public static List <string> GetMilestoneList(string pathBCSV, string fn = "EventFlagsLifeSupportAchievementParam.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var findex = dict[0x54706054]; var fname = dict[0x45F320F2]; var fjp = dict[0x85CF1615]; var result = new List <string>(); for (int i = 0; i < bcsv.EntryCount; i++) { var iid = bcsv.ReadValue(i, findex); var ival = ushort.Parse(iid); var name = bcsv.ReadValue(i, fname).TrimEnd('\0'); var jp = bcsv.ReadValue(i, fjp).TrimEnd('\0'); var kvp = $"{{{ival:00}, \"{name}\"}}, // {jp}"; result.Add(kvp); } result.Sort(); return(result); }
private static IEnumerable <string> GetPlantedNames(string pathBCSV, string fn = "FgMainParam.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var fType = dict[0x48EF0398]; var fname = dict[0x87BF00E8]; var findex = dict[0x54706054]; var fcomment = dict[0x3F45F2BF]; var result = new List <string>(); for (int i = 0; i < bcsv.EntryCount; i++) { var iid = bcsv.ReadValue(i, findex); var ival = (ushort)short.Parse(iid); var name = bcsv.ReadValue(i, fname).TrimEnd('\0'); var comment = bcsv.ReadValue(i, fcomment).TrimEnd('\0'); var type = bcsv.ReadValue(i, fType).TrimEnd('\0'); if (!Enum.TryParse <FieldItemKind>(type, out var k)) { throw new InvalidEnumArgumentException($"{type} is not a known enum value @ index {i}. Update the enum index first."); } var v = $"new {nameof(FieldItemDefinition)}(0x{ival:X}, \"{name}\", {nameof(FieldItemKind)}.{k})"; var kvp = $"{{0x{ival:X}, {v}}}, // {comment}"; result.Add(kvp); } result.Sort(); return(result); }
private static IEnumerable <string> GetLandEventFlagNames(string pathBCSV, string fn = "EventFlagsLandParam.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var fv1 = dict[0x4C24F1CF]; var fv2 = dict[0x344B17D7]; var fname = dict[0x45F320F2]; var findex = dict[0x54706054]; var fcomment = dict[0x85CF1615]; var result = new List <string>(); for (int i = 0; i < bcsv.EntryCount; i++) { var iv1 = bcsv.ReadValue(i, fv1).Substring(2); var iv1a = short.Parse(iv1, NumberStyles.HexNumber); var iv2 = bcsv.ReadValue(i, fv2).Substring(2); var iv2a = short.Parse(iv2, NumberStyles.HexNumber); var iid = bcsv.ReadValue(i, findex); var ival = (ushort)short.Parse(iid); var name = bcsv.ReadValue(i, fname).TrimEnd('\0'); var comment = bcsv.ReadValue(i, fcomment).TrimEnd('\0'); var paddedName = $"\"{name}\"".PadRight(45, ' '); var v = $"new {nameof(EventFlagLand)}({iv1a,-2}, {iv2a,-5}, {ival:0000}, {paddedName})"; var kvp = $"{{0x{ival:X3}, {v}}}, // {comment}"; result.Add(kvp); } result.Sort(); return(result); }
public static List <string> GetRecipeList(string pathBCSV, string fn = "RecipeCraftParam.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var frecipe = dict[0x54706054]; var fitemID = dict[0x89A3482C]; var items = GameInfo.Strings.itemlist; var result = new List <string>(); for (int i = 0; i < bcsv.EntryCount; i++) { var iid = bcsv.ReadValue(i, fitemID); var ival = ushort.Parse(iid); var rid = bcsv.ReadValue(i, frecipe); var rval = ushort.Parse(rid); var kvp = $"{{0x{rval:X3}, {ival:00000}}}, // {items[ival]}"; result.Add(kvp); } result.Sort(); return(result); }
private static IEnumerable <string> GetVillagerEventFlagNamesMemoryPlayer(string pathBCSV, string fn = "EventFlagsNpcMemoryParam.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var finit = dict[0xD55938BD]; var fmax = dict[0xBD7682F5]; var fname = dict[0x45F320F2]; var findex = dict[0x54706054]; var fcomment = dict[0x85CF1615]; var result = new List <string>(); for (int i = 0; i < bcsv.EntryCount; i++) { var isinit = bcsv.ReadValue(i, finit); var iinit = short.Parse(isinit); var ismax = bcsv.ReadValue(i, fmax); var imax = short.Parse(ismax); var iid = bcsv.ReadValue(i, findex); var index = (ushort)short.Parse(iid); var name = bcsv.ReadValue(i, fname).TrimEnd('\0'); var comment = bcsv.ReadValue(i, fcomment).TrimEnd('\0'); var paddedName = $"\"{name}\"".PadRight(45, ' '); var v = $"new {nameof(EventFlagVillagerMemoryPlayer)}({iinit,-2}, {imax,-3}, {index:000}, {paddedName})"; var kvp = $"{{0x{index:X2}, {v}}}, // {comment}"; result.Add(kvp); } result.Sort(); return(result); }
public static List <string> GetLifeSupportAchievementList(string pathBCSV, string fn = "EventFlagsLifeSupportAchievementParam.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var findex = dict[0x54706054]; var fname = dict[0x45F320F2]; var fcomment = dict[0x85CF1615]; var fLand = dict[0x3FE43170]; var fPlayer = dict[0x4171A41D]; var fmaxLevel = dict[0x1BE772F0]; var fThreshold1 = dict[0xCE0933FC]; var fThreshold2 = dict[0x89A9492C]; var fThreshold3 = dict[0xB4C9609C]; var fThreshold4 = dict[0x06E9BC8C]; var fThreshold5 = dict[0x3B89953C]; var result = new List <string>(); for (int i = 0; i < bcsv.EntryCount; i++) { int readHex(BCSVFieldParam p) => int.Parse(bcsv.ReadValue(i, p).Substring(2), NumberStyles.HexNumber); var iid = bcsv.ReadValue(i, findex); var index = ushort.Parse(iid); var land = readHex(fLand); var player = readHex(fPlayer); var name = bcsv.ReadValue(i, fname).TrimEnd('\0'); var paddedName = $"\"{name}\"".PadRight(30, ' '); var comment = bcsv.ReadValue(i, fcomment).TrimEnd('\0'); var tmp = bcsv.ReadValue(i, fmaxLevel); var max = ushort.Parse(tmp); var t1 = readHex(fThreshold1); var t2 = readHex(fThreshold2); var t3 = readHex(fThreshold3); var t4 = readHex(fThreshold4); var t5 = readHex(fThreshold5); var values = $"{max}, {t1:0000}, {t2:0000}, {t3:0000}, {t4:0000}, {t5:0000}"; var v = $"new {nameof(LifeSupportAchievement)}({index:000}, {values}, {land,3}, {player,3}, {paddedName})"; var kvp = $"{{0x{index:X2}, {v}}}, // {comment}"; result.Add(kvp); } result.Sort(); return(result); }
private static IEnumerable<ushort> GetItemList(string pathBCSV, string fn, uint keyItemIDColumn) { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var findex = dict[keyItemIDColumn]; var result = new List<ushort>(); for (int i = 0; i < bcsv.EntryCount; i++) { var iid = bcsv.ReadValue(i, findex); var ival = ushort.Parse(iid); result.Add(ival); } result.Sort(); return result; }
private static IEnumerable<string> GetAcreNames(string pathBCSV, string fn = "FieldOutsideParts.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var findex = dict[0x54706054]; var fname = dict[0x39B5A93D]; var result = new List<string>(); for (int i = 0; i < bcsv.EntryCount; i++) { var iid = bcsv.ReadValue(i, findex); var ival = ushort.Parse(iid); var name = bcsv.ReadValue(i, fname).TrimEnd('\0'); var kvp = $"{{0x{ival:X2}, \"{name}\"}}, // {ival}"; result.Add(kvp); } result.Sort(); return result; }
public static List <string> GetLifeSupportAchievementList(string pathBCSV, string fn = "EventFlagsLifeSupportAchievementParam.bcsv") { var bcsv = BCSVConverter.GetBCSV(pathBCSV, fn); var dict = bcsv.GetFieldDictionary(); var findex = dict[0x54706054]; var fname = dict[0x45F320F2]; var fcomment = dict[0x85CF1615]; var fv1 = dict[0x3FE43170]; var fv2 = dict[0x4171A41D]; var result = new List <string>(); for (int i = 0; i < bcsv.EntryCount; i++) { var iid = bcsv.ReadValue(i, findex); var ival = ushort.Parse(iid); ival++; // offset by 1; index 0 is used for something else var iv1 = bcsv.ReadValue(i, fv1).Substring(2); var iv1a = int.Parse(iv1, NumberStyles.HexNumber); var iv2 = bcsv.ReadValue(i, fv2).Substring(2); var iv2a = int.Parse(iv2, NumberStyles.HexNumber); var name = bcsv.ReadValue(i, fname).TrimEnd('\0'); var comment = bcsv.ReadValue(i, fcomment).TrimEnd('\0'); var paddedName = $"\"{name}\"".PadRight(30, ' '); var v = $"new {nameof(LifeSupportAchievement)}({iv1a,2}, {iv2a,4}, {ival:0000}, {paddedName})"; var kvp = $"{{0x{ival:X3}, {v}}}, // {comment}"; result.Add(kvp); } result.Sort(); return(result); }