* fix: spellbooks can have charges ≠ 3 * refactor: just make setting MaxCharges an api thing * refactor: don't auto-add LimitedCharges * Small stuff --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
28 lines
915 B
C#
28 lines
915 B
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]
|
|
public int MaxCharges = 3;
|
|
|
|
/// <summary>
|
|
/// Last time charges was changed. Used to derive current charges.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer:typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
|
public TimeSpan LastUpdate;
|
|
}
|