From acc866dc2a5f1f55ea8307321e31f8f3a8742e5e Mon Sep 17 00:00:00 2001 From: Lorenz Date: Tue, 16 Aug 2022 23:11:13 +0200 Subject: add ashfang reset cooldown --- .../features/abilities/AshfangFreezeCooldown.kt | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/abilities/AshfangFreezeCooldown.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features/abilities') diff --git a/src/main/java/at/hannibal2/skyhanni/features/abilities/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/abilities/AshfangFreezeCooldown.kt deleted file mode 100644 index 5a5bdac0d..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/abilities/AshfangFreezeCooldown.kt +++ /dev/null @@ -1,43 +0,0 @@ -package at.hannibal2.skyhanni.features.abilities - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.utils.GuiRender.renderString -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex -import net.minecraftforge.client.event.RenderGameOverlayEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import java.text.DecimalFormat - -class AshfangFreezeCooldown { - - var lastHit = 0L - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!isEnabled()) return - - val message = event.message - if (message.matchRegex("§cAshfang Follower's Cryogenic Blast hit you for (.*) damage!")) { - lastHit = System.currentTimeMillis() - } - } - - @SubscribeEvent - fun renderOverlay(event: RenderGameOverlayEvent.Post) { - if (!isEnabled()) return - val duration = System.currentTimeMillis() - lastHit - val maxDuration = 3_000 - - val remainingLong = maxDuration - duration - if (remainingLong > 0) { - val remaining = (remainingLong.toFloat() / 1000) - val format = DecimalFormat("0.0").format(remaining + 0.1) - SkyHanniMod.feature.abilities.ashfangFreezeCooldownPos.renderString("§cAshfang Freeze: §a${format}s") - } - } - - private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.ashfangFreezeCooldown - } -} \ No newline at end of file -- cgit