diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm
index fa8b485ed8c..4460d6a1a20 100644
--- a/code/ATMOSPHERICS/atmospherics.dm
+++ b/code/ATMOSPHERICS/atmospherics.dm
@@ -155,7 +155,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.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
+ if ((int_air.pressure-env_air.pressure) > 2*ONE_ATMOSPHERE)
if(istype(W, /obj/item/weapon/wrench/socket) && istype(src, /obj/machinery/atmospherics/pipe))
user << "You begin to open the pressure release valve on the pipe..."
if(do_after(user, 50))
diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
index c3e27234cbc..3852918de5b 100644
--- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
@@ -25,8 +25,8 @@
/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
var/datum/gas_mixture/removed
if(anchored && !(stat&BROKEN) )
- var/input_starting_pressure = air1.return_pressure()
- var/output_starting_pressure = air2.return_pressure()
+ var/input_starting_pressure = air1.pressure
+ var/output_starting_pressure = air2.pressure
last_pressure_delta = max(input_starting_pressure - output_starting_pressure + 10, 0)
//only circulate air if there is a pressure difference (plus 10 kPa to represent friction in the machine)
@@ -38,7 +38,7 @@
//Actually transfer the gas
removed = air1.remove(recent_moles_transferred)
if(removed)
- last_heat_capacity = removed.heat_capacity()
+ last_heat_capacity = removed.heat_capacity
last_temperature = removed.temperature
//Update the gas networks.
diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
index 4dc3f31a817..6493435f05b 100644
--- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
@@ -73,7 +73,7 @@
return
var/datum/gas_mixture/environment = loc.return_air()
- var/environment_pressure = environment.return_pressure()
+ var/environment_pressure = environment.pressure
if(pump_direction) //input -> external
var/pressure_delta = 10000
@@ -81,7 +81,7 @@
if(pressure_checks&1)
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
if(pressure_checks&2)
- pressure_delta = min(pressure_delta, (air1.return_pressure() - input_pressure_min))
+ pressure_delta = min(pressure_delta, (air1.pressure - input_pressure_min))
if(pressure_delta > 0)
if(air1.temperature > 0)
@@ -100,7 +100,7 @@
if(pressure_checks&1)
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
if(pressure_checks&4)
- pressure_delta = min(pressure_delta, (output_pressure_max - air2.return_pressure()))
+ pressure_delta = min(pressure_delta, (output_pressure_max - air2.pressure))
if(pressure_delta > 0)
if(environment.temperature > 0)
diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
index c8827405ef3..9c6839ad1a2 100644
--- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
@@ -33,8 +33,8 @@
if(!on)
return
- var/output_starting_pressure = air2.return_pressure()
- var/input_starting_pressure = air1.return_pressure()
+ var/output_starting_pressure = air2.pressure
+ var/input_starting_pressure = air1.pressure
if(output_starting_pressure >= min(target_pressure,input_starting_pressure-10))
//No need to pump gas if target is already reached or input pressure is too low
@@ -42,7 +42,7 @@
return
//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 = min(target_pressure - output_starting_pressure, (input_starting_pressure - output_starting_pressure)/2)
//Can not have a pressure delta that would cause output_pressure > input_pressure
diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm
index 23c25451c1d..1830c294fed 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm
@@ -55,14 +55,14 @@ Thus, the two variables affect pump operation are set in New():
if((stat & (NOPOWER|BROKEN)) || !on)
return
- var/output_starting_pressure = air2.return_pressure()
+ var/output_starting_pressure = air2.pressure
if( (target_pressure - output_starting_pressure) < 0.01)
//No need to pump gas if target is already reached!
return
//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 = target_pressure - output_starting_pressure
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
index 84c7236ee04..5fe5a558583 100644
--- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
@@ -51,8 +51,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.return_pressure()
- var/output_starting_pressure = air2.return_pressure()
+ var/input_starting_pressure = air1.pressure
+ var/output_starting_pressure = air2.pressure
if((input_starting_pressure < 0.01) || (output_starting_pressure > 9000))
return
diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
index a6128d42f09..145d94f6913 100755
--- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
@@ -58,9 +58,9 @@ obj/machinery/atmospherics/trinary/filter/process()
if(!on)
return
- var/output_starting_pressure = air3.return_pressure()
+ var/output_starting_pressure = air3.pressure
- if(output_starting_pressure >= target_pressure || air2.return_pressure() >= target_pressure )
+ if(output_starting_pressure >= target_pressure || air2.pressure >= target_pressure )
//No need to mix if target is already full!
return
@@ -104,7 +104,7 @@ obj/machinery/atmospherics/trinary/filter/process()
filtered_out = null
for(var/gasid in gases_to_remove)
- filtered_out.adjust_gas(gasid, removed.get_moles_by_id(gasid), 0)
+ filtered_out.adjust_gas(gasid, removed.gases[gasid], 0)
removed.set_gas(gasid, 0, 0)
air2.merge(filtered_out)
diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
index a1975011d7c..a11ad653e51 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
@@ -40,7 +40,7 @@ obj/machinery/atmospherics/trinary/mixer/process()
if(!on)
return
- var/output_starting_pressure = air3.return_pressure()
+ var/output_starting_pressure = air3.pressure
if(output_starting_pressure >= target_pressure)
//No need to mix if target is already full!
@@ -58,8 +58,8 @@ obj/machinery/atmospherics/trinary/mixer/process()
if(air2.temperature > 0)
transfer_moles2 = (node2_concentration*pressure_delta)*air3.volume/(air2.temperature * R_IDEAL_GAS_EQUATION)
- 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/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm
index ebe794ba8b2..0ee7244eb49 100644
--- a/code/ATMOSPHERICS/components/unary/cold_sink.dm
+++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm
@@ -26,7 +26,7 @@
. = ..()
if(!on || !network)
return
- var/air_heat_capacity = air_contents.heat_capacity()
+ var/air_heat_capacity = air_contents.heat_capacity
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
var/old_temperature = air_contents.temperature
diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
index 82ddb66a70e..7065fd91824 100644
--- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
+++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
@@ -38,8 +38,8 @@
update_cycle = air_master.current_cycle
partner.update_cycle = air_master.current_cycle
- var/air_heat_capacity = air_contents.heat_capacity()
- var/other_air_heat_capacity = partner.air_contents.heat_capacity()
+ var/air_heat_capacity = air_contents.heat_capacity
+ var/other_air_heat_capacity = partner.air_contents.heat_capacity
var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity
var/old_temperature = air_contents.temperature
diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm
index f95e457cda9..97b117a58f0 100644
--- a/code/ATMOSPHERICS/components/unary/heat_source.dm
+++ b/code/ATMOSPHERICS/components/unary/heat_source.dm
@@ -28,7 +28,7 @@
. = ..()
if(!on)
return
- var/air_heat_capacity = air_contents.heat_capacity()
+ var/air_heat_capacity = air_contents.heat_capacity
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
var/old_temperature = air_contents.temperature
diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm
index 16a4c47626f..7fe3833eb52 100644
--- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm
+++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm
@@ -45,7 +45,7 @@
return
if(air_contents.temperature > 0)
- var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
+ var/transfer_moles = (air_contents.pressure)*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
@@ -63,7 +63,7 @@
injecting = 1
if(air_contents.temperature > 0)
- var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
+ var/transfer_moles = (air_contents.pressure)*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
diff --git a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm
index 0380ed72228..c3d82f10c07 100644
--- a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm
+++ b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm
@@ -33,10 +33,10 @@ obj/machinery/atmospherics/unary/oxygen_generator/process()
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()
+ var/current_heat_capacity = air_contents.heat_capacity
var/added_oxygen = oxygen_content - total_moles
diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm
index 8b066480bf8..15855d3ccdd 100644
--- a/code/ATMOSPHERICS/components/unary/thermal_plate.dm
+++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm
@@ -26,26 +26,26 @@
//Get processable air sample and thermal info from environment
- var/transfer_moles = 0.25 * environment.total_moles()
+ var/transfer_moles = 0.25 * environment.total_moles
var/datum/gas_mixture/external_removed = environment.remove(transfer_moles)
if (!external_removed)
return radiate()
- if (external_removed.total_moles() < 10)
+ if (external_removed.total_moles < 10)
return radiate()
//Get same info from connected gas
- var/internal_transfer_moles = 0.25 * air_contents.total_moles()
+ var/internal_transfer_moles = 0.25 * air_contents.total_moles
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
if (!internal_removed)
environment.merge(external_removed)
return
- var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity()
- var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature
+ var/combined_heat_capacity = internal_removed.heat_capacity + external_removed.heat_capacity
+ var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity + external_removed.heat_capacity * external_removed.temperature
if(!combined_heat_capacity) combined_heat_capacity = 1
var/final_temperature = combined_energy / combined_heat_capacity
@@ -73,14 +73,14 @@
air_contents.copy_from(network.radiate) //We can cut down on processing time by only calculating radiate() once and then applying the result
return
- var/internal_transfer_moles = 0.25 * air_contents.total_moles()
+ var/internal_transfer_moles = 0.25 * air_contents.total_moles
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
if (!internal_removed)
return
- var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY
- var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + (RADIATION_CAPACITY * 6.4)
+ var/combined_heat_capacity = internal_removed.heat_capacity + RADIATION_CAPACITY
+ var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity + (RADIATION_CAPACITY * 6.4)
var/final_temperature = combined_energy / combined_heat_capacity
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index b7b0270686d..e7ce13a3b0c 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -93,7 +93,7 @@
if(!loc) return
var/datum/gas_mixture/environment = loc.return_air()
- var/environment_pressure = environment.return_pressure()
+ var/environment_pressure = environment.pressure
if(pump_direction) //internal -> external
var/pressure_delta = 10000
@@ -101,7 +101,7 @@
if(pressure_checks&1)
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
if(pressure_checks&2)
- pressure_delta = min(pressure_delta, (air_contents.return_pressure() - internal_pressure_bound))
+ pressure_delta = min(pressure_delta, (air_contents.pressure - internal_pressure_bound))
if(pressure_delta > 0.1)
if(air_contents.temperature > 0)
@@ -119,7 +119,7 @@
if(pressure_checks&1)
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
if(pressure_checks&2)
- pressure_delta = min(pressure_delta, (internal_pressure_bound - air_contents.return_pressure()))
+ pressure_delta = min(pressure_delta, (internal_pressure_bound - air_contents.pressure))
if(pressure_delta > 0.1)
if(environment.temperature > 0)
diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
index 26c841d53ec..4f1a9fd8e7c 100644
--- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
@@ -124,7 +124,7 @@
if(scrubbing)
if(scrubbing_gases.len)
- var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
+ var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles
//Take a gas sample
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
@@ -137,15 +137,13 @@
if(!(gasid in scrubbing_gases))
continue
- filtered_out.adjust_gas(gasid, removed.get_moles_by_id(gasid), 0) //move to filtered
- removed.set_gas(gasid, 0, 0) //set to 0
+ filtered_out.adjust_gas(gasid, removed.gases[gasid]) //move to filtered
+ removed.set_gas(gasid, 0) //set to 0
//Filter it
- filtered_out.temperature = removed.temperature
+ filtered_out.set_temperature(removed.temperature)
- filtered_out.update_values()
- removed.update_values()
//Remix the resulting gases
air_contents.merge(filtered_out)
@@ -156,10 +154,10 @@
network.update = 1
else //Just siphoning all air
- if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
+ if (air_contents.pressure>=50*ONE_ATMOSPHERE)
return
- var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
+ var/transfer_moles = environment.total_moles*(volume_rate/environment.volume)
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
diff --git a/code/ATMOSPHERICS/datum_pipe_network.dm b/code/ATMOSPHERICS/datum_pipe_network.dm
index c4684db917f..10f6ffdfb25 100644
--- a/code/ATMOSPHERICS/datum_pipe_network.dm
+++ b/code/ATMOSPHERICS/datum_pipe_network.dm
@@ -107,13 +107,13 @@
for(var/datum/gas_mixture/gas in gases)
air_transient_volume += gas.volume
- var/temp_heatcap = gas.heat_capacity()
+ var/temp_heatcap = gas.heat_capacity
total_thermal_energy += gas.temperature*temp_heatcap
total_heat_capacity += temp_heatcap
air_transient.add(gas)
- air_transient.volume = air_transient_volume
+ air_transient.set_volume(air_transient_volume)
if(air_transient_volume > 0)
@@ -134,9 +134,6 @@
gas.copy_from(air_transient)
gas.multiply(volume_ratio)
- gas.update_values()
-
- air_transient.update_values()
return 1
proc/equalize_gases(list/datum/gas_mixture/gases)
@@ -148,7 +145,7 @@ proc/equalize_gases(list/datum/gas_mixture/gases)
for(var/datum/gas_mixture/gas in gases)
total_volume += gas.volume
- total_thermal_energy += gas.temperature*gas.heat_capacity()
+ total_thermal_energy += gas.temperature*gas.heat_capacity
total.add(gas)
@@ -158,17 +155,16 @@ proc/equalize_gases(list/datum/gas_mixture/gases)
//Calculate temperature
var/temperature = 0
- if(total.heat_capacity() > 0)
- temperature = total_thermal_energy/total.heat_capacity()
+ if(total.heat_capacity > 0)
+ temperature = total_thermal_energy/total.heat_capacity
//Update individual gas_mixtures by volume ratio
for(var/gasid in total.gases) //for each gas in the gas mix in our list of gas mixes
- var/total_gas = total.get_moles_by_id(gasid)
+ var/total_gas = total.gases[gasid]
for(var/datum/gas_mixture/gas_mix in gases)
- gas_mix.set_gas(gasid, total_gas * gas_mix.volume / total_volume, 0)
+ gas_mix.set_gas(gasid, total_gas * gas_mix.volume / total_volume)
for(var/datum/gas_mixture/gas_mix in gases) //cheaper to set here
- gas_mix.temperature = temperature
- gas_mix.update_values()
+ gas_mix.set_temperature(temperature)
return 1
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm
index d5e1cf1843b..4f0453a65eb 100644
--- a/code/ATMOSPHERICS/datum_pipeline.dm
+++ b/code/ATMOSPHERICS/datum_pipeline.dm
@@ -29,7 +29,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.return_pressure()
+ var/pressure = air.pressure
if(pressure > alert_pressure)
for(var/obj/machinery/atmospherics/pipe/member in members)
if(!member.check_pressure(pressure))
@@ -46,13 +46,11 @@
for(var/obj/machinery/atmospherics/pipe/member in members)
member.air_temporary = new
- member.air_temporary.volume = member.volume
+ member.air_temporary.set_volume(member.volume)
member.air_temporary.copy_from(air)
member.air_temporary.multiply(member.volume/air.volume)
- member.air_temporary.temperature = air.temperature
- member.air_temporary.update_values()
/datum/pipeline/proc/build_pipeline(obj/machinery/atmospherics/pipe/base)
var/list/possible_expansions = list(base)
@@ -69,6 +67,8 @@
else
air = new
+ air.set_volume(volume)
+
while(possible_expansions.len>0)
for(var/obj/machinery/atmospherics/pipe/borderline in possible_expansions)
@@ -96,9 +96,6 @@
possible_expansions -= borderline
- air.volume = volume
- air.update_values()
-
/datum/pipeline/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
if(new_network.line_members.Find(src))
@@ -160,7 +157,7 @@
network.update = 1
/datum/pipeline/proc/temperature_interact(turf/target, share_volume, thermal_conductivity)
- var/total_heat_capacity = air.heat_capacity()
+ var/total_heat_capacity = air.heat_capacity
var/partial_heat_capacity = total_heat_capacity*(share_volume/air.volume)
if(istype(target, /turf/simulated))
@@ -183,10 +180,10 @@
if(modeled_location.zone)
delta_temperature = (air.temperature - modeled_location.zone.air.temperature)
- sharer_heat_capacity = modeled_location.zone.air.heat_capacity()
+ sharer_heat_capacity = modeled_location.zone.air.heat_capacity
else
delta_temperature = (air.temperature - modeled_location.air.temperature)
- sharer_heat_capacity = modeled_location.air.heat_capacity()
+ sharer_heat_capacity = modeled_location.air.heat_capacity
var/self_temperature_delta = 0
var/sharer_temperature_delta = 0
diff --git a/code/ATMOSPHERICS/he_pipes.dm b/code/ATMOSPHERICS/he_pipes.dm
index 37d44d2c9e9..f3b58357d08 100644
--- a/code/ATMOSPHERICS/he_pipes.dm
+++ b/code/ATMOSPHERICS/he_pipes.dm
@@ -56,12 +56,12 @@
// Get gas from pipenet
var/datum/gas_mixture/internal = return_air()
- var/internal_transfer_moles = 0.25 * internal.total_moles()
+ var/internal_transfer_moles = 0.25 * internal.total_moles
var/datum/gas_mixture/internal_removed = internal.remove(internal_transfer_moles)
//Get processable air sample and thermal info from environment
var/datum/gas_mixture/environment = loc.return_air()
- var/transfer_moles = 0.25 * environment.total_moles()
+ var/transfer_moles = 0.25 * environment.total_moles
var/datum/gas_mixture/external_removed = environment.remove(transfer_moles)
// No environmental gas? We radiate it, then.
@@ -71,7 +71,7 @@
return radiate()
// Not enough gas in the air around us to care about. Radiate.
- if (external_removed.total_moles() < 10)
+ if (external_removed.total_moles < 10)
if(internal_removed)
internal.merge(internal_removed)
environment.merge(external_removed)
@@ -83,8 +83,8 @@
return
//Get same info from connected gas
- var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity()
- var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature
+ var/combined_heat_capacity = internal_removed.heat_capacity + external_removed.heat_capacity
+ var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity + external_removed.heat_capacity * external_removed.temperature
if(!combined_heat_capacity)
combined_heat_capacity = 1
@@ -103,14 +103,14 @@
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/proc/radiate()
var/datum/gas_mixture/internal = return_air()
- var/internal_transfer_moles = 0.25 * internal.total_moles()
+ var/internal_transfer_moles = 0.25 * internal.total_moles
var/datum/gas_mixture/internal_removed = internal.remove(internal_transfer_moles)
if (!internal_removed)
return
- var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY
- var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + (RADIATION_CAPACITY * ENERGY_MULT)
+ var/combined_heat_capacity = internal_removed.heat_capacity + RADIATION_CAPACITY
+ var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity + (RADIATION_CAPACITY * ENERGY_MULT)
var/final_temperature = combined_energy / combined_heat_capacity
diff --git a/code/ATMOSPHERICS/hvac/chiller.dm b/code/ATMOSPHERICS/hvac/chiller.dm
index 0e4af4c1e82..e881af106ba 100644
--- a/code/ATMOSPHERICS/hvac/chiller.dm
+++ b/code/ATMOSPHERICS/hvac/chiller.dm
@@ -93,11 +93,11 @@
var/turf/simulated/L = loc
if(istype(L))
var/datum/gas_mixture/env = L.return_air()
- var/transfer_moles = 0.25 * env.total_moles()
+ var/transfer_moles = 0.25 * env.total_moles
var/datum/gas_mixture/removed = env.remove(transfer_moles)
if(removed)
if(removed.temperature > (set_temperature + T0C))
- var/air_heat_capacity = removed.heat_capacity()
+ var/air_heat_capacity = removed.heat_capacity
var/combined_heat_capacity = cooling_power + air_heat_capacity
//var/old_temperature = removed.temperature
diff --git a/code/ATMOSPHERICS/hvac/spaceheater.dm b/code/ATMOSPHERICS/hvac/spaceheater.dm
index 8934b3f1edb..51e7dff78e1 100644
--- a/code/ATMOSPHERICS/hvac/spaceheater.dm
+++ b/code/ATMOSPHERICS/hvac/spaceheater.dm
@@ -165,7 +165,7 @@
var/datum/gas_mixture/env = L.return_air()
if(env.temperature != set_temperature + T0C)
- var/transfer_moles = 0.25 * env.total_moles()
+ var/transfer_moles = 0.25 * env.total_moles
var/datum/gas_mixture/removed = env.remove(transfer_moles)
@@ -173,7 +173,7 @@
if(removed)
- var/heat_capacity = removed.heat_capacity()
+ var/heat_capacity = removed.heat_capacity
//world << "heating ([heat_capacity])"
if(heat_capacity) // Added check to avoid divide by zero (oshi-) runtime errors -- TLE
if(removed.temperature < set_temperature + T0C)
diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm
index 542b3f3fc44..9009b4b9f38 100644
--- a/code/ATMOSPHERICS/pipes.dm
+++ b/code/ATMOSPHERICS/pipes.dm
@@ -198,7 +198,7 @@
// So, a pipe rated at 8,000 kPa in a 104kPa environment will explode at 8,104kPa.
var/datum/gas_mixture/environment = loc.return_air()
- var/pressure_difference = pressure - environment.return_pressure()
+ var/pressure_difference = pressure - environment.pressure
// Burst check first.
if(pressure_difference > maximum_pressure && prob(1))
diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm b/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm
index 9fbd1f8a5c0..8c16db8d785 100644
--- a/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Rust/core_field.dm
@@ -135,25 +135,24 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
//add plasma from the surrounding environment
var/datum/gas_mixture/environment = loc.return_air()
- var/held_plasma_moles = held_plasma.get_moles_by_id(PLASMA)
+ var/held_plasma_moles = held_plasma.gases[PLASMA]
//hack in some stuff to remove plasma from the air because SCIENCE
//the amount of plasma pulled in each update is relative to the field strength, with 50T (max field strength) = 100% of area covered by the field
//at minimum strength, 0.25% of the field volume is pulled in per update (?)
//have a max of 1000 moles suspended
if(held_plasma_moles < transfer_ratio * 1000)
- var/moles_covered = environment.return_pressure()*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION)
+ var/moles_covered = environment.pressure*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION)
//world << "moles_covered: [moles_covered]"
//
var/datum/gas_mixture/gas_covered = environment.remove(moles_covered)
var/datum/gas_mixture/plasma_captured = new /datum/gas_mixture()
//
- plasma_captured.set_gas(PLASMA, round(gas_covered.get_moles_by_id(PLASMA) * transfer_ratio), 0)
+ plasma_captured.set_gas(PLASMA, round(gas_covered.gases[PLASMA] * transfer_ratio))
//world << "[plasma_captured.toxins] moles of plasma captured"
- plasma_captured.temperature = gas_covered.temperature
- plasma_captured.update_values()
+ plasma_captured.set_temperature(gas_covered.temperature)
//
- gas_covered.adjust_gas(PLASMA, -plasma_captured.get_moles_by_id(PLASMA))
+ gas_covered.adjust_gas(PLASMA, -plasma_captured.gases[PLASMA])
//
held_plasma.merge(plasma_captured)
//
@@ -172,7 +171,7 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
//change held plasma temp according to energy levels
//SPECIFIC_HEAT_TOXIN
if(mega_energy > 0 && held_plasma_moles)
- var/heat_capacity = held_plasma.heat_capacity()//200 * number of plasma moles
+ var/heat_capacity = held_plasma.heat_capacity//200 * number of plasma moles
if(heat_capacity > 0.0003) //formerly MINIMUM_HEAT_CAPACITY
held_plasma.temperature = (heat_capacity + mega_energy * 35000)/heat_capacity
diff --git a/code/WorkInProgress/pomf/spacepods/spacepods.dm b/code/WorkInProgress/pomf/spacepods/spacepods.dm
index d6336f4f354..c167aade0bc 100644
--- a/code/WorkInProgress/pomf/spacepods/spacepods.dm
+++ b/code/WorkInProgress/pomf/spacepods/spacepods.dm
@@ -263,21 +263,21 @@
/obj/spacepod/proc/return_pressure()
. = 0
if(use_internal_tank)
- . = cabin_air.return_pressure()
+ . = cabin_air.pressure
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
- . = t_air.return_pressure()
+ . = t_air.pressure
return
/obj/spacepod/proc/return_temperature()
. = 0
if(use_internal_tank)
- . = cabin_air.return_temperature()
+ . = cabin_air.temperature
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
- . = t_air.return_temperature()
+ . = t_air.temperature
return
/obj/spacepod/proc/moved_inside(var/mob/living/carbon/human/H as mob)
@@ -366,7 +366,7 @@
delay = 20
process(var/obj/spacepod/spacepod)
- if(spacepod.cabin_air && spacepod.cabin_air.return_volume() > 0)
+ if(spacepod.cabin_air && spacepod.cabin_air.volume > 0)
var/delta = spacepod.cabin_air.temperature - T20C
spacepod.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
return
@@ -380,21 +380,21 @@
var/datum/gas_mixture/cabin_air = spacepod.cabin_air
var/release_pressure = ONE_ATMOSPHERE
- var/cabin_pressure = cabin_air.return_pressure()
- var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
+ var/cabin_pressure = cabin_air.pressure
+ var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.pressure - cabin_pressure)/2)
var/transfer_moles = 0
if(pressure_delta > 0) //cabin pressure lower than release pressure
- if(tank_air.return_temperature() > 0)
- transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
+ if(tank_air.temperature > 0)
+ transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.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.return_pressure(), pressure_delta)
+ pressure_delta = min(cabin_pressure - t_air.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.return_temperature() * R_IDEAL_GAS_EQUATION)
+ transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.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/ZAS/Airflow.dm b/code/ZAS/Airflow.dm
index 66497632826..85a5e941b85 100644
--- a/code/ZAS/Airflow.dm
+++ b/code/ZAS/Airflow.dm
@@ -118,7 +118,7 @@ obj/item/check_airflow_movable(n)
proc/Airflow(zone/A, zone/B)
set background = 1
- var/n = B.air.return_pressure() - A.air.return_pressure()
+ var/n = B.air.pressure - A.air.pressure
//Don't go any further if n is lower than the lowest value needed for airflow.
if(abs(n) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
@@ -199,7 +199,7 @@ proc/AirflowSpace(zone/A)
spawn()
//The space version of the Airflow(A,B,n) proc.
- var/n = A.air.return_pressure()
+ var/n = A.air.pressure
//Here, n is determined by only the pressure in the room.
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
diff --git a/code/ZAS/ConnectionGroup.dm b/code/ZAS/ConnectionGroup.dm
index 692c29daa02..71f751b22b8 100644
--- a/code/ZAS/ConnectionGroup.dm
+++ b/code/ZAS/ConnectionGroup.dm
@@ -182,7 +182,7 @@ Class Procs:
air_master.mark_zone_update(B)
//world << "equalized."
- var/differential = A.air.return_pressure() - B.air.return_pressure()
+ var/differential = A.air.pressure - B.air.pressure
if(abs(differential) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
var/list/attracted
@@ -241,7 +241,7 @@ Class Procs:
ShareSpace(A.air,air,dbg_out)
air_master.mark_zone_update(A)
- var/differential = A.air.return_pressure() - air.return_pressure()
+ var/differential = A.air.pressure - air.pressure
if(abs(differential) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
var/list/attracted = A.movables()
@@ -256,9 +256,9 @@ proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
var/ratio = sharing_lookup_table[6]
//WOOT WOOT TOUCH THIS AND YOU ARE A RETARD
- var/A_full_heat_capacity = A.heat_capacity() * A.group_multiplier
+ var/A_full_heat_capacity = A.heat_capacity * A.group_multiplier
- var/B_full_heat_capacity = B.heat_capacity() * B.group_multiplier
+ var/B_full_heat_capacity = B.heat_capacity * B.group_multiplier
var/temp_avg = (A.temperature * A_full_heat_capacity + B.temperature * B_full_heat_capacity) / (A_full_heat_capacity + B_full_heat_capacity)
@@ -267,21 +267,17 @@ proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
ratio = sharing_lookup_table[connecting_tiles]
//WOOT WOOT TOUCH THIS AND YOU ARE A RETARD
+ A.set_temperature((A.temperature - temp_avg) * (1-ratio) + temp_avg)
+
+ B.set_temperature((B.temperature - temp_avg) * (1-ratio) + temp_avg)
+
for(var/gasid in A.gases)
- var/A_moles = A.get_moles_by_id(gasid)
- var/B_moles = B.get_moles_by_id(gasid)
+ var/A_moles = A.gases[gasid]
+ var/B_moles = B.gases[gasid]
var/avg_gas = (A_moles * A.group_multiplier + B_moles * B.group_multiplier) / (A.group_multiplier + B.group_multiplier)
- A.set_gas(gasid, avg_gas + ((A_moles - avg_gas) * (1 - ratio)), 0) //we don't use adjust_gas because it interferes with the group multiplier
- B.set_gas(gasid, avg_gas + ((B_moles - avg_gas) * (1 - ratio)), 0)
-
-
- A.temperature = max(0, (A.temperature - temp_avg) * (1-ratio) + temp_avg )
-
- B.temperature = max(0, (B.temperature - temp_avg) * (1-ratio) + temp_avg )
-
- A.update_values()
- B.update_values()
+ A.set_gas(gasid, avg_gas + ((A_moles - avg_gas) * (1 - ratio))) //we don't use adjust_gas because it interferes with the group multiplier
+ B.set_gas(gasid, avg_gas + ((B_moles - avg_gas) * (1 - ratio)))
return A.compare(B)
@@ -303,7 +299,7 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles, dbg_output)
tileslen = avg_unsim.group_multiplier
if(dbg_output)
- world << "O2: [unsim_mix.get_moles_by_id(OXYGEN)] N2: [unsim_mix.get_moles_by_id(NITROGEN)] Size: [share_size] Tiles: [tileslen]"
+ world << "O2: [unsim_mix.gases[OXYGEN]] N2: [unsim_mix.gases[NITROGEN]] Size: [share_size] Tiles: [tileslen]"
else if(istype(unsimulated_tiles, /list))
if(!unsimulated_tiles.len)
@@ -329,14 +325,14 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles, dbg_output)
var/ratio = sharing_lookup_table[6]
- var/old_pressure = A.return_pressure()
+ var/old_pressure = A.pressure
- var/full_heat_capacity = A.heat_capacity() * A.group_multiplier
+ var/full_heat_capacity = A.heat_capacity * A.group_multiplier
var/temp_avg = 0
- if((full_heat_capacity + unsim_mix.heat_capacity()) > 0)
- temp_avg = (A.temperature * full_heat_capacity + unsim_mix.temperature * unsim_mix.heat_capacity()) / (full_heat_capacity + unsim_mix.heat_capacity())
+ if((full_heat_capacity + unsim_mix.heat_capacity) > 0)
+ temp_avg = (A.temperature * full_heat_capacity + unsim_mix.temperature * unsim_mix.heat_capacity) / (full_heat_capacity + unsim_mix.heat_capacity)
if(sharing_lookup_table.len >= tileslen) //6 or more interconnecting tiles will max at 42% of air moved per tick.
ratio = sharing_lookup_table[tileslen]
@@ -345,28 +341,26 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles, dbg_output)
world << "Ratio: [ratio]"
//world << "Avg O2: [oxy_avg] N2: [nit_avg]"
+ A.set_temperature(max(TCMB, (A.temperature - temp_avg) * (1 - ratio) + temp_avg ))
+
for(var/gasid in A.gases)
- var/gas_moles = A.get_moles_by_id(gasid)
- var/avg_gas = (gas_moles + unsim_mix.get_moles_by_id(gasid)*share_size) / (size + share_size)
+ var/gas_moles = A.gases[gasid]
+ var/avg_gas = (gas_moles + unsim_mix.gases[gasid]*share_size) / (size + share_size)
A.set_gas(gasid, (gas_moles - avg_gas) * (1 - ratio) + avg_gas, 0 )
- A.temperature = max(TCMB, (A.temperature - temp_avg) * (1 - ratio) + temp_avg )
+ if(dbg_output) world << "Result: [abs(old_pressure - A.pressure)] kPa"
- A.update_values()
-
- if(dbg_output) world << "Result: [abs(old_pressure - A.return_pressure())] kPa"
-
- return abs(old_pressure - A.return_pressure())
+ return abs(old_pressure - A.pressure)
proc/ShareHeat(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
//This implements a simplistic version of the Stefan-Boltzmann law.
var/energy_delta = ((A.temperature - B.temperature) ** 4) * 5.6704e-8 * connecting_tiles * 2.5
- var/maximum_energy_delta = max(0, min(A.temperature * A.heat_capacity() * A.group_multiplier, B.temperature * B.heat_capacity() * B.group_multiplier))
+ var/maximum_energy_delta = max(0, min(A.temperature * A.heat_capacity * A.group_multiplier, B.temperature * B.heat_capacity * B.group_multiplier))
if(maximum_energy_delta > abs(energy_delta))
if(energy_delta < 0)
maximum_energy_delta *= -1
energy_delta = maximum_energy_delta
- A.temperature -= energy_delta / (A.heat_capacity() * A.group_multiplier)
- B.temperature += energy_delta / (B.heat_capacity() * B.group_multiplier)
\ No newline at end of file
+ A.temperature -= energy_delta / (A.heat_capacity * A.group_multiplier)
+ B.temperature += energy_delta / (B.heat_capacity * B.group_multiplier)
\ No newline at end of file
diff --git a/code/ZAS/Controller.dm b/code/ZAS/Controller.dm
index ed53ed802cd..e85a00773c8 100644
--- a/code/ZAS/Controller.dm
+++ b/code/ZAS/Controller.dm
@@ -316,7 +316,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
var/datum/gas_mixture/B_mix = B.return_air()
for(var/gasid in A_mix.gases)
- if(A_mix.get_moles_by_id(gasid) != B_mix.get_moles_by_id(gasid))
+ if(A_mix.gases[gasid] != B_mix.gases[gasid])
return 0
return 1
diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm
index 863e5023842..09443f7c4ae 100644
--- a/code/ZAS/Diagnostic.dm
+++ b/code/ZAS/Diagnostic.dm
@@ -18,11 +18,11 @@ client/proc/Zone_Info(turf/T as null|turf)
else
mob << "No zone here."
var/datum/gas_mixture/mix = T.return_air()
- mob << "[mix.return_pressure()] kPa [mix.temperature]C"
+ mob << "[mix.pressure] kPa [mix.temperature]C"
var/message = ""
for(var/gasid in mix.gases)
var/datum/gas/gas = mix.get_gas_by_id(gasid)
- message += "[gas.display_short]: [mix.get_moles_by_id(gasid)]"
+ message += "[gas.display_short]: [mix.gases[gasid]]"
mob << message
else
if(zone_debug_images)
@@ -112,8 +112,8 @@ client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf)
client << "Plasma: [air.toxins]"
client << "Carbon Dioxide: [air.carbon_dioxide]"
client << "Temperature: [air.temperature] K"
- client << "Heat Energy: [air.temperature * air.heat_capacity()] J"
- client << "Pressure: [air.return_pressure()] KPa"
+ client << "Heat Energy: [air.temperature * air.heat_capacity] J"
+ client << "Pressure: [air.pressure] KPa"
client << ""
client << "Unsimulated Zone(space/catwalk) Tiles: [length(unsimulated_tiles)]"
client << "Movable Objects: [length(movables())]"
diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm
index ec56e7af9c7..096a8ecd4ab 100644
--- a/code/ZAS/Fire.dm
+++ b/code/ZAS/Fire.dm
@@ -160,7 +160,7 @@ Attach to transfer valve and open. BOOM.
//since the air is processed in fractions, we need to make sure not to have any minuscle residue or
//the amount of moles might get to low for some functions to catch them and thus result in wonky behaviour
- air_contents.update_values(FIRE_GAS_ROUNDING) //the define is the level we clean to
+ air_contents.round_values(FIRE_GAS_ROUNDING) //the define is the level we clean to
// Check if there is something to combust.
if (!air_contents.check_recombustability(S))
@@ -183,14 +183,14 @@ Attach to transfer valve and open. BOOM.
//im not sure how to implement a version that works for every creature so for now monkeys are firesafe
for(var/mob/living/carbon/human/M in loc)
- M.FireBurn(firelevel, air_contents.temperature, air_contents.return_pressure() ) //Burn the humans!
+ M.FireBurn(firelevel, air_contents.temperature, air_contents.pressure ) //Burn the humans!
/*for(var/atom/A in loc)
- A.fire_act(air_contents, air_contents.temperature, air_contents.return_volume())
+ A.fire_act(air_contents, air_contents.temperature, air_contents.volume)
*/
// Burn the turf, too.
- S.fire_act(air_contents, air_contents.temperature, air_contents.return_volume())
+ S.fire_act(air_contents, air_contents.temperature, air_contents.volume)
//spread
for(var/direction in cardinal)
@@ -254,7 +254,7 @@ turf/simulated/apply_fire_protection()
for(var/gasid in gases)
var/datum/gas/gas = get_gas_by_id(gasid)
if(gas.isFuel())
- total_fuel += get_moles_by_id(gasid)
+ total_fuel += gases[gasid]
return total_fuel
/datum/gas_mixture/proc/get_gas_oxidiser()
@@ -262,7 +262,7 @@ turf/simulated/apply_fire_protection()
for(var/gasid in gases)
var/datum/gas/gas = get_gas_by_id(gasid)
if(gas.isOxidiser())
- total_oxidiser += get_moles_by_id(gasid)
+ total_oxidiser += gases[gasid]
return total_oxidiser
datum/gas_mixture/proc/zburn(var/turf/T, force_burn)
@@ -289,7 +289,7 @@ datum/gas_mixture/proc/zburn(var/turf/T, force_burn)
//get the current inner energy of the gas mix
//this must be taken here to prevent the addition or deletion of energy by a changing heat capacity
- var/starting_energy = temperature * heat_capacity()
+ var/starting_energy = temperature * heat_capacity
//determine the amount of oxygen used
total_oxidiser = min(total_oxidiser, 2 * total_fuel)
@@ -307,15 +307,15 @@ datum/gas_mixture/proc/zburn(var/turf/T, force_burn)
for(var/gasid in gases)
var/datum/gas/current_gas = get_gas_by_id(gasid)
if(current_gas.isOxidiser())
- adjust_gas(current_gas.gas_id, -get_moles_by_id(gasid) * used_reactants_ratio * current_gas.fuel_multiplier, 0, 0) //take the cost of oxidiser
+ adjust_gas(current_gas.gas_id, -gases[gasid] * used_reactants_ratio * current_gas.fuel_multiplier, 0, 0) //take the cost of oxidiser
//fuels
for(var/gasid in gases)
var/datum/gas/current_gas = get_gas_by_id(gasid)
if(current_gas.isFuel())
- adjust_gas(current_gas.gas_id, -get_moles_by_id(gasid) * used_fuel_ratio * used_reactants_ratio * current_gas.fuel_multiplier, 0, 0) //take the cost of fuel
+ adjust_gas(current_gas.gas_id, -gases[gasid] * used_fuel_ratio * used_reactants_ratio * current_gas.fuel_multiplier, 0, 0) //take the cost of fuel
- adjust_gas(CARBON_DIOXIDE, max(2 * total_fuel, 0), 0, 0)
+ adjust_gas(CARBON_DIOXIDE, max(2 * total_fuel, 0), 0)
if(can_use_turf)
if(T.getFireFuel()>0)
@@ -325,9 +325,8 @@ datum/gas_mixture/proc/zburn(var/turf/T, force_burn)
A.burnFireFuel(used_fuel_ratio, used_reactants_ratio)
//calculate the energy produced by the reaction and then set the new temperature of the mix
- temperature = (starting_energy + zas_settings.Get(/datum/ZAS_Setting/fire_fuel_energy_release) * total_fuel) / heat_capacity()
+ temperature = (starting_energy + zas_settings.Get(/datum/ZAS_Setting/fire_fuel_energy_release) * total_fuel) / heat_capacity
- update_values()
value = total_reactants * used_reactants_ratio
return value
@@ -406,7 +405,7 @@ datum/gas_mixture/proc/calculate_firelevel(var/turf/T)
if(total_fuel > 0 && total_oxidiser > 0)
//slows down the burning when the concentration of the reactants is low
- var/dampening_multiplier = total_combustables / (total_moles())
+ var/dampening_multiplier = total_combustables / (total_moles)
//calculates how close the mixture of the reactants is to the optimum
var/mix_multiplier = 1 / (1 + (5 * ((total_oxidiser / total_combustables) ** 2))) // Thanks, Mloc
//toss everything together
diff --git a/code/ZAS/Plasma.dm b/code/ZAS/Plasma.dm
index 37c6d77cd85..c6d5967bef4 100644
--- a/code/ZAS/Plasma.dm
+++ b/code/ZAS/Plasma.dm
@@ -124,6 +124,6 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
if(istype(I) && zas_settings.Get(/datum/ZAS_Setting/CLOTH_CONTAMINATION))
var/datum/gas_mixture/environment = return_air()
- if(environment.get_moles_by_id(PLASMA) > MOLES_PLASMA_VISIBLE + 1)
+ if(environment.gases[PLASMA] > MOLES_PLASMA_VISIBLE + 1)
if(I.can_contaminate())
I.contaminate()
diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm
index 5878493c711..a2586539d08 100644
--- a/code/ZAS/Turf.dm
+++ b/code/ZAS/Turf.dm
@@ -207,8 +207,7 @@
if(!air)
make_air()
- air.temperature = temperature
- air.update_values()
+ air.set_temperature(temperature)
return air
diff --git a/code/ZAS/Zone.dm b/code/ZAS/Zone.dm
index cf5167a15fd..6d63f4644cd 100644
--- a/code/ZAS/Zone.dm
+++ b/code/ZAS/Zone.dm
@@ -131,10 +131,10 @@ Class Procs:
var/gas_message = ""
for(var/gasid in air.gases)
var/datum/gas/gas = air.get_gas_by_id(gasid)
- gas_message += "[gas.display_short]: [air.get_moles_by_id(gasid)]"
+ gas_message += "[gas.display_short]: [air.gases[gasid]]"
M << gas_message
- M << "P: [air.return_pressure()] kPa V: [air.volume]L T: [air.temperature]°K ([air.temperature - T0C]°C)"
- M << "O2 per N2: [(air.get_moles_by_id(NITROGEN) ? air.get_moles_by_id(OXYGEN)/air.get_moles_by_id(NITROGEN) : "N/A")] Moles: [air.total_moles]"
+ M << "P: [air.pressure] kPa V: [air.volume]L T: [air.temperature]°K ([air.temperature - T0C]°C)"
+ M << "O2 per N2: [(air.gases[NITROGEN] ? air.gases[OXYGEN]/air.gases[NITROGEN] : "N/A")] Moles: [air.total_moles]"
M << "Simulated: [contents.len] ([air.group_multiplier])"
//M << "Unsimulated: [unsimulated_contents.len]"
//M << "Edges: [edges.len]"
@@ -147,7 +147,7 @@ Class Procs:
else
space_edges++
space_coefficient += E.coefficient
- M << "[E:air:return_pressure()]kPa"
+ M << "[E:air:pressure]kPa"
M << "Zone Edges: [zone_edges]"
M << "Space Edges: [space_edges] ([space_coefficient] connections)"
diff --git a/code/ZAS/_gas_datum.dm b/code/ZAS/_gas_datum.dm
index 8d0f0e388bc..0bef446f2db 100644
--- a/code/ZAS/_gas_datum.dm
+++ b/code/ZAS/_gas_datum.dm
@@ -1,4 +1,5 @@
var/global/list/gas_datum_list
+var/global/list/gas_specific_heat
/datum/gas
var/display_name = ""
diff --git a/code/ZAS/_gas_mixture.dm b/code/ZAS/_gas_mixture.dm
index 574129a22de..6af6608cedc 100644
--- a/code/ZAS/_gas_mixture.dm
+++ b/code/ZAS/_gas_mixture.dm
@@ -49,6 +49,8 @@ What are the archived variables for?
var/pressure=0
+ var/heat_capacity = 0
+
var/list/gases //stores all the gas numbers for this mixture
var/list/archived_gases //archiving!
@@ -65,6 +67,7 @@ What are the archived variables for?
for(var/newgas in (typesof(/datum/gas) - /datum/gas))
var/datum/gas/new_datum_gas = new newgas()
gas_datum_list += list(new_datum_gas.gas_id = new_datum_gas) //associates the gas with its id
+ gas_specific_heat = list(new_datum_gas.gas_id = new_datum_gas.specific_heat)
for(var/gasid in gas_datum_list) //initialise the gases themselves
gases += list("[gasid]" = 0)
@@ -78,18 +81,6 @@ What are the archived variables for?
else
return null
-//just a shortcut for fetching moles
-/datum/gas_mixture/proc/get_moles_by_id(gasid)
- if(gasid in gases)
- return gases[gasid]
- else
- return 0
-
-/datum/gas_mixture/proc/get_archived_moles_by_id(gasid)
- if(gasid in archived_gases)
- return archived_gases[gasid]
- else
- return 0
//FOR THE LOVE OF GOD PLEASE USE THIS PROC
//Call it with negative numbers to remove gases.
@@ -101,147 +92,97 @@ What are the archived variables for?
//Outputs: null
for(var/a_gas in adjusts)
- adjust_gas(a_gas, adjusts[a_gas], 0, 0) //we delay updating since we do it at the end
- update_values()
+ adjust_gas(a_gas, adjusts[a_gas], 0)
return
-//Takes a gas string, and the amount of moles to adjust by. Calls update_values() if update isn't 0.
+//Takes a gas string, and the amount of moles to adjust by.
//if use_group is 0, the group_multiplier isn't considered
-/datum/gas_mixture/proc/adjust_gas(gasid, moles, update = 1, use_group = 1)
- if(moles == 0)
- return
-
- if(!(gasid in gases))
+//supports negative values
+/datum/gas_mixture/proc/adjust_gas(gasid, moles, use_group = 1)
+ if(moles == 0 || !(gasid in gases))
return
if(group_multiplier != 1 && use_group)
- gases[gasid] = max(0, gases[gasid] + moles/group_multiplier)
+ set_gas(gasid, gases[gasid] + moles/group_multiplier)
else
- gases[gasid] = max(0, gases[gasid] + moles)
+ set_gas(gasid, gases[gasid] + moles)
-
- if(update)
- update_values()
-
-//Sets the value of a gas
-/datum/gas_mixture/proc/set_gas(gasid, moles, update = 1)
- if(!(gasid in gases))
+//Sets the value of a gas using a gas string and a mole number
+//Note: this should be the only way in which gas numbers should ever be edited
+//The gas system must be airtight - never bypass this
+/datum/gas_mixture/proc/set_gas(gasid, moles)
+ if(!(gasid in gases) || moles < 0)
return
+ var/old_moles = gases[gasid]
+
gases[gasid] = max(0, moles)
- if(update)
- update_values()
-
-/*
-/datum/gas_mixture/proc/create_reagents(var/max_vol)
- aerosols = new /datum/reagents(max_vol)
- aerosols.my_atom = src
-*/
-
-//tg seems to like using these a lot
-/datum/gas_mixture/proc/return_temperature()
- return temperature
-
-
-/datum/gas_mixture/proc/return_volume()
- return max(0, volume)
-
+ pressure += ((moles - old_moles) * R_IDEAL_GAS_EQUATION * temperature) / volume //add the maths of the new gas
+ heat_capacity += (moles - old_moles) * gas_specific_heat[gasid]
+ total_moles += (moles - old_moles)
/datum/gas_mixture/proc/thermal_energy()
- return temperature*heat_capacity()
+ return temperature*heat_capacity
///////////////////////////////
//PV=nRT - related procedures//
///////////////////////////////
-/datum/gas_mixture/proc/heat_capacity()
- //Purpose: Returning the heat capacity of the gas mix
+/datum/gas_mixture/proc/set_temperature(var/new_temperature)
+ //Purpose: Changes the temperature of a gas_mixture
//Called by: UNKNOWN
- //Inputs: None
+ //Inputs: New temperature to set to
+ //Outputs: None
+ new_temperature = max(0, new_temperature)
+
+ var/old_temperature = temperature
+
+ temperature = new_temperature
+
+ if(old_temperature) //can't divide by 0 - and we only have pressure if T > 0
+ pressure *= new_temperature/old_temperature //V is unchanging, T changes by a factor, P must change by the same factor
+ else
+ pressure = (total_moles * R_IDEAL_GAS_EQUATION * temperature) / volume //recalc
+
+/datum/gas_mixture/proc/set_volume(var/new_volume)
+ //Purpose: Changes the volume of a gas_mixture
+ //Called by: UNKNOWN
+ //Inputs: New volume to set to
+ //Outputs: None
+ new_volume = max(0, new_volume)
+
+ var/old_volume = volume
+
+ volume = new_volume
+
+ if(old_volume) //can't divide by 0
+ pressure /= new_volume/old_volume //since PV is a constant, the ratio change in V is inverse for P
+ else
+ pressure = (total_moles * R_IDEAL_GAS_EQUATION * temperature) / volume //recalc
+
+/datum/gas_mixture/proc/heat_capacity_calc(var/list/hc_gases = gases)
+ //Purpose: Returning the heat capacity of a gas mix
+ //Called by: UNKNOWN
+ //Inputs: List of gases (or none, so the gas list itself)
//Outputs: Heat capacity
- var/heat_capacity
+ var/hc_current
- for(var/gasid in gases)
- var/datum/gas/gas = get_gas_by_id(gasid)
- heat_capacity += get_moles_by_id(gasid)*gas.specific_heat
+ for(var/gasid in hc_gases)
+ hc_current += gases[gasid] * gas_specific_heat[gasid]
- return max(MINIMUM_HEAT_CAPACITY,heat_capacity)
+ return max(MINIMUM_HEAT_CAPACITY, hc_current)
-/datum/gas_mixture/proc/heat_capacity_archived()
- //Purpose: Returning the archived heat capacity of the gas mix
- //Called by: UNKNOWN
- //Inputs: None
- //Outputs: Archived heat capacity
-
- var/heat_capacity_archived
-
- for(var/gasid in gases)
- var/datum/gas/gas = get_gas_by_id(gasid)
- heat_capacity_archived += get_archived_moles_by_id(gasid)*gas.specific_heat
-
- return max(MINIMUM_HEAT_CAPACITY,heat_capacity_archived)
-
-/datum/gas_mixture/proc/total_moles()
-// update_values()
- return total_moles
- /*var/moles = oxygen + carbon_dioxide + nitrogen + toxins
-
- if(trace_gases.len)
- for(var/datum/gas/trace_gas in trace_gases)
- moles += trace_gas.moles
- return moles*/
-
-/datum/gas_mixture/proc/return_pressure()
- //Purpose: Calculating Current Pressure
- //Called by:
- //Inputs: None
- //Outputs: Gas pressure.
- return pressure
-
-// proc/return_temperature()
- //Purpose:
- //Inputs:
- //Outputs:
-
-// return temperature
-
-// proc/return_volume()
- //Purpose:
- //Inputs:
- //Outputs:
-
-// return max(0, volume)
-
-// proc/thermal_energy()
- //Purpose:
- //Inputs:
- //Outputs:
-
-// return temperature*heat_capacity()
-
-/datum/gas_mixture/proc/update_values(var/rounding_error = STANDARD_GAS_ROUNDING)
- //Purpose: Calculating and storing values which were normally called CONSTANTLY
- //Called by: Anything that changes values within a gas mix.
- //Inputs: None
+/datum/gas_mixture/proc/round_values(var/rounding_error = STANDARD_GAS_ROUNDING)
+ //Purpose: Trims the fat off values
+ //Called by: Fire code that cleans up values after processing
+ //Inputs: Rounding error
//Outputs: None
- total_moles = 0
-
for(var/gasid in gases)
- var/gas_moles = get_moles_by_id(gasid)
- if(!rounding_error || round(gas_moles, rounding_error) > 0) //the fraction isn't small enough to be discarded
- total_moles += gas_moles
- else
- set_gas(gasid, 0, 0) //get rid of the remainder
+ adjust_gas(gasid, - (gases[gasid] - round(gases[gasid], rounding_error)))
- if(volume>0)
- pressure = total_moles()*R_IDEAL_GAS_EQUATION*temperature/volume
- else
- pressure = 0
-
- return
////////////////////////////////////////////
//Procedures used for very specific events//
@@ -257,16 +198,16 @@ What are the archived variables for?
// If configured and cold, maek ice
if(zas_settings.Get(/datum/ZAS_Setting/ice_formation))
- if(temperature <= TEMPERATURE_ICE_FORMATION && return_pressure()>MIN_PRESSURE_ICE_FORMATION)
+ if(temperature <= TEMPERATURE_ICE_FORMATION && pressure>MIN_PRESSURE_ICE_FORMATION)
// If we're just forming, do a probability check. Otherwise, KEEP IT ON~
// This ordering will hopefully keep it from sampling random noise every damn tick.
//if(was_icy || (!was_icy && prob(25)))
graphics |= GRAPHICS_COLD
- if(get_moles_by_id(PLASMA) > MOLES_PLASMA_VISIBLE)
+ if(gases[PLASMA] > MOLES_PLASMA_VISIBLE)
graphics |= GRAPHICS_PLASMA
- if(get_moles_by_id(NITROUS_OXIDE) > MOLES_N2O_VISIBLE)
+ if(gases[NITROUS_OXIDE] > MOLES_N2O_VISIBLE)
graphics |= GRAPHICS_N2O
/*
if(aerosols && aerosols.total_volume >= 1)
@@ -294,7 +235,7 @@ What are the archived variables for?
return zburn(null)
/*var/energy_released = 0
- var/old_heat_capacity = heat_capacity()
+ var/old_heat_capacity = heat_capacity
var/datum/gas/volatile_fuel/fuel_store = locate(/datum/gas/volatile_fuel) in trace_gases
if(fuel_store) //General volatile gas burn
@@ -339,7 +280,7 @@ What are the archived variables for?
fuel_burnt += (plasma_burn_rate)*(1+oxygen_burn_rate)
if(energy_released > 0)
- var/new_heat_capacity = heat_capacity()
+ var/new_heat_capacity = heat_capacity
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity
update_values()
@@ -379,7 +320,7 @@ What are the archived variables for?
return 0
for(var/gasid in gases)
- if((giver.get_moles_by_id(gasid) > MINIMUM_AIR_TO_SUSPEND) && (giver.get_moles_by_id(gasid) >= get_moles_by_id(gasid)*MINIMUM_AIR_RATIO_TO_SUSPEND))
+ if((giver.gases[gasid] > MINIMUM_AIR_TO_SUSPEND) && (giver.gases[gasid] >= gases[gasid]*MINIMUM_AIR_RATIO_TO_SUSPEND))
return 0
return merge(giver)
@@ -394,24 +335,18 @@ What are the archived variables for?
return 0
if(abs(temperature-giver.temperature)>MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- var/self_heat_capacity = heat_capacity()*group_multiplier
- var/giver_heat_capacity = giver.heat_capacity()*giver.group_multiplier
+ var/self_heat_capacity = heat_capacity*group_multiplier
+ var/giver_heat_capacity = giver.heat_capacity*giver.group_multiplier
var/combined_heat_capacity = giver_heat_capacity + self_heat_capacity
if(combined_heat_capacity != 0)
temperature = (giver.temperature*giver_heat_capacity + temperature*self_heat_capacity)/combined_heat_capacity
if(giver.group_multiplier>1)
for(var/gasid in gases)
- adjust_gas(gasid, giver.get_moles_by_id(gasid) * giver.group_multiplier, 0) //delay updates
+ adjust_gas(gasid, giver.gases[gasid] * giver.group_multiplier)
else
for(var/gasid in gases)
- adjust_gas(gasid, giver.get_moles_by_id(gasid), 0)
-
-/*
- if(giver.aerosols.total_volume > 1)
- giver.aerosols.trans_to_atmos(src,aerosols.total_volume)
-*/
- update_values()
+ adjust_gas(gasid, giver.gases[gasid])
// Let the garbage collector handle it, faster according to /tg/ testers
//del(giver)
@@ -423,28 +358,23 @@ What are the archived variables for?
//Inputs: How many moles to remove.
//Outputs: Removed air.
- update_values()
-
// Fix a singuloth problem
if(group_multiplier==0)
return null
- var/sum = total_moles()
+ var/sum = total_moles
amount = min(amount,sum) //Can not take more air than tile has!
if(amount <= 0)
return new/datum/gas_mixture
var/datum/gas_mixture/removed = new
+ removed.set_temperature(temperature)
for(var/gasid in gases)
- var/taken_gas = QUANTIZE(get_moles_by_id(gasid) / sum) * amount //the gas we lose - not yet subtracted
- adjust_gas(gasid, -taken_gas, 0) //don't update just yet - negative subtracts
- removed.adjust_gas(gasid, taken_gas, 0) //slap the copied gas in
-
- removed.temperature = temperature
- update_values()
- removed.update_values()
+ var/taken_gas = QUANTIZE(gases[gasid] / sum) * amount //the gas we lose - not yet subtracted
+ adjust_gas(gasid, -taken_gas) //don't update just yet - negative subtracts
+ removed.adjust_gas(gasid, taken_gas) //slap the copied gas in
return removed
@@ -459,7 +389,7 @@ What are the archived variables for?
ratio = min(ratio, 1)
- return remove(total_moles() * ratio) //use the sum removal
+ return remove(total_moles * ratio) //use the sum removal
/datum/gas_mixture/proc/check_then_remove(amount)
//Purpose: Similar to remove(...) but first checks to see if the amount of air removed is small enough
@@ -468,9 +398,9 @@ What are the archived variables for?
//Inputs: Number of moles to remove
//Outputs: Removed air or 0 if it can remove air or not.
- amount = Clamp(amount, 0, total_moles()) //Can not take more air than tile has!
+ amount = Clamp(amount, 0, total_moles) //Can not take more air than tile has!
- if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > total_moles()*MINIMUM_AIR_RATIO_TO_SUSPEND))
+ if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > total_moles*MINIMUM_AIR_RATIO_TO_SUSPEND))
return 0
return remove(amount)
@@ -481,12 +411,10 @@ What are the archived variables for?
//Inputs: Gas to copy
//Outputs: 1
+ set_temperature(sample.temperature)
+
for(var/gasid in sample.gases)
- set_gas(gasid, sample.get_moles_by_id(gasid), 0)
-
- temperature = sample.temperature
-
- update_values()
+ set_gas(gasid, sample.gases[gasid], 0)
return 1
@@ -504,8 +432,8 @@ What are the archived variables for?
return 0
for(var/gasid in gases)
- var/archived_own_gas = get_archived_moles_by_id(gasid)
- var/archived_sharer_gas = sharer.get_archived_moles_by_id(gasid)
+ var/archived_own_gas = archived_gases[gasid]
+ var/archived_sharer_gas = sharer.archived_gases[gasid]
var/gas_delta = abs(QUANTIZE(archived_own_gas - archived_sharer_gas)/TRANSFER_FRACTION) //the difference in gas moles
if((gas_delta > MINIMUM_AIR_TO_SUSPEND) && (gas_delta >= archived_own_gas*MINIMUM_AIR_RATIO_TO_SUSPEND))
@@ -528,8 +456,8 @@ What are the archived variables for?
return 0
for(var/gasid in gases)
- var/archived_gas = get_archived_moles_by_id(gasid)
- var/gas_delta = abs((archived_gas - model.get_moles_by_id(gasid))/TRANSFER_FRACTION)
+ var/archived_gas = archived_gases[gasid]
+ var/gas_delta = abs((archived_gas - model.gases[gasid])/TRANSFER_FRACTION)
if((gas_delta > MINIMUM_AIR_TO_SUSPEND) && (gas_delta >= archived_gas*MINIMUM_AIR_RATIO_TO_SUSPEND))
return 0
return 1
@@ -558,7 +486,7 @@ What are the archived variables for?
var/moved_moles = 0
for(var/gasid in gases)
- var/gas_delta = QUANTIZE(get_archived_moles_by_id(gasid) - sharer.get_archived_moles_by_id(gasid))/TRANSFER_FRACTION
+ var/gas_delta = QUANTIZE(archived_gases[gasid] - sharer.archived_gases[gasid])/TRANSFER_FRACTION
if(gas_delta && abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER) //difference in gases and temperature
var/datum/gas/current_gas = get_gas_by_id(gasid)
var/gas_heat_capacity = current_gas.specific_heat
@@ -569,17 +497,15 @@ What are the archived variables for?
heat_sharer_to_self -= gas_heat_capacity * temperature_archived
heat_capacity_sharer_to_self -= gas_heat_capacity
- adjust_gas(gasid, -gas_delta, 0) //delay update - adjust_gas handles the group multiplier
- sharer.adjust_gas(gasid, gas_delta, 0)
+ adjust_gas(gasid, -gas_delta) //delay update - adjust_gas handles the group multiplier
+ sharer.adjust_gas(gasid, gas_delta)
moved_moles += gas_delta
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- old_self_heat_capacity = heat_capacity()*group_multiplier
- old_sharer_heat_capacity = sharer.heat_capacity()*sharer.group_multiplier
+ old_self_heat_capacity = heat_capacity*group_multiplier
+ old_sharer_heat_capacity = sharer.heat_capacity*sharer.group_multiplier
- update_values()
- sharer.update_values()
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/new_self_heat_capacity = old_self_heat_capacity + heat_capacity_sharer_to_self - heat_capacity_self_to_sharer
@@ -596,7 +522,7 @@ What are the archived variables for?
temperature_share(sharer, OPEN_HEAT_TRANSFER_COEFFICIENT)
if((delta_temperature > MINIMUM_TEMPERATURE_TO_MOVE) || abs(moved_moles) > MINIMUM_MOLES_DELTA_TO_MOVE)
- var/delta_pressure = temperature_archived*(total_moles() + moved_moles) - sharer.temperature_archived*(sharer.total_moles() - moved_moles)
+ var/delta_pressure = temperature_archived*(total_moles + moved_moles) - sharer.temperature_archived*(sharer.total_moles - moved_moles)
return delta_pressure*R_IDEAL_GAS_EQUATION/volume
else
@@ -619,39 +545,36 @@ What are the archived variables for?
var/moved_moles
for(var/gasid in gases)
- var/gas_delta = QUANTIZE(get_archived_moles_by_id(gasid) - model.get_moles_by_id(gasid))/TRANSFER_FRACTION
+ var/gas_delta = QUANTIZE(archived_gases[gasid] - model.gases[gasid])/TRANSFER_FRACTION
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- var/datum/gas/current_gas = get_gas_by_id(gasid)
- var/gas_heat_capacity = current_gas.specific_heat * gas_delta
+ var/gas_heat_capacity = gas_specific_heat[gasid]
heat_transferred -= gas_heat_capacity * model.temperature
heat_capacity_transferred -= gas_heat_capacity
if(border_multiplier)
- adjust_gas(gasid, -gas_delta*border_multiplier, 0) //the 0 delays updates
+ adjust_gas(gasid, -gas_delta*border_multiplier)
else
- adjust_gas(gasid, -gas_delta, 0)
+ adjust_gas(gasid, -gas_delta)
moved_moles += gas_delta
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- old_self_heat_capacity = heat_capacity()*group_multiplier
-
- update_values()
+ old_self_heat_capacity = heat_capacity*group_multiplier
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/new_self_heat_capacity = old_self_heat_capacity - heat_capacity_transferred
if(new_self_heat_capacity > MINIMUM_HEAT_CAPACITY)
if(border_multiplier)
- temperature = (old_self_heat_capacity*temperature - heat_capacity_transferred*border_multiplier*temperature_archived)/new_self_heat_capacity
+ set_temperature((old_self_heat_capacity*temperature - heat_capacity_transferred*border_multiplier*temperature_archived)/new_self_heat_capacity)
else
- temperature = (old_self_heat_capacity*temperature - heat_capacity_transferred*border_multiplier*temperature_archived)/new_self_heat_capacity
+ set_temperature((old_self_heat_capacity*temperature - heat_capacity_transferred*border_multiplier*temperature_archived)/new_self_heat_capacity)
temperature_mimic(model, model_turf.thermal_conductivity, border_multiplier)
if((delta_temperature > MINIMUM_TEMPERATURE_TO_MOVE) || abs(moved_moles) > MINIMUM_MOLES_DELTA_TO_MOVE)
- var/delta_pressure = temperature_archived*(total_moles() + moved_moles) - model.temperature*(model.total_moles())
+ var/delta_pressure = temperature_archived*(total_moles + moved_moles) - model.temperature*(model.total_moles)
return delta_pressure*R_IDEAL_GAS_EQUATION/volume
else
return 0
@@ -659,8 +582,8 @@ What are the archived variables for?
/datum/gas_mixture/proc/check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
- var/self_heat_capacity = heat_capacity_archived()
- var/sharer_heat_capacity = sharer.heat_capacity_archived()
+ var/self_heat_capacity = heat_capacity_calc(archived_gases)
+ var/sharer_heat_capacity = sharer.heat_capacity_calc(archived_gases)
var/self_temperature_delta = 0
var/sharer_temperature_delta = 0
@@ -691,8 +614,8 @@ What are the archived variables for?
/datum/gas_mixture/proc/check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
- var/self_heat_capacity = heat_capacity_archived()
- var/sharer_heat_capacity = sharer.heat_capacity_archived()
+ var/self_heat_capacity = heat_capacity_calc(archived_gases)
+ var/sharer_heat_capacity = sharer.heat_capacity_calc(archived_gases)
var/self_temperature_delta = 0
var/sharer_temperature_delta = 0
@@ -723,7 +646,7 @@ What are the archived variables for?
var/sharer_temperature_delta = 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- var/self_heat_capacity = heat_capacity_archived()
+ var/self_heat_capacity = heat_capacity_calc(archived_gases)
if((sharer.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
@@ -749,7 +672,7 @@ What are the archived variables for?
var/self_temperature_delta = 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- var/self_heat_capacity = heat_capacity_archived()
+ var/self_heat_capacity = heat_capacity_calc(archived_gases)
if((model.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
@@ -761,7 +684,7 @@ What are the archived variables for?
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
return 0
- temperature += self_temperature_delta
+ set_temperature(temperature + self_temperature_delta)
return 1
//Logic integrated from: temperature_mimic(model, conduction_coefficient) for efficiency
@@ -769,8 +692,8 @@ What are the archived variables for?
/datum/gas_mixture/proc/temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- var/self_heat_capacity = heat_capacity_archived()
- var/sharer_heat_capacity = sharer.heat_capacity_archived()
+ var/self_heat_capacity = heat_capacity_calc(archived_gases)
+ var/sharer_heat_capacity = sharer.heat_capacity_calc(archived_gases)
if(!group_multiplier)
message_admins("Error! The gas mixture (ref \ref[src]) has no group multiplier!")
return
@@ -785,7 +708,7 @@ What are the archived variables for?
/datum/gas_mixture/proc/temperature_mimic(turf/model, conduction_coefficient, border_multiplier)
var/delta_temperature = (temperature - model.temperature)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- var/self_heat_capacity = heat_capacity()//_archived()
+ var/self_heat_capacity = heat_capacity//_archived()
if(!group_multiplier)
message_admins("Error! The gas mixture (ref \ref[src]) has no group multiplier!")
return
@@ -802,7 +725,7 @@ What are the archived variables for?
/datum/gas_mixture/proc/temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
- var/self_heat_capacity = heat_capacity()
+ var/self_heat_capacity = heat_capacity
if((sharer.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
var/heat = conduction_coefficient*delta_temperature* \
@@ -819,13 +742,13 @@ What are the archived variables for?
if(!sample) return 0
for(var/gasid in gases)
- var/current_gas = get_moles_by_id(gasid)
- var/sample_gas = sample.get_moles_by_id(gasid)
+ var/current_gas = gases[gasid]
+ var/sample_gas = sample.gases[gasid]
if((abs(current_gas - sample_gas) > MINIMUM_AIR_TO_SUSPEND) && \
((current_gas < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample_gas) || (current_gas > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample_gas)))
return 0
- if(total_moles() > MINIMUM_AIR_TO_SUSPEND)
+ if(total_moles > MINIMUM_AIR_TO_SUSPEND)
if((abs(temperature-sample.temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) && \
((temperature < (1-MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND)*sample.temperature) || (temperature > (1+MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND)*sample.temperature)))
//world << "temp fail [temperature] & [sample.temperature]"
@@ -837,9 +760,8 @@ What are the archived variables for?
return 0
for(var/gasid in right_side.gases)
- adjust_gas(gasid, right_side.get_moles_by_id(gasid), 0, 0)
+ adjust_gas(gasid, right_side.gases[gasid], 0, 0)
- update_values()
return 1
/datum/gas_mixture/proc/subtract(datum/gas_mixture/right_side)
@@ -849,17 +771,15 @@ What are the archived variables for?
//Outputs: 1
for(var/gasid in right_side.gases)
- adjust_gas(gasid, -right_side.get_moles_by_id(gasid), 0, 0)
+ adjust_gas(gasid, -right_side.gases[gasid], 0, 0)
- update_values()
return 1
/datum/gas_mixture/proc/multiply(factor)
for(var/gasid in gases)
- adjust_gas(gasid, (factor - 1) * get_moles_by_id(gasid), 0, 0)
+ adjust_gas(gasid, (factor - 1) * gases[gasid], 0, 0)
- update_values()
return 1
/datum/gas_mixture/proc/divide(factor)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index 3240e265d33..517757ddb9f 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -305,15 +305,15 @@
contents.Add(t.air_contents.total_moles) //Someone messed with the tank and put unknown gasses
continue //in it, so we're going to believe the tank is what it says it is
- if(t.air_contents.get_moles_by_id(breathes))
+ if(t.air_contents.gases[breathes])
var/toxic_found
for(var/toxicid in C.toxic_to_breathe)
- if(t.air_contents.get_moles_by_id(toxicid))
+ if(t.air_contents.gases[toxicid])
tank_contents.Add(0)
toxic_found = 1
break
if(!toxic_found)
- tank_contents.Add(t.air_contents.get_moles_by_id(breathes))
+ tank_contents.Add(t.air_contents.gases[breathes])
else
//no tank so we set contents to 0
diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm
index ca83fab7591..64f29698408 100644
--- a/code/game/gamemodes/events/ninja_equipment.dm
+++ b/code/game/gamemodes/events/ninja_equipment.dm
@@ -313,15 +313,15 @@ ________________________________________________________________________________
else
var/datum/gas_mixture/environment = T.return_air()
- var/pressure = environment.return_pressure()
- var/total_moles = environment.total_moles()
+ var/pressure = environment.pressure
+ var/total_moles = environment.total_moles
dat += "Air Pressure: [round(pressure,0.1)] kPa"
dat += "
"
for(var/gasid in environment.gases)
var/datum/gas/gas = environment.get_gas_by_id(gasid)
- dat += "- [gas.display_name]: [round(environment.get_moles_by_id(gasid)/total_moles)]%
"
+ dat += "- [gas.display_name]: [round(environment.gases[gasid]/total_moles)]%
"
dat += "Temperature: [round(environment.temperature-T0C)]°C"
if(2)
diff --git a/code/game/gamemodes/steal_items.dm b/code/game/gamemodes/steal_items.dm
index 53f496c2a55..61bc0af6d93 100644
--- a/code/game/gamemodes/steal_items.dm
+++ b/code/game/gamemodes/steal_items.dm
@@ -219,7 +219,7 @@
max=28
/datum/theft_objective/number/traitor/plasma_gas/getAmountStolen(var/obj/item/I)
- return I:air_contents:get_moles_by_id(PLASMA)
+ return I:air_contents:gases[PLASMA]
/datum/theft_objective/number/traitor/coins
name = "credits of coins (in bag)"
diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm
index 5721baaeb0d..55798d5a1e1 100644
--- a/code/game/machinery/Freezer.dm
+++ b/code/game/machinery/Freezer.dm
@@ -105,7 +105,7 @@
var/dat = {"Cryo gas cooling system
Current status: [ on ? "Off On" : "Off On"]
Current gas temperature: [temp_text]
- Current air pressure: [air_contents.return_pressure()]
+ Current air pressure: [air_contents.pressure]
Target gas temperature: - - - [current_temperature] + + +
"}
@@ -265,7 +265,7 @@
var/dat = {"Heating system
Current status: [ on ? "Off On" : "Off On"]
Current gas temperature: [temp_text]
- Current air pressure: [air_contents.return_pressure()]
+ Current air pressure: [air_contents.pressure]
Target gas temperature: - - - [current_temperature] + + +
"}
diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm
index 63ee228658d..9b72a7f720d 100644
--- a/code/game/machinery/airlock_control.dm
+++ b/code/game/machinery/airlock_control.dm
@@ -169,7 +169,7 @@ obj/machinery/airlock_sensor/process()
var/datum/gas_mixture/air_sample = return_air()
- var/pressure = round(air_sample.return_pressure(),0.1)
+ var/pressure = round(air_sample.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 ded9c5568fa..4bcff54dbe4 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -209,7 +209,7 @@
var/datum/gas_mixture/gas = location.remove_air(0.25 * environment.total_moles)
if(gas)
- var/heat_capacity = gas.heat_capacity()
+ var/heat_capacity = gas.heat_capacity
var/energy_used = min(abs(heat_capacity * (gas.temperature - target_temperature)), MAX_ENERGY_CHANGE)
// We need to cool ourselves.
@@ -241,7 +241,7 @@
danger_averted_confidence = 0 // Reset counter.
use_power = 2
- if (mode==AALARM_MODE_CYCLE && environment.return_pressure()4)
- var/total_moles = air_sample.total_moles()
+ var/total_moles = air_sample.total_moles
if(total_moles > 0)
if(output&4)
- signal.data[OXYGEN] = round(100*air_sample.get_moles_by_id(OXYGEN)/total_moles,0.1)
+ signal.data[OXYGEN] = round(100*air_sample.gases[OXYGEN]/total_moles,0.1)
if(output&8)
- signal.data[PLASMA] = round(100*air_sample.get_moles_by_id(PLASMA)/total_moles,0.1)
+ signal.data[PLASMA] = round(100*air_sample.gases[PLASMA]/total_moles,0.1)
if(output&16)
- signal.data[NITROGEN] = round(100*air_sample.get_moles_by_id(NITROGEN)/total_moles,0.1)
+ signal.data[NITROGEN] = round(100*air_sample.gases[NITROGEN]/total_moles,0.1)
if(output&32)
- signal.data[CARBON_DIOXIDE] = round(100*air_sample.get_moles_by_id(CARBON_DIOXIDE)/total_moles,0.1)
+ signal.data[CARBON_DIOXIDE] = round(100*air_sample.gases[CARBON_DIOXIDE]/total_moles,0.1)
else
signal.data[OXYGEN] = 0
signal.data[PLASMA] = 0
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 00c6d19aeba..9017fb7403e 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -76,7 +76,7 @@
if (connected_port)
overlays.Add("can-connector")
- var/tank_pressure = air_contents.return_pressure()
+ var/tank_pressure = air_contents.pressure
if (tank_pressure < 10)
overlays.Add("can-o0")
@@ -132,8 +132,8 @@
else
environment = loc.return_air()
- var/env_pressure = environment.return_pressure()
- var/pressure_delta = min(release_pressure - env_pressure, (air_contents.return_pressure() - env_pressure)/2)
+ var/env_pressure = environment.pressure
+ var/pressure_delta = min(release_pressure - env_pressure, (air_contents.pressure - env_pressure)/2)
//Can not have a pressure delta that would cause environment pressure > tank pressure
var/transfer_moles = 0
@@ -149,7 +149,7 @@
loc.assume_air(removed)
src.update_icon()
- if(air_contents.return_pressure() < 1)
+ if(air_contents.pressure < 1)
can_label = 1
else
can_label = 0
@@ -170,7 +170,7 @@
/obj/machinery/portable_atmospherics/canister/proc/return_pressure()
var/datum/gas_mixture/GM = src.return_air()
if(GM && GM.volume>0)
- return GM.return_pressure()
+ return GM.pressure
return 0
/obj/machinery/portable_atmospherics/canister/blob_act()
@@ -207,8 +207,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.return_pressure()
- var/pressure_delta = min(10*ONE_ATMOSPHERE - env_pressure, (air_contents.return_pressure() - env_pressure)/2)
+ var/env_pressure = thejetpack.pressure
+ var/pressure_delta = min(10*ONE_ATMOSPHERE - env_pressure, (air_contents.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))
@@ -246,7 +246,7 @@
data["name"] = name
data["canLabel"] = can_label ? 1 : 0
data["portConnected"] = connected_port ? 1 : 0
- 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["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["releasePressure"] = round(release_pressure)
data["minReleasePressure"] = round(ONE_ATMOSPHERE/10)
data["maxReleasePressure"] = round(10*ONE_ATMOSPHERE)
@@ -254,7 +254,7 @@
data["hasHoldingTank"] = holding ? 1 : 0
if (holding)
- data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
+ data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.pressure > 0 ? holding.air_contents.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)
@@ -288,7 +288,7 @@
var/list/contents_l=list()
for(var/gasid in src.air_contents.gases)
var/datum/gas/gas = air_contents.get_gas_by_id(gasid)
- if(gas.gas_flags & AUTO_LOGGING && air_contents.get_moles_by_id(gasid) > 0)
+ if(gas.gas_flags & AUTO_LOGGING && air_contents.gases[gasid] > 0)
contents_l += "[gas.display_name]"
var/contents_str = english_list(contents_l)
investigation_log(I_ATMOS, "had its valve OPENED by [key_name(usr)], starting transfer into the air ([contents_str])")
@@ -304,7 +304,7 @@
var/list/contents_l=list()
for(var/gasid in src.air_contents.gases)
var/datum/gas/gas = air_contents.get_gas_by_id(gasid)
- if(gas.gas_flags & AUTO_LOGGING && air_contents.get_moles_by_id(gasid) > 0)
+ if(gas.gas_flags & AUTO_LOGGING && air_contents.gases[gasid] > 0)
contents_l += "[gas.display_name]"
var/contents_str = english_list(contents_l)
if(contents_l.len>0)
@@ -439,4 +439,4 @@
// New beam damage code (per-tick)
for(var/obj/effect/beam/B in beams)
apply_beam_damage(B)
- healthcheck()
+ healthcheck()
diff --git a/code/game/machinery/atmoalter/gas_mine.dm b/code/game/machinery/atmoalter/gas_mine.dm
index ccff1ba8f36..f6a4f6d560d 100644
--- a/code/game/machinery/atmoalter/gas_mine.dm
+++ b/code/game/machinery/atmoalter/gas_mine.dm
@@ -25,10 +25,9 @@
/obj/machinery/atmospherics/miner/New()
..()
air_contents = new
- air_contents.volume=1000
- air_contents.temperature = T20C
+ air_contents.set_volume(1000)
+ air_contents.set_temperature(T20C)
AddAir()
- air_contents.update_values()
update_icon()
/obj/machinery/atmospherics/miner/wrenchAnchor(mob/user)
@@ -100,7 +99,7 @@
return
var/datum/gas_mixture/environment = loc.return_air()
- var/environment_pressure = environment.return_pressure()
+ var/environment_pressure = environment.pressure
pumping.copy_from(air_contents)
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index b808efb09e0..0b861e3b484 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -43,7 +43,7 @@
spawn(0) qdel(src)
return PROCESS_KILL
- var/env_pressure = environment.return_pressure()
+ var/env_pressure = environment.pressure
if(env_pressure <= 0.15*ONE_ATMOSPHERE)
icon_state = "meter0"
else if(env_pressure <= 1.8*ONE_ATMOSPHERE)
@@ -74,10 +74,10 @@
"sigtype" = "status"
)
- var/total_moles = environment.total_moles()
+ var/total_moles = environment.total_moles
if(total_moles > 0)
for(var/gasid in environment.gases)
- signal.data[gasid] = round(100 * environment.get_moles_by_id(gasid) / total_moles, 0.1)
+ signal.data[gasid] = round(100 * environment.gases[gasid] / total_moles, 0.1)
else
for(var/gasid in environment.gases)
signal.data[gasid] = 0
@@ -89,7 +89,7 @@
if (src.target)
var/datum/gas_mixture/environment = target.return_air()
if(environment)
- t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]K ([round(environment.temperature-T0C,0.01)]°C)"
+ t += "The pressure gauge reads [round(environment.pressure, 0.01)] kPa; [round(environment.temperature,0.01)]K ([round(environment.temperature-T0C,0.01)]°C)"
else
t += "The sensor error light is blinking."
else
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index f16f43c0027..7078b9261a4 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -107,7 +107,7 @@
var/list/contents_l=list()
for(var/gasid in src.air_contents.gases)
var/datum/gas/gas = air_contents.get_gas_by_id(gasid)
- if(gas.gas_flags & AUTO_LOGGING && air_contents.get_moles_by_id(gasid) > 0)
+ if(gas.gas_flags & AUTO_LOGGING && air_contents.gases[gasid] > 0)
contents_l += "[gas.display_name]"
var/contents_str = english_list(contents_l)
if(contents_l.len>0)
diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm
index 56ea190eaa8..60972006a6f 100644
--- a/code/game/machinery/atmoalter/pump.dm
+++ b/code/game/machinery/atmoalter/pump.dm
@@ -55,7 +55,7 @@
else
environment = loc.return_air()
if(direction_out)
- var/pressure_delta = target_pressure - environment.return_pressure()
+ var/pressure_delta = target_pressure - environment.pressure
//Can not have a pressure delta that would cause environment pressure > tank pressure
var/transfer_moles = 0
@@ -70,7 +70,7 @@
else
loc.assume_air(removed)
else
- var/pressure_delta = target_pressure - air_contents.return_pressure()
+ var/pressure_delta = target_pressure - air_contents.pressure
//Can not have a pressure delta that would cause environment pressure > tank pressure
var/transfer_moles = 0
@@ -106,7 +106,7 @@
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
var/list/data[0]
data["portConnected"] = connected_port ? 1 : 0
- data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)
+ data["tankPressure"] = round(air_contents.pressure > 0 ? air_contents.pressure : 0)
data["targetpressure"] = round(target_pressure)
data["pump_dir"] = direction_out
data["minpressure"] = round(pressuremin)
@@ -115,7 +115,7 @@
data["hasHoldingTank"] = holding ? 1 : 0
if (holding)
- data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
+ data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.pressure > 0 ? holding.air_contents.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)
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index 24f7f0272af..ca940ed5c5f 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -101,7 +101,7 @@
environment = holding.air_contents
else
environment = loc.return_air()
- var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
+ var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles
//Take a gas sample
var/datum/gas_mixture/removed
@@ -114,14 +114,13 @@
if (removed)
var/datum/gas_mixture/filtered_out = new
- filtered_out.temperature = removed.temperature
+ filtered_out.set_temperature(removed.temperature)
for(var/gasid in removed.gases)
var/datum/gas/gas_to_remove = removed.get_gas_by_id(gasid)
if(gas_to_remove.gas_flags & AUTO_FILTERED)
- filtered_out.adjust_gas(gasid, removed.get_moles_by_id(gasid), 0)
- removed.set_gas(gasid, 0, 0)
- removed.update_values()
+ filtered_out.adjust_gas(gasid, removed.gases[gasid])
+ removed.set_gas(gasid, 0)
//Remix the resulting gases
air_contents.merge(filtered_out)
@@ -151,7 +150,7 @@
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
var/list/data[0]
data["portConnected"] = connected_port ? 1 : 0
- data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)
+ data["tankPressure"] = round(air_contents.pressure > 0 ? air_contents.pressure : 0)
data["rate"] = round(volume_rate)
data["minrate"] = round(minrate)
data["maxrate"] = round(maxrate)
@@ -159,7 +158,7 @@
data["hasHoldingTank"] = holding ? 1 : 0
if (holding)
- data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
+ data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.pressure > 0 ? holding.air_contents.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)
@@ -192,4 +191,4 @@
var/diff = text2num(href_list["volume_adj"])
volume_rate = Clamp(volume_rate+diff, minrate, maxrate)
- src.add_fingerprint(usr)
+ src.add_fingerprint(usr)
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index a84a8ae8d41..67c0667c189 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -339,18 +339,18 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj
icon_state = "cell-off"
/obj/machinery/atmospherics/unary/cryo_cell/proc/process_occupant()
- if(air_contents.total_moles() < 10)
+ if(air_contents.total_moles < 10)
return
if(occupant)
if(occupant.stat == 2)
return
- occupant.bodytemperature += 2*(air_contents.temperature - occupant.bodytemperature)*current_heat_capacity/(current_heat_capacity + air_contents.heat_capacity())
+ occupant.bodytemperature += 2*(air_contents.temperature - occupant.bodytemperature)*current_heat_capacity/(current_heat_capacity + air_contents.heat_capacity)
occupant.bodytemperature = max(occupant.bodytemperature, air_contents.temperature) // this is so ugly i'm sorry for doing it i'll fix it later i promise
occupant.stat = 1
if(occupant.bodytemperature < T0C)
occupant.sleeping = max(5, (1/occupant.bodytemperature)*2000)
occupant.Paralyse(max(5, (1/occupant.bodytemperature)*3000))
- if(air_contents.get_moles_by_id(OXYGEN) > 2)
+ if(air_contents.gases[OXYGEN] > 2)
if(occupant.getOxyLoss()) occupant.adjustOxyLoss(-1)
else
occupant.adjustOxyLoss(-1)
@@ -369,19 +369,19 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj
beaker.reagents.reaction(occupant)
/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/air_heat_capacity = air_contents.heat_capacity
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
if(combined_heat_capacity > 0)
var/combined_energy = T20C*current_heat_capacity + air_heat_capacity*air_contents.temperature
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
+// var/remove_amount = air_contents.total_moles/50
// expel_gas = air_contents.remove(remove_amount)
// Just have the gas disappear to nowhere.
diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm
index 35954c0c8b6..89b881eb082 100644
--- a/code/game/machinery/overview.dm
+++ b/code/game/machinery/overview.dm
@@ -124,7 +124,7 @@
if(!colour2 && !T.density)
var/datum/gas_mixture/environment = T.return_air()
- var/turf_total = environment.total_moles()
+ var/turf_total = environment.total_moles
//var/turf_total = T.co2 + T.oxygen + T.poison + T.sl_gas + T.n2
@@ -210,7 +210,7 @@
if("/turf/simulated/floor", "/turf/simulated/floor/engine")
var/datum/gas_mixture/environment = T.return_air()
- var/turf_total = environment.total_moles()
+ var/turf_total = environment.total_moles
var/t1 = turf_total / MOLES_CELLSTANDARD * 175
if(t1<=100)
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index bd6a1778136..fdcf1dc1cba 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -236,13 +236,13 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/datum/gas_mixture/env = L.return_air()
if(env.temperature < (heat_amt+T0C))
- var/transfer_moles = 0.25 * env.total_moles()
+ var/transfer_moles = 0.25 * env.total_moles
var/datum/gas_mixture/removed = env.remove(transfer_moles)
if(removed)
- var/heat_capacity = removed.heat_capacity()
+ var/heat_capacity = removed.heat_capacity
if(heat_capacity == 0 || heat_capacity == null)
heat_capacity = 1
removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000)
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index 8dbc05b1418..3d53d7ee561 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -942,14 +942,13 @@
var/datum/gas_mixture/GM = T.return_air()
if(prob(10))
GM.adjust_gas(PLASMA, 100, 0, 0)
- GM.temperature = 1500+T0C //should be enough to start a fire
+ GM.set_temperature(1500+T0C) //should be enough to start a fire
T.visible_message("The [src] suddenly disgorges a cloud of heated plasma.")
destroy()
else
GM.adjust_gas(PLASMA, 5, 0, 0)
- GM.temperature = istype(T) ? T.air.temperature : T20C
+ GM.set_temperature(istype(T) ? T.air.temperature : T20C)
T.visible_message("The [src] suddenly disgorges a cloud of plasma.")
- GM.update_values()
return
/datum/global_iterator/mecha_generator
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 85d51c9d12a..26d5fd4e8ba 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -821,22 +821,22 @@
/obj/mecha/proc/return_pressure()
. = 0
if(use_internal_tank)
- . = cabin_air.return_pressure()
+ . = cabin_air.pressure
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
- . = t_air.return_pressure()
+ . = t_air.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.return_temperature()
+ . = cabin_air.temperature
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
- . = t_air.return_temperature()
+ . = t_air.temperature
return
/obj/mecha/proc/connect(obj/machinery/atmospherics/unary/portables_connector/new_port)
@@ -1118,17 +1118,17 @@
return
if(mob_container.forceMove(src.loc))//ejecting mob container
/*
- if(ishuman(occupant) && (return_pressure() > HAZARD_HIGH_PRESSURE))
+ if(ishuman(occupant) && (pressure > HAZARD_HIGH_PRESSURE))
use_internal_tank = 0
var/datum/gas_mixture/environment = get_turf_air()
if(environment)
- var/env_pressure = environment.return_pressure()
- var/pressure_delta = (cabin.return_pressure() - env_pressure)
+ var/env_pressure = environment.pressure
+ var/pressure_delta = (cabin.pressure - env_pressure)
//Can not have a pressure delta that would cause environment pressure > tank pressure
var/transfer_moles = 0
if(pressure_delta > 0)
- transfer_moles = pressure_delta*environment.volume/(cabin.return_temperature() * R_IDEAL_GAS_EQUATION)
+ transfer_moles = pressure_delta*environment.volume/(cabin.temperature * R_IDEAL_GAS_EQUATION)
//Actually transfer the gas
var/datum/gas_mixture/removed = cabin.air_contents.remove(transfer_moles)
@@ -1688,7 +1688,7 @@
delay = 20
process(var/obj/mecha/mecha)
- if(mecha.cabin_air && mecha.cabin_air.return_volume() > 0)
+ if(mecha.cabin_air && mecha.cabin_air.volume > 0)
var/delta = mecha.cabin_air.temperature - T20C
mecha.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
return
@@ -1702,21 +1702,21 @@
var/datum/gas_mixture/cabin_air = mecha.cabin_air
var/release_pressure = mecha.internal_tank_valve
- var/cabin_pressure = cabin_air.return_pressure()
- var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
+ var/cabin_pressure = cabin_air.pressure
+ var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.pressure - cabin_pressure)/2)
var/transfer_moles = 0
if(pressure_delta > 0) //cabin pressure lower than release pressure
- if(tank_air.return_temperature() > 0)
- transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
+ if(tank_air.temperature > 0)
+ transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.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.return_pressure(), pressure_delta)
+ pressure_delta = min(cabin_pressure - t_air.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.return_temperature() * R_IDEAL_GAS_EQUATION)
+ transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
if(t_air)
t_air.merge(removed)
@@ -1749,12 +1749,12 @@
if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
- if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents
+ if(int_tank_air && int_tank_air.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.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),"fire")
+ if(mecha.cabin_air && mecha.cabin_air.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),"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/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm
index ff445be4ba8..281ff10a6eb 100644
--- a/code/game/objects/effects/effect_system.dm
+++ b/code/game/objects/effects/effect_system.dm
@@ -734,7 +734,7 @@ steam.start() -- spawns the effect
if(reagents.has_reagent("water"))
var/turf/simulated/T = get_turf(src)
if(istype(T))
- 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-500,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm
index 34841aba50d..bb44798ef42 100644
--- a/code/game/objects/effects/spawners/bombspawner.dm
+++ b/code/game/objects/effects/spawners/bombspawner.dm
@@ -136,14 +136,12 @@
PT.master = V
OT.master = V
- PT.air_contents.temperature = PLASMA_FLASHPOINT
+ PT.air_contents.set_temperature(PLASMA_FLASHPOINT)
PT.air_contents.set_gas(PLASMA, 15, 0)
PT.air_contents.set_gas(CARBON_DIOXIDE, 33, 0)
- PT.air_contents.update_values()
- OT.air_contents.temperature = PLASMA_FLASHPOINT
+ PT.air_contents.set_temperature(PLASMA_FLASHPOINT)
OT.air_contents.set_gas(OXYGEN, 48, 0)
- OT.air_contents.update_values()
var/obj/item/device/assembly/S
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 6383aa85fbb..b17852e4555 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -278,9 +278,8 @@ proc/healthanalyze(mob/living/M as mob, mob/living/user as mob, var/mode = 0)
/obj/item/device/analyzer/proc/output_gas_scan(var/datum/gas_mixture/scanned, var/atom/container, human_standard = 0)
if(!scanned)
return "No gas mixture found."
- scanned.update_values()
- var/pressure = scanned.return_pressure()
- var/total_moles = scanned.total_moles()
+ var/pressure = scanned.pressure
+ var/total_moles = scanned.total_moles
var/message = ""
if(!container || istype(container, /turf))
message += "Results:
"
@@ -290,7 +289,7 @@ proc/healthanalyze(mob/living/M as mob, mob/living/user as mob, var/mode = 0)
message += "[human_standard && abs(pressure - ONE_ATMOSPHERE) > 10 ? "" : ""] Pressure: [round(pressure,0.1)] kPa
"
for(var/gasid in scanned.gases)
- var/gas_moles = scanned.get_moles_by_id(gasid)
+ var/gas_moles = scanned.gases[gasid]
var/datum/gas/gas = scanned.get_gas_by_id(gasid)
if(!gas_moles && !(gas.gas_flags & ALWAYS_SHOW)) //no gas, and we aren't configured to show a 0 number
continue //skip it
@@ -303,7 +302,7 @@ proc/healthanalyze(mob/living/M as mob, mob/living/user as mob, var/mode = 0)
if(gas_moles >= human_standards["[gas.gas_id]_max"])
danger = 1
- message += "[danger ? "" : ""] [gas.display_short]: [round(gas_moles, 0.1)] mol, [round((gas_moles / scanned.total_moles())*100)]%
"
+ message += "[danger ? "" : ""] [gas.display_short]: [round(gas_moles, 0.1)] mol, [round((gas_moles / scanned.total_moles)*100)]%
"
message += "[human_standard && !(abs(scanned.temperature-T0C - 20) < 20) ? "" : ""] Temperature: [round(scanned.temperature-T0C)]°C"
else
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index ff43a975e6e..23c39374acb 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -128,7 +128,7 @@
if(!ptank)
user << "Attach a plasma tank first!"
return
- var/dat = text("Flamethrower ([lit ? "Lit" : "Unlit"])
\n Tank Pressure: [ptank.air_contents.return_pressure()]
\nAmount to throw: - - - [throw_amount] + + +
\nRemove plasmatank - Close")
+ var/dat = text("Flamethrower ([lit ? "Lit" : "Unlit"])
\n Tank Pressure: [ptank.air_contents.pressure]
\nAmount to throw: - - - [throw_amount] + + +
\nRemove plasmatank - Close")
user << browse(dat, "window=flamethrower;size=600x300")
onclose(user, "flamethrower")
return
@@ -143,7 +143,7 @@
usr.set_machine(src)
if(href_list["light"])
if(!ptank) return
- if(ptank.air_contents.get_moles_by_id(PLASMA) < 1) return
+ if(ptank.air_contents.gases[PLASMA] < 1) return
if(!status) return
lit = !lit
if(lit)
@@ -192,7 +192,7 @@
//Transfer 5% of current tank air contents to turf
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.02*(throw_amount/100))
//air_transfer.toxins = air_transfer.toxins * 5 // This is me not comprehending the air system. I realize this is retarded and I could probably make it work without fucking it up like this, but there you have it. -- TLE
- new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(target,air_transfer.get_moles_by_id(PLASMA)*10,get_dir(loc,target))
+ new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(target,air_transfer.gases[PLASMA]*10,get_dir(loc,target))
air_transfer.set_gas(PLASMA, 0)
target.assume_air(air_transfer)
//Burn it based on transfered gas
diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm
index f822989f106..d32bbbd31dd 100644
--- a/code/game/objects/items/weapons/tanks/jetpack.dm
+++ b/code/game/objects/items/weapons/tanks/jetpack.dm
@@ -39,13 +39,13 @@
/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)
- if(G.total_moles() >= 0.005)
+ if(G.total_moles >= 0.005)
return 1
G = null //let the GC get it
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 8ecae54a9e6..d1263f12a74 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -117,7 +117,7 @@
// this is the data which will be sent to the ui
var/data[0]
- data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
+ data["tankPressure"] = round(air_contents.pressure ? air_contents.pressure : 0)
data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0)
data["defaultReleasePressure"] = round(TANK_DEFAULT_RELEASE_PRESSURE)
data["maxReleasePressure"] = round(TANK_MAX_RELEASE_PRESSURE)
@@ -199,7 +199,7 @@
if(!air_contents)
return null
- var/tank_pressure = air_contents.return_pressure()
+ var/tank_pressure = air_contents.pressure
if(tank_pressure < distribute_pressure)
distribute_pressure = tank_pressure
@@ -221,7 +221,7 @@
if(!air_contents)
return 0
- var/pressure = air_contents.return_pressure()
+ var/pressure = air_contents.pressure
if(pressure > TANK_FRAGMENT_PRESSURE)
if(!istype(src.loc,/obj/item/device/transfer_valve))
message_admins("Explosive tank rupture! last key to touch the tank was [src.fingerprintslast].")
@@ -231,7 +231,7 @@
air_contents.react()
air_contents.react()
air_contents.react()
- pressure = air_contents.return_pressure()
+ pressure = air_contents.pressure
var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE
if(range > MAX_EXPLOSION_RANGE)
cap = 1
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
index 2f9f894b819..a1f321e7d43 100644
--- a/code/game/objects/structures/false_walls.dm
+++ b/code/game/objects/structures/false_walls.dm
@@ -18,7 +18,7 @@
var/cp=0
if(T && istype(T) && T.zone)
var/datum/gas_mixture/environment = T.return_air()
- cp = environment.return_pressure()
+ cp = environment.pressure
else
if(istype(T,/turf/simulated))
continue
@@ -32,13 +32,13 @@
if(!istype(lT) || !lT.zone)
return 0
var/datum/gas_mixture/myenv=lT.return_air()
- var/pressure=myenv.return_pressure()
+ var/pressure=myenv.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_air()
- var/pdiff = abs(pressure - environment.return_pressure())
+ var/pdiff = abs(pressure - environment.pressure)
if(pdiff > FALSEDOOR_MAX_PRESSURE_DIFF)
return pdiff
return 0
diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm
index fa06a88b66d..7471a0e7050 100644
--- a/code/game/objects/structures/transit_tubes.dm
+++ b/code/game/objects/structures/transit_tubes.dm
@@ -75,11 +75,9 @@ obj/structure/ex_act(severity)
/obj/structure/transit_tube_pod/New()
. = ..()
- air_contents.adjust_gas(OXYGEN, MOLES_O2STANDARD * 2, 0)
- air_contents.adjust_gas(NITROGEN, MOLES_N2STANDARD, 0)
- air_contents.temperature = T20C
- air_contents.update_values()
-
+ air_contents.set_temperature(T20C)
+ air_contents.adjust_gas(OXYGEN, MOLES_O2STANDARD * 2)
+ air_contents.adjust_gas(NITROGEN, MOLES_N2STANDARD)
// Give auto tubes time to align before trying to start moving
spawn (5)
follow_tube()
@@ -384,8 +382,8 @@ obj/structure/ex_act(severity)
// currently on.
/obj/structure/transit_tube_pod/proc/mix_air()
var/datum/gas_mixture/environment = loc.return_air()
- var/env_pressure = environment.return_pressure()
- var/int_pressure = air_contents.return_pressure()
+ var/env_pressure = environment.pressure
+ var/int_pressure = air_contents.pressure
var/total_pressure = env_pressure + int_pressure
if(total_pressure == 0)
@@ -400,8 +398,8 @@ obj/structure/ex_act(severity)
var/transfer_in = max(0.1, 0.5 * (env_pressure - int_pressure) / total_pressure)
var/transfer_out = max(0.1, 0.3 * (int_pressure - env_pressure) / total_pressure)
- var/datum/gas_mixture/from_env = loc.remove_air(environment.total_moles() * transfer_in)
- var/datum/gas_mixture/from_int = air_contents.remove(air_contents.total_moles() * transfer_out)
+ var/datum/gas_mixture/from_env = loc.remove_air(environment.total_moles * transfer_in)
+ var/datum/gas_mixture/from_int = air_contents.remove(air_contents.total_moles * transfer_out)
loc.assume_air(from_int)
air_contents.merge(from_env)
diff --git a/code/game/sound.dm b/code/game/sound.dm
index 3735d2ebd51..ab878712e33 100644
--- a/code/game/sound.dm
+++ b/code/game/sound.dm
@@ -41,7 +41,7 @@ var/list/mommicomment_sound = list('sound/voice/mommi_comment1.ogg', 'sound/voic
var/atmosphere = 0
var/datum/gas_mixture/current_air = turf_source.return_air()
if(current_air)
- atmosphere = current_air.return_pressure()
+ atmosphere = current_air.pressure
else
atmosphere = 0 //no air
@@ -82,7 +82,7 @@ var/const/SURROUND_CAP = 7
var/datum/gas_mixture/environment = current_turf.return_air()
var/atmosphere = 0
if(environment)
- atmosphere = environment.return_pressure()
+ atmosphere = environment.pressure
/// Local sound modifications ///
if(atmosphere < MIN_SOUND_PRESSURE) //no sound reception in space, boyos
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 8c359728976..e69bfa1d7a0 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -145,7 +145,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for(var/gasid in env.gases)
var/datum/gas/gas = env.get_gas_by_id(gasid)
- t += "[gas.display_name] : [env.get_moles_by_id(gasid)]
"
+ t += "[gas.display_name] : [env.gases[gasid]]
"
usr.show_message(t, 1)
feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm
index a4eb8ca7387..96cdd05ddb6 100644
--- a/code/modules/admin/verbs/diagnostics.dm
+++ b/code/modules/admin/verbs/diagnostics.dm
@@ -55,7 +55,7 @@
if(T.active_hotspot)
burning = 1
- usr << "@[target.x],[target.y] ([GM.group_multiplier]): O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("BURNING"):(null)]"
+ usr << "@[target.x],[target.y] ([GM.group_multiplier]): O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.pressure] kPa [(burning)?("BURNING"):(null)]"
for(var/datum/gas/trace_gas in GM.trace_gases)
usr << "[trace_gas.type]: [trace_gas.moles]"
feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index 8728b52cac5..92fd47debe5 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -109,7 +109,7 @@
return
/obj/item/weapon/tank/proc/detonate() //This happens when a bomb is told to explode
- var/fuel_moles = air_contents.get_moles_by_id(PLASMA) + air_contents.get_moles_by_id(OXYGEN)/6
+ var/fuel_moles = air_contents.gases[PLASMA] + air_contents.gases[OXYGEN]/6
var/strength = 1
var/turf/ground_zero = get_turf(loc)
@@ -157,7 +157,7 @@
del(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/hydroponics/hydro_tray.dm b/code/modules/hydroponics/hydro_tray.dm
index 9c1c14701dd..473fa83c3ce 100644
--- a/code/modules/hydroponics/hydro_tray.dm
+++ b/code/modules/hydroponics/hydro_tray.dm
@@ -258,14 +258,14 @@
for(var/gas in seed.consume_gasses)
if(environment)
if(gas == OXYGEN)
- if(environment.get_moles_by_id(OXYGEN) <= seed.consume_gasses[OXYGEN])
+ if(environment.gases[OXYGEN] <= seed.consume_gasses[OXYGEN])
missing_gas++
continue
else
- if(environment.get_moles_by_id(gas) >= seed.consume_gasses[gas])
+ if(environment.gases[gas] >= seed.consume_gasses[gas])
missing_gas++
continue
- environment.adjust_gas(gas,-seed.consume_gasses[gas],1)
+ environment.adjust_gas(gas,-seed.consume_gasses[gas])
else
missing_gas++
@@ -273,7 +273,7 @@
health -= missing_gas * HYDRO_SPEED_MULTIPLIER
// Process it.
- var/pressure = environment.return_pressure()
+ var/pressure = environment.pressure
if(pressure < seed.lowkpa_tolerance || pressure > seed.highkpa_tolerance)
health -= healthmod
diff --git a/code/modules/hydroponics/vines.dm b/code/modules/hydroponics/vines.dm
index daa76dd7a83..d1d60240c94 100644
--- a/code/modules/hydroponics/vines.dm
+++ b/code/modules/hydroponics/vines.dm
@@ -280,7 +280,7 @@
if(!environment)
return
- var/pressure = environment.return_pressure()
+ var/pressure = environment.pressure
if(pressure < seed.lowkpa_tolerance || pressure > seed.highkpa_tolerance)
die()
return
diff --git a/code/modules/media/broadcast/transmitters/broadcast.dm b/code/modules/media/broadcast/transmitters/broadcast.dm
index 4f649cd92dc..f46b9d2e8d0 100644
--- a/code/modules/media/broadcast/transmitters/broadcast.dm
+++ b/code/modules/media/broadcast/transmitters/broadcast.dm
@@ -175,7 +175,7 @@
var/datum/gas_mixture/env = L.return_air()
if(env.temperature != MAX_TEMP + T0C)
- var/transfer_moles = 0.25 * env.total_moles()
+ var/transfer_moles = 0.25 * env.total_moles
var/datum/gas_mixture/removed = env.remove(transfer_moles)
@@ -183,7 +183,7 @@
if(removed)
- var/heat_capacity = removed.heat_capacity()
+ var/heat_capacity = removed.heat_capacity
//world << "heating ([heat_capacity])"
if(heat_capacity) // Added check to avoid divide by zero (oshi-) runtime errors -- TLE
if(removed.temperature < MAX_TEMP + T0C)
diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm
index a159934bac8..b6c22104c49 100644
--- a/code/modules/mining/equipment_locker.dm
+++ b/code/modules/mining/equipment_locker.dm
@@ -495,7 +495,7 @@
del(src)
else
var/datum/gas_mixture/environment = proj_turf.return_air()
- var/pressure = environment.return_pressure()
+ var/pressure = environment.pressure
if(pressure < 50)
name = "strong resonance field"
resonance_damage = 60
diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm
index fc98026c8aa..ce17c5b84ea 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/life.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm
@@ -117,12 +117,12 @@
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
var/breath_moles = 0
- /*if(environment.return_pressure() > ONE_ATMOSPHERE)
+ /*if(environment.pressure > ONE_ATMOSPHERE)
// Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT)
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
else*/
// Not enough air around, take a percentage of what's there to model this properly
- breath_moles = environment.total_moles()*BREATH_PERCENTAGE
+ breath_moles = environment.total_moles*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
@@ -171,11 +171,11 @@
return 0
var/plasma_used = 0
- var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
+ var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
//Partial pressure of the toxins in our breath
- var/plasma_gas = breath.get_moles_by_id(PLASMA)
- var/Plasma_pp = (plasma_gas/breath.total_moles())*breath_pressure
+ var/plasma_gas = breath.gases[PLASMA]
+ var/Plasma_pp = (plasma_gas/breath.total_moles)*breath_pressure
if(Plasma_pp) // Detect toxins in air
diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm
index 970fef289b4..1bcc955fac5 100644
--- a/code/modules/mob/living/carbon/alien/larva/life.dm
+++ b/code/modules/mob/living/carbon/alien/larva/life.dm
@@ -98,12 +98,12 @@
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
var/breath_moles = 0
- /*if(environment.return_pressure() > ONE_ATMOSPHERE)
+ /*if(environment.pressure > ONE_ATMOSPHERE)
// Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT)
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
else*/
// Not enough air around, take a percentage of what's there to model this properly
- breath_moles = environment.total_moles()*BREATH_PERCENTAGE
+ breath_moles = environment.total_moles*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
@@ -152,11 +152,11 @@
return 0
var/plasma_used = 0
- var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
+ var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
//Partial pressure of the toxins in our breath
- var/plasma_gas = breath.get_moles_by_id(PLASMA)
- var/Plasma_pp = (plasma_gas/breath.total_moles())*breath_pressure
+ var/plasma_gas = breath.gases[PLASMA]
+ var/Plasma_pp = (plasma_gas/breath.total_moles)*breath_pressure
if(Plasma_pp) // Detect toxins in air
diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm
index 2d33533b427..acfa07dce63 100644
--- a/code/modules/mob/living/carbon/brain/life.dm
+++ b/code/modules/mob/living/carbon/brain/life.dm
@@ -72,7 +72,7 @@
proc/handle_environment(datum/gas_mixture/environment)
if(!environment || (flags & INVULNERABLE))
return
- var/environment_heat_capacity = environment.heat_capacity()
+ var/environment_heat_capacity = environment.heat_capacity
if(istype(get_turf(src), /turf/space))
var/turf/heat_turf = get_turf(src)
environment_heat_capacity = heat_turf.heat_capacity
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 803d0d5fc2f..136e7f1b5df 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -165,7 +165,7 @@
del(internal)
else
stat("Internal Atmosphere Info", internal.name)
- stat("Tank Pressure", internal.air_contents.return_pressure())
+ stat("Tank Pressure", internal.air_contents.pressure)
stat("Distribution Pressure", internal.distribute_pressure)
if(mind)
if(mind.changeling)
@@ -1733,4 +1733,4 @@
return .
if(!species)
return null
- return species.default_language ? all_languages[species.default_language] : null
\ No newline at end of file
+ return species.default_language ? all_languages[species.default_language] : null
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index f93b25afa46..d3dfe93ec14 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -550,12 +550,12 @@ var/global/list/organ_damage_overlays = list(
breath = location_as_object.handle_internal_lifeform(src, BREATH_MOLES)
else if(isturf(loc))
var/breath_moles = 0
- /*if(environment.return_pressure() > ONE_ATMOSPHERE)
+ /*if(environment.pressure > ONE_ATMOSPHERE)
// Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT)
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
else*/
// Not enough air around, take a percentage of what's there to model this properly
- breath_moles = environment.total_moles()*BREATH_PERCENTAGE
+ breath_moles = environment.total_moles*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
@@ -600,9 +600,9 @@ var/global/list/organ_damage_overlays = list(
//testing("Plasmaman [src] leakin'. coverflags=[cover_flags]")
// OH FUCK HE LEAKIN'.
// This was OP.
- //environment.adjust(tx = environment.total_moles()*BREATH_PERCENTAGE) // About one breath's worth. (I know we aren't breathing it out, but this should be about the right amount)
+ //environment.adjust(tx = environment.total_moles*BREATH_PERCENTAGE) // About one breath's worth. (I know we aren't breathing it out, but this should be about the right amount)
if(environment)
- if(environment.total_moles() && (environment.get_moles_by_id(OXYGEN) / environment.total_moles()) >= OXYCONCEN_PLASMEN_IGNITION) //how's the concentration doing?
+ if(environment.total_moles && (environment.gases[OXYGEN] / environment.total_moles) >= OXYCONCEN_PLASMEN_IGNITION) //how's the concentration doing?
if(!on_fire)
src << "Your body reacts with the atmosphere and bursts into flame!"
adjust_fire_stacks(0.5)
@@ -640,7 +640,7 @@ var/global/list/organ_damage_overlays = list(
if((status_flags & GODMODE) || (flags & INVULNERABLE))
return 0
- if(!breath || (breath.total_moles() == 0) || suiciding)
+ if(!breath || (breath.total_moles == 0) || suiciding)
if(reagents.has_reagent("inaprovaline"))
return 0
if(suiciding)
@@ -738,7 +738,7 @@ var/global/list/organ_damage_overlays = list(
// 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.return_pressure()
+ var/pressure = environment.pressure
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
if(status_flags & GODMODE) return 1 //godmode
@@ -759,7 +759,7 @@ var/global/list/organ_damage_overlays = list(
else
pressure_alert = -1
- if(environment.get_moles_by_id(PLASMA) > MOLES_PLASMA_VISIBLE)
+ if(environment.gases[PLASMA] > MOLES_PLASMA_VISIBLE)
pl_effects()
return
diff --git a/code/modules/mob/living/carbon/human/plasmaman/species.dm b/code/modules/mob/living/carbon/human/plasmaman/species.dm
index 98d8ebeb1f6..41ee38cd3bf 100644
--- a/code/modules/mob/living/carbon/human/plasmaman/species.dm
+++ b/code/modules/mob/living/carbon/human/plasmaman/species.dm
@@ -122,14 +122,14 @@
var/N2O_emote_min = 0.15
var/plasma_used = 0
var/nitrogen_used = 0
- var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
+ var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
// Partial pressure of plasma
- var/Plasma_pp = (breath.get_moles_by_id(PLASMA)/breath.total_moles())*breath_pressure
+ var/Plasma_pp = (breath.gases[PLASMA]/breath.total_moles)*breath_pressure
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
- var/CO2_pp = (breath.get_moles_by_id(CARBON_DIOXIDE)/breath.total_moles())*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE
+ var/CO2_pp = (breath.gases[CARBON_DIOXIDE]/breath.total_moles)*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE
- var/N2O_pp = (breath.get_moles_by_id(NITROUS_OXIDE)/breath.total_moles())*breath_pressure
+ var/N2O_pp = (breath.gases[NITROUS_OXIDE]/breath.total_moles)*breath_pressure
if(Plasma_pp < safe_plasma_min)
if(prob(20))
@@ -139,7 +139,7 @@
var/ratio = safe_plasma_min/Plasma_pp
H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!)
H.failed_last_breath = 1
- plasma_used = breath.get_moles_by_id(PLASMA)*ratio/6
+ plasma_used = breath.gases[PLASMA]*ratio/6
else
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
H.failed_last_breath = 1
@@ -148,7 +148,7 @@
else // We're in safe limits
H.failed_last_breath = 0
H.adjustOxyLoss(-5)
- plasma_used = breath.get_moles_by_id(PLASMA)/6
+ plasma_used = breath.gases[PLASMA]/6
H.oxygen_alert = 0
breath.adjust_gas(PLASMA, -plasma_used, 0)
@@ -179,7 +179,7 @@
if(prob(20))
spawn(0)
H.emote(pick("giggle", "laugh"))
- breath.adjust_gas(NITROUS_OXIDE, -breath.get_moles_by_id(NITROUS_OXIDE))
+ breath.adjust_gas(NITROUS_OXIDE, -breath.gases[NITROUS_OXIDE])
if( (abs(310.15 - breath.temperature) > 50) && !(M_RESIST_HEAT in H.mutations)) // Hot air hurts :(
if(H.status_flags & GODMODE)
diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm
index 4716cc88b75..4412400289c 100644
--- a/code/modules/mob/living/carbon/metroid/life.dm
+++ b/code/modules/mob/living/carbon/metroid/life.dm
@@ -158,7 +158,7 @@
adjustToxLoss(rand(10,20))
return
- //var/environment_heat_capacity = environment.heat_capacity()
+ //var/environment_heat_capacity = environment.heat_capacity
var/loc_temp = T0C
if(istype(get_turf(src), /turf/space))
//environment_heat_capacity = loc:heat_capacity
diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm
index 2d9ec3d4984..70892cc7aa6 100644
--- a/code/modules/mob/living/carbon/monkey/life.dm
+++ b/code/modules/mob/living/carbon/monkey/life.dm
@@ -253,7 +253,7 @@
var/obj/location_as_object = loc
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
- var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
+ var/breath_moles = environment.total_moles*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
@@ -317,16 +317,16 @@
var/N2O_sleep_min = 5
var/N2O_emote_min = 0.01
var/oxygen_used = 0
- var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
+ var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
//Partial pressure of the O2 in our breath
- var/O2_pp = (breath.get_moles_by_id(OXYGEN)/breath.total_moles())*breath_pressure
+ var/O2_pp = (breath.gases[OXYGEN]/breath.total_moles)*breath_pressure
// Same, but for the toxins
- var/Plasma_pp = (breath.get_moles_by_id(PLASMA)/breath.total_moles())*breath_pressure
+ var/Plasma_pp = (breath.gases[PLASMA]/breath.total_moles)*breath_pressure
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
- var/CO2_pp = (breath.get_moles_by_id(CARBON_DIOXIDE)/breath.total_moles())*breath_pressure
+ var/CO2_pp = (breath.gases[CARBON_DIOXIDE]/breath.total_moles)*breath_pressure
- var/N2O_pp = (breath.get_moles_by_id(NITROUS_OXIDE)/breath.total_moles())*breath_pressure
+ var/N2O_pp = (breath.gases[NITROUS_OXIDE]/breath.total_moles)*breath_pressure
if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20))
@@ -335,7 +335,7 @@
O2_pp = 0.01
var/ratio = safe_oxygen_min/O2_pp
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
- oxygen_used = breath.get_moles_by_id(OXYGEN)*ratio/6
+ oxygen_used = breath.gases[OXYGEN]*ratio/6
oxygen_alert = max(oxygen_alert, 1)
/*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose)
spawn(0) emote("cough")
@@ -345,7 +345,7 @@
oxygen_alert = max(oxygen_alert, 1)*/
else // We're in safe limits
adjustOxyLoss(-5)
- oxygen_used = breath.get_moles_by_id(OXYGEN)/6
+ oxygen_used = breath.gases[OXYGEN]/6
oxygen_alert = 0
breath.adjust_gas(OXYGEN, -oxygen_used)
@@ -366,7 +366,7 @@
co2overloadtime = 0
if(Plasma_pp > safe_toxins_max) // Too much toxins
- var/plasma_level = breath.get_moles_by_id(PLASMA)
+ var/plasma_level = breath.gases[PLASMA]
var/ratio = (plasma_level/safe_toxins_max) * 10
//adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
if(wear_mask)
@@ -409,7 +409,7 @@
if(hat && istype(hat, /obj/item/clothing/head/helmet/space) && uniform && istype(uniform, /obj/item/clothing/monkeyclothes/space))
spaceproof = 1 //quick and dirt cheap. no need for the Life() of monkeys to become as complicated as the Life() of humans. man that's deep.
- var/environment_heat_capacity = environment.heat_capacity()
+ var/environment_heat_capacity = environment.heat_capacity
if(istype(get_turf(src), /turf/space))
var/turf/heat_turf = get_turf(src)
environment_heat_capacity = heat_turf.heat_capacity
@@ -424,7 +424,7 @@
//Account for massive pressure differences
- var/pressure = environment.return_pressure()
+ var/pressure = environment.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/species.dm b/code/modules/mob/living/carbon/species.dm
index 8dcee9a7825..123b17e2abf 100644
--- a/code/modules/mob/living/carbon/species.dm
+++ b/code/modules/mob/living/carbon/species.dm
@@ -180,19 +180,19 @@ var/global/list/whitelisted_species = list("Human")
var/N2O_emote_min = 0.15
var/oxygen_used = 0
var/nitrogen_used = 0
- var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
+ var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
var/vox_oxygen_max = 1 // For vox.
//Partial pressure of the O2 in our breath
- var/O2_pp = (breath.get_moles_by_id(OXYGEN)/breath.total_moles())*breath_pressure
+ var/O2_pp = (breath.gases[OXYGEN]/breath.total_moles)*breath_pressure
// Same, but for the toxins
- var/Plasma_pp = (breath.get_moles_by_id(PLASMA)/breath.total_moles())*breath_pressure
+ var/Plasma_pp = (breath.gases[PLASMA]/breath.total_moles)*breath_pressure
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
- var/CO2_pp = (breath.get_moles_by_id(CARBON_DIOXIDE)/breath.total_moles())*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE
+ var/CO2_pp = (breath.gases[CARBON_DIOXIDE]/breath.total_moles)*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE
// Nitrogen, for Vox.
- var/Nitrogen_pp = (breath.get_moles_by_id(NITROGEN)/breath.total_moles())*breath_pressure
+ var/Nitrogen_pp = (breath.gases[NITROGEN]/breath.total_moles)*breath_pressure
- var/N2O_pp = (breath.get_moles_by_id(NITROUS_OXIDE)/breath.total_moles())*breath_pressure
+ var/N2O_pp = (breath.gases[NITROUS_OXIDE]/breath.total_moles)*breath_pressure
// TODO: Split up into Voxs' own proc.
if(O2_pp < safe_oxygen_min && name != "Vox") // Too little oxygen
@@ -203,7 +203,7 @@ var/global/list/whitelisted_species = list("Human")
var/ratio = safe_oxygen_min/O2_pp
H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!)
H.failed_last_breath = 1
- oxygen_used = breath.get_moles_by_id(OXYGEN)*ratio/6
+ oxygen_used = breath.gases[OXYGEN]*ratio/6
else
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
H.failed_last_breath = 1
@@ -216,7 +216,7 @@ var/global/list/whitelisted_species = list("Human")
var/ratio = safe_oxygen_min/Nitrogen_pp
H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS))
H.failed_last_breath = 1
- nitrogen_used = breath.get_moles_by_id(NITROGEN)*ratio/6
+ nitrogen_used = breath.gases[NITROGEN]*ratio/6
else
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
H.failed_last_breath = 1
@@ -225,7 +225,7 @@ var/global/list/whitelisted_species = list("Human")
else // We're in safe limits
H.failed_last_breath = 0
H.adjustOxyLoss(-5)
- oxygen_used = breath.get_moles_by_id(OXYGEN)/6
+ oxygen_used = breath.gases[OXYGEN]/6
H.oxygen_alert = 0
breath.adjust_gas(OXYGEN, -oxygen_used, 0)
@@ -248,12 +248,12 @@ var/global/list/whitelisted_species = list("Human")
H.co2overloadtime = 0
if(Plasma_pp > safe_plasma_max) // Too much toxins
- var/ratio = (breath.get_moles_by_id(PLASMA)/safe_plasma_max) * 10
+ var/ratio = (breath.gases[PLASMA]/safe_plasma_max) * 10
//adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
if(H.wear_mask)
if(H.wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)
- if(breath.get_moles_by_id(PLASMA) > safe_plasma_mask)
- ratio = (breath.get_moles_by_id(PLASMA)/safe_plasma_mask) * 10
+ if(breath.gases[PLASMA] > safe_plasma_mask)
+ ratio = (breath.gases[PLASMA]/safe_plasma_mask) * 10
else
ratio = 0
if(ratio)
@@ -261,7 +261,7 @@ var/global/list/whitelisted_species = list("Human")
H.reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
H.toxins_alert = max(H.toxins_alert, 1)
else if(O2_pp > vox_oxygen_max && name == "Vox") //Oxygen is toxic to vox.
- var/ratio = (breath.get_moles_by_id(OXYGEN)/vox_oxygen_max) * 1000
+ var/ratio = (breath.gases[OXYGEN]/vox_oxygen_max) * 1000
H.adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
H.toxins_alert = max(H.toxins_alert, 1)
else
@@ -274,7 +274,7 @@ var/global/list/whitelisted_species = list("Human")
else if(N2O_pp > N2O_emote_min) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
spawn(0) H.emote(pick("giggle", "laugh"))
- breath.adjust_gas(NITROUS_OXIDE, -breath.get_moles_by_id(NITROUS_OXIDE)) //purge it
+ breath.adjust_gas(NITROUS_OXIDE, -breath.gases[NITROUS_OXIDE]) //purge it
if( (abs(310.15 - breath.temperature) > 50) && !(M_RESIST_HEAT in H.mutations)) // Hot air hurts :(
if(H.status_flags & GODMODE) return 1 //godmode
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 60b08f25bb8..c2f59e5d003 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -168,7 +168,7 @@
if(istype(T))
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
if(G)
- oxy=G.get_moles_by_id(OXYGEN)
+ oxy=G.gases[OXYGEN]
if(oxy < 1 || fire_stacks <= 0)
ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
return 1
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 147ba6b00e9..0950f43e8ea 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -505,7 +505,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.return_pressure())
+ stat("Tank Pressure", current_jetpack.air_contents.pressure)
// this function returns the robots jetpack, if one is installed
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 b4e28971eb4..6f95fe3600e 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
@@ -68,13 +68,13 @@ var/global/list/spider_types = typesof(/mob/living/simple_animal/hostile/giant_s
if(!istype(lT) || !lT.zone)
return 0
var/datum/gas_mixture/myenv=lT.return_air()
- var/pressure=myenv.return_pressure()
+ var/pressure=myenv.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_air()
- var/pdiff = abs(pressure - environment.return_pressure())
+ var/pdiff = abs(pressure - environment.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 6c834ed7693..d56aa53e885 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -205,41 +205,41 @@
bodytemperature += ((Environment.temperature - bodytemperature) / 5)
if(min_oxy)
- if(Environment.get_moles_by_id(OXYGEN) < min_oxy)
+ if(Environment.gases[OXYGEN] < min_oxy)
atmos_suitable = 0
oxygen_alert = 1
else
oxygen_alert = 0
if(max_oxy)
- if(Environment.get_moles_by_id(OXYGEN) > max_oxy)
+ if(Environment.gases[OXYGEN] > max_oxy)
atmos_suitable = 0
if(min_tox)
- if(Environment.get_moles_by_id(PLASMA) < min_tox)
+ if(Environment.gases[PLASMA] < min_tox)
atmos_suitable = 0
if(max_tox)
- if(Environment.get_moles_by_id(PLASMA) > max_tox)
+ if(Environment.gases[PLASMA] > max_tox)
atmos_suitable = 0
toxins_alert = 1
else
toxins_alert = 0
if(min_n2)
- if(Environment.get_moles_by_id(NITROGEN) < min_n2)
+ if(Environment.gases[NITROGEN] < min_n2)
atmos_suitable = 0
if(max_n2)
- if(Environment.get_moles_by_id(NITROGEN) > max_n2)
+ if(Environment.gases[NITROGEN] > max_n2)
atmos_suitable = 0
if(min_co2)
- if(Environment.get_moles_by_id(CARBON_DIOXIDE) < min_co2)
+ if(Environment.gases[CARBON_DIOXIDE] < min_co2)
atmos_suitable = 0
if(max_co2)
- if(Environment.get_moles_by_id(CARBON_DIOXIDE) > max_co2)
+ if(Environment.gases[CARBON_DIOXIDE] > max_co2)
atmos_suitable = 0
//Atmos effect
@@ -598,4 +598,4 @@
/mob/living/simple_animal/say_understands(var/mob/other,var/datum/language/speaking = null)
if(issilicon(other))
return 1
- return ..()
\ No newline at end of file
+ return ..()
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 704aa76537e..beab61c1a22 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -69,7 +69,7 @@
t += {" Temperature: [environment.temperature] \n"}
for(var/gasid in environment.gases)
var/datum/gas/gas = environment.get_gas_by_id(gasid)
- t += {" [gas.display_name]: [environment.get_moles_by_id(gasid)] \n"}
+ t += {" [gas.display_name]: [environment.gases[gasid]] \n"}
// END AUTOFIX
usr.show_message(t, 1)
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index f5d7344823b..1b83e5e02ba 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -75,8 +75,8 @@
lastgen = 0
if(air1 && air2)
- var/air1_heat_capacity = air1.heat_capacity()
- var/air2_heat_capacity = air2.heat_capacity()
+ var/air1_heat_capacity = air1.heat_capacity
+ var/air2_heat_capacity = air2.heat_capacity
var/delta_temperature = abs(air2.temperature - air1.temperature)
if(delta_temperature > 0 && air1_heat_capacity > 0 && air2_heat_capacity > 0)
@@ -152,14 +152,14 @@
// C:\Users\Rob\Documents\Projects\vgstation13\code\modules\power\generator.dm:142: t += "Output : [round(lastgen)] W
"
t += {"Output : [round(lastgen)] W
Primary Circulator (top or right)
-Inlet Pressure: [round(circ1.air1.return_pressure(), 0.1)] kPa
+Inlet Pressure: [round(circ1.air1.pressure, 0.1)] kPa
Inlet Temperature: [round(circ1.air1.temperature, 0.1)] K
-Outlet Pressure: [round(circ1.air2.return_pressure(), 0.1)] kPa
+Outlet Pressure: [round(circ1.air2.pressure, 0.1)] kPa
Outlet Temperature: [round(circ1.air2.temperature, 0.1)] K
Secondary Circulator (bottom or left)
-Inlet Pressure: [round(circ2.air1.return_pressure(), 0.1)] kPa
+Inlet Pressure: [round(circ2.air1.pressure, 0.1)] kPa
Inlet Temperature: [round(circ2.air1.temperature, 0.1)] K
-Outlet Pressure: [round(circ2.air2.return_pressure(), 0.1)] kPa
+Outlet Pressure: [round(circ2.air2.pressure, 0.1)] kPa
Outlet Temperature: [round(circ2.air2.temperature, 0.1)] K
"}
// END AUTOFIX
else
diff --git a/code/modules/power/generator_type2.dm b/code/modules/power/generator_type2.dm
index 507fb6030f0..10429cf3b48 100644
--- a/code/modules/power/generator_type2.dm
+++ b/code/modules/power/generator_type2.dm
@@ -41,8 +41,8 @@
hot_air = air2
cold_air = air1
- var/hot_air_heat_capacity = hot_air.heat_capacity()
- var/cold_air_heat_capacity = cold_air.heat_capacity()
+ var/hot_air_heat_capacity = hot_air.heat_capacity
+ var/cold_air_heat_capacity = cold_air.heat_capacity
var/delta_temperature = hot_air.temperature - cold_air.temperature
@@ -93,7 +93,7 @@
return {"Cold Loop ([dir2text(loop_dir)])
- Temperature: [round(loop.air_contents.temperature, 0.1)] K
- - Pressure: [round(loop.air_contents.return_pressure(), 0.1)] kPa
+ - Pressure: [round(loop.air_contents.pressure, 0.1)] kPa
"}
/obj/machinery/power/generator/type2/interact(mob/user)
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index f6325cc4846..b15c7123bf3 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -30,9 +30,9 @@ var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector/process()
if (P)
- if (P.air_contents.get_moles_by_id(PLASMA) <= 0)
+ if (P.air_contents.gases[PLASMA] <= 0)
investigation_log(I_SINGULO,"out of fuel.")
- P.air_contents.adjust_gas(PLASMA, -P.air_contents.get_moles_by_id(PLASMA)) //set it to 0
+ P.air_contents.adjust_gas(PLASMA, -P.air_contents.gases[PLASMA]) //set it to 0
eject()
else if(!active)
return
@@ -45,7 +45,7 @@ var/global/list/rad_collectors = list()
toggle_power()
user.visible_message("[user] turns the [src] [active? "on":"off"].", \
"You turn the [src] [active? "on":"off"].")
- investigation_log(I_SINGULO,"turned [active?"on":"off"] by [user.key]. [P?"Fuel: [round(P.air_contents.get_moles_by_id(PLASMA)/0.29)]%":"It is empty"].")
+ investigation_log(I_SINGULO,"turned [active?"on":"off"] by [user.key]. [P?"Fuel: [round(P.air_contents.gases[PLASMA]/0.29)]%":"It is empty"].")
return
else
user << "The controls are locked!"
@@ -127,7 +127,7 @@ var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector/proc/receive_pulse(const/pulse_strength)
if (P && active)
- var/power_produced = P.air_contents.get_moles_by_id(PLASMA) * pulse_strength * 3.5 // original was 20, nerfed to 2 now 3.5 should get you about 500kw
+ var/power_produced = P.air_contents.gases[PLASMA] * pulse_strength * 3.5 // original was 20, nerfed to 2 now 3.5 should get you about 500kw
add_avail(power_produced)
last_power = power_produced
diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm
index 3bb6f289367..afc5d592aca 100644
--- a/code/modules/power/turbine.dm
+++ b/code/modules/power/turbine.dm
@@ -67,7 +67,7 @@
return
rpm = 0.9* rpm + 0.1 * rpmtarget
var/datum/gas_mixture/environment = inturf.return_air()
- var/transfer_moles = environment.total_moles()/10
+ var/transfer_moles = environment.total_moles/10
//var/transfer_moles = rpm/10000*capacity
var/datum/gas_mixture/removed = inturf.remove_air(transfer_moles)
gas_contained.merge(removed)
@@ -123,14 +123,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/pneumatic.dm b/code/modules/projectiles/guns/projectile/pneumatic.dm
index 71f2872ddcc..81f5e4d97fc 100644
--- a/code/modules/projectiles/guns/projectile/pneumatic.dm
+++ b/code/modules/projectiles/guns/projectile/pneumatic.dm
@@ -64,7 +64,7 @@
..()
user << "The valve is dialed to [pressure_setting]%."
if(tank)
- user << "The tank dial reads [tank.air_contents.return_pressure()] kPa."
+ user << "The tank dial reads [tank.air_contents.pressure] kPa."
else
user << "Nothing is attached to the tank valve!"
@@ -114,7 +114,7 @@
if (!istype(targloc) || !istype(curloc))
return
- var/fire_pressure = (tank.air_contents.return_pressure()/100)*pressure_setting
+ var/fire_pressure = (tank.air_contents.pressure/100)*pressure_setting
if (fire_pressure < minimum_tank_pressure)
user << "There isn't enough gas in the tank to fire [src]."
diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm
index 5b4ccfff401..891df36dcd7 100644
--- a/code/modules/projectiles/projectile/special.dm
+++ b/code/modules/projectiles/projectile/special.dm
@@ -195,7 +195,7 @@ obj/item/projectile/kinetic/New()
if(!istype(proj_turf, /turf))
return
var/datum/gas_mixture/environment = proj_turf.return_air()
- var/pressure = environment.return_pressure()
+ var/pressure = environment.pressure
if(pressure < 50)
name = "full strength kinetic force"
damage = 30
diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm
index 2ab374669f8..3bc1e2853f9 100644
--- a/code/modules/reagents/Chemistry-Reagents.dm
+++ b/code/modules/reagents/Chemistry-Reagents.dm
@@ -316,7 +316,7 @@
var/hotspot = (locate(/obj/fire) in T)
if(hotspot && !istype(T, /turf/space))
- var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
+ var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
@@ -328,7 +328,7 @@
var/turf/T = get_turf(O)
var/hotspot = (locate(/obj/fire) in T)
if(hotspot && !istype(T, /turf/space))
- var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
+ var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
@@ -2889,7 +2889,7 @@
T.wet(800)
var/hotspot = (locate(/obj/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/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm
index ee16ca7df04..424d241ce90 100644
--- a/code/modules/reagents/Chemistry-Recipes.dm
+++ b/code/modules/reagents/Chemistry-Recipes.dm
@@ -467,10 +467,8 @@ datum
for(var/turf/simulated/floor/target_tile in range(0,location))
var/datum/gas_mixture/napalm = new
- napalm.set_gas(VOLATILE_FUEL, created_volume, 0)
-
- napalm.temperature = 400+T0C
- napalm.update_values()
+ napalm.set_temperature(400+T0C)
+ napalm.set_gas(VOLATILE_FUEL, created_volume)
target_tile.assume_air(napalm)
spawn (0) target_tile.hotspot_expose(700, 400,surfaces=1)
@@ -2541,4 +2539,4 @@ datum
name = "Tide"
id = "greytea"
result = "greytea"
- required_reagents = list("water" = 5, "fuel" = 5)
+ required_reagents = list("water" = 5, "fuel" = 5)
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 85ce36f28dc..bef779cd7d3 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -216,7 +216,7 @@
/obj/machinery/disposal/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/list/data[0]
- data["pressure"] = round(100 * air_contents.return_pressure() / (SEND_PRESSURE))
+ data["pressure"] = round(100 * air_contents.pressure / (SEND_PRESSURE))
data["flush"] = flush
data["mode"] = mode
data["isAI"] = isAI(user)
@@ -325,7 +325,7 @@
src.updateDialog()
- if(flush && air_contents.return_pressure() >= SEND_PRESSURE ) // flush can happen even without power
+ if(flush && air_contents.pressure >= SEND_PRESSURE ) // flush can happen even without power
spawn(0)
flush()
@@ -343,7 +343,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.return_pressure()
+ var/pressure_delta = (SEND_PRESSURE*1.01) - air_contents.pressure
if(env.temperature > 0)
var/transfer_moles = 0.1 * pressure_delta*air_contents.volume/(env.temperature * R_IDEAL_GAS_EQUATION)
@@ -354,7 +354,7 @@
// if full enough, switch to ready mode
- if(air_contents.return_pressure() >= SEND_PRESSURE)
+ if(air_contents.pressure >= SEND_PRESSURE)
mode = 2
update_icon()
return
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index 7f7e805bf68..7692acb2582 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -113,13 +113,13 @@
var/datum/gas_mixture/env = L.return_air()
if(env.temperature < (heat_amt+T0C))
- var/transfer_moles = 0.25 * env.total_moles()
+ var/transfer_moles = 0.25 * env.total_moles
var/datum/gas_mixture/removed = env.remove(transfer_moles)
if(removed)
- var/heat_capacity = removed.heat_capacity()
+ var/heat_capacity = removed.heat_capacity
if(heat_capacity == 0 || heat_capacity == null)
heat_capacity = 1
removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000)
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
index f463b4be0ab..da2db20e1d6 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
@@ -152,13 +152,13 @@ var/list/valid_secondary_effect_types = list(\
else if(env.temperature > 375)
trigger_hot = 1
- if(env.get_moles_by_id(PLASMA) >= 10)
+ if(env.gases[PLASMA] >= 10)
trigger_plasma = 1
- if(env.get_moles_by_id(OXYGEN) >= 10)
+ if(env.gases[OXYGEN] >= 10)
trigger_oxy = 1
- if(env.get_moles_by_id(CARBON_DIOXIDE) >= 10)
+ if(env.gases[CARBON_DIOXIDE] >= 10)
trigger_co2 = 1
- if(env.get_moles_by_id(NITROGEN) >= 10)
+ if(env.gases[NITROGEN] >= 10)
trigger_nitro = 1
//COLD ACTIVATION
diff --git a/code/modules/research/xenoarchaeology/machinery/analysis_base.dm b/code/modules/research/xenoarchaeology/machinery/analysis_base.dm
index 9967bfeca80..af74f387a21 100644
--- a/code/modules/research/xenoarchaeology/machinery/analysis_base.dm
+++ b/code/modules/research/xenoarchaeology/machinery/analysis_base.dm
@@ -76,8 +76,8 @@
temperature += heat_added/XENOARCH_HEAT_CAPACITY
var/temperature_difference = abs(environmental_temp-temperature)
- var/datum/gas_mixture/removed = env.remove(env.total_moles()*0.25)
- var/heat_capacity = removed.heat_capacity()
+ var/datum/gas_mixture/removed = env.remove(env.total_moles*0.25)
+ var/heat_capacity = removed.heat_capacity
heat_added = max(temperature_difference*heat_capacity, XENOARCH_MAX_ENERGY_TRANSFER)
diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm
index 783a599169e..931691dd77e 100644
--- a/code/modules/supermatter/supermatter.dm
+++ b/code/modules/supermatter/supermatter.dm
@@ -227,7 +227,7 @@
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
//Ok, 100% oxygen atmosphere = best reaction
//Maxes out at 100% oxygen pressure
- oxygen = Clamp((removed.get_moles_by_id(OXYGEN) - (removed.get_moles_by_id(NITROGEN) * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 0, 1)
+ oxygen = Clamp((removed.gases[OXYGEN] - (removed.gases[NITROGEN] * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 0, 1)
var/temp_factor = 100
@@ -253,16 +253,14 @@
//Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock
//is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall.
- removed.temperature += (device_energy / THERMAL_RELEASE_MODIFIER)
+ removed.set_temperature(removed.temperature + (device_energy / THERMAL_RELEASE_MODIFIER))
- removed.temperature = max(0, min(removed.temperature, 2500))
+ removed.set_temperature(Clamp(removed.temperature, 0, 2500))
//Calculate how much gas to release
- removed.adjust_gas(PLASMA, max(device_energy / PLASMA_RELEASE_MODIFIER, 0), 0) //last 0 means don't update yet
+ removed.adjust_gas(PLASMA, max(device_energy / PLASMA_RELEASE_MODIFIER, 0))
- removed.adjust_gas(OXYGEN, max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0), 0)
-
- removed.update_values()
+ removed.adjust_gas(OXYGEN, max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0))
env.merge(removed)