Added ability to toggle bonecrusher function on blessed sickle

When using "cast bloom", the sickle will grow nearby fungus as usual. If no fungus are grown, it will instead toggle the bone crusher attribute.
This commit is contained in:
randy 2024-11-07 10:02:10 -07:00
parent 6305e2a718
commit 8094465579

View file

@ -85,10 +85,12 @@ object NSUtils {
fun castBloom(player: Player): Boolean{
var success = false
val region = forId(player.location.regionId)
/*
if (player.skills.prayerPoints < 1) {
player.packetDispatch.sendMessage("You don't have enough prayer points to do this.")
return false
}
*/
handleVisuals(player)
val locs = player.location.surroundingTiles
for (o in locs) {
@ -114,6 +116,17 @@ object NSUtils {
}
}
}
if (success) {
player.skills.decrementPrayerPoints(RandomFunction.random(1, 3).toDouble())
} else {
if (getAttribute(player, "bonecrusher:enabled", false)) {
setAttribute(player, "/save:bonecrusher:enabled",false)
player.packetDispatch.sendMessage("Automatic Bone Burial: Disabled.")
} else {
setAttribute(player, "/save:bonecrusher:enabled",true)
player.packetDispatch.sendMessage("Automatic Bone Burial: Enabled.")
}
}
return success
}
@ -122,7 +135,6 @@ object NSUtils {
* animation.
*/
private fun handleVisuals(player: Player) {
player.skills.decrementPrayerPoints(RandomFunction.random(1, 3).toDouble())
playAudio(player, Sounds.CAST_BLOOM_1493)
val AROUND_YOU = player.location.surroundingTiles
for (location in AROUND_YOU) {