mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-06 23:12:36 +00:00
* ONLY SKYRAT CHANGES * ACTUALLY SKYRAT CHANGES * yolo, revert later * Update alternate_byond_versions.txt Co-authored-by: AnturK <AnturK@users.noreply.github.com>
21 lines
756 B
Plaintext
21 lines
756 B
Plaintext
/// Attachable to items. Plays a bikehorn sound whenever attack_self is called (with a cooldown).
|
|
/datum/element/honkspam
|
|
|
|
/datum/element/honkspam/Attach(datum/target)
|
|
. = ..()
|
|
if(!isitem(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
RegisterSignal(target, COMSIG_ITEM_ATTACK_SELF, PROC_REF(interact))
|
|
|
|
/datum/element/honkspam/Detach(datum/source)
|
|
UnregisterSignal(source, COMSIG_ITEM_ATTACK_SELF)
|
|
return ..()
|
|
|
|
/datum/element/honkspam/proc/interact(obj/item/source, mob/user)
|
|
SIGNAL_HANDLER
|
|
if(HAS_TRAIT(source, TRAIT_HONKSPAMMING))
|
|
return
|
|
ADD_TRAIT(source, TRAIT_HONKSPAMMING, ELEMENT_TRAIT(type))
|
|
playsound(source.loc, 'sound/items/bikehorn.ogg', 50, TRUE)
|
|
addtimer(TRAIT_CALLBACK_REMOVE(source, TRAIT_HONKSPAMMING, ELEMENT_TRAIT(type)), 2 SECONDS)
|