コード例 #1
0
    // Token: 0x06002D25 RID: 11557 RVA: 0x000A8C94 File Offset: 0x000A6E94
    protected override global::LifeStatus Hurt(ref global::DamageEvent damage)
    {
        global::LifeStatus lifeStatus = base.Hurt(ref damage);
        bool flag = (damage.damageTypes & (global::DamageTypeFlags.damage_bullet | global::DamageTypeFlags.damage_melee | global::DamageTypeFlags.damage_explosion)) != (global::DamageTypeFlags)0;

        if (flag)
        {
            this._healOverTime = 0f;
        }
        if (lifeStatus == global::LifeStatus.WasKilled)
        {
            base.CancelInvoke("DoBleed");
        }
        else if (lifeStatus == global::LifeStatus.IsAlive && base.healthLossFraction > 0.2f)
        {
            float num = damage.amount / base.maxHealth;
            if ((damage.damageTypes & (global::DamageTypeFlags.damage_bullet | global::DamageTypeFlags.damage_melee)) != (global::DamageTypeFlags)0 && damage.amount > base.maxHealth * 0.05f)
            {
                int num2 = 0;
                if (num >= 0.25f)
                {
                    num2 = 1;
                }
                else if (num >= 0.15f)
                {
                    num2 = 2;
                }
                else if (num >= 0.05f)
                {
                    num2 = 3;
                }
                bool flag2 = Random.Range(0, num2) == 1 || num2 == 1;
                if (flag2)
                {
                    this.AddBleedingLevel(Mathf.Clamp(damage.amount * 0.15f, 1f, base.maxHealth));
                    this.bleedAttacker = damage.attacker.id;
                    this.bleedingID    = damage.victim.id;
                }
            }
        }
        return(lifeStatus);
    }
コード例 #2
0
    // Token: 0x06000B8E RID: 2958 RVA: 0x0002D6CC File Offset: 0x0002B8CC
    protected void ProcessDamageEvent(ref global::DamageEvent damage)
    {
        if (this.takenodamage)
        {
            return;
        }
        global::LifeStatus status = damage.status;

        if (status != global::LifeStatus.IsAlive)
        {
            if (status == global::LifeStatus.WasKilled)
            {
                this._health = 0f;
            }
        }
        else
        {
            this._health -= damage.amount;
        }
    }