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:
Tayrtahn
2024-03-28 02:28:45 -04:00
committed by GitHub
parent a071bc5dbf
commit b1ba6b5bb6
35 changed files with 425 additions and 57 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.Power.Components;
using Content.Shared.UserInterface;
using Content.Server.Advertise;
using Content.Shared.Arcade;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
@@ -9,6 +10,7 @@ namespace Content.Server.Arcade.BlockGame;
public sealed class BlockGameArcadeSystem : EntitySystem
{
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly AdvertiseSystem _advertise = default!;
public override void Initialize()
{
@@ -89,7 +91,15 @@ public sealed class BlockGameArcadeSystem : EntitySystem
UpdatePlayerStatus(uid, component.Player, blockGame: component);
}
else
{
// Everybody's gone
component.Player = null;
if (component.ShouldSayThankYou && TryComp<AdvertiseComponent>(uid, out var advertise))
{
_advertise.SayThankYou(uid, advertise);
component.ShouldSayThankYou = false;
}
}
UpdatePlayerStatus(uid, temp, blockGame: component);
}
@@ -103,6 +113,7 @@ public sealed class BlockGameArcadeSystem : EntitySystem
_uiSystem.CloseAll(bui);
component.Player = null;
component.Spectators.Clear();
component.ShouldSayThankYou = false;
}
private void OnPlayerAction(EntityUid uid, BlockGameArcadeComponent component, BlockGameMessages.BlockGamePlayerActionMessage msg)
@@ -122,6 +133,8 @@ public sealed class BlockGameArcadeSystem : EntitySystem
return;
}
component.ShouldSayThankYou = true;
component.Game.ProcessInput(msg.PlayerAction);
}
}