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

54 lines
1.8 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 PokemonPsychic: Pokemon {
public PokemonPsychic(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
base.setPC(80);
this.setType(Type.PSYCHIC);
}
public override void PhysAttack(Pokemon cible) {
this.setPC(this.getPC() - 1);
int damage = cible.getDEFPhys() - this.getATKPhys();
if(cible.getType().Equals(Type.DARK)) {
damage = 0;
}
if(damage > 0) {
if(cible.getType().Equals(Type.STEEL) ||
cible.getType().Equals(Type.PSYCHIC)) {
damage /= 2;
}
if(cible.getType().Equals(Type.FIGHTING) ||
cible.getType().Equals(Type.POISON)) {
damage *= 2;
}
cible.getDamage(damage);
}
}
public override void SpeAttack(Pokemon cible) {
this.setPC(this.getPC() - 3);
int damage = cible.getDEFSpe() - this.getATKSpe();
if (cible.getType().Equals(Type.DARK)) {
damage = 0;
}
if (damage > 0) {
if (cible.getType().Equals(Type.STEEL) ||
cible.getType().Equals(Type.PSYCHIC)) {
damage /= 2;
}
if (cible.getType().Equals(Type.FIGHTING) ||
cible.getType().Equals(Type.POISON)) {
damage *= 2;
}
cible.getDamage(damage);
}
}
}
}