public Caracteristique(Caracteristique c)
 {
     PV      = c.PV;
     Attaque = c.Attaque;
     Defense = c.Defense;
     Vitesse = c.Vitesse;
     Esquive = c.Esquive;
 }
Esempio n. 2
0
 private void BuffNerfPokemonByStade(ETypeElement type, Caracteristique carac, Stade stade)
 {
     if (type == stade.Type)
     {
         carac.Attaque += stade.Attaque;
         carac.Defense += stade.Defense;
     }
     else if (GetMultiplicatorBetweenType(type, stade.Type) == 0.5m)
     {
         carac.Attaque -= stade.Attaque;
         carac.Defense -= stade.Defense;
     }
 }
Esempio n. 3
0
        private Match RunMatch(Pokemon pokemon1, Pokemon pokemon2, EPhaseTournoi phase)
        {
            Caracteristique newCaracP1 = new Caracteristique(pokemon1.Caracteristiques);
            Caracteristique newCaracP2 = new Caracteristique(pokemon2.Caracteristiques);

            Match match = new Match(this, phase, pokemon1, pokemon2);

            match.Stade = Stades[rng.Next(0, Stades.Count)];

            BuffNerfPokemonByStade(pokemon1.Type, newCaracP1, match.Stade);
            BuffNerfPokemonByStade(pokemon2.Type, newCaracP2, match.Stade);

            decimal multiplicatorP1 = GetMultiplicatorBetweenType(pokemon1.Type, pokemon2.Type);
            decimal multiplicatorP2 = GetMultiplicatorBetweenType(pokemon2.Type, pokemon1.Type);

            while (newCaracP1.PV > 0 && newCaracP2.PV > 0)
            {
                int i = (int)Math.Ceiling(multiplicatorP1 * (decimal)newCaracP1.Attaque / (decimal)newCaracP2.Defense * 4m);
                int y = (int)Math.Ceiling(multiplicatorP2 * (decimal)newCaracP2.Attaque / (decimal)newCaracP1.Defense * 4m);
                if (!EsquiveOrNot(pokemon2))
                {
                    newCaracP2.PV -= (int)Math.Ceiling(multiplicatorP1 * (decimal)newCaracP1.Attaque / (decimal)newCaracP2.Defense * 4m);
                }
                if (!EsquiveOrNot(pokemon1))
                {
                    newCaracP1.PV -= (int)Math.Ceiling(multiplicatorP2 * (decimal)newCaracP2.Attaque / (decimal)newCaracP1.Defense * 4m);
                }
            }

            if (newCaracP1.PV <= 0 && newCaracP2.PV <= 0)
            {
                match.IdPokemonVainqueur = pokemon1.ID;
            }
            else if (newCaracP1.PV <= 0)
            {
                match.IdPokemonVainqueur = pokemon2.ID;
            }
            else
            {
                match.IdPokemonVainqueur = pokemon1.ID;
            }

            return(match);
        }
Esempio n. 4
0
 public Pokemon(int id) : base(id)
 {
     Caracteristiques = new Caracteristique();
 }
Esempio n. 5
0
 public Pokemon()
 {
     Caracteristiques = new Caracteristique();
 }