Exemple #1
0
        static void Main(string[] args)
        {
            int    n, k = 0;
            string s;
            string NamePok = null;
            int    i       = 1;
            int    t       = 0;
            int    H       = 0;
            int    Damage  = 0;
            int    Spell   = 0;
            int    fear    = 0;

            Console.WriteLine("Choose your pokemon");
            do
            {
                k = 0;
                Console.WriteLine("Player 1 input number from 1 to 5");
                s = Console.ReadLine();
                n = Convert.ToByte(s);
                switch (n)
                {
                case 1:
                    H       = 1000; Damage = 50; Spell = 0;
                    NamePok = "Antonyuk";
                    Console.WriteLine("You  choose {0}", NamePok);
                    break;

                case 2:
                    H       = 800; Damage = 40; Spell = 0;
                    NamePok = "Artem";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                case 3:
                    H       = 750; Damage = 60; Spell = 0;
                    NamePok = "Morozov";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                case 4:
                    H       = 10; Damage = 5; Spell = 0;
                    NamePok = "Bilodid";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                case 5:
                    H       = 500; Damage = 500; Spell = 0;
                    NamePok = "Pasha";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                default:
                    Console.WriteLine("Try again");
                    k = 1;
                    break;
                }
            }while (k == 1);
            Player1 pl1 = new Player1(H, Damage, Spell, NamePok);

            do
            {
                k = 0;
                Console.WriteLine("Player 2 input nubmber from 1 to 5");
                s = Console.ReadLine();
                n = Convert.ToByte(s);
                switch (n)
                {
                case 1:
                    H       = 1000; Damage = 30; Spell = 6;
                    NamePok = "Antonyuk";
                    Console.WriteLine("You  choose {0}", NamePok);
                    break;

                case 2:
                    H       = 800; Damage = 40; Spell = 2;
                    NamePok = "Artem";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                case 3:
                    H       = 750; Damage = 60; Spell = 5;
                    NamePok = "Morozov";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                case 4:
                    H       = 10; Damage = 5; Spell = 1;
                    NamePok = "Bilodid";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                case 5:
                    H       = 500; Damage = 500; Spell = 10;
                    NamePok = "Pasha";
                    Console.WriteLine("You choose {0}", NamePok);
                    break;

                default:
                    Console.WriteLine("Try again");
                    k = 1;
                    break;
                }
            }while (k == 1);

            Player2 pl2 = new Player2(H, Damage, Spell, NamePok);

            do
            {
                Console.WriteLine("Turn {0}", i);
                if (t % 2 == 0)
                {
                    Console.WriteLine("Player1 Press any to key for Hit");
                    Console.ReadLine();
                    Console.WriteLine("Your HP {0} ", pl1.HP1);
                    Console.WriteLine();
                    pl1.Hit(ref pl2.HP2, ref pl1.damage);
                    pl1.Krit(ref pl2.HP2);
                    pl1.Miss(ref pl2.HP2);
                    pl1.Spel(ref pl2.HP2, ref pl1.Spell);
                }
                else
                {
                    Console.WriteLine("Player2 Press any to key for Hit");
                    Console.ReadLine();
                    Console.WriteLine("Your HP {0} ", pl2.HP2);
                    Console.WriteLine();
                    pl2.Hit(ref pl1.HP1, ref pl2.damage);
                    pl2.Krit(ref pl1.HP1);
                    pl2.Miss(ref pl1.HP1);
                    pl1.Spel(ref pl1.HP1, ref pl2.Spell);
                }
                i++; t++;
            } while ((pl1.HP1 > 0) && (pl2.HP2 > 0));
            Console.WriteLine("Game Over");
        }
Exemple #2
0
        static void Main(string[] args)
        {
            int n,k=0;
            string s;
            string NamePok=null;
            int i = 1;
            int t = 0;
            int H = 0;
            int Damage = 0;
            int Spell = 0;
            int fear = 0;
            Console.WriteLine("Choose your pokemon");
            do
            {
                k = 0;
                Console.WriteLine("Player 1 input number from 1 to 5");
                s = Console.ReadLine();
                n = Convert.ToByte(s);
                switch (n)
                {
                    case 1:
                        H = 1000; Damage = 50; Spell = 0;
                        NamePok = "Antonyuk";
                        Console.WriteLine("You  choose {0}", NamePok);
                        break;
                    case 2:
                        H = 800; Damage = 40; Spell = 0;
                        NamePok = "Artem";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    case 3:
                        H = 750; Damage = 60; Spell = 0;
                        NamePok = "Morozov";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    case 4:
                        H = 10; Damage = 5; Spell = 0;
                        NamePok = "Bilodid";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    case 5:
                        H = 500; Damage = 500; Spell = 0;
                        NamePok = "Pasha";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    default:
                        Console.WriteLine("Try again");
                        k = 1;
                        break;
                }
            }
            while (k == 1);
            Player1 pl1 = new Player1(H, Damage, Spell,NamePok);
            do
            {
                k = 0;
                Console.WriteLine("Player 2 input nubmber from 1 to 5");
                s = Console.ReadLine();
                n = Convert.ToByte(s);
                switch (n)
                {
                    case 1:
                        H = 1000; Damage = 30; Spell = 6;
                        NamePok = "Antonyuk";
                        Console.WriteLine("You  choose {0}", NamePok);
                        break;
                    case 2:
                        H = 800; Damage = 40; Spell = 2;
                        NamePok = "Artem";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    case 3:
                        H = 750; Damage = 60; Spell = 5;
                        NamePok = "Morozov";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    case 4:
                        H = 10; Damage = 5; Spell = 1;
                        NamePok = "Bilodid";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    case 5:
                        H = 500; Damage = 500; Spell = 10;
                        NamePok = "Pasha";
                        Console.WriteLine("You choose {0}", NamePok);
                        break;
                    default:
                        Console.WriteLine("Try again");
                        k = 1;
                        break;
                }
            }
            while (k == 1);

            Player2 pl2 = new Player2(H, Damage, Spell, NamePok);
            do
            {
                Console.WriteLine("Turn {0}",i);
                if (t % 2 == 0)
                {
                    Console.WriteLine("Player1 Press any to key for Hit");
                    Console.ReadLine();
                    Console.WriteLine("Your HP {0} ",pl1.HP1);
                    Console.WriteLine();
                    pl1.Hit(ref pl2.HP2, ref pl1.damage);
                    pl1.Krit(ref pl2.HP2);
                    pl1.Miss(ref pl2.HP2);
                    pl1.Spel(ref pl2.HP2, ref pl1.Spell);
                }
                else
                {
                    Console.WriteLine("Player2 Press any to key for Hit");
                    Console.ReadLine();
                    Console.WriteLine("Your HP {0} ", pl2.HP2);
                    Console.WriteLine();
                    pl2.Hit(ref pl1.HP1, ref pl2.damage);
                    pl2.Krit(ref pl1.HP1);
                    pl2.Miss(ref pl1.HP1);
                    pl1.Spel(ref pl1.HP1, ref pl2.Spell);
                }
                i++; t++;
            } while ((pl1.HP1 > 0) && (pl2.HP2 > 0));
            Console.WriteLine("Game Over");
        }