Files
GoatandShadow-Quill 9b4fb094db Adds missing checks to cain & abel (#90777)
## About The Pull Request
cain and abel could be used while they were in your pocket and that was
a bit funny
## Why It's Good For The Game
i shouldn't be able to swing my daggers while they're shoved inside my
pocket
## Changelog
🆑 Goat
fix: Cain and Abel (the colossus drop) now require you to hold them to
be able to swing them around
/🆑
2025-04-29 18:23:24 -06:00

34 lines
1.3 KiB
Plaintext

/datum/action/cooldown/dagger_swing
name = "Dagger swing"
desc = "Swing your daggers around."
button_icon = 'icons/obj/mining_zones/artefacts.dmi'
button_icon_state = "cain_and_abel"
background_icon_state = "bg_default"
overlay_icon_state = "bg_default_border"
cooldown_time = 20 SECONDS
check_flags = AB_CHECK_INCAPACITATED | AB_CHECK_HANDS_BLOCKED | AB_CHECK_CONSCIOUS
/datum/action/cooldown/dagger_swing/Activate(atom/target_atom)
var/mob/living/living_owner = owner
var/obj/item/cain_and_abel = target
if(!living_owner.is_holding(cain_and_abel))
owner.balloon_alert(owner, "must be held")
return FALSE
living_owner.apply_status_effect(/datum/status_effect/dagger_swinging)
var/static/list/possible_sounds = list(
'sound/items/weapons/cain_and_abel/dagger_slash_1.ogg',
'sound/items/weapons/cain_and_abel/dagger_slash_2.ogg',
'sound/items/weapons/cain_and_abel/dagger_slash_3.ogg',
'sound/items/weapons/cain_and_abel/dagger_slash_4.ogg',
'sound/items/weapons/cain_and_abel/dagger_slash_5.ogg',
'sound/items/weapons/cain_and_abel/dagger_slash_6.ogg',
)
var/list/sounds_to_pick_from = possible_sounds.Copy()
for(var/index in 0 to 5)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound), owner, pick_n_take(sounds_to_pick_from), 65, TRUE), 0.15 SECONDS * index)
StartCooldown()