From: MirceaKitsune Date: Wed, 13 Jul 2011 16:41:34 +0000 (+0300) Subject: Spawn FOV effect X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a6547d24f78609029fb98c9c9ba14a2219a573ef;p=voretournament%2Fvoretournament.git Spawn FOV effect --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 08db8645..7d926714 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -144,6 +144,8 @@ 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" seta cl_flash_respawn 0.25 "if enabled, the screen flashes by this amount when picking up an item" seta cl_flash_respawn_color "1 1 1" "color of the pickup flash" +seta cl_spawnfov 0.5 "the field of view starts zoomed out by this amount when you spawn" +seta cl_spawnfov_speed 1 "the fov fades back to normal at this speed" 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 164fc951..1ab5b7ea 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -255,6 +255,7 @@ float reticle_type; float chase_active_old; float artwork_fade; float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flash_laststate; +float spawnfov_current; float myhealth, myhealth_prev, myhealth_flash; float contentavgalpha, liquidalpha_prev; float old_blurradius, old_bluralpha, old_sharpen_intensity; @@ -446,6 +447,19 @@ void CSQC_UpdateView(float w, float h) vid_conheight = cvar("vid_conheight"); vid_pixelheight = cvar("vid_pixelheight"); + // spawn fov effect + if(cvar("cl_spawnfov")) + { + if(respawned) + spawnfov_current = 1 + cvar("cl_spawnfov"); + + if(spawnfov_current > 1) + spawnfov_current -= cvar("cl_spawnfov_speed") * frametime; + else + spawnfov_current = 1; + fov *= spawnfov_current; + } + R_SetView(VF_FOV, GetCurrentFov(fov)); // Camera for demo playback