methode atk total opk
This commit is contained in:
parent
f6fd8f6830
commit
020c6d0128
@ -40,7 +40,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if(damage > 0) {
|
||||
if (cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.FIGHTING) ||
|
||||
|
@ -1,57 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonDark : Pokemon {
|
||||
|
||||
public PokemonDark(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(95);
|
||||
this.setType(Type.DARK);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonDark : Pokemon {
|
||||
|
||||
public PokemonDark(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(95);
|
||||
this.setType(Type.DARK);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 4);
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.FIGHTING) ||
|
||||
cible.getType().Equals(Type.FAIRY) ||
|
||||
cible.getType().Equals(Type.DARK)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.PSYCHIC) ||
|
||||
cible.getType().Equals(Type.GHOST)) {
|
||||
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 = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
if (cible.getType().Equals(Type.FIGHTING) ||
|
||||
cible.getType().Equals(Type.FAIRY) ||
|
||||
cible.getType().Equals(Type.DARK)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.PSYCHIC) ||
|
||||
cible.getType().Equals(Type.GHOST)) {
|
||||
damage *= 2;
|
||||
Console.WriteLine("C'est super efficace");
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
} else {
|
||||
Console.WriteLine("L'attaque n'a eu aucun effet");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.FIGHTING) ||
|
||||
cible.getType().Equals(Type.FAIRY) ||
|
||||
cible.getType().Equals(Type.DARK)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.PSYCHIC) ||
|
||||
cible.getType().Equals(Type.GHOST)) {
|
||||
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.FIGHTING) ||
|
||||
cible.getType().Equals(Type.FAIRY) ||
|
||||
cible.getType().Equals(Type.DARK)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.PSYCHIC) ||
|
||||
cible.getType().Equals(Type.GHOST)) {
|
||||
damage *= 2;
|
||||
Console.WriteLine("C'est super efficace");
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
} else {
|
||||
Console.WriteLine("L'attaque n'a eu aucun effet");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,59 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonDragon : Pokemon {
|
||||
|
||||
public PokemonDragon(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(125);
|
||||
this.setType(Type.DRAGON);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonDragon : Pokemon {
|
||||
|
||||
public PokemonDragon(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(125);
|
||||
this.setType(Type.DRAGON);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.FAIRY)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.DRAGON)) {
|
||||
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() - 1);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if (cible.getType().Equals(Type.FAIRY)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
if (damage > 0) {
|
||||
if (cible.getType().Equals(Type.STEEL)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.DRAGON)) {
|
||||
damage *= 2;
|
||||
Console.WriteLine("C'est super efficace");
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
} else {
|
||||
Console.WriteLine("L'attaque n'a eu aucun effet");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.FAIRY)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.DRAGON)) {
|
||||
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() - 1);
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.FAIRY)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
if (damage > 0) {
|
||||
if (cible.getType().Equals(Type.STEEL)) {
|
||||
damage /= 2;
|
||||
Console.WriteLine("Ce n'est pas très efficace");
|
||||
}
|
||||
if (cible.getType().Equals(Type.DRAGON)) {
|
||||
damage *= 2;
|
||||
Console.WriteLine("C'est super efficace");
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
} else {
|
||||
Console.WriteLine("L'attaque n'a eu aucun effet");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(cible.getType().Equals(Type.GROUND)) {
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.GROUND)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 4);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (damage > 0) {
|
||||
if (cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.POISON)) {
|
||||
|
@ -43,7 +43,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.GHOST)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
|
@ -37,8 +37,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
|
@ -37,8 +37,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (damage > 0) {
|
||||
if (cible.getType().Equals(Type.ROCK) ||
|
||||
cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.ELECTRIC)) {
|
||||
|
@ -37,7 +37,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.NORMAL)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
|
@ -39,8 +39,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
|
@ -41,8 +41,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 4);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(cible.getType().Equals(Type.FLYING)) {
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.FLYING)) {
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
damage = 0;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (damage > 0) {
|
||||
if (cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
|
@ -32,8 +32,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(cible.getType().Equals(Type.GHOST)) {
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.GHOST)) {
|
||||
damage = 0;
|
||||
}
|
||||
if(damage > 0) {
|
||||
|
@ -40,7 +40,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.STEEL)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
|
@ -38,7 +38,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (cible.getType().Equals(Type.DARK)) {
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
damage = 0;
|
||||
|
@ -35,9 +35,9 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.FIGHTING) ||
|
||||
cible.getType().Equals(Type.GROUND)) {
|
||||
|
@ -36,9 +36,9 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = this.getATKSpe() - cible.getDEFSpe();
|
||||
if (damage > 0) {
|
||||
if (cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
|
@ -34,9 +34,9 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user