Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-28-2012, 05:27 PM
Fer912 Fer912 is offline
Approved Member
 
Join Date: Sep 2011
Location: San clemente del tuyu Argentina
Posts: 12
Default teacher looking for?

good morning again to see if someone can lend a hand, I created a mission style coop, which still could not test and so the code is not okay.
My intention is to bring together in an array all the local pilots and remote mission, I wonder if there is any advice on what is written or modified to improve it or fix it thanks

Code:
using System;
using System.Collections.Generic;
using maddox.core;
using maddox.game;
using maddox.game.world;
using maddox.GP;



public class Mission : AMission
{

    bool _WonSup = true;    // wonSup se da con el 75% de los pilotos vivos, cada avion volable vale 12.5
    bool _WonEsc = true;    // wonEsc se da con el +50% de los aviones de ataques vivos
    bool _WonATK = false;   // wonATK se da con +60% de los blancos asignados destruidos
    int indice = 0;

    private class piloto
    {
        string _nombre;
        string _estado;
        int _valor;

        public string Nombre
        {
            set { this._nombre = value; }
            get { return this._nombre; }
        }

        public string Estado
        {
            get { return this._estado; }
            set { this._estado = value; }
        }

        public int Valor
        {
            set { this._valor = value; }
            get { return this._valor; }
        }
    };

    piloto[] p = new piloto[8];

    public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);

        if ("WonEsc".Equals(shortName) && active)
        {
            _WonEsc = false;
            GamePlay.gpGetTrigger("WonEsc").Enable = false;
            GamePlay.gpHUDLogCenter("WonEsc Fallido");
        }

        if ("WonAtk".Equals(shortName) && active)
        {
            _WonATK = true;
            GamePlay.gpGetTrigger("WonAtk").Enable = false;
            GamePlay.gpHUDLogCenter("WonAtk Cumplido");
        }
    }


    public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorCreated(missionNumber, shortName, actor);

        if (actor is AiAircraft)
        {
            for (int i = 0; i < (actor as AiAircraft).Places(); i++ )
            {
                if ((actor as AiAircraft).Player(i) != null)
                {
                    p[indice].Nombre = (actor as AiAircraft).Player(i).Name();
                    p[indice].Estado = "Vivo";
                    p[indice].Valor = 0;    //por ahora no lo uso, va a ser implementado en otros para los defectos del avion segun las tirada de dados de rol
                    indice++;
                }
            }
        }
    }

    
    public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
    {
        base.OnActorDead(missionNumber, shortName, actor, damages);

        if (actor is AiAircraft)
        {
            GamePlay.gpLogServer(null, " Paso 1 Ok ", null);

            for (int i = 0; i < (actor as AiAircraft).Places(); i++)
            {
                GamePlay.gpLogServer(null, "Primer For i={0}", new object[] { i });
                GamePlay.gpLogServer(null, " Paso 2 Ok ", null);
                //  if ((actor as AiAircraft).Player(i) != null)
                //{
                for (int j = 0; j < indice; j++)
                {
                    GamePlay.gpLogServer(null, " Buscando al Piloto Ok ", null);
                    if (p[j].Nombre.Equals((actor as AiAircraft).Player(i).Name()))
                    {
                        p[j].Estado = "Muerto";

                        GamePlay.gpLogServer(null, "piloto {0} ha muerto JAJAJ", new object[] { p[j].Nombre });
                    }

                }
                //}
            }
        }
    }
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.