using Content.Shared.Actions.ActionTypes; using Content.Shared.Atmos; using Content.Shared.Sound; using Robust.Shared.Audio; namespace Content.Server.Atmos.Components { [RegisterComponent] public sealed class GasTankComponent : Component, IGasMixtureHolder { public const float MaxExplosionRange = 14f; private const float DefaultOutputPressure = Atmospherics.OneAtmosphere; public int Integrity = 3; [ViewVariables(VVAccess.ReadWrite), DataField("ruptureSound")] public SoundSpecifier RuptureSound = new SoundPathSpecifier("/Audio/Effects/spray.ogg"); [ViewVariables(VVAccess.ReadWrite), DataField("connectSound")] public SoundSpecifier? ConnectSound = new SoundPathSpecifier("/Audio/Effects/internals.ogg") { Params = AudioParams.Default.WithVolume(5f), }; [ViewVariables(VVAccess.ReadWrite), DataField("disconnectSound")] public SoundSpecifier? DisconnectSound; // Cancel toggles sounds if we re-toggle again. public IPlayingAudioStream? ConnectStream; public IPlayingAudioStream? DisconnectStream; [DataField("air")] [ViewVariables] public GasMixture Air { get; set; } = new(); /// /// Distributed pressure. /// [DataField("outputPressure")] [ViewVariables] public float OutputPressure { get; set; } = DefaultOutputPressure; /// /// Tank is connected to internals. /// [ViewVariables] public bool IsConnected { get; set; } /// /// Pressure at which tanks start leaking. /// [DataField("tankLeakPressure")] public float TankLeakPressure { get; set; } = 30 * Atmospherics.OneAtmosphere; /// /// Pressure at which tank spills all contents into atmosphere. /// [DataField("tankRupturePressure")] public float TankRupturePressure { get; set; } = 40 * Atmospherics.OneAtmosphere; /// /// Base 3x3 explosion. /// [DataField("tankFragmentPressure")] public float TankFragmentPressure { get; set; } = 50 * Atmospherics.OneAtmosphere; /// /// Increases explosion for each scale kPa above threshold. /// [DataField("tankFragmentScale")] public float TankFragmentScale { get; set; } = 10 * Atmospherics.OneAtmosphere; [DataField("toggleAction", required: true)] public InstantAction ToggleAction = new(); } }