share/hedgewars/Data/Scripts/TargetPractice.lua
changeset 14949 4c5fb1ee75b7
parent 14675 8bd005067f4a
equal deleted inserted replaced
14948:9d6a25239d00 14949:4c5fb1ee75b7
   225 
   225 
   226 		if scored == total_targets  or game_lost then
   226 		if scored == total_targets  or game_lost then
   227 			if end_timer == 0 then
   227 			if end_timer == 0 then
   228 				generateStats()
   228 				generateStats()
   229 				EndGame()
   229 				EndGame()
       
   230 				if scored == total_targets then
       
   231 					SetState(player, gstWinner)
       
   232 				end
   230 			end
   233 			end
   231 			end_timer = end_timer - 20
   234 			end_timer = end_timer - 20
   232 		end
   235 		end
   233 
   236 
   234 		for gear, _ in pairs(gearsInGame) do
   237 		for gear, _ in pairs(gearsInGame) do
   270 						PlaySound(sndFlawless, player)
   273 						PlaySound(sndFlawless, player)
   271 					else
   274 					else
   272 						PlaySound(sndVictory, player)
   275 						PlaySound(sndVictory, player)
   273 					end
   276 					end
   274 					SetEffect(player, heInvulnerable, 1)
   277 					SetEffect(player, heInvulnerable, 1)
   275 					SetState(player, bor(GetState(player), gstWinner))
       
   276 					time_goal = TurnTimeLeft
   278 					time_goal = TurnTimeLeft
   277 					-- Disable control
   279 					-- Disable control
   278 					SetInputMask(0)
   280 					SetInputMask(0)
   279 					AddAmmo(player, params.ammoType, 0)
   281 					AddAmmo(player, params.ammoType, 0)
   280 					SetTurnTimePaused(true)
   282 					SetTurnTimePaused(true)