replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Server.Storage.Components
|
||||
{
|
||||
@@ -19,6 +21,9 @@ namespace Content.Server.Storage.Components
|
||||
|
||||
public override string Name => "CursedEntityStorage";
|
||||
|
||||
[DataField("cursedSound")] private SoundSpecifier _cursedSound = new SoundPathSpecifier("/Audio/Effects/teleport_departure.ogg");
|
||||
[DataField("cursedLockerSound")] private SoundSpecifier _cursedLockerSound = new SoundPathSpecifier("/Audio/Effects/teleport_arrival.ogg");
|
||||
|
||||
protected override void CloseStorage()
|
||||
{
|
||||
base.CloseStorage();
|
||||
@@ -46,8 +51,10 @@ namespace Content.Server.Storage.Components
|
||||
locker.Insert(entity);
|
||||
}
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/teleport_departure.ogg", Owner, AudioHelpers.WithVariation(0.125f));
|
||||
SoundSystem.Play(Filter.Pvs(lockerEnt), "/Audio/Effects/teleport_arrival.ogg", lockerEnt, AudioHelpers.WithVariation(0.125f));
|
||||
if(_cursedSound.TryGetSound(out var cursedSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), cursedSound, Owner, AudioHelpers.WithVariation(0.125f));
|
||||
if(_cursedLockerSound.TryGetSound(out var cursedLockerSound))
|
||||
SoundSystem.Play(Filter.Pvs(lockerEnt), cursedLockerSound, lockerEnt, AudioHelpers.WithVariation(0.125f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user