예제 #1
0
        public void GymPoke(Gym fight)
        {
            Console.WriteLine("Choose the pokemon that you would like to switch to:");
            for (int i = 0; i < x.PETS.Count; i++)
            {
                Pokemon tmp = x.PETS[i];
                Console.WriteLine("{6}.{0} Lv:{1} HP:{2}/{3} ATK:{4} DEF:{5}", tmp.NAME, tmp.LV, tmp.HP, tmp.MAXHP, tmp.ATK, tmp.DEF, (char)(i + 'A'));
            }
            Console.WriteLine("Q.Quit pokeon Menu");

            int  target;
            bool quit = false;
            char input;

            while (!quit)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                input = Console.ReadKey().KeyChar;
                Console.ResetColor();
                Console.WriteLine();
                switch (input)
                {
                case 'Q':
                case 'q':
                    quit = true; break;

                default:
                    if (input >= 'a' && input <= (char)('a' + x.PETS.Count - 1) || input >= 'A' && input <= (char)('A' + x.PETS.Count - 1))
                    {
                        if (input <= 'Z')
                        {
                            target = input - 'A';
                        }
                        else
                        {
                            target = input - 'a';
                        }

                        bool tf = x.SwitchPoke(x.PETS[target]);
                        GymDiagDisplay(fight.dialogue(Gym.diag.poke, tf));
                        quit = true;
                        GymStatus(fight);
                    }

                    break;
                }
            }
        }
예제 #2
0
        public void GymStatus(Gym fight)
        {
            Console.WriteLine("Total number of opponents:" + fight.TOTAL);
            Console.WriteLine("Number of defeated pokemon:" + fight.KO);
            Console.WriteLine("Current opponent:{0} Lv:{1} HP:{2}/{3}", fight.POKENOW.NAME, fight.POKENOW.LV, fight.POKENOW.HP, fight.POKENOW.MAXHP);
            Console.WriteLine("Your pokemon:{0} Lv:{1} HP:{2}/{3}", x.POKENOW.NAME, x.POKENOW.LV, x.POKENOW.HP, x.POKENOW.MAXHP);
            Console.WriteLine("Choose your action:");
            Console.WriteLine("A.Fight");
            Console.WriteLine("B.Change Pokemon");
            Console.WriteLine("C.Use Item");

            bool quit = false;
            char input;

            while (!quit)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                input = Console.ReadKey().KeyChar;
                Console.ResetColor();
                Console.WriteLine();
                switch (input)
                {
                case 'a':
                case 'A':
                    GymBattle(fight);
                    quit = true;
                    break;

                case 'b':
                case 'B':
                    GymPoke(fight);
                    quit = true;
                    break;

                case 'c':
                case 'C':
                    GymItem(fight);
                    quit = true;
                    break;

                default:
                    break;
                }
            }
        }
예제 #3
0
        public void GymItem(Gym fight)
        {
            if (x.ITEMS["HPHealer"] > 0)
            {
                Console.WriteLine("You can use the following item:");
                Console.WriteLine("H.HPHealer   X{0}", x.ITEMS["HPHealer"]);
            }
            Console.WriteLine("Q.Quit item menu");

            bool quit = false;
            char input;

            while (!quit)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                input = Console.ReadKey().KeyChar;
                Console.ResetColor();
                Console.WriteLine();
                switch (input)
                {
                case 'h':
                case 'H':
                    GymDiagDisplay(fight.dialogue(Gym.diag.heal, x.POKENOW.heal(x)));
                    GymStatus(fight);
                    quit = true;
                    break;

                case 'q':
                case 'Q':
                    GymStatus(fight);
                    quit = true;
                    break;

                default: break;
                }
            }
        }
예제 #4
0
 private PokeMap()
 {
     gyms    = new Gym[1];
     gyms[0] = Gym.Instance(1215, 178, Gym.na_type.water);
 }
예제 #5
0
        public void GymBattle(Gym fight)
        {
            Console.WriteLine("Choose a skill to attack!!");
            for (int i = 0; i < x.POKENOW.SKILLS.Count; i++)
            {
                Console.WriteLine("{0}.{1}", (char)(i + 'A'), x.POKENOW.SKILLS[i]);
            }
            Console.WriteLine("Q.Quit skill menu");

            int  target;
            int  result;
            bool quit = false;
            char input;

            while (!quit)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                input = Console.ReadKey().KeyChar;
                Console.ResetColor();
                Console.WriteLine();
                switch (input)
                {
                case 'Q':
                case 'q':
                    quit = true; break;

                default:
                    if (input >= 'a' && input <= (char)('a' + x.POKENOW.SKILLS.Count - 1) || (input >= 'A' && input <= (char)('A' + x.POKENOW.SKILLS.Count - 1)))
                    {
                        if (input <= 'Z')
                        {
                            target = input - 'A';
                        }
                        else
                        {
                            target = input - 'a';
                        }
                        string atk = x.POKENOW.SKILLS[target];
                        int    dmg = x.POKENOW.Attack(atk, fight.POKENOW);
                        GymDiagDisplay(fight.dialogue(dmg, atk));
                        result = fight.statusUpdate();
                        if (result == 2)
                        {
                            GymDiagDisplay(fight.dialogue(Gym.diag.startend, false));
                            world.ResetGym(fight.NATURE);
                            x.GymVictory();
                        }
                        else
                        {
                            if (result == 1)
                            {
                                GymDiagDisplay(fight.dialogue(Gym.diag.ko, result == 1));
                            }
                            else
                            {
                                GymDiagDisplay(fight.dialogue(Gym.diag.ko, result == 1));
                            }
                            GymStatus(fight);
                        }

                        quit = true;
                    }

                    break;
                }
            }
        }
예제 #6
0
        public int MapPrint()
        {
            int position = -1;
            int xstart, xend, ystart, yend;
            int gym_xpos = -1, gym_ypos = -1;

            if (player_xpos < 4)
            {
                xstart = 0;
                xend   = 8;
            }
            else if (player_xpos > worldsize - 5)
            {
                xstart = worldsize - 9;
                xend   = worldsize - 1;
            }
            else
            {
                xstart = player_xpos - 4;
                xend   = player_xpos + 4;
            }
            if (player_ypos < 2)
            {
                ystart = 0;
                yend   = 4;
            }
            else if (player_ypos > worldsize - 3)
            {
                ystart = worldsize - 5;
                yend   = worldsize - 1;
            }
            else
            {
                ystart = player_ypos - 2;
                yend   = player_ypos + 2;
            }
            //Console.WriteLine("Player X pos:{0} Y pos:{1} XS:{2} XE:{3} YS:{4} YE:{5}", player_xpos, player_ypos, xstart, xend, ystart, yend);

            Gym tmp = null;

            //Console.WriteLine(world.GetAllGym.Length);
            for (int i = 0; i < world.GetAllGym.Length; i++)
            {
                gym_xpos = world.GetAllGym[i].Position[0];              //20
                gym_ypos = world.GetAllGym[i].Position[1];              //2
                //Console.WriteLine("Gym X pos:{0} Y pos:{1}", gym_xpos, gym_ypos);
                if (gym_xpos >= xstart && gym_xpos <= xend && gym_ypos >= ystart && gym_ypos <= yend)
                {
                    position = i;
                    tmp      = world.GetAllGym[i];
                    break;
                }
            }
            //tmp = world.GetTypedGym(Gym.na_type.water);
            //Console.WriteLine(tmp.Position[0]);
            for (int i = ystart; i <= yend; i++)         // 7 to 11
            {
                for (int j = xstart; j <= xend; j++)     // 8 to 16
                {
                    if (position == -1)
                    {
                        if (j == player_xpos && i == player_ypos)
                        {
                            Console.Write("X");
                        }
                        else
                        {
                            Console.Write(".");
                        }
                    }
                    else
                    {
                        if (gym_ypos == player_ypos && gym_xpos == player_xpos)
                        {
                            Console.Write("Z");
                        }
                        else
                        {
                            if (j == gym_xpos && i == gym_ypos)
                            {
                                Console.Write("G");
                            }
                            else if (j == player_xpos && i == player_ypos)
                            {
                                Console.Write("X");
                            }
                            else
                            {
                                Console.Write(".");
                            }
                        }
                    }
                }
                Console.WriteLine();
            }
            return(position);
        }