Refactor standing to be ECS (#4142)

* Refactor standing to be ECS

E C S B A B Y

* DONE

* FIX IT FIX IT FIX IT

* IsDown event

* Change to methods

* Fixes

* Address some reviews

* Last of the Mohicans

* Final fixes

* Fix tests
This commit is contained in:
metalgearsloth
2021-06-27 19:02:46 +10:00
committed by GitHub
parent 97f4f0a9bd
commit 50cc526ebd
30 changed files with 328 additions and 268 deletions

View File

@@ -1,11 +1,10 @@
#nullable enable
using Content.Server.Act;
using Content.Server.Notification;
using Content.Server.Standing;
using Content.Shared.Audio;
using Content.Shared.MobState;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Standing;
using Content.Shared.Stunnable;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
@@ -28,7 +27,7 @@ namespace Content.Server.Stunnable.Components
protected override void OnKnockdownEnd()
{
if(Owner.TryGetComponent(out IMobStateComponent? mobState) && !mobState.IsIncapacitated())
EntitySystem.Get<StandingStateSystem>().Standing(Owner);
EntitySystem.Get<StandingStateSystem>().Stand(Owner);
}
public void CancelAll()
@@ -46,7 +45,7 @@ namespace Content.Server.Stunnable.Components
if (KnockedDown &&
Owner.TryGetComponent(out IMobStateComponent? mobState) && !mobState.IsIncapacitated())
{
EntitySystem.Get<StandingStateSystem>().Standing(Owner);
EntitySystem.Get<StandingStateSystem>().Stand(Owner);
}
KnockdownTimer = null;