Improves how gas mixture datums are handled, reduces proc calls, commenting. Removed ghost-heating from cryo and "oxygen_agent_b" gas type.

This commit is contained in:
SkyMarshal
2012-04-26 14:08:15 -07:00
parent ded68393ac
commit 15d72e3b0e
47 changed files with 537 additions and 398 deletions

View File

@@ -25,7 +25,7 @@
return null
//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 = (input_starting_pressure - output_starting_pressure)/2
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)

View File

@@ -37,7 +37,7 @@ obj/machinery/atmospherics/binary/passive_gate
return 1
//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 = (input_starting_pressure - output_starting_pressure)/2
//Can not have a pressure delta that would cause output_pressure > input_pressure

View File

@@ -65,7 +65,7 @@ obj/machinery/atmospherics/binary/pump
return 1
//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)

View File

@@ -86,12 +86,6 @@ Filter types:
filtered_out.toxins = removed.toxins
removed.toxins = 0
if(removed.trace_gases.len>0)
for(var/datum/gas/trace_gas in removed.trace_gases)
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
removed.trace_gases -= trace_gas
filtered_out.trace_gases += trace_gas
if(1) //removing O2
filtered_out.oxygen = removed.oxygen
removed.oxygen = 0
@@ -115,6 +109,7 @@ Filter types:
filtered_out = null
filtered_out.update_values()
air2.merge(filtered_out)
air3.merge(removed)

View File

@@ -51,8 +51,8 @@ obj/machinery/atmospherics/trinary/mixer
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

View File

@@ -33,7 +33,7 @@ obj/machinery/atmospherics/unary/oxygen_generator
if(!on)
return 0
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()

View File

@@ -25,18 +25,18 @@
//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)
@@ -61,7 +61,7 @@
proc/radiate()
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)

View File

@@ -98,7 +98,7 @@
if(scrubbing)
if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
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)
@@ -117,15 +117,13 @@
if(removed.trace_gases.len>0)
for(var/datum/gas/trace_gas in removed.trace_gases)
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
removed.trace_gases -= trace_gas
filtered_out.trace_gases += trace_gas
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
removed.trace_gases -= trace_gas
filtered_out.trace_gases += trace_gas
//Remix the resulting gases
filtered_out.update_values()
air_contents.merge(filtered_out)
loc.assume_air(removed)
@@ -137,7 +135,7 @@
if (air_contents.return_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)

View File

@@ -92,8 +92,9 @@ datum/pipe_network
for(var/datum/gas_mixture/gas in gases)
air_transient.volume += gas.volume
total_thermal_energy += gas.thermal_energy()
total_heat_capacity += gas.heat_capacity()
var/temp_heatcap = gas.heat_capacity()
total_thermal_energy += gas.temperature*temp_heatcap
total_heat_capacity += temp_heatcap
air_transient.oxygen += gas.oxygen
air_transient.nitrogen += gas.nitrogen
@@ -157,8 +158,9 @@ proc/equalize_gases(datum/gas_mixture/list/gases)
for(var/datum/gas_mixture/gas in gases)
total_volume += gas.volume
total_thermal_energy += gas.thermal_energy()
total_heat_capacity += gas.heat_capacity()
var/temp_heatcap = gas.heat_capacity()
total_thermal_energy += gas.temperature*temp_heatcap
total_heat_capacity += temp_heatcap
total_oxygen += gas.oxygen
total_nitrogen += gas.nitrogen

View File

@@ -381,22 +381,6 @@ obj/machinery/atmospherics/pipe
..()
oxygen_agent_b
icon = 'red_orange_pipe_tank.dmi'
name = "Pressure Tank (Oxygen + Plasma)"
New()
air_temporary = new
air_temporary.volume = volume
air_temporary.temperature = T0C
var/datum/gas/oxygen_agent_b/trace_gas = new
trace_gas.moles = (25*ONE_ATMOSPHERE)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)
air_temporary.trace_gases += trace_gas
..()
oxygen
icon = 'blue_pipe_tank.dmi'
name = "Pressure Tank (Oxygen)"
@@ -599,7 +583,7 @@ obj/machinery/atmospherics/pipe
O << "\red [user] has used the analyzer on \icon[icon]"
var/pressure = parent.air.return_pressure()
var/total_moles = parent.air.total_moles()
var/total_moles = parent.air.total_moles
user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)

View File

@@ -441,6 +441,7 @@ turf/simulated
trace_gas.moles = amount
adding.trace_gases += trace_gas
adding.temperature = T20C
adding.update_values()
assume_air(adding)
@@ -474,7 +475,7 @@ obj/indicator
return "error"
return "[round(GM.nitrogen/MOLES_CELLSTANDARD*10+0.5)]"
else
return "[round((GM.total_moles())/MOLES_CELLSTANDARD*10+0.5)]"
return "[round((GM.total_moles)/MOLES_CELLSTANDARD*10+0.5)]"
Click()

View File

@@ -14,13 +14,10 @@ What are the archived variables for?
#define QUANTIZE(variable) (round(variable,0.0001))
datum
gas
gas //These are used for the "Trace Gases" stuff, but is buggy.
sleeping_agent
specific_heat = 40
oxygen_agent_b
specific_heat = 300
volatile_fuel
specific_heat = 30
@@ -31,11 +28,12 @@ datum
moles_archived = 0
gas_mixture
var
var //Holds the "moles" of each of the four gases.
oxygen = 0
carbon_dioxide = 0
nitrogen = 0
toxins = 0
total_moles = 0 //Updated when a reaction occurs.
volume = CELL_VOLUME
@@ -47,9 +45,9 @@ datum
graphic
list/datum/gas/trace_gases = list()
list/datum/gas/trace_gases = list() //Seemed to be a good idea that was abandoned
tmp
tmp //These are variables for use with the archived data
oxygen_archived
carbon_dioxide_archived
nitrogen_archived
@@ -59,9 +57,17 @@ datum
graphic_archived
fuel_burnt = 0
///////////////////////////////
//PV=nRT - related procedures//
///////////////////////////////
proc/heat_capacity()
//Purpose: Returning the heat capacity of the gas mix
//Called by: UNKNOWN
//Inputs: None
//Outputs: Heat capacity
proc //PV=nRT - related procedures
heat_capacity()
var/heat_capacity = HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins)
if(trace_gases.len)
@@ -70,7 +76,12 @@ datum
return heat_capacity
heat_capacity_archived()
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 = HEAT_CAPACITY_CALCULATION(oxygen_archived,carbon_dioxide_archived,nitrogen_archived,toxins_archived)
if(trace_gases.len)
@@ -79,32 +90,61 @@ datum
return heat_capacity_archived
total_moles()
var/moles = oxygen + carbon_dioxide + nitrogen + toxins
proc/return_pressure()
//Purpose: Calculating Current Pressure
//Called by:
//Inputs: None
//Outputs: Gas pressure.
if(volume>0)
return total_moles*R_IDEAL_GAS_EQUATION*temperature/volume
return 0
// 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()
proc/update_values()
//Purpose: Calculating and storing values which were normally called CONSTANTLY
//Called by: Anything that changes values within a gas mix.
//Inputs: None
//Outputs: None
total_moles = oxygen + carbon_dioxide + nitrogen + toxins
if(trace_gases.len)
for(var/datum/gas/trace_gas in trace_gases)
moles += trace_gas.moles
total_moles += trace_gas.moles
return
return moles
////////////////////////////////////////////
//Procedures used for very specific events//
////////////////////////////////////////////
return_pressure()
if(volume>0)
return total_moles()*R_IDEAL_GAS_EQUATION*temperature/volume
return 0
return_temperature()
return temperature
proc/check_tile_graphic()
//Purpose: Calculating the graphic for a tile
//Called by: Turfs updating
//Inputs: None
//Outputs: 1 if graphic changed, 0 if unchanged
return_volume()
return max(0, volume)
thermal_energy()
return temperature*heat_capacity()
proc //Procedures used for very specific events
check_tile_graphic()
//returns 1 if graphic changed
graphic = null
if(toxins > MOLES_PLASMA_VISIBLE)
graphic = "plasma"
@@ -117,39 +157,30 @@ datum
return graphic != graphic_archived
react(atom/dump_location)
proc/react(atom/dump_location)
//Purpose: Calculating if it is possible for a fire to occur in the airmix
//Called by: Air mixes updating?
//Inputs: None
//Outputs: If a fire occured
var/reacting = 0 //set to 1 if a notable reaction occured (used by pipe_network)
if(trace_gases.len > 0)
if(temperature > 900)
if(toxins > MINIMUM_HEAT_CAPACITY && carbon_dioxide > MINIMUM_HEAT_CAPACITY)
var/datum/gas/oxygen_agent_b/trace_gas = locate(/datum/gas/oxygen_agent_b/) in trace_gases
if(trace_gas)
var/reaction_rate = min(carbon_dioxide*0.75, toxins*0.25, trace_gas.moles*0.05)
carbon_dioxide -= reaction_rate
oxygen += reaction_rate
trace_gas.moles -= reaction_rate*0.05
temperature -= (reaction_rate*20000)/heat_capacity()
reacting = 1
fuel_burnt = 0
if(temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
//world << "pre [temperature], [oxygen], [toxins]"
if(fire() > 0)
reacting = 1
//world << "post [temperature], [oxygen], [toxins]"
return reacting
fire()
proc/fire()
//Purpose: Calculating any fire reactions.
//Called by: react() (See above)
//Inputs: None
//Outputs: How much fuel burned
var/energy_released = 0
var/old_heat_capacity = heat_capacity()
var/datum/gas/volatile_fuel/fuel_store = locate(/datum/gas/volatile_fuel/) in trace_gases
var/datum/gas/volatile_fuel/fuel_store = locate(/datum/gas/volatile_fuel) in trace_gases
if(fuel_store) //General volatile gas burn
var/burned_fuel = 0
@@ -195,91 +226,21 @@ datum
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()
return fuel_burnt
proc
archive()
//Update archived versions of variables
//Returns: 1 in all cases
merge(datum/gas_mixture/giver)
//Merges all air from giver into self. Deletes giver.
//Returns: 1 on success (no failure cases yet)
check_then_merge(datum/gas_mixture/giver)
//Similar to merge(...) but first checks to see if the amount of air assumed is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: 1 on successful merge, 0 if the check failed
remove(amount)
//Proportionally removes amount of gas from the gas_mixture
//Returns: gas_mixture with the gases removed
remove_ratio(ratio)
//Proportionally removes amount of gas from the gas_mixture
//Returns: gas_mixture with the gases removed
subtract(datum/gas_mixture/right_side)
//Subtracts right_side from air_mixture. Used to help turfs mingle
check_then_remove(amount)
//Similar to remove(...) but first checks to see if the amount of air removed is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: gas_mixture with the gases removed or null
copy_from(datum/gas_mixture/sample)
//Copies variables from sample
share(datum/gas_mixture/sharer)
//Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length
//Return: amount of gas exchanged (+ if sharer received)
mimic(turf/model)
//Similar to share(...), except the model is not modified
//Return: amount of gas exchanged
check_gas_mixture(datum/gas_mixture/sharer)
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if both checks pass
check_turf(turf/model)
//Returns: 0 if self-check failed or 1 if check passes
// check_me_then_share(datum/gas_mixture/sharer)
//Similar to share(...) but first checks to see if amount of air moved is small enough
// that group processing is still accurate for source (aborts if not)
//Returns: 1 on successful share, 0 if the check failed
// check_me_then_mimic(turf/model)
//Similar to mimic(...) but first checks to see if amount of air moved is small enough
// that group processing is still accurate (aborts if not)
//Returns: 1 on successful mimic, 0 if the check failed
// check_both_then_share(datum/gas_mixture/sharer)
//Similar to check_me_then_share(...) but also checks to see if amount of air moved is small enough
// that group processing is still accurate for the sharer (aborts if not)
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if successful share
//////////////////////////////////////////////
//Procs for general gas spread calculations.//
//////////////////////////////////////////////
temperature_mimic(turf/model, conduction_coefficient)
proc/archive()
//Purpose: Archives the current gas values
//Called by: UNKNOWN
//Inputs: None
//Outputs: 1
temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
check_me_then_temperature_mimic(turf/model, conduction_coefficient)
check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
compare(datum/gas_mixture/sample)
//Compares sample to self to see if within acceptable ranges that group processing may be enabled
archive()
oxygen_archived = oxygen
carbon_dioxide_archived = carbon_dioxide
nitrogen_archived = nitrogen
@@ -295,7 +256,13 @@ datum
return 1
check_then_merge(datum/gas_mixture/giver)
proc/check_then_merge(datum/gas_mixture/giver)
//Purpose: Similar to merge(...) but first checks to see if the amount of air assumed is small enough
// that group processing is still accurate for source (aborts if not)
//Called by: airgroups/machinery expelling air, ?
//Inputs: The gas to try and merge
//Outputs: 1 on successful merge. 0 otherwise.
if(!giver)
return 0
if(((giver.oxygen > MINIMUM_AIR_TO_SUSPEND) && (giver.oxygen >= oxygen*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
@@ -314,7 +281,12 @@ datum
return merge(giver)
merge(datum/gas_mixture/giver)
proc/merge(datum/gas_mixture/giver)
//Purpose: Merges all air from giver into self. Deletes giver.
//Called by: Machinery expelling air, check_then_merge, ?
//Inputs: The gas to merge.
//Outputs: 1
if(!giver)
return 0
@@ -343,13 +315,18 @@ datum
corresponding = new trace_gas.type()
trace_gases += corresponding
corresponding.moles += trace_gas.moles*giver.group_multiplier/group_multiplier
update_values()
del(giver)
return 1
remove(amount)
proc/remove(amount)
//Purpose: Removes a certain number of moles from the air.
//Called by: ?
//Inputs: How many moles to remove.
//Outputs: Removed air.
var/sum = total_moles()
var/sum = total_moles
amount = min(amount,sum) //Can not take more air than tile has!
if(amount <= 0)
return null
@@ -376,10 +353,16 @@ datum
trace_gas.moles -= corresponding.moles/group_multiplier
removed.temperature = temperature
update_values()
removed.update_values()
return removed
remove_ratio(ratio)
proc/remove_ratio(ratio)
//Purpose: Removes a certain ratio of the air.
//Called by: ?
//Inputs: Percentage to remove.
//Outputs: Removed air.
if(ratio <= 0)
return null
@@ -407,25 +390,36 @@ datum
trace_gas.moles -= corresponding.moles/group_multiplier
removed.temperature = temperature
update_values()
removed.update_values()
return removed
check_then_remove(amount)
proc/check_then_remove(amount)
//Purpose: Similar to remove(...) but first checks to see if the amount of air removed is small enough
// that group processing is still accurate for source (aborts if not)
//Called by: ?
//Inputs: Number of moles to remove
//Outputs: Removed air or 0 if it can remove air or not.
//Since it is all proportional, the check may be done on the gas as a whole
var/sum = total_moles()
amount = min(amount,sum) //Can not take more air than tile has!
amount = min(amount,total_moles) //Can not take more air than tile has!
if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > sum*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)
copy_from(datum/gas_mixture/sample)
proc/copy_from(datum/gas_mixture/sample)
//Purpose: Duplicates the sample air mixture.
//Called by: airgroups splitting, ?
//Inputs: Gas to copy
//Outputs: 1
oxygen = sample.oxygen
carbon_dioxide = sample.carbon_dioxide
nitrogen = sample.nitrogen
toxins = sample.toxins
total_moles = sample.total_moles
trace_gases.len=null
if(sample.trace_gases.len > 0)
@@ -439,43 +433,14 @@ datum
return 1
subtract(datum/gas_mixture/right_side)
oxygen -= right_side.oxygen
carbon_dioxide -= right_side.carbon_dioxide
nitrogen -= right_side.nitrogen
toxins -= right_side.toxins
proc/check_gas_mixture(datum/gas_mixture/sharer)
//Purpose: Telling if one or both airgroups needs to disable group processing.
//Called by: Airgroups sharing air, checking if group processing needs disabled.
//Inputs: Gas to compare from other airgroup
//Outputs: 0 if the self-check failed (local airgroup breaks?)
// then -1 if sharer-check failed (sharing airgroup breaks?)
// then 1 if both checks pass (share succesful?)
if((trace_gases.len > 0)||(right_side.trace_gases.len > 0))
for(var/datum/gas/trace_gas in right_side.trace_gases)
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
if(!corresponding)
corresponding = new trace_gas.type()
trace_gases += corresponding
corresponding.moles -= trace_gas.moles
return 1
/* check_me_then_share(datum/gas_mixture/sharer)
var/delta_oxygen = (oxygen_archived - sharer.oxygen_archived)/5
var/delta_carbon_dioxide = (carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
var/delta_nitrogen = (nitrogen_archived - sharer.nitrogen_archived)/5
var/delta_toxins = (toxins_archived - sharer.toxins_archived)/5
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
if(((abs(delta_oxygen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_oxygen) >= oxygen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_carbon_dioxide) >= carbon_dioxide_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_nitrogen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_nitrogen) >= nitrogen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|| ((abs(delta_toxins) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_toxins) >= toxins_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)))
return 0
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
return 0
return share(sharer)*/
check_gas_mixture(datum/gas_mixture/sharer)
if(!sharer) return 0
var/delta_oxygen = (oxygen_archived - sharer.oxygen_archived)/5
var/delta_carbon_dioxide = (carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
var/delta_nitrogen = (nitrogen_archived - sharer.nitrogen_archived)/5
@@ -526,7 +491,12 @@ datum
return 1
check_turf(turf/model)
proc/check_turf(turf/model)
//Purpose: Used to compare the gases in an unsimulated turf with the gas in a simulated one.
//Called by: Sharing air (mimicing) with adjacent unsimulated turfs
//Inputs: Unsimulated turf
//Outputs: 1 if safe to mimic, 0 if needs to break airgroup.
var/delta_oxygen = (oxygen_archived - model.oxygen)/5
var/delta_carbon_dioxide = (carbon_dioxide_archived - model.carbon_dioxide)/5
var/delta_nitrogen = (nitrogen_archived - model.nitrogen)/5
@@ -549,7 +519,13 @@ datum
return 1
share(datum/gas_mixture/sharer)
proc/share(datum/gas_mixture/sharer)
//Purpose: Used to transfer gas from a more pressurised tile to a less presurised tile
// (Two directional, if the other tile is more pressurised, air travels to current tile)
//Called by: Sharing air with adjacent simulated turfs
//Inputs: Air datum to share with
//Outputs: Amount of gas exchanged (Negative if lost air, positive if gained.)
if(!sharer) return 0
var/delta_oxygen = QUANTIZE(oxygen_archived - sharer.oxygen_archived)/5
var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
@@ -667,6 +643,8 @@ datum
heat_capacity_sharer_to_self += individual_heat_capacity
moved_moles += -delta
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
@@ -683,13 +661,18 @@ datum
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
return 0
mimic(turf/model, border_multiplier)
proc/mimic(turf/model, border_multiplier)
//Purpose: Used transfer gas from a more pressurised tile to a less presurised unsimulated tile.
//Called by: "sharing" from unsimulated to simulated turfs.
//Inputs: Unsimulated turf, Multiplier for gas transfer (optional)
//Outputs: Amount of gas exchanged
var/delta_oxygen = QUANTIZE(oxygen_archived - model.oxygen)/5
var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - model.carbon_dioxide)/5
var/delta_nitrogen = QUANTIZE(nitrogen_archived - model.nitrogen)/5
@@ -749,6 +732,7 @@ datum
heat_transferred += heat_cap_transferred*temperature_archived
heat_capacity_transferred += heat_cap_transferred
moved_moles += delta
update_values()
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
var/new_self_heat_capacity = old_self_heat_capacity - heat_capacity_transferred
@@ -761,12 +745,12 @@ datum
temperature_mimic(model, model.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.oxygen+model.carbon_dioxide+model.nitrogen+model.toxins)
var/delta_pressure = temperature_archived*(total_moles + moved_moles) - model.temperature*(model.oxygen+model.carbon_dioxide+model.nitrogen+model.toxins)
return delta_pressure*R_IDEAL_GAS_EQUATION/volume
else
return 0
check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
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()
@@ -798,7 +782,7 @@ datum
return 1
//Logic integrated from: temperature_share(sharer, conduction_coefficient) for efficiency
check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
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()
@@ -826,7 +810,7 @@ datum
return 1
//Logic integrated from: temperature_share(sharer, conduction_coefficient) for efficiency
check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
proc/check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
var/delta_temperature = (temperature_archived - sharer.temperature)
var/self_temperature_delta = 0
@@ -854,7 +838,7 @@ datum
return 1
//Logic integrated from: temperature_turf_share(sharer, conduction_coefficient) for efficiency
check_me_then_temperature_mimic(turf/model, conduction_coefficient)
proc/check_me_then_temperature_mimic(turf/model, conduction_coefficient)
var/delta_temperature = (temperature_archived - model.temperature)
var/self_temperature_delta = 0
@@ -876,7 +860,7 @@ datum
return 1
//Logic integrated from: temperature_mimic(model, conduction_coefficient) for efficiency
temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
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)
@@ -890,7 +874,7 @@ datum
temperature -= heat/(self_heat_capacity*group_multiplier)
sharer.temperature += heat/(sharer_heat_capacity*sharer.group_multiplier)
temperature_mimic(turf/model, conduction_coefficient, border_multiplier)
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()
@@ -906,7 +890,7 @@ datum
else
temperature -= heat/(self_heat_capacity*group_multiplier)
temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
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()
@@ -918,7 +902,12 @@ datum
temperature -= heat/(self_heat_capacity*group_multiplier)
sharer.temperature += heat/sharer.heat_capacity
compare(datum/gas_mixture/sample)
proc/compare(datum/gas_mixture/sample)
//Purpose: Compares sample to self to see if within acceptable ranges that group processing may be enabled
//Called by: Airgroups trying to rebuild
//Inputs: Gas mix to compare
//Outputs: 1 if can rebuild, 0 if not.
if((abs(oxygen-sample.oxygen) > MINIMUM_AIR_TO_SUSPEND) && \
((oxygen < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.oxygen) || (oxygen > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.oxygen)))
return 0
@@ -932,7 +921,7 @@ datum
((toxins < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.toxins) || (toxins > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.toxins)))
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]"
@@ -960,3 +949,26 @@ datum
else
return 0
return 1
proc/subtract(datum/gas_mixture/right_side)
//Purpose: Subtracts right_side from air_mixture. Used to help turfs mingle
//Called by: Pipelines ending in a break (or something)
//Inputs: Gas mix to remove
//Outputs: 1
oxygen -= right_side.oxygen
carbon_dioxide -= right_side.carbon_dioxide
nitrogen -= right_side.nitrogen
toxins -= right_side.toxins
if((trace_gases.len > 0)||(right_side.trace_gases.len > 0))
for(var/datum/gas/trace_gas in right_side.trace_gases)
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
if(!corresponding)
corresponding = new trace_gas.type()
trace_gases += corresponding
corresponding.moles -= trace_gas.moles
update_values()
return 1

View File

@@ -147,7 +147,7 @@ datum
setup()
set background = 1
world << "\red \b Processing Geometry..."
sleep(1)
sleep(-1)
var/start_time = world.timeofday

View File

@@ -25,6 +25,7 @@ turf
GM.toxins = toxins
GM.temperature = temperature
GM.update_values()
return GM
@@ -39,6 +40,7 @@ turf
GM.toxins = (toxins/sum)*amount
GM.temperature = temperature
GM.update_values()
return GM
@@ -149,6 +151,7 @@ turf
air.toxins = toxins
air.temperature = temperature
air.update_values()
if(air_master)
air_master.tiles_to_update.Add(src)
@@ -189,7 +192,7 @@ turf
parent.suspend_group_processing()
air.merge(giver)
else
if (giver.total_moles() > MINIMUM_AIR_TO_SUSPEND)
if (giver.total_moles > MINIMUM_AIR_TO_SUSPEND)
reset_delay()
air.merge(giver)
@@ -239,7 +242,6 @@ turf
if(!processing)
if(air.check_tile_graphic())
update_visuals(air)
return removed
else

View File

@@ -161,6 +161,8 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
plasma_captured.toxins = round(gas_covered.toxins * transfer_ratio)
plasma_captured.temperature = gas_covered.temperature
gas_covered.toxins -= plasma_captured.toxins
plasma_captured.update_values()
gas_covered.update_values()
held_plasma.merge(plasma_captured)
//
environment.merge(gas_covered)
@@ -302,7 +304,9 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
plasma_lost.temperature = held_plasma.temperature
//
plasma_lost.toxins = held_plasma.toxins * loss_ratio
plasma_lost.update_values()
held_plasma.toxins -= held_plasma.toxins * loss_ratio
held_plasma.update_values()
//
environment.merge(plasma_lost)
radiation += loss_ratio * mega_energy * 0.1
@@ -310,6 +314,7 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
return 1
else
held_plasma.toxins = 0
held_plasma.update_values()
return 0
//the !!fun!! part

View File

@@ -0,0 +1,120 @@
#define NITROGEN_RETARDATION_FACTOR 4 //Higher == N2 slows reaction more
#define THERMAL_RELEASE_MODIFIER 50 //Higher == less heat released during reaction
#define PLASMA_RELEASE_MODIFIER 750 //Higher == less plasma released by reaction
#define OXYGEN_RELEASE_MODIFIER 1500 //Higher == less oxygen released at high temperature/power
#define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power
/obj/machinery/engine/supermatter
name = "Supermatter"
desc = "A strangely translucent and iridescent crystal. \red You get headaches just from looking at it."
icon = 'engine.dmi'
icon_state = "darkmatter"
density = 1
anchored = 1
var/gasefficency = 0.25
var/det = 0
var/previousdet = 0
var/const/explosiondet = 3500
var/const/warningtime = 50 // Make the CORE OVERLOAD message repeat only every aprox. ?? seconds
var/lastwarning = 0 // Time in 1/10th of seconds since the last sent warning
/obj/machinery/engine/klaxon
name = "Emergency Klaxon"
icon = 'engine.dmi'
icon_state = "darkmatter"
density = 1
anchored = 1
var/obj/machinery/engine/supermatter/sup
/obj/machinery/engine/klaxon/process()
if(!sup)
for(var/obj/machinery/engine/supermatter/T in world)
sup = T
break
if(sup.det >= 1)
return
/obj/machinery/engine/supermatter/process()
var/turf/simulated/L = loc
//Ok, get the air from the turf
var/datum/gas_mixture/env = L.return_air()
//Remove gas from surrounding area
var/transfer_moles = gasefficency * env.total_moles
var/datum/gas_mixture/removed = env.remove(transfer_moles)
previousdet = det
det += (removed.temperature - 1000) / 150
det = max(det, 0)
if(det > 0 && removed.temperature > 1000) // while the core is still damaged and it's still worth noting its status
if((world.realtime - lastwarning) / 10 >= warningtime)
lastwarning = world.realtime
if(explosiondet - det <= 300)
radioalert("CORE EXPLOSION IMMINENT","Core control computer")
else if(det >= previousdet) // The damage is still going up
radioalert("CORE OVERLOAD","Core control computer")
else // Phew, we're safe
radioalert("Core returning to safe operating levels.","Core control computer")
if(det > explosiondet)
roundinfo.core = 1
//proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, force = 0)
explosion(src.loc,8,15,20,30,1)
det = 0
if (!removed)
return 1
var/power = max(round((removed.temperature - T0C) / 20), 0) //Total laser power plus an overload factor
//Get the collective laser power
for(var/dir in cardinal)
var/turf/T = get_step(L, dir)
for(var/obj/effect/beam/e_beam/item in T)
power += item.power
//Ok, 100% oxygen atmosphere = best reaction
//Maxes out at 100% oxygen pressure
var/oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0)
var/device_energy = oxygen * power
device_energy *= removed.temperature / T0C
device_energy = round(device_energy * REACTION_POWER_MODIFIER)
//To figure out how much temperature to add each tick, consider that at one atmosphere's worth
//of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature
//that the device energy is around 2140. At that stage, we don't want too much heat to be put out
//Since the core is effectively "cold"
//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 += max((device_energy / THERMAL_RELEASE_MODIFIER), 0)
removed.temperature = min(removed.temperature, 1500)
//Calculate how much gas to release
removed.toxins += max(round(device_energy / PLASMA_RELEASE_MODIFIER), 0)
removed.oxygen += max(round((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER), 0)
env.merge(removed)
//Not functional currently. -- SkyMarshal
/*
for(var/mob/living/carbon/l in view(src, 6)) // you have to be seeing the core to get hallucinations
if(prob(10) && !(l.glasses && istype(l.glasses, /obj/item/clothing/glasses/meson)))
l.hallucination = 50
*/
for(var/mob/living/l in view(src,3))
l.bruteloss += 50
l.updatehealth()
return 1

View File

@@ -301,6 +301,7 @@
napalm.toxins = toxinsToDeduce
napalm.temperature = 400+T0C
napalm.update_values()
target_tile.assume_air(napalm)
spawn (0) target_tile.hotspot_expose(temperature, 400)

View File

@@ -311,7 +311,7 @@ ________________________________________________________________________________
var/datum/gas_mixture/environment = T.return_air()
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles()
var/total_moles = environment.total_moles
dat += "Air Pressure: [round(pressure,0.1)] kPa"

View File

@@ -40,7 +40,7 @@ obj/machinery/air_sensor
signal.data["temperature"] = round(air_sample.temperature,0.1)
if(output>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.oxygen/total_moles,0.1)

View File

@@ -15,6 +15,7 @@
air_contents.volume = volume
air_contents.temperature = T20C
air_contents.update_values()
return 1
@@ -110,7 +111,7 @@
O << "\red [user] has used [W] on \icon[icon]"
if(air_contents)
var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles()
var/total_moles = air_contents.total_moles
user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)

View File

@@ -56,7 +56,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
@@ -83,12 +83,7 @@
if(istype(trace_gas, /datum/gas/sleeping_agent))
removed.trace_gases -= trace_gas
filtered_out.trace_gases += trace_gas
if(removed.trace_gases.len>0)
for(var/datum/gas/trace_gas in removed.trace_gases)
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
removed.trace_gases -= trace_gas
filtered_out.trace_gases += trace_gas
filtered_out.update_values()
//Remix the resulting gases
air_contents.merge(filtered_out)

View File

@@ -44,7 +44,7 @@
if(air_contents)
temperature_archived = air_contents.temperature
heat_gas_contents()
// heat_gas_contents()
expel_gas()
if(abs(temperature_archived-air_contents.temperature) > 1)
@@ -156,7 +156,7 @@
add_overlays()
process_occupant()
if(air_contents.total_moles() < 10)
if(air_contents.total_moles < 10)
return
if(occupant)
if(occupant.stat == 2)
@@ -185,22 +185,24 @@
if(next_trans == 10)
next_trans = 0
heat_gas_contents()
if(air_contents.total_moles() < 1)
return
var/air_heat_capacity = air_contents.heat_capacity()
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
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
//Fucking ghost-heating.
// heat_gas_contents()
// if(air_contents.total_moles < 1)
// return
// var/air_heat_capacity = air_contents.heat_capacity()
// var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
// 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
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()/100
var/remove_amount = air_contents.total_moles/100
expel_gas = air_contents.remove(remove_amount)
expel_gas.temperature = T20C // Lets expel hot gas and see if that helps people not die as they are removed
expel_gas.update_values()
loc.assume_air(expel_gas)
go_out()

View File

@@ -208,7 +208,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)

View File

@@ -166,7 +166,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)

View File

@@ -205,7 +205,7 @@
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)

View File

@@ -853,8 +853,9 @@
destroy()
else
GM.toxins += 5
GM.temperature = istype(T) ? T.air.return_temperature() : T20C
GM.temperature = istype(T) ? T.air.temperature : T20C
T.visible_message("The [src] suddenly disgorges a cloud of plasma.")
GM.update_values()
T.assume_air(GM)
return

View File

@@ -121,6 +121,7 @@
cabin_air.volume = 200
cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
cabin_air.update_values()
return cabin_air
/obj/mecha/proc/add_radio()
@@ -847,11 +848,11 @@
/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/portables_connector/new_port)
@@ -1665,7 +1666,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
@@ -1683,8 +1684,8 @@
var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
var/transfer_moles = 0
if(pressure_delta > 0) //cabin pressure lower than release pressure
if(tank_air.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*max(0, 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
@@ -1693,7 +1694,7 @@
if(t_air)
pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
if(pressure_delta > 0) //if location pressure is lower than cabin pressure
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
transfer_moles = pressure_delta*max(0, 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)
@@ -1726,12 +1727,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

View File

@@ -331,7 +331,7 @@
var/datum/gas_mixture/environment = T.return_air()
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles()
var/total_moles = environment.total_moles
dat += "Air Pressure: [round(pressure,0.1)] kPa<br>"

View File

@@ -369,7 +369,7 @@ MASS SPECTROMETER
var/datum/gas_mixture/environment = location.return_air()
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles()
var/total_moles = environment.total_moles
user.show_message("\blue <B>Results:</B>", 1)
if(abs(pressure - ONE_ATMOSPHERE) < 10)

View File

@@ -133,7 +133,7 @@
for (var/mob/O in viewers(user, null))
O << "\red [user] has used the analyzer on \icon[icon]"
var/pressure = src.ptank.air_contents.return_pressure()
var/total_moles = src.ptank.air_contents.total_moles()
var/total_moles = src.ptank.air_contents.total_moles
user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)

View File

@@ -234,6 +234,7 @@
napalm.toxins = toxinsToDeduce
napalm.temperature = 400+T0C
napalm.update_values()
target_tile.assume_air(napalm)
spawn (0) target_tile.hotspot_expose(temperature, 400)

View File

@@ -210,7 +210,7 @@
var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles()
var/total_moles = air_contents.total_moles
user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)
@@ -244,6 +244,7 @@
src.air_contents = new /datum/gas_mixture()
src.air_contents.volume = volume //liters
src.air_contents.temperature = T20C
air_contents.update_values()
processing_objects.Add(src)
@@ -258,6 +259,7 @@
..()
/obj/item/weapon/tank/examine()
set src in oview()
var/obj/icon = src
if (istype(src.loc, /obj/item/assembly))
icon = src.loc
@@ -290,6 +292,7 @@
src.air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
src.air_contents.nitrogen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
air_contents.update_values()
return
@@ -302,17 +305,19 @@
trace_gas.moles = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
src.air_contents.trace_gases += trace_gas
air_contents.update_values()
return
/obj/item/weapon/tank/plasma/New()
..()
src.air_contents.toxins = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C)
air_contents.update_values()
return
/obj/item/weapon/tank/plasma/proc/release()
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles())
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles)
loc.assume_air(removed)

View File

@@ -53,7 +53,7 @@
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.ion_trail.stop()
return 0

View File

@@ -38,6 +38,7 @@
trace_gas.moles = 30
payload += trace_gas
payload.update_values()
target.air.merge(payload)
@@ -53,6 +54,7 @@
var/datum/gas_mixture/payload = new
payload.toxins = 30
payload.update_values()
target.air.merge(payload)

View File

@@ -903,6 +903,7 @@ var/list/plating_icons = list("plating","platingdmg1","platingdmg2","platingdmg3
trace_gas.moles = 2000
adding.trace_gases += trace_gas
adding.temperature = T20C
adding.update_values()
assume_air(adding)

View File

@@ -719,6 +719,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
T.air.nitrogen = T.nitrogen
T.air.toxins = T.toxins
T.air.temperature = T.temperature
T.air.update_values()
// make things update properly
T.assume_air(new /datum/gas_mixture())

View File

@@ -282,7 +282,7 @@ datum
var/hotspot = (locate(/obj/effect/hotspot) 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)
@@ -293,7 +293,7 @@ datum
var/turf/T = get_turf(O)
var/hotspot = (locate(/obj/effect/hotspot) 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)
@@ -543,12 +543,14 @@ datum
var/datum/gas_mixture/napalm = new
napalm.oxygen = volume*10
napalm.temperature = T0C
napalm.update_values()
the_turf.assume_air(napalm)
reaction_turf(var/turf/T, var/volume)
src = null
var/datum/gas_mixture/napalm = new
napalm.oxygen = volume*10
napalm.temperature = T0C
napalm.update_values()
T.assume_air(napalm)
return
@@ -571,12 +573,14 @@ datum
var/datum/gas_mixture/napalm = new
napalm.nitrogen = volume*10
napalm.temperature = T0C
napalm.update_values()
the_turf.assume_air(napalm)
reaction_turf(var/turf/T, var/volume)
src = null
var/datum/gas_mixture/napalm = new
napalm.nitrogen = volume*10
napalm.temperature = T0C
napalm.update_values()
T.assume_air(napalm)
return
@@ -1051,12 +1055,14 @@ datum
var/datum/gas_mixture/napalm = new
napalm.toxins = volume*10
napalm.temperature = T0C
napalm.update_values()
the_turf.assume_air(napalm)
reaction_turf(var/turf/T, var/volume)
src = null
var/datum/gas_mixture/napalm = new
napalm.toxins = volume*10
napalm.temperature = T0C
napalm.update_values()
T.assume_air(napalm)
return
on_mob_life(var/mob/living/M as mob)
@@ -1168,6 +1174,7 @@ datum
var/datum/gas/volatile_fuel/fuel = new
fuel.moles = 5
napalm.trace_gases += fuel
napalm.update_values()
the_turf.assume_air(napalm)
reaction_turf(var/turf/T, var/volume)
src = null
@@ -1175,6 +1182,7 @@ datum
var/datum/gas/volatile_fuel/fuel = new
fuel.moles = 5
napalm.trace_gases += fuel
napalm.update_values()
T.assume_air(napalm)
return
@@ -2154,7 +2162,7 @@ datum
T.wet_overlay = null
var/hotspot = (locate(/obj/effect/hotspot) 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)

View File

@@ -357,6 +357,7 @@ datum
napalm.toxins = created_volume*10
napalm.temperature = 400+T0C
napalm.update_values()
target_tile.assume_air(napalm)
spawn (0) target_tile.hotspot_expose(700, 400)

View File

@@ -211,7 +211,7 @@
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)
@@ -259,15 +259,15 @@
if(src.nodamage)
return
if(!breath || (breath.total_moles() == 0))
if(!breath || (breath.total_moles == 0))
//Aliens breathe in vaccuum
return 0
var/toxins_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/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
var/Toxins_pp = (breath.toxins/breath.total_moles)*breath_pressure
if(Toxins_pp) // Detect toxins in air

View File

@@ -186,7 +186,7 @@
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)
@@ -234,15 +234,15 @@
if(nodamage)
return
if(!breath || (breath.total_moles() == 0))
if(!breath || (breath.total_moles == 0))
//Aliens breathe in vaccuum
return 0
var/toxins_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/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
var/Toxins_pp = (breath.toxins/breath.total_moles)*breath_pressure
if(Toxins_pp) // Detect toxins in air

View File

@@ -409,7 +409,7 @@
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)
@@ -473,7 +473,7 @@
if(nodamage || (mutations & mNobreath))
return
if(!breath || (breath.total_moles() == 0))
if(!breath || (breath.total_moles == 0))
if(reagents.has_reagent("inaprovaline"))
return
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
@@ -491,15 +491,15 @@
var/SA_para_min = 1
var/SA_sleep_min = 5
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.oxygen/breath.total_moles())*breath_pressure
var/O2_pp = (breath.oxygen/breath.total_moles)*breath_pressure
// Same, but for the toxins
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
var/Toxins_pp = (breath.toxins/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.carbon_dioxide/breath.total_moles())*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE
//var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*0.5 // The default pressure value
var/CO2_pp = (breath.carbon_dioxide/breath.total_moles)*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE
//var/CO2_pp = (breath.carbon_dioxide/breath.total_moles)*0.5 // The default pressure value
if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20) && isbreathing)
@@ -548,7 +548,7 @@
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
var/SA_pp = (SA.moles/breath.total_moles)*breath_pressure
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
@@ -1532,5 +1532,5 @@ snippets
src << "\red You collapse from heat exaustion!"
plcheck = t_plasma
oxcheck = t_oxygen
G.turf_add(T, G.total_moles())
G.turf_add(T, G.total_moles)
*/

View File

@@ -206,7 +206,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
@@ -260,7 +260,7 @@
if(src.nodamage)
return
if(!breath || (breath.total_moles() == 0))
if(!breath || (breath.total_moles == 0))
adjustOxyLoss(7)
oxygen_alert = max(oxygen_alert, 1)
@@ -274,14 +274,14 @@
var/SA_para_min = 0.5
var/SA_sleep_min = 5
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.oxygen/breath.total_moles())*breath_pressure
var/O2_pp = (breath.oxygen/breath.total_moles)*breath_pressure
// Same, but for the toxins
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
var/Toxins_pp = (breath.toxins/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.carbon_dioxide/breath.total_moles())*breath_pressure
var/CO2_pp = (breath.carbon_dioxide/breath.total_moles)*breath_pressure
if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20))
@@ -329,7 +329,7 @@
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
var/SA_pp = (SA.moles/breath.total_moles)*breath_pressure
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well

View File

@@ -508,7 +508,7 @@
var/datum/gas_mixture/environment = T.return_air()
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles()
var/total_moles = environment.total_moles
dat += "Air Pressure: [round(pressure,0.1)] kPa<br>"

View File

@@ -66,7 +66,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)
@@ -122,14 +122,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)

View File

@@ -75,7 +75,7 @@
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)

View File

@@ -22,7 +22,7 @@
else
T = null
if (src.h_status)
var/t1 = src.gas.total_moles()
var/t1 = src.gas.total_moles
if ((t1 > 0 && src.gas.temperature < (src.h_tar+T0C)))
var/increase = src.heatrate / t1
var/n_temp = src.gas.temperature + increase
@@ -31,7 +31,7 @@
switch(src.t_status)
if(1.0)
if (src.holding)
var/t1 = src.gas.total_moles()
var/t1 = src.gas.total_moles
var/t2 = t1
var/t = src.t_per
if (src.t_per > t2)
@@ -41,7 +41,7 @@
src.t_status = 3
if(2.0)
if (src.holding)
var/t1 = src.gas.total_moles()
var/t1 = src.gas.total_moles
var/t2 = src.maximum - t1
var/t = src.t_per
if (src.t_per > t2)
@@ -97,7 +97,7 @@
ct = text("<A href='?src=\ref[];c=1'>Release</A> <A href='?src=\ref[];c=2'>Accept</A> Stopped", src, src)
else
ct = "Disconnected"
var/dat = text("<TT><B>Canister Valves</B><BR>\n<FONT color = 'blue'><B>Contains/Capacity</B> [] / []</FONT><BR>\nUpper Valve Status: [][]<BR>\n\t<A href='?src=\ref[];tp=-[]'>M</A> <A href='?src=\ref[];tp=-10000'>-</A> <A href='?src=\ref[];tp=-1000'>-</A> <A href='?src=\ref[];tp=-100'>-</A> <A href='?src=\ref[];tp=-1'>-</A> [] <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=100'>+</A> <A href='?src=\ref[];tp=1000'>+</A> <A href='?src=\ref[];tp=10000'>+</A> <A href='?src=\ref[];tp=[]'>M</A><BR>\nHeater Status: [] - []<BR>\n\tTrg Tmp: <A href='?src=\ref[];ht=-50'>-</A> <A href='?src=\ref[];ht=-5'>-</A> <A href='?src=\ref[];ht=-1'>-</A> [] <A href='?src=\ref[];ht=1'>+</A> <A href='?src=\ref[];ht=5'>+</A> <A href='?src=\ref[];ht=50'>+</A><BR>\n<BR>\nPipe Valve Status: []<BR>\n\t<A href='?src=\ref[];cp=-[]'>M</A> <A href='?src=\ref[];cp=-10000'>-</A> <A href='?src=\ref[];cp=-1000'>-</A> <A href='?src=\ref[];cp=-100'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=100'>+</A> <A href='?src=\ref[];cp=1000'>+</A> <A href='?src=\ref[];cp=10000'>+</A> <A href='?src=\ref[];cp=[]'>M</A><BR>\n<BR>\n<A href='?src=\ref[];mach_close=canister'>Close</A><BR>\n</TT>", src.gas.total_moles(), src.maximum, tt, (src.holding ? text("<BR><A href='?src=\ref[];tank=1'>Tank ([]</A>)", src, src.holding.gas.total_moles()) : null), src, num2text(1000000.0, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(1000000.0, 7), ht, (src.gas.total_moles() ? (src.gas.temperature-T0C) : 20), src, src, src, src.h_tar, src, src, src, ct, src, num2text(1000000.0, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(1000000.0, 7), user)
var/dat = text("<TT><B>Canister Valves</B><BR>\n<FONT color = 'blue'><B>Contains/Capacity</B> [] / []</FONT><BR>\nUpper Valve Status: [][]<BR>\n\t<A href='?src=\ref[];tp=-[]'>M</A> <A href='?src=\ref[];tp=-10000'>-</A> <A href='?src=\ref[];tp=-1000'>-</A> <A href='?src=\ref[];tp=-100'>-</A> <A href='?src=\ref[];tp=-1'>-</A> [] <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=100'>+</A> <A href='?src=\ref[];tp=1000'>+</A> <A href='?src=\ref[];tp=10000'>+</A> <A href='?src=\ref[];tp=[]'>M</A><BR>\nHeater Status: [] - []<BR>\n\tTrg Tmp: <A href='?src=\ref[];ht=-50'>-</A> <A href='?src=\ref[];ht=-5'>-</A> <A href='?src=\ref[];ht=-1'>-</A> [] <A href='?src=\ref[];ht=1'>+</A> <A href='?src=\ref[];ht=5'>+</A> <A href='?src=\ref[];ht=50'>+</A><BR>\n<BR>\nPipe Valve Status: []<BR>\n\t<A href='?src=\ref[];cp=-[]'>M</A> <A href='?src=\ref[];cp=-10000'>-</A> <A href='?src=\ref[];cp=-1000'>-</A> <A href='?src=\ref[];cp=-100'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=100'>+</A> <A href='?src=\ref[];cp=1000'>+</A> <A href='?src=\ref[];cp=10000'>+</A> <A href='?src=\ref[];cp=[]'>M</A><BR>\n<BR>\n<A href='?src=\ref[];mach_close=canister'>Close</A><BR>\n</TT>", src.gas.total_moles, src.maximum, tt, (src.holding ? text("<BR><A href='?src=\ref[];tank=1'>Tank ([]</A>)", src, src.holding.gas.total_moles) : null), src, num2text(1000000.0, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(1000000.0, 7), ht, (src.gas.total_moles ? (src.gas.temperature-T0C) : 20), src, src, src, src.h_tar, src, src, src, ct, src, num2text(1000000.0, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(1000000.0, 7), user)
user << browse(dat, "window=canister;size=600x300")
onclose(user, "canister")
return */ //TODO: FIX

View File

@@ -59,17 +59,17 @@ var/linenums = 0
/*
/obj/machinery/pipeline/get_gas_moles(from)
return gas.total_moles()/capmult
return gas.total_moles/capmult
*/
/obj/machinery/pipeline/get_gas(from)
return gas
/obj/machinery/pipeline/gas_flow()
//if(suffix == "d" && Debug) world.log << "PLF1 [gas.total_moles()] ~ [ngas.total_moles()]"
//if(suffix == "d" && Debug) world.log << "PLF1 [gas.total_moles] ~ [ngas.total_moles]"
gas.copy_from(ngas)
//if(suffix == "d" && Debug) world.log << "PLF2 [gas.total_moles()] ~ [ngas.total_moles()]"
//if(suffix == "d" && Debug) world.log << "PLF2 [gas.total_moles] ~ [ngas.total_moles]"
/obj/machinery/pipeline/process()
/*
@@ -81,7 +81,7 @@ var/linenums = 0
// var/dbg = (suffix == "d") && Debug
//if(dbg) world.log << "PLP1 [gas.total_moles()] ~ [ngas.total_moles()]"
//if(dbg) world.log << "PLP1 [gas.total_moles] ~ [ngas.total_moles()]"
if(!numnodes)
return //dividing by zero is bad okay?