예제 #1
0
 public void TakeDamage(int damage)
 {
     //play a hurt sound
     //Instantiate(bloodEffect, transform.position, Quaternion.identity);
     dazedTime = startDazedTime;
     health   -= damage;
     healthBar.SetHealth(health);
     Debug.Log("damage TAKEN !");
 }
 public override void OnTakeDamage(float damage)
 {
     if (alive)
     {
         if (!distraction.IsAtDistraction)
         {
             distraction.ResetDistraction();
             sight.SetSightOnPlayer();
         }
         currTotalHealth -= damage;
         healthUI.SetHealth(currTotalHealth);
     }
 }
 public override void Attack(float damage, string damager = "Normal")
 {
     manager.OnTakeDamage(damage);
     if (damager == currDamager)
     {
         currDamageAmount -= damage;
         if (damager == "Normal")
         {
             health -= damage;
             bossUI.SetHealth(health);
         }
         else
         {
             bossUI.SpecialDamage();
         }
         if (currDamageAmount <= 0.0f)
         {
             if (currDamager == "Normal")
             {
                 if (specialDamagers.Count > 0)
                 {
                     currDamager = specialDamagers[0];
                     bossUI.SetSpecial(currDamager);
                     specialDamagers.RemoveAt(0);
                     currDamageAmount = specialDamage;
                 }
                 else
                 {
                     manager.Kill();
                 }
             }
             else
             {
                 currDamager      = "Normal";
                 currDamageAmount = normalDamage;
             }
         }
     }
 }