コード例 #1
0
        public static string GetNonMagikarpPokemon()
        {
            string randomPokemonName = Pokemons.GetRandomPokemon();

            // Makes sure no more Magikarps are added
            while (randomPokemonName == "Magikarp")
            {
                randomPokemonName = Pokemons.GetRandomPokemon();
            }
            return(randomPokemonName);
        }
コード例 #2
0
ファイル: Menu.cs プロジェクト: lettertea/Popokenom
        public static void FightWildPokemon(PokemonTrainer userTrainer)
        {
            int opponentLevel;

            do
            {
                Console.WriteLine("Your opponent level?");
                if (int.TryParse(Console.ReadLine(), out opponentLevel))
                {
                    if (opponentLevel >= 1 && opponentLevel <= 100)
                    {
                        Pokemon opponent = new Pokemon(Pokemons.GetRandomPokemon(), opponentLevel);
                        Console.WriteLine($"A wild {opponent.Name} (R:{opponent.Rarity}) appeared.");
                        Console.WriteLine($"{userTrainer.Name}: Alright, let's show 'em what we got, {userTrainer.PokemonOut.Name} (R:{userTrainer.PokemonOut.Rarity})");
                        Battle.FightPokemon(userTrainer, opponent);
                        break;
                    }
                }
            } while (true);
        }