diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-08-07 02:56:45 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-08-07 02:56:45 +0200 |
commit | 2a58daa96a090dc0ab9511ecc0afc476f6c55cb5 (patch) | |
tree | b9e37f6f52feff201923daaddcdde396e53dc7db /src/main/java/at | |
parent | c3e28b937f9cae03406459609edf22595e6dd732 (diff) | |
download | skyhanni-2a58daa96a090dc0ab9511ecc0afc476f6c55cb5.tar.gz skyhanni-2a58daa96a090dc0ab9511ecc0afc476f6c55cb5.tar.bz2 skyhanni-2a58daa96a090dc0ab9511ecc0afc476f6c55cb5.zip |
support for enderman slayer
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt | 93 |
1 files changed, 81 insertions, 12 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 313a24cc3..74a33049c 100644 --- a/src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt +++ b/src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/BossDamageIndicator.kt @@ -161,21 +161,90 @@ class BossDamageIndicator { var calcMaxHealth = maxHealth + var extraPrefix = "" + if (entityData.bossType == BossType.END_ENDERMAN_SLAYER) { - if (maxHealth == 66_666_666) { - calcMaxHealth = 22_222_222 - if (health > 44_444_444) { - calcHealth -= 44_444_444 - } else if (health > 22_222_222) { - calcHealth -= 22_222_222 - } else { - calcHealth = health + when (maxHealth) { + 300_000 -> { + calcMaxHealth = 100_000 + if (health > 200_000) { + calcHealth -= 200_000 + extraPrefix = "1/3" + } else if (health > 100_000) { + calcHealth -= 100_000 + extraPrefix = "2/3" + } else { + calcHealth = health + extraPrefix = "3/3" + } + } + 15_000_000 -> { + calcMaxHealth = 5_000_000 + if (health > 10_000_000) { + extraPrefix = "1/3" + calcHealth -= 10_000_000 + } else if (health > 5_000_000) { + calcHealth -= 5_000_000 + extraPrefix = "2/3" + } else { + calcHealth = health + extraPrefix = "3/3" + } + } + 66_666_666 -> { + calcMaxHealth = 22_222_222 + if (health > 44_444_444) { + calcHealth -= 44_444_444 + extraPrefix = "1/3" + } else if (health > 22_222_222) { + calcHealth -= 22_222_222 + extraPrefix = "2/3" + } else { + calcHealth = health + extraPrefix = "3/3" + } + + } + 300_000_000 -> { + calcMaxHealth = 50_000_000 + if (health > 250_000_000) { + calcHealth -= 250_000_000 + extraPrefix = "1/6" + } else if (health > 200_000_000) { + calcHealth -= 200_000_000 + extraPrefix = "2/6" + } else if (health > 150_000_000) { + calcHealth -= 150_000_000 + extraPrefix = "3/6" + } else if (health > 100_000_000) { + calcHealth -= 100_000_000 + extraPrefix = "4/6" + } else if (health > 50_000_000) { + calcHealth -= 50_000_000 + extraPrefix = "5/6" + } else { + calcHealth = health + extraPrefix = "6/6" + } + } + else -> { + //TODO this is a workaround, find a sweet solution pls? + if (!entityData.hidden) { + LorenzUtils.warning("§c[SkyHanni] Unknown max enderman health: $maxHealth") + entityData.hidden = true + } + } - } else { - println("maxHealth: $maxHealth") } if (entity is EntityEnderman) { - entityData.hidden = entity.hasNameTagWith(0, 3, 0, " Hits") + var hidden = false + if (entity.hasNameTagWith(0, 3, 0, " Hit")) { + hidden = true + } + if (entity.ridingEntity != null) { + hidden = true + } + entityData.hidden = hidden } } @@ -236,7 +305,7 @@ class BossDamageIndicator { } entityData.lastHealth = health - entityData.text = NumberUtil.format(calcHealth) + entityData.text = extraPrefix + " " + NumberUtil.format(calcHealth) entityData.color = color entityData.timeLastTick = System.currentTimeMillis() data[entity.uniqueID] = entityData |