Files
ss14-wl/Content.Server/Jobs/ApplyStatusEffectSpecial.cs
SlamBamActionman d0a784b9e6 Add status effect support to Traits, change PainNumbness to be a status effect (#41646)
* Initial commit

* Review comments

* Jobify

* Prototype(effect)
2025-12-03 11:55:29 +00:00

28 lines
823 B
C#

using Content.Shared.Roles;
using Content.Shared.StatusEffectNew;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
namespace Content.Server.Jobs;
/// <summary>
/// Adds permanent status effects to the entity.
/// TODO: Move this, and other JobSpecials, from Server to Shared.
/// </summary>
[UsedImplicitly]
public sealed partial class ApplyStatusEffectSpecial : JobSpecial
{
[DataField(required: true)]
public HashSet<EntProtoId> StatusEffects { get; private set; } = new();
public override void AfterEquip(EntityUid mob)
{
var entMan = IoCManager.Resolve<IEntityManager>();
var statusSystem = entMan.System<StatusEffectsSystem>();
foreach (var effect in StatusEffects)
{
statusSystem.TrySetStatusEffectDuration(mob, effect);
}
}
}