54 lines
1.9 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 {
2022-10-13 22:03:05 +02:00
public class PokemonSteel : Pokemon {
public PokemonSteel(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
base.setPC(105);
this.setType(Type.STEEL);
2022-10-13 13:53:26 +02:00
}
2022-10-13 22:03:05 +02:00
2022-10-13 13:53:26 +02:00
public override void PhysAttack(Pokemon cible) {
2022-10-13 22:03:05 +02:00
this.setPC(this.getPC() - 3);
2022-10-13 13:53:26 +02:00
int damage = cible.getDEFPhys() - this.getATKPhys();
if(damage > 0) {
2022-10-13 22:03:05 +02:00
if(cible.getType().Equals(Type.STEEL) ||
2022-10-13 13:53:26 +02:00
cible.getType().Equals(Type.WATER) ||
cible.getType().Equals(Type.FIRE) ||
2022-10-13 22:03:05 +02:00
cible.getType().Equals(Type.ELECTRIC)) {
2022-10-13 13:53:26 +02:00
damage /= 2;
}
2022-10-13 22:03:05 +02:00
if(cible.getType().Equals(Type.FAIRY) ||
2022-10-13 13:53:26 +02:00
cible.getType().Equals(Type.ICE) ||
2022-10-13 22:03:05 +02:00
cible.getType().Equals(Type.ROCK)) {
2022-10-13 13:53:26 +02:00
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) {
2022-10-13 22:03:05 +02:00
if (cible.getType().Equals(Type.STEEL) ||
2022-10-13 13:53:26 +02:00
cible.getType().Equals(Type.WATER) ||
cible.getType().Equals(Type.FIRE) ||
2022-10-13 22:03:05 +02:00
cible.getType().Equals(Type.ELECTRIC)) {
2022-10-13 13:53:26 +02:00
damage /= 2;
}
2022-10-13 22:03:05 +02:00
if (cible.getType().Equals(Type.FAIRY) ||
2022-10-13 13:53:26 +02:00
cible.getType().Equals(Type.ICE) ||
2022-10-13 22:03:05 +02:00
cible.getType().Equals(Type.ROCK)) {
2022-10-13 13:53:26 +02:00
damage *= 2;
}
cible.getDamage(damage);
}
}
}
}