55 lines
2.1 KiB
C#
Raw Normal View History

2022-10-13 13:53:26 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Programmation_objet_TLESIO21.projet {
public class PokemonFire : Pokemon {
public PokemonFire(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
base.setPC(100);
this.setType(Type.FIRE);
}
public override void PhysAttack(Pokemon cible) {
this.setPC(this.getPC() - 2);
int damage = cible.getDEFPhys() - this.getATKPhys();
if(damage > 0) {
if(cible.getType().Equals(Type.DRAGON) ||
cible.getType().Equals(Type.WATER) ||
cible.getType().Equals(Type.FIRE) ||
cible.getType().Equals(Type.ROCK)) {
damage /= 2;
}
if(cible.getType().Equals(Type.GRASS) ||
cible.getType().Equals(Type.BUG) ||
cible.getType().Equals(Type.ICE) ||
cible.getType().Equals(Type.STEEL)) {
damage *= 2;
}
cible.getDamage(damage);
}
}
public override void SpeAttack(Pokemon cible) {
this.setPC(this.getPC() - 2);
int damage = cible.getDEFSpe() - this.getATKSpe();
if(damage > 0) {
if(cible.getType().Equals(Type.DRAGON) ||
cible.getType().Equals(Type.WATER) ||
cible.getType().Equals(Type.FIRE) ||
cible.getType().Equals(Type.ROCK)) {
damage /= 2;
}
if(cible.getType().Equals(Type.GRASS) ||
cible.getType().Equals(Type.BUG) ||
cible.getType().Equals(Type.ICE) ||
cible.getType().Equals(Type.STEEL)) {
damage *= 2;
}
cible.getDamage(damage);
}
}
}
}