Ejemplo n.º 1
0
    public virtual bool SendStatusNotify(CharacterNotifyEvent notify)
    {
        if (IsInvincibility)
        {
            return(false);
        }

        if (notify.Type == CharacterNotifyType.E_Damage && CurrentHp > 0f)
        {
            CurrentHp = Mathf.Max(CurrentHp - (float)notify.Data, 0f);
            if (CurrentHp <= 0f)
            {
                Owner.ConsumeNotifyEvent(notify);
                Owner.AddNotifyEvent(new CharacterNotifyEvent(CharacterNotifyType.E_Dead, null));
                return(false);
            }
        }

        else if (notify.Type == CharacterNotifyType.E_Stun)
        {
            IsStun          = true;
            CurrentStunTime = (float)notify.Data;
        }
        else if (notify.Type == CharacterNotifyType.E_Invincibility)
        {
            IsInvincibility = (bool)notify.Data;
        }

        return(true);
    }
Ejemplo n.º 2
0
    public override bool SendStatusNotify(CharacterNotifyEvent notify)
    {
        if (notify.Type == CharacterNotifyType.E_Damage)
        {
            Owner.ConsumeNotifyEvent(notify);
            return(false);
        }

        return(base.SendStatusNotify(notify));
    }