Arcade machine improvements (#24200)
* Give 'em something to talk about * Wire panel visuals * Wire graphics tweak * More ads and thanks * More ads for a noisy arcade * New screen for space villain machines * Implement EmitSoundIntervalComponent and a bunch of arcade noises * Require power for sounds * Allow earlier startup intervals * Orange glow * Audio attributions * Include the PR link * Replace EmitSoundInterval with expanded SpamEmitSound * Remove pacman-themed arcade sounds * Documentation good. * Updated methods to use Entity<T> * Refactored SpamEmitSound to get rid of accumulator and chance. * Fixed prewarm logic * Moved stuff to Shared * Fix outdated YAML * Better prediction, auto pause handling * Make enable/disable reset the timer instead of trying to save it.
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Content.Shared.Sound;
|
||||
[UsedImplicitly]
|
||||
public abstract class SharedEmitSoundSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] protected readonly IGameTiming Timing = default!;
|
||||
[Dependency] private readonly INetManager _netMan = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
|
||||
[Dependency] protected readonly IRobustRandom Random = default!;
|
||||
@@ -124,7 +124,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
|
||||
!args.OtherFixture.Hard ||
|
||||
!TryComp<PhysicsComponent>(uid, out var physics) ||
|
||||
physics.LinearVelocity.Length() < component.MinimumVelocity ||
|
||||
_timing.CurTime < component.NextSound ||
|
||||
Timing.CurTime < component.NextSound ||
|
||||
MetaData(uid).EntityPaused)
|
||||
{
|
||||
return;
|
||||
@@ -136,7 +136,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
|
||||
|
||||
var fraction = MathF.Min(1f, (physics.LinearVelocity.Length() - component.MinimumVelocity) / MaxVolumeVelocity);
|
||||
var volume = MinVolume + (MaxVolume - MinVolume) * fraction;
|
||||
component.NextSound = _timing.CurTime + EmitSoundOnCollideComponent.CollideCooldown;
|
||||
component.NextSound = Timing.CurTime + EmitSoundOnCollideComponent.CollideCooldown;
|
||||
var sound = component.Sound;
|
||||
|
||||
if (_netMan.IsServer && sound != null)
|
||||
@@ -144,4 +144,8 @@ public abstract class SharedEmitSoundSystem : EntitySystem
|
||||
_audioSystem.PlayPvs(_audioSystem.GetSound(sound), uid, AudioParams.Default.WithVolume(volume));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetEnabled(Entity<SpamEmitSoundComponent?> entity, bool enabled)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user