2023-01-18 05:44:32 +11:00
|
|
|
using Content.Server.Doors.Systems;
|
2022-05-05 19:35:06 -07:00
|
|
|
using Content.Server.Wires;
|
|
|
|
|
using Content.Shared.Doors;
|
2023-01-18 05:44:32 +11:00
|
|
|
using Content.Shared.Doors.Components;
|
2022-05-05 19:35:06 -07:00
|
|
|
using Content.Shared.Wires;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Doors;
|
|
|
|
|
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class DoorBoltLightWireAction : ComponentWireAction<DoorBoltComponent>
|
2022-05-05 19:35:06 -07:00
|
|
|
{
|
2023-01-21 12:51:02 +13:00
|
|
|
public override Color Color { get; set; } = Color.Lime;
|
|
|
|
|
public override string Name { get; set; } = "wire-name-bolt-light";
|
2022-05-05 19:35:06 -07:00
|
|
|
|
2023-06-01 02:23:35 +12:00
|
|
|
public override StatusLightState? GetLightState(Wire wire, DoorBoltComponent comp)
|
2023-01-21 12:51:02 +13:00
|
|
|
=> comp.BoltLightsEnabled ? StatusLightState.On : StatusLightState.Off;
|
2022-05-05 19:35:06 -07:00
|
|
|
|
|
|
|
|
public override object StatusKey { get; } = AirlockWireStatus.BoltLightIndicator;
|
|
|
|
|
|
2023-06-01 02:23:35 +12:00
|
|
|
public override bool Cut(EntityUid user, Wire wire, DoorBoltComponent door)
|
2022-05-05 19:35:06 -07:00
|
|
|
{
|
2024-02-22 18:01:31 -05:00
|
|
|
EntityManager.System<DoorSystem>().SetBoltLightsEnabled((wire.Owner, door), false);
|
2022-05-05 19:35:06 -07:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-01 02:23:35 +12:00
|
|
|
public override bool Mend(EntityUid user, Wire wire, DoorBoltComponent door)
|
2022-05-05 19:35:06 -07:00
|
|
|
{
|
2024-02-22 18:01:31 -05:00
|
|
|
EntityManager.System<DoorSystem>().SetBoltLightsEnabled((wire.Owner, door), true);
|
2022-05-05 19:35:06 -07:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-01 02:23:35 +12:00
|
|
|
public override void Pulse(EntityUid user, Wire wire, DoorBoltComponent door)
|
2022-05-05 19:35:06 -07:00
|
|
|
{
|
2024-02-22 18:01:31 -05:00
|
|
|
EntityManager.System<DoorSystem>().SetBoltLightsEnabled((wire.Owner, door), !door.BoltLightsEnabled);
|
2022-05-05 19:35:06 -07:00
|
|
|
}
|
|
|
|
|
}
|