using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Programmation_objet_TLESIO21.projet { public class PokemonFighting : Pokemon { public PokemonFighting(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) { base.setPC(102); this.setType(Type.FIGHTING); } public override void PhysAttack(Pokemon cible) { this.setPC(this.getPC() - 4); int damage = cible.getDEFPhys() - this.getATKPhys(); if(cible.getType().Equals(Type.GHOST)) { damage = 0; } if(damage > 0) { if(cible.getType().Equals(Type.PSYCHIC) || cible.getType().Equals(Type.FLYING) || cible.getType().Equals(Type.BUG) || cible.getType().Equals(Type.FAIRY)) { damage /= 2; } if(cible.getType().Equals(Type.STEEL) || cible.getType().Equals(Type.NORMAL) || cible.getType().Equals(Type.DARK) || cible.getType().Equals(Type.ICE) || cible.getType().Equals(Type.ROCK)) { damage *= 2; } cible.getDamage(damage); } } public override void SpeAttack(Pokemon cible) { this.setPC(this.getPC() - 1); int damage = cible.getDEFSpe() - this.getATKSpe(); if (cible.getType().Equals(Type.GHOST)) { damage = 0; } if (damage > 0) { if (cible.getType().Equals(Type.PSYCHIC) || cible.getType().Equals(Type.FLYING) || cible.getType().Equals(Type.BUG) || cible.getType().Equals(Type.FAIRY)) { damage /= 2; } if (cible.getType().Equals(Type.STEEL) || cible.getType().Equals(Type.NORMAL) || cible.getType().Equals(Type.DARK) || cible.getType().Equals(Type.ICE) || cible.getType().Equals(Type.ROCK)) { damage *= 2; } cible.getDamage(damage); } } } }