From: Southbridge <7013162+southbridge-fur@users.noreply.github.com> Date: Wed, 29 Jan 2025 09:04:45 +0000 (-0500) Subject: Nuke Timer MinimumTime (#34734) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=55bffa864aa6395032b7dfbc2745425776d9b637;p=space-station-14.git Nuke Timer MinimumTime (#34734) * Implemented the thing * Made requested changes --- diff --git a/Content.Server/Nuke/NukeComponent.cs b/Content.Server/Nuke/NukeComponent.cs index 141e99055c..e1a117f4bd 100644 --- a/Content.Server/Nuke/NukeComponent.cs +++ b/Content.Server/Nuke/NukeComponent.cs @@ -25,6 +25,13 @@ namespace Content.Server.Nuke [ViewVariables(VVAccess.ReadWrite)] public int Timer = 300; + /// + /// 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. + /// + [DataField] + public int MinimumTime = 180; + /// /// How long until the bomb can arm again after deactivation. /// Used to prevent announcements spam. diff --git a/Content.Server/Nuke/NukeSystem.cs b/Content.Server/Nuke/NukeSystem.cs index 0a62287505..84118931b1 100644 --- a/Content.Server/Nuke/NukeSystem.cs +++ b/Content.Server/Nuke/NukeSystem.cs @@ -522,6 +522,9 @@ public sealed class NukeSystem : EntitySystem _sound.PlayGlobalOnStation(uid, _audio.GetSound(component.DisarmSound)); _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 component.PlayedAlertSound = false; component.AlertAudioStream = _audio.Stop(component.AlertAudioStream);