]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Void's Applause (#34591)
authorkeronshb <54602815+keronshb@users.noreply.github.com>
Fri, 31 Jan 2025 00:10:35 +0000 (19:10 -0500)
committerGitHub <noreply@github.com>
Fri, 31 Jan 2025 00:10:35 +0000 (01:10 +0100)
* Adds single clap emote

* Adds missing single clap loc

* Adds void blink effects, sound, and sprite

* Adds VoidApplauseEvent and implements it into the Magic System and Grimoire

* Removes commented Spawn code in Shared Magic System. Adds comments to replace pointlight with a negative light in the future.

* Makes spells Mono

* Changes to swap positions.

* Makes Void Applause target body only

* Update Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Content.Client/Magic/MagicSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Resources/Audio/Effects/Emotes/attributions.yml

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Resources/Prototypes/SoundCollections/emotes.yml

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Removes duplicate effect spawning from server

* Puts Void Applause effect on server, lets lizards hear clap

* Adds single clap to diona

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
18 files changed:
Content.Client/Magic/MagicSystem.cs
Content.Server/Magic/MagicSystem.cs
Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs [new file with mode: 0644]
Content.Shared/Magic/SharedMagicSystem.cs
Resources/Audio/Effects/Emotes/attributions.yml
Resources/Audio/Effects/Emotes/clap-single.ogg [new file with mode: 0644]
Resources/Audio/Magic/Eldritch/voidblink.ogg [new file with mode: 0644]
Resources/Audio/Magic/attributions.yml
Resources/Locale/en-US/chat/emotes.ftl
Resources/Locale/en-US/store/spellbook-catalog.ftl
Resources/Prototypes/Catalog/spellbook_catalog.yml
Resources/Prototypes/Entities/Effects/eldritch.yml [new file with mode: 0644]
Resources/Prototypes/Magic/teleport_spells.yml
Resources/Prototypes/SoundCollections/emotes.yml
Resources/Prototypes/Voice/speech_emote_sounds.yml
Resources/Prototypes/Voice/speech_emotes.yml
Resources/Textures/Objects/Magic/Eldritch/eldritch_actions.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Objects/Magic/Eldritch/eldritch_actions.rsi/voidblink.png [new file with mode: 0644]

index 03aa9eb56d4d6c86924ff244b4eafeed582fa398..086a0f7b42e7e2110a615ef72257ca750b8a2214 100644 (file)
@@ -1,5 +1,8 @@
 using Content.Shared.Magic;
+using Content.Shared.Magic.Events;
 
 namespace Content.Client.Magic;
 
-public sealed class MagicSystem : SharedMagicSystem;
+public sealed class MagicSystem : SharedMagicSystem
+{
+}
index 2cf5136b42770fb68bad3793733eb35ebfec6650..a7e5e967862acd371580f687f751aa329ccb3146 100644 (file)
@@ -19,4 +19,17 @@ public sealed class MagicSystem : SharedMagicSystem
     {
         _chat.TrySendInGameICMessage(args.Performer, Loc.GetString(args.Speech), InGameICChatType.Speak, false);
     }
+
+    public override void OnVoidApplause(VoidApplauseSpellEvent ev)
+    {
+        base.OnVoidApplause(ev);
+
+        _chat.TryEmoteWithChat(ev.Performer, ev.Emote);
+
+        var perfXForm = Transform(ev.Performer);
+        var targetXForm = Transform(ev.Target);
+
+        Spawn(ev.Effect, perfXForm.Coordinates);
+        Spawn(ev.Effect, targetXForm.Coordinates);
+    }
 }
diff --git a/Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs b/Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs
new file mode 100644 (file)
index 0000000..c134790
--- /dev/null
@@ -0,0 +1,24 @@
+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
+{
+    [DataField]
+    public string? Speech { get; private set; }
+
+    /// <summary>
+    ///     Emote to use.
+    /// </summary>
+    [DataField]
+    public ProtoId<EmotePrototype> Emote = "ClapSingle";
+
+    /// <summary>
+    ///     Visual effect entity that is spawned at both the user's and the target's location.
+    /// </summary>
+    [DataField]
+    public EntProtoId Effect = "EffectVoidBlink";
+}
index acedaf05f65755280215aae4646a17a36d757278..fe033f24987993e2da2d97b37f0f0a4225461956 100644 (file)
@@ -80,6 +80,7 @@ public abstract class SharedMagicSystem : EntitySystem
         SubscribeLocalEvent<ChargeSpellEvent>(OnChargeSpell);
         SubscribeLocalEvent<RandomGlobalSpawnSpellEvent>(OnRandomGlobalSpawnSpell);
         SubscribeLocalEvent<MindSwapSpellEvent>(OnMindSwapSpell);
+        SubscribeLocalEvent<VoidApplauseSpellEvent>(OnVoidApplause);
 
         // Spell wishlist
         //  A wishlish of spells that I'd like to implement or planning on implementing in a future PR
@@ -402,8 +403,7 @@ public abstract class SharedMagicSystem : EntitySystem
             return;
 
         var transform = Transform(args.Performer);
-
-        if (transform.MapID != args.Target.GetMapId(EntityManager) || !_interaction.InRangeUnobstructed(args.Performer, args.Target, range: 1000F, collisionMask: CollisionGroup.Opaque, popup: true))
+        if (transform.MapID != _transform.GetMapId(args.Target) || !_interaction.InRangeUnobstructed(args.Performer, args.Target, range: 1000F, collisionMask: CollisionGroup.Opaque, popup: true))
             return;
 
         _transform.SetCoordinates(args.Performer, args.Target);
@@ -411,6 +411,17 @@ public abstract class SharedMagicSystem : EntitySystem
         Speak(args);
         args.Handled = true;
     }
+
+    public virtual void OnVoidApplause(VoidApplauseSpellEvent ev)
+    {
+        if (ev.Handled || !PassesSpellPrerequisites(ev.Action, ev.Performer))
+            return;
+
+        ev.Handled = true;
+        Speak(ev);
+
+        _transform.SwapPositions(ev.Performer, ev.Target);
+    }
     // End Teleport Spells
     #endregion
     #region Spell Helpers
index 0c62b483660e616265cd717ae2c5a1b3d14228c7..6b580a930bb7fb7430a24fed76d488175286edfa 100644 (file)
@@ -6,6 +6,11 @@
   license: "CC-BY-SA-3.0"
   copyright: "Taken from tgstation at https://github.com/tgstation/tgstation/commit/e1142f20f5e4661cb6845cfcf2dd69f864d67432"
   source: "https://github.com/tgstation/tgstation"
+- files:
+  - clap-single.ogg
+  license: "CC-BY-SA-3.0"
+  copyright: "Taken from Citadel Station at https://github.com/Citadel-Station-13/Citadel-Station-13/commit/e145bdafe83e2cf38d148c39f073da5e7b0cb456"
+  source: "https://github.com/Citadel-Station-13/Citadel-Station-13"
 - files:
     - snap1.ogg
     - snap2.ogg
diff --git a/Resources/Audio/Effects/Emotes/clap-single.ogg b/Resources/Audio/Effects/Emotes/clap-single.ogg
new file mode 100644 (file)
index 0000000..94d8b10
Binary files /dev/null and b/Resources/Audio/Effects/Emotes/clap-single.ogg differ
diff --git a/Resources/Audio/Magic/Eldritch/voidblink.ogg b/Resources/Audio/Magic/Eldritch/voidblink.ogg
new file mode 100644 (file)
index 0000000..8485591
Binary files /dev/null and b/Resources/Audio/Magic/Eldritch/voidblink.ogg differ
index bfbe4d6ec24d5c0fd1f56f69a6eba2f2ae8f4835..92a4ae3c4505825e89270e2d332f633033a3e759 100644 (file)
@@ -22,3 +22,9 @@
   copyright: '"forcewall.ogg", "knock.ogg", "blink.ogg", "ethereal_enter.ogg", and "ethereal_exit.ogg" by Citadel Station 13'
   license: CC-BY-SA-3.0
   source: https://github.com/Citadel-Station-13/Citadel-Station-13/commit/35a1723e98a60f375df590ca572cc90f1bb80bd5
+
+- files:
+  - voidblink.ogg
+  copyright: '"voidblink.ogg" by Citadel Station 13'
+  license: CC-BY-SA-3.0
+  source: https://github.com/Citadel-Station-13/Citadel-Station-13/commit/e145bdafe83e2cf38d148c39f073da5e7b0cb456
index 479e9daab4a21f434bdd243efa8ab4efd7b9f545..74e669b50725fbbcd791fcd09165990f045b1eae 100644 (file)
@@ -11,6 +11,7 @@ chat-emote-name-squeak = Squeak
 chat-emote-name-thump = Thump Tail
 chat-emote-name-click = Click
 chat-emote-name-clap = Clap
+chat-emote-name-clap-single = Single Clap
 chat-emote-name-snap = Snap
 chat-emote-name-salute = Salute
 chat-emote-name-gasp = Gasp
@@ -45,6 +46,7 @@ chat-emote-msg-squeak = squeaks.
 chat-emote-msg-thump = thumps {POSS-ADJ($entity)} tail.
 chat-emote-msg-click = clicks.
 chat-emote-msg-clap = claps!
+chat-emote-msg-clap-single = claps their hands together.
 chat-emote-msg-snap = snaps {POSS-ADJ($entity)} fingers.
 chat-emote-msg-salute = salutes.
 chat-emote-msg-gasp = gasps.
index 1450cc86082fe4667eecee21a8783af6f53f7793..98d19817c6754cdb154787e66fda551eda5e357e 100644 (file)
@@ -5,6 +5,9 @@ spellbook-fireball-desc = Get most crew exploding with rage when they see this f
 spellbook-blink-name = Blink
 spellbook-blink-desc = Don't blink or you'll miss yourself teleporting away.
 
+spellbook-voidapplause-name = Void Applause
+spellbook-voidapplause-desc = Swap places with the target, doesn't it make you want to do the boogie?
+
 spellbook-force-wall-name = Force Wall
 spellbook-force-wall-desc = Make three walls of pure force that you can pass through, but other's can't.
 
index d5a9b0f1b9a3a1d751d194a57201bacea2ef94ff..3246117e71864b6d9e2476c1835c16d52bab4bb6 100644 (file)
   - !type:ListingLimitedStockCondition
     stock: 1
 
+# Taking an Eldritch spell, good proof of concept and a way to celebrate everything magic.
+- type: listing
+  id: SpellbookVoidApplause
+  name: spellbook-voidapplause-name
+  description: spellbook-voidapplause-desc
+  productAction: ActionVoidApplause
+  cost:
+    WizCoin: 1
+  categories:
+  - SpellbookUtility
+  conditions:
+  - !type:ListingLimitedStockCondition
+    stock: 1
+
 - type: listing
   id: SpellbookCharge
   name: spellbook-charge-name
diff --git a/Resources/Prototypes/Entities/Effects/eldritch.yml b/Resources/Prototypes/Entities/Effects/eldritch.yml
new file mode 100644 (file)
index 0000000..196fe28
--- /dev/null
@@ -0,0 +1,25 @@
+- type: entity
+  id: EffectVoidBlink
+  name: void blink
+  categories: [ HideSpawnMenu ]
+  save: false
+  components:
+  # TODO: PointLight is temp until I can make a shader & overlay for negative light or until this can support it
+  - type: PointLight
+    radius: 3
+    energy: 1
+    softness: 10
+    color: "#301934"
+  - type: Transform
+    noRot: true
+  - type: Sprite
+    sprite: Objects/Magic/Eldritch/eldritch_actions.rsi
+    drawdepth: Effects
+    noRot: true
+    layers:
+    - state: "voidblink"
+  - type: TimedDespawn
+    lifetime: 1
+  - type: Tag
+    tags:
+    - HideContextMenu
index 6f1ed9a6e43a8679794aac83035d59a770924cee..6e359cc611f2665dcb5cb7aa8c71d692a429def5 100644 (file)
       sprite: Objects/Magic/magicactions.rsi
       state: blink
     event: !type:TeleportSpellEvent
+
+# TODO: Second level upgrade sometime that allows swapping with all objects
+- type: entity
+  id: ActionVoidApplause
+  name: Void Applause
+  description: Clap your hands and swap places with the target.
+  components:
+  - type: EntityTargetAction
+    useDelay: 15
+    range: 16
+    sound: !type:SoundPathSpecifier
+      path: /Audio/Magic/Eldritch/voidblink.ogg
+    itemIconStyle: BigAction
+    whitelist:
+      components:
+      - Body
+    canTargetSelf: false
+    interactOnMiss: false
+    checkCanAccess: false
+    repeat: false
+    icon:
+      sprite: Objects/Magic/Eldritch/eldritch_actions.rsi
+      state: voidblink
+    event: !type:VoidApplauseSpellEvent
+      effect: EffectVoidBlink
index 04d2b3b2e8e2fc11868f3024e92cee4cbe2d5416..c93a46572b10c6ca4657ca8ecd1f6c346e177ca6 100644 (file)
     - /Audio/Effects/Emotes/clap3.ogg
     - /Audio/Effects/Emotes/clap4.ogg
 
+- type: soundCollection
+  id: ClapSingle
+  files:
+  - /Audio/Effects/Emotes/clap-single.ogg
+
 - type: soundCollection
   id: Snaps
   files:
index 9fab1aeed807e2e63254edea0ee63a7c54349ca8..82b4b40574708672eb2f0c02bd9d9e314189687f 100644 (file)
   sounds:
     Clap:
       collection: Claps
+    ClapSingle:
+      collection: ClapSingle
     Snap:
       collection: Snaps
       params:
   sounds:
     Clap:
       path: /Audio/Voice/Diona/diona_clap.ogg
+    # TODO: Replace this with a similar wood themed single clap
+    ClapSingle:
+      collection: ClapSingle
     Snap:
       path: /Audio/Voice/Diona/diona_snap.ogg
       params:
         variation: 0.125
     Clap:
       collection: Claps
+    ClapSingle:
+      collection: ClapSingle
     Snap:
       collection: Snaps
       params:
index 9de4bb2b70191a749ea6e94a1498aafbe80fcf9c..a346f8614841b2fb1f514496cc3e3ec9fc16a7fc 100644 (file)
     - BorgChassis
   chatMessages: ["chat-emote-msg-clap"]
   chatTriggers:
-    - clap
     - claps
     - clapping
     - clapped
 
+- type: emote
+  id: ClapSingle
+  name: chat-emote-name-clap-single
+  category: Hands
+  icon: Interface/Emotes/clap.png #TODO: Needs a sprite that distinguishes it better from clap
+  whitelist:
+    components:
+    - Hands
+  blacklist:
+    components:
+    - BorgChassis
+  chatMessages: [ "chat-emote-msg-clap-single" ]
+  chatTriggers:
+    - clap
+    - claps their hands together
+
 - type: emote
   id: Snap
   name: chat-emote-name-snap
diff --git a/Resources/Textures/Objects/Magic/Eldritch/eldritch_actions.rsi/meta.json b/Resources/Textures/Objects/Magic/Eldritch/eldritch_actions.rsi/meta.json
new file mode 100644 (file)
index 0000000..8dddb61
--- /dev/null
@@ -0,0 +1,27 @@
+{
+  "version": 1,
+  "license": "CC-BY-NC-SA-3.0",
+  "copyright": "Taken from and modified by kiwedespars on Citadel Station at commit https://github.com/Citadel-Station-13/Citadel-Station-13/commit/e145bdafe83e2cf38d148c39f073da5e7b0cb456",
+  "size": {
+    "x": 32,
+    "y": 32
+  },
+  "states": [
+    {
+      "name": "voidblink",
+      "delays": [
+        [
+          0.1,
+          0.3,
+          0.1,
+          0.3,
+          0.1,
+          0.3,
+          0.1,
+          0.3,
+          0.3
+        ]
+      ]
+    }
+  ]
+}
diff --git a/Resources/Textures/Objects/Magic/Eldritch/eldritch_actions.rsi/voidblink.png b/Resources/Textures/Objects/Magic/Eldritch/eldritch_actions.rsi/voidblink.png
new file mode 100644 (file)
index 0000000..c44f889
Binary files /dev/null and b/Resources/Textures/Objects/Magic/Eldritch/eldritch_actions.rsi/voidblink.png differ