From ee38211143ee83388a93d2bb9457c0ca5c5febce Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:46:23 -0400 Subject: [PATCH] [MISSED MIRROR] Volume pump refactor (#76260) (#22535) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Volume pump refactor (#76260) ## About The Pull Request A new pull request that DOESN'T make Lemon and Ghil kill me. _[I had made a previous PR about the same original commits that was going to make Volume Pumps leave a lot more gas in pipenets then people would want.]_ Removed Hardcoded values from Volume_Pump.dm and moved them to __DEFINES Updated documentation on Volume pumps because it was copied from Pressure Pump. Volume pumps attempt to move a certain volume and ignore pressure limits until exceeding them. This can lead to pressures well above the limit, so there is no ‘perfecting’ of pressures, as previously detailed by documentation. Edited to be more specific. ## Why It's Good For The Game Less Hardcoded values. Documentation more readily reflects the realities of the game. ## Changelog :cl: code: replaced hardcoded values in volume_pump.dm with __DEFINES vars doc: Volume Pump's basic introduction was copied and pasted from the Pressure Pump documentation, and made mention of trying to 'perfect the pressure'. Volume pump doesn't care about pressure until it exceeds it, so there is no 'perfecting' going on. /:cl: --------- Co-authored-by: EliteCreature Co-authored-by: Riley Redd --- code/__DEFINES/atmospherics/atmos_piping.dm | 8 +++++++- .../machinery/components/binary_devices/volume_pump.dm | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/atmospherics/atmos_piping.dm b/code/__DEFINES/atmospherics/atmos_piping.dm index 3d864e6485f..bb5350ee17e 100644 --- a/code/__DEFINES/atmospherics/atmos_piping.dm +++ b/code/__DEFINES/atmospherics/atmos_piping.dm @@ -22,7 +22,13 @@ #define MAX_OUTPUT_PRESSURE 4500 /// (L/s) Maximum speed powered equipment can work at. #define MAX_TRANSFER_RATE 200 -/// How many percent of the contents that an overclocked volume pumps leak into the air +/// (kPa) Minimum pressure volume pumps can move. +#define VOLUME_PUMP_MINIMUM_OUTPUT_PRESSURE 0.01 +/// (kPa) What pressure volume pumps max out at. +#define VOLUME_PUMP_MAX_OUTPUT_PRESSURE 9000 +/// (kPa) Allowed pressure difference between input and output pipenets for overclocked volume pump. +#define VOLUME_PUMP_OVERPRESSURE_ALLOWANCE 1000 +/// How many percent of the contents that an overclocked volume pumps leak into the air. #define VOLUME_PUMP_LEAK_AMOUNT 0.1 //used for device_type vars #define UNARY 1 diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index 31183a8eb51..1170ea32bde 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -1,7 +1,7 @@ -// Every cycle, the pump uses the air in air_in to try and make air_out the perfect pressure. +// Every cycle, the pump uses the air in air_in to try and move a specific volume of gas into air_out. // -// node1, air1, network1 correspond to input -// node2, air2, network2 correspond to output +// node1, air1, network1 corresponds to input +// node2, air2, network2 corresponds to output // // Thus, the two variables affect pump operation are set in New(): // air1.volume @@ -72,10 +72,10 @@ var/input_starting_pressure = air1.return_pressure() var/output_starting_pressure = air2.return_pressure() - if((input_starting_pressure < 0.01) || ((output_starting_pressure > 9000)) && !overclocked) + if((input_starting_pressure < VOLUME_PUMP_MINIMUM_OUTPUT_PRESSURE) || ((output_starting_pressure > VOLUME_PUMP_MAX_OUTPUT_PRESSURE)) && !overclocked) return - if(overclocked && (output_starting_pressure-input_starting_pressure > 1000))//Overclocked pumps can only force gas a certain amount. + if(overclocked && (output_starting_pressure-input_starting_pressure > VOLUME_PUMP_OVERPRESSURE_ALLOWANCE))//Overclocked pumps can only force gas a certain amount. return