Draw MapAtmosphere gasses (#17688)

This commit is contained in:
metalgearsloth
2023-06-28 21:22:03 +10:00
committed by GitHub
parent 2488dd4ecd
commit 44a3db398b
11 changed files with 250 additions and 81 deletions

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Server.Administration;
using Content.Server.Atmos;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Parallax;
using Content.Shared.Administration;
using Content.Shared.Atmos;
@@ -85,17 +86,18 @@ public sealed class PlanetCommand : IConsoleCommand
// Atmos
var atmos = _entManager.EnsureComponent<MapAtmosphereComponent>(mapUid);
atmos.Space = false;
var moles = new float[Atmospherics.AdjustedNumberOfGases];
moles[(int) Gas.Oxygen] = 21.824779f;
moles[(int) Gas.Nitrogen] = 82.10312f;
atmos.Mixture = new GasMixture(2500)
var mixture = new GasMixture(2500)
{
Temperature = 293.15f,
Moles = moles,
};
_entManager.System<AtmosphereSystem>().SetMapAtmosphere(mapUid, false, mixture, atmos);
_entManager.EnsureComponent<MapGridComponent>(mapUid);
shell.WriteLine(Loc.GetString("cmd-planet-success", ("mapId", mapId)));
}