Example #1
0
 void PrepareInteractablesInRoom(Room currentRoom)
 {
     for (int i = 0; i < currentRoom.interactableObjectsInRoom.Length; i++)
     {
         interactableItems.UnpackInteractables(currentRoom, i);
         InteractableObject interactableInRoom = currentRoom.interactableObjectsInRoom[i];
         for (int j = 0; j < interactableInRoom.interactions.Length; j++)
         {
             Interaction interaction = interactableInRoom.interactions[j];
             if (interaction.inputAction.keyWord == "look")
             {
                 if (secondQuestActive && interaction.secondQuestTextResponseAlternate != null && interactableInRoom.searched)
                 {
                     interactableItems.lookAtDictionary.Add(interactableInRoom.noun, interaction.secondQuestTextResponseAlternate);
                 }
                 else if (secondQuestActive && interaction.secondQuestTextResponse != null)
                 {
                     interactableItems.lookAtDictionary.Add(interactableInRoom.noun, interaction.secondQuestTextResponse);
                 }
                 else if (interaction.textResponseAlternate != null && interactableInRoom.searched)
                 {
                     interactableItems.lookAtDictionary.Add(interactableInRoom.noun, interaction.textResponseAlternate);
                 }
                 else
                 {
                     interactableItems.lookAtDictionary.Add(interactableInRoom.noun, interaction.textResponse);
                 }
             }
             if (interaction.inputAction.keyWord == "search")
             {
                 if (secondQuestActive && interaction.secondQuestTextResponseAlternate != null && interactableInRoom.searched)
                 {
                     interactableItems.searchDictionary.Add(interactableInRoom.noun, interaction.secondQuestTextResponseAlternate);
                 }
                 else if (secondQuestActive && interaction.secondQuestTextResponse != null && !interactableInRoom.searched)
                 {
                     interactableItems.searchDictionary.Add(interactableInRoom.noun, interaction.secondQuestTextResponse);
                 }
                 else if (interactableInRoom.searched && interaction.textResponseAlternate != null)
                 {
                     interactableItems.searchDictionary.Add(interactableInRoom.noun, interaction.textResponseAlternate);
                 }
                 else
                 {
                     interactableItems.searchDictionary.Add(interactableInRoom.noun, interaction.textResponse);
                 }
             }
             if (interaction.inputAction.keyWord == "listen")
             {
                 if (secondQuestActive && interaction.secondQuestTextResponseAlternate != null && interactableInRoom.searched)
                 {
                     interactableItems.listenToDictionary.Add(interactableInRoom.noun, interaction.secondQuestTextResponseAlternate);
                 }
                 else if (secondQuestActive && interaction.secondQuestTextResponse != null && !interactableInRoom.searched)
                 {
                     interactableItems.listenToDictionary.Add(interactableInRoom.noun, interaction.secondQuestTextResponse);
                 }
                 else if (interaction.textResponseAlternate != null && interactableInRoom.searched)
                 {
                     interactableItems.listenToDictionary.Add(interactableInRoom.noun, interaction.textResponseAlternate);
                 }
                 else if (interaction.textResponse != null)
                 {
                     interactableItems.listenToDictionary.Add(interactableInRoom.noun, interaction.textResponse);
                 }
                 //else { interactableItems.listenToDictionary.Add(interactableInRoom.noun,  "The only thing you hear is the beating of your own heart."); }
             }
         }
     }
 }