Add sprite for vent under-pressure lock-out (#29527)

This commit is contained in:
slarticodefast
2024-06-29 07:02:48 +02:00
committed by GitHub
parent ebd6104c63
commit cd2968d849
6 changed files with 19 additions and 4 deletions

View File

@@ -83,13 +83,18 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
var timeDelta = args.dt;
var pressureDelta = timeDelta * vent.TargetPressureChange;
var lockout = (environment.Pressure < vent.UnderPressureLockoutThreshold);
if (vent.UnderPressureLockout != lockout) // update visuals only if this changes
{
vent.UnderPressureLockout = lockout;
UpdateState(uid, vent);
}
if (vent.PumpDirection == VentPumpDirection.Releasing && pipe.Air.Pressure > 0)
{
if (environment.Pressure > vent.MaxPressure)
return;
vent.UnderPressureLockout = (environment.Pressure < vent.UnderPressureLockoutThreshold);
if ((vent.PressureChecks & VentPressureBound.ExternalBound) != 0)
{
// Vents cannot supply high pressures from an almost empty pipe, instead it's proportional to the pipe
@@ -267,7 +272,10 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
}
else if (vent.PumpDirection == VentPumpDirection.Releasing)
{
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance);
if (vent.UnderPressureLockout & !vent.PressureLockoutOverride)
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Lockout, appearance);
else
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance);
}
else if (vent.PumpDirection == VentPumpDirection.Siphoning)
{
@@ -281,7 +289,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
return;
if (args.IsInDetailsRange)
{
if (pumpComponent.UnderPressureLockout & !pumpComponent.PressureLockoutOverride)
if (pumpComponent.PumpDirection == VentPumpDirection.Releasing & pumpComponent.UnderPressureLockout & !pumpComponent.PressureLockoutOverride)
{
args.PushMarkup(Loc.GetString("gas-vent-pump-uvlo"));
}

View File

@@ -15,5 +15,6 @@ namespace Content.Shared.Atmos.Visuals
In,
Out,
Welded,
Lockout,
}
}

View File

@@ -301,6 +301,7 @@
In: { state: vent_in }
Out: { state: vent_out }
Welded: { state: vent_welded }
Lockout: { state: vent_lockout }
- type: PipeColorVisuals
- type: GasVentPump
inlet: inlet

View File

@@ -55,6 +55,7 @@
In: { state: vent_in }
Out: { state: vent_out }
Welded: { state: vent_welded }
Lockout: { state: vent_lockout }
- type: GasVentPump
- type: Construction
graph: GasUnary

View File

@@ -28,6 +28,10 @@
"name":"vent_in",
"directions" : 4,
"delays":[ [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ] ]
},
{
"name":"vent_lockout",
"directions" : 4
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB