Esempio n. 1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         if (possessionCheck)
         {
             if (other.GetComponent <PlayerPossession>().itemName == conditionalItem)
             {
                 changeScene();
                 Debug.Log(other.GetComponent <PlayerPossession>().itemName);
             }
             else
             {
                 SaySmt.PrepLine("Priest", "Hey, no ghosts allowed!");
                 SaySmt.PrepLine("Clyde", "I think I need a disguise to get in...");
                 SaySmt.PlayLines();
             }
         }
         else if (destinationSwitchId < 0)
         {
             SaySmt.Line("", "A mysterious voice tells you to not look back.");
             SaySmt.prepClose = true;
         }
         else
         {
             changeScene();
         }
     }
 }
Esempio n. 2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         if (isLocked)
         {
             if (other.GetComponent <PlayerPossession>().itemName == unlockingKey)
             {
                 GetComponent <SpriteRenderer>().sprite = unlockedSprite;
                 GetComponents <AudioSource>()[0].Play(0);
                 other.GetComponent <PlayerPossession>().Depossess();
                 StartCoroutine(waitForDepossess());
                 Destroy(GameObject.Find(unlockingKey));
             }
             else if (other.GetComponent <PlayerPossession>().itemName == "FalseKey")
             {
                 SaySmt.Line("Clyde", "Looks like this is a fake key! :(");
                 SaySmt.prepClose = true;
             }
             else if (other.GetComponent <PlayerPossession>().itemName.Contains("Key"))
             {
                 SaySmt.Line("Clyde", "Doesn't look like the right key...");
                 SaySmt.prepClose = true;
             }
             else
             {
                 GetComponents <AudioSource>()[1].Play(0);
                 SaySmt.Line("Clyde", "The door is locked. I think I need a key.");
                 SaySmt.prepClose = true;
                 Debug.Log("Door locked! Need key");
             }
         }
     }
 }
 private void Update()
 {
     if (Input.GetKeyDown("escape"))
     {
         SaySmt.Line("", "Press J to unpause,\nPress Q to go to quit to the main menu", false, true);
         SaySmt.prepClose = true;
     }
 }
Esempio n. 4
0
    IEnumerator PlayerDeath()
    {
        yield return(new WaitForSeconds(5f));

        player.GetComponent <PlayerMovement>().gameOverSFX[1].Play(0);
        SaySmt.Line("", "GAME OVER!", true);
        SaySmt.prepClose = true;
    }
Esempio n. 5
0
    IEnumerator WaitForDeathAnim()
    {
        yield return(new WaitForSeconds(1.5f));

        gameOverSFX[1].Play(0);
        SaySmt.Line("", "GAME OVER!", true);
        SaySmt.prepClose = true;
        // This is to enable the Coffin Dance music if we want
        // main.GetComponents<AudioSource>()[2].enabled = true;
    }
Esempio n. 6
0
 void WinGame()
 {
     winGame     = true;
     gameStarted = false;
     stationaryCultists.SetActive(false);
     mobileCultists.SetActive(false);
     sacrificialBonnie.SetActive(false);
     music[0].Stop();
     music[1].Stop();
     music[2].Play(0);
     SaySmt.PrepLine("Priests", "Noooo the ritual is ruined!!!");
     SaySmt.PrepLine("Priests", "We will be back.....");
     SaySmt.PlayLines();
     SaySmt.prepClose = true;
 }
Esempio n. 7
0
 // Update is called once per frame
 public void Speak()
 {
     if (!spoken && lines.Count > 0)
     {
         foreach (var line in lines)
         {
             SaySmt.PrepLine(line.speaker != "" ? line.speaker : "", line.message);
         }
         SaySmt.PlayLines();
         spoken = true;
     }
     else
     {
         SaySmt.Line(endLine.speaker, endLine.message);
     }
 }
Esempio n. 8
0
 void LoseGame()
 {
     loseGame    = true;
     gameStarted = false;
     music[0].Stop();
     music[1].Stop();
     music[3].Play(0);
     camera.GetComponent <FollowPlayer>().enabled = false;
     camera.transform.position = new Vector3(-3, 8, -10);
     player.GetComponent <PlayerMovement>().speed = 0;
     director.GetComponent <PlayableDirector>().Play();
     sacrificialBonnie.SetActive(false);
     SaySmt.PrepLine("Demon", "HAHA!");
     SaySmt.PrepLine("Demon", "I HAVE BEEN SUMMONED!");
     SaySmt.PrepLine("Demon", "DIEEE LITTLE GHOST!");
     SaySmt.PlayLines();
     SaySmt.prepClose = true;
     StartCoroutine(PlayerDeath());
 }