Beispiel #1
0
        private void InitList()
        {
            PokemonPlus p;

            this.pokemons = new List <PokemonPlus>();

            p = new PokemonPlus("Bulbasauro", "Type: Planta", 40);
            this.pokemons.Add(p);
            p = new PokemonPlus("Mew", "Type: Psíquico", 100);
            this.pokemons.Add(p);
            p = new PokemonPlus("Mewtwo", "Type: Psíquico", 95);
            this.pokemons.Add(p);
            p = new PokemonPlus("Giratina", "Type: Fantasma", 90);
            this.pokemons.Add(p);
            p = new PokemonPlus("Flygon", "Type: Dragão", 80);
            this.pokemons.Add(p);
            p = new PokemonPlus("Metagross", "Type: Metal", 90);
            this.pokemons.Add(p);
            p = new PokemonPlus("Muk", "Type: Tóxico", 60);
            this.pokemons.Add(p);
            p = new PokemonPlus("Metagross", "Type: Metal", 90);
            this.pokemons.Add(p);
            p = new PokemonPlus("Lucario", "Type: Lutador", 65);
            this.pokemons.Add(p);
            p = new PokemonPlus("Paras", "Type: Inseto", 70);
            this.pokemons.Add(p);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            int     opt     = 1;
            Pokedex pokedex = new Pokedex();

            while (opt != 0)
            {
                opt = Menu();
                if (opt == 1)
                {
                    pokedex.ListPokemons();
                }
                if (opt == 2)
                {
                    pokedex.ListPokemons();
                    Console.WriteLine("Choose Pokémon ID to battle");
                    int         id      = Convert.ToInt32(Console.ReadLine());
                    PokemonPlus pPlayer = pokedex.Pokemons[id];
                    Console.WriteLine(pPlayer.Nome + " I Choose You!");

                    Random      r    = new Random();
                    int         rID  = r.Next(0, pokedex.Pokemons.Count);
                    PokemonPlus pNPC = pokedex.Pokemons[rID];
                    Console.WriteLine("Wild " + pNPC.Nome + " appeared!");

                    if (pPlayer.Power >= pNPC.Power)
                    {
                        Console.WriteLine("You won!");
                    }
                    else
                    {
                        Console.WriteLine("You lost!");
                    }
                }
                Console.ReadKey();
                Console.Clear();
            }
        }