Files
tbd-station-14/Content.Server/Medical/Components/HealingComponent.cs
2022-02-07 14:14:45 +11:00

39 lines
1.4 KiB
C#

using System.Threading;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables;
namespace Content.Server.Medical.Components
{
/// <summary>
/// Applies a damage change to the target when used in an interaction.
/// </summary>
[RegisterComponent]
public sealed class HealingComponent : Component
{
[DataField("damage", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier Damage = default!;
/// <remarks>
/// The supported damage types are specified using a <see cref="DamageContainerPrototype"/>s. For a
/// HealingComponent this filters what damage container type this component should work on. If null,
/// all damage container types are supported.
/// </remarks>
[DataField("damageContainer", customTypeSerializer: typeof(PrototypeIdSerializer<DamageContainerPrototype>))]
public string? DamageContainerID;
/// <summary>
/// How long it takes to apply the damage.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("delay")]
public float Delay = 3f;
public CancellationTokenSource? CancelToken = null;
}
}