Random Announcer System (#415)

# Description

Replaces every instance of station announcements with an announcer
system meant to handle audio and messages for various announcers defined
in prototypes instead of each server replacing the scattered files
inconsistently with whatever singular thing they want to hear announce
messages.

# TODO

- [x] Systems
- [x] CVars
- [x] Sounds
- [x] Client volume slider
- [x] Collections
- [x] Prototypes
- [x] Events
- [x] Commands
- [x] PR media
- [x] Deglobalize
- [x] Passthrough localization parameters to overrides
- [x] Make every announcer follow the template
- [x] Move sounds into subdirectories
- [x] Make announcement IDs camelCased
- [x] Test announcement localizations
- [x] Weighted announcer lists

---

<details><summary><h1>Media</h1></summary>
<p>


https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/caf5805d-acb0-4140-b344-875a8f79e5ee

</p>
</details>

---

# Changelog

🆑
- add: Added 4 new announcers that will randomly be selected every shift
This commit is contained in:
DEATHB4DEFEAT
2024-07-12 13:13:50 -07:00
committed by GitHub
parent 98bfbde6c2
commit e3bc8d4c0e
192 changed files with 2124 additions and 273 deletions

View File

@@ -7,6 +7,8 @@ using Content.Server.Station.Systems;
using Content.Shared.Paper;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Server.Announcements.Systems;
using Robust.Shared.Player;
namespace Content.Server.Nuke
{
@@ -17,6 +19,7 @@ namespace Content.Server.Nuke
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly PaperSystem _paper = default!;
[Dependency] private readonly FaxSystem _faxSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
public override void Initialize()
{
@@ -57,9 +60,7 @@ namespace Content.Server.Nuke
while (faxes.MoveNext(out var faxEnt, out var fax))
{
if (!fax.ReceiveNukeCodes || !TryGetRelativeNukeCode(faxEnt, out var paperContent, station))
{
continue;
}
var printout = new FaxPrintout(
paperContent,
@@ -77,10 +78,8 @@ namespace Content.Server.Nuke
}
if (wasSent)
{
var msg = Loc.GetString("nuke-component-announcement-send-codes");
_chatSystem.DispatchStationAnnouncement(station, msg, colorOverride: Color.Red);
}
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("NukeCodes"), Filter.Broadcast(),
"nuke-component-announcement-send-codes", colorOverride: Color.Red);
return wasSent;
}