mob dead state tweaks (#162)

~~well, it SHOULD make mob rotate on death, but it doesn't, i have no idea why~~

- Blocks character movement in crit/death
- rotates character ~~360noscope~~ 90 degrees to convince you it's lying down when dead

resolves #145
resolves #158
related to #115
This commit is contained in:
Injazz
2019-03-27 17:29:06 +05:00
committed by Pieter-Jan Briers
parent 842cb44cd2
commit c5e077efc1
8 changed files with 118 additions and 29 deletions

View File

@@ -0,0 +1,35 @@
using Content.Shared.GameObjects.Components.Mobs;
using SS14.Client.GameObjects;
using SS14.Client.Interfaces.GameObjects.Components;
using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.Maths;
namespace Content.Client.GameObjects.Components.Mobs
{
public class SpeciesVisualizer2D : AppearanceVisualizer
{
public override void InitializeEntity(IEntity entity)
{
base.InitializeEntity(entity);
}
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
var sprite = component.Owner.GetComponent<ISpriteComponent>();
if (component.TryGetData<SharedSpeciesComponent.MobState>(SharedSpeciesComponent.MobVisuals.RotationState, out var state))
{
switch (state)
{
case SharedSpeciesComponent.MobState.Stand:
sprite.Rotation = 0;
break;
case SharedSpeciesComponent.MobState.Down:
sprite.Rotation = Angle.FromDegrees(90);
break;
}
}
}
}
}