Owner Transform to Owner in SoundSystem calls (#4460)

* Owner Transform to Owner

* Owner Transform to Owner minor fixes
This commit is contained in:
ColdAutumnRain
2021-08-18 23:36:57 +02:00
committed by GitHub
parent 77d7d3c383
commit db48f0cc2d
12 changed files with 35 additions and 35 deletions

View File

@@ -119,7 +119,7 @@ namespace Content.Server.Stunnable
{
if (!entity.TryGetComponent(out StunnableComponent? stunnable) || !comp.Activated) return;
SoundSystem.Play(Filter.Pvs(comp.Owner), comp.StunSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(comp.Owner), comp.StunSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f));
if (!stunnable.SlowedDown)
{
if (_robustRandom.Prob(comp.ParalyzeChanceNoSlowdown))
@@ -139,7 +139,7 @@ namespace Content.Server.Stunnable
if (!comp.Owner.TryGetComponent<PowerCellSlotComponent>(out var slot) || slot.Cell == null || !(slot.Cell.CurrentCharge < comp.EnergyPerUse))
return;
SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f));
TurnOff(comp);
}
@@ -153,7 +153,7 @@ namespace Content.Server.Stunnable
if (!comp.Owner.TryGetComponent<SpriteComponent>(out var sprite) ||
!comp.Owner.TryGetComponent<ItemComponent>(out var item)) return;
SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f));
item.EquippedPrefix = "off";
// TODO stunbaton visualizer
sprite.LayerSetState(0, "stunbaton_off");
@@ -177,19 +177,19 @@ namespace Content.Server.Stunnable
if (slot.Cell == null)
{
SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f));
user.PopupMessage(Loc.GetString("comp-stunbaton-activated-missing-cell"));
return;
}
if (slot.Cell != null && slot.Cell.CurrentCharge < comp.EnergyPerUse)
{
SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f));
user.PopupMessage(Loc.GetString("comp-stunbaton-activated-dead-cell"));
return;
}
SoundSystem.Play(playerFilter, comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, comp.SparksSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.25f));
item.EquippedPrefix = "on";
sprite.LayerSetState(0, "stunbaton_on");