示例#1
0
    public override void Start()
    {
        base.Start();
        DamageCreateContext dct = new DamageCreateContext();

        dct.SrcUID      = m_srcID;
        dct.DamageValue = m_damageValue;
        dct.HitShowID   = m_hitShowID;

        if (m_owner != null)
        {
            if (m_owner.IsDead() == false)
            {
                m_owner.OnDamage(dct);
            }
        }
    }
示例#2
0
    public override void OnDamage(DamageCreateContext damage)
    {
        base.OnDamage(damage);

        SetProp(PropID.HP, -damage.DamageValue);
        if (IsDead())
        {
            DeadContext deadCtx = new DeadContext();
            deadCtx.SrcEntityID = damage.SrcUID;
            OnDead(deadCtx);
            return;
        }

        m_entityView.PlayEfficacyView(damage.HitShowID);

        float fcurhp = GetProp(PropID.HP);
        float fmaxhp = GetProp(PropID.MaxHP);

        if (BloodChange != null)
        {
            BloodChange(fcurhp, fmaxhp);
        }
    }
示例#3
0
 public virtual void OnDamage(DamageCreateContext damage)
 {
 }