From: MirceaKitsune Date: Sun, 5 Sep 2010 23:08:00 +0000 (+0300) Subject: Finalize the effect. Not really what I wanted but it's good for now X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=aaa0540204466e528bf0b5d1d4410823d807cc27;p=voretournament%2Fvoretournament.git Finalize the effect. Not really what I wanted but it's good for now --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index 5d62f8ac..2c815b43 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -1498,6 +1498,7 @@ seta g_ghost_items 1 "enable ghosted items (when between 0 and 1, overrides the seta g_ghost_items_color "-1 -1 -1" "color of ghosted items, 0 0 0 leaves the color unchanged" set cl_vore_stomachmodel 1 "when enabled, we see the stomach model around us when eaten. -1 = disabled, 1 = enabled, anything between 0 and 1 = alpha" +set cl_vore_cameraspeed 1.5 "speed at which you see yourself sliding down when getting swallowed, 0 disables" set g_vore_regurgitatecolor_released "0.75 1 0.5" "the color players will have when released from the stomach alive" set g_vore_regurgitatecolor_digested "-0.125 0.25 0" "the color players will have when released from the stomach digested" set g_vore_gurglesound 1 "predators make an ambient gurgling sound" diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 6a6a9aa6..0e2bce89 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -332,8 +332,9 @@ float sv_clforceplayermodels; #endif .float cvar_cl_gunalign; .float cvar_cl_noantilag; -.float cvar_chase_active; .float cvar_cl_vore_stomachmodel; +.float cvar_cl_vore_cameraspeed; +.float cvar_chase_active; void Announce(string snd); void AnnounceTo(entity e, string snd); diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 65af9b2c..e897ff0f 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -616,6 +616,7 @@ void GetCvars(float f) GetCvars_handleFloat(s, f, cvar_cl_accuracy_data_receive, "cl_accuracy_data_receive"); GetCvars_handleFloat(s, f, cvar_chase_active, "chase_active"); GetCvars_handleFloat(s, f, cvar_cl_vore_stomachmodel, "cl_vore_stomachmodel"); + GetCvars_handleFloat(s, f, cvar_cl_vore_cameraspeed, "cl_vore_cameraspeed"); self.cvar_cl_accuracy_data_share = boolean(self.cvar_cl_accuracy_data_share); self.cvar_cl_accuracy_data_receive = boolean(self.cvar_cl_accuracy_data_receive); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index fede02e6..1a3fa9e4 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -69,15 +69,19 @@ void Vore_CameraEffect_Apply() if(self.eater.classname != "player") return; - local float step; - step = 2 * frametime; // CVAR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + if(self.cvar_cl_vore_cameraspeed) + { + local float step; + step = self.cvar_cl_vore_cameraspeed * frametime; - if(self.cameraeffect_current >= self.cameraeffect_target + step) - self.cameraeffect_current -= step; - else if(self.cameraeffect_current <= self.cameraeffect_target - step) - self.cameraeffect_current += step; + if(self.cameraeffect_current >= self.cameraeffect_target + step) + self.cameraeffect_current -= step; + else if(self.cameraeffect_current <= self.cameraeffect_target - step) + self.cameraeffect_current += step; + } + else + self.cameraeffect_current = self.cameraeffect_target; -bprint(strcat(ftos(self.cameraeffect_current), "<<-----------\n")); self.view_ofs_z = self.vore_oldview_ofs_z / self.cameraeffect_current; }