Files
tbd-station-14/Content.Server/Medical/CryoPodEjectLockWireAction.cs
slarticodefast 63b2979e73 Predict cryopods (#39385)
Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2025-08-05 17:09:50 -07:00

44 lines
1.5 KiB
C#

using Content.Server.Wires;
using Content.Shared.Medical.Cryogenics;
using Content.Shared.Wires;
namespace Content.Server.Medical;
/// <summary>
/// Causes a failure in the cryo pod ejection system when cut. A crowbar will be needed to pry open the pod.
/// </summary>
public sealed partial class CryoPodEjectLockWireAction : ComponentWireAction<CryoPodComponent>
{
public override Color Color { get; set; } = Color.Red;
public override string Name { get; set; } = "wire-name-lock";
public override bool LightRequiresPower { get; set; } = false;
public override object? StatusKey { get; } = CryoPodWireActionKey.Key;
public override bool Cut(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent)
{
if (!cryoPodComponent.PermaLocked)
{
cryoPodComponent.Locked = true;
EntityManager.Dirty(wire.Owner, cryoPodComponent);
}
return true;
}
public override bool Mend(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent)
{
if (!cryoPodComponent.PermaLocked)
{
cryoPodComponent.Locked = false;
EntityManager.Dirty(wire.Owner, cryoPodComponent);
}
return true;
}
public override void Pulse(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent) { }
public override StatusLightState? GetLightState(Wire wire, CryoPodComponent comp)
=> comp.Locked ? StatusLightState.On : StatusLightState.Off;
}