From 020c6d0128c128f611fda98b5323a2de7bda4d2f Mon Sep 17 00:00:00 2001 From: OMGiTzPomPom Date: Sun, 16 Oct 2022 11:16:53 +0200 Subject: [PATCH] methode atk total opk --- projet/Types/PokemonBug.cs | 2 +- projet/Types/PokemonDark.cs | 112 +++++++++++++++--------------- projet/Types/PokemonDragon.cs | 116 ++++++++++++++++---------------- projet/Types/PokemonElectric.cs | 4 +- projet/Types/PokemonFairy.cs | 4 +- projet/Types/PokemonFighting.cs | 2 +- projet/Types/PokemonFire.cs | 4 +- projet/Types/PokemonFlying.cs | 4 +- projet/Types/PokemonGhost.cs | 2 +- projet/Types/PokemonGrass.cs | 4 +- projet/Types/PokemonGround.cs | 4 +- projet/Types/PokemonIce.cs | 2 +- projet/Types/PokemonNormal.cs | 4 +- projet/Types/PokemonPoison.cs | 2 +- projet/Types/PokemonPsychic.cs | 2 +- projet/Types/PokemonRock.cs | 6 +- projet/Types/PokemonSteel.cs | 6 +- projet/Types/PokemonWater.cs | 6 +- 18 files changed, 143 insertions(+), 143 deletions(-) diff --git a/projet/Types/PokemonBug.cs b/projet/Types/PokemonBug.cs index 39c6e2e..7e096bb 100644 --- a/projet/Types/PokemonBug.cs +++ b/projet/Types/PokemonBug.cs @@ -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) || diff --git a/projet/Types/PokemonDark.cs b/projet/Types/PokemonDark.cs index f2370fb..c0f29d3 100644 --- a/projet/Types/PokemonDark.cs +++ b/projet/Types/PokemonDark.cs @@ -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"); + } + } + } +} diff --git a/projet/Types/PokemonDragon.cs b/projet/Types/PokemonDragon.cs index 75fdb97..c04e4e2 100644 --- a/projet/Types/PokemonDragon.cs +++ b/projet/Types/PokemonDragon.cs @@ -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"); + } + } + } +} diff --git a/projet/Types/PokemonElectric.cs b/projet/Types/PokemonElectric.cs index 1f1ea17..f3a9810 100644 --- a/projet/Types/PokemonElectric.cs +++ b/projet/Types/PokemonElectric.cs @@ -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"); } diff --git a/projet/Types/PokemonFairy.cs b/projet/Types/PokemonFairy.cs index e0651eb..a7a8417 100644 --- a/projet/Types/PokemonFairy.cs +++ b/projet/Types/PokemonFairy.cs @@ -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)) { diff --git a/projet/Types/PokemonFighting.cs b/projet/Types/PokemonFighting.cs index 23cf8a1..cbc4043 100644 --- a/projet/Types/PokemonFighting.cs +++ b/projet/Types/PokemonFighting.cs @@ -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"); diff --git a/projet/Types/PokemonFire.cs b/projet/Types/PokemonFire.cs index fb0bf78..59a32f8 100644 --- a/projet/Types/PokemonFire.cs +++ b/projet/Types/PokemonFire.cs @@ -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) || diff --git a/projet/Types/PokemonFlying.cs b/projet/Types/PokemonFlying.cs index 97d5121..b028450 100644 --- a/projet/Types/PokemonFlying.cs +++ b/projet/Types/PokemonFlying.cs @@ -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)) { diff --git a/projet/Types/PokemonGhost.cs b/projet/Types/PokemonGhost.cs index 6fd8b34..1704112 100644 --- a/projet/Types/PokemonGhost.cs +++ b/projet/Types/PokemonGhost.cs @@ -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"); diff --git a/projet/Types/PokemonGrass.cs b/projet/Types/PokemonGrass.cs index 7352a3c..c9eab3b 100644 --- a/projet/Types/PokemonGrass.cs +++ b/projet/Types/PokemonGrass.cs @@ -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) || diff --git a/projet/Types/PokemonGround.cs b/projet/Types/PokemonGround.cs index 8132055..83982c1 100644 --- a/projet/Types/PokemonGround.cs +++ b/projet/Types/PokemonGround.cs @@ -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; } diff --git a/projet/Types/PokemonIce.cs b/projet/Types/PokemonIce.cs index 27fcc7d..3c8b598 100644 --- a/projet/Types/PokemonIce.cs +++ b/projet/Types/PokemonIce.cs @@ -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) || diff --git a/projet/Types/PokemonNormal.cs b/projet/Types/PokemonNormal.cs index c328ec7..a076895 100644 --- a/projet/Types/PokemonNormal.cs +++ b/projet/Types/PokemonNormal.cs @@ -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) { diff --git a/projet/Types/PokemonPoison.cs b/projet/Types/PokemonPoison.cs index f12ed6e..7629393 100644 --- a/projet/Types/PokemonPoison.cs +++ b/projet/Types/PokemonPoison.cs @@ -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"); diff --git a/projet/Types/PokemonPsychic.cs b/projet/Types/PokemonPsychic.cs index 63783cd..7329c6c 100644 --- a/projet/Types/PokemonPsychic.cs +++ b/projet/Types/PokemonPsychic.cs @@ -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; diff --git a/projet/Types/PokemonRock.cs b/projet/Types/PokemonRock.cs index ae20839..56d1f42 100644 --- a/projet/Types/PokemonRock.cs +++ b/projet/Types/PokemonRock.cs @@ -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)) { diff --git a/projet/Types/PokemonSteel.cs b/projet/Types/PokemonSteel.cs index 75d0fb4..583e8f3 100644 --- a/projet/Types/PokemonSteel.cs +++ b/projet/Types/PokemonSteel.cs @@ -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) || diff --git a/projet/Types/PokemonWater.cs b/projet/Types/PokemonWater.cs index a256c2c..d17ff4a 100644 --- a/projet/Types/PokemonWater.cs +++ b/projet/Types/PokemonWater.cs @@ -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)) {