From 75727db3a31cc756d6945e4743be062429992c24 Mon Sep 17 00:00:00 2001 From: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com> Date: Tue, 11 Feb 2025 23:32:18 -0800 Subject: [PATCH] Add new freezer atmos devices and fix freezer fixgridatmos marker (#34991) --- .../AtmosphereSystem.Commands.cs | 6 ++-- Content.Shared/Atmos/Atmospherics.cs | 15 ++++++++++ .../Prototypes/Atmospherics/thresholds.yml | 11 +++++++ .../Specific/Atmospherics/freezer.yml | 29 +++++++++++++++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 Resources/Prototypes/Entities/Structures/Specific/Atmospherics/freezer.yml diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs index b790493c44..d728ba9164 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs @@ -61,9 +61,9 @@ public sealed partial class AtmosphereSystem mixtures[5].Temperature = 5000f; // 6: (Walk-In) Freezer - mixtures[6].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesStandard); - 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 + mixtures[6].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesFreezer); + mixtures[6].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesFreezer); + mixtures[6].Temperature = Atmospherics.FreezerTemp; // 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); diff --git a/Content.Shared/Atmos/Atmospherics.cs b/Content.Shared/Atmos/Atmospherics.cs index cb89f6c199..749e705a31 100644 --- a/Content.Shared/Atmos/Atmospherics.cs +++ b/Content.Shared/Atmos/Atmospherics.cs @@ -40,6 +40,12 @@ namespace Content.Shared.Atmos /// public const float T20C = 293.15f; + /// + /// -38.15ºC in K. + /// This is used to initialize roundstart freezer rooms. + /// + public const float FreezerTemp = 235f; + /// /// Do not allow any gas mixture temperatures to exceed this number. It is occasionally possible /// to have very small heat capacity (e.g. room that was just unspaced) and for large amounts of @@ -65,6 +71,12 @@ namespace Content.Shared.Atmos /// public const float MolesCellStandard = (OneAtmosphere * CellVolume / (T20C * R)); + /// + /// Moles in a 2.5 m^3 cell at 101.325 kPa and -38.15ºC. + /// This is used in fix atmos freezer markers to ensure the air is at the correct atmospheric pressure while still being cold. + /// + public const float MolesCellFreezer = (OneAtmosphere * CellVolume / (FreezerTemp * R)); + /// /// Moles in a 2.5 m^3 cell at GasMinerDefaultMaxExternalPressure kPa and 20ºC /// @@ -81,6 +93,9 @@ namespace Content.Shared.Atmos public const float OxygenMolesStandard = MolesCellStandard * OxygenStandard; public const float NitrogenMolesStandard = MolesCellStandard * NitrogenStandard; + public const float OxygenMolesFreezer = MolesCellFreezer * OxygenStandard; + public const float NitrogenMolesFreezer = MolesCellFreezer * NitrogenStandard; + #endregion /// diff --git a/Resources/Prototypes/Atmospherics/thresholds.yml b/Resources/Prototypes/Atmospherics/thresholds.yml index 29904e6f24..20d7911bf2 100644 --- a/Resources/Prototypes/Atmospherics/thresholds.yml +++ b/Resources/Prototypes/Atmospherics/thresholds.yml @@ -114,3 +114,14 @@ threshold: 0.8 # danger below 80% nitrogen lowerWarnAround: !type:AlarmThresholdSetting threshold: 1.125 # warning below 90% + +- type: alarmThreshold + id: freezerTemperature + upperBound: !type:AlarmThresholdSetting + threshold: 335.15 # T-38.15C (235) + 100 + lowerBound: !type:AlarmThresholdSetting + threshold: 135.15 # T-38.15C (235) - 100 + upperWarnAround: !type:AlarmThresholdSetting + threshold: 0.8 + lowerWarnAround: !type:AlarmThresholdSetting + threshold: 1.1 diff --git a/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/freezer.yml b/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/freezer.yml new file mode 100644 index 0000000000..f3c75eb737 --- /dev/null +++ b/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/freezer.yml @@ -0,0 +1,29 @@ +- type: entity + abstract: true + parent: AirSensorBase + id: AirSensorFreezerBase + suffix: Freezer Atmosphere + components: + - type: AtmosMonitor + temperatureThresholdId: freezerTemperature + +- type: entity + parent: [AirSensorFreezerBase, AirSensor] + id: AirSensorFreezer + +- type: entity + parent: [AirSensorFreezerBase, GasVentPump] + id: GasVentPumpFreezer + +- type: entity + parent: [AirSensorFreezerBase, GasVentScrubber] + id: GasVentScrubberFreezer + +# air alarm proto with auto: false to prevent the automatic switching of modes overriding the default values +- type: entity + parent: AirAlarm + id: AirAlarmFreezer + suffix: Freezer Atmosphere, auto mode disabled + components: + - type: AirAlarm + autoMode: false