Files
Delta-v/Content.Shared/Charges/Components/LimitedChargesComponent.cs
T
deltanedasanddeltanedas 9d3d6c8334 fix kitsune action (#3715)
* fix kitsune action

* fix DisableWhenEmpty

* teleport fires instead of deleting and spawning

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2025-05-11 16:13:12 +01:00

34 lines
1.2 KiB
C#

using Content.Shared.Charges.Systems;
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
{
[DataField, AutoNetworkedField]
public int LastCharges;
/// <summary>
/// The max charges this action has.
/// </summary>
[DataField, AutoNetworkedField, Access(Other = AccessPermissions.Read)]
public int MaxCharges = 3;
/// <summary>
/// Last time charges was changed. Used to derive current charges.
/// </summary>
[DataField(customTypeSerializer:typeof(TimeOffsetSerializer)), AutoNetworkedField]
public TimeSpan LastUpdate;
/// <summary>
/// DeltaV - If disabled the action will not disable when no charges remain. Use if you want to handle no charges differently.
/// </summary>
[DataField]
public bool DisableWhenEmpty = true;
}