using Content.Shared.Damage; using Content.Shared.Ninja.Systems; using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Ninja.Components; /// /// Component for stunning mobs on click outside of harm mode. /// Knocks them down for a bit and deals shock damage. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedStunProviderSystem))] public sealed partial class StunProviderComponent : Component { /// /// The powercell entity to take power from. /// Determines whether stunning is possible. /// [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public EntityUid? BatteryUid; /// /// Sound played when stunning someone. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public SoundSpecifier Sound = new SoundCollectionSpecifier("sparks"); /// /// Joules required in the battery to stun someone. Defaults to 10 uses on a small battery. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float StunCharge = 36f; /// /// Damage dealt when stunning someone /// [DataField, ViewVariables(VVAccess.ReadWrite)] public DamageSpecifier StunDamage = new() { DamageDict = new() { { "Shock", 5 } } }; /// /// Time that someone is stunned for, stacks if done multiple times. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public TimeSpan StunTime = TimeSpan.FromSeconds(5); /// /// How long stunning is disabled after stunning something. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public TimeSpan Cooldown = TimeSpan.FromSeconds(2); /// /// Locale string to popup when there is no power /// [DataField(required: true), ViewVariables(VVAccess.ReadWrite)] public string NoPowerPopup = string.Empty; /// /// Whitelist for what counts as a mob. /// [DataField] public EntityWhitelist Whitelist = new() { Components = new[] {"Stamina"} }; /// /// When someone can next be stunned. /// Essentially a UseDelay unique to this component. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] public TimeSpan NextStun = TimeSpan.Zero; }