Skip to content

Commit

Permalink
Feature: Bestiary Level as Stack Size (hannibal002#1945)
Browse files Browse the repository at this point in the history
Co-authored-by: Cal <cwolfson58@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
3 people authored and Nealkitt committed Aug 16, 2024
1 parent 8679fc1 commit abd1821
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public enum ItemNumberEntry implements HasLegacyId {
DARK_CACAO_TRUFFLE("§bDark Cacao Truffle"),
EDITION_NUMBER("§bEdition Number", 16),
BINGO_GOAL_RANK("§bBingo Goal Rank"),
SKYBLOCK_LEVEL("§bSkyblock Level")
SKYBLOCK_LEVEL("§bSkyblock Level"),
BESTIARY_LEVEL("§bBestiary Level")
;

private final String str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumbe
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKILL_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKYBLOCK_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.VACUUM_GARDEN
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.BESTIARY_LEVEL
import at.hannibal2.skyhanni.data.PetAPI
import at.hannibal2.skyhanni.events.RenderItemTipEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI
Expand Down Expand Up @@ -93,6 +94,10 @@ object ItemDisplayOverlayFeatures {
"skyblocklevel",
"§7Your SkyBlock Level: §8\\[(?<level>§.\\d+)§8]",
)
private val bestiaryStackPattern by patternGroup.pattern(
"bestiarystack",
"§7Progress to Tier (?<tier>[\\dIVXC]+): §b[\\d.]+%"
)

@SubscribeEvent
fun onRenderItemTip(event: RenderItemTipEvent) {
Expand Down Expand Up @@ -283,6 +288,17 @@ object ItemDisplayOverlayFeatures {
}
}

if (BESTIARY_LEVEL.isSelected() && (chestName.contains("Bestiary ➜") || chestName.contains("Fishing ➜")) && lore.any { it.contains("Deaths: ") }) {
lore.matchFirst(bestiaryStackPattern) {
val tier = (group("tier").romanToDecimalIfNecessary() - 1)
return tier.toString()
} ?: run {
val tier = itemName.split(" ")

return tier.last().romanToDecimalIfNecessary().toString()
}
}

return null
}

Expand Down

0 comments on commit abd1821

Please sign in to comment.