From: thetuerk <46725294+ThanosDeGraf@users.noreply.github.com> Date: Thu, 9 Oct 2025 10:26:21 +0000 (+0200) Subject: Predict LungSystem (#40729) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=bb3fa43f1f6ff133501bb298b4bb95407427159f;p=space-station-14.git Predict LungSystem (#40729) * Initial edits of files Untested yet. I would like to make sure all is accounted for before moving the files. * trying my best * Revert "trying my best" This reverts commit 9aeece466df0169adec97e3947b061b54fd9b388. * Revert "Initial edits of files" This reverts commit 45c6e2343844b5fcafadbf2e5115fb2f241086a1. * an actual meal * Added networking to LungComponent.cs * removed duplicate using * moving GasRagents to SharedAtmosphereSystem.cs --- diff --git a/Content.IntegrationTests/Tests/Body/LungTest.cs b/Content.IntegrationTests/Tests/Body/LungTest.cs index 8ac3a3021f..584eb58595 100644 --- a/Content.IntegrationTests/Tests/Body/LungTest.cs +++ b/Content.IntegrationTests/Tests/Body/LungTest.cs @@ -1,7 +1,7 @@ using Content.Server.Atmos.Components; using Content.Server.Atmos.EntitySystems; using Content.Server.Body.Components; -using Content.Server.Body.Systems; +using Content.Shared.Body.Systems; using Content.Shared.Body.Components; using Robust.Server.GameObjects; using Robust.Shared; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs index c545186669..0c6a3a7daa 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs @@ -25,8 +25,6 @@ namespace Content.Server.Atmos.EntitySystems /// public float[] GasSpecificHeats => _gasSpecificHeats; - public string?[] GasReagents = new string[Atmospherics.TotalNumberOfGases]; - private void InitializeGases() { _gasReactions = _protoMan.EnumeratePrototypes().ToArray(); @@ -37,7 +35,6 @@ namespace Content.Server.Atmos.EntitySystems for (var i = 0; i < GasPrototypes.Length; i++) { _gasSpecificHeats[i] = GasPrototypes[i].SpecificHeat / HeatScale; - GasReagents[i] = GasPrototypes[i].Reagent; } } diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index eab3e2e56c..63b04adc6a 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Atmos.EntitySystems; using Content.Server.Body.Components; using Content.Server.Chat.Systems; using Content.Server.EntityEffects; +using Content.Shared.Body.Systems; using Content.Shared.Alert; using Content.Shared.Atmos; using Content.Shared.Body.Components; diff --git a/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.cs b/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.cs index 4698939734..4a177e6263 100644 --- a/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.cs +++ b/Content.Shared/Atmos/EntitySystems/SharedAtmosphereSystem.cs @@ -13,6 +13,8 @@ namespace Content.Shared.Atmos.EntitySystems private EntityQuery _internalsQuery; + public string?[] GasReagents = new string[Atmospherics.TotalNumberOfGases]; + protected readonly GasPrototype[] GasPrototypes = new GasPrototype[Atmospherics.TotalNumberOfGases]; public override void Initialize() @@ -26,6 +28,7 @@ namespace Content.Shared.Atmos.EntitySystems for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++) { GasPrototypes[i] = _prototypeManager.Index(i.ToString()); + GasReagents[i] = GasPrototypes[i].Reagent; } } diff --git a/Content.Server/Body/Components/LungComponent.cs b/Content.Shared/Body/Components/LungComponent.cs similarity index 84% rename from Content.Server/Body/Components/LungComponent.cs rename to Content.Shared/Body/Components/LungComponent.cs index 4fb769d670..dd31de7722 100644 --- a/Content.Server/Body/Components/LungComponent.cs +++ b/Content.Shared/Body/Components/LungComponent.cs @@ -1,12 +1,13 @@ -using Content.Server.Body.Systems; +using Content.Shared.Body.Systems; using Content.Shared.Alert; using Content.Shared.Atmos; using Content.Shared.Chemistry.Components; +using Robust.Shared.GameStates; using Robust.Shared.Prototypes; -namespace Content.Server.Body.Components; +namespace Content.Shared.Body.Components; -[RegisterComponent, Access(typeof(LungSystem))] +[RegisterComponent, NetworkedComponent, Access(typeof(LungSystem))] public sealed partial class LungComponent : Component { [DataField] diff --git a/Content.Server/Body/Systems/LungSystem.cs b/Content.Shared/Body/Systems/LungSystem.cs similarity index 86% rename from Content.Server/Body/Systems/LungSystem.cs rename to Content.Shared/Body/Systems/LungSystem.cs index fdc071c5f1..5f4c1ee4ef 100644 --- a/Content.Server/Body/Systems/LungSystem.cs +++ b/Content.Shared/Body/Systems/LungSystem.cs @@ -1,19 +1,18 @@ -using Content.Server.Atmos.EntitySystems; -using Content.Server.Body.Components; +using Content.Shared.Atmos.Components; +using Content.Shared.Atmos.EntitySystems; +using Content.Shared.Body.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Atmos; using Content.Shared.Chemistry.Components; using Content.Shared.Clothing; using Content.Shared.Inventory.Events; -using BreathToolComponent = Content.Shared.Atmos.Components.BreathToolComponent; -using InternalsComponent = Content.Shared.Body.Components.InternalsComponent; -namespace Content.Server.Body.Systems; +namespace Content.Shared.Body.Systems; public sealed class LungSystem : EntitySystem { - [Dependency] private readonly AtmosphereSystem _atmos = default!; - [Dependency] private readonly InternalsSystem _internals = default!; + [Dependency] private readonly SharedAtmosphereSystem _atmos = default!; + [Dependency] private readonly SharedInternalsSystem _internals = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; public static string LungSolutionName = "Lung";