]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/g_damage.qc
Stomach kicks no longer have a probability of regurgitating the player. Instead,...
[voretournament/voretournament.git] / data / qcsrc / server / g_damage.qc
index edc14f05f58320008bfb95013eb210f7be6540ff..35eb1f551468327c19093bfabc048034d77a9ba9 100644 (file)
@@ -693,6 +693,18 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                if (attacker.isbot)\r
                        damage = damage * bound(0.1, (skill + 5) * 0.1, 1);\r
 \r
+               // if a predator is taking damage, check if he should regurgitate any prey\r
+               if(cvar("g_balance_vore_escapeprobability"))\r
+               {\r
+                       entity e;\r
+                       FOR_EACH_PLAYER(e)\r
+                       {\r
+                               if(e.predator == targ)\r
+                               if(random() < cvar("g_balance_vore_escapeprobability"))\r
+                                       Vore_Regurgitate(e);\r
+                       }\r
+               }\r
+\r
                // nullify damage if teamplay is on\r
                if(deathtype != DEATH_TELEFRAG)\r
                if(attacker.classname == "player")\r