public void TakeDamage(int i, IDamageSender sender) { var damageReceiver = GetComponentInParent <IDamageReceiver>(); if (damageReceiver != null) { damageReceiver.TakeDamage(i, sender); } }
public void TakeDamage(int amount, IDamageSender sender) { var pushForce = sender.Stunable ? 1.0F : 0.5F; var stunTime = sender.Stunable ? 3.0F : 1.5F; var stun = GetComponent <IStunable>(); if (stun != null) { stun.Stun(stunTime); } var pushable = GetComponent <IPushable>(); if (pushable != null) { var dir = transform.position - sender.transform.position; dir.Normalize(); pushable.Push(dir, pushForce); } SelectRandomWeakPoint(); }
public override void TakeDamage(IDamageSender hero) { Console.WriteLine($"{hero.Nickname} бьёт по шлему"); Console.WriteLine("Pshhh..."); }
/// <summary> /// Получение урона /// </summary> /// <param name="sender">Источник урона</param> public virtual void TakeDamage(IDamageSender sender) { Console.WriteLine($"{sender.Nickname} жестко наказывает {Nickname}-а. {Nickname} плачет."); }