Nuke Timer MinimumTime (#34734)
* Implemented the thing * Made requested changes
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user