Exemplo n.º 1
0
 //If there are NPCs in the current room the user can ask questions
 public static void Asking(ref TrackedItems Cards, string[] Inventory, string[] InnocentCharacter, string[] userArray)
 {
     if (Cards.currentRoom == "dining")
     {
         if (userArray.Contains("happened"))
         {
             Console.WriteLine("I don't know what happened.");
         }
         else if ((userArray.Contains("ballroom")) && (userArray.Contains("key")))
         {
             Console.WriteLine("I have the key to the ballroom, please take it.");
         }
         else
         {
             Console.WriteLine($"{InnocentCharacter[0]} is confused by that sentence and asks you to repeat it.");
         }
     }
     if (Cards.currentRoom == "lounge")
     {
         if (userArray.Contains("happened"))
         {
             Console.WriteLine("We don't know, it all happened so fast. We were in the dining room getting food when it happened.");
         }
         else
         {
             Console.WriteLine($"{InnocentCharacter[1]} and {InnocentCharacter[2]}  are confused by that sentence and ask you to repeat it.");
         }
     }
 }
Exemplo n.º 2
0
        //For when the user enters the cellar and is ready to guess
        public static void Guessing(ref TrackedItems Cards)
        {
            int points = 0;

            Console.Write("He asks who you think the murderer was, you reply: ");
            string userGuess = Console.ReadLine();

            if (Cards.murderer == userGuess)
            {
                points++;
            }
            Console.Write("He asks what weapon you think you think was used, you reply: ");
            userGuess = Console.ReadLine();
            if (Cards.murderWeapon == userGuess)
            {
                points++;
            }
            Console.Write("He asks what room you think you think the murder was commited in, you reply: ");
            userGuess = Console.ReadLine();
            if (Cards.murderRoom == userGuess)
            {
                points++;
            }
            End(points);
        }
Exemplo n.º 3
0
 //Examing the rooms method
 public static void Examine(ref TrackedItems Cards, string[] Inventory)
 {
     if (Cards.currentRoom.ToLower() == "kitchen")
     {
         Console.WriteLine("You examine the room, moving tables and searching cupboards. When it seems likely that the room is a dead end, you find a key.");
         Thread.Sleep(200);
         Console.WriteLine("The key is engraved with a giant 'S'. You conclude this can only mean this key is meant for the study room.");
         Inventory[1] = "Study Key";
     }
 }
Exemplo n.º 4
0
 //Shows a hint for the current room if there is one
 public static void Hints(ref TrackedItems Cards, string[] InnocentCharacter)
 {
     if (Cards.currentRoom.ToLower() == "dining")
     {
         Console.WriteLine($"Try asking {InnocentCharacter[0]} what happened.");
     }
     if (Cards.currentRoom.ToLower() == "ballroom")
     {
         Console.WriteLine("You did overhear that a gentleman in the lounge has a set of keys for the mansion's many rooms.");
     }
 }
Exemplo n.º 5
0
 //Examing the body
 public static void ExamineBody(ref TrackedItems Cards)
 {
     if ((Cards.murderWeapon.ToLower() == "poison") && (Cards.currentRoom == "kitchen"))
     {
         Console.WriteLine("The body is lying motionless on the floor, upon further inspection. A glass had been dropped as the victim tried to drink");
         Console.WriteLine("It was very similiar to a recent murder you solved, involving Arsenic. Arsenic is a substance found in rat poison and weed killer. You conclude that the victim must have been poisened.");
     }
     else if ((Cards.murderWeapon.ToLower() == "poison") && (Cards.currentRoom == "kitchen"))
     {
     }
 }
Exemplo n.º 6
0
        //Displays the map when the command is triggered
        public static void Map(ref TrackedItems Cards)
        {
            StreamReader sr = new StreamReader(@"map.txt");

            while (!sr.EndOfStream)
            {
                Console.WriteLine(sr.ReadLine());
            }
            Console.WriteLine($"=       N: NPC             Current Room: {Cards.currentRoom.PadRight(7)}          =");
            Console.WriteLine("= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =");
            Console.WriteLine("Finished?");
            Console.ReadLine();
        }
Exemplo n.º 7
0
        public static void Main()
        {
            //Setting up variables and arrays
            string[]     Inventory = { "Empty", "Empty", "Empty", "Empty", "Empty" };
            Random       rand      = new Random();
            TrackedItems Cards     = new TrackedItems();

            string[] InnocentCharacter = new string[4];
            string[] suspectArray      = { "Peter Plum", "Miss Scarlet", "Miss White", "Mr. Green", "Colonel Mustard" };
            string[] weaponArray       = { "Candlestick", "Dagger", "Cue", "Revolver", "Spanner", "Poison" };
            string[] roomArray         = { "Kitchen", "Ballroom", "Billiard", "Library", "Dining", "Hall", "Study", "Lounge" };

            //Randomising the murderer, weapon and room
            Cards.murderer     = suspectArray[rand.Next(0, 5)];
            Cards.murderRoom   = roomArray[rand.Next(0, 5)];
            Cards.currentRoom  = "Outside";
            Cards.studyLock    = "locked";
            Cards.ballroomLock = "locked";

            //error checking for establishing NPCS that are not the murderer
            //Console.WriteLine("Murderer: " + Cards.murderer);
            for (int i = 0; i < 4; i++)
            {
                bool loop = true;
                while (loop == true)
                {
                    if (suspectArray[i] != Cards.murderer)
                    {
                        InnocentCharacter[i] = suspectArray[i];
                    }
                    else
                    {
                        InnocentCharacter[i] = "Frank West";
                    }
                    loop = false;
                }
            }
            Menu(ref Cards, Inventory, InnocentCharacter);
        }
Exemplo n.º 8
0
        //Constantly looping checking for users input
        public static void userInput(ref TrackedItems Cards, string[] Inventory, string[] InnocentCharacter)
        {
            Console.WriteLine("The old mansion creeks as you enter. Marble pillars decorate long white halls. The suspects gather in the basement as you begin your first round of quesitoning. Satisfied with the answers you get, you begin the investigation.");
            Thread.Sleep(2000);
            bool loop = true;

            while (loop == true)
            {
                Console.Write("Please enter what you want to do: ");
                Console.ForegroundColor = ConsoleColor.Green;
                string userInput = Console.ReadLine().ToLower();
                Console.ForegroundColor = ConsoleColor.White;
                string[] userArray = userInput.Split(' ');

                //GoTo Command
                if (userArray[0].ToLower() == "goto")
                {
                    MovingRoom(userArray, ref Cards, Inventory, InnocentCharacter);
                }

                //Inventory Command
                else if (userArray[0].ToLower() == "inventory")
                {
                    for (int i = 0; i < Inventory.Length; i++)
                    {
                        Console.WriteLine($"Slot {i + 1} : {Inventory[i]}");
                    }
                }

                //Exit Command
                else if (userArray[0].ToLower() == "exit")
                {
                    Console.WriteLine("Exiting");
                    Thread.Sleep(2000);
                    loop = false;
                }

                //Map command
                else if (userArray[0].ToLower() == "map")
                {
                    Map(ref Cards);
                }

                //Ask command
                else if (userArray[0].ToLower() == "ask")
                {
                    Asking(ref Cards, Inventory, InnocentCharacter, userArray);
                }

                //Examine command
                else if (userArray[0].ToLower() == "examine")
                {
                    Examine(ref Cards, Inventory);
                }
                //Hint command
                else if (userArray[0].ToLower() == "hint")
                {
                    Hints(ref Cards, InnocentCharacter);
                }

                //Error Checking
                else
                {
                    Console.Write("Unknown command, please try again: ");
                }
            }
        }
Exemplo n.º 9
0
        //Activates when the user is using the moving command.
        public static void MovingRoom(string[] userArray, ref TrackedItems Cards, string[] Inventory, string[] InnocentCharacter)
        {
            if (userArray.Contains("kitchen"))
            {
                Cards.currentRoom = "kitchen";
                if (Cards.murderRoom.ToLower() == "kitchen")
                {
                    Cards.murderWeapon = "Poison";
                    Console.WriteLine("You enter the kitchen, in the corner is the victim, foam and bile spilling from their mouth, eyes bloodred, skin purple. It must've been a horrible way to die.");
                }
                else
                {
                    Console.WriteLine("Inside the marble kitchen you find many stainless steel pots, pans, trays and other equipment. The sink is overflowing with cutlery from last nights meal.");
                }
            }

            //Entering ballroom
            else if (userArray.Contains("ballroom"))
            {
                if (Cards.ballroomLock.ToLower() == "locked")
                {
                    if (Inventory[0] == "Ballroom Key")
                    {
                        Cards.ballroomLock = "unlocked";
                        Console.WriteLine("You have the Ballroom key, collected from one of the suspects.");
                        if (Cards.murderRoom.ToLower() == "ballroom")
                        {
                            Cards.murderWeapon = "Lead Pipe";
                            Console.WriteLine("You enter the room where the murdered victim lies");
                        }
                        else
                        {
                            Console.WriteLine("You enter the ballroom, the room echos with the conversations of distraught guests. No body can be seen.");
                        }
                    }
                    else
                    {
                        Console.WriteLine("You try to open the ballroom door, but the door is locked.");
                    }
                }
                else
                {
                    Console.WriteLine("The door is still open from last time you entered.");
                    if (Cards.murderRoom.ToLower() == "ballroom")
                    {
                        Console.WriteLine("The victim's body still lies on the floor");
                    }
                    else
                    {
                        Console.WriteLine("The room continues to echo with the conversations of distraught guests.");
                    }
                }
            }

            //Entering study
            else if (userArray.Contains("study"))
            {
                if (Cards.studyLock.ToLower() == "locked")
                {
                    if (Inventory[1] == "Study Key")
                    {
                        Cards.currentRoom = "study";
                        Cards.studyLock   = "unlocked";
                        Console.WriteLine("You have the Study key");
                        if (Cards.murderRoom.ToLower() == "study")
                        {
                            Cards.murderWeapon = "Revolver";
                            Console.WriteLine("You enter the room where the murdered victim lies");
                        }
                        else
                        {
                            Console.WriteLine("You enter the study");
                        }
                    }
                    else
                    {
                        Console.WriteLine("You try to open the study door, but the door is locked");
                    }
                }
                else
                {
                    Console.WriteLine("The door is still open from last time you entered.");
                    if (Cards.murderRoom.ToLower() == "study")
                    {
                        Console.WriteLine("The victim's body still lies on the floor");
                    }
                    else
                    {
                        Console.WriteLine("The room continues to echo with the conversations of distraught guests.");
                    }
                }
            }

            //Entering Lounge
            else if (userArray.Contains("lounge"))
            {
                Cards.currentRoom = "lounge";
                if (Cards.murderRoom == "lounge")
                {
                    Cards.murderWeapon = "Dagger";
                    Console.WriteLine("You enter the room where the murdered victim lies");
                    Console.WriteLine($"You enter the lounge, {InnocentCharacter[2]} and {InnocentCharacter[3]} are sitting on the couch. Comforting each other.");
                }
                else
                {
                    Console.WriteLine($"You enter the lounge, {InnocentCharacter[2]} and {InnocentCharacter[3]} are sitting on the couch. Comforting each other.");
                }
            }

            //Entering Library
            else if (userArray.Contains("library"))
            {
                Cards.currentRoom = "library";
                if (Cards.murderRoom == "library")
                {
                    Cards.murderWeapon = "Candlestick";
                    Console.WriteLine("You enter the library and a body is lying down");
                }
                else
                {
                    Console.WriteLine("You enter the library, bookshelves as tall as the ceiling can be seen.");
                }
            }

            //Entering Dining Room
            else if (userArray.Contains("dining"))
            {
                Cards.currentRoom = "dining";
                if (Cards.murderRoom == "dining")
                {
                    Cards.murderWeapon = "Fork";
                    Console.WriteLine("You enter the room where the murdered victim lies");
                }
                else
                {
                    Console.WriteLine("You enter the Dining room, You are disappointed. No corpse can be seen");
                    Console.WriteLine($"You enter the dining room, {InnocentCharacter[0]} is standing in the corner.");
                }
                //Console.WriteLine($"You enter the dining room, {InnocentCharacter[0]} is standing in the corner, distraught.");
                Inventory[0] = "Ballroom Key";
            }

            //Entering billiard room
            else if (userArray.Contains("billiard"))
            {
                Cards.currentRoom = "billiard";
                if (Cards.murderRoom == "billiard")
                {
                    Cards.murderWeapon = "Pool Cue";
                    Console.WriteLine("Upon entering the Billiard room the smell hits you immediatly, this was a bludgening. The vicim lies on top of the pool table");
                }
                else
                {
                    Console.WriteLine("You enter the billiard room, the room smells of recently lit cigars, and expensive whiskey.");
                }
            }
        }
Exemplo n.º 10
0
        public static void Menu(ref TrackedItems Cards, string[] Inventory, string[] InnocentCharacter)
        {
            int  menu;
            bool menuOpen = true;

            while (menuOpen == true)
            {
                Console.WriteLine("Not Cluedo".PadLeft(Console.WindowWidth / 2));
                Console.WriteLine();
                Console.WriteLine($"Main Menu\n".PadLeft(Console.WindowWidth / 2));
                Console.WriteLine("========================================================================================================================");
                Console.WriteLine("Play Game (1)\n\nRules and Commands (2)\n\nOptions (3)\n\nExit (4)\n");
                menu = Convert.ToInt32(Console.ReadLine());
                {
                    switch (menu) // while loop?
                    {
                    case 1:
                        Console.Clear();
                        Thread.Sleep(1000);
                        Console.WriteLine("GAME BEGIN");
                        Thread.Sleep(3000);
                        Console.Clear();
                        userInput(ref Cards, Inventory, InnocentCharacter);
                        break;

                    case 2:
                        Console.Clear();
                        Console.WriteLine("Rules and Commands");
                        Console.WriteLine("Welcome to Not Cludeo! In this game you will try to guess the murderer in the Not Cludeo mansion. You will need to identify the room they were killed in, the item used to kill them and the murderer.");
                        Thread.Sleep(5000);
                        Console.WriteLine($"\nThe following are some helpful commands you will need to use to navigate and interact with the cluedeo mansion.");
                        Thread.Sleep(2000);
                        Console.WriteLine($"\nGOTO \nThis command allows you to change rooms and GOTO the room you want. \nINVENTORY \nThis command will open your inventory, showing you what you currently have. \nMAP \nThis command opens the map and shows the player where they are in the Not Cluedo mansion. \nEXIT \nThis will forcibly exit the game and not save anything. \nASK \nThis allows the players to ask the characters questions such as 'what happened' \nEXAMINE \nAllows the player to examine items in the room. \nHELP \nAllows the player to ask for help from the game and get a hint.");
                        Thread.Sleep(1000);
                        Console.WriteLine($"\nPress the enter key to go back to the main menu");
                        Console.ReadLine();
                        Console.Clear();
                        //Link Rules or type out then call menu
                        break;

                    case 3:
                        Console.Clear();
                        Console.WriteLine("Options:");
                        Console.WriteLine("There's supposed to be something here");
                        Thread.Sleep(1000);
                        Console.Clear();
                        //let them edit the options then call menu
                        break;

                    case 4:
                        menuOpen = false;
                        break;

                    default:
                        Console.WriteLine("Incorrect Input");
                        //call menu
                        break;
                    }
                }
            }
        }
Exemplo n.º 11
0
        /// <summary>
        ///
        /// </summary>
        private void TrackNewItem()
        {
            //Get item name from user input
            string itemToAdd = Interaction.InputBox("Which item would you like track?", "Add Item", String.Empty);

            //DEBUGGING
            if (App.Debug)
            {
                #region Mock ItemInfo
                ItemInfo mockItem = new ItemInfo(itemToAdd);
                mockItem.AvgPrice_Asking   = 1;
                mockItem.AvgPrice_Offering = 2;
                mockItem.AvgPrice_Sold     = 3;
                mockItem.AvgPrice_Bought   = 4;
                mockItem.NPCBuyPrice       = 12345;
                mockItem.Vendors.Add(new ShopInfo()
                {
                    ShopType   = ShopInfo.TransactionRole.Vendor,
                    Item       = itemToAdd,
                    PlayerName = "Sumdood",
                    Title      = "My shop",
                    Map        = "Prontera",
                    Coords     = "1, 2",
                    Qty        = 99,
                    Price      = 1000000,
                    Variance   = 200,
                    LastSeen   = DateTime.Now
                });
                mockItem.Vendors.Add(new ShopInfo()
                {
                    ShopType   = ShopInfo.TransactionRole.Vendor,
                    Item       = itemToAdd,
                    PlayerName = "FinalMerchant",
                    Title      = "#2 shop",
                    Map        = "Prontera",
                    Coords     = "2, 3",
                    Qty        = 299,
                    Price      = 750000,
                    Variance   = -150,
                    LastSeen   = DateTime.Now
                });
                mockItem.Buyers.Add(new ShopInfo()
                {
                    ShopType   = ShopInfo.TransactionRole.Buyer,
                    Item       = itemToAdd,
                    PlayerName = "Thatguy",
                    Title      = "ImaBuy",
                    Map        = "Prontera",
                    Coords     = "10, 20",
                    Qty        = 400,
                    Price      = 1000,
                    Variance   = 0,
                    LastSeen   = DateTime.Now
                });
                mockItem.Buyers.Add(new ShopInfo()
                {
                    ShopType   = ShopInfo.TransactionRole.Buyer,
                    Item       = itemToAdd,
                    PlayerName = "ThaOtherGuy",
                    Title      = "ImaBuy2",
                    Map        = "Eden",
                    Coords     = "2F 10, 20",
                    Qty        = 3,
                    Price      = 1500,
                    Variance   = 50,
                    LastSeen   = DateTime.Now
                });
                mockItem.Buyers.Add(new ShopInfo()
                {
                    ShopType   = ShopInfo.TransactionRole.Buyer,
                    Item       = itemToAdd,
                    PlayerName = "Player One",
                    Title      = "Gimme Please",
                    Map        = "Payon",
                    Coords     = "10, 20",
                    Qty        = 7,
                    Price      = 800,
                    Variance   = -20,
                    LastSeen   = DateTime.Now
                });
                this.AppDispatch(() => TrackedItems.Add(mockItem));
                #endregion Mock ItemInfo
            }
            else
            {
                //Validate input
                if (itemToAdd.HasText() && TrackedItems.Where(item => item.Name.Equals(itemToAdd)).Count() == 0)
                {
                    //Send request for item to be added
                    if (m_DAL.AddItem(itemToAdd.Trim()) == DataAbstractionLayer.DAL_ReturnCode.Success)
                    {
                        lock (lock_TrackedItems)
                        {
                            this.AppDispatch(() => TrackedItems.Add(new ItemInfo(itemToAdd)));
                        }
                    }
                    else
                    {
                        OnStatusNotification(itemToAdd + " could not be added.");
                    }
                }
            }
        }