Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more localized announcements #350

Merged
merged 6 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public sealed partial class ChatSystem : SharedChatSystem
public const int VoiceRange = 10; // how far voice goes in world units
public const int WhisperClearRange = 2; // how far whisper goes while still being understandable, in world units
public const int WhisperMuffledRange = 5; // how far whisper goes at all, in world units
public const string DefaultAnnouncementSound = "/Audio/Announcements/announce.ogg";
public const string DefaultAnnouncementSound = "/Audio/Starshine/Announcements/announce.ogg"; // Starshine-Announcements
public const string CentComAnnouncementSound = "/Audio/Starshine/Announcements/centcomm.ogg"; // Starshine-Announcements

private bool _loocEnabled = true;
private bool _deadLoocEnabled;
Expand Down Expand Up @@ -319,6 +320,8 @@ public void DispatchGlobalAnnouncement(
_chatManager.ChatMessageToAll(ChatChannel.Radio, message, wrappedMessage, default, false, true, colorOverride);
if (playSound)
{
if (sender == Loc.GetString("admin-announce-announcer-default"))
announcementSound = new SoundPathSpecifier(CentComAnnouncementSound); // Starshine-Announcements: Support custom alert sound from admin panel
_audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), true, AudioParams.Default.WithVolume(-2f));
}
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}");
Expand Down
13 changes: 13 additions & 0 deletions Content.Server/Communications/CommunicationsConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,18 @@ public sealed partial class CommunicationsConsoleComponent : SharedCommunication
/// </summary>
[DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Announcements/announce.ogg");

/// <summary>
/// Starshine Announce dictionary
/// </summary>
public Dictionary<string, string> JobSpecialAnnounceDictionary = new()
{
{"Капитан","Captain"},
{"Старший инженер","ChiefEngineer"},
{"Главный врач","ChiefMedicalOfficer"},
{"Глава персонала","HeadOfPersonnel"},
{"Глава службы безопасности","HeadOfSecurity"},
{"Научный руководитель","ResearchDirector"}
};
}
}
12 changes: 11 additions & 1 deletion Content.Server/Communications/CommunicationsConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Content.Shared.Emag.Components;
using Content.Shared.Popups;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Configuration;

namespace Content.Server.Communications
Expand Down Expand Up @@ -239,6 +240,7 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com
var maxLength = _cfg.GetCVar(CCVars.ChatMaxAnnouncementLength);
var msg = SharedChatSystem.SanitizeAnnouncement(message.Message, maxLength);
var author = Loc.GetString("comms-console-announcement-unknown-sender");
SoundSpecifier specificAnnouncement = new SoundPathSpecifier("/Audio/Starshine/Announcements/Console/command.ogg");
if (message.Actor is { Valid: true } mob)
{
if (!CanAnnounce(comp))
Expand All @@ -255,6 +257,14 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com
if (_idCardSystem.TryFindIdCard(mob, out var id))
{
author = $"{id.Comp.FullName} ({CultureInfo.CurrentCulture.TextInfo.ToTitleCase(id.Comp.JobTitle ?? string.Empty)})".Trim();

// Starshine-Announcements-start
comp.JobSpecialAnnounceDictionary.TryGetValue(id.Comp.JobTitle!, out var jobIdName);
if (TryComp<AccessComponent>(id, out var accessComponent) && accessComponent.Tags.Contains(jobIdName!))
{
specificAnnouncement = new SoundPathSpecifier($"/Audio/Starshine/Announcements/Console/{jobIdName?.ToLower()}.ogg");
}
// Starshine-Announcements-end
}
}

Expand All @@ -277,7 +287,7 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com
return;
}

_chatSystem.DispatchStationAnnouncement(uid, msg, title, colorOverride: comp.Color);
_chatSystem.DispatchStationAnnouncement(uid, msg, title, announcementSound: specificAnnouncement, colorOverride: comp.Color);

_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Actor):player} has sent the following station announcement: {msg}");

Expand Down
5 changes: 4 additions & 1 deletion Content.Server/RoundEnd/RoundEndSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Content.Shared.Database;
using Content.Shared.DeviceNetwork;
using Content.Shared.GameTicking;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Player;
Expand Down Expand Up @@ -188,7 +189,9 @@ public void RequestRoundEnd(TimeSpan countdownTime, EntityUid? requester = null,
null,
Color.Gold);

_audio.PlayGlobal("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast(), true);
// Custom sound for auto-called
if (!_autoCalledBefore) _audio.PlayGlobal("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast(), true, AudioParams.Default.AddVolume(-4)); // Starshine-Announcements
else _audio.PlayGlobal("/Audio/Starshine/Announcements/crew_s_called.ogg", Filter.Broadcast(), true, AudioParams.Default.AddVolume(-4)); // Starshine-Announcements

LastCountdownStart = _gameTiming.CurTime;
ExpectedCountdownEnd = _gameTiming.CurTime + countdownTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Content.Shared.Shuttles.Events;
using Content.Shared.Shuttles.Systems;
using Content.Shared.UserInterface;
using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Timer = Robust.Shared.Timing.Timer;
Expand Down Expand Up @@ -217,8 +218,12 @@ private void UpdateEmergencyConsole(float frameTime)
// Departed
if (!ShuttlesLeft && _consoleAccumulator <= 0f)
{
SoundSpecifier shuttleLeftAnnouncement =
new SoundPathSpecifier("/Audio/Starshine/Announcements/shuttle_left.ogg"); // Starshine-Announcements
ShuttlesLeft = true;
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString("emergency-shuttle-left", ("transitTime", $"{TransitTime:0}")));
_chatSystem.DispatchGlobalAnnouncement(
Loc.GetString("emergency-shuttle-left", ("transitTime", $"{TransitTime:0}")),
announcementSound: shuttleLeftAnnouncement);

Timer.Spawn((int) (TransitTime * 1000) + _bufferTime.Milliseconds, () => _roundEnd.EndRound(), _roundEndCancelToken?.Token ?? default);
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Audio/Announcements/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
copyright: "Taken from tgstation, cut from the beginning"
source: "https://github.com/tgstation/tgstation/blob/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a/sound/ai/default/shuttlerecalled.ogg"

- files: ["aliens.ogg", "attention.ogg", "meteors.ogg", "outbreak7.ogg", "power_off.ogg", "power_on.ogg", "radiation.ogg", "shuttle_dock.ogg", "shuttlecalled.ogg", "shuttlerecalled.ogg", "ventclog.ogg", "war.ogg", "welcome.ogg", "ert_no.ogg", "ert_yes.ogg"]
- files: ["attention.ogg", "meteors.ogg", "outbreak7.ogg", "power_off.ogg", "power_on.ogg", "radiation.ogg", "shuttle_dock.ogg", "shuttlecalled.ogg", "shuttlerecalled.ogg", "ventclog.ogg", "war.ogg", "welcome.ogg", "ert_no.ogg", "ert_yes.ogg"]
license: "CC-BY-SA-3.0"
copyright: "By discord:Basia#3911"
source: "https://github.com/TauCetiStation/TauCetiClassic/commit/92d2767dbb39f28540f78d5055e7be1eb7acee98"
Expand Down
11 changes: 11 additions & 0 deletions Resources/Audio/Starshine/Announcements/Console/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- files:
- command.ogg
- captain.ogg
- headOfSecurity.ogg
- headOfPersonnel.ogg
- chiefEngineer.ogg
- chiefMedicalOfficer.ogg
- researchDirector.ogg
license: "CC-BY-SA-3.0"
copyright: "By discord:Basia#3911"
source: "https://github.com/TauCetiStation/TauCetiClassic/commit/92d2767dbb39f28540f78d5055e7be1eb7acee98"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions Resources/Audio/Starshine/Announcements/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- files:
- announce.ogg
- centcomm.ogg
- lifesigns.ogg
- flux.ogg
- shuttle_left.ogg
- blusp_anomalies.ogg
- comms_blackout.ogg
- crew_s_called.ogg
license: "CC-BY-SA-3.0"
copyright: "By discord:Basia#3911"
source: "https://github.com/TauCetiStation/TauCetiClassic/commit/92d2767dbb39f28540f78d5055e7be1eb7acee98"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Resources/Audio/Starshine/Announcements/flux.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion Resources/Audio/StationEvents/attribution.txt

This file was deleted.

7 changes: 6 additions & 1 deletion Resources/Audio/StationEvents/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
- files: ["clearly_nuclear.ogg"]
license: "CC-BY-3.0"
copyright: "Created by mryikes"
source: "https://www.youtube.com/watch?v=chix8uz-oUQ"
source: "https://www.youtube.com/watch?v=chix8uz-oUQ"

- files: ["countdown.ogg"]
license: "CC-BY-SA-3.0"
copyright: "Created by qwertyquerty"
source: "https://github.com/BeeStation/BeeStation-Hornet/commit/7f48971438492805af286023a72e7609a729234a"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
anomaly-spawn-event-announcement = Наши считывающие устройства обнаружили опасную межпространственную аномалию. Пожалуйста, сообщите исследовательской группе о { $sighting }.
anomaly-spawn-event-announcement = На станции обнаружена нестабильная блюспейс аномалия. Пожалуйста, незамедлительно сообщайте научному отделу о { $sighting }.
anomaly-spawn-sighting-1 = низких пульсирующих звуках слышных по всей станции
anomaly-spawn-sighting-2 = странных источниках света
anomaly-spawn-sighting-3 = необъяснимых формах
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bluespace-artifact-event-announcement = Наши приборы зафиксировали приближающийся объект инородного происхождения. Пожалуйста, незамедлительно сообщайте научному отделу о { $sighting }.
bluespace-artifact-event-announcement = На станции зафиксирован гиперэнерегетический волновой поток. Пожалуйста, незамедлительно сообщайте научному отделу о { $sighting }.
bluespace-artifact-sighting-1 = ярких вспышках света
bluespace-artifact-sighting-2 = странных звуках, доносящихся из технических туннелей
bluespace-artifact-sighting-3 = неестественных конструкциях
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
station-event-vent-creatures-start-announcement = Внимание. В вентиляционных системах станции обнаружен большой наплыв неизвестных форм жизни. Просьба избавиться от этих существ, пока они не начали влиять на производительность работы.
station-event-vent-creatures-start-announcement = На станции были обнаружены неопознанные формы жизни. Обезопасьте внешние доступы, включая трубопровод и вентиляцию.
50 changes: 39 additions & 11 deletions Resources/Prototypes/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
noSpawn: true
components:
- type: StationEvent
startAudio: # Starshine
path: /Audio/Starshine/Announcements/blusp_anomalies.ogg
params:
volume: -4
weight: 8
startDelay: 30
duration: 35
Expand All @@ -18,6 +22,10 @@
weight: 8
startDelay: 30
duration: 35
startAudio: # Starshine
path: /Audio/Starshine/Announcements/flux.ogg
params:
volume: -4
- type: BluespaceArtifactRule

- type: entity
Expand Down Expand Up @@ -140,10 +148,14 @@
- type: StationEvent
startAnnouncement: station-event-gas-leak-start-announcement
startAudio:
path: /Audio/Announcements/gasleak_start.ogg
path: /Audio/Announcements/gasleak_start.ogg # Starshine
params:
volume: -4
endAnnouncement: station-event-gas-leak-end-announcement
endAudio:
path: /Audio/Announcements/gasleak_end.ogg
path: /Audio/Announcements/gasleak_end.ogg # Starshine
params:
volume: -4
weight: 8
startDelay: 20
- type: GasLeakRule
Expand Down Expand Up @@ -176,11 +188,11 @@
startAnnouncement: station-event-meteor-swarm-start-announcement
endAnnouncement: station-event-meteor-swarm-end-announcement
startAudio:
path: /Audio/Announcements/meteors_start.ogg
path: /Audio/Announcements/meteors_start.ogg # Starshine
params:
volume: -4
endAudio:
path: /Audio/Announcements/meteors_end.ogg
path: /Audio/Announcements/meteors_end.ogg # Starshine
params:
volume: -4
duration: null #ending is handled by MeteorSwarmRule
Expand Down Expand Up @@ -218,7 +230,9 @@
- type: StationEvent
startAnnouncement: station-event-vent-creatures-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
path: /Audio/Starshine/Announcements/lifesigns.ogg
params:
volume: -4
startDelay: 10
earliestStart: 15
weight: 6
Expand All @@ -245,7 +259,9 @@
- type: StationEvent
startAnnouncement: station-event-vent-creatures-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
path: /Audio/Starshine/Announcements/lifesigns.ogg
params:
volume: -4
startDelay: 10
weight: 6
duration: 50
Expand Down Expand Up @@ -285,6 +301,8 @@
maxOccurrences: 1 # this event has diminishing returns on interesting-ness, so we cap it
startAudio:
path: /Audio/Announcements/sentience.ogg
params:
volume: -4
- type: RandomSentienceRule

- type: entity
Expand All @@ -296,8 +314,10 @@
weight: 8
startAnnouncement: station-event-solar-flare-start-announcement
endAnnouncement: station-event-solar-flare-end-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
startAudio: # Starshine
path: /Audio/Starshine/Announcements/comms_blackout.ogg
params:
volume: -4
duration: 120
maxDuration: 240
- type: SolarFlareRule
Expand Down Expand Up @@ -325,6 +345,8 @@
startAnnouncement: station-event-vent-clog-start-announcement
startAudio:
path: /Audio/Announcements/ventclog.ogg
params:
volume: -4
earliestStart: 15
minimumPlayers: 15
weight: 5
Expand All @@ -340,7 +362,9 @@
- type: StationEvent
startAnnouncement: station-event-vent-creatures-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
path: /Audio/Starshine/Announcements/lifesigns.ogg
params:
volume: -4
startDelay: 10
earliestStart: 20
minimumPlayers: 15
Expand All @@ -363,7 +387,9 @@
- type: StationEvent
startAnnouncement: station-event-vent-creatures-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
path: /Audio/Starshine/Announcements/lifesigns.ogg
params:
volume: -4
startDelay: 10
earliestStart: 20
minimumPlayers: 15
Expand All @@ -382,7 +408,9 @@
- type: StationEvent
startAnnouncement: station-event-vent-creatures-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
path: /Audio/Starshine/Announcements/lifesigns.ogg
params:
volume: -4
startDelay: 10
earliestStart: 20
minimumPlayers: 20
Expand Down
Loading