Releasing an under-pressure lockout is now a verb (#36910)
Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
@@ -22,11 +22,12 @@ using Content.Shared.DeviceNetwork.Components;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.DeviceNetwork.Events;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Power;
|
||||
using Content.Shared.Tools.Systems;
|
||||
using Content.Shared.Verbs;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
{
|
||||
@@ -41,7 +42,6 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly WeldableSystem _weldable = default!;
|
||||
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly PowerReceiverSystem _powerReceiverSystem = default!;
|
||||
@@ -60,7 +60,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
SubscribeLocalEvent<GasVentPumpComponent, SignalReceivedEvent>(OnSignalReceived);
|
||||
SubscribeLocalEvent<GasVentPumpComponent, GasAnalyzerScanEvent>(OnAnalyzed);
|
||||
SubscribeLocalEvent<GasVentPumpComponent, WeldableChangedEvent>(OnWeldChanged);
|
||||
SubscribeLocalEvent<GasVentPumpComponent, InteractUsingEvent>(OnInteractUsing);
|
||||
SubscribeLocalEvent<GasVentPumpComponent, GetVerbsEvent<Verb>>(OnGetVerbs);
|
||||
SubscribeLocalEvent<GasVentPumpComponent, VentScrewedDoAfterEvent>(OnVentScrewed);
|
||||
}
|
||||
|
||||
@@ -379,23 +379,43 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
{
|
||||
UpdateState(uid, component);
|
||||
}
|
||||
private void OnInteractUsing(EntityUid uid, GasVentPumpComponent component, InteractUsingEvent args)
|
||||
|
||||
private void OnGetVerbs(Entity<GasVentPumpComponent> ent, ref GetVerbsEvent<Verb> args)
|
||||
{
|
||||
if (args.Handled
|
||||
|| component.UnderPressureLockout == false
|
||||
|| !_toolSystem.HasQuality(args.Used, "Screwing")
|
||||
|| !Transform(uid).Anchored
|
||||
)
|
||||
{
|
||||
if (ent.Comp.UnderPressureLockout == false || !Transform(ent).Anchored)
|
||||
return;
|
||||
}
|
||||
|
||||
args.Handled = true;
|
||||
var user = args.User;
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.ManualLockoutDisableDoAfter, new VentScrewedDoAfterEvent(), uid, uid, args.Used));
|
||||
var v = new Verb
|
||||
{
|
||||
Priority = 1,
|
||||
Icon = new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/unlock.svg.192dpi.png")),
|
||||
Text = Loc.GetString("gas-vent-pump-release-lockout"),
|
||||
Impact = LogImpact.Low,
|
||||
DoContactInteraction = true,
|
||||
Act = () =>
|
||||
{
|
||||
var doAfter = new DoAfterArgs(EntityManager, user, ent.Comp.ManualLockoutDisableDoAfter, new VentScrewedDoAfterEvent(), ent, ent)
|
||||
{
|
||||
BreakOnDamage = true,
|
||||
NeedHand = true,
|
||||
BreakOnMove = true,
|
||||
BreakOnWeightlessMove = true,
|
||||
};
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(doAfter);
|
||||
},
|
||||
};
|
||||
|
||||
args.Verbs.Add(v);
|
||||
}
|
||||
|
||||
private void OnVentScrewed(EntityUid uid, GasVentPumpComponent component, VentScrewedDoAfterEvent args)
|
||||
{
|
||||
if (args.Cancelled || args.Handled)
|
||||
return;
|
||||
|
||||
component.ManualLockoutReenabledAt = _timing.CurTime + component.ManualLockoutDisabledDuration;
|
||||
component.IsPressureLockoutManuallyDisabled = true;
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
gas-vent-pump-uvlo = It is in [color=red]under-pressure lock out[/color].
|
||||
gas-vent-pump-release-lockout = Release pressure lock out
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
This is to prevent wasting useful gasses to space if a room is not sealed.
|
||||
The lights on the air vent will turn [color=yellow]yellow[/color] to highlight this change.
|
||||
|
||||
This can be [color=green]overridden[/color] by using a screwdriver on the vent, or setting the mode to Fill on a connected [textlink="air alarm" link="AirAlarms"].
|
||||
This can be [color=green]overridden[/color] by right-clicking on the vent and selecting 'Release pressure lock out', or setting the mode to Fill on a connected [textlink="air alarm" link="AirAlarms"].
|
||||
|
||||
It is important to note that air vents in [color=red]pressure lockout[/color] still very slowly leak out gas.
|
||||
The amount of gas they leak out is relative to the current pressure of the pipenet they're connected to.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
2. Repressurize the area.
|
||||
|
||||
- [textlink="Air vents" link="AirVent"] enter pressure lockout in order not to lose more air to spacing, so you'll need to override the vents to repressurize the area. You can do this by setting the connected [textlink="air alarm" link="AirAlarms"] to fill, or by using a screwdriver on a vent to manually override it temporarily.
|
||||
- [textlink="Air vents" link="AirVent"] enter pressure lockout in order not to lose more air to spacing, so you'll need to override the vents to repressurize the area. You can do this by setting the connected [textlink="air alarm" link="AirAlarms"] to fill, or by right-clicking on the vent and selecting 'Release pressure lock out' to manually override it temporarily.
|
||||
|
||||
## Things to Avoid
|
||||
- Keep in mind that while you have an infinite supply of [textlink="mined gas" link="GasMiningAndStorage"], it is not quick enough to fill up multiple rooms at once. Setting [textlink="air alarms" link="AirAlarms"] to fill first [italic]before[/italic] fixing the root problem will often lead to wasted time and gas.
|
||||
|
||||
Reference in New Issue
Block a user