Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
f87dd9f732 | |||
020c6d0128 | |||
f6fd8f6830 |
2
ClassDiagram1.cd
Normal file
2
ClassDiagram1.cd
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram />
|
@ -5,6 +5,6 @@ public class Program {
|
||||
GameManager gm = new GameManager();
|
||||
gm.InitializeGame();
|
||||
|
||||
Console.WriteLine("");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
String sb = this.Name + " est level " + this.level + "." + " " + this.Description + ". Ses pokemon sont :\n";
|
||||
String sb = this.Name + " est level " + this.level + ". " + this.Description.Replace(". ", ".\n") + ".\nSes pokemon sont :\n";
|
||||
foreach (Pokemon p in this.PC) {
|
||||
sb += p.getName() + ". ";
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
this.p1CharacterChoosen = 0;
|
||||
this.p2CharacterChoosen = 0;
|
||||
this.Path = "../../../csv/";
|
||||
//this.Path = "./";
|
||||
}
|
||||
|
||||
private static bool StringIsValidInt(String s) {
|
||||
@ -123,6 +124,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("\n====================================================================================\n");
|
||||
|
||||
this.InitializePokemons();
|
||||
this.ChooseTeams();
|
||||
this.Combat();
|
||||
@ -159,11 +162,10 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
p2CharacterChoosen = 8;
|
||||
}
|
||||
|
||||
Console.WriteLine("Vous avez choisi de faire confiance à " + Characters[p1CharacterChoosen].getName() + ".");
|
||||
Console.WriteLine("Votre adversaire a choisis de faire confiance à " + Characters[p2CharacterChoosen].getName() + ".");
|
||||
Console.WriteLine("Vous avez choisi de faire confiance à " + Characters[p1CharacterChoosen].getName() + ".\n");
|
||||
Console.WriteLine("Votre adversaire a choisis de faire confiance à " + Characters[p2CharacterChoosen].getName() + ".\n");
|
||||
|
||||
Console.WriteLine("Maintenant, vous allez devoir choisir 6 pokémons parmis ceux de " + Characters[p1CharacterChoosen].getName() + "\n" +
|
||||
"Il vous suffit de rentrer le numéro précédant le nom du pokémon.\n");
|
||||
Console.WriteLine("Maintenant, vous allez devoir choisir 6 pokémons parmis ceux de " + Characters[p1CharacterChoosen].getName() + "\n");
|
||||
|
||||
|
||||
i = 0;
|
||||
@ -220,6 +222,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
displayCurrentPlayerTurn(p1);
|
||||
Console.WriteLine("Pokemon adverse : " + p2.getCurrentPokemon() + " - Type : " + p2.getCurrentPokemon().getType());
|
||||
entreeStandard = Console.ReadLine();
|
||||
Console.WriteLine(" ");
|
||||
switch (entreeStandard) {
|
||||
case "1":
|
||||
Console.WriteLine(p1.getNom() + " décide que " + p1.getCurrentPokemon().getName() + " doit attaquer en physique.");
|
||||
@ -262,7 +265,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
displayTeamChange(p2);
|
||||
p2Choice = getRandom(6);
|
||||
if (p2.getTeam()[p2Choice].isAlive()) {
|
||||
Console.Write("Reviens " + p2.getCurrentPokemon());
|
||||
Console.WriteLine("Reviens " + p2.getCurrentPokemon());
|
||||
p2.setCurrentPokemonIndex(p2Choice);
|
||||
correctSwitchChoice = true;
|
||||
Console.WriteLine("À toi " + p2.getCurrentPokemon());
|
||||
@ -270,7 +273,34 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!p1.getCurrentPokemon().isAlive()) {
|
||||
bool correctSwitchChoice = false;
|
||||
if (p1.canStillFight()) {
|
||||
isFighting = false;
|
||||
Console.WriteLine("La partie est terminée. " + p2.getNom() + " a gagné !");
|
||||
correctSwitchChoice = true;
|
||||
} else {
|
||||
while (!correctSwitchChoice) {
|
||||
Console.WriteLine(p1.getNom() + ", votre pokémon " + p1.getCurrentPokemon().getName() + " n'est plus capable de se battre. Vous devez changer de Pokémon !");
|
||||
displayTeamChange(p1);
|
||||
entreeStandard = Console.ReadLine();
|
||||
entreeStandard = entreeStandard.Substring(0, 1);
|
||||
if (StringIsValidIntFight(entreeStandard) && p1.getTeam()[int.Parse(entreeStandard) - 1].isAlive()) {
|
||||
Console.WriteLine("Reviens " + p1.getCurrentPokemon());
|
||||
p1.setCurrentPokemonIndex(int.Parse(entreeStandard) - 1);
|
||||
correctSwitchChoice = true;
|
||||
Console.WriteLine("À toi " + p1.getCurrentPokemon());
|
||||
|
||||
} else {
|
||||
Console.WriteLine("Vous ne pouvez pas switch avec ce pokémon. Merci d'entrer une valeur correcte.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!p2.getCurrentPokemon().isAlive()) {
|
||||
currentTurnisValid = false;
|
||||
}
|
||||
while (!currentTurnisValid) {
|
||||
p2Choice = getRandom(3);
|
||||
switch (p2Choice) {
|
||||
@ -297,6 +327,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("\n");
|
||||
currentTurnisValid = false;
|
||||
|
||||
if (!p1.getCurrentPokemon().isAlive()) {
|
||||
@ -312,7 +343,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
entreeStandard = Console.ReadLine();
|
||||
entreeStandard = entreeStandard.Substring(0, 1);
|
||||
if (StringIsValidIntFight(entreeStandard) && p1.getTeam()[int.Parse(entreeStandard)-1].isAlive()) {
|
||||
Console.Write("Reviens " + p1.getCurrentPokemon());
|
||||
Console.WriteLine("Reviens " + p1.getCurrentPokemon());
|
||||
p1.setCurrentPokemonIndex(int.Parse(entreeStandard)-1);
|
||||
correctSwitchChoice = true;
|
||||
Console.WriteLine("À toi " + p1.getCurrentPokemon());
|
||||
@ -323,6 +354,26 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!p2.getCurrentPokemon().isAlive()) {
|
||||
bool correctSwitchChoice = false;
|
||||
if (p2.canStillFight()) {
|
||||
isFighting = false;
|
||||
Console.WriteLine("La partie est terminée. " + p1.getNom() + " a gagné !");
|
||||
correctSwitchChoice = true;
|
||||
} else {
|
||||
while (!correctSwitchChoice) {
|
||||
Console.WriteLine(p2.getNom() + ", votre pokémon " + p2.getCurrentPokemon().getName() + " n'est plus capable de se battre. Vous devez changer de Pokémon !");
|
||||
displayTeamChange(p2);
|
||||
p2Choice = getRandom(6);
|
||||
if (p2.getTeam()[p2Choice].isAlive()) {
|
||||
Console.WriteLine("Reviens " + p2.getCurrentPokemon());
|
||||
p2.setCurrentPokemonIndex(p2Choice);
|
||||
correctSwitchChoice = true;
|
||||
Console.WriteLine("À toi " + p2.getCurrentPokemon());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
}
|
||||
|
||||
public String getStats() {
|
||||
return this.getName() + " - PV : " + getPV() +
|
||||
return this.getName() + " - Type = " + getType() +
|
||||
" - PV = " + getPV() +
|
||||
" - PC = " + getPC() +
|
||||
" - ATK Physique = " + getATKPhys() +
|
||||
" - ATK Spéciale = " + getATKSpe() +
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.FIGHTING) ||
|
||||
cible.getType().Equals(Type.FAIRY) ||
|
||||
@ -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) ||
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 4);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
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)) {
|
||||
@ -35,8 +35,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.FIGHTING) ||
|
||||
cible.getType().Equals(Type.FAIRY) ||
|
||||
cible.getType().Equals(Type.DARK)) {
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.FAIRY)) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.FAIRY)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
@ -36,7 +36,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.FAIRY)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
|
@ -14,7 +14,7 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if(cible.getType().Equals(Type.GROUND)) {
|
||||
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() - 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");
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.POISON)) {
|
||||
@ -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)) {
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 4);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.GHOST)) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.GHOST)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
@ -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");
|
||||
|
@ -13,8 +13,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
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.DRAGON) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
|
@ -14,8 +14,9 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 4);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.ROCK) ||
|
||||
cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.ELECTRIC)) {
|
||||
@ -36,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)) {
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.NORMAL)) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.NORMAL)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
@ -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");
|
||||
|
@ -13,8 +13,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
@ -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) ||
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.FLYING)) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.FLYING)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
@ -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) ||
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.GHOST)) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.GHOST)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
@ -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) {
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.STEEL)) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.STEEL)) {
|
||||
damage = 0;
|
||||
Console.WriteLine("Ca n'affecte pas le " + cible.getName() + "ennemi");
|
||||
}
|
||||
@ -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");
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.DARK)) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (cible.getType().Equals(Type.DARK)) {
|
||||
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;
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 4);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.FIGHTING) ||
|
||||
cible.getType().Equals(Type.GROUND)) {
|
||||
@ -36,8 +36,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.STEEL) ||
|
||||
cible.getType().Equals(Type.FIGHTING) ||
|
||||
cible.getType().Equals(Type.GROUND)) {
|
||||
|
@ -14,8 +14,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
int damage = this.getATKPhys() - cible.getDEFPhys();
|
||||
if (damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
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.STEEL) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
|
@ -13,8 +13,8 @@ namespace Programmation_objet_TLESIO21.projet {
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
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)) {
|
||||
@ -35,8 +35,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.GRASS)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user