diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 9ce15ab8349..1358c6818d3 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -318,7 +318,7 @@ Pipelines + Other Objects -> Pipe network var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() add_fingerprint(user) - if ((int_air.pressure-env_air.pressure) > 2*ONE_ATMOSPHERE) + if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) if(istype(W, /obj/item/tool/wrench/socket) && istype(src, /obj/machinery/atmospherics/pipe)) to_chat(user, "You begin to open the pressure release valve on the pipe...") if(!do_after(user, src, 50) || !loc) diff --git a/code/ATMOSPHERICS/components/binary_devices/MSGS.dm b/code/ATMOSPHERICS/components/binary_devices/MSGS.dm index 620a12eed5a..6acb34ed9e5 100644 --- a/code/ATMOSPHERICS/components/binary_devices/MSGS.dm +++ b/code/ATMOSPHERICS/components/binary_devices/MSGS.dm @@ -41,13 +41,13 @@ return //Output handling, stolen from pump code. - var/output_starting_pressure = air2.pressure + var/output_starting_pressure = air2.return_pressure() if((target_pressure - output_starting_pressure) > 0.01) //No need to output gas if target is already reached! //Calculate necessary moles to transfer using PV=nRT - if((air.total_moles > 0) && (air.temperature > 0)) + if((air.total_moles() > 0) && (air.temperature > 0)) var/pressure_delta = target_pressure - output_starting_pressure var/transfer_moles = pressure_delta * air2.volume / (air.temperature * R_IDEAL_GAS_EQUATION) @@ -60,13 +60,13 @@ //Input handling. Literally pump code again with the target pressure being the max pressure of the MSGS if(on) - var/input_starting_pressure = air1.pressure + var/input_starting_pressure = air1.return_pressure() if((max_pressure - input_starting_pressure) > 0.01) //No need to output gas if target is already reached! //Calculate necessary moles to transfer using PV=nRT - if((air1.total_moles > 0) && (air1.temperature > 0)) + if((air1.total_moles() > 0) && (air1.temperature > 0)) var/pressure_delta = max_pressure - input_starting_pressure var/transfer_moles = pressure_delta * air.volume / (air1.temperature * R_IDEAL_GAS_EQUATION) @@ -82,8 +82,8 @@ /obj/machinery/atmospherics/binary/msgs/ui_data() var/list/data = list() - data["pressure"] = round(air.pressure, 0.01) - data["temperature"] = air.temperature + data["pressure"] = round(air.return_pressure(), 0.01) + data["temperature"] = air.return_temperature() data["power"] = on data["targetPressure"] = target_pressure data["gases"] = list() @@ -152,7 +152,7 @@ if((update_flags & MSGS_ON) != !(stat & (NOPOWER | BROKEN | FORCEDISABLE))) update = 1 - var/pressure = air.pressure // null ref error here. + var/pressure = air.return_pressure() // null ref error here. var/i = clamp(round(pressure / (max_pressure / 5)), 0, 5) if(i != last_pressure) update = 1 diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index a595b0767fa..afba3834fc3 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -48,8 +48,8 @@ return var/datum/gas_mixture/removed - var/input_starting_pressure = air1.pressure - var/output_starting_pressure = air2.pressure + var/input_starting_pressure = air1.return_pressure() + var/output_starting_pressure = air2.return_pressure() last_pressure_delta = max(input_starting_pressure - output_starting_pressure - 5, 0) //Only circulate air if there is a pressure difference (plus 5kPa kinetic, 10kPa static friction). diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index 60b11d8d421..c14b375e843 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -22,7 +22,7 @@ //4: Do not pass output_pressure_max frequency = 0 - + var/datum/radio_frequency/radio_connection machine_flags = MULTITOOL_MENU @@ -73,7 +73,7 @@ if(!on) return - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() var/pressure_delta = get_pressure_delta(environment) if(pressure_delta > 0.5) @@ -105,18 +105,18 @@ /obj/machinery/atmospherics/binary/dp_vent_pump/proc/get_pressure_delta(datum/gas_mixture/environment) var/pressure_delta = 10000 //why is this 10000? whatever - var/environment_pressure = environment.pressure + var/environment_pressure = environment.return_pressure() if(pump_direction) //internal -> external if(pressure_checks & 1) pressure_delta = min(pressure_delta, external_pressure_bound - environment_pressure) //increasing the pressure here if(pressure_checks & 2) - pressure_delta = min(pressure_delta, air1.pressure - input_pressure_min) //decreasing the pressure here + pressure_delta = min(pressure_delta, air1.return_pressure() - input_pressure_min) //decreasing the pressure here else //external -> internal if(pressure_checks & 1) pressure_delta = min(pressure_delta, environment_pressure - external_pressure_bound) //decreasing the pressure here if(pressure_checks & 2) - pressure_delta = min(pressure_delta, output_pressure_max - air2.pressure) //increasing the pressure here + pressure_delta = min(pressure_delta, output_pressure_max - air2.return_pressure()) //increasing the pressure here return pressure_delta diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 43b94d0ffc5..89e36cfe8df 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -41,8 +41,8 @@ if(!open) return - var/output_starting_pressure = air2.pressure - var/input_starting_pressure = air1.pressure + var/output_starting_pressure = air2.return_pressure() + var/input_starting_pressure = air1.return_pressure() //var/pressure_delta = min(10000, abs(environment_pressure - air_contents.return_pressure())) var/pressure_delta = min(10000, input_starting_pressure - output_starting_pressure) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 5872d0d8a38..17af757057a 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -53,7 +53,7 @@ air2.volume if((stat & (NOPOWER|BROKEN|FORCEDISABLE)) || !on) return - var/output_starting_pressure = air2.pressure + var/output_starting_pressure = air2.return_pressure() var/pressure_delta = target_pressure - output_starting_pressure if(pressure_delta > 0.01 && (air1.temperature > 0 || air2.temperature > 0)) diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index ee8e82ff341..8685523290e 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -52,8 +52,8 @@ Thus, the two variables affect pump operation are set in New(): // Pump mechanism just won't do anything if the pressure is too high/too low - var/input_starting_pressure = air1.pressure - var/output_starting_pressure = air2.pressure + var/input_starting_pressure = air1.return_pressure() + var/output_starting_pressure = air2.return_pressure() if((input_starting_pressure < 0.01) || (output_starting_pressure > (9000+input_starting_pressure))) pump_stalled = 1 diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index fa0df0b7b5f..9c4f3b4d557 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -53,9 +53,9 @@ if(!on) return - var/output_starting_pressure = air3.pressure + var/output_starting_pressure = air3.return_pressure() var/pressure_delta = target_pressure - output_starting_pressure - var/filtered_pressure_delta = target_pressure - air2.pressure + var/filtered_pressure_delta = target_pressure - air2.return_pressure() if(pressure_delta > 0.01 && filtered_pressure_delta > 0.01 && (air1.temperature > 0 || air3.temperature > 0)) //Figure out how much gas to transfer to meet the target pressure. diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 838fa5b5476..b8946072fb3 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -43,7 +43,7 @@ if(!on) return - var/output_starting_pressure = air3.pressure + var/output_starting_pressure = air3.return_pressure() var/pressure_delta = target_pressure - output_starting_pressure if(pressure_delta > 0.01 && ((air1.temperature > 0 && air2.temperature > 0) || air3.temperature > 0)) @@ -56,8 +56,8 @@ var/transfer_moles2 = ((node2_concentration * pressure_delta) * output_volume) / (air_temperature2 * R_IDEAL_GAS_EQUATION) //fix the mix if one of the inputs has insufficient gas - var/air1_moles = air1.total_moles - var/air2_moles = air2.total_moles + var/air1_moles = air1.total_moles() + var/air2_moles = air2.total_moles() if((air1_moles < transfer_moles1) || (air2_moles < transfer_moles2)) if(!transfer_moles1 || !transfer_moles2) return diff --git a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm index 2ea1dd30f0f..d88a1b62ff4 100644 --- a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm +++ b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm @@ -33,7 +33,7 @@ if(!on) return - var/total_moles = air_contents.total_moles + var/total_moles = air_contents.total_moles() if(total_moles < oxygen_content) var/current_heat_capacity = air_contents.heat_capacity() diff --git a/code/ATMOSPHERICS/components/unary/tank.dm b/code/ATMOSPHERICS/components/unary/tank.dm index 56f5c18c03a..033c907326a 100644 --- a/code/ATMOSPHERICS/components/unary/tank.dm +++ b/code/ATMOSPHERICS/components/unary/tank.dm @@ -37,9 +37,9 @@ punctured() /obj/machinery/atmospherics/unary/tank/proc/punctured(var/mob/user as mob) - var/internal_pressure = air_contents.pressure + var/internal_pressure = air_contents.return_pressure() var/datum/gas_mixture/environment = loc.return_air() - var/external_pressure = environment.pressure + var/external_pressure = environment.return_pressure() var/pressure_delta = internal_pressure - external_pressure if(pressure_delta >= 500) //only explode if there's this much pressure differential if(user) diff --git a/code/ATMOSPHERICS/components/unary/vent.dm b/code/ATMOSPHERICS/components/unary/vent.dm index cc644f82795..59541f18253 100644 --- a/code/ATMOSPHERICS/components/unary/vent.dm +++ b/code/ATMOSPHERICS/components/unary/vent.dm @@ -38,9 +38,9 @@ //air_contents.mingle_with_turf(loc) - var/datum/gas_mixture/environment = loc.return_readonly_air() - var/environment_pressure = environment.pressure - var/pressure_delta = min(10000, abs(environment_pressure - air_contents.pressure)) + var/datum/gas_mixture/environment = loc.return_air() + var/environment_pressure = environment.return_pressure() + var/pressure_delta = min(10000, abs(environment_pressure - air_contents.return_pressure())) if((environment.temperature || air_contents.temperature) && pressure_delta > 0.5) if(environment_pressure < air_contents.pressure) //move air out diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 46998601200..1229485fe20 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -109,7 +109,7 @@ if(!loc) return - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() var/pressure_delta = get_pressure_delta(environment) if((environment.temperature || air_contents.temperature) && pressure_delta > 0.5) @@ -144,18 +144,18 @@ /obj/machinery/atmospherics/unary/vent_pump/proc/get_pressure_delta(datum/gas_mixture/environment) var/pressure_delta = 10000 //why is this 10000? whatever - var/environment_pressure = environment.pressure + var/environment_pressure = environment.return_pressure() if(pump_direction) //internal -> external if(pressure_checks & 1) pressure_delta = min(pressure_delta, external_pressure_bound - environment_pressure) //increasing the pressure here if(pressure_checks & 2) - pressure_delta = min(pressure_delta, air_contents.pressure - internal_pressure_bound) //decreasing the pressure here + pressure_delta = min(pressure_delta, air_contents.return_pressure() - internal_pressure_bound) //decreasing the pressure here else //external -> internal if(pressure_checks & 1) pressure_delta = min(pressure_delta, environment_pressure - external_pressure_bound) //decreasing the pressure here if(pressure_checks & 2) - pressure_delta = min(pressure_delta, internal_pressure_bound - air_contents.pressure) //increasing the pressure here + pressure_delta = min(pressure_delta, internal_pressure_bound - air_contents.return_pressure()) //increasing the pressure here return pressure_delta diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 822346cb199..7650e0feb73 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -157,14 +157,14 @@ //currently it turns red the moment the pipe is full, updating ~150 scrubbers at once once the waste pipeloop fills /obj/machinery/atmospherics/unary/vent_scrubber/proc/handle_stalling() if(!stalled) - if(air_contents.pressure >= MAX_PRESSURE)//not stalled but too much pressure, make stalled + if(air_contents.return_pressure() >= MAX_PRESSURE)//not stalled but too much pressure, make stalled stalled = TRUE update_icon() else //not stalled and good pressure, do nothing return else - if(air_contents.pressure < MAX_PRESSURE) //stalled but good pressure, make unstalled + if(air_contents.return_pressure() < MAX_PRESSURE) //stalled but good pressure, make unstalled stalled = FALSE update_icon() else //stalled and too much pressure, do nothing @@ -195,7 +195,7 @@ return - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() handle_stalling() if(stalled) return //if we're at max pressure we don't do anything @@ -203,7 +203,7 @@ //scrubbing mode if(scrubbing) //if internal pressure limit is enabled and met, we don't do anything - if((pressure_checks & 2) && (internal_pressure_bound - air_contents.pressure) <= 0.05) + if((pressure_checks & 2) && (internal_pressure_bound - air_contents.return_pressure()) <= 0.05) if(reducing_pressure) reducing_pressure = 0 update_icon() @@ -216,7 +216,7 @@ scrubbed_gas_present = TRUE break - var/external_pressure_delta = environment.pressure - external_pressure_bound + var/external_pressure_delta = environment.return_pressure() - external_pressure_bound if(scrubbed_gas_present || ((pressure_checks & 1) && external_pressure_delta > 0.05)) var/transfer_moles = min(1, volume_rate / environment.volume) * environment.total_moles diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index a4957112a62..dda9359b86b 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -28,7 +28,7 @@ /datum/pipeline/proc/process()//This use to be called called from the pipe networks if((world.timeofday - last_pressure_check) / 10 >= PRESSURE_CHECK_DELAY) //Check to see if pressure is within acceptable limits - var/pressure = air.pressure + var/pressure = air.return_pressure() if(pressure > alert_pressure) for(var/obj/machinery/atmospherics/pipe/member in members) if(!member.check_pressure(pressure)) diff --git a/code/ATMOSPHERICS/hvac/spaceheater.dm b/code/ATMOSPHERICS/hvac/spaceheater.dm index 725c26ac8b3..bfe9124636f 100644 --- a/code/ATMOSPHERICS/hvac/spaceheater.dm +++ b/code/ATMOSPHERICS/hvac/spaceheater.dm @@ -187,7 +187,7 @@ if (!isliving(user)) return var/turf/T = get_turf(src) - var/datum/gas_mixture/env = T.return_readonly_air() + var/datum/gas_mixture/env = T.return_air() if(env.molar_density(GAS_OXYGEN) < 5 / CELL_VOLUME) to_chat(user, "You try to light \the [name], but it won't catch on fire!") return @@ -366,7 +366,7 @@ // to_chat(world, "now at [removed.temperature]") env.merge(removed) - afterheat(L.return_readonly_air()) + afterheat(L.return_air()) if(!istype(loc,/turf/space)) for (var/mob/living/carbon/M in view(src,light_range_on)) @@ -382,7 +382,7 @@ if(!on) return var/turf/simulated/T = loc - var/datum/gas_mixture/env = T.return_readonly_air() + var/datum/gas_mixture/env = T.return_air() if(Floor(cell.charge/10) != lastcharge) update_icon() if((!(cell && cell.charge > 0) && (nocell != 2)) || !istype(T) || (env.molar_density(GAS_OXYGEN) < 5 / CELL_VOLUME)) diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index 5c5115370a1..25463440435 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -204,9 +204,9 @@ // Note: This checks the difference between atmospheric pressure and pressure in the pipe. // So, a pipe rated at 8,000 kPa in a 104kPa environment will explode at 8,104kPa. - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() - var/pressure_difference = pressure - environment.pressure + var/pressure_difference = pressure - environment.return_pressure() // Burst check first. if(pressure_difference > maximum_pressure && prob(1)) @@ -938,7 +938,7 @@ if(istype(W,/obj/item/device/analyzer)) var/obj/item/device/analyzer/A = W - var/datum/gas_mixture/environment = src.return_readonly_air() + var/datum/gas_mixture/environment = src.return_air() user.show_message(A.output_gas_scan(environment,src,1)) return ..() diff --git a/code/ZAS/ConnectionGroup.dm b/code/ZAS/ConnectionGroup.dm index 6846e8de5c3..009ba59ef71 100644 --- a/code/ZAS/ConnectionGroup.dm +++ b/code/ZAS/ConnectionGroup.dm @@ -132,7 +132,7 @@ Class Procs: var/equiv = A.air.share_tiles(B.air, coefficient) - var/differential = A.air.pressure - B.air.pressure + var/differential = A.air.return_pressure() - B.air.return_pressure() if(abs(differential) >= zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) flow(A.movables(), differential) flow(B.movables(), -differential) @@ -195,7 +195,7 @@ Class Procs: var/equiv = A.air.share_space(air, coefficient) - var/differential = A.air.pressure - air.pressure + var/differential = A.air.return_pressure() - air.return_pressure() if(abs(differential) >= zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) flow(A.movables(), abs(differential), differential < 0) A.blow_dust_motes(src, differential) diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index 2d8775651b2..73f35b0fefc 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -5,8 +5,8 @@ T:zone:dbg_data(src) else to_chat(mob, "No zone here.") - var/datum/gas_mixture/mix = T.return_readonly_air() - to_chat(mob, "[mix.pressure] kPa [mix.temperature]C") + var/datum/gas_mixture/mix = T.return_air() + to_chat(mob, "[mix.return_pressure()] kPa [mix.temperature]C") to_chat(mob, "O2: [mix[GAS_OXYGEN]] N2: [mix[GAS_NITROGEN]] CO2: [mix[GAS_CARBON]] TX: [mix[GAS_PLASMA]]") else if(zone_debug_images) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index db5dcd1390e..0dcbe503905 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -148,10 +148,10 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel if(!force_smoke) if(prob(clamp(lerp(temp,T20C,T0C + 1000,96,100),96,100))) //4% chance of smoke at 20C, 0% at 1000C return FALSE - var/smoke_density = clamp(3 * ((MINOXY2BURN/oxy) ** 2),1,3) + var/smoke_density = clamp(5 * ((MINOXY2BURN/oxy) ** 2),1,5) var/datum/effect/system/smoke_spread/bad/smoke = new smoke.set_up(smoke_density,0,where) - smoke.time_to_live = 3 SECONDS + smoke.time_to_live = 10 SECONDS smoke.start() /atom/proc/check_fire_protection() @@ -232,9 +232,9 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel extinguish() return var/datum/thermal_material/material = src.thermal_material - var/datum/gas_mixture/air = T.return_readonly_air() + var/datum/gas_mixture/air = T.return_air() var/oxy_ratio = air.molar_ratio(GAS_OXYGEN) - var/temperature = air.temperature + var/temperature = air.return_temperature() var/delta_t var/heat_out = 0 //J var/oxy_used = 0 //mols @@ -409,7 +409,7 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel if(thermal_mass <= 0) ashify() return - var/datum/gas_mixture/G = return_readonly_air() + var/datum/gas_mixture/G = return_air() if(!G) return if(!(G.temperature >= autoignition_temperature)) @@ -498,7 +498,7 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel if(locate(/obj/effect/fire) in src) return 0 - var/datum/gas_mixture/air_contents = return_readonly_air() + var/datum/gas_mixture/air_contents = return_air() if(!air_contents) return 0 @@ -546,7 +546,7 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel if(!flammable || check_fire_protection() || thermal_mass <= 0) return FALSE - var/datum/gas_mixture/air_contents = return_readonly_air() + var/datum/gas_mixture/air_contents = return_air() if(air_contents[GAS_OXYGEN] < 1) return FALSE @@ -591,7 +591,7 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel . = ..() dir = pick(cardinal) var/turf/T = get_turf(loc) - var/datum/gas_mixture/air_contents=T.return_readonly_air() + var/datum/gas_mixture/air_contents=T.return_air() if(air_contents) setfirelight(air_contents.calculate_firelevel(get_turf(src)), air_contents.temperature) SSair.add_hotspot(src) @@ -680,7 +680,7 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel var/turf/simulated/enemy_tile = get_step(S, direction) var/liquidburn = FALSE if(istype(enemy_tile)) - var/datum/gas_mixture/acs = enemy_tile.return_readonly_air() + var/datum/gas_mixture/acs = enemy_tile.return_air() if(!acs) continue if(!acs.check_combustability(enemy_tile)) diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm index 6b5902b1ff2..6cf072f9aeb 100644 --- a/code/ZAS/Turf.dm +++ b/code/ZAS/Turf.dm @@ -267,18 +267,6 @@ make_air() return air -/turf/simulated/return_readonly_air() //does not mark zone for air updates - if(zone) - if(!zone.invalid) - return zone.air - else - c_copy_air() - return air - else - if(!air) - make_air() - return air - /turf/proc/make_air() air = new/datum/gas_mixture air.temperature = temperature diff --git a/code/ZAS/XGM_gases.dm b/code/ZAS/XGM_gases.dm index b46fdcee6ea..4c0a84f8d50 100644 --- a/code/ZAS/XGM_gases.dm +++ b/code/ZAS/XGM_gases.dm @@ -30,7 +30,7 @@ flags = XGM_GAS_NOTEWORTHY /datum/gas/oxygen/is_human_safe(moles, datum/gas_mixture/mixture) - return abs(moles/mixture.total_moles - O2STANDARD) < 0.02 + return abs(moles/mixture.total_moles() - O2STANDARD) < 0.02 /datum/gas/nitrogen id = GAS_NITROGEN @@ -42,7 +42,7 @@ flags = XGM_GAS_NOTEWORTHY /datum/gas/nitrogen/is_human_safe(moles, datum/gas_mixture/mixture) - return abs(moles/mixture.total_moles - N2STANDARD) < 0.2 + return abs(moles/mixture.total_moles() - N2STANDARD) < 0.2 /datum/gas/carbon_dioxide id = GAS_CARBON @@ -54,7 +54,7 @@ flags = XGM_GAS_NOTEWORTHY | XGM_GAS_LOGGED /datum/gas/carbon_dioxide/is_human_safe(moles, datum/gas_mixture/mixture) - return moles/mixture.total_moles < 0.01 + return moles/mixture.total_moles() < 0.01 /datum/gas/plasma id = GAS_PLASMA @@ -75,7 +75,7 @@ flags = XGM_GAS_NOTEWORTHY | XGM_GAS_LOGGED /datum/gas/plasma/is_human_safe(moles, datum/gas_mixture/mixture) - return moles/mixture.total_moles < 0.01 + return moles/mixture.total_moles() < 0.01 /obj/effect/overlay/gas_overlay/plasma name = "plasma" @@ -93,7 +93,7 @@ flags = XGM_GAS_NOTEWORTHY | XGM_GAS_LOGGED /datum/gas/sleeping_agent/is_human_safe(moles, datum/gas_mixture/mixture) - return moles/mixture.total_moles < 0.01 + return moles/mixture.total_moles() < 0.01 /obj/effect/overlay/gas_overlay/sleeping_agent name = "sleeping agent" @@ -110,7 +110,7 @@ flags = XGM_GAS_LOGGED /datum/gas/volatile_fuel/is_human_safe(moles, datum/gas_mixture/mixture) - return moles/mixture.total_moles < 0.01 + return moles/mixture.total_moles() < 0.01 /datum/gas/oxygen_agent_b id = GAS_OXAGENT @@ -123,7 +123,7 @@ flags = XGM_GAS_LOGGED /datum/gas/oxygen_agent_b/is_human_safe(moles, datum/gas_mixture/mixture) - return moles/mixture.total_moles < 0.01 + return moles/mixture.total_moles() < 0.01 /datum/gas/cryotheum id = GAS_CRYOTHEUM @@ -138,7 +138,7 @@ flags = XGM_GAS_NOTEWORTHY | XGM_GAS_LOGGED /datum/gas/cryotheum/is_human_safe(moles, datum/gas_mixture/mixture) - return moles/mixture.total_moles < 0.01 + return moles/mixture.total_moles() < 0.01 /obj/effect/overlay/gas_overlay/cryotheum name = "cryotheum" diff --git a/code/ZAS/_gas_mixture.dm b/code/ZAS/_gas_mixture.dm index 45e7d27e30f..2b55707eb91 100644 --- a/code/ZAS/_gas_mixture.dm +++ b/code/ZAS/_gas_mixture.dm @@ -274,7 +274,7 @@ for(var/g in gas) var/moles = gas[g] * ratio - gas[g] -= QUANTIZE(moles) + gas[g] -= moles removed[g] += moles removed.temperature = temperature @@ -344,14 +344,13 @@ //Copies the gases from sample to src, per unit volume. /datum/gas_mixture/proc/copy_from(datum/gas_mixture/sample) - gas = sample.gas.Copy() + gas.len = 0 + for(var/g in sample.gas) + src[g] = sample.gas[g] + temperature = sample.temperature - var/list/cached_gas = gas - for(var/id in cached_gas) - cached_gas[id] = QUANTIZE(cached_gas[id]) multiply(volume / sample.volume) - update_values() return 1 //The general form of the calculation used in compare() to check if two numbers are separated by at least a given abslute value AND relative value. @@ -407,7 +406,7 @@ /datum/gas_mixture/proc/multiply(factor) for(var/g in gas) - gas[g] *= QUANTIZE(factor) + gas[g] *= factor update_values() return TRUE @@ -427,8 +426,8 @@ /datum/gas_mixture/proc/share_ratio(datum/gas_mixture/other, ratio) var/total_volume = volume + other.volume - var/datum/gas_mixture/holder = remove_ratio(QUANTIZE(ratio * other.volume / total_volume)) - merge(other.remove_ratio(QUANTIZE(ratio * volume / total_volume))) + var/datum/gas_mixture/holder = remove_ratio(ratio * other.volume / total_volume) + merge(other.remove_ratio(ratio * volume / total_volume)) other.merge(holder) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 6f9e5cf78f6..afdd2d7626c 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -845,7 +845,7 @@ B.icon_state = old_icon_state B.icon = old_icon - B.return_air().copy_from(T.return_readonly_air()) + B.return_air().copy_from(T.return_air()) for(var/obj/O in T) copiedobjs += O.DuplicateObject(B) diff --git a/code/datums/wires/transmitter.dm b/code/datums/wires/transmitter.dm index aff2abbe193..8103477b5b6 100644 --- a/code/datums/wires/transmitter.dm +++ b/code/datums/wires/transmitter.dm @@ -56,5 +56,5 @@ var/const/TRANS_SETTINGS = 16 //Pulse shows percentage given by environment temp if(TRANS_LINK) T.unhook_media_sources() if(TRANS_SETTINGS) - var/datum/gas_mixture/env = T.loc.return_readonly_air() - counter = 100*(env.temperature / (T20C + 20)) + var/datum/gas_mixture/env = T.loc.return_air() + counter = 100*(env.temperature / (T20C + 20)) \ No newline at end of file diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 3491675cedd..367e1371143 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -218,10 +218,6 @@ var/global/list/ghdel_profiling = list() else return null -///Return the current air environment in this atom. If this atom is a turf, it will not automatically update the zone. -/atom/proc/return_readonly_air() - return return_air() - /atom/proc/check_eye(user as mob) if (istype(user, /mob/living/silicon/ai)) // WHYYYY return 1 diff --git a/code/game/centcomm_orders/orders_engineering.dm b/code/game/centcomm_orders/orders_engineering.dm index 540f9660e7e..e5f4affc959 100644 --- a/code/game/centcomm_orders/orders_engineering.dm +++ b/code/game/centcomm_orders/orders_engineering.dm @@ -66,8 +66,8 @@ /datum/centcomm_order/department/engineering/cold_canister/ExtraChecks(var/obj/machinery/portable_atmospherics/canister/C) if (!istype(C)) return 0 - var/datum/gas_mixture/GM = C.return_readonly_air() - if ((GM.gas?.len == 1) && (GAS_PLASMA in GM.gas) && (GM.temperature < 2) && (GM.pressure > 1000)) + var/datum/gas_mixture/GM = C.return_air() + if ((GM.gas?.len == 1) && (GAS_PLASMA in GM.gas) && (GM.return_temperature() < 2) && (GM.pressure > 1000)) return 1 return 0 diff --git a/code/game/gamemodes/events/powercreeper.dm b/code/game/gamemodes/events/powercreeper.dm index c0b5e7927a1..38130182694 100644 --- a/code/game/gamemodes/events/powercreeper.dm +++ b/code/game/gamemodes/events/powercreeper.dm @@ -83,7 +83,7 @@ var/datum/gas_mixture/environment if(isturf(loc)) var/turf/T = loc - environment = T.return_readonly_air() + environment = T.return_air() if(environment.temperature < T0C) die() return diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 645328118d8..ea7ec71f250 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -102,7 +102,7 @@ var/dat = {"Cryo gas cooling system
Current status: [ on ? "Off On" : "Off On"]
Current gas temperature: [temp_text]
- Current air pressure: [air_contents.pressure]
+ Current air pressure: [air_contents.return_pressure()]
Target gas temperature: - - - [current_temperature] + + +
"} @@ -270,7 +270,7 @@ var/dat = {"Heating system
Current status: [ on ? "Off On" : "Off On"]
Current gas temperature: [temp_text]
- Current air pressure: [air_contents.pressure]
+ Current air pressure: [air_contents.return_pressure()]
Target gas temperature: - - - [current_temperature] + + +
"} diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm index e399628b5b8..11fb52fe3a5 100644 --- a/code/game/machinery/airlock_control.dm +++ b/code/game/machinery/airlock_control.dm @@ -217,9 +217,9 @@ signal.data["tag"] = id_tag signal.data["timestamp"] = world.time - var/datum/gas_mixture/air_sample = return_readonly_air() + var/datum/gas_mixture/air_sample = return_air() - var/pressure = round(air_sample.pressure,0.1) + var/pressure = round(air_sample.return_pressure(),0.1) alert = (pressure < ONE_ATMOSPHERE*0.8) signal.data["pressure"] = pressure diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 4338d7ea525..9b1cc11a01e 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -506,7 +506,7 @@ var/global/list/air_alarms = list() danger_averted_confidence = 0 // Reset counter. use_power = MACHINE_POWER_USE_ACTIVE - if (mode==AALARM_MODE_CYCLE && environment.pressure tank pressure var/transfer_moles = 0 @@ -223,7 +223,7 @@ if (P) P.update = 1 - if(air_contents.pressure < 1) + if(air_contents.return_pressure() < 1) can_label = 1 else can_label = 0 @@ -238,15 +238,15 @@ return air_contents /obj/machinery/portable_atmospherics/canister/proc/return_temperature() - var/datum/gas_mixture/GM = src.return_readonly_air() + 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_readonly_air() + var/datum/gas_mixture/GM = src.return_air() if(GM && GM.volume>0) - return GM.pressure + return GM.return_pressure() return 0 /obj/machinery/portable_atmospherics/canister/blob_act() @@ -278,8 +278,8 @@ if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/weapon/tank/jetpack)) var/datum/gas_mixture/thejetpack = W:air_contents - var/env_pressure = thejetpack.pressure - var/pressure_delta = min(10*ONE_ATMOSPHERE - env_pressure, (air_contents.pressure - env_pressure)/2) + var/env_pressure = thejetpack.return_pressure() + var/pressure_delta = min(10*ONE_ATMOSPHERE - env_pressure, (air_contents.return_pressure() - env_pressure)/2) //Can not have a pressure delta that would cause environment pressure > tank pressure var/transfer_moles = 0 if((air_contents.temperature > 0) && (pressure_delta > 0)) @@ -323,7 +323,7 @@ data["name"] = name data["canLabel"] = can_label ? 1 : 0 data["portConnected"] = connected_port ? 1 : 0 - data["tankPressure"] = round(air_contents.pressure > 0 ? air_contents.pressure : 0)//This used to be redundant, made it into a fix for -1 kPA showing up in the UI + data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)//This used to be redundant, made it into a fix for -1 kPA showing up in the UI data["releasePressure"] = round(release_pressure) data["minReleasePressure"] = round(ONE_ATMOSPHERE/10) data["maxReleasePressure"] = round(10*ONE_ATMOSPHERE) @@ -331,7 +331,7 @@ data["hasHoldingTank"] = holding ? 1 : 0 if (holding) - data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.pressure > 0 ? holding.air_contents.pressure : 0)) + data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0)) // update the ui if it exists, returns null if no ui is passed/found ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) diff --git a/code/game/machinery/atmoalter/gas_mine.dm b/code/game/machinery/atmoalter/gas_mine.dm index 95d39db0888..3c6a07edbe4 100644 --- a/code/game/machinery/atmoalter/gas_mine.dm +++ b/code/game/machinery/atmoalter/gas_mine.dm @@ -89,8 +89,8 @@ //unless running on exernal power, which raises the pressure limit the more power you add /obj/machinery/atmospherics/miner/proc/tranfer_gas() pumping.copy_from(air_contents) - var/datum/gas_mixture/environment = loc.return_readonly_air() - var/environment_pressure = environment.pressure + var/datum/gas_mixture/environment = loc.return_air() + var/environment_pressure = environment.return_pressure() var/extra_power_pressure_bonus = 0 extra_power_pressure_bonus = active_power_usage * WATT_TO_KPA_OF_EXTERNAL_PRESSURE_LIMIT /* if(power_connection.connected) //raise max pressure if powered diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 5d6d08900d0..f1c82188b4b 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -53,7 +53,7 @@ use_power(5) - var/datum/gas_mixture/environment = target.return_readonly_air() + var/datum/gas_mixture/environment = target.return_air() if(!environment) icon_state = "meterX" // Pop the meter off when the environment we're attached to croaks. @@ -61,7 +61,7 @@ spawn(0) qdel(src) return PROCESS_KILL - var/env_pressure = environment.pressure + var/env_pressure = environment.return_pressure() if(env_pressure <= 0.15*ONE_ATMOSPHERE) icon_state = "meter0" else if(env_pressure <= 1.8*ONE_ATMOSPHERE) @@ -110,9 +110,9 @@ /obj/machinery/meter/proc/status() var/t = "" if (src.target) - var/datum/gas_mixture/environment = target.return_readonly_air() + var/datum/gas_mixture/environment = target.return_air() if(environment) - t += "The pressure gauge reads [round(environment.pressure, 0.01)] kPa; [environment.temperature_kelvin_pretty()]K ([environment.temperature_celsius_pretty()]°C)" + t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [environment.temperature_kelvin_pretty()]K ([environment.temperature_celsius_pretty()]°C)" else t += "The sensor error light is blinking." else diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 10e60458d1e..85f0ab09865 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -58,7 +58,7 @@ environment = loc.return_air() if(direction_out) - var/pressure_delta = target_pressure - environment.pressure + var/pressure_delta = target_pressure - environment.return_pressure() //Can not have a pressure delta that would cause environment pressure > tank pressure if(air_contents.temperature > 0) @@ -75,7 +75,7 @@ else loc.assume_air(removed) else - var/pressure_delta = target_pressure - air_contents.pressure + var/pressure_delta = target_pressure - air_contents.return_pressure() //Can not have a pressure delta that would cause environment pressure > tank pressure if(environment.temperature > 0) @@ -111,7 +111,7 @@ /obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open=NANOUI_FOCUS) var/list/data[0] data["portConnected"] = connected_port ? 1 : 0 - data["tankPressure"] = round(air_contents.pressure > 0 ? air_contents.pressure : 0) + data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) data["targetpressure"] = round(target_pressure) data["pump_dir"] = direction_out data["minpressure"] = round(pressuremin) @@ -120,7 +120,7 @@ data["hasHoldingTank"] = holding ? 1 : 0 if (holding) - data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.pressure > 0 ? holding.air_contents.pressure : 0)) + data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0)) // update the ui if it exists, returns null if no ui is passed/found ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index c4e6e071c76..67f1baf25d7 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -122,9 +122,9 @@ /obj/machinery/portable_atmospherics/scrubber/process() ..() - if(on && air_contents.pressure < MAX_PRESSURE) + if(on && air_contents.return_pressure() < MAX_PRESSURE) var/datum/gas_mixture/environment = get_environment() - var/transfer_moles = min(1, volume_rate / environment.volume) * environment.total_moles + var/transfer_moles = min(1, volume_rate / environment.volume) * environment.total_moles() var/removed_volume = min(volume_rate, environment.volume) //Take a gas sample @@ -140,7 +140,7 @@ total_to_filter.adjust_gas((gas_type), removed[gas_type], FALSE) total_to_filter.update_values() //since the FILTER macro doesn't update to save perf, we need to update here //calculate the amount of moles in scrubbing_rate litres of gas in removed and apply the scrubbing rate limit - var/filter_moles = min(1, scrubbing_rate / removed_volume) * removed.total_moles + var/filter_moles = min(1, scrubbing_rate / removed_volume) * removed.total_moles() var/datum/gas_mixture/filtered_out = total_to_filter.remove(filter_moles) removed.subtract(filtered_out) @@ -171,7 +171,7 @@ /obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open=NANOUI_FOCUS) var/list/data[0] data["portConnected"] = connected_port ? 1 : 0 - data["tankPressure"] = round(air_contents.pressure > 0 ? air_contents.pressure : 0) + data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) data["rate"] = round(volume_rate) data["on"] = on ? 1 : 0 var/list/scrub_toggles = list() @@ -182,7 +182,7 @@ data["scrub_toggles"] = scrub_toggles data["hasHoldingTank"] = holding ? 1 : 0 if (holding) - data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.pressure > 0 ? holding.air_contents.pressure : 0)) + data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0)) // update the ui if it exists, returns null if no ui is passed/found ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index bceace234c0..0c9857a684b 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -464,7 +464,7 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj /obj/machinery/atmospherics/unary/cryo_cell/proc/process_occupant() - if(air_contents.total_moles < 10) + if(air_contents.total_moles() < 10) return if(istype(occupant, /mob/living/simple_animal/)) go_out() @@ -510,7 +510,7 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj occupant.bodytemperature = mix(occupant.bodytemperature, T0C + 37, 0.6) /obj/machinery/atmospherics/unary/cryo_cell/proc/heat_gas_contents() - if(air_contents.total_moles < 1) + if(air_contents.total_moles() < 1) return var/air_heat_capacity = air_contents.heat_capacity() var/combined_heat_capacity = current_heat_capacity + air_heat_capacity @@ -519,7 +519,7 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj air_contents.temperature = combined_energy/combined_heat_capacity /obj/machinery/atmospherics/unary/cryo_cell/proc/expel_gas() - if(air_contents.total_moles < 1) + if(air_contents.total_moles() < 1) return // var/datum/gas_mixture/expel_gas = new // var/remove_amount = air_contents.total_moles()/50 diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 2487f835488..8351fc76660 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -34,14 +34,14 @@ var/global/list/alert_overlays_global = list() rstats = null else if(T && istype(T) && T.zone) - var/datum/gas_mixture/environment = T.return_readonly_air() + var/datum/gas_mixture/environment = T.return_air() for(var/i=1;i<=stats.len;i++) rstats[i] = environment.vars[stats[i]] else if(istype(T, /turf/simulated)) rstats = null // Exclude zone (wall, door, etc). else if(istype(T, /turf)) // Should still work. (/turf/return_air()) - var/datum/gas_mixture/environment = T.return_readonly_air() + var/datum/gas_mixture/environment = T.return_air() for(var/i=1;i<=stats.len;i++) rstats[i] = environment.vars[stats[i]] temps[direction] = rstats @@ -76,7 +76,7 @@ var/global/list/alert_overlays_global = list() animation_delay_predensity_opening = 3 animation_delay_predensity_closing = 7 - + machine_flags = SCREWTOGGLE | EMAGGABLE var/list/alert_overlays_local diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm index 1b79d4ecb93..693a460fd10 100644 --- a/code/game/machinery/overview.dm +++ b/code/game/machinery/overview.dm @@ -125,7 +125,7 @@ colour = rgb(red, green, blue) if(!colour2 && !T.density) - var/datum/gas_mixture/environment = T.return_readonly_air() + var/datum/gas_mixture/environment = T.return_air() var/turf_total = environment.molar_density() * CELL_VOLUME @@ -210,7 +210,7 @@ sense = 0 if("/turf/simulated/floor", "/turf/simulated/floor/engine") - var/datum/gas_mixture/environment = T.return_readonly_air() + var/datum/gas_mixture/environment = T.return_air() var/turf_total = environment.molar_density() * CELL_VOLUME var/t1 = turf_total / MOLES_CELLSTANDARD * 175 diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index b8687db9881..890ec4f2755 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -254,7 +254,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() /obj/machinery/telecomms/proc/checkheat() // Checks heat from the environment and applies any integrity damage - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() if(environment.temperature > T20C + 20) set_integrity(get_integrity() - 1) if(get_integrity() <= 0) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 223a54948f5..fbfee907171 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1028,22 +1028,22 @@ /obj/mecha/proc/return_pressure() . = 0 if(use_internal_tank) - . = cabin_air.pressure + . = cabin_air.return_pressure() else var/datum/gas_mixture/t_air = get_turf_air() if(t_air) - . = t_air.pressure + . = t_air.return_pressure() return //skytodo: //No idea what you want me to do here, mate. /obj/mecha/proc/return_temperature() . = 0 if(use_internal_tank) - . = cabin_air.temperature + . = cabin_air.return_temperature() else var/datum/gas_mixture/t_air = get_turf_air() if(t_air) - . = t_air.temperature + . = t_air.return_temperature() return /obj/mecha/proc/connect(obj/machinery/atmospherics/unary/portables_connector/new_port) @@ -2265,21 +2265,21 @@ var/datum/gas_mixture/cabin_air = mecha.cabin_air var/release_pressure = mecha.internal_tank_valve - var/cabin_pressure = cabin_air.pressure - var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.pressure - cabin_pressure)/2) + var/cabin_pressure = cabin_air.return_pressure() + var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2) var/transfer_moles = 0 if(pressure_delta > 0) //cabin pressure lower than release pressure - if(tank_air.temperature > 0) - transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.temperature * R_IDEAL_GAS_EQUATION) + if(tank_air.return_temperature() > 0) + transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) 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() pressure_delta = cabin_pressure - release_pressure if(t_air) - pressure_delta = min(cabin_pressure - t_air.pressure, pressure_delta) + pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta) if(pressure_delta > 0) //if location pressure is lower than cabin pressure - transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.temperature * R_IDEAL_GAS_EQUATION) + transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles) if(t_air) t_air.merge(removed) @@ -2313,9 +2313,9 @@ if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15)) if(mecha.cabin_air && mecha.cabin_air.return_volume()>0) - mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.temperature+rand(10,15)) - if(mecha.cabin_air.temperature>mecha.max_temperature/2) - mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.temperature,0.1), damage_type = "fire") + mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15)) + if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2) + mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1), damage_type = "fire") if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum mecha.pr_int_temp_processor.stop() if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 61aca0b040a..9c9ec8ca0b8 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -132,7 +132,7 @@ if(!istype(environment)) return - var/pressure = environment.pressure + var/pressure = environment.return_pressure() if(pressure <= 20) . = TRUE @@ -148,6 +148,6 @@ var/datum/gas_mixture/environment = T.return_air() if(!istype(environment)) return - var/pressure = environment.pressure + var/pressure = environment.return_pressure() if(pressure <= 20) . = TRUE diff --git a/code/game/objects/effects/decals/slag.dm b/code/game/objects/effects/decals/slag.dm index cf83ef2154f..3cf2ffc60e2 100644 --- a/code/game/objects/effects/decals/slag.dm +++ b/code/game/objects/effects/decals/slag.dm @@ -35,7 +35,7 @@ processing_objects.Remove(src) return var/turf/T=loc - var/datum/gas_mixture/env = T.return_readonly_air() + var/datum/gas_mixture/env = T.return_air() if(melt_temperature > env.temperature && molten && prob(5)) molten=0 solidify() diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index dd54b161517..352228a1c98 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -776,7 +776,7 @@ steam.start() -- spawns the effect savedtemp = old_air.temperature if(istype(T) && savedtemp > lowest_temperature) var/datum/gas_mixture/lowertemp = old_air.remove_volume(CELL_VOLUME) - lowertemp.add_thermal_energy(max(lowertemp.get_thermal_energy_change(lowest_temperature), -(15*CELL_VOLUME)*max(1,lowertemp.temperature/2))) + lowertemp.add_thermal_energy(max(lowertemp.get_thermal_energy_change(lowest_temperature), -(15*CELL_VOLUME)*max(1,lowertemp.return_temperature()/2))) T.assume_air(lowertemp) spawn(3) process() diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index db7ceeefad2..1b48158ebd9 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -156,7 +156,7 @@ return wax-- var/turf/T = get_turf(src) - var/datum/gas_mixture/env = T.return_readonly_air() + var/datum/gas_mixture/env = T.return_air() if(env.molar_density(GAS_OXYGEN) < (5 / CELL_VOLUME)) extinguish() processing_objects.Remove(src) diff --git a/code/game/objects/items/devices/PDA/apps/general.dm b/code/game/objects/items/devices/PDA/apps/general.dm index 28f8030af95..f1419a06b9c 100644 --- a/code/game/objects/items/devices/PDA/apps/general.dm +++ b/code/game/objects/items/devices/PDA/apps/general.dm @@ -389,14 +389,14 @@ var/global/list/facts = list("If you have 3 quarters, 4 dimes, and 4 pennies, yo if (isnull(user.loc)) dat += "Unable to obtain a reading.
" else - var/datum/gas_mixture/environment = user.loc.return_readonly_air() + var/datum/gas_mixture/environment = user.loc.return_air() if(!environment) dat += "No gasses detected.
" else - var/pressure = environment.pressure - var/total_moles = environment.total_moles + var/pressure = environment.return_pressure() + var/total_moles = environment.total_moles() dat += "Air Pressure: [round(pressure,0.1)] kPa
" diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 9206acedb1f..198ad7e2a28 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -385,8 +385,8 @@ Subject's pulse: ??? BPM"}) unit.volume = unit_vol unit.copy_from(scanned) scanned = unit - var/pressure = scanned.pressure - var/total_moles = scanned.total_moles + var/pressure = scanned.return_pressure() + var/total_moles = scanned.total_moles() var/message = "" if(!container || istype(container, /turf)) message += "Results:" diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index b3b6ef7e478..7f86033ade2 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -197,7 +197,7 @@ temp_first.react() - var/pressure = temp_first.pressure + var/pressure = temp_first.return_pressure() if(pressure <= TANK_FRAGMENT_PRESSURE) return 0 @@ -206,7 +206,7 @@ temp_first.react() temp_first.react() - pressure = temp_first.pressure + pressure = temp_first.return_pressure() var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE var/dev = round(range*0.25) diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index c6fdb4ba667..a96d65e1792 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -253,7 +253,7 @@ if(!location) return var/totaldrying = 0 - var/datum/gas_mixture/environment = location.return_readonly_air() + var/datum/gas_mixture/environment = location.return_air() if(environment.temperature >= drying_threshold_temperature + 21) //Original pre-buff temperature behavior, default 1 minute totaldrying = totaldrying + 6 else if(environment.temperature >= drying_threshold_temperature) //(Default variable value) Room temperature drying, default 6 minutes diff --git a/code/game/objects/items/weapons/boomerang.dm b/code/game/objects/items/weapons/boomerang.dm index 55765e75388..6721ea86298 100644 --- a/code/game/objects/items/weapons/boomerang.dm +++ b/code/game/objects/items/weapons/boomerang.dm @@ -172,10 +172,10 @@ boomerang = null return //if there is no air, no return trip - var/datum/gas_mixture/current_air = T.return_readonly_air() + var/datum/gas_mixture/current_air = T.return_air() var/atmosphere = 0 if(current_air) - atmosphere = current_air.pressure + atmosphere = current_air.return_pressure() if (atmosphere < ONE_ATMOSPHERE/2) visible_message("\The [boomerang] dramatically fails to come back due to the lack of air pressure.") diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index d50ded0a242..6653e71a2bf 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -137,7 +137,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM var/mob/living/M = get_holder_of_type(src,/mob/living) var/turf/location = get_turf(src) smoketime-- - var/datum/gas_mixture/env = location.return_readonly_air() + var/datum/gas_mixture/env = location.return_air() if(smoketime <= 0) lit = -1 update_brightness() @@ -469,7 +469,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM smoketime-- if (smoketime == 5 && ismob(loc)) to_chat(M, "Your [name] is about to go out.") - var/datum/gas_mixture/env = location.return_readonly_air() + var/datum/gas_mixture/env = location.return_air() if(smoketime <= 0 || env.molar_density(GAS_OXYGEN) < (5 / CELL_VOLUME)) if(smoketime > 0 && ishuman(loc)) var/mob/living/carbon/human/mysmoker = loc @@ -1036,7 +1036,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM /obj/item/weapon/lighter/attack_self(mob/living/user) var/turf/T = get_turf(src) - var/datum/gas_mixture/env = T.return_readonly_air() + var/datum/gas_mixture/env = T.return_air() user.delayNextAttack(5) //Hold on there cowboy if(!fuel || env.molar_density(GAS_OXYGEN) < (5 / CELL_VOLUME)) user.visible_message("[user] attempts to light \the [src] to no avail.", \ @@ -1101,7 +1101,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM update_brightness() visible_message("Without warning, \the [src] suddenly shuts off.") fueltime = null - var/datum/gas_mixture/env = location.return_readonly_air() + var/datum/gas_mixture/env = location.return_air() if(env.molar_density(GAS_OXYGEN) < (5 / CELL_VOLUME)) lit = 0 update_brightness() @@ -1123,7 +1123,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM /obj/item/weapon/lighter/zippo/attack_self(mob/living/user) var/turf/T = get_turf(src) - var/datum/gas_mixture/env = T.return_readonly_air() + var/datum/gas_mixture/env = T.return_air() user.delayNextAttack(5) //Hold on there cowboy if(!fuel || env.molar_density(GAS_OXYGEN) < (5 / CELL_VOLUME)) user.visible_message("[user] attempts to light \the [src] to no avail.", \ diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm index bd7326ed3c0..18141c5c509 100644 --- a/code/game/objects/items/weapons/tanks/jetpack.dm +++ b/code/game/objects/items/weapons/tanks/jetpack.dm @@ -35,12 +35,12 @@ /obj/item/weapon/tank/jetpack/proc/allow_thrust(num, mob/living/user as mob) if(!(src.on)) return 0 - if((num < 0.005 || src.air_contents.total_moles < num)) + if((num < 0.005 || src.air_contents.total_moles() < num)) src.toggle() return 0 var/datum/gas_mixture/G = src.air_contents.remove(num) - var/allgases = G.total_moles + var/allgases = G.total_moles() if(allgases >= 0.005) return 1 diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 174979e04e1..2c2aa2af88d 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -99,7 +99,7 @@ user.show_message(analyzer.output_gas_scan(src.air_contents, src, 0), 1) src.add_fingerprint(user) else if (istype(W, /obj/item/clothing/gloves/latex) || (istype(W, /obj/item/toy/balloon) && !istype(W, /obj/item/toy/balloon/inflated))) - if(air_contents.pressure >= ONE_ATMOSPHERE) + if(air_contents.return_pressure() >= ONE_ATMOSPHERE) to_chat(user, "You inflate \the [W] using \the [src].") if(istype(W, /obj/item/toy/balloon)) var/obj/item/toy/balloon/B = W @@ -134,7 +134,7 @@ // this is the data which will be sent to the ui var/data[0] - data["tankPressure"] = round(air_contents.pressure ? air_contents.pressure : 0) + data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0) data["defaultReleasePressure"] = round(TANK_DEFAULT_RELEASE_PRESSURE) data["maxReleasePressure"] = round(TANK_MAX_RELEASE_PRESSURE) @@ -244,7 +244,7 @@ if(!air_contents) return 0 - var/pressure = air_contents.pressure + var/pressure = air_contents.return_pressure() if(pressure > TANK_FRAGMENT_PRESSURE) @@ -256,7 +256,7 @@ air_contents.react() air_contents.react() air_contents.react() - pressure = air_contents.pressure + pressure = air_contents.return_pressure() var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE score.largest_TTV = max(score.largest_TTV, range) if(range > MAX_EXPLOSION_RANGE) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 029ef033b2e..0e9455747eb 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -172,10 +172,10 @@ var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXI if(handle_item_attack(W, user)) return - + if(emag_check(W,user)) . = 1 - + if(can_take_pai && istype(W, /obj/item/device/paicard)) if(integratedpai) to_chat(user, "There's already a Personal AI inserted.") @@ -461,7 +461,7 @@ var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXI ..() /obj/item/proc/checksmoke() - var/datum/gas_mixture/G = return_readonly_air() + var/datum/gas_mixture/G = return_air() if(!G) return while(G.temperature >= (autoignition_temperature * 0.75)) @@ -473,7 +473,7 @@ var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXI var/rate = clamp(lerp(G.temperature,autoignition_temperature * 0.75,autoignition_temperature,0.1,1),0.1,1) adjust_particles(PVAR_SPAWNING,rate,PS_SMOKE) sleep(10 SECONDS) - G = return_readonly_air() + G = return_air() remove_particles(PS_SMOKE) smoking = FALSE diff --git a/code/game/objects/structures/ancient_cryopod.dm b/code/game/objects/structures/ancient_cryopod.dm index 3701915f997..12f50772b48 100644 --- a/code/game/objects/structures/ancient_cryopod.dm +++ b/code/game/objects/structures/ancient_cryopod.dm @@ -26,8 +26,8 @@ message_admins("[key_name_admin(user)] has activated an ancient cryopod.") log_game("[key_name(user)] has activated an ancient cryopod.") var/turf/location = get_turf(src) - var/datum/gas_mixture/environment = location.return_readonly_air() - var/pressure = environment.pressure + var/datum/gas_mixture/environment = location.return_air() + var/pressure = environment.return_pressure() if(((pressure < WARNING_HIGH_PRESSURE) && pressure > WARNING_LOW_PRESSURE)) thawing = TRUE visible_message("\The [name] beeps and clicks, then flickers to life, displaying the text 'Attempting to revive occupant...'.") diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index 20c64283cf4..907729dc9ef 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -17,7 +17,7 @@ var/turf/simulated/T=get_turf(get_step(loc,dir)) var/cp=0 if(T && istype(T) && T.zone) - var/datum/gas_mixture/environment = T.return_readonly_air() + var/datum/gas_mixture/environment = T.return_air() cp = environment.return_pressure() else if(istype(T,/turf/simulated)) @@ -39,8 +39,8 @@ var/cp = 0 var/turf/simulated/TS = T if(TS && istype(TS) && TS.zone) - var/datum/gas_mixture/environment = TS.return_readonly_air() - cp = environment.pressure + var/datum/gas_mixture/environment = TS.return_air() + cp = environment.return_pressure() else if(istype(T,/turf/simulated)) continue @@ -56,14 +56,14 @@ var/turf/simulated/lT=loc if(!istype(lT) || !lT.zone) return 0 - var/datum/gas_mixture/myenv=lT.return_readonly_air() - var/pressure=myenv.pressure + var/datum/gas_mixture/myenv=lT.return_air() + var/pressure=myenv.return_pressure() for(var/dir in cardinal) var/turf/simulated/T=get_turf(get_step(loc,dir)) if(T && istype(T) && T.zone) - var/datum/gas_mixture/environment = T.return_readonly_air() - var/pdiff = abs(pressure - environment.pressure) + var/datum/gas_mixture/environment = T.return_air() + var/pdiff = abs(pressure - environment.return_pressure()) if(pdiff > FALSEDOOR_MAX_PRESSURE_DIFF) return pdiff return 0 diff --git a/code/game/say.dm b/code/game/say.dm index ad16d8548c7..ab23b518cb2 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -60,9 +60,9 @@ var/global/lastDecTalkUse = 0 var/turf/T = get_turf(speech.speaker) if(T && !T.c_airblock(T)) //we are on an airflowing tile var/atmos = 0 - var/datum/gas_mixture/current_air = T.return_readonly_air() + var/datum/gas_mixture/current_air = T.return_air() if(current_air) - atmos = round(current_air.pressure/ONE_ATMOSPHERE, 0.1) + atmos = round(current_air.return_pressure()/ONE_ATMOSPHERE, 0.1) else atmos = 0 //no air diff --git a/code/game/sound.dm b/code/game/sound.dm index 5ca89e3138e..40de6876750 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -74,9 +74,9 @@ var/list/sand_sound = list('sound/effects/sand_walk1.ogg', 'sound/effects/sand_w if(gas_modified && turf_source && !turf_source.c_airblock(turf_source)) //if the sound is modified by air, and we are on an airflowing tile var/atmosphere = 0 - var/datum/gas_mixture/current_air = turf_source.return_readonly_air() + var/datum/gas_mixture/current_air = turf_source.return_air() if(current_air) - atmosphere = current_air.pressure + atmosphere = current_air.return_pressure() else atmosphere = 0 //no air @@ -127,10 +127,10 @@ var/const/SURROUND_CAP = 7 if(!current_turf) return - var/datum/gas_mixture/environment = current_turf.return_readonly_air() + var/datum/gas_mixture/environment = current_turf.return_air() var/atmosphere = 0 if(environment) - atmosphere = environment.pressure + atmosphere = environment.return_pressure() /// Local sound modifications /// if(atmosphere < MIN_SOUND_PRESSURE) //no sound reception in space, boyos diff --git a/code/game/turfs/simulated/floor_glass.dm b/code/game/turfs/simulated/floor_glass.dm index f75317269d6..554d3088cb6 100644 --- a/code/game/turfs/simulated/floor_glass.dm +++ b/code/game/turfs/simulated/floor_glass.dm @@ -88,8 +88,8 @@ if(M) var/pressure = 0 if(src.zone) - var/datum/gas_mixture/environment = src.return_readonly_air() - pressure = environment.pressure + var/datum/gas_mixture/environment = src.return_air() + pressure = environment.return_pressure() if (pressure > 0) message_admins("Glass floor with pressure [pressure]kPa broken (method=[method]) by [M.real_name] ([formatPlayerPanel(M,M.ckey)]) at [formatJumpTo(src)]!") log_admin("Window with pressure [pressure]kPa broken (method=[method]) by [M.real_name] ([M.ckey]) at [src]!") @@ -249,8 +249,8 @@ "You hear welding noises.") var/pressure = 0 if(src.zone) - var/datum/gas_mixture/environment = src.return_readonly_air() - pressure = environment.pressure + var/datum/gas_mixture/environment = src.return_air() + pressure = environment.return_pressure() if (pressure > 0) message_admins("Glass floor with pressure [pressure]kPa deconstructed by [user.real_name] ([formatPlayerPanel(user,user.ckey)]) at [formatJumpTo(src)]!") log_admin("Window with pressure [pressure]kPa deconstructed by [user.real_name] ([user.ckey]) at [src]!") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 852d9b0935d..ce943496e65 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -177,7 +177,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if (!( istype(T, /turf) )) return - var/datum/gas_mixture/env = T.return_readonly_air() + var/datum/gas_mixture/env = T.return_air() var/t = "" diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index a9cb1bf9dc1..610e5cdcd18 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -162,7 +162,7 @@ qdel(src) /obj/item/weapon/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out. - var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles) + var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles()) var/turf/simulated/T = get_turf(src) if(!T) return diff --git a/code/modules/components/ai/atmos.dm b/code/modules/components/ai/atmos.dm index 20593893a49..7bb6aad1299 100644 --- a/code/modules/components/ai/atmos.dm +++ b/code/modules/components/ai/atmos.dm @@ -31,7 +31,7 @@ if(isturf(A)) var/turf/T = A - var/datum/gas_mixture/Environment = T.return_readonly_air() + var/datum/gas_mixture/Environment = T.return_air() if(Environment) if(abs(Environment.temperature - dude.bodytemperature) > min_overheat_temp) diff --git a/code/modules/components/ai/door_opener.dm b/code/modules/components/ai/door_opener.dm index 71c0f79c51a..b130393fdbe 100644 --- a/code/modules/components/ai/door_opener.dm +++ b/code/modules/components/ai/door_opener.dm @@ -39,14 +39,14 @@ var/turf/simulated/lT=loc if(!istype(lT) || !lT.zone) return 0 - var/datum/gas_mixture/myenv=lT.return_readonly_air() - var/pressure=myenv.pressure + var/datum/gas_mixture/myenv=lT.return_air() + var/pressure=myenv.return_pressure() for(var/dir in cardinal) var/turf/simulated/T=get_turf(get_step(loc,dir)) if(T && istype(T) && T.zone) - var/datum/gas_mixture/environment = T.return_readonly_air() - var/pdiff = abs(pressure - environment.pressure) + var/datum/gas_mixture/environment = T.return_air() + var/pdiff = abs(pressure - environment.return_pressure()) if(pdiff > max_pressure_diff) return pdiff return 0 diff --git a/code/modules/hydroponics/hydro_tray.dm b/code/modules/hydroponics/hydro_tray.dm index 8f0347895a6..f81f55a16d2 100644 --- a/code/modules/hydroponics/hydro_tray.dm +++ b/code/modules/hydroponics/hydro_tray.dm @@ -579,7 +579,7 @@ var/list/hydro_trays = list() if(!environment) if(istype(T)) - environment = T.return_readonly_air() + environment = T.return_air() if(!environment) if(istype(T, /turf/space)) diff --git a/code/modules/hydroponics/hydro_tray_process.dm b/code/modules/hydroponics/hydro_tray_process.dm index da81df88ac2..ef84f89dfe5 100644 --- a/code/modules/hydroponics/hydro_tray_process.dm +++ b/code/modules/hydroponics/hydro_tray_process.dm @@ -418,7 +418,7 @@ environment.adjust_gas(gas, max(1,round((seed.exude_gasses[gas]*round(seed.potency))/seed.exude_gasses.len))) /obj/machinery/portable_atmospherics/hydroponics/proc/check_kpa(var/datum/gas_mixture/environment) - var/pressure = environment.pressure + var/pressure = environment.return_pressure() if(pressure < seed.lowkpa_tolerance || pressure > seed.highkpa_tolerance) improper_kpa = 1 else diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 58dd2a82a4d..58465b41e31 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -41,9 +41,9 @@ // Handle life. var/turf/simulated/T = get_turf(src) if(istype(T)) - var/datum/gas_mixture/environment = T.return_readonly_air() + var/datum/gas_mixture/environment = T.return_air() if(environment) - if(environment.pressure > seed.highkpa_tolerance) //Kudzu can live at 0KPA, otherwise you could just vent the room to kill it. + if(environment.return_pressure() > seed.highkpa_tolerance) //Kudzu can live at 0KPA, otherwise you could just vent the room to kill it. health -= rand(5,10) if(abs(environment.temperature - seed.ideal_heat) > seed.heat_tolerance) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 028f406c669..4e852bfffbf 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -459,8 +459,8 @@ spawn(5) qdel(src) else - var/datum/gas_mixture/environment = proj_turf.return_readonly_air() - var/pressure = environment.pressure + var/datum/gas_mixture/environment = proj_turf.return_air() + var/pressure = environment.return_pressure() if(pressure < 50) name = "strong resonance field" resonance_damage = 60 diff --git a/code/modules/mob/dead/observer/verbs.dm b/code/modules/mob/dead/observer/verbs.dm index a2417bb7f03..b441e2d815a 100644 --- a/code/modules/mob/dead/observer/verbs.dm +++ b/code/modules/mob/dead/observer/verbs.dm @@ -275,10 +275,10 @@ if (!( istype(usr.loc, /turf) )) return - var/datum/gas_mixture/environment = usr.loc.return_readonly_air() + var/datum/gas_mixture/environment = usr.loc.return_air() - var/pressure = environment.pressure - var/total_moles = environment.total_moles + var/pressure = environment.return_pressure() + var/total_moles = environment.total_moles() var/tiles = environment.return_volume() / CELL_VOLUME to_chat(src, "Results:") diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index b74188ebd6e..1ac4f1de1c4 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -16,7 +16,7 @@ ..() - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() if (stat != DEAD) //still breathing diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 42bc1d4945d..ac61a170176 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -18,7 +18,7 @@ return 0 //under effects of time magick ..() - var/datum/gas_mixture/enviroment = loc.return_readonly_air() + var/datum/gas_mixture/enviroment = loc.return_air() if (stat != DEAD) //still breathing // GROW! diff --git a/code/modules/mob/living/carbon/complex/life.dm b/code/modules/mob/living/carbon/complex/life.dm index a704324d859..4244553f173 100644 --- a/code/modules/mob/living/carbon/complex/life.dm +++ b/code/modules/mob/living/carbon/complex/life.dm @@ -8,7 +8,7 @@ blinded = null var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE if(loc) - environment = loc.return_readonly_air() + environment = loc.return_air() if (stat != DEAD) //still breathing //Lungs required beyond this point @@ -217,7 +217,7 @@ //Account for massive pressure differences - var/pressure = environment.pressure + var/pressure = environment.return_pressure() var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. switch(adjusted_pressure) if(HAZARD_HIGH_PRESSURE to INFINITY) diff --git a/code/modules/mob/living/carbon/complex/martian/martian.dm b/code/modules/mob/living/carbon/complex/martian/martian.dm index e3faffdb2de..9e2b2bb69b6 100644 --- a/code/modules/mob/living/carbon/complex/martian/martian.dm +++ b/code/modules/mob/living/carbon/complex/martian/martian.dm @@ -138,5 +138,5 @@ if(fishbowl.tank && istype(fishbowl.tank, /obj/item/weapon/tank)) var/obj/item/weapon/tank/internal = fishbowl.tank stat("Internal Atmosphere Info", internal.name) - stat("Tank Pressure", internal.air_contents.pressure) + stat("Tank Pressure", internal.air_contents.return_pressure()) stat("Distribution Pressure", internal.distribute_pressure) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ee1e238bac2..a1f35926338 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -255,7 +255,7 @@ QDEL_NULL(internal) else stat("Internal Atmosphere Info", internal.name) - stat("Tank Pressure", internal.air_contents.pressure) + stat("Tank Pressure", internal.air_contents.return_pressure()) stat("Distribution Pressure", internal.distribute_pressure) /*if(mind) if(mind.changeling) @@ -2101,7 +2101,7 @@ var/datum/record_organ //This is just a dummy proc, not storing any variables he if(!can_be_fat) species.anatomy_flags &= ~CAN_BE_FAT - + species.blood_color = get_random_colour() species.flesh_color = get_random_colour() diff --git a/code/modules/mob/living/carbon/human/life/handle_breath.dm b/code/modules/mob/living/carbon/human/life/handle_breath.dm index ca16a40e310..501e280152b 100644 --- a/code/modules/mob/living/carbon/human/life/handle_breath.dm +++ b/code/modules/mob/living/carbon/human/life/handle_breath.dm @@ -132,7 +132,7 @@ if((status_flags & GODMODE) || (flags & INVULNERABLE)) return 0 var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"] - if(!breath || (breath.total_moles == 0) || (mind && mind.suiciding) || !L) + if(!breath || (breath.total_moles() == 0) || (mind && mind.suiciding) || !L) if(reagents.has_any_reagents(list(INAPROVALINE,PRESLOMITE))) return 0 if(mind && mind.suiciding) diff --git a/code/modules/mob/living/carbon/human/life/handle_environment.dm b/code/modules/mob/living/carbon/human/life/handle_environment.dm index 9d147b81153..277d29bc818 100644 --- a/code/modules/mob/living/carbon/human/life/handle_environment.dm +++ b/code/modules/mob/living/carbon/human/life/handle_environment.dm @@ -43,7 +43,7 @@ //Account for massive pressure differences. Done by Polymorph //Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense! - var/pressure = environment.pressure + var/pressure = environment.return_pressure() var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. if(adjusted_pressure >= species.hazard_high_pressure) adjustBruteLoss(min(((adjusted_pressure/species.hazard_high_pressure) - 1) * PRESSURE_DAMAGE_COEFFICIENT, MAX_HIGH_PRESSURE_DAMAGE)) diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm index 740cd019153..8c754244cef 100644 --- a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm +++ b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm @@ -130,7 +130,7 @@ temperature_alert = TEMP_ALARM_HEAT_STRONG else if(has_reagent_in_blood(FROSTOIL)) temperature_alert = TEMP_ALARM_COLD_STRONG - else if(!(get_thermal_loss(loc.return_readonly_air()) > 0.1) || bodytemperature > T0C + 50) + else if(!(get_thermal_loss(loc.return_air()) > 0.1) || bodytemperature > T0C + 50) switch(bodytemperature) //310.055 optimal body temp if(370 to INFINITY) temperature_alert = TEMP_ALARM_HEAT_STRONG @@ -149,7 +149,7 @@ else if(is_vessel_dilated() && undergoing_hypothermia() == MODERATE_HYPOTHERMIA) temperature_alert = TEMP_ALARM_HEAT_STRONG // yes, this is intentional - this is the cause of "paradoxical undressing", ie feeling 2hot when hypothermic else - switch(get_thermal_loss(loc.return_readonly_air())) // How many degrees of celsius we are losing per tick. + switch(get_thermal_loss(loc.return_air())) // How many degrees of celsius we are losing per tick. if(0.1 to 0.15) temperature_alert = TEMP_ALARM_SAFE if(0.15 to 0.2) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 442baf6ce67..37916452129 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -24,7 +24,7 @@ var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE if(loc) - environment = loc.return_readonly_air() + environment = loc.return_air() if (stat != DEAD) //still breathing //Lungs required beyond this point @@ -451,7 +451,7 @@ fire_alert = 0 //Account for massive pressure differences - var/pressure = environment.pressure + var/pressure = environment.return_pressure() var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. switch(adjusted_pressure) if(HAZARD_HIGH_PRESSURE to INFINITY) diff --git a/code/modules/mob/living/carbon/slime/life.dm b/code/modules/mob/living/carbon/slime/life.dm index 76f493cbf46..35f2300f967 100644 --- a/code/modules/mob/living/carbon/slime/life.dm +++ b/code/modules/mob/living/carbon/slime/life.dm @@ -26,7 +26,7 @@ var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE if(src.loc) - environment = loc.return_readonly_air() + environment = loc.return_air() //Apparently, the person who wrote this code designed it so that //blinded get reset each cycle and then get activated later in the diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 0eea2837c4a..bd858960a49 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -324,7 +324,7 @@ var/oxy=0 var/turf/T=get_turf(src) if(istype(T)) - var/datum/gas_mixture/G = T.return_readonly_air() // Check if we're standing in an oxygenless environment + var/datum/gas_mixture/G = T.return_air() // Check if we're standing in an oxygenless environment if(G) oxy = G.molar_density(GAS_OXYGEN) if(oxy < (1 / CELL_VOLUME) || fire_stacks < 0) @@ -341,7 +341,7 @@ var/turf/T = get_turf(src) var/flevel = air.calculate_firelevel(T) - var/pressure = air.pressure + var/pressure = air.return_pressure() FireBurn(flevel,temperature, pressure) /mob/living/proc/FireBurn(var/firelevel = 0, var/temperature, var/pressure) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 02e6cae3f43..7b635a58542 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -613,14 +613,14 @@ if (isnull(loc)) dat += "Unable to obtain a reading.
" else - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() if(isnull(environment)) dat += "No gasses detected.
" else - var/pressure = environment.pressure - var/total_moles = environment.total_moles + var/pressure = environment.return_pressure() + var/total_moles = environment.total_moles() dat += "Air Pressure: [round(pressure,0.1)] kPa
" diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 5e9b88c921d..3acd1a4a2fa 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -25,7 +25,7 @@ handle_beams() if(loc) - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() handle_pressure_damage(environment) handle_heat_damage(environment) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 2bf2b3d445e..f8ec6c1dfac 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -404,7 +404,7 @@ var/obj/item/weapon/tank/jetpack/current_jetpack = installed_jetpack() if(current_jetpack) stat("Internal Atmosphere Info", current_jetpack.name) - stat("Tank Pressure", current_jetpack.air_contents.pressure) + stat("Tank Pressure", current_jetpack.air_contents.return_pressure()) // this function returns the robots jetpack, if one is installed /mob/living/silicon/robot/proc/installed_jetpack() diff --git a/code/modules/mob/living/silicon/robot/robot_hud.dm b/code/modules/mob/living/silicon/robot/robot_hud.dm index e716182ad17..aee142f9064 100644 --- a/code/modules/mob/living/silicon/robot/robot_hud.dm +++ b/code/modules/mob/living/silicon/robot/robot_hud.dm @@ -79,7 +79,7 @@ // This handles the pressure sensor hud element. Values based on human values. /mob/living/silicon/robot/proc/handle_pressure_damage(datum/gas_mixture/environment) //by the power of Polymorph and Errorage - var/localpressure = environment.pressure + var/localpressure = environment.return_pressure() var/adjusted_pressure = localpressure - ONE_ATMOSPHERE //REAL pressure if(localpressure) if(adjusted_pressure >= HAZARD_HIGH_PRESSURE) @@ -97,7 +97,7 @@ // This handles the temp sensor hud element /mob/living/silicon/robot/proc/handle_heat_damage(datum/gas_mixture/environment) - var/envirotemp = environment.temperature + var/envirotemp = environment.return_temperature() if(environment) if(envirotemp) if (envirotemp >= 1000 ) //1000 is the heat_level_3 for humans diff --git a/code/modules/mob/living/simple_animal/borer/egg.dm b/code/modules/mob/living/simple_animal/borer/egg.dm index 190bf20d9dd..15ff409072f 100644 --- a/code/modules/mob/living/simple_animal/borer/egg.dm +++ b/code/modules/mob/living/simple_animal/borer/egg.dm @@ -86,7 +86,7 @@ var/turf/location = get_turf(src) if(!location) return - var/datum/gas_mixture/environment = location.return_readonly_air() + var/datum/gas_mixture/environment = location.return_air() //testing("[type]/PROCESS() - plasma: [environment[GAS_PLASMA]]") var/meets_conditions=1 for(var/gas_id in required_mols) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm index ced3044795d..e613444f8bd 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm @@ -111,14 +111,14 @@ return if(!istype(curturf)) return 0 - var/datum/gas_mixture/myenv=curturf.return_readonly_air() - var/pressure=myenv.pressure + var/datum/gas_mixture/myenv=curturf.return_air() + var/pressure=myenv.return_pressure() for(var/checkdir in cardinal) var/turf/T = get_step(curturf, checkdir) if(T && istype(T)) - var/datum/gas_mixture/environment = T.return_readonly_air() - var/pdiff = abs(pressure - environment.pressure) + var/datum/gas_mixture/environment = T.return_air() + var/pdiff = abs(pressure - environment.return_pressure()) if(pdiff > SPIDER_MAX_PRESSURE_DIFF) return pdiff return 0 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index dbb5fc31dce..9ebcf6eced5 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -276,7 +276,7 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t var/datum/gas_mixture/environment if(loc) - environment = loc.return_readonly_air() + environment = loc.return_air() handle_environment(environment) handle_regular_hud_updates() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index dbb47e2a1c8..2c83aed171b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -276,7 +276,7 @@ if(!loc) return 0 - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() var/t = " Coordinates: [x],[y] \n" diff --git a/code/modules/mob/thermoregulation.dm b/code/modules/mob/thermoregulation.dm index 5944edfaf7d..ba4414f9114 100644 --- a/code/modules/mob/thermoregulation.dm +++ b/code/modules/mob/thermoregulation.dm @@ -63,7 +63,7 @@ if((status_flags & GODMODE) || (flags & INVULNERABLE)) return 0 if(!environment) - environment = loc.return_readonly_air() + environment = loc.return_air() var/loc_temp = get_loc_temp(environment) if(loc_temp < bodytemperature) // We're going to try and just use exposed area(temperature difference)/cold divisor, and assume we're only conducting. @@ -128,7 +128,7 @@ /mob/living/proc/get_loc_temp(var/datum/gas_mixture/environment) if(!environment) - environment = loc.return_readonly_air() + environment = loc.return_air() var/loc_temp = T0C if(istype(loc, /obj/mecha)) var/obj/mecha/M = loc diff --git a/code/modules/multiz/pipes.dm b/code/modules/multiz/pipes.dm index be93e09526a..5d95eb851ad 100644 --- a/code/modules/multiz/pipes.dm +++ b/code/modules/multiz/pipes.dm @@ -62,9 +62,9 @@ . = PROCESS_KILL /obj/machinery/atmospherics/pipe/zpipe/check_pressure(pressure) - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() - var/pressure_difference = pressure - environment.pressure + var/pressure_difference = pressure - environment.return_pressure() if(pressure_difference > maximum_pressure) burst() diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 4e8a4d38216..2c551e359b6 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -189,16 +189,16 @@ if(circ1) data["first_flow_cap"] = round(circ1.volume_capacity_used * 100) - data["first_in_pressure"] = round(circ1.air1.pressure, 1) + data["first_in_pressure"] = round(circ1.air1.return_pressure(), 1) data["first_in_temp"] = round(circ1.air1.temperature, 1) - data["first_out_pressure"] = round(circ1.air2.pressure, 1) + data["first_out_pressure"] = round(circ1.air2.return_pressure(), 1) data["first_out_temp"] = round(circ1.air2.temperature, 1) if(circ2) data["second_flow_cap"] = round(circ2.volume_capacity_used * 100) - data["second_in_pressure"] = round(circ2.air1.pressure, 1) + data["second_in_pressure"] = round(circ2.air1.return_pressure(), 1) data["second_in_temp"] = round(circ2.air1.temperature, 1) - data["second_out_pressure"] = round(circ2.air2.pressure, 1) + data["second_out_pressure"] = round(circ2.air2.return_pressure(), 1) data["second_out_temp"] = round(circ2.air2.temperature, 1) return data diff --git a/code/modules/power/rust/core_field.dm b/code/modules/power/rust/core_field.dm index 8a492bfc9a8..e37f2fd0bd2 100644 --- a/code/modules/power/rust/core_field.dm +++ b/code/modules/power/rust/core_field.dm @@ -142,7 +142,7 @@ Deuterium-tritium fusion: 4.5 x 10^7 K //at minimum strength, 0.25% of the field volume is pulled in per update (?) //have a max of 1000 moles suspended if(held_plasma[GAS_PLASMA] < transfer_ratio * 1000) - var/moles_covered = environment.pressure*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION) + var/moles_covered = environment.return_pressure()*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION) // to_chat(world, "moles_covered: [moles_covered]") // diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index e5b16dbf166..17dd4ab8928 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -121,14 +121,14 @@ lastgen = ((compressor.rpm / TURBGENQ)**TURBGENG) *TURBGENQ add_avail(lastgen) - var/newrpm = ((compressor.gas_contained.temperature) * compressor.gas_contained.total_moles)/4 + var/newrpm = ((compressor.gas_contained.temperature) * compressor.gas_contained.total_moles())/4 newrpm = max(0, newrpm) if(!compressor.starter || newrpm > 1000) compressor.rpmtarget = newrpm - if(compressor.gas_contained.total_moles>0) - var/oamount = min(compressor.gas_contained.total_moles, (compressor.rpm+100)/35000*compressor.capacity) + if(compressor.gas_contained.total_moles()>0) + var/oamount = min(compressor.gas_contained.total_moles(), (compressor.rpm+100)/35000*compressor.capacity) var/datum/gas_mixture/removed = compressor.gas_contained.remove(oamount) outturf.assume_air(removed) diff --git a/code/modules/projectiles/guns/projectile/constructable/blastcannon.dm b/code/modules/projectiles/guns/projectile/constructable/blastcannon.dm index 2feffd30103..3b31f722edf 100644 --- a/code/modules/projectiles/guns/projectile/constructable/blastcannon.dm +++ b/code/modules/projectiles/guns/projectile/constructable/blastcannon.dm @@ -168,7 +168,7 @@ if(bomb_air_contents_2) bomb_air_contents_2.react() - var/pressure = bomb_air_contents_2.pressure + var/pressure = bomb_air_contents_2.return_pressure() var/heavy_damage_range = 0 var/medium_damage_range = 0 @@ -178,16 +178,16 @@ bomb_air_contents_2.react() bomb_air_contents_2.react() bomb_air_contents_2.react() - pressure = bomb_air_contents_2.pressure + pressure = bomb_air_contents_2.return_pressure() var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE score.largest_TTV = max(score.largest_TTV, range) if(!ignorecap && (range > MAX_EXPLOSION_RANGE)) overcap = range range = min(range, MAX_EXPLOSION_RANGE) - var/transfer_moles1 = (bomb.tank_one.air_contents.pressure * bomb.tank_one.air_contents.volume) / (bomb.tank_one.air_contents.temperature * R_IDEAL_GAS_EQUATION) + var/transfer_moles1 = (bomb.tank_one.air_contents.return_pressure() * bomb.tank_one.air_contents.volume) / (bomb.tank_one.air_contents.temperature * R_IDEAL_GAS_EQUATION) bomb.tank_one.air_contents.remove(transfer_moles1) - var/transfer_moles2 = (bomb.tank_two.air_contents.pressure * bomb.tank_two.air_contents.volume) / (bomb.tank_two.air_contents.temperature * R_IDEAL_GAS_EQUATION) + var/transfer_moles2 = (bomb.tank_two.air_contents.return_pressure() * bomb.tank_two.air_contents.volume) / (bomb.tank_two.air_contents.temperature * R_IDEAL_GAS_EQUATION) bomb.tank_two.air_contents.remove(transfer_moles2) bomb_air_contents_1 = null diff --git a/code/modules/projectiles/guns/projectile/constructable/flamethrower.dm b/code/modules/projectiles/guns/projectile/constructable/flamethrower.dm index 62bce10ba4f..c7cf95e6e95 100644 --- a/code/modules/projectiles/guns/projectile/constructable/flamethrower.dm +++ b/code/modules/projectiles/guns/projectile/constructable/flamethrower.dm @@ -105,8 +105,8 @@ if(!tank_gas) return tank_gas.update_values() - var/pressure = tank_gas.pressure - var/total_moles = tank_gas.total_moles + var/pressure = tank_gas.return_pressure() + var/total_moles = tank_gas.total_moles() if(total_moles) var/o2_concentration = tank_gas[GAS_OXYGEN]/total_moles if(o2_concentration > 0.01) @@ -197,7 +197,7 @@ /obj/item/weapon/gun/projectile/flamethrower/proc/flamethrower_window(mob/user) if(window_open) user.set_machine(src) - var/dat = text("Flamethrower ([lit ? "Lit" : "Unlit"])
\n Tank Pressure: [ptank ? "[ptank.air_contents.pressure]" : "No tank loaded."]
\nPercentage to throw: - - - [throw_percent] + + +
\nRemove plasmatank - Close
") + var/dat = text("Flamethrower ([lit ? "Lit" : "Unlit"])
\n Tank Pressure: [ptank ? "[ptank.air_contents.return_pressure()]" : "No tank loaded."]
\nPercentage to throw: - - - [throw_percent] + + +
\nRemove plasmatank - Close
") user << browse(dat, "window=flamethrower;size=600x300") onclose(user, "flamethrower", src) diff --git a/code/modules/projectiles/guns/projectile/pneumatic.dm b/code/modules/projectiles/guns/projectile/pneumatic.dm index 1275951830f..e148ceda705 100644 --- a/code/modules/projectiles/guns/projectile/pneumatic.dm +++ b/code/modules/projectiles/guns/projectile/pneumatic.dm @@ -68,7 +68,7 @@ ..() to_chat(user, "The valve is dialed to [pressure_setting]%.") if(tank) - to_chat(user, "The tank dial reads [tank.air_contents.pressure] kPa.") + to_chat(user, "The tank dial reads [tank.air_contents.return_pressure()] kPa.") else to_chat(user, "Nothing is attached to the tank valve!") @@ -132,7 +132,7 @@ if (!istype(targloc) || !istype(curloc)) return - var/fire_pressure = (tank.air_contents.pressure/100)*pressure_setting + var/fire_pressure = (tank.air_contents.return_pressure()/100)*pressure_setting if (fire_pressure < minimum_tank_pressure) to_chat(user, "There isn't enough gas in the tank to fire [src].") diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 1fba9f05a86..c3bb0f8bc6e 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -755,7 +755,7 @@ if(!gas_jet) bullet_die() else - original_total_moles = gas_jet.total_moles + original_total_moles = gas_jet.total_moles() /obj/item/projectile/bullet/fire_plume/proc/create_puff() if(gas_jet) @@ -868,7 +868,7 @@ var/datum/gas_mixture/firemix = new /datum/gas_mixture firemix.adjust_gas(GAS_PLASMA, 666) gas_jet = firemix - jet_pressure = firemix.pressure + jet_pressure = firemix.return_pressure() gas_jet.temperature = 383.15 burn_strength = gas_jet.temperature @@ -1114,4 +1114,4 @@ if(!blocked && ishuman(atarget)) reagents.trans_to(atarget, reagents.total_volume) else - reagents.reaction(atarget) + reagents.reaction(atarget) \ No newline at end of file diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index e83c857cb14..c0536906533 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -144,8 +144,8 @@ var/turf/proj_turf = get_turf(src) if(!istype(proj_turf, /turf)) return - var/datum/gas_mixture/environment = proj_turf.return_readonly_air() - var/pressure = environment.pressure + var/datum/gas_mixture/environment = proj_turf.return_air() + var/pressure = environment.return_pressure() if(pressure < 50) name = "full strength kinetic force" damage += low_pressure_bonus diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index ebb28a64b69..6a24fcce172 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -476,7 +476,7 @@ var/list/LOGGED_SPLASH_REAGENTS = list(FUEL, THERMITE) update_temperature_overlays() return - var/datum/gas_mixture/air = return_readonly_air() + var/datum/gas_mixture/air = return_air() if (!air) thermal_entropy_containers.Remove(src) diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 4215dfa14ef..ab1940ec7ba 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -940,7 +940,7 @@ /obj/structure/reagent_dispensers/cauldron/barrel/proc/start_fire(mob/user) var/turf/T = get_turf(src) - var/datum/gas_mixture/G = T.return_readonly_air() + var/datum/gas_mixture/G = T.return_air() if(!G || G.molar_density(GAS_OXYGEN) < 0.1 / CELL_VOLUME) visible_message("\The [src] fails to ignite due to lack of oxygen.") return 0 diff --git a/code/modules/reagents/reagents/reagents_food.dm b/code/modules/reagents/reagents/reagents_food.dm index bf06e49eac3..3c166695fe7 100644 --- a/code/modules/reagents/reagents/reagents_food.dm +++ b/code/modules/reagents/reagents/reagents_food.dm @@ -294,7 +294,7 @@ T.wet(800) var/hotspot = (locate(/obj/effect/fire) in T) if(hotspot) - var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles) + var/datum/gas_mixture/lowertemp = T.remove_air(T:air:total_moles()) lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2), 0) lowertemp.react() T.assume_air(lowertemp) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index bf1e055f6e3..8024f4c1771 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -251,7 +251,7 @@ var/list/data[0] if(air_contents) - data["pressure"] = round(100 * air_contents.pressure / (SEND_PRESSURE)) + data["pressure"] = round(100 * air_contents.return_pressure() / (SEND_PRESSURE)) data["flush"] = flush data["mode"] = mode data["isAI"] = isAI(user) @@ -261,7 +261,7 @@ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) // the ui does not exist, so we'll create a new() one - // for a list of parameters and their descriptions see the code docs in \code\\modules\nano\nanoui.dm + // for a list of parameters and their descriptions see the code docs in \code\\modules\nano\nanoui.dm ui = new(user, src, ui_key, template_path, "Waste Disposal Unit", 430, 150) // when the ui is first opened this is the data it will use ui.set_initial_data(data) @@ -379,7 +379,7 @@ src.updateDialog() - if(flush && air_contents.pressure >= SEND_PRESSURE ) // flush can happen even without power + if(flush && air_contents.return_pressure() >= SEND_PRESSURE ) // flush can happen even without power spawn(0) flush() @@ -397,7 +397,7 @@ var/atom/L = loc // recharging from loc turf var/datum/gas_mixture/env = L.return_air() - var/pressure_delta = (SEND_PRESSURE*1.01) - air_contents.pressure + var/pressure_delta = (SEND_PRESSURE*1.01) - air_contents.return_pressure() if(env.temperature > 0) var/transfer_moles = 0.1 * pressure_delta * air_contents.volume / (env.temperature * R_IDEAL_GAS_EQUATION) @@ -408,7 +408,7 @@ // if full enough, switch to ready mode - if(air_contents.pressure >= SEND_PRESSURE) + if(air_contents.return_pressure() >= SEND_PRESSURE) mode = 2 update_icon() return diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index cdb4c248623..c1e15d18b8e 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -55,7 +55,7 @@ id_with_download += text2num(N) /obj/machinery/r_n_d/server/process() - var/datum/gas_mixture/environment = loc.return_readonly_air() + var/datum/gas_mixture/environment = loc.return_air() switch(environment.temperature) if(0 to T0C) health = min(100, health + 1) @@ -341,7 +341,7 @@ A.anchored = 1 src.transfer_fingerprints_to(A) qdel(src) - else + else return ..() /obj/machinery/computer/rdservercontrol/emag_act(mob/user) diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm b/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm index e004f69f996..fff9973e043 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact_hoverpod.dm @@ -46,8 +46,8 @@ var/turf/mech_turf = get_turf(src) if(!istype(mech_turf, /turf)) return - var/datum/gas_mixture/environment = mech_turf.return_readonly_air() - var/pressure = environment.pressure + var/datum/gas_mixture/environment = mech_turf.return_air() + var/pressure = environment.return_pressure() if(pressure > 50) step_in = 4 else diff --git a/code/modules/spacepods/spacepods.dm b/code/modules/spacepods/spacepods.dm index 33b28c68fb5..278e7bf23d9 100644 --- a/code/modules/spacepods/spacepods.dm +++ b/code/modules/spacepods/spacepods.dm @@ -408,21 +408,21 @@ /obj/spacepod/proc/return_pressure() . = 0 if(use_internal_tank) - . = cabin_air.pressure + . = cabin_air.return_pressure() else var/datum/gas_mixture/t_air = get_turf_air() if(t_air) - . = t_air.pressure + . = t_air.return_pressure() return /obj/spacepod/proc/return_temperature() . = 0 if(use_internal_tank) - . = cabin_air.temperature + . = cabin_air.return_temperature() else var/datum/gas_mixture/t_air = get_turf_air() if(t_air) - . = t_air.temperature + . = t_air.return_temperature() return /obj/spacepod/MouseDropTo(atom/moved, mob/user) @@ -601,21 +601,21 @@ var/datum/gas_mixture/cabin_air = spacepod.cabin_air var/release_pressure = ONE_ATMOSPHERE - var/cabin_pressure = cabin_air.pressure - var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.pressure - cabin_pressure)/2) + var/cabin_pressure = cabin_air.return_pressure() + var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2) var/transfer_moles = 0 if(pressure_delta > 0) //cabin pressure lower than release pressure - if(tank_air.temperature > 0) - transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.temperature * R_IDEAL_GAS_EQUATION) + if(tank_air.return_temperature() > 0) + transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) 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 = spacepod.get_turf_air() pressure_delta = cabin_pressure - release_pressure if(t_air) - pressure_delta = min(cabin_pressure - t_air.pressure, pressure_delta) + pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta) if(pressure_delta > 0) //if location pressure is lower than cabin pressure - transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.temperature * R_IDEAL_GAS_EQUATION) + transfer_moles = pressure_delta * cabin_air.return_volume() / (cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles) if(t_air) t_air.merge(removed) diff --git a/code/modules/trader/trade_window.dm b/code/modules/trader/trade_window.dm index f04a8f26720..f61a28f7b7d 100644 --- a/code/modules/trader/trade_window.dm +++ b/code/modules/trader/trade_window.dm @@ -48,8 +48,8 @@ /obj/structure/trade_window/process() var/turf/T = get_turf(src) if(T && !T.c_airblock(T)) //we are on an airflowing tile with pressure between 80 and 180 - var/datum/gas_mixture/current_air = T.return_readonly_air() - var/pressure = current_air.pressure + var/datum/gas_mixture/current_air = T.return_air() + var/pressure = current_air.return_pressure() if(pressure <= 180 && pressure >= 80) if(closed) say("That's more like it. Opening shop back up.") diff --git a/code/modules/virus2/effect/stage_4.dm b/code/modules/virus2/effect/stage_4.dm index e9aa774fbd1..65f7188ef8c 100644 --- a/code/modules/virus2/effect/stage_4.dm +++ b/code/modules/virus2/effect/stage_4.dm @@ -7,8 +7,8 @@ max_chance = 25 /datum/disease2/effect/spaceadapt/activate(var/mob/living/mob) - var/datum/gas_mixture/environment = mob.loc.return_readonly_air() - var/pressure = environment.pressure + var/datum/gas_mixture/environment = mob.loc.return_air() + var/pressure = environment.return_pressure() var/adjusted_pressure = mob.calculate_affecting_pressure(pressure) if (istype(mob.loc, /turf/space) || adjusted_pressure < HAZARD_LOW_PRESSURE) if (mob.reagents.get_reagent_amount(DEXALINP) < 10) diff --git a/maps/randomvaults/mining/mining_surprise_items.dm b/maps/randomvaults/mining/mining_surprise_items.dm index c727d64c610..74e68ab98a2 100644 --- a/maps/randomvaults/mining/mining_surprise_items.dm +++ b/maps/randomvaults/mining/mining_surprise_items.dm @@ -239,7 +239,7 @@ "That ain't the kind of way I like to be offered plasma, so don't you even think about openin' that in here or there'll be trouble.", "Plasma ain't a very stable or safe substance as a gas and definitely not if it were let outta that tank, so I ain't touchin that.")) return - var/datum/gas_mixture/current_air = checkloc.return_readonly_air() + var/datum/gas_mixture/current_air = checkloc.return_air() if(current_air[GAS_PLASMA]) M.say(pick("Dangit when I said get some plasma, I meant in solid form! Now how's this place gonna get customers that ain't purple boney men!", "Did you let GASEOUS plasma get all over my bar? I asked ya for solid plasma and you let it get dispersin' everywhere like this!",