Change all of body system to use entities and components (#2074)
* Early commit * Early commit 2 * merging master broke my git * does anyone even read these * life is fleeting * it just works * this time passing integration tests * Remove hashset yaml serialization for now * You got a license for those nullables? * No examine, no context menu, part and mechanism parenting and visibility * Fix wrong brain sprite state * Removing layers was a mistake * just tear body system a new one and see if it still breathes * Remove redundant code * Add that comment back * Separate damage and body, component states, stomach rework * Add containers for body parts * Bring layers back pls * Fix parts magically changing color * Reimplement sprite layer visibility * Fix tests * Add leg test * Active legs is gone Crab rave * Merge fixes, rename DamageState to CurrentState * Remove IShowContextMenu and ICanExamine
This commit is contained in:
@@ -2,12 +2,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.GameObjects.Components.Body.Behavior;
|
||||
using Content.Server.GameObjects.Components.Body.Circulatory;
|
||||
using Content.Server.GameObjects.Components.Body.Respiratory;
|
||||
using Content.Server.GameObjects.Components.Temperature;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.GameObjects.Components.Body.Mechanism;
|
||||
using Content.Shared.GameObjects.Components.Damage;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Interfaces;
|
||||
@@ -190,9 +191,13 @@ namespace Content.Server.GameObjects.Components.Metabolism
|
||||
if (bloodstreamAmount < amountNeeded)
|
||||
{
|
||||
// Panic inhale
|
||||
if (Owner.TryGetComponent(out LungComponent lung))
|
||||
if (Owner.TryGetMechanismBehaviors(out List<LungBehaviorComponent> lungs))
|
||||
{
|
||||
lung.Gasp();
|
||||
foreach (var lung in lungs)
|
||||
{
|
||||
lung.Gasp();
|
||||
}
|
||||
|
||||
bloodstreamAmount = bloodstream.Air.GetMoles(gas);
|
||||
}
|
||||
|
||||
@@ -341,7 +346,7 @@ namespace Content.Server.GameObjects.Components.Metabolism
|
||||
public void Update(float frameTime)
|
||||
{
|
||||
if (!Owner.TryGetComponent<IDamageableComponent>(out var damageable) ||
|
||||
damageable.CurrentDamageState == DamageState.Dead)
|
||||
damageable.CurrentState == DamageState.Dead)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user