From 36705db17de1dd733a9b4c9ec2e05e89ef620b70 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 11 Jul 2011 04:14:08 +0300 Subject: [PATCH] Add screen flashes for eating and getting eaten --- data/defaultVT.cfg | 3 ++ data/qcsrc/client/View.qc | 31 ++++++++++++++----- .../dialog_multiplayer_playersetup_hud.c | 3 +- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 445db813..bbb96ea9 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -139,6 +139,9 @@ seta cl_reticle_item_weapon 1 "draw aiming reticle for weapon zoom, 0 disables a seta cl_reticle_item_normal 1 "draw reticle when zooming without a weapon, 0 disables and values between 0 and 1 change alpha" seta cl_flash_pickup 0.25 "if enabled, the screen flashes by this amount when picking up an item" seta cl_flash_pickup_color "0 0 1" "color of the pickup flash" +seta cl_flash_vore 0.25 "if enabled, the screen flashes by this amount when eating or getting eaten" +seta cl_flash_vore_color_prey "1 0 0" "color of the vore flash for prey" +seta cl_flash_vore_color_pred "0 1 0" "color of the vore flash for predators" fov 90 seta cl_velocityzoom -0.2 "velocity based zooming of fov, negative values zoom out" seta cl_velocityzoomtime 0.3 "time value for averaging speed values" diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index 8a5144fb..523538a5 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -253,7 +253,7 @@ float camera_mode; float reticle_type; float chase_active_old; float artwork_fade; -float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time; +float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flash_laststate; float myhealth, myhealth_prev, myhealth_flash; float contentavgalpha, liquidalpha_prev; float old_blurradius, old_bluralpha, old_sharpen_intensity; @@ -1033,6 +1033,28 @@ void CSQC_UpdateView(float w, float h) if(cvar("viewsize") < 120) CSQC_common_hud(); + if(cvar("cl_flash_pickup")) + if(pickup_flash_time < getstatf(STAT_LAST_PICKUP)) + { + localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n")); + pickup_flash_time = getstatf(STAT_LAST_PICKUP); + } + if(cvar("cl_flash_vore")) + { + float vore_flash_state; + if(getstati(STAT_VORE_EATEN)) + vore_flash_state = -1; + else + vore_flash_state = getstati(STAT_VORE_LOAD); + + if(vore_flash_state > vore_flash_laststate && vore_flash_state > 0) // stomach load is bigger, so we ate someone + localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_pred"), " ", cvar_string("cl_flash_vore"), "\n")); + if(vore_flash_state < vore_flash_laststate && vore_flash_state < 0) // -1 means we have been eaten + localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_prey"), " ", cvar_string("cl_flash_vore"), "\n")); + + vore_flash_laststate = vore_flash_state; + } + if not(getstati(STAT_VORE_EATEN)) // crosshair is useless if we're in the stomach { // crosshair goes VERY LAST @@ -1176,13 +1198,6 @@ void CSQC_UpdateView(float w, float h) wcross_scale += sin(pickup_crosshair_size) * cvar("crosshair_pickup"); } - if(cvar("cl_flash_pickup")) - if(pickup_flash_time < getstatf(STAT_LAST_PICKUP)) - { - localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n")); - pickup_flash_time = getstatf(STAT_LAST_PICKUP); - } - if(shottype == SHOTTYPE_HITENEMY) wcross_scale *= cvar("crosshair_hittest"); // is not queried if hittest is 0 if(shottype == SHOTTYPE_HITTEAM) diff --git a/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c b/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c index b52906d2..af40dcff 100644 --- a/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c +++ b/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c @@ -34,7 +34,8 @@ void fillVoretHudDialog(entity me) makeMulti(sl, "hud_stomach"); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 0.5, e = makeVoretCheckBoxEx(0.25, 0, "cl_flash_pickup", "Pickup flashes")); + me.TD(me, 1, 0.5, e = makeVoretCheckBoxEx(0.25, 0, "cl_flash_pickup", "Screen flashes")); + makeMulti(e, "cl_flash_vore"); me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 2, e = makeVoretCheckBox(0, "cl_reticle_item_normal", "Zoom reticles")); -- 2.39.2