Ejemplo n.º 1
0
        static void Jurassic(Hero player, Hero partner)
        {
            player.Location = "Jurassic Forest";
            Dinosaur dino1 = new Dinosaur("Dino");

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine($"{player.Location}");
            Console.WriteLine("You emerge from an ancient jungle temple to find a Tyranosaurus Rex writhing in anger, as it charges toward you in a torrential hurricane of speed and power.");
            dino1.Attack(player);
            player.Attack(dino1);
            dino1.EatGrass();
            Console.WriteLine("Press Enter to fight the Dinosaur!");
            ConsoleKey key = Console.ReadKey(true).Key;

            while (key != ConsoleKey.Enter)
            {
                key = Console.ReadKey(true).Key;
            }
            while (dino1.health > 0 && player.health > 0)
            {
                dino1.Attack(player);
                player.Attack(dino1);
            }
            if (player.health > 0)
            {
                Console.WriteLine("You killed the dinosaur!");
                if (player.health < 25)
                {
                    Console.WriteLine("Your health is less than 25, you have been given a Power up");
                    player.Power(player);
                }
                player.DinoDone = true;
            }
            else
            {
                Console.WriteLine("You have been killed by the dinosaur :(");
            }
        }