CatStation/Content.Shared/Atmos/Components/GasTankComponent.cs
Pok e7897d76a4
More item status (#39264)
* more-item-status

* update 1

* update 2

* Update pistol.yml

* update 3

* yml

* oops

* BatteryItemStatus

* fix ChargeItemStatus

* Update item-status.ftl

* review update 1

* review fix 1

* Update BatteryInfoSystem.cs

* Update TimerTriggerItemStatus

* merge fix

* merge fix

* review update 2

* review update 3

* fix marge

* StyleNano

* review update 4

* review update 5

* BatteryItemStatus

* BatteryItemStatus Client

* code cleanup

* merge

* merge and GasTank fix

* Merge

* unnecessary components

* review

* oops

* GasTank

* wawa
2026-07-19 23:41:09 +00:00

63 lines
2 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Atmos.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
public sealed partial class GasTankComponent : GasMaxPressureHolderComponent
{
private const float DefaultLowPressure = Atmospherics.OneAtmosphere;
public bool IsLowPressure => Air.Pressure <= TankLowPressure;
[DataField]
public SoundSpecifier? ConnectSound =
new SoundPathSpecifier("/Audio/Effects/internals.ogg")
{
Params = AudioParams.Default.WithVolume(5f),
};
[DataField]
public SoundSpecifier? DisconnectSound;
// Cancel toggles sounds if we re-toggle again.
public EntityUid? ConnectStream;
public EntityUid? DisconnectStream;
/// <summary>
/// Pressure at which tank should be considered 'low' such as for internals.
/// </summary>
[DataField]
public float TankLowPressure = DefaultLowPressure;
/// <summary>
/// Tank is connected to internals.
/// </summary>
[ViewVariables]
public bool IsConnected => User != null;
[DataField, AutoNetworkedField]
public EntityUid? User;
/// <summary>
/// True if this entity was recently moved out of a container. This might have been a hand -> inventory
/// transfer, or it might have been the user dropping the tank. This indicates the tank needs to be checked.
/// </summary>
[ViewVariables]
public bool CheckUser;
[DataField]
public EntProtoId ToggleAction = "ActionToggleInternals";
[DataField, AutoNetworkedField]
public EntityUid? ToggleActionEntity;
/// <summary>
/// Tracks elapsed time between client state updates for <see cref="GasMaxPressureHolderComponent"/>.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
public TimeSpan NextDirtyTime;
}