Пример #1
0
    public void OnDamaged(DamageContext damage)
    {
        currentDamage += damage.RollDamage();

        if (currentDamage >= TriggerDamage)
        {
            InvokeTrigger(this);
        }
    }
Пример #2
0
    ////////////////////////////////////////////////////////////////////

    public virtual void OnDamaged(DamageContext damage)
    {
        if (IsDead)
        {
            return;
        }

        Live -= damage.RollDamage();
        if (Live <= 0)
        {
            Live = 0;
            OnDeath();
            return;
        }

        if (DamagedEvent != null)
        {
            DamagedEvent(this);
        }
    }