コード例 #1
0
 public static void UseBed(string useCommand)
 {
     if (useCommand == "USE BED")
     {
         if (Player.PlayerLocation == 'S')
         {
             if (!Player.CheckInventory("KEY"))
             {
                 MenuText.TypeLine("You climb into the rough bed and notice something inside the pillow... A ");
                 MenuText.ChangeTextColor("KEY", ConsoleColor.Red);
                 MenuText.TypeLine("?\n");
                 System.Threading.Thread.Sleep(500);
                 MenuText.TypeLine("You put it in your bag.\n");
                 Player.inventory.Add("KEY");
             }
             else if (Player.CheckInventory("KEY"))
             {
                 MenuText.TypeLine("You climb into the rough bed, and remember finding the ");
                 MenuText.ChangeTextColor("KEY", ConsoleColor.Red);
                 MenuText.TypeLine(" inside the pillow.\n");
                 System.Threading.Thread.Sleep(500);
                 MenuText.TypeLine("There's nothing else to find here.\n");
             }
         }
         else
         {
             MenuText.TypeLine("You are not close enough to the ");
             MenuText.ChangeTextColor("BED", ConsoleColor.Red);
             MenuText.TypeLine(" to use it.\n");
         }
     }
 }
コード例 #2
0
 public static void NorthLook()
 {
     if (Player.PlayerLocation == 'N')
     {
         MenuText.TypeLine("You see an ancient, mysterious ");
         MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red);
         MenuText.TypeLine(" with runes etched across both sides.\n");
     }
 }
コード例 #3
0
 public static void SouthLook()
 {
     if (Player.PlayerLocation == 'S')
     {
         MenuText.TypeLine("You see the ");
         MenuText.ChangeTextColor("BED", ConsoleColor.Red);
         MenuText.TypeLine(" you woke up on.\n");
     }
 }
コード例 #4
0
 public static void EastLook()
 {
     if (Player.PlayerLocation == 'E')
     {
         MenuText.TypeLine("You see a modest wooden writing ");
         MenuText.ChangeTextColor("DESK", ConsoleColor.Red);
         MenuText.TypeLine(", with an open ");
         MenuText.ChangeTextColor("JOURNAL", ConsoleColor.Red);
         MenuText.TypeLine(" sitting on top.\n");
     }
 }
コード例 #5
0
 public static void WestLook()
 {
     if (Player.PlayerLocation == 'W')
     {
         MenuText.TypeLine("You see a small ");
         MenuText.ChangeTextColor("WINDOW", ConsoleColor.Red);
         MenuText.TypeLine(" that is far too narrow to climb out of.\n");
         System.Threading.Thread.Sleep(500);
         MenuText.TypeLine("Below the open window is some broken glass, and a handful of small ");
         MenuText.ChangeTextColor("STONES", ConsoleColor.Red);
         MenuText.TypeLine(".\n");
     }
 }
コード例 #6
0
 static void CompassText()
 {
     {
         MenuText.TypeLine("There are four sides to this room. \nTo the North, a ");
         MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red);
         MenuText.TypeLine(".\nTo the East, ");
         MenuText.ChangeTextColor("DESK", ConsoleColor.Red);
         MenuText.TypeLine(".\nTo the South, a ");
         MenuText.ChangeTextColor("BED", ConsoleColor.Red);
         MenuText.TypeLine(".\nTo the West, a ");
         MenuText.ChangeTextColor("WINDOW", ConsoleColor.Red);
     }
 }
コード例 #7
0
ファイル: Game.cs プロジェクト: SeanGiddings/CastleEscapeGame
        public Game()
        {
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Blue;
            if (Debug == false)
            {
                MenuText.TitleCard();
                MenuText.OpeningText();
            }

            MenuText.TypeLine("What would you like to do?\n");
            UsableItems UsableItems = new UsableItems();
            Player      player      = new Player();
        }
コード例 #8
0
 public static void UseKey(string useCommand)
 {
     if (useCommand == "USE KEY")
     {
         if (!Player.CheckInventory("KEY"))
         {
             MenuText.TypeLine("You dont have a ");
             MenuText.ChangeTextColor("KEY", ConsoleColor.Red);
             MenuText.TypeLine(".\n");
         }
         else if (Player.CheckInventory("KEY") && !(Player.PlayerLocation == 'E'))
         {
             MenuText.TypeLine("There is no reason to use a ");
             MenuText.ChangeTextColor("KEY", ConsoleColor.Red);
             MenuText.TypeLine(" here.\n");
         }
         else if (Player.PlayerLocation == 'E' && (useCommand == "USE KEY" && Player.CheckInventory("KEY") && !Player.CheckInventory("MAGIC BOOK")))
         {
             MenuText.TypeLine("You unlock the ");
             MenuText.ChangeTextColor("SECRET COMPARTMENT", ConsoleColor.Red);
             MenuText.TypeLine(" with a *click*.\n");
             System.Threading.Thread.Sleep(500);
             MenuText.TypeLine("Inside, you find a ");
             MenuText.ChangeTextColor("MAGIC BOOK", ConsoleColor.Red);
             MenuText.TypeLine(". \n");
             System.Threading.Thread.Sleep(500);
             MenuText.TypeLine("You take it.\n");
             Player.inventory.Add("MAGIC BOOK");
         }
         else if (Player.PlayerLocation == 'E' && (useCommand == "USE KEY" && Player.CheckInventory("KEY") && Player.CheckInventory("MAGIC BOOK")))
         {
             MenuText.TypeLine("You have already unlocked the ");
             MenuText.ChangeTextColor("SECRET COMPARTMENT", ConsoleColor.Red);
             MenuText.TypeLine(" and found the ");
             MenuText.ChangeTextColor("MAGIC BOOK", ConsoleColor.Red);
             MenuText.TypeLine(".\n");
         }
     }
 }
コード例 #9
0
 // All Usable Items, and their text are below here.
 public static void UseMirror(string useCommand)
 {
     if (useCommand == "USE MIRROR")
     {
         if (Player.PlayerLocation == 'N')
         {
             MenuText.TypeLine("You look at the ");
             MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red);
             MenuText.TypeLine(" and instead of seeing your reflection, you see a ");
             MenuText.ChangeTextColor("STRANGE MAN", ConsoleColor.Cyan);
             MenuText.TypeLine(" motioning to the Runes on either side.\n");
             System.Threading.Thread.Sleep(500);
             MenuText.TypeLine("Perhaps if you could decipher them, you could learn more about the Man trapped in the mirror?\n");
         }
         else
         {
             MenuText.TypeLine("You are not close enough to the ");
             MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red);
             MenuText.TypeLine(" to use it.\n");
         }
     }
 }
コード例 #10
0
 public static void UseItemCommand(string useCommand)
 {
     if (usableItems.Contains(useCommand))
     {
         UseMirror(useCommand);
         UseKey(useCommand);
         UseBed(useCommand);
         UseCompass(useCommand);
         UseWindow(useCommand);
         UseStone(useCommand);
         UseDesk(useCommand);
         UseJournal(useCommand);
         UseMagicBook(useCommand);
         UseSecretCompartment(useCommand);
     }
     else
     {
         MenuText.TypeLine($"{useCommand} is not a proper command. Type ");
         MenuText.ChangeTextColor("\"HELP\"", ConsoleColor.Yellow);
         MenuText.TypeLine(" for assistance with the USE command.\n");
     }
 }
コード例 #11
0
        // This method handles the commands the player types into the Console
        public void PlayerCommand()
        {
            Console.ForegroundColor = ConsoleColor.White;
            string input         = Console.ReadLine();
            string playerCommand = input.ToUpper();

            Console.ForegroundColor = ConsoleColor.Blue;
            if (playerCommand == "SOUTH" || playerCommand == "S")
            {
                if (PlayerLocation == 'S')
                {
                    MenuText.TypeLine("You are already South.\n");
                }
                else
                {
                    PlayerLocation = 'S';
                    CheckPlayerLocation();
                }
            }
            else if (playerCommand == "NORTH" || playerCommand == "N")
            {
                if (PlayerLocation == 'N')
                {
                    MenuText.TypeLine("You are already North.\n");
                }
                else
                {
                    PlayerLocation = 'N';
                    CheckPlayerLocation();
                }
            }
            else if (playerCommand == "EAST" || playerCommand == "E")
            {
                if (PlayerLocation == 'E')
                {
                    MenuText.TypeLine("You are already East.\n");
                }
                else
                {
                    PlayerLocation = 'E';
                    CheckPlayerLocation();
                }
            }
            else if (playerCommand == "WEST" || playerCommand == "W")
            {
                if (PlayerLocation == 'W')
                {
                    MenuText.TypeLine("You are already West.\n");
                }
                else
                {
                    PlayerLocation = 'W';
                    CheckPlayerLocation();
                }
            }
            else if (playerCommand == "EXIT")
            {
                IsPlaying = false;
            }
            else if (playerCommand == "INVENTORY" || playerCommand == "INV")
            {
                Console.ForegroundColor = ConsoleColor.DarkMagenta;
                Console.WriteLine("Your bag contains:");
                inventory.ForEach(Console.WriteLine);
                Console.ForegroundColor = ConsoleColor.Blue;
            }
            else if (playerCommand == "HELP")
            {
                MenuText.HelpMenu();
            }
            else if (playerCommand == "LOOK")
            {
                Look.LookCommand();
            }
            else if (playerCommand.Contains("USE") == true)
            {
                UsableItems.UseItemCommand(playerCommand);
            }
            else
            {
                Console.WriteLine($"\"{playerCommand}\" is not a proper command. Please type \"HELP\" for all available commands");
            }
        }