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,5 +1,6 @@
#nullable enable
using Content.Shared.Alert;
using Content.Shared.Hands;
using Content.Shared.Standing;
using Robust.Shared.GameObjects;
@@ -20,13 +21,20 @@ namespace Content.Shared.MobState.State
{
status.ShowAlert(AlertType.HumanCrit); // TODO: combine humancrit-0 and humancrit-1 into a gif and display it
}
EntitySystem.Get<StandingStateSystem>().Down(entity);
if (entity.TryGetComponent(out SharedAppearanceComponent? appearance))
{
appearance.SetData(DamageStateVisuals.State, DamageState.Critical);
}
}
public override void ExitState(IEntity entity)
{
base.ExitState(entity);
EntitySystem.Get<SharedStandingStateSystem>().Standing(entity);
EntitySystem.Get<StandingStateSystem>().Stand(entity);
}
public override bool CanInteract()