* Rename usages of collidable to physics * high tier PANIQUE * aaaaaaaaAAAAAa * cursed commit dont research * Fix urist and items being anchored * Fix the rest
63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
using Content.Server.GameObjects.EntitySystems;
|
|
using Content.Shared.GameObjects.Components.Damage;
|
|
using Content.Shared.GameObjects.Components.Mobs;
|
|
using Content.Shared.GameObjects.Components.Mobs.State;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Shared.GameObjects.Components;
|
|
using Robust.Shared.GameObjects.Systems;
|
|
using Robust.Shared.Interfaces.GameObjects;
|
|
|
|
namespace Content.Server.GameObjects.Components.Mobs.State
|
|
{
|
|
public class DeadState : SharedDeadState
|
|
{
|
|
public override void EnterState(IEntity entity)
|
|
{
|
|
if (entity.TryGetComponent(out AppearanceComponent appearance))
|
|
{
|
|
appearance.SetData(DamageStateVisuals.State, DamageState.Dead);
|
|
}
|
|
|
|
if (entity.TryGetComponent(out ServerStatusEffectsComponent status))
|
|
{
|
|
status.ChangeStatusEffectIcon(StatusEffect.Health,
|
|
"/Textures/Interface/StatusEffects/Human/humandead.png");
|
|
}
|
|
|
|
if (entity.TryGetComponent(out ServerOverlayEffectsComponent overlayComponent))
|
|
{
|
|
overlayComponent.AddOverlay(SharedOverlayID.CircleMaskOverlay);
|
|
}
|
|
|
|
if (entity.TryGetComponent(out StunnableComponent stun))
|
|
{
|
|
stun.CancelAll();
|
|
}
|
|
|
|
EntitySystem.Get<StandingStateSystem>().Down(entity);
|
|
|
|
if (entity.TryGetComponent(out IPhysicsComponent physics))
|
|
{
|
|
physics.CanCollide = false;
|
|
}
|
|
}
|
|
|
|
public override void ExitState(IEntity entity)
|
|
{
|
|
EntitySystem.Get<StandingStateSystem>().Standing(entity);
|
|
|
|
if (entity.TryGetComponent(out IPhysicsComponent physics))
|
|
{
|
|
physics.CanCollide = true;
|
|
}
|
|
|
|
if (entity.TryGetComponent(out ServerOverlayEffectsComponent overlay))
|
|
{
|
|
overlay.ClearOverlays();
|
|
}
|
|
}
|
|
|
|
public override void UpdateState(IEntity entity) { }
|
|
}
|
|
}
|