Turning a few components into elements. (#12325)

* Turning a few components into elements.

* eh
This commit is contained in:
Ghom
2020-05-24 22:06:27 +02:00
committed by GitHub
parent 02f467654e
commit ce1f1bdf5e
20 changed files with 116 additions and 100 deletions

View File

@@ -2,16 +2,17 @@
name = "modified gravity zone"
setup_field_turfs = TRUE
var/gravity_value = 0
var/list/grav_components = list()
var/list/modified_turfs = list()
field_shape = FIELD_SHAPE_RADIUS_SQUARE
/datum/proximity_monitor/advanced/gravity/setup_field_turf(turf/T)
. = ..()
grav_components[T] = T.AddComponent(/datum/component/forced_gravity,gravity_value)
T.AddElement(/datum/element/forced_gravity, gravity_value)
modified_turfs[T] = gravity_value
/datum/proximity_monitor/advanced/gravity/cleanup_field_turf(turf/T)
. = ..()
var/datum/component/forced_gravity/G = grav_components[T]
grav_components -= T
if(G)
qdel(G)
if(isnull(modified_turfs[T]))
return
T.RemoveElement(/datum/element/forced_gravity, modified_turfs[T])
modified_turfs -= T

View File

@@ -14,7 +14,7 @@
spark_system.attach(src)
wires = new /datum/wires/robot(src)
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
AddElement(/datum/element/empprotection, EMP_PROTECT_WIRES)
robot_modules_background = new()
robot_modules_background.icon_state = "block"

View File

@@ -317,7 +317,7 @@
/obj/item/stock_parts/cell/emproof/ComponentInitialize()
. = ..()
AddComponent(/datum/component/empprotection, EMP_PROTECT_SELF)
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF)
/obj/item/stock_parts/cell/emproof/empty
start_charged = FALSE

View File

@@ -75,7 +75,7 @@
/obj/machinery/power/emitter/ComponentInitialize()
. = ..()
AddComponent(/datum/component/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
/obj/machinery/power/emitter/RefreshParts()
var/max_firedelay = 120

View File

@@ -61,7 +61,7 @@ field_generator power level display
/obj/machinery/field/generator/ComponentInitialize()
. = ..()
AddComponent(/datum/component/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
/obj/machinery/field/generator/process()
if(active == FG_ONLINE)