static void CommandSetNights(string[] parameters) { try { int map = int.Parse(parameters[0]) - 1; if (map < 0 || map >= NUMMAPS) { Console.WriteLine("Couldn't find the map {0}. Please select a map between 1 and {1}", map + 1, NUMMAPS); return; } byte numMares = byte.Parse(parameters[1]); nightsrecords[map] = new NightsRecord(); nightsrecords[map].nummares = (byte)(numMares); nightsrecords[map].mares = new Mare[numMares + 1]; for (byte i = 0; i < numMares; i++) { nightsrecords[map].mares[i] = new Mare(); Console.WriteLine("Mare {0}:", i); GetUInt32("Score: ", ref nightsrecords[map].mares[i].score); GetByte("Grade (0-6): ", ref nightsrecords[map].mares[i].grade); GetUInt32("Time: ", ref nightsrecords[map].mares[i].time); } Mare emptyMare = new Mare(); emptyMare.score = 0; emptyMare.grade = 0; emptyMare.time = 0; nightsrecords[map].mares[numMares] = emptyMare; } catch (FormatException e) { Console.WriteLine("{0}: {1}", e.Data.GetType().ToString(), e.Message); } }
static void CommandUnlockAll(string[] parameters) { totalplaytime = 0; // total play time (separate from all) modified = 0; SetArray(ref mapvisited, MV_MAX); SetArray(ref emblemlocations, 1); SetArray(ref extraemblems, 1); SetArray(ref unlockables, 1); SetArray(ref conditionSets, 1); timesBeaten = UInt32.MaxValue; timesBeatenWithEmeralds = UInt32.MaxValue; timesBeatenUltimate = UInt32.MaxValue; for (int i = 0; i < NUMMAPS; ++i) { if (mainrecords[i] == null) { mainrecords[i] = new Record(); } mainrecords[i].score = MAXSCORE; mainrecords[i].time = 1; mainrecords[i].rings = 10000; } // Let's assume there aren't any nights maps after 200 for (int i = 0; i < 200; ++i) { if (nightsrecords[i] == null) { nightsrecords[i] = new NightsRecord(); } byte nummares = 4; // 4 at most nightsrecords[i].mares = new Mare[nummares + 1]; for (int curmare = 0; curmare < (nummares + 1); ++curmare) { Mare mare = new Mare(); mare.score = MAXSCORE; mare.grade = GRADE_S; mare.time = 1; nightsrecords[i].mares[curmare] = mare; } nightsrecords[i].nummares = nummares; } }
static void CommandRecordInfo(string[] parameters) { Console.WriteLine("mainrecords/nightsrecords: "); for (int i = 0; i < NUMMAPS; i++) { Record record = mainrecords[i]; NightsRecord nightsRecord = nightsrecords[i]; if (record != null && (record.score != 0 || record.time != 0 || record.rings != 0)) { Console.WriteLine("Map {0}: Score: {1}, Time: {2}, Rings: {3}", i + 1, record.score, record.time, record.rings); } if (nightsrecords[i] != null && nightsrecords[i].nummares != 0) { Console.Write("Map: {0}: ", i + 1); for (int j = 0; j < nightsRecord.nummares; j++) { Mare mare = nightsRecord.mares[j]; Console.Write("Mare {0}: Score: {1}, Grade: {2}, Time: {3}, ", j, mare.score, mare.grade, mare.time); } Console.WriteLine(); } } }