Files
Bubberstation/code/datums/components/empprotection.dm
vuonojenmustaturska 1eccbcca18 Adds an EMP protection component, allowing ANYTHING to be protected from EMP (#37671)
The component is initialized with any combination of three flags, EMP_PROTECT_SELF protects against effects that target the object itself, EMP_PROTECT_WIRES protects against wires being messed with similar to the NO_EMP_WIRES_1 flag which this PR removes, EMP_PROTECT_CONTENTS protects against things that are inside the object like organs, internal "non-virtual" power cells and the like

This enables (but doesn't introduce) new mechanics such as adding EMP shielding at runtime to any atom, or taking it away.
2018-05-22 11:38:02 +12:00

12 lines
311 B
Plaintext

/datum/component/empprotection
var/flags = NONE
/datum/component/empprotection/Initialize(_flags)
if(!istype(parent, /atom))
return COMPONENT_INCOMPATIBLE
flags = _flags
RegisterSignal(list(COMSIG_ATOM_EMP_ACT), .proc/getEmpFlags)
/datum/component/empprotection/proc/getEmpFlags(severity)
return flags