feat: add a component for rejuvenateable status effects (#39025)

* feat: add a component for rejuvenateable effects

* feat: let god mode'd entities get buffs

* fix: handle old status effect system

Didn't realize BeforeStatusEffectAddedEvent was called by both systems,
oops.

* refactor: rename to RejuvenateRemovedStatusEffect

* fix: make forced sleeping a debuff again

Missed in rebase.

* refactor: make BeforeStatusEffectAdded two events
This commit is contained in:
Perry Fraser
2025-07-24 11:13:29 -04:00
committed by GitHub
parent 82c0f63d50
commit b0e1ce7c0c
7 changed files with 63 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Rejuvenate;
using Content.Shared.StatusEffectNew.Components;
using Content.Shared.Whitelist;
using Robust.Shared.Containers;
@@ -32,6 +33,8 @@ public sealed partial class StatusEffectsSystem : EntitySystem
SubscribeLocalEvent<StatusEffectContainerComponent, EntInsertedIntoContainerMessage>(OnEntityInserted);
SubscribeLocalEvent<StatusEffectContainerComponent, EntRemovedFromContainerMessage>(OnEntityRemoved);
SubscribeLocalEvent<RejuvenateRemovedStatusEffectComponent, StatusEffectRelayedEvent<RejuvenateEvent>>(OnRejuvenate);
_containerQuery = GetEntityQuery<StatusEffectContainerComponent>();
_effectQuery = GetEntityQuery<StatusEffectComponent>();
}
@@ -115,6 +118,12 @@ public sealed partial class StatusEffectsSystem : EntitySystem
Dirty(args.Entity, statusComp);
}
private void OnRejuvenate(Entity<RejuvenateRemovedStatusEffectComponent> ent,
ref StatusEffectRelayedEvent<RejuvenateEvent> args)
{
PredictedQueueDel(ent.Owner);
}
private void SetStatusEffectTime(EntityUid effect, TimeSpan? duration)
{
if (!_effectQuery.TryComp(effect, out var effectComp))