]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add new freezer atmos devices and fix freezer fixgridatmos marker (#34991)
authorArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
Wed, 12 Feb 2025 07:32:18 +0000 (23:32 -0800)
committerGitHub <noreply@github.com>
Wed, 12 Feb 2025 07:32:18 +0000 (18:32 +1100)
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs
Content.Shared/Atmos/Atmospherics.cs
Resources/Prototypes/Atmospherics/thresholds.yml
Resources/Prototypes/Entities/Structures/Specific/Atmospherics/freezer.yml [new file with mode: 0644]

index b790493c448542b70bcdead9ebf7307b42772fc8..d728ba91644bc8d3a5efeb6069368b2bc5872e9a 100644 (file)
@@ -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);
index cb89f6c19920838ff6de6c9a44b2cb0c81f98a7b..749e705a3141116386d279d410991b1d1abc1261 100644 (file)
@@ -40,6 +40,12 @@ namespace Content.Shared.Atmos
         /// </summary>
         public const float T20C = 293.15f;
 
+        /// <summary>
+        ///     -38.15ºC in K.
+        ///     This is used to initialize roundstart freezer rooms.
+        /// </summary>
+        public const float FreezerTemp = 235f;
+
         /// <summary>
         ///     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
         /// </summary>
         public const float MolesCellStandard = (OneAtmosphere * CellVolume / (T20C * R));
 
+        /// <summary>
+        ///     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.
+        /// </summary>
+        public const float MolesCellFreezer = (OneAtmosphere * CellVolume / (FreezerTemp * R));
+
         /// <summary>
         ///     Moles in a 2.5 m^3 cell at GasMinerDefaultMaxExternalPressure kPa and 20ºC
         /// </summary>
@@ -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
 
         /// <summary>
index 29904e6f2455a761342e751670fb5a8e4cc0f3a1..20d7911bf2df3030475b1c0031b35429f086cad0 100644 (file)
     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 (file)
index 0000000..f3c75eb
--- /dev/null
@@ -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