Esempio n. 1
0
    public bool TakeDamage(float _damage, GlobalDamage.DamageTypes _type)
    {
        if (!this.enabled)
        {
            return(false);
        }

        switch (_type)
        {
        case GlobalDamage.DamageTypes.DAMAGE_BALLISTIC_SMALL:
            health -= _damage;
            break;

        case GlobalDamage.DamageTypes.DAMAGE_FIRE_NORMAL:
            health -= _damage;
            // state
            break;

        case GlobalDamage.DamageTypes.DAMAGE_FIRE_TICK:
            // Calculate based on max health instead
            health -= _damage;
            break;
        }
        return(true);
    }
Esempio n. 2
0
    public bool TakeDamage(float _damage, GlobalDamage.DamageTypes _type)
    {
        if (!this.enabled)
        {
            return(false);
        }

        switch (_type)
        {
        case GlobalDamage.DamageTypes.DAMAGE_BALLISTIC_SMALL:
            health -= _damage;
            break;

        case GlobalDamage.DamageTypes.DAMAGE_FIRE_NORMAL:
            health -= _damage;
            break;

        case GlobalDamage.DamageTypes.DAMAGE_FIRE_TICK:
            health -= _damage;
            break;

        case GlobalDamage.DamageTypes.DAMAGE_ROCKET:
            health -= _damage;
            break;
        }
        return(true);
    }