[Entity] Brig Timers (#15285)

* brigtimer

* ok

* TextScreen w timer implementation

* second commit

* working brig timer

* signal timers near completion

* soon done

* removed licenses, fixes noRotation on screens, minor edits

* no message

* no message

* removed my last todos

* removed csproj.rej??

* missed a thing with .yml and tests

* fix tests

* Update base_structureairlocks.yml

* timespan type serialize

* activation turned into comp

* sloth review

* Update timer.yml

* small changes

---------

Co-authored-by: CommieFlowers <rasmus.cedergren@hotmail.com>
Co-authored-by: rolfero <45628623+rolfero@users.noreply.github.com>
This commit is contained in:
Nemanja
2023-04-19 03:47:01 -04:00
committed by GitHub
parent 7fe07fb01d
commit 31851e5468
67 changed files with 1256 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ using Content.Shared.Doors.Systems;
using Content.Shared.Interaction;
using Robust.Server.GameObjects;
using Content.Shared.Wires;
using Content.Server.MachineLinking.Events;
using Content.Server.MachineLinking.System;
namespace Content.Server.Doors.Systems
{
@@ -15,12 +17,15 @@ namespace Content.Server.Doors.Systems
{
[Dependency] private readonly WiresSystem _wiresSystem = default!;
[Dependency] private readonly PowerReceiverSystem _power = default!;
[Dependency] private readonly SignalLinkerSystem _signalSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AirlockComponent, ComponentInit>(OnAirlockInit);
SubscribeLocalEvent<AirlockComponent, SignalReceivedEvent>(OnSignalReceived);
SubscribeLocalEvent<AirlockComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<AirlockComponent, DoorStateChangedEvent>(OnStateChanged);
SubscribeLocalEvent<AirlockComponent, BeforeDoorOpenedEvent>(OnBeforeDoorOpened);
@@ -28,6 +33,7 @@ namespace Content.Server.Doors.Systems
SubscribeLocalEvent<AirlockComponent, ActivateInWorldEvent>(OnActivate, before: new [] {typeof(DoorSystem)});
SubscribeLocalEvent<AirlockComponent, DoorGetPryTimeModifierEvent>(OnGetPryMod);
SubscribeLocalEvent<AirlockComponent, BeforeDoorPryEvent>(OnDoorPry);
}
private void OnAirlockInit(EntityUid uid, AirlockComponent component, ComponentInit args)
@@ -38,6 +44,14 @@ namespace Content.Server.Doors.Systems
}
}
private void OnSignalReceived(EntityUid uid, AirlockComponent component, SignalReceivedEvent args)
{
if (args.Port == component.AutoClosePort)
{
component.AutoClose = false;
}
}
private void OnPowerChanged(EntityUid uid, AirlockComponent component, ref PowerChangedEvent args)
{
if (TryComp<AppearanceComponent>(uid, out var appearanceComponent))