mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 10:33:30 +01:00
Death alarms now use signals, and properly trigger on gibbing / dusting (#17277)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user