Action Cooldowns Reset on Rejuvenate (#22149)
* ActionComponents subscribe to RejuvenateEvent, resets cooldowns * forgo a line * Update Content.Shared/Actions/SharedActionsSystem.cs Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ using Robust.Shared.GameStates;
|
|||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Content.Shared.Rejuvenate;
|
||||||
|
|
||||||
namespace Content.Shared.Actions;
|
namespace Content.Shared.Actions;
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ public abstract class SharedActionsSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<ActionsComponent, DidEquipHandEvent>(OnHandEquipped);
|
SubscribeLocalEvent<ActionsComponent, DidEquipHandEvent>(OnHandEquipped);
|
||||||
SubscribeLocalEvent<ActionsComponent, DidUnequipEvent>(OnDidUnequip);
|
SubscribeLocalEvent<ActionsComponent, DidUnequipEvent>(OnDidUnequip);
|
||||||
SubscribeLocalEvent<ActionsComponent, DidUnequipHandEvent>(OnHandUnequipped);
|
SubscribeLocalEvent<ActionsComponent, DidUnequipHandEvent>(OnHandUnequipped);
|
||||||
|
SubscribeLocalEvent<ActionsComponent, RejuvenateEvent>(OnRejuventate);
|
||||||
|
|
||||||
SubscribeLocalEvent<ActionsComponent, ComponentShutdown>(OnShutdown);
|
SubscribeLocalEvent<ActionsComponent, ComponentShutdown>(OnShutdown);
|
||||||
|
|
||||||
@@ -163,6 +165,14 @@ public abstract class SharedActionsSystem : EntitySystem
|
|||||||
Dirty(actionId.Value, action);
|
Dirty(actionId.Value, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnRejuventate(EntityUid uid, ActionsComponent component, RejuvenateEvent args)
|
||||||
|
{
|
||||||
|
foreach (var act in component.Actions)
|
||||||
|
{
|
||||||
|
ClearCooldown(act);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region ComponentStateManagement
|
#region ComponentStateManagement
|
||||||
protected virtual void UpdateAction(EntityUid? actionId, BaseActionComponent? action = null)
|
protected virtual void UpdateAction(EntityUid? actionId, BaseActionComponent? action = null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user