Example #1
0
    private void PrepareItemsToTakeOrExamine(RoomSO currentRoom)
    {
        for (int i = 0; i < currentRoom.interactableItemsInRoom.Length; i++)
        {
            string descriptionNotInInv = useableItems.GetItemNotInInv(currentRoom, i);
            if (descriptionNotInInv != null)
            {
                inRoomInteractions.Add(descriptionNotInInv);
            }

            InteractableItems interactableInRoom = currentRoom.interactableItemsInRoom[i];

            for (int j = 0; j < interactableInRoom.interactions.Length; j++)
            {
                Interaction interaction = interactableInRoom.interactions[j];
                if (interaction.inputAction.keyWord == "examine")
                {
                    useableItems.examineDictionary.Add(interactableInRoom.noun, interaction.textResponse);
                }

                if (interaction.inputAction.keyWord == "take")
                {
                    useableItems.takeDictionary.Add(interactableInRoom.noun, interaction.textResponse);
                }
            }
        }
    }
Example #2
0
    public string GetItemNotInInv(RoomSO currentRoom, int i)
    {
        InteractableItems ItemsInRoom = currentRoom.interactableItemsInRoom[i];

        if (!nounsInInv.Contains(ItemsInRoom.noun))
        {
            nounsInRoom.Add(ItemsInRoom.noun);
            return(ItemsInRoom.itemDescription);
        }

        return(null);
    }
Example #3
0
 public void AttemptToChangeRooms(string direction)
 {
     if (exitDictionary.ContainsKey(direction))
     {
         currentRoom = exitDictionary[direction];
         gameController.LogStringWithReturn("Ye embarketh to the " + direction);
         gameController.DisplayRoomText();
     }
     else
     {
         gameController.LogStringWithReturn("Ye cannot go " + direction);
     }
 }