From 6467ced4ad40b70b1b63946387a4ef62dd497023 Mon Sep 17 00:00:00 2001 From: CarsCupcake <84076092+CarsCupcake@users.noreply.github.com> Date: Sun, 25 Jun 2023 18:49:06 +0200 Subject: [PATCH] Added Twinclaw and Steak Stake alert (#395) --- .../kotlin/gg/skytils/skytilsmod/core/Config.kt | 14 ++++++++++++++ .../features/impl/misc/SlayerFeatures.kt | 17 ++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt b/src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt index 1e9f50886..9d02c9c3a 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt @@ -2492,6 +2492,20 @@ object Config : Vigilant( ) var attunementDisplay = false + @Property( + type = PropertyType.SWITCH, name = "Vampire Slayer One Shot Alert", + description = "Shows a title when you can one-shot the Vampire Slayer with Steak Stake", + category = "Slayer" + ) + var oneShotAlert = false + + @Property( + type = PropertyType.SWITCH, name = "Twinclaw Alert", + description = "Shows a title when the Vampire Slayer is about to do a Twinclaw attack", + category = "Slayer" + ) + var twinclawAlert = false + @Property( type = PropertyType.SWITCH, name = "Disable Cooldown Sounds", description = "Blocks the sound effect played while an item is on cooldown.", diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/SlayerFeatures.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/SlayerFeatures.kt index 22fd7d240..a257d8d04 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/SlayerFeatures.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/SlayerFeatures.kt @@ -25,6 +25,7 @@ import gg.essential.universal.UResolution import gg.skytils.skytilsmod.Skytils import gg.skytils.skytilsmod.Skytils.Companion.mc import gg.skytils.skytilsmod.Skytils.Companion.prefix +import gg.skytils.skytilsmod.core.Config import gg.skytils.skytilsmod.core.GuiManager import gg.skytils.skytilsmod.core.GuiManager.createTitle import gg.skytils.skytilsmod.core.SoundQueue @@ -136,7 +137,7 @@ object SlayerFeatures : CoroutineScope { is EntityBlaze -> DemonlordSlayer(entity) is EntityOtherPlayerMP -> { if (entity.name == "Bloodfiend ") { - Slayer(entity, "Riftstalker Bloodfiend", "§c☠ §4Bloodfiend") + BloodfiendSlayer(entity) } else null } @@ -1387,4 +1388,18 @@ object SlayerFeatures : CoroutineScope { } } } + + class BloodfiendSlayer(entity: EntityOtherPlayerMP) : + Slayer(entity, "Riftstalker Bloodfiend", "§c☠ §4Bloodfiend") { + override fun tick(event: ClientTickEvent) { + if (Config.oneShotAlert && this.nameEntity?.displayName?.unformattedText?.contains( + "҉" + ) == true + ) createTitle("§cSteak Stake!", 2) + else if (Config.twinclawAlert && this.timerEntity?.displayName?.unformattedText?.contains( + "TWINCLAWS" + ) == true + ) createTitle("§6§lTWINCLAWS!", 2) + } + } }