Event-ify Rejuvenate (#11145)

This commit is contained in:
Visne
2022-09-14 19:30:56 +02:00
committed by GitHub
parent 81eee73995
commit 356a6b8d2e
13 changed files with 100 additions and 61 deletions

View File

@@ -1,3 +1,4 @@
using Content.Shared.Rejuvenate;
using Content.Shared.StatusEffect;
using Robust.Shared.GameStates;
using Robust.Shared.Timing;
@@ -22,6 +23,7 @@ namespace Content.Shared.Jittering
{
SubscribeLocalEvent<JitteringComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<JitteringComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<JitteringComponent, RejuvenateEvent>(OnRejuvenate);
}
private void OnGetState(EntityUid uid, JitteringComponent component, ref ComponentGetState args)
@@ -38,6 +40,11 @@ namespace Content.Shared.Jittering
component.Frequency = jitteringState.Frequency;
}
private void OnRejuvenate(EntityUid uid, JitteringComponent component, RejuvenateEvent args)
{
EntityManager.RemoveComponentDeferred<JitteringComponent>(uid);
}
/// <summary>
/// Applies a jitter effect to the specified entity.
/// You can apply this to any entity whatsoever, so be careful what you use it on!