using Content.Shared.Actions; using Content.Shared.Actions.ActionTypes; using Content.Shared.Ninja.Systems; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Utility; namespace Content.Shared.Ninja.Components; // TODO: ResourcePath -> ResPath when thing gets merged /// /// Component for ninja suit abilities and power consumption. /// As an implementation detail, dashing with katana is a suit action which isn't ideal. /// [Access(typeof(SharedNinjaSuitSystem))] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class NinjaSuitComponent : Component { [ViewVariables, AutoNetworkedField] public bool Cloaked = false; /// /// The action for toggling suit phase cloak ability /// [DataField("togglePhaseCloakAction")] public InstantAction TogglePhaseCloakAction = new() { UseDelay = TimeSpan.FromSeconds(5), // have to plan un/cloaking ahead of time DisplayName = "action-name-toggle-phase-cloak", Description = "action-desc-toggle-phase-cloak", Priority = -9, Event = new TogglePhaseCloakEvent() }; /// /// Battery charge used passively, in watts. Will last 1000 seconds on a small-capacity power cell. /// [DataField("passiveWattage")] public float PassiveWattage = 0.36f; /// /// Battery charge used while cloaked, stacks with passive. Will last 200 seconds while cloaked on a small-capacity power cell. /// [DataField("cloakWattage")] public float CloakWattage = 1.44f; /// /// The action for creating throwing soap, in place of ninja throwing stars since embedding doesn't exist. /// [DataField("createSoapAction")] public InstantAction CreateSoapAction = new() { UseDelay = TimeSpan.FromSeconds(10), Icon = new SpriteSpecifier.Rsi(new ResourcePath("Objects/Specific/Janitorial/soap.rsi"), "soap"), ItemIconStyle = ItemActionIconStyle.NoItem, DisplayName = "action-name-create-soap", Description = "action-desc-create-soap", Priority = -10, Event = new CreateSoapEvent() }; /// /// Battery charge used to create a throwing soap. Can do it 25 times on a small-capacity power cell. /// [DataField("soapCharge")] public float SoapCharge = 14.4f; /// /// Soap item to create with the action /// [DataField("soapPrototype", customTypeSerializer: typeof(PrototypeIdSerializer))] public string SoapPrototype = "SoapNinja"; /// /// The action for recalling a bound energy katana /// [DataField("recallkatanaAction")] public InstantAction RecallKatanaAction = new() { UseDelay = TimeSpan.FromSeconds(1), Icon = new SpriteSpecifier.Rsi(new ResourcePath("Objects/Weapons/Melee/energykatana.rsi"), "icon"), ItemIconStyle = ItemActionIconStyle.NoItem, DisplayName = "action-name-recall-katana", Description = "action-desc-recall-katana", Priority = -11, Event = new RecallKatanaEvent() }; /// /// The action for dashing somewhere using katana /// [DataField("katanaDashAction")] public WorldTargetAction KatanaDashAction = new() { Icon = new SpriteSpecifier.Rsi(new ResourcePath("Objects/Magic/magicactions.rsi"), "blink"), ItemIconStyle = ItemActionIconStyle.NoItem, DisplayName = "action-name-katana-dash", Description = "action-desc-katana-dash", Priority = -12, Event = new KatanaDashEvent(), // doing checks manually CheckCanAccess = false, Range = 0f }; /// /// The action for creating an EMP burst /// [DataField("empAction")] public InstantAction EmpAction = new() { Icon = new SpriteSpecifier.Rsi(new ResourcePath("Objects/Weapons/Grenades/empgrenade.rsi"), "icon"), ItemIconStyle = ItemActionIconStyle.BigAction, DisplayName = "action-name-em-burst", Description = "action-desc-em-burst", Priority = -13, Event = new NinjaEmpEvent() }; /// /// Battery charge used to create an EMP burst. Can do it 2 times on a small-capacity power cell. /// [DataField("empCharge")] public float EmpCharge = 180f; /// /// Range of the EMP in tiles. /// [DataField("empRange")] public float EmpRange = 6f; /// /// Power consumed from batteries by the EMP /// [DataField("empConsumption")] public float EmpConsumption = 100000f; } public sealed class TogglePhaseCloakEvent : InstantActionEvent { } public sealed class CreateSoapEvent : InstantActionEvent { } public sealed class RecallKatanaEvent : InstantActionEvent { } public sealed class NinjaEmpEvent : InstantActionEvent { }