Refactor all references to AudioSystem functions now that the old ones are obsolete. (#1081)

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
This commit is contained in:
Memory
2020-06-07 08:55:15 -05:00
committed by GitHub
parent b8338bc64c
commit 21c41f28ed
40 changed files with 72 additions and 72 deletions

View File

@@ -137,7 +137,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
Shaded = false
};
EntitySystem.Get<EffectSystem>().CreateParticle(message);
EntitySystem.Get<AudioSystem>().Play(_fireSound, Owner, AudioParams.Default.WithVolume(-5));
EntitySystem.Get<AudioSystem>().PlayFromEntity(_fireSound, Owner, AudioParams.Default.WithVolume(-5));
}
}
}

View File

@@ -107,7 +107,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
}
if (_magInSound != null && playSound)
{
EntitySystem.Get<AudioSystem>().Play(_magInSound, Owner);
EntitySystem.Get<AudioSystem>().PlayFromEntity(_magInSound, Owner);
}
magazinetype.OnAmmoCountChanged += MagazineAmmoCountChanged;
if (GetChambered(0) == null)
@@ -136,7 +136,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
entity.Transform.GridPosition = Owner.Transform.GridPosition;
if (_magOutSound != null && playSound)
{
EntitySystem.Get<AudioSystem>().Play(_magOutSound, Owner, AudioParams.Default.WithVolume(20));
EntitySystem.Get<AudioSystem>().PlayFromEntity(_magOutSound, Owner, AudioParams.Default.WithVolume(20));
}
UpdateAppearance();
Dirty();
@@ -162,7 +162,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
entity.Transform.GridPosition = Owner.Transform.GridPosition.Offset(offsetPos);
entity.Transform.LocalRotation = _bulletDropRandom.Pick(RandomBulletDirs).ToAngle();
var effect = $"/Audio/Guns/Casings/casingfall{_bulletDropRandom.Next(1, 4)}.ogg";
EntitySystem.Get<AudioSystem>().Play(effect, Owner, AudioParams.Default.WithVolume(-3));
EntitySystem.Get<AudioSystem>().PlayFromEntity(effect, Owner, AudioParams.Default.WithVolume(-3));
if (Magazine != null)
{
@@ -193,7 +193,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
EjectMagazine();
if (_autoEjectSound != null)
{
EntitySystem.Get<AudioSystem>().Play(_autoEjectSound, Owner, AudioParams.Default.WithVolume(-5));
EntitySystem.Get<AudioSystem>().PlayFromEntity(_autoEjectSound, Owner, AudioParams.Default.WithVolume(-5));
}
Dirty();
}

View File

@@ -135,7 +135,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
return true;
}
private void PlayEmptySound() => EntitySystem.Get<AudioSystem>().Play(_soundGunEmpty, Owner);
private void PlayEmptySound() => EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundGunEmpty, Owner);
protected sealed class Chamber
{

View File

@@ -76,7 +76,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
}
}
private void PlayFireSound() => EntitySystem.Get<AudioSystem>().Play(_soundGunshot, Owner);
private void PlayFireSound() => EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundGunshot, Owner);
/// <summary>
/// Gets the angle from an entity to a coordinate.