diff options
Diffstat (limited to 'src')
6 files changed, 80 insertions, 5 deletions
diff --git a/src/main/kotlin/dulkirmod/DulkirMod.kt b/src/main/kotlin/dulkirmod/DulkirMod.kt index 1277de5..4ae84cc 100644 --- a/src/main/kotlin/dulkirmod/DulkirMod.kt +++ b/src/main/kotlin/dulkirmod/DulkirMod.kt @@ -6,6 +6,7 @@ import dulkirmod.events.ChatEvent import dulkirmod.features.* import dulkirmod.features.chat.AbiphoneDND import dulkirmod.features.dungeons.* +import dulkirmod.features.rift.EffigyWaypoint import dulkirmod.features.rift.IchorHighlight import dulkirmod.features.rift.SteakDisplay import dulkirmod.utils.* @@ -87,6 +88,7 @@ class DulkirMod { mcBus.register(ArcherHighlight) mcBus.register(ReaperDisplay) mcBus.register(ImpactDisplay) + mcBus.register(EffigyWaypoint) keyBinds.forEach(ClientRegistry::registerKeyBinding) } @@ -111,6 +113,7 @@ class DulkirMod { // the data structure on 1s cooldown TabListUtils.parseTabEntries() DragonFeatures.updateDragonDead() + EffigyWaypoint.checkEffigies() lastLongUpdate = currTime } diff --git a/src/main/kotlin/dulkirmod/config/DulkirConfig.kt b/src/main/kotlin/dulkirmod/config/DulkirConfig.kt index d8ac14c..a4aea6c 100644 --- a/src/main/kotlin/dulkirmod/config/DulkirConfig.kt +++ b/src/main/kotlin/dulkirmod/config/DulkirConfig.kt @@ -836,6 +836,14 @@ object DulkirConfig : Config(Mod("DulkirMod", ModType.SKYBLOCK), "dulkirmod-conf ) var ichorHighlight = false + @Switch( + name = "Inactive Effigy Waypoint", + description = "Useful for learning/remembering where the effigies are in relation to the scoreboard position", + category = "Rift", + subcategory = "Vamp Slayer" + ) + var effigyWaypoint = false + fun init() { initialize() diff --git a/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt b/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt index e7ae854..5e473ee 100644 --- a/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/ImpactDisplay.kt @@ -10,7 +10,8 @@ import kotlin.math.min object ImpactDisplay { - var lastImpact = 0L + private var lastImpact = 0L + private val bladeRegex = "(HYPERION|ASTRAEA|SCYLLA|VALKYRIE)".toRegex() fun shouldDisplay(stack: ItemStack, cir: CallbackInfoReturnable<Boolean>) { if (!isBlade(stack)) return @@ -43,7 +44,7 @@ object ImpactDisplay { val ea: NBTTagCompound = tag.getCompoundTag("ExtraAttributes") if (ea.hasKey("id", 8)) { val id = ea.getString("id") - return id matches "(HYPERION|ASTRAEA|SCYLLA|VALKYRIE)".toRegex() + return id matches bladeRegex } } } diff --git a/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt b/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt index 6d6489e..5d7207f 100644 --- a/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/ReaperDisplay.kt @@ -10,7 +10,8 @@ import kotlin.math.min object ReaperDisplay { - var lastReaperUsage = 0L + private var lastReaperUsage = 0L + private val reaperRegex = "(REAPER_CHESTPLATE)|(REAPER_LEGGINGS)|(REAPER_BOOTS)".toRegex() fun shouldDisplay(stack: ItemStack, cir: CallbackInfoReturnable<Boolean>) { if (!isReaper(stack)) return @@ -43,7 +44,7 @@ object ReaperDisplay { val ea: NBTTagCompound = tag.getCompoundTag("ExtraAttributes") if (ea.hasKey("id", 8)) { val id = ea.getString("id") - return id matches "(REAPER_CHESTPLATE)|(REAPER_LEGGINGS)|(REAPER_BOOTS)".toRegex() + return id matches reaperRegex } } } diff --git a/src/main/kotlin/dulkirmod/features/rift/EffigyWaypoint.kt b/src/main/kotlin/dulkirmod/features/rift/EffigyWaypoint.kt new file mode 100644 index 0000000..73155eb --- /dev/null +++ b/src/main/kotlin/dulkirmod/features/rift/EffigyWaypoint.kt @@ -0,0 +1,62 @@ +package dulkirmod.features.rift + +import dulkirmod.DulkirMod.Companion.mc +import dulkirmod.config.DulkirConfig +import dulkirmod.utils.* +import net.minecraft.util.Vec3 +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.math.max + +object EffigyWaypoint { + var effigyWaypoints = arrayOf( + Effigy(Vec3(150.5, 76.0, 95.5)), + Effigy(Vec3(193.5, 90.0, 119.5)), + Effigy(Vec3(235.5, 107.0, 147.5)), + Effigy(Vec3(294.5, 93.0, 134.5)), + Effigy(Vec3(240.5, 126.0, 118.5)), + Effigy(Vec3(262.5, 96.0, 94.5)) + ) + + private val c7OnlyRegex = Regex("[^c7]") + + @SubscribeEvent + fun onRender(event: RenderWorldLastEvent) { + // if we have any waypoints that need rendering, Do so. + val playerVec = mc.thePlayer.positionVector + for (effigy in effigyWaypoints) { + if (effigy.render) { + WorldRenderUtils.renderString(effigy.coords, "§6Inactive", false, + max(1f, playerVec.distanceTo(effigy.coords).toFloat()/10f), true + ) + } + } + } + + /** + * Run once per second to check scoreboard data and update our data struct + */ + fun checkEffigies() { + if (!DulkirConfig.effigyWaypoint) return + if (!Utils.isInSkyblock()) return + if (TabListUtils.area != "The Rift") return + val lines = ScoreBoardUtils.getLines() + if (lines.size <= 7) return + if (lines[3] != " §5ф §cStillgore\uD83D\uDC0D§c Château") return + val effigyStatusLine = lines[6].replace(c7OnlyRegex, "") + if (effigyStatusLine.length != 6) { + TextUtils.info("§6Something went wrong with Scoreboard parsing in Effigy Feature.") + TextUtils.info(" §6Turning off feature, please report to Dulkir.", prefix = false) + DulkirConfig.effigyWaypoint = false + return + } + for (i in 0..5) { + effigyWaypoints[i].render = (effigyStatusLine[i] == '7') + } + } + + /** + * data class for storing the effigy coordinates and whether they need to be rendered + */ + data class Effigy(val coords: Vec3, var render: Boolean = false) +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt index 171dc7a..cb0c035 100644 --- a/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt @@ -20,7 +20,7 @@ object SteakDisplay { if (event.entity is EntityArmorStand && event.entity.hasCustomName()) { val name = Utils.stripColorCodes(event.entity.customNameTag) val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z) - if (name.contains(char) && name.contains("Vampire Boss")) { + if (name.contains(char) && name.contains("Bloodfiend")) { WorldRenderUtils.drawCustomBox( x - .5, 1.0, |