Delta-v/Content.Server/MobState/States/DeadMobState.cs

32 lines
976 B
C#

using Content.Server.Alert;
using Content.Server.Stunnable;
using Content.Server.Stunnable.Components;
using Content.Shared.Alert;
using Content.Shared.MobState;
using Content.Shared.MobState.State;
using Content.Shared.StatusEffect;
using Content.Shared.Stunnable;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
namespace Content.Server.MobState.States
{
public class DeadMobState : SharedDeadMobState
{
public override void EnterState(EntityUid uid, IEntityManager entityManager)
{
base.EnterState(uid, entityManager);
if (entityManager.TryGetComponent(uid, out ServerAlertsComponent? status))
{
status.ShowAlert(AlertType.HumanDead);
}
if (entityManager.TryGetComponent(uid, out StatusEffectsComponent? stun))
{
EntitySystem.Get<StatusEffectsSystem>().TryRemoveStatusEffect(uid, "Stun");
}
}
}
}