Example #1
0
bool Creature::add_env_effect(efftype_id eff_id, body_part vector, int, int dur)
{
    if (dice(1, 3) > dice(get_env_resist(vector), 3)) {
        add_effect(eff_id, dur);
        return true;
    } else {
        return false;
    }
}
Example #2
0
bool Creature::add_env_effect(efftype_id eff_id, body_part vector, int strength, int dur,
                                int intensity, bool permanent)
{
    if (dice(strength, 3) > dice(get_env_resist(vector), 3)) {
        add_effect(eff_id, dur, intensity, permanent);
        return true;
    } else {
        return false;
    }
}
Example #3
0
bool Creature::add_env_effect(efftype_id eff_id, body_part vector, int strength, int dur,
                              body_part bp, bool permanent, int intensity)
{
    if (dice(strength, 3) > dice(get_env_resist(vector), 3)) {
        // Only add the effect if we fail the resist roll
        add_effect(eff_id, dur, bp, permanent, intensity);
        return true;
    } else {
        return false;
    }
}
bool Creature::add_env_effect( const efftype_id &eff_id, body_part vector, int strength,
                               const time_duration dur, body_part bp, bool permanent, int intensity, bool force )
{
    if( !force && is_immune_effect( eff_id ) ) {
        return false;
    }

    if (dice(strength, 3) > dice(get_env_resist(vector), 3)) {
        // Only add the effect if we fail the resist roll
        // Don't check immunity (force == true), because we did check above
        add_effect( eff_id, dur, bp, permanent, intensity, true );
        return true;
    } else {
        return false;
    }
}