diff options
| author | ronald <inglettronald@gmail.com> | 2023-07-29 00:13:53 -0500 |
|---|---|---|
| committer | ronald <inglettronald@gmail.com> | 2023-07-29 00:13:53 -0500 |
| commit | d3e13e38e22b8eecd5198c59cf6a132cc9425b33 (patch) | |
| tree | e70a8fdc86d00cf22a281fcde09b856f09b45a11 /src/main/kotlin/com/dulkirfabric/features/slayer | |
| parent | 71b8238eff91de0243e641c2eeadacd61b8f0f88 (diff) | |
| download | DulkirMod-Fabric-d3e13e38e22b8eecd5198c59cf6a132cc9425b33.tar.gz DulkirMod-Fabric-d3e13e38e22b8eecd5198c59cf6a132cc9425b33.tar.bz2 DulkirMod-Fabric-d3e13e38e22b8eecd5198c59cf6a132cc9425b33.zip | |
Lots of slayer backend and a smattering of random features (Lightning/fire culling, chat stacking improvements, aotv highlight stuff, etc)
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/features/slayer')
| -rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/slayer/Demonlord.kt | 43 | ||||
| -rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/slayer/MiniBossHighlight.kt | 26 |
2 files changed, 64 insertions, 5 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/slayer/Demonlord.kt b/src/main/kotlin/com/dulkirfabric/features/slayer/Demonlord.kt new file mode 100644 index 0000000..434c866 --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/slayer/Demonlord.kt @@ -0,0 +1,43 @@ +package com.dulkirfabric.features.slayer + +import com.dulkirfabric.DulkirModFabric.mc +import com.dulkirfabric.events.PlaySoundEvent +import com.dulkirfabric.events.WorldRenderLastEvent +import com.dulkirfabric.util.TablistUtils +import com.dulkirfabric.util.TextUtils +import com.dulkirfabric.util.Utils.debugSound +import com.dulkirfabric.util.Utils.getInterpolatedPos +import com.dulkirfabric.util.render.WorldRenderUtils +import meteordevelopment.orbit.EventHandler +import net.minecraft.entity.decoration.ArmorStandEntity +import net.minecraft.util.math.Box +import java.awt.Color + +object Demonlord { + private val phaseColors = listOf( + "CRYSTAL ♨" to Color(15, 247, 236, 255), + "ASHEN ♨" to Color(0, 0, 0, 255), + "AURIC ♨" to Color(206, 219, 57, 255), + "SPIRIT ♨" to Color(255, 255, 255, 255) + ) + private val box = Box(-.5, -.4, -.5, .5, -1.9, .5) + + @EventHandler + fun attunementHighlight(event: WorldRenderLastEvent) { + if (TablistUtils.persistentInfo.area != "Crimson Isle") return + val ents = mc.world?.entities ?: return + ents.forEach { ent -> + if (ent is ArmorStandEntity && ent.hasCustomName()) { + val name = TextUtils.stripColorCodes(ent.customName?.string ?: return@forEach) + val color = phaseColors.firstOrNull { name.contains(it.first) }?.second ?: return@forEach + val pos = ent.getInterpolatedPos(event.context.tickDelta()) + WorldRenderUtils.drawWireFrame( + event.context, + box.offset(pos.x, pos.y, pos.z), + color, + 8f + ) + } + } + } +}
\ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/features/slayer/MiniBossHighlight.kt b/src/main/kotlin/com/dulkirfabric/features/slayer/MiniBossHighlight.kt index 4720890..61c712a 100644 --- a/src/main/kotlin/com/dulkirfabric/features/slayer/MiniBossHighlight.kt +++ b/src/main/kotlin/com/dulkirfabric/features/slayer/MiniBossHighlight.kt @@ -1,24 +1,30 @@ package com.dulkirfabric.features.slayer import com.dulkirfabric.DulkirModFabric.mc +import com.dulkirfabric.config.DulkirConfig +import com.dulkirfabric.events.PlaySoundEvent import com.dulkirfabric.events.WorldRenderLastEvent import com.dulkirfabric.util.ScoreBoardUtils -import com.dulkirfabric.util.TextUtils import com.dulkirfabric.util.Utils.getInterpolatedPos +import com.dulkirfabric.util.render.HudRenderUtil import com.dulkirfabric.util.render.WorldRenderUtils import meteordevelopment.orbit.EventHandler import net.minecraft.entity.decoration.ArmorStandEntity +import net.minecraft.text.Style +import net.minecraft.text.Text +import net.minecraft.util.Formatting import net.minecraft.util.math.Box import java.awt.Color +import java.time.Duration object MiniBossHighlight { data class MiniBoss(val name: String, val box: Box) - private val zombieBox = Box(-.3, .1, -.3, .3, -1.9, .3) + private val zombieBox = Box(-.4, .1, -.4, .4, -1.9, .4) private val spiderBox = Box(-.7, -.3, -.7, .7, -1.2, .7) - private val wolfBox = Box(-.3, -0.0, -.3, .3, -.85, .3) - private val emanBox = Box(-.3, 0.0, -.3, .3, -2.9, .3) + private val wolfBox = Box(-.4, -0.0, -.4, .4, -.85, .4) + private val emanBox = Box(-.4, 0.0, -.4, .4, -2.9, .4) private val blazeBox = Box(-.4, -.2, -.4, .4, -2.0, .4) private val miniBosses = listOf( @@ -43,8 +49,8 @@ object MiniBossHighlight { @EventHandler fun drawMiniBossBoxes(event: WorldRenderLastEvent) { - // TODO: check for a slayer quest being active if (!ScoreBoardUtils.hasActiveSlayerQuest) return + if (!DulkirConfig.configOptions.boxMinis) return val ents = mc.world?.entities ?: return @@ -57,4 +63,14 @@ object MiniBossHighlight { } } + // TODO: fix + @EventHandler + fun onSound(event: PlaySoundEvent) { + if (!DulkirConfig.configOptions.announceMinis) return + if (event.sound.id.path != "entity.generic.explode") return + if (event.sound.pitch != 1.2857143f) return + if (event.sound.volume != .6f) return + HudRenderUtil.drawTitle(Text.literal("MiniBoss Spawned").setStyle(Style.EMPTY.withColor(Formatting.RED)), + Duration.ofMillis(1000)) + } }
\ No newline at end of file |
