Example #1
0
        public static void myfirstpokemon()
        {
            Console.WriteLine("         *| Bulbizaur : 1 | Charmander : 2 | Squirtle : 3 |*");
            Console.WriteLine();
            Console.Write("      > ");
            string myread = Console.ReadLine();

            switch (myread)
            {
            case "1":
                _trainer.CatchAPokemon(_index.GetPokemon(0));
                _opponent.CatchAPokemon(_index.GetPokemon(3));
                break;

            case "2":
                _trainer.CatchAPokemon(_index.GetPokemon(3));
                _opponent.CatchAPokemon(_index.GetPokemon(6));
                break;

            case "3":
                _trainer.CatchAPokemon(_index.GetPokemon(6));
                _opponent.CatchAPokemon(_index.GetPokemon(0));
                break;

            default:
                myfirstpokemon();
                break;
            }
        }
Example #2
0
        public static void Updates()
        {
            bool end = false;

            while (!end)
            {
                Menu.Action nextact = Menu.GetNextAction();

                switch (nextact)
                {
                case Menu.Action.FIGHT:
                    //debut combat

                    Menu.Fight fight = Menu.GetFight();

                    Combat combat;
                    if (fight == Menu.Fight.WILD)
                    {
                        Trainer wild = new Trainer("Wild pokemon", 0);
                        wild.CatchAPokemon(_index.GetRandomPokemon());
                        combat = new Combat(Trainer, wild, true);
                    }
                    else
                    {
                        combat = new Combat(MyGame.Trainer, MyGame.Opponent, false);
                    }

                    //combatmusic();

                    bool isWon = combat.CombatLoop();

                    //fin combat et retour au menu
                    //music();
                    if (!isWon)
                    {
                        Console.WriteLine("{0} scurried to a pokemon center, \nprotecting the exhausted and fainted pokemon from further harm", Trainer.Name);
                        Trainer.Heal();
                    }
                    break;

                case Menu.Action.SHOP:
                    //storemusic();
                    Menu.Shop myshop = Menu.Getshop();

                    switch (myshop)
                    {
                    case Menu.Shop.SHOP:
                        Console.ReadLine();
                        // music();
                        break;

                    case Menu.Shop.POKECENTER:
                        _trainer.Heal();
                        Console.WriteLine("Your pokemons have been healed");
                        Console.ReadLine();
                        // music();
                        break;

                    case Menu.Shop.HOMEPAGE:
                        //music();
                        Menu.GetNextAction();
                        break;
                    }

                    break;

                case Menu.Action.SHOW:

                    Menu.Stat mystat = Menu.GetStat();
                    switch (mystat)
                    {
                    case Menu.Stat.MYPOKEMON:
                        _trainer.MyPokemon();
                        Console.ReadLine();
                        Menu.GetStat();
                        break;

                    case Menu.Stat.MYID:
                        _trainer.WhoAmI();
                        _trainer.Describe();
                        Console.ReadLine();
                        Menu.GetStat();

                        break;

                    case Menu.Stat.HOMEPAGE:
                        Menu.GetNextAction();
                        break;

                    default:
                        Menu.GetStat();
                        break;
                    }

                    break;

                case Menu.Action.OPTION:
                    Menu.Option nextoption = Menu.GetOption();
                    switch (nextoption)
                    {
                    case Menu.Option.QUIT:
                        end = true;
                        Console.WriteLine("goodbye my friend");
                        break;

                    case Menu.Option.PAUSE:
                        Console.Clear();
                        Console.WriteLine();
                        Console.WriteLine("                 ****************************************************************");
                        Console.WriteLine("                 *                                                              *");
                        Console.WriteLine("                 *                         *GAME PAUSED*                        *");
                        Console.WriteLine("                 *                                                              *");
                        Console.WriteLine("                 *                                                              *");
                        Console.WriteLine("                 ****************************************************************");
                        Console.WriteLine();
                        Console.WriteLine("                                                  <-/");
                        Console.ReadLine();

                        break;

                    case Menu.Option.RESTART:
                        Console.Clear();
                        Welcome();
                        Getmyfirstpokemon();
                        break;

                    case Menu.Option.HOMEPAGE:
                        Menu.GetNextAction();
                        break;

                    default:
                        Menu.GetOption();
                        break;
                    }

                    break;

                default:
                    Menu.GetNextAction();
                    break;
                }
            }
        }