mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Allows atmos helpers to be used with portable_atmos
This commit is contained in:
@@ -8,13 +8,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/atmospherics/var/last_flow_rate = 0 //Can't return multiple values, unfortunately
|
/obj/machinery/atmospherics/var/last_flow_rate = 0
|
||||||
|
/obj/machinery/portable_atmospherics/var/last_flow_rate = 0
|
||||||
|
|
||||||
//Generalized gas pumping proc.
|
//Generalized gas pumping proc.
|
||||||
//Moves gas from one gas_mixture to another and returns the amount of power needed (assuming 1 second), or -1 if no gas was pumped.
|
//Moves gas from one gas_mixture to another and returns the amount of power needed (assuming 1 second), or -1 if no gas was pumped.
|
||||||
//transfer_moles - Limits the amount of moles to transfer. The actual amount of gas moved may also be limited by available_power, if given.
|
//transfer_moles - Limits the amount of moles to transfer. The actual amount of gas moved may also be limited by available_power, if given.
|
||||||
//available_power - the maximum amount of power that may be used when moving gas. If null then the transfer is not limited by power.
|
//available_power - the maximum amount of power that may be used when moving gas. If null then the transfer is not limited by power.
|
||||||
/obj/machinery/atmospherics/proc/pump_gas(var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/transfer_moles = null, var/available_power = null)
|
/proc/pump_gas(var/obj/machinery/M, var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/transfer_moles = null, var/available_power = null)
|
||||||
if (source.total_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
if (source.total_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@@ -31,7 +32,13 @@
|
|||||||
if (transfer_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
if (transfer_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
//Update flow rate meter
|
||||||
|
if (istype(M, /obj/machinery/atmospherics))
|
||||||
|
var/obj/machinery/atmospherics/A = M
|
||||||
|
A.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
if (istype(M, /obj/machinery/portable_atmospherics))
|
||||||
|
var/obj/machinery/portable_atmospherics/P = M
|
||||||
|
P.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
|
||||||
var/datum/gas_mixture/removed = source.remove(transfer_moles)
|
var/datum/gas_mixture/removed = source.remove(transfer_moles)
|
||||||
if (!removed) //Just in case
|
if (!removed) //Just in case
|
||||||
@@ -50,7 +57,7 @@
|
|||||||
//filtering - A list of gasids to be scrubbed from source
|
//filtering - A list of gasids to be scrubbed from source
|
||||||
//total_transfer_moles - Limits the amount of moles to scrub. The actual amount of gas scrubbed may also be limited by available_power, if given.
|
//total_transfer_moles - Limits the amount of moles to scrub. The actual amount of gas scrubbed may also be limited by available_power, if given.
|
||||||
//available_power - the maximum amount of power that may be used when scrubbing gas. If null then the scrubbing is not limited by power.
|
//available_power - the maximum amount of power that may be used when scrubbing gas. If null then the scrubbing is not limited by power.
|
||||||
/obj/machinery/atmospherics/proc/scrub_gas(var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/total_transfer_moles = null, var/available_power = null)
|
/proc/scrub_gas(var/obj/machinery/M, var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/total_transfer_moles = null, var/available_power = null)
|
||||||
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@@ -89,8 +96,15 @@
|
|||||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
//Update flow rate var
|
||||||
|
if (istype(M, /obj/machinery/atmospherics))
|
||||||
|
var/obj/machinery/atmospherics/A = M
|
||||||
|
A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
if (istype(M, /obj/machinery/portable_atmospherics))
|
||||||
|
var/obj/machinery/portable_atmospherics/P = M
|
||||||
|
P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
|
||||||
var/power_draw = 0
|
var/power_draw = 0
|
||||||
last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
|
||||||
for (var/g in filtering)
|
for (var/g in filtering)
|
||||||
var/transfer_moles = source.gas[g]
|
var/transfer_moles = source.gas[g]
|
||||||
//filter gas in proportion to the mole ratio
|
//filter gas in proportion to the mole ratio
|
||||||
@@ -117,7 +131,7 @@
|
|||||||
//filtering - A list of gasids to be filtered. These gasses get moved to sink_filtered, while the other gasses get moved to sink_clean.
|
//filtering - A list of gasids to be filtered. These gasses get moved to sink_filtered, while the other gasses get moved to sink_clean.
|
||||||
//total_transfer_moles - Limits the amount of moles to input. The actual amount of gas filtered may also be limited by available_power, if given.
|
//total_transfer_moles - Limits the amount of moles to input. The actual amount of gas filtered may also be limited by available_power, if given.
|
||||||
//available_power - the maximum amount of power that may be used when filtering gas. If null then the filtering is not limited by power.
|
//available_power - the maximum amount of power that may be used when filtering gas. If null then the filtering is not limited by power.
|
||||||
/obj/machinery/atmospherics/proc/filter_gas(var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink_filtered, var/datum/gas_mixture/sink_clean, var/total_transfer_moles = null, var/available_power = null)
|
/proc/filter_gas(var/obj/machinery/M, var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink_filtered, var/datum/gas_mixture/sink_clean, var/total_transfer_moles = null, var/available_power = null)
|
||||||
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@@ -154,7 +168,13 @@
|
|||||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
//Update flow rate var
|
||||||
|
if (istype(M, /obj/machinery/atmospherics))
|
||||||
|
var/obj/machinery/atmospherics/A = M
|
||||||
|
A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
if (istype(M, /obj/machinery/portable_atmospherics))
|
||||||
|
var/obj/machinery/portable_atmospherics/P = M
|
||||||
|
P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
|
||||||
var/datum/gas_mixture/removed = source.remove(total_transfer_moles)
|
var/datum/gas_mixture/removed = source.remove(total_transfer_moles)
|
||||||
if (!removed) //Just in case
|
if (!removed) //Just in case
|
||||||
@@ -188,7 +208,7 @@
|
|||||||
//For omni devices. Instead filtering is an associative list mapping gasids to gas mixtures.
|
//For omni devices. Instead filtering is an associative list mapping gasids to gas mixtures.
|
||||||
//I don't like the copypasta, but I decided to keep both versions of gas filtering as filter_gas is slightly faster (doesn't create as many temporary lists, doesn't call update_values() as much)
|
//I don't like the copypasta, but I decided to keep both versions of gas filtering as filter_gas is slightly faster (doesn't create as many temporary lists, doesn't call update_values() as much)
|
||||||
//filter_gas can be removed and replaced with this proc if need be.
|
//filter_gas can be removed and replaced with this proc if need be.
|
||||||
/obj/machinery/atmospherics/proc/filter_gas_multi(var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink_clean, var/total_transfer_moles = null, var/available_power = null)
|
/proc/filter_gas_multi(var/obj/machinery/M, var/list/filtering, var/datum/gas_mixture/source, var/datum/gas_mixture/sink_clean, var/total_transfer_moles = null, var/available_power = null)
|
||||||
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
if (source.total_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@@ -226,7 +246,13 @@
|
|||||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
//Update Flow Rate var
|
||||||
|
if (istype(M, /obj/machinery/atmospherics))
|
||||||
|
var/obj/machinery/atmospherics/A = M
|
||||||
|
A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
if (istype(M, /obj/machinery/portable_atmospherics))
|
||||||
|
var/obj/machinery/portable_atmospherics/P = M
|
||||||
|
P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
|
||||||
|
|
||||||
var/datum/gas_mixture/removed = source.remove(total_transfer_moles)
|
var/datum/gas_mixture/removed = source.remove(total_transfer_moles)
|
||||||
if (!removed) //Just in case
|
if (!removed) //Just in case
|
||||||
@@ -262,7 +288,7 @@
|
|||||||
|
|
||||||
//Similar deal as the other atmos process procs.
|
//Similar deal as the other atmos process procs.
|
||||||
//mix_sources maps input gas mixtures to mix ratios. The mix ratios MUST add up to 1.
|
//mix_sources maps input gas mixtures to mix ratios. The mix ratios MUST add up to 1.
|
||||||
/obj/machinery/atmospherics/proc/mix_gas(var/list/mix_sources, var/datum/gas_mixture/sink, var/total_transfer_moles = null, var/available_power = null)
|
/proc/mix_gas(var/obj/machinery/M, var/list/mix_sources, var/datum/gas_mixture/sink, var/total_transfer_moles = null, var/available_power = null)
|
||||||
if (!mix_sources.len)
|
if (!mix_sources.len)
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@@ -304,7 +330,13 @@
|
|||||||
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
if (total_transfer_moles < MINUMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
last_flow_rate = (total_transfer_moles/total_input_moles)*total_input_volume //group_multiplier gets divided out here
|
//Update flow rate var
|
||||||
|
if (istype(M, /obj/machinery/atmospherics))
|
||||||
|
var/obj/machinery/atmospherics/A = M
|
||||||
|
A.last_flow_rate = (total_transfer_moles/total_input_moles)*total_input_volume //group_multiplier gets divided out here
|
||||||
|
if (istype(M, /obj/machinery/portable_atmospherics))
|
||||||
|
var/obj/machinery/portable_atmospherics/P = M
|
||||||
|
P.last_flow_rate = (total_transfer_moles/total_input_moles)*total_input_volume //group_multiplier gets divided out here
|
||||||
|
|
||||||
var/total_power_draw = 0
|
var/total_power_draw = 0
|
||||||
for (var/datum/gas_mixture/source in mix_sources)
|
for (var/datum/gas_mixture/source in mix_sources)
|
||||||
@@ -329,7 +361,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//Calculates the amount of power needed to move one mole from source to sink.
|
//Calculates the amount of power needed to move one mole from source to sink.
|
||||||
/obj/machinery/atmospherics/proc/calculate_specific_power(datum/gas_mixture/source, datum/gas_mixture/sink)
|
/proc/calculate_specific_power(datum/gas_mixture/source, datum/gas_mixture/sink)
|
||||||
//Calculate the amount of energy required
|
//Calculate the amount of energy required
|
||||||
var/air_temperature = (sink.temperature > 0)? sink.temperature : source.temperature
|
var/air_temperature = (sink.temperature > 0)? sink.temperature : source.temperature
|
||||||
var/specific_entropy = sink.specific_entropy() - source.specific_entropy() //environment is gaining moles, air_contents is loosing
|
var/specific_entropy = sink.specific_entropy() - source.specific_entropy() //environment is gaining moles, air_contents is loosing
|
||||||
@@ -342,7 +374,7 @@
|
|||||||
return specific_power
|
return specific_power
|
||||||
|
|
||||||
//Calculates the amount of power needed to move one mole of a certain gas from source to sink.
|
//Calculates the amount of power needed to move one mole of a certain gas from source to sink.
|
||||||
/obj/machinery/atmospherics/proc/calculate_specific_power_gas(var/gasid, datum/gas_mixture/source, datum/gas_mixture/sink)
|
/proc/calculate_specific_power_gas(var/gasid, datum/gas_mixture/source, datum/gas_mixture/sink)
|
||||||
//Calculate the amount of energy required
|
//Calculate the amount of energy required
|
||||||
var/air_temperature = (sink.temperature > 0)? sink.temperature : source.temperature
|
var/air_temperature = (sink.temperature > 0)? sink.temperature : source.temperature
|
||||||
var/specific_entropy = sink.specific_entropy_gas(gasid) - source.specific_entropy_gas(gasid) //environment is gaining moles, air_contents is loosing
|
var/specific_entropy = sink.specific_entropy_gas(gasid) - source.specific_entropy_gas(gasid) //environment is gaining moles, air_contents is loosing
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
var/air_temperature = environment.temperature? environment.temperature : air1.temperature
|
var/air_temperature = environment.temperature? environment.temperature : air1.temperature
|
||||||
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
|
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
|
||||||
|
|
||||||
power_draw = pump_gas(air1, environment, transfer_moles, active_power_usage)
|
power_draw = pump_gas(src, air1, environment, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if(power_draw >= 0 && network1)
|
if(power_draw >= 0 && network1)
|
||||||
network1.update = 1
|
network1.update = 1
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
//limit flow rate from turfs
|
//limit flow rate from turfs
|
||||||
transfer_moles = min(transfer_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
transfer_moles = min(transfer_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
||||||
|
|
||||||
power_draw = pump_gas(environment, air2, transfer_moles, active_power_usage)
|
power_draw = pump_gas(src, environment, air2, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if(power_draw >= 0 && network2)
|
if(power_draw >= 0 && network2)
|
||||||
network2.update = 1
|
network2.update = 1
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
transfer_moles = min(transfer_moles, pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION))
|
transfer_moles = min(transfer_moles, pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION))
|
||||||
|
|
||||||
//pump_gas() will return a negative number if no flow occurred
|
//pump_gas() will return a negative number if no flow occurred
|
||||||
var/flow = pump_gas(air1, air2, transfer_moles, available_power=0) //available_power=0 means we only move gas if it would flow naturally
|
var/flow = pump_gas(src, air1, air2, transfer_moles, available_power=0) //available_power=0 means we only move gas if it would flow naturally
|
||||||
|
|
||||||
if (flow >= 0)
|
if (flow >= 0)
|
||||||
if(network1)
|
if(network1)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ Thus, the two variables affect pump operation are set in New():
|
|||||||
//get the number of moles that would have to be transfered to bring sink to the target pressure
|
//get the number of moles that would have to be transfered to bring sink to the target pressure
|
||||||
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
|
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
|
||||||
|
|
||||||
power_draw = pump_gas(air1, air2, transfer_moles, active_power_usage)
|
power_draw = pump_gas(src, air1, air2, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if (power_draw < 0)
|
if (power_draw < 0)
|
||||||
//update_use_power(0)
|
//update_use_power(0)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
var/power_draw = -1
|
var/power_draw = -1
|
||||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||||
power_draw = filter_gas_multi(filtering_outputs, input_air, output_air, transfer_moles, active_power_usage)
|
power_draw = filter_gas_multi(src, filtering_outputs, input_air, output_air, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if (power_draw < 0)
|
if (power_draw < 0)
|
||||||
//update_use_power(0)
|
//update_use_power(0)
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
|
|
||||||
var/power_draw = -1
|
var/power_draw = -1
|
||||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||||
power_draw = mix_gas(mixing_inputs, output, transfer_moles, active_power_usage)
|
power_draw = mix_gas(src, mixing_inputs, output, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if (power_draw < 0)
|
if (power_draw < 0)
|
||||||
//update_use_power(0)
|
//update_use_power(0)
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
var/power_draw = -1
|
var/power_draw = -1
|
||||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||||
power_draw = filter_gas(filtered_out, air1, air2, air3, transfer_moles, active_power_usage)
|
power_draw = filter_gas(src, filtered_out, air1, air2, air3, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if(network2)
|
if(network2)
|
||||||
network2.update = 1
|
network2.update = 1
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
var/power_draw = -1
|
var/power_draw = -1
|
||||||
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
if (transfer_moles > MINUMUM_MOLES_TO_FILTER)
|
||||||
power_draw = mix_gas(mixing_inputs, air3, transfer_moles, active_power_usage)
|
power_draw = mix_gas(src, mixing_inputs, air3, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if(network1 && mixing_inputs[air1])
|
if(network1 && mixing_inputs[air1])
|
||||||
network1.update = 1
|
network1.update = 1
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
injecting = 1
|
injecting = 1
|
||||||
|
|
||||||
if(air_contents.temperature > 0)
|
if(air_contents.temperature > 0)
|
||||||
var/power_used = pump_gas(air_contents, environment, air_contents.total_moles, inject_power)
|
var/power_used = pump_gas(src, air_contents, environment, air_contents.total_moles, inject_power)
|
||||||
use_power(power_used)
|
use_power(power_used)
|
||||||
|
|
||||||
if(network)
|
if(network)
|
||||||
|
|||||||
@@ -153,14 +153,16 @@
|
|||||||
|
|
||||||
//Figure out the target pressure difference
|
//Figure out the target pressure difference
|
||||||
var/pressure_delta = get_pressure_delta(environment)
|
var/pressure_delta = get_pressure_delta(environment)
|
||||||
|
//src.visible_message("DEBUG >>> [src]: pressure_delta = [pressure_delta]")
|
||||||
|
|
||||||
if((environment.temperature || air_contents.temperature) && pressure_delta > 0.5)
|
if((environment.temperature || air_contents.temperature) && pressure_delta > 0.5)
|
||||||
if(pump_direction) //internal -> external
|
if(pump_direction) //internal -> external
|
||||||
var/output_volume = environment.volume * environment.group_multiplier
|
var/output_volume = environment.volume * environment.group_multiplier
|
||||||
var/air_temperature = environment.temperature? environment.temperature : air_contents.temperature
|
var/air_temperature = environment.temperature? environment.temperature : air_contents.temperature
|
||||||
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
|
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
|
||||||
|
//src.visible_message("DEBUG >>> [src]: output_volume = [output_volume]L; air_temperature = [air_temperature]K; transfer_moles = [transfer_moles] mol")
|
||||||
|
|
||||||
power_draw = pump_gas(air_contents, environment, transfer_moles, active_power_usage)
|
power_draw = pump_gas(src, air_contents, environment, transfer_moles, active_power_usage)
|
||||||
else //external -> internal
|
else //external -> internal
|
||||||
var/output_volume = air_contents.volume + (network? network.volume : 0)
|
var/output_volume = air_contents.volume + (network? network.volume : 0)
|
||||||
var/air_temperature = air_contents.temperature? air_contents.temperature : environment.temperature
|
var/air_temperature = air_contents.temperature? air_contents.temperature : environment.temperature
|
||||||
@@ -169,7 +171,7 @@
|
|||||||
//limit flow rate from turfs
|
//limit flow rate from turfs
|
||||||
transfer_moles = min(transfer_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
transfer_moles = min(transfer_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
||||||
|
|
||||||
power_draw = pump_gas(environment, air_contents, transfer_moles, active_power_usage)
|
power_draw = pump_gas(src, environment, air_contents, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if (power_draw < 0)
|
if (power_draw < 0)
|
||||||
last_power_draw = 0
|
last_power_draw = 0
|
||||||
@@ -364,6 +366,8 @@
|
|||||||
..()
|
..()
|
||||||
if (get_dist(usr, src) <= 1)
|
if (get_dist(usr, src) <= 1)
|
||||||
usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||||
|
else
|
||||||
|
usr << "You are too far away to read the gauge."
|
||||||
if(welded)
|
if(welded)
|
||||||
usr << "It seems welded shut."
|
usr << "It seems welded shut."
|
||||||
|
|
||||||
|
|||||||
@@ -131,12 +131,12 @@
|
|||||||
//limit flow rate from turfs
|
//limit flow rate from turfs
|
||||||
var/transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SCRUBBER_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
var/transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SCRUBBER_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
||||||
|
|
||||||
power_draw = scrub_gas(scrubbing_gas, environment, air_contents, transfer_moles, active_power_usage)
|
power_draw = scrub_gas(src, scrubbing_gas, environment, air_contents, transfer_moles, active_power_usage)
|
||||||
else //Just siphon all air
|
else //Just siphon all air
|
||||||
//limit flow rate from turfs
|
//limit flow rate from turfs
|
||||||
var/transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
var/transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
|
||||||
|
|
||||||
power_draw = pump_gas(environment, air_contents, transfer_moles, active_power_usage)
|
power_draw = pump_gas(src, environment, air_contents, transfer_moles, active_power_usage)
|
||||||
|
|
||||||
if (power_draw < 0)
|
if (power_draw < 0)
|
||||||
//update_use_power(0)
|
//update_use_power(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user