mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* 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
40 lines
1.2 KiB
C#
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;
|
|
}
|