From b7c45e41eb3360d4ece3e028ba68b962721c095a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 3 Mar 2023 00:47:31 +0100 Subject: Removed slayer minions from minion craft helper. --- .../skyhanni/features/bingo/MinionCraftHelper.kt | 36 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'src/main') 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, 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) }) { -- cgit