diff --git a/code/game/objects/items/weapons/implants/implant_death_alarm.dm b/code/game/objects/items/weapons/implants/implant_death_alarm.dm index 54a8ceb12f1..ee9390ed2a7 100644 --- a/code/game/objects/items/weapons/implants/implant_death_alarm.dm +++ b/code/game/objects/items/weapons/implants/implant_death_alarm.dm @@ -18,20 +18,10 @@ return dat /obj/item/implant/death_alarm/Destroy() - STOP_PROCESSING(SSobj, src) + UnregisterSignal(imp_in, COMSIG_MOB_DEATH) return ..() -/obj/item/implant/death_alarm/process() - if(!implanted) - return - var/mob/M = imp_in - - if(isnull(M)) // If the mob got gibbed - activate() - else if(M.stat == DEAD) - activate("death") - -/obj/item/implant/death_alarm/activate(cause) +/obj/item/implant/death_alarm/activate(cause) // Death signal sends name followed by the gibbed / not gibbed check var/mob/M = imp_in var/area/t = get_area(M) @@ -39,18 +29,18 @@ a.follow_target = M switch(cause) - if("death") - if(is_type_in_typecache(t, stealth_areas)) - //give the syndies a bit of stealth - a.autosay("[mobname] has died in Space!", "[mobname]'s Death Alarm") - else - a.autosay("[mobname] has died in [t.name]!", "[mobname]'s Death Alarm") + if("gib") + a.autosay("[mobname] has died-zzzzt in-in-in...", "[mobname]'s Death Alarm") qdel(src) if("emp") var/name = prob(50) ? t.name : pick(SSmapping.teleportlocs) a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm") else - a.autosay("[mobname] has died-zzzzt in-in-in...", "[mobname]'s Death Alarm") + if(is_type_in_typecache(t, stealth_areas)) + //give the syndies a bit of stealth + a.autosay("[mobname] has died in Space!", "[mobname]'s Death Alarm") + else + a.autosay("[mobname] has died in [t.name]!", "[mobname]'s Death Alarm") qdel(src) qdel(a) @@ -61,12 +51,18 @@ /obj/item/implant/death_alarm/implant(mob/target) if(..()) mobname = target.real_name - START_PROCESSING(SSobj, src) + RegisterSignal(target, COMSIG_MOB_DEATH, /obj/item/implant/death_alarm.proc/check_gibbed_activate) return 1 return 0 +/obj/item/implant/death_alarm/proc/check_gibbed_activate(datum/source, gibbed) + if(gibbed) + activate("gib") + else + activate("death") + /obj/item/implant/death_alarm/removed(mob/target) if(..()) - STOP_PROCESSING(SSobj, src) + UnregisterSignal(target, COMSIG_MOB_DEATH) return 1 return 0