using Content.Shared.Alert; using Content.Shared.Damage; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; namespace Content.Server.Atmos.Components { /// /// Barotrauma: injury because of changes in air pressure. /// [RegisterComponent] public sealed partial class BarotraumaComponent : Component { [DataField("damage", required: true)] [ViewVariables(VVAccess.ReadWrite)] public DamageSpecifier Damage = default!; [DataField("maxDamage")] [ViewVariables(VVAccess.ReadWrite)] public FixedPoint2 MaxDamage = 200; /// /// Used to keep track of when damage starts/stops. Useful for logs. /// public bool TakingDamage = false; /// /// These are the inventory slots that are checked for pressure protection. If a slot is missing protection, no protection is applied. /// [DataField("protectionSlots")] public List ProtectionSlots = new() { "head", "outerClothing" }; /// /// Cached pressure protection values /// [ViewVariables] public float HighPressureMultiplier = 1f; [ViewVariables] public float HighPressureModifier = 0f; [ViewVariables] public float LowPressureMultiplier = 1f; [ViewVariables] public float LowPressureModifier = 0f; /// /// Whether the entity is immuned to pressure (i.e possess the PressureImmunity component) /// [ViewVariables(VVAccess.ReadWrite)] public bool HasImmunity = false; [DataField] public ProtoId HighPressureAlert = "HighPressure"; [DataField] public ProtoId LowPressureAlert = "LowPressure"; [DataField] public ProtoId PressureAlertCategory = "Pressure"; } }