Beispiel #1
0
 public void AddUnite(e_classe c_, e_typeUnite typeUnite_, Pouvoir SHORYUKEN_, Aura aura_, string nom_, int force_, int dexterite_, int constitution_,
     int defense_, int esprit_, int chance_, int vitesse_, int[] portee_, bool[] typedAttaque_, int numeroArmee_,
     int numeroImage_, int mouvement_, int ia_)
 {
     bataillon.Add(new Unite(c_, typeUnite_, SHORYUKEN_, aura_, nom_, force_, dexterite_, constitution_, defense_,
     esprit_, chance_, vitesse_, portee_, typedAttaque_, effectif, numeroArmee_, mouvement_, ia_));
     effectif++;
     atLeastOneAlive = true;
     if (typeUnite_ == e_typeUnite.Heros)
     {
         atLeastOneHeroAlive = true;
     }
 }
Beispiel #2
0
        public Unite(e_classe c_,e_typeUnite typeUnite_, Pouvoir SHORYUKEN_, Aura aura_,
            string nom_, int force_, int dexterite_, int constitution_, int defense_,
            int esprit_, int chance_, int vitesse_, int[] portee_, bool[] typedAttaque_, int numeroUnite_,
            int numeroArmee_, int mouvement_, int ia_ = 0, e_typeDePartie etat_ = e_typeDePartie.Joute)
        {
            metier = c_;
            debug = 0;
            nom = nom_;
            typeUnite = typeUnite_;
            SHORYUKEN = SHORYUKEN_;
            aura = aura_;
            profiteDuneAura = false;

            #region Carac
            force = force_;
            dexterite = dexterite_;
            constitution = constitution_;
            defense = defense_;
            esprit = esprit_;
            chance = chance_;
            vitesse = vitesse_;

            lvl = 1;
            xp = 0;

            mouvement = mouvement_;
            mouvementmax = mouvement_;
            CaracFromStats();

            portee = portee_;
            typedAttaque = typedAttaque_;
            points = 6 * defense + 5 * dexterite + 5 * chance + 3 * vitesse + 6 * constitution;
            bool attaP = false;
            bool attaM = false;
            float moy = 0;
            for (int po = 0; po < portee.Length; po++)
            {
                attaP = attaP || typedAttaque[po];
                attaM = attaM || (!typedAttaque[po] && portee[po] != 0);
                moy += portee[po];
            }
            moy /= 20f;
            if (attaM)
            {
                points += (int)(esprit * 7 * moy);
            }
            else
            {
                points += esprit * 3;
            }
            if (typeUnite == e_typeUnite.Elite)
            {
                points += 2 * esprit;
            }
            if (attaP)
            {
                points += (int)(force * 7 * moy);
            }
            else
            {
                points += force * 3;
            }
            points = (points * mouvementmax) / 80;
            #endregion

            mouvOrNot = true;
            attaqOrNot = true;

            numeroArmee = numeroArmee_;
            numeroUnite = numeroUnite_;

            i = 5 + numeroUnite;
            ivirtuel = i;
            j = 6 + numeroArmee;
            jvirtuel = j;

            r = new Random();

            alive = true;

            sousrect = new Rectangle(0, 0, 128, 128);
            Anim = 0;
            vitesseAnim = 0.025f;
            state = e_EtatAnim.repos1;
            jDepart = 0;
            iDepart = 0;
            estPasseParLa = new bool[32, 32];
            fileDeMouvements = new List<mouv>();
            nombreDeRotations = 0;

            een = true;

            image = c_.ToString();

            IA = new IntelligenceArtificielle(ia_, this);
            //Console.WriteLine(nom + " : " + points);

            porteTresor = false;
            estInvisible = false;
        }
Beispiel #3
0
 public void AddUnite(int armee_, e_classe c_, e_typeUnite typeUnite_, Pouvoir SHORYUKEN_, Aura aura_, string nom_, int force_, int dexterite_, int constitution_, int defense_,
     int esprit_, int chance_, int vitesse_, int[] portee_, bool[] typedAttaque_, int numeroImage, int mouvement, int ia_)
 {
     listeDesJoueurs[armee_].AddUnite(c_, typeUnite_, SHORYUKEN_, aura_, nom_, force_, dexterite_, constitution_, defense_,
     esprit_, chance_, vitesse_, portee_, typedAttaque_, armee_, numeroImage, mouvement, ia_);
 }