Exemplo n.º 1
0
 public virtual void TakeDamage(int amount, LVector3 hitPoint)
 {
     if (isInvincible || isDead)
     {
         return;
     }
     curHealth -= amount;
     EntityView?.OnTakeDamage(amount, hitPoint);
     OnTakeDamage(amount, hitPoint);
     if (isDead)
     {
         OnDead();
     }
 }
Exemplo n.º 2
0
 public virtual void TakeDamage(BaseEntity atker, int amount, LVector3 hitPoint)
 {
     if (isInvincible || isDead)
     {
         return;
     }
     DebugService.Trace($"{atker.EntityId} attack {EntityId}  damage:{amount} hitPos:{hitPoint}");
     curHealth -= amount;
     EntityView?.OnTakeDamage(amount, hitPoint);
     OnTakeDamage(amount, hitPoint);
     if (isDead)
     {
         OnDead();
     }
 }