Beispiel #1
0
        public void Bathroom()
        {
            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine("Bathroom");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine();
            Console.WriteLine("You are in a bathroom. The tub is missing and there is random plumbing pipes coming out of the wall. There is missing sheetrock on the walls and some bare studs. The vanity sink is dirty like it hasnt been used much.");
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            string input3 = Console.ReadLine().ToLower();

            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.Cyan;
            switch (input3)
            {
            case "n":
                Console.WriteLine();
                Console.WriteLine("You are facing the vanity cabinet.");
                Console.WriteLine();
                Bathroom();
                break;

            case "e":
                Console.WriteLine();
                Console.WriteLine("You are facing a toilet.");
                Console.WriteLine();
                Bathroom();
                break;

            case "s":
                Console.Clear();
                Bedroom();
                break;

            case "w":
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("You fell into a hole where the tub was, you broke your neck.");
                Console.WriteLine();
                Console.BackgroundColor = ConsoleColor.White;
                Console.WriteLine("You LOSE!!!");
                Console.BackgroundColor = ConsoleColor.Black;
                Console.WriteLine();
                Win();
                break;

            case "l":
                Console.Clear();
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine();
                Console.WriteLine("To the north you see a vanity cabinet and sink, on top of the sink is a screwdriver. The east wall has a crummy looking toilet. The west wall is where a tub used to be and there is a big hole in the floor, you can see down into the basement.");
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine();
                Bathroom();
                break;

            case "take screwdriver":
                if (CurrentPlayer.Inventory.Count > 0)
                {
                    Console.WriteLine();
                    Console.WriteLine("You already have something in your hands.");
                    Console.WriteLine();
                    Bathroom();
                }
                else
                {
                    Item screwdriver = new Item("screwdriver");
                    screwdriver.Take();
                    Console.WriteLine();
                    Console.WriteLine("You now have a screwdriver in your hand.");
                    CurrentPlayer.Inventory.Add(screwdriver);
                    Console.WriteLine();
                    Bathroom();
                }
                break;

            case "use screwdriver":
                Console.WriteLine();
                Console.WriteLine("You can't fix anything in here.");
                Console.WriteLine();
                Bathroom();
                break;

            case "take":
                Console.WriteLine();
                Console.WriteLine("What do you want to take?");
                Console.WriteLine();
                Bathroom();
                break;

            case "use":
                Console.WriteLine();
                Console.WriteLine("What do you want to use?");
                Console.WriteLine();
                Bathroom();
                break;

            case "i":
                if (CurrentPlayer.Inventory.Count == 0)
                {
                    Console.WriteLine();
                    Console.WriteLine("You have nothing in your hands");
                }
                else
                {
                    Console.WriteLine();
                    Console.WriteLine("You are holding " + CurrentPlayer.Inventory[0].Name + " in your hands.");
                }
                Bathroom();
                break;

            case "h":
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.Clear();
                Console.WriteLine(help);
                Console.WriteLine(help1);
                Console.WriteLine(help2);
                Console.WriteLine();
                Console.WriteLine("Press enter to clear help menu.");
                Console.ReadLine();
                Console.Clear();
                Bathroom();
                break;

            case "q":
                Quit();
                break;

            case "r":
                if (CurrentPlayer.Inventory.Count > 0)
                {
                    CurrentPlayer.Inventory.RemoveAt(0);
                    System.Console.WriteLine("Reset");
                }
                else
                {
                    System.Console.WriteLine("Reset");
                }
                doorLocked    = true;
                barndoorStuck = true;
                keysUsed      = false;
                Start();
                break;

            default:
                Bathroom();
                break;
            }
        }
Beispiel #2
0
        public void LivingRoom()
        {
            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine("Living Room");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine();
            Console.WriteLine("You are currently in the living room. There is currently no carpet on the floor. The wall to the north has a barn door but it doesnt looks like it might be hanging funny. There is a door to the east. Man there sure isn't much for furniture in the living room. The west wall has a window with broken blinds. ");
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            string input = Console.ReadLine().ToLower();

            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.Cyan;
            switch (input)
            {
            case "n":

                if (barndoorStuck == true)
                {
                    Console.WriteLine();
                    Console.WriteLine("It appears that the barn door to the kitchen is Stuck. I think you might need a tool to fix that.");
                    Console.WriteLine();
                    LivingRoom();
                }
                else
                {
                    Console.WriteLine();
                    Console.Clear();
                    Kitchen();
                }
                break;

            case "e":

                if (doorLocked == true)
                {
                    Console.WriteLine();
                    Console.WriteLine("The door is locked. You should look around to find a key.");
                }
                else
                {
                    Console.Clear();
                    Bedroom();
                }
                LivingRoom();
                break;

            case "s":

                Console.WriteLine();
                Console.WriteLine("You can't leave, the door knob just fell out, you need to look around the house to find another way out.");
                Console.WriteLine();
                LivingRoom();
                break;

            case "w":
                Console.WriteLine();
                Console.WriteLine("You are facing a window.");
                Console.WriteLine();
                LivingRoom();
                break;

            case "l":
                Console.Clear();
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine();
                Console.WriteLine("As you look around the room, you notice the room is in bad condition. You see some keys hanging on the wall next to the front door.");
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine();
                LivingRoom();
                break;

            case "take screwdriver":
                if (barndoorStuck == false)
                {
                    Console.WriteLine();
                    System.Console.WriteLine("You don't need that screwdriver anymore.");
                }
                else if (doorLocked == true)
                {
                    Console.WriteLine();
                    System.Console.WriteLine("There isn't a screwdriver in here.");
                }
                else if (keysUsed == false)
                {
                    Console.WriteLine();
                    System.Console.WriteLine("There isn't a screwdriver in here.");
                }
                else
                {
                    Console.WriteLine();
                    Console.WriteLine("You already have a screwdriver in your hand.");
                }
                LivingRoom();
                break;

            case "take keys":
                if (doorLocked == false)
                {
                    Console.WriteLine();
                    System.Console.WriteLine("You don't need those keys.");
                }
                else
                {
                    if (CurrentPlayer.Inventory.Count > 0)
                    {
                        Console.WriteLine();
                        Console.WriteLine("You already have something in your hands.");
                        Console.WriteLine();
                        LivingRoom();
                    }
                    else
                    {
                        Item keys = new Item("Keys");
                        keys.Take();
                        Console.WriteLine();
                        Console.WriteLine("You now have keys in your hand.");
                        CurrentPlayer.Inventory.Add(keys);
                        Console.WriteLine();
                        LivingRoom();
                    }
                }
                break;

            case "use screwdriver":
                if (CurrentPlayer.Inventory.Count > 0 && keysUsed == true)
                {
                    barndoorStuck   = false;
                    screwdriverUsed = true;
                    CurrentPlayer.Inventory.RemoveAt(0);
                    Console.WriteLine();
                    Console.WriteLine("You used the screwdriver to open the barn door. You put the screwdriver next to the the keys.");
                }
                else
                {
                    Console.WriteLine();
                    Console.Write("You don't have a screwdriver.");
                }
                Console.WriteLine();
                LivingRoom();
                break;

            case "use keys":
                if (CurrentPlayer.Inventory.Count > 0 && screwdriverUsed == false)
                {
                    doorLocked = false;
                    keysUsed   = true;
                    CurrentPlayer.Inventory.RemoveAt(0);
                    Console.WriteLine();
                    Console.WriteLine("You used the keys to open the door, you have put them back.");
                }
                else
                {
                    Console.WriteLine();
                    Console.Write("You don't have a key.");
                }
                Console.WriteLine();
                LivingRoom();
                break;

            case "take":
                Console.WriteLine();
                Console.WriteLine("What do you want to take?");
                Console.WriteLine();
                LivingRoom();
                break;

            case "use":
                Console.WriteLine();
                Console.WriteLine("What do you want to use?");
                Console.WriteLine();
                LivingRoom();
                break;

            case "i":
                if (CurrentPlayer.Inventory.Count == 0)
                {
                    Console.WriteLine();
                    Console.WriteLine("You have nothing in your hands");
                }
                else
                {
                    Console.WriteLine();
                    Console.WriteLine("You are holding " + CurrentPlayer.Inventory[0].Name + " in your hands.");
                }
                Console.WriteLine();
                LivingRoom();
                break;

            case "h":
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.Clear();
                Console.WriteLine(help);
                Console.WriteLine(help1);
                Console.WriteLine(help2);
                Console.WriteLine();
                Console.WriteLine("Press enter to clear help menu.");
                Console.ReadLine();
                Console.Clear();
                LivingRoom();
                break;

            case "q":
                Quit();
                break;

            case "r":
                if (CurrentPlayer.Inventory.Count > 0)
                {
                    CurrentPlayer.Inventory.RemoveAt(0);
                    System.Console.WriteLine("Reset");
                }
                else
                {
                    System.Console.WriteLine("Reset");
                }
                doorLocked    = true;
                barndoorStuck = true;
                keysUsed      = false;
                Start();
                break;

            default:
                LivingRoom();
                break;
            }
        }