]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Make a minimum and maximum time probability for each taunt.
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 01:33:40 +0000 (03:33 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 01:33:40 +0000 (03:33 +0200)
data/defaultVoretournament.cfg
data/qcsrc/server/vore.qc

index e189b4557eac93b159b7f54f7d86468d9c67ae6e..3ab5cb93be5fb39703cb777571ff019c0dfc2a2b 100644 (file)
@@ -207,7 +207,8 @@ 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 sv_vore_autotaunt_repeat 5 "how many seconds to attempt playing vore taunts"\r
+seta sv_vore_autotaunt_repeat_min 2.5 "how many seconds to attempt playing vore taunts, minimum"\r
+seta sv_vore_autotaunt_repeat_max 10 "how many seconds to attempt playing vore taunts, maximum"\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 e9a35917fe70f559e45e6b16ce3f8ef66aed9490..0300168c69f6a7d32bc2e9d0d9791b79e748bc82 100644 (file)
@@ -414,35 +414,37 @@ void Vore_AutoTaunt()
 {\r
        // triggers ambient vore taunts, for both pred and prey\r
 \r
-       // 50/50 probability for either a predator or prey to play the taunt\r
-       if(random() < 0.5)\r
+       float taunt_time;\r
+\r
+       // predator taunts\r
+       if(self.stomach_load && !Stomach_TeamMates_check(self))\r
        {\r
-               // predator taunts\r
-               if(self.stomach_load && !Stomach_TeamMates_check(self))\r
-               {\r
-                       if(!self.taunt_soundtime)\r
-                               SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPRED);\r
-               }\r
-               else if(self.taunt_soundtype == TAUNTTYPE_VOREPRED)\r
+               if(!self.taunt_soundtime)\r
                {\r
-                       // we have a predator taunt scheduled, but are no longer a (suitable) predator, so remove it\r
-                       SetAutoTaunt(self, 0, 0);\r
+                       taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min");\r
+                       SetAutoTaunt(self, taunt_time, TAUNTTYPE_VOREPRED);\r
                }\r
        }\r
-       else\r
+       else if(self.taunt_soundtype == TAUNTTYPE_VOREPRED)\r
        {\r
-               // prey taunts\r
-               if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team))\r
-               {\r
-                       if(!self.taunt_soundtime)\r
-                               SetAutoTaunt(self, time + cvar("sv_vore_autotaunt_repeat"), TAUNTTYPE_VOREPREY);\r
-               }\r
-               else if(self.taunt_soundtype == TAUNTTYPE_VOREPREY)\r
+               // we have a predator taunt scheduled, but are no longer a (suitable) predator, so remove it\r
+               SetAutoTaunt(self, 0, 0);\r
+       }\r
+\r
+       // prey taunts\r
+       if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team))\r
+       {\r
+               if(!self.taunt_soundtime)\r
                {\r
-                       // we have a prey taunt scheduled, but are no longer a (suitable) prey, so remove it\r
-                       SetAutoTaunt(self, 0, 0);\r
+                       taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min");\r
+                       SetAutoTaunt(self, taunt_time, TAUNTTYPE_VOREPREY);\r
                }\r
        }\r
+       else if(self.taunt_soundtype == TAUNTTYPE_VOREPREY)\r
+       {\r
+               // we have a prey taunt scheduled, but are no longer a (suitable) prey, so remove it\r
+               SetAutoTaunt(self, 0, 0);\r
+       }\r
 }\r
 \r
 void Vore()\r