ABSURDLY important footstep change (#3147)
* +1 db * -.25db, different volume walking vs. running
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using Content.Server.GameObjects.Components.GUI;
|
using Content.Server.GameObjects.Components.GUI;
|
||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.Components.Mobs;
|
using Content.Server.GameObjects.Components.Mobs;
|
||||||
@@ -11,6 +11,7 @@ using Content.Shared.Maps;
|
|||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
@@ -108,12 +109,12 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PlayFootstepSound(transform.Coordinates);
|
PlayFootstepSound(transform.Coordinates, mover.Sprinting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PlayFootstepSound(EntityCoordinates coordinates)
|
private void PlayFootstepSound(EntityCoordinates coordinates, bool sprinting)
|
||||||
{
|
{
|
||||||
// Step one: figure out sound collection prototype.
|
// Step one: figure out sound collection prototype.
|
||||||
var grid = _mapManager.GetGrid(coordinates.GetGridId(EntityManager));
|
var grid = _mapManager.GetGrid(coordinates.GetGridId(EntityManager));
|
||||||
@@ -149,7 +150,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(soundCollectionName);
|
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(soundCollectionName);
|
||||||
var file = _robustRandom.Pick(soundCollection.PickFiles);
|
var file = _robustRandom.Pick(soundCollection.PickFiles);
|
||||||
_audioSystem.PlayAtCoords(file, coordinates);
|
_audioSystem.PlayAtCoords(file, coordinates, sprinting ? AudioParams.Default.WithVolume(0.75f) : null);
|
||||||
}
|
}
|
||||||
catch (UnknownPrototypeException)
|
catch (UnknownPrototypeException)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user