Beispiel #1
0
        public static void FightAgainstTheDragon()
        {
            Dragon dragon = new Dragon();

            Console.Clear();
            PrintDragon();
            Console.ReadKey();

            while (Dragon.MonsterHealth > 0 && Player.HealthOfPlayer > 0)
            {
                int yourdmg = StartGame.RandomNumber(Weapon.LowestDmg, Weapon.HighestDmg);
                Dragon.MonsterHealth = Dragon.MonsterHealth - yourdmg;

                if (yourdmg == 0)
                {
                    Console.WriteLine();
                    Player.CenterText("You missed the attack..");
                }

                if (yourdmg >= 6)
                {
                    Console.Clear();
                    Console.WriteLine();
                    Player.CenterText($"You got a critcial hit on the dragon with your {Weapon.Name} and dealt {yourdmg} damage");
                    Console.WriteLine();
                    Player.CenterText($"The dragon has {Dragon.MonsterHealth} health remaning");
                    Console.ReadKey();
                }

                if (yourdmg < 6 && yourdmg > 0)
                {
                    Console.Clear();
                    Console.WriteLine();
                    Player.CenterText($"You dealt {yourdmg} damage to the dragon ");
                    Console.WriteLine();
                    Player.CenterText($"The dragon has {Dragon.MonsterHealth} health remaning");
                    Console.ReadKey();
                }

                if (Dragon.MonsterHealth <= 0)
                {
                    Console.WriteLine();
                    Player.CenterText("You managed to kill the dragon!!");
                    Console.ReadKey();
                    break;
                }

                int dragondmg = StartGame.RandomNumber(Dragon.LowestMonsterDmg, Dragon.HighestMonsterDmg);
                Player.HealthOfPlayer = Player.HealthOfPlayer - dragondmg;

                if (dragondmg >= 8)
                {
                    Console.Clear();
                    Console.WriteLine();
                    Player.CenterText($"The dragon use he's fire breath against you and you take {dragondmg}");
                    Console.WriteLine();
                    Player.CenterText($"You got {Player.HealthOfPlayer} health remaning..");
                    Console.ReadKey();
                }

                if (dragondmg < 8 && dragondmg > 4)
                {
                    Console.Clear();
                    Console.WriteLine();
                    Player.CenterText($"The dragon bites you and you take {dragondmg} damage");
                    Console.WriteLine();
                    Player.CenterText($"You got {Player.HealthOfPlayer} health remaning..");
                    Console.ReadKey();
                }

                if (dragondmg < 4 && dragondmg > 0)
                {
                    Console.Clear();
                    Console.WriteLine();
                    Player.CenterText($"The dragon slashes you with he's claw and you take {dragondmg} damage");
                    Console.WriteLine();
                    Player.CenterText($"You got {Player.HealthOfPlayer} health remaning..");
                    Console.ReadKey();
                }

                if (dragondmg == 0)
                {
                    Console.Clear();
                    Console.WriteLine();
                    Player.CenterText($"The dragon missed the attack!");
                    Console.WriteLine();
                    Player.CenterText($"You got {Player.HealthOfPlayer} health remaning..");
                    Console.ReadKey();
                }
            }
        }