From: MirceaKitsune Date: Mon, 28 Feb 2011 01:33:40 +0000 (+0200) Subject: Make a minimum and maximum time probability for each taunt. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=42d657e9fe93789a299c87a22f095b7ac5526ac1;p=voretournament%2Fvoretournament.git Make a minimum and maximum time probability for each taunt. --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index e189b455..3ab5cb93 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -207,7 +207,8 @@ cl_autodemo_nameformat demos/%Y-%m-%d_%H-%M // taunts and voices seta cl_autotaunt 0.75 "automatically taunt enemies when fragging them" -seta sv_vore_autotaunt_repeat 5 "how many seconds to attempt playing vore taunts" +seta sv_vore_autotaunt_repeat_min 2.5 "how many seconds to attempt playing vore taunts, minimum" +seta sv_vore_autotaunt_repeat_max 10 "how many seconds to attempt playing vore taunts, maximum" 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/vore.qc b/data/qcsrc/server/vore.qc index e9a35917..0300168c 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -414,35 +414,37 @@ void Vore_AutoTaunt() { // triggers ambient vore taunts, for both pred and prey - // 50/50 probability for either a predator or prey to play the taunt - if(random() < 0.5) + float taunt_time; + + // predator taunts + if(self.stomach_load && !Stomach_TeamMates_check(self)) { - // predator taunts - if(self.stomach_load && !Stomach_TeamMates_check(self)) - { - if(!self.taunt_soundtime) - SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPRED); - } - else if(self.taunt_soundtype == TAUNTTYPE_VOREPRED) + if(!self.taunt_soundtime) { - // we have a predator taunt scheduled, but are no longer a (suitable) predator, so remove it - SetAutoTaunt(self, 0, 0); + taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min"); + SetAutoTaunt(self, taunt_time, TAUNTTYPE_VOREPRED); } } - else + else if(self.taunt_soundtype == TAUNTTYPE_VOREPRED) { - // prey taunts - if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team)) - { - if(!self.taunt_soundtime) - SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPREY); - } - else if(self.taunt_soundtype == TAUNTTYPE_VOREPREY) + // we have a predator taunt scheduled, but are no longer a (suitable) predator, so remove it + SetAutoTaunt(self, 0, 0); + } + + // prey taunts + if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team)) + { + if(!self.taunt_soundtime) { - // we have a prey taunt scheduled, but are no longer a (suitable) prey, so remove it - SetAutoTaunt(self, 0, 0); + taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min"); + SetAutoTaunt(self, taunt_time, 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, 0); + } } void Vore()