using Content.Shared.Charges.Systems; using Content.Shared.Popups; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Charges.Components; /// /// Specifies the attached action has discrete charges, separate to a cooldown. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedChargesSystem))] public sealed partial class LimitedChargesComponent : Component { /// /// Localization ID of the popup shown when the entity has no charges left. /// [DataField] public LocId? OnFailPopup; /// /// The type the fail popup should show up as. /// [DataField] public PopupType OnFailPopupType = PopupType.SmallCaution; [DataField, AutoNetworkedField] public int LastCharges; /// /// The max charges this action has. /// [DataField, AutoNetworkedField] public int MaxCharges = 3; /// /// Last time charges was changed. Used to derive current charges. /// [DataField(customTypeSerializer:typeof(TimeOffsetSerializer)), AutoNetworkedField] public TimeSpan LastUpdate; }