Beispiel #1
0
 public override void HurtPlayer(float damage)
 {
     //GetComponent<SpriteRenderer>().color = Color.magenta;
     DamageTextHandler.makeDamageText(damage.ToString(), transform, 1f, "Player");
     hurt_sound.Play();
     currentHealth -= damage;
     StartCoroutine(HurtTime());
 }
 public virtual void HurtEnemy(float damage)
 {
     DamageTextHandler.makeDamageText(damage.ToString(), transform, 1f, "Enemy");
     if (chase_player != null)
     {
         chase_player.hurt = true;
     }
     else if (shoot_player != null)
     {
         //Debug.Log("hey i got hurt");
         shoot_player.hurt = true;
     }
     else if (boss != null)
     {
         boss.hurt = true;
     }
     //Debug.Log("Ouch I was hit");
     currentHealth         -= damage;
     healthImage.fillAmount = currentHealth / maxHealth;  // **wont do until ask nikhil
 }
Beispiel #3
0
 public void HealPlayer(float heal)
 {
     DamageTextHandler.makeDamageText(heal.ToString(), transform, 1f, "Heal");
     currentHealth += heal;
 }
Beispiel #4
0
 public virtual void HurtPlayer(float damage)
 {
     DamageTextHandler.makeDamageText(damage.ToString(), transform, 1f, "Player");
     currentHealth -= damage;
     StartCoroutine(HurtTime());
 }