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.
This commit is contained in:
vuonojenmustaturska
2018-05-22 02:38:02 +03:00
committed by yogstation13-bot
parent 5af3d4dcae
commit ddd4409133
97 changed files with 408 additions and 187 deletions

View File

@@ -489,9 +489,11 @@
choice.ask_for_input(user)
/obj/item/electronic_assembly/emp_act(severity)
..()
for(var/i in 1 to contents.len)
var/atom/movable/AM = contents[i]
. = ..()
if(. & EMP_PROTECT_CONTENTS)
return
for(var/I in src)
var/atom/movable/AM = I
AM.emp_act(severity)
// Returns true if power was successfully drawn.
@@ -742,4 +744,4 @@
if(EAST)
pixel_x = -31
if(WEST)
pixel_x = 31
pixel_x = 31