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:
@@ -13,6 +13,7 @@ namespace Content.Server.Communications
|
|||||||
/// Remaining cooldown between making announcements.
|
/// Remaining cooldown between making announcements.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField]
|
||||||
public float AnnouncementCooldownRemaining;
|
public float AnnouncementCooldownRemaining;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -37,6 +38,13 @@ namespace Content.Server.Communications
|
|||||||
[DataField]
|
[DataField]
|
||||||
public int Delay = 90;
|
public int Delay = 90;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time in seconds of announcement cooldown when a new console is created on a per-console basis
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField]
|
||||||
|
public int InitialDelay = 30;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Can call or recall the shuttle
|
/// Can call or recall the shuttle
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ namespace Content.Server.Communications
|
|||||||
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleAnnounceMessage>(OnAnnounceMessage);
|
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleAnnounceMessage>(OnAnnounceMessage);
|
||||||
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleCallEmergencyShuttleMessage>(OnCallShuttleMessage);
|
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleCallEmergencyShuttleMessage>(OnCallShuttleMessage);
|
||||||
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleRecallEmergencyShuttleMessage>(OnRecallShuttleMessage);
|
SubscribeLocalEvent<CommunicationsConsoleComponent, CommunicationsConsoleRecallEmergencyShuttleMessage>(OnRecallShuttleMessage);
|
||||||
|
|
||||||
|
// On console init, set cooldown
|
||||||
|
SubscribeLocalEvent<CommunicationsConsoleComponent, MapInitEvent>(OnCommunicationsConsoleMapInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
@@ -79,6 +82,11 @@ namespace Content.Server.Communications
|
|||||||
base.Update(frameTime);
|
base.Update(frameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnCommunicationsConsoleMapInit(EntityUid uid, CommunicationsConsoleComponent comp, MapInitEvent args)
|
||||||
|
{
|
||||||
|
comp.AnnouncementCooldownRemaining = comp.InitialDelay;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the UI of every comms console.
|
/// Update the UI of every comms console.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user