using Content.Shared._RMC14.Attachable.Systems; using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Utility; namespace Content.Shared._RMC14.Attachable.Components; [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [Access(typeof(AttachableToggleableSystem))] public sealed partial class AttachableToggleableComponent : Component { /// /// Whether the attachment is currently active. /// [DataField, AutoNetworkedField] public bool Active = false; /// /// If set to true, the attachment will deactivate upon switching hands. /// [DataField, AutoNetworkedField] public bool NeedHand = false; /// /// If set to true, the attachment will not toggle itself when its action is interrupted. Used in cases where the item toggles itself separately, like scopes. /// [DataField, AutoNetworkedField] public bool DoInterrupt = false; /// /// If set to true, the attachment will deactivate upon moving. /// [DataField, AutoNetworkedField] public bool BreakOnMove = false; /// /// If set to true, the attachment will deactivate upon rotating to any direction other than the one it was activated in. /// [DataField, AutoNetworkedField] public bool BreakOnRotate = false; /// /// If set to true, the attachment will deactivate upon rotating 90 degrees away from the one it was activated in. /// [DataField, AutoNetworkedField] public bool BreakOnFullRotate = false; /// /// If set to true, the attachment will deactivate upon being dropped. /// [DataField, AutoNetworkedField] public bool BreakOnDrop = false; /// /// If set to true, the attachment will slow the user upon being toggled due to any source but toggling it manually. /// [DataField, AutoNetworkedField] public bool SlowOnBreak = false; /// /// If set to true, the attachment can only be toggled when the holder is wielded. /// [DataField, AutoNetworkedField] public bool WieldedOnly = false; /// /// If set to true, the attachment can only be used when the holder is wielded. /// [DataField, AutoNetworkedField] public bool WieldedUseOnly = false; /// /// If set to true, the attachment can only be activated when someone is holding it. /// [DataField, AutoNetworkedField] public bool HeldOnlyActivate = false; /// /// Only the person holding or wearing the holder can activate this attachment. /// [DataField, AutoNetworkedField] public bool UserOnly = false; [DataField, AutoNetworkedField] public TimeSpan UseDelay = TimeSpan.FromSeconds(0f); [DataField, AutoNetworkedField] public float DoAfter; [DataField, AutoNetworkedField] public float? DeactivateDoAfter; [DataField, AutoNetworkedField] public bool DoAfterNeedHand = true; [DataField, AutoNetworkedField] public bool DoAfterBreakOnMove = true; [DataField, AutoNetworkedField] public AttachableInstantToggleConditions InstantToggle = AttachableInstantToggleConditions.None; /// /// If set to true, this attachment will block some of the holder's functionality when active and perform it instead. /// Used for attached weapons, like the UGL. /// [DataField, AutoNetworkedField] public bool SupercedeHolder = false; /// /// If set to true, this attachment's functions only work when it's attached to a holder. /// [DataField, AutoNetworkedField] public bool AttachedOnly = false; [DataField, AutoNetworkedField] public SoundSpecifier? ActivateSound = new SoundPathSpecifier("/Audio/_RMC14/Attachable/attachment_activate.ogg"); [DataField, AutoNetworkedField] public SoundSpecifier? DeactivateSound = new SoundPathSpecifier("/Audio/_RMC14/Attachable/attachment_deactivate.ogg"); [DataField, AutoNetworkedField] public bool ShowTogglePopup = true; [DataField, AutoNetworkedField] public LocId ActivatePopupText = new LocId("attachable-popup-activate-generic"); [DataField, AutoNetworkedField] public LocId DeactivatePopupText = new LocId("attachable-popup-deactivate-generic"); [DataField, AutoNetworkedField] public EntityUid? Action; [DataField, AutoNetworkedField] public string ActionId = "CMActionToggleAttachable"; [DataField, AutoNetworkedField] public string ActionName = "Toggle Attachable"; [DataField, AutoNetworkedField] public string ActionDesc = "Toggle an attachable. If you're seeing this, someone forgot to set the description properly."; [DataField, AutoNetworkedField] public EntityWhitelist? ActionsToRelayWhitelist; [DataField, AutoNetworkedField] public SpriteSpecifier Icon = new SpriteSpecifier.Rsi(new ResPath("_RMC14/Objects/Weapons/Guns/Attachments/rail.rsi"), "flashlight"); [DataField, AutoNetworkedField] public SpriteSpecifier? IconActive; [DataField, AutoNetworkedField] public bool Attached = false; } public enum AttachableInstantToggleConditions : byte { None = 0, Brace = 1 << 0 }