You now stop breathing while in crit.
This commit is contained in:
@@ -8,6 +8,7 @@ using Content.Server.GameObjects.Components.Body.Respiratory;
|
|||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.GameObjects.Components.Body.Behavior;
|
using Content.Shared.GameObjects.Components.Body.Behavior;
|
||||||
|
using Content.Shared.GameObjects.Components.Mobs.State;
|
||||||
using Robust.Shared.Interfaces.Timing;
|
using Robust.Shared.Interfaces.Timing;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
@@ -99,6 +100,11 @@ namespace Content.Server.GameObjects.Components.Body.Behavior
|
|||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
|
if (Body != null && Body.Owner.TryGetComponent(out IMobStateComponent? mobState) && mobState.IsCritical())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Status == LungStatus.None)
|
if (Status == LungStatus.None)
|
||||||
{
|
{
|
||||||
Status = LungStatus.Inhaling;
|
Status = LungStatus.Inhaling;
|
||||||
|
|||||||
@@ -206,10 +206,13 @@ namespace Content.Server.GameObjects.Components.Metabolism
|
|||||||
|
|
||||||
if (bloodstreamAmount < amountNeeded)
|
if (bloodstreamAmount < amountNeeded)
|
||||||
{
|
{
|
||||||
// Panic inhale
|
if (!Owner.GetComponent<IMobStateComponent>().IsCritical())
|
||||||
foreach (var lung in lungs)
|
|
||||||
{
|
{
|
||||||
lung.Gasp();
|
// Panic inhale
|
||||||
|
foreach (var lung in lungs)
|
||||||
|
{
|
||||||
|
lung.Gasp();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bloodstreamAmount = bloodstream.Air.GetMoles(gas);
|
bloodstreamAmount = bloodstream.Air.GetMoles(gas);
|
||||||
|
|||||||
Reference in New Issue
Block a user