Beispiel #1
0
    IEnumerator deadanim()
    {
        game.timeup = true;
        anim.SetBool("Dead", true);
        yield return(new WaitForSeconds(3));

        Debug.Log("Jalan");
        anim.SetBool("Dead", false);
        game.lose();
    }
Beispiel #2
0
 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());
         }
     }
 }