mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-25 06:07:22 +01:00
[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:
co-authored by
Guti
Cameron Lennox
parent
494fc9bea9
commit
b116cc450d
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user