mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* destroy firelock empty sprites with fury * fix the meta.json * remove unused states * we need all the layers * string? never heard of it * DoorSystem cleanup, FirelockSystem layer checks * DoorComponent cleanup * FirelockComponent cleanup * firelock panel animation * fix offset (-15/16, bad math) * component cleanup and comments * door cleanup * 9-state firelock animations, no locked/deny state * "comments" * dedicated edge firelock panel, null airlock states * screw it, subscriptions for airlocksystem too * format --------- Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com>
136 lines
4.2 KiB
C#
136 lines
4.2 KiB
C#
using Content.Shared.Guidebook;
|
|
using Robust.Shared.GameStates;
|
|
|
|
namespace Content.Shared.Doors.Components;
|
|
|
|
/// <summary>
|
|
/// Companion component to <see cref="DoorComponent"/> that handles firelock-specific behavior, including
|
|
/// auto-closing on depressurization, air/fire alarm interactions, and preventing normal door functions when
|
|
/// retaining pressure..
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
public sealed partial class FirelockComponent : Component
|
|
{
|
|
#region Settings
|
|
|
|
/// <summary>
|
|
/// Pry time modifier to be used when the firelock is currently closed due to fire or pressure.
|
|
/// </summary>
|
|
[DataField]
|
|
public float LockedPryTimeModifier = 1.5f;
|
|
|
|
/// <summary>
|
|
/// Maximum pressure difference before the firelock will refuse to open, in kPa.
|
|
/// </summary>
|
|
[DataField, GuidebookData]
|
|
public float PressureThreshold = 20;
|
|
|
|
/// <summary>
|
|
/// Maximum temperature difference before the firelock will refuse to open, in k.
|
|
/// </summary>
|
|
[DataField, GuidebookData]
|
|
public float TemperatureThreshold = 330;
|
|
// this used to check for hot-spots, but because accessing that data is a a mess this now just checks
|
|
// temperature. This does mean a cold room will trigger hot-air pop-ups
|
|
|
|
/// <summary>
|
|
/// If true, and if this door has an <see cref="AtmosAlarmableComponent"/>, then it will only auto-close if the
|
|
/// alarm is set to danger.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool AlarmAutoClose = true;
|
|
|
|
/// <summary>
|
|
/// The cooldown duration before a firelock can automatically close due to a hazardous environment after it has
|
|
/// been pried open. Measured in seconds.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan EmergencyCloseCooldownDuration = TimeSpan.FromSeconds(2);
|
|
|
|
#endregion
|
|
|
|
#region Set by system
|
|
|
|
/// <summary>
|
|
/// When the firelock will be allowed to automatically close again due to a hazardous environment.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan? EmergencyCloseCooldown;
|
|
|
|
/// <summary>
|
|
/// Whether the firelock can open, or is locked due to its environment.
|
|
/// </summary>
|
|
public bool IsLocked => Pressure || Temperature;
|
|
|
|
/// <summary>
|
|
/// Whether the firelock is holding back a hazardous pressure.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool Pressure;
|
|
|
|
/// <summary>
|
|
/// Whether the firelock is holding back extreme temperatures.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool Temperature;
|
|
|
|
/// <summary>
|
|
/// Whether the airlock is powered.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool Powered;
|
|
|
|
#endregion
|
|
|
|
#region Client animation
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock frame when the airlock opens.
|
|
/// </summary>
|
|
[DataField]
|
|
public string? OpeningLightSpriteState = "opening_unlit";
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock frame when the airlock closes.
|
|
/// </summary>
|
|
[DataField]
|
|
public string? ClosingLightSpriteState = "closing_unlit";
|
|
|
|
/// <summary>
|
|
/// Whether or not the maintenance panel on this door should be animated.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool AnimatePanel = true;
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock panel when the airlock opens.
|
|
/// </summary>
|
|
[DataField]
|
|
public string? OpeningPanelSpriteState = "panel_opening";
|
|
|
|
/// <summary>
|
|
/// The sprite state used to draw when the door is closed, but the panel is open.
|
|
/// </summary>
|
|
[DataField]
|
|
public string? OpenPanelSpriteState = "panel_open";
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock panel when the airlock closes.
|
|
/// </summary>
|
|
[DataField]
|
|
public string? ClosingPanelSpriteState = "panel_closing";
|
|
|
|
/// <summary>
|
|
/// The sprite state used for the closed airlock lights.
|
|
/// </summary>
|
|
[DataField]
|
|
public string? WarningLightSpriteState = "closed_unlit";
|
|
|
|
/// <summary>
|
|
/// The sprite state used for the 'access denied' lights animation.
|
|
/// </summary>
|
|
[DataField]
|
|
public string? DenySpriteState = "deny_unlit";
|
|
|
|
#endregion
|
|
}
|