Esempio n. 1
0
 public void CheckAlive()
 {
     if (_player1.GetSelectedPokemon().IsKO)
     {
         Console.Clear();
         Console.WriteLine("{0} needs to swap pokemon", _player1);
         _player1.Select();
         Console.Clear();
         Console.WriteLine("{0} : Do you want to swap pokemon ? {Yes}/{No}", _player2);
         if (Console.ReadLine() == "Yes")
         {
             _player2.Select();
         }
     }
     else if (_player1.GetSelectedPokemon().IsKO)
     {
         Console.Clear();
         Console.WriteLine("{0} needs to swap pokemon", _player1);
         _player1.Select();
         Console.Clear();
         Console.WriteLine("{0} : Do you want to swap pokemon ? {Yes}/{No}", _player2);
         if (Console.ReadLine() == "Yes")
         {
             _player2.Select();
         }
     }
 }
Esempio n. 2
0
        public void Attack(Trainer player, Trainer opponent)
        {
            Console.Clear();
            Console.WriteLine();
            Console.WriteLine("      ======|   ATTACK   |======");
            Console.WriteLine();
            foreach (var attack in player.GetSelectedPokemon().Attacks)
            {
                attack.Describe();
            }
            Console.WriteLine();
            Console.WriteLine("    press 1 to continue...");
            Console.WriteLine();
            Console.Write(">> ");
            string selected = Console.ReadLine();

            player.GetSelectedPokemon().Attack(int.Parse(selected) - 1, opponent.GetSelectedPokemon());
        }
Esempio n. 3
0
        public void PlayerTurn(Trainer player, Trainer opponent)
        {
            Console.Clear();
            List <string> actions = new List <string>()
            {
                "Attaquer", "Sac", "Fuir", "Changer de pokemon"
            };

            Console.WriteLine();
            Console.WriteLine("      =======|  TOUR DE {0}  |=======", player.Name);
            Console.WriteLine();

            Console.Write("{0}'s pokemon: ", player.Name);
            player.GetSelectedPokemon().GetPokemonCombatInfo();

            Console.Write("{0}'s pokemon: ", opponent.Name);
            opponent.GetSelectedPokemon().GetPokemonCombatInfo();

            Console.WriteLine();
            Console.WriteLine("Choisissez une action :");
            for (int i = 0; i < actions.Count; i++)
            {
                Console.WriteLine("  {0}- {1}", i + 1, actions[i]);
            }

            int choice;

            do
            {
                Console.Write(">> ");
                choice = int.Parse(Console.ReadLine()) - 1;
            } while (!(choice >= 0 && choice < actions.Count));
            Console.WriteLine(choice);

            switch (choice)
            {
            case 0:
                Attack(player, opponent);
                break;

            case 1:
                Bag();
                break;

            case 2:
                Flee();
                break;

            case 3:
                ChangePokemon(player);
                break;

            default:
                throw new Exception();
            }
        }