2022-10-15 18:39:27 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Programmation_objet_TLESIO21.projet {
|
|
|
|
|
public abstract class Pokemon {
|
|
|
|
|
private readonly string Name;
|
|
|
|
|
private Type Type;
|
|
|
|
|
private Nature Nature;
|
|
|
|
|
private int PV;
|
|
|
|
|
private int PC;
|
|
|
|
|
private int ATKPhys;
|
|
|
|
|
private int ATKSpe;
|
|
|
|
|
private int DEFPhys;
|
|
|
|
|
private int DEFSpe;
|
|
|
|
|
private int Speed;
|
|
|
|
|
|
|
|
|
|
public Pokemon(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) {
|
|
|
|
|
this.Name = Name;
|
|
|
|
|
this.PV = PV;
|
|
|
|
|
this.ATKPhys = ATKPhys;
|
|
|
|
|
this.ATKSpe = ATKSpe;
|
|
|
|
|
this.DEFPhys = DEFPhys;
|
|
|
|
|
this.DEFSpe = DEFSpe;
|
|
|
|
|
this.Speed = Speed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void PhysAttack(Pokemon cible) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void SpeAttack(Pokemon cible) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getDamage(int d) {
|
|
|
|
|
this.PV -= d;
|
|
|
|
|
Console.WriteLine(this.getName() + " a subbi " + d + " dégats");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Boolean hasEnoughtPC() {
|
|
|
|
|
return (this.getPC() > 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Boolean isAlive() {
|
|
|
|
|
return (this.getPV() > 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getStats() {
|
2022-10-16 11:14:06 +02:00
|
|
|
|
return this.getName() + " - Type = " + getType() +
|
|
|
|
|
" - PV = " + getPV() +
|
2022-10-15 18:39:27 +02:00
|
|
|
|
" - PC = " + getPC() +
|
|
|
|
|
" - ATK Physique = " + getATKPhys() +
|
|
|
|
|
" - ATK Spéciale = " + getATKSpe() +
|
|
|
|
|
" - DEF Physique = " + getDEFPhys() +
|
|
|
|
|
" - DEF Spéciale = " + getDEFSpe() +
|
|
|
|
|
" - Vitesse = " + getSpeed() ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() {
|
|
|
|
|
return this.Name + " - PV : " + this.PV + " - PC : " + this.PC;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-13 22:03:05 +02:00
|
|
|
|
public void SetNature(Nature n) {
|
|
|
|
|
this.Nature = n;
|
2022-10-15 18:39:27 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setPV(int pv) {
|
|
|
|
|
this.PV = pv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void setPC(int pc) {
|
|
|
|
|
this.PC = pc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void setType(Type t) {
|
|
|
|
|
this.Type = t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setATKPhys(int atk) {
|
|
|
|
|
this.ATKPhys = atk;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setATKSpe(int atk) {
|
|
|
|
|
this.ATKSpe = atk;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDefPhys(int def) {
|
|
|
|
|
this.DEFPhys = def;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDefSpe(int def) {
|
|
|
|
|
this.DEFSpe = def;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setSpeed(int speed) {
|
|
|
|
|
this.Speed = speed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
return this.Name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Type getType() {
|
|
|
|
|
return this.Type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Nature GetNature() {
|
|
|
|
|
return this.Nature;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getPV() {
|
|
|
|
|
return this.PV;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getPC() {
|
|
|
|
|
return this.PC;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getATKPhys() {
|
|
|
|
|
return this.ATKPhys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getATKSpe() {
|
|
|
|
|
return this.ATKSpe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getDEFPhys() {
|
|
|
|
|
return this.DEFPhys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getDEFSpe() {
|
|
|
|
|
return this.DEFSpe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getSpeed() {
|
|
|
|
|
return this.Speed;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|