Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- interface Herbergi
- {
- Herbergi Run();
- }
- class Hallway : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are at the hallway. What do you want to do?");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "go south")
- return new Gatehouse();
- else if (command == "look")
- Console.WriteLine("To the south is the Gatehouse, to the north is a hall.");
- else if (command == "go north")
- return new Gateroom();
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- class ManTalk : Herbergi
- {
- public static bool talk = false;
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- if (talk == false)
- {
- Console.WriteLine("\nMan: What do you want?\n");
- Console.WriteLine("1. I want to pass here.\n2. Nothing");
- Console.Write("Option: ");
- string option = Console.ReadLine().ToLower();
- if (option == "1")
- {
- while (true)
- {
- Console.WriteLine("\nYou: I want to pass here.\n");
- Console.WriteLine("Man: Why should I let you pass here?\n");
- Console.WriteLine("1. Nevermind, I'll just leave.\n2. I have orders from the mayor to pass here.\n3. Because someone as weak as you should not stand in my way!");
- Console.Write("Option: ");
- string option2 = Console.ReadLine().ToLower();
- if (option2 == "1")
- {
- Console.WriteLine("\nYou: Nevermind, I'll just leave.\n");
- Console.ReadKey(true);
- return new Gateroom();
- }
- else if (option2 == "2")
- {
- Console.WriteLine("\nYou: I have orders from the mayor to pass here.\n");
- Console.WriteLine("Man: Don't lie to me, you bandit!\n");
- Console.WriteLine("The man takes a sword hidden on him and stabs you in the chest.\nYou bleed out on the floor and die.");
- Console.ReadKey(true);
- return null;
- }
- else if (option2 == "3")
- {
- Console.WriteLine("\nYou: Because someone as weak as you should not stand in my way!\n");
- Console.WriteLine("");
- Console.ReadKey(true);
- return null;
- }
- else
- Console.WriteLine("Option not valid");
- }
- }
- else if (option == "2")
- {
- Console.WriteLine("\nYou: Nothing\n");
- Console.ReadKey(true);
- return new Gateroom();
- }
- else
- Console.WriteLine("Option not valid");
- }
- else
- {
- Console.WriteLine("Man: Please pass through.");
- Console.ReadKey(true);
- return new Gateroom();
- }
- }
- }
- }
- class Start : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- Console.WriteLine("You wake up in a jail. You don't remember what happened.");
- Console.ReadKey();
- return new Jail();
- }
- }
- class JailCell : Herbergi
- {
- public static bool Key = false;
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are in a jail cell, what do you want to do.");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "look")
- {
- if (Key == false)
- Console.WriteLine("You are in a cell, the cell is locked.\nYou see something glitter in the drain.");
- else
- Console.WriteLine("You are in a cell, the cell is locked.");
- }
- else if (command == "search drain")
- {
- if (Key == false)
- {
- Console.WriteLine("You find a key in the drain, you pick it up.");
- Key = true;
- }
- else
- Console.WriteLine("There is nothing more in the drain.");
- }
- else if (command == "open cell")
- {
- if (Key == false)
- Console.WriteLine("You cannot open the cell, the cell door is locked.");
- else
- {
- Console.WriteLine("You open the cell door with the key");
- Console.ReadKey();
- return new Jail();
- }
- }
- }
- }
- }
- class Jail : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are outside your cell. What do you want to do");
- Console.WriteLine("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "look")
- Console.WriteLine("You seem to be in a dungeon, your cell is behind you.\nThere are stairs leading up");
- else if (command == "go to cell")
- Console.WriteLine("\nYou: I don't want to go back in there.\n");
- else if (command == "go up")
- }
- }
- }
- class Gateroom : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are in a large hall. What do you want to do?");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "go south")
- return new Hallway();
- else if (command == "look")
- Console.WriteLine("\nTo the south is the hallway, there is a man standing near stairs leading down.\n");
- else if (command == "talk to man")
- return new ManTalk();
- else if (command == "go down")
- {
- if (ManTalk.talk == true)
- return null;
- else
- Console.WriteLine("The man is standing in the way.");
- }
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- class Gate2nd : Herbergi
- {
- public static bool leaver = false;
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are on the 2nd floor in the Gatehouse. What do you want to do");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "go down")
- return new Gatehouse();
- else if (command == "pull leaver")
- {
- if (leaver == false)
- {
- Console.WriteLine("You hear the gate opening.");
- leaver = true;
- }
- else
- Console.WriteLine("You have already pulled the leaver");
- }
- else if (command == "push leaver")
- {
- if (leaver == true)
- {
- Console.WriteLine("You hear the gate closing.");
- leaver = false;
- }
- else
- Console.WriteLine("You have already pushed the leaver");
- }
- else if (command == "look")
- Console.WriteLine("\nThere is a leaver on the wall, there are stairs leading down.\n");
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- class Gatehouse : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are at the first floor of the gatehouse. What do you want to do?");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "go north")
- {
- return new Hallway();
- }
- else if (command == "look")
- Console.WriteLine("\nTo the north is a hallway, there is an exit to the south but the gate is closed, there are stairs leading up.\n");
- else if (command == "go up")
- return new Gate2nd();
- else if (command == "go south")
- {
- if (Gate2nd.leaver == false)
- Console.WriteLine("The gate is closed.");
- else
- return null;
- }
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- /*class outside : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are outside of the gatehouse. what do you do?");
- Console.Write("Command: ");
- string command = Console.ReadLine() .ToLower();
- if(command == "look")
- {
- Console.WriteLine("the gatehouse is to the north. \nThere are three houses infront of the gatehouse.\nThere is a wall around everything and you see a gate on the wall");
- }
- else if(command == "go north")
- {
- return new Gatehouse();
- }
- else if(command == "hint")
- {
- Console.WriteLine("you can use 'go to house1'...house2...house3...gate");
- }
- else if(command == "go to house1")
- {
- return new house1();
- }
- else if(command == "go to house2")
- {
- return new house2();
- }
- else if(command == "go to house3")
- {
- return new house3();
- }
- else if(command == "go to gate")
- {
- return new gate();
- }
- }
- }
- }
- class gate : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are at the wall. what do you do?");
- Console.Write("Command: ");
- string command = Console.ReadLine() .ToLower();
- if(command == "look")
- {
- Console.WriteLine("you see a gate on the wall \nyou see the three houses and the gatehouse");
- }
- else if(command == "go to gatehouse")
- {
- return new outside();
- }
- else if(command == "go to house1")
- {
- return new house1();
- }
- else if(command == "go to house2")
- {
- return new house2();
- }
- else if(command == "go to house3")
- {
- return new house3();
- }
- else if (command == "talk to man")
- return new ManTalk2();
- else if (command == "open gate")
- {
- if (ManTalk2.talk == true)
- return null;
- else
- Console.WriteLine("The man is standing in the way.");
- }
- }
- }
- }
- class GuardTalk : Herbergi
- {
- public static bool Talk = false;
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- if (Talk == false)
- {
- Console.WriteLine("\nMan: What do you want?\n");
- Console.WriteLine("1. I want to pass here.\n2. Nothing");
- Console.Write("Option: ");
- string option = Console.ReadLine().ToLower();
- if (option == "1")
- {
- while (true)
- {
- Console.WriteLine("\nYou: I want to pass here.\n");
- Console.WriteLine("Man: The only way to get pass the gate is to defet me in battle");
- Console.WriteLine("1. Nevermind, I'll just leave.\n2. alright lets fight");
- Console.Write("Option: ");
- string option2 = Console.ReadLine().ToLower();
- if (option2 == "1")
- {
- Console.WriteLine("\nYou: Nevermind, I'll just leave.\n");
- Console.ReadKey(true);
- return new gate();
- }
- else if (option2 == "2")
- {
- Console.WriteLine("\nYou: I have orders from the mayor to pass here.\n");
- Console.WriteLine("Man: Ohh, I am sorry I did not know that. Please pass through.\n");
- Console.WriteLine("The man moves out of the way.");
- Talk = true;
- Console.ReadKey(true);
- return new Gateroom();
- }
- else
- Console.WriteLine("Option not valid");
- }
- }
- else if (option == "2")
- {
- Console.WriteLine("\nYou: Nothing\n");
- Console.ReadKey(true);
- return new Gateroom();
- }
- else
- Console.WriteLine("Option not valid");
- }
- else
- {
- Console.WriteLine("Man: Please pass through.");
- Console.ReadKey(true);
- return new Gateroom();
- }
- }
- }
- }
- class House1 : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You enter an empty house.");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "go out")
- {
- return new Gatehouse();
- }
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- class House2 : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You enter a dark house. What do you want to do?.");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (Door.torch == true)
- {
- while(true)
- {
- if (command == "look")
- Console.WriteLine("You can't see anything, but you can use your torch");
- else if (command == "use torch")
- {
- Console.WriteLine("You take up the torch and light up the house.")
- Console.ReadKey(true);
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are in a room. What do you want to do.");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "look")
- {
- Console.WriteLine("You see a key on a table across the room.");
- }
- else if (command == "pick up key")
- }
- }
- else if (command == "look")
- Console.WriteLine("You can't see anything.");
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- class House3 : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You enter a house and see stairs to the right. What do you want to do?");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "go right")
- {
- return new Upstairs();
- }
- else if (command == "go out")
- {
- return new Gatehouse();
- }
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- class Upstairs : Herbergi
- {
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You are upstairs. What do you want to do?");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "open door")
- {
- return new Door();
- }
- else if (command == "go down");
- {
- return new House3();
- }
- else if (command == "look");
- {
- Console.WriteLine("you see a door infront of you. \nThe stairs are behind you");
- }
- else
- Console.WriteLine("Command not found.");
- }
- }
- }
- class Door : Herbergi
- {
- public static bool torch = false;
- public Herbergi Run()
- {
- Console.Clear();
- while (true)
- {
- Console.WriteLine("You open the door and come into a room.");
- Console.Write("Command: ");
- string command = Console.ReadLine().ToLower();
- if (command == "go out")
- {
- return new Upstairs();
- }
- else if (command == "look");
- }
- Console.WriteLine("The only thing in the room is a table and on the table is a torch");
- }
- else if (command == "pick up torch");
- {
- if (torch == false)
- {
- Console.WriteLine("you pick up the torch");
- torch = true;
- }
- else
- Console.WriteLine("you already have the torch.")
- }
- else
- Console.WriteLine("Command not found.");
- }
- }
- }*/
- class leikur
- {
- static void Main()
- {
- Herbergi nextRoom = new Gatehouse();
- while (nextRoom != null)
- {
- nextRoom = nextRoom.Run();
- }
- }
- }
Add Comment
Please, Sign In to add comment