Files
ss14-wega/Content.Server/Administration/Commands/ShuttleCommands.cs
Samuka 20756abcfb Fix xenoborg evac calling announcment (#41437)
* no longer calls evac if evac is called or if the round is over

* can't recall shuttle

* some commentary

* can recall next round

* cancel evac recalling

* add this back

* only call once

* admins can recall anyway now

* 1 bool is better than 2 i guess

* some cleanup

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-12-02 14:28:33 +00:00

42 lines
1.6 KiB
C#

using Content.Server.RoundEnd;
using Content.Shared.Administration;
using Content.Shared.Localizations;
using Robust.Shared.Console;
namespace Content.Server.Administration.Commands
{
[AdminCommand(AdminFlags.Round)]
public sealed class CallShuttleCommand : LocalizedEntityCommands
{
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!;
public override string Command => "callshuttle";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
// ReSharper disable once ConvertIfStatementToSwitchStatement
if (args.Length == 1 && TimeSpan.TryParseExact(args[0], ContentLocalizationManager.TimeSpanMinutesFormats, LocalizationManager.DefaultCulture, out var timeSpan))
_roundEndSystem.RequestRoundEnd(timeSpan, shell.Player?.AttachedEntity, false);
else if (args.Length == 1)
shell.WriteLine(Loc.GetString("shell-timespan-minutes-must-be-correct"));
else
_roundEndSystem.RequestRoundEnd(shell.Player?.AttachedEntity, false);
}
}
[AdminCommand(AdminFlags.Round)]
public sealed class RecallShuttleCommand : LocalizedEntityCommands
{
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!;
public override string Command => "recallshuttle";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
_roundEndSystem.CancelRoundEndCountdown(shell.Player?.AttachedEntity, forceRecall: true);
}
}
}