Improves MindComponent's description. Force ghost without body return when commiting suicide.

This commit is contained in:
Víctor Aguilera Puerto
2020-08-16 17:08:27 +02:00
parent d58d84096b
commit 83567c1bd9
3 changed files with 11 additions and 3 deletions

View File

@@ -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>());
}
}
}

View File

@@ -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]");
}
}

View File

@@ -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>())