Пример #1
0
        /// <summary>
        /// Changes current Alert Level. You can omit the announcement! Must be called on server.
        /// </summary>
        /// <param name="toLevel">Value from AlertLevel that represent the desired level</param>
        /// <param name="announce">Optional, Should we announce the change? Default is true.</param>
        public void ChangeAlertLevel(AlertLevel toLevel, bool announce = true)
        {
            if (CurrentAlertLevel == toLevel)
            {
                return;
            }

            if (CurrentAlertLevel > toLevel && toLevel == AlertLevel.Green && announce)
            {
                MakeAnnouncement(ChatTemplates.CentcomAnnounce,
                                 ChatTemplates.GetAlertLevelMessage(AlertLevelChange.DownToGreen),
                                 UpdateSound.Notice);
            }
            else if (CurrentAlertLevel > toLevel && announce)
            {
                var levelString = (int)toLevel * -1;
                MakeAnnouncement(ChatTemplates.CentcomAnnounce,
                                 ChatTemplates.GetAlertLevelMessage((AlertLevelChange)levelString),
                                 UpdateSound.Notice);
            }
            else if (CurrentAlertLevel < toLevel && announce)
            {
                MakeAnnouncement(ChatTemplates.CentcomAnnounce,
                                 ChatTemplates.GetAlertLevelMessage((AlertLevelChange)toLevel),
                                 UpdateSound.Alert);
            }

            lastAlertChange   = gameManager.stationTime;
            CurrentAlertLevel = toLevel;
        }
Пример #2
0
        private void SendAntagUpdate()
        {
            _ = SoundManager.PlayNetworked(CommonSounds.Instance.AnnouncementIntercept);
            var message = string.Format(ReportTemplates.InitialUpdate,
                                        $"{ReportTemplates.AntagInitialUpdate}\n\n{ChatTemplates.GetAlertLevelMessage(AlertLevelChange.UpToBlue)}");

            MakeAnnouncement(ChatTemplates.CentcomAnnounce, message, UpdateSound.Alert);
            SpawnReports(ReportTemplates.AntagThreat);
            ChangeAlertLevel(AlertLevel.Blue, false);
        }
Пример #3
0
 private void SendAntagUpdate()
 {
     _ = SoundManager.PlayNetworked(SingletonSOSounds.Instance.AnnouncementIntercept);
     MakeAnnouncement(
         ChatTemplates.CentcomAnnounce,
         string.Format(
             ReportTemplates.InitialUpdate,
             ReportTemplates.AntagInitialUpdate + "\n\n" +
             ChatTemplates.GetAlertLevelMessage(AlertLevelChange.UpToBlue)),
         UpdateSound.Alert);
     SpawnReports(ReportTemplates.AntagThreat);
     ChangeAlertLevel(AlertLevel.Blue, false);
 }