diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 1506cd26129..3fcf79fe8d8 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -7,10 +7,9 @@ Pipelines and other atmospheric objects combine to form pipe_networks Pipes -> Pipelines Pipelines + Other Objects -> Pipe network - */ +GLOBAL_DATUM_INIT(pipe_icon_manager, /datum/pipe_icon_manager, new()) /obj/machinery/atmospherics - auto_init = 0 anchored = 1 layer = 2.4 //under wires with their 2.44 idle_power_usage = 0 @@ -29,15 +28,12 @@ Pipelines + Other Objects -> Pipe network var/pipe_color var/obj/item/pipe/stored var/image/pipe_image - var/global/datum/pipe_icon_manager/icon_manager /obj/machinery/atmospherics/New() if(!armor) armor = list(melee = 25, bullet = 10, laser = 10, energy = 100, bomb = 0, bio = 100, rad = 100) ..() SSair.atmos_machinery += src - if(!icon_manager) - icon_manager = new() if(!pipe_color) pipe_color = color @@ -45,12 +41,8 @@ Pipelines + Other Objects -> Pipe network if(!pipe_color_check(pipe_color)) pipe_color = null - // No need for a tween worldstart roundstart handler - pipenet creation is - // handled there - -/obj/machinery/atmospherics/initialize() - ..() +/obj/machinery/atmospherics/proc/atmos_init() if(can_unwrench) stored = new(src, make_from = src) @@ -73,9 +65,9 @@ Pipelines + Other Objects -> Pipe network pipe_image.plane = HUD_PLANE /obj/machinery/atmospherics/proc/check_icon_cache(var/safety = 0) - if(!istype(icon_manager)) + if(!istype(GLOB.pipe_icon_manager)) if(!safety) //to prevent infinite loops - icon_manager = new() + GLOB.pipe_icon_manager = new() check_icon_cache(1) return 0 @@ -91,14 +83,14 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) if(node) if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) - //underlays += icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node)) - underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type) + //underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node)) + underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type) else - //underlays += icon_manager.get_atmos_icon("underlay_intact", direction, color_cache_name(node)) - underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type) + //underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay_intact", direction, color_cache_name(node)) + underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type) else - //underlays += icon_manager.get_atmos_icon("underlay_exposed", direction, pipe_color) - underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "exposed" + icon_connect_type) + //underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay_exposed", direction, pipe_color) + underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "exposed" + icon_connect_type) /obj/machinery/atmospherics/proc/update_underlays() if(check_icon_cache()) @@ -231,10 +223,10 @@ Pipelines + Other Objects -> Pipe network var/turf/T = loc level = T.intact ? 2 : 1 add_fingerprint(usr) - initialize() + atmos_init() var/list/nodes = pipeline_expansion() for(var/obj/machinery/atmospherics/A in nodes) - A.initialize() + A.atmos_init() A.addMember(src) build_network() @@ -320,11 +312,11 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/add_underlay_adapter(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) //modified from add_underlay, does not make exposed underlays if(node) if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) - underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type) + underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type) else - underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type) + underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type) else - underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type) + underlays += GLOB.pipe_icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type) /obj/machinery/atmospherics/singularity_pull(S, current_size) if(current_size >= STAGE_FIVE) diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index 276ce5e7b6e..c11a0421bda 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -41,7 +41,7 @@ nullifyPipenet(parent2) return ..() -/obj/machinery/atmospherics/binary/initialize() +/obj/machinery/atmospherics/binary/atmos_init() ..() var/node2_connect = dir var/node1_connect = turn(dir, 180) diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index bfffb7cd35d..aebc09cfc7a 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -48,7 +48,7 @@ radio_connection = null return ..() -/obj/machinery/atmospherics/binary/dp_vent_pump/initialize() +/obj/machinery/atmospherics/binary/dp_vent_pump/atmos_init() ..() if(frequency) set_frequency(frequency) @@ -90,7 +90,7 @@ else vent_icon += "[on ? "[pump_direction ? "out" : "in"]" : "off"]" - overlays += icon_manager.get_atmos_icon("device", , , vent_icon) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("device", , , vent_icon) /obj/machinery/atmospherics/binary/dp_vent_pump/update_underlays() if(..()) diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index e43b052095b..9e845c15a98 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -16,7 +16,7 @@ var/id = null var/datum/radio_frequency/radio_connection -/obj/machinery/atmospherics/binary/passive_gate/initialize() +/obj/machinery/atmospherics/binary/passive_gate/atmos_init() ..() if(frequency) set_frequency(frequency) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index db0c7144324..118a70c3ecd 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -110,7 +110,7 @@ Thus, the two variables affect pump operation are set in New(): radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) return 1 -/obj/machinery/atmospherics/binary/pump/initialize() +/obj/machinery/atmospherics/binary/pump/atmos_init() ..() if(frequency) set_frequency(frequency) diff --git a/code/ATMOSPHERICS/components/binary_devices/valve.dm b/code/ATMOSPHERICS/components/binary_devices/valve.dm index 7b566e04fda..1d7805c55b2 100644 --- a/code/ATMOSPHERICS/components/binary_devices/valve.dm +++ b/code/ATMOSPHERICS/components/binary_devices/valve.dm @@ -109,7 +109,7 @@ if(frequency) radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA) -/obj/machinery/atmospherics/binary/valve/digital/initialize() +/obj/machinery/atmospherics/binary/valve/digital/atmos_init() ..() if(frequency) set_frequency(frequency) diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index c4dd8adeabb..a64c94e7fc5 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -38,7 +38,7 @@ Thus, the two variables affect pump operation are set in New(): on = 1 icon_state = "map_on" -/obj/machinery/atmospherics/binary/volume_pump/initialize() +/obj/machinery/atmospherics/binary/volume_pump/atmos_init() ..() set_frequency(frequency) diff --git a/code/ATMOSPHERICS/components/omni_devices/_omni_extras.dm b/code/ATMOSPHERICS/components/omni_devices/_omni_extras.dm index 1858b685ec0..a1f80916aee 100644 --- a/code/ATMOSPHERICS/components/omni_devices/_omni_extras.dm +++ b/code/ATMOSPHERICS/components/omni_devices/_omni_extras.dm @@ -40,9 +40,9 @@ /datum/omni_port/proc/connect() if(node) return - master.initialize() + master.atmos_init() if(node) - node.initialize() + node.atmos_init() node.addMember(master) master.build_network() diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index 086d2ff799f..0eed9729f87 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -56,7 +56,7 @@ nullifyPipenet(P.parent) return ..() -/obj/machinery/atmospherics/omni/initialize() +/obj/machinery/atmospherics/omni/atmos_init() ..() for(var/datum/omni_port/P in ports) if(P.node || P.mode == 0) @@ -143,11 +143,11 @@ //directional icons are layers 1-4, with the core icon on layer 5 if(core_icon) - overlays_off[5] = icon_manager.get_atmos_icon("omni", , , core_icon) - overlays_on[5] = icon_manager.get_atmos_icon("omni", , , core_icon + "_glow") + overlays_off[5] = GLOB.pipe_icon_manager.get_atmos_icon("omni", , , core_icon) + overlays_on[5] = GLOB.pipe_icon_manager.get_atmos_icon("omni", , , core_icon + "_glow") - overlays_error[1] = icon_manager.get_atmos_icon("omni", , , core_icon) - overlays_error[2] = icon_manager.get_atmos_icon("omni", , , "error") + overlays_error[1] = GLOB.pipe_icon_manager.get_atmos_icon("omni", , , core_icon) + overlays_error[2] = GLOB.pipe_icon_manager.get_atmos_icon("omni", , , "error") /obj/machinery/atmospherics/omni/proc/update_port_icons() if(!check_icon_cache()) @@ -203,19 +203,19 @@ ic_on += "_filter" ic_off += "_out" - ic_on = icon_manager.get_atmos_icon("omni", , , ic_on) - ic_off = icon_manager.get_atmos_icon("omni", , , ic_off) + ic_on = GLOB.pipe_icon_manager.get_atmos_icon("omni", , , ic_on) + ic_off = GLOB.pipe_icon_manager.get_atmos_icon("omni", , , ic_off) var/pipe_state var/turf/T = get_turf(src) if(!istype(T)) return if(T.intact && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 ) - //pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node)) - pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down") + //pipe_state = GLOB.pipe_icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node)) + pipe_state = GLOB.pipe_icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down") else - //pipe_state = icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node)) - pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "intact") + //pipe_state = GLOB.pipe_icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node)) + pipe_state = GLOB.pipe_icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "intact") return list("on_icon" = ic_on, "off_icon" = ic_off, "pipe_icon" = pipe_state) diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 427c77e8246..903f917e0c6 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -149,7 +149,7 @@ Filter types: return 1 -/obj/machinery/atmospherics/trinary/filter/initialize() +/obj/machinery/atmospherics/trinary/filter/atmos_init() set_frequency(frequency) ..() diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 187b308fa3c..e750256b0df 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -66,7 +66,7 @@ nullifyPipenet(parent3) return ..() -/obj/machinery/atmospherics/trinary/initialize() +/obj/machinery/atmospherics/trinary/atmos_init() ..() //Mixer: //1 and 2 is input diff --git a/code/ATMOSPHERICS/components/trinary_devices/tvalve.dm b/code/ATMOSPHERICS/components/trinary_devices/tvalve.dm index ad9561fbf1d..9dddf8b06f4 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/tvalve.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/tvalve.dm @@ -156,7 +156,7 @@ if(frequency) radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA) -/obj/machinery/atmospherics/trinary/tvalve/digital/initialize() +/obj/machinery/atmospherics/trinary/tvalve/digital/atmos_init() ..() if(frequency) set_frequency(frequency) diff --git a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm index 496413c881c..58b374578df 100644 --- a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm @@ -20,7 +20,7 @@ return -/obj/machinery/atmospherics/unary/heat_exchanger/initialize() +/obj/machinery/atmospherics/unary/heat_exchanger/atmos_init() if(!partner) var/partner_connect = turn(dir,180) diff --git a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm index 6028346df6d..fe5b6a0a445 100644 --- a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm @@ -120,7 +120,7 @@ return 1 -/obj/machinery/atmospherics/unary/outlet_injector/initialize() +/obj/machinery/atmospherics/unary/outlet_injector/atmos_init() ..() set_frequency(frequency) diff --git a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm index 51b12d39481..4ef7743fc8c 100644 --- a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm @@ -22,7 +22,7 @@ nullifyPipenet(parent) return ..() -/obj/machinery/atmospherics/unary/initialize() +/obj/machinery/atmospherics/unary/atmos_init() ..() for(var/obj/machinery/atmospherics/target in get_step(src, dir)) if(target.initialize_directions & get_dir(target,src)) @@ -43,9 +43,9 @@ node.disconnect(src) node = null nullifyPipenet(parent) - initialize() + atmos_init() if(node) - node.initialize() + node.atmos_init() node.addMember(src) build_network() . = 1 diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm index 8f76e689eae..99eeb1883ea 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm @@ -98,7 +98,7 @@ else vent_icon += "[on ? "[pump_direction ? "out" : "in"]" : "off"]" - overlays += icon_manager.get_atmos_icon("device", , , vent_icon) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("device", , , vent_icon) update_pipe_image() @@ -223,7 +223,7 @@ return 1 -/obj/machinery/atmospherics/unary/vent_pump/initialize() +/obj/machinery/atmospherics/unary/vent_pump/atmos_init() ..() //some vents work his own special way diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm index 530dbe1d952..11b1fc0f920 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm @@ -109,7 +109,7 @@ if(welded) scrubber_icon = "scrubberweld" - overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("device", , , scrubber_icon) update_pipe_image() /obj/machinery/atmospherics/unary/vent_scrubber/update_underlays() @@ -169,7 +169,7 @@ return 1 -/obj/machinery/atmospherics/unary/vent_scrubber/initialize() +/obj/machinery/atmospherics/unary/vent_scrubber/atmos_init() ..() radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index 0692bf44efd..b4a0cd9ba7b 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -57,11 +57,7 @@ var/pipenetwarnings = 10 if(!members.Find(item)) if(item.parent) - if(pipenetwarnings > 0) - error("[item.type] added to a pipenet while still having one (pipes leading to the same spot stacking in one turf). Nearby: [item.x], [item.y], [item.z].") - pipenetwarnings -= 1 - if(pipenetwarnings == 0) - error("Further messages about pipenets will be suppressed.") + log_runtime(EXCEPTION("[item.type] \[\ref[item]] added to a pipenet while still having one ([item.parent]) (pipes leading to the same spot stacking in one turf). Nearby: [item.x], [item.y], [item.z].")) members += item possible_expansions += item @@ -118,15 +114,12 @@ var/pipenetwarnings = 10 qdel(E) /obj/machinery/atmospherics/proc/addMember(obj/machinery/atmospherics/A) - return + var/datum/pipeline/P = returnPipenet(A) + P.addMember(A, src) /obj/machinery/atmospherics/pipe/addMember(obj/machinery/atmospherics/A) parent.addMember(A, src) -/obj/machinery/atmospherics/addMember(obj/machinery/atmospherics/A) - var/datum/pipeline/P = returnPipenet(A) - P.addMember(A, src) - /datum/pipeline/proc/temporarily_store_air() //Update individual gas_mixtures by volume ratio diff --git a/code/ATMOSPHERICS/pipes/cap.dm b/code/ATMOSPHERICS/pipes/cap.dm index 7691b157857..2552f6e0794 100644 --- a/code/ATMOSPHERICS/pipes/cap.dm +++ b/code/ATMOSPHERICS/pipes/cap.dm @@ -61,9 +61,9 @@ alpha = 255 overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type) -/obj/machinery/atmospherics/pipe/cap/initialize() +/obj/machinery/atmospherics/pipe/cap/atmos_init() ..() for(var/obj/machinery/atmospherics/target in get_step(src, dir)) if(target.initialize_directions & get_dir(target,src)) diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index a42903bb7f6..199942e7a40 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -32,7 +32,7 @@ if(WEST) initialize_directions = NORTH|EAST|SOUTH -/obj/machinery/atmospherics/pipe/manifold/initialize() +/obj/machinery/atmospherics/pipe/manifold/atmos_init() ..() for(var/D in cardinal) if(D == dir) @@ -122,8 +122,8 @@ alpha = 255 overlays.Cut() - overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type) - overlays += icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type) underlays.Cut() var/turf/T = get_turf(src) diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index 46b883db62b..502795e1da9 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -95,8 +95,8 @@ alpha = 255 overlays.Cut() - overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type) - overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type) underlays.Cut() var/turf/T = get_turf(src) @@ -134,7 +134,7 @@ if(level == 1 && istype(loc, /turf/simulated)) invisibility = i ? 101 : 0 -/obj/machinery/atmospherics/pipe/manifold4w/initialize() +/obj/machinery/atmospherics/pipe/manifold4w/atmos_init() ..() for(var/D in cardinal) for(var/obj/machinery/atmospherics/target in get_step(src, D)) diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm index 9f360f74274..b2c2750a452 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm @@ -43,7 +43,7 @@ if(SOUTHWEST) initialize_directions = SOUTH|WEST -/obj/machinery/atmospherics/pipe/simple/initialize(initPipe = 1) +/obj/machinery/atmospherics/pipe/simple/atmos_init(initPipe = 1) ..() if(initPipe) normalize_dir() @@ -145,9 +145,9 @@ overlays.Cut() if(node1 && node2) - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type) else - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "exposed[node1?1:0][node2?1:0]" + icon_connect_type) + overlays += GLOB.pipe_icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "exposed[node1?1:0][node2?1:0]" + icon_connect_type) // A check to make sure both nodes exist - self-delete if they aren't present /obj/machinery/atmospherics/pipe/simple/check_nodes_exist() diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm index 26139b40606..cb7ec277f95 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm @@ -61,7 +61,7 @@ initialize_directions_he = initialize_directions // The auto-detection from /pipe is good enough for a simple HE pipe color = "#404040" -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/initialize(initPipe = 1) +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/atmos_init(initPipe = 1) ..(0) if(initPipe) normalize_dir() @@ -110,7 +110,7 @@ initialize_directions = EAST initialize_directions_he = WEST -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/initialize() +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/atmos_init() ..(0) for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions)) if(target.initialize_directions & get_dir(target,src)) diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm index db62f8e51fe..3efd22ed446 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm @@ -34,7 +34,7 @@ alpha = 255 overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + overlays += GLOB.pipe_icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") underlays.Cut() if(node1) diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm index 1fcb45e7959..9bf085b534a 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm @@ -45,7 +45,7 @@ alpha = 255 overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + overlays += GLOB.pipe_icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") underlays.Cut() if(node1) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index b58ea20dbae..b283edb6540 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1928,4 +1928,7 @@ var/mob/dview/dview_mob = new CRASH(msg) /datum/proc/stack_trace(msg) - CRASH(msg) \ No newline at end of file + CRASH(msg) + +/proc/pass() + return \ No newline at end of file diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 0cc712799c7..5a025702877 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -1,5 +1,5 @@ var/global/list/portals = list() //for use by portals -var/global/list/cable_list = list() //Index for all cables, so that powernets don't have to look through the entire world all the time +GLOBAL_LIST(cable_list) //Index for all cables, so that powernets don't have to look through the entire world all the time var/global/list/chemical_reactions_list //list of all /datum/chemical_reaction datums. Used during chemical reactions var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff var/global/list/landmarks_list = list() //list of all landmarks created @@ -17,7 +17,6 @@ var/global/list/cell_logs = list() var/global/list/all_areas = list() var/global/list/machines = list() -var/global/list/machine_processing = list() var/global/list/fast_processing = list() var/global/list/processing_power_items = list() //items that ask to be called every cycle var/global/list/rcd_list = list() //list of Rapid Construction Devices. diff --git a/code/_globalvars/station.dm b/code/_globalvars/station.dm index 6d2578e5b88..d9e53d96834 100644 --- a/code/_globalvars/station.dm +++ b/code/_globalvars/station.dm @@ -3,9 +3,6 @@ var/global/datum/datacore/data_core = null var/CELLRATE = 0.002 // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) var/CHARGELEVEL = 0.001 // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) -var/list/powernets = list() -var/list/deferred_powernet_rebuilds = list() - // this is not strictly unused although the whole modules datum thing is unused // To remove this you need to remove that var/datum/moduletypes/mods = new() diff --git a/code/controllers/Processes/machinery.dm b/code/controllers/Processes/machinery.dm deleted file mode 100644 index 2466f802740..00000000000 --- a/code/controllers/Processes/machinery.dm +++ /dev/null @@ -1,74 +0,0 @@ -/var/global/machinery_sort_required = 0 - -/datum/controller/process/machinery/setup() - name = "machinery" - schedule_interval = 20 // every 2 seconds - start_delay = 12 - -/datum/controller/process/machinery/statProcess() - ..() - stat(null, "[machine_processing.len] machines") - stat(null, "[powernets.len] powernets, [deferred_powernet_rebuilds.len] deferred") - -/datum/controller/process/machinery/doWork() - process_sort() - process_power() - process_power_drain() - process_machines() - -/datum/controller/process/machinery/proc/process_sort() - if(machinery_sort_required) - machinery_sort_required = 0 - machine_processing = dd_sortedObjectList(machine_processing) - -/datum/controller/process/machinery/proc/process_machines() - for(last_object in machine_processing) - var/obj/machinery/M = last_object - if(istype(M) && !QDELETED(M)) - try - if(M.process() == PROCESS_KILL) - machine_processing.Remove(M) - continue - - if(M.use_power) - M.auto_use_power() - catch(var/exception/e) - catchException(e, M) - else - catchBadType(M) - machine_processing -= M - - SCHECK - -/datum/controller/process/machinery/proc/process_power() - for(last_object in deferred_powernet_rebuilds) - var/obj/O = last_object - if(istype(O) && !QDELETED(O)) - try - var/datum/powernet/newPN = new()// creates a new powernet... - propagate_network(O, newPN)//... and propagates it to the other side of the cable - catch(var/exception/e) - catchException(e, O) - SCHECK - else - catchBadType(O) - deferred_powernet_rebuilds -= O - - for(last_object in powernets) - var/datum/powernet/powerNetwork = last_object - if(istype(powerNetwork) && !QDELETED(powerNetwork)) - try - powerNetwork.reset() - catch(var/exception/e) - catchException(e, powerNetwork) - SCHECK - else - catchBadType(powerNetwork) - powernets -= powerNetwork - -/datum/controller/process/machinery/proc/process_power_drain() - // Currently only used by powersinks. These items get priority processed before machinery - for(var/obj/item/I in processing_power_items) - if(!I.pwr_drain()) // 0 = Process Kill, remove from processing list. - processing_power_items.Remove(I) - SCHECK diff --git a/code/controllers/Processes/mob.dm b/code/controllers/Processes/mob.dm deleted file mode 100644 index 2b11eff99be..00000000000 --- a/code/controllers/Processes/mob.dm +++ /dev/null @@ -1,35 +0,0 @@ -var/global/datum/controller/process/mob/mob_master - -/datum/controller/process/mob - var/current_cycle - -/datum/controller/process/mob/setup() - name = "mob" - schedule_interval = 20 // every 2 seconds - start_delay = 16 - log_startup_progress("Mob ticker starting up.") - -/datum/controller/process/mob/started() - ..() - if(!mob_list) - mob_list = list() - -/datum/controller/process/mob/statProcess() - ..() - stat(null, "[mob_list.len] mobs") - -/datum/controller/process/mob/doWork() - for(last_object in mob_list) - var/mob/M = last_object - if(istype(M) && !QDELETED(M)) - try - M.Life() - catch(var/exception/e) - catchException(e, M) - SCHECK - else - catchBadType(M) - mob_list -= M - current_cycle++ - -DECLARE_GLOBAL_CONTROLLER(mob, mob_master) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 3b5e4a6e707..9cb84f26aa5 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -62,7 +62,6 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/static/current_ticklimit = TICK_LIMIT_RUNNING /datum/controller/master/New() - makeDatumRefLists() //temporary file used to record errors with loading config, moved to log directory once logging is set up GLOB.config_error_log = GLOB.world_game_log = GLOB.world_runtime_log = "data/logs/config_error.log" load_configuration() diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 11cd37343fe..7606149c39d 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -56,8 +56,7 @@ var/global/pipe_processing_killed = 0 space_manager.do_transition_setup() - setup_objects() - setupgenetics() + setup_asset_cache() setupfactions() setup_economy() @@ -66,20 +65,8 @@ var/global/pipe_processing_killed = 0 populate_spawn_points() -/datum/controller/game_controller/proc/setup_objects() +/datum/controller/game_controller/proc/setup_asset_cache() var/watch = start_watch() - var/count = 0 - var/overwatch = start_watch() // Overall. - log_startup_progress("Populating asset cache...") populate_asset_cache() - log_startup_progress(" Populated [asset_cache.len] assets in [stop_watch(watch)]s.") - - watch = start_watch() - log_startup_progress("Initializing objects...") - for(var/atom/movable/object in world) - object.initialize() - count++ - log_startup_progress(" Initialized [count] objects in [stop_watch(watch)]s.") - - log_startup_progress("Finished object initializations in [stop_watch(overwatch)]s.") + log_startup_progress(" Populated [asset_cache.len] assets in [stop_watch(watch)]s.") \ No newline at end of file diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 4b1d59fa82e..b2b0e63d99b 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -171,7 +171,7 @@ statclick = new/obj/effect/statclick/debug(src, "Initializing...") if(can_fire && !(SS_NO_FIRE & flags)) - msg = "[round(cost, 1)]ms|[round(tick_usage, 1)]%([round(tick_overrun, 1)]%)|[round(ticks, 0.1)]\t[msg]" + msg = "[round(cost, 1)]ms | [round(tick_usage, 1)]%([round(tick_overrun, 1)]%) | [round(ticks, 0.1)]\t[msg]" else msg = "OFFLINE\t[msg]" diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index bf791e61519..4c2774d58db 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -320,15 +320,15 @@ SUBSYSTEM_DEF(air) var/watch = start_watch() var/count = 0 log_startup_progress("Initializing atmospherics machinery...") - for(var/obj/machinery/atmospherics/unary/U in machines) - if(istype(U, /obj/machinery/atmospherics/unary/vent_pump)) - var/obj/machinery/atmospherics/unary/vent_pump/T = U + for(var/obj/machinery/atmospherics/A in machines) + A.atmos_init() + count++ + if(istype(A, /obj/machinery/atmospherics/unary/vent_pump)) + var/obj/machinery/atmospherics/unary/vent_pump/T = A T.broadcast_status() - count++ - else if(istype(U, /obj/machinery/atmospherics/unary/vent_scrubber)) - var/obj/machinery/atmospherics/unary/vent_scrubber/T = U + else if(istype(A, /obj/machinery/atmospherics/unary/vent_scrubber)) + var/obj/machinery/atmospherics/unary/vent_scrubber/T = A T.broadcast_status() - count++ log_startup_progress(" Initialized [count] atmospherics machines in [stop_watch(watch)]s.") //this can't be done with setup_atmos_machinery() because @@ -341,7 +341,7 @@ SUBSYSTEM_DEF(air) for(var/obj/machinery/atmospherics/machine in machines) machine.build_network() count++ - log_startup_progress(" Initialized [count] pipes in [stop_watch(watch)]s.") + log_startup_progress(" Initialized [count] pipenets in [stop_watch(watch)]s.") /datum/controller/subsystem/air/proc/setup_overlays() plmaster = new /obj/effect/overlay() diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm new file mode 100644 index 00000000000..c3943ea9163 --- /dev/null +++ b/code/controllers/subsystem/atoms.dm @@ -0,0 +1,120 @@ +#define BAD_INIT_QDEL_BEFORE 1 +#define BAD_INIT_DIDNT_INIT 2 +#define BAD_INIT_SLEPT 4 +#define BAD_INIT_NO_HINT 8 + +SUBSYSTEM_DEF(atoms) + name = "Atoms" + init_order = INIT_ORDER_ATOMS + flags = SS_NO_FIRE + + var/old_initialized + + var/list/late_loaders + var/list/created_atoms + + var/list/BadInitializeCalls = list() + + +/datum/controller/subsystem/atoms/Initialize(timeofday) + setupgenetics() + initialized = INITIALIZATION_INNEW_MAPLOAD + InitializeAtoms() + + + +/datum/controller/subsystem/atoms/proc/InitializeAtoms(list/atoms) + if(initialized == INITIALIZATION_INSSATOMS) + return + + initialized = INITIALIZATION_INNEW_MAPLOAD + + LAZYINITLIST(late_loaders) + + var/watch = start_watch() + log_startup_progress("Initializing atoms...") + var/count + var/list/mapload_arg = list(TRUE) + if(atoms) + created_atoms = list() + count = atoms.len + for(var/I in atoms) + var/atom/A = I + if(!A.initialized) + if(InitAtom(I, mapload_arg)) + atoms -= I + CHECK_TICK + else + count = 0 + for(var/atom/A in world) + if(!A.initialized) + InitAtom(A, mapload_arg) + ++count + CHECK_TICK + + log_startup_progress(" Initialized [count] atoms in [stop_watch(watch)]s") + pass(count) + + initialized = INITIALIZATION_INNEW_REGULAR + + if(late_loaders.len) + watch = start_watch() + log_startup_progress("Late-initializing atoms...") + for(var/I in late_loaders) + var/atom/A = I + A.LateInitialize() + log_startup_progress(" Late initialized [late_loaders.len] atoms in [stop_watch(watch)]s") + late_loaders.Cut() + + if(atoms) + . = created_atoms + atoms + created_atoms = null + +/datum/controller/subsystem/atoms/proc/InitAtom(atom/A, list/arguments) + var/the_type = A.type + if(QDELING(A)) + BadInitializeCalls[the_type] |= BAD_INIT_QDEL_BEFORE + return TRUE + + var/start_tick = world.time + + var/result = A.Initialize(arglist(arguments)) + + if(start_tick != world.time) + BadInitializeCalls[the_type] |= BAD_INIT_SLEPT + + var/qdeleted = FALSE + + if(result != INITIALIZE_HINT_NORMAL) + switch(result) + if(INITIALIZE_HINT_LATELOAD) + if(arguments[1]) //mapload + late_loaders += A + else + A.LateInitialize() + if(INITIALIZE_HINT_QDEL) + qdel(A) + qdeleted = TRUE + else + BadInitializeCalls[the_type] |= BAD_INIT_NO_HINT + + if(!A) //possible harddel + qdeleted = TRUE + else if(!A.initialized) + BadInitializeCalls[the_type] |= BAD_INIT_DIDNT_INIT + + return qdeleted || QDELING(A) + +/datum/controller/subsystem/atoms/proc/map_loader_begin() + old_initialized = initialized + initialized = INITIALIZATION_INSSATOMS + +/datum/controller/subsystem/atoms/proc/map_loader_stop() + initialized = old_initialized + +/datum/controller/subsystem/atoms/Recover() + initialized = SSatoms.initialized + if(initialized == INITIALIZATION_INNEW_MAPLOAD) + InitializeAtoms() + old_initialized = SSatoms.old_initialized + BadInitializeCalls = SSatoms.BadInitializeCalls \ No newline at end of file diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 067114e52be..823294e4d4e 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -43,20 +43,20 @@ SUBSYSTEM_DEF(garbage) var/list/counts = list() for(var/list/L in queues) counts += length(L) - msg += "Q:[counts.Join(",")]|D:[delslasttick]|G:[gcedlasttick]|" + msg += "Queue:[counts.Join(",")] | Del's:[delslasttick] | Soft:[gcedlasttick] |" msg += "GR:" if(!(delslasttick + gcedlasttick)) msg += "n/a|" else - msg += "[round((gcedlasttick / (delslasttick + gcedlasttick)) * 100, 0.01)]%|" + msg += "[round((gcedlasttick / (delslasttick + gcedlasttick)) * 100, 0.01)]% |" - msg += "TD:[totaldels]|TG:[totalgcs]|" + msg += "Total Dels:[totaldels] | Soft:[totalgcs] |" if(!(totaldels + totalgcs)) msg += "n/a|" else - msg += "TGR:[round((totalgcs / (totaldels + totalgcs)) * 100, 0.01)]%" - msg += " P:[pass_counts.Join(",")]" - msg += "|F:[fail_counts.Join(",")]" + msg += "TGR:[round((totalgcs / (totaldels + totalgcs)) * 100, 0.01)]% |" + msg += " Pass:[pass_counts.Join(",")]" + msg += " | Fail:[fail_counts.Join(",")]" ..(msg) /* TO-DO diff --git a/code/controllers/subsystem/machinery.dm b/code/controllers/subsystem/machinery.dm new file mode 100644 index 00000000000..8f914202dcf --- /dev/null +++ b/code/controllers/subsystem/machinery.dm @@ -0,0 +1,145 @@ +#define SSMACHINES_DEFERREDPOWERNETS 1 +#define SSMACHINES_POWERNETS 2 +#define SSMACHINES_PREMACHINERY 3 +#define SSMACHINES_MACHINERY 4 +SUBSYSTEM_DEF(machines) + name = "Machines" + init_order = INIT_ORDER_MACHINES + flags = SS_KEEP_TIMING + + var/list/processing = list() + var/list/currentrun = list() + var/list/powernets = list() + var/list/deferred_powernet_rebuilds = list() + + var/currentpart = SSMACHINES_DEFERREDPOWERNETS + +/datum/controller/subsystem/machines/Initialize() + makepowernets() + fire() + ..() + +/datum/controller/subsystem/machines/proc/makepowernets() + for(var/datum/powernet/PN in powernets) + qdel(PN) + powernets.Cut() + + for(var/obj/structure/cable/PC in GLOB.cable_list) + if(!PC.powernet) + var/datum/powernet/NewPN = new() + NewPN.add_cable(PC) + propagate_network(PC,PC.powernet) + +/datum/controller/subsystem/machines/stat_entry() + ..("Machines: [processing.len]\nPowernets: [powernets.len]\tDeferred: [deferred_powernet_rebuilds.len]") + +/datum/controller/subsystem/machines/proc/process_defered_powernets(resumed = 0) + if(!resumed) + src.currentrun = deferred_powernet_rebuilds.Copy() + //cache for sanid speed (lists are references anyways) + var/list/currentrun = src.currentrun + while(currentrun.len) + var/obj/O = currentrun[currentrun.len] + currentrun.len-- + if(O) + var/datum/powernet/newPN = new() // create a new powernet... + propagate_network(O, newPN)//... and propagate it to the other side of the cable + else + deferred_powernet_rebuilds.Remove(O) + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/proc/process_powernets(resumed = 0) + if(!resumed) + src.currentrun = powernets.Copy() + //cache for sanid speed (lists are references anyways) + var/list/currentrun = src.currentrun + while(currentrun.len) + var/datum/powernet/P = currentrun[currentrun.len] + currentrun.len-- + if(P) + P.reset() // reset the power state + else + powernets.Remove(P) + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/proc/process_premachines(resumed = 0) + /* Literally exists as snowflake for fucking powersinks goddamnit */ + if(!resumed) + src.currentrun = processing_power_items.Copy() + //cache for sanid speed (lists are references anyways) + var/list/currentrun = src.currentrun + while(currentrun.len) + var/obj/item/I = currentrun[currentrun.len] + currentrun.len-- + if(!QDELETED(I)) + if(!I.pwr_drain()) + processing_power_items.Remove(I) + else + processing_power_items.Remove(I) + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/proc/process_machines(resumed = 0) + var/seconds = wait * 0.1 + if(!resumed) + src.currentrun = processing.Copy() + //cache for sanic speed (lists are references anyways) + var/list/currentrun = src.currentrun + while(currentrun.len) + var/obj/machinery/thing = currentrun[currentrun.len] + currentrun.len-- + if(!QDELETED(thing) && thing.process(seconds) != PROCESS_KILL) + if(thing.use_power) + thing.auto_use_power() //add back the power state + else + processing -= thing + if(!QDELETED(thing)) + thing.isprocessing = FALSE + if(MC_TICK_CHECK) + return + +/datum/controller/subsystem/machines/fire(resumed = 0) + if(currentpart == SSMACHINES_DEFERREDPOWERNETS || !resumed) + process_defered_powernets(resumed) + if(state != SS_RUNNING) + return + resumed = 0 + currentpart = SSMACHINES_POWERNETS + + if(currentpart == SSMACHINES_POWERNETS || !resumed) + process_powernets(resumed) + if(state != SS_RUNNING) + return + resumed = 0 + currentpart = SSMACHINES_PREMACHINERY + + if(currentpart == SSMACHINES_PREMACHINERY || !resumed) + process_premachines(resumed) + if(state != SS_RUNNING) + return + resumed = 0 + currentpart = SSMACHINES_MACHINERY + + if(currentpart == SSMACHINES_MACHINERY || !resumed) + process_machines(resumed) + if(state != SS_RUNNING) + return + resumed = 0 + currentpart = SSMACHINES_DEFERREDPOWERNETS + + +/datum/controller/subsystem/machines/proc/setup_template_powernets(list/cables) + for(var/A in cables) + var/obj/structure/cable/PC = A + if(!PC.powernet) + var/datum/powernet/NewPN = new() + NewPN.add_cable(PC) + propagate_network(PC,PC.powernet) + +/datum/controller/subsystem/machines/Recover() + if(istype(SSmachines.processing)) + processing = SSmachines.processing + if(istype(SSmachines.powernets)) + powernets = SSmachines.powernets diff --git a/code/controllers/subsystem/mobs.dm b/code/controllers/subsystem/mobs.dm new file mode 100644 index 00000000000..03989d24af2 --- /dev/null +++ b/code/controllers/subsystem/mobs.dm @@ -0,0 +1,28 @@ +SUBSYSTEM_DEF(mobs) + name = "Mobs" + priority = FIRE_PRIORITY_MOBS + flags = SS_KEEP_TIMING | SS_NO_INIT + runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME + + var/list/currentrun = list() + +/datum/controller/subsystem/mobs/stat_entry() + ..("P:[mob_list.len]") + +/datum/controller/subsystem/mobs/fire(resumed = 0) + var/seconds = wait * 0.1 + if(!resumed) + src.currentrun = mob_list.Copy() + + //cache for sanic speed (lists are references anyways) + var/list/currentrun = src.currentrun + var/times_fired = src.times_fired + while(currentrun.len) + var/mob/M = currentrun[currentrun.len] + currentrun.len-- + if(M) + M.Life(seconds, times_fired) + else + mob_list.Remove(M) + if(MC_TICK_CHECK) + return \ No newline at end of file diff --git a/code/controllers/subsystem/processing/processing.dm b/code/controllers/subsystem/processing/processing.dm new file mode 100644 index 00000000000..92254454219 --- /dev/null +++ b/code/controllers/subsystem/processing/processing.dm @@ -0,0 +1,38 @@ +//Used to process objects. Fires once every second. + +//TODO: Implement fully when process scheduler dies +/* +SUBSYSTEM_DEF(processing) + name = "Processing" + priority = FIRE_PRIORITY_PROCESS + flags = SS_BACKGROUND|SS_POST_FIRE_TIMING|SS_NO_INIT + wait = 10 + + var/stat_tag = "P" //Used for logging + var/list/processing = list() + var/list/currentrun = list() + +/datum/controller/subsystem/processing/stat_entry() + ..("[stat_tag]:[processing.len]") + +/datum/controller/subsystem/processing/fire(resumed = 0) + if (!resumed) + currentrun = processing.Copy() + //cache for sanic speed (lists are references anyways) + var/list/current_run = currentrun + + while(current_run.len) + var/datum/thing = current_run[current_run.len] + current_run.len-- + if(QDELETED(thing) || thing.process(wait) == PROCESS_KILL) + processing -= thing + if (MC_TICK_CHECK) + return +*/ +/datum/var/isprocessing = FALSE +/* +/datum/proc/process() + set waitfor = 0 + STOP_PROCESSING(SSobj, src) + return 0 +*/ \ No newline at end of file diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index d5426b3d673..3315cafb399 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -82,7 +82,7 @@ debug_variables(SSfires) feedback_add_details("admin_verb","DFires") if("Mob") - debug_variables(mob_master) + debug_variables(SSmobs) feedback_add_details("admin_verb","DMob") if("NPC AI") debug_variables(npcai_master) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 83880039a73..8a9a108c7b3 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -42,10 +42,16 @@ power_equip = 0 //rastaf0 power_environ = 0 //rastaf0 - power_change() // all machines set to current power level, also updates lighting icon - blend_mode = BLEND_MULTIPLY // Putting this in the constructor so that it stops the icons being screwed up in the map editor. +/area/Initialize() + ..() + return INITIALIZE_HINT_LATELOAD + +/area/LateInitialize() + . = ..() + power_change() // all machines set to current power level, also updates lighting icon + /area/proc/get_cameras() var/list/cameras = list() for(var/obj/machinery/camera/C in src) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 1e931690333..19af319aa20 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -42,6 +42,62 @@ var/admin_spawned = 0 //was this spawned by an admin? used for stat tracking stuff. + var/initialized = FALSE + +/atom/New(loc, ...) + if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() + _preloader.load(src) + . = ..() + attempt_init(...) + +// This is distinct from /tg/ because of our space management system +// This is overriden in /atom/movable and the parent isn't called if the SMS wants to deal with it's init +/atom/proc/attempt_init(loc, ...) + var/do_initialize = SSatoms.initialized + if(do_initialize != INITIALIZATION_INSSATOMS) + args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD + if(SSatoms.InitAtom(src, args)) + // we were deleted + return + + +//Called after New if the map is being loaded. mapload = TRUE +//Called from base of New if the map is not being loaded. mapload = FALSE +//This base must be called or derivatives must set initialized to TRUE +//must not sleep +//Other parameters are passed from New (excluding loc), this does not happen if mapload is TRUE +//Must return an Initialize hint. Defined in __DEFINES/subsystems.dm + +//Note: the following functions don't call the base for optimization and must copypasta: +// /turf/Initialize +// /turf/open/space/Initialize + +/atom/proc/Initialize(mapload, ...) + if(initialized) + stack_trace("Warning: [src]([type]) initialized multiple times!") + initialized = TRUE + + if(light_power && light_range) + update_light() + + if(opacity && isturf(loc)) + var/turf/T = loc + T.has_opaque_atom = TRUE // No need to recalculate it in this case, it's guranteed to be on afterwards anyways. + + ComponentInitialize() + + return INITIALIZE_HINT_NORMAL + + +//called if Initialize returns INITIALIZE_HINT_LATELOAD +/atom/proc/LateInitialize() + return + +// Put your AddComponent() calls here +/atom/proc/ComponentInitialize() + return + + /atom/proc/onCentcom() var/turf/T = get_turf(src) if(!T) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 55af5fae17b..c7e6401e204 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -24,16 +24,19 @@ var/area/areaMaster - var/auto_init = 1 - /atom/movable/New() . = ..() areaMaster = get_area_master(src) - // If you're wondering what goofery this is, this is for things that need the environment - // around them set up - like `air_update_turf` and the like - if((ticker && ticker.current_state >= GAME_STATE_SETTING_UP)) - attempt_init() +/atom/movable/attempt_init() + if(ticker && ticker.current_state >= GAME_STATE_SETTING_UP) + var/turf/T = get_turf(src) + if(T && space_manager.is_zlevel_dirty(T.z)) + space_manager.postpone_init(T.z, src) + return + . = ..() + + /atom/movable/Destroy() if(loc) @@ -53,19 +56,6 @@ pulledby = null return ..() -// used to provide a good interface for the init delay system to step in -// and we don't need to call `get_turf` until the game's started -// at which point object creations are a fair toss more seldom -/atom/movable/proc/attempt_init() - var/turf/T = get_turf(src) - if(T && space_manager.is_zlevel_dirty(T.z)) - space_manager.postpone_init(T.z, src) - else if(auto_init) - initialize() - -/atom/movable/proc/initialize() - return - // Used in shuttle movement and AI eye stuff. // Primarily used to notify objects being moved by a shuttle/bluespace fuckup. /atom/movable/proc/setLoc(var/T, var/teleported=0) diff --git a/code/game/gamemodes/blob/blobs/blob_mobs.dm b/code/game/gamemodes/blob/blobs/blob_mobs.dm index c6dc0833afb..bae37c04c2c 100644 --- a/code/game/gamemodes/blob/blobs/blob_mobs.dm +++ b/code/game/gamemodes/blob/blobs/blob_mobs.dm @@ -62,7 +62,7 @@ factory.spores += src ..() -/mob/living/simple_animal/hostile/blob/blobspore/Life() +/mob/living/simple_animal/hostile/blob/blobspore/Life(seconds, times_fired) if(!is_zombie && isturf(src.loc)) for(var/mob/living/carbon/human/H in oview(src,1)) //Only for corpse right next to/on same tile diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index 9dcb5b7e3eb..0e1fc7daa86 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -60,7 +60,7 @@ /obj/structure/blob/core/RegenHealth() return // Don't regen, we handle it in Life() -/obj/structure/blob/core/Life() +/obj/structure/blob/core/Life(seconds, times_fired) if(!overmind) create_overmind() else diff --git a/code/game/gamemodes/blob/blobs/node.dm b/code/game/gamemodes/blob/blobs/node.dm index 232511744ea..19ac320287a 100644 --- a/code/game/gamemodes/blob/blobs/node.dm +++ b/code/game/gamemodes/blob/blobs/node.dm @@ -28,7 +28,7 @@ processing_objects.Remove(src) return ..() -/obj/structure/blob/node/Life() +/obj/structure/blob/node/Life(seconds, times_fired) if(overmind) for(var/i = 1; i < 8; i += i) Pulse(5, i, overmind.blob_reagent_datum.color) diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index 5da84fbc460..60ea94befb0 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -36,7 +36,7 @@ updateallghostimages() ..() -/mob/camera/blob/Life() +/mob/camera/blob/Life(seconds, times_fired) if(!blob_core) qdel(src) ..() diff --git a/code/game/gamemodes/miniantags/abduction/machinery/console.dm b/code/game/gamemodes/miniantags/abduction/machinery/console.dm index b0b879a30ab..10cd5473279 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/console.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/console.dm @@ -27,7 +27,7 @@ var/obj/machinery/computer/camera_advanced/abductor/camera var/list/datum/icon_snapshot/disguises = list() -/obj/machinery/abductor/console/initialize() +/obj/machinery/abductor/console/Initialize() ..() Link_Abduction_Equipment() diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm index 09d8a84539a..00bf335c576 100644 --- a/code/game/gamemodes/miniantags/borer/borer.dm +++ b/code/game/gamemodes/miniantags/borer/borer.dm @@ -244,7 +244,7 @@ to_chat(M, "Borer Communication from [B] ([ghost_follow_link(src, ghost=M)]): [input]") to_chat(src, "[B.truename] says: [input]") -/mob/living/simple_animal/borer/Life() +/mob/living/simple_animal/borer/Life(seconds, times_fired) ..() diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index 822bfc9ce29..f76830910b1 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -57,7 +57,7 @@ else holder.icon_state = "hudhealthy" -/mob/living/simple_animal/hostile/guardian/Life() //Dies if the summoner dies +/mob/living/simple_animal/hostile/guardian/Life(seconds, times_fired) //Dies if the summoner dies ..() if(summoner) if(summoner.stat == DEAD) diff --git a/code/game/gamemodes/miniantags/guardian/types/assassin.dm b/code/game/gamemodes/miniantags/guardian/types/assassin.dm index 426824f2e8c..5eb8c1b1cec 100644 --- a/code/game/gamemodes/miniantags/guardian/types/assassin.dm +++ b/code/game/gamemodes/miniantags/guardian/types/assassin.dm @@ -13,7 +13,7 @@ var/obj/screen/alert/canstealthalert var/obj/screen/alert/instealthalert -/mob/living/simple_animal/hostile/guardian/assassin/Life() +/mob/living/simple_animal/hostile/guardian/assassin/Life(seconds, times_fired) . = ..() updatestealthalert() if(loc == summoner && toggle) diff --git a/code/game/gamemodes/miniantags/guardian/types/fire.dm b/code/game/gamemodes/miniantags/guardian/types/fire.dm index 2a9dc2d2c8e..61905f942d2 100644 --- a/code/game/gamemodes/miniantags/guardian/types/fire.dm +++ b/code/game/gamemodes/miniantags/guardian/types/fire.dm @@ -13,7 +13,7 @@ bio_fluff_string = "Your scarab swarm finishes mutating and stirs to life, ready to sow havoc at random." var/toggle = FALSE -/mob/living/simple_animal/hostile/guardian/fire/Life() //Dies if the summoner dies +/mob/living/simple_animal/hostile/guardian/fire/Life(seconds, times_fired) //Dies if the summoner dies ..() if(summoner) summoner.ExtinguishMob() diff --git a/code/game/gamemodes/miniantags/guardian/types/healer.dm b/code/game/gamemodes/miniantags/guardian/types/healer.dm index d51e4cefd45..c679beac91a 100644 --- a/code/game/gamemodes/miniantags/guardian/types/healer.dm +++ b/code/game/gamemodes/miniantags/guardian/types/healer.dm @@ -32,7 +32,7 @@ /mob/living/simple_animal/hostile/guardian/healer/New() ..() -/mob/living/simple_animal/hostile/guardian/healer/Life() +/mob/living/simple_animal/hostile/guardian/healer/Life(seconds, times_fired) ..() var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED] medsensor.add_hud_to(src) diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 49380c57863..fa659b50c43 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -54,7 +54,7 @@ var/image/ghostimage = null //Visible to ghost with darkness off -/mob/living/simple_animal/revenant/Life() +/mob/living/simple_animal/revenant/Life(seconds, times_fired) ..() if(revealed && essence <= 0) death() diff --git a/code/game/gamemodes/miniantags/slaughter/slaughter.dm b/code/game/gamemodes/miniantags/slaughter/slaughter.dm index 42827d27f59..aeb26f58822 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughter.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughter.dm @@ -82,7 +82,7 @@ to_chat(src, "Objective #[2]: [fluffObjective.explanation_text]") -/mob/living/simple_animal/slaughter/Life() +/mob/living/simple_animal/slaughter/Life(seconds, times_fired) ..() if(boost[usr] attaches [src] to [target].", "You attach [src] to [target].") attached = target - machine_processing += src + START_PROCESSING(SSmachines, src) update_icon() else to_chat(usr, "There's nothing attached to the IV drip!") diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 9862d952244..343734804cb 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -44,7 +44,7 @@ src.on = src.area.lightswitch updateicon() -/obj/machinery/light_switch/initialize() +/obj/machinery/light_switch/Initialize() ..() set_frequency(frequency) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 34842a64b76..18fc505a49b 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -119,7 +119,7 @@ Class Procs: atom_say_verb = "beeps" var/speed_process = 0 // Process as fast as possible? -/obj/machinery/initialize() +/obj/machinery/Initialize() addAtProcessing() . = ..() power_change() @@ -128,24 +128,26 @@ Class Procs: if(use_power) myArea = get_area_master(src) if(!speed_process) - machine_processing += src + START_PROCESSING(SSmachines, src) else fast_processing += src + isprocessing = TRUE // all of these isprocessing = TRUE can be removed when the PS is dead // gotta go fast /obj/machinery/proc/makeSpeedProcess() if(speed_process) return speed_process = 1 - machine_processing -= src + STOP_PROCESSING(SSmachines, src) fast_processing += src + isprocessing = TRUE // gotta go slow /obj/machinery/proc/makeNormalProcess() if(!speed_process) return speed_process = 0 - machine_processing += src + START_PROCESSING(SSmachines, src) fast_processing -= src /obj/machinery/New() //new @@ -158,7 +160,7 @@ Class Procs: if(myArea) myArea = null fast_processing -= src - machine_processing -= src + STOP_PROCESSING(SSmachines, src) machines -= src return ..() @@ -309,7 +311,7 @@ Class Procs: re_init=1 if(re_init) - initialize() + Initialize() if(update_mt_menu) //usr.set_machine(src) update_multitool_menu(usr) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 24251977ca9..6ef4d064ac7 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -14,7 +14,7 @@ src.dir = pick(1,2,3,4) ..() -/obj/machinery/shield/initialize() +/obj/machinery/shield/Initialize() air_update_turf(1) ..() diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 414ec8d2e62..a77bd744f92 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -54,7 +54,7 @@ return ..() // register for radio system -/obj/machinery/status_display/initialize() +/obj/machinery/status_display/Initialize() ..() if(radio_controller) radio_controller.add_object(src, frequency) diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 59f9a667584..7ec64373373 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -131,7 +131,7 @@ singulo.target = src icon_state = "[icontype]1" active = 1 - machine_processing |= src + START_PROCESSING(SSmachines, src) if(user) to_chat(user, "You activate the beacon.") diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 00465cf8b8b..9dc30edf61e 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -116,7 +116,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() // TODO: Make the radio system cooperate with the space manager listening_level = position.z -/obj/machinery/telecomms/initialize() +/obj/machinery/telecomms/Initialize() ..() if(autolinkers.len) // Links nearby machines diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index fa8f2e8d084..a1248fc0b6d 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -18,7 +18,7 @@ ..() return -/obj/machinery/computer/teleporter/initialize() +/obj/machinery/computer/teleporter/Initialize() ..() link_power_station() update_icon() @@ -293,7 +293,7 @@ component_parts += new /obj/item/stock_parts/matter_bin/super(null) RefreshParts() -/obj/machinery/teleport/hub/initialize() +/obj/machinery/teleport/hub/Initialize() ..() link_power_station() @@ -472,7 +472,7 @@ RefreshParts() link_console_and_hub() -/obj/machinery/teleport/station/initialize() +/obj/machinery/teleport/station/Initialize() ..() link_console_and_hub() diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 8df55e1bc66..d6ae98cb516 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -64,7 +64,7 @@ A.turret_controls -= src return ..() -/obj/machinery/turretid/initialize() +/obj/machinery/turretid/Initialize() ..() if(!control_area) control_area = get_area(src) diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 866cb7580f6..7706f3120f0 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -444,7 +444,6 @@ if(!PN) PN = new() - powernets += PN NC.powernet = PN PN.cables += NC NC.mergeConnectedNetworks(NC.d2) diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index b14825c7cc0..a34d43098cb 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -177,7 +177,7 @@ return data -/obj/machinery/computer/mech_bay_power_console/initialize() +/obj/machinery/computer/mech_bay_power_console/Initialize() reconnect() update_icon() return ..() diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index cb218395735..17723adcde7 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -172,7 +172,7 @@ desc = "A lightweight foamed metal wall." var/metal = MFOAM_ALUMINUM -/obj/structure/foamedmetal/initialize() +/obj/structure/foamedmetal/Initialize() ..() air_update_turf(1) diff --git a/code/game/objects/effects/spawners/windowspawner.dm b/code/game/objects/effects/spawners/windowspawner.dm index a2517d093f8..6d271039070 100644 --- a/code/game/objects/effects/spawners/windowspawner.dm +++ b/code/game/objects/effects/spawners/windowspawner.dm @@ -7,7 +7,8 @@ var/windowtospawn = /obj/structure/window/basic anchored = 1 // No sliding out while you prime -/obj/effect/spawner/window/initialize() +/obj/effect/spawner/window/Initialize() + ..() spawn(0) var/turf/T = get_turf(src) for(var/obj/structure/grille/G in get_turf(src)) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 944a6e0d5f9..e7156cb6888 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -12,7 +12,7 @@ var/on = 0 var/brightness_on = 4 //luminosity when on -/obj/item/flashlight/initialize() +/obj/item/flashlight/Initialize() ..() if(on) icon_state = "[initial(icon_state)]-on" diff --git a/code/game/objects/items/devices/instruments.dm b/code/game/objects/items/devices/instruments.dm index b55efc665b2..3a0f2b6941d 100644 --- a/code/game/objects/items/devices/instruments.dm +++ b/code/game/objects/items/devices/instruments.dm @@ -21,7 +21,7 @@ user.visible_message("[user] begins to play 'Gloomy Sunday'! It looks like \he's trying to commit suicide!") return (BRUTELOSS) -/obj/item/instrument/initialize(mapload) +/obj/item/instrument/Initialize(mapload) song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded ..() diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 55465218b99..51aa645a139 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -21,7 +21,7 @@ ..() internal_channels.Cut() -/obj/item/radio/headset/initialize() +/obj/item/radio/headset/Initialize() ..() if(ks1type) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index e1ee7029439..530156fbd99 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -83,7 +83,8 @@ var/global/list/default_medbay_channels = list( return ..() -/obj/item/radio/initialize() +/obj/item/radio/Initialize() + ..() if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ) frequency = sanitize_frequency(frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ) set_frequency(frequency) diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm index c4506396f45..76deeac93e8 100644 --- a/code/game/objects/structures/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -30,7 +30,7 @@ var/resintype = null smooth = SMOOTH_TRUE -/obj/structure/alien/resin/initialize() +/obj/structure/alien/resin/Initialize() air_update_turf(1) ..() diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 6d03ca4fdef..4ea0fc34e2d 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -25,7 +25,7 @@ var/health = 50.0 -/obj/structure/inflatable/initialize(location) +/obj/structure/inflatable/Initialize(location) ..() air_update_turf(1) diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index f4a2990918b..e0e9ba1b6a7 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -24,7 +24,7 @@ ..() initial_state = icon_state -/obj/structure/mineral_door/initialize() +/obj/structure/mineral_door/Initialize() ..() air_update_turf(1) diff --git a/code/game/objects/structures/misc.dm b/code/game/objects/structures/misc.dm index 131a355feb2..6be7bf072d8 100644 --- a/code/game/objects/structures/misc.dm +++ b/code/game/objects/structures/misc.dm @@ -87,7 +87,7 @@ var/atom/attack_atom -/obj/structure/ghost_beacon/initialize() +/obj/structure/ghost_beacon/Initialize() . = ..() last_ghost_alert = world.time attack_atom = src diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 3e5d3386e0a..60ca03ad0f7 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -29,7 +29,7 @@ anchored = 1.0 var/open_sound = 'sound/items/Deconstruct.ogg' -/obj/structure/morgue/initialize() +/obj/structure/morgue/Initialize() . = ..() update() diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index da4c1181f01..b8c28046bd3 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -295,7 +295,7 @@ QDEL_NULL(song) return ..() -/obj/structure/piano/initialize() +/obj/structure/piano/Initialize() song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded ..() diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index caa1bf48b4b..8ea6a3c0cce 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -7,7 +7,8 @@ anchored = 1 var/notices = 0 -/obj/structure/noticeboard/initialize() +/obj/structure/noticeboard/Initialize() + ..() for(var/obj/item/I in loc) if(notices > 4) break if(istype(I, /obj/item/paper)) diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index f0a2c28af85..8d22732e5dd 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -124,7 +124,7 @@ name = "airtight plastic flaps" desc = "Heavy duty, airtight, plastic flaps." -/obj/structure/plasticflaps/mining/initialize() +/obj/structure/plasticflaps/mining/Initialize() air_update_turf(1) ..() diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 315728ddc16..44c9da74b20 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -30,7 +30,8 @@ FLOOR SAFES tumbler_2_open = rand(0, 71) -/obj/structure/safe/initialize() +/obj/structure/safe/Initialize() + ..() for(var/obj/item/I in loc) if(space >= maxspace) return @@ -178,7 +179,7 @@ obj/structure/safe/ex_act(severity) layer = 2.5 -/obj/structure/safe/floor/initialize() +/obj/structure/safe/floor/Initialize() ..() var/turf/T = loc hide(T.intact) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index c93a0e5f1b8..aebd111ad26 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -386,7 +386,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f update_nearby_icons() return -/obj/structure/window/initialize() +/obj/structure/window/Initialize() air_update_turf(1) return ..() @@ -454,7 +454,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f update_nearby_icons() return -/obj/structure/window/plasmabasic/initialize() +/obj/structure/window/plasmabasic/Initialize() ..() air_update_turf(1) @@ -483,7 +483,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f update_nearby_icons() return -/obj/structure/window/plasmareinforced/initialize() +/obj/structure/window/plasmareinforced/Initialize() ..() air_update_turf(1) diff --git a/code/game/world.dm b/code/game/world.dm index dc4b830704e..7d592864501 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -16,10 +16,12 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG GLOB.timezoneOffset = text2num(time2text(0, "hh")) * 36000 + makeDatumRefLists() callHook("startup") src.update_status() + . = ..() // Create robolimbs for chargen. diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 85591ee3159..de281d34e68 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -51,7 +51,7 @@ return feedback_add_details("admin_verb","CPOW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - for(var/datum/powernet/PN in powernets) + for(var/datum/powernet/PN in SSmachines.powernets) if(!PN.nodes || !PN.nodes.len) if(PN.cables && (PN.cables.len > 1)) var/obj/structure/cable/C = PN.cables[1] diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 78f9fbd5de1..00966ee31fc 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -387,7 +387,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(!check_rights(R_DEBUG)) return - makepowernets() + SSmachines.makepowernets() log_admin("[key_name(src)] has remade the powernet. makepowernets() called.") message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.", 0) feedback_add_details("admin_verb","MPWN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/arcade/mob_hunt/battle_computer.dm b/code/modules/arcade/mob_hunt/battle_computer.dm index e5f2af123fb..8ae577fe338 100644 --- a/code/modules/arcade/mob_hunt/battle_computer.dm +++ b/code/modules/arcade/mob_hunt/battle_computer.dm @@ -27,11 +27,11 @@ team = "Blue" avatar_y_offset = 1 -/obj/machinery/computer/mob_battle_terminal/red/initialize() +/obj/machinery/computer/mob_battle_terminal/red/Initialize() ..() check_connection() -/obj/machinery/computer/mob_battle_terminal/blue/initialize() +/obj/machinery/computer/mob_battle_terminal/blue/Initialize() ..() check_connection() diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index 1886cd4ee65..6a2019b9001 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -23,7 +23,8 @@ if(radio_controller) set_frequency(frequency) -/obj/item/assembly/signaler/initialize() +/obj/item/assembly/signaler/Initialize() + ..() if(radio_controller) set_frequency(frequency) diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index e5c42e495f2..94e0ea2acce 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -29,7 +29,8 @@ var/brute_damage = 0 var/oxy_damage = 0 -/obj/effect/landmark/corpse/initialize() +/obj/effect/landmark/corpse/Initialize() + ..() if(istype(src,/obj/effect/landmark/corpse/clown)) var/obj/effect/landmark/corpse/clown/C = src C.chooseRank() diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index d964663298f..d5e2cbcd34d 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -9,7 +9,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null unacidable = 1 var/active = 0 -/obj/machinery/gateway/initialize() +/obj/machinery/gateway/Initialize() ..() update_icon() update_density_from_dir() @@ -44,7 +44,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null if(!the_gateway) the_gateway = src -/obj/machinery/gateway/centerstation/initialize() +/obj/machinery/gateway/centerstation/Initialize() ..() update_icon() wait = world.time + config.gateway_delay //+ thirty minutes default @@ -170,7 +170,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null var/obj/machinery/gateway/centeraway/stationgate = null -/obj/machinery/gateway/centeraway/initialize() +/obj/machinery/gateway/centeraway/Initialize() ..() update_icon() stationgate = locate(/obj/machinery/gateway/centerstation) in world diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm index 49af9a43ce6..6497d62648a 100644 --- a/code/modules/awaymissions/loot.dm +++ b/code/modules/awaymissions/loot.dm @@ -5,7 +5,8 @@ var/lootdoubles = 0 //if the same item can be spawned twice var/loot = "" //a list of possible items to spawn- a string of paths -/obj/effect/spawner/away/lootdrop/initialize() +/obj/effect/spawner/away/lootdrop/Initialize() + ..() var/list/things = params2list(loot) if(things && things.len) diff --git a/code/modules/awaymissions/map_rng.dm b/code/modules/awaymissions/map_rng.dm index 64350c99737..7618996fdf9 100644 --- a/code/modules/awaymissions/map_rng.dm +++ b/code/modules/awaymissions/map_rng.dm @@ -18,13 +18,8 @@ template_name = tname if(template_name) template = map_templates[template_name] - // Catches the interim-zone of worldstart and roundstart - // I want both the ticker to exist (so mapped-in maploaders don't trip this) - // but also not have started yet (since the zlevel system would handle this on its own otherwise) - if((ticker && ticker.current_state < GAME_STATE_PLAYING)) - attempt_init() -/obj/effect/landmark/map_loader/initialize() +/obj/effect/landmark/map_loader/Initialize() ..() if(template) load(template) @@ -48,7 +43,7 @@ /obj/effect/landmark/map_loader/random var/template_list = "" -/obj/effect/landmark/map_loader/random/initialize() +/obj/effect/landmark/map_loader/random/Initialize() ..() if(template_list) template_name = safepick(splittext(template_list, ";")) diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index b44fd01e45c..5ff625544fd 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -422,13 +422,6 @@ var/global/dmm_suite/preloader/_preloader = new return to_return -//atom creation method that preloads variables at creation -/atom/New() - if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() - _preloader.load(src) - - . = ..() - /dmm_suite/Destroy() ..() return QDEL_HINT_HARDDEL_NOW diff --git a/code/modules/awaymissions/mission_code/spacehotel.dm b/code/modules/awaymissions/mission_code/spacehotel.dm index e86123abc2e..4e4f2628736 100644 --- a/code/modules/awaymissions/mission_code/spacehotel.dm +++ b/code/modules/awaymissions/mission_code/spacehotel.dm @@ -54,7 +54,7 @@ name = "space hotel pamphlet" info = "

Welcome to Deep Space Hotel 419!

Thank you for choosing our hotel. Simply hand your credit or debit card to the concierge and get your room key! To check out, hand your credit card back.

Conditions:

" -/obj/effect/landmark/map_loader/hotel_room/initialize() +/obj/effect/landmark/map_loader/hotel_room/Initialize() ..() // load and randomly assign rooms var/global/list/south_room_templates = list() diff --git a/code/modules/awaymissions/zvis.dm b/code/modules/awaymissions/zvis.dm index 73bbff2198f..4324377149d 100644 --- a/code/modules/awaymissions/zvis.dm +++ b/code/modules/awaymissions/zvis.dm @@ -22,7 +22,7 @@ ..() levels += src -/obj/effect/levelref/initialize() +/obj/effect/levelref/Initialize() ..() for(var/obj/effect/levelref/O in levels) if(id == O.id && O != src) @@ -161,7 +161,7 @@ ..() portals += src -/obj/effect/view_portal/initialize() +/obj/effect/view_portal/Initialize() ..() if(id) for(var/obj/effect/view_portal/O in portals) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index 83bcf61ec5d..6306fa5a83e 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -38,7 +38,7 @@ log transactions ..() machine_id = "[station_name()] RT #[num_financial_terminals++]" -/obj/machinery/atm/initialize() +/obj/machinery/atm/Initialize() ..() reconnect_database() diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index a527367ee2b..09a5d20833e 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -96,7 +96,7 @@ var/total_runtimes_skipped = 0 // Now to actually output the error info... log_world("\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]") - log_runtime_txt("\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]") + log_runtime_txt("Runtime in [e.file],[e.line]: [e]") for(var/line in desclines) log_world(line) log_runtime_txt(line) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index 0176049b59a..cd94d79bd5c 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -1254,9 +1254,10 @@ log_game("Cube ([monkey_type]) inflated, last touched by: " + fingerprintslast) else log_game("Cube ([monkey_type]) inflated, last touched by: NO_DATA") - var/mob/living/carbon/human/creature = new /mob/living/carbon/human(get_turf(src), monkey_type) + var/mob/living/carbon/human/creature = new /mob/living/carbon/human(get_turf(src)) if(fingerprintshidden.len) creature.fingerprintshidden = fingerprintshidden.Copy() + creature.set_species(monkey_type) qdel(src) /obj/item/reagent_containers/food/snacks/monkeycube/farwacube diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index a0b10f29f38..8df5d593b9b 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -24,7 +24,7 @@ var/tmp/busy = 0 var/list/allowed_books = list(/obj/item/book, /obj/item/spellbook, /obj/item/storage/bible, /obj/item/tome) //Things allowed in the bookcase -/obj/structure/bookcase/initialize() +/obj/structure/bookcase/Initialize() ..() for(var/obj/item/I in loc) if(is_type_in_list(I, allowed_books)) diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm index 679f6fb86ef..075e3e47a20 100644 --- a/code/modules/lighting/lighting_atom.dm +++ b/code/modules/lighting/lighting_atom.dm @@ -40,16 +40,6 @@ else light = new /datum/light_source(src, .) -/atom/New() - . = ..() - - if(light_power && light_range) - update_light() - - if(opacity && isturf(loc)) - var/turf/T = loc - T.has_opaque_atom = TRUE // No need to recalculate it in this case, it's guranteed to be on afterwards anyways. - /atom/Destroy() if(light) light.destroy() diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm index 6fe55eed0ff..1a421e6d1ad 100644 --- a/code/modules/lighting/lighting_overlay.dm +++ b/code/modules/lighting/lighting_overlay.dm @@ -9,7 +9,6 @@ invisibility = INVISIBILITY_LIGHTING color = LIGHTING_BASE_MATRIX icon_state = "light1" - auto_init = 0 // doesn't need special init blend_mode = BLEND_MULTIPLY var/lum_r = 0 diff --git a/code/modules/logic/logic_base.dm b/code/modules/logic/logic_base.dm index db891ab383c..519c47c408b 100644 --- a/code/modules/logic/logic_base.dm +++ b/code/modules/logic/logic_base.dm @@ -50,7 +50,7 @@ component_parts += LG component_parts += new /obj/item/stack/cable_coil(null, 1) -/obj/machinery/logic_gate/initialize() +/obj/machinery/logic_gate/Initialize() ..() set_frequency(frequency) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 4ab29741ef6..933ef9a6403 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -106,7 +106,7 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi Transfer_mind is there to check if mob is being deleted/not going to have a body. Works together with spawning an observer, noted above. */ -/mob/dead/observer/Life() +/mob/dead/observer/Life(seconds, times_fired) ..() if(!loc) return if(!client) return 0 @@ -419,7 +419,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(.) update_following() -/mob/Life() +/mob/Life(seconds, times_fired) // to catch teleports etc which directly set loc update_following() return ..() diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index a13fce956da..180d6bd8072 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/alien/humanoid/Life() +/mob/living/carbon/alien/humanoid/Life(seconds, times_fired) . = ..() update_icons() diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 4faa957163c..5bbb31c00d1 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/alien/larva/Life() +/mob/living/carbon/alien/larva/Life(seconds, times_fired) if(..()) //still breathing // GROW! if(amount_grown < max_grown) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5a47bb052d5..e0f90aacdd0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -10,8 +10,12 @@ var/datum/species/species //Contains icon generation and language information, set during New(). var/obj/item/rig/wearing_rig // This is very not good, but it's much much better than calling get_rig() every update_canmove() call. -/mob/living/carbon/human/New(var/new_loc, var/new_species = null, var/delay_ready_dna = 0) +/mob/living/carbon/human/New(loc) + if(length(args) > 1) + log_runtime(EXCEPTION("human/New called with more than 1 argument (REPORT THIS ENTIRE RUNTIME TO A CODER)")) + . = ..() +/mob/living/carbon/human/Initialize(mapload, new_species = null) if(!dna) dna = new /datum/dna(null) // Species name is handled by set_species() @@ -40,7 +44,7 @@ faction |= "\ref[M]" //what // Set up DNA. - if(!delay_ready_dna && dna) + if(dna) dna.ready_dna(src) dna.real_name = real_name sync_organ_dna(1) @@ -69,80 +73,80 @@ real_name = "Test Dummy" status_flags = GODMODE|CANPUSH -/mob/living/carbon/human/skrell/New(var/new_loc) - ..(new_loc, "Skrell") +/mob/living/carbon/human/skrell/Initialize(mapload) + ..(mapload, "Skrell") -/mob/living/carbon/human/tajaran/New(var/new_loc) - ..(new_loc, "Tajaran") +/mob/living/carbon/human/tajaran/Initialize(mapload) + ..(mapload, "Tajaran") -/mob/living/carbon/human/vulpkanin/New(var/new_loc) - ..(new_loc, "Vulpkanin") +/mob/living/carbon/human/vulpkanin/Initialize(mapload) + ..(mapload, "Vulpkanin") -/mob/living/carbon/human/unathi/New(var/new_loc) - ..(new_loc, "Unathi") +/mob/living/carbon/human/unathi/Initialize(mapload) + ..(mapload, "Unathi") -/mob/living/carbon/human/vox/New(var/new_loc) - ..(new_loc, "Vox") +/mob/living/carbon/human/vox/Initialize(mapload) + ..(mapload, "Vox") -/mob/living/carbon/human/voxarmalis/New(var/new_loc) - ..(new_loc, "Vox Armalis") +/mob/living/carbon/human/voxarmalis/Initialize(mapload) + ..(mapload, "Vox Armalis") -/mob/living/carbon/human/skeleton/New(var/new_loc) - ..(new_loc, "Skeleton") +/mob/living/carbon/human/skeleton/Initialize(mapload) + ..(mapload, "Skeleton") -/mob/living/carbon/human/kidan/New(var/new_loc) - ..(new_loc, "Kidan") +/mob/living/carbon/human/kidan/Initialize(mapload) + ..(mapload, "Kidan") -/mob/living/carbon/human/plasma/New(var/new_loc) - ..(new_loc, "Plasmaman") +/mob/living/carbon/human/plasma/Initialize(mapload) + ..(mapload, "Plasmaman") -/mob/living/carbon/human/slime/New(var/new_loc) - ..(new_loc, "Slime People") +/mob/living/carbon/human/slime/Initialize(mapload) + ..(mapload, "Slime People") -/mob/living/carbon/human/grey/New(var/new_loc) - ..(new_loc, "Grey") +/mob/living/carbon/human/grey/Initialize(mapload) + ..(mapload, "Grey") -/mob/living/carbon/human/abductor/New(var/new_loc) - ..(new_loc, "Abductor") +/mob/living/carbon/human/abductor/Initialize(mapload) + ..(mapload, "Abductor") -/mob/living/carbon/human/human/New(var/new_loc) - ..(new_loc, "Human") +/mob/living/carbon/human/human/Initialize(mapload) + ..(mapload, "Human") -/mob/living/carbon/human/diona/New(var/new_loc) - ..(new_loc, "Diona") +/mob/living/carbon/human/diona/Initialize(mapload) + ..(mapload, "Diona") -/mob/living/carbon/human/machine/New(var/new_loc) - ..(new_loc, "Machine") +/mob/living/carbon/human/machine/Initialize(mapload) + ..(mapload, "Machine") -/mob/living/carbon/human/shadow/New(var/new_loc) - ..(new_loc, "Shadow") +/mob/living/carbon/human/shadow/Initialize(mapload) + ..(mapload, "Shadow") -/mob/living/carbon/human/golem/New(var/new_loc) - ..(new_loc, "Golem") +/mob/living/carbon/human/golem/Initialize(mapload) + ..(mapload, "Golem") -/mob/living/carbon/human/wryn/New(var/new_loc) - ..(new_loc, "Wryn") +/mob/living/carbon/human/wryn/Initialize(mapload) + ..(mapload, "Wryn") -/mob/living/carbon/human/nucleation/New(var/new_loc) - ..(new_loc, "Nucleation") +/mob/living/carbon/human/nucleation/Initialize(mapload) + ..(mapload, "Nucleation") -/mob/living/carbon/human/drask/New(var/new_loc) - ..(new_loc, "Drask") +/mob/living/carbon/human/drask/Initialize(mapload) + ..(mapload, "Drask") -/mob/living/carbon/human/monkey/New(var/new_loc) - ..(new_loc, "Monkey") +/mob/living/carbon/human/monkey/Initialize(mapload) + ..(mapload, "Monkey") -/mob/living/carbon/human/farwa/New(var/new_loc) - ..(new_loc, "Farwa") +/mob/living/carbon/human/farwa/Initialize(mapload) + ..(mapload, "Farwa") -/mob/living/carbon/human/wolpin/New(var/new_loc) - ..(new_loc, "Wolpin") +/mob/living/carbon/human/wolpin/Initialize(mapload) + ..(mapload, "Wolpin") -/mob/living/carbon/human/neara/New(var/new_loc) - ..(new_loc, "Neara") +/mob/living/carbon/human/neara/Initialize(mapload) + ..(mapload, "Neara") -/mob/living/carbon/human/stok/New(var/new_loc) - ..(new_loc, "Stok") +/mob/living/carbon/human/stok/Initialize(mapload) + ..(mapload, "Stok") /mob/living/carbon/human/Stat() ..() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 64395954672..00de7814170 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/human/Life() +/mob/living/carbon/human/Life(seconds, times_fired) life_tick++ voice = GetVoice() @@ -32,7 +32,7 @@ //Update our name based on whether our face is obscured/disfigured name = get_visible_name() - pulse = handle_pulse() + pulse = handle_pulse(times_fired) if(mind && mind.vampire) mind.vampire.handle_vampire() @@ -902,9 +902,8 @@ hud_used.lingchemdisplay.invisibility = 101 -/mob/living/carbon/human/proc/handle_pulse() - - if(mob_master.current_cycle % 5) +/mob/living/carbon/human/proc/handle_pulse(times_fired) + if(times_fired % 5 == 1) return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load) if(NO_BLOOD in species.species_traits) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index f61c5431fab..3023d6538a8 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/Life() +/mob/living/carbon/Life(seconds, times_fired) set invisibility = 0 set background = BACKGROUND_ENABLED @@ -14,7 +14,7 @@ O.on_life() handle_changeling() - handle_wetness() + handle_wetness(times_fired) // Increase germ_level regularly if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level @@ -26,8 +26,8 @@ /////////////// //Start of a breath chain, calls breathe() -/mob/living/carbon/handle_breathing() - if(mob_master.current_cycle % 4 == 2 || failed_last_breath) +/mob/living/carbon/handle_breathing(times_fired) + if(times_fired % 4 == 2 || failed_last_breath) breathe() //Breathe per 4 ticks, unless suffocating else if(istype(loc, /obj/)) @@ -241,11 +241,11 @@ reagents.metabolize(src) -/mob/living/carbon/proc/handle_wetness() - if(mob_master.current_cycle%20==2) //dry off a bit once every 20 ticks or so +/mob/living/carbon/proc/handle_wetness(times_fired) + if(times_fired % 20==2) //dry off a bit once every 20 ticks or so wetlevel = max(wetlevel - 1,0) -/mob/living/carbon/handle_stomach() +/mob/living/carbon/handle_stomach(times_fired) for(var/mob/living/M in stomach_contents) if(M.loc != src) stomach_contents.Remove(M) @@ -255,7 +255,7 @@ stomach_contents.Remove(M) qdel(M) continue - if(mob_master.current_cycle%3==1) + if(times_fired % 3 == 1) M.adjustBruteLoss(5) nutrition += 10 diff --git a/code/modules/mob/living/carbon/slime/life.dm b/code/modules/mob/living/carbon/slime/life.dm index ced452ab652..80ed9fdbffd 100644 --- a/code/modules/mob/living/carbon/slime/life.dm +++ b/code/modules/mob/living/carbon/slime/life.dm @@ -5,7 +5,7 @@ var/Discipline = 0 // if a slime has been hit with a freeze gun, or wrestled/attacked off a human, they become disciplined and don't attack anymore for a while var/SStun = 0 // stun variable -/mob/living/carbon/slime/Life() +/mob/living/carbon/slime/Life(seconds, times_fired) if(..()) handle_nutrition() handle_targets() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 8c414636349..f02065b3a0a 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -1,4 +1,4 @@ -/mob/living/Life() +/mob/living/Life(seconds, times_fired) set invisibility = 0 set background = BACKGROUND_ENABLED @@ -22,7 +22,7 @@ handle_mutations_and_radiation() //Breathing, if applicable - handle_breathing() + handle_breathing(times_fired) //Random events (vomiting etc) handle_random_events() @@ -38,7 +38,7 @@ handle_fire() //stuff in the stomach - handle_stomach() + handle_stomach(times_fired) update_gravity(mob_has_gravity()) @@ -61,7 +61,7 @@ ..() -/mob/living/proc/handle_breathing() +/mob/living/proc/handle_breathing(times_fired) return /mob/living/proc/handle_mutations_and_radiation() @@ -80,7 +80,7 @@ /mob/living/proc/handle_environment(datum/gas_mixture/environment) return -/mob/living/proc/handle_stomach() +/mob/living/proc/handle_stomach(times_fired) return /mob/living/proc/update_pulling() diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index a6a043a8945..1755674b4f6 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -3,7 +3,7 @@ #define POWER_RESTORATION_SEARCH_APC 2 #define POWER_RESTORATION_APC_FOUND 3 -/mob/living/silicon/ai/Life() +/mob/living/silicon/ai/Life(seconds, times_fired) //doesn't call parent because it's a horrible mess if(stat == DEAD) return diff --git a/code/modules/mob/living/silicon/decoy/life.dm b/code/modules/mob/living/silicon/decoy/life.dm index ade3c535506..353bf4259ff 100644 --- a/code/modules/mob/living/silicon/decoy/life.dm +++ b/code/modules/mob/living/silicon/decoy/life.dm @@ -1,4 +1,4 @@ -/mob/living/silicon/decoy/Life() +/mob/living/silicon/decoy/Life(seconds, times_fired) if(src.stat == 2) return else diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index ec40dff7739..abcfc6bd643 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -1,4 +1,4 @@ -/mob/living/silicon/pai/Life() +/mob/living/silicon/pai/Life(seconds, times_fired) . = ..() if(.) //if(secHUD == 1) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index f42f19b67fa..afa10c1772b 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -1,4 +1,4 @@ -/mob/living/silicon/robot/Life() +/mob/living/silicon/robot/Life(seconds, times_fired) set invisibility = 0 set background = BACKGROUND_ENABLED diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index c292d33f39a..ef5de1908a8 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -267,7 +267,7 @@ Auto Patrol: []"}, C.visible_message("[src] has [harmbaton ? "beaten" : "stunned"] [C]!",\ "[src] has [harmbaton ? "beaten" : "stunned"] you!") -/mob/living/simple_animal/bot/secbot/Life() +/mob/living/simple_animal/bot/secbot/Life(seconds, times_fired) . = ..() if(flashing_lights) switch(light_color) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index b942ce4107b..a6fcf4b5a20 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -285,7 +285,7 @@ AIStatus = AI_ON environment_smash = 1 //only token destruction, don't smash the cult wall NO STOP -/mob/living/simple_animal/hostile/construct/behemoth/Life() +/mob/living/simple_animal/hostile/construct/behemoth/Life(seconds, times_fired) weakened = 0 return ..() diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index 7afa9debe25..ea7db302c43 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -46,7 +46,7 @@ Read_Memory() ..() -/mob/living/simple_animal/pet/cat/Runtime/Life() +/mob/living/simple_animal/pet/cat/Runtime/Life(seconds, times_fired) if(!cats_deployed && ticker.current_state >= GAME_STATE_SETTING_UP) Deploy_The_Cats() if(!stat && ticker.current_state == GAME_STATE_FINISHED && !memory_saved) diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 24772ff473c..613f91e024c 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -37,7 +37,7 @@ if(gender == NEUTER) gender = pick(MALE, FEMALE) -/mob/living/simple_animal/pet/corgi/Life() +/mob/living/simple_animal/pet/corgi/Life(seconds, times_fired) . = ..() regenerate_icons() @@ -612,7 +612,7 @@ A.fire() return -/mob/living/simple_animal/pet/corgi/Ian/borgi/Life() +/mob/living/simple_animal/pet/corgi/Ian/borgi/Life(seconds, times_fired) ..() if(emagged && prob(25)) var/mob/living/carbon/target = locate() in view(10,src) diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/simple_animal/friendly/crab.dm index 99db2236612..665afa16cb2 100644 --- a/code/modules/mob/living/simple_animal/friendly/crab.dm +++ b/code/modules/mob/living/simple_animal/friendly/crab.dm @@ -34,7 +34,7 @@ Move(get_step(src, east_vs_west), east_vs_west) turns_since_move = 0 -/mob/living/simple_animal/crab/Life() +/mob/living/simple_animal/crab/Life(seconds, times_fired) . = ..() regenerate_icons() diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index ab1a94cbcc6..a8784a6d150 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -52,7 +52,7 @@ if(SV) SV.eat(src) -/mob/living/simple_animal/hostile/retaliate/goat/Life() +/mob/living/simple_animal/hostile/retaliate/goat/Life(seconds, times_fired) . = ..() if(stat == CONSCIOUS && prob(5)) milk_content = min(50, milk_content+rand(5, 10)) @@ -132,7 +132,7 @@ else ..() -/mob/living/simple_animal/cow/Life() +/mob/living/simple_animal/cow/Life(seconds, times_fired) . = ..() if(stat == CONSCIOUS && prob(5)) milk_content = min(50, milk_content+rand(5, 10)) @@ -188,7 +188,7 @@ pixel_x = rand(-6, 6) pixel_y = rand(0, 10) -/mob/living/simple_animal/chick/Life() +/mob/living/simple_animal/chick/Life(seconds, times_fired) . =..() if(.) amount_grown += rand(1,2) @@ -267,7 +267,7 @@ var/global/chicken_count = 0 else ..() -/mob/living/simple_animal/chicken/Life() +/mob/living/simple_animal/chicken/Life(seconds, times_fired) . = ..() if((. && prob(3) && eggsleft > 0) && egg_type) visible_message("[src] [pick(layMessage)]") diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 5972d0f6e4b..a7a62c74c0b 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -39,7 +39,7 @@ for(var/mob/M in view()) M << 'sound/effects/mousesqueek.ogg' -/mob/living/simple_animal/mouse/Life() +/mob/living/simple_animal/mouse/Life(seconds, times_fired) . = ..() if(stat == UNCONSCIOUS) if(ckey || prob(1)) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index a06ea9bd80d..283936acb44 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -57,7 +57,7 @@ target = null return ..() -/mob/living/simple_animal/hostile/Life() +/mob/living/simple_animal/hostile/Life(seconds, times_fired) . = ..() if(!.) walk(src, 0) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 50c24f0ac0b..971adc431cc 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -75,7 +75,7 @@ Difficulty: Hard /obj/effect/decal/cleanable/blood/gibs/bubblegum/can_bloodcrawl_in() return TRUE -/mob/living/simple_animal/hostile/megafauna/bubblegum/Life() +/mob/living/simple_animal/hostile/megafauna/bubblegum/Life(seconds, times_fired) ..() move_to_delay = Clamp((health/maxHealth) * 10, 5, 10) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 8d249c7f9e2..fe80846935d 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -76,7 +76,7 @@ Difficulty: Hard internal_gps = new/obj/item/gps/internal/hierophant(src) spawned_rune = new(loc) -/mob/living/simple_animal/hostile/megafauna/hierophant/Life() +/mob/living/simple_animal/hostile/megafauna/hierophant/Life(seconds, times_fired) . = ..() if(. && spawned_rune && !client) if(target || loc == spawned_rune.loc) diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 9dab58daa4a..5832f7bdd60 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -51,7 +51,7 @@ var/attempt_open = 0 // Pickup loot -/mob/living/simple_animal/hostile/mimic/crate/initialize() +/mob/living/simple_animal/hostile/mimic/crate/Initialize() ..() for(var/obj/item/I in loc) I.loc = src diff --git a/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm b/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm index a026d33ed8d..3063c5a8ce1 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm @@ -269,7 +269,7 @@ stat_attack = 1 robust_searching = 1 -/mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion/Life() +/mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion/Life(seconds, times_fired) if(isturf(loc)) for(var/mob/living/carbon/human/H in view(src,1)) //Only for corpse right next to/on same tile if(H.stat == UNCONSCIOUS) diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index 7346473de94..2c775074253 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -42,7 +42,7 @@ else to_chat(user, "It looks like it's been roughed up.") -/mob/living/simple_animal/hostile/mushroom/Life() +/mob/living/simple_animal/hostile/mushroom/Life(seconds, times_fired) ..() if(!stat)//Mushrooms slowly regenerate if conscious, for people who want to save them from being eaten adjustBruteLoss(-2) diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm index 0e1d5eddd71..90586bb43c6 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm @@ -62,7 +62,7 @@ return ..() //self repair systems have a chance to bring the drone back to life -/mob/living/simple_animal/hostile/retaliate/malf_drone/Life() +/mob/living/simple_animal/hostile/retaliate/malf_drone/Life(seconds, times_fired) //emps and lots of damage can temporarily shut us down if(disabled > 0) diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm index 14b1af87b0a..f9516739e6f 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm @@ -56,7 +56,7 @@ if(.) custom_emote(1, "wails at [.]") -/mob/living/simple_animal/hostile/retaliate/ghost/Life() +/mob/living/simple_animal/hostile/retaliate/ghost/Life(seconds, times_fired) if(target) invisibility = pick(0,0,60,invisibility) else diff --git a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm index 27bd2f3ee1c..d63d43b4919 100644 --- a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm +++ b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm @@ -190,7 +190,7 @@ SW.death() -/mob/living/simple_animal/hostile/spaceWorm/Life() +/mob/living/simple_animal/hostile/spaceWorm/Life(seconds, times_fired) if(nextWorm && !(Adjacent(nextWorm))) Detach(0) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/purple.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/purple.dm index c9309715443..5c483b4e3e9 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/purple.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/purple.dm @@ -48,7 +48,7 @@ visible_message("[src] chitters in the direction of [Q]!") . = ..() -/mob/living/simple_animal/hostile/poison/terror_spider/purple/Life() +/mob/living/simple_animal/hostile/poison/terror_spider/purple/Life(seconds, times_fired) . = ..() if(.) // if mob is NOT dead if(!degenerate && spider_myqueen) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm index 5edcbe919c2..9133b8cc14c 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm @@ -61,7 +61,7 @@ spider_growinstantly = 1 spider_spawnfrequency = 150 -/mob/living/simple_animal/hostile/poison/terror_spider/queen/Life() +/mob/living/simple_animal/hostile/poison/terror_spider/queen/Life(seconds, times_fired) . = ..() if(.) // if mob is NOT dead if(ckey && canlay < 12 && hasnested) // max 12 eggs worth stored at any one time, realistically that's tons. diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm index cd01006546c..ef456ddcb0e 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm @@ -292,7 +292,7 @@ var/global/list/ts_spiderling_list = list() handle_dying() return ..() -/mob/living/simple_animal/hostile/poison/terror_spider/Life() +/mob/living/simple_animal/hostile/poison/terror_spider/Life(seconds, times_fired) . = ..() if(!.) // if mob is dead if(prob(2)) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index c206f1499d9..dba62b4744c 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -276,7 +276,7 @@ /* * AI - Not really intelligent, but I'm calling it AI anyway. */ -/mob/living/simple_animal/parrot/Life() +/mob/living/simple_animal/parrot/Life(seconds, times_fired) ..() //Sprite and AI update for when a parrot gets pulled diff --git a/code/modules/mob/living/simple_animal/posessed_object.dm b/code/modules/mob/living/simple_animal/posessed_object.dm index 2e9d1b94bf2..9ba666ce96a 100644 --- a/code/modules/mob/living/simple_animal/posessed_object.dm +++ b/code/modules/mob/living/simple_animal/posessed_object.dm @@ -60,7 +60,7 @@ qdel(src) -/mob/living/simple_animal/possessed_object/Life() +/mob/living/simple_animal/possessed_object/Life(seconds, times_fired) ..() if(!possessed_item) // If we're a donut and someone's eaten us, for instance. diff --git a/code/modules/mob/living/simple_animal/tribbles.dm b/code/modules/mob/living/simple_animal/tribbles.dm index 5a38929b88d..3e7f1722a41 100644 --- a/code/modules/mob/living/simple_animal/tribbles.dm +++ b/code/modules/mob/living/simple_animal/tribbles.dm @@ -68,7 +68,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles, gestation = 0 -/mob/living/simple_animal/tribble/Life() +/mob/living/simple_animal/tribble/Life(seconds, times_fired) ..() if(src.health > 0) //no mostly dead procreation if(gestation != null) //neuter check diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index bb590e730f5..897f092a517 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -169,7 +169,7 @@ /mob/proc/movement_delay() return 0 -/mob/proc/Life() +/mob/proc/Life(seconds, times_fired) // handle_typing_indicator() return diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index e3c625593c5..30841f94c69 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -30,7 +30,8 @@ icon_state = "tallcabinet" -/obj/structure/filingcabinet/initialize() +/obj/structure/filingcabinet/Initialize() + ..() for(var/obj/item/I in loc) if(istype(I, /obj/item/paper) || istype(I, /obj/item/folder) || istype(I, /obj/item/photo)) I.loc = src diff --git a/code/modules/pda/cart.dm b/code/modules/pda/cart.dm index c50ae0758f4..53c61f4e27f 100644 --- a/code/modules/pda/cart.dm +++ b/code/modules/pda/cart.dm @@ -14,15 +14,6 @@ var/list/programs = list() var/list/messenger_plugins = list() -/obj/item/cartridge/New() - if(ticker && ticker.current_state >= GAME_STATE_SETTING_UP) - initialize() - -/obj/item/cartridge/initialize() - if(radio) - radio.initialize() - ..() - /obj/item/cartridge/Destroy() QDEL_NULL(radio) QDEL_LIST(programs) @@ -68,7 +59,7 @@ new/datum/data/pda/app/crew_records/security, new/datum/data/pda/app/secbot_control) -/obj/item/cartridge/security/initialize() +/obj/item/cartridge/security/Initialize() radio = new /obj/item/integrated_radio/beepsky(src) ..() @@ -118,7 +109,7 @@ desc = "A data cartridge with an integrated radio signaler module." programs = list(new/datum/data/pda/app/signaller) -/obj/item/cartridge/signal/initialize() +/obj/item/cartridge/signal/Initialize() radio = new /obj/item/integrated_radio/signal(src) ..() @@ -141,7 +132,7 @@ new/datum/data/pda/app/supply, new/datum/data/pda/app/mule_control) -/obj/item/cartridge/quartermaster/initialize() +/obj/item/cartridge/quartermaster/Initialize() radio = new /obj/item/integrated_radio/mule(src) ..() @@ -163,7 +154,7 @@ new/datum/data/pda/app/status_display) -/obj/item/cartridge/hop/initialize() +/obj/item/cartridge/hop/Initialize() radio = new /obj/item/integrated_radio/mule(src) ..() @@ -176,7 +167,7 @@ new/datum/data/pda/app/status_display) -/obj/item/cartridge/hos/initialize() +/obj/item/cartridge/hos/Initialize() radio = new /obj/item/integrated_radio/beepsky(src) ..() @@ -214,7 +205,7 @@ new/datum/data/pda/app/status_display) -/obj/item/cartridge/rd/initialize() +/obj/item/cartridge/rd/Initialize() radio = new /obj/item/integrated_radio/signal(src) ..() @@ -242,7 +233,7 @@ new/datum/data/pda/app/status_display) -/obj/item/cartridge/captain/initialize() +/obj/item/cartridge/captain/Initialize() radio = new /obj/item/integrated_radio/beepsky(src) ..() @@ -279,7 +270,7 @@ new/datum/data/pda/app/status_display) -/obj/item/cartridge/centcom/initialize() +/obj/item/cartridge/centcom/Initialize() radio = new /obj/item/integrated_radio/beepsky(src) ..() diff --git a/code/modules/pda/radio.dm b/code/modules/pda/radio.dm index 3c89c291300..b9dfe8ff7e4 100644 --- a/code/modules/pda/radio.dm +++ b/code/modules/pda/radio.dm @@ -173,7 +173,7 @@ radio_connection = null return ..() -/obj/item/integrated_radio/signal/initialize() +/obj/item/integrated_radio/signal/Initialize() if(!radio_controller) return if(src.frequency < PUBLIC_LOW_FREQ || src.frequency > PUBLIC_HIGH_FREQ) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index c5b014576fc..7580621834f 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -72,19 +72,13 @@ By design, d1 is the smallest direction and d2 is the highest var/turf/T = src.loc // hide if turf is not intact if(level==1) hide(T.intact) - cable_list += src //add it to the global cable list - - // Catches the interim-zone of worldstart and roundstart - // I want both the ticker to exist (so mapped-in cables don't trip this) - // but also not have started yet (since the zlevel system would handle this on its own otherwise) - if((ticker && ticker.current_state < GAME_STATE_PLAYING)) - attempt_init() + LAZYADD(GLOB.cable_list, src) //add it to the global cable list /obj/structure/cable/Destroy() // called when a cable is deleted if(powernet) cut_cable_from_powernet() // update the powernets - cable_list -= src //remove it from global cable list + LAZYREMOVE(GLOB.cable_list, src) //remove it from global cable list return ..() // then go ahead and delete the cable /////////////////////////////////// @@ -462,7 +456,7 @@ obj/structure/cable/proc/cable_color(var/colorC) powernet.remove_cable(src) //remove the cut cable from its powernet // queue it to rebuild - deferred_powernet_rebuilds += O + SSmachines.deferred_powernet_rebuilds += O // Disconnect machines connected to nodes if(d1 == 0) // if we cut a node (O-X) cable diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 4def1c3b067..8c9ee3eda0d 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -35,7 +35,7 @@ if(powernet) disconnect_from_network() -/obj/machinery/power/generator/initialize() +/obj/machinery/power/generator/Initialize() ..() connect() diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index ad73a6ff0ad..42f7cbde657 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -85,20 +85,12 @@ var/const/GRAV_NEEDS_WRENCH = 3 // Generator which spawns with the station. // -/obj/machinery/gravity_generator/main/station/initialize() +/obj/machinery/gravity_generator/main/station/Initialize() ..() setup_parts() middle.overlays += "activated" update_list() -// -// Generator an admin can spawn -// - -/obj/machinery/gravity_generator/main/station/admin/New() - ..() - initialize() - // // Main Generator with the main code // diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index 72e30b9d29a..2892d0245b2 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -112,7 +112,7 @@ var/temperature = 0 //The current temperature var/overheating = 0 //if this gets high enough the generator explodes -/obj/machinery/power/port_gen/pacman/initialize() +/obj/machinery/power/port_gen/pacman/Initialize() ..() if(anchored) connect_to_network() diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index fd5946b7dc4..15b47a47635 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -232,26 +232,6 @@ . += C return . -/hook/startup/proc/buildPowernets() - return makepowernets() - -// rebuild all power networks from scratch - only called at world creation or by the admin verb -/proc/makepowernets() - for(var/datum/powernet/PN in powernets) - qdel(PN) - powernets.Cut() - - for(var/obj/structure/cable/PC in cable_list) - makepowernet_for(PC) - - return 1 - -/proc/makepowernet_for(var/obj/structure/cable/PC) - if(!PC.powernet) - var/datum/powernet/NewPN = new() - NewPN.add_cable(PC) - propagate_network(PC,PC.powernet) - //remove the old powernet and replace it with a new one throughout the network. /proc/propagate_network(var/obj/O, var/datum/powernet/PN) //log_world("propagating new network") diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index 416de55f6c3..a07d854380d 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -16,7 +16,7 @@ /datum/powernet/New() - powernets += src + SSmachines.powernets += src ..() /datum/powernet/Destroy() @@ -28,7 +28,7 @@ nodes -= M M.powernet = null - powernets -= src + SSmachines.powernets -= src return ..() //Returns the amount of excess power (before refunding to SMESs) from last tick. diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 58cecbc8ecc..70cd75bf85d 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -76,12 +76,13 @@ return rotate() -/obj/machinery/power/emitter/initialize() +/obj/machinery/power/emitter/Initialize() ..() if(state == 2 && anchored) connect_to_network() if(frequency) set_frequency(frequency) + /obj/machinery/power/emitter/multitool_menu(var/mob/user,var/obj/item/multitool/P) return {"