using Content.Shared.Alert; using Content.Shared.FixedPoint; using Content.Shared.Mobs.Systems; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.Mobs.Components; [RegisterComponent, NetworkedComponent] [Access(typeof(MobThresholdSystem))] public sealed partial class MobThresholdsComponent : Component { [DataField("thresholds", required: true)] public SortedDictionary Thresholds = new(); [DataField("triggersAlerts")] public bool TriggersAlerts = true; [DataField("currentThresholdState")] public MobState CurrentThresholdState; /// /// The health alert that should be displayed for player controlled entities. /// Used for alternate health alerts (silicons, for example) /// [DataField("stateAlertDict")] public Dictionary> StateAlertDict = new() { {MobState.Alive, "HumanHealth"}, {MobState.Critical, "HumanCrit"}, {MobState.Dead, "HumanDead"}, }; [DataField] public ProtoId HealthAlertCategory = "Health"; /// /// Whether or not this entity should display damage overlays (robots don't feel pain, black out etc.) /// [DataField("showOverlays")] public bool ShowOverlays = true; /// /// Whether or not this entity can be revived out of a dead state. /// [DataField("allowRevives")] public bool AllowRevives; } [Serializable, NetSerializable] public sealed class MobThresholdsComponentState : ComponentState { public Dictionary UnsortedThresholds; public bool TriggersAlerts; public MobState CurrentThresholdState; public Dictionary> StateAlertDict; public bool ShowOverlays; public bool AllowRevives; public MobThresholdsComponentState(Dictionary unsortedThresholds, bool triggersAlerts, MobState currentThresholdState, Dictionary> stateAlertDict, bool showOverlays, bool allowRevives) { UnsortedThresholds = unsortedThresholds; TriggersAlerts = triggersAlerts; CurrentThresholdState = currentThresholdState; StateAlertDict = stateAlertDict; ShowOverlays = showOverlays; AllowRevives = allowRevives; } }