[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:
CHOMPStation2StaffMirrorBot
2026-04-11 16:14:18 -04:00
committed by GitHub
co-authored by Guti Cameron Lennox
parent 494fc9bea9
commit b116cc450d
148 changed files with 665 additions and 384 deletions
+20
View File
@@ -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)