コード例 #1
0
        public void JoinTournament(Trainer trainer, List <Player> opponents)
        {
            int choice;

            Console.WriteLine($"Welcome to {this.Name}!\nYou may have a chance for the {this.Rosette.Name}.\nBut firstly you have to fight with:");
            foreach (var opponent in opponents)
            {
                Console.WriteLine($"- {opponent.Nickname}");
            }
            Console.WriteLine("\n1. Fight!\n2. Leave the arena");
            Console.Write("->");
            choice = Convert.ToInt32(Console.ReadLine());

            switch (choice)
            {
            case 1:
                Fight.Battle(trainer, opponents);
                break;

            case 2:
                Menu.MainActions(trainer);
                break;

            default:
                break;
            }
        }
コード例 #2
0
        public static void Battle(Pokemon wildPokemon, Trainer trainer)
        {
            Console.WriteLine("1. Fight\n2. Go to Bag");
            Console.WriteLine("->");
            choice = Convert.ToInt32(Console.ReadLine());

            switch (choice)
            {
            case 1:
                Fight.Battle(wildPokemon, trainer);
                break;

            case 2:
                UseItem.GoToBag(wildPokemon, trainer);
                break;

            default:
                Battle(wildPokemon, trainer);
                break;
            }
        }