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

@@ -11,6 +11,7 @@ using Content.Shared.Damage.Components;
using Content.Shared.Hands;
using Content.Shared.Interaction.Events;
using Content.Shared.Notification.Managers;
using Content.Shared.Sound;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
@@ -48,6 +49,12 @@ namespace Content.Server.Weapon.Ranged
[DataField("canHotspot")]
private bool _canHotspot = true;
[DataField("clumsyWeaponHandlingSound")]
private SoundSpecifier _clumsyWeaponHandlingSound = new SoundPathSpecifier("/Audio/Items/bikehorn.ogg");
[DataField("clumsyWeaponShotSound")]
private SoundSpecifier _clumsyWeaponShotSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/bang.ogg");
public Func<bool>? WeaponCanFireHandler;
public Func<IEntity, bool>? UserCanFireHandler;
public Action<IEntity, Vector2>? FireHandler;
@@ -159,11 +166,13 @@ namespace Content.Server.Weapon.Ranged
if (ClumsyCheck && ClumsyComponent.TryRollClumsy(user, ClumsyExplodeChance))
{
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Items/bikehorn.ogg",
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
if(_clumsyWeaponHandlingSound.TryGetSound(out var clumsyWeaponHandlingSound))
SoundSystem.Play(Filter.Pvs(Owner), clumsyWeaponHandlingSound,
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/Guns/Gunshots/bang.ogg",
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
if(_clumsyWeaponShotSound.TryGetSound(out var clumsyWeaponShotSound))
SoundSystem.Play(Filter.Pvs(Owner), clumsyWeaponShotSound,
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
if (user.TryGetComponent(out IDamageableComponent? health))
{