예제 #1
0
        static void Main(string[] args)
        {
            PokemonType feu = new PokemonType(Tipe.Feu, Tipe.Eau, Tipe.Plante);

            PokemonType plante = new PokemonType(Tipe.Plante, Tipe.Feu, Tipe.Eau);

            Attaque a = new Attaque("Feu 120 0", Tipe.Feu, 120, 0);
            Attaque b = new Attaque("Feu 12 100", Tipe.Feu, 12, 100);
            Attaque c = new Attaque("eau ", Tipe.Eau, 120, 100);

            Attaque d = new Attaque("plante", Tipe.Plante, 120, 30);

            Pokemon p = new Pokemon("Pikachu", 10000, 10, 10, 10, 10, a, b, c, d);

            Pokemon p2 = new Pokemon("PikachuV2", 10, 10, 10, 10, 10, a, b, c, d);


            Pokemon[] p8 = new Pokemon[2];
            p8[0] = p;
            p8[1] = p2;

            Joueur Kevin = new Joueur();

            Kevin.pokemons = p8;

            Joueur Bouffon = new Joueur();

            Bouffon.pokemons = p8;
            new Combat(Kevin, Bouffon);
        }
예제 #2
0
        private void play()
        {
            this.currentPlayer = this.Joueurs[0].pokemonCourrant.Speed >= this.Joueurs[1].pokemonCourrant.Speed ? Joueurs[0] : Joueurs[1];

            while (!Joueurs[1].allPokemonsKO() || !Joueurs[0].allPokemonsKO())
            {
                displayCombat();

                displayChoice();
                int theChoice = Console.Read();


                switch (theChoice)
                {
                case 0:     //Attack
                    Attaque atk          = null;
                    Pokemon otherPokemon = currentPlayer == Joueurs[0] ? Joueurs[1].pokemonCourrant : Joueurs[0].pokemonCourrant;
                    //Pick attack

                    displayAttaque();

                    int choice = Console.Read();

                    if (choice < 4 && choice > 0)
                    {
                        atk = this.currentPlayer.pokemonCourrant.Moves[choice];
                        this.currentPlayer.Attaquer(atk, otherPokemon);
                        Console.WriteLine("attack sent");
                    }
                    displayCombat();
                    //use attack

                    break;

                case 1:     //Switch
                    throw new NotImplementedException();
                    break;

                case 2:     //object
                    displayObjects();
                    throw new NotImplementedException();
                    break;

                case 3:     //flee
                    Console.WriteLine("You fled");
                    break;

                default:     // issue here
                    throw new NotImplementedException();
                }

                //swap
                this.currentPlayer = currentPlayer == this.Joueurs[0] ? this.Joueurs[1] : this.Joueurs[0];
            }
        }
예제 #3
0
 public void Attaquer(Attaque atk, Pokemon p)
 {
     //inflict damages
     p.Hp -= atk.Damage;
 }
예제 #4
0
 public Pokemon(string p_nom, int p_hp, int p_atk, int p_def, int p_speed, int p_level, Attaque p_move1, Attaque p_move2, Attaque p_move3, Attaque p_move4)
 {
     this.Nom      = p_nom;
     this.Hp       = p_hp;
     this.Atk      = p_atk;
     this.Def      = p_def;
     this.Speed    = p_speed;
     this.Level    = p_level;
     this.Moves    = new Attaque[4];
     this.Moves[0] = p_move1;
     this.Moves[1] = p_move2;
     this.Moves[2] = p_move3;
     this.Moves[3] = p_move4;
 }