mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
A couple more Max Cap fixes/rebalances (#43659)
* max cap more fixes and rebalances * arbitrary * bugefix cleanup, rebalance --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
parent
42d33ff899
commit
527735f20d
10 changed files with 27 additions and 33 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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<GasTankComponent> ent, GasMixture giver)
|
||||
{
|
||||
_atmosphereSystem.Merge(ent.Comp.Air, giver);
|
||||
CheckStatus(ent);
|
||||
}
|
||||
|
||||
protected override void SafetyMeasures(Entity<GasTankComponent> entity)
|
||||
{
|
||||
if (entity.Comp.ReleaseValveOpen)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Content.Shared.Atmos.Components;
|
|||
/// </summary>
|
||||
public abstract partial class GasMaxPressureHolderComponent : Component, IGasMaxPressureHolder
|
||||
{
|
||||
private const int DefaultIntegrity = 5;
|
||||
private const float DefaultIntegrity = 3f;
|
||||
private const float DefaultOutputPressure = Atmospherics.OneAtmosphere;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -49,7 +49,10 @@ public abstract partial class GasMaxPressureHolderComponent : Component, IGasMax
|
|||
/// Sound made when air is leaked out of this device.
|
||||
/// </summary>
|
||||
[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),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ public interface IGasMaxPressureHolder : IGasMixtureHolder
|
|||
/// An overpressure is defined as pressure exceeding <see cref="Overpressure"/>
|
||||
/// This determines the maximum value
|
||||
/// </summary>
|
||||
int MaxIntegrity { get; set; }
|
||||
float MaxIntegrity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How many over-pressures until this gas tank detonates.
|
||||
/// An overpressure is defined as pressure exceeding <see cref="Overpressure"/>
|
||||
/// This determines the current value
|
||||
/// </summary>
|
||||
int Integrity { get; set; }
|
||||
float Integrity { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public abstract class GasMaxPressureSystem<T> : EntitySystem where T : IGasMaxPr
|
|||
private void OnDeviceUpdated(Entity<T> 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<T> : EntitySystem where T : IGasMaxPr
|
|||
/// Checks the status of an atmos device that has a specified max pressure, and handles overpressure issues.
|
||||
/// </summary>
|
||||
/// <param name="entity">Gas holding atmos device.</param>
|
||||
/// <param name="dt">Time since the last status update.</param>
|
||||
/// <returns>True if the device hasn't failed. False if the device has failed and been destroyed.</returns>
|
||||
protected bool CheckStatus(Entity<T> entity)
|
||||
protected bool CheckStatus(Entity<T> entity, float dt)
|
||||
{
|
||||
var pressure = entity.Comp.Air.Pressure;
|
||||
|
||||
|
|
@ -117,13 +118,13 @@ public abstract class GasMaxPressureSystem<T> : 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue