diff --git a/code/__HELPERS/turfs.dm b/code/__HELPERS/turfs.dm index 22eedc1f8d5..12b28d8be6f 100644 --- a/code/__HELPERS/turfs.dm +++ b/code/__HELPERS/turfs.dm @@ -48,8 +48,7 @@ return locate(clearance, rand(clearance, world.maxy - clearance), Z) /proc/is_below_sound_pressure(var/turf/T) - var/datum/gas_mixture/environment = T ? T.return_air() : null - var/pressure = environment ? environment.return_pressure() : 0 + var/pressure = T.return_pressure() || 0 if(pressure < SOUND_MINIMUM_PRESSURE) return TRUE return FALSE diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index 226be776375..09ccd5bd616 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -59,7 +59,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun // Maps should not have active edges on boot. If we've got some, log it so it can get fixed. if(active_edges.len) var/list/edge_log = list() - for(var/connection_edge/E in active_edges) + for(var/datum/zas_edge/E in active_edges) edge_log += "Active Edge [E] ([E.type])" for(var/turf/T in E.connecting_turfs) edge_log += "+--- Connecting Turf [T] ([T.type]) @ [T.x], [T.y], [T.z] ([T.loc])" @@ -149,7 +149,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun #endif if(MC_TICK_CHECK) return - + if(LAZYLEN(selfblock_deferred) != 0) stack_trace("WARNING: selfblock_deffered was not empty (length [LAZYLEN(selfblock_deferred)])") src.selfblock_deferred = null @@ -160,7 +160,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun while(currentrun.len) - var/connection_edge/edge = currentrun[currentrun.len] + var/datum/zas_edge/edge = currentrun[currentrun.len] currentrun.len-- if(edge) // TODO - Do we need to check this? Old one didn't, but old one was single-threaded. edge.tick() @@ -173,7 +173,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun while(currentrun.len) - var/zone/Z = currentrun[currentrun.len] + var/datum/zas_zone/Z = currentrun[currentrun.len] currentrun.len-- if(Z) // TODO - Do we need to check this? Old one didn't, but old one was single-threaded. Z.process_fire() @@ -187,7 +187,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun var/list/currentrun = src.currentrun var/dt = (flags & SS_TICKER)? (wait * world.tick_lag * 0.1) : (wait * 0.1) while(currentrun.len) - var/obj/fire/fire = currentrun[currentrun.len] + var/atom/movable/fire/fire = currentrun[currentrun.len] currentrun.len-- if(fire) // TODO - Do we need to check this? Old one didn't, but old one was single-threaded. fire.process(dt) @@ -209,7 +209,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun while(currentrun.len) - var/zone/zone = currentrun[currentrun.len] + var/datum/zas_zone/zone = currentrun[currentrun.len] currentrun.len-- if(zone) // TODO - Do we need to check this? Old one didn't, but old one was single-threaded. zone.tick() @@ -260,7 +260,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun stoplag() // Invalidate all zones - for(var/zone/zone in zones) + for(var/datum/zas_zone/zone in zones) zone.c_invalidate() // Reset all the lists diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 1e859b7835e..5540815f1dd 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -194,18 +194,6 @@ /atom/proc/reveal_blood() return -/atom/proc/assume_air(datum/gas_mixture/giver) - return null - -/atom/proc/remove_air(amount) - return null - -/atom/proc/return_air() - if(loc) - return loc.return_air() - else - return null - //return flags that should be added to the viewer's sight var. //Otherwise return a negative number to indicate that the view should be cancelled. /atom/proc/check_eye(user as mob) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index a78107411bd..bd8f9eaac2b 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -281,18 +281,6 @@ update_flag /obj/machinery/portable_atmospherics/canister/return_air() return air_contents -/obj/machinery/portable_atmospherics/canister/proc/return_temperature() - var/datum/gas_mixture/GM = src.return_air() - if(GM && GM.volume>0) - return GM.temperature - return 0 - -/obj/machinery/portable_atmospherics/canister/proc/return_pressure() - var/datum/gas_mixture/GM = src.return_air() - if(GM && GM.volume>0) - return GM.return_pressure() - return 0 - /obj/machinery/portable_atmospherics/canister/bullet_act(var/obj/item/projectile/Proj) if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN)) return diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 7714f431667..2fae3cb4d2b 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -93,8 +93,6 @@ else . += "The connect error light is blinking." - - /obj/machinery/meter/attackby(var/obj/item/W, var/mob/user) if(W.is_wrench()) playsound(src, W.usesound, 50, 1) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index a6c19be03f3..5ee1f607a06 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -213,7 +213,7 @@ return L -mob/living/proc/near_camera() +/mob/living/proc/near_camera() if (!isturf(loc)) return 0 else if(!cameranet.checkVis(src)) @@ -261,16 +261,16 @@ mob/living/proc/near_camera() if(T && (T.z in GLOB.using_map.station_levels) && hassensorlevel(src, SUIT_SENSOR_TRACKING)) return TRACKING_POSSIBLE -mob/living/proc/tracking_initiated() +/mob/living/proc/tracking_initiated() -mob/living/silicon/robot/tracking_initiated() +/mob/living/silicon/robot/tracking_initiated() tracking_entities++ if(tracking_entities == 1 && has_zeroth_law()) to_chat(src, "Internal camera is currently being accessed.") -mob/living/proc/tracking_cancelled() +/mob/living/proc/tracking_cancelled() -mob/living/silicon/robot/tracking_initiated() +/mob/living/silicon/robot/tracking_initiated() tracking_entities-- if(!tracking_entities && has_zeroth_law()) to_chat(src, "Internal camera is no longer being accessed.") diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 43607547922..de360d76387 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -461,7 +461,7 @@ operating = 0 //I shall not add a check every x ticks if a door has closed over some fire. - var/obj/fire/fire = locate() in loc + var/atom/movable/fire/fire = locate() in loc if(fire) qdel(fire) diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index e9fe69de3ea..6a31c2f49dd 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -113,7 +113,7 @@ FIRE ALARM updateDialog() last_process = world.timeofday - if(locate(/obj/fire) in src.loc) + if(locate(/atom/movable/fire) in src.loc) alarm() return diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 444903340da..c3dd693f4a6 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -186,7 +186,7 @@ /obj/machinery/telecomms/proc/checkheat() // Checks heat from the environment and applies any integrity damage - var/datum/gas_mixture/environment = loc.return_air() + var/datum/gas_mixture/environment = loc.return_temperature() var/damage_chance = 0 // Percent based chance of applying 1 integrity damage this tick switch(environment.temperature) if((T0C + 40) to (T0C + 70)) // 40C-70C, minor overheat, 10% chance of taking damage diff --git a/code/game/mecha/equipment/tools/generator.dm b/code/game/mecha/equipment/tools/generator.dm index 4ae7b1ae6af..1800c223c45 100644 --- a/code/game/mecha/equipment/tools/generator.dm +++ b/code/game/mecha/equipment/tools/generator.dm @@ -96,11 +96,11 @@ return var/datum/gas_mixture/GM = new if(prob(10)) - T.assume_gas("phoron", 100, 1500+T0C) + T.assume_gas(/datum/gas/phoron, 100, 1500+T0C) T.visible_message("The [src] suddenly disgorges a cloud of heated phoron.") destroy() else - T.assume_gas("phoron", 5, istype(T) ? T.air.temperature : T20C) + T.assume_gas(/datum/gas/phoron, 5, istype(T) ? T.air.temperature : T20C) T.visible_message("The [src] suddenly disgorges a cloud of phoron.") T.assume_air(GM) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index e23c96f9b65..936a09e424b 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -360,7 +360,7 @@ cabin_air = new cabin_air.temperature = T20C cabin_air.volume = 200 - cabin_air.adjust_multi("oxygen", O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature), "nitrogen", N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)) + cabin_air.adjust_multi(/datum/gas/oxygen, O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature), /datum/gas/nitrogen, N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)) return cabin_air /obj/mecha/proc/add_radio() @@ -1593,49 +1593,12 @@ //////// Atmospheric stuff //////// ///////////////////////////////////// -/obj/mecha/proc/get_turf_air() - var/turf/T = get_turf(src) - if(T) - . = T.return_air() - return - -/obj/mecha/remove_air(amount) - var/obj/item/mecha_parts/component/gas/GC = internal_components[MECH_GAS] - if(use_internal_tank && (GC && prob(GC.get_efficiency() * 100))) - return cabin_air.remove(amount) - else - var/turf/T = get_turf(src) - if(T) - return T.remove_air(amount) - return - /obj/mecha/return_air() - if(use_internal_tank) + RETURN_TYPE(/datum/gas_mixture) + var/obj/item/mecha_parts/component/gas/GC = internal_components[MECH_GAS] + if(use_internal_tank && GC && prob(GC.get_efficiency() * 100)) return cabin_air - return get_turf_air() - -/obj/mecha/proc/return_pressure() - . = 0 - var/obj/item/mecha_parts/component/gas/GC = internal_components[MECH_GAS] - if(use_internal_tank && (GC && prob(GC.get_efficiency() * 100))) - . = cabin_air.return_pressure() - else - var/datum/gas_mixture/t_air = get_turf_air() - if(t_air) - . = t_air.return_pressure() - return - -//skytodo: //No idea what you want me to do here, mate. -/obj/mecha/proc/return_temperature() - . = 0 - var/obj/item/mecha_parts/component/gas/GC = internal_components[MECH_GAS] - if(use_internal_tank && (GC && prob(GC.get_efficiency() * 100))) - . = cabin_air.temperature - else - var/datum/gas_mixture/t_air = get_turf_air() - if(t_air) - . = t_air.temperature - return + return loc?.return_air() /obj/mecha/proc/connect(obj/machinery/atmospherics/portables_connector/new_port) //Make sure not already connected to something else @@ -2743,7 +2706,7 @@ var/datum/gas_mixture/removed = tank_air.remove(transfer_moles) cabin_air.merge(removed) else if(pressure_delta < 0) //cabin pressure higher than release pressure - var/datum/gas_mixture/t_air = mecha.get_turf_air() + var/datum/gas_mixture/t_air = mecha.loc.return_air() pressure_delta = cabin_pressure - release_pressure if(t_air) pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta) diff --git a/code/game/objects/items/devices/communicator/helper.dm b/code/game/objects/items/devices/communicator/helper.dm index 0a6cc0e05b1..b0508f8b2f2 100644 --- a/code/game/objects/items/devices/communicator/helper.dm +++ b/code/game/objects/items/devices/communicator/helper.dm @@ -6,10 +6,10 @@ var/pressure = environment.return_pressure() var/total_moles = environment.total_moles if (total_moles) - var/o2_level = environment.gas["oxygen"]/total_moles - var/n2_level = environment.gas["nitrogen"]/total_moles - var/co2_level = environment.gas["carbon_dioxide"]/total_moles - var/phoron_level = environment.gas["phoron"]/total_moles + var/o2_level = environment.gas[/datum/gas/oxygen]/total_moles + var/n2_level = environment.gas[/datum/gas/nitrogen]/total_moles + var/co2_level = environment.gas[/datum/gas/carbon_dioxide]/total_moles + var/phoron_level = environment.gas[/datum/gas/phoron]/total_moles var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level) // Label is what the entry is describing diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index bf83758a442..8c2415c2e50 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -314,24 +314,32 @@ var/list/global/tank_gauge_cache = list() else to_chat(user, "You need something to connect to \the [src].") -/obj/item/tank/remove_air(amount) +/obj/item/tank/proc/remove_air_by_flag(flag, amount) + . = air_contents.remove_by_flag(flag, amount) START_PROCESSING(SSobj, src) - return air_contents.remove(amount) /obj/item/tank/return_air() - START_PROCESSING(SSobj, src) return air_contents - /obj/item/tank/assume_air(datum/gas_mixture/giver) + . = ..() START_PROCESSING(SSobj, src) - air_contents.merge(giver) - //handle_tolerances(ASSUME_AIR_DT_FACTOR) - check_status() - return TRUE -/obj/item/tank/proc/remove_air_by_flag(flag, amount) - return air_contents.remove_by_flag(flag, amount) +/obj/item/tank/assume_gas(gasid, moles, temp) + . = ..() + START_PROCESSING(SSobj, src) + +/obj/item/tank/add_thermal_energy(joules) + . = ..() + START_PROCESSING(SSobj, src) + +/obj/item/tank/remove_moles(moles) + . = ..() + START_PROCESSING(SSobj, src) + +/obj/item/tank/remove_volume(liters) + . = ..() + START_PROCESSING(SSobj, src) /obj/item/tank/proc/remove_air_volume(volume_to_return) if(!air_contents) @@ -343,7 +351,7 @@ var/list/global/tank_gauge_cache = list() var/moles_needed = distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature) - return remove_air(moles_needed) + return remove_moles(moles_needed) /obj/item/tank/process(delta_time) //Allow for reactions diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index cb7f5844d66..63269d0a62b 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -57,24 +57,6 @@ /obj/item/proc/is_used_on(obj/O, mob/user) -/obj/assume_air(datum/gas_mixture/giver) - if(loc) - return loc.assume_air(giver) - else - return null - -/obj/remove_air(amount) - if(loc) - return loc.remove_air(amount) - else - return null - -/obj/return_air() - if(loc) - return loc.return_air() - else - return null - /obj/proc/updateUsrDialog() if(in_use) var/is_in_use = 0 diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index fec3a881024..3fb1c2153fe 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -154,7 +154,6 @@ return FALSE return TRUE - /obj/structure/bonfire/proc/extinguish() if(burning) burning = FALSE diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index d6c35fe42fc..b0e75483cfc 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -269,7 +269,7 @@ visible_message("The anti-tamper mechanism of [src] causes a small fire!") for(var/atom/movable/A as mob|obj in src) // For every item in the box, we spawn a pile of ash. new /obj/effect/decal/cleanable/ash(src.loc) - new /obj/fire(src.loc) + new /atom/movable/fire(src.loc) qdel(src) if(5) visible_message("The anti-tamper mechanism of [src] fails!") diff --git a/code/game/objects/structures/medical_stand_vr.dm b/code/game/objects/structures/medical_stand_vr.dm index dc7eb494762..264caf100ed 100644 --- a/code/game/objects/structures/medical_stand_vr.dm +++ b/code/game/objects/structures/medical_stand_vr.dm @@ -384,8 +384,9 @@ else breather.internals?.icon_state = "internal0" breather.internal = null + else if (valve_opened) - var/datum/gas_mixture/removed = tank.remove_air(0.01) + var/datum/gas_mixture/removed = tank.remove_moles(0.01) var/datum/gas_mixture/environment = loc.return_air() environment.merge(removed) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index 5e94edc5511..57b533847a6 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -347,12 +347,6 @@ /obj/structure/transit_tube_pod/return_air() return air_contents -/obj/structure/transit_tube_pod/assume_air(datum/gas_mixture/giver) - return air_contents.merge(giver) - -/obj/structure/transit_tube_pod/remove_air(amount) - return air_contents.remove(amount) - // Called when a pod arrives at, and before a pod departs from a station, // giving it a chance to mix its internal air supply with the turf it is // currently on. diff --git a/code/game/turfs/simulated/water.dm b/code/game/turfs/simulated/water.dm index 110628d34b4..4bbb396d2a4 100644 --- a/code/game/turfs/simulated/water.dm +++ b/code/game/turfs/simulated/water.dm @@ -56,11 +56,11 @@ var/datum/gas_mixture/water_breath = new() var/datum/gas_mixture/above_air = return_air() var/amount = 300 - water_breath.adjust_gas("oxygen", amount) // Assuming water breathes just extract the oxygen directly from the water. + water_breath.adjust_gas(/datum/gas/oxygen, amount) // Assuming water breathes just extract the oxygen directly from the water. water_breath.temperature = above_air.temperature return return_air() else - var/gasid = "carbon_dioxide" + var/gasid = /datum/gas/carbon_dioxide if(ishuman(L)) var/mob/living/carbon/human/H = L if(H.species && H.species.exhale_type) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 683838c2cb4..4ff066c3d8f 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -40,7 +40,7 @@ var/old_lc_bottomright = lc_bottomright var/old_lc_bottomleft = lc_bottomleft - var/obj/fire/old_fire = fire + var/atom/movable/fire/old_fire = fire var/old_outdoors = outdoors var/old_dangerous_objects = dangerous_objects diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 59fd560d3c0..08a3601cd6c 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1980,13 +1980,13 @@ PlayerNotesPage(text2num(href_list["index"])) return -mob/living/proc/can_centcom_reply() +/mob/living/proc/can_centcom_reply() return 0 -mob/living/carbon/human/can_centcom_reply() +/mob/living/carbon/human/can_centcom_reply() return istype(l_ear, /obj/item/radio/headset) || istype(r_ear, /obj/item/radio/headset) -mob/living/silicon/ai/can_centcom_reply() +/mob/living/silicon/ai/can_centcom_reply() return common_radio != null && !check_unable(2) /atom/proc/extra_admin_link() diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 4f6b11dd6fe..8f712484a4d 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -10,12 +10,12 @@ var/inactive_groups = air_master.zones.len - active_groups var/hotspots = 0 - for(var/obj/fire/hotspot in world) + for(var/atom/movable/fire/hotspot in world) hotspots++ var/active_on_main_station = 0 var/inactive_on_main_station = 0 - for(var/zone/zone in air_master.zones) + for(var/datum/zas_zone/zone in air_master.zones) var/turf/simulated/turf = locate() in zone.contents if(turf && (turf.z in GLOB.using_map.station_levels)) if(zone.needs_update) diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index 05124d6155f..9db85529226 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -28,7 +28,7 @@ to_chat(usr, "\[2/5\] - All pipenets purged of gas.") // Delete all zones. - for(var/zone/Z in world) + for(var/datum/zas_zone/Z in world) Z.c_invalidate() to_chat(usr, "\[3/5\] - All ZAS Zones removed.") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 8fbcc9b5ae2..94dc5077024 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -204,7 +204,7 @@ var/list/debug_verbs = list ( /client/var/usedZAScolors = 0 /client/var/list/image/ZAScolors = list() -/client/proc/recurse_zone(var/zone/Z, var/recurse_level =1) +/client/proc/recurse_zone(var/datum/zas_zone/Z, var/recurse_level =1) testZAScolors_zones += Z if(recurse_level > 10) return @@ -213,8 +213,8 @@ var/list/debug_verbs = list ( for(var/turf/T in Z.contents) images += image(yellow, T, "zasdebug", TURF_LAYER) testZAScolors_turfs += T - for(var/connection_edge/zone/edge in Z.edges) - var/zone/connected = edge.get_connected_zone(Z) + for(var/datum/zas_edge/zone/edge in Z.edges) + var/datum/zas_zone/connected = edge.get_connected_zone(Z) if(connected in testZAScolors_zones) continue recurse_zone(connected,recurse_level+1) @@ -249,14 +249,14 @@ var/list/debug_verbs = list ( for(var/turf/T in location.zone.contents) images += image(green, T,"zasdebug", TURF_LAYER) testZAScolors_turfs += T - for(var/connection_edge/zone/edge in location.zone.edges) - var/zone/Z = edge.get_connected_zone(location.zone) + for(var/datum/zas_edge/zone/edge in location.zone.edges) + var/datum/zas_zone/Z = edge.get_connected_zone(location.zone) testZAScolors_zones += Z for(var/turf/T in Z.contents) images += image(blue, T,"zasdebug",TURF_LAYER) testZAScolors_turfs += T - for(var/connection_edge/zone/z_edge in Z.edges) - var/zone/connected = z_edge.get_connected_zone(Z) + for(var/datum/zas_edge/zone/z_edge in Z.edges) + var/datum/zas_zone/connected = z_edge.get_connected_zone(Z) if(connected in testZAScolors_zones) continue recurse_zone(connected,1) diff --git a/code/__HELPERS/atmospherics.dm b/code/modules/atmospherics/analyzer_hooks.dm similarity index 100% rename from code/__HELPERS/atmospherics.dm rename to code/modules/atmospherics/analyzer_hooks.dm diff --git a/code/modules/atmospherics/environmental/ZAS_airpass.dm b/code/modules/atmospherics/environmental/ZAS_airpass.dm deleted file mode 100644 index ff7bd09c0cf..00000000000 --- a/code/modules/atmospherics/environmental/ZAS_airpass.dm +++ /dev/null @@ -1 +0,0 @@ -// placeholder diff --git a/code/modules/atmospherics/environmental/ZAS_turf.dm b/code/modules/atmospherics/environmental/ZAS_turf.dm deleted file mode 100644 index ff7bd09c0cf..00000000000 --- a/code/modules/atmospherics/environmental/ZAS_turf.dm +++ /dev/null @@ -1 +0,0 @@ -// placeholder diff --git a/code/modules/atmospherics/environmental/turf.dm b/code/modules/atmospherics/environmental/turf.dm new file mode 100644 index 00000000000..b2ea3dcef99 --- /dev/null +++ b/code/modules/atmospherics/environmental/turf.dm @@ -0,0 +1,40 @@ +// everything relating to turfs for atmospherics - environmental +/turf + /// our air mixture, if any - this refers **just** to ours, not our zone. + var/datum/gas_mixture/air + +/** + * returns a mutable gas mixture, or null + * this does not take into account volume, and for ZAS, can return a whole room's air + * for operations that care about this, prefer using other procs! + */ +/atom/proc/return_air() + RETURN_TYPE(/datum/gas_mixture) + return loc?.return_air() + +/area/return_air() + CRASH("How was /area reached?") + +/turf/return_air() + RETURN_TYPE(/datum/gas_mixture) + //Create gas mixture to hold data for passing + var/datum/gas_mixture/GM = new + GM.copy_from_turf(src) + return GM + +// ATMOS_TODO: remove /unsimulated +/turf/simulated/return_air() + RETURN_TYPE(/datum/gas_mixture) + if(zone) + if(!zone.invalid) + air_master.mark_zone_update(zone) + return zone.air + else + if(!air) + make_air() + c_copy_air() + return air + else + if(!air) + make_air() + return air diff --git a/code/modules/atmospherics/environmental/turf_public.dm b/code/modules/atmospherics/environmental/turf_public.dm new file mode 100644 index 00000000000..ce174ac3787 --- /dev/null +++ b/code/modules/atmospherics/environmental/turf_public.dm @@ -0,0 +1,99 @@ +// when writing atmos machinery, prefer using these procs +// this lets us somewhat separate API from implemenetation of the environmental module. +// a lot of things are on atom instead, since stuff like breathing should work with inside, say, bluespace bodybags. +// these procs should *all* be agnostic to whether we're using tile or zone atmos +// * this means, that, things like return_air() will never be in this, because return_air() must return a mutable mixture +// and doing that is dangerous other than for machines that check volume, etc. +// instead, we will have things like copy_cell_volume(), remove_cell_volume(), which are immutable but are agnostic +// * procs in here are by that mentality, babyproofed. +// * by no means are things like return_air() banned - they're just unpreferred because then changes to environmental +// will affect how machines work. + +/** + * merges all gases from giver into us + * giver is untouched + */ +/atom/proc/assume_air(datum/gas_mixture/giver) + return_air()?.merge(giver) + +/** + * adds x moles of a specific gasid at y temperature + * for mass adds, use assume_air with a mixture instead for performance. + */ +/atom/proc/assume_gas(gasid, moles, temp) + if(isnull(temp)) + return_air()?.adjust_gas(gasid, moles) + else + return_air()?.adjust_gas_temp(gasid, moles, temp) + +/** + * removes a gas mixture of x moles + */ +/atom/proc/remove_moles(moles) + RETURN_TYPE(/datum/gas_mixture) + return return_air()?.remove(moles) + +/** + * removes a gas mixture of x volume + */ +/atom/proc/remove_volume(liters) + RETURN_TYPE(/datum/gas_mixture) + return return_air()?.remove_volume(liters) + +/** + * add/remove thermal energy from air + */ +/atom/proc/add_thermal_energy(joules) + return return_air()?.add_thermal_energy(joules) + +/** + * get thermal energy needed for our air to be x temperature + */ +/atom/proc/get_thermal_energy_change(target_temperature) + return return_air()?.get_thermal_energy_change(target_temperature) || 0 + +/** + * remove CELL_VOLUME's worth of air + */ +/atom/proc/remove_cell_volume() + RETURN_TYPE(/datum/gas_mixture) + return remove_volume(CELL_VOLUME) + +/** + * remove a multiple of CELL_VOLUME's worth of air + */ +/atom/proc/remove_cell_volumes(multiplier = 1) + RETURN_TYPE(/datum/gas_mixture) + return remove_volume(CELL_VOLUME * multiplier) + +/** + * return pressure of air + */ +/atom/proc/return_pressure() + return return_air()?.return_pressure() + +/** + * gets a **copy** (read: changing this won't affect turf) of a cell volume's worth of air + */ +/atom/proc/copy_cell_volume() + RETURN_TYPE(/datum/gas_mixture) + return return_air().copy_single_tile() + +/** + * return temperature of air + */ +/atom/proc/return_temperature() + return return_air()?.temperature + +/** + * gets moles of gas in a single turf's worth of air + * inefficient; use copy_cell_volume() if you're getting more than 2-3 gases! + */ +/atom/proc/get_cell_moles(gasid) + return copy_cell_volume()?.gas[gasid] + +/** + * gets full gas list of all gases in a single turf's worth of air + */ +/atom/proc/get_cell_gases() + return copy_cell_volume()?.gas.Copy() diff --git a/code/modules/atmospherics/zas/_docs.dm b/code/modules/atmospherics/environmental/zas/_docs.dm similarity index 84% rename from code/modules/atmospherics/zas/_docs.dm rename to code/modules/atmospherics/environmental/zas/_docs.dm index 382f1f0abbf..e61f16195ba 100644 --- a/code/modules/atmospherics/zas/_docs.dm +++ b/code/modules/atmospherics/environmental/zas/_docs.dm @@ -22,7 +22,9 @@ air_master.mark_for_update(turf) Notes for people who used ZAS before: There is no connected_zones anymore. To get the zones that are connected to a zone, use this loop: - for(var/connection_edge/zone/edge in zone.edges) - var/zone/connected_zone = edge.get_connected_zone(zone) + for(var/datum/zas_edge/zone/edge in zone.edges) + var/datum/zas_zone/connected_zone = edge.get_connected_zone(zone) */ + +// everything in this folder is pending moving diff --git a/code/modules/atmospherics/zas/Airflow.dm b/code/modules/atmospherics/environmental/zas/airflow.dm similarity index 83% rename from code/modules/atmospherics/zas/Airflow.dm rename to code/modules/atmospherics/environmental/zas/airflow.dm index e1361a968bf..a728016d46f 100644 --- a/code/modules/atmospherics/zas/Airflow.dm +++ b/code/modules/atmospherics/environmental/zas/airflow.dm @@ -2,8 +2,10 @@ Contains helper procs for airflow, handled in /connection_group. */ -mob/var/tmp/last_airflow_stun = 0 -mob/proc/airflow_stun() +/mob + var/tmp/last_airflow_stun = 0 + +/mob/proc/airflow_stun() if(stat == 2) return 0 CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/stun_cooldown, stuncd) @@ -20,16 +22,16 @@ mob/proc/airflow_stun() Weaken(2) last_airflow_stun = world.time -mob/living/silicon/airflow_stun() +/mob/living/silicon/airflow_stun() return -mob/living/carbon/human/airflow_stun() +/mob/living/carbon/human/airflow_stun() if(shoes && (shoes.item_flags & NOSLIP)) to_chat(src, "Air suddenly rushes past you!") return 0 ..() -atom/movable/proc/check_airflow_movable(n) +/atom/movable/proc/check_airflow_movable(n) CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/dense_pressure, dense_pressure) if(!simulated) return 0 @@ -42,20 +44,19 @@ atom/movable/proc/check_airflow_movable(n) return 1 -mob/check_airflow_movable(n) +/mob/check_airflow_movable(n) CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/heavy_pressure, heavy_pressure) if(n < heavy_pressure) return 0 return 1 -mob/observer/check_airflow_movable() +/mob/observer/check_airflow_movable() return 0 -mob/living/silicon/check_airflow_movable() +/mob/living/silicon/check_airflow_movable() return 0 - -obj/check_airflow_movable(n) +/obj/check_airflow_movable(n) if (!(. = ..())) return 0 CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/dense_pressure, dense_pressure) @@ -74,10 +75,11 @@ obj/check_airflow_movable(n) else if(n < dense_pressure) return 0 -/atom/movable/var/tmp/turf/airflow_dest -/atom/movable/var/tmp/airflow_speed = 0 -/atom/movable/var/tmp/airflow_time = 0 -/atom/movable/var/tmp/last_airflow = 0 +/atom/movable + var/tmp/turf/airflow_dest + var/tmp/airflow_speed = 0 + var/tmp/airflow_time = 0 + var/tmp/last_airflow = 0 /atom/movable/proc/AirflowCanMove(n) return 1 @@ -100,32 +102,32 @@ obj/check_airflow_movable(n) airflow_time = 0 . = ..() -atom/movable/proc/airflow_hit(atom/A) +/atom/movable/proc/airflow_hit(atom/A) airflow_speed = 0 airflow_dest = null -mob/airflow_hit(atom/A) +/mob/airflow_hit(atom/A) for(var/mob/M in hearers(src)) M.show_message("\The [src] slams into \a [A]!",1,"You hear a loud slam!",2) playsound(src.loc, "smash.ogg", 25, 1, -1) var/weak_amt = istype(A,/obj/item) ? A:w_class : rand(1,5) //Heheheh Weaken(weak_amt) - . = ..() + return ..() -obj/airflow_hit(atom/A) +/obj/airflow_hit(atom/A) for(var/mob/M in hearers(src)) M.show_message("\The [src] slams into \a [A]!",1,"You hear a loud slam!",2) - playsound(src.loc, "smash.ogg", 25, 1, -1) - . = ..() + playsound(src, "smash.ogg", 25, 1, -1) + return ..() -obj/item/airflow_hit(atom/A) +/obj/item/airflow_hit(atom/A) airflow_speed = 0 airflow_dest = null -mob/living/carbon/human/airflow_hit(atom/A) +/mob/living/carbon/human/airflow_hit(atom/A) // for(var/mob/M in hearers(src)) // M.show_message("[src] slams into [A]!",1,"You hear a loud slam!",2) - playsound(src.loc, "punch", 25, 1, -1) + playsound(src, "punch", 25, 1, -1) if (prob(33)) loc:add_blood(src) bloody_body(src) @@ -151,9 +153,9 @@ mob/living/carbon/human/airflow_hit(atom/A) Stun(paralysis + 3) else Stun(round(airflow_speed * impact_stun/2)) - . = ..() + return ..() -zone/proc/movables() +/datum/zas_zone/proc/movables() . = list() for(var/turf/T in contents) for(var/atom/movable/A in T) diff --git a/code/modules/atmospherics/zas/Atom.dm b/code/modules/atmospherics/environmental/zas/atom.dm similarity index 100% rename from code/modules/atmospherics/zas/Atom.dm rename to code/modules/atmospherics/environmental/zas/atom.dm diff --git a/code/modules/atmospherics/zas/Connection.dm b/code/modules/atmospherics/environmental/zas/connection.dm similarity index 88% rename from code/modules/atmospherics/zas/Connection.dm rename to code/modules/atmospherics/environmental/zas/connection.dm index 27e62d9c81e..848ffd46314 100644 --- a/code/modules/atmospherics/zas/Connection.dm +++ b/code/modules/atmospherics/environmental/zas/connection.dm @@ -49,16 +49,15 @@ Class Procs: */ -/connection/var/turf/simulated/A -/connection/var/turf/simulated/B -/connection/var/zone/zoneA -/connection/var/zone/zoneB +/datum/zas_connection + var/turf/simulated/A + var/turf/simulated/B + var/datum/zas_zone/zoneA + var/datum/zas_zone/zoneB + var/datum/zas_edge/edge + var/state = 0 -/connection/var/connection_edge/edge - -/connection/var/state = 0 - -/connection/New(turf/simulated/A, turf/simulated/B) +/datum/zas_connection/New(turf/simulated/A, turf/simulated/B) #ifdef ZASDBG ASSERT(air_master.has_valid_zone(A)) //ASSERT(air_master.has_valid_zone(B)) @@ -75,33 +74,33 @@ Class Procs: edge = air_master.get_edge(A.zone,B.zone) edge.add_connection(src) -/connection/proc/mark_direct() +/datum/zas_connection/proc/mark_direct() if(!direct()) state |= CONNECTION_DIRECT edge.direct++ //to_chat(world, "Marked direct.") -/connection/proc/mark_indirect() +/datum/zas_connection/proc/mark_indirect() if(direct()) state &= ~CONNECTION_DIRECT edge.direct-- //to_chat(world, "Marked indirect.") -/connection/proc/mark_space() +/datum/zas_connection/proc/mark_space() state |= CONNECTION_SPACE -/connection/proc/direct() +/datum/zas_connection/proc/direct() return (state & CONNECTION_DIRECT) -/connection/proc/valid() +/datum/zas_connection/proc/valid() return !(state & CONNECTION_INVALID) -/connection/proc/erase() +/datum/zas_connection/proc/erase() edge.remove_connection(src) state |= CONNECTION_INVALID //to_chat(world, "Connection Erased: [state]") -/connection/proc/update() +/datum/zas_connection/proc/update() //to_chat(world, "Updated, \...") if(!istype(A,/turf/simulated)) //to_chat(world, "Invalid A.") diff --git a/code/modules/atmospherics/zas/ConnectionManager.dm b/code/modules/atmospherics/environmental/zas/connection_manager.dm similarity index 79% rename from code/modules/atmospherics/zas/ConnectionManager.dm rename to code/modules/atmospherics/environmental/zas/connection_manager.dm index 3890cd85f5c..8efe6fd4b0a 100644 --- a/code/modules/atmospherics/zas/ConnectionManager.dm +++ b/code/modules/atmospherics/environmental/zas/connection_manager.dm @@ -15,7 +15,7 @@ Class Procs: Returns the connection (if any) in this direction. Preferable to accessing the connection directly because it checks validity. - place(connection/c, d) + place(datum/zas_connection/c, d) Called by air_master.connect(). Sets the connection in the specified direction to c. update_all() @@ -25,7 +25,7 @@ Class Procs: Called when the turf is changed with ChangeTurf(). Erases all existing connections. Macros: - check(connection/c) + check(datum/zas_connection/c) Checks for connection validity. It's possible to have a reference to a connection that has been erased. @@ -34,19 +34,20 @@ Macros: // macro-ized to cut down on proc calls #define check(c) (c && c.valid()) -/turf/var/tmp/connection_manager/connections - -/connection_manager/var/connection/N -/connection_manager/var/connection/S -/connection_manager/var/connection/E -/connection_manager/var/connection/W +/turf + var/tmp/datum/connection_manager/connections +/datum/connection_manager + var/datum/zas_connection/N + var/datum/zas_connection/S + var/datum/zas_connection/E + var/datum/zas_connection/W #ifdef MULTIZAS -/connection_manager/var/connection/U -/connection_manager/var/connection/D + var/datum/zas_connection/U + var/datum/zas_connection/D #endif -/connection_manager/proc/get(d) +/datum/connection_manager/proc/get(d) switch(d) if(NORTH) if(check(N)) return N @@ -70,7 +71,7 @@ Macros: else return null #endif -/connection_manager/proc/place(connection/c, d) +/datum/connection_manager/proc/place(datum/zas_connection/c, d) switch(d) if(NORTH) N = c if(SOUTH) S = c @@ -82,7 +83,7 @@ Macros: if(DOWN) D = c #endif -/connection_manager/proc/update_all() +/datum/connection_manager/proc/update_all() if(check(N)) N.update() if(check(S)) S.update() if(check(E)) E.update() @@ -92,7 +93,7 @@ Macros: if(check(D)) D.update() #endif -/connection_manager/proc/erase_all() +/datum/connection_manager/proc/erase_all() if(check(N)) N.erase() if(check(S)) S.erase() if(check(E)) E.erase() diff --git a/code/modules/atmospherics/zas/Controller.dm b/code/modules/atmospherics/environmental/zas/controller.dm similarity index 80% rename from code/modules/atmospherics/zas/Controller.dm rename to code/modules/atmospherics/environmental/zas/controller.dm index 5ef4a13f955..6ee55c773a3 100644 --- a/code/modules/atmospherics/zas/Controller.dm +++ b/code/modules/atmospherics/environmental/zas/controller.dm @@ -24,7 +24,7 @@ Class Procs: Adds the turf to the update list. When updated, update_air_properties() will be called. When stuff changes that might affect airflow, call this. It's basically the only thing you need. - add_zone(zone/Z) and remove_zone(zone/Z) + add_zone(datum/zas_zone/Z) and remove_zone(datum/zas_zone/Z) Adds zones to the zones list. Does not mark them for update. air_blocked(turf/A, turf/B) @@ -36,7 +36,7 @@ Class Procs: Checks the presence and validity of T's zone. May be called on unsimulated turfs, returning 0. - merge(zone/A, zone/B) + merge(datum/zas_zone/A, datum/zas_zone/B) Called when zones have a direct connection and equivalent pressure and temperature. Merges the zones to create a single zone. @@ -44,23 +44,23 @@ Class Procs: Called by turf/update_air_properties(). The first argument must be simulated. Creates a connection between A and B. - mark_zone_update(zone/Z) + mark_zone_update(datum/zas_zone/Z) Adds zone to the update list. Unlike mark_for_update(), this one is called automatically whenever air is returned from a simulated turf. - equivalent_pressure(zone/A, zone/B) + equivalent_pressure(datum/zas_zone/A, datum/zas_zone/B) Currently identical to A.air.compare(B.air). Returns 1 when directly connected zones are ready to be merged. - get_edge(zone/A, zone/B) - get_edge(zone/A, turf/B) + get_edge(datum/zas_zone/A, datum/zas_zone/B) + get_edge(datum/zas_zone/A, turf/B) Gets a valid connection_edge between A and B, creating a new one if necessary. has_same_air(turf/A, turf/B) Used to determine if an unsimulated edge represents a specific turf. - Simulated edges use connection_edge/contains_zone() for the same purpose. + Simulated edges use datum/zas_edge/contains_zone() for the same purpose. Returns 1 if A has identical gases and temperature to B. - remove_edge(connection_edge/edge) + remove_edge(datum/zas_edge/edge) Called when an edge is erased. Removes it from processing. */ @@ -84,12 +84,12 @@ Class Procs: var/current_cycle = 0 var/next_id = 1 //Used to keep track of zone UIDs. -/datum/controller/subsystem/air/proc/add_zone(zone/z) +/datum/controller/subsystem/air/proc/add_zone(datum/zas_zone/z) zones.Add(z) z.name = "Zone [next_id++]" mark_zone_update(z) -/datum/controller/subsystem/air/proc/remove_zone(zone/z) +/datum/controller/subsystem/air/proc/remove_zone(datum/zas_zone/z) zones.Remove(z) zones_to_update.Remove(z) @@ -108,7 +108,7 @@ Class Procs: #endif return istype(T) && T.zone && !T.zone.invalid -/datum/controller/subsystem/air/proc/merge(zone/A, zone/B) +/datum/controller/subsystem/air/proc/merge(datum/zas_zone/A, datum/zas_zone/B) #ifdef ZASDBG ASSERT(istype(A)) ASSERT(istype(B)) @@ -156,7 +156,7 @@ Class Procs: if(A.zone == B.zone) return - var/connection/c = new /connection(A,B) + var/datum/zas_connection/c = new(A,B) A.connections.place(c, a_to_b) B.connections.place(c, b_to_a) @@ -174,7 +174,7 @@ Class Procs: #endif T.needs_air_update = 1 -/datum/controller/subsystem/air/proc/mark_zone_update(zone/Z) +/datum/controller/subsystem/air/proc/mark_zone_update(datum/zas_zone/Z) #ifdef ZASDBG ASSERT(istype(Z)) #endif @@ -182,7 +182,7 @@ Class Procs: zones_to_update.Add(Z) Z.needs_update = 1 -/datum/controller/subsystem/air/proc/mark_edge_sleeping(connection_edge/E) +/datum/controller/subsystem/air/proc/mark_edge_sleeping(datum/zas_edge/E) #ifdef ZASDBG ASSERT(istype(E)) #endif @@ -190,7 +190,7 @@ Class Procs: active_edges.Remove(E) E.sleeping = 1 -/datum/controller/subsystem/air/proc/mark_edge_active(connection_edge/E) +/datum/controller/subsystem/air/proc/mark_edge_active(datum/zas_edge/E) #ifdef ZASDBG ASSERT(istype(E)) #endif @@ -198,24 +198,24 @@ Class Procs: active_edges.Add(E) E.sleeping = 0 -/datum/controller/subsystem/air/proc/equivalent_pressure(zone/A, zone/B) +/datum/controller/subsystem/air/proc/equivalent_pressure(datum/zas_zone/A, datum/zas_zone/B) return A.air.compare(B.air) -/datum/controller/subsystem/air/proc/get_edge(zone/A, zone/B) +/datum/controller/subsystem/air/proc/get_edge(datum/zas_zone/A, datum/zas_zone/B) if(istype(B)) - for(var/connection_edge/zone/edge in A.edges) + for(var/datum/zas_edge/zone/edge in A.edges) if(edge.contains_zone(B)) return edge - var/connection_edge/edge = new/connection_edge/zone(A,B) + var/datum/zas_edge/edge = new/datum/zas_edge/zone(A,B) edges.Add(edge) edge.recheck() return edge else - for(var/connection_edge/unsimulated/edge in A.edges) + for(var/datum/zas_edge/unsimulated/edge in A.edges) if(has_same_air(edge.B,B)) return edge - var/connection_edge/edge = new/connection_edge/unsimulated(A,B) + var/datum/zas_edge/edge = new/datum/zas_edge/unsimulated(A,B) edges.Add(edge) edge.recheck() return edge @@ -231,6 +231,6 @@ Class Procs: return 1 */ -/datum/controller/subsystem/air/proc/remove_edge(connection_edge/E) +/datum/controller/subsystem/air/proc/remove_edge(datum/zas_edge/E) edges.Remove(E) if(!E.sleeping) active_edges.Remove(E) diff --git a/code/modules/atmospherics/zas/Diagnostic.dm b/code/modules/atmospherics/environmental/zas/debug.dm similarity index 70% rename from code/modules/atmospherics/zas/Diagnostic.dm rename to code/modules/atmospherics/environmental/zas/debug.dm index 035db1f7933..1bc3fd4ac3f 100644 --- a/code/modules/atmospherics/zas/Diagnostic.dm +++ b/code/modules/atmospherics/environmental/zas/debug.dm @@ -1,4 +1,25 @@ -client/proc/ZoneTick() +var/image/assigned = image('icons/Testing/Zone.dmi', icon_state = "assigned") +var/image/created = image('icons/Testing/Zone.dmi', icon_state = "created") +var/image/merged = image('icons/Testing/Zone.dmi', icon_state = "merged") +var/image/invalid_zone = image('icons/Testing/Zone.dmi', icon_state = "invalid") +var/image/air_blocked = image('icons/Testing/Zone.dmi', icon_state = "block") +var/image/zone_blocked = image('icons/Testing/Zone.dmi', icon_state = "zoneblock") +var/image/blocked = image('icons/Testing/Zone.dmi', icon_state = "fullblock") +var/image/mark = image('icons/Testing/Zone.dmi', icon_state = "mark") + +/datum/zas_edge/var/dbg_out = 0 + +/turf/var/tmp/dbg_img +/turf/proc/dbg(image/img, d = 0) + if(d > 0) img.dir = d + overlays -= dbg_img + overlays += img + dbg_img = img + +proc/soft_assert(thing,fail) + if(!thing) message_admins(fail) + +/client/proc/ZoneTick() set category = "Debug" set name = "Process Atmos" set desc = "Manually run a single tick of the air subsystem" @@ -16,7 +37,7 @@ client/proc/ZoneTick() to_chat(src, "Failed to process! ([air_master.tick_progress])") */ -client/proc/Zone_Info(turf/T as null|turf) +/client/proc/Zone_Info(turf/T as null|turf) set category = "Debug" if(T) if(istype(T,/turf/simulated) && T:zone) @@ -33,9 +54,9 @@ client/proc/Zone_Info(turf/T as null|turf) images -= zone_debug_images[zone] zone_debug_images = null -client/var/list/zone_debug_images +/client/var/list/zone_debug_images -client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf) +/client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf) set category = "Debug" if(!istype(T)) return diff --git a/code/modules/atmospherics/zas/ConnectionGroup.dm b/code/modules/atmospherics/environmental/zas/edge.dm similarity index 79% rename from code/modules/atmospherics/zas/ConnectionGroup.dm rename to code/modules/atmospherics/environmental/zas/edge.dm index 8463004a022..638d76031fd 100644 --- a/code/modules/atmospherics/zas/ConnectionGroup.dm +++ b/code/modules/atmospherics/environmental/zas/edge.dm @@ -4,7 +4,7 @@ Overview: These are what handle gas transfers between zones and into space. They are found in a zone's edges list and in air_master.edges. Each edge updates every air tick due to their role in gas transfer. - They come in two flavors, /connection_edge/zone and /connection_edge/unsimulated. + They come in two flavors, /datum/zas_edge/zone and /datum/zas_edge/unsimulated. As the type names might suggest, they handle inter-zone and spacelike connections respectively. Class Vars: @@ -15,14 +15,14 @@ Class Vars: coefficent - This is a marker for how many connections are on this edge. Used to determine the ratio of flow. - connection_edge/zone + datum/zas_edge/zone B - This holds the second zone with which the first zone equalizes. direct - This counts the number of direct (i.e. with no doors) connections on this edge. Any value of this is sufficient to make the zones mergeable. - connection_edge/unsimulated + datum/zas_edge/unsimulated B - This holds an unsimulated turf which has the gas values this edge is mimicing. @@ -30,14 +30,14 @@ Class Vars: Class Procs: - add_connection(connection/c) + add_connection(datum/zas_connection/c) Adds a connection to this edge. Usually increments the coefficient and adds a turf to connecting_turfs. - remove_connection(connection/c) + remove_connection(datum/zas_connection/c) Removes a connection from this edge. This works even if c is not in the edge, so be careful. If the coefficient reaches zero as a result, the edge is erased. - contains_zone(zone/Z) + contains_zone(datum/zas_zone/Z) Returns true if either A or B is equal to Z. Unsimulated connections return true only on A. erase() @@ -51,47 +51,46 @@ Class Procs: If repelled is true, the objects move away from any turf in connecting_turfs, otherwise they approach. A check against vsc.lightest_airflow_pressure should generally be performed before calling this. - get_connected_zone(zone/from) + get_connected_zone(datum/zas_zone/from) Helper proc that allows getting the other zone of an edge given one of them. - Only on /connection_edge/zone, otherwise use A. + Only on /datum/zas_edge/zone, otherwise use A. */ -/connection_edge/var/zone/A +/datum/zas_edge + var/datum/zas_zone/A + var/list/connecting_turfs = list() + var/direct = 0 + var/sleeping = 1 + var/coefficient = 0 -/connection_edge/var/list/connecting_turfs = list() -/connection_edge/var/direct = 0 -/connection_edge/var/sleeping = 1 - -/connection_edge/var/coefficient = 0 - -/connection_edge/New() +/datum/zas_edge/New() CRASH("Cannot make connection edge without specifications.") -/connection_edge/proc/add_connection(connection/c) +/datum/zas_edge/proc/add_connection(datum/zas_connection/c) coefficient++ if(c.direct()) direct++ //to_chat(world, "Connection added: [type] Coefficient: [coefficient]") -/connection_edge/proc/remove_connection(connection/c) +/datum/zas_edge/proc/remove_connection(datum/zas_connection/c) //to_chat(world, "Connection removed: [type] Coefficient: [coefficient-1]") coefficient-- if(coefficient <= 0) erase() if(c.direct()) direct-- -/connection_edge/proc/contains_zone(zone/Z) +/datum/zas_edge/proc/contains_zone(datum/zas_zone/Z) -/connection_edge/proc/erase() +/datum/zas_edge/proc/erase() air_master.remove_edge(src) //to_chat(world, "[type] Erased.") -/connection_edge/proc/tick() +/datum/zas_edge/proc/tick() -/connection_edge/proc/recheck() +/datum/zas_edge/proc/recheck() -/connection_edge/proc/flow(list/movable, differential, repelled) +/datum/zas_edge/proc/flow(list/movable, differential, repelled) CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/retrigger_delay, retrigger_delay) CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/stun_pressure, stun_pressure) for(var/i = 1; i <= movable.len; i++) @@ -126,9 +125,10 @@ Class Procs: spawn if(M) M.GotoAirflowDest(differential/10) -/connection_edge/zone/var/zone/B +/datum/zas_edge/zone + var/datum/zas_zone/B -/connection_edge/zone/New(zone/A, zone/B) +/datum/zas_edge/zone/New(datum/zas_zone/A, datum/zas_zone/B) src.A = A src.B = B @@ -137,23 +137,23 @@ Class Procs: //id = edge_id(A,B) //to_chat(world, "New edge between [A] and [B]") -/connection_edge/zone/add_connection(connection/c) +/datum/zas_edge/zone/add_connection(datum/zas_connection/c) . = ..() connecting_turfs.Add(c.A) -/connection_edge/zone/remove_connection(connection/c) +/datum/zas_edge/zone/remove_connection(datum/zas_connection/c) connecting_turfs.Remove(c.A) . = ..() -/connection_edge/zone/contains_zone(zone/Z) +/datum/zas_edge/zone/contains_zone(datum/zas_zone/Z) return A == Z || B == Z -/connection_edge/zone/erase() +/datum/zas_edge/zone/erase() A.edges.Remove(src) B.edges.Remove(src) . = ..() -/connection_edge/zone/tick() +/datum/zas_edge/zone/tick() CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/lightest_pressure, lightest_pressure) if(A.invalid || B.invalid) erase() @@ -187,20 +187,21 @@ Class Procs: air_master.mark_zone_update(A) air_master.mark_zone_update(B) -/connection_edge/zone/recheck() +/datum/zas_edge/zone/recheck() // Edges with only one side being vacuum need processing no matter how close. if(!A.air.compare(B.air, vacuum_exception = 1)) air_master.mark_edge_active(src) //Helper proc to get connections for a zone. -/connection_edge/zone/proc/get_connected_zone(zone/from) +/datum/zas_edge/zone/proc/get_connected_zone(datum/zas_zone/from) if(A == from) return B else return A -/connection_edge/unsimulated/var/turf/B -/connection_edge/unsimulated/var/datum/gas_mixture/air +/datum/zas_edge/unsimulated + var/turf/B + var/datum/gas_mixture/air -/connection_edge/unsimulated/New(zone/A, turf/B) +/datum/zas_edge/unsimulated/New(datum/zas_zone/A, turf/B) src.A = A src.B = B A.edges.Add(src) @@ -208,24 +209,24 @@ Class Procs: //id = 52*A.id //to_chat(world, "New edge from [A] to [B].") -/connection_edge/unsimulated/add_connection(connection/c) +/datum/zas_edge/unsimulated/add_connection(datum/zas_connection/c) . = ..() connecting_turfs.Add(c.B) air.group_multiplier = coefficient -/connection_edge/unsimulated/remove_connection(connection/c) +/datum/zas_edge/unsimulated/remove_connection(datum/zas_connection/c) connecting_turfs.Remove(c.B) air.group_multiplier = coefficient . = ..() -/connection_edge/unsimulated/erase() +/datum/zas_edge/unsimulated/erase() A.edges.Remove(src) . = ..() -/connection_edge/unsimulated/contains_zone(zone/Z) +/datum/zas_edge/unsimulated/contains_zone(datum/zas_zone/Z) return A == Z -/connection_edge/unsimulated/tick() +/datum/zas_edge/unsimulated/tick() if(A.invalid) erase() return @@ -245,7 +246,7 @@ Class Procs: air_master.mark_zone_update(A) -/connection_edge/unsimulated/recheck() +/datum/zas_edge/unsimulated/recheck() // Edges with only one side being vacuum need processing no matter how close. // Note: This handles the glaring flaw of a room holding pressure while exposed to space, but // does not specially handle the less common case of a simulated room exposed to an unsimulated pressurized turf. diff --git a/code/modules/atmospherics/zas/Fire.dm b/code/modules/atmospherics/environmental/zas/fire.dm similarity index 91% rename from code/modules/atmospherics/zas/Fire.dm rename to code/modules/atmospherics/environmental/zas/fire.dm index b680a27ffe1..b0ebcfd86b3 100644 --- a/code/modules/atmospherics/zas/Fire.dm +++ b/code/modules/atmospherics/environmental/zas/fire.dm @@ -8,20 +8,21 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin //#define FIREDBG -/turf/var/obj/fire/fire = null +/turf + var/atom/movable/fire/fire //Some legacy definitions so fires can be started. -atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) +/atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) return null -turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) +/turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) /turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh) if(fire_protection > world.time-300) return 0 - if(locate(/obj/fire) in src) + if(locate(/atom/movable/fire) in src) return 1 var/datum/gas_mixture/air_contents = return_air() if(!air_contents || exposed_temperature < PHORON_MINIMUM_BURN_TEMPERATURE) @@ -36,7 +37,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) create_fire(exposed_temperature) return igniting -/zone/proc/process_fire() +/datum/zas_zone/proc/process_fire() CACHE_VSC_PROP(atmos_vsc, /atmos/fire/consumption_rate, consumption_rate) var/datum/gas_mixture/burn_gas = air.remove_ratio(consumption_rate, fire_tiles.len) @@ -63,7 +64,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) if(!fire_tiles.len) air_master.active_fire_zones.Remove(src) -/zone/proc/remove_liquidfuel(var/used_liquid_fuel, var/remove_fire=0) +/datum/zas_zone/proc/remove_liquidfuel(var/used_liquid_fuel, var/remove_fire=0) if(!fuel_objs.len) return @@ -106,7 +107,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) return 0 -/obj/fire +/atom/movable/fire //Icon for fire on turfs. anchored = 1 @@ -121,7 +122,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) var/firelevel = 1 //Calculated by gas_mixture.calculate_firelevel() -/obj/fire/process(delta_time) +/atom/movable/fire/process(delta_time) . = 1 var/turf/simulated/my_tile = loc @@ -148,6 +149,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) L.FireBurn(firelevel, air_contents.temperature, air_contents.return_pressure()) //Burn the mobs! loc.fire_act(air_contents, air_contents.temperature, air_contents.volume) + for(var/atom/A in loc) A.fire_act(air_contents, air_contents.temperature, air_contents.volume) @@ -182,8 +184,9 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) animate(src, color = fire_color(air_contents.temperature), 5) set_light(l_color = color) -/obj/fire/Initialize(mapload, fl) +/atom/movable/fire/Initialize(mapload, fl) . = ..() + if(!istype(loc, /turf)) return INITIALIZE_HINT_QDEL @@ -196,33 +199,31 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) firelevel = fl air_master.active_hotspots.Add(src) -/obj/fire/proc/fire_color(var/env_temperature) +/atom/movable/fire/proc/fire_color(var/env_temperature) CACHE_VSC_PROP(atmos_vsc, /atmos/fire/firelevel_multiplier, firelevel_multiplier) var/temperature = max(4000*sqrt(firelevel/firelevel_multiplier), env_temperature) return heat2color(temperature) -/obj/fire/Destroy() +/atom/movable/fire/Destroy() RemoveFire() + return ..() - ..() - -/obj/fire/proc/RemoveFire() +/atom/movable/fire/proc/RemoveFire() var/turf/T = loc if (istype(T)) set_light(0) T.fire = null - loc = null air_master.active_hotspots.Remove(src) +/turf/simulated + var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again. -/turf/simulated/var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again. /turf/proc/apply_fire_protection() + /turf/simulated/apply_fire_protection() fire_protection = world.time - - /mob/living/proc/FireBurn(var/firelevel, var/last_temperature, var/pressure) CACHE_VSC_PROP(atmos_vsc, /atmos/fire/firelevel_multiplier, firelevel_multiplier) var/mx = 5 * firelevel/firelevel_multiplier * min(pressure / ONE_ATMOSPHERE, 1) diff --git a/code/modules/atmospherics/zas/Phoron.dm b/code/modules/atmospherics/environmental/zas/phoron.dm similarity index 99% rename from code/modules/atmospherics/zas/Phoron.dm rename to code/modules/atmospherics/environmental/zas/phoron.dm index 39f1f101919..6f295e642c2 100644 --- a/code/modules/atmospherics/zas/Phoron.dm +++ b/code/modules/atmospherics/environmental/zas/phoron.dm @@ -1,8 +1,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') - -obj/var/contaminated = 0 - +/obj + var/contaminated = 0 /obj/item/proc/can_contaminate() //Clothing and backpacks can be contaminated. diff --git a/code/modules/atmospherics/zas/Turf.dm b/code/modules/atmospherics/environmental/zas/turf.dm similarity index 81% rename from code/modules/atmospherics/zas/Turf.dm rename to code/modules/atmospherics/environmental/zas/turf.dm index f283d59c2de..6b1ec268a5e 100644 --- a/code/modules/atmospherics/zas/Turf.dm +++ b/code/modules/atmospherics/environmental/zas/turf.dm @@ -1,9 +1,7 @@ /turf var/needs_air_update = FALSE - var/datum/gas_mixture/air - /turf/simulated - var/zone/zone + var/datum/zas_zone/zone var/open_directions /// Do we show gas overlays? var/allow_gas_overlays = TRUE @@ -50,9 +48,8 @@ */ /turf/simulated/proc/can_safely_remove_from_zone() - - - if(!zone) return 1 + if(!zone) + return TRUE var/check_dirs = get_zone_neighbours(src) var/unconnected_dirs = check_dirs @@ -89,7 +86,6 @@ . |= dir /turf/simulated/update_air_properties() - if(zone && zone.invalid) c_copy_air() zone = null //Easier than iterating through the list at the zone. @@ -101,7 +97,7 @@ //dbg(blocked) #endif if(zone) - var/zone/z = zone + var/datum/zas_zone/z = zone if(can_safely_remove_from_zone()) //Helps normal airlocks avoid rebuilding zones all the time z.remove(src) @@ -209,7 +205,7 @@ postponed.Add(unsim) if(!air_master.has_valid_zone(src)) //Still no zone, make a new one. - var/zone/newzone = new/zone() + var/datum/zas_zone/newzone = new newzone.add(src) #ifdef ZASDBG @@ -224,59 +220,7 @@ air_master.connect(src, T) /turf/proc/post_update_air_properties() - if(connections) connections.update_all() - -/turf/assume_air(datum/gas_mixture/giver) //use this for machines to adjust air - return 0 - -/turf/proc/assume_gas(gasid, moles, temp = 0) - return 0 - -/turf/return_air() - //Create gas mixture to hold data for passing - var/datum/gas_mixture/GM = new - - GM.copy_from_turf(src) - - return GM - -/turf/remove_air(amount as num) - var/datum/gas_mixture/GM = new - GM.copy_from_turf(src) - return GM.remove(amount) - -/turf/simulated/assume_air(datum/gas_mixture/giver) - var/datum/gas_mixture/my_air = return_air() - my_air.merge(giver) - -/turf/simulated/assume_gas(gasid, moles, temp = null) - var/datum/gas_mixture/my_air = return_air() - - if(isnull(temp)) - my_air.adjust_gas(gasid, moles) - else - my_air.adjust_gas_temp(gasid, moles, temp) - - return 1 - -/turf/simulated/remove_air(amount as num) - var/datum/gas_mixture/my_air = return_air() - return my_air.remove(amount) - -/turf/simulated/return_air() - if(zone) - if(!zone.invalid) - air_master.mark_zone_update(zone) - return zone.air - else - if(!air) - make_air() - c_copy_air() - return air - else - if(!air) - make_air() - return air + connections?.update_all() /turf/proc/make_air() air = new /datum/gas_mixture @@ -285,6 +229,7 @@ air.volume = CELL_VOLUME /turf/simulated/proc/c_copy_air() - if(!air) air = new/datum/gas_mixture + if(!air) + air = new /datum/gas_mixture air.copy_from(zone.air) air.group_multiplier = 1 diff --git a/code/modules/atmospherics/zas/variable_settings.dm b/code/modules/atmospherics/environmental/zas/variable_settings.dm similarity index 100% rename from code/modules/atmospherics/zas/variable_settings.dm rename to code/modules/atmospherics/environmental/zas/variable_settings.dm diff --git a/code/modules/atmospherics/zas/Zone.dm b/code/modules/atmospherics/environmental/zas/zone.dm similarity index 90% rename from code/modules/atmospherics/zas/Zone.dm rename to code/modules/atmospherics/environmental/zas/zone.dm index 87afe100823..29007b1eca6 100644 --- a/code/modules/atmospherics/zas/Zone.dm +++ b/code/modules/atmospherics/environmental/zas/zone.dm @@ -19,7 +19,7 @@ Class Procs: Removes a turf, sets its zone to null and erases any gas graphics. Invalidates the zone if it has no more tiles. - c_merge(zone/into) + c_merge(datum/zas_zone/into) Invalidates this zone and adds all its former contents to into. c_invalidate() @@ -39,7 +39,7 @@ Class Procs: */ -/zone +/datum/zas_zone var/name var/invalid = 0 var/list/contents = list() @@ -51,13 +51,13 @@ Class Procs: var/list/turf_graphics = list() -/zone/New() +/datum/zas_zone/New() air_master.add_zone(src) air.temperature = TCMB air.group_multiplier = 1 air.volume = CELL_VOLUME -/zone/proc/add(turf/simulated/T) +/datum/zas_zone/proc/add(turf/simulated/T) #ifdef ZASDBG ASSERT(!invalid) ASSERT(istype(T)) @@ -78,7 +78,7 @@ Class Procs: if(T.allow_gas_overlays && !T.outdoors) T.vis_contents += turf_graphics -/zone/proc/remove(turf/simulated/T) +/datum/zas_zone/proc/remove(turf/simulated/T) #ifdef ZASDBG ASSERT(!invalid) ASSERT(istype(T)) @@ -97,7 +97,7 @@ Class Procs: else c_invalidate() -/zone/proc/c_merge(zone/into) +/datum/zas_zone/proc/c_merge(datum/zas_zone/into) #ifdef ZASDBG ASSERT(!invalid) ASSERT(istype(into)) @@ -113,13 +113,13 @@ Class Procs: #endif //rebuild the old zone's edges so that they will be possessed by the new zone - for(var/connection_edge/E in edges) + for(var/datum/zas_edge/E in edges) if(E.contains_zone(into)) continue //don't need to rebuild this edge for(var/turf/T in E.connecting_turfs) air_master.mark_for_update(T) -/zone/proc/c_invalidate() +/datum/zas_zone/proc/c_invalidate() invalid = 1 air_master.remove_zone(src) #ifdef ZASDBG @@ -127,7 +127,7 @@ Class Procs: T.dbg(invalid_zone) #endif -/zone/proc/rebuild() +/datum/zas_zone/proc/rebuild() if(invalid) return //Short circuit for explosions where rebuild is called many times over. c_invalidate() for(var/turf/simulated/T in contents) @@ -136,7 +136,7 @@ Class Procs: T.needs_air_update = 0 //Reset the marker so that it will be added to the list. air_master.mark_for_update(T) -/zone/proc/add_tile_air(datum/gas_mixture/tile_air) +/datum/zas_zone/proc/add_tile_air(datum/gas_mixture/tile_air) //air.volume += CELL_VOLUME air.group_multiplier = 1 air.multiply(contents.len) @@ -144,7 +144,7 @@ Class Procs: air.divide(contents.len+1) air.group_multiplier = contents.len+1 -/zone/proc/tick() +/datum/zas_zone/proc/tick() CACHE_VSC_PROP(atmos_vsc, /atmos/fire/firelevel_multiplier, firelevel_multiplier) if(air.temperature >= PHORON_FLASHPOINT && !(src in air_master.active_fire_zones) && air.check_combustability() && contents.len) var/turf/T = pick(contents) @@ -161,11 +161,11 @@ Class Procs: T.vis_contents += added turf_graphics = returned - for(var/connection_edge/E in edges) + for(var/datum/zas_edge/E in edges) if(E.sleeping) E.recheck() -/zone/proc/dbg_data(mob/M) +/datum/zas_zone/proc/dbg_data(mob/M) to_chat(M, name) for(var/g in air.gas) to_chat(M, "[GLOB.meta_gas_names[g]]: [air.gas[g]]") @@ -178,8 +178,8 @@ Class Procs: var/zone_edges = 0 var/space_edges = 0 var/space_coefficient = 0 - for(var/connection_edge/E in edges) - if(E.type == /connection_edge/zone) zone_edges++ + for(var/datum/zas_edge/E in edges) + if(E.type == /datum/zas_edge/zone) zone_edges++ else space_edges++ space_coefficient += E.coefficient diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index acac938f27e..db68515c77e 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -11,6 +11,7 @@ //Volume of this mix. var/volume = CELL_VOLUME //Size of the group this gas_mixture is representing. 1 for singletons. + // ATMOS_TODO : this needs to be removed for auxmos var/group_multiplier = 1 //List of active tile overlays for this gas_mixture. Updated by check_tile_graphic() @@ -78,7 +79,7 @@ //Merges all the gas from another mixture into this one. Respects group_multipliers and adjusts temperature correctly. //Does not modify giver in any way. -/datum/gas_mixture/proc/merge(const/datum/gas_mixture/giver) +/datum/gas_mixture/proc/merge(datum/gas_mixture/giver) if(!giver) return @@ -392,12 +393,10 @@ return compare(other) - //A wrapper around share_ratio for spacing gas at the same rate as if it were going into a large airless room. /datum/gas_mixture/proc/share_space(datum/gas_mixture/unsim_air) return share_ratio(unsim_air, unsim_air.group_multiplier, max(1, max(group_multiplier + 3, 1) + unsim_air.group_multiplier), one_way = 1) - //Equalizes a list of gas mixtures. Used for pipe networks. /proc/equalize_gases(list/datum/gas_mixture/gases) //Calculate totals from individual components @@ -509,3 +508,14 @@ /datum/gas_mixture/proc/get_mass() for(var/g in gas) . += gas[g] * GLOB.meta_gas_molar_mass[g] * group_multiplier + +/** + * get the equivalent of a single tile of this gas mixture + * + * TODO: remove group_multiplier, change to tiles_represented + */ +/datum/gas_mixture/proc/copy_single_tile() + RETURN_TYPE(/datum/gas_mixture) + var/datum/gas_mixture/GM = new(CELL_VOLUME) + GM.copy_from(src) + GM.group_multiplier = 1 diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index d2819d884aa..519867e4330 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -1,5 +1,5 @@ //Returns the firelevel -/datum/gas_mixture/proc/zburn(zone/zone, force_burn, no_check = 0) +/datum/gas_mixture/proc/zburn(datum/zas_zone/zone, force_burn, no_check = 0) CACHE_VSC_PROP(atmos_vsc, /atmos/fire/firelevel_multiplier, firelevel_multiplier) CACHE_VSC_PROP(atmos_vsc, /atmos/fire/fuel_energy_release, fuel_energy_release) diff --git a/code/modules/atmospherics/zas/Debug.dm b/code/modules/atmospherics/zas/Debug.dm deleted file mode 100644 index e20ca000bac..00000000000 --- a/code/modules/atmospherics/zas/Debug.dm +++ /dev/null @@ -1,20 +0,0 @@ -var/image/assigned = image('icons/Testing/Zone.dmi', icon_state = "assigned") -var/image/created = image('icons/Testing/Zone.dmi', icon_state = "created") -var/image/merged = image('icons/Testing/Zone.dmi', icon_state = "merged") -var/image/invalid_zone = image('icons/Testing/Zone.dmi', icon_state = "invalid") -var/image/air_blocked = image('icons/Testing/Zone.dmi', icon_state = "block") -var/image/zone_blocked = image('icons/Testing/Zone.dmi', icon_state = "zoneblock") -var/image/blocked = image('icons/Testing/Zone.dmi', icon_state = "fullblock") -var/image/mark = image('icons/Testing/Zone.dmi', icon_state = "mark") - -/connection_edge/var/dbg_out = 0 - -/turf/var/tmp/dbg_img -/turf/proc/dbg(image/img, d = 0) - if(d > 0) img.dir = d - overlays -= dbg_img - overlays += img - dbg_img = img - -proc/soft_assert(thing,fail) - if(!thing) message_admins(fail) diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 666dc588aaf..b810c324697 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -28,7 +28,7 @@ var/list/dreams = list( //other misc. things ) -mob/living/carbon/proc/dream() +/mob/living/carbon/proc/dream() dreaming = 1 spawn(0) @@ -41,8 +41,8 @@ mob/living/carbon/proc/dream() dreaming = 0 return -mob/living/carbon/proc/handle_dreams() +/mob/living/carbon/proc/handle_dreams() if(client && !dreaming && prob(5)) dream() -mob/living/carbon/var/dreaming = 0 +/mob/living/carbon/var/dreaming = 0 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 0b129fc7707..cb689f67880 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -11,7 +11,7 @@ Gunshots/explosions/opening doors/less rare audio (done) */ -mob/living/carbon/var +/mob/living/carbon/var image/halimage image/halbody obj/halitem @@ -19,7 +19,7 @@ mob/living/carbon/var handling_hal = 0 hal_crit = 0 -mob/living/carbon/proc/handle_hallucinations() +/mob/living/carbon/proc/handle_hallucinations() if(handling_hal) return handling_hal = 1 while(client && hallucination > 20) diff --git a/code/modules/maps/tether/away_spawner.dm b/code/modules/maps/tether/away_spawner.dm index 4eceb772803..e0f17c382a8 100644 --- a/code/modules/maps/tether/away_spawner.dm +++ b/code/modules/maps/tether/away_spawner.dm @@ -62,21 +62,21 @@ var/list/gaslist = env.gas if(my_mob.min_oxy) - my_mob.min_oxy = gaslist["oxygen"] * 0.8 + my_mob.min_oxy = gaslist[/datum/gas/oxygen] * 0.8 if(my_mob.min_tox) - my_mob.min_tox = gaslist["phoron"] * 0.8 + my_mob.min_tox = gaslist[/datum/gas/phoron] * 0.8 if(my_mob.min_n2) - my_mob.min_n2 = gaslist["nitrogen"] * 0.8 + my_mob.min_n2 = gaslist[/datum/gas/nitrogen] * 0.8 if(my_mob.min_co2) - my_mob.min_co2 = gaslist["carbon_dioxide"] * 0.8 + my_mob.min_co2 = gaslist[/datum/gas/carbon_dioxide] * 0.8 if(my_mob.max_oxy) - my_mob.max_oxy = gaslist["oxygen"] * 1.2 + my_mob.max_oxy = gaslist[/datum/gas/oxygen] * 1.2 if(my_mob.max_tox) - my_mob.max_tox = gaslist["phoron"] * 1.2 + my_mob.max_tox = gaslist[/datum/gas/phoron] * 1.2 if(my_mob.max_n2) - my_mob.max_n2 = gaslist["nitrogen"] * 1.2 + my_mob.max_n2 = gaslist[/datum/gas/nitrogen] * 1.2 if(my_mob.max_co2) - my_mob.max_co2 = gaslist["carbon_dioxide"] * 1.2 + my_mob.max_co2 = gaslist[/datum/gas/carbon_dioxide] * 1.2 /* //VORESTATION AI TEMPORARY REMOVAL if(guard) my_mob.returns_home = TRUE diff --git a/code/modules/mining/resonator_vr.dm b/code/modules/mining/resonator_vr.dm index 22638f89b92..953ab25165d 100644 --- a/code/modules/mining/resonator_vr.dm +++ b/code/modules/mining/resonator_vr.dm @@ -86,8 +86,7 @@ qdel(src) return // Otherwise we damage mobs! Boost damage if low tempreature - var/datum/gas_mixture/environment = T.return_air() - if(environment.temperature < 250) + if(T.return_temperature() < 250) name = "strong resonance field" resonance_damage = 50 diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index c5a039694f4..10535e88431 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -693,7 +693,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness) //Inversion, because "not seeing" the darkness is "seeing" the lighting plane master. plane_holder.set_vis(VIS_GHOSTS, ghostvision) -mob/observer/dead/MayRespawn(var/feedback = 0) +/mob/observer/dead/MayRespawn(var/feedback = 0) if(!client) return 0 if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 95dc90a1b02..262fc87f4a9 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -12,8 +12,7 @@ //make sure the air can transmit speech - hearer's side var/turf/T = get_turf(src) if ((T) && (!(istype(src, /mob/observer/dead)))) //Ghosts can hear even in vacuum. - var/datum/gas_mixture/environment = T.return_air() - var/pressure = (environment)? environment.return_pressure() : 0 + var/pressure = T.return_pressure() if(pressure < SOUND_MINIMUM_PRESSURE && get_dist(speaker, src) > 1) return diff --git a/code/modules/mob/living/carbon/human/species/station/alraune.dm b/code/modules/mob/living/carbon/human/species/station/alraune.dm index 5d867414dd8..3d3ff869fb9 100644 --- a/code/modules/mob/living/carbon/human/species/station/alraune.dm +++ b/code/modules/mob/living/carbon/human/species/station/alraune.dm @@ -120,8 +120,7 @@ if(H.wear_suit && (H.wear_suit.min_pressure_protection = 0) && H.head && (H.head.min_pressure_protection = 0)) fullysealed = TRUE else // find out if local gas mixture is enough to override use of internals - var/datum/gas_mixture/environment = H.loc.return_air() - var/envpressure = environment.return_pressure() + var/envpressure = H.loc.return_pressure() if(envpressure >= hazard_low_pressure) environmentalair = TRUE diff --git a/code/modules/mob/living/carbon/human/species/station/plasmen.dm b/code/modules/mob/living/carbon/human/species/station/plasmen.dm index 29bc99197a4..40b8ab26daf 100644 --- a/code/modules/mob/living/carbon/human/species/station/plasmen.dm +++ b/code/modules/mob/living/carbon/human/species/station/plasmen.dm @@ -73,7 +73,7 @@ /datum/species/plasmaman/handle_environment_special(var/mob/living/carbon/human/H) var/turf/T = H.loc if(!T) return - var/datum/gas_mixture/environment = T.return_air() + var/datum/gas_mixture/environment = T.copy_cell_volume() if(!environment) return var/enviroment_bad = 0 //In case they're ever set on fire while wearing a spacesuit, we don't want the message that they're reacting with the atmosphere. diff --git a/code/modules/mob/living/carbon/human/species/station/station_special.dm b/code/modules/mob/living/carbon/human/species/station/station_special.dm index 556ef239a1e..fda496e8d2f 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special.dm @@ -157,8 +157,7 @@ //Cold/pressure effects when not regenerating else - var/datum/gas_mixture/environment = H.loc.return_air() - var/pressure2 = environment.return_pressure() + var/pressure2 = H.loc.return_pressure() var/adjusted_pressure2 = H.calculate_affecting_pressure(pressure2) //Very low pressure damage diff --git a/code/modules/mob/living/carbon/human/species/station/teshari.dm b/code/modules/mob/living/carbon/human/species/station/teshari.dm index 4bf692414c9..af8bfaac606 100644 --- a/code/modules/mob/living/carbon/human/species/station/teshari.dm +++ b/code/modules/mob/living/carbon/human/species/station/teshari.dm @@ -182,8 +182,8 @@ return ..() // Is there enough air to flap against? - var/datum/gas_mixture/environment = landing.return_air() - if(!environment || environment.return_pressure() < (ONE_ATMOSPHERE * 0.75)) + var/pressure = landing.return_pressure() + if(pressure < (ONE_ATMOSPHERE * 0.75)) if(!silent) to_chat(H, SPAN_WARNING("You spread your wings to slow your fall, but the air is too thin!")) return ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index af0b2faba63..1baf65e7ca5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -889,7 +889,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) /mob/proc/embedded_needs_process() return (embedded.len > 0) -mob/proc/yank_out_object() +/mob/proc/yank_out_object() set category = "Object" set name = "Yank out object" set desc = "Remove an embedded item at the cost of bleeding and pain." diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index 7ec9ad1a34f..ebecfe05cf7 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -1,14 +1,14 @@ -mob/proc/flash_pain() +/mob/proc/flash_pain() flick("pain",pain) -mob/var/list/pain_stored = list() -mob/var/last_pain_message = "" -mob/var/next_pain_time = 0 +/mob/var/list/pain_stored = list() +/mob/var/last_pain_message = "" +/mob/var/next_pain_time = 0 // message is the custom message to be displayed // power decides how much painkillers will stop the message // force means it ignores anti-spam timer -mob/living/carbon/proc/custom_pain(message, power, force) +/mob/living/carbon/proc/custom_pain(message, power, force) if(!message || stat || !can_feel_pain() || chem_effects[CE_PAINKILLER] > power) return 0 message = "[message]" @@ -21,7 +21,7 @@ mob/living/carbon/proc/custom_pain(message, power, force) to_chat(src, message) next_pain_time = world.time + (100 - power) -mob/living/carbon/human/proc/handle_pain() +/mob/living/carbon/human/proc/handle_pain() if(stat) return diff --git a/code/modules/power/fission/engine.dm b/code/modules/power/fission/engine.dm index 314f72cde16..bcbc2fa84a4 100644 --- a/code/modules/power/fission/engine.dm +++ b/code/modules/power/fission/engine.dm @@ -322,7 +322,7 @@ removed.temperature = between(0, removed.temperature, REACTOR_TEMPERATURE_CUTOFF) env.merge(removed) -/obj/machinery/power/fission/proc/add_thermal_energy(var/thermal_energy) +/obj/machinery/power/fission/add_thermal_energy(var/thermal_energy) if(mass < 1) return 0 diff --git a/code/modules/power/fission/rods.dm b/code/modules/power/fission/rods.dm index dcbb08a96e7..11d116b8107 100644 --- a/code/modules/power/fission/rods.dm +++ b/code/modules/power/fission/rods.dm @@ -78,7 +78,7 @@ if(integrity == 0 && integrity_lost > 0) // Meltdown time. meltdown() -/obj/item/fuelrod/proc/add_thermal_energy(var/thermal_energy) +/obj/item/fuelrod/add_thermal_energy(var/thermal_energy) if(mass < 1) return 0 diff --git a/code/modules/power/fusion/core/core_field.dm b/code/modules/power/fusion/core/core_field.dm index f9a423f112a..c08e8a1c069 100644 --- a/code/modules/power/fusion/core/core_field.dm +++ b/code/modules/power/fusion/core/core_field.dm @@ -43,7 +43,7 @@ GLOBAL_VAR_INIT(max_fusion_air_heat, INFINITY) ignore_types = typecacheof(list( /obj/effect, /obj/item/projectile, - /obj/fire, + /atom/movable/fire, /obj/structure/cable, /obj/machinery/atmospherics, /obj/machinery/air_sensor, diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 08d3bc17c39..2304564dc52 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -156,7 +156,7 @@ // It's a simplified version taking only 1/10 of the moles from the turf nearby. It should be later changed into a better version var/transfer_moles = environment.total_moles / 10 - var/datum/gas_mixture/removed = inturf.remove_air(transfer_moles) + var/datum/gas_mixture/removed = inturf.remove_moles(transfer_moles) gas_contained.merge(removed) // RPM function to include compression friction - be advised that too low/high of a compfriction value can make things screwy diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm index 717d31c1beb..03444176f84 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm @@ -141,9 +141,9 @@ var/datum/gas_mixture/environment = T.return_air() var/min_temperature = T0C + 100 // 100C, the boiling point of water - var/hotspot = (locate(/obj/fire) in T) + var/hotspot = (locate(/atom/movable/fire) in T) if(hotspot && !istype(T, /turf/space)) - var/datum/gas_mixture/lowertemp = T.remove_air(T:air:total_moles) + var/datum/gas_mixture/lowertemp = T.remove_cell_volume() lowertemp.temperature = max(min(lowertemp.temperature-2000, lowertemp.temperature / 2), 0) lowertemp.react() T.assume_air(lowertemp) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm index 3d17b2d8191..20e9d0f0bfe 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm @@ -279,7 +279,7 @@ if(!istype(T)) return - var/hotspot = (locate(/obj/fire) in T) + var/hotspot = (locate(/atom/movable/fire) in T) if(hotspot && !istype(T, /turf/space)) var/datum/gas_mixture/lowertemp = T.remove_air(T:air:total_moles) lowertemp.temperature = max(min(lowertemp.temperature-2000, lowertemp.temperature / 2), 0) @@ -305,9 +305,9 @@ End Citadel Change */ if(!istype(T)) return - var/hotspot = (locate(/obj/fire) in T) + var/hotspot = (locate(/atom/movable/fire) in T) if(hotspot && !istype(T, /turf/space)) - var/datum/gas_mixture/lowertemp = T.remove_air(T:air:total_moles) + var/datum/gas_mixture/lowertemp = T.remove_cell_volume() lowertemp.temperature = max(min(lowertemp.temperature-2000, lowertemp.temperature / 2), 0) lowertemp.react() T.assume_air(lowertemp) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm index c44672eee59..211489bccf4 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm @@ -1576,9 +1576,9 @@ var/datum/gas_mixture/environment = T.return_air() var/min_temperature = T0C + 100 // 100C, the boiling point of water - var/hotspot = (locate(/obj/fire) in T) + var/hotspot = (locate(/atom/movable/fire) in T) if(hotspot && !isspaceturf(T)) - var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles) + var/datum/gas_mixture/lowertemp = T.remove_cell_volume() lowertemp.temperature = max(min(lowertemp.temperature-2000, lowertemp.temperature / 2), 0) lowertemp.react() T.assume_air(lowertemp) diff --git a/code/modules/shuttles/shuttles_web.dm b/code/modules/shuttles/shuttles_web.dm index 06da52303ff..1c160f9c5d0 100644 --- a/code/modules/shuttles/shuttles_web.dm +++ b/code/modules/shuttles/shuttles_web.dm @@ -453,15 +453,15 @@ return var/list/aircontents - var/datum/gas_mixture/environment = T.return_air() + var/datum/gas_mixture/environment = T.copy_cell_volume() var/pressure = environment.return_pressure() var/total_moles = environment.total_moles if(total_moles) - var/o2_level = environment.gas["oxygen"]/total_moles - var/n2_level = environment.gas["nitrogen"]/total_moles - var/co2_level = environment.gas["carbon_dioxide"]/total_moles - var/phoron_level = environment.gas["phoron"]/total_moles + var/o2_level = environment.gas[/datum/gas/oxygen]/total_moles + var/n2_level = environment.gas[/datum/gas/nitrogen]/total_moles + var/co2_level = environment.gas[/datum/gas/carbon_dioxide]/total_moles + var/phoron_level = environment.gas[/datum/gas/phoron]/total_moles var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level) aircontents = list(\ "pressure" = "[round(pressure,0.1)]",\ diff --git a/code/modules/tgui/modules/supermatter_monitor.dm b/code/modules/tgui/modules/supermatter_monitor.dm index 46f994ddc4f..f713065fdda 100644 --- a/code/modules/tgui/modules/supermatter_monitor.dm +++ b/code/modules/tgui/modules/supermatter_monitor.dm @@ -57,11 +57,11 @@ data["SM_EPR"] = active.get_epr() //data["SM_EPR"] = active.get_epr() if(air.total_moles) - data["SM_gas_O2"] = round(100*air.gas["oxygen"]/air.total_moles,0.01) - data["SM_gas_CO2"] = round(100*air.gas["carbon_dioxide"]/air.total_moles,0.01) - data["SM_gas_N2"] = round(100*air.gas["nitrogen"]/air.total_moles,0.01) - data["SM_gas_PH"] = round(100*air.gas["phoron"]/air.total_moles,0.01) - data["SM_gas_N2O"] = round(100*air.gas["sleeping_agent"]/air.total_moles,0.01) + data["SM_gas_O2"] = round(100*air.gas[/datum/gas/oxygen]/air.total_moles,0.01) + data["SM_gas_CO2"] = round(100*air.gas[/datum/gas/carbon_dioxide]/air.total_moles,0.01) + data["SM_gas_N2"] = round(100*air.gas[/datum/gas/nitrogen]/air.total_moles,0.01) + data["SM_gas_PH"] = round(100*air.gas[/datum/gas/phoron]/air.total_moles,0.01) + data["SM_gas_N2O"] = round(100*air.gas["/datum/gas/nitrous_oxide"]/air.total_moles,0.01) else data["SM_gas_O2"] = 0 data["SM_gas_CO2"] = 0 diff --git a/code/modules/unit_tests/map_tests.dm b/code/modules/unit_tests/map_tests.dm index 7bb87c102fd..84683c2ed85 100644 --- a/code/modules/unit_tests/map_tests.dm +++ b/code/modules/unit_tests/map_tests.dm @@ -93,7 +93,7 @@ var/active_edges = air_master.active_edges.len var/list/edge_log = list() if(active_edges) - for(var/connection_edge/E in air_master.active_edges) + for(var/datum/zas_edge/E in air_master.active_edges) edge_log += "Active Edge [E] ([E.type])" for(var/turf/T in E.connecting_turfs) edge_log += "+--- Connecting Turf [T] @ [T.x], [T.y], [T.z]" diff --git a/code/modules/vore/appearance/spider_taur_powers_vr.dm b/code/modules/vore/appearance/spider_taur_powers_vr.dm index 4f4e972d65d..e277cd0b07d 100644 --- a/code/modules/vore/appearance/spider_taur_powers_vr.dm +++ b/code/modules/vore/appearance/spider_taur_powers_vr.dm @@ -29,7 +29,7 @@ obj/item/clothing/suit/web_bindings //yw edit end /* //Commenting all this out, as people keep abusing it. Sorry! -mob/proc/weaveWeb() +/mob/proc/weaveWeb() set name = "Weave Web" set category = "Species Powers" if(nutrition >= 500) //People decided to abuse it. Sorry. It was asked to be made so it couldn't be spammed, and what do ya know, people are spamming it everywhere. @@ -41,7 +41,7 @@ mob/proc/weaveWeb() to_chat(src, "You do not have enough nutrition to create webbing!") */ -mob/proc/weaveWebBindings() +/mob/proc/weaveWebBindings() set name = "Weave Web Bindings" set category = "Species Powers" if(nutrition >= 30) //This isn't a huge problem. This is so you can bind people up. diff --git a/code/modules/xenoarcheaology/artifacts/artifact.dm b/code/modules/xenoarcheaology/artifacts/artifact.dm index 9b08eee80f8..4839d9d03bd 100644 --- a/code/modules/xenoarcheaology/artifacts/artifact.dm +++ b/code/modules/xenoarcheaology/artifacts/artifact.dm @@ -86,20 +86,20 @@ var/trigger_nitro = 0 if( (my_effect.trigger >= TRIGGER_HEAT && my_effect.trigger <= TRIGGER_NITRO) || (my_effect.trigger >= TRIGGER_HEAT && my_effect.trigger <= TRIGGER_NITRO) ) var/turf/T = get_turf(src) - var/datum/gas_mixture/env = T.return_air() + var/datum/gas_mixture/env = T.copy_cell_volume() if(env) if(env.temperature < 225) trigger_cold = 1 else if(env.temperature > 375) trigger_hot = 1 - if(env.gas[/datum/gas/phoron] >= 10) + if(env.gas[/datum/gas/phoron] >= 2) trigger_phoron = 1 - if(env.gas[/datum/gas/oxygen] >= 10) + if(env.gas[/datum/gas/oxygen] >= 2) trigger_oxy = 1 - if(env.gas[/datum/gas/carbon_dioxide] >= 10) + if(env.gas[/datum/gas/carbon_dioxide] >= 2) trigger_co2 = 1 - if(env.gas[/datum/gas/nitrogen] >= 10) + if(env.gas[/datum/gas/nitrogen] >= 2) trigger_nitro = 1 //COLD ACTIVATION diff --git a/code/modules/xenobio/items/extracts.dm b/code/modules/xenobio/items/extracts.dm index a983d5a2cf0..3dfa1d32dff 100644 --- a/code/modules/xenobio/items/extracts.dm +++ b/code/modules/xenobio/items/extracts.dm @@ -479,7 +479,7 @@ if(!istype(T)) return - var/zone/Z = T.zone + var/datum/zas_zone/Z = T.zone if(!Z) // Paranoid. return diff --git a/vorestation.dme b/vorestation.dme index 39c5f95bca9..018db36a347 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -132,7 +132,6 @@ #include "code\__HELPERS\_lists_tg.dm" #include "code\__HELPERS\_logging.dm" #include "code\__HELPERS\areas.dm" -#include "code\__HELPERS\atmospherics.dm" #include "code\__HELPERS\atom_movables.dm" #include "code\__HELPERS\events.dm" #include "code\__HELPERS\files.dm" @@ -1659,6 +1658,7 @@ #include "code\modules\asset_cache\transports\webroot_transport.dm" #include "code\modules\atmospherics\_atmos_setup.dm" #include "code\modules\atmospherics\_atmospherics_helpers.dm" +#include "code\modules\atmospherics\analyzer_hooks.dm" #include "code\modules\atmospherics\atmospherics.dm" #include "code\modules\atmospherics\datum_pipe_network.dm" #include "code\modules\atmospherics\datum_pipeline.dm" @@ -1694,8 +1694,21 @@ #include "code\modules\atmospherics\components\unary\vent_pump.dm" #include "code\modules\atmospherics\components\unary\vent_scrubber.dm" #include "code\modules\atmospherics\components\unary\vent_scrubber_vr.dm" -#include "code\modules\atmospherics\environmental\ZAS_airpass.dm" -#include "code\modules\atmospherics\environmental\ZAS_turf.dm" +#include "code\modules\atmospherics\environmental\turf.dm" +#include "code\modules\atmospherics\environmental\turf_public.dm" +#include "code\modules\atmospherics\environmental\zas\_docs.dm" +#include "code\modules\atmospherics\environmental\zas\airflow.dm" +#include "code\modules\atmospherics\environmental\zas\atom.dm" +#include "code\modules\atmospherics\environmental\zas\connection.dm" +#include "code\modules\atmospherics\environmental\zas\connection_manager.dm" +#include "code\modules\atmospherics\environmental\zas\controller.dm" +#include "code\modules\atmospherics\environmental\zas\debug.dm" +#include "code\modules\atmospherics\environmental\zas\edge.dm" +#include "code\modules\atmospherics\environmental\zas\fire.dm" +#include "code\modules\atmospherics\environmental\zas\phoron.dm" +#include "code\modules\atmospherics\environmental\zas\turf.dm" +#include "code\modules\atmospherics\environmental\zas\variable_settings.dm" +#include "code\modules\atmospherics\environmental\zas\zone.dm" #include "code\modules\atmospherics\gasmixtures\gas_mixture.dm" #include "code\modules\atmospherics\gasmixtures\gas_types.dm" #include "code\modules\atmospherics\gasmixtures\immutable_mixtures.dm" @@ -1709,20 +1722,6 @@ #include "code\modules\atmospherics\pipes\tank.dm" #include "code\modules\atmospherics\pipes\universal.dm" #include "code\modules\atmospherics\pipes\vent.dm" -#include "code\modules\atmospherics\zas\_docs.dm" -#include "code\modules\atmospherics\zas\Airflow.dm" -#include "code\modules\atmospherics\zas\Atom.dm" -#include "code\modules\atmospherics\zas\Connection.dm" -#include "code\modules\atmospherics\zas\ConnectionGroup.dm" -#include "code\modules\atmospherics\zas\ConnectionManager.dm" -#include "code\modules\atmospherics\zas\Controller.dm" -#include "code\modules\atmospherics\zas\Debug.dm" -#include "code\modules\atmospherics\zas\Diagnostic.dm" -#include "code\modules\atmospherics\zas\Fire.dm" -#include "code\modules\atmospherics\zas\Phoron.dm" -#include "code\modules\atmospherics\zas\Turf.dm" -#include "code\modules\atmospherics\zas\variable_settings.dm" -#include "code\modules\atmospherics\zas\Zone.dm" #include "code\modules\awaymissions\bluespaceartillery.dm" #include "code\modules\awaymissions\corpse.dm" #include "code\modules\awaymissions\exile.dm"