From e0f6fc1b4f0211a7bcdf42b5f579600889efd159 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Mon, 15 Aug 2022 12:55:49 +0200 Subject: changed damage indicator chat message, added toggle in config --- .../skyhanni/config/features/Inventory.java | 14 +++--- .../hannibal2/skyhanni/config/features/Misc.java | 18 +++++-- .../skyhanni/config/gui/commands/Commands.java | 2 +- .../damageindicator/BossDamageIndicator.kt | 56 ++++++++-------------- .../hannibal2/skyhanni/damageindicator/BossType.kt | 2 +- .../java/at/hannibal2/skyhanni/test/LorenzTest.kt | 6 +-- 6 files changed, 44 insertions(+), 54 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java index 884f245ea..d234145aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java @@ -15,43 +15,43 @@ public class Inventory { @Expose @ConfigOption(name = "Item number as stack size", desc = "") - @ConfigEditorAccordion(id = 2) + @ConfigEditorAccordion(id = 1) public boolean filterTypes = false; @Expose @ConfigOption(name = "Master Star Number", desc = "Show the Tier of the Master Star.") @ConfigEditorBoolean - @ConfigAccordionId(id = 2) + @ConfigAccordionId(id = 1) public boolean displayMasterStarNumber = false; @Expose @ConfigOption(name = "Master Skull Number", desc = "Show the tier of the Master Skull accessory.") @ConfigEditorBoolean - @ConfigAccordionId(id = 2) + @ConfigAccordionId(id = 1) public boolean displayMasterSkullNumber = false; @Expose @ConfigOption(name = "Dungeon Head Floor", desc = "Show the correct floor for golden and diamond heads.") @ConfigEditorBoolean - @ConfigAccordionId(id = 2) + @ConfigAccordionId(id = 1) public boolean displayDungeonHeadFloor = false; @Expose @ConfigOption(name = "New Year Cake", desc = "Show the Number of the Year of New Year Cakes.") @ConfigEditorBoolean - @ConfigAccordionId(id = 2) + @ConfigAccordionId(id = 1) public boolean displayNewYearCakeNumber = false; @Expose @ConfigOption(name = "Pet Level", desc = "Show the level of the pet when not maxed.") @ConfigEditorBoolean - @ConfigAccordionId(id = 2) + @ConfigAccordionId(id = 1) public boolean displayPetLevel = false; @Expose @ConfigOption(name = "Minion Tier", desc = "Show the Minion Tier over Items.") @ConfigEditorBoolean - @ConfigAccordionId(id = 2) + @ConfigAccordionId(id = 1) public boolean displayMinionTier = false; @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index a98f91a3e..5328ba1c1 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -1,18 +1,28 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.gui.core.config.Position; -import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorBoolean; -import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorButton; -import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.gui.core.config.annotations.*; import com.google.gson.annotations.Expose; public class Misc { @Expose - @ConfigOption(name = "Damage Indicator", desc = "Show the missing health of a boss in the dungeon, of slayer bosses and other bosses and the cooldown time until the boss becomes attackable.") + @ConfigOption(name = "Damage Indicator", desc = "") + @ConfigEditorAccordion(id = 1) + public boolean damageIndicatorInternal = false; + + @Expose + @ConfigOption(name = "Enabled", desc = "Show the missing health of a boss.") @ConfigEditorBoolean + @ConfigAccordionId(id = 1) public boolean damageIndicator = false; + @Expose + @ConfigOption(name = "Healing Chat Message", desc = "Sends a chat message when a boss heals himself.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 1) + public boolean damageIndicatorHealingMessage = false; + @Expose @ConfigOption(name = "Pet Display", desc = "Show the currently active pet.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/config/gui/commands/Commands.java b/src/main/java/at/hannibal2/skyhanni/config/gui/commands/Commands.java index fe3a6f791..411e5b14d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/gui/commands/Commands.java +++ b/src/main/java/at/hannibal2/skyhanni/config/gui/commands/Commands.java @@ -62,7 +62,7 @@ public class Commands { "testhanni", new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { - LorenzTest.Companion.testCommand(); + LorenzTest.Companion.testCommand(args); } } ) diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt index 6ce193280..85996919b 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt @@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.dungeon.DungeonData import at.hannibal2.skyhanni.events.DamageIndicatorFinalBossEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.misc.ScoreboardData -import at.hannibal2.skyhanni.test.LorenzTest import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth import net.minecraft.client.Minecraft @@ -89,7 +88,6 @@ class BossDamageIndicator { 6f ) - var bossName = data.bossType.bossName if (data.namePrefix.isNotEmpty()) { bossName = data.namePrefix + bossName @@ -98,15 +96,13 @@ class BossDamageIndicator { bossName += data.nameSuffix } - val scale2 = LorenzTest.b.toFloat() - val above = LorenzTest.a.toFloat() RenderUtils.drawLabel( pos, bossName, partialTicks, true, - scale2, - above + 3.9f, + -9.0f ) } GlStateManager.enableDepth() @@ -309,37 +305,11 @@ class BossDamageIndicator { else -> LorenzColor.RED } - if (data.containsKey(entity.uniqueID)) { - val lastHealth = data[entity.uniqueID]!!.lastHealth - val diff = lastHealth - health - if (diff != 0) { + if (SkyHanniMod.feature.misc.damageIndicatorHealingMessage) { + if (data.containsKey(entity.uniqueID)) { + val lastHealth = data[entity.uniqueID]!!.lastHealth val bossType = entityData.bossType - if (bossType == BossType.NETHER_ASHFANG) { - if (diff < 0) { - val oldHealth = lastHealth / 1_000_000 - val newHealth = health / 1_000_000 - LorenzUtils.chat("§e§lAshfang healing: ${oldHealth}M -> ${newHealth}M") - } - } else if (bossType == BossType.NETHER_BLADESOUL) { - if (diff < 0) { - val oldHealth = lastHealth / 1_000_000 - val newHealth = health / 1_000_000 - val oldFormat = NumberUtil.format(oldHealth) - val newFormat = NumberUtil.format(newHealth) - LorenzUtils.chat("§e§lBladesoul healing: §a+12.5m §e(${oldFormat}M -> ${newFormat}M)") - } - } else if (bossType == BossType.NETHER_BARBARIAN_DUKE) { - if (diff < 0) { - val oldHealth = lastHealth / 1_000_000 - val newHealth = health / 1_000_000 - val oldFormat = NumberUtil.format(oldHealth) - val newFormat = NumberUtil.format(newHealth) - LorenzUtils.chat("§e§lBarbarian Duke healing: §a+12.5m §e(${oldFormat}M -> ${newFormat}M)") - } - //TODO check for revive buffs -// } else { -// LorenzUtils.chat("$bossType diff: $diff") - } + checkHealed(health, lastHealth, bossType) } } @@ -354,6 +324,20 @@ class BossDamageIndicator { } } + private fun checkHealed(health: Int, lastHealth: Int, bossType: BossType) { + val healed = health - lastHealth + if (healed <= 0) return + + //Hide auto heal every 10 ticks + if (healed == 15_000 && bossType == BossType.HUB_REVENANT_HORROR) return + + val formatLastHealth = NumberUtil.format(lastHealth) + val formatHealth = NumberUtil.format(health) + val healedFormat = NumberUtil.format(healed) + println(bossType.bossName + " §fhealed for $healed❤ ($lastHealth -> $health)") + LorenzUtils.chat(bossType.bossName + " §ehealed for §a$healedFormat❤ §8(§e$formatLastHealth -> $formatHealth§8)") + } + private fun grabData(entity: EntityLivingBase): EntityData? { if (data.contains(entity.uniqueID)) return data[entity.uniqueID] diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt index ea6c61b4c..a913bbf4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt @@ -12,7 +12,7 @@ enum class BossType(val bossName: String) { NETHER_VANQUISHER("§5Vanquisher"), END_ENDSTONE_PROTECTOR("§cEndstone Protector"),//TODO add color - END_ENDERMAN_SLAYER("Voidgloom Seraph"), + END_ENDERMAN_SLAYER("Voidgloom Seraph"),//TODO use seperate enums per tier END_ENDER_DRAGON("Ender Dragon"),//TODO fix totally HUB_REVENANT_HORROR("§5Revenant Horror 5"),//TODO add other variants like voidgloom? diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index 271a97020..1b0864385 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -22,9 +22,6 @@ class LorenzTest { var enabled = false var text = "" - var a = -9.0 - var b = 3.9 - val debugLogger = LorenzLogger("debug/test") fun printLore() { @@ -97,8 +94,7 @@ class LorenzTest { LorenzDebug.log(text) } - fun testCommand() { - + fun testCommand(args: Array) { } } -- cgit