Files
Delta-v/Content.Server/Light/Components/EmergencyLightComponent.cs
T
a635429d3e Communications console & screens overhaul (#5954)
* i'm going insane from screens

* some wiring

* screemes

* holy shit adhd lock-in

* incomplete

* its FUCKING DONE

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* zeta

* mrrrp

* test fix

* fix arrivals

* fix misnetwork

* Fix iteration outline. Fixed all headers showing if all options where hidden. Added access requirement to keycard auth mechnism. Added countdown. Fixed ninja and fugitive. Fixed AI and aghost.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vanessa <vanessalouwagie@gmail.com>
2026-08-27 13:37:40 -05:00

70 lines
1.9 KiB
C#

using Content.Server.Light.EntitySystems;
using Content.Shared.Light.Components;
namespace Content.Server.Light.Components;
/// <summary>
/// Component that represents an emergency light, it has an internal battery that charges when the power is on.
/// </summary>
[RegisterComponent, Access(typeof(EmergencyLightSystem))]
public sealed partial class EmergencyLightComponent : SharedEmergencyLightComponent
{
[ViewVariables]
public EmergencyLightState State;
/// <summary>
/// Is this emergency light forced on for some reason and cannot be disabled through normal means
/// (i.e. blue alert or higher?)
/// </summary>
public bool ForciblyEnabled = false;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("wattage")]
public float Wattage = 5;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("chargingWattage")]
public float ChargingWattage = 60;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("chargingEfficiency")]
public float ChargingEfficiency = 0.85f;
// Begin DeltaV Additions
[DataField]
public float MaydayRadius = 10f;
[DataField]
public float MaydayFalloff = 0f;
[DataField]
public float MaydayEnergy = 0.7f;
// End DeltaV Additions
public Dictionary<EmergencyLightState, string> BatteryStateText = new()
{
{ EmergencyLightState.Full, "emergency-light-component-light-state-full" },
{ EmergencyLightState.Empty, "emergency-light-component-light-state-empty" },
{ EmergencyLightState.Charging, "emergency-light-component-light-state-charging" },
{ EmergencyLightState.On, "emergency-light-component-light-state-on" }
};
}
public enum EmergencyLightState : byte
{
Charging,
Full,
Empty,
On
}
public sealed class EmergencyLightEvent : EntityEventArgs
{
public EmergencyLightState State { get; }
public EmergencyLightEvent(EmergencyLightState state)
{
State = state;
}
}