2020-12-07 14:52:55 +01:00
|
|
|
using Content.Server.Administration;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.GameTicking;
|
2020-03-03 20:37:26 +01:00
|
|
|
using Content.Server.Players;
|
2021-12-13 16:45:49 +11:00
|
|
|
using Content.Shared.Administration;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Server.Player;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2021-06-20 10:09:24 +02:00
|
|
|
using Robust.Shared.GameObjects;
|
2020-03-03 20:37:26 +01:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Ghost
|
2020-03-03 20:37:26 +01:00
|
|
|
{
|
2020-10-30 16:06:48 +01:00
|
|
|
[AnyCommand]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class Ghost : IConsoleCommand
|
2020-03-03 20:37:26 +01:00
|
|
|
{
|
|
|
|
|
public string Command => "ghost";
|
|
|
|
|
public string Description => "Give up on life and become a ghost.";
|
|
|
|
|
public string Help => "ghost";
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-03-03 20:37:26 +01:00
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
var player = shell.Player as IPlayerSession;
|
2020-03-03 20:37:26 +01:00
|
|
|
if (player == null)
|
|
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
shell?.WriteLine("You have no session, you can't ghost.");
|
2020-03-03 20:37:26 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-14 08:57:24 +01:00
|
|
|
var mind = player.ContentData()?.Mind;
|
2020-08-25 05:37:54 -06:00
|
|
|
if (mind == null)
|
|
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
shell?.WriteLine("You have no Mind, you can't ghost.");
|
2020-03-30 01:16:44 +02:00
|
|
|
return;
|
2020-03-03 20:37:26 +01:00
|
|
|
}
|
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
if (!EntitySystem.Get<GameTicker>().OnGhostAttempt(mind, true))
|
2020-08-14 08:13:32 -05:00
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
shell?.WriteLine("You can't ghost right now.");
|
2020-12-11 01:10:55 +00:00
|
|
|
return;
|
2020-08-14 08:13:32 -05:00
|
|
|
}
|
2020-03-03 20:37:26 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|