void EnemyTurn() { if (state != BattleState.ENEMYTURN) { return; } if (moldUnitOne.AttemptAttack(playerUnit.GetSpeed(), playerUnit.GetIntimidation(), playerUnit.GetDefense(false))) { StartCoroutine(PrintText("MOLD uses SPORES")); StartCoroutine(EnemyAttack(moldUnitOne.ReturnDamage())); } else { StartCoroutine(PrintText("MOLD misses attack")); if (numEnemies > 1) { StartCoroutine(EnemyTwoTurn()); } else { state = BattleState.PLAYERTURN; PlayerTurn(); } } }
IEnumerator EnemyFourTurn() { if (moldUnitFour.AttemptAttack(playerUnit.GetSpeed(), playerUnit.GetIntimidation(), playerUnit.GetDefense(false))) { StartCoroutine(PrintText("MOLD 4 uses SPORES")); playerUnit.TakeDamage(moldUnitFour.ReturnDamage()); } else { StartCoroutine(PrintText("MOLD 4 misses its attack")); } yield return(new WaitForSeconds(2f)); StartCoroutine(EnemyThreeTurn()); }
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(); }
void EnemyTurn() { if (state != BattleState.ENEMYTURN) { return; } Debug.Log("Enemy's turn"); if (numEnemies == 1) { if (moldUnitOne.AttemptAttack(playerUnit.GetSpeed(), playerUnit.GetIntimidation(), playerUnit.GetDefense(false))) { dialogueText.text = "MOLD uses SPORES"; StartCoroutine(EnemyAttack(moldUnitOne.ReturnDamage())); } else { dialogueText.text = "MOLD misses attack"; state = BattleState.PLAYERTURN; } } }