Files
OldThink/Content.Shared/Doors/Components/FirelockComponent.cs
ThereDrD0 164251ffa7 Cherrypicks 5 (#399)
* Give moldy food the "Trash" tag (#29380)

Make moldy food items have the "Trash" tag, so they can be collected.

* Add "Structure" tag to switches, buttons, and levers (#29378)
shit
Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>

* Revamped Meteor Swarm (#28974)

* meteor code and balanced values

* Meteor Swarms

* Update meteors.yml

* Update meteors.yml

* HOO! (fix overkill bug and buff space dust)

* undo BloodstreamComponent.cs changes

* DamageDistribution -> DamageTypes

* part 2.

* meteor fixes

* improve meteor spawning (#29057)

* Decrease meteor frequency (#29194)

* Make Projectiles Only Hit a Variety of Station Objects Unless Clicked on (#28571)

* Revert "Make Projectiles Only Hit a Variety of Station Objects Unless Clicked on (#28571)"

This reverts commit 4f934f02f17ce55cabc03b965eb1df7738d63148.

* Makes machine parts stackable, removes unused field in stack prototypes (#28434)

* Makes machine parts stacks, removes unused field in stack prototypes

* forgor

* Fix tests

* Fixes lathe construction. Yes. This sucks but there's no better way that doesnt involve refactoring machine parts completely

* detail

* a

* Add pressure and temperature warning text to firelocks (#28341)

* fix firelocks

* missing nukies can be filled in by ghost roles (#28316)

* Revert "missing nukies can be filled in by ghost roles (#28316)"

This reverts commit 99f13e1e45bc778a4941316fde5d89d7b91337ce.

* welding gas mask (#27108)

* welding gas mask

* eek

* Canes + Cane Blade for Syndicate Librarians (#25873)

* Cane + Cane Blade

* Add - type: ContainerContainer

* Add another - type: ContainerContainer

* Fix and add proper ContainerContainer component

* Add UserInterface component

* Remove Space

* Stat Changes

* review

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>

* Fix stupid NPC. (#26868)

* init commit

* Review

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>

* fixes

---------

Co-authored-by: VeritableCalamity <34698192+Veritable-Calamity@users.noreply.github.com>
Co-authored-by: eoineoineoin <github@eoinrul.es>
Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
Co-authored-by: Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com>
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: Ps3Moira <113228053+ps3moira@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
2024-06-30 10:04:27 +03:00

86 lines
3.1 KiB
C#

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>
/// <returns></returns>
[DataField("lockedPryTimeModifier"), ViewVariables(VVAccess.ReadWrite)]
public float LockedPryTimeModifier = 1.5f;
/// <summary>
/// Maximum pressure difference before the firelock will refuse to open, in kPa.
/// </summary>
[DataField("pressureThreshold"), ViewVariables(VVAccess.ReadWrite)]
public float PressureThreshold = 20;
/// <summary>
/// Maximum temperature difference before the firelock will refuse to open, in k.
/// </summary>
[DataField("temperatureThreshold"), ViewVariables(VVAccess.ReadWrite)]
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("alarmAutoClose"), ViewVariables(VVAccess.ReadWrite)]
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
}
}