public void takedamage(int damage) { if (damage != 0) { wrongcounter = 0; combocounter++; StartCoroutine(hurtanimu()); if (combocounter == 5 || combocounter == 10 || combocounter == 15 || combocounter == 20 || combocounter == 25 && onskill == false) { //doing good dogood(); } } else if (damage == 0) { combocounter = 0; wrongcounter++; if (wrongcounter == 3 || wrongcounter == 6 || wrongcounter == 9 || wrongcounter == 12 || wrongcounter == 15 || wrongcounter == 18 || wrongcounter == 21 || wrongcounter == 24 || wrongcounter == 27 && onskill == false) { //doing bad dobad(); } if (skill2wrong == true && skill2counter == 3) { game.lose(); } } if (hp == 1 && damage > 1) { hp = 0; } else { hp -= damage; if (hp > 5 && hp < 11) { healthpointer2.text = "2x"; } else if (hp > 0 && hp < 6) { healthpointer2.text = "1x"; } } // updatehps(); if (hp == 0) { StartCoroutine(deadanimu()); } else { if (doubleatt == true) { doubleatt = false; } else if (skill2wrong == true) { game.changequestion(); } else { StartCoroutine(chottomatte()); } } }
public void takedamage(int damage) { StartCoroutine(takedamageanim()); hp -= damage; if (hp > 5 && hp < 11) { healthpointer.text = "2x"; } else if (hp > 0 && hp < 6) { healthpointer.text = "1x"; } // updatehps(); if (hp == 0) { StartCoroutine(deadanim()); } else { if (target.choicesq == true) { storei = game.i; game.i = 20 + cq; morestore = game.i; cq++; Debug.Log("Stored"); skilldialoguebox.SetActive(true); skilldialogue.text = "I think you'll be confused with this..."; } else if (target.unlearnedq == true) { storei = game.i; game.i = 30 + uq; morestore = game.i; uq++; Debug.Log("Stored"); skilldialoguebox.SetActive(true); skilldialogue.text = "Good. But can you answer this?"; } else if (target.simpleq == true) { storei = game.i; game.i = 25 + sq; morestore = game.i; sq++; Debug.Log("Stored"); skilldialoguebox.SetActive(true); skilldialogue.text = "Can you even answer this easy one?"; } game.refilltime(); game.changequestion(); if (target.choicesq == true) { target.choicesq = false; target.onskill = false; helpme = true; game.i = storei; Debug.Log("Loaded"); } else if (target.unlearnedq == true) { target.unlearnedq = false; target.onskill = false; helpme = true; game.i = storei; Debug.Log("Loaded"); } else if (target.simpleq == true) { target.simpleq = false; target.onskill = false; helpme = true; game.i = storei; Debug.Log("Loaded"); } } }