59 lines
2.3 KiB
C#
59 lines
2.3 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 PokemonWater : Pokemon {
|
|
public PokemonWater(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
|
base.setPC(90);
|
|
this.setType(Type.WATER);
|
|
}
|
|
|
|
public override void PhysAttack(Pokemon cible) {
|
|
this.setPC(this.getPC() - 3);
|
|
int damage = this.getATKPhys() - cible.getDEFPhys();
|
|
if (damage > 0) {
|
|
if(cible.getType().Equals(Type.DRAGON) ||
|
|
cible.getType().Equals(Type.WATER) ||
|
|
cible.getType().Equals(Type.GRASS)) {
|
|
damage /= 2;
|
|
Console.WriteLine("Ce n'est pas très efficace");
|
|
}
|
|
if (cible.getType().Equals(Type.FIRE) ||
|
|
cible.getType().Equals(Type.ROCK) ||
|
|
cible.getType().Equals(Type.GROUND)) {
|
|
damage *= 2;
|
|
Console.WriteLine("C'est super efficace");
|
|
}
|
|
cible.getDamage(damage);
|
|
} else {
|
|
Console.WriteLine("L'attaque n'a eu aucun effet");
|
|
}
|
|
}
|
|
|
|
public override void SpeAttack(Pokemon cible) {
|
|
this.setPC(this.getPC() - 2);
|
|
int damage = this.getATKSpe() - cible.getDEFSpe();
|
|
if (damage > 0) {
|
|
if(cible.getType().Equals(Type.DRAGON) ||
|
|
cible.getType().Equals(Type.WATER) ||
|
|
cible.getType().Equals(Type.GRASS)) {
|
|
damage /= 2;
|
|
Console.WriteLine("Ce n'est pas très efficace");
|
|
}
|
|
if (cible.getType().Equals(Type.FIRE) ||
|
|
cible.getType().Equals(Type.ROCK) ||
|
|
cible.getType().Equals(Type.GROUND)) {
|
|
damage *= 2;
|
|
Console.WriteLine("C'est super efficace");
|
|
}
|
|
cible.getDamage(damage);
|
|
} else {
|
|
Console.WriteLine("L'attaque n'a eu aucun effet");
|
|
}
|
|
}
|
|
}
|
|
}
|