seta hud_damage_factor 0.025 "(damage * factor) = how much to add to the alpha value"
seta hud_damage_fade_rate 1 "how much to subtract from the alpha value each second"
seta hud_damage_maxalpha 2 "how much to limit the alpha value to"
-seta hud_damage_pain_treshold 0.1 "how much alpha to ignore (must be bigger than the hud_damage_factor so that e.g. rot is ignored)"
-seta hud_damage_pain_treshold_lower 1.25 "how much we lower pain_treshold with when nearing 0 health (if pain_treshold gets negative then we always draw a flash at alpha = fabs(pain_treshold)"
-seta hud_damage_pain_treshold_lower_health 70 "at which health we start lowering pain_treshold"
-seta hud_damage_pain_treshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"
-seta hud_damage_pain_treshold_pulsating_period 0.8 "one pulse every X seconds"
+seta hud_damage_pain_threshold 0.1 "how much alpha to ignore (must be bigger than the hud_damage_factor so that e.g. rot is ignored)"
+seta hud_damage_pain_threshold_lower 1.25 "how much we lower pain_threshold with when nearing 0 health (if pain_threshold gets negative then we always draw a flash at alpha = fabs(pain_threshold)"
+seta hud_damage_pain_threshold_lower_health 50 "at which health we start lowering pain_threshold"
+seta hud_damage_pain_threshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"
+seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds"
// scoreboard
seta scoreboard_columns default
// add new damage
myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * cvar("hud_damage_factor"), cvar("hud_damage_maxalpha"));
- float pain_treshold, pain_treshold_lower, pain_treshold_lower_health;
- pain_treshold = cvar("hud_damage_pain_treshold");
- pain_treshold_lower = cvar("hud_damage_pain_treshold_lower");
- pain_treshold_lower_health = cvar("hud_damage_pain_treshold_lower_health");
+ float pain_threshold, pain_threshold_lower, pain_threshold_lower_health;
+ pain_threshold = cvar("hud_damage_pain_threshold");
+ pain_threshold_lower = cvar("hud_damage_pain_threshold_lower");
+ pain_threshold_lower_health = cvar("hud_damage_pain_threshold_lower_health");
- if(pain_treshold_lower && myhealth < pain_treshold_lower_health)
+ if(pain_threshold_lower && myhealth < pain_threshold_lower_health)
{
- pain_treshold = pain_treshold - max(cvar("hud_damage_pain_treshold_pulsating_min"), fabs(sin(M_PI * time / cvar("hud_damage_pain_treshold_pulsating_period")))) * pain_treshold_lower * (1 - max(0, myhealth)/pain_treshold_lower_health);
+ pain_threshold = pain_threshold - max(cvar("hud_damage_pain_threshold_pulsating_min"), fabs(sin(M_PI * time / cvar("hud_damage_pain_threshold_pulsating_period")))) * pain_threshold_lower * (1 - max(0, myhealth)/pain_threshold_lower_health);
}
- myhealth_flash_temp = bound(0, myhealth_flash - pain_treshold, 1);
+ myhealth_flash_temp = bound(0, myhealth_flash - pain_threshold, 1);
if(myhealth_prev < 1)
{
{
if(autocvar_cl_gentle_damage == 2)
{
- if(myhealth_flash < pain_treshold) // only randomize when the flash is gone
+ if(myhealth_flash < pain_threshold) // only randomize when the flash is gone
{
myhealth_gentlergb = eX * random() + eY * random() + eZ * random();
}