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
This commit is contained in:
thetuerk
2025-10-09 12:26:21 +02:00
committed by GitHub
parent 6f3f7d86b8
commit bb3fa43f1f
6 changed files with 15 additions and 14 deletions

View File

@@ -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;

View File

@@ -25,8 +25,6 @@ namespace Content.Server.Atmos.EntitySystems
/// </summary>
public float[] GasSpecificHeats => _gasSpecificHeats;
public string?[] GasReagents = new string[Atmospherics.TotalNumberOfGases];
private void InitializeGases()
{
_gasReactions = _protoMan.EnumeratePrototypes<GasReactionPrototype>().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;
}
}

View File

@@ -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;

View File

@@ -13,6 +13,8 @@ namespace Content.Shared.Atmos.EntitySystems
private EntityQuery<InternalsComponent> _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<GasPrototype>(i.ToString());
GasReagents[i] = GasPrototypes[i].Reagent;
}
}

View File

@@ -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]

View File

@@ -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";