Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Twinclaw and Steak Stake alert #395

Merged
merged 16 commits into from
Jun 25, 2023
Merged
14 changes: 14 additions & 0 deletions src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -1387,4 +1388,18 @@ object SlayerFeatures : CoroutineScope {
}
}
}

class BloodfiendSlayer(entity: EntityOtherPlayerMP) :
Slayer<EntityOtherPlayerMP>(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)
}
}
}