Beispiel #1
0
    public void CheckKey()
    {
        if (pInv != null && MyKey != null)
        {
            if (pInv.ContainsItem(MyKey))
            {
                locked = false;
                foreach (symbolUpdater sym in symbols)
                {
                    if (!sym.active)
                    {
                        locked = true;
                    }
                }
            }

            if (locked)
            {
                //toolTipScript.UpdateTooltipMessage("The handle won't budge - there appears to be a cross shaped slot.");
                MessageRedBookHint.TriggerMessage();
                if (manager != null)
                {
                    manager.Play("Locked Door", false);
                }
            }
        }
        else
        {
            Tooltip.Message = "This door is locked.";
            Debug.LogError("Door is locked but there is no key or inv set");
        }
    }
Beispiel #2
0
    private void Awake()
    {
        int random = (int)Random.Range(1, 5);

        switch (random)
        {
        case 1:
            gameover1.TriggerMessage();
            break;

        case 2:
            gameover2.TriggerMessage();
            break;

        case 3:
            gameover3.TriggerMessage();
            break;

        case 4:
            gameover4.TriggerMessage();
            break;

        default:
            Debug.Log("Default case");
            break;
        }
    }
Beispiel #3
0
 void OpenInventoryToggle()
 {
     if (!canvasActive)
     {
         Puzzle.SetActive(true);
         canvasActive = true;
     }
     else
     {
         Puzzle.SetActive(false);
         canvasActive = false;
         if (PhotoPuzzle && allPhotoFounds == false)
         {
             if (havePhoto)
             {
                 PhotoPuzzleIntroMessageWithPhotos.TriggerMessage();
             }
             else
             {
                 PhotoPuzzleIntroMessageNoPhotos.TriggerMessage();
             }
             PhotoPuzzle = false;
         }
         if (allPhotoFounds)
         {
             PhotoPuzzleMessageAllPhotosFound.TriggerMessage();
         }
     }
 }
Beispiel #4
0
    public void checkAnswer()
    {
        if (Gear1.GetComponent <GearRotation>().movement == answer1 && Gear2.GetComponent <GearRotation>().movement == answer2 && Gear3.GetComponent <GearRotation>().movement == answer3 && !lost)
        {
            timer = 15f;
            ExitButton.gameObject.SetActive(true);
            solved = true;
            Solved.SetActive(true);
            GameObject.Find("BeartrapPuzzle").SetActive(false);
            if (!isTutorial)
            {
                manager.Stop("Hunter");
                SoundTrack.StopALL = false;
                SoundTrack.CheckFloor();
            }
            manager.Play("Success", false);

            if (isTutorial)
            {
                if (!playermovement.plyInv.ContainsItem(key))
                {
                    KeyPopUp.SetActive(true);
                    NeedKeyMessage.TriggerMessage();
                }
                else
                {
                    EnterTheHouse ETC = new EnterTheHouse();
                    StartCoroutine(ETC.LoadYourAsyncScene());
                }
            }
        }
    }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        dist = Vector3.Distance(this.transform.position, player.transform.position);

        if (dist <= range)
        {
            //listener.isFocus = false;
            if (uControls.Player.Interact.triggered)
            {
                if (!opened)
                {
                    if (coinPuzzle)
                    {
                        coinCanv.SetActive(true);
                    }

                    TaskString = "\n " + TaskString;
                    taskManager.updateList(TaskString);
                    opened = true;
                }
                if (!coinPuzzle || havCoins)
                {
                    OpenInventoryToggle();
                }
                else
                {
                    if (plyInv.ContainsItem(coins[0]) && plyInv.ContainsItem(coins[1]) && plyInv.ContainsItem(coins[2]) && plyInv.ContainsItem(coins[3]))
                    {
                        havCoins = true;
                        OpenInventoryToggle();

                        invCan.SetActive(true);
                        plyInv.RemoveItem(coins[0]);
                        plyInv.RemoveItem(coins[1]);
                        plyInv.RemoveItem(coins[2]);
                        plyInv.RemoveItem(coins[3]);
                        invCan.SetActive(false);
                        //taskManager.updateList("\n - I have to get the coins in their matching slots, but how?");
                    }
                    else
                    {
                        if (!reminder)
                        {
                            CoinPuzzleIntroMessage.TriggerMessage();
                            reminder = true;
                        }
                        else
                        {
                            CoinPuzzleReminder.TriggerMessage();
                        }
                    }
                }
            }
        }
    }
Beispiel #6
0
 private void SendMessageInOrder()
 {
     if (messageOrder == 1)
     {
         BCMessage1.TriggerMessage();
         messageOrder++;
     }
     if (messageOrder == 2)
     {
         BCMessage2.TriggerMessage();
         messageOrder++;
     }
     if (messageOrder == 3)
     {
         BCMessage3.TriggerMessage();
         messageOrder++;
     }
 }
Beispiel #7
0
 void Update()
 {
     /*
      * if(SkullPosition1 == 2 && SkullPosition2 == 0 && SkullPosition3 == 2 && SkullPosition4 == 0)
      * {
      *  Debug.Log("Solved");
      * }
      */
     if (!stg3)
     {
         if (!stg1)
         {
             cn1.CandleToggle(true);
         }
         if (SkullPosition1 == 2 && SkullPosition2 == 0 && SkullPosition3 == 2 && SkullPosition4 == 0 && !stg1)
         {
             stg1 = true;
             pillarDisplay.updatePilar("stage1");
             Debug.Log("Stg 1 Complete");
             manager.Play("Skull light", true);
             cn2.CandleToggle(true);
             cn1.CandleToggle(false);
         }
         if (SkullPosition1 == 1 && SkullPosition2 == 1 && SkullPosition3 == 3 && SkullPosition4 == 3 && stg1)
         {
             stg2 = true;
             pillarDisplay.updatePilar("stage2");
             Debug.Log("Stg 2 complete");
             manager.Play("Skull light", true);
             cn2.CandleToggle(false);
             cn3.CandleToggle(true);
         }
         if (SkullPosition1 == 0 && SkullPosition2 == 2 && SkullPosition3 == 0 && SkullPosition4 == 2 && stg1 && stg2)
         {
             stg3 = true;
             pillarDisplay.updatePilar("stage3");
             Debug.Log("Stg 3 complete, locking puzzle");
             manager.Play("Skull success", false);
             cn3.CandleToggle(false);
             this.GetComponent <SkullEnd>().OpenLeftEnding();
             EndPuzzleMessage.TriggerMessage();
         }
     }
 }
Beispiel #8
0
    private void Update()
    {
        if (sanityValue < 70 && sanityValue > 60 && MidSanityMessage.gameObject != null)
        {
            MidSanityMessage.TriggerMessage();
        }
        if (sanityValue < 50 && sanityValue > 30 && MidLowSanityMessage.gameObject != null)
        {
            MidLowSanityMessage.TriggerMessage();
        }
        if (sanityValue < 20 && sanityValue > 0 && LowSanityMessage != null)
        {
            LowSanityMessage.TriggerMessage();
        }

        if (sanityValue <= 0)
        {
            if (tick == 0)
            {
                tick++;
                PlayGameOver();
            }
        }

        if (effectOn)
        {
            if (timeLeft > 0)
            {
                timeLeft -= Time.deltaTime; //countdown to turn off the effect.
            }
            if (timeLeft <= 0)
            {
                turnOffEffect(currentlyPlaying);
            }
        }

        if (effectCue[0] != 0 && effectOn == false)
        {
            playEffect(effectCue[0]);
            removeEffectCue();
        }
    }
Beispiel #9
0
    // Update is called once per frame
    void Update()
    {
        dist = Vector3.Distance(this.transform.position, player.transform.position);

        index += Time.deltaTime;

        if (dist <= 0.7f && ladTaken == false)
        {
            //Listener.isFocus = false;

            if (uControls.Player.Interact.triggered)
            {
                inCanv.SetActive(true);
                Pinv.AddItem(brokenLadder);
                inCanv.SetActive(false);

                sprite.sprite = null;
                ladTaken      = true;
                CoinHint.TriggerMessage();
            }
        }
    }
Beispiel #10
0
 private void SendMessageInOrder()
 {
     if (sendMessage3)
     {
         playingMessage = true;
         sendMessage3   = false;
         message3.TriggerMessage();
     }
     if (sendMessage2)
     {
         playingMessage = true;
         sendMessage2   = false;
         sendMessage3   = true;
         message2.TriggerMessage();
     }
     if (sendMessage1 && playingMessage == false)
     {
         playingMessage = true;
         sendMessage1   = false;
         sendMessage2   = true;
         message1.TriggerMessage();
     }
 }
Beispiel #11
0
    // Update is called once per frame
    void Update()
    {
        if (player.myRoom != null && player.myRoom.getName() != "Outside")
        {
            if (!profane)
            {
                Clock += Time.deltaTime;
            }
            else
            {
                Clock += (Time.deltaTime / 2);
            }

            if (Clock >= endTime) //Check if sys time is beyond end time, if so decrease sanity
            {
                sanityWait -= Time.deltaTime;
                if (sanityWait <= 0)
                {
                    sanity.ChangeSanity(-20);
                    sanityWait = 10f;
                }
            }
            else
            {
                hourHand.GetComponent <RectTransform>().Rotate(0f, 0f, ((-0.25f * Time.deltaTime) / 2));
                minuteHand.GetComponent <RectTransform>().Rotate(0f, 0f, ((-3f * Time.deltaTime) / 2));
            }

            /*if(sanity.sanityValue <= 0) //Check if the player has any sanity, if not end the game
             * {
             *  SceneManager.LoadScene(2); //Load the Game Over scene
             *  escntrl.endMessage = "You ran out of time.";
             *  Cursor.visible = true;
             * }*/

            //Check for events
            if (Clock >= WatcherTime)
            {
                watcher.SetActive(true);
            }
            else if (watcherAI.WatcherHallway)
            {
                watcher.SetActive(true);
            }
            else
            {
                watcher.SetActive(false);
            }

            if (Clock >= CreepTime)
            {
                creep.SetActive(true);
            }
            else
            {
                creep.SetActive(false);
            }

            if (Clock >= TrapTime)
            {
                TrapCtrl.SetActive(true);
            }
            else
            {
                TrapCtrl.SetActive(false);
            }

            //Check for each hour, play clock sound each time.
            if (Clock >= 0 && Clock <= 1 && manager != null && hourIsPlaying == false)
            {
                Debug.Log("got here 1111");
                hourIsPlaying = true;
                manager.Play("Clock 5", false);
                clipLength = 20 + Clock;                //clipLength was added so that Clock Tick would not play while these bells are playing.

                Message5pm.TriggerMessage();
                //popup.UpdateTooltipMessage("5PM: 10 hours remain.");
            }
            else if (Clock >= 240 && Clock <= 242 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 6", false);
                clipLength = 23 + Clock;
                Message6pm.TriggerMessage();
                // popup.UpdateTooltipMessage("6PM: 9 hours remain.");
            }
            else if (Clock >= 480 && Clock <= 482 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 7", false);
                clipLength = 26 + Clock;
                Message7pm.TriggerMessage();
                //popup.UpdateTooltipMessage("7PM: 8 hours remain.");
            }
            else if (Clock >= 720 && Clock <= 722 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 8", false);
                clipLength = 29 + Clock;
                Message8pm.TriggerMessage();
                //popup.UpdateTooltipMessage("8PM: 7 hours remain.");
            }
            else if (Clock >= 960 && Clock <= 962 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 9", false);
                clipLength = 32 + Clock;

                //popup.UpdateTooltipMessage("9PM: 6 hours remain.");
            }
            else if (Clock >= 1200 && Clock <= 1202 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 10", false);
                clipLength = 35 + Clock;
                Message10pm.TriggerMessage();
                //popup.UpdateTooltipMessage("10PM: 5 hours remain.");
            }
            else if (Clock >= 1440 && Clock <= 1442 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 11", false);
                clipLength = 38 + Clock;

                //popup.UpdateTooltipMessage("11PM: 4 hours remain.");
            }
            else if (Clock >= 1680 && Clock <= 1682 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 12", false);
                clipLength = 40 + Clock;

                MessageMidnight.TriggerMessage();
                //popup.UpdateTooltipMessage("12AM: 3 hours remain.");
            }
            else if (Clock >= 1920 && Clock <= 1922 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 1", false);
                clipLength = 8 + Clock;
                if (BrockenWatchSolved.solved)
                {
                    Message1amNoClock.TriggerMessage();
                }
                else
                {
                    Message1am.TriggerMessage();
                }
                //popup.UpdateTooltipMessage("1AM: 2 hours remain.");
            }
            else if (Clock >= 2160 && Clock <= 2162 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 2", false);
                clipLength = 11 + Clock;
                if (BrockenWatchSolved.solved)
                {
                    Message2amNoClock.TriggerMessage();
                }
                else
                {
                    Message2am.TriggerMessage();
                }

                //popup.UpdateTooltipMessage("22AM: 1 hours remain.");
            }
            else if (Clock >= 2400 && Clock <= 2402 && manager != null && hourIsPlaying == false)
            {
                hourIsPlaying = true;
                manager.Play("Clock 3", false);
                clipLength = 14 + Clock;
                Message3am.TriggerMessage();
                //popup.UpdateTooltipMessage("3AM: Time's Up");
            }
            else if (hourIsPlaying == true && Clock > clipLength - 2)
            {
                hourIsPlaying = false;
            }
        }
    }