diff --git a/Content.Server/Communications/CommunicationsConsoleComponent.cs b/Content.Server/Communications/CommunicationsConsoleComponent.cs index e2aa0d7620..52f3087b65 100644 --- a/Content.Server/Communications/CommunicationsConsoleComponent.cs +++ b/Content.Server/Communications/CommunicationsConsoleComponent.cs @@ -13,6 +13,7 @@ namespace Content.Server.Communications /// Remaining cooldown between making announcements. /// [ViewVariables(VVAccess.ReadWrite)] + [DataField] public float AnnouncementCooldownRemaining; /// @@ -37,6 +38,13 @@ namespace Content.Server.Communications [DataField] public int Delay = 90; + /// + /// Time in seconds of announcement cooldown when a new console is created on a per-console basis + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField] + public int InitialDelay = 30; + /// /// Can call or recall the shuttle /// diff --git a/Content.Server/Communications/CommunicationsConsoleSystem.cs b/Content.Server/Communications/CommunicationsConsoleSystem.cs index b2945c2a11..ea27450956 100644 --- a/Content.Server/Communications/CommunicationsConsoleSystem.cs +++ b/Content.Server/Communications/CommunicationsConsoleSystem.cs @@ -52,6 +52,9 @@ namespace Content.Server.Communications SubscribeLocalEvent(OnAnnounceMessage); SubscribeLocalEvent(OnCallShuttleMessage); SubscribeLocalEvent(OnRecallShuttleMessage); + + // On console init, set cooldown + SubscribeLocalEvent(OnCommunicationsConsoleMapInit); } public override void Update(float frameTime) @@ -79,6 +82,11 @@ namespace Content.Server.Communications base.Update(frameTime); } + public void OnCommunicationsConsoleMapInit(EntityUid uid, CommunicationsConsoleComponent comp, MapInitEvent args) + { + comp.AnnouncementCooldownRemaining = comp.InitialDelay; + } + /// /// Update the UI of every comms console. ///