using Content.Shared.Atmos.EntitySystems; using Content.Shared.DoAfter; using Content.Shared.Tools; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.Atmos.Components; /// /// Contains layer data for atmos pipes. Layers allow multiple atmos pipes with the /// same orientation to be anchored to the same tile without their contents mixing. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [Access(typeof(SharedAtmosPipeLayersSystem))] public sealed partial class AtmosPipeLayersComponent : Component { /// /// The number of pipe layers this entity supports. /// Must be equal to or less than the number of values /// in . /// [DataField] public byte NumberOfPipeLayers = 3; /// /// Determines which layer the pipe is currently assigned. /// Only pipes on the same layer can connect with each other. /// [DataField("pipeLayer"), AutoNetworkedField] [ViewVariables(VVAccess.ReadOnly)] public AtmosPipeLayer CurrentPipeLayer = AtmosPipeLayer.Primary; /// /// The RSI paths that the entity will use to update its sprite when its pipe layer changes; /// if empty, the entity sprite will not update when it pipe layer changes. /// If you want to set specific sprite layers to update when the pipe layer changes, use /// instead. /// /// /// If the dictionary is not empty there should be an entry for each atmos pipe layer. /// [DataField] public Dictionary SpriteRsiPaths = new(); /// /// Used to update specific sprite layers when the entity's pipe layer changes. /// The dictionary key is the name of the sprite layer to be updated, and its value is /// a second dictionary which contains the RSI paths indexed by pipe layer. /// If you want to change the default RSI path used by the entity, use /// instead. /// /// /// If an dictionary is not empty there should be an entry for each pipe layer. /// [DataField] public Dictionary> SpriteLayersRsiPaths = new(); /// /// Entity prototypes that will be used to replace the current one when using /// position dependent entity placement via AlignAtmosPipeLayers. /// /// /// If the dictionary is not empty there should be an entry for each atmos pipe layer. /// [DataField] public Dictionary AlternativePrototypes = new(); /// /// The pipe layers of this entity cannot be changed when this value is true. /// [DataField] public bool PipeLayersLocked; /// /// Tool quality required to cause a pipe to change layers /// [DataField] public ProtoId Tool = "Screwing"; /// /// The base delay to use for changing layers. /// [DataField] public float Delay = 1f; } /// /// Raised when a player attempts to cycle a pipe to its next layer /// [Serializable, NetSerializable] public sealed partial class TrySetNextPipeLayerCompletedEvent : SimpleDoAfterEvent; /// /// Raised when a player attempts to set a pipe a specified layer /// [Serializable, NetSerializable] public sealed partial class TrySettingPipeLayerCompletedEvent : SimpleDoAfterEvent { public AtmosPipeLayer PipeLayer; public TrySettingPipeLayerCompletedEvent(AtmosPipeLayer pipeLayer) { PipeLayer = pipeLayer; } } [Serializable, NetSerializable] public enum AtmosPipeLayerVisuals { Sprite, SpriteLayers, DrawDepth, } [Serializable, NetSerializable] public enum AtmosPipeLayer { Primary, Secondary, Tertiary, }