]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/View.qc
Base blur amount on swallow progress. The screen will blur at full configured intensi...
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index 3e48e2d36fc871205507a80f4a954362b5860732..2ef460109ed8c78d161c47090c2d7f7af2296dad 100644 (file)
@@ -708,6 +708,12 @@ void CSQC_UpdateView(float w, float h)
                        liquidcolor = stov(cvar_string("hud_contents_stomach_color"));\r
                        incontent = 1;\r
                }\r
+               else if(getstatf(STAT_VORE_PROGRESS_PREY))\r
+               {\r
+                       liquidalpha = cvar("hud_contents_swallow_alpha");\r
+                       liquidcolor = stov(cvar_string("hud_contents_swallow_color"));\r
+                       incontent = getstatf(STAT_VORE_PROGRESS_PREY); // based on the swallow progress\r
+               }\r
                else\r
                {\r
                        switch(pointcontents(view_origin))\r
@@ -1031,21 +1037,21 @@ void CSQC_UpdateView(float w, float h)
 \r
        // draw radar\r
        if(\r
-                       ons_showmap\r
+                       showmap\r
                        ||\r
                        (\r
                         !scoreboard_active\r
                         &&\r
-                        cvar_string("cl_teamradar") != "0"\r
+                        cvar_string("cl_radar") != "0"\r
                         &&\r
                         (\r
-                         cvar("cl_teamradar") == 2\r
+                         cvar("cl_radar") == 2\r
                          ||\r
                          teamplay\r
                         )\r
                        )\r
          )\r
-               teamradar_view();\r
+               radar_view();\r
 \r
        // Draw artwork and play intermission music\r
        if(intermission && !isdemo() && gametype != GAME_RPG && !spectatee_status) // the match has ended. Don't do this for RPG because no one wins or loses there\r
@@ -1150,43 +1156,46 @@ void CSQC_UpdateView(float w, float h)
        hud = getstati(STAT_HUD);\r
 \r
        if(cvar("r_letterbox") == 0)\r
-               if(cvar("viewsize") < 120)\r
+               if(cvar("viewsize") < 120 && sbar_hudselector)\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
+       if(sbar_hudselector) // flashes require some HUD components to work\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 not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach load\r
+               if(cvar("cl_flash_pickup"))\r
+               if(pickup_flash_time < getstatf(STAT_LAST_PICKUP))\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
+                       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 = hud_total_prey;\r
+\r
+                       if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach 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
 \r
-               // always update the last vore state, or the flash can be triggered when switching spectated players one frame after\r
-               vore_flash_laststate = vore_flash_state;\r
+                       // always update the last vore state, or the flash can be triggered when switching spectated players one frame after\r
+                       vore_flash_laststate = vore_flash_state;\r
+               }\r
+               if(cvar("cl_flash_respawn"))\r
+               if(respawned)\r
+                       localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n"));\r
        }\r
-       if(cvar("cl_flash_respawn"))\r
-       if(respawned)\r
-               localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n"));\r
 \r
        if not(getstati(STAT_VORE_EATEN)) // crosshair is useless if we're in the stomach\r
        if not(getstati(STAT_ARMOR) < g_power || time <= power_boot)\r
        {\r
                // crosshair goes VERY LAST\r
-               if(!scoreboard_active && !ons_showmap && !camera_active) {\r
+               if(!scoreboard_active && !showmap && !camera_active) {\r
                        // TrueAim check\r
                        float shottype;\r
                        // wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;\r