]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Increase shuttle FTL cooldown to prevent FTL spamming (#42209)
authormikey <23003816+mikeysaurus@users.noreply.github.com>
Fri, 9 Jan 2026 06:44:22 +0000 (22:44 -0800)
committerGitHub <noreply@github.com>
Fri, 9 Jan 2026 06:44:22 +0000 (06:44 +0000)
* seperate out shuttle cooldowns

* fix

* feedback

* fix spacing

* update to TimeSpan

* GOAT float

* return to TimeSpan

* add var

* clarify with seconds

* clarifying some things

Content.Server/Shuttles/Components/ShuttleComponent.cs
Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
Content.Shared/CCVar/CCVars.Shuttle.cs

index 0aa815d2df4cd7428e7d8904a14d1127ac7eba00..75a162f64344cf7f546f9e4937a2525a6ed9b494 100644 (file)
@@ -68,5 +68,12 @@ namespace Content.Server.Shuttles.Components
         /// </summary>
         [DataField]
         public float DampingModifier;
+
+        /// <summary>
+        /// Optional override for the FTL cooldown for this shuttle.
+        /// If not null, then the value will be used instead of the shuttle.cooldown CCVar.
+        /// </summary>
+        [DataField]
+        public TimeSpan? FTLCooldownOverride = null;
     }
 }
index a63359077f3827a6fce97e48c482cbb6c2e7660f..1441c2edc8c8cef6c28a026194cbeca0ff869555 100644 (file)
@@ -48,7 +48,8 @@ public sealed partial class ShuttleSystem
     public float DefaultStartupTime;
     public float DefaultTravelTime;
     public float DefaultArrivalTime;
-    private float FTLCooldown;
+    private TimeSpan FTLCooldown;
+    private TimeSpan ArrivalsFTLCooldown;
     public float FTLMassLimit;
     private TimeSpan _hyperspaceKnockdownTime = TimeSpan.FromSeconds(5);
 
@@ -87,7 +88,8 @@ public sealed partial class ShuttleSystem
         _cfg.OnValueChanged(CCVars.FTLStartupTime, time => DefaultStartupTime = time, true);
         _cfg.OnValueChanged(CCVars.FTLTravelTime, time => DefaultTravelTime = time, true);
         _cfg.OnValueChanged(CCVars.FTLArrivalTime, time => DefaultArrivalTime = time, true);
-        _cfg.OnValueChanged(CCVars.FTLCooldown, time => FTLCooldown = time, true);
+        _cfg.OnValueChanged(CCVars.FTLCooldown, time => FTLCooldown = TimeSpan.FromSeconds(time), true);
+        _cfg.OnValueChanged(CCVars.ArrivalsFTLCooldown, time => ArrivalsFTLCooldown = TimeSpan.FromSeconds(time), true);
         _cfg.OnValueChanged(CCVars.FTLMassLimit, time => FTLMassLimit = time, true);
         _cfg.OnValueChanged(CCVars.HyperspaceKnockdownTime, time => _hyperspaceKnockdownTime = TimeSpan.FromSeconds(time), true);
     }
@@ -542,7 +544,10 @@ public sealed partial class ShuttleSystem
         }
 
         comp.State = FTLState.Cooldown;
-        comp.StateTime = StartEndTime.FromCurTime(_gameTiming, FTLCooldown);
+        var cooldown = entity.Comp2.FTLCooldownOverride ?? (HasComp<ArrivalsShuttleComponent>(uid)
+                ? ArrivalsFTLCooldown
+                : FTLCooldown);
+        comp.StateTime = StartEndTime.FromCurTime(_gameTiming, cooldown);
         _console.RefreshShuttleConsoles(uid);
         _mapSystem.SetPaused(mapId, false);
         Smimsh(uid, xform: xform);
index 28ed146eafbd6531f7af3a666c1d3e63c0703fa8..ad8e9b2d70c6709809ef2d7e16e0654a38efcf58 100644 (file)
@@ -95,10 +95,17 @@ public sealed partial class CCVars
         CVarDef.Create("shuttle.arrival_time", 5f, CVar.SERVERONLY);
 
     /// <summary>
-    ///     How much time needs to pass before a shuttle can FTL again.
+    ///     How much time in seconds that needs to pass before a non-arrivals shuttle can FTL again.
     /// </summary>
     public static readonly CVarDef<float> FTLCooldown =
-        CVarDef.Create("shuttle.cooldown", 10f, CVar.SERVERONLY);
+        CVarDef.Create("shuttle.cooldown", 60f, CVar.SERVERONLY);
+
+    /// <summary>
+    ///     How much time in seconds that needs to pass before the arrivals shuttle can FTL again.
+    ///     If this is adjusted, ensure that shuttle.arrivals_cooldown is longer than this value.
+    /// </summary>
+    public static readonly CVarDef<float> ArrivalsFTLCooldown =
+        CVarDef.Create("shuttle.arrivals_ftl_cooldown", 10f, CVar.SERVERONLY);
 
     /// <summary>
     ///     The maximum <see cref="PhysicsComponent.Mass"/> a grid can have before it becomes unable to FTL.