Files
tbd-station-14/Content.Server/Shuttles/Commands/DockEmergencyShuttleCommand.cs
Pieter-Jan Briers 5a6a3371dc Extend shuttle dock time if the shuttle doesn't dock at evac. (#31496)
* Extend shuttle dock time if the shuttle doesn't dock at evac.

If the shuttle can't dock at evac for *some reason*, it will instead try to dock at another port on the station. And if that fails it goes somewhere random on the station.

Because of the chaos and confusion caused by this, many people will frequently not get to the shuttle in time under these circumstances. This sucks for everybody.

To alleviate this, the shuttle launch timer will now be extended if the station doesn't dock at its ideal spot. The default values (controlled via CVar) are 1.667x and 2x respectively for "wrong dock" and "no dock at all" scenarios.

The code around here was a mess, so I fixed that too. "CallEmergencyShuttle" has been renamed to "DockEmergencyShuttle", the overload that did the actual docking has been renamed to DockSingleEmergencyShuttle. Code has been split into separate dock -> announce methods so we can calculate shuttle delay in between the case of multiple stations.

Also made the "shuttle couldn't find a dock" text announce the time until it launches and fix the shuttle timers not triggering for it.

* Minor review

---------
2024-09-09 20:10:28 +02:00

25 lines
816 B
C#

using Content.Server.Administration;
using Content.Server.Shuttles.Systems;
using Content.Shared.Administration;
using Robust.Shared.Console;
namespace Content.Server.Shuttles.Commands;
/// <summary>
/// Calls in the emergency shuttle.
/// </summary>
[AdminCommand(AdminFlags.Fun)]
public sealed class DockEmergencyShuttleCommand : IConsoleCommand
{
[Dependency] private readonly IEntitySystemManager _sysManager = default!;
public string Command => "dockemergencyshuttle";
public string Description => Loc.GetString("emergency-shuttle-command-dock-desc");
public string Help => $"{Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var system = _sysManager.GetEntitySystem<EmergencyShuttleSystem>();
system.DockEmergencyShuttle();
}
}