using Content.Shared.DeviceLinking; using Content.Shared.Doors.Systems; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Shared.Doors.Components; /// /// Companion component to DoorComponent that handles airlock-specific behavior -- wires, requiring power to operate, bolts, and allowing automatic closing. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [Access(typeof(SharedAirlockSystem), Friend = AccessPermissions.ReadWriteExecute, Other = AccessPermissions.Read)] public sealed partial class AirlockComponent : Component { // Need to network airlock safety state to avoid mis-predicts when a door auto-closes as the client walks through the door. [ViewVariables(VVAccess.ReadWrite)] [DataField, AutoNetworkedField] public bool Safety = true; [ViewVariables(VVAccess.ReadWrite)] [DataField] public bool EmergencyAccess = false; /// /// Pry modifier for a powered airlock. /// Most anything that can pry powered has a pry speed bonus, /// so this default is closer to 6 effectively on e.g. jaws (9 seconds when applied to other default.) /// [DataField] public float PoweredPryModifier = 9f; /// /// Whether the maintenance panel should be visible even if the airlock is opened. /// [DataField] public bool OpenPanelVisible = false; /// /// Whether the airlock should stay open if the airlock was clicked. /// If the airlock was bumped into it will still auto close. /// [DataField] public bool KeepOpenIfClicked = false; /// /// Whether the airlock should auto close. This value is reset every time the airlock closes. /// [ViewVariables(VVAccess.ReadWrite)] public bool AutoClose = true; /// /// Delay until an open door automatically closes. /// [DataField] public TimeSpan AutoCloseDelay = TimeSpan.FromSeconds(5f); /// /// Multiplicative modifier for the auto-close delay. Can be modified by hacking the airlock wires. Setting to /// zero will disable auto-closing. /// [ViewVariables(VVAccess.ReadWrite)] public float AutoCloseDelayModifier = 1.0f; /// /// The receiver port for turning off automatic closing. /// [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] public string AutoClosePort = "AutoClose"; #region Graphics /// /// Whether the door lights should be visible. /// [DataField] public bool OpenUnlitVisible = false; /// /// Whether the door should display emergency access lights. /// [DataField] public bool EmergencyAccessLayer = true; /// /// Whether or not to animate the panel when the door opens or closes. /// [DataField] public bool AnimatePanel = true; /// /// The sprite state used to animate the airlock frame when the airlock opens. /// [DataField] public string OpeningSpriteState = "opening_unlit"; /// /// The sprite state used to animate the airlock panel when the airlock opens. /// [DataField] public string OpeningPanelSpriteState = "panel_opening"; /// /// The sprite state used to animate the airlock frame when the airlock closes. /// [DataField] public string ClosingSpriteState = "closing_unlit"; /// /// The sprite state used to animate the airlock panel when the airlock closes. /// [DataField] public string ClosingPanelSpriteState = "panel_closing"; /// /// The sprite state used for the open airlock lights. /// [DataField] public string OpenSpriteState = "open_unlit"; /// /// The sprite state used for the closed airlock lights. /// [DataField] public string ClosedSpriteState = "closed_unlit"; /// /// The sprite state used for the 'access denied' lights animation. /// [DataField] public string DenySpriteState = "deny_unlit"; /// /// How long the animation played when the airlock denies access is in seconds. /// [DataField] public float DenyAnimationTime = 0.3f; #endregion Graphics }