diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-03 00:47:31 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-03 00:47:31 +0100 |
commit | b7c45e41eb3360d4ece3e028ba68b962721c095a (patch) | |
tree | 7921ef7cb98556873573dfe1a9d2f84601ef2034 /src/main/java/at | |
parent | 2a26030fa9f6bc3979f1527c5727cc30e8d2e2b0 (diff) | |
download | skyhanni-b7c45e41eb3360d4ece3e028ba68b962721c095a.tar.gz skyhanni-b7c45e41eb3360d4ece3e028ba68b962721c095a.tar.bz2 skyhanni-b7c45e41eb3360d4ece3e028ba68b962721c095a.zip |
Removed slayer minions from minion craft helper.
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 6f80fa15e..b52db6139 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -96,17 +96,47 @@ class MinionCraftHelper { val rawId = item.getInternalName() if (name.contains(" Minion ")) { minions[name] = rawId - } else { + } + } + + val allMinions = tierOneMinions.toMutableList() + minions.values.mapTo(allMinions) { it.addOneToId() } + + for (item in mainInventory) { + val name = item?.name?.removeColor() ?: continue + val rawId = item.getInternalName() + if (!name.contains(" Minion ")) { if (!allIngredients.contains(rawId)) continue + if (!isAllowed(allMinions, rawId)) continue + val (itemId, multiplier) = NEUItems.getMultiplier(rawId) val old = otherItems.getOrDefault(itemId, 0) otherItems[itemId] = old + item.stackSize * multiplier } } + firstMinionTier(otherItems, minions) return Pair(minions, otherItems) } + private fun isAllowed(allMinions: List<String>, internalName: String): Boolean { + val a = NEUItems.getMultiplier(internalName) + for (minion in allMinions) { + val recipes = NEUItems.getRecipes(minion) + + for (recipe in recipes) { + for (ingredient in recipe.ingredients) { + val ingredientInternalName = ingredient.internalItemId + if (ingredientInternalName == internalName) return true + + val b = NEUItems.getMultiplier(ingredientInternalName) + if (a.first == b.first && a.second < b.second) return true + } + } + } + return false + } + private fun init() { if (tierOneMinions.isNotEmpty()) return @@ -114,6 +144,9 @@ class MinionCraftHelper { for (internalId in NotEnoughUpdates.INSTANCE.manager.itemInformation.keys) { if (internalId.endsWith("_GENERATOR_1")) { + if (internalId == "REVENANT_GENERATOR_1") continue + if (internalId == "TARANTULA_GENERATOR_1") continue + if (internalId == "VOIDLING_GENERATOR_1") continue tierOneMinions.add(internalId) } @@ -144,7 +177,6 @@ class MinionCraftHelper { } } for (minionId in tierOneMinionsFiltered) { - for (recipe in NEUItems.getRecipes(minionId)) { if (recipe !is CraftingRecipe) continue if (recipe.ingredients.any { help.contains(it.internalItemId) }) { |