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.
--- 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