private void FillFilterUniqueData(LeagueData data, List <string> baseTypes, UniqueValue value) { foreach (string baseTy in baseTypes) { if (!data.Uniques.TryGetValue(baseTy, out UniqueBaseType unique)) { if (baseTy == "Maelstr") { if (!data.Uniques.TryGetValue("Maelström Staff", out unique)) { unique = new UniqueBaseType("Maelström Staff"); data.Uniques.Add("Maelström Staff", unique); } } else { unique = new UniqueBaseType(baseTy); data.Uniques.Add(baseTy, unique); MessageBox.Show("Filter: unknown basetype: " + unique.BaseType, "Error", MessageBoxButtons.OK); Environment.Exit(1); } } unique.FilterValue = value; } }
private void UniqueJsonHandler(ItemData jdata, LeagueData data) { string baseTy = jdata.BaseType; if (!data.Uniques.TryGetValue(baseTy, out UniqueBaseType uniq)) { uniq = new UniqueBaseType(baseTy); data.Uniques.Add(baseTy, uniq); } if (!uniq.Add(jdata)) { UniquesErrors.Add(jdata); } }
private void UniqueJsonHandler(JsonData jdata, LeagueData data) { string baseTy = jdata.BaseType; if (!data.Uniques.TryGetValue(baseTy, out UniqueBaseType uniq)) { uniq = new UniqueBaseType(baseTy); data.Uniques.Add(baseTy, uniq); if (!data.IsHardcore) { MessageBox.Show("JSON: The CSV file is missing BaseType: " + baseTy, "Error", MessageBoxButtons.OK); ErrorCount++; } } if (!uniq.Add(jdata) && !data.IsHardcore) { MessageBox.Show("JSON: The CSV file is missing: " + jdata.BaseType + " " + jdata.Name, "Error", MessageBoxButtons.OK); ErrorCount++; } if (ErrorCount > MaxErrors) { Environment.Exit(1); } }
private string GenerateUniquesString(FilterType type) { List <string> list15c = new List <string>(); List <string> list5to15c = new List <string>(); List <string> list3to5c = new List <string>(); List <string> listLimited = new List <string>(); StringBuilder sb = new StringBuilder(); foreach (var uniq in UniquesA) { UniqueBaseType entry = uniq.Value; string baseTy = uniq.Key; UniqueValue expectedVal = entry.ExpectedFilterValue; UniqueValue filterVal = entry.FilterValue; string outputBaseTy = baseTy; int index = baseTy.IndexOf('ö'); if (index > 0) { outputBaseTy = outputBaseTy.Substring(0, index); } UniqueBaseType entryHC = UniquesB[baseTy]; UniqueValue expectedValHC = entryHC.ExpectedFilterValue; if (entry.SeverityLevel == 0) { expectedVal = filterVal; } //if is only core drop and SC <3c and HC 15c+ then Limited if (expectedVal.Tier == 0 && expectedValHC.Tier > 0) { if (expectedValHC.Tier > 2 || !entry.Items.All(x => x.IsCoreDrop)) { expectedVal = UniqueValue.Limited; } } switch (expectedVal.Value) { case UniqueValueEnum.Chaos15: list15c.Add(outputBaseTy); break; case UniqueValueEnum.Chaos5to15: list5to15c.Add(outputBaseTy); break; case UniqueValueEnum.Chaos3to5: list3to5c.Add(outputBaseTy); break; case UniqueValueEnum.Limited: listLimited.Add(outputBaseTy); break; default: break; } } sb.AppendLine(uniqueWarning).AppendLine(); sb.AppendLine(uniqueJewels).AppendLine(); if (list15c.Count > 0) { sb.AppendLine(header15c).AppendLine(); sb.AppendLine("Show # Uniques - 15c+").AppendLine("\tRarity = Unique").Append("\tBaseType ").AppendLine(ItemList(list15c)).AppendLine(style15c).AppendLine(); } sb.AppendLine(header5to15c).AppendLine(); if (list5to15c.Count > 0) { sb.AppendLine("Show # Uniques - 5-15c").AppendLine("\tRarity = Unique").Append("\tBaseType ").AppendLine(ItemList(list5to15c)).AppendLine(style5to15c).AppendLine(); } sb.AppendLine("Show # Uniques - Enchanted").AppendLine("\tRarity = Unique").AppendLine("\tAnyEnchantment True").AppendLine(style5to15c).AppendLine(); sb.AppendLine(header3c).AppendLine(); if (list3to5c.Count > 0) { sb.AppendLine("Show # Uniques - 3-5c").AppendLine("\tRarity = Unique").Append("\tBaseType ").AppendLine(ItemList(list3to5c)).AppendLine(style3c).AppendLine(); } sb.AppendLine(loreweaveStr).AppendLine(style3c).AppendLine(); sb.AppendLine(replicaUniq).AppendLine(); sb.AppendLine(headerLess3c).AppendLine(); string showHide = type == FilterType.VERY_STRICT ? "Hide" : "Show"; string vsSound = type == FilterType.VERY_STRICT ? styleUniqueIcon : styleUniqueIconSound; string sSound = (type != FilterType.VERY_STRICT && type != FilterType.STRICT) ? styleUniqueIconSound : " DisableDropSound"; if (type != FilterType.VERY_STRICT) { sb.AppendLine(lessLvl67).AppendLine(); } if (listLimited.Count > 0) { sb.AppendLine(headerLimited); sb.AppendLine("Show # Uniques - Limited").AppendLine("\tRarity = Unique").Append("\tBaseType ").AppendLine(ItemList(listLimited)).AppendLine(styleLimited).AppendLine(vsSound).AppendLine(); } sb.AppendLine(showHide + uniqueNewOrWorthless).Append(sSound).AppendLine(); return(sb.ToString()); }
private string GenerateUniquesString() { List <string> list10c = new List <string>(); List <string> list2to10c = new List <string>(); List <string> list1to2c = new List <string>(); List <string> listLess1c = new List <string>(); List <string> listLess1cShared = new List <string>(); List <string> listLess1cLeague = new List <string>(); List <string> listLess1cBoss = new List <string>(); List <string> listLess1cCrafted = new List <string>(); List <string> listLess1cLabyrinth = new List <string>(); StringBuilder sb = new StringBuilder(); foreach (KeyValuePair <string, UniqueBaseType> uniq in UniquesSC) { UniqueBaseType entry = uniq.Value; string baseTy = uniq.Key; UniqueValue expectedVal = entry.ExpectedFilterValue; UniqueValue filterVal = entry.FilterValue; string outputBaseTy = baseTy; int index = baseTy.IndexOf('ö'); if (index > 0) { outputBaseTy = outputBaseTy.Substring(0, index); } UniqueBaseType entryHC = UniquesHC[baseTy]; UniqueValue expectedValHC = entryHC.ExpectedFilterValue; if (entry.SeverityLevel == 0) { expectedVal = filterVal; } else if (Safe && filterVal.Tier > expectedVal.Tier) { if (entry.Items.Count > 1 || filterVal.LowValue < entry.Items[0].ChaosValue) { expectedVal = UniqueValue.FromTier(expectedVal.Tier + 1); } } //if SC <1c and HC 4c+ then 1-2c if (HCFriendly && expectedVal.Tier < 2 && expectedValHC.Tier > 2 && entryHC.Items.Any(i => i.IsCoreDrop && i.ChaosValue > 4.0f)) { expectedVal = UniqueValue.Chaos1to2; } switch (expectedVal.Value) { case UniqueValueEnum.Chaos10: list10c.Add(outputBaseTy); break; case UniqueValueEnum.Chaos2to10: list2to10c.Add(outputBaseTy); break; case UniqueValueEnum.Chaos1to2: list1to2c.Add(outputBaseTy); break; case UniqueValueEnum.ChaosLess1: listLess1c.Add(outputBaseTy); break; case UniqueValueEnum.ChaosLess1League: listLess1cLeague.Add(outputBaseTy); break; case UniqueValueEnum.ChaosLess1Boss: listLess1cBoss.Add(outputBaseTy); break; case UniqueValueEnum.ChaosLess1Shared: listLess1cShared.Add(outputBaseTy); break; case UniqueValueEnum.ChaosLess1Crafted: listLess1cCrafted.Add(outputBaseTy); break; case UniqueValueEnum.ChaosLess1Labyrinth: listLess1cLabyrinth.Add(outputBaseTy); break; default: break; } } if (list10c.Count > 0) { sb.AppendLine(header10c).AppendLine(); sb.AppendLine("Show # Uniques - 10c+").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(list10c)).AppendLine(style10c).AppendLine(); } if (list2to10c.Count > 0) { sb.AppendLine(header2to10c).AppendLine(); sb.AppendLine("Show # Uniques - 2-10c").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(list2to10c)).AppendLine(style2to10c).AppendLine(); } sb.AppendLine(header1c).AppendLine(); if (list1to2c.Count > 0) { sb.AppendLine("Show # Uniques - 1-2c").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(list1to2c)).AppendLine(style1c).AppendLine(); } sb.AppendLine(loreweaveStr).AppendLine(); sb.AppendLine(headerLess1c).AppendLine(); if (listLess1cLeague.Count > 0) { sb.AppendLine("Show # Uniques - <1c - League").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(listLess1cLeague)).AppendLine(styleLess1c).AppendLine(); } if (listLess1cBoss.Count > 0) { sb.AppendLine("Show # Uniques - <1c - Boss Prophecy").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(listLess1cBoss)).AppendLine(styleLess1c).AppendLine(); } if (listLess1cShared.Count > 0) { sb.AppendLine("Show # Uniques - <1c - Shared").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(listLess1cShared)).AppendLine(styleLess1c).AppendLine(); } if (listLess1cCrafted.Count > 0) { sb.AppendLine("Show # Uniques - <1c - Crafted Fated Purchased").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(listLess1cCrafted)).AppendLine(styleLess1c).AppendLine(); } if (listLess1cLabyrinth.Count > 0) { sb.AppendLine("Show # Uniques - <1c - Labyrinth").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(listLess1cLabyrinth)).AppendLine(styleLess1c).AppendLine(); } if (listLess1c.Count > 0) { sb.AppendLine("Show # Uniques - <1c - Nearly Worthless").AppendLine("\tRarity = Unique").Append('\t').AppendLine(BaseTypeList(listLess1c)).AppendLine(styleLess1c).AppendLine(); } sb.AppendLine(uniqueNewOrWorthless); return(sb.ToString()); }