CatStation/Content.Shared/Charges/Components/LimitedChargesComponent.cs
ScarKy0 091180655d
Changeling Chemicals (#45239)
* initially works i think

* yeah

* pulled these numbers outta my ass

* text

* silly

* fixy fix

* fix

* This sure is a videogame

* init test fuck everything

* sprites

* fix dirty

* query

* another query

* craftable changeling sting

* remove todo

* \n

* doc
2026-08-19 19:25:16 +00:00

40 lines
1.2 KiB
C#

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;
/// <summary>
/// Specifies the attached action has discrete charges, separate to a cooldown.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedChargesSystem))]
public sealed partial class LimitedChargesComponent : Component
{
/// <summary>
/// Localization ID of the popup shown when the entity has no charges left.
/// </summary>
[DataField]
public LocId? OnFailPopup;
/// <summary>
/// The type the fail popup should show up as.
/// </summary>
[DataField]
public PopupType OnFailPopupType = PopupType.SmallCaution;
[DataField, AutoNetworkedField]
public int LastCharges;
/// <summary>
/// The max charges this action has.
/// </summary>
[DataField, AutoNetworkedField]
public int MaxCharges = 3;
/// <summary>
/// Last time charges was changed. Used to derive current charges.
/// </summary>
[DataField(customTypeSerializer:typeof(TimeOffsetSerializer)), AutoNetworkedField]
public TimeSpan LastUpdate;
}