using Content.Server.Power.EntitySystems; using Content.Shared.Power.EntitySystems; namespace Content.Server.Power.Components; /// /// Attached to APC powered entities that possess a rechargeable internal battery. /// If external power is interrupted, the entity will draw power from this battery instead. /// Requires and to function. /// [RegisterComponent] [Access([typeof(PowerNetSystem), typeof(SharedPowerReceiverSystem)])] public sealed partial class ApcPowerReceiverBatteryComponent : Component { /// /// Indicates whether power is currently being drawn from the battery. /// [DataField] public bool Enabled = false; /// /// The passive load the entity places on the APC power network. /// If not connected to an active APC power network, this amount /// of power is drained from the battery every second. /// [DataField] public float IdleLoad { get; set; } = 5f; /// /// Determines how much battery charge the entity's battery gains /// per second when connected to an active APC power network. /// [DataField] public float BatteryRechargeRate { get; set; } = 50f; /// /// While the battery is being recharged, the load this entity places on the APC /// power network is increased by the multiplied /// by this factor. /// [DataField] public float BatteryRechargeEfficiency { get; set; } = 1f; } /// /// Raised whenever an ApcPowerReceiverBattery starts / stops discharging /// [ByRefEvent] public readonly record struct ApcPowerReceiverBatteryChangedEvent(bool Enabled);