Example #1
0
 // Update is called once per frame
 void OnMouseDown()
 {
     if (hasKey)
     {
         if (isSmashed)
         {
             i.displayMessage("You picked up a nightstand key!");
             Inventory.main.Set(ItemType.nightStandKey, true);
             hasKey = false;
         }
         else if (Inventory.main.selectedItem == ItemType.hammer)
         {
             isSmashed = true;
             i.displayMessage("You smashed the glass!");
         }
         else if (Inventory.main.selectedItem != ItemType.empty)
         {
             i.displayMessage("You cant use that here!");
         }
         else
         {
             i.displayMessage("Something rattles behind the glass...");
         }
     }
 }
Example #2
0
 // Update is called once per frame
 void OnMouseDown()
 {
     if (!isLocked && !isMoving)
     {
         if (isOpen)
         {
             StartCoroutine("CloseDrawer");
         }
         else
         {
             StartCoroutine("OpenDrawer");
         }
     }
     else if (isLocked)
     {
         if (Inventory.main.selectedItem != ItemType.empty)
         {
             if (Inventory.main.selectedItem == ItemType.nightStandKey && itemToUnlock == ItemType.nightStandKey)
             {
                 isLocked = false;
                 invgui.displayMessage("You unlocked the nightstand!");
                 //Inventory.main.Set(ItemType.nightStandKey, false);
                 StartCoroutine("OpenDrawer");
             }
             else if (itemToUnlock == ItemType.candleStick && Inventory.main.hasCompletedCandleStick)
             {
                 isLocked = false;
                 StartCoroutine("OpenDrawer");
             }
             else if (failMessage)
             {
                 if (Inventory.main.selectedItem == ItemType.keyOne || Inventory.main.selectedItem == ItemType.keyTwo)
                 {
                     invgui.displayMessage("This key doesn't fit!");
                 }
                 else if (Inventory.main.selectedItem == ItemType.nightStandKey)
                 {
                     invgui.displayMessage("This drawer seems to be locked by a different mechanism!");
                 }
                 else
                 {
                     invgui.displayMessage("You can't use that here!");
                 }
             }
         }
         else if (itemToUnlock == ItemType.candleStick && Inventory.main.hasCompletedCandleStick)
         {
             isLocked = false;
             StartCoroutine("OpenDrawer");
         }
         else if (failMessage)
         {
             invgui.displayMessage("This drawer is locked!");
         }
     }
 }
Example #3
0
        void OnMouseDown()
        {
            if (doorNumber == 0)
            {
                if (Inventory.main.selectedItem == ItemType.keyOne)
                {
                    Inventory.main.hasUnlockedDoorOne = true;
                    //Inventory.main.Set(ItemType.keyOne, false);
                    GetComponent <Animator>().SetBool("isOpened", true);


                    //no longer need these scripts, the door object can stay
                    GetComponent <BoxCollider>().enabled = false;
                    //this.enabled = false;
                }
                else if (Inventory.main.selectedItem != ItemType.empty)
                {
                    i.displayMessage("You cant use that here!");
                }
                else
                {
                    i.displayMessage("This door is locked!");
                }
            }
            else if (doorNumber == 1)
            {
                if (Inventory.main.selectedItem == ItemType.keyTwo)
                {
                    Inventory.main.hasUnlockedDoorTwo = true;
                    //Inventory.main.Set(ItemType.keyTwo, false);
                    GetComponent <Animator>().SetBool("isOpened", true);


                    //no longer need these scripts, the door object can stay
                    GetComponent <BoxCollider>().enabled = false;
                    //this.enabled = false;
                }
                else if (Inventory.main.selectedItem != ItemType.empty)
                {
                    i.displayMessage("You cant use that here!");
                }
                else
                {
                    i.displayMessage("This door is locked!");
                }
            }
        }
Example #4
0
 void OnMouseDown()
 {
     if (isPuzzleCandle && !isAssembled)
     {
         if (Inventory.main.selectedItem == ItemType.candleStick)
         {
             this.gameObject.transform.GetChild(0).gameObject.SetActive(true);
             isAssembled = true;
             Inventory.main.Set(ItemType.candleStick, false);
             Inventory.main.hasCompletedCandleStick = true;
             i.displayMessage("*click*");
         }
         else if (Inventory.main.selectedItem != ItemType.empty)
         {
             i.displayMessage("You can't use that here!");
         }
     }
     else if (!isOn)
     {
         if (Inventory.main.selectedItem == ItemType.tinderBox)
         {
             StartCoroutine("LightFlame");
         }
         else if (Inventory.main.selectedItem != ItemType.empty)
         {
             i.displayMessage("You can't use that here!");
         }
         else if (Inventory.main.hasItem(ItemType.tinderBox))
         {
             i.displayMessage("Your not holding your matches!");
         }
         else
         {
             i.displayMessage("You dont have any matches!");
         }
     }
 }
Example #5
0
 // Update is called once per frame
 void OnMouseDown()
 {
     i.displayMessage(message);
 }