refactor: rework the new status effect system to use containers (#38915)

This commit is contained in:
Perry Fraser
2025-07-12 12:49:58 -04:00
committed by GitHub
parent ad34d88a49
commit dbfe05d5cc
18 changed files with 244 additions and 214 deletions

View File

@@ -1,4 +1,3 @@
using Content.Server.StatusEffectNew;
using Content.Shared.Bed.Sleep;
using Content.Shared.Drowsiness;
using Content.Shared.StatusEffectNew;

View File

@@ -1,23 +0,0 @@
using Content.Shared.StatusEffectNew;
using Content.Shared.StatusEffectNew.Components;
namespace Content.Server.StatusEffectNew;
/// <inheritdoc/>
public sealed partial class StatusEffectsSystem : SharedStatusEffectsSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StatusEffectContainerComponent, ComponentShutdown>(OnContainerShutdown);
}
private void OnContainerShutdown(Entity<StatusEffectContainerComponent> ent, ref ComponentShutdown args)
{
foreach (var effect in ent.Comp.ActiveStatusEffects)
{
QueueDel(effect);
}
}
}

View File

@@ -1,5 +1,5 @@
using Content.Server.StatusEffectNew;
using Content.Shared.Bed.Sleep;
using Content.Shared.StatusEffectNew;
using Robust.Shared.Random;
namespace Content.Server.Traits.Assorted;