From 55bffa864aa6395032b7dfbc2745425776d9b637 Mon Sep 17 00:00:00 2001
From: Southbridge <7013162+southbridge-fur@users.noreply.github.com>
Date: Wed, 29 Jan 2025 04:04:45 -0500
Subject: [PATCH] Nuke Timer MinimumTime (#34734)
* Implemented the thing
* Made requested changes
---
Content.Server/Nuke/NukeComponent.cs | 7 +++++++
Content.Server/Nuke/NukeSystem.cs | 3 +++
2 files changed, 10 insertions(+)
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);
--
2.51.2