From 29028868e02b0e5afef0a1ada9193084ff8ae27e Mon Sep 17 00:00:00 2001 From: Finket Date: Wed, 21 Feb 2024 17:05:57 +0200 Subject: [PATCH] Fix shadowkin actions! --- .../Events/ShadowkinEvents.Powers.cs | 91 ------------------ .../Systems/ShadowkinPowerSystem.DarkSwap.cs | 1 - .../Systems/ShadowkinPowerSystem.Rest.cs | 2 +- .../Systems/ShadowkinPowerSystem.Teleport.cs | 4 +- .../Shadowkin/Systems/ShadowkinSystem.cs | 2 - .../Events/ShadowkinEvents.Powers.cs | 93 ++++++++++++++++++- .../Entities/Mobs/Player/shadowkin.yml | 1 - .../SimpleStation14/Magic/shadowkin.yml | 12 +-- 8 files changed, 101 insertions(+), 105 deletions(-) delete mode 100644 Content.Server/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs deleted file mode 100644 index ea28c1915d..0000000000 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Content.Shared.Actions; -using Content.Shared.Magic; -using Robust.Shared.Audio; - -namespace Content.Server.SimpleStation14.Species.Shadowkin.Events; - -/// -/// Raised when the shadowkin teleport action is used. -/// -public sealed partial class ShadowkinTeleportEvent : WorldTargetActionEvent, ISpeakSpell -{ - [DataField("sound")] - public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/teleport.ogg"); - - [DataField("volume")] - public float Volume = 5f; - - - [DataField("powerCost")] - public float PowerCost = 40f; - - [DataField("staminaCost")] - public float StaminaCost = 20f; - - - [DataField("speech")] - public string? Speech { get; set; } -} - -/// -/// Raised when the shadowkin darkSwap action is used. -/// -public sealed partial class ShadowkinDarkSwapEvent : InstantActionEvent, ISpeakSpell -{ - [DataField("soundOn")] - public SoundSpecifier SoundOn = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/darkswapon.ogg"); - - [DataField("volumeOn")] - public float VolumeOn = 5f; - - [DataField("soundOff")] - public SoundSpecifier SoundOff = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/darkswapoff.ogg"); - - [DataField("volumeOff")] - public float VolumeOff = 5f; - - - /// - /// How much stamina to drain when darkening. - /// - [DataField("powerCostOn")] - public float PowerCostOn = 60f; - - /// - /// How much stamina to drain when lightening. - /// - [DataField("powerCostOff")] - public float PowerCostOff = 45f; - - /// - /// How much stamina to drain when darkening. - /// - [DataField("staminaCostOn")] - public float StaminaCostOn; - - /// - /// How much stamina to drain when lightening. - /// - [DataField("staminaCostOff")] - public float StaminaCostOff; - - - [DataField("speech")] - public string? Speech { get; set; } -} - -public sealed class ShadowkinDarkSwapAttemptEvent : CancellableEntityEventArgs -{ - EntityUid Performer; - - public ShadowkinDarkSwapAttemptEvent(EntityUid performer) - { - Performer = performer; - } -} - - -public sealed partial class ShadowkinRestEvent: InstantActionEvent -{ - -} diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs index 83747fe12f..a34980f2fa 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs @@ -3,7 +3,6 @@ using Content.Server.NPC.Components; using Content.Server.NPC.Systems; using Content.Server.SimpleStation14.Species.Shadowkin.Components; -using Content.Server.SimpleStation14.Species.Shadowkin.Events; using Content.Shared.Actions; using Content.Shared.CombatMode.Pacification; using Content.Shared.Cuffs.Components; diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs index 6f57ab90bc..af4f80d9c8 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs @@ -1,9 +1,9 @@ using Content.Server.SimpleStation14.Species.Shadowkin.Components; -using Content.Server.SimpleStation14.Species.Shadowkin.Events; using Content.Shared.Actions; using Content.Shared.Bed.Sleep; using Content.Shared.Cuffs.Components; using Content.Shared.SimpleStation14.Species.Shadowkin.Components; +using Content.Shared.SimpleStation14.Species.Shadowkin.Events; using Robust.Shared.Prototypes; namespace Content.Server.SimpleStation14.Species.Shadowkin.Systems; diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs index 83e38ef11e..6fa7b03184 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs @@ -1,12 +1,12 @@ using Content.Server.Magic; using Content.Server.Pulling; using Content.Server.SimpleStation14.Species.Shadowkin.Components; -using Content.Server.SimpleStation14.Species.Shadowkin.Events; using Content.Shared.Actions; using Content.Shared.Cuffs.Components; using Content.Shared.Damage.Systems; using Content.Shared.Pulling.Components; using Content.Shared.SimpleStation14.Species.Shadowkin.Components; +using Content.Shared.SimpleStation14.Species.Shadowkin.Events; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; @@ -66,7 +66,7 @@ private void Teleport(EntityUid uid, ShadowkinTeleportPowerComponent component, var transform = Transform(args.Performer); if (transform.MapID != args.Target.GetMapId(EntityManager)) return; - + SharedPullableComponent? pullable = null; // To avoid "might not be initialized when accessed" warning if (_entity.TryGetComponent(args.Performer, out var puller) && puller.Pulling != null && diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.cs index 7963331c1b..d33a11f68c 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinSystem.cs @@ -1,7 +1,5 @@ using System.Numerics; using Content.Server.Mind; -using Content.Shared.Mind.Components; -using Content.Server.SimpleStation14.Species.Shadowkin.Events; using Content.Shared.Bed.Sleep; using Content.Shared.Cuffs.Components; using Content.Shared.Examine; diff --git a/Content.Shared/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs b/Content.Shared/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs index 83385e205e..c3a1b118be 100644 --- a/Content.Shared/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs +++ b/Content.Shared/SimpleStation14/Species/Shadowkin/Events/ShadowkinEvents.Powers.cs @@ -1,7 +1,98 @@ -using Robust.Shared.Serialization; +using Content.Shared.Actions; +using Content.Shared.Magic; +using Robust.Shared.Audio; +using Robust.Shared.Serialization; namespace Content.Shared.SimpleStation14.Species.Shadowkin.Events; + +/// +/// Raised when the shadowkin teleport action is used. +/// +public sealed partial class ShadowkinTeleportEvent : WorldTargetActionEvent, ISpeakSpell +{ + [DataField("sound")] + public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/teleport.ogg"); + + [DataField("volume")] + public float Volume = 5f; + + + [DataField("powerCost")] + public float PowerCost = 40f; + + [DataField("staminaCost")] + public float StaminaCost = 20f; + + + [DataField("speech")] + public string? Speech { get; set; } +} + +/// +/// Raised when the shadowkin darkSwap action is used. +/// +public sealed partial class ShadowkinDarkSwapEvent : InstantActionEvent, ISpeakSpell +{ + [DataField("soundOn")] + public SoundSpecifier SoundOn = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/darkswapon.ogg"); + + [DataField("volumeOn")] + public float VolumeOn = 5f; + + [DataField("soundOff")] + public SoundSpecifier SoundOff = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/darkswapoff.ogg"); + + [DataField("volumeOff")] + public float VolumeOff = 5f; + + + /// + /// How much stamina to drain when darkening. + /// + [DataField("powerCostOn")] + public float PowerCostOn = 60f; + + /// + /// How much stamina to drain when lightening. + /// + [DataField("powerCostOff")] + public float PowerCostOff = 45f; + + /// + /// How much stamina to drain when darkening. + /// + [DataField("staminaCostOn")] + public float StaminaCostOn; + + /// + /// How much stamina to drain when lightening. + /// + [DataField("staminaCostOff")] + public float StaminaCostOff; + + + [DataField("speech")] + public string? Speech { get; set; } +} + +public sealed class ShadowkinDarkSwapAttemptEvent : CancellableEntityEventArgs +{ + EntityUid Performer; + + public ShadowkinDarkSwapAttemptEvent(EntityUid performer) + { + Performer = performer; + } +} + + +public sealed partial class ShadowkinRestEvent: InstantActionEvent +{ + +} + + /// /// Raised over network to notify the client that they're going in/out of The Dark. /// diff --git a/Resources/Prototypes/SimpleStation14/Entities/Mobs/Player/shadowkin.yml b/Resources/Prototypes/SimpleStation14/Entities/Mobs/Player/shadowkin.yml index e96e67a191..b71a8cd139 100644 --- a/Resources/Prototypes/SimpleStation14/Entities/Mobs/Player/shadowkin.yml +++ b/Resources/Prototypes/SimpleStation14/Entities/Mobs/Player/shadowkin.yml @@ -113,7 +113,6 @@ - type: NpcFactionMember factions: - NanoTrasen - - type: MailReceiver - type: InteractionPopup successChance: 0.75 interactFailureString: petting-failure-generic diff --git a/Resources/Prototypes/SimpleStation14/Magic/shadowkin.yml b/Resources/Prototypes/SimpleStation14/Magic/shadowkin.yml index 07ff9babb2..a029e421b1 100644 --- a/Resources/Prototypes/SimpleStation14/Magic/shadowkin.yml +++ b/Resources/Prototypes/SimpleStation14/Magic/shadowkin.yml @@ -7,13 +7,13 @@ useDelay: 5 range: 32 itemIconStyle: NoItem - checkCanAccess: true - repeat: true - priority: -20 icon: sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi state: teleport - serverEvent: !type:ShadowkinTeleportEvent + checkCanAccess: true + repeat: true + priority: -20 + event: !type:ShadowkinTeleportEvent powerCost: 40 staminaCost: 20 speech: action-description-shadowkin-teleport @@ -30,7 +30,7 @@ icon: sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi state: darkswap - serverEvent: !type:ShadowkinDarkSwapEvent + event: !type:ShadowkinDarkSwapEvent powerCostOn: 60 powerCostOff: 45 staminaCostOn: 25 @@ -50,4 +50,4 @@ sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi state: rest checkCanInteract: false - serverEvent: !type:ShadowkinRestEvent + event: !type:ShadowkinRestEvent