# HG changeset patch # User Wuzzy # Date 1546737405 -3600 # Node ID 797e3f441c14f5b478efe044367e0238964240e4 # Parent 029f40c609b484410c6b55b35eae6c9e5da32026 Make turn timer gray when finishing target practice diff -r 029f40c609b4 -r 797e3f441c14 share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua --- a/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua Sun Jan 06 01:21:16 2019 +0100 +++ b/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua Sun Jan 06 02:16:45 2019 +0100 @@ -193,12 +193,8 @@ -- ... end the game ... generateStats() EndGame() - else - -- ... or just lower the timer by 1. - -- Reset the time left to stop the timer - SetTurnTimeLeft(time_goal) end - end_timer = end_timer - 20 + end_timer = end_timer - 20 end end @@ -385,8 +381,7 @@ AddCaption(loc("Last Target!")); spawnTarget(3480,1200) end - else - if not game_lost then + elseif not game_lost then -- Victory! SaveMissionVar("Won", "true") AddCaption(loc("Victory!"), capcolDefault, capgrpGameState) @@ -402,7 +397,9 @@ -- Save the time left so we may keep it. time_goal = TurnTimeLeft - end + + -- Freeze the clock because the challenge has been completed + SetTurnTimePaused(true) end SetTeamLabel(playerTeamName, getTargetScore()) end diff -r 029f40c609b4 -r 797e3f441c14 share/hedgewars/Data/Scripts/TargetPractice.lua --- a/share/hedgewars/Data/Scripts/TargetPractice.lua Sun Jan 06 01:21:16 2019 +0100 +++ b/share/hedgewars/Data/Scripts/TargetPractice.lua Sun Jan 06 02:16:45 2019 +0100 @@ -195,10 +195,8 @@ if end_timer == 0 then generateStats() EndGame() - else - SetTurnTimeLeft(time_goal) end - end_timer = end_timer - 20 + end_timer = end_timer - 20 end for gear, _ in pairs(gearsInGame) do @@ -242,6 +240,7 @@ -- Disable control SetInputMask(0) AddAmmo(player, params.ammoType, 0) + SetTurnTimePaused(true) end end end