Stomach kicks no longer have a probability of regurgitating the player. Instead,...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 7 Jul 2011 11:03:15 +0000 (14:03 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 7 Jul 2011 11:03:15 +0000 (14:03 +0300)
data/balanceVT.cfg
data/qcsrc/server/g_damage.qc
data/qcsrc/server/vore.qc
data/qcsrc/server/vore.qh

index 8e8f5ad..29c0a5a 100644 (file)
@@ -207,7 +207,7 @@ set g_balance_vore_kick_damage_min 15 "minimum amount of damage you can do with
 set g_balance_vore_kick_damage_max 30 "maximum amount of damage you can do with a stomach kick"\r
 set g_balance_vore_kick_delay 0.6 "how many seconds must pass before you can perform another stomach kick"\r
 set g_balance_vore_kick_force 140 "predators are pushed by this amount when stomach kicked, in the direction their prey is facing"\r
-set g_balance_vore_kick_escapeprobability 0.115 "probability of getting regurgitated while performing stomach kicks (0 = never, 1 = always)"\r
 set g_balance_vore_kick_predator_punchangle 3 "your view gets tilted by this amount when receiving stomach kicks"\r
 set g_balance_vore_kick_prey_punchangle 6 "your view gets tilted by this amount when dealing stomach kicks"\r
+set g_balance_vore_escapeprobability 0.115 "probability of getting regurgitated when the predator takes damage (0 = never, 1 = always)"\r
 // }}}\r
index edc14f0..35eb1f5 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
index fff85c5..8bb775d 100644 (file)
@@ -422,9 +422,6 @@ void Vore_StomachKick()
                self.predator.punchangle_x -= cvar("g_balance_vore_kick_predator_punchangle");\r
                self.punchangle_x += cvar("g_balance_vore_kick_prey_punchangle");\r
 \r
-               if(random() < cvar("g_balance_vore_kick_escapeprobability"))\r
-                       Vore_Regurgitate(self);\r
-\r
                self.stomachkick_delay = time + cvar("g_balance_vore_kick_delay");\r
        }\r
 }\r
index 96eb5ed..30989ca 100644 (file)
@@ -1,4 +1,5 @@
 void Vore();\r
+void Vore_Regurgitate(entity e);\r
 void Vore_Disconnect();\r
 void Vore_DeadPrey_Detach(entity e);\r
 \r