Shuttle called/recalled announcements and sounds.

This commit is contained in:
Vera Aguilera Puerto
2021-01-01 16:34:54 +01:00
parent d43ca2877a
commit cf38e17b7e
7 changed files with 14 additions and 3 deletions

View File

@@ -71,12 +71,12 @@ namespace Content.Server.Chat
_netManager.ServerSendToAll(msg);
}
public void DispatchStationAnnouncement(string message)
public void DispatchStationAnnouncement(string message, string sender = "CentComm")
{
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
msg.Channel = ChatChannel.Radio;
msg.Message = message;
msg.MessageWrap = "Centcom Announcement:\n{0}";
msg.MessageWrap = $"{sender} Announcement:\n{{0}}";
_netManager.ServerSendToAll(msg);
}

View File

@@ -9,6 +9,7 @@ using Robust.Server.Interfaces.GameObjects;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Robust.Shared.ViewVariables;

View File

@@ -3,6 +3,7 @@ using System.Threading;
using Content.Server.Interfaces.Chat;
using Content.Server.Interfaces.GameTicking;
using Content.Shared.GameTicking;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
@@ -48,6 +49,10 @@ namespace Content.Server.GameObjects.EntitySystems
IsRoundEndCountdownStarted = true;
_chatManager.DispatchStationAnnouncement(Loc.GetString("An emergency shuttle has been sent. ETA: {0} minutes.", RoundEndCountdownTime.Minutes), Loc.GetString("Station"));
Get<AudioSystem>().PlayGlobal("/Audio/Announcements/shuttlecalled.ogg");
ExpectedCountdownEnd = _gameTiming.CurTime + RoundEndCountdownTime;
Timer.Spawn(RoundEndCountdownTime, EndRound, _roundEndCancellationTokenSource.Token);
OnRoundEndCountdownStarted?.Invoke();
@@ -60,6 +65,10 @@ namespace Content.Server.GameObjects.EntitySystems
IsRoundEndCountdownStarted = false;
_chatManager.DispatchStationAnnouncement(Loc.GetString("The emergency shuttle has been recalled."), Loc.GetString("Station"));
Get<AudioSystem>().PlayGlobal("/Audio/Announcements/shuttlerecalled.ogg");
_roundEndCancellationTokenSource.Cancel();
_roundEndCancellationTokenSource = new CancellationTokenSource();

View File

@@ -16,7 +16,8 @@ namespace Content.Server.Interfaces.Chat
/// Station announcement to every player
/// </summary>
/// <param name="message"></param>
void DispatchStationAnnouncement(string message);
/// <param name="sender"></param>
void DispatchStationAnnouncement(string message, string sender = "CentComm");
void DispatchServerMessage(IPlayerSession player, string message);

Binary file not shown.

Binary file not shown.

Binary file not shown.