Add Initial Cooldown To Communications Computers (#21681)

* Add initial delay variable

* Add cooldown to console on spawn

* shock

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Justin Pfeifler
2024-01-08 06:28:06 -06:00
committed by GitHub
parent cce9bde4cd
commit 36fe294bcc
2 changed files with 16 additions and 0 deletions

View File

@@ -52,6 +52,9 @@ namespace Content.Server.Communications
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleAnnounceMessage>(OnAnnounceMessage);
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleCallEmergencyShuttleMessage>(OnCallShuttleMessage);
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleRecallEmergencyShuttleMessage>(OnRecallShuttleMessage);
// On console init, set cooldown
SubscribeLocalEvent<CommunicationsConsoleComponent, MapInitEvent>(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;
}
/// <summary>
/// Update the UI of every comms console.
/// </summary>