Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jabak
2024-06-19 12:59:49 +03:00
59 changed files with 334 additions and 4 deletions

View File

@@ -1,7 +1,23 @@
namespace Content.Server._White.Wizard.Magic.Other;
using Robust.Shared.Audio;
namespace Content.Server._White.Wizard.Magic.Other;
[RegisterComponent]
public sealed partial class InstantRecallComponent : Component
{
public EntityUid? Item;
/// <summary>
/// Sound to play on use.
/// </summary>
[DataField]
[ViewVariables]
public SoundSpecifier LinkSound;
/// <summary>
/// Sound to play on use.
/// </summary>
[DataField]
[ViewVariables]
public SoundSpecifier RecallSound;
}

View File

@@ -217,6 +217,7 @@ public sealed class WizardSpellsSystem : EntitySystem
recallComponent.Item = handsComponent.ActiveHandEntity.Value;
_popupSystem.PopupEntity($"Сопряжено с {MetaData(handsComponent.ActiveHandEntity.Value).EntityName}",
msg.Performer, msg.Performer);
_audio.PlayPvs(recallComponent.LinkSound, msg.Performer);
return;
}
@@ -226,12 +227,13 @@ public sealed class WizardSpellsSystem : EntitySystem
var coordsItem = Transform(recallComponent.Item.Value).Coordinates;
var coordsPerformer = Transform(msg.Performer).Coordinates;
Spawn("EffectEmpPulse", coordsItem);
Spawn("EffectMagicDisappearance", coordsItem);
_transformSystem.SetCoordinates(recallComponent.Item.Value, coordsPerformer);
_transformSystem.AttachToGridOrMap(recallComponent.Item.Value);
_handsSystem.TryForcePickupAnyHand(msg.Performer, recallComponent.Item.Value);
_audio.PlayPvs(recallComponent.RecallSound, msg.Performer);
msg.Handled = true;
Speak(msg);