153 |
153 |
154 function heroSafe(gear) |
154 function heroSafe(gear) |
155 SendStat(siGameResult, loc("Congratulations, you won!")) |
155 SendStat(siGameResult, loc("Congratulations, you won!")) |
156 SendStat(siCustomAchievement, loc("You have escaped successfully.")) |
156 SendStat(siCustomAchievement, loc("You have escaped successfully.")) |
157 SendStat(siCustomAchievement, string.format(loc("Your escape took you %d turns."), TotalRounds)) |
157 SendStat(siCustomAchievement, string.format(loc("Your escape took you %d turns."), TotalRounds)) |
158 SendStat(siPlayerKills,'1',teamA.name) |
158 local record = tonumber(GetCampaignVar("FastestMineEscape")) |
|
159 if record ~= nil and TotalRounds >= record then |
|
160 SendStat(siCustomAchievement, string.format(loc("Your fastest escape so far: %d turns"), record)) |
|
161 end |
|
162 if record == nil or TotalRounds < record then |
|
163 SaveCampaignVar("FastestMineEscape", tostring(TotalRounds)) |
|
164 if record ~= nil then |
|
165 SendStat(siCustomAchievement, loc("This is a new personal best, congratulations!")) |
|
166 end |
|
167 end |
|
168 SendStat(siPlayerKills,'0',teamA.name) |
159 EndGame() |
169 EndGame() |
160 end |
170 end |
161 |
171 |
162 -------------- ANIMATIONS ------------------ |
172 -------------- ANIMATIONS ------------------ |
163 |
173 |