]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Fade the stomach splash effect in and out. Once you are swallowed, it appears quickly...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Feb 2011 22:44:33 +0000 (00:44 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Feb 2011 22:44:33 +0000 (00:44 +0200)
data/defaultVoretournament.cfg
data/qcsrc/client/View.qc

index dfdfba8d18428b3bb5e2c1416c4f77520b7d1818..9307508ab1f2968754423ec1deef23871a8b238b 100644 (file)
@@ -1083,8 +1083,10 @@ seta hud_damage_pain_threshold_lower_health 50 "at which health we start lowerin
 seta hud_damage_pain_threshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"\r
 seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds"\r
 \r
-seta hud_stomach 0.3 "displays a splash on the screen when inside the stomach, value specifies alpha"\r
+seta hud_stomach 0.5 "displays a splash on the screen when inside the stomach, value specifies alpha"\r
 seta hud_stomach_color "0.5 1 0" "color of the stomach screen splash"\r
+seta hud_stomach_fade_in 0.1 "how quickly the stomach splash appears when you get swallowed"\r
+seta hud_stomach_fade_out 0.025 "how quickly the stomach splash disappears when you are regurgitated"\r
 \r
 seta hud_postprocessing 1 "enables the ability for effects such as hud_damage_blur and hud_contents to apply a postprocessing method upon the screen - enabling this disables manual editing of the postprocess cvars"\r
 seta hud_postprocessing_maxbluralpha 0.5 "maximum alpha which the blur postprocess can be"\r
index e6a94a0775415baf0d5473daf59a154fcd171848..e5bc1907df00cce09ccaef426d13913987ef8cce 100644 (file)
@@ -255,6 +255,7 @@ float artwork_fade;
 float pickup_crosshair_time, pickup_crosshair_size;\r
 float myhealth, myhealth_prev, myhealth_flash;\r
 float contentavgalpha, liquidalpha_prev;\r
+float stomachsplash_alpha;\r
 vector myhealth_gentlergb;\r
 vector liquidcolor_prev;\r
 vector damage_blurpostprocess, content_blurpostprocess;\r
@@ -591,8 +592,24 @@ void CSQC_UpdateView(float w, float h)
        }\r
 \r
        if(cvar("hud_stomach"))\r
-       if(getstati(STAT_VORE_EATEN))\r
-               drawpic('0 0 0', "gfx/blood", '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, stov(cvar_string("hud_stomach_color")), cvar("hud_stomach"), DRAWFLAG_NORMAL);\r
+       {\r
+               if(getstati(STAT_VORE_EATEN))\r
+               {\r
+                       if(stomachsplash_alpha < cvar("hud_stomach"))\r
+                               stomachsplash_alpha += cvar("hud_stomach_fade_in") * frametime;\r
+                       else\r
+                               stomachsplash_alpha = cvar("hud_stomach");\r
+               }\r
+               else\r
+               {\r
+                       if(stomachsplash_alpha > 0)\r
+                               stomachsplash_alpha -= cvar("hud_stomach_fade_out") * frametime;\r
+                       else\r
+                               stomachsplash_alpha = 0;\r
+               }\r
+               stomachsplash_alpha = bound(0, stomachsplash_alpha, 1);\r
+               drawpic('0 0 0', "gfx/blood", '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, stov(cvar_string("hud_stomach_color")), stomachsplash_alpha, DRAWFLAG_NORMAL);\r
+       }\r
 \r
        if(cvar("hud_postprocessing"))\r
        { // lets apply the postprocess effects from the previous two functions if needed\r