diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-08-07 03:11:52 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-08-07 03:11:52 +0200 |
commit | 0777fed3cc587191d12df20781e800be2411c7e4 (patch) | |
tree | 20791733d42869296679368e6f8f2c5a4e5a3316 /src/main/java/at | |
parent | 2a58daa96a090dc0ab9511ecc0afc476f6c55cb5 (diff) | |
download | skyhanni-0777fed3cc587191d12df20781e800be2411c7e4.tar.gz skyhanni-0777fed3cc587191d12df20781e800be2411c7e4.tar.bz2 skyhanni-0777fed3cc587191d12df20781e800be2411c7e4.zip |
reformat code
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt index 74a33049c..4978bd6d2 100644 --- a/src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt +++ b/src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt @@ -114,10 +114,25 @@ class BossDamageIndicator { checkFinalBoss(entityData.finalDungeonBoss, entity.entityId) } - var health = entity.health.toInt() + val biggestHealth = getMaxHealthFor(entity) + + val health = entity.health.toInt() val maxHealth: Int + + if (biggestHealth == 0) { + val currentMaxHealth = entity.baseMaxHealth.toInt() + maxHealth = max(currentMaxHealth, health) + setMaxHealth(entity, maxHealth) + } else { + maxHealth = biggestHealth + } + + var calcHealth = health + var calcMaxHealth = maxHealth + var extraPrefix = "" + if (DungeonData.isOneOf("F4")) { - val hitPoints = when (health) { + calcHealth = when (health) { 300_000 -> 4 222_000 -> 3 144_000 -> 2 @@ -127,12 +142,10 @@ class BossDamageIndicator { return } } - - health = hitPoints - maxHealth = 4 + calcMaxHealth = 4 //TODO add m4 support // } else if (DungeonData.isOneOf("M4")) { -// val hitPoints = when (health) { +// calcHealth = when (health) { // 300_000 -> 4 // 222_000 -> 3 // 144_000 -> 2 @@ -142,28 +155,12 @@ class BossDamageIndicator { // return // } // } - -// health = hitPoints -// maxHealth = 4 - } else { - val biggestHealth = getMaxHealthFor(entity) - - if (biggestHealth == 0) { - val currentMaxHealth = entity.baseMaxHealth.toInt() - maxHealth = max(currentMaxHealth, health) - setMaxHealth(entity, maxHealth) - } else { - maxHealth = biggestHealth - } +// calcMaxHealth = 4 } - var calcHealth = health - var calcMaxHealth = maxHealth - - - var extraPrefix = "" if (entityData.bossType == BossType.END_ENDERMAN_SLAYER) { + //custom prefix and health for the four different ender slayers when (maxHealth) { 300_000 -> { calcMaxHealth = 100_000 @@ -236,6 +233,8 @@ class BossDamageIndicator { } } + + //Hides the damage indicator when in hit phase or in laser phase if (entity is EntityEnderman) { var hidden = false if (entity.hasNameTagWith(0, 3, 0, " Hit")) { @@ -248,6 +247,20 @@ class BossDamageIndicator { } } + //See through blocks when the barbarian duke stands on the platform and the player is below + if (entityData.bossType == BossType.NETHER_BARBARIAN_DUKE) { + val location = entity.getLorenzVec() + val y = location.y + var ignoreBlocks = false + val distance = Minecraft.getMinecraft().thePlayer.getLorenzVec().distance(location) + if (distance < 10) { + if (y == 117.0) { + ignoreBlocks = true + } + } + entityData.ignoreBlocks = ignoreBlocks + } + val percentage = calcHealth.toDouble() / calcMaxHealth.toDouble() val color = when { percentage > 0.9 -> LorenzColor.DARK_GREEN @@ -291,19 +304,6 @@ class BossDamageIndicator { } } - if (entityData.bossType == BossType.NETHER_BARBARIAN_DUKE) { - val location = entity.getLorenzVec() - val y = location.y - var ignoreBlocks = false - val distance = Minecraft.getMinecraft().thePlayer.getLorenzVec().distance(location) - if (distance < 10) { - if (y == 117.0) { - ignoreBlocks = true - } - } - entityData.ignoreBlocks = ignoreBlocks - } - entityData.lastHealth = health entityData.text = extraPrefix + " " + NumberUtil.format(calcHealth) entityData.color = color |