Exemple #1
0
 // Use this for initialization
 void Awake()
 {
     interactableItems = GetComponent <InteractableItems> ();
     roomNavigation    = GetComponent <RoomNavigation>();
     puzzleManager     = GetComponent <PuzzleManager> ();
     soundEffects      = GetComponents <AudioSource>();
 }
Exemple #2
0
 void Awake()
 {
     interactableItems = GetComponent <InteractableItems>();
     roomNavigation    = GetComponent <RoomNavigation>();
     _source           = GetComponent <AudioSource>();
     textTyper         = FindObjectOfType <TextTyper>();
 }
Exemple #3
0
 // Start is called before the first frame update
 void Awake()
 {
     interactableItems = GetComponent <InteractableItems>();
     //get the RoomNavigation componenet
     roomNavigation = GetComponent <RoomNavigation>();
     audioSource    = GetComponent <AudioSource>();
 }
    public void AddActionResponsesToUseDictionary()
    {
        for (int i = 0; i < nounsInInv.Count; i++)
        {
            string noun = nounsInInv[i];

            InteractableItems interactableItemsInInv = GetInteractableItemFromUsableList(noun);
            if (interactableItemsInInv == null)
            {
                continue;
            }

            for (int j = 0; j < interactableItemsInInv.interactions.Length; j++)
            {
                Interaction interaction = interactableItemsInInv.interactions[j];

                if (interaction.actionResponse == null)
                {
                    continue;
                }

                if (!useDictionary.ContainsKey(noun))
                {
                    useDictionary.Add(noun, interaction.actionResponse);
                }
            }
        }
    }
Exemple #5
0
    public override void RespondToInput(GameController controller, string[] separatedInputWords)
    {
        InteractableItems ii = controller.interactableItems;

        if (separatedInputWords.Length > 1)
        {
            if (separatedInputWords [1] == "room")
            {
                controller.DisplayRoomText();
            }
            else
            {
                controller.LogStringWithReturn(controller.TestVerbDictionaryWithNoun(ii.examineDictionary, separatedInputWords [0], separatedInputWords [1]));
                InteractableObject item = ii.GetInteractableObjectFromUsableList(separatedInputWords [1]);
                if (item != null)
                {
                    ii.ExecuteActionResponse(ii.GetInteraction(item, "examine"), separatedInputWords);
                }
            }
        }
        else
        {
            controller.LogStringWithReturn("What do you want to examine?");
        }
    }
 // Use this for initialization
 void Awake()
 {
     navigation        = GetComponent <RoomNavigation> ();
     interactableItems = GetComponent <InteractableItems> ();
     map = FindObjectOfType <Map> ();
     displayText.color = baseColor;
 }
Exemple #7
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);
                }
            }
        }
    }
 void Awake()
 {
     //GameObject.DontDestroyOnLoad(gameObject);
     /*When the game starts it populates the items and rooms*/
     interactableItems = GetComponent <InteractableItems>();
     roomNavigation    = GetComponent <RoomNavigation>();
 }
 void Awake()
 {
     continueButton.enabled = false;
     displayImage.enabled   = false;
     interactableObjects    = GetComponent <InteractableItems>();
     placeNavigation        = GetComponent <PlaceNavigation> ();
 }
Exemple #10
0
 // Use this for initialization
 void Awake()
 {
     roomNavigation    = GetComponent <RoomNavigation>();
     interactableItems = GetComponent <InteractableItems>();
     saveLoadGame      = GetComponent <SaveLoadGame>();
     Cursor.lockState  = CursorLockMode.Locked;
     Score             = Moves = 0;
 }
 void Awake()
 {
     typewriterText    = false;
     interactableItems = GetComponent <InteractableItems>();
     roomNavigation    = GetComponent <Navigation>();
     audioSource       = GetComponent <AudioSource>();
     actionAudioSource = GetComponentInChildren <AudioSource>();
 }
Exemple #12
0
    private void OnTriggerExit(Collider collider)
    {
        InteractableItems collidedItem = collider.GetComponent <InteractableItems>();

        if (collidedItem)
        {
            objectsHoveringOver.Remove(collidedItem);
        }
    }
 //---------------------------------------------
 void Awake()
 {
     interactableItems = GetComponent <InteractableItems> ();
     textInput         = GetComponent <TextInput>();
     actionResponse    = GetComponent <ActionResponse>();
     roomNavigation    = GetComponent <RoomNavigation> ();
     spriteDisplay     = Instantiate(renderer);//, new Vector3(0,0,0),Quaternion.identity);
     display           = spriteDisplay.GetComponent <SpriteRenderer> ();
     //controlObject = GetInstanceID();
     //Debug.Log(controlObject);
 }
    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);
    }
Exemple #15
0
    void Awake()
    {
        //GameObject.DontDestroyOnLoad(gameObject);
        /*When the game starts it populates the items and rooms*/

        // Here we have an opportunity to store and retreive
        // information into a dataservice. Hence we can possibly
        // work towards changing the items and the rooms from
        // that data service.

        // GameMode.GetGame assigns values to the interactableItems, roomNavigation
        // that includes a current room.
        if (!GameModel.GetGame())
        {
            interactableItems = GetComponent <InteractableItems>();
            roomNavigation    = GetComponent <RoomNavigation>();
        }
    }
Exemple #16
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (controller == null)
        {
            //Debug.Log("Controller not initialized");
            return;
        }


        if (controller.GetPressDown(triggerButton))
        {
            float minDistance = float.MaxValue;

            float distance;
            foreach (InteractableItems item in objectsHoveringOver)
            {
                distance = (item.transform.position - transform.position).sqrMagnitude;

                if (distance < minDistance)
                {
                    minDistance = distance;
                    closestItem = item;
                }
            }

            interactingItem = closestItem;
            closestItem     = null;

            if (interactingItem)
            {
                if (interactingItem.IsInteracting())
                {
                    interactingItem.EndInteraction(this);
                }

                interactingItem.BeginInteraction(this);
            }
        }

        if (controller.GetPressUp(triggerButton) && interactingItem != null)
        {
            interactingItem.EndInteraction(this);
        }
    }
Exemple #17
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        interactableItems = GetComponent <InteractableItems> ();
        roomNavigation    = GetComponent <RoomNavigation> ();

        for (int i = 0; i < resetRemoveItemsAtStartOfGameToBeFalse.Count; i++)
        {
            resetRemoveItemsAtStartOfGameToBeFalse[i].removeItem = false;
            for (int j = 0; j < resetRemoveItemsAtStartOfGameToBeFalse[i].interactions.Length; j++)
            {
                resetRemoveItemsAtStartOfGameToBeFalse[i].interactions[j].currentTextResponse = resetRemoveItemsAtStartOfGameToBeFalse[i].interactions[j].originalTextResponse;
            }
        }

        for (int i = 0; i < resetRemoveItemsAtStartOfGameToBeTrue.Count; i++)
        {
            resetRemoveItemsAtStartOfGameToBeTrue[i].removeItem = true;
            for (int j = 0; j < resetRemoveItemsAtStartOfGameToBeTrue[i].interactions.Length; j++)
            {
                resetRemoveItemsAtStartOfGameToBeTrue[i].interactions[j].currentTextResponse = resetRemoveItemsAtStartOfGameToBeTrue[i].interactions[j].originalTextResponse;
            }
        }

        for (int i = 0; i < resetDefaultRoomDescriptions.Count; i++)
        {
            resetDefaultRoomDescriptions [i].description = resetDefaultRoomDescriptions [i].originalDescription;
        }
    }
Exemple #18
0
    void Awake()
    {
        //Get a bunch of components attached to this game object
        roomNavigation    = GetComponent <RoomNavigation>();
        interactableItems = GetComponent <InteractableItems>();
        uiFader           = GetComponent <UIFader>();
        dialogueManager   = GetComponent <DialogueManager>();
        textAnimator      = GetComponent <AnimatedDialogueText>();
        canvas            = GameObject.Find("Canvas").GetComponent <Canvas>();
        canvasRekt        = canvas.GetComponent <RectTransform>();
        canvasWidth       = canvas.GetComponent <RectTransform>().rect.width *canvas.GetComponent <RectTransform>().localScale.x;
        textInput         = GetComponent <TextInput>();

        tipBox = GameObject.Find("Tipbox");
        tipBoxRectTransform = GameObject.Find("ToolTipText").GetComponent <RectTransform>();

        //Set default display to currently being used (as opposed to hacking)
        currentDisplayText = defaultDisplayText;
        currentActionLog   = textModeActionLog;

        //Clear the the displays of their default text
        defaultDisplayText.text = " ";
        hackingDisplayText.text = " ";
    }
    List <string> actionLog = new List <string>();                                                                    // creates action log string

    void Awake()
    {
        interactableItems = GetComponent <InteractableItems>();
        roomNavigation    = GetComponent <RoomNavigation>();                                                        // gets RoomNavigation script
    }
Exemple #20
0
 private void Awake()
 {
     interactableItems = GetComponent <InteractableItems>();
     areaNavigation    = GetComponent <AreaNavigation>();
 }
Exemple #21
0
 // Start is called before the first frame update
 void Awake()
 {
     roomNavigation    = GetComponent <RoomNavigation>();
     textInput         = GetComponent <TextInput>();
     interactableItems = GetComponent <InteractableItems>();
     registerObjects   = GetComponent <RegisterObjects>();
     registerRooms     = GetComponent <RegisterRooms>();
     map                  = GetComponent <MiniMap>();
     debugClass           = GetComponent <DebugMode>();
     additionalNarrations = GetComponent <AdditionalNarrations>();
     npcTalk              = GetComponent <NPCTalk>();
     npcInteraction       = GetComponent <NPCInteraction>();
     demoScript           = GetComponent <DemoScript>();
     achievements         = GetComponent <Achievements>();
     combat               = GetComponent <Combat>();
     teleType             = GetComponent <TeleType>();
     introScreen          = GetComponent <IntroScreen>();
     GameObject.Find("MainScrollRect").GetComponent <ScrollRect>().verticalNormalizedPosition = 0.5f;
     //enterToContinue = false;
     //escToContinue = false;
     //toResumeEscToContinue = false;
     //exitPopUp = false;
     debugMode              = false;
     secondQuestActive      = false;
     currentActiveInput     = "main";
     ego.equippedWeapon     = null;
     ego.equippedArmor      = null;
     ego.equippedShield     = null;
     ego.chosenAction       = "";
     ego.allStats[0].value  = 100;
     ego.allStats[1].value  = 100;
     ego.allStats[2].value  = 100;
     ego.allStats[3].value  = 0;
     ego.allStats[4].value  = 1;
     ego.allStats[5].value  = 0;
     ego.allStats[6].value  = 4;
     ego.allStats[7].value  = 0;
     ego.allStats[8].value  = 1.5f;
     ego.allStats[9].value  = 0;
     ego.allStats[10].value = 0;
     for (int i = 0; i < ego.allStats.Length; i++)
     {
         ego.allStats[i].effectValue = 0;
     }
     ego.activeEffects.Clear();
     ego.defeatedBadGuys.Clear();
     ego.blueCrystals   = 0;
     ego.bankedCrystals = 0;
     ego.fightClubRank  = 0;
     ego.fleeLocation   = "";
     ego.conversation   = 0;
     ego.currentInit    = 0;
     ego.displayAction  = "";
     ego.chosenAction   = "";
     ego.chosenItem     = null;
     ego.chosenItem2    = null;
     ego.chosenTarget   = null;
     ego.potionBelt.Clear();
     //enterToContinueDialogue = false;
     //timeDelay = 1;
     sentences = new Queue <string>();
     pauses    = new Queue <int>();
     //ego = Instantiate(ego);
 }
Exemple #22
0
    List <string> actionLog = new List <string>();                                                                    // creates action log string

    void Awake()
    {
        interactableItems = GetComponent <InteractableItems>();                                                     // fetches InteractableItems script
        roomNavigation    = GetComponent <RoomNavigation>();                                                        // fetches RoomNavigation script
    }
Exemple #23
0
 // Unity functions
 private void Awake()
 {
     // Reference to the room navigation
     roomNavigation    = GetComponent <RoomNavigation>();
     interactableItems = GetComponent <InteractableItems>();
 }
 void Awake()
 {
     interactableItems = GetComponent <InteractableItems>();
     commandNavigation = GetComponent <commandNavigation>();
 }
Exemple #25
0
 // Use this for initialization
 void Awake()
 {
     roomNavigation    = GetComponent <RoomNavigation> ();
     interactableItems = GetComponent <InteractableItems> ();
 }
Exemple #26
0
 // Use this for initialization
 void Awake()
 {
     interactableItems = GetComponent <InteractableItems>();
     roomNavigation    = GetComponent <RoomNavigation>();
     player.GetComponent <Player>();
 }