Refactors stunnable to be ECS. (#4819)
Also cleans up StandingStatesystem.
This commit is contained in:
committed by
GitHub
parent
19a588a70a
commit
6eee256b11
9
Content.Client/Stunnable/StunSystem.cs
Normal file
9
Content.Client/Stunnable/StunSystem.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Content.Shared.Stunnable;
|
||||
|
||||
namespace Content.Client.Stunnable
|
||||
{
|
||||
public sealed class StunSystem : SharedStunSystem
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Stunnable;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Stunnable
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedStunnableComponent))]
|
||||
public class StunnableComponent : SharedStunnableComponent
|
||||
{
|
||||
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (curState is not StunnableComponentState state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
StunnedTimer = state.StunnedTimer;
|
||||
KnockdownTimer = state.KnockdownTimer;
|
||||
SlowdownTimer = state.SlowdownTimer;
|
||||
|
||||
WalkModifierOverride = state.WalkModifierOverride;
|
||||
RunModifierOverride = state.RunModifierOverride;
|
||||
|
||||
if (Owner.TryGetComponent(out MovementSpeedModifierComponent? movement))
|
||||
{
|
||||
movement.RefreshMovementSpeedModifiers();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user