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,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Alert;
using Content.Shared.Rejuvenate;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
@@ -22,6 +23,7 @@ namespace Content.Shared.StatusEffect
SubscribeLocalEvent<StatusEffectsComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<StatusEffectsComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<StatusEffectsComponent, RejuvenateEvent>(OnRejuvenate);
}
public override void Update(float frameTime)
@@ -82,6 +84,11 @@ namespace Content.Shared.StatusEffect
}
}
private void OnRejuvenate(EntityUid uid, StatusEffectsComponent component, RejuvenateEvent args)
{
TryRemoveAllStatusEffects(uid, component);
}
/// <summary>
/// Tries to add a status effect to an entity, with a given component added as well.
/// </summary>