emag refactor (#15181)
* limitedcharges stuff from emag * changes except broken * fix * the * move recharging to server, emag namespace -> charges * the * use resolve * pro webedit gaming * the * the --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
25
Content.Server/Charges/Components/AutoRechargeComponent.cs
Normal file
25
Content.Server/Charges/Components/AutoRechargeComponent.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Content.Server.Charges.Systems;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.Charges.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Something with limited charges that can be recharged automatically.
|
||||
/// Requires LimitedChargesComponent to function.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(ChargesSystem))]
|
||||
public sealed class AutoRechargeComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The time it takes to regain a single charge
|
||||
/// </summary>
|
||||
[DataField("rechargeDuration"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan RechargeDuration = TimeSpan.FromSeconds(90);
|
||||
|
||||
/// <summary>
|
||||
/// The time when the next charge will be added
|
||||
/// </summary>
|
||||
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan NextChargeTime = TimeSpan.MaxValue;
|
||||
}
|
||||
Reference in New Issue
Block a user