using Content.Shared.Damage;
using Robust.Shared.GameStates;
namespace Content.Shared.Mobs.Components;
///
/// When attached to an ,
/// 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.
///
[RegisterComponent]
[NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class MobStateComponent : Component
{
///
/// Whether this mob will be allowed to issue movement commands when in the Critical MobState.
///
[DataField]
public bool AllowMovementWhileCrit = false;
///
/// Whether this mob will be allowed to issue movement commands when in the Soft-Crit MobState.
///
[DataField]
public bool AllowMovementWhileSoftCrit = false;
///
/// Whether this mob will be allowed to issue movement commands when in the Dead MobState.
/// This is provided for completeness sake, and *probably* shouldn't be used by default.
///
[DataField]
public bool AllowMovementWhileDead;
///
/// WWDP - Whether this mob will be allowed to break from being pulled.
///
[DataField]
public bool AllowBreakingPullingWhileCrit;
[DataField]
public bool AllowBreakingPullingWhileSoftCrit;
[DataField]
public bool AllowBreakingPullingWhileDead;
///
/// Whether this mob will be allowed to talk while in the Critical MobState.
///
[DataField]
public bool AllowTalkingWhileCrit = true;
///
/// Whether this mob will be allowed to talk while in the SoftCritical MobState.
///
[DataField]
public bool AllowTalkingWhileSoftCrit = true;
///
/// Whether this mob will be allowed to talk while in the Dead MobState.
/// This is provided for completeness sake, and *probably* shouldn't be used by default.
///
[DataField]
public bool AllowTalkingWhileDead;
///
/// Whether this mob is forced to be downed when entering the Critical MobState.
///
[DataField]
public bool DownWhenCrit = true;
///
/// Whether this mob is forced to be downed when entering the SoftCritical MobState.
///
[DataField]
public bool DownWhenSoftCrit = true;
///
/// Whether this mob is forced to be downed when entering the Dead MobState.
///
[DataField]
public bool DownWhenDead = true;
///
/// Whether this mob is allowed to perform hand interactions while in the Critical MobState.
///
[DataField]
public bool AllowHandInteractWhileCrit;
///
/// Whether this mob is allowed to perform hand interactions while in the SoftCritical MobState.
///
[DataField]
public bool AllowHandInteractWhileSoftCrit;
///
/// Whether this mob is allowed to perform hand interactions while in the Dead MobState.
/// This is provided for completeness sake, and *probably* shouldn't be used by default.
///
[DataField]
public bool AllowHandInteractWhileDead;
//default mobstate is always the lowest state level
[AutoNetworkedField, ViewVariables]
public MobState CurrentState { get; set; } = MobState.Alive;
[DataField]
[AutoNetworkedField]
public HashSet AllowedStates = new()
{
MobState.Alive,
MobState.Critical,
MobState.SoftCritical,
MobState.Dead
};
}