public void Look() { Services.ScrollText(Description, 1000); }
public void ExamineCommand(string command) { if (command.ToLower() == "bag") { _player.Bag.PrintBag(); } else if (command.ToLower() == "help") { Help(); } else if (command.ToLower() == "look") { Look(); } else if (command.Length >= 5 && command.Substring(0, 3).ToLower() == "use") { foreach (Item item in _player.Bag.GetContents()) { int index = 0; bool found = false; if (item.Name.ToLower() == command.Substring(4).ToLower() || item.Name.ToLower() == command.Substring(3).ToLower()) { index = _player.Bag.GetContents().IndexOf(item); found = true; } if (found == true) { if (_player.Bag.GetContents()[index].Name == "Map") { Item = _player.Bag.GetContents()[index]; Target = "Map"; } else if (_player.Bag.GetContents()[index].Name == "Paper") { Console.WriteLine("\n"); Services.ScrollText("1738993", 1000); Target = "Paper"; } else if (_player.Bag.GetContents()[index].Name == "Lighter") { Item = _player.Bag.GetContents()[index]; Target = "Lighter"; } else { if (Targets.Length >= 1) { Services.ScrollText("Who/what would you like to use " + _player.Bag.GetContents()[index].Name + " on?", 500); foreach (string target in Targets) { Services.ScrollText((Array.IndexOf(Targets, target) + 1) + " - " + target); } int input; string decision = Console.ReadLine(); if (Int32.TryParse(decision, out input)) { if (Targets.Length >= input) { Item = _player.Bag.GetContents()[index]; Target = Targets[input - 1]; } else { Services.ScrollText("Invalid target"); } } } else { Services.ScrollText("There are no targets available for " + _player.Bag.GetContents()[index].Name); } } } } } else { Console.WriteLine("Invalid input. Please try again."); } }
public void Basement() { Location = "the hotel's basement"; if (_state == 2) { EnterArea(basement, basementDesc, basementTarget); Services.ScrollText("(Bodrov Ilyich is sitting with his back to you and doesn't seem to see you)", 500); int input; string decision = Console.ReadLine(); if (Int32.TryParse(decision, out input)) { switch (input) { case 1: Services.ScrollText("You walk upstairs to the hotel lobby.", 500); Timer(); Hotel(); break; default: Console.WriteLine("Invalid input. Please try again."); Basement(); break; } } else { ExamineCommand(decision); if (Item != null && Target != null) { if (Target == "Bodrov Ilyich") { if (Item.Name == "Twine") { Services.ScrollText("You sneak up behind Bodrov and quickly wrap the twine around his neck...", 1500); Services.ScrollText("After a brief struggle, he sits motionless on the couch in front of you."); _player.LevelCompleted = true; } } else { Services.ScrollText("It's not very effective.", 500); Item = null; Target = null; Timer(); Basement(); } } else { Basement(); } } } else { Services.ScrollText("Uh oh, there's a guard at the doorway at the bottom of the stairs"); Services.ScrollText("Hey! No one is allowed down here. Go back upstairs!"); Timer(); Hotel(); } }
public void StageBack() { Location = "the back of the stage"; EnterArea(stageBack, stageBackDesc, stageBackTarget); int input; string decision = Console.ReadLine(); if (Int32.TryParse(decision, out input)) { switch (input) { case 1: Services.ScrollText("You take a closer look at the pile of tarps, looks like it's just a bunch of dirty tarps.", 500); Timer(); StageBack(); break; case 2: Services.ScrollText("You take a closer look at the stack of crates, they're full of fireworks!", 500); Timer(); StageBack(); break; case 3: Services.ScrollText("You walk back to the front of the stage", 500); Timer(); Stage(); break; default: Console.WriteLine("Invalid input. Please try again."); StageBack(); break; } } else { ExamineCommand(decision); if (Item != null && Target != null) { if (Target == "Guard") { if (Item.Name != "Gun") { Services.ScrollText("WHAT DO YOU THINK YOU'RE DOING?", 500); Services.ScrollText("Code red! Code red!", 1000); Services.ScrollText(". . .", 250); Services.ScrollText("Within seconds you're surrounded and outnumbered. It's hard to complete your mission from a prison cell.", 1000); Services.ScrollText("Game Over", 1000); Services.PlayAgain(); } else { Services.ScrollText("You shoot the guard in the back!", 500); Services.ScrollText("He slumps to the ground.", 500); Services.ScrollText(". . .", 250); Services.ScrollText("Within seconds you're surrounded and outnumbered. It's hard to complete your mission from a prison cell.", 1000); Services.ScrollText("Game Over", 1000); Services.PlayAgain(); } } else if (Target == "Crates") { if (Item.Name == "Gun") { Services.ScrollText("You take a few steps back and fire your gun at the crates", 500); Services.ScrollText("BOOOOOOM. . .", 1000); Services.ScrollText("What a huge explosion!", 500); Services.ScrollText("It looks like it knocked the guard on his head, he's really passed out!"); Services.ScrollText("You take your opportunity to get out of there before someone realizes you caused the explosion."); Item = null; Target = null; _state++; Timer(); Stage(); } else { Services.ScrollText("It's not very effective.", 500); Item = null; Target = null; Timer(); StageBack(); } } else { Services.ScrollText("It's not very effective.", 500); Item = null; Target = null; Timer(); StageBack(); } } else { StageBack(); } } }
public void Hotel() { Location = "the hotel"; EnterArea(hotel, hotelDesc, hotelTarget); int input; string decision = Console.ReadLine(); if (Int32.TryParse(decision, out input)) { switch (input) { case 1: Services.ScrollText("You walk over to the front desk in the lobby and strike up a conversation with the receptionist\n", 1500); Services.ScrollText("..Hello! Welcome to the Metropol Hotel. What can I do for you?", 1500); Timer(); Receptionist(); break; case 2: Services.ScrollText("You walk out the north door.", 500); Services.ScrollText("You get your gun and knife back on the way out.", 1000); _player.Bag.Add(gun); _player.Bag.Add(knife); Timer(); Stage(); break; case 3: Services.ScrollText("You walk out the south door", 500); Services.ScrollText("You get your gun and knife back on the way out.", 1000); _player.Bag.Add(gun); _player.Bag.Add(knife); Timer(); RedSquareEnterance(); break; case 4: Services.ScrollText("You walk down the stairs towards the basement", 500); Timer(); Basement(); break; default: Console.WriteLine("Invalid input. Please try again."); Stage(); break; } } else { ExamineCommand(decision); if (Item != null && Target != null) { Services.ScrollText("It's not very effective.", 500); Item = null; Target = null; Timer(); Hotel(); } Hotel(); } }
public void Stage() { Location = "front of the stage"; EnterArea(stageFront, stageFrontDesc, stageFrontTarget); int input; string decision = Console.ReadLine(); if (Int32.TryParse(decision, out input)) { switch (input) { case 1: ScanCrowd(); Timer(); Stage(); break; case 2: Services.ScrollText("You walk over to the Red Square's enterance.", 500); Timer(); RedSquareEnterance(); break; case 3: Services.ScrollText("You walk behind the stage", 500); if (_talkToGuard == false) { Services.ScrollText("You're stopped by a guard", 1000); Services.ScrollText("..Stop right there bub, no one is allowed back here."); Timer(); Guard(); } else { Timer(); StageBack(); } break; case 4: Services.ScrollText("You walk into the hotel bordering the square", 500); Services.ScrollText("There is security with a metal detector at the door, you are forced to leave your gun and knife with them.", 1000); _player.Bag.Remove(gun); _player.Bag.Remove(knife); Timer(); Hotel(); break; default: Console.WriteLine("Invalid input. Please try again."); Stage(); break; } } else { ExamineCommand(decision); if (Item != null && Target != null) { Services.ScrollText("It's not very effective.", 500); Item = null; Target = null; Timer(); Stage(); } Stage(); } }