Files
tbd-station-14/Content.Server/Commands/Observer/Ghost.cs
Manel Navola f7ac546f39 Added suicide for Crematorium and Recycler, soft fixed Recycled gibbing (#2610)
* Added suicide for Crematorium and Recycler, soft fixed Recycled gibbing

* Renamed _cancelToken to _cremateCancelToken, made _cremateCancelToken nullable

* Update Content.Server/GameObjects/Components/Morgue/CrematoriumEntityStorageComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Added Ownder.Deleted check inside timer

* Added TODO gibbing comments

* Removed innecessary code and removed deleting entities when getting 'gibbed'

* Fix ghosting with gibbing.

Co-authored-by: Manel Navola <ManelNavola@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2021-01-14 18:57:24 +11:00

49 lines
1.6 KiB
C#

#nullable enable
using Content.Server.Administration;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Observer;
using Content.Server.Interfaces.GameTicking;
using Content.Server.Players;
using Content.Shared.Damage;
using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Mobs.State;
using Robust.Server.Interfaces.Console;
using Robust.Server.Interfaces.Player;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Commands.Observer
{
[AnyCommand]
public class Ghost : IClientCommand
{
public string Command => "ghost";
public string Description => "Give up on life and become a ghost.";
public string Help => "ghost";
public bool CanReturn { get; set; } = true;
public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (player == null)
{
shell?.SendText(player, "You have no session, you can't ghost.");
return;
}
var mind = player.ContentData()?.Mind;
if (mind == null)
{
shell?.SendText(player, "You have no Mind, you can't ghost.");
return;
}
if (!IoCManager.Resolve<IGameTicker>().OnGhostAttempt(mind, CanReturn))
{
shell?.SendText(player, "You can't ghost right now.");
return;
}
}
}
}