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 <fishfish458>
This commit is contained in:
@@ -38,7 +38,7 @@ public class LungSystem : EntitySystem
|
|||||||
LungComponent? lung=null,
|
LungComponent? lung=null,
|
||||||
SharedMechanismComponent? mech=null)
|
SharedMechanismComponent? mech=null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref lung))
|
if (!Resolve(uid, ref lung, ref mech))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_gameTiming.CurTime >= lung.LastGaspPopupTime + lung.GaspPopupCooldown)
|
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));
|
_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);
|
Inhale(uid, lung.CycleDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,13 +153,10 @@ namespace Content.Server.Body.Systems
|
|||||||
|
|
||||||
if (bloodstreamAmount < amountNeeded)
|
if (bloodstreamAmount < amountNeeded)
|
||||||
{
|
{
|
||||||
if (!EntityManager.GetComponent<MobStateComponent>(uid).IsCritical())
|
// Panic inhale
|
||||||
|
foreach (var (lung, mech) in lungs)
|
||||||
{
|
{
|
||||||
// Panic inhale
|
_lungSystem.Gasp((lung).Owner, lung, mech);
|
||||||
foreach (var (lung, mech) in lungs)
|
|
||||||
{
|
|
||||||
_lungSystem.Gasp((lung).Owner, lung, mech);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bloodstreamAmount = bloodstream.Air.GetMoles(gas);
|
bloodstreamAmount = bloodstream.Air.GetMoles(gas);
|
||||||
|
|||||||
@@ -137,22 +137,23 @@ namespace Content.Server.Mind.Components
|
|||||||
_entMan.TryGetComponent<MobStateComponent?>(Owner, out var state) &&
|
_entMan.TryGetComponent<MobStateComponent?>(Owner, out var state) &&
|
||||||
state.IsDead();
|
state.IsDead();
|
||||||
|
|
||||||
if (!HasMind)
|
if (dead)
|
||||||
{
|
{
|
||||||
var aliveText =
|
if (Mind?.Session == null) {
|
||||||
$"[color=purple]{Loc.GetString("comp-mind-examined-catatonic", ("ent", Owner))}[/color]";
|
// Player has no session attached and dead
|
||||||
var deadText = $"[color=red]{Loc.GetString("comp-mind-examined-dead", ("ent", Owner))}[/color]";
|
message.AddMarkup($"[color=yellow]{Loc.GetString("mind-component-no-mind-and-dead-text", ("ent", Owner))}[/color]");
|
||||||
|
} else {
|
||||||
message.AddMarkup(dead ? deadText : aliveText);
|
// 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)
|
else if (Mind?.Session == null)
|
||||||
{
|
{
|
||||||
if (dead) return;
|
message.AddMarkup($"[color=yellow]{Loc.GetString("comp-mind-examined-ssd", ("ent", Owner))}[/color]");
|
||||||
|
|
||||||
var text =
|
|
||||||
$"[color=yellow]{Loc.GetString("comp-mind-examined-ssd", ("ent", Owner))}[/color]";
|
|
||||||
|
|
||||||
message.AddMarkup(text);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
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-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 = {$owner}'s soul has departed.
|
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 = {$owner} has a blank, absent-minded stare and appears completely unresponsive to anything. {$owner} may snap out of it soon.
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user