Exemplo n.º 1
0
        /**
         * Given a command, process (that is: execute) the command.
         * If this command ends the game, true is returned, otherwise false is
         * returned.
         */
        private bool processCommand(Command command)
        {
            bool wantToQuit = false;

            if (command.isUnknown())
            {
                Console.WriteLine("I don't know what you mean...");
                return(false);
            }

            string commandWord = command.getCommandWord();

            switch (commandWord)
            {
            case "help":
                printHelp();
                break;

            case "go":
                player.goRoom(command);
                break;

            case "quit":
                wantToQuit = true;
                break;

            case "look":
                Console.WriteLine(player.CurrentRoom.getLongDescription());
                break;
            }

            return(wantToQuit);
        }
Exemplo n.º 2
0
        /**
         * Given a command, process (that is: execute) the command.
         * If this command ends the game, true is returned, otherwise false is
         * returned.
         */
        private bool processCommand(Command command)
        {
            bool wantToQuit = false;

            if (command.isUnknown())
            {
                Console.WriteLine("I don't know what you mean...");
                return(false);
            }

            string commandWord = command.getCommandWord();

            switch (commandWord)
            {
            case "help":
                line();
                printHelp();
                line();
                break;

            case "go":
                line();
                player.goRoom(command);
                line();
                break;

            case "quit":
                wantToQuit = true;
                break;

            case "look":
                line();
                Console.WriteLine(player.currentRoom.getLongDescription());
                inRoomInv();
                line();
                break;

            case "inv":
            case "inventory":
                line();
                inInv();
                line();
                break;

            case "take":
                line();
                takeItem(command);
                line();
                break;

            //temp
            case "health":
                line();
                Console.WriteLine(player.Health);
                line();
                break;
            }

            return(wantToQuit);
        }
Exemplo n.º 3
0
        /**
         * Given a command, process (that is: execute) the command.
         * If this command ends the game, true is returned, otherwise false is
         * returned.
         */
        private bool processCommand(Command command)
        {
            bool wantToQuit = false;

            if (command.isUnknown())
            {
                Console.WriteLine("I don't know what you mean...");
                return(false);
            }

            string commandWord = command.getCommandWord();

            switch (commandWord)
            {
            case "help":
                printHelp();
                break;

            case "go":
                goRoom(command);
                if (player.Health <= 0)
                {
                    wantToQuit = true;
                }
                break;

            case "ragequit":
                wantToQuit = true;
                break;

            case "look":
                Console.WriteLine(player.Currentroom.getLongDescription());
                player.Currentroom.Inventory.GetItemsRoom();
                break;

            case "take":
                player.Currentroom.Inventory.Take(player.Inventory, command.getSecondWord());
                break;

            case "drop":
                player.Inventory.Drop(player.Currentroom.Inventory, command.getSecondWord());
                break;

            case "use":
                use(command);
                if (player.Health <= 0)
                {
                    wantToQuit = true;
                }
                break;

            case "inventory":
                player.Inventory.GetItemsPlayer();
                break;
            }

            return(wantToQuit);
        }
Exemplo n.º 4
0
        /**
         * Given a command, process (that is: execute) the command.
         * If this command ends the game, true is returned, otherwise false is
         * returned.
         */
        private bool processCommand(Command command)
        {
            bool wantToQuit = false;

            if (command.isUnknown())
            {
                Console.WriteLine("I don't know what you mean...");
                return(false);
            }

            string commandWord = command.getCommandWord();

            switch (commandWord)
            {
            case "help":
                printHelp();
                break;

            case "go":
                player.goRoom(command);
                break;

            case "quit":
                wantToQuit = true;
                break;

            case "look":
                Console.WriteLine(player.CurrentRoom.getLongDescription());
                ReturnInv();
                break;

            case "health":
                Console.WriteLine("Your health: " + player.getPlayerHealth());
                break;

            case "inventory":
                RetPlayerInv();
                break;

            case "take":
                TakeItems();
                break;

            case "drop":
                DropItems();
                break;

            case "use":
                UseItem();
                break;
            }

            return(wantToQuit);
        }
Exemplo n.º 5
0
        /**
         * Given a command, process (that is: execute) the command.
         * If this command ends the game, true is returned, otherwise false is
         * returned.
         */
        private bool processCommand(Command command)
        {
            bool wantToQuit = false;

            if (command.isUnknown())
            {
                Console.WriteLine("");
                Console.WriteLine("11010010 11000011 11101010 00101101 10010001 10101000");
                Console.WriteLine("");
                Console.WriteLine(" # I don't know what you mean...");
                Console.WriteLine("");
                Console.WriteLine("00100111 00100011 11111101 01011011 10011011 11111000 ");
                Console.WriteLine("");
                return(false);
            }

            string commandWord = command.getCommandWord();

            switch (commandWord)
            {
            case "help":
                printHelp();
                break;

            case "look":
                printLongDiscription();
                break;

            case "go":
                goRoom(command);
                break;

            case "quit":
                wantToQuit = true;
                break;

            case "pickup":
                //Player.setItem();
                break;
            }

            return(wantToQuit);
        }
Exemplo n.º 6
0
        /**
         * Given a command, process (that is: execute) the command.
         * If this command ends the game, true is returned, otherwise false is
         * returned.
         */
        private bool processCommand(Command command)
        {
            bool wantToQuit = false;

            if (command.isUnknown())
            {
                Console.WriteLine(GeneralDataLibrary.I() + "I don't know what you mean...");
                Console.WriteLine(GeneralDataLibrary.I() + "Type: 'help' if you need help.");
                return(false);
            }

            string commandWord = command.getCommandWord();

            GeneralDataLibrary.Break();

            switch (commandWord)
            {
            case "help":

                printHelp(command);

                break;

            case "go":

                triggerCharacterAI();
                GeneralDataLibrary.Break();
                GeneralDataLibrary.LongLine();
                GeneralDataLibrary.Break();
                goRoom(command);

                break;

            case "quit":

                wantToQuit = true;

                break;

            case "look":

                lookAround(command);

                break;

            case "clear":

                ClearConsole(command);

                break;

            case "take":

                triggerCharacterAI();
                GeneralDataLibrary.Break();
                GeneralDataLibrary.LongLine();
                GeneralDataLibrary.Break();
                takeItem(command);

                break;

            case "drop":

                triggerCharacterAI();
                GeneralDataLibrary.Break();
                GeneralDataLibrary.LongLine();
                GeneralDataLibrary.Break();
                dropItem(command);

                break;

            case "bag":

                displayBag();

                break;

            case "use":

                triggerCharacterAI();
                GeneralDataLibrary.Break();
                GeneralDataLibrary.LongLine();
                GeneralDataLibrary.Break();
                useItem(command);

                break;

            case "equip":

                triggerCharacterAI();
                GeneralDataLibrary.Break();
                GeneralDataLibrary.LongLine();
                GeneralDataLibrary.Break();
                equipItem(command);

                break;

            case "unequip":

                triggerCharacterAI();
                GeneralDataLibrary.Break();
                GeneralDataLibrary.LongLine();
                GeneralDataLibrary.Break();
                unequipItem(command);

                break;

            case "attack":

                triggerCharacterAI();
                GeneralDataLibrary.Break();
                GeneralDataLibrary.LongLine();
                GeneralDataLibrary.Break();
                attackEnemy(command);

                break;
            }

            GeneralDataLibrary.Break();
            GeneralDataLibrary.LongLine();
            GeneralDataLibrary.Break();

            return(wantToQuit);
        }