From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Sat, 15 Jun 2024 15:17:16 +0000 (-0700) Subject: Make firelock warning light not require power and add a PointLight (#29024) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=789453adf0cf1b3310f75ef3ac5b1240a09be9b8;p=space-station-14.git Make firelock warning light not require power and add a PointLight (#29024) * Add a PointLight to firelocks when warnings are active * Remove power requirement for lights --- diff --git a/Content.Client/Doors/FirelockSystem.cs b/Content.Client/Doors/FirelockSystem.cs index f64b4c8e52..ad869391f4 100644 --- a/Content.Client/Doors/FirelockSystem.cs +++ b/Content.Client/Doors/FirelockSystem.cs @@ -25,15 +25,12 @@ public sealed class FirelockSystem : SharedFirelockSystem if (!_appearanceSystem.TryGetData(uid, DoorVisuals.State, out var state, args.Component)) state = DoorState.Closed; - if (_appearanceSystem.TryGetData(uid, DoorVisuals.Powered, out var powered, args.Component) && powered) - { - boltedVisible = _appearanceSystem.TryGetData(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights; - unlitVisible = - state == DoorState.Closing - || state == DoorState.Opening - || state == DoorState.Denying - || (_appearanceSystem.TryGetData(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights); - } + boltedVisible = _appearanceSystem.TryGetData(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights; + unlitVisible = + state == DoorState.Closing + || state == DoorState.Opening + || state == DoorState.Denying + || (_appearanceSystem.TryGetData(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights); args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible && !boltedVisible); args.Sprite.LayerSetVisible(DoorVisualLayers.BaseBolted, boltedVisible); diff --git a/Content.Server/Doors/Systems/FirelockSystem.cs b/Content.Server/Doors/Systems/FirelockSystem.cs index c7da404fe8..7cb31b5b4e 100644 --- a/Content.Server/Doors/Systems/FirelockSystem.cs +++ b/Content.Server/Doors/Systems/FirelockSystem.cs @@ -6,9 +6,9 @@ using Content.Server.Power.EntitySystems; using Content.Server.Shuttles.Components; using Content.Shared.Atmos; using Content.Shared.Atmos.Monitor; -using Content.Shared.Doors; using Content.Shared.Doors.Components; using Content.Shared.Doors.Systems; +using Robust.Server.GameObjects; using Robust.Shared.Map.Components; namespace Content.Server.Doors.Systems @@ -20,6 +20,7 @@ namespace Content.Server.Doors.Systems [Dependency] private readonly AtmosphereSystem _atmosSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedMapSystem _mapping = default!; + [Dependency] private readonly PointLightSystem _pointLight = default!; private const int UpdateInterval = 30; private int _accumulatedTicks; @@ -53,6 +54,7 @@ namespace Content.Server.Doors.Systems var airtightQuery = GetEntityQuery(); var appearanceQuery = GetEntityQuery(); var xformQuery = GetEntityQuery(); + var pointLightQuery = GetEntityQuery(); var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var firelock, out var door)) @@ -74,6 +76,11 @@ namespace Content.Server.Doors.Systems firelock.Temperature = fire; firelock.Pressure = pressure; Dirty(uid, firelock); + + if (pointLightQuery.TryComp(uid, out var pointLight)) + { + _pointLight.SetEnabled(uid, fire | pressure, pointLight); + } } } } diff --git a/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml b/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml index d6815abcdc..e4b2424301 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml @@ -109,6 +109,12 @@ access: [ [ "Engineering" ] ] - type: PryUnpowered pryModifier: 0.5 + - type: PointLight + energy: 0.5 + radius: 1.75 + color: Red + enabled: false + castShadows: false - type: entity id: Firelock