Varied and semi-sprited atmos markers (#4944)
This commit is contained in:
@@ -29,9 +29,24 @@ namespace Content.Server.Atmos.Commands
|
|||||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||||
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
||||||
|
|
||||||
var mixture = new GasMixture(Atmospherics.CellVolume) { Temperature = Atmospherics.T20C };
|
var mixtures = new GasMixture[5];
|
||||||
mixture.AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesStandard);
|
for (var i = 0; i < mixtures.Length; i++)
|
||||||
mixture.AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesStandard);
|
mixtures[i] = new GasMixture(Atmospherics.CellVolume) { Temperature = Atmospherics.T20C };
|
||||||
|
|
||||||
|
// 0: Air
|
||||||
|
mixtures[0].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesStandard);
|
||||||
|
mixtures[0].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesStandard);
|
||||||
|
|
||||||
|
// 1: Vaccum
|
||||||
|
|
||||||
|
// 2: Oxygen (GM)
|
||||||
|
mixtures[2].AdjustMoles(Gas.Oxygen, Atmospherics.MolesCellGasMiner);
|
||||||
|
|
||||||
|
// 3: Nitrogen (GM)
|
||||||
|
mixtures[3].AdjustMoles(Gas.Nitrogen, Atmospherics.MolesCellGasMiner);
|
||||||
|
|
||||||
|
// 4: Plasma (GM)
|
||||||
|
mixtures[4].AdjustMoles(Gas.Plasma, Atmospherics.MolesCellGasMiner);
|
||||||
|
|
||||||
foreach (var gid in args)
|
foreach (var gid in args)
|
||||||
{
|
{
|
||||||
@@ -63,18 +78,15 @@ namespace Content.Server.Atmos.Commands
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
tile.Clear();
|
tile.Clear();
|
||||||
var blocker = false;
|
var mixtureId = 0;
|
||||||
foreach (var entUid in mapGrid.GetAnchoredEntities(indices))
|
foreach (var entUid in mapGrid.GetAnchoredEntities(indices))
|
||||||
{
|
{
|
||||||
if (!entityManager.TryGetComponent(entUid, out TagComponent? tags))
|
if (!entityManager.TryGetComponent(entUid, out AtmosFixMarkerComponent? afm))
|
||||||
continue;
|
continue;
|
||||||
if (tags.HasTag("AtmosFixBlocking"))
|
mixtureId = afm.Mode;
|
||||||
{
|
|
||||||
blocker = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
var mixture = mixtures[mixtureId];
|
||||||
if (!blocker)
|
|
||||||
atmosphereSystem.Merge(tile, mixture);
|
atmosphereSystem.Merge(tile, mixture);
|
||||||
tile.Temperature = mixture.Temperature;
|
tile.Temperature = mixture.Temperature;
|
||||||
|
|
||||||
|
|||||||
21
Content.Server/Atmos/Components/AtmosFixMarkerComponent.cs
Normal file
21
Content.Server/Atmos/Components/AtmosFixMarkerComponent.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using Content.Server.Atmos.EntitySystems;
|
||||||
|
using Content.Server.Temperature.Components;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
|
namespace Content.Server.Atmos.Components
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Used by FixGridAtmos. Entities with this may get magically auto-deleted on map initialization in future.
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent]
|
||||||
|
public class AtmosFixMarkerComponent : Component
|
||||||
|
{
|
||||||
|
public override string Name => "AtmosFixMarker";
|
||||||
|
|
||||||
|
// See FixGridAtmos for more details
|
||||||
|
[DataField("mode")]
|
||||||
|
public int Mode { get; set; } = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,7 +20,7 @@ namespace Content.Server.Atmos.Piping.Other.Components
|
|||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("maxExternalPressure")]
|
[DataField("maxExternalPressure")]
|
||||||
public float MaxExternalPressure { get; set; } = 6500f;
|
public float MaxExternalPressure { get; set; } = Atmospherics.GasMinerDefaultMaxExternalPressure;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("spawnGas")]
|
[DataField("spawnGas")]
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ namespace Content.Shared.Atmos
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const float OneAtmosphere = 101.325f;
|
public const float OneAtmosphere = 101.325f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Maximum external pressure (in kPA) a gas miner will, by default, output to.
|
||||||
|
/// This is used to initialize roundstart atmos rooms.
|
||||||
|
/// </summary>
|
||||||
|
public const float GasMinerDefaultMaxExternalPressure = 6500f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// -270.3ºC in K. CMB stands for Cosmic Microwave Background.
|
/// -270.3ºC in K. CMB stands for Cosmic Microwave Background.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,6 +63,11 @@ namespace Content.Shared.Atmos
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const float MolesCellStandard = (OneAtmosphere * CellVolume / (T20C * R));
|
public const float MolesCellStandard = (OneAtmosphere * CellVolume / (T20C * R));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Moles in a 2.5 m^3 cell at GasMinerDefaultMaxExternalPressure kPa and 20ºC
|
||||||
|
/// </summary>
|
||||||
|
public const float MolesCellGasMiner = (GasMinerDefaultMaxExternalPressure * CellVolume / (T20C * R));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compared against for superconduction.
|
/// Compared against for superconduction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -69368,109 +69368,109 @@ entities:
|
|||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6651
|
- uid: 6651
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixOxygenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 37.5,22.5
|
- pos: 37.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6652
|
- uid: 6652
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixOxygenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 37.5,21.5
|
- pos: 37.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6653
|
- uid: 6653
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixOxygenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 38.5,22.5
|
- pos: 38.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6654
|
- uid: 6654
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixOxygenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 38.5,21.5
|
- pos: 38.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6655
|
- uid: 6655
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixOxygenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 39.5,22.5
|
- pos: 39.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6656
|
- uid: 6656
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixOxygenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 39.5,21.5
|
- pos: 39.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6657
|
- uid: 6657
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixNitrogenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 41.5,22.5
|
- pos: 41.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6658
|
- uid: 6658
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixNitrogenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 41.5,21.5
|
- pos: 41.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6659
|
- uid: 6659
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixNitrogenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 42.5,22.5
|
- pos: 42.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6660
|
- uid: 6660
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixNitrogenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 42.5,21.5
|
- pos: 42.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6661
|
- uid: 6661
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixNitrogenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 43.5,22.5
|
- pos: 43.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6662
|
- uid: 6662
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixNitrogenMarker
|
||||||
components:
|
components:
|
||||||
- pos: 43.5,21.5
|
- pos: 43.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6663
|
- uid: 6663
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixPlasmaMarker
|
||||||
components:
|
components:
|
||||||
- pos: 45.5,22.5
|
- pos: 45.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6664
|
- uid: 6664
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixPlasmaMarker
|
||||||
components:
|
components:
|
||||||
- pos: 45.5,21.5
|
- pos: 45.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6665
|
- uid: 6665
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixPlasmaMarker
|
||||||
components:
|
components:
|
||||||
- pos: 46.5,22.5
|
- pos: 46.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6666
|
- uid: 6666
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixPlasmaMarker
|
||||||
components:
|
components:
|
||||||
- pos: 46.5,21.5
|
- pos: 46.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6667
|
- uid: 6667
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixPlasmaMarker
|
||||||
components:
|
components:
|
||||||
- pos: 47.5,22.5
|
- pos: 47.5,22.5
|
||||||
parent: 853
|
parent: 853
|
||||||
type: Transform
|
type: Transform
|
||||||
- uid: 6668
|
- uid: 6668
|
||||||
type: AtmosFixBlockerMarker
|
type: AtmosFixPlasmaMarker
|
||||||
components:
|
components:
|
||||||
- pos: 47.5,21.5
|
- pos: 47.5,21.5
|
||||||
parent: 853
|
parent: 853
|
||||||
|
|||||||
@@ -1,13 +1,68 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
name: Atmos Fix Blocker Marker
|
name: Atmos Fix Vacuum Marker
|
||||||
id: AtmosFixBlockerMarker
|
id: AtmosFixBlockerMarker
|
||||||
|
description: "Vacuum, T20C"
|
||||||
parent: MarkerBase
|
parent: MarkerBase
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
- state: red
|
- sprite: Markers/atmos.rsi # {
|
||||||
- texture: Objects/Specific/Atmos/gasanalyzer.rsi/icon.png
|
state: base
|
||||||
- type: Tag
|
shader: unshaded
|
||||||
tags:
|
- sprite: Markers/atmos.rsi
|
||||||
- AtmosFixBlocking
|
shader: unshaded # }
|
||||||
|
state: vacuum
|
||||||
|
- type: AtmosFixMarker
|
||||||
|
mode: 1
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
name: Atmos Fix Oxygen Marker
|
||||||
|
id: AtmosFixOxygenMarker
|
||||||
|
description: "Oxygen @ gas miner pressure, T20C"
|
||||||
|
parent: MarkerBase
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
layers:
|
||||||
|
- sprite: Markers/atmos.rsi # {
|
||||||
|
state: base
|
||||||
|
shader: unshaded
|
||||||
|
- sprite: Markers/atmos.rsi
|
||||||
|
shader: unshaded # }
|
||||||
|
state: oxygen
|
||||||
|
- type: AtmosFixMarker
|
||||||
|
mode: 2
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
name: Atmos Fix Nitrogen Marker
|
||||||
|
id: AtmosFixNitrogenMarker
|
||||||
|
description: "Nitrogen @ gas miner pressure, T20C"
|
||||||
|
parent: MarkerBase
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
layers:
|
||||||
|
- sprite: Markers/atmos.rsi # {
|
||||||
|
state: base
|
||||||
|
shader: unshaded
|
||||||
|
- sprite: Markers/atmos.rsi
|
||||||
|
shader: unshaded # }
|
||||||
|
state: nitrogen
|
||||||
|
- type: AtmosFixMarker
|
||||||
|
mode: 3
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
name: Atmos Fix Plasma Marker
|
||||||
|
id: AtmosFixPlasmaMarker
|
||||||
|
description: "Plasma @ gas miner pressure, T20C"
|
||||||
|
parent: MarkerBase
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
layers:
|
||||||
|
- sprite: Markers/atmos.rsi # {
|
||||||
|
state: base
|
||||||
|
shader: unshaded
|
||||||
|
- sprite: Markers/atmos.rsi
|
||||||
|
shader: unshaded # }
|
||||||
|
state: plasma
|
||||||
|
- type: AtmosFixMarker
|
||||||
|
mode: 4
|
||||||
|
|
||||||
|
|||||||
@@ -214,6 +214,3 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
id: HideContextMenu
|
id: HideContextMenu
|
||||||
|
|
||||||
- type: Tag
|
|
||||||
id: AtmosFixBlocking
|
|
||||||
|
|
||||||
|
|||||||
BIN
Resources/Textures/Markers/atmos.rsi/base.png
Normal file
BIN
Resources/Textures/Markers/atmos.rsi/base.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 250 B |
29
Resources/Textures/Markers/atmos.rsi/meta.json
Normal file
29
Resources/Textures/Markers/atmos.rsi/meta.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"license": "CC-BY-SA-3.0",
|
||||||
|
"copyright": "Space Wizards Federation",
|
||||||
|
"size": {
|
||||||
|
"x": 32,
|
||||||
|
"y": 32
|
||||||
|
},
|
||||||
|
"states": [
|
||||||
|
{
|
||||||
|
"name": "base"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vacuum"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "oxygen"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nitrogen"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "plasma"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "watervapour"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
Resources/Textures/Markers/atmos.rsi/nitrogen.png
Normal file
BIN
Resources/Textures/Markers/atmos.rsi/nitrogen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 217 B |
BIN
Resources/Textures/Markers/atmos.rsi/oxygen.png
Normal file
BIN
Resources/Textures/Markers/atmos.rsi/oxygen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 213 B |
BIN
Resources/Textures/Markers/atmos.rsi/plasma.png
Normal file
BIN
Resources/Textures/Markers/atmos.rsi/plasma.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 216 B |
BIN
Resources/Textures/Markers/atmos.rsi/vacuum.png
Normal file
BIN
Resources/Textures/Markers/atmos.rsi/vacuum.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 212 B |
BIN
Resources/Textures/Markers/atmos.rsi/watervapour.png
Normal file
BIN
Resources/Textures/Markers/atmos.rsi/watervapour.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 215 B |
Reference in New Issue
Block a user