diff options
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/features')
3 files changed, 126 insertions, 1 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt b/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt index dfae99b..85c1f7b 100644 --- a/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt +++ b/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt @@ -31,6 +31,7 @@ object BrokenHyp { // get info about held item val tag = stack.nbt ?: return id = tag.getCompound("ExtraAttributes")?.getString("id") ?: "" + kill = tag.getCompound("ExtraAttributes")?.getInt("stats_book") ?: -1 championXp = tag.getCompound("ExtraAttributes")?.getDouble("champion_combat_xp") ?: -1.0 diff --git a/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt b/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt index 9bdfa13..0476d51 100644 --- a/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt +++ b/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt @@ -7,6 +7,7 @@ import com.dulkirfabric.util.SoundInfo import com.dulkirfabric.util.TrackedCooldown import com.dulkirfabric.util.Utils import meteordevelopment.orbit.EventHandler +import net.minecraft.client.sound.Sound import net.minecraft.item.ItemStack import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable import kotlin.math.round @@ -24,9 +25,31 @@ object CooldownDisplays { Pair( SoundInfo("entity.firework_rocket.launch", 1f, 3f), TrackedCooldown("SOS_FLARE".toRegex(), 20000, 0) + ), + Pair( + SoundInfo("block.lever.click", 2f, .55f), + TrackedCooldown("RAGNAROCK_AXE".toRegex(), 20000, 0) + ), + Pair( + SoundInfo("entity.generic.drink", 1.7936507f, 1f), + TrackedCooldown("HOLY_ICE".toRegex(), 4000, 0) + ), + Pair( + SoundInfo("entity.wolf.howl", 1.5238096f, .5f), + TrackedCooldown("WEIRDER_TUBA".toRegex(), 20000, 0) + ), + Pair( + SoundInfo("block.lava.pop", 2f, .4f), + TrackedCooldown("ROGUE_SWORD".toRegex(), 30000, 0) + ), + Pair( + SoundInfo("block.anvil.land", 0.4920635f, 1f), + TrackedCooldown("GIANTS_SWORD".toRegex(), 30000, 0) ) ) + private var lastRagTick: Long = 0 + fun shouldDisplay(stack: ItemStack, cir: CallbackInfoReturnable<Boolean>) { val cooldown = fetchCooldownItem(stack) ?: return cir.returnValue = System.currentTimeMillis() - cooldown.lastUsage < cooldown.cooldownDuration @@ -39,13 +62,21 @@ object CooldownDisplays { @EventHandler fun onSound(event: PlaySoundEvent) { if (!DulkirConfig.configOptions.duraCooldown) return - // Utils.debugSound(event) val path = event.sound.id.path val pitch = event.sound.pitch val volume = event.sound.volume // Figure out if we have a match in trackedCooldowns val matchResult = trackedCooldowns[SoundInfo(path, pitch, volume)] ?: return + + if (matchResult.itemID matches "RAGNAROCK_AXE") { + if (System.currentTimeMillis() - lastRagTick < 5000) { + lastRagTick = System.currentTimeMillis() + return + } else { + lastRagTick = System.currentTimeMillis() + } + } matchResult.lastUsage = System.currentTimeMillis() } diff --git a/src/main/kotlin/com/dulkirfabric/features/slayer/Vampire.kt b/src/main/kotlin/com/dulkirfabric/features/slayer/Vampire.kt new file mode 100644 index 0000000..322d58a --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/slayer/Vampire.kt @@ -0,0 +1,93 @@ +package com.dulkirfabric.features.slayer + +import com.dulkirfabric.DulkirModFabric.mc +import com.dulkirfabric.config.DulkirConfig +import com.dulkirfabric.events.SlayerBossEvents +import com.dulkirfabric.events.WorldRenderLastEvent +import com.dulkirfabric.util.ScoreBoardUtils +import com.dulkirfabric.util.TablistUtils +import com.dulkirfabric.util.Utils.getInterpolatedPos +import com.dulkirfabric.util.Utils.getSkullTexture +import com.dulkirfabric.util.render.WorldRenderUtils +import meteordevelopment.orbit.EventHandler +import net.minecraft.block.entity.SkullBlockEntity +import net.minecraft.client.texture.PlayerSkinProvider +import net.minecraft.entity.EquipmentSlot +import net.minecraft.entity.decoration.ArmorStandEntity +import net.minecraft.item.Items +import net.minecraft.nbt.NbtHelper +import net.minecraft.util.math.Box +import java.awt.Color + +object Vampire { + + private const val char = "҉" + private const val ichorTexture = + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzAzNDA5MjNhNmRlNDgyNWExNzY4MTNkMTMzNTAzZWZmMTg2ZGIwODk2ZTMyYjY3MDQ5MjhjMmEyYmY2ODQyMiJ9fX0=" + private val box = Box(-.4, .1, -.4, .4, -1.9, .4) + private var inT5 = false + private val ichorBox = Box(- .5, 1.0, -.5, .5, 2.0, .5,) + + @EventHandler + fun steakDisplay(event: WorldRenderLastEvent) { + if (!DulkirConfig.configOptions.steakDisplay) return + if (TablistUtils.persistentInfo.area != "The Rift") return + + val ents = mc.world?.entities ?: return + ents.forEach { + if (it !is ArmorStandEntity || !it.hasCustomName()) return@forEach + if (!it.isMarker) return@forEach + if (!it.isCustomNameVisible) return@forEach + val name = it.customName?.string ?: return@forEach + if (name.contains(char) && name.contains("Bloodfiend")) { + val pos = it.getInterpolatedPos(mc.tickDelta) + WorldRenderUtils.drawWireFrame( + event.context, + box.offset(pos.x, pos.y, pos.z), + Color(0, 255, 255), + 8f + ) + } + } + } + + @EventHandler + fun ichorHighlight(event: WorldRenderLastEvent) { + if (!inT5) return + if (!DulkirConfig.configOptions.ichorHighlight) return + if (TablistUtils.persistentInfo.area != "The Rift") return + + val ents = mc.world?.entities ?: return + ents.forEach { + if (it !is ArmorStandEntity) return@forEach + val itemStack = it.getEquippedStack(EquipmentSlot.HEAD) ?: return@forEach + val item = itemStack.item ?: return@forEach + if (item !== Items.PLAYER_HEAD) return@forEach + val textureId = getSkullTexture(itemStack) ?: return@forEach + if (textureId != ichorTexture) return@forEach + val pos = it.getInterpolatedPos(mc.tickDelta) + WorldRenderUtils.drawWireFrame( + event.context, + ichorBox.offset(pos.x, pos.y, pos.z), + Color(0, 255, 255), + 8f, + ) + } + } + + @EventHandler + fun onSlayerStart(event: SlayerBossEvents.Spawn) { + if (ScoreBoardUtils.slayerType == "Riftstalker Bloodfiend V") + inT5 = true + } + + @EventHandler + fun onSlayerKill(event: SlayerBossEvents.Kill) { + inT5 = false + } + + @EventHandler + fun onSlayerFail(event: SlayerBossEvents.Fail) { + inT5 = false + } +}
\ No newline at end of file |