Turning a few components into elements. (#12325)
* Turning a few components into elements. * eh
This commit is contained in:
@@ -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
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user