Files
tbd-station-14/Content.Server/GameObjects/Components/Mobs/State/CriticalMobState.cs
2021-03-16 15:50:20 +01:00

29 lines
861 B
C#

using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Mobs.State;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Mobs.State
{
public class CriticalMobState : SharedCriticalMobState
{
public override void EnterState(IEntity entity)
{
base.EnterState(entity);
if (entity.TryGetComponent(out AppearanceComponent? appearance))
{
appearance.SetData(DamageStateVisuals.State, DamageState.Critical);
}
if (entity.TryGetComponent(out StunnableComponent? stun))
{
stun.CancelAll();
}
EntitySystem.Get<StandingStateSystem>().Down(entity);
}
}
}