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
This commit is contained in:
@@ -25,15 +25,12 @@ public sealed class FirelockSystem : SharedFirelockSystem
|
||||
if (!_appearanceSystem.TryGetData<DoorState>(uid, DoorVisuals.State, out var state, args.Component))
|
||||
state = DoorState.Closed;
|
||||
|
||||
if (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.Powered, out var powered, args.Component) && powered)
|
||||
{
|
||||
boltedVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights;
|
||||
unlitVisible =
|
||||
state == DoorState.Closing
|
||||
|| state == DoorState.Opening
|
||||
|| state == DoorState.Denying
|
||||
|| (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights);
|
||||
}
|
||||
boltedVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights;
|
||||
unlitVisible =
|
||||
state == DoorState.Closing
|
||||
|| state == DoorState.Opening
|
||||
|| state == DoorState.Denying
|
||||
|| (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights);
|
||||
|
||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible && !boltedVisible);
|
||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseBolted, boltedVisible);
|
||||
|
||||
@@ -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<AirtightComponent>();
|
||||
var appearanceQuery = GetEntityQuery<AppearanceComponent>();
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
var pointLightQuery = GetEntityQuery<PointLightComponent>();
|
||||
|
||||
var query = EntityQueryEnumerator<FirelockComponent, DoorComponent>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user