CryoPodEjectLockWireAction.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Content.Server.Medical.Components;
  2. using Content.Server.Wires;
  3. using Content.Shared.Medical.Cryogenics;
  4. using Content.Shared.Wires;
  5. namespace Content.Server.Medical;
  6. /// <summary>
  7. /// Causes a failure in the cryo pod ejection system when cut. A crowbar will be needed to pry open the pod.
  8. /// </summary>
  9. public sealed partial class CryoPodEjectLockWireAction: ComponentWireAction<CryoPodComponent>
  10. {
  11. public override Color Color { get; set; } = Color.Red;
  12. public override string Name { get; set; } = "wire-name-lock";
  13. public override bool LightRequiresPower { get; set; } = false;
  14. public override object? StatusKey { get; } = CryoPodWireActionKey.Key;
  15. public override bool Cut(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent)
  16. {
  17. if (!cryoPodComponent.PermaLocked)
  18. cryoPodComponent.Locked = true;
  19. return true;
  20. }
  21. public override bool Mend(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent)
  22. {
  23. if (!cryoPodComponent.PermaLocked)
  24. cryoPodComponent.Locked = false;
  25. return true;
  26. }
  27. public override void Pulse(EntityUid user, Wire wire, CryoPodComponent cryoPodComponent) { }
  28. public override StatusLightState? GetLightState(Wire wire, CryoPodComponent comp)
  29. => comp.Locked ? StatusLightState.On : StatusLightState.Off;
  30. }