Files
tbd-station-14/Content.Server/GameObjects/Components/Mobs/State/DeadMobState.cs
metalgearsloth 70ac46ee09 Make dead bodies use CollisionWake (#4119)
* Make dead bodies use CollisionWake

* Disable CanCollide fuckery

* Update Content.Shared/GameObjects/Components/Mobs/State/SharedDeadMobState.cs

Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
2021-06-05 09:23:24 +02:00

36 lines
1.0 KiB
C#

using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Alert;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Mobs.State;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Physics;
namespace Content.Server.GameObjects.Components.Mobs.State
{
public class DeadMobState : SharedDeadMobState
{
public override void EnterState(IEntity entity)
{
base.EnterState(entity);
if (entity.TryGetComponent(out AppearanceComponent? appearance))
{
appearance.SetData(DamageStateVisuals.State, DamageState.Dead);
}
if (entity.TryGetComponent(out ServerAlertsComponent? status))
{
status.ShowAlert(AlertType.HumanDead);
}
if (entity.TryGetComponent(out StunnableComponent? stun))
{
stun.CancelAll();
}
EntitySystem.Get<StandingStateSystem>().Down(entity);
}
}
}