Skip to content

Commit

Permalink
fix: Dungeon fixes + Enchantments small fix (#488)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zealerker22 authored and My-Name-Is-Jeff committed Aug 9, 2024
1 parent 768cad9 commit e3bc274
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified src/main/resources/assets/catlas/default/green_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/catlas/default/white_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e3bc274

Please sign in to comment.