Nuke Timer MinimumTime (#34734)

* Implemented the thing

* Made requested changes
This commit is contained in:
Southbridge
2025-01-29 04:04:45 -05:00
committed by GitHub
parent 1f57f0566e
commit 55bffa864a
2 changed files with 10 additions and 0 deletions

View File

@@ -25,6 +25,13 @@ namespace Content.Server.Nuke
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public int Timer = 300; public int Timer = 300;
/// <summary>
/// If the nuke is disarmed, this sets the minimum amount of time the timer can have.
/// The remaining time will reset to this value if it is below it.
/// </summary>
[DataField]
public int MinimumTime = 180;
/// <summary> /// <summary>
/// How long until the bomb can arm again after deactivation. /// How long until the bomb can arm again after deactivation.
/// Used to prevent announcements spam. /// Used to prevent announcements spam.

View File

@@ -522,6 +522,9 @@ public sealed class NukeSystem : EntitySystem
_sound.PlayGlobalOnStation(uid, _audio.GetSound(component.DisarmSound)); _sound.PlayGlobalOnStation(uid, _audio.GetSound(component.DisarmSound));
_sound.StopStationEventMusic(uid, StationEventMusicType.Nuke); _sound.StopStationEventMusic(uid, StationEventMusicType.Nuke);
// reset nuke remaining time to either itself or the minimum time, whichever is higher
component.RemainingTime = Math.Max(component.RemainingTime, component.MinimumTime);
// disable sound and reset it // disable sound and reset it
component.PlayedAlertSound = false; component.PlayedAlertSound = false;
component.AlertAudioStream = _audio.Stop(component.AlertAudioStream); component.AlertAudioStream = _audio.Stop(component.AlertAudioStream);