IEnumerator EnemyAttack(float damage) { yield return(new WaitForSeconds(2f)); playerUnit.TakeDamage(damage); Debug.Log("Back to player"); state = BattleState.PLAYERTURN; PlayerTurn(); }
IEnumerator EnemyTwoTurn() { if (moldUnitTwo.AttemptAttack(playerUnit.GetSpeed(), playerUnit.GetIntimidation(), playerUnit.GetDefense(false))) { StartCoroutine(PrintText("MOLD 2 uses SPORES")); playerUnit.TakeDamage(moldUnitTwo.ReturnDamage()); } else { StartCoroutine(PrintText("MOLD 2 misses its attack")); } yield return(new WaitForSeconds(2f)); if (playerUnit.currHealth <= 0.0f) { SceneManager.LoadScene("Game Over"); } state = BattleState.BOSSTURN; BossTurn(); }
IEnumerator EnemyTwoTurn() { if (moldUnitTwo.AttemptAttack(playerUnit.GetSpeed(), playerUnit.GetIntimidation(), playerUnit.GetDefense(false))) { StartCoroutine(PrintText("MOLD 2 uses SPORES")); playerUnit.TakeDamage(moldUnitTwo.ReturnDamage()); } else { StartCoroutine(PrintText("MOLD 2 misses its attack")); } yield return(new WaitForSeconds(2f)); if (playerUnit.currHealth <= 0.0f) { //YOU LOSE SIR, GOOD DAY } state = BattleState.PLAYERTURN; PlayerTurn(); }
private void Attack() { playerBattle.TakeDamage(5); currentATB -= 1; }