Give player species slight passive regen (#20638)
* Implementation * Reviews
This commit is contained in:
40
Content.Shared/Damage/Components/PassiveDamageComponent.cs
Normal file
40
Content.Shared/Damage/Components/PassiveDamageComponent.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Passively damages the entity on a specified interval.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class PassiveDamageComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The entitys' states that passive damage will apply in
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<MobState> AllowedStates = new();
|
||||
|
||||
/// <summary>
|
||||
/// Damage / Healing per interval dealt to the entity every interval
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier Damage = new();
|
||||
|
||||
/// <summary>
|
||||
/// Delay between damage events in seconds
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Interval = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum HP the damage will be given to. If 0, disabled.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public FixedPoint2 DamageCap = 0;
|
||||
|
||||
[DataField("nextDamage", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan NextDamage = TimeSpan.Zero;
|
||||
}
|
||||
Reference in New Issue
Block a user