2023-01-21 12:51:02 +13:00
|
|
|
using Content.Server.Medical.Components;
|
2022-12-25 12:35:51 +01:00
|
|
|
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>
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class CryoPodEjectLockWireAction: ComponentWireAction<CryoPodComponent>
|
2022-12-25 12:35:51 +01:00
|
|
|
{
|
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;
|
2022-12-25 12:35:51 +01:00
|
|
|
|
|
|
|
|
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)
|
2022-12-25 12:35:51 +01:00
|
|
|
{
|
2023-01-21 12:51:02 +13:00
|
|
|
if (!cryoPodComponent.PermaLocked)
|
2022-12-25 12:35:51 +01:00
|
|
|
cryoPodComponent.Locked = true;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-21 12:51:02 +13:00
|
|
|
public override bool Mend(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent)
|
2022-12-25 12:35:51 +01:00
|
|
|
{
|
2023-01-21 12:51:02 +13:00
|
|
|
if (!cryoPodComponent.PermaLocked)
|
2022-12-25 12:35:51 +01:00
|
|
|
cryoPodComponent.Locked = false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-21 12:51:02 +13:00
|
|
|
public override void Pulse(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent) { }
|
2022-12-25 12:35:51 +01:00
|
|
|
|
2023-01-21 12:51:02 +13:00
|
|
|
public override StatusLightState? GetLightState(Wire wire, CryoPodComponent comp)
|
|
|
|
|
=> comp.Locked ? StatusLightState.On : StatusLightState.Off;
|
2022-12-25 12:35:51 +01:00
|
|
|
}
|