Files
OldThink/Content.Server/Medical/CryoPodEjectLockWireAction.cs

39 lines
1.3 KiB
C#
Raw Permalink Normal View History

2023-01-21 12:51:02 +13:00
using Content.Server.Medical.Components;
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>
{
2023-01-21 12:51:02 +13:00
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;
2023-01-21 12:51:02 +13:00
public override bool Cut(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent)
{
2023-01-21 12:51:02 +13:00
if (!cryoPodComponent.PermaLocked)
cryoPodComponent.Locked = true;
return true;
}
2023-01-21 12:51:02 +13:00
public override bool Mend(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent)
{
2023-01-21 12:51:02 +13:00
if (!cryoPodComponent.PermaLocked)
cryoPodComponent.Locked = false;
return true;
}
2023-01-21 12:51:02 +13:00
public override void Pulse(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent) { }
2023-01-21 12:51:02 +13:00
public override StatusLightState? GetLightState(Wire wire, CryoPodComponent comp)
=> comp.Locked ? StatusLightState.On : StatusLightState.Off;
}