mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00:00
24 lines
618 B
C#
24 lines
618 B
C#
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared._DV.Traits.Effects;
|
|
|
|
/// <summary>
|
|
/// Effect that adds status effects to the player entity.
|
|
/// </summary>
|
|
public sealed partial class ApplyStatusEffect : BaseTraitEffect
|
|
{
|
|
/// <summary>
|
|
/// The status effects to add to the entity.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public HashSet<EntProtoId> StatusEffects = new();
|
|
|
|
public override void Apply(TraitEffectContext ctx)
|
|
{
|
|
foreach (var effect in StatusEffects)
|
|
{
|
|
ctx.StatusEffects.TrySetStatusEffectDuration(ctx.Player, effect);
|
|
}
|
|
}
|
|
}
|