Esempio n. 1
0
    // but not that Panic...
    public void Panic()
    {
        // only panic if we're not already panicked
        if (isPanicked == false)
        {
            isPanicked = true;
            waiting    = false;

            // start the coroutine to play the sound over and over
            StartCoroutine("ReaperCry");

            // change the music
            refMusicManager.SetMusicStatus(MusicStatus.reaperTheme);

            // if haven't yet, spawn reapettes
            if (spawnedReapettes == false)
            {
                Instantiate(reapettePrefab, Vector2.zero, Quaternion.identity);
                spawnedReapettes = true;
            }

            // stop panicking after a little bit
            Invoke("StopPanicking", panicTime);
        }
    }
Esempio n. 2
0
 private void OrneMusic()
 {
     if (playMusic)
     {
         refMusicManager.SetMusicStatus(MusicStatus.orneTheme);
     }
     else if (refMusicManager.GetMusicStatus() == MusicStatus.orneTheme)
     {
         refMusicManager.SetMusicStatus(MusicStatus.mainTheme);
     }
 }
Esempio n. 3
0
    void OnTriggerStay2D(Collider2D other)
    {
        if (other.CompareTag("Enemy") && canGetHit == true)
        {
            refPlayerAudio.PlayHurt();
            currentHealth--;
            canGetHit = false;
            Invoke("StopInvincibility", invincibilityTime);
        }

        if (other.CompareTag("Theif") && canGetHit == true)
        {
            List <int> candidates = new List <int>();

            if (refPlayerMovement.extraJumps != 1)
            {
                candidates.Add(0);
            }

            /*if (hearts > 0)
             * {
             * candidates.Add(1);
             * }
             *
             * if (refPlayerShoot.hasChargeReticle || refPlayerShoot.hasLongbow)
             * {
             * candidates.Add(2);
             * }*/

            if (candidates.Count > 0)
            {
                int rand = Random.Range(0, candidates.Count);

                switch (candidates[rand])
                {
                case 0:
                {
                    textTheft.text = "Roc's Feather stolen!";
                    if (refPlayerMovement.extraJumps != 1)
                    {
                        refPlayerMovement.extraJumps--;
                    }
                    break;
                }

                case 1:
                {
                    textTheft.text = "Half of your hearts stolen!";
                    hearts         = hearts / 2;
                    break;
                }

                case 2:
                {
                    textTheft.text = "Bow upgrades stolen!";
                    refPlayerShoot.arrowChargeLevel = 0;
                    refPlayerShoot.arrowRangeLevel  = 0;

                    break;
                }

                default:
                {
                    break;
                }
                }
            }
            else
            {
                textTheft.text = "Couldn't steal anything!";
            }

            refPlayerAudio.PlayTheif();

            CancelInvoke("ResetTheftMessage");
            Invoke("ResetTheftMessage", 3.0f);

            canGetHit = false;
            Invoke("StopInvincibility", invincibilityTime);
        }

        if (other.CompareTag("SafeZone"))
        {
            refMusicManager.SetMusicStatus(MusicStatus.shopTheme);
            inSafeZone = true;
        }

        if (other.CompareTag("TextArea"))
        {
            textMessages.text = other.gameObject.GetComponent <TextArea>().text;
        }
        else
        {
            textMessages.text = "";
        }
    }