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