2022-10-13 22:03:05 +02:00

58 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Programmation_objet_TLESIO21.projet {
public class PokemonPoison : Pokemon {
public PokemonPoison(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
base.setPC(110);
this.setType(Type.POISON);
}
public override void PhysAttack(Pokemon cible) {
this.setPC(this.getPC() - 2);
int damage = cible.getDEFPhys() - this.getATKPhys();
if(cible.getType().Equals(Type.STEEL)) {
damage = 0;
}
if(damage > 0) {
if(cible.getType().Equals(Type.POISON) ||
cible.getType().Equals(Type.ROCK) ||
cible.getType().Equals(Type.GROUND) ||
cible.getType().Equals(Type.GHOST)) {
damage /= 2;
}
if(cible.getType().Equals(Type.FAIRY) ||
cible.getType().Equals(Type.GRASS)) {
damage *= 2;
}
cible.getDamage(damage);
}
}
public override void SpeAttack(Pokemon cible) {
this.setPC(this.getPC() - 2);
int damage = cible.getDEFSpe() - this.getATKSpe();
if (cible.getType().Equals(Type.STEEL)) {
damage = 0;
}
if (damage > 0) {
if (cible.getType().Equals(Type.POISON) ||
cible.getType().Equals(Type.ROCK) ||
cible.getType().Equals(Type.GROUND) ||
cible.getType().Equals(Type.GHOST)) {
damage /= 2;
}
if (cible.getType().Equals(Type.FAIRY) ||
cible.getType().Equals(Type.GRASS)) {
damage *= 2;
}
cible.getDamage(damage);
}
}
}
}