share/hedgewars/Data/Scripts/TargetPractice.lua
changeset 14464 ead8928a59f8
parent 14365 a7769dbd7088
child 14475 2113296b7a29
equal deleted inserted replaced
14463:bd1db668b7c0 14464:ead8928a59f8
   242 			if scored < total_targets then
   242 			if scored < total_targets then
   243 				AddCaption(string.format(loc("Targets left: %d"), (total_targets-scored)), capcolDefault, capgrpMessage)
   243 				AddCaption(string.format(loc("Targets left: %d"), (total_targets-scored)), capcolDefault, capgrpMessage)
   244 				spawnTarget()
   244 				spawnTarget()
   245 			else
   245 			else
   246 				if not game_lost then
   246 				if not game_lost then
       
   247 					SaveMissionVar("Won", "true")
   247 					AddCaption(loc("You have destroyed all targets!"), capcolDefault, capgrpGameState)
   248 					AddCaption(loc("You have destroyed all targets!"), capcolDefault, capgrpGameState)
   248 					ShowMission(params.missionTitle, loc("Aiming practice"), loc("Congratulations! You have destroyed all targets within the time."), 0, 0)
   249 					ShowMission(params.missionTitle, loc("Aiming practice"), loc("Congratulations! You have destroyed all targets within the time."), 0, 0)
   249 					PlaySound(sndVictory, player)
   250 					PlaySound(sndVictory, player)
   250 					SetEffect(player, heInvulnerable, 1)
   251 					SetEffect(player, heInvulnerable, 1)
   251 					SetState(player, bor(GetState(player), gstWinner))
   252 					SetState(player, bor(GetState(player), gstWinner))