439 ShowMission(loc("Climb Home"), |
439 ShowMission(loc("Climb Home"), |
440 loc("Made it!"), |
440 loc("Made it!"), |
441 string.format(loc("Ahhh, home, sweet home. Made it in %d seconds."), roundedFinishTime), |
441 string.format(loc("Ahhh, home, sweet home. Made it in %d seconds."), roundedFinishTime), |
442 -amRope, 0) |
442 -amRope, 0) |
443 PlaySound(sndVictory,CurrentHedgehog) |
443 PlaySound(sndVictory,CurrentHedgehog) |
444 SetState(CurrentHedgehog, gstWinner) |
|
445 SendStat(siGameResult, loc("You have beaten the challenge!")) |
444 SendStat(siGameResult, loc("You have beaten the challenge!")) |
446 SendStat(siGraphTitle, loc("Your height over time")) |
445 SendStat(siGraphTitle, loc("Your height over time")) |
447 SendStat(siCustomAchievement, string.format(loc("%s reached home in %.3f seconds. Congratulations!"), GetHogName(CurrentHedgehog), finishTime)) |
446 SendStat(siCustomAchievement, string.format(loc("%s reached home in %.3f seconds. Congratulations!"), GetHogName(CurrentHedgehog), finishTime)) |
448 updateChallengeRecord("TimeRecord", rawFinishTime, false) |
447 updateChallengeRecord("TimeRecord", rawFinishTime, false) |
449 SendStat(siCustomAchievement, string.format(loc("%s bravely climbed up to a dizzy height of %d to reach home."), GetHogName(CurrentHedgehog), getActualHeight(RecordHeight))) |
448 SendStat(siCustomAchievement, string.format(loc("%s bravely climbed up to a dizzy height of %d to reach home."), GetHogName(CurrentHedgehog), getActualHeight(RecordHeight))) |
450 updateChallengeRecord("Highscore", getActualHeight(RecordHeight)) |
449 updateChallengeRecord("Highscore", getActualHeight(RecordHeight)) |
451 SendStat(siPointType, "!TIME") |
450 SendStat(siPointType, "!TIME") |
452 SendStat(siPlayerKills, tostring(rawFinishTime), GetHogTeamName(CurrentHedgehog)) |
451 SendStat(siPlayerKills, tostring(rawFinishTime), GetHogTeamName(CurrentHedgehog)) |
453 |
452 |
454 EndGame() |
453 EndGame() |
|
454 SetState(CurrentHedgehog, gstWinner) |
455 onAchievementsDeclaration() |
455 onAchievementsDeclaration() |
456 YouWon = true |
456 YouWon = true |
457 end |
457 end |
458 else |
458 else |
459 if distanceFromWater < 0 and not YouLost and not YouWon then |
459 if distanceFromWater < 0 and not YouLost and not YouWon then |