예제 #1
0
    public void OnDamaged(DamageContext damage)
    {
        currentDamage += damage.RollDamage();

        if (currentDamage >= TriggerDamage)
        {
            InvokeTrigger(this);
        }
    }
예제 #2
0
파일: ICharacter.cs 프로젝트: gormed/darwin
    ////////////////////////////////////////////////////////////////////

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

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

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