diff options
Diffstat (limited to 'src/main/java/at')
6 files changed, 54 insertions, 23 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt index c2701c61b..436132cd3 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt @@ -9,7 +9,7 @@ import com.google.gson.JsonPrimitive object ConfigUpdaterMigrator { val logger = LorenzLogger("ConfigMigration") - const val CONFIG_VERSION = 22 + const val CONFIG_VERSION = 23 fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? { if (chain.isEmpty()) return this if (this !is JsonObject) return null diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/combat/damageindicator/DamageIndicatorConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/combat/damageindicator/DamageIndicatorConfig.java index 69cae8a78..e7650b9eb 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/combat/damageindicator/DamageIndicatorConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/combat/damageindicator/DamageIndicatorConfig.java @@ -15,7 +15,6 @@ import java.util.List; import static at.hannibal2.skyhanni.config.features.combat.damageindicator.DamageIndicatorConfig.BossCategory.ARACHNE; import static at.hannibal2.skyhanni.config.features.combat.damageindicator.DamageIndicatorConfig.BossCategory.DIANA_MOBS; -import static at.hannibal2.skyhanni.config.features.combat.damageindicator.DamageIndicatorConfig.BossCategory.DUNGEON_ALL; import static at.hannibal2.skyhanni.config.features.combat.damageindicator.DamageIndicatorConfig.BossCategory.GARDEN_PESTS; import static at.hannibal2.skyhanni.config.features.combat.damageindicator.DamageIndicatorConfig.BossCategory.INFERNO_DEMONLORD; import static at.hannibal2.skyhanni.config.features.combat.damageindicator.DamageIndicatorConfig.BossCategory.NETHER_MINI_BOSSES; @@ -87,7 +86,6 @@ public class DamageIndicatorConfig { @ConfigEditorDraggableList() //TODO only show currently working and tested features public List<BossCategory> bossesToShow = new ArrayList<>(Arrays.asList( - DUNGEON_ALL, NETHER_MINI_BOSSES, VANQUISHER, REVENANT_HORROR, @@ -106,7 +104,6 @@ public class DamageIndicatorConfig { )); public enum BossCategory implements HasLegacyId { - DUNGEON_ALL("§bDungeon All", 0), NETHER_MINI_BOSSES("§bNether Mini Bosses", 1), VANQUISHER("§bVanquisher", 2), ENDERSTONE_PROTECTOR("§bEndstone Protector (not tested)", 3), @@ -157,6 +154,7 @@ public class DamageIndicatorConfig { return str; } } + @Expose @ConfigOption(name = "Hide Damage Splash", desc = "Hiding damage splashes near the damage indicator.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt index 11f16ae7f..4f5145a79 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt @@ -10,8 +10,6 @@ enum class BossType( val shortName: String = fullName, val showDeathTime: Boolean = false ) { - GENERIC_DUNGEON_BOSS("Generic Dungeon boss", Type.DUNGEON_ALL),//TODO split into different bosses - //Nether Mini Bosses NETHER_BLADESOUL("§8Bladesoul", Type.NETHER_MINI_BOSSES), NETHER_MAGMA_BOSS("§4Magma Boss", Type.NETHER_MINI_BOSSES), @@ -68,13 +66,26 @@ enum class BossType( HUB_HEADLESS_HORSEMAN("§6Headless Horseman", Type.HEADLESS_HORSEMAN), - DUNGEON_F1("", Type.DUNGEON_FLOOR_1), - DUNGEON_F2("", Type.DUNGEON_FLOOR_2), - DUNGEON_F3("", Type.DUNGEON_FLOOR_3), + + DUNGEON_F1_BONZO_FIRST("§cFunny Bonzo", Type.DUNGEON_FLOOR_1), + DUNGEON_F1_BONZO_SECOND("§cSad Bonzo", Type.DUNGEON_FLOOR_1), + + DUNGEON_F2_SUMMON("§eSummon", Type.DUNGEON_FLOOR_2), + DUNGEON_F2_SCARF("§cScarf", Type.DUNGEON_FLOOR_2), + + DUNGEON_F3_GUARDIAN("§eGuardian", Type.DUNGEON_FLOOR_3), + DUNGEON_F3_PROFESSOR_1("§cProfessor 1/2", Type.DUNGEON_FLOOR_3), + DUNGEON_F3_PROFESSOR_2("§cProfessor 2/2", Type.DUNGEON_FLOOR_3), + DUNGEON_F4_THORN("§cThorn", Type.DUNGEON_FLOOR_4), + DUNGEON_F5("§dLivid", Type.DUNGEON_FLOOR_5), - DUNGEON_F("", Type.DUNGEON_FLOOR_6), - DUNGEON_75("", Type.DUNGEON_FLOOR_7), + + DUNGEON_F6_GIANT("§eGiant", Type.DUNGEON_FLOOR_6), + DUNGEON_F6_SADAN("§cSadan", Type.DUNGEON_FLOOR_6), + + // TODO implement + DUNGEON_7("", Type.DUNGEON_FLOOR_7), MINOS_INQUISITOR("§5Minos Inquisitor", Type.DIANA_MOBS), MINOS_CHAMPION("§2Minos Champion", Type.DIANA_MOBS), diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt index 1b4f1fc32..9d20ee2b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt @@ -41,6 +41,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeUtils.format import at.hannibal2.skyhanni.utils.getLorenzVec +import com.google.gson.JsonArray import net.minecraft.client.Minecraft import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.client.renderer.GlStateManager @@ -885,6 +886,17 @@ class DamageIndicatorManager { event.transform(15, "combat.damageIndicator.bossName") { element -> ConfigUtils.migrateIntToEnum(element, NameVisibility::class.java) } + event.transform(23, "combat.damageIndicator.bossesToShow") { element -> + val result = JsonArray() + for (bossType in element as JsonArray) { + if (bossType.asString == "DUNGEON_ALL") continue + result.add(bossType) + } + + result + } + + } fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityResult.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityResult.kt index 2488b00ef..ab6db53cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityResult.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityResult.kt @@ -4,5 +4,5 @@ class EntityResult( val delayedStart: Long? = null, val ignoreBlocks: Boolean = false, val finalDungeonBoss: Boolean = false, - val bossType: BossType = BossType.GENERIC_DUNGEON_BOSS, + val bossType: BossType, ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt index e079dd76b..7a5407581 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt @@ -142,11 +142,11 @@ class MobFinder { private fun tryAddDungeonF1(entity: EntityLivingBase) = when { floor1bonzo1 && entity is EntityOtherPlayerMP && entity.name == "Bonzo " -> { - EntityResult(floor1bonzo1SpawnTime) + EntityResult(floor1bonzo1SpawnTime, bossType = BossType.DUNGEON_F1_BONZO_FIRST) } floor1bonzo2 && entity is EntityOtherPlayerMP && entity.name == "Bonzo " -> { - EntityResult(floor1bonzo2SpawnTime, finalDungeonBoss = true) + EntityResult(floor1bonzo2SpawnTime, bossType = BossType.DUNGEON_F1_BONZO_SECOND, finalDungeonBoss = true) } else -> null @@ -156,19 +156,23 @@ class MobFinder { if (entity.name == "Summon " && entity is EntityOtherPlayerMP) { if (floor2summons1 && !floor2summonsDiedOnce.contains(entity)) { if (entity.health.toInt() != 0) { - return EntityResult(floor2summons1SpawnTime) + return EntityResult(floor2summons1SpawnTime, bossType = BossType.DUNGEON_F2_SUMMON) } floor2summonsDiedOnce.add(entity) } if (floor2secondPhase) { - return EntityResult(floor2secondPhaseSpawnTime) + return EntityResult(floor2secondPhaseSpawnTime, bossType = BossType.DUNGEON_F2_SUMMON) } } if (floor2secondPhase && entity is EntityOtherPlayerMP) { //TODO only show scarf after (all/at least x) summons are dead? if (entity.name == "Scarf ") { - return EntityResult(floor2secondPhaseSpawnTime, finalDungeonBoss = true) + return EntityResult( + floor2secondPhaseSpawnTime, + finalDungeonBoss = true, + bossType = BossType.DUNGEON_F2_SCARF + ) } } return null @@ -182,22 +186,27 @@ class MobFinder { findGuardians() } if (guardians.contains(entity)) { - return EntityResult(floor3GuardianShieldSpawnTime, true) + return EntityResult(floor3GuardianShieldSpawnTime, true, bossType = BossType.DUNGEON_F3_GUARDIAN) } } if (floor3Professor && entity is EntityOtherPlayerMP && entity.name == "The Professor") { return EntityResult( floor3ProfessorSpawnTime, - floor3ProfessorSpawnTime + 1_000 > System.currentTimeMillis() + floor3ProfessorSpawnTime + 1_000 > System.currentTimeMillis(), + bossType = BossType.DUNGEON_F3_PROFESSOR_1 ) } if (floor3ProfessorGuardianPrepare && entity is EntityOtherPlayerMP && entity.name == "The Professor") { - return EntityResult(floor3ProfessorGuardianPrepareSpawnTime, true) + return EntityResult( + floor3ProfessorGuardianPrepareSpawnTime, + true, + bossType = BossType.DUNGEON_F3_PROFESSOR_2 + ) } if (entity is EntityGuardian && floor3ProfessorGuardian && entity == floor3ProfessorGuardianEntity) { - return EntityResult(finalDungeonBoss = true) + return EntityResult(finalDungeonBoss = true, bossType = BossType.DUNGEON_F3_PROFESSOR_2) } return null } @@ -230,12 +239,13 @@ class MobFinder { val extraDelay = checkExtraF6GiantsDelay(entity) return EntityResult( floor6GiantsSpawnTime + extraDelay, - floor6GiantsSpawnTime + extraDelay + 1_000 > System.currentTimeMillis() + floor6GiantsSpawnTime + extraDelay + 1_000 > System.currentTimeMillis(), + bossType = BossType.DUNGEON_F6_GIANT ) } if (floor6Sadan) { - return EntityResult(floor6SadanSpawnTime, finalDungeonBoss = true) + return EntityResult(floor6SadanSpawnTime, finalDungeonBoss = true, bossType = BossType.DUNGEON_F6_SADAN) } return null } |