Files
Bubberstation/code/datums/elements/empprotection.dm
SkyratBot 598952c1c2 [MIRROR] Refactors chameleon actions, Adds chameleon outfit saving, Adds chameleon scanner [MDB IGNORE] (#22773)
* Refactors chameleon actions, Adds chameleon outfit saving, Adds chameleon scanner

* Update cards_ids.dm

* Update _glasses.dm

* Delete chameleon.dm

* Update _glasses.dm

* Update _glasses.dm

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-07-29 21:09:06 -04:00

21 lines
615 B
Plaintext

/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, COMSIG_ATOM_PRE_EMP_ACT)
return ..()
/datum/element/empprotection/proc/getEmpFlags(datum/source, severity)
SIGNAL_HANDLER
return flags