public void endCombat() { if (enemy.getHP() <= 0) { resetStrength(); enemy.resetAttack(); changes.text = ""; myHP.text = "Hp = " + hp.ToString(); enemyHP.text = "HP = " + enemy.getHP().ToString(); exp = exp + enemy.giveEXP(); PlayerPrefs.SetInt("Exp", exp); if (exp == nextLevel) { levelUP(); } else { winText.text = "You Win!"; if (enemy.tag == "Dragon") { StartCoroutine("EndGame"); } else { StartCoroutine("Wait"); } } } else { StartCoroutine("WaitText"); } }
public void endCombat() { if (enemy.getHP() <= 0) { resetStrength(); enemy.resetAttack(); changes.text = ""; myHP.text = "Hp = " + hp.ToString(); enemyHP.text = "HP = " + enemy.getHP().ToString(); exp = exp + enemy.giveEXP(); PlayerPrefs.SetInt("Exp", exp); if (exp == nextLevel) { levelUP(); } else { winText.text = "You Win!"; if (enemy.tag == "Dragon") { StartCoroutine("EndGame"); } else { StartCoroutine("Wait"); } } } else { if (player.getHP() == 0) { canvas.SetActive(false); cam2.SetActive(false); player.allyCam.SetActive(true); player.allyCanvas.SetActive(true); enemy.startTurn(); } else { canvas.SetActive(false); allyCanvas.SetActive(true); cam2.SetActive(false); allyCam.SetActive(true); player.startTurn(); } } }