Put code in place to allow different types of taunts
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 27 Feb 2011 22:35:24 +0000 (00:35 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 27 Feb 2011 22:35:24 +0000 (00:35 +0200)
data/defaultVoretournament.cfg
data/qcsrc/server/cl_client.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/g_damage.qc
data/qcsrc/server/miscfunctions.qc

index 3b6e5cf51ee1f24f5bfe218ee1591a4d1bc44a2c..05a3727baa17a0e6dbcb5d6f5e86c206b6e28872 100644 (file)
@@ -207,6 +207,7 @@ cl_autodemo_nameformat demos/%Y-%m-%d_%H-%M
 \r
 // taunts and voices\r
 seta cl_autotaunt 0.75 "automatically taunt enemies when fragging them"\r
+seta cl_autotaunt_repeat 5 "how many seconds to attempt playing repeatable taunts"\r
 seta sv_taunt 1 "allow taunts on the server"\r
 seta sv_autotaunt 1 "allow autotaunts on the server"\r
 seta cl_voice_directional 1    "0 = all voices are non-directional, 1 = all voices are directional, 2 = only taunts are directional"\r
index fe30cae7843ee007ff0bbadd1436d42466f3db62..b882260800b8afbb094f8eed12c58d27fb79c2fe 100644 (file)
@@ -2634,8 +2634,21 @@ void PlayerPreThink (void)
        if(self.taunt_soundtime)\r
        if(time > self.taunt_soundtime)\r
        {\r
+               switch(self.taunt_soundtype)\r
+               {\r
+                       case TAUNTTYPE_DEATH:\r
+                               PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT);\r
+                               break;\r
+                       case TAUNTTYPE_VORE:\r
+                               PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT); // change this properly\r
+                               break;\r
+                       default:\r
+                               dprint("Incorrect autotaunt type\n");\r
+                               break;\r
+               }\r
+\r
                self.taunt_soundtime = 0;\r
-               PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT);\r
+               self.taunt_soundtype = 0;\r
        }\r
 \r
        target_voicescript_next(self);\r
index 1cb074702e9d8470da8f21bdabb110cba19e7268..9c80b05264e162994a21eafe1692db5974df7e66 100644 (file)
@@ -503,6 +503,9 @@ string globalsound_metalstep;
 #define VOICETYPE_TAUNT 15\r
 #define VOICETYPE_GURGLE 16\r
 \r
+#define TAUNTTYPE_DEATH 1\r
+#define TAUNTTYPE_VORE 2\r
+\r
 void PrecachePlayerSounds(string f);\r
 void PrecacheGlobalSound(string samplestring);\r
 void UpdatePlayerSounds();\r
@@ -513,6 +516,7 @@ void VoiceMessage(string type, string message);
 \r
 // autotaunt system\r
 .float cvar_cl_autotaunt;\r
+.float cvar_cl_autotaunt_repeat;\r
 .float cvar_cl_voice_directional;\r
 .float cvar_cl_voice_directional_taunt_attenuation;\r
 \r
index 9c7bce0a8b71186391c02e97fae3c58d4eeef0f4..0041e79dba17cdae1015821b0ee1007e848872c3 100644 (file)
@@ -57,6 +57,7 @@ float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after u
 .entity teamkill_soundsource;\r
 .entity pusher;\r
 .float taunt_soundtime;\r
+.float taunt_soundtype;\r
 \r
 \r
 float IsDifferentTeam(entity a, entity b)\r
@@ -374,6 +375,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                        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
                                        }\r
                                }\r
                                else\r
@@ -390,6 +392,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                                        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
                                        }\r
                                }\r
 \r
index ea84cacf4d12686d8f81e1973a9193951d5bc710..348d3f2b7cc32dd0882a0c8ce10157c896b4b828 100644 (file)
@@ -608,6 +608,7 @@ void GetCvars(float f)
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[8], "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete);\r
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);\r
        GetCvars_handleFloat(s, f, cvar_cl_autotaunt, "cl_autotaunt");\r
+       GetCvars_handleFloat(s, f, cvar_cl_autotaunt_repeat, "cl_autotaunt_repeat");\r
        GetCvars_handleFloat(s, f, cvar_cl_noantilag, "cl_noantilag");\r
        GetCvars_handleFloat(s, f, cvar_cl_voice_directional, "cl_voice_directional");\r
        GetCvars_handleFloat(s, f, cvar_cl_voice_directional_taunt_attenuation, "cl_voice_directional_taunt_attenuation");\r