using Content.Shared.Actions; using Content.Shared.Actions.ActionTypes; using Content.Shared.DoAfter; using Content.Shared.Ninja.Systems; using Content.Shared.Tag; using Content.Shared.Toggleable; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Utility; using System.Threading; namespace Content.Shared.Ninja.Components; /// /// Component for toggling glove powers. /// Powers being enabled is controlled by GlovesEnabledComponent /// [Access(typeof(SharedNinjaGlovesSystem))] [RegisterComponent, NetworkedComponent] public sealed class NinjaGlovesComponent : Component { /// /// Entity of the ninja using these gloves, usually means enabled /// [ViewVariables] public EntityUid? User; /// /// The action for toggling ninja gloves abilities /// [DataField("toggleAction")] public InstantAction ToggleAction = new() { DisplayName = "action-name-toggle-ninja-gloves", Description = "action-desc-toggle-ninja-gloves", Priority = -13, Event = new ToggleActionEvent() }; } /// /// Component for emagging doors on click, when gloves are enabled. /// Only works on entities with DoorComponent. /// [RegisterComponent] public sealed class NinjaDoorjackComponent : Component { /// /// The tag that marks an entity as immune to doorjacking /// [DataField("emagImmuneTag", customTypeSerializer: typeof(PrototypeIdSerializer))] public string EmagImmuneTag = "EmagImmune"; } /// /// Component for stunning mobs on click, when gloves are enabled. /// Knocks them down for a bit and deals shock damage. /// [RegisterComponent] public sealed class NinjaStunComponent : Component { /// /// Joules required in the suit to stun someone. Defaults to 10 uses on a small battery. /// [DataField("stunCharge")] public float StunCharge = 36.0f; /// /// Shock damage dealt when stunning someone /// [DataField("stunDamage")] public int StunDamage = 5; /// /// Time that someone is stunned for, stacks if done multiple times. /// [DataField("stunTime")] public TimeSpan StunTime = TimeSpan.FromSeconds(3); } /// /// Component for draining power from APCs/substations/SMESes, when gloves are enabled. /// [RegisterComponent] public sealed class NinjaDrainComponent : Component { /// /// Conversion rate between joules in a device and joules added to suit. /// Should be very low since powercells store nothing compared to even an APC. /// [DataField("drainEfficiency")] public float DrainEfficiency = 0.001f; /// /// Time that the do after takes to drain charge from a battery, in seconds /// [DataField("drainTime")] public float DrainTime = 1f; [DataField("sparkSound")] public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks"); } /// /// Component for downloading research nodes from a R&D server, when gloves are enabled. /// Requirement for greentext. /// [RegisterComponent] public sealed class NinjaDownloadComponent : Component { /// /// Time taken to download research from a server /// [DataField("downloadTime")] public float DownloadTime = 20f; } /// /// Component for hacking a communications console to call in a threat. /// Called threat is rolled from the ninja gamerule config. /// [RegisterComponent] public sealed class NinjaTerrorComponent : Component { /// /// Time taken to hack the console /// [DataField("terrorTime")] public float TerrorTime = 20f; } /// /// DoAfter event for drain ability. /// [Serializable, NetSerializable] public sealed class DrainDoAfterEvent : SimpleDoAfterEvent { } /// /// DoAfter event for research download ability. /// [Serializable, NetSerializable] public sealed class DownloadDoAfterEvent : SimpleDoAfterEvent { } /// /// DoAfter event for comms console terror ability. /// [Serializable, NetSerializable] public sealed class TerrorDoAfterEvent : SimpleDoAfterEvent { }