> = [];
+
+ var totalPlatinums = 0;
+ var totalUltimates = 0;
+ var totalEggs = 0;
+ var totalBestTime = 0.0;
+ var hardestLevel:Mission = MissionList.missionList[game]["beginner"][0];
+ var hardestStats:PlayStatistics = {
+ oobs: 0,
+ respawns: 0,
+ totalTime: 0
+ };
+ var hardestLevelScore = 0.0;
+
+ for (difficulty => missions in MissionList.missionList[game]) {
+ completions.set(difficulty, missions.map(mis -> {
+ var misScores = Settings.getScores(mis.path);
+ if (misScores.length == 0) {
+ return {
+ mission: mis,
+ beatPar: false,
+ beatPlatinum: false,
+ beatUltimate: false,
+ beaten: false
+ }
+ }
+ var bestTime = misScores[0];
+ totalBestTime += bestTime.time;
+ var beatPar = bestTime.time < mis.qualifyTime;
+ var beatPlatinum = bestTime.time < mis.goldTime;
+ var beatUltimate = bestTime.time < mis.ultimateTime;
+ var beaten = beatPar || beatPlatinum || beatUltimate;
+
+ if (beatPlatinum)
+ totalPlatinums++;
+ if (beatUltimate)
+ totalUltimates++;
+ if (Settings.easterEggs.exists(mis.path))
+ totalEggs++;
+
+ if (Settings.levelStatistics.exists(mis.path)) {
+ var stats = Settings.levelStatistics.get(mis.path);
+ var metric = stats.oobs + stats.respawns + (stats.totalTime / 60);
+ if (metric > hardestLevelScore) {
+ hardestLevel = mis;
+ hardestLevelScore = metric;
+ hardestStats = stats;
+ }
+ }
+
+ return {
+ mission: mis,
+ beatPar: beatPar,
+ beatPlatinum: beatPlatinum,
+ beatUltimate: beatUltimate,
+ beaten: beaten
+ };
+ }));
+ }
+
+ if (game == "platinum") {
+ var beginnerCompletion = completions["beginner"].filter(x -> x.beatPar).length / completions["beginner"].length;
+ var intermediateCompletion = completions["intermediate"].filter(x -> x.beatPar).length / completions["intermediate"].length;
+ var advancedCompletion = completions["advanced"].filter(x -> x.beatPar).length / completions["advanced"].length;
+ var expertCompletion = completions["expert"].filter(x -> x.beatPar).length / completions["expert"].length;
+ var totalCompletion:Float = completions["beginner"].filter(x -> x.beatPar).length
+ + completions["intermediate"].filter(x -> x.beatPar)
+ .length + completions["advanced"].filter(x -> x.beatPar).length + completions["expert"].filter(x -> x.beatPar).length;
+ totalCompletion /= completions["beginner"].length
+ + completions["intermediate"].length + completions["advanced"].length + completions["expert"].length;
+
+ statText.text.text = '${Math.floor(beginnerCompletion * 100)}%
'
+ + '${Math.floor(intermediateCompletion * 100)}%
'
+ + '${Math.floor(advancedCompletion * 100)}%
'
+ + '${Math.floor(expertCompletion * 100)}%
'
+ + '${Math.floor(totalCompletion * 100)}%
'
+ + '
'
+ + '${totalPlatinums}/120 ${Math.floor(totalPlatinums / 120.0 * 100)}%
'
+ + '${totalUltimates}/120 ${Math.floor(totalUltimates / 120.0 * 100)}%
'
+ + '${totalEggs}/96 ${Math.floor(totalEggs / 96 * 100)}%
'
+ + '${Settings.playStatistics.oobs}
'
+ + '${Settings.playStatistics.respawns}
'
+ + '${hardestLevel != null ? hardestLevel.title : ""}
'
+ +
+ '${hardestLevel != null ? 'With ${hardestStats.oobs} OOBs, ${hardestStats.respawns} Respawns, and ${Util.formatTimeHours(hardestStats.totalTime)} Played': ""}
'
+ + '${Util.formatTimeHours(totalBestTime)}
'
+ + '${Util.formatTimeHours(Settings.playStatistics.totalTime)}
';
+ }
+ if (game == "gold") {
+ var beginnerCompletion = completions["beginner"].filter(x -> x.beatPar).length / completions["beginner"].length;
+ var intermediateCompletion = completions["intermediate"].filter(x -> x.beatPar).length / completions["intermediate"].length;
+ var advancedCompletion = completions["advanced"].filter(x -> x.beatPar).length / completions["advanced"].length;
+ var totalCompletion:Float = completions["beginner"].filter(x -> x.beatPar).length
+ + completions["intermediate"].filter(x -> x.beatPar).length + completions["advanced"].filter(x -> x.beatPar).length;
+ totalCompletion /= completions["beginner"].length + completions["intermediate"].length + completions["advanced"].length;
+
+ statText.text.text = '${Math.floor(beginnerCompletion * 100)}%
'
+ + '${Math.floor(intermediateCompletion * 100)}%
'
+ + '${Math.floor(advancedCompletion * 100)}%
'
+ + '${Math.floor(totalCompletion * 100)}%
'
+ + '
'
+ + '${totalPlatinums}/100 ${Math.floor(totalPlatinums / 100.0 * 100)}%
'
+ + '${Settings.playStatistics.oobs}
'
+ + '${Settings.playStatistics.respawns}
'
+ + '${hardestLevel != null ? hardestLevel.title : ""}
'
+ +
+ '${hardestLevel != null ? 'With ${hardestStats.oobs} OOBs, ${hardestStats.respawns} Respawns, and ${Util.formatTimeHours(hardestStats.totalTime)} Played': ""}
'
+ + '${Util.formatTimeHours(totalBestTime)}
'
+ + '${Util.formatTimeHours(Settings.playStatistics.totalTime)}
';
+ }
+ }
+}