mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-15 20:22:07 +00:00
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.
12 lines
311 B
Plaintext
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
|