]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Add screen flashes for eating and getting eaten
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 11 Jul 2011 01:14:08 +0000 (04:14 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 11 Jul 2011 01:14:08 +0000 (04:14 +0300)
data/defaultVT.cfg
data/qcsrc/client/View.qc
data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c

index 445db813b2b92ebe84ad827e6f0bb5cf5eadf569..bbb96ea9fa9c747fc32d2992644fdf44640d0a0e 100644 (file)
@@ -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"\r
 seta cl_flash_pickup 0.25 "if enabled, the screen flashes by this amount when picking up an item"\r
 seta cl_flash_pickup_color "0 0 1" "color of the pickup flash"\r
+seta cl_flash_vore 0.25 "if enabled, the screen flashes by this amount when eating or getting eaten"\r
+seta cl_flash_vore_color_prey "1 0 0" "color of the vore flash for prey"\r
+seta cl_flash_vore_color_pred "0 1 0" "color of the vore flash for predators"\r
 fov 90\r
 seta cl_velocityzoom -0.2      "velocity based zooming of fov, negative values zoom out"\r
 seta cl_velocityzoomtime 0.3   "time value for averaging speed values"\r
index 8a5144fbc8dae7267fb47a60d54b30ee416082ba..523538a551271242419a4ae944d7e561769c62b2 100644 (file)
@@ -253,7 +253,7 @@ float camera_mode;
 float reticle_type;\r
 float chase_active_old;\r
 float artwork_fade;\r
-float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time;\r
+float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flash_laststate;\r
 float myhealth, myhealth_prev, myhealth_flash;\r
 float contentavgalpha, liquidalpha_prev;\r
 float old_blurradius, old_bluralpha, old_sharpen_intensity;\r
@@ -1033,6 +1033,28 @@ void CSQC_UpdateView(float w, float h)
                if(cvar("viewsize") < 120)\r
                        CSQC_common_hud();\r
 \r
+       if(cvar("cl_flash_pickup"))\r
+       if(pickup_flash_time < getstatf(STAT_LAST_PICKUP))\r
+       {\r
+               localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n"));\r
+               pickup_flash_time = getstatf(STAT_LAST_PICKUP);\r
+       }\r
+       if(cvar("cl_flash_vore"))\r
+       {\r
+               float vore_flash_state;\r
+               if(getstati(STAT_VORE_EATEN))\r
+                       vore_flash_state = -1;\r
+               else\r
+                       vore_flash_state = getstati(STAT_VORE_LOAD);\r
+\r
+               if(vore_flash_state > vore_flash_laststate && vore_flash_state > 0) // stomach load is bigger, so we ate someone\r
+                       localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_pred"), " ", cvar_string("cl_flash_vore"), "\n"));\r
+               if(vore_flash_state < vore_flash_laststate && vore_flash_state < 0) // -1 means we have been eaten\r
+                       localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_prey"), " ", cvar_string("cl_flash_vore"), "\n"));\r
+\r
+               vore_flash_laststate = vore_flash_state;\r
+       }\r
+\r
        if not(getstati(STAT_VORE_EATEN)) // crosshair is useless if we're in the stomach\r
        {\r
                // crosshair goes VERY LAST\r
@@ -1176,13 +1198,6 @@ void CSQC_UpdateView(float w, float h)
                                        wcross_scale += sin(pickup_crosshair_size) * cvar("crosshair_pickup");\r
                                }\r
 \r
-                               if(cvar("cl_flash_pickup"))\r
-                               if(pickup_flash_time < getstatf(STAT_LAST_PICKUP))\r
-                               {\r
-                                       localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n"));\r
-                                       pickup_flash_time = getstatf(STAT_LAST_PICKUP);\r
-                               }\r
-\r
                                if(shottype == SHOTTYPE_HITENEMY)\r
                                        wcross_scale *= cvar("crosshair_hittest"); // is not queried if hittest is 0\r
                                if(shottype == SHOTTYPE_HITTEAM)\r
index b52906d20bd9815440edcc6b1b5bb3a7274e82fc..af40dcff4c643869a1df00358b1843933189b4c4 100644 (file)
@@ -34,7 +34,8 @@ void fillVoretHudDialog(entity me)
                makeMulti(sl, "hud_stomach");\r
        me.TR(me);\r
                me.TDempty(me, 0.2);\r
-               me.TD(me, 1, 0.5, e = makeVoretCheckBoxEx(0.25, 0, "cl_flash_pickup", "Pickup flashes"));\r
+               me.TD(me, 1, 0.5, e = makeVoretCheckBoxEx(0.25, 0, "cl_flash_pickup", "Screen flashes"));\r
+               makeMulti(e, "cl_flash_vore");\r
        me.TR(me);\r
                me.TDempty(me, 0.2);\r
                me.TD(me, 1, 2, e = makeVoretCheckBox(0, "cl_reticle_item_normal", "Zoom reticles"));\r