Pepper makes you cough (#36358)

This commit is contained in:
āda
2025-05-19 13:23:38 -05:00
committed by GitHub
parent 69354f59c8
commit 41a129e749
9 changed files with 143 additions and 9 deletions

View File

@@ -173,6 +173,20 @@ public sealed class RespiratorSystem : EntitySystem
_atmosSys.Merge(ev.Gas, outGas);
}
/// <summary>
/// Returns true if the entity is above their SuffocationThreshold and alive.
/// </summary>
public bool IsBreathing(Entity<RespiratorComponent?> ent)
{
if (_mobState.IsIncapacitated(ent))
return false;
if (!Resolve(ent, ref ent.Comp))
return false;
return (ent.Comp.Saturation > ent.Comp.SuffocationThreshold);
}
/// <summary>
/// Check whether or not an entity can metabolize inhaled air without suffocating or taking damage (i.e., no toxic
/// gasses).