using Content.Shared.Actions; using Content.Shared.Actions.ActionTypes; using Content.Shared.Ninja.Systems; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization; namespace Content.Shared.Ninja.Components; /// /// Component for a Space Ninja's katana, controls its dash sound. /// Requires a ninja with a suit for abilities to work. /// // basically emag but without immune tag, TODO: make the charge thing its own component and have emag use it too [Access(typeof(EnergyKatanaSystem))] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class EnergyKatanaComponent : Component { public EntityUid? Ninja = null; /// /// Sound played when using dash action. /// [DataField("blinkSound")] public SoundSpecifier BlinkSound = new SoundPathSpecifier("/Audio/Magic/blink.ogg"); /// /// Volume control for katana dash action. /// [DataField("blinkVolume")] public float BlinkVolume = 5f; /// /// The maximum number of dash charges the katana can have /// [DataField("maxCharges"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public int MaxCharges = 3; /// /// The current number of dash charges on the katana /// [DataField("charges"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public int Charges = 3; /// /// Whether or not the katana automatically recharges over time. /// [DataField("autoRecharge"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public bool AutoRecharge = true; /// /// The time it takes to regain a single dash charge /// [DataField("rechargeDuration"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public TimeSpan RechargeDuration = TimeSpan.FromSeconds(20); /// /// The time when the next dash charge will be added /// [DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public TimeSpan NextChargeTime = TimeSpan.MaxValue; } public sealed class KatanaDashEvent : WorldTargetActionEvent { }