float spawnfov_current;\r
float myhealth, myhealth_prev, myhealth_flash;\r
float contentavgalpha, liquidalpha_prev;\r
-float old_blurradius, old_bluralpha, old_sharpen_intensity;\r
+float old_blurradius, old_bluralpha, old_cartoon_intensity;\r
float stomachsplash_alpha;\r
float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2;\r
float volume_modify_changed_1, volume_modify_changed_2;\r
// enable or disable rendering types if they are used or not\r
if(cvar("r_glsl_postprocess_uservec1_enable") != (cvar("hud_postprocessing_maxbluralpha") != 0))\r
cvar_set("r_glsl_postprocess_uservec1_enable", ftos(cvar("hud_postprocessing_maxbluralpha") != 0));\r
- if(cvar("r_glsl_postprocess_uservec2_enable") != (cvar("hud_powerup") != 0))\r
- cvar_set("r_glsl_postprocess_uservec2_enable", ftos(cvar("hud_powerup") != 0));\r
+ if(cvar("r_glsl_postprocess_uservec2_enable") != (cvar("hud_cartoon") != 0))\r
+ cvar_set("r_glsl_postprocess_uservec2_enable", ftos(cvar("hud_cartoon") != 0));\r
\r
// lets apply the postprocess effects from the previous two functions if needed\r
if((damage_blurpostprocess_x || content_blurpostprocess_x) && cvar("chase_active") >= 0) // not while the event chase camera is active\r
old_bluralpha = 0;\r
}\r
\r
- float sharpen_intensity;\r
- if (getstatf(STAT_STRENGTH_FINISHED) - time > 0)\r
- sharpen_intensity += (getstatf(STAT_STRENGTH_FINISHED) - time);\r
- if (getstatf(STAT_INVINCIBLE_FINISHED) - time > 0)\r
- sharpen_intensity += (getstatf(STAT_INVINCIBLE_FINISHED) - time);\r
-\r
- if(cvar("hud_powerup") && sharpen_intensity > 0 && cvar("chase_active") >= 0) // not while the event chase camera is active\r
+ if(cvar("hud_cartoon"))\r
{\r
- sharpen_intensity = bound(0, sharpen_intensity, 5); // powerup warning time is 5 seconds, so fade the effect from there\r
-\r
- if(sharpen_intensity != old_sharpen_intensity) // reduce cvar_set spam as much as possible\r
+ // When having the strength or invincible powerups, cartoon lines will be white instead of black.\r
+ // As powerup time goes under 5 seconds (warning time), lines will fade from white to nothing then from nothing back to black.\r
+ float cartoon_intensity, cartoon_powerup;\r
+ cartoon_intensity = -cvar("hud_cartoon");\r
+ cartoon_powerup = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 5) + bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 5);\r
+ cartoon_powerup = bound(0, cartoon_powerup, 5);\r
+ if (cartoon_powerup && cvar("chase_active") >= 0) // not while the event chase camera is active\r
+ cartoon_intensity *= 1 - cartoon_powerup / 2.5; // cycle between -1 and 1\r
+\r
+ if(cartoon_intensity != old_cartoon_intensity) // reduce cvar_set spam as much as possible\r
{\r
- cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(-sharpen_intensity * cvar("hud_powerup")), " 0 0"));\r
- old_sharpen_intensity = sharpen_intensity;\r
+ cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(cartoon_intensity), " ", cvar_string("hud_cartoon_tolerance"), " 0"));\r
+ old_cartoon_intensity = cartoon_intensity;\r
}\r
}\r
else if(cvar_string("r_glsl_postprocess_uservec2") != "0 0 0 0") // reduce cvar_set spam as much as possible\r
{\r
cvar_set("r_glsl_postprocess_uservec2", "0 0 0 0");\r
- old_sharpen_intensity = 0;\r
+ old_cartoon_intensity = 0;\r
}\r
}\r
\r
cvar_set("r_glsl_postprocess_uservec1", "0 0 0 0");\r
cvar_set("r_glsl_postprocess_uservec1_enable", "0");\r
}\r
- if(cvar("hud_postprocessing") && !cvar("hud_powerup"))\r
+ if(cvar("hud_postprocessing") && !cvar("hud_cartoon"))\r
if(cvar("r_glsl_postprocess_uservec2_enable"))\r
{\r
// don't allow sharpen to get stuck on if we disable the cvar while powered up\r
e.savedValue = 0.5; // default\r
me.TD(me, 1, 2, s);\r
me.TR(me);\r
+ me.TD(me, 1, 1, e = makeVoretCheckBoxEx(1, 0, "hud_cartoon", "Cartoon lines"));\r
me.TD(me, 1, 1, e = makeVoretCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", "Damage & Water blur"));\r
- me.TD(me, 1, 1, e = makeVoretCheckBoxEx(0.25, 0, "hud_powerup", "Powerup sharpen"));\r
me.TD(me, 1, 1, e = makeVoretCheckBox(0, "hud_saturation", "Armor saturation"));\r
\r
me.gotoRC(me, me.rows - 1, 0);\r