public void CheckPlayerLocation() { if (PlayerLocation == 'S') { Console.Clear(); MenuText.DrawPicture(@"Images\South.txt"); Console.WriteLine($"You moved South"); } else if (PlayerLocation == 'N') { Console.Clear(); MenuText.DrawPicture(@"Images\North.txt"); Console.WriteLine($"You moved North"); } else if (PlayerLocation == 'E') { Console.Clear(); MenuText.DrawPicture(@"Images\East.txt"); Console.WriteLine($"You moved East"); } else if (PlayerLocation == 'W') { Console.Clear(); MenuText.DrawPicture(@"Images\West.txt"); Console.WriteLine($"You moved West"); } }
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"); } } }
public static void StoneFinalChoice() { Console.ForegroundColor = ConsoleColor.White; string input = Console.ReadLine(); string playerCommand = input.ToUpper(); Console.ForegroundColor = ConsoleColor.Blue; if (playerCommand == "YES" || playerCommand == "Y") { TypeLine("\nYou throw the stone as hard as you can at the mirror. \n"); System.Threading.Thread.Sleep(500); TypeLine("There is a huge flash of light. And then--\n"); System.Threading.Thread.Sleep(1000); TypeLine("Where the "); MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red); TypeLine(" stood, there is now a doorway, with a spiral staircase that descends into darkness. \n"); System.Threading.Thread.Sleep(500); TypeLine("You take a deep breath and begin your descent.\n"); MenuText.YouWin(); } else if (playerCommand == "NO" || playerCommand == "N") { TypeLine("\nYou put the "); MenuText.ChangeTextColor("STONE", ConsoleColor.Red); TypeLine(" back into your pocket and step away from the "); MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red); TypeLine(". \n"); } else { Console.WriteLine($"\"{playerCommand}\" is not a proper command. Please type YES or NO."); StoneFinalChoice(); } }
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"); } }
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"); } }
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"); } }
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"); } }
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); } }
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(); }
public static void OpeningText() { int textDelay = 500; Console.Clear(); TypeLine("\n \n \nYou wake up, with a start! \n"); System.Threading.Thread.Sleep(textDelay); TypeLine("You are laying on a small, hard "); MenuText.ChangeTextColor("BED", ConsoleColor.Red); TypeLine(" in an otherwise (almost) empty room. You have a small "); MenuText.ChangeTextColor("COMPASS", ConsoleColor.Red); TypeLine(" in your pocket, but no other belongings.\n"); System.Threading.Thread.Sleep(textDelay); TypeLine("At the North end of the room, there is a large ornate "); MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red); TypeLine(". \n"); System.Threading.Thread.Sleep(textDelay); TypeLine("On the East side of the room, a "); MenuText.ChangeTextColor("DESK", ConsoleColor.Red); TypeLine(". \n"); System.Threading.Thread.Sleep(textDelay); TypeLine("To the West, a "); MenuText.ChangeTextColor("WINDOW", ConsoleColor.Red); TypeLine(". \n"); System.Threading.Thread.Sleep(textDelay); TypeLine("The "); MenuText.ChangeTextColor("BED", ConsoleColor.Red); TypeLine(" you are currently sitting on is to the South.\n"); System.Threading.Thread.Sleep(textDelay); TypeLine("You look around the small room, and see the sparse decorations, the stone walls, the single "); MenuText.ChangeTextColor("WINDOW", ConsoleColor.Red); TypeLine(" with only the sky in view. \n"); System.Threading.Thread.Sleep(textDelay); TypeLine("You seem to be in a tower. \n"); System.Threading.Thread.Sleep(textDelay); TypeLine("There seems to be no way in or out. \n"); System.Threading.Thread.Sleep(textDelay); Console.ForegroundColor = ConsoleColor.Yellow; TypeLine("For Help/Instructions, type \"HELP\" \n"); Console.ForegroundColor = ConsoleColor.Blue; System.Threading.Thread.Sleep(textDelay); }
public static void TitleCard() { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(" ▄████▄ ▄▄▄ ██████ ▄▄▄█████▓ ██▓ ▓█████ ▓█████ ██████ ▄████▄ ▄▄▄ ██▓███ ▓█████ "); Console.WriteLine("▒██▀ ▀█ ▒████▄ ▒██ ▒ ▓ ██▒ ▓▒▓██▒ ▓█ ▀ ▓█ ▀ ▒██ ▒▒██▀ ▀█ ▒████▄ ▓██░ ██▒▓█ ▀ "); Console.WriteLine("▒▓█ ▄ ▒██ ▀█▄ ░ ▓██▄ ▒ ▓██░ ▒░▒██░ ▒███ ▒███ ░ ▓██▄ ▒▓█ ▄ ▒██ ▀█▄ ▓██░ ██▓▒▒███ "); Console.WriteLine("▒▓▓▄ ▄██▒░██▄▄▄▄██ ▒ ██▒░ ▓██▓ ░ ▒██░ ▒▓█ ▄ ▒▓█ ▄ ▒ ██▒▓▓▄ ▄██▒░██▄▄▄▄██ ▒██▄█▓▒ ▒▒▓█ ▄ "); Console.WriteLine("▒ ▓███▀ ░ ▓█ ▓██▒▒██████▒▒ ▒██▒ ░ ░██████▒░▒████▒ ░▒████▒▒██████▒▒ ▓███▀ ░ ▓█ ▓██▒▒██▒ ░ ░░▒████▒"); Console.WriteLine("░ ░▒ ▒ ░ ▒▒ ▓▒█░▒ ▒▓▒ ▒ ░ ▒ ░░ ░ ▒░▓ ░░░ ▒░ ░ ░░ ▒░ ░▒ ▒▓▒ ▒ ░ ░▒ ▒ ░ ▒▒ ▓▒█░▒▓▒░ ░ ░░░ ▒░ ░"); Console.WriteLine(" ░ ▒ ▒ ▒▒ ░░ ░▒ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░░ ░▒ ░ ░ ░ ▒ ▒ ▒▒ ░░▒ ░ ░ ░ ░"); Console.WriteLine("░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ░ "); Console.WriteLine("░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░"); Console.WriteLine("░ ░ "); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("\n A Text Adventure Game By Sean Giddings"); System.Threading.Thread.Sleep(2000); Console.WriteLine("\n \n \n"); MenuText.HelpMenu(); TypeLine("\n \n \n Hit ENTER to begin"); Console.ReadLine(); }
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"); } } }
// 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"); } } }
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"); } }
public static void BookFinalChoice() { Console.ForegroundColor = ConsoleColor.White; string input = Console.ReadLine(); string playerCommand = input.ToUpper(); Console.ForegroundColor = ConsoleColor.Blue; if (playerCommand == "YES" || playerCommand == "Y") { TypeLine("\nThere is a flash of light.\n"); System.Threading.Thread.Sleep(500); TypeLine("When you open your eyes, everything around you is dark.\n"); System.Threading.Thread.Sleep(500); TypeLine("Before you, you see the "); MenuText.ChangeTextColor("STRANGE MAN", ConsoleColor.Cyan); TypeLine(" standing in the tower you were trapped in. \n"); System.Threading.Thread.Sleep(500); TypeLine("He continues to laugh, silently, as he picks up a "); MenuText.ChangeTextColor("STONE", ConsoleColor.Red); TypeLine(" and throws it at you. \n"); System.Threading.Thread.Sleep(500); TypeLine("Your view shatters, and everything goes black.\n"); MenuText.GameOver(); Player.IsPlaying = false; } else if (playerCommand == "NO" || playerCommand == "N") { TypeLine("\nYou put the "); MenuText.ChangeTextColor("MAGIC BOOK", ConsoleColor.Red); TypeLine(" back into your pocket and step away from the "); MenuText.ChangeTextColor("MIRROR", ConsoleColor.Red); TypeLine(". \n"); } else { Console.WriteLine($"\"{playerCommand}\" is not a proper command. Please type YES or NO."); BookFinalChoice(); } }
// 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"); } }