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

@@ -8,6 +8,7 @@ using Content.Shared.Acts;
using Content.Shared.Interaction.Helpers;
using Content.Shared.Maps;
using Content.Shared.Physics;
using Content.Shared.Sound;
using Content.Shared.Tag;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -36,6 +37,7 @@ namespace Content.Server.Explosion
/// </summary>
private static readonly float LightBreakChance = 0.3f;
private static readonly float HeavyBreakChance = 0.8f;
private static SoundSpecifier _explosionSound = new SoundPathSpecifier("/Audio/Effects/explosion.ogg");
private static bool IgnoreExplosivePassable(IEntity e) => e.HasTag("ExplosivePassable");
@@ -311,7 +313,8 @@ namespace Content.Server.Explosion
var boundingBox = new Box2(epicenterMapPos - new Vector2(maxRange, maxRange),
epicenterMapPos + new Vector2(maxRange, maxRange));
SoundSystem.Play(Filter.Broadcast(), "/Audio/Effects/explosion.ogg", epicenter);
if(_explosionSound.TryGetSound(out var explosionSound))
SoundSystem.Play(Filter.Broadcast(), explosionSound, epicenter);
DamageEntitiesInRange(epicenter, boundingBox, devastationRange, heavyImpactRange, maxRange, mapId);
var mapGridsNear = mapManager.FindGridsIntersecting(mapId, boundingBox);