コード例 #1
0
        public void Kill(Player player, Enemies enemy, GameImages images, GameDialogue dialogue)// when player wins
        {
            int c = rand.Next(0, 45);

            SetCursorPosition(54, 40); Console.WriteLine($"As you stand vitorious over {enemy.Name}!");
            SetCursorPosition(54, 41); WriteLine($"You get ready to leave and spot gold coins around {enemy.Name}! You pick up {c} coins.");
            SetCursorPosition(54, 42); WriteLine("Press any key to continue...");
            ReadKey();
            player.Coin += c;
        }
コード例 #2
0
        public void StoryFightMenu(Player player, Enemies enemy, GameImages images, GameDialogue dialogue)
        {
            CursorVisible = false;
restart:


            while (player.Health > 0 && enemy.Health > 0)
            {
                SetCursorPosition(58, 45);
                DrawFightMenu(player, enemy, images);
                SetCursorPosition(54, 40); WriteLine($" Press (A) to attack, (D) to Defend, (H) to heal....");
                SetCursorPosition(54, 40); WriteLine($"                                                                                      ");
                FightKeyHandling(player, enemy, images);
                ReadKey();
            }
            if (enemy.Health < 1)
            {
                DrawFightMenu(player, enemy, images);
                Kill(player, enemy, images, dialogue);
            }
            else if (player.Life > 0 && player.Health < 1)
            {
                DrawFightMenu(player, enemy, images);
                SetCursorPosition(54, 40); WriteLine($"You are dying. Do you have any elixirs? If so, press L to use it!");
                ConsoleKeyInfo keyInfo  = ReadKey(true);
                ConsoleKey     key; key = keyInfo.Key;
                switch (key)
                {
                case ConsoleKey.L:

                    if (player.Life > 0)
                    {
                        images.ActionMenu(player);
                        SetCursorPosition(54, 40); WriteLine($"In a deperate attempt, you reach into your sack and pull out an elixir.");
                        SetCursorPosition(54, 41); WriteLine($"Glowing bright green, you chug it as quickly as possible.");
                        SetCursorPosition(54, 42); WriteLine($" Atlas! You feel brand new and ready to continue the fight!");
                        SetCursorPosition(54, 43); WriteLine("Press any key to continue...");
                        player.Life--;
                        player.Health += 40;
                        ReadKey();
                        goto restart;
                    }
                    break;

                default:
                    Death(enemy, images, dialogue);
                    break;
                }
            }
            else if (player.Life == 0 && player.Health < 1)
            {
                Death(enemy, images, dialogue);
            }
        }
コード例 #3
0
        public void Death(Enemies enemy, GameImages images, GameDialogue dialogue)// when player dies
        {
            Clear();
            images.Death();
            SetCursorPosition(54, 40); WriteLine($"In a deperate attempt, you reach into your sack and see feel nothing.");
            SetCursorPosition(54, 41); WriteLine($"Feeling tired, you let your guard down {enemy.Name} deals the final blow. Dude you are dead!");
            SetCursorPosition(54, 42); WriteLine("Press any key to continue...");
            ReadKey();
            Clear();
            //go back to start menu
            images.TitlePage();
            images.MainMenu();

            bool mainMenu = true;

            while (mainMenu)
            {
                SetCursorPosition(113, 34);
                mainMenu = MainMenu(images);
            }
        }
コード例 #4
0
        public void ChapBoss(Player player, GameImages images, GameDialogue dialogue, Enemies enemies, UserMenus menu)
        {
            Clear();

            menu.StoryFightMenu(CurrentPlayer, enemies, images, dialogue);
        }