Improves MindComponent's description. Force ghost without body return when commiting suicide.
This commit is contained in:
@@ -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<string>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
}
|
||||
else if (Mind?.Session == null)
|
||||
{
|
||||
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]");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GhostComponent>())
|
||||
|
||||
Reference in New Issue
Block a user