Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Void's Applause #34591

Merged
merged 16 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion Content.Client/Magic/MagicSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
using Content.Shared.Magic;
using Content.Shared.Magic.Events;

namespace Content.Client.Magic;

public sealed class MagicSystem : SharedMagicSystem;
public sealed class MagicSystem : SharedMagicSystem
{
public override void Initialize()
{
base.Initialize();
}
keronshb marked this conversation as resolved.
Show resolved Hide resolved

public override void OnVoidApplause(VoidApplauseSpellEvent ev)
{
base.OnVoidApplause(ev);

var perfXForm = Transform(ev.Performer);
var targetXForm = Transform(ev.Target);

Spawn(ev.Effect, perfXForm.Coordinates);
Spawn(ev.Effect, targetXForm.Coordinates);
keronshb marked this conversation as resolved.
Show resolved Hide resolved
}
}
13 changes: 13 additions & 0 deletions Content.Server/Magic/MagicSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@ private void OnSpellSpoken(ref SpeakSpellEvent args)
{
_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);
keronshb marked this conversation as resolved.
Show resolved Hide resolved

var perfXForm = Transform(ev.Performer);
var targetXForm = Transform(ev.Target);

Spawn(ev.Effect, perfXForm.Coordinates);
Spawn(ev.Effect, targetXForm.Coordinates);
}
}
25 changes: 25 additions & 0 deletions Content.Shared/Magic/Events/VoidApplauseSpellEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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; }

// TODO: Make SingleClap emote and add sound from 13
keronshb marked this conversation as resolved.
Show resolved Hide resolved
/// <summary>
/// Emote to use.
/// </summary>
[DataField]
public ProtoId<EmotePrototype> Emote = "ClapSingle";

/// <summary>
/// Effect to play
keronshb marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[DataField]
public EntProtoId Effect = "EffectVoidBlink";
}
25 changes: 23 additions & 2 deletions Content.Shared/Magic/SharedMagicSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public override void Initialize()
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
Expand Down Expand Up @@ -402,15 +403,35 @@ private void OnTeleportSpell(TeleportSpellEvent args)
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);
_transform.AttachToGridOrMap(args.Performer, transform);
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);

var perfXForm = Transform(ev.Performer);
var targetXForm = Transform(ev.Target);

var originalPerfCoords = perfXForm.Coordinates;
var originalTargetCoords = targetXForm.Coordinates;

_transform.SetCoordinates(ev.Performer, originalTargetCoords);
_transform.AttachToGridOrMap(ev.Performer, perfXForm);

_transform.SetCoordinates(ev.Target, originalPerfCoords);
_transform.AttachToGridOrMap(ev.Target, targetXForm);
keronshb marked this conversation as resolved.
Show resolved Hide resolved
}
// End Teleport Spells
#endregion
#region Spell Helpers
Expand Down
5 changes: 5 additions & 0 deletions Resources/Audio/Effects/Emotes/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
keronshb marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
Binary file added Resources/Audio/Effects/Emotes/clap-single.ogg
Binary file not shown.
Binary file added Resources/Audio/Magic/Eldritch/voidblink.ogg
Binary file not shown.
6 changes: 6 additions & 0 deletions Resources/Audio/Magic/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/chat/emotes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/store/spellbook-catalog.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
14 changes: 14 additions & 0 deletions Resources/Prototypes/Catalog/spellbook_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
- !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
Expand Down
25 changes: 25 additions & 0 deletions Resources/Prototypes/Entities/Effects/eldritch.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions Resources/Prototypes/Magic/teleport_spells.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,22 @@
sprite: Objects/Magic/magicactions.rsi
state: blink
event: !type:TeleportSpellEvent

- 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
checkCanAccess: false
repeat: false
icon:
sprite: Objects/Magic/Eldritch/eldritch_actions.rsi
state: voidblink
event: !type:VoidApplauseSpellEvent
effect: EffectVoidBlink
5 changes: 5 additions & 0 deletions Resources/Prototypes/SoundCollections/emotes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
- /Audio/Effects/Emotes/clap3.ogg
- /Audio/Effects/Emotes/clap4.ogg

- type: soundCollection
id: ClapSingle
files:
- /Audio/Effects/Emotes/clap-single.ogg
keronshb marked this conversation as resolved.
Show resolved Hide resolved

- type: soundCollection
id: Snaps
files:
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Voice/speech_emote_sounds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@
sounds:
Clap:
collection: Claps
ClapSingle:
collection: ClapSingle
Snap:
collection: Snaps
params:
Expand Down
17 changes: 16 additions & 1 deletion Resources/Prototypes/Voice/speech_emotes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,26 @@
- 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
]
]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading