177 |
177 |
178 _G.onGameTick20 = function() |
178 _G.onGameTick20 = function() |
179 if TurnTimeLeft < 40 and TurnTimeLeft > 0 and scored < total_targets and game_lost == false then |
179 if TurnTimeLeft < 40 and TurnTimeLeft > 0 and scored < total_targets and game_lost == false then |
180 game_lost = true |
180 game_lost = true |
181 AddCaption(loc("Time’s up!"), capcolDefault, capgrpGameState) |
181 AddCaption(loc("Time’s up!"), capcolDefault, capgrpGameState) |
182 ShowMission(params.missionTitle, loc("Aiming practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0) |
|
183 SetHealth(player, 0) |
182 SetHealth(player, 0) |
184 time_goal = 1 |
183 time_goal = 1 |
185 end |
184 end |
186 |
185 |
187 if band(GetState(player), gstDrowning) == gstDrowning and game_lost == false and scored < total_targets then |
186 if band(GetState(player), gstDrowning) == gstDrowning and game_lost == false and scored < total_targets then |
188 game_lost = true |
187 game_lost = true |
189 time_goal = 1 |
188 time_goal = 1 |
190 AddCaption(loc("You lose!"), capcolDefault, capgrpGameState) |
|
191 ShowMission(params.missionTitle, loc("Aiming practice"), loc("Oh no! You failed! Just try again."), -amSkip, 0) |
|
192 end |
189 end |
193 |
190 |
194 if scored == total_targets or game_lost then |
191 if scored == total_targets or game_lost then |
195 if end_timer == 0 then |
192 if end_timer == 0 then |
196 generateStats() |
193 generateStats() |
291 SendStat(siCustomAchievement, string.format(loc("You have destroyed %d of %d targets (+%d points)."), scored, total_targets, end_score_targets)) |
286 SendStat(siCustomAchievement, string.format(loc("You have destroyed %d of %d targets (+%d points)."), scored, total_targets, end_score_targets)) |
292 SendStat(siCustomAchievement, string.format(params.shootText, shots)) |
287 SendStat(siCustomAchievement, string.format(params.shootText, shots)) |
293 SendStat(siCustomAchievement, string.format(loc("Your accuracy was %.1f%% (+%d points)."), accuracy, end_score_accuracy)) |
288 SendStat(siCustomAchievement, string.format(loc("Your accuracy was %.1f%% (+%d points)."), accuracy, end_score_accuracy)) |
294 SendStat(siCustomAchievement, string.format(loc("You had %.1fs remaining on the clock (+%d points)."), (time_goal/1000), end_score_time)) |
289 SendStat(siCustomAchievement, string.format(loc("You had %.1fs remaining on the clock (+%d points)."), (time_goal/1000), end_score_time)) |
295 else |
290 else |
296 SendStat(siGameResult, loc("You lose!")) |
291 SendStat(siGameResult, loc("Challenge over!")) |
297 |
292 |
298 SendStat(siCustomAchievement, string.format(loc("You have destroyed %d of %d targets (+%d points)."), scored, total_targets, end_score_targets)) |
293 SendStat(siCustomAchievement, string.format(loc("You have destroyed %d of %d targets (+%d points)."), scored, total_targets, end_score_targets)) |
299 SendStat(siCustomAchievement, string.format(params.shootText, shots)) |
294 SendStat(siCustomAchievement, string.format(params.shootText, shots)) |
300 if(shots > 0) then |
295 if(shots > 0) then |
301 SendStat(siCustomAchievement, string.format(loc("Your accuracy was %.1f%%."), accuracy)) |
296 SendStat(siCustomAchievement, string.format(loc("Your accuracy was %.1f%%."), accuracy)) |