mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 14:47:50 +01:00
[MIRROR] EMP & Wires refactor (#12658)
Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Guti
Cameron Lennox
parent
494fc9bea9
commit
b116cc450d
@@ -0,0 +1,20 @@
|
||||
/datum/element/empprotection
|
||||
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH_ON_HOST_DESTROY // Detach for turfs
|
||||
argument_hash_start_idx = 2
|
||||
var/flags = NONE
|
||||
|
||||
/datum/element/empprotection/Attach(datum/target, _flags)
|
||||
. = ..()
|
||||
if(. == ELEMENT_INCOMPATIBLE || !isatom(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
flags = _flags
|
||||
RegisterSignal(target, COMSIG_ATOM_PRE_EMP_ACT, PROC_REF(getEmpFlags))
|
||||
|
||||
/datum/element/empprotection/Detach(atom/target)
|
||||
UnregisterSignal(target, list(COMSIG_ATOM_PRE_EMP_ACT, COMSIG_ATOM_EXAMINE_TAGS))
|
||||
return ..()
|
||||
|
||||
/datum/element/empprotection/proc/getEmpFlags(datum/source, severity)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
return (flags & EMP_PROTECT_ALL)
|
||||
Reference in New Issue
Block a user