Ejemplo n.º 1
0
 public virtual void TakeDamage(int damage, Util.Enums.Element incommingElement)
 {
     if (!invincible)
     {
         health = health - (int)(damage * Util.Elements.GetDamageMultiplier(element, incommingElement));
         if (health <= 0)
         {
             currentNode.clearOccupied();
             Destroy(this.gameObject);
         }
     }
 }
Ejemplo n.º 2
0
 public override void TakeDamage(int damage, Util.Enums.Element incommingElement)
 {
     if (!invincible)
     {
         health = health - (int)(damage * Util.Elements.GetDamageMultiplier(element, incommingElement));
         if (UpdateHealth != null)
         {
             UpdateHealth(health, playerNumber);
         }
         if (health <= 0)
         {
             currentNode.clearOccupied();
             if (playerNumber == 1)
             {
                 Managers.GameManager.Player1Lose = true;
             }
             else
             {
                 Managers.GameManager.Player1Win = true;
             }
         }
     }
 }