From 35f5024ed5e377f89840ed171708338efb866f86 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 27 Feb 2011 22:57:09 +0200 Subject: [PATCH] Autodigest client-side feature. When enabled, a player automatically begins digesting enemy prey once swallowing it. --- data/defaultVoretournament.cfg | 1 + data/qcsrc/server/defs.qh | 1 + data/qcsrc/server/miscfunctions.qc | 1 + data/qcsrc/server/vore.qc | 24 ++++++++++++++++++++++++ 4 files changed, 27 insertions(+) diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index c2987426..6db7ef52 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -1517,6 +1517,7 @@ set cl_vore_punchangle 14 "your view gets tilted by this amount when swallowing seta cl_vore_cutvolume_sound 0.75 "sound volume is reduced to this amount when you are in a stomach" seta cl_vore_cutvolume_music 0.5 "music volume is reduced to this amount when you are in a stomach" seta cl_vore_cutvolume_fade 0.1 "fading speed of the volume change" +seta cl_vore_autodigest 0 "when enabled, the player will automatically begin digesting enemy prey after eating them, as long as no team mates are inside" set g_vore 1 "enables the vore system, you want this on!" set g_vore_digestion 1 "enables digestion system, you want this on!" set g_vore_kick 1 "enables stomach kick system, you want this on!" diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index d1834f65..1cb07470 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -337,6 +337,7 @@ float sv_clforceplayermodels; .float cvar_cl_vore_stomachmodel; .float cvar_cl_vore_cameraspeed; .float cvar_cl_vore_punchangle; +.float cvar_cl_vore_autodigest; .float cvar_chase_active; void Announce(string snd); diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 60cdad05..ea84cacf 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -618,6 +618,7 @@ void GetCvars(float f) GetCvars_handleFloat(s, f, cvar_cl_vore_stomachmodel, "cl_vore_stomachmodel"); GetCvars_handleFloat(s, f, cvar_cl_vore_cameraspeed, "cl_vore_cameraspeed"); GetCvars_handleFloat(s, f, cvar_cl_vore_punchangle, "cl_vore_punchangle"); + GetCvars_handleFloat(s, f, cvar_cl_vore_autodigest, "cl_vore_autodigest"); 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 eab85fbf..b4a2126e 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -140,6 +140,29 @@ void Vore_WeightApply(entity e) e.vore_oldstomachload = e.stomach_load; } +void Vore_AutoDigest(entity e) +{ + // if the predator has the autodigest preference enabled, begin digesting new prey automatically + + if not(e.cvar_cl_vore_autodigest) + return; + if not(cvar("g_vore_digestion")) + return; + + entity head; + if(teams_matter) + { + FOR_EACH_PLAYER(head) + { + // never begin automatic digestion if we've swallowed a team mate + if(head.team == e.team) + return; + } + } + + e.digesting = TRUE; +} + .entity pusher; .float pushltime; void Vore_Swallow(entity e) @@ -180,6 +203,7 @@ void Vore_Swallow(entity e) e.predator.regurgitate_prepare = 0; e.predator.spawnshieldtime = 0; // lose spawn shield when we vore Vore_WeightApply(e.predator); + Vore_AutoDigest(e.predator); // block firing for a small amount of time, or we'll be firing the next frame after we swallow e.predator.weapon_delay = time + button_delay_time; -- 2.39.2