/tg/ Station 13 - Modules - TypesProc Details

/datum/gas_mixture

Procs

add_gasadd_gas(gas_id) - similar to assert_gas(), but does not check for an existing gas list for this id. This can clobber existing gases. Used instead of assert_gas() when you know the gas does not exist. Faster than assert_gas().
add_gasesadd_gases(args) - shorthand for calling add_gas() once for each gas_type.
archiveUpdate archived versions of variables. Returns: 1 in all cases
assert_gasassert_gas(gas_id) - used to guarantee that the gas list for this id exists in gas_mixture.gases.
assert_gasesassert_gases(args) - shorthand for calling ASSERT_GAS() once for each gas type.
compareCompares sample to self to see if within acceptable ranges that group processing may be enabled Returns: a string indicating what check failed, or "" if check passes
copyCreates new, identical gas mixture Returns: duplicate gas mixture
copy_fromCopies variables from sample, moles multiplicated by partial Returns: 1 if we are mutable, 0 otherwise
copy_from_turfCopies all gas info from the turf into the gas list along with temperature Returns: 1 if we are mutable, 0 otherwise
equalizeDistributes the contents of two mixes equally between themselves
garbage_collectgarbage_collect() - removes any gas list which is empty. If called with a list as an argument, only removes gas lists with IDs from that list. Must be used after subtracting from a gas. Must be used after assert_gas() if assert_gas() was called only to read from the gas. By removing empty gases, processing speed is increased.
get_breath_partial_pressureTakes the amount of the gas you want to PP as an argument So I don't have to do some hacky switches/defines/magic strings eg: Tox_PP = get_partial_pressure(gas_mixture.toxins) O2_PP = get_partial_pressure(gas_mixture.oxygen)
get_true_breath_pressureinverse
heat_capacityjoules per kelvin
mergeMerges all air from giver into self. Deletes giver. Returns: 1 if we are mutable, 0 otherwise
parse_gas_stringCopies variables from a particularly formatted string. Returns: 1 if we are mutable, 0 otherwise
pump_gas_toMathematical proofs: get_breath_partial_pressure(gas_pp) --> gas_pp/total_moles()breath_pp = pp get_true_breath_pressure(pp) --> gas_pp = pp/breath_pptotal_moles()
reactPerforms various reactions such as combustion or fusion (LOL) Returns: 1 if any reaction took place; 0 otherwise
release_gas_toReleases gas from src to output air. This means that it can not transfer air to gas mixture with higher pressure.
removeProportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed
remove_ratioProportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed
remove_specificRemoves an amount of a specific gas from the gas_mixture. Returns: gas_mixture with the gas removed
return_pressureCalculate pressure in kilopascals
return_temperatureCalculate temperature in kelvins
return_volumeCalculate volume in liters
sharePerforms air sharing calculations between two gas_mixtures assuming only 1 boundary length Returns: amount of gas exchanged (+ if sharer received)
temperature_sharePerforms temperature sharing calculations (via conduction) between two gas_mixtures assuming only 1 boundary length Returns: new temperature of the sharer
thermal_energyCalculate thermal energy in joules
total_molesCalculate moles

Proc Details

add_gas

add_gas(gas_id) - similar to assert_gas(), but does not check for an existing gas list for this id. This can clobber existing gases. Used instead of assert_gas() when you know the gas does not exist. Faster than assert_gas().

add_gases

add_gases(args) - shorthand for calling add_gas() once for each gas_type.

archive

Update archived versions of variables. Returns: 1 in all cases

assert_gas

assert_gas(gas_id) - used to guarantee that the gas list for this id exists in gas_mixture.gases.

assert_gases

assert_gases(args) - shorthand for calling ASSERT_GAS() once for each gas type.

compare

Compares sample to self to see if within acceptable ranges that group processing may be enabled Returns: a string indicating what check failed, or "" if check passes

copy

Creates new, identical gas mixture Returns: duplicate gas mixture

copy_from

Copies variables from sample, moles multiplicated by partial Returns: 1 if we are mutable, 0 otherwise

copy_from_turf

Copies all gas info from the turf into the gas list along with temperature Returns: 1 if we are mutable, 0 otherwise

equalize

Distributes the contents of two mixes equally between themselves

garbage_collect

garbage_collect() - removes any gas list which is empty. If called with a list as an argument, only removes gas lists with IDs from that list. Must be used after subtracting from a gas. Must be used after assert_gas() if assert_gas() was called only to read from the gas. By removing empty gases, processing speed is increased.

get_breath_partial_pressure

Takes the amount of the gas you want to PP as an argument So I don't have to do some hacky switches/defines/magic strings eg: Tox_PP = get_partial_pressure(gas_mixture.toxins) O2_PP = get_partial_pressure(gas_mixture.oxygen)

get_true_breath_pressure

inverse

heat_capacity

joules per kelvin

merge

Merges all air from giver into self. Deletes giver. Returns: 1 if we are mutable, 0 otherwise

parse_gas_string

Copies variables from a particularly formatted string. Returns: 1 if we are mutable, 0 otherwise

pump_gas_to

Mathematical proofs: get_breath_partial_pressure(gas_pp) --> gas_pp/total_moles()breath_pp = pp get_true_breath_pressure(pp) --> gas_pp = pp/breath_pptotal_moles()

10/205 = 2.5 10 = 2.5/520 Pumps gas from src to output_air. Amount depends on target_pressure

react

Performs various reactions such as combustion or fusion (LOL) Returns: 1 if any reaction took place; 0 otherwise

release_gas_to

Releases gas from src to output air. This means that it can not transfer air to gas mixture with higher pressure.

remove

Proportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed

remove_ratio

Proportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed

remove_specific

Removes an amount of a specific gas from the gas_mixture. Returns: gas_mixture with the gas removed

return_pressure

Calculate pressure in kilopascals

return_temperature

Calculate temperature in kelvins

return_volume

Calculate volume in liters

share

Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length Returns: amount of gas exchanged (+ if sharer received)

temperature_share

Performs temperature sharing calculations (via conduction) between two gas_mixtures assuming only 1 boundary length Returns: new temperature of the sharer

thermal_energy

Calculate thermal energy in joules

total_moles

Calculate moles