mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns Edit: Most left out ones are in mecha which should be done in mecha refactor already Oh my look how clean it is Co-authored-by: TiviPlus <TiviPlus> Co-authored-by: Couls <coul422@gmail.com>
24 lines
852 B
Plaintext
24 lines
852 B
Plaintext
// This used to be in paper.dm, it was some snowflake code that was
|
|
// used ONLY on april's fool. I moved it to a component so it could be
|
|
// used in other places
|
|
|
|
//This is copypasted on other obj so if you are readin this go refactor it, start on objs with var/limiting_spam
|
|
/datum/component/honkspam
|
|
dupe_mode = COMPONENT_DUPE_UNIQUE
|
|
var/limiting_spam = FALSE
|
|
|
|
/datum/component/honkspam/Initialize()
|
|
if(!isitem(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
RegisterSignal(parent, COMSIG_ITEM_ATTACK_SELF, .proc/interact)
|
|
|
|
/datum/component/honkspam/proc/reset_spamflag()
|
|
limiting_spam = FALSE
|
|
|
|
/datum/component/honkspam/proc/interact(mob/user)
|
|
if(!limiting_spam)
|
|
limiting_spam = TRUE
|
|
var/obj/item/parent_item = parent
|
|
playsound(parent_item.loc, 'sound/items/bikehorn.ogg', 50, TRUE)
|
|
addtimer(CALLBACK(src, .proc/reset_spamflag), 2 SECONDS)
|