151 -- GAME OVER, WIN! |
151 -- GAME OVER, WIN! |
152 totalTime = totalTime - TurnTimeLeft |
152 totalTime = totalTime - TurnTimeLeft |
153 local totalTimePrinted = totalTime / 1000 |
153 local totalTimePrinted = totalTime / 1000 |
154 local saucersLeft = GetAmmoCount(hero.gear, amJetpack) |
154 local saucersLeft = GetAmmoCount(hero.gear, amJetpack) |
155 local saucersUsed = totalSaucers - saucersLeft |
155 local saucersUsed = totalSaucers - saucersLeft |
156 SetTeamLabel(teamA.name, string.format(loc("%.3f s"), totalTimePrinted)) |
156 SetTeamLabel(teamA.name, string.format(loc("%.3fs"), totalTimePrinted)) |
157 SendStat(siGameResult, loc("Hooray! You are a champion!")) |
157 SendStat(siGameResult, loc("Hooray! You are a champion!")) |
158 SendStat(siCustomAchievement, string.format(loc("You completed the mission in %.3f seconds."), totalTimePrinted)) |
158 SendStat(siCustomAchievement, string.format(loc("You completed the mission in %.3f seconds."), totalTimePrinted)) |
159 if timeRecord ~= nil and totalTime >= timeRecord then |
159 if timeRecord ~= nil and totalTime >= timeRecord then |
160 SendStat(siCustomAchievement, string.format(loc("Your personal best time so far: %.3f seconds"), timeRecord/1000)) |
160 SendStat(siCustomAchievement, string.format(loc("Your personal best time so far: %.3f seconds"), timeRecord/1000)) |
161 end |
161 end |
182 end |
182 end |
183 end |
183 end |
184 if heroTurn and challengeStarted and not gameEnded and not hero.dead and ReadyTimeLeft == 0 then |
184 if heroTurn and challengeStarted and not gameEnded and not hero.dead and ReadyTimeLeft == 0 then |
185 local time = totalTime - TurnTimeLeft |
185 local time = totalTime - TurnTimeLeft |
186 local timePrinted = time / 1000 |
186 local timePrinted = time / 1000 |
187 SetTeamLabel(teamA.name, string.format(loc("%.1f s"), timePrinted)) |
187 SetTeamLabel(teamA.name, string.format(loc("%.1fs"), timePrinted)) |
188 end |
188 end |
189 end |
189 end |
190 |
190 |
191 function onGearDelete(gear) |
191 function onGearDelete(gear) |
192 if gear == hero.gear then |
192 if gear == hero.gear then |