public float GetProgression() { if (TutorialStatus.GetTutorialStage() > 0) { return((float)0.0f); //No curse strength is given. } if (waveComplete) { return((float)1.0f); } return((float)numberEnemiesKilled / waveArrays[GetCurrentWave() - 1].wave.Length); }
IEnumerator EnemyKilled() { animator.SetBool("isDead", true); yield return(new WaitForSeconds(1f)); if (TutorialStatus.GetTutorialStage() > 0) //If the tutorial is active, trigger "TutorialEnemyKilled". { TutorialStatus.TutorialEnemyKilled(); Destroy(this.gameObject); } if (enemyIsDead) { pauseCheck.AddPoints(pointsWhenKilled); progressionController.enemyKilled(FinalBossMinion); } Destroy(this.gameObject); //Kill enemy }
//Power1 is true if it is the LEFT power chosen. Otherwise, it is false (RIGHT power). public void LosePower(bool Power1) { UIController ui = GameObject.Find("UIHandler").GetComponent <UIController>(); PowerBehaviour powers = GameObject.Find("PowerHandler").GetComponent <PowerBehaviour>(); Progression progressionCheck = GameObject.Find("ProgressionHandler").GetComponent <Progression>(); GameObject audioController; audioController = GameObject.FindGameObjectWithTag("MusicHandler"); audioController.GetComponent <AudioController>().PlayMusic(0); TutorialHandler TutStatus = GameObject.FindWithTag("TutorialHandler").GetComponent <TutorialHandler>(); if (TutStatus.GetTutorialStage() > 0) { TutStatus.PowerDrained(); } if (Power1) { powers.LoseSpecificPower(ui.losePower1); switch (powers.powerHandler[ui.losePower1].PowerStrength) { case 3: { ui.AddPoints((progressionCheck.GetMaximumWaves() - progressionCheck.GetCurrentWave()) * 500); break; } case 2: { ui.AddPoints((progressionCheck.GetMaximumWaves() - progressionCheck.GetCurrentWave()) * 250); break; } case 1: { break; } default: { break; } } } else { powers.LoseSpecificPower(ui.losePower2); switch (powers.powerHandler[ui.losePower2].PowerStrength) { case 3: { ui.AddPoints((progressionCheck.GetMaximumWaves() - progressionCheck.GetCurrentWave()) * 500); break; } case 2: { ui.AddPoints((progressionCheck.GetMaximumWaves() - progressionCheck.GetCurrentWave()) * 250); break; } case 1: { break; } default: { break; } } } ui.setLockPauseMenu(false); ui.returnToMainGame(); Cursor.lockState = CursorLockMode.None; if (TutStatus.GetTutorialStage() > 0) //Skip weapon selection. { progressionCheck.SetWaveComplete(false); Cursor.lockState = CursorLockMode.Locked; return; } ui.WeaponSelection(); progressionCheck.SetWaveComplete(false); }