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
This commit is contained in:
keronshb
2022-04-08 00:37:39 -04:00
committed by GitHub
parent dc79b36b55
commit c2f0198243
3 changed files with 19 additions and 1 deletions

View File

@@ -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<TagSystem>().HasTag(owner, "CannotSuicide"))
{
if (!EntitySystem.Get<GameTicker>().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?

View File

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

View File

@@ -42,6 +42,9 @@
- type: Tag
id: CanPilot
- type: Tag
id: CannotSuicide
- type: Tag
id: CaptainSabre