Fix toilet suicide messages (#6445)
Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Server.Act;
|
||||
using Content.Server.Act;
|
||||
using Content.Server.Buckle.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Storage.Components;
|
||||
@@ -126,22 +126,16 @@ namespace Content.Server.Toilet
|
||||
public SuicideKind Suicide(EntityUid uid, EntityUid victimUid, ToiletComponent? component = null,
|
||||
MetaDataComponent? meta = null, MetaDataComponent? victimMeta = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, ref meta))
|
||||
return SuicideKind.Special;
|
||||
|
||||
if (!Resolve(uid, ref victimMeta))
|
||||
return SuicideKind.Special;
|
||||
|
||||
// check that victim even have head
|
||||
if (EntityManager.TryGetComponent<SharedBodyComponent>(victimUid, out var body) &&
|
||||
body.HasPartOfType(BodyPartType.Head))
|
||||
{
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others",
|
||||
("victim",victimMeta.Name),("owner", meta.Name));
|
||||
_popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(victimUid));
|
||||
("victim", victimUid),("owner", uid));
|
||||
_popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(victimUid).RemoveWhereAttachedEntity(puid => puid == victimUid));
|
||||
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-head-message",
|
||||
("owner", meta.Name));
|
||||
("owner", uid));
|
||||
_popupSystem.PopupEntity(selfMessage, uid, Filter.Entities(victimUid));
|
||||
|
||||
return SuicideKind.Asphyxiation;
|
||||
@@ -149,11 +143,11 @@ namespace Content.Server.Toilet
|
||||
else
|
||||
{
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-message-others",
|
||||
("victim", victimMeta.Name),("owner", meta.Name));
|
||||
_popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(uid));
|
||||
("victim", victimUid),("owner", uid));
|
||||
_popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(uid).RemoveWhereAttachedEntity(puid => puid == victimUid));
|
||||
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-message",
|
||||
("owner",meta.Name));
|
||||
("owner", uid));
|
||||
_popupSystem.PopupEntity(selfMessage, uid, Filter.Entities(victimUid));
|
||||
|
||||
return SuicideKind.Blunt;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## ToiletComponent
|
||||
|
||||
toilet-component-on-examine-found-hidden-item = There is [color=darkgreen]something[/color] inside cistern!
|
||||
toilet-component-suicide-head-message-others = {$victim} sticks their head into {$owner} and flushes it!
|
||||
toilet-component-suicide-head-message = You stick your head into {$owner} and flush it!
|
||||
toilet-component-suicide-message-others = {$victim} bashes themselves with {$owner}!
|
||||
toilet-component-suicide-message = You bash yourself with {$owner}!
|
||||
toilet-component-suicide-head-message-others = {CAPITALIZE(THE($victim))} sticks their head into {THE($owner)} and flushes it!
|
||||
toilet-component-suicide-head-message = You stick your head into {THE($owner)} and flush it!
|
||||
toilet-component-suicide-message-others = {CAPITALIZE(THE($victim))} bashes themselves with {THE($owner)}!
|
||||
toilet-component-suicide-message = You bash yourself with {THE($owner)}!
|
||||
|
||||
Reference in New Issue
Block a user