[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
@@ -227,6 +227,9 @@
. += "Its shield matrix is at [round( (shield_health / max_shield_health) * 100, 0.01)]% strength."
/obj/item/shield_projector/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
adjust_health(-max_shield_health / severity) // A strong EMP will kill the shield instantly, but weaker ones won't on the first hit.
// Subtypes
@@ -81,6 +81,9 @@
return
/obj/machinery/shield/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
qdel(src)
@@ -257,6 +260,9 @@
return
/obj/machinery/shieldgen/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
src.health /= 2 //cut health in half
+4 -3
View File
@@ -215,9 +215,10 @@
// EMP. It may seem weak but keep in mind that multiple shield segments are likely to be affected.
/obj/effect/shield/emp_act(severity, recursive)
if(!disabled_for)
take_damage(rand(30,60) / severity, SHIELD_DAMTYPE_EM)
. = ..()
if (. & EMP_PROTECT_SELF || disabled_for)
return
take_damage(rand(30,60) / severity, SHIELD_DAMTYPE_EM)
// Explosions
/obj/effect/shield/ex_act(var/severity)
+1 -3
View File
@@ -8,7 +8,6 @@
icon_state = "generator0"
circuit = /obj/item/circuitboard/shield_generator
density = TRUE
var/datum/wires/shield_generator/wires = null
var/list/field_segments = list() // List of all shield segments owned by this generator.
var/list/damaged_segments = list() // List of shield segments that have failed and are currently regenerating.
var/shield_modes = 0 // Enabled shield mode flags
@@ -52,8 +51,7 @@
/obj/machinery/power/shield_generator/Initialize(mapload)
. = ..()
if(!wires)
wires = new(src)
set_wires(new /datum/wires/shield_generator(src))
default_apply_parts()
connect_to_network()