Skip to content

Commit

Permalink
Improvement: Added Item Cooldown to Totem of Corruption and Enrager (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DungeonHub authored Oct 11, 2024
1 parent 60f92d5 commit 9c1a844
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ enum class ItemAbility(
ROYAL_PIGEON(5),
WAND_OF_STRENGTH(10),
TACTICAL_INSERTION(20),
TOTEM_OF_CORRUPTION(20),
ENRAGER(20),

// doesn't have a sound
ENDER_BOW("Ender Warp", 5, "Ender Bow"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ object ItemAbilityCooldown {
private var lastAbility = ""
private var items = mapOf<String, List<ItemText>>()
private var abilityItems = mapOf<ItemStack, MutableList<ItemAbility>>()
private val recentItemsInHand = InventoryUtils.recentItemsInHand.values
private val WEIRD_TUBA = "WEIRD_TUBA".asInternalName()
private val WEIRDER_TUBA = "WEIRDER_TUBA".asInternalName()
private val VOODOO_DOLL_WILTED = "VOODOO_DOLL_WILTED".asInternalName()
private val WARNING_FLARE = "WARNING_FLARE".asInternalName()
private val ALERT_FLARE = "ALERT_FLARE".asInternalName()
private val SOS_FLARE = "SOS_FLARE".asInternalName()
private val TOTEM_OF_CORRUPTION = "TOTEM_OF_CORRUPTION".asInternalName()


@SubscribeEvent
Expand Down Expand Up @@ -192,13 +194,23 @@ object ItemAbilityCooldown {
event.soundName == "mob.zombie.remedy" && event.pitch == 1.8888888f && event.volume == 0.7f -> {
ItemAbility.TACTICAL_INSERTION.activate(null, 17_000)
}
// Totem of Corruption
event.soundName == "random.wood_click" && event.pitch == 0.84126985f && event.volume == 0.5f -> {
if (TOTEM_OF_CORRUPTION in recentItemsInHand) {
ItemAbility.TOTEM_OF_CORRUPTION.sound()
}
}
// Enrager
event.soundName == "mob.enderdragon.growl" && event.pitch == 0.4920635f && event.volume == 2.0f -> {
ItemAbility.ENRAGER.sound()
}

// Blaze Slayer Flares
event.soundName == "fireworks.launch" && event.pitch == 1.0f && event.volume == 3.0f -> {
val recent = InventoryUtils.recentItemsInHand.values
if (WARNING_FLARE in recent || ALERT_FLARE in recent) {
if (WARNING_FLARE in recentItemsInHand || ALERT_FLARE in recentItemsInHand) {
ItemAbility.ALERT_FLARE.sound()
}
if (SOS_FLARE in recent) {
if (SOS_FLARE in recentItemsInHand) {
ItemAbility.SOS_FLARE.sound()
}
}
Expand Down

0 comments on commit 9c1a844

Please sign in to comment.