replacing sound (collection) names with SoundSpecifier - part 1

This commit is contained in:
Galactic Chimp
2021-07-10 17:35:33 +02:00
parent 4500b66f28
commit ce3c59e0e6
131 changed files with 934 additions and 587 deletions

View File

@@ -2,6 +2,7 @@
using System.Linq;
using Content.Server.Explosion;
using Content.Shared.Pointing.Components;
using Content.Shared.Sound;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
@@ -41,6 +42,9 @@ namespace Content.Server.Pointing.Components
[DataField("chasingTime")]
private float _chasingTime = 1;
[DataField("explosionSound")]
private SoundSpecifier _explosionSound = new SoundPathSpecifier("/Audio/Effects/explosion.ogg");
private IEntity? RandomNearbyPlayer()
{
var players = _playerManager
@@ -120,7 +124,8 @@ namespace Content.Server.Pointing.Components
}
Owner.SpawnExplosion(0, 2, 1, 1);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/explosion.ogg", Owner);
if(_explosionSound.TryGetSound(out var explosionSound))
SoundSystem.Play(Filter.Pvs(Owner), explosionSound, Owner);
Owner.Delete();
}