22 lines
599 B
C#
22 lines
599 B
C#
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared._DV.Traits.Effects;
|
|
|
|
/// <summary>
|
|
/// Effect that adds components to the player entity.
|
|
/// Components are added without overwriting existing ones.
|
|
/// </summary>
|
|
public sealed partial class AddCompsEffect : BaseTraitEffect
|
|
{
|
|
/// <summary>
|
|
/// The components to add to the entity.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public ComponentRegistry Components = new();
|
|
|
|
public override void Apply(TraitEffectContext ctx)
|
|
{
|
|
ctx.EntMan.AddComponents(ctx.Player, Components, removeExisting: false);
|
|
}
|
|
}
|