début projet pokemon
This commit is contained in:
parent
6c800f4e6f
commit
a94c17f1a0
11
Program.cs
11
Program.cs
@ -1,6 +1,7 @@
|
||||
//using Programmation_objet_TLESIO21.TD1;
|
||||
//using Programmation_objet_TLESIO21.TD2;
|
||||
//using Programmation_objet_TLESIO21.TD3;
|
||||
using Programmation_objet_TLESIO21.TD4;
|
||||
using Programmation_objet_TLESIO21.projet;
|
||||
|
||||
TD4.Launch();
|
||||
public class Program {
|
||||
public static void Main(string[] args) {
|
||||
|
||||
}
|
||||
}
|
@ -19,10 +19,10 @@ namespace Programmation_objet_TLESIO21.TD4 {
|
||||
double salaire = 0;
|
||||
|
||||
if(this.NbHeures > 35) {
|
||||
salaire += (this.NbHeures - 35) * this.TauxHoraire * T1;
|
||||
salaire += (this.NbHeures - 35) * this.TauxHoraire * T1 * 4;
|
||||
}
|
||||
|
||||
salaire += this.NbHeures * this.TauxHoraire;
|
||||
salaire += this.NbHeures * this.TauxHoraire * 4;
|
||||
|
||||
return salaire;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Programmation_objet_TLESIO21.TD3.fleuriste;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
|
||||
namespace Programmation_objet_TLESIO21.TD4 {
|
||||
@ -43,6 +44,7 @@ namespace Programmation_objet_TLESIO21.TD4 {
|
||||
public static void Launch() {
|
||||
Exo1();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
146
projet/GameManager.cs
Normal file
146
projet/GameManager.cs
Normal file
@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class GameManager {
|
||||
|
||||
public static void AlterPokemonStat(String stat, double value, Pokemon p) {
|
||||
switch(stat) {
|
||||
case "PV":
|
||||
p.setPV((int)Math.Floor(p.getPV() * value));
|
||||
break;
|
||||
case "ATKPhys":
|
||||
p.setATKPhys(((int)Math.Floor(p.getATKPhys() * value)));
|
||||
break;
|
||||
case "ATKSpe":
|
||||
p.setATKSpe(((int)Math.Floor(p.getATKSpe() * value)));
|
||||
break;
|
||||
case "DEFPhys":
|
||||
p.setDefPhys(((int)Math.Floor(p.getDEFPhys() * value)));
|
||||
break;
|
||||
case "DEFSpe":
|
||||
p.setDefSpe(((int)Math.Floor(p.getDEFSpe() * value)));
|
||||
break;
|
||||
case "Speed":
|
||||
p.setSpeed(((int)Math.Floor(p.getSpeed() * value)));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyNatureEffect(Enum nature, Pokemon p) {
|
||||
switch(nature) { //malus
|
||||
case Nature.BOLD:
|
||||
case Nature.CALM:
|
||||
case Nature.MODEST:
|
||||
case Nature.TIMID:
|
||||
AlterPokemonStat("ATKPhys", 0.9, p);
|
||||
break;
|
||||
case Nature.MILD:
|
||||
case Nature.GENTLE:
|
||||
case Nature.HASTY:
|
||||
case Nature.LONELY:
|
||||
AlterPokemonStat("DEFPhys", 0.9, p);
|
||||
break;
|
||||
case Nature.JOLLY:
|
||||
case Nature.IMPISH:
|
||||
case Nature.CAREFUL:
|
||||
case Nature.ADAMANT:
|
||||
AlterPokemonStat("ATKSpe", 0.9, p);
|
||||
break;
|
||||
case Nature.RASH:
|
||||
case Nature.LAX:
|
||||
case Nature.NAUGHTY:
|
||||
case Nature.NAIVE:
|
||||
AlterPokemonStat("DEFSpe", 0.9, p);
|
||||
break;
|
||||
case Nature.BRAVE:
|
||||
case Nature.QUIET:
|
||||
case Nature.SASSY:
|
||||
case Nature.RELAXED:
|
||||
AlterPokemonStat("Speed", 0.9, p);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(nature) { //bonus
|
||||
case Nature.BRAVE:
|
||||
case Nature.NAUGHTY:
|
||||
case Nature.ADAMANT:
|
||||
case Nature.LONELY:
|
||||
AlterPokemonStat("ATKPhys", 1.1, p);
|
||||
break;
|
||||
case Nature.BOLD:
|
||||
case Nature.LAX:
|
||||
case Nature.IMPISH:
|
||||
case Nature.RELAXED:
|
||||
AlterPokemonStat("DEFPhys", 1.1, p);
|
||||
break;
|
||||
case Nature.QUIET:
|
||||
case Nature.MILD:
|
||||
case Nature.RASH:
|
||||
case Nature.MODEST:
|
||||
AlterPokemonStat("ATKSpe", 1.1, p);
|
||||
break;
|
||||
case Nature.CALM:
|
||||
case Nature.GENTLE:
|
||||
case Nature.SASSY:
|
||||
case Nature.CAREFUL:
|
||||
AlterPokemonStat("DEFSpe", 1.1, p);
|
||||
break;
|
||||
case Nature.JOLLY:
|
||||
case Nature.NAIVE:
|
||||
case Nature.HASTY:
|
||||
case Nature.TIMID:
|
||||
AlterPokemonStat("Speed", 1.1, p);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyPlayerEffect(String playerName, Pokemon p) {
|
||||
switch(playerName) {
|
||||
case "Applejack":
|
||||
AlterPokemonStat("PV", 0.95, p);
|
||||
break;
|
||||
case "Rainbow Dash":
|
||||
AlterPokemonStat("ATKPhys", 1.03, p);
|
||||
break;
|
||||
case "Twilight Sparkle":
|
||||
AlterPokemonStat("Speed", 1.07, p);
|
||||
break;
|
||||
case "Pinkie Pie":
|
||||
AlterPokemonStat("DEFPhys", 1.04, p);
|
||||
break;
|
||||
case "Fluttershy":
|
||||
AlterPokemonStat("DEFPhys", 0.96, p);
|
||||
break;
|
||||
case "Izzy Moonbow":
|
||||
AlterPokemonStat("PV", 1.05, p);
|
||||
AlterPokemonStat("Speed", 0.95, p);
|
||||
break;
|
||||
case "Zipp Storm":
|
||||
AlterPokemonStat("PV", 0.95, p);
|
||||
AlterPokemonStat("Speed", 1.05, p);
|
||||
break;
|
||||
case "Sunny Starscout":
|
||||
AlterPokemonStat("ATKSpe", 1.03, p);
|
||||
break;
|
||||
case "Derpy Hooves":
|
||||
AlterPokemonStat("PV", 0.95, p);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
35
projet/Nature.cs
Normal file
35
projet/Nature.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public enum Nature {
|
||||
BOLD,
|
||||
QUIRKY,
|
||||
BRAVE,
|
||||
CALM,
|
||||
QUIET,
|
||||
DOCILE,
|
||||
MILD,
|
||||
RASH,
|
||||
GENTLE,
|
||||
HARDY,
|
||||
JOLLY,
|
||||
LAX,
|
||||
IMPISH,
|
||||
SASSY,
|
||||
NAUGHTY,
|
||||
MODEST,
|
||||
NAIVE,
|
||||
HASTY,
|
||||
CAREFUL,
|
||||
BASHFUL,
|
||||
RELAXED,
|
||||
ADAMANT,
|
||||
SERIOUS,
|
||||
LONELY,
|
||||
TIMID
|
||||
}
|
||||
}
|
25
projet/Player.cs
Normal file
25
projet/Player.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class Player {
|
||||
private string Name;
|
||||
private string Description;
|
||||
private int level;
|
||||
private List<Pokemon> PC;
|
||||
private List<Pokemon> Team;
|
||||
|
||||
#pragma warning disable CS8618 // Un champ non-nullable doit contenir une valeur non-null lors de la fermeture du constructeur. Envisagez de déclarer le champ comme nullable.
|
||||
public Player(string Name, string Description, List<Pokemon> PC) {
|
||||
this.Name = Name;
|
||||
this.Description = Description;
|
||||
this.PC = PC;
|
||||
this.level = PC.Count;
|
||||
this.Team = new List<Pokemon>(6);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
124
projet/Pokemon.cs
Normal file
124
projet/Pokemon.cs
Normal file
@ -0,0 +1,124 @@
|
||||
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;
|
||||
}
|
||||
|
||||
public Boolean hasEnoughtPC() {
|
||||
return (this.getPC() > 0);
|
||||
}
|
||||
|
||||
public Boolean isAlive() {
|
||||
return (this.getPV() > 0);
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return this.getName() + " - PV : " + getPV() + ", PC = " + getPC();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
55
projet/PokemonElectric.cs
Normal file
55
projet/PokemonElectric.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonElectric : Pokemon {
|
||||
|
||||
public PokemonElectric(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(80);
|
||||
this.setType(Type.ELECTRIC);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.GROUND)) {
|
||||
damage = 0;
|
||||
}
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.GRASS) ||
|
||||
cible.getType().Equals(Type.ELECTRIC)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.WATER)) {
|
||||
damage *= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(cible.getType().Equals(Type.GROUND)) {
|
||||
damage = 0;
|
||||
}
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.GRASS) ||
|
||||
cible.getType().Equals(Type.ELECTRIC)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.FLYING) ||
|
||||
cible.getType().Equals(Type.WATER)) {
|
||||
damage *= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
54
projet/PokemonFire.cs
Normal file
54
projet/PokemonFire.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonFire : Pokemon {
|
||||
public PokemonFire(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(100);
|
||||
this.setType(Type.FIRE);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.ROCK)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.GRASS) ||
|
||||
cible.getType().Equals(Type.BUG) ||
|
||||
cible.getType().Equals(Type.ICE) ||
|
||||
cible.getType().Equals(Type.STEEL)) {
|
||||
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) {
|
||||
if(cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.ROCK)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.GRASS) ||
|
||||
cible.getType().Equals(Type.BUG) ||
|
||||
cible.getType().Equals(Type.ICE) ||
|
||||
cible.getType().Equals(Type.STEEL)) {
|
||||
damage *= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
58
projet/PokemonGrass.cs
Normal file
58
projet/PokemonGrass.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonGrass : Pokemon {
|
||||
public PokemonGrass(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.GRASS);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.BUG) ||
|
||||
cible.getType().Equals(Type.GRASS) ||
|
||||
cible.getType().Equals(Type.POISON) ||
|
||||
cible.getType().Equals(Type.FLYING)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.ROCK) ||
|
||||
cible.getType().Equals(Type.GROUND)) {
|
||||
damage *= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) ||
|
||||
cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.BUG) ||
|
||||
cible.getType().Equals(Type.GRASS) ||
|
||||
cible.getType().Equals(Type.POISON) ||
|
||||
cible.getType().Equals(Type.FLYING)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.ROCK) ||
|
||||
cible.getType().Equals(Type.GROUND)) {
|
||||
damage *= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
43
projet/PokemonNormal.cs
Normal file
43
projet/PokemonNormal.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonNormal : Pokemon {
|
||||
|
||||
public PokemonNormal(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(90);
|
||||
this.setType(Type.NORMAL);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 2);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(cible.getType().Equals(Type.GHOST)) {
|
||||
damage = 0;
|
||||
}
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) || cible.getType().Equals(Type.ROCK)) {
|
||||
damage /= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SpeAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 1);
|
||||
int damage = cible.getDEFSpe() - this.getATKSpe();
|
||||
if(cible.getType().Equals(Type.GHOST)) {
|
||||
damage = 0;
|
||||
}
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.STEEL) || cible.getType().Equals(Type.ROCK)) {
|
||||
damage /= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
projet/PokemonWater.cs
Normal file
50
projet/PokemonWater.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public class PokemonWater : Pokemon {
|
||||
public PokemonWater(string Name, int PV, int ATKPhys, int ATKSpe, int DEFPhys, int DEFSpe, int Speed) : base(Name, PV, ATKPhys, ATKSpe, DEFPhys, DEFSpe, Speed) {
|
||||
base.setPC(90);
|
||||
this.setType(Type.WATER);
|
||||
}
|
||||
|
||||
public override void PhysAttack(Pokemon cible) {
|
||||
this.setPC(this.getPC() - 3);
|
||||
int damage = cible.getDEFPhys() - this.getATKPhys();
|
||||
if(damage > 0) {
|
||||
if(cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.GRASS)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.ROCK) ||
|
||||
cible.getType().Equals(Type.GROUND)) {
|
||||
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) {
|
||||
if(cible.getType().Equals(Type.DRAGON) ||
|
||||
cible.getType().Equals(Type.WATER) ||
|
||||
cible.getType().Equals(Type.GRASS)) {
|
||||
damage /= 2;
|
||||
}
|
||||
if(cible.getType().Equals(Type.FIRE) ||
|
||||
cible.getType().Equals(Type.ROCK) ||
|
||||
cible.getType().Equals(Type.GROUND)) {
|
||||
damage *= 2;
|
||||
}
|
||||
cible.getDamage(damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
28
projet/Type.cs
Normal file
28
projet/Type.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Programmation_objet_TLESIO21.projet {
|
||||
public enum Type {
|
||||
NORMAL,
|
||||
GRASS,
|
||||
FIRE,
|
||||
WATER,
|
||||
ELECTRIC,
|
||||
FLYING,
|
||||
BUG,
|
||||
ROCK,
|
||||
GROUND,
|
||||
PSYCHIC,
|
||||
POISON,
|
||||
GHOST,
|
||||
DARK,
|
||||
STEEL,
|
||||
COMBAT,
|
||||
ICE,
|
||||
DRAGON,
|
||||
FAIRY
|
||||
}
|
||||
}
|
9
txt/Characters.csv
Normal file
9
txt/Characters.csv
Normal file
@ -0,0 +1,9 @@
|
||||
Applejack;Applejack est une honnête dresseuse pokémon et sait faire preuve d'un grand altruisme envers les pokémon. Elle vit et travaille à la Ferme de la Douce Baie Oran.;Ses Pokémons ont un bonus de PV de 5%
|
||||
Rainbow Dash;Rainbow Dash est une loyale dresseuse pokémon. Elle est en charge de la météo de Pokeville;Ses Pokémons ont un bonus d'ATKPhys de 3%
|
||||
Twilight Sparkle;Twilight Sparkle est une dresseuse pokémon avec un talent inné. Elle a la capacité d'élever ses pokémons avec aisance. Elle vit dans le palais royal du Bourg Galop;Ses Pokémons ont un bonus de vitesse de 7%
|
||||
Pinkie Pie;Pinkie Pie est une souriante dresseuse pokémon. Elle fait sourire tous les pokémons en un instant. Elle vit avec sa famille dans une ferme de production de caillous à Mérouville.;Ses Pokémons ont un bonus de DEFPhys de 4%
|
||||
Fluttershy;Fluttershy est une timide dresseuse pokémon mais néanmoins très puissante. Elle est la seule dresseuse capable de parler aux pokémons. Elle les élève dans sa pension à Bonville.;Ses Pokémons ont un bonus de DEFSpé de 4%
|
||||
Izzy Moonbow;Izzy Moonbow est une dresseuse pokémon qui adore unicycler les restes des objets laissés par les dresseurs pour les transformer en outils de capture. Elle vit dand la forêt de Brideblanc.;Ses Pokémons ont un bonus de PV de 5% et un malus de vitesse de 5%
|
||||
Zipp Storm;Zipp Storm est une enquêtrice pokémon qui enquête régulièrement sur les mystères à travers les régions pokémon. Bien que de sang royal, elle vit loin de sa famille pour vivre sa passion au phare de cristal de Rivamar;Ses Pokémons ont un malus de PV de 5% et un bonus de vitesse de 5%
|
||||
Sunny Starscout;Sunny Starscout est une dresseuse pokémon qui est pesuadée que peu importe leur nature, tous les pokémon peuvent vivre ensemble. Elle vit dans la Baie de Portponi;Ses Pokémons ont un bonus d'ATKSPe de 3%
|
||||
Derpy Hooves; Derpy Hooves est une dresseuse pokemon qui adore les pokémons bien qu'elle soit très maladroite dans ses mouvements. Son regard effrai en général les pokémons sauvages;Ses Pokémons ont un malus de PV de 5%
|
|
1073
txt/Pokemon.csv
Normal file
1073
txt/Pokemon.csv
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user