From c2f01982434ced0559b89f0b705bbc5846d3d3b8 Mon Sep 17 00:00:00 2001 From: keronshb <54602815+keronshb@users.noreply.github.com> Date: Fri, 8 Apr 2022 00:37:39 -0400 Subject: [PATCH] Fixes Holoparasites killing their hosts when suiciding. (#7465) * Fixes Holoparasites from killing their hosts when suiciding * Adds the CannotSuicide tag to the Guardian Parent This way it effects all guardian types and not just holoparasites. * Adds check, fixes whitespace * Fixes the ghosting check --- Content.Server/Chat/Commands/SuicideCommand.cs | 12 ++++++++++++ .../Prototypes/Entities/Mobs/Player/guardian.yml | 5 ++++- Resources/Prototypes/tags.yml | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Content.Server/Chat/Commands/SuicideCommand.cs b/Content.Server/Chat/Commands/SuicideCommand.cs index 89b54f9a50..bdfa9d49bb 100644 --- a/Content.Server/Chat/Commands/SuicideCommand.cs +++ b/Content.Server/Chat/Commands/SuicideCommand.cs @@ -12,6 +12,7 @@ using Content.Shared.Damage.Prototypes; using Content.Shared.Database; using Content.Shared.Item; using Content.Shared.Popups; +using Content.Shared.Tag; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.Enums; @@ -82,6 +83,17 @@ namespace Content.Server.Chat.Commands return; } + //Checks to see if the CannotSuicide tag exits, ghosts instead. + if(EntitySystem.Get().HasTag(owner, "CannotSuicide")) + { + if (!EntitySystem.Get().OnGhostAttempt(mind, true)) + { + shell?.WriteLine("You can't ghost right now."); + return; + } + return; + } + //TODO: needs to check if the mob is actually alive //TODO: maybe set a suicided flag to prevent resurrection? diff --git a/Resources/Prototypes/Entities/Mobs/Player/guardian.yml b/Resources/Prototypes/Entities/Mobs/Player/guardian.yml index 5806cb7919..c840da2d26 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/guardian.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/guardian.yml @@ -86,6 +86,9 @@ interactSuccessString: petting-success-holo interactFailureString: petting-failure-holo successChance: 0.7 + - type: Tag + tags: + - CannotSuicide # From the uplink injector - type: entity @@ -123,4 +126,4 @@ - state: magic_base - state: magic_flare color: "#d14730" - shader: unshaded \ No newline at end of file + shader: unshaded diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 6eadfbebba..faa02344d3 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -42,6 +42,9 @@ - type: Tag id: CanPilot +- type: Tag + id: CannotSuicide + - type: Tag id: CaptainSabre