diff --git a/Content.Server/Chat/ChatCommands.cs b/Content.Server/Chat/ChatCommands.cs index 9d3ff7c995..a6c5404f59 100644 --- a/Content.Server/Chat/ChatCommands.cs +++ b/Content.Server/Chat/ChatCommands.cs @@ -1,10 +1,12 @@ -using System.Linq; +using System; +using System.Linq; using Content.Server.GameObjects.Components.Damage; using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Observer; using Content.Server.Interfaces.Chat; using Content.Server.Interfaces.GameObjects; +using Content.Server.Observer; using Content.Server.Players; using Content.Shared.GameObjects.Components.Damage; using Robust.Server.Interfaces.Console; @@ -168,6 +170,10 @@ namespace Content.Server.Chat // Default suicide, bite your tongue chat.EntityMe(owner, Loc.GetString("is attempting to bite {0:their} own tongue, looks like {0:theyre} trying to commit suicide!", owner)); //TODO: theyre macro dmgComponent.TakeDamage(DamageType.Brute, 500, owner, owner); //TODO: dmg value needs to be a max damage of some sorts + + // Prevent the player from returning to the body. Yes, this is an ugly hack. + var ghost = new Ghost(){CanReturn = false}; + ghost.Execute(shell, player, Array.Empty()); } } } diff --git a/Content.Server/GameObjects/Components/Mobs/MindComponent.cs b/Content.Server/GameObjects/Components/Mobs/MindComponent.cs index d148490bd9..fe033e2231 100644 --- a/Content.Server/GameObjects/Components/Mobs/MindComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/MindComponent.cs @@ -137,7 +137,8 @@ namespace Content.Server.GameObjects.Components.Mobs } else if (Mind?.Session == null) { - message.AddMarkup("[color=yellow]" + Loc.GetString("{0:They} {0:have} a blank, absent-minded stare and appears completely unresponsive to anything. {0:They} may snap out of it soon.", Owner) + "[/color]"); + if(!dead) + message.AddMarkup("[color=yellow]" + Loc.GetString("{0:They} {0:have} a blank, absent-minded stare and appears completely unresponsive to anything. {0:They} may snap out of it soon.", Owner) + "[/color]"); } } } diff --git a/Content.Server/Observer/Ghost.cs b/Content.Server/Observer/Ghost.cs index 80480b958a..004f5951ee 100644 --- a/Content.Server/Observer/Ghost.cs +++ b/Content.Server/Observer/Ghost.cs @@ -17,6 +17,7 @@ namespace Content.Server.Observer 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) { @@ -27,7 +28,7 @@ namespace Content.Server.Observer } var mind = player.ContentData().Mind; - var canReturn = player.AttachedEntity != null; + var canReturn = player.AttachedEntity != null && CanReturn; var name = player.AttachedEntity?.Name ?? player.Name; if (player.AttachedEntity != null && player.AttachedEntity.HasComponent())