]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/g_damage.qc
Implement ambient taunts for predators, and rework the autotaunt code for better...
[voretournament/voretournament.git] / data / qcsrc / server / g_damage.qc
index 0041e79dba17cdae1015821b0ee1007e848872c3..85140336ca96cbea050b6a313dc623382b3dc144 100644 (file)
@@ -56,9 +56,17 @@ float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after u
 .float teamkill_soundtime;\r
 .entity teamkill_soundsource;\r
 .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
+{\r
+       e.taunt_soundtime = t_soundtime;\r
+       e.taunt_soundtimefiltered = t_soundtimefiltered;\r
+       e.taunt_soundtype = soundtype;\r
+}\r
 \r
 float IsDifferentTeam(entity a, entity b)\r
 {\r
@@ -374,8 +382,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
-                                               attacker.taunt_soundtime = time + 1;\r
-                                               attacker.taunt_soundtype = TAUNTTYPE_DEATH;\r
+                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
                                else\r
@@ -391,8 +398,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
-                                               attacker.taunt_soundtime = time + 1;\r
-                                               attacker.taunt_soundtype = TAUNTTYPE_DEATH;\r
+                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
 \r