Skip to content

Commit

Permalink
Add Vox atmosphere marker, vents, and air alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
deltanedas committed Aug 26, 2024
1 parent 09d5fe3 commit 4effb1d
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
return;
}

var mixtures = new GasMixture[7];
var mixtures = new GasMixture[8];
for (var i = 0; i < mixtures.Length; i++)
mixtures[i] = new GasMixture(Atmospherics.CellVolume) { Temperature = Atmospherics.T20C };

Expand Down Expand Up @@ -65,6 +65,9 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
mixtures[6].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesStandard);
mixtures[6].Temperature = 235f; // Little colder than an actual freezer but gives a grace period to get e.g. themomachines set up, should keep warm for a few door openings

// 7: Nitrogen (101kpa) for vox rooms
mixtures[7].AdjustMoles(Gas.Nitrogen, Atmospherics.MolesCellStandard);

foreach (var arg in args)
{
if (!NetEntity.TryParse(arg, out var netEntity) || !TryGetEntity(netEntity, out var euid))
Expand Down
14 changes: 14 additions & 0 deletions Resources/Prototypes/Atmospherics/thresholds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,17 @@
id: danger # just any gas you don't want at all
upperBound: !type:AlarmThresholdSetting
threshold: 0.0001

- type: alarmThreshold
id: voxOxygen
upperBound: !type:AlarmThresholdSetting
threshold: 0.02 # 2%
upperWarnAround: !type:AlarmThresholdSetting
threshold: 0.5 # 1%

- type: alarmThreshold
id: voxNitrogen
lowerBound: !type:AlarmThresholdSetting
threshold: 0.8 # danger below 80% nitrogen
lowerWarnAround: !type:AlarmThresholdSetting
threshold: 1.125 # warning below 90%
9 changes: 9 additions & 0 deletions Resources/Prototypes/Entities/Markers/atmos_blocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,12 @@
state: freeze
- type: AtmosFixMarker
mode: 6

- type: entity
parent: AtmosFixNitrogenMarker
id: AtmosFixVoxMarker
suffix: Vox Atmosphere
description: "Nitrogen @ 101 kPa, 20C"
components:
- type: AtmosFixMarker
mode: 7
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
- type: entity
abstract: true
parent: AirSensorBase
id: AirSensorVoxBase
suffix: Vox Atmosphere
components:
- type: AtmosMonitor
gasThresholdPrototypes:
Oxygen: voxOxygen
Nitrogen: voxNitrogen
CarbonDioxide: stationCO2
Plasma: stationPlasma
Tritium: stationTritium
WaterVapor: stationWaterVapor
Ammonia: stationAmmonia
NitrousOxide: stationNO
Frezon: danger

- type: entity
parent: [AirSensorVoxBase, AirSensor]
id: AirSensorVox

- type: entity
parent: [AirSensorVoxBase, GasVentPump]
id: GasVentPumpVox

- type: entity
parent: [AirSensorVoxBase, GasVentScrubber]
id: GasVentScrubberVox
components:
- type: GasVentScrubber
wideNet: true # Air alarm with auto mode overrides filters with hardcoded defaults so default to widenet
filterGases:
- Oxygen # filter out oxygen as well as regular harmful gases
- CarbonDioxide
- Plasma
- Tritium
- WaterVapor
- Ammonia
- NitrousOxide
- Frezon

# use this to prevent overriding filters with hardcoded defaults
- type: entity
parent: AirAlarm
id: AirAlarmVox
suffix: Vox Atmosphere, auto mode disabled
components:
- type: AirAlarm
autoMode: false

0 comments on commit 4effb1d

Please sign in to comment.