From: MirceaKitsune Date: Fri, 25 Feb 2011 22:44:33 +0000 (+0200) Subject: Fade the stomach splash effect in and out. Once you are swallowed, it appears quickly... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a05ae717b3103b054ea3805c5d16377e54125cd1;p=voretournament%2Fvoretournament.git Fade the stomach splash effect in and out. Once you are swallowed, it appears quickly. But after regurgitation, you still see it for a bit --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index dfdfba8d..9307508a 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -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))" seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds" -seta hud_stomach 0.3 "displays a splash on the screen when inside the stomach, value specifies alpha" +seta hud_stomach 0.5 "displays a splash on the screen when inside the stomach, value specifies alpha" seta hud_stomach_color "0.5 1 0" "color of the stomach screen splash" +seta hud_stomach_fade_in 0.1 "how quickly the stomach splash appears when you get swallowed" +seta hud_stomach_fade_out 0.025 "how quickly the stomach splash disappears when you are regurgitated" 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" seta hud_postprocessing_maxbluralpha 0.5 "maximum alpha which the blur postprocess can be" diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index e6a94a07..e5bc1907 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -255,6 +255,7 @@ float artwork_fade; float pickup_crosshair_time, pickup_crosshair_size; float myhealth, myhealth_prev, myhealth_flash; float contentavgalpha, liquidalpha_prev; +float stomachsplash_alpha; vector myhealth_gentlergb; vector liquidcolor_prev; vector damage_blurpostprocess, content_blurpostprocess; @@ -591,8 +592,24 @@ void CSQC_UpdateView(float w, float h) } if(cvar("hud_stomach")) - if(getstati(STAT_VORE_EATEN)) - 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); + { + if(getstati(STAT_VORE_EATEN)) + { + if(stomachsplash_alpha < cvar("hud_stomach")) + stomachsplash_alpha += cvar("hud_stomach_fade_in") * frametime; + else + stomachsplash_alpha = cvar("hud_stomach"); + } + else + { + if(stomachsplash_alpha > 0) + stomachsplash_alpha -= cvar("hud_stomach_fade_out") * frametime; + else + stomachsplash_alpha = 0; + } + stomachsplash_alpha = bound(0, stomachsplash_alpha, 1); + 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); + } if(cvar("hud_postprocessing")) { // lets apply the postprocess effects from the previous two functions if needed