]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/View.qc
Spawn FOV effect
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index f1aeeec786295683c3d731d05b72a20b91cedfd5..1ab5b7ea3b1ff0b4d4ff7ba0203c8455c7b60f09 100644 (file)
@@ -255,6 +255,7 @@ float reticle_type;
 float chase_active_old;\r
 float artwork_fade;\r
 float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flash_laststate;\r
+float spawnfov_current;\r
 float myhealth, myhealth_prev, myhealth_flash;\r
 float contentavgalpha, liquidalpha_prev;\r
 float old_blurradius, old_bluralpha, old_sharpen_intensity;\r
@@ -446,6 +447,19 @@ void CSQC_UpdateView(float w, float h)
        vid_conheight = cvar("vid_conheight");\r
        vid_pixelheight = cvar("vid_pixelheight");\r
 \r
+       // spawn fov effect\r
+       if(cvar("cl_spawnfov"))\r
+       {\r
+               if(respawned)\r
+                       spawnfov_current = 1 + cvar("cl_spawnfov");\r
+\r
+               if(spawnfov_current > 1)\r
+                       spawnfov_current -= cvar("cl_spawnfov_speed") * frametime;\r
+               else\r
+                       spawnfov_current = 1;\r
+               fov *= spawnfov_current;\r
+       }\r
+\r
        R_SetView(VF_FOV, GetCurrentFov(fov));\r
 \r
        // Camera for demo playback\r
@@ -1044,8 +1058,6 @@ void CSQC_UpdateView(float w, float h)
                pickup_flash_time = getstatf(STAT_LAST_PICKUP);\r
        }\r
        if(cvar("cl_flash_vore"))\r
-       if(!respawned) // guards against a bug\r
-       if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach load\r
        {\r
                float vore_flash_state;\r
                if(getstati(STAT_VORE_EATEN))\r
@@ -1053,11 +1065,15 @@ void CSQC_UpdateView(float w, float h)
                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
+               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
        }\r
        if(cvar("cl_flash_respawn"))\r