示例#1
0
        static void BattleLoop(Player player, Slime slime, Ally ally)
        {
            Random random = new Random();

            do
            {
                ScreenWindows.ClearPlayerTextBox();
                if (slime.KingSlime)
                {
                    ScreenWindows.DisplayKingSlime();
                }
                else
                {
                    ScreenWindows.DisplaySlime(slime);
                }
                ScreenWindows.SlimeAndChatColor(slime);

                Player(player, slime, ally);
                Thread.Sleep(1000);
                ScreenWindows.ClearPlayerTextBox();
                if (slime.Health > 0)
                {
                    SlimeATK(player, slime);
                }
            } while ((player.Health > 0) && (slime.Health > 0));



            ScreenWindows.ClearPlayerTextBox();
            Console.ForegroundColor = ConsoleColor.Yellow;
            #region Gold and Experience
            int goldDrop;
            int exp;
            if (slime.KingSlime)
            {
                goldDrop = random.Next(60, 100);
                exp      = random.Next(200, 500);
            }
            else if (slime.Color == "red")
            {
                goldDrop = random.Next(20, 30);
                exp      = random.Next(100, 150);
            }
            else if (slime.Color == "blue")
            {
                goldDrop = random.Next(10, 15);
                exp      = random.Next(60, 100);
            }
            else if (slime.Color == "green")
            {
                goldDrop = random.Next(4, 7);
                exp      = random.Next(20, 60);
            }
            else
            {
                goldDrop = random.Next(2, 5);
                exp      = random.Next(2, 30);
            }
            Console.SetCursorPosition(27, 33);
            Console.Write($"You have succeeded in battle and have recieved {goldDrop} Gold!");
            Console.SetCursorPosition(27, 34);
            Console.Write($"You gained {exp} Experience Points!");
            #endregion



            if (slime.HasCharm)
            {
                InitializeAlly(ally, slime, player);
                Console.SetCursorPosition(27, 34);
                Console.Write("You picked up a Slime charm... You put it around your neck.");
                Thread.Sleep(1000);
                Console.SetCursorPosition(27, 35);
                Console.Write("A little slime appears next to you and jumps on your head");
                Thread.Sleep(1000);
                switch (ally.Charm)
                {
                case Ally.Charms.REDCHARM:
                    Console.SetCursorPosition(27, 36);
                    Console.Write("It appears the slime is wielding its own sword");
                    Thread.Sleep(2500);
                    Console.SetCursorPosition(27, 37);
                    Console.WriteLine("The slime fights along side you!");
                    Thread.Sleep(1000);
                    break;

                case Ally.Charms.BLUECHARM:
                    Console.SetCursorPosition(27, 36);
                    Console.Write("The slime makes a small shield out of its own goo, ");
                    Thread.Sleep(2500);
                    Console.SetCursorPosition(27, 37);
                    Console.WriteLine("It seems to be trying to protect you...");
                    Thread.Sleep(1000);
                    break;

                case Ally.Charms.PINKCHARM:
                    Console.SetCursorPosition(27, 36);
                    Console.Write("You feel your injuries heal slightly");
                    Thread.Sleep(2500);
                    Console.SetCursorPosition(27, 37);
                    Console.WriteLine("You regained 5 health!");
                    Thread.Sleep(1000);
                    player.Health = player.Health + 5;
                    if (player.Health > player.MaxHealth)
                    {
                        player.Health = player.MaxHealth;
                    }
                    break;

                case Ally.Charms.GREENCHARM:
                    Console.SetCursorPosition(27, 36);
                    Console.Write("You start remembering more about your battle");
                    Thread.Sleep(2500);
                    Console.SetCursorPosition(27, 37);
                    Console.WriteLine("Experience boost!");
                    Thread.Sleep(1000);
                    break;

                default:
                    Console.SetCursorPosition(27, 36);
                    Console.Write("BROKEN ERROR ERROR ERROR ERROR");
                    Thread.Sleep(2500);
                    Console.SetCursorPosition(27, 37);
                    Console.WriteLine("SOME SHIT WENT DOWN NOW FIX OR WAIT A YEAR ");
                    Thread.Sleep(99999999);
                    break;
                }


                ScreenWindows.DisplayContinuePrompt(103, 38);
                ScreenWindows.ClearPlayerTextBox();
            }
            Console.ForegroundColor = ConsoleColor.Gray;
            player.Gold             = player.Gold + goldDrop;
            ScreenWindows.DisplayContinuePrompt(103, 38);
        }
示例#2
0
        //-----------------------------Slime PASSIVE-------------------------------------

        static void SlimePassive(Player player, Slime slime, Ally ally)
        {
            //Some setup
            ScreenWindows.DisplayGameScreen();
            ScreenWindows.DisplayTextBoxPlayer();
            ScreenWindows.SlimeAndChatColor(slime);
            ScreenWindows.DisplaySlime(slime);
            Random random       = new Random();
            int    slimePassive = random.Next(1, 4);
            bool   fight        = false;

            //The chances to happen
            ScreenWindows.ClearPlayerTextBox();
            if (slimePassive == 1)
            {
                Console.SetCursorPosition(27, 33);
                Console.Write("The slime slides around in a circle");
            }

            else if (slimePassive == 2)
            {
                Console.SetCursorPosition(27, 33);
                Console.Write("The slime lunges at you but misses...");

                Thread.Sleep(1000);
                Console.SetCursorPosition(27, 34);
                Console.Write("It seems to want to play");
                Thread.Sleep(2000);
            }
            else if (slimePassive == 3)
            {
                Console.SetCursorPosition(27, 33);
                Console.Write("The slime jiggles it's body");
                Thread.Sleep(1000);
                Console.SetCursorPosition(27, 34);
                Console.Write("It seems to be taunting you");
            }
            else
            {
            }
            Thread.Sleep(2000);
            ScreenWindows.ClearPlayerTextBox();

            Console.SetCursorPosition(27, 31);
            Console.Write("Would you like to fight the slime minding its own buisness?");


            ConsoleKeyInfo keyPress;
            bool           optionSelected = false;

            Console.CursorVisible = false;
            //Options
            Console.SetCursorPosition(33, 33);
            Console.Write("Yes");
            Console.SetCursorPosition(33, 34);
            Console.Write("No");
            ScreenWindows.DisplayTextBoxPlayer();
            fight = true;
            Console.SetCursorPosition(29, 33);
            Console.Write("->");
            int tOb     = 33;
            int tObLast = 33;

            while (!optionSelected)
            {
                keyPress = Console.ReadKey();

                if (keyPress.Key == ConsoleKey.UpArrow)
                {
                    tOb = 33;
                    Console.SetCursorPosition(29, tObLast);
                    Console.Write("   ");
                    Console.SetCursorPosition(29, tOb);
                    Console.Write("-> ");
                    fight   = true;
                    tObLast = tOb;
                }
                if (keyPress.Key == ConsoleKey.DownArrow)
                {
                    tOb = 34;
                    Console.SetCursorPosition(29, tObLast);
                    Console.Write("   ");
                    Console.SetCursorPosition(29, tOb);
                    Console.Write("-> ");
                    fight   = false;
                    tObLast = tOb;
                }
                if (keyPress.Key == ConsoleKey.Enter)
                {
                    optionSelected = true;
                }
            }
            ScreenWindows.ClearPlayerTextBox();

            Console.SetCursorPosition(27, 33);
            if (fight)
            {
                BattleLoop(player, slime, ally);
            }
            else if (!fight)
            {
                Console.Write("You continue on...");
            }
            Thread.Sleep(2000);
            Console.ForegroundColor = ConsoleColor.Gray;
        }