]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/g_damage.qc
Increase / decrease digestion damage and stomach kick damage based on the size of...
[voretournament/voretournament.git] / data / qcsrc / server / g_damage.qc
index 85140336ca96cbea050b6a313dc623382b3dc144..f3f342cae891df825fb7a69e2ea184a3418ac4a3 100644 (file)
@@ -58,14 +58,12 @@ float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after u
 .entity pusher;\r
 \r
 .float taunt_soundtime;\r
-.float taunt_soundtimefiltered;\r
 .float taunt_soundtype;\r
 \r
-void SetAutoTaunt(entity e, float t_soundtime, float t_soundtimefiltered, float soundtype)\r
+void SetAutoTaunt(entity e, float t_soundtime, float t_soundtype)\r
 {\r
        e.taunt_soundtime = t_soundtime;\r
-       e.taunt_soundtimefiltered = t_soundtimefiltered;\r
-       e.taunt_soundtype = soundtype;\r
+       e.taunt_soundtype = t_soundtype;\r
 }\r
 \r
 float IsDifferentTeam(entity a, entity b)\r
@@ -382,7 +380,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                        centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^4You ate ^7", s, GetAdvancedDeathReports(targ)));\r
                                                        centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were eaten by ^7", a, GetAdvancedDeathReports(attacker)));\r
                                                }\r
-                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
+                                               SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
                                else\r
@@ -398,7 +396,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                        centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^4You killed ^7", s, GetAdvancedDeathReports(targ)));\r
                                                        centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were killed by ^7", a, GetAdvancedDeathReports(attacker)));\r
                                                }\r
-                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
+                                               SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
 \r
@@ -695,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 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 == targ)\r
+                               if(random() < cvar("g_balance_vore_escapeprobability") * damage)\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