Stasis bed cleanup and bugfixes. (#38762)

* Stasis bed sent to shed

* Code Review

* Code Review 2
This commit is contained in:
Nemanja
2025-07-05 20:59:31 -04:00
committed by GitHub
parent 7aaccb5b98
commit ab201b6e82
21 changed files with 243 additions and 222 deletions

View File

@@ -1,5 +1,4 @@
using Content.Server.Body.Systems;
using Content.Shared.Alert;
using Content.Shared.Atmos;
using Content.Shared.Chat.Prototypes;
using Content.Shared.Damage;
@@ -8,7 +7,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Body.Components
{
[RegisterComponent, Access(typeof(RespiratorSystem))]
[RegisterComponent, Access(typeof(RespiratorSystem)), AutoGenerateComponentPause]
public sealed partial class RespiratorComponent : Component
{
/// <summary>
@@ -36,7 +35,7 @@ namespace Content.Server.Body.Components
/// <summary>
/// The next time that this body will inhale or exhale.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextUpdate;
/// <summary>
@@ -46,6 +45,18 @@ namespace Content.Server.Body.Components
[DataField]
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(2);
/// <summary>
/// Multiplier applied to <see cref="UpdateInterval"/> for adjusting based on metabolic rate multiplier.
/// </summary>
[DataField]
public float UpdateIntervalMultiplier = 1f;
/// <summary>
/// Adjusted update interval based off of the multiplier value.
/// </summary>
[ViewVariables]
public TimeSpan AdjustedUpdateInterval => UpdateInterval * UpdateIntervalMultiplier;
/// <summary>
/// Saturation level. Reduced by UpdateInterval each tick.
/// Can be thought of as 'how many seconds you have until you start suffocating' in this configuration.