Пример #1
0
    public void ActivateCombatMode()
    {
        // Enables the HealthBar to appear and activates its attached script
        healthBar.enabled = true;

        AudioManagerBG.SwitchTrack("combat");

        // Tells the HealthBar to start playing its CombatMode animations
        HealthBar.instance.gameObject.SendMessage("StartBeat", true);
        PlayerCombat.instance.gameObject.SendMessage("TimeToFight", true);
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     instance       = this;
     berimBAM       = Resources.Load <AudioClip>("Sounds/aud_berimBAM2");
     combatTheme    = Resources.Load <AudioClip>("Sounds/bg_combatBeats126");
     grandmaTheme   = Resources.Load <AudioClip>("Sounds/bg_nightmareWhoopie");
     nightmareTheme = Resources.Load <AudioClip>("Sounds/bg_nightmare1");
     stratumTheme   = Resources.Load <AudioClip>("Sounds/bg_explorationPhase");
     theSource      = GetComponent <AudioSource>();
     if (theSource == null)
     {
         theSource = gameObject.AddComponent <AudioSource>();
     }
     SwitchTrack("stratum");
 }
Пример #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.CompareTag("Player") && !allWavesComplete)
        {
            AudioManagerBG.SwitchTrack("combat");
            PlayerCombat.instance.gameObject.SendMessage("TimeToFight", true);
            if (numWaves <= 0)
            {
                Debug.Log("There are no waves!");
                StartCoroutine(SelfDestruct());
                return;
            }

            if (oh != null)
            {
                oh.SetOverhead(this, numWaves);
            }
            Debug.Log("Total number of enemies on this floor: " + numEnemies);
            // Immediately spawn first wave upon walking into activationBox
            StartCoroutine(SpawnWave(waves[nextWave]));
            borderL.enabled = true;     // Turns on left wall of combat area
            borderR.enabled = true;     // Turns on right wall of combat area

            if (boxy != null)
            {
                //manipulate camera values
                cf.XMinValue = borderL.transform.position.x + 5;
                //cf.XMaxValue = borderR.transform.position.x - 5;
            }

            // Activates magical flame walls to confine player
            foreach (ParticleSystem ps in leftFlames)
            {
                ps.Play();
            }
            foreach (ParticleSystem ps in rightFlames)
            {
                ps.Play();
            }
            // Disables activationBox so we don't accidentally re-trigger the WaveSpawner
            // (Also handled through SelfDestruct Coroutine)
            activationBox.enabled = false;
            beginTheWaves         = true;
        }
    }
Пример #4
0
    // Will probably be an IEnumerator so we can add a quick yield delay for switching things off/on
    IEnumerator BerimBeats()
    {
        isPlaying = true;
        AudioManagerBG.SwitchTrack("berimBAM");

        // Freeze the player (momentarily), play some music, button prompts
        MovePlayer.instance.canMove = false;

        Destroy(flight, berimgone);
        // Then either a combo multiplies total damage to affect enemies all at once at the end of the ability
        // OR hits that happen in quick succession with each correctly timed button press
        yield return(new WaitForSeconds(berimgone));

        anim.SetBool("Berimbau", false);
        MovePlayer.instance.canMove = true;
        isPlaying = false;
        yield return(new WaitForSeconds(berimgone));

        attackDamage = baseDamage;
    }