Updated references from SharedStatusEffectsSystem to StatusEffectsSystem in spell and magic weakness systems to use the correct status effects system implementation.
30 lines
859 B
C#
30 lines
859 B
C#
using Content.Shared.StatusEffectNew;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared._CP14.MagicSpell.Spells;
|
|
|
|
public sealed partial class CP14SpellApplyStatusEffect : CP14SpellEffect
|
|
{
|
|
[DataField(required: true)]
|
|
public EntProtoId StatusEffect = default;
|
|
|
|
[DataField(required: true)]
|
|
public TimeSpan Duration = TimeSpan.FromSeconds(1f);
|
|
|
|
[DataField]
|
|
public bool Refresh = true;
|
|
|
|
public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args)
|
|
{
|
|
if (args.Target is null)
|
|
return;
|
|
|
|
var effectSys = entManager.System<StatusEffectsSystem>();
|
|
|
|
if (!Refresh)
|
|
effectSys.TryAddStatusEffectDuration(args.Target.Value, StatusEffect, Duration);
|
|
else
|
|
effectSys.TrySetStatusEffectDuration(args.Target.Value, StatusEffect, Duration);
|
|
}
|
|
}
|