]> 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 d86a49b84b16d1f79da3539c45c4f2e1fc0a59d4..85140336ca96cbea050b6a313dc623382b3dc144 100644 (file)
@@ -56,8 +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
@@ -367,13 +376,13 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, a,"^1 made you their meal ^7", GetAdvancedDeathReports(attacker)));\r
                                        } else {\r
                                                if((cvar("sv_fragmessage_information_typefrag")) && (targ.BUTTON_CHAT)) {\r
-                                                       centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^1You typeate ^7", s, GetAdvancedDeathReports(targ)));\r
-                                                       centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were typeeaten by ^7", a, GetAdvancedDeathReports(attacker)));\r
+                                                       centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^1You type-ate ^7", s, GetAdvancedDeathReports(targ)));\r
+                                                       centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were type-eaten by ^7", a, GetAdvancedDeathReports(attacker)));\r
                                                } else {\r
                                                        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
+                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
                                else\r
@@ -383,13 +392,13 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, a,"^1 scored against you ^7", GetAdvancedDeathReports(attacker)));\r
                                        } else {\r
                                                if((cvar("sv_fragmessage_information_typefrag")) && (targ.BUTTON_CHAT)) {\r
-                                                       centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^1You typefragged ^7", s, GetAdvancedDeathReports(targ)));\r
-                                                       centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were typefragged by ^7", a, GetAdvancedDeathReports(attacker)));\r
+                                                       centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, blood_message, "^1You type-ate ^7", s, GetAdvancedDeathReports(targ)));\r
+                                                       centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were type-eaten by ^7", a, GetAdvancedDeathReports(attacker)));\r
                                                } else {\r
                                                        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
+                                               SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH);\r
                                        }\r
                                }\r
 \r
@@ -471,7 +480,12 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                        GiveFrags(attacker, targ, 0); // for logging\r
                                }\r
                                else\r
-                                       GiveFrags(attacker, targ, 1);\r
+                               {\r
+                                       if(cvar("g_vore_reversescoring") && deathtype == DEATH_DIGESTION) // reversed vore scoring\r
+                                               GiveFrags(targ, attacker, 1);\r
+                                       else\r
+                                               GiveFrags(attacker, targ, 1);\r
+                               }\r
 \r
                                if (targ.killcount > 2) {\r
                                        if(sv_gentle)\r
@@ -827,13 +841,12 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                {\r
                                        if(deathtype != DEATH_FIRE)\r
                                                attacker.typehitsound += 1;\r
-                                       if(mirrordamage > 0)\r
-                                               if(time > attacker.teamkill_complain)\r
-                                               {\r
-                                                       attacker.teamkill_complain = time + 5;\r
-                                                       attacker.teamkill_soundtime = time + 0.4;\r
-                                                       attacker.teamkill_soundsource = targ;\r
-                                               }\r
+                                       if(time > attacker.teamkill_complain)\r
+                                       {\r
+                                               attacker.teamkill_complain = time + 5;\r
+                                               attacker.teamkill_soundtime = time + 0.4;\r
+                                               attacker.teamkill_soundsource = targ;\r
+                                       }\r
                                }\r
                        }\r
                }\r
@@ -859,6 +872,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                // Savage: vampire mode\r
                if (g_vampire)\r
                if (time >= self.spawnshieldtime)\r
+               if (deathtype != DEATH_DIGESTION) // a different vampire system is used for this\r
                {\r
                        attacker.health += damage;\r
                }\r