This commit is contained in:
SandPoot
2021-06-27 15:54:58 -03:00
163 changed files with 2371 additions and 2245 deletions
@@ -131,11 +131,10 @@
var/pressure_delta = target_pressure - target_air.return_pressure()
if(pressure_delta > 0.1)
var/transfer_moles = (pressure_delta*target_air.return_volume()/(source_air.return_temperature() * R_IDEAL_GAS_EQUATION))*PUMP_EFFICIENCY
var/datum/gas_mixture/removed = source_air.remove(transfer_moles)
if(istype(snowflake)) //Snowflake check for tanks specifically, because tank ruptures are handled in a very snowflakey way that expects all tank interactions to be handled via the tank's procs
snowflake.assume_air(removed)
snowflake.assume_air_moles(source_air, transfer_moles)
else
target_air.merge(removed)
source_air.transfer_to(target_air, transfer_moles)
// - volume pump - // **Works**
@@ -183,12 +182,10 @@
//The second part of the min caps the pressure built by the volume pumps to the max pump pressure
var/transfer_ratio = min(transfer_rate,target_air.return_volume()*PUMP_MAX_PRESSURE/source_air.return_pressure())/source_air.return_volume()
var/datum/gas_mixture/removed = source_air.remove_ratio(transfer_ratio * PUMP_EFFICIENCY)
if(istype(snowflake))
snowflake.assume_air(removed)
snowflake.assume_air_ratio(source_air, transfer_ratio * PUMP_EFFICIENCY)
else
target_air.merge(removed)
source_air.transfer_ratio_to(target_air, transfer_ratio * PUMP_EFFICIENCY)
// - gas vent - // **works**
@@ -376,7 +373,7 @@
for(var/filtered_gas in removed.get_gases())
//Get the name of the gas and see if it is in the list
if(GLOB.meta_gas_names[filtered_gas] in wanted)
if(GLOB.gas_data.names[filtered_gas] in wanted)
//The gas that is put in all the filtered out gases
filtered_out.set_temperature(removed.return_temperature())
filtered_out.set_moles(filtered_gas, removed.get_moles(filtered_gas))
@@ -468,16 +465,12 @@
var/snowflakecheck = istype(gas_output, /obj/item/tank)
var/datum/gas_mixture/mix = source_1_gases.remove(transfer_moles * gas_percentage)
if(snowflakecheck)
gas_output.assume_air(mix)
gas_output.assume_air_moles(source_1_gases, transfer_moles * gas_percentage)
gas_output.assume_air_moles(source_2_gases, transfer_moles * (1-gas_percentage))
else
output_gases.merge(mix)
mix = source_2_gases.remove(transfer_moles * (1-gas_percentage))
if(snowflakecheck)
gas_output.assume_air(mix)
else
output_gases.merge(mix)
source_1_gases.transfer_to(output_gases, transfer_moles * gas_percentage)
source_2_gases.transfer_to(output_gases, transfer_moles * (1-gas_percentage))
// - integrated tank - // **works**
@@ -1163,7 +1163,7 @@
var/list/gas_names = list()
var/list/gas_amounts = list()
for(var/id in air_contents.get_gases())
var/name = GLOB.meta_gas_names[id]
var/name = GLOB.gas_data.names[id]
var/amt = round(air_contents.get_moles(id), 0.001)
gas_names.Add(name)
gas_amounts.Add(amt)
@@ -292,10 +292,7 @@
if(!source_air || !target_air)
return
var/datum/gas_mixture/removed = source_air.remove(gas_per_throw)
if(!removed)
return
target_air.merge(removed)
source_air.transfer_to(target_air, gas_per_throw)
// If the item is in a grabber circuit we'll update the grabber's outputs after we've thrown it.
var/obj/item/integrated_circuit/manipulation/grabber/G = A.loc