Sniper rifle training: Fix missing victory sound, also disable controls at the end
authorWuzzy <Wuzzy2@mail.ru>
Sat, 21 Oct 2017 18:52:24 +0200
changeset 12735 2c4a07eb2112
parent 12734 4e0e59255856
child 12736 2b0a4a4b1ba2
Sniper rifle training: Fix missing victory sound, also disable controls at the end String freeze notice: This commit will display a caption with the string "Victory!". It does NOT violate the string freeze, as this string is already present in stub.lua.
share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua
--- a/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua	Sat Oct 21 18:38:28 2017 +0200
+++ b/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua	Sat Oct 21 18:52:24 2017 +0200
@@ -374,10 +374,17 @@
 			end
 		else
 			if not game_lost then
-			-- Otherwise show that the goal was accomplished
+			-- Victory!
+			AddCaption(loc("Victory!"), 0xFFFFFFFF, capgrpGameState)
 			ShowMission(loc("Sniper Training"), loc("Aiming Practice"), loc("Congratulations! You've eliminated all targets|within the allowed time frame."), 0, 0)
 			-- Also let the hogs shout "victory!"
-			PlaySound(sndVictory)
+			PlaySound(sndVictory, CurrentHedgehog)
+			FollowGear(CurrentHedgehog)
+
+			-- Disable hog controls
+			SetInputMask(0)
+			AddAmmo(CurrentHedgehog, amSniperRifle, 0)
+
 			-- Save the time left so we may keep it.
 			time_goal = TurnTimeLeft
 			end