]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Use a slightly different system for forced regurgitation in some cases, which is...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 13:49:44 +0000 (15:49 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 13:49:44 +0000 (15:49 +0200)
data/qcsrc/server/g_damage.qc
data/qcsrc/server/vore.qc
data/qcsrc/server/vore.qh

index fc12a332b45f367fda5ca0e5586f8aeea33e6d0d..31f86668e9c15fa4bd764fde25ca99e25c24e47e 100644 (file)
@@ -699,15 +699,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
 \r
                // if a predator is taking damage, check if he should regurgitate his prey, based on the damage he took\r
                if(cvar("g_balance_vore_escapeprobability"))\r
-               {\r
-                       entity e;\r
-                       FOR_EACH_PLAYER(e)\r
-                       {\r
-                               if(e.predator != world && e.predator == targ)\r
-                               if(random() < cvar("g_balance_vore_escapeprobability") * damage)\r
-                                       Vore_Regurgitate(e);\r
-                       }\r
-               }\r
+               if(targ.stomach_load && random() < cvar("g_balance_vore_escapeprobability") * damage)\r
+                       targ.regurgitate_prepare = -1;\r
 \r
                // nullify damage if teamplay is on\r
                if(deathtype != DEATH_TELEFRAG)\r
index 56f60da1763fb8eb30331a4d8c75109f7a2338b4..678aa9015bd850ebf125972437b5ca570a0592af 100644 (file)
@@ -1,4 +1,3 @@
-.float regurgitate_prepare;\r
 .float stomachkick_delay, system_delay, action_delay, digest_button_delay_time, regurgitate_button_delay_time;\r
 .float complain_vore;\r
 .float vore_oldmovetype, vore_oldsolid;\r
@@ -822,6 +821,17 @@ void Vore()
                }\r
        }\r
 \r
+       if(self.stomach_load > self.stomach_maxload) // the predator got beyond his capacity after eating, so some prey must pop out\r
+       {\r
+               self.regurgitate_prepare = -1;\r
+               return;\r
+       }\r
+       if(cvar("g_balance_vore_load_pred_speedcap") && self.stomach_load && vlen(self.velocity) >= cvar("g_balance_vore_load_pred_speedcap") / (self.stomach_load / self.stomach_maxload)) // predator's going too fast, gets sick and throws up\r
+       {\r
+               self.regurgitate_prepare = -1;\r
+               return;\r
+       }\r
+\r
        if(cvar("g_vore_gurglesound"))\r
                Vore_GurgleSound();\r
 \r
@@ -855,17 +865,6 @@ void Vore()
                        self.predator.regurgitate_prepare = 0;\r
        }\r
 \r
-       if(self.predator.stomach_load > self.predator.stomach_maxload) // the predator got beyond his capacity after eating, so some prey must pop out\r
-       {\r
-               Vore_Regurgitate(self);\r
-               return;\r
-       }\r
-       if(cvar("g_balance_vore_load_pred_speedcap") && vlen(self.predator.velocity) >= cvar("g_balance_vore_load_pred_speedcap") / (self.predator.stomach_load / self.predator.stomach_maxload)) // predator's going too fast, gets sick and throws up\r
-       {\r
-               Vore_Regurgitate(self);\r
-               return;\r
-       }\r
-\r
        // apply delayed regurgitating if it was scheduled\r
        if(self.predator.regurgitate_prepare && time > self.predator.regurgitate_prepare)\r
        {\r
index 07fde63c629320de174570d41b20334b272d6507..baf9ffbc37ab27d7502fcaad41cb3223c8a6d872 100644 (file)
@@ -1,6 +1,6 @@
 void Vore();\r
-void Vore_Regurgitate(entity e);\r
 void Vore_Disconnect();\r
+.float regurgitate_prepare;\r
 \r
 entity Swallow_player_check();\r
 float Swallow_condition_check(entity prey);\r