From: MirceaKitsune Date: Mon, 28 Feb 2011 01:25:44 +0000 (+0200) Subject: Make the vore taunt play-rate server side. There's simply no way to make it a client... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3c344811f2558a51041374ffe7d9771e3d57547a;p=voretournament%2Fvoretournament.git Make the vore taunt play-rate server side. There's simply no way to make it a client side preference without using hacky methods... at least for me. The auto taunts will still follow the cl_autotaunt probability rate for each client though. --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index 05a3727b..7ab61ca7 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -207,7 +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_vore_autotaunt_repeat 5 "how many seconds to attempt playing voew 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 2cbfbd20..b5f1333f 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2651,7 +2651,6 @@ void PlayerPreThink (void) } self.taunt_soundtime = 0; - self.taunt_soundtimefiltered = FALSE; self.taunt_soundtype = 0; } diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index ea3a9797..bef0ec68 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1211,8 +1211,6 @@ void UpdatePlayerSounds() LoadPlayerSounds(strcat(self.model, ".sounds"), 0); } -.float soundtimefilter; -.entity soundownerfilter; void GlobalSound(string sample, float chan, float voicetype) { float n; @@ -1296,23 +1294,16 @@ void GlobalSound(string sample, float chan, float voicetype) tauntrand = random(); FOR_EACH_REALCLIENT(msg_entity) { - msg_entity.soundownerfilter = self; if (tauntrand < msg_entity.cvar_cl_autotaunt) - if not (self.taunt_soundtimefiltered && msg_entity.soundownerfilter.soundtimefilter > time) + if (msg_entity.cvar_cl_voice_directional >= 1) { - if (msg_entity.cvar_cl_voice_directional >= 1) - { - if(self.predator.classname == "player") - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); - else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); - } + if(self.predator.classname == "player") + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); - - if(self.taunt_soundtimefiltered) - msg_entity.soundownerfilter.soundtimefilter = time + msg_entity.cvar_cl_autotaunt_repeat; + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); } + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } break; case VOICETYPE_TAUNT: diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index a2636062..b0143575 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -519,7 +519,6 @@ 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 85140336..483ff0c7 100644 --- a/data/qcsrc/server/g_damage.qc +++ b/data/qcsrc/server/g_damage.qc @@ -58,13 +58,11 @@ float damage_headshotbonus; // bonus multiplier for head shots, set to 0 after u .entity pusher; .float taunt_soundtime; -.float taunt_soundtimefiltered; .float taunt_soundtype; -void SetAutoTaunt(entity e, float t_soundtime, float t_soundtimefiltered, float soundtype) +void SetAutoTaunt(entity e, float t_soundtime, float soundtype) { e.taunt_soundtime = t_soundtime; - e.taunt_soundtimefiltered = t_soundtimefiltered; e.taunt_soundtype = soundtype; } @@ -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))); centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were eaten by ^7", a, GetAdvancedDeathReports(attacker))); } - SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH); + SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH); } } else @@ -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))); centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, victim_message, "^1You were killed by ^7", a, GetAdvancedDeathReports(attacker))); } - SetAutoTaunt(attacker, time + 1, FALSE, TAUNTTYPE_DEATH); + SetAutoTaunt(attacker, time + 1, TAUNTTYPE_DEATH); } } diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 348d3f2b..ea84cacf 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -608,7 +608,6 @@ 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"); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 29f8dbb3..e9a35917 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -421,12 +421,12 @@ void Vore_AutoTaunt() if(self.stomach_load && !Stomach_TeamMates_check(self)) { if(!self.taunt_soundtime) - SetAutoTaunt(self, time, TRUE, TAUNTTYPE_VOREPRED); + SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPRED); } else if(self.taunt_soundtype == TAUNTTYPE_VOREPRED) { // we have a predator taunt scheduled, but are no longer a (suitable) predator, so remove it - SetAutoTaunt(self, 0, FALSE, 0); + SetAutoTaunt(self, 0, 0); } } else @@ -435,12 +435,12 @@ void Vore_AutoTaunt() if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team)) { if(!self.taunt_soundtime) - SetAutoTaunt(self, time, TRUE, TAUNTTYPE_VOREPREY); + SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPREY); } else if(self.taunt_soundtype == TAUNTTYPE_VOREPREY) { // we have a prey taunt scheduled, but are no longer a (suitable) prey, so remove it - SetAutoTaunt(self, 0, FALSE, 0); + SetAutoTaunt(self, 0, 0); } } }