From 7b352643d5dbf45bbd3fb6bac648ad1401a18ff1 Mon Sep 17 00:00:00 2001 From: J Date: Sun, 4 May 2025 18:34:19 +0100 Subject: [PATCH] Refactor magic speak system to be a component added to actions (#36328) --- Content.Server/Magic/MagicSystem.cs | 7 ---- .../EntitySystems/SpeakOnActionSystem.cs | 39 +++++++++++++++++++ .../Magic/Events/ChangeComponentSpellEvent.cs | 7 +--- .../Magic/Events/ChargeSpellEvent.cs | 7 +--- .../Magic/Events/InstantSpawnSpellEvent.cs | 7 +--- .../Magic/Events/KnockSpellEvent.cs | 7 +--- .../Magic/Events/MindSwapSpellEvent.cs | 5 +-- .../Magic/Events/ProjectileSpellEvent.cs | 7 +--- .../Events/RandomGlobalSpawnSpellEvent.cs | 5 +-- .../Magic/Events/SmiteSpellEvent.cs | 7 +--- .../Magic/Events/SpeakSpellEvent.cs | 8 ---- .../Magic/Events/TeleportSpellEvent.cs | 6 +-- .../Magic/Events/VoidApplauseSpellEvent.cs | 7 +--- .../Magic/Events/WorldSpawnSpellEvent.cs | 7 +--- Content.Shared/Magic/ISpeakSpell.cs | 9 ----- Content.Shared/Magic/SharedMagicSystem.cs | 23 ----------- .../Components/SpeakOnActionComponent.cs | 17 ++++++++ .../SharedSpeakOnActionSystem.cs | 13 +++++++ .../Locale/en-US/magic/spells-actions.ftl | 1 + Resources/Prototypes/Magic/animate_spell.yml | 2 - Resources/Prototypes/Magic/event_spells.yml | 6 ++- .../Prototypes/Magic/forcewall_spells.yml | 3 +- Resources/Prototypes/Magic/knock_spell.yml | 3 +- Resources/Prototypes/Magic/mindswap_spell.yml | 3 +- .../Prototypes/Magic/projectile_spells.yml | 9 +++-- Resources/Prototypes/Magic/spawn_spells.yml | 3 +- Resources/Prototypes/Magic/touch_spells.yml | 9 +++-- Resources/Prototypes/Magic/utility_spells.yml | 3 +- 28 files changed, 115 insertions(+), 115 deletions(-) create mode 100644 Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs delete mode 100644 Content.Shared/Magic/Events/SpeakSpellEvent.cs delete mode 100644 Content.Shared/Magic/ISpeakSpell.cs create mode 100644 Content.Shared/Speech/Components/SpeakOnActionComponent.cs create mode 100644 Content.Shared/Speech/EntitySystems/SharedSpeakOnActionSystem.cs diff --git a/Content.Server/Magic/MagicSystem.cs b/Content.Server/Magic/MagicSystem.cs index dafd88dd5f..09f6fd143e 100644 --- a/Content.Server/Magic/MagicSystem.cs +++ b/Content.Server/Magic/MagicSystem.cs @@ -21,13 +21,6 @@ public sealed class MagicSystem : SharedMagicSystem public override void Initialize() { base.Initialize(); - - SubscribeLocalEvent(OnSpellSpoken); - } - - private void OnSpellSpoken(ref SpeakSpellEvent args) - { - _chat.TrySendInGameICMessage(args.Performer, Loc.GetString(args.Speech), InGameICChatType.Speak, false); } public override void OnVoidApplause(VoidApplauseSpellEvent ev) diff --git a/Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs b/Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs new file mode 100644 index 0000000000..ba7043e10c --- /dev/null +++ b/Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs @@ -0,0 +1,39 @@ +using Content.Server.Chat.Systems; +using Content.Shared.Speech.Components; +using Content.Shared.Speech; +using Content.Shared.Speech.EntitySystems; +using Content.Shared.Speech.Muting; +using Content.Shared.Actions.Events; + + +namespace Content.Server.Speech.EntitySystems; + +/// +/// As soon as the chat refactor moves to Shared +/// the logic here can move to the shared +/// +public sealed class SpeakOnActionSystem : SharedSpeakOnActionSystem +{ + [Dependency] private readonly ChatSystem _chat = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnActionPerformed); + } + + private void OnActionPerformed(Entity ent, ref ActionPerformedEvent args) + { + var user = args.Performer; + + // If we can't speak, we can't speak + if (!HasComp(user) || HasComp(user)) + return; + + if (string.IsNullOrWhiteSpace(ent.Comp.Sentence)) + return; + + _chat.TrySendInGameICMessage(user, Loc.GetString(ent.Comp.Sentence), InGameICChatType.Speak, false); + } +} diff --git a/Content.Shared/Magic/Events/ChangeComponentSpellEvent.cs b/Content.Shared/Magic/Events/ChangeComponentSpellEvent.cs index b2b1dc96e8..0354a69911 100644 --- a/Content.Shared/Magic/Events/ChangeComponentSpellEvent.cs +++ b/Content.Shared/Magic/Events/ChangeComponentSpellEvent.cs @@ -6,7 +6,7 @@ namespace Content.Shared.Magic.Events; /// /// Spell that uses the magic of ECS to add & remove components. Components are first removed, then added. /// -public sealed partial class ChangeComponentsSpellEvent : EntityTargetActionEvent, ISpeakSpell +public sealed partial class ChangeComponentsSpellEvent : EntityTargetActionEvent { // TODO allow it to set component data-fields? // for now a Hackish way to do that is to remove & add, but that doesn't allow you to selectively set specific data fields. @@ -19,9 +19,4 @@ public sealed partial class ChangeComponentsSpellEvent : EntityTargetActionEvent [AlwaysPushInheritance] public HashSet ToRemove = new(); - [DataField] - public string? Speech { get; private set; } - - [DataField] - public bool DoSpeech { get; private set; } } diff --git a/Content.Shared/Magic/Events/ChargeSpellEvent.cs b/Content.Shared/Magic/Events/ChargeSpellEvent.cs index 8898761ec2..3d97de2dc7 100644 --- a/Content.Shared/Magic/Events/ChargeSpellEvent.cs +++ b/Content.Shared/Magic/Events/ChargeSpellEvent.cs @@ -1,18 +1,15 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; namespace Content.Shared.Magic.Events; /// /// Adds provided Charge to the held wand /// -public sealed partial class ChargeSpellEvent : InstantActionEvent, ISpeakSpell +public sealed partial class ChargeSpellEvent : InstantActionEvent { [DataField(required: true)] public int Charge; [DataField] public string WandTag = "WizardWand"; - - [DataField] - public string? Speech { get; private set; } } diff --git a/Content.Shared/Magic/Events/InstantSpawnSpellEvent.cs b/Content.Shared/Magic/Events/InstantSpawnSpellEvent.cs index 1405b15827..235a841636 100644 --- a/Content.Shared/Magic/Events/InstantSpawnSpellEvent.cs +++ b/Content.Shared/Magic/Events/InstantSpawnSpellEvent.cs @@ -1,9 +1,9 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; using Robust.Shared.Prototypes; namespace Content.Shared.Magic.Events; -public sealed partial class InstantSpawnSpellEvent : InstantActionEvent, ISpeakSpell +public sealed partial class InstantSpawnSpellEvent : InstantActionEvent { /// /// What entity should be spawned. @@ -14,9 +14,6 @@ public sealed partial class InstantSpawnSpellEvent : InstantActionEvent, ISpeakS [DataField] public bool PreventCollideWithCaster = true; - [DataField] - public string? Speech { get; private set; } - /// /// Gets the targeted spawn positons; may lead to multiple entities being spawned. /// diff --git a/Content.Shared/Magic/Events/KnockSpellEvent.cs b/Content.Shared/Magic/Events/KnockSpellEvent.cs index 24a1700d21..87c02806c9 100644 --- a/Content.Shared/Magic/Events/KnockSpellEvent.cs +++ b/Content.Shared/Magic/Events/KnockSpellEvent.cs @@ -1,8 +1,8 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; namespace Content.Shared.Magic.Events; -public sealed partial class KnockSpellEvent : InstantActionEvent, ISpeakSpell +public sealed partial class KnockSpellEvent : InstantActionEvent { /// /// The range this spell opens doors in @@ -11,7 +11,4 @@ public sealed partial class KnockSpellEvent : InstantActionEvent, ISpeakSpell /// [DataField] public float Range = 10f; - - [DataField] - public string? Speech { get; private set; } } diff --git a/Content.Shared/Magic/Events/MindSwapSpellEvent.cs b/Content.Shared/Magic/Events/MindSwapSpellEvent.cs index 89319090c1..5b23047cfb 100644 --- a/Content.Shared/Magic/Events/MindSwapSpellEvent.cs +++ b/Content.Shared/Magic/Events/MindSwapSpellEvent.cs @@ -2,14 +2,11 @@ using Content.Shared.Actions; namespace Content.Shared.Magic.Events; -public sealed partial class MindSwapSpellEvent : EntityTargetActionEvent, ISpeakSpell +public sealed partial class MindSwapSpellEvent : EntityTargetActionEvent { [DataField] public TimeSpan PerformerStunDuration = TimeSpan.FromSeconds(10); [DataField] public TimeSpan TargetStunDuration = TimeSpan.FromSeconds(10); - - [DataField] - public string? Speech { get; private set; } } diff --git a/Content.Shared/Magic/Events/ProjectileSpellEvent.cs b/Content.Shared/Magic/Events/ProjectileSpellEvent.cs index 336ea03346..917f6ea851 100644 --- a/Content.Shared/Magic/Events/ProjectileSpellEvent.cs +++ b/Content.Shared/Magic/Events/ProjectileSpellEvent.cs @@ -1,16 +1,13 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; using Robust.Shared.Prototypes; namespace Content.Shared.Magic.Events; -public sealed partial class ProjectileSpellEvent : WorldTargetActionEvent, ISpeakSpell +public sealed partial class ProjectileSpellEvent : WorldTargetActionEvent { /// /// What entity should be spawned. /// [DataField(required: true)] public EntProtoId Prototype; - - [DataField] - public string? Speech { get; private set; } } diff --git a/Content.Shared/Magic/Events/RandomGlobalSpawnSpellEvent.cs b/Content.Shared/Magic/Events/RandomGlobalSpawnSpellEvent.cs index eb39c0cd08..dedf538696 100644 --- a/Content.Shared/Magic/Events/RandomGlobalSpawnSpellEvent.cs +++ b/Content.Shared/Magic/Events/RandomGlobalSpawnSpellEvent.cs @@ -4,7 +4,7 @@ using Robust.Shared.Audio; namespace Content.Shared.Magic.Events; -public sealed partial class RandomGlobalSpawnSpellEvent : InstantActionEvent, ISpeakSpell +public sealed partial class RandomGlobalSpawnSpellEvent : InstantActionEvent { /// /// The list of prototypes this spell can spawn, will select one randomly @@ -18,9 +18,6 @@ public sealed partial class RandomGlobalSpawnSpellEvent : InstantActionEvent, IS [DataField] public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Magic/staff_animation.ogg"); - [DataField] - public string? Speech { get; private set; } - /// /// Should this Global spawn spell turn its targets into a Survivor Antagonist? /// Ignores the caster for this. diff --git a/Content.Shared/Magic/Events/SmiteSpellEvent.cs b/Content.Shared/Magic/Events/SmiteSpellEvent.cs index 74ca116ad5..801e65689d 100644 --- a/Content.Shared/Magic/Events/SmiteSpellEvent.cs +++ b/Content.Shared/Magic/Events/SmiteSpellEvent.cs @@ -1,8 +1,8 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; namespace Content.Shared.Magic.Events; -public sealed partial class SmiteSpellEvent : EntityTargetActionEvent, ISpeakSpell +public sealed partial class SmiteSpellEvent : EntityTargetActionEvent { // TODO: Make part of gib method /// @@ -10,7 +10,4 @@ public sealed partial class SmiteSpellEvent : EntityTargetActionEvent, ISpeakSpe /// [DataField] public bool DeleteNonBrainParts = true; - - [DataField] - public string? Speech { get; private set; } } diff --git a/Content.Shared/Magic/Events/SpeakSpellEvent.cs b/Content.Shared/Magic/Events/SpeakSpellEvent.cs deleted file mode 100644 index 1b3f7af63c..0000000000 --- a/Content.Shared/Magic/Events/SpeakSpellEvent.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Content.Shared.Magic.Events; - -[ByRefEvent] -public readonly struct SpeakSpellEvent(EntityUid performer, string speech) -{ - public readonly EntityUid Performer = performer; - public readonly string Speech = speech; -} diff --git a/Content.Shared/Magic/Events/TeleportSpellEvent.cs b/Content.Shared/Magic/Events/TeleportSpellEvent.cs index 525c1e5105..f4cbcecd8f 100644 --- a/Content.Shared/Magic/Events/TeleportSpellEvent.cs +++ b/Content.Shared/Magic/Events/TeleportSpellEvent.cs @@ -1,12 +1,10 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; namespace Content.Shared.Magic.Events; // TODO: Can probably just be an entity or something -public sealed partial class TeleportSpellEvent : WorldTargetActionEvent, ISpeakSpell +public sealed partial class TeleportSpellEvent : WorldTargetActionEvent { - [DataField] - public string? Speech { get; private set; } // TODO: Move to magic component // TODO: Maybe not since sound specifier is a thing diff --git a/Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs b/Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs index c134790da8..bfab0411af 100644 --- a/Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs +++ b/Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs @@ -1,15 +1,12 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; using Content.Shared.Chat.Prototypes; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.Magic.Events; -public sealed partial class VoidApplauseSpellEvent : EntityTargetActionEvent, ISpeakSpell +public sealed partial class VoidApplauseSpellEvent : EntityTargetActionEvent { - [DataField] - public string? Speech { get; private set; } - /// /// Emote to use. /// diff --git a/Content.Shared/Magic/Events/WorldSpawnSpellEvent.cs b/Content.Shared/Magic/Events/WorldSpawnSpellEvent.cs index 2f50c67b3e..90bdcd01aa 100644 --- a/Content.Shared/Magic/Events/WorldSpawnSpellEvent.cs +++ b/Content.Shared/Magic/Events/WorldSpawnSpellEvent.cs @@ -1,4 +1,4 @@ -using System.Numerics; +using System.Numerics; using Content.Shared.Actions; using Content.Shared.Storage; @@ -6,7 +6,7 @@ namespace Content.Shared.Magic.Events; // TODO: This class needs combining with InstantSpawnSpellEvent -public sealed partial class WorldSpawnSpellEvent : WorldTargetActionEvent, ISpeakSpell +public sealed partial class WorldSpawnSpellEvent : WorldTargetActionEvent { /// /// The list of prototypes this spell will spawn @@ -28,7 +28,4 @@ public sealed partial class WorldSpawnSpellEvent : WorldTargetActionEvent, ISpea /// [DataField] public float? Lifetime; - - [DataField] - public string? Speech { get; private set; } } diff --git a/Content.Shared/Magic/ISpeakSpell.cs b/Content.Shared/Magic/ISpeakSpell.cs deleted file mode 100644 index 954b99417f..0000000000 --- a/Content.Shared/Magic/ISpeakSpell.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Content.Shared.Magic; - -public interface ISpeakSpell // The speak n spell interface -{ - /// - /// Localized string spoken by the caster when casting this spell. - /// - public string? Speech { get; } -} diff --git a/Content.Shared/Magic/SharedMagicSystem.cs b/Content.Shared/Magic/SharedMagicSystem.cs index 5bf1fee090..b362b5aa90 100644 --- a/Content.Shared/Magic/SharedMagicSystem.cs +++ b/Content.Shared/Magic/SharedMagicSystem.cs @@ -1,5 +1,4 @@ using System.Numerics; -using Content.Shared.Actions; using Content.Shared.Body.Components; using Content.Shared.Body.Systems; using Content.Shared.Coordinates.Helpers; @@ -141,7 +140,6 @@ public abstract class SharedMagicSystem : EntitySystem SpawnSpellHelper(args.Prototype, position, args.Performer, preventCollide: args.PreventCollideWithCaster); } - Speak(args); args.Handled = true; } @@ -235,7 +233,6 @@ public abstract class SharedMagicSystem : EntitySystem var targetMapCoords = args.Target; WorldSpawnSpellHelper(args.Prototypes, targetMapCoords, args.Performer, args.Lifetime, args.Offset); - Speak(args); args.Handled = true; } @@ -271,7 +268,6 @@ public abstract class SharedMagicSystem : EntitySystem return; ev.Handled = true; - Speak(ev); var xform = Transform(ev.Performer); var fromCoords = xform.Coordinates; @@ -299,8 +295,6 @@ public abstract class SharedMagicSystem : EntitySystem return; ev.Handled = true; - if (ev.DoSpeech) - Speak(ev); RemoveComponents(ev.Target, ev.ToRemove); AddComponents(ev.Target, ev.ToAdd); @@ -324,7 +318,6 @@ public abstract class SharedMagicSystem : EntitySystem _transform.SetCoordinates(args.Performer, args.Target); _transform.AttachToGridOrMap(args.Performer, transform); - Speak(args); args.Handled = true; } @@ -334,7 +327,6 @@ public abstract class SharedMagicSystem : EntitySystem return; ev.Handled = true; - Speak(ev); _transform.SwapPositions(ev.Performer, ev.Target); } @@ -392,7 +384,6 @@ public abstract class SharedMagicSystem : EntitySystem return; ev.Handled = true; - Speak(ev); var direction = _transform.GetMapCoordinates(ev.Target, Transform(ev.Target)).Position - _transform.GetMapCoordinates(ev.Performer, Transform(ev.Performer)).Position; var impulseVector = direction * 10000; @@ -418,7 +409,6 @@ public abstract class SharedMagicSystem : EntitySystem return; args.Handled = true; - Speak(args); var transform = Transform(args.Performer); @@ -457,7 +447,6 @@ public abstract class SharedMagicSystem : EntitySystem } ev.Handled = true; - Speak(ev); if (wand == null || !TryComp(wand, out var basicAmmoComp) || basicAmmoComp.Count == null) return; @@ -475,7 +464,6 @@ public abstract class SharedMagicSystem : EntitySystem return; ev.Handled = true; - Speak(ev); var allHumans = _mind.GetAliveHumans(); @@ -509,7 +497,6 @@ public abstract class SharedMagicSystem : EntitySystem return; ev.Handled = true; - Speak(ev); // Need performer mind, but target mind is unnecessary, such as taking over a NPC // Need to get target mind before putting performer mind into their body if they have one @@ -535,14 +522,4 @@ public abstract class SharedMagicSystem : EntitySystem // End Spells #endregion - // When any spell is cast it will raise this as an event, so then it can be played in server or something. At least until chat gets moved to shared - // TODO: Temp until chat is in shared - private void Speak(BaseActionEvent args) - { - if (args is not ISpeakSpell speak || string.IsNullOrWhiteSpace(speak.Speech)) - return; - - var ev = new SpeakSpellEvent(args.Performer, speak.Speech); - RaiseLocalEvent(ref ev); - } } diff --git a/Content.Shared/Speech/Components/SpeakOnActionComponent.cs b/Content.Shared/Speech/Components/SpeakOnActionComponent.cs new file mode 100644 index 0000000000..3de09932e2 --- /dev/null +++ b/Content.Shared/Speech/Components/SpeakOnActionComponent.cs @@ -0,0 +1,17 @@ +using Content.Shared.Speech.EntitySystems; +using Robust.Shared.GameStates; + +namespace Content.Shared.Speech.Components; + +/// +/// Action components which should write a message to ICChat on use +/// +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedSpeakOnActionSystem))] +public sealed partial class SpeakOnActionComponent : Component +{ + /// + /// The ftl id of the sentence that the user will speak. + /// + [DataField, AutoNetworkedField] + public LocId? Sentence; +} diff --git a/Content.Shared/Speech/EntitySystems/SharedSpeakOnActionSystem.cs b/Content.Shared/Speech/EntitySystems/SharedSpeakOnActionSystem.cs new file mode 100644 index 0000000000..075d336cc4 --- /dev/null +++ b/Content.Shared/Speech/EntitySystems/SharedSpeakOnActionSystem.cs @@ -0,0 +1,13 @@ +using Content.Shared.Chasm; +using Content.Shared.Speech.Components; +using Content.Shared.Speech.Muting; +using System; + +namespace Content.Shared.Speech.EntitySystems; + +/// +/// Once the chat refactor has happened, move the code from +/// +/// to here and set this class to sealed. +/// +public abstract class SharedSpeakOnActionSystem : EntitySystem; diff --git a/Resources/Locale/en-US/magic/spells-actions.ftl b/Resources/Locale/en-US/magic/spells-actions.ftl index 2216018018..11dceef536 100644 --- a/Resources/Locale/en-US/magic/spells-actions.ftl +++ b/Resources/Locale/en-US/magic/spells-actions.ftl @@ -8,3 +8,4 @@ action-speech-spell-summon-magic = RYGOIN FEMA-VERECO action-speech-spell-mind-swap = GIN'YU CAPAN! action-speech-spell-cluwne = !KNOH action-speech-spell-slip = SLEE PARRI! +action-speech-spell-charge = DI'RI CEL! \ No newline at end of file diff --git a/Resources/Prototypes/Magic/animate_spell.yml b/Resources/Prototypes/Magic/animate_spell.yml index 6d1319944b..38c17e0517 100644 --- a/Resources/Prototypes/Magic/animate_spell.yml +++ b/Resources/Prototypes/Magic/animate_spell.yml @@ -74,5 +74,3 @@ - BlockMovement - Item - MeleeRequiresWield - speech: action-speech-spell-animate - doSpeech: false diff --git a/Resources/Prototypes/Magic/event_spells.yml b/Resources/Prototypes/Magic/event_spells.yml index 83bd853a21..91db28bca2 100644 --- a/Resources/Prototypes/Magic/event_spells.yml +++ b/Resources/Prototypes/Magic/event_spells.yml @@ -158,7 +158,8 @@ orGroup: Guns - id: RevolverCapGunFake orGroup: Guns - speech: action-speech-spell-summon-guns + - type: SpeakOnAction + sentence: action-speech-spell-summon-guns - type: entity id: ActionSummonMagic @@ -205,4 +206,5 @@ orGroup: Magics - id: RGBStaff orGroup: Magics - speech: action-speech-spell-summon-magic + - type: SpeakOnAction + sentence: action-speech-spell-summon-magic diff --git a/Resources/Prototypes/Magic/forcewall_spells.yml b/Resources/Prototypes/Magic/forcewall_spells.yml index 3001f71421..7f501ae59b 100644 --- a/Resources/Prototypes/Magic/forcewall_spells.yml +++ b/Resources/Prototypes/Magic/forcewall_spells.yml @@ -14,4 +14,5 @@ event: !type:InstantSpawnSpellEvent prototype: WallForce posData: !type:TargetInFront - speech: action-speech-spell-forcewall + - type: SpeakOnAction + sentence: action-speech-spell-forcewall diff --git a/Resources/Prototypes/Magic/knock_spell.yml b/Resources/Prototypes/Magic/knock_spell.yml index 5ba456d3be..e01c5a57af 100644 --- a/Resources/Prototypes/Magic/knock_spell.yml +++ b/Resources/Prototypes/Magic/knock_spell.yml @@ -12,4 +12,5 @@ sprite: Objects/Magic/magicactions.rsi state: knock event: !type:KnockSpellEvent - speech: action-speech-spell-knock + - type: SpeakOnAction + sentence: action-speech-spell-knock diff --git a/Resources/Prototypes/Magic/mindswap_spell.yml b/Resources/Prototypes/Magic/mindswap_spell.yml index bc2a8d11be..ae0bfa87bc 100644 --- a/Resources/Prototypes/Magic/mindswap_spell.yml +++ b/Resources/Prototypes/Magic/mindswap_spell.yml @@ -18,4 +18,5 @@ sprite: Mobs/Species/Human/organs.rsi state: brain event: !type:MindSwapSpellEvent - speech: action-speech-spell-mind-swap + - type: SpeakOnAction + sentence: action-speech-spell-mind-swap diff --git a/Resources/Prototypes/Magic/projectile_spells.yml b/Resources/Prototypes/Magic/projectile_spells.yml index eee8b1fc8a..1568b3ab65 100644 --- a/Resources/Prototypes/Magic/projectile_spells.yml +++ b/Resources/Prototypes/Magic/projectile_spells.yml @@ -17,7 +17,8 @@ state: fireball event: !type:ProjectileSpellEvent prototype: ProjectileFireball - speech: action-speech-spell-fireball + - type: SpeakOnAction + sentence: action-speech-spell-fireball - type: ActionUpgrade effectedLevels: 2: ActionFireballII @@ -41,7 +42,8 @@ state: fireball event: !type:ProjectileSpellEvent prototype: ProjectileFireball - speech: action-speech-spell-fireball + - type: SpeakOnAction + sentence: action-speech-spell-fireball - type: entity id: ActionFireballIII @@ -61,4 +63,5 @@ state: fireball event: !type:ProjectileSpellEvent prototype: ProjectileFireball - speech: action-speech-spell-fireball + - type: SpeakOnAction + sentence: action-speech-spell-fireball diff --git a/Resources/Prototypes/Magic/spawn_spells.yml b/Resources/Prototypes/Magic/spawn_spells.yml index 76674d5bfa..fb6755212a 100644 --- a/Resources/Prototypes/Magic/spawn_spells.yml +++ b/Resources/Prototypes/Magic/spawn_spells.yml @@ -15,4 +15,5 @@ - id: MobCarpMagic amount: 3 offset: 0, 1 - speech: action-speech-spell-summon-magicarp + - type: SpeakOnAction + sentence: action-speech-spell-summon-magicarp diff --git a/Resources/Prototypes/Magic/touch_spells.yml b/Resources/Prototypes/Magic/touch_spells.yml index 5e20bc2b2b..3eba350dd0 100644 --- a/Resources/Prototypes/Magic/touch_spells.yml +++ b/Resources/Prototypes/Magic/touch_spells.yml @@ -17,7 +17,8 @@ sprite: Objects/Magic/magicactions.rsi state: gib event: !type:SmiteSpellEvent - speech: action-speech-spell-smite + - type: SpeakOnAction + sentence: action-speech-spell-smite - type: Magic requiresClothes: true @@ -47,9 +48,10 @@ sprite: Clothing/Mask/cluwne.rsi state: icon event: !type:ChangeComponentsSpellEvent - speech: action-speech-spell-cluwne toAdd: - type: Cluwne + - type: SpeakOnAction + sentence: action-speech-spell-cluwne - type: Magic requiresClothes: true @@ -72,10 +74,11 @@ sprite: Objects/Specific/Janitorial/soap.rsi state: omega-4 event: !type:ChangeComponentsSpellEvent - speech: action-speech-spell-slip toAdd: - type: Slippery - type: StepTrigger requiredTriggeredSpeed: -1 + - type: SpeakOnAction + sentence: action-speech-spell-slip - type: Magic requiresClothes: true diff --git a/Resources/Prototypes/Magic/utility_spells.yml b/Resources/Prototypes/Magic/utility_spells.yml index 90bcdc7487..c0074f496f 100644 --- a/Resources/Prototypes/Magic/utility_spells.yml +++ b/Resources/Prototypes/Magic/utility_spells.yml @@ -11,4 +11,5 @@ state: nothing event: !type:ChargeSpellEvent charge: 1 - speech: DI'RI CEL! + - type: SpeakOnAction + sentence: action-speech-spell-charge