From e3bc27437d0627489b383b85ff0d24edb2292cd0 Mon Sep 17 00:00:00 2001 From: zealerker22 <97942218+zealerker22@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:17:44 -0400 Subject: [PATCH] fix: Dungeon fixes + Enchantments small fix (#488) * Fixed sending "Blaze Done" message earlier than expected if a Blaze puzzle was reset, due to total number of blaze kills wasn't cleared * Fixed resetting a puzzle in Dungeons doesn't change number of missing/failed puzzles, affecting score calculation * Fixed all Turbo-[crop] (e.g. Turbo-Potato) enchantments having exact same enchantment abbreviation (aka. "Tur.") by changing them w.r.t. actual crops * Attempt for a checkmark texture update for Catlas --- .../features/impl/dungeons/DungeonFeatures.kt | 9 +++++++++ .../features/impl/dungeons/ScoreCalculation.kt | 7 +++++++ .../features/impl/misc/ItemFeatures.kt | 10 +++++++--- .../assets/catlas/default/green_check.png | Bin 170 -> 226 bytes .../assets/catlas/default/white_check.png | Bin 165 -> 172 bytes 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt index fc127ebfd..5560cd454 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt @@ -28,6 +28,7 @@ import gg.skytils.skytilsmod.core.structure.GuiElement import gg.skytils.skytilsmod.events.impl.* import gg.skytils.skytilsmod.events.impl.GuiContainerEvent.SlotClickEvent import gg.skytils.skytilsmod.events.impl.PacketEvent.ReceiveEvent +import gg.skytils.skytilsmod.events.impl.skyblock.DungeonEvent import gg.skytils.skytilsmod.features.impl.dungeons.catlas.handlers.DungeonInfo import gg.skytils.skytilsmod.features.impl.handlers.MayorInfo import gg.skytils.skytilsmod.listeners.DungeonListener @@ -331,6 +332,14 @@ object DungeonFeatures { } } + @SubscribeEvent + fun onPuzzleReset(event: DungeonEvent.PuzzleEvent.Reset) { + if (!Utils.inDungeons) return + if (event.puzzle == "Higher Or Lower") { + blazes = 0 + } + } + @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true) fun onChat(event: ClientChatReceivedEvent) { if (!Utils.inSkyblock || event.type == 2.toByte()) return diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt index 05c26e09e..f796d70a8 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt @@ -25,6 +25,7 @@ import gg.skytils.skytilsmod.core.GuiManager import gg.skytils.skytilsmod.core.structure.GuiElement import gg.skytils.skytilsmod.core.tickTimer import gg.skytils.skytilsmod.events.impl.MainReceivePacketEvent +import gg.skytils.skytilsmod.events.impl.skyblock.DungeonEvent import gg.skytils.skytilsmod.features.impl.dungeons.DungeonFeatures.dungeonFloorNumber import gg.skytils.skytilsmod.features.impl.handlers.MayorInfo import gg.skytils.skytilsmod.listeners.DungeonListener @@ -453,6 +454,12 @@ object ScoreCalculation { } } + @SubscribeEvent + fun onPuzzleReset(event: DungeonEvent.PuzzleEvent.Reset) { + missingPuzzles.set(missingPuzzles.get() + 1) + failedPuzzles.set((failedPuzzles.get() - 1).coerceAtLeast(0)) + } + @SubscribeEvent(priority = EventPriority.LOWEST) fun canYouPleaseStopCryingThanks(event: ClientChatReceivedEvent) { if (!Utils.inDungeons || event.type != 0.toByte()) return diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt index 0e4c90fc8..bbf4bbbe9 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt @@ -601,9 +601,13 @@ object ItemFeatures { val enchant = EnchantUtil.enchants.find { it.nbtName == name } val prefix: String = if (enchant != null) { val parts = enchant.loreName.split(" ") - val joined = if (parts.size > 1) parts.joinToString("") { it[0].uppercase() } else "${ - parts[0].take(3).toTitleCase() - }." + val joined = if (parts.size > 1) parts.joinToString("") { it[0].uppercase() } + else if (parts.first().startsWith("Turbo-")) "${ + parts.first().split("-")[1].take(3).toTitleCase() + }." + else "${ + parts.first().take(3).toTitleCase() + }." if (enchant.nbtName.startsWith("ultimate")) { "§d§l${joined}" } else joined diff --git a/src/main/resources/assets/catlas/default/green_check.png b/src/main/resources/assets/catlas/default/green_check.png index e2e2e05ee14d75bc669d77d7d824c4562df5cbc3..a5090e592c8aa2eb23ff52a609b117a26b20c282 100644 GIT binary patch delta 183 zcmZ3*_=r)lGr-TCmrII^fq{Y7)59eQNQ2m%9Be?6d)Z#$iHfH6<(@8%AsWH0{Rep) z6nI?gKk8L|ejuf{@b#+fl{^W#(jEp*HR>7h_N^b9<87NceD{cdj6VLcBWsbT&b%eD zr#+9l?EkK|(Zf+?t>x>KEwf7Qt0m59i(rd%zTg=hb7Hd4G>=a{QW~CJqL&`MkvUXT ivqXGt-2$!;41JAyhgYW0<&^@ug~8L+&t;ucLK6V=KSW9Z delta 126 zcmaFFxQbD+Gr-TCmrII^fq{Y7)59eQNOOQN2OE$)!oRP3qM~Vty{C&~h(>U-0*l1| z|Nr?@lh`9f4Xzm-Vx76bL`K2;U;e-I9Sa%Q940A9tzlTg9jR{Au$%F2hKBHE-W3gv aj0}gw#s43*emVhYB!j1`pUXO@geCxXXeQMF diff --git a/src/main/resources/assets/catlas/default/white_check.png b/src/main/resources/assets/catlas/default/white_check.png index 8030f92cce938ae931664fd79bc7fa54e02a0e51..5448a013a0f42f344c2afe4f8c974bbdd0a28a89 100644 GIT binary patch delta 128 zcmZ3=xQ0=&Gr-TCmrII^fq{Y7)59eQNQ2m%9Be?6d)Z#$iHfFSj-D=#AsWH0XFT~B z6gXH8KK$Pw*6ty~vZk9`mPJ1K;mtO&K*?Pl-|lu!ocC*2ieM-2k4V=iZE9{yU0pC=cC z0SB}1|NqZBOcu3IId`y^Q^MXMXz_E!GapyzmoXVQF^5bI(EQ)ilHGr0_uoX}iEdQ_ VtQzGuvOv=qJYD@<);T3K0RZN)CE5T0