From 239ea855d2436a594ef9266d3289794a2c718c8d Mon Sep 17 00:00:00 2001 From: 1080pCat <96908085+1080pCat@users.noreply.github.com> Date: Fri, 8 Nov 2024 04:42:20 +1000 Subject: [PATCH] Death alarms have a SLIGHT cooldown on when they send another message (#27287) * Update bio_chip_death_alarm.dm * contra review --- .../objects/items/weapons/bio_chips/bio_chip_death_alarm.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/game/objects/items/weapons/bio_chips/bio_chip_death_alarm.dm b/code/game/objects/items/weapons/bio_chips/bio_chip_death_alarm.dm index fadfd8f4a5b..06905ac5738 100644 --- a/code/game/objects/items/weapons/bio_chips/bio_chip_death_alarm.dm +++ b/code/game/objects/items/weapons/bio_chips/bio_chip_death_alarm.dm @@ -8,6 +8,8 @@ var/mobname = "Unknown" var/static/list/stealth_areas = typecacheof(list(/area/syndicate_mothership, /area/shuttle/syndicate_elite)) + /// Tracking to prevent multiple EMPs in the same tick from flooding radio. + COOLDOWN_DECLARE(emp_spam_lock) /obj/item/bio_chip/death_alarm/implant(mob/target) . = ..() @@ -26,8 +28,11 @@ a.autosay("[mobname] has died-zzzzt in-in-in...", "[mobname]'s Death Alarm") qdel(src) if("emp") + if(!COOLDOWN_FINISHED(src, emp_spam_lock)) + return var/name = prob(50) ? t.name : pick(SSmapping.teleportlocs) a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm") + COOLDOWN_START(src, emp_spam_lock, 0.1 SECONDS) else if(is_type_in_typecache(t, stealth_areas)) //give the syndies a bit of stealth