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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user