Files
Bubberstation/code/datums/components/honkspam.dm
TiviPlus ca366c3ea1 Bools and returns super-pr (#53221)
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>
2020-08-28 14:26:37 -07:00

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)