From: MirceaKitsune Date: Sun, 27 Feb 2011 22:35:24 +0000 (+0200) Subject: Put code in place to allow different types of taunts X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=3b891be3ed44a7cee7f2fdeb49dca83a13dad5be Put code in place to allow different types of taunts --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index 3b6e5cf5..05a3727b 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -207,6 +207,7 @@ cl_autodemo_nameformat demos/%Y-%m-%d_%H-%M // taunts and voices seta cl_autotaunt 0.75 "automatically taunt enemies when fragging them" +seta cl_autotaunt_repeat 5 "how many seconds to attempt playing repeatable taunts" seta sv_taunt 1 "allow taunts on the server" seta sv_autotaunt 1 "allow autotaunts on the server" seta cl_voice_directional 1 "0 = all voices are non-directional, 1 = all voices are directional, 2 = only taunts are directional" diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index fe30cae7..b8822608 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2634,8 +2634,21 @@ void PlayerPreThink (void) if(self.taunt_soundtime) if(time > self.taunt_soundtime) { + switch(self.taunt_soundtype) + { + case TAUNTTYPE_DEATH: + PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT); + break; + case TAUNTTYPE_VORE: + PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT); // change this properly + break; + default: + dprint("Incorrect autotaunt type\n"); + break; + } + self.taunt_soundtime = 0; - PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT); + self.taunt_soundtype = 0; } target_voicescript_next(self); diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 1cb07470..9c80b052 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -503,6 +503,9 @@ string globalsound_metalstep; #define VOICETYPE_TAUNT 15 #define VOICETYPE_GURGLE 16 +#define TAUNTTYPE_DEATH 1 +#define TAUNTTYPE_VORE 2 + void PrecachePlayerSounds(string f); void PrecacheGlobalSound(string samplestring); void UpdatePlayerSounds(); @@ -513,6 +516,7 @@ void VoiceMessage(string type, string message); // autotaunt system .float cvar_cl_autotaunt; +.float cvar_cl_autotaunt_repeat; .float cvar_cl_voice_directional; .float cvar_cl_voice_directional_taunt_attenuation; diff --git a/data/qcsrc/server/g_damage.qc b/data/qcsrc/server/g_damage.qc index 9c7bce0a..0041e79d 100644 --- a/data/qcsrc/server/g_damage.qc +++ b/data/qcsrc/server/g_damage.qc @@ -57,6 +57,7 @@ float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after u .entity teamkill_soundsource; .entity pusher; .float taunt_soundtime; +.float taunt_soundtype; float IsDifferentTeam(entity a, entity b) @@ -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))); } attacker.taunt_soundtime = time + 1; + attacker.taunt_soundtype = TAUNTTYPE_DEATH; } } else @@ -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))); } attacker.taunt_soundtime = time + 1; + attacker.taunt_soundtype = TAUNTTYPE_DEATH; } } diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index ea84cacf..348d3f2b 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -608,6 +608,7 @@ void GetCvars(float f) GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[8], "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete); GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete); GetCvars_handleFloat(s, f, cvar_cl_autotaunt, "cl_autotaunt"); + GetCvars_handleFloat(s, f, cvar_cl_autotaunt_repeat, "cl_autotaunt_repeat"); GetCvars_handleFloat(s, f, cvar_cl_noantilag, "cl_noantilag"); GetCvars_handleFloat(s, f, cvar_cl_voice_directional, "cl_voice_directional"); GetCvars_handleFloat(s, f, cvar_cl_voice_directional_taunt_attenuation, "cl_voice_directional_taunt_attenuation");