Racer, TechRacer: Mask taunts like Stupid when track was completed successfully
authorWuzzy <Wuzzy2@mail.ru>
Sun, 15 Sep 2019 16:04:11 +0200
changeset 15404 0e3bf53dfe47
parent 15403 e347c3508f95
child 15405 b99834f70847
Racer, TechRacer: Mask taunts like Stupid when track was completed successfully
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sun Sep 15 15:54:43 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sun Sep 15 16:04:11 2019 +0200
@@ -774,6 +774,10 @@
         AddAmmo(CurrentHedgehog, amAirAttack, 0)
         gTimer = 0
 
+        SetSoundMask(sndStupid, false)
+        SetSoundMask(sndBugger, false)
+        SetSoundMask(sndDrat, false)
+
         -- Remember ammo delays for later
         if ammoDelays == nil then
                 ammoDelays = {}
@@ -953,7 +957,11 @@
 
                                 AddCaption(string.format(loc("Time: %.1fs"), (trackTime/1000)),GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
 
+				-- Track completed, all waypoints touched
                                 if (CheckWaypoints() == true) then
+                                        SetSoundMask(sndStupid, true)
+                                        SetSoundMask(sndBugger, true)
+                                        SetSoundMask(sndDrat, true)
                                         AdjustScores()
                                         SetEffect(CurrentHedgehog, heInvulnerable, 1)
                                         DisableTumbler()
--- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Sun Sep 15 15:54:43 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Sun Sep 15 16:04:11 2019 +0200
@@ -949,6 +949,10 @@
 
 function onNewTurn()
 
+	SetSoundMask(sndStupid, false)
+	SetSoundMask(sndDrat, false)
+	SetSoundMask(sndBugger, false)
+
 	CheckForNewRound()
 	TryRepositionHogs()
 
@@ -1089,7 +1093,11 @@
 
 				AddCaption(string.format(loc("Time: %.1fs"), (trackTime/1000)), GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
 
+				-- Track completed, all waypoints touched!
 				if (CheckWaypoints() == true) then
+					SetSoundMask(sndStupid, true)
+					SetSoundMask(sndDrat, true)
+					SetSoundMask(sndBugger, true)
 					AdjustScores()
 					DisableTumbler()
 				end