Add gas recyclers (#9934)

* Add RemoveVolume()

RemoveVolume(vol) captures the common pattern of:

    air.RemoveRatio(vol / air.Volume)

Change existing code to use this method where appropriate.

* Add gas recyclers

Gas recyclers catalyze the conversion of CO2 and N2O to O2 and N2. The
gas recycler component takes waste gas from the input net and releases
the result into the output net.

To make things more fun, the input net must be pressurized to 3 MPa and
heated to at least 300 C; otherwise, no reaction will occur.

Game-mechanic wise, gas recyclers contain the catalyst for the
conversion reaction, and therefore, requires no external power. However,
the external pumps and heaters required to make the reaction happen
still do.

* Fix gas recyclers

Fix negative sqrt, fix pressure check after remove.
This commit is contained in:
Kevin Zheng
2022-09-11 16:02:01 -07:00
committed by GitHub
parent dd66bf305e
commit 45349e3c0d
18 changed files with 256 additions and 12 deletions

View File

@@ -270,6 +270,7 @@
unlockedRecipes:
- ThermomachineFreezerMachineCircuitBoard
- PortableScrubberMachineCircuitBoard
- GasRecyclerMachineCircuitboard
# Avionics Circuitry Technology Tree

View File

@@ -541,3 +541,15 @@
materialRequirements:
Glass: 2
Cable: 2
- type: entity
id: GasRecyclerMachineCircuitboard
parent: BaseMachineCircuitboard
name: gas recycler board
description: A printed circuit board for a gas recycler
components:
- type: MachineBoard
prototype: GasRecycler
materialRequirements:
Steel: 10
Plasma: 10

View File

@@ -278,6 +278,7 @@
- WallmountGeneratorAPUElectronics
- WallmountSubstationElectronics
- EmitterCircuitboard
- GasRecyclerMachineCircuitboard
- type: Machine
board: CircuitImprinterMachineCircuitboard
- type: Lathe

View File

@@ -257,3 +257,49 @@
!type:PipeNode
nodeGroupID: Pipe
pipeDirection: South
- type: entity
parent: [ GasBinaryBase, BaseMachine, ConstructibleMachine ]
id: GasRecycler
name: gas recycler
description: Recycles carbon dioxide and nitrous oxide. Heater and compressor not included.
placement:
mode: SnapgridCenter
components:
- type: Sprite
sprite: Structures/Machines/gasrecycler.rsi
netsync: false
layers:
- sprite: Structures/Piping/Atmospherics/pipe.rsi
state: pipeStraight
map: [ "enum.PipeVisualLayers.Pipe" ]
- state: running
- state: unlit
shader: unshaded
- type: GenericVisualizer
visuals:
enum.PumpVisuals.Enabled:
enabled:
True: { state: running }
False: { state: unlit }
- type: Appearance
- type: PipeColorVisuals
- type: GasRecycler
- type: AmbientSound
enabled: false
volume: -9
range: 5
sound:
path: /Audio/Ambience/Objects/gas_pump.ogg
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 100
behaviors:
- !type:ChangeConstructionNodeBehavior
node: machineFrame
- !type:DoActsBehavior
acts: ["Destruction"]
- type: Machine
board: GasRecyclerMachineCircuitboard

View File

@@ -404,3 +404,12 @@
materials:
Steel: 100
Glass: 900
- type: latheRecipe
id: GasRecyclerMachineCircuitboard
icon: Objects/Misc/module.rsi/id_mod.png
result: GasRecyclerMachineCircuitboard
completetime: 4
materials:
Steel: 100
Glass: 900