From 9c1a84491382ce9ffc4bf94cc5ee24f35b58a2cf Mon Sep 17 00:00:00 2001 From: DungeonHub <177025031+DungeonHub@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:54:54 +0200 Subject: [PATCH] Improvement: Added Item Cooldown to Totem of Corruption and Enrager (#2706) --- .../abilitycooldown/ItemAbility.kt | 2 ++ .../abilitycooldown/ItemAbilityCooldown.kt | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt index 68f9798c309b..6bc24f055ada 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt @@ -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"), diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt index 830d823f6576..fb15bd703a44 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt @@ -55,12 +55,14 @@ object ItemAbilityCooldown { private var lastAbility = "" private var items = mapOf>() private var abilityItems = mapOf>() + 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 @@ -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() } }