diff --git a/Content.Client/Atmos/EntitySystems/MaxPressureVisualsSystem.cs b/Content.Client/Atmos/EntitySystems/MaxPressureVisualsSystem.cs index d92a7b6741..72eff2b409 100644 --- a/Content.Client/Atmos/EntitySystems/MaxPressureVisualsSystem.cs +++ b/Content.Client/Atmos/EntitySystems/MaxPressureVisualsSystem.cs @@ -46,10 +46,10 @@ public sealed class MaxPressureVisualsSystem : EntitySystem if (args.Sprite is not { } sprite) return; - if (!args.AppearanceData.TryGetValue(GasIntegrity.Integrity, out var obj) || obj is not int integrity) + if (!args.AppearanceData.TryGetValue(GasIntegrity.Integrity, out var obj) || obj is not float integrity) return; - if (!args.AppearanceData.TryGetValue(GasIntegrity.MaxIntegrity, out obj) || obj is not int maxIntegrity) + if (!args.AppearanceData.TryGetValue(GasIntegrity.MaxIntegrity, out obj) || obj is not float maxIntegrity) return; // We don't want visuals at max integrity, so we return if we're at max. diff --git a/Content.Server/Atmos/EntitySystems/GasTankSystem.cs b/Content.Server/Atmos/EntitySystems/GasTankSystem.cs index 74f4856d78..fba6c145ae 100644 --- a/Content.Server/Atmos/EntitySystems/GasTankSystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasTankSystem.cs @@ -21,9 +21,9 @@ public sealed class GasTankSystem : SharedGasTankSystem [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly ThrowingSystem _throwing = default!; - private const float MinimumSoundValvePressure = 10.0f; + private const float MinimumSoundValvePressure = 21.3f; // Arbitrary number - private const float ReleaseArea = 0.0001f; // About 1cm^2 + private const float ReleaseArea = 0.0005f; // About 5cm^2 // A vector bias for throwing our gas tanks in radians. Averages about -43 degrees since the sprite is at a 45-degree angle. private static readonly Vector2 ThrowVector = new (-1.0f, -0.5f); @@ -106,7 +106,7 @@ public sealed class GasTankSystem : SharedGasTankSystem _atmosphereSystem.Merge(environment, removed); // If we wouldn't produce a sound, don't throw or play a sound. - if (deltaP < MinimumSoundValvePressure) + if (removed.Pressure < MinimumSoundValvePressure) return; Audio.PlayPvs(entity.Comp.ReleaseSound, entity); @@ -141,12 +141,6 @@ public sealed class GasTankSystem : SharedGasTankSystem return gasTank.Comp.Air.Remove(amount); } - public void AssumeAir(Entity ent, GasMixture giver) - { - _atmosphereSystem.Merge(ent.Comp.Air, giver); - CheckStatus(ent); - } - protected override void SafetyMeasures(Entity entity) { if (entity.Comp.ReleaseValveOpen) diff --git a/Content.Shared/Atmos/Components/GasMaxPressureHolderComponent.cs b/Content.Shared/Atmos/Components/GasMaxPressureHolderComponent.cs index 7c6ac9cfaf..573d3cbdf2 100644 --- a/Content.Shared/Atmos/Components/GasMaxPressureHolderComponent.cs +++ b/Content.Shared/Atmos/Components/GasMaxPressureHolderComponent.cs @@ -8,7 +8,7 @@ namespace Content.Shared.Atmos.Components; /// public abstract partial class GasMaxPressureHolderComponent : Component, IGasMaxPressureHolder { - private const int DefaultIntegrity = 5; + private const float DefaultIntegrity = 3f; private const float DefaultOutputPressure = Atmospherics.OneAtmosphere; /// @@ -49,7 +49,10 @@ public abstract partial class GasMaxPressureHolderComponent : Component, IGasMax /// Sound made when air is leaked out of this device. /// [DataField] - public SoundSpecifier? ReleaseSound { get; set; } = new SoundPathSpecifier("/Audio/Effects/spray.ogg"); + public SoundSpecifier? ReleaseSound { get; set; } = new SoundPathSpecifier("/Audio/Effects/spray.ogg") + { + Params = AudioParams.Default.WithVolume(-5f), + }; /// /// The mixture of air contained in this device. @@ -73,8 +76,8 @@ public abstract partial class GasMaxPressureHolderComponent : Component, IGasMax public LocId? SafetyAlert { get; set; } = "gas-max-pressure-alert"; [DataField] - public int MaxIntegrity { get; set; } = DefaultIntegrity; + public float MaxIntegrity { get; set; } = DefaultIntegrity; [DataField] - public int Integrity { get; set; } = DefaultIntegrity; + public float Integrity { get; set; } = DefaultIntegrity; } diff --git a/Content.Shared/Atmos/Components/IGasMaxPressureHolder.cs b/Content.Shared/Atmos/Components/IGasMaxPressureHolder.cs index 88386a5c74..e05d80c96c 100644 --- a/Content.Shared/Atmos/Components/IGasMaxPressureHolder.cs +++ b/Content.Shared/Atmos/Components/IGasMaxPressureHolder.cs @@ -33,12 +33,12 @@ public interface IGasMaxPressureHolder : IGasMixtureHolder /// An overpressure is defined as pressure exceeding /// This determines the maximum value /// - int MaxIntegrity { get; set; } + float MaxIntegrity { get; set; } /// /// How many over-pressures until this gas tank detonates. /// An overpressure is defined as pressure exceeding /// This determines the current value /// - int Integrity { get; set; } + float Integrity { get; set; } } diff --git a/Content.Shared/Atmos/EntitySystems/GasMaxPressureSystem.cs b/Content.Shared/Atmos/EntitySystems/GasMaxPressureSystem.cs index 68bfaa6a11..31e6a4f6c4 100644 --- a/Content.Shared/Atmos/EntitySystems/GasMaxPressureSystem.cs +++ b/Content.Shared/Atmos/EntitySystems/GasMaxPressureSystem.cs @@ -38,7 +38,7 @@ public abstract class GasMaxPressureSystem : EntitySystem where T : IGasMaxPr private void OnDeviceUpdated(Entity entity, ref AtmosDeviceUpdateEvent args) { // We don't update our atmos device if it's in the process of being deleted. - if (CheckStatus(entity)) + if (CheckStatus(entity, args.dt)) DeviceUpdated(entity, ref args); } @@ -89,8 +89,9 @@ public abstract class GasMaxPressureSystem : EntitySystem where T : IGasMaxPr /// Checks the status of an atmos device that has a specified max pressure, and handles overpressure issues. /// /// Gas holding atmos device. + /// Time since the last status update. /// True if the device hasn't failed. False if the device has failed and been destroyed. - protected bool CheckStatus(Entity entity) + protected bool CheckStatus(Entity entity, float dt) { var pressure = entity.Comp.Air.Pressure; @@ -117,13 +118,13 @@ public abstract class GasMaxPressureSystem : EntitySystem where T : IGasMaxPr if (pressure > entity.Comp.Overpressure) { IntegrityLost(entity); - entity.Comp.Integrity--; + entity.Comp.Integrity -= dt; Appearance.SetData(entity.Owner, GasIntegrity.Integrity, entity.Comp.Integrity); Appearance.SetData(entity.Owner, GasIntegrity.MaxIntegrity, entity.Comp.MaxIntegrity); } else if (entity.Comp.Integrity < entity.Comp.MaxIntegrity) { - entity.Comp.Integrity++; + entity.Comp.Integrity = Math.Min(entity.Comp.Integrity + dt, entity.Comp.MaxIntegrity); Appearance.SetData(entity.Owner, GasIntegrity.Integrity, entity.Comp.Integrity); Appearance.SetData(entity.Owner, GasIntegrity.MaxIntegrity, entity.Comp.MaxIntegrity); } diff --git a/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.Gases.cs b/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.Gases.cs index 5433ec6570..240711f048 100644 --- a/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.Gases.cs +++ b/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.Gases.cs @@ -421,7 +421,7 @@ public abstract partial class SharedAtmosphereSystem if (deltaP <= 0) return null; - return ReleaseGasAt(mixture, (float)GetFlowVolume(mixture, deltaP, area, dt), deltaP); + return ReleaseGasAt(mixture, (float)GetFlowVolume(mixture, deltaP, area, dt), mixture.Pressure); } /// diff --git a/Resources/Prototypes/Atmospherics/gases.yml b/Resources/Prototypes/Atmospherics/gases.yml index 2108b68e53..b217074ca8 100644 --- a/Resources/Prototypes/Atmospherics/gases.yml +++ b/Resources/Prototypes/Atmospherics/gases.yml @@ -53,7 +53,7 @@ abbreviation: gas-tritium-abbreviation molarHeatCapacity: 10 heatCapacityRatio: 1.3 - molarMass: 6 + molarMass: 3 gasOverlaySprite: sprite: /Textures/Effects/atmospherics.rsi state: tritium diff --git a/Resources/Prototypes/Catalog/Fills/Items/gas_tanks.yml b/Resources/Prototypes/Catalog/Fills/Items/gas_tanks.yml index cfc35c1589..f377d96db9 100644 --- a/Resources/Prototypes/Catalog/Fills/Items/gas_tanks.yml +++ b/Resources/Prototypes/Catalog/Fills/Items/gas_tanks.yml @@ -225,8 +225,9 @@ air: volume: 0.66 moles: - Oxygen: 0.1805213564 - Tritium: 0.0902606782 + Oxygen: 0.1 # If trit fire burn ratio is ever changed, this value will need to be adjusted. + Tritium: 0.05 + Plasma: 0.06 # High mass to slow flow rate temperature: 373.149 - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Tools/jetpacks.yml b/Resources/Prototypes/Entities/Objects/Tools/jetpacks.yml index 1ba2d790fe..94dd306d8c 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/jetpacks.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/jetpacks.yml @@ -241,11 +241,6 @@ sprite: Objects/Tanks/Jetpacks/security.rsi - type: Clothing sprite: Objects/Tanks/Jetpacks/security.rsi - - type: GasTank - maxIntegrity: 5 # You may ask why this microbalance? The answer is: Sec jetpacks sprite is based off regular jetpacks, and I'm too lazy to make their sprite data different. - integrity: 5 - - type: MaxPressureVisuals - steps: 5 #Filled security - type: entity diff --git a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml index 961e3a6487..7ffc594342 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml @@ -124,10 +124,10 @@ - type: MaxPressureVisuals integrityMask: mask-grey - type: GasCanister - maxIntegrity: 25 # 5 times stronger than a gas tank - integrity: 25 + maxIntegrity: 15 # 5 times stronger than a gas tank + integrity: 15 maxReleasePressure: 1013.25 - safetyPressure: 7599.375 # High enough that liquid tanks don't burst immediately + safetyPressure: 10132.5 # High enough that liquid tanks don't burst immediately, with an extra 33% wiggle room to work with overpressure: 20265 # Purposefully high because cans react really fucking fast, may need to redo this value if reactions change! gasTankSlot: name: comp-gas-canister-slot-name-gas-tank