]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Autodigest client-side feature. When enabled, a player automatically begins digesting...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 27 Feb 2011 20:57:09 +0000 (22:57 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 27 Feb 2011 20:57:09 +0000 (22:57 +0200)
data/defaultVoretournament.cfg
data/qcsrc/server/defs.qh
data/qcsrc/server/miscfunctions.qc
data/qcsrc/server/vore.qc

index c29874265d2d019ad12634d49b738a9749920b5e..6db7ef524539868a64c0ba58f99d619ae5411b03 100644 (file)
@@ -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"\r
 seta cl_vore_cutvolume_music 0.5 "music volume is reduced to this amount when you are in a stomach"\r
 seta cl_vore_cutvolume_fade 0.1 "fading speed of the volume change"\r
+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"\r
 set g_vore 1 "enables the vore system, you want this on!"\r
 set g_vore_digestion 1 "enables digestion system, you want this on!"\r
 set g_vore_kick 1 "enables stomach kick system, you want this on!"\r
index d1834f6590549559a9a2fc98a08567733072f4e3..1cb074702e9d8470da8f21bdabb110cba19e7268 100644 (file)
@@ -337,6 +337,7 @@ float sv_clforceplayermodels;
 .float cvar_cl_vore_stomachmodel;\r
 .float cvar_cl_vore_cameraspeed;\r
 .float cvar_cl_vore_punchangle;\r
+.float cvar_cl_vore_autodigest;\r
 .float cvar_chase_active;\r
 \r
 void Announce(string snd);\r
index 60cdad05e3874bd47b1a1b359051558f34593e42..ea84cacf4d12686d8f81e1973a9193951d5bc710 100644 (file)
@@ -618,6 +618,7 @@ void GetCvars(float f)
        GetCvars_handleFloat(s, f, cvar_cl_vore_stomachmodel, "cl_vore_stomachmodel");\r
        GetCvars_handleFloat(s, f, cvar_cl_vore_cameraspeed, "cl_vore_cameraspeed");\r
        GetCvars_handleFloat(s, f, cvar_cl_vore_punchangle, "cl_vore_punchangle");\r
+       GetCvars_handleFloat(s, f, cvar_cl_vore_autodigest, "cl_vore_autodigest");\r
 \r
        self.cvar_cl_accuracy_data_share = boolean(self.cvar_cl_accuracy_data_share);\r
        self.cvar_cl_accuracy_data_receive = boolean(self.cvar_cl_accuracy_data_receive);\r
index eab85fbfd11f4165d1b16068abf5f697d438cf0b..b4a2126eb58548a3760ffc540183119f98da9266 100644 (file)
@@ -140,6 +140,29 @@ void Vore_WeightApply(entity e)
        e.vore_oldstomachload = e.stomach_load;\r
 }\r
 \r
+void Vore_AutoDigest(entity e)\r
+{\r
+       // if the predator has the autodigest preference enabled, begin digesting new prey automatically\r
+\r
+       if not(e.cvar_cl_vore_autodigest)\r
+               return;\r
+       if not(cvar("g_vore_digestion"))\r
+               return;\r
+\r
+       entity head;\r
+       if(teams_matter)\r
+       {\r
+               FOR_EACH_PLAYER(head)\r
+               {\r
+                       // never begin automatic digestion if we've swallowed a team mate\r
+                       if(head.team == e.team)\r
+                               return;\r
+               }\r
+       }\r
+\r
+       e.digesting = TRUE;\r
+}\r
+\r
 .entity pusher;\r
 .float pushltime;\r
 void Vore_Swallow(entity e)\r
@@ -180,6 +203,7 @@ void Vore_Swallow(entity e)
        e.predator.regurgitate_prepare = 0;\r
        e.predator.spawnshieldtime = 0; // lose spawn shield when we vore\r
        Vore_WeightApply(e.predator);\r
+       Vore_AutoDigest(e.predator);\r
 \r
        // block firing for a small amount of time, or we'll be firing the next frame after we swallow\r
        e.predator.weapon_delay = time + button_delay_time;\r