From 026f2ee313ded7678ce5857a8b42ea847b1c57d3 Mon Sep 17 00:00:00 2001 From: Fishfish458 <47410468+Fishfish458@users.noreply.github.com> Date: Sun, 19 Dec 2021 16:45:47 -0600 Subject: [PATCH] Small changes for crit mobs to be able to gasp and dead mobs to show dead on examine (#5828) * [ADD] changes to be able to identify living downed players * [FIX] format of tryGetComponent, fixed string * [CHANGE] PR mind component suggestions * [CHANGE] trycomp based on qa feedback * [CHANGE] Condensed mindcomponent as per feedback Co-authored-by: fishfish458 --- Content.Server/Body/Systems/LungSystem.cs | 5 +++- .../Body/Systems/RespiratorSystem.cs | 9 +++---- .../Mind/Components/MindComponent.cs | 25 ++++++++++--------- .../en-US/mind/components/mind-component.ftl | 6 ++--- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Content.Server/Body/Systems/LungSystem.cs b/Content.Server/Body/Systems/LungSystem.cs index 89db6d04c8..c68392d01b 100644 --- a/Content.Server/Body/Systems/LungSystem.cs +++ b/Content.Server/Body/Systems/LungSystem.cs @@ -38,7 +38,7 @@ public class LungSystem : EntitySystem LungComponent? lung=null, SharedMechanismComponent? mech=null) { - if (!Resolve(uid, ref lung)) + if (!Resolve(uid, ref lung, ref mech)) return; if (_gameTiming.CurTime >= lung.LastGaspPopupTime + lung.GaspPopupCooldown) @@ -47,6 +47,9 @@ public class LungSystem : EntitySystem _popupSystem.PopupEntity(Loc.GetString("lung-behavior-gasp"), uid, Filter.Pvs(uid)); } + if (mech.Body != null && TryComp((mech.Body).Owner, out MobStateComponent? mobState) && !mobState.IsAlive()) + return; + Inhale(uid, lung.CycleDelay); } diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index 2e71ac4d05..8bb39d3197 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -153,13 +153,10 @@ namespace Content.Server.Body.Systems if (bloodstreamAmount < amountNeeded) { - if (!EntityManager.GetComponent(uid).IsCritical()) + // Panic inhale + foreach (var (lung, mech) in lungs) { - // Panic inhale - foreach (var (lung, mech) in lungs) - { - _lungSystem.Gasp((lung).Owner, lung, mech); - } + _lungSystem.Gasp((lung).Owner, lung, mech); } bloodstreamAmount = bloodstream.Air.GetMoles(gas); diff --git a/Content.Server/Mind/Components/MindComponent.cs b/Content.Server/Mind/Components/MindComponent.cs index 76ada93768..305d605eba 100644 --- a/Content.Server/Mind/Components/MindComponent.cs +++ b/Content.Server/Mind/Components/MindComponent.cs @@ -137,22 +137,23 @@ namespace Content.Server.Mind.Components _entMan.TryGetComponent(Owner, out var state) && state.IsDead(); - if (!HasMind) + if (dead) { - var aliveText = - $"[color=purple]{Loc.GetString("comp-mind-examined-catatonic", ("ent", Owner))}[/color]"; - var deadText = $"[color=red]{Loc.GetString("comp-mind-examined-dead", ("ent", Owner))}[/color]"; - - message.AddMarkup(dead ? deadText : aliveText); + if (Mind?.Session == null) { + // Player has no session attached and dead + message.AddMarkup($"[color=yellow]{Loc.GetString("mind-component-no-mind-and-dead-text", ("ent", Owner))}[/color]"); + } else { + // Player is dead with session + message.AddMarkup($"[color=red]{Loc.GetString("comp-mind-examined-dead", ("ent", Owner))}[/color]"); + } + } + else if (!HasMind) + { + message.AddMarkup($"[color=purple]{Loc.GetString("comp-mind-examined-catatonic", ("ent", Owner))}[/color]"); } else if (Mind?.Session == null) { - if (dead) return; - - var text = - $"[color=yellow]{Loc.GetString("comp-mind-examined-ssd", ("ent", Owner))}[/color]"; - - message.AddMarkup(text); + message.AddMarkup($"[color=yellow]{Loc.GetString("comp-mind-examined-ssd", ("ent", Owner))}[/color]"); } } } diff --git a/Resources/Locale/en-US/mind/components/mind-component.ftl b/Resources/Locale/en-US/mind/components/mind-component.ftl index 6c12ec1505..e5ee78202c 100644 --- a/Resources/Locale/en-US/mind/components/mind-component.ftl +++ b/Resources/Locale/en-US/mind/components/mind-component.ftl @@ -6,6 +6,6 @@ comp-mind-examined-dead = { CAPITALIZE(POSS-ADJ($ent)) } soul has departed. comp-mind-examined-ssd = { CAPITALIZE(SUBJECT($ent)) } { CONJUGATE-HAVE($ent) } a blank, absent-minded stare and appears completely unresponsive to anything. { CAPITALIZE(SUBJECT($ent)) } may snap out of it soon. -mind-component-no-mind-and-alive-text = {$owner} is totally catatonic. The stresses of life in deep-space must have been too much for them. Any recovery is unlikely. -mind-component-no-mind-and-dead-text = {$owner}'s soul has departed. -mind-component-mind-and-no-session-text = {$owner} has a blank, absent-minded stare and appears completely unresponsive to anything. {$owner} may snap out of it soon. \ No newline at end of file +mind-component-no-mind-and-alive-text = { CAPITALIZE(POSS-ADJ($ent)) } is totally catatonic. The stresses of life in deep-space must have been too much for them. Any recovery is unlikely. +mind-component-no-mind-and-dead-text = { CAPITALIZE(POSS-ADJ($ent)) } soul has departed and moved on. Any recovery is unlikely. +mind-component-mind-and-no-session-text = { CAPITALIZE(POSS-ADJ($ent)) } { CONJUGATE-HAVE($ent) } a blank, absent-minded stare and appears completely unresponsive to anything. { CAPITALIZE(POSS-ADJ($ent)) } may snap out of it soon.