Beispiel #1
0
        public void TutorialBattle_0()
        {
            T_PlayerHealth = 10;
            T_EnemyHealth  = 10;
            Console.WriteLine("This fight is simple. Press 'Space' to start the Battle.");
            ConsoleKeyInfo info = Console.ReadKey();

            if (info.Key == ConsoleKey.Spacebar)
            {
                Console.Clear();
                var player = new TutorialFight();
                player.TutorialBattle_1();
            }
            else
            {
                Console.Clear();
                var player = new TutorialFight();
                player.TutorialBattle_1();
            }
        }
Beispiel #2
0
        public void TutorialBattle_2()
        {
            //Player Round.
            var damageNumbers = new double[2, 3]
            {
                { 0.15, 0.25, 0.50 },
                { 0.50, 0.75, 1 }
            };

            /*
             * Pthrow
             * 1  - 6      0.5     Damage * Swordlevel
             * 7  - 12     1       Damage * Swordlevel
             * 13 - 18     1.5     Damage * Swordlevel
             */
            int pthrow;

            /*
             * DamageCategory:
             *
             * Enemy Defensive
             *
             * Cat 1. = 0.25   Dmg    (1-6)
             * Cat 2. = 0.5    Dmg    (7-12)
             * Cat 3. = 0.75   Dmg    (13-18)
             *
             * Enemy Attack
             *
             * Cat 4. = 0.5    Dmg    (1-6)
             * Cat 5. = 1      Dmg    (7-12)
             * Cat 6. = 1.5    Dmg    (13-18)
             */
            int    damageCategory = 0;
            double damageDeal     = 0;

            var pcub1 = new Random().Next(1, 7);
            var pcub2 = new Random().Next(1, 7);
            var pcub3 = new Random().Next(1, 7);

            pthrow = pcub1 + pcub2 + pcub3;

            if (pthrow <= 6 && T_PlayerStance == 1)
            {
                damageCategory = 1;
            }
            else if (pthrow <= 12 && T_PlayerStance == 1)
            {
                damageCategory = 2;
            }
            else if (pthrow <= 18 && T_PlayerStance == 1)
            {
                damageCategory = 3;
            }
            else if (pthrow <= 6)
            {
                damageCategory = 4;
            }
            else if (pthrow <= 12)
            {
                damageCategory = 5;
            }
            else if (pthrow <= 18)
            {
                damageCategory = 6;
            }

            switch (damageCategory)
            {
            case 1:
                damageDeal = damageNumbers[0, 0];
                TutorialFight.T_PlayerHealth -= damageDeal;
                Console.WriteLine("Training Dummy hit to the Hero body and he suffered " + damageDeal + " Damage. Hero health is now: {0}", T_PlayerHealth);
                System.Threading.Thread.Sleep(1500);
                break;

            case 2:
                damageDeal = damageNumbers[0, 1];
                TutorialFight.T_PlayerHealth -= damageDeal;
                Console.WriteLine("Training Dummy hit strongly to the Hero body and he suffered " + damageDeal + " Damage. Hero health is now: {0}", T_PlayerHealth);
                System.Threading.Thread.Sleep(1500);
                break;

            case 3:
                damageDeal = damageNumbers[0, 2];
                TutorialFight.T_PlayerHealth -= damageDeal;
                Console.WriteLine("Training Dummy hit hard to the Hero head and he suffered " + damageDeal + " Damage. Hero health is now: {0}", T_PlayerHealth);
                System.Threading.Thread.Sleep(1500);
                break;

            case 4:
                damageDeal = damageNumbers[1, 0];
                TutorialFight.T_PlayerHealth -= damageDeal;
                Console.WriteLine("Training Dummy hit to the Hero body and he suffered " + damageDeal + " Damage. Hero health is now: {0}", T_PlayerHealth);
                System.Threading.Thread.Sleep(1500);
                break;

            case 5:
                damageDeal = damageNumbers[1, 1];
                TutorialFight.T_PlayerHealth -= damageDeal;
                Console.WriteLine("Training Dummy hit strongly to the Hero body and he suffered " + damageDeal + " Damage. Hero health is now: {0}", T_PlayerHealth);
                System.Threading.Thread.Sleep(1500);
                break;

            case 6:
                damageDeal = damageNumbers[1, 2];
                TutorialFight.T_PlayerHealth -= damageDeal;
                Console.WriteLine("Training Dummy hit hard to the Hero head and he suffered " + damageDeal + " Damage. Hero health is now: {0}", T_PlayerHealth);
                System.Threading.Thread.Sleep(1500);
                break;
            }
            Console.WriteLine("Hero Health: {0} ---- Training Dummy Health: {1}", T_PlayerHealth, T_EnemyHealth);
            Console.WriteLine("The Training Dummy have thrown '{0}' what is {1} damage to the Hero.", pthrow, damageDeal);
            Console.WriteLine("Training Dummy's Turn is over now. \nPress 'Space' to continue.");
            var player = new TutorialFight();

            if (T_PlayerHealth <= 0)
            {
                player.LoseFight();
            }
            ConsoleKeyInfo info = Console.ReadKey();

            if (info.Key == ConsoleKey.Spacebar)
            {
                Console.Clear();
                player.TutorialBattle_1();
            }
            else
            {
                Console.Clear();
                player.TutorialBattle_1();
            }
        }