CatStation/Content.Shared/Mobs/Components/MobStateComponent.cs
ScarKy0 0f46f12599
Move DamageOverlay to an Entity System + Component (#45165)
* may god have mercy upon my soul

* stuff

* Revert "Always raise MobStateChanged on client (#45103)"

This reverts commit 1951b00875.

* keep the cleanup

* fuck you though

* review

* Update Content.Shared/DamageOverlay/SharedDamageOverlaySystem.cs

Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com>

* deltas

* queries

---------

Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com>
2026-08-10 13:27:15 +00:00

31 lines
1 KiB
C#

using Content.Shared.Damage.Components;
using Content.Shared.Mobs.Systems;
using Robust.Shared.GameStates;
namespace Content.Shared.Mobs.Components;
/// <summary>
/// When attached to an <see cref="DamageableComponent"/>,
/// this component will handle critical and death behaviors for mobs.
/// Additionally, it handles sending effects to clients
/// (such as blur effect for unconsciousness) and managing the health HUD.
/// </summary>
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
[Access(typeof(MobStateSystem), typeof(MobThresholdSystem))]
public sealed partial class MobStateComponent : Component
{
/// <summary>
/// The current mob state the entity is in.
/// </summary>
[DataField, AutoNetworkedField]
public MobState CurrentState = MobState.Alive; //default mobstate is always the lowest state level
[DataField, AutoNetworkedField]
public HashSet<MobState> AllowedStates = new()
{
MobState.Alive,
MobState.Critical,
MobState.Dead
};
}