public override void OnEventStart() { stationMatrix = MatrixManager.MainStationMatrix; if (AnnounceEvent) { var text = "What the f**k is going on?!"; CentComm.MakeAnnouncement(CentComm.CentCommAnnounceTemplate, text, CentComm.UpdateSound.alert); } if (FakeEvent) { return; } base.OnEventStart(); }
public override void OnEventStart() { stationMatrix = MatrixManager.MainStationMatrix; if (AnnounceEvent) { var text = "Proximity Alert:\nInbound Meteors have been detected.\nBrace for impact!"; CentComm.MakeAnnouncement(CentComm.CentCommAnnounceTemplate, text, CentComm.UpdateSound.alert); } if (FakeEvent) { return; } base.OnEventStart(); }
public void OnSpawnServer(SpawnInfo info) { if (!info.SpawnItems) { hasCables = false; stateSync = MountedMonitorState.OpenEmpty; statusText = GameManager.Instance.CentComm.CommandStatusString; } if (doorControllers.Count > 0 || NewdoorControllers.Count > 0) { OnTextBroadcastReceived(StatusDisplayChannel.DoorTimer); } SyncSprite(stateSync, stateSync); centComm = GameManager.Instance.CentComm; centComm.OnStatusDisplayUpdate.AddListener(OnTextBroadcastReceived); }
public override void OnEventStart() { if (AnnounceEvent) { var text = "Ionizing electromagnetic emissions detected near the station. Avoid areas of high radiation."; CentComm.MakeAnnouncement(ChatTemplates.CentcomAnnounce, text, CentComm.UpdateSound.NoSound); _ = SoundManager.PlayNetworked(SingletonSOSounds.Instance.RadiationAnnouncement); } if (FakeEvent) { return; } base.OnEventStart(); }
public override void OnEventStart() { if (AnnounceEvent) { var text = "Abnormal activity detected in the station's powernet." + "As a precautionary measure, the station's power will be shut off for an indeterminate duration."; CentComm.MakeAnnouncement(ChatTemplates.CentcomAnnounce, text, CentComm.UpdateSound.Alert); // TODO: Play specific announcement message sound instead of generic alert. } if (FakeEvent) { return; } base.OnEventStart(); }
public override void OnEventStart() { if (AnnounceEvent) { var text = "Massive bluespace anomaly detected en route to your station. Brace for impact."; CentComm.MakeAnnouncement(ChatTemplates.CentcomAnnounce, text, CentComm.UpdateSound.NoSound); _ = SoundManager.PlayNetworked(CommonSounds.Instance.SpanomaliesAnnouncement); } if (FakeEvent) { return; } base.OnEventStart(); }
public void CmdRecallShuttle(string text, NetworkConnectionToClient sender = null) { if (IsAdmin(sender, out var player) == false) { return; } var success = GameManager.Instance.PrimaryEscapeShuttle.RecallShuttle(out var result, true); if (success == false) { return; } CentComm.MakeShuttleRecallAnnouncement(text); LogAdminAction($"{player.Username}: RECALLED the emergency shuttle. \n {text}"); }
public override void OnEventStart() { if (AnnounceEvent) { var text = "Abnormal activity detected in the station's powernet." + "As a precautionary measure, the station's power will be shut off for an indeterminate duration."; CentComm.MakeAnnouncement(ChatTemplates.CentcomAnnounce, text, CentComm.UpdateSound.NoSound); _ = SoundManager.PlayNetworked(CommonSounds.Instance.PowerOffAnnouncement); } if (FakeEvent) { return; } base.OnEventStart(); }
public void CmdRecallShuttle(string adminId, string adminToken, string text, NetworkConnectionToClient sender = null) { if (IsAdmin(adminId, adminToken, sender) == false) { return; } var success = GameManager.Instance.PrimaryEscapeShuttle.RecallShuttle(out var result, true); if (!success) { return; } CentComm.MakeShuttleRecallAnnouncement(text); LogAdminAction($"{PlayerList.Instance.GetByUserID(adminId).Username}: RECALLED the emergency shuttle."); }
public void CmdCallShuttle(string adminId, string adminToken, string text, NetworkConnectionToClient sender = null) { if (IsAdmin(adminId, adminToken, sender) == false) { return; } var shuttle = GameManager.Instance.PrimaryEscapeShuttle; if (shuttle.Status == EscapeShuttleStatus.DockedCentcom) { shuttle.CallShuttle(out var result); var minutes = TimeSpan.FromSeconds(shuttle.InitialTimerSeconds).ToString(); CentComm.MakeShuttleCallAnnouncement(minutes, text, true); LogAdminAction($"{PlayerList.Instance.GetByUserID(adminId).Username}: CALLED the emergency shuttle. \n {text}"); } }
public override void OnEventStart() { stationMatrix = MatrixManager.MainStationMatrix; if (AnnounceEvent) { var text = "Proximity Alert:\nInbound Meteors have been detected.\nBrace for impact!"; CentComm.MakeAnnouncement(ChatTemplates.CentcomAnnounce, text, CentComm.UpdateSound.NoSound); _ = SoundManager.PlayNetworked(SingletonSOSounds.Instance.MeteorsAnnouncement); } if (FakeEvent) { return; } base.OnEventStart(); }
public override void OnEventStart() { if (AnnounceEvent) { var text = "It appears the chemistry of the universe has been broken, damn those science nerds."; CentComm.MakeAnnouncement(ChatTemplates.CentcomAnnounce, text, CentComm.UpdateSound.Alert); } if (FakeEvent) { return; } new GasReactions( reaction: new OxyToPlasma(), gasReactionData: new Dictionary <Gas, GasReactionData>() { { Gas.Oxygen, new GasReactionData() { minimumMolesToReact = 0.01f } } }, minimumTemperature: 0f, maximumTemperature: 10000000000f, minimumPressure: 0f, maximumPressure: 10000000000f, minimumMoles: 0.01f, maximumMoles: 10000000000f, energyChange: 0f ); base.OnEventStart(); }
public void CmdRecallShuttle(string adminId, string adminToken, string text) { if (IsAdmin(adminId, adminToken) == false) { return; } var success = GameManager.Instance.PrimaryEscapeShuttle.RecallShuttle(out var result, true); if (!success) { return; } CentComm.MakeShuttleRecallAnnouncement(text); var msg = $"{PlayerList.Instance.GetByUserID(adminId).Username}: RECALLED the emergency shuttle."; UIManager.Instance.adminChatWindows.adminToAdminChat.ServerAddChatRecord(msg, null); DiscordWebhookMessage.Instance.AddWebHookMessageToQueue(DiscordWebhookURLs.DiscordWebhookAdminLogURL, msg, ""); }
private IEnumerator SendEscapeShuttle(int seconds) { //departure countdown for (int i = seconds; i >= 0; i--) { CentComm.UpdateStatusDisplay(StatusDisplayChannel.EscapeShuttle, FormatTime(i, "Depart\nETA: ")); yield return(WaitFor.Seconds(1)); } PrimaryEscapeShuttle.SendShuttle(); //centcom round end countdown int timeToCentcom = (seconds * 2 - 2); for (int i = timeToCentcom - 1; i >= 0; i--) { CentComm.UpdateStatusDisplay(StatusDisplayChannel.EscapeShuttle, FormatTime(i, "CENTCOM\nETA: ")); yield return(WaitFor.Seconds(1)); } CentComm.UpdateStatusDisplay(StatusDisplayChannel.EscapeShuttle, string.Empty); }
public void AnnounceWar(string declarationMessage) { if (warDeclared == false) { warDeclared = true; GameManager.Instance.CentComm.ChangeAlertLevel(CentComm.AlertLevel.Red, true); CentComm.MakeAnnouncement(ChatTemplates.PriorityAnnouncement, $"Attention all crew! An open message from the syndicate has been picked up on local radiowaves! Message Reads:\n" + $"{declarationMessage}", CentComm.UpdateSound.Alert); var antagPlayers = AntagManager.Instance.ActiveAntags; foreach (var antag in antagPlayers) { if (antag.Antagonist.AntagJobType == JobType.SYNDICATE) { Operatives.Add(antag); } } } }
public void CmdCallShuttle(string adminId, string adminToken, string text) { if (IsAdmin(adminId, adminToken) == false) { return; } var shuttle = GameManager.Instance.PrimaryEscapeShuttle; if (shuttle.Status == EscapeShuttleStatus.DockedCentcom) { shuttle.CallShuttle(out var result); var minutes = TimeSpan.FromSeconds(shuttle.InitialTimerSeconds).ToString(); CentComm.MakeShuttleCallAnnouncement(minutes, text, true); var msg = $"{PlayerList.Instance.GetByUserID(adminId).Username}: CALLED the emergency shuttle."; UIManager.Instance.adminChatWindows.adminToAdminChat.ServerAddChatRecord(msg, null); DiscordWebhookMessage.Instance.AddWebHookMessageToQueue(DiscordWebhookURLs.DiscordWebhookAdminLogURL, msg, ""); } }
public void MakeAnAnnouncement(string text) { Logger.Log(nameof(MakeAnAnnouncement), Category.NetUI); CentComm.MakeCaptainAnnouncement(text); OpenMenu(); }
private void Start() { centComm = GameManager.Instance.CentComm; }
private void TrackETA(int eta) { CentComm.UpdateStatusDisplay(StatusDisplayChannel.EscapeShuttle, FormatTime(eta, "STATION\nETA: ")); }
/// <summary> /// Called after MatrixManager is initialized /// </summary> /// private void InitEscapeStuff() { //Primary escape shuttle lookup if (PrimaryEscapeShuttle == null) { var shuttles = FindObjectsOfType <EscapeShuttle>(); if (shuttles.Length < 1) { Logger.LogError("Primary escape shuttle is missing from GameManager!", Category.Round); return; } Logger.LogWarning("Primary escape shuttle is missing from GameManager, but one was found on scene", Category.Round); primaryEscapeShuttle = shuttles[0]; } //later, maybe: keep a list of all computers and call the shuttle automatically with a 25 min timer if they are deleted if (primaryEscapeShuttle.MatrixInfo == null) { Logger.LogError("Primary escape shuttle has no associated matrix!", Category.Round); return; } //Starting up at Centcom coordinates if (GameManager.Instance.QuickLoad) { if (primaryEscapeShuttle.MatrixInfo == null) { return; } if (primaryEscapeShuttle.MatrixInfo.MatrixMove == null) { return; } } var orientation = primaryEscapeShuttle.MatrixInfo.MatrixMove.InitialFacing; float width; if (orientation == Orientation.Up || orientation == Orientation.Down) { width = PrimaryEscapeShuttle.MatrixInfo.Bounds.size.x; } else { width = PrimaryEscapeShuttle.MatrixInfo.Bounds.size.y; } Vector3 newPos; switch (LandingZoneManager.Instance.centcomDocking.orientation) { case OrientationEnum.Right: newPos = new Vector3(LandingZoneManager.Instance.centcomDockingPos.x + Mathf.Ceil(width / 2f), LandingZoneManager.Instance.centcomDockingPos.y, 0); break; case OrientationEnum.Up: newPos = new Vector3(LandingZoneManager.Instance.centcomDockingPos.x, LandingZoneManager.Instance.centcomDockingPos.y + Mathf.Ceil(width / 2f), 0); break; case OrientationEnum.Left: newPos = new Vector3(LandingZoneManager.Instance.centcomDockingPos.x - Mathf.Ceil(width / 2f), LandingZoneManager.Instance.centcomDockingPos.y, 0); break; default: newPos = new Vector3(LandingZoneManager.Instance.centcomDockingPos.x, LandingZoneManager.Instance.centcomDockingPos.y - Mathf.Ceil(width / 2f), 0); break; } PrimaryEscapeShuttle.MatrixInfo.MatrixMove.ChangeFacingDirection(Orientation.FromEnum(PrimaryEscapeShuttle.orientationForDockingAtCentcom)); PrimaryEscapeShuttle.MatrixInfo.MatrixMove.SetPosition(newPos); primaryEscapeShuttle.InitDestination(newPos); bool beenToStation = false; PrimaryEscapeShuttle.OnShuttleUpdate?.AddListener(status => { //status display ETA tracking if (status == EscapeShuttleStatus.OnRouteStation) { PrimaryEscapeShuttle.OnTimerUpdate.AddListener(TrackETA); } else { PrimaryEscapeShuttle.OnTimerUpdate.RemoveListener(TrackETA); CentComm.UpdateStatusDisplay(StatusDisplayChannel.EscapeShuttle, string.Empty); } if (status == EscapeShuttleStatus.DockedCentcom && beenToStation) { Logger.Log("Shuttle arrived at Centcom", Category.Round); Chat.AddSystemMsgToChat(string.Format(ChatTemplates.PriorityAnnouncement, $"<color=white>Escape shuttle has docked at Centcomm! Round will restart in {TimeSpan.FromSeconds(RoundEndTime).Minutes} minute.</color>"), MatrixManager.MainStationMatrix); StartCoroutine(WaitForRoundEnd()); } IEnumerator WaitForRoundEnd() { Logger.Log($"Shuttle docked to Centcom, Round will end in {TimeSpan.FromSeconds(RoundEndTime).Minutes} minute", Category.Round); yield return(WaitFor.Seconds(1f)); EndRound(); } if (status == EscapeShuttleStatus.DockedStation && !primaryEscapeShuttle.hostileEnvironment) { beenToStation = true; SoundManager.PlayNetworked(SingletonSOSounds.Instance.ShuttleDocked); Chat.AddSystemMsgToChat(string.Format(ChatTemplates.PriorityAnnouncement, $"<color=white>Escape shuttle has arrived! Crew has {TimeSpan.FromSeconds(ShuttleDepartTime).Minutes} minutes to get on it.</color>"), MatrixManager.MainStationMatrix); //should be changed to manual send later departCoroutine = StartCoroutine(SendEscapeShuttle(ShuttleDepartTime)); } else if (status == EscapeShuttleStatus.DockedStation && primaryEscapeShuttle.hostileEnvironment) { beenToStation = true; SoundManager.PlayNetworked(SingletonSOSounds.Instance.ShuttleDocked); Chat.AddSystemMsgToChat(string.Format(ChatTemplates.PriorityAnnouncement, $"<color=white>Escape shuttle has arrived! The shuttle <color=#FF151F>cannot</color> leave the station due to the hostile environment!</color>"), MatrixManager.MainStationMatrix); } }); }
public void MakeAnAnnouncement(string text) { Logger.Log(nameof(MakeAnAnnouncement), Category.NetUI); CentComm.MakeAnnouncement(CentComm.CaptainAnnounceTemplate, text, CentComm.UpdateType.announce); OpenMenu(); }