This commit is contained in:
Janet Blackquill
2025-11-21 00:32:28 -05:00
parent 340f6b02b3
commit d1d939a898
53 changed files with 577 additions and 475 deletions

View File

@@ -1,24 +1,29 @@
using Content.Shared.EntityEffects;
using Content.Shared.StatusEffectNew.Components;
using Content.Shared.StatusEffectNew;
using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class RemoveStatusEffect : EntityEffect
public sealed partial class RemoveStatusEffect : EntityEffectBase<RemoveStatusEffect>
{
[DataField(required: true)]
public EntProtoId EffectProto;
public override void Effect(EntityEffectBaseArgs args)
{
args.EntityManager.System<StatusEffectsSystem>()
.TryRemoveStatusEffect(args.TargetEntity, EffectProto);
}
/// <inheritdoc />
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
Loc.GetString(
"reagent-effect-guidebook-status-effect-remove",
"entity-effect-guidebook-status-effect-remove",
("chance", Probability),
("key", prototype.Index(EffectProto).Name));
}
public sealed class RemoveStatusEffectEntityEffectSystem : EntityEffectSystem<StatusEffectContainerComponent, RemoveStatusEffect>
{
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
protected override void Effect(Entity<StatusEffectContainerComponent> ent, ref EntityEffectEvent<RemoveStatusEffect> args)
{
_statusEffects.TryRemoveStatusEffect(ent, args.Effect.EffectProto);
}
}