Add verbose (client predicted!) examine text to Gas Miners (#30480)

* add verbose examine text to gas miners so their behaviour can be understood

* no need for these to be properties

* use an enum instead of two booleans for the miner state

* require the gas miner to be anchored in order to not be disabled

* xmldoc

* pr feedback

* file-scope namespace

* it's to late to hide my transgressions in a rebase

* turns out the normal examine distance is totally fine for this
This commit is contained in:
Mervill
2024-08-07 19:14:31 -07:00
committed by GitHub
parent 9645f5528b
commit b8d10a3f5e
7 changed files with 226 additions and 127 deletions

View File

@@ -0,0 +1,60 @@
using Robust.Shared.Serialization;
using Robust.Shared.GameStates;
namespace Content.Shared.Atmos.Components;
[NetworkedComponent]
[AutoGenerateComponentState]
[RegisterComponent]
public sealed partial class GasMinerComponent : Component
{
/// <summary>
/// Operational state of the miner.
/// </summary>
[AutoNetworkedField]
[ViewVariables(VVAccess.ReadOnly)]
public GasMinerState MinerState = GasMinerState.Disabled;
/// <summary>
/// If the number of moles in the external environment exceeds this number, no gas will be mined.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float MaxExternalAmount = float.PositiveInfinity;
/// <summary>
/// If the pressure (in kPA) of the external environment exceeds this number, no gas will be mined.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float MaxExternalPressure = Atmospherics.GasMinerDefaultMaxExternalPressure;
/// <summary>
/// Gas to spawn.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public Gas SpawnGas;
/// <summary>
/// Temperature in Kelvin.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float SpawnTemperature = Atmospherics.T20C;
/// <summary>
/// Number of moles created per second when the miner is working.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float SpawnAmount = Atmospherics.MolesCellStandard * 20f;
}
[Serializable, NetSerializable]
public enum GasMinerState : byte
{
Disabled,
Idle,
Working,
}