From 5bb2a583b3c0a55960843c4261e239f4c61ede2e Mon Sep 17 00:00:00 2001 From: Lorenz Date: Mon, 15 Aug 2022 18:14:46 +0200 Subject: adding rev5 boom timer, not totally ready yet --- .../skyhanni/damageindicator/BossDamageIndicator.kt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt index 221741640..f0299a173 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt @@ -14,6 +14,7 @@ import net.minecraft.client.renderer.GlStateManager import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.monster.EntityEnderman import net.minecraft.entity.monster.EntityMagmaCube +import net.minecraft.entity.monster.EntityZombie import net.minecraft.util.Vec3 import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.event.entity.EntityJoinWorldEvent @@ -52,7 +53,8 @@ class BossDamageIndicator { val player = Minecraft.getMinecraft().thePlayer //TODO config to define between 100ms and 5 sec - for (uuid in data.filter { System.currentTimeMillis() > it.value.timeLastTick + if (it.value.dead) 3_000 else 100 }.map { it.key }) { + for (uuid in data.filter { System.currentTimeMillis() > it.value.timeLastTick + if (it.value.dead) 3_000 else 100 } + .map { it.key }) { data.remove(uuid) } @@ -317,7 +319,18 @@ class BossDamageIndicator { } } } -// } + if (entityData.bossType == BossType.SLAYER_ZOMBIE_5) { + if (entity is EntityZombie) { + entity.hasNameTagWith(3, "§fBoom!", consumer = { + val ticksAlive = entity.ticksExisted % (20 * 5) + val remainingTicks = (5 * 20).toLong() - ticksAlive + val format = formatDelay(remainingTicks * 50) +// entityData.nameSuffix = " §lBOOM - $format" + entityData.nameSuffix = " §lBOOM!" + }) + } + } + if (health == 0) { customHealthText = "§cDead" entityData.dead = true -- cgit