2022-04-28 15:36:25 +03:00
|
|
|
using Content.Server.Singularity.EntitySystems;
|
2023-09-04 08:11:57 -05:00
|
|
|
using Content.Shared.Atmos;
|
2020-10-28 19:19:47 +01:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
namespace Content.Server.Singularity.Components;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generates electricity from radiation.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
[Access(typeof(RadiationCollectorSystem))]
|
|
|
|
|
public sealed partial class RadiationCollectorComponent : Component
|
2020-10-28 19:19:47 +01:00
|
|
|
{
|
2022-04-28 15:36:25 +03:00
|
|
|
/// <summary>
|
2023-09-07 13:49:55 -05:00
|
|
|
/// How much joules will collector generate for each rad.
|
2022-04-28 15:36:25 +03:00
|
|
|
/// </summary>
|
2023-09-07 13:49:55 -05:00
|
|
|
[DataField("chargeModifier")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public float ChargeModifier = 30000f;
|
2022-01-23 12:40:27 -08:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Cooldown time between users interaction.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("cooldown")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public TimeSpan Cooldown = TimeSpan.FromSeconds(0.81f);
|
2020-10-28 19:19:47 +01:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Was machine activated by user?
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
|
|
|
public bool Enabled;
|
2020-10-28 19:19:47 +01:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Timestamp when machine can be deactivated again.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public TimeSpan CoolDownEnd;
|
2023-09-04 08:11:57 -05:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// List of gases that will react to the radiation passing through the collector
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("radiationReactiveGases")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public List<RadiationReactiveGas>? RadiationReactiveGases;
|
|
|
|
|
}
|
2023-09-04 08:11:57 -05:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Describes how a gas reacts to the collected radiation
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataDefinition]
|
|
|
|
|
public sealed partial class RadiationReactiveGas
|
|
|
|
|
{
|
2023-09-04 08:11:57 -05:00
|
|
|
/// <summary>
|
2023-09-07 13:49:55 -05:00
|
|
|
/// The reactant gas
|
2023-09-04 08:11:57 -05:00
|
|
|
/// </summary>
|
2023-09-07 13:49:55 -05:00
|
|
|
[DataField("reactantPrototype", required: true)]
|
|
|
|
|
public Gas Reactant = Gas.Plasma;
|
2023-09-04 08:11:57 -05:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Multipier for the amount of power produced by the radiation collector when using this gas
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("powerGenerationEfficiency")]
|
|
|
|
|
public float PowerGenerationEfficiency = 1f;
|
2023-09-04 08:11:57 -05:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Controls the rate (molar percentage per rad) at which the reactant breaks down when exposed to radiation
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// /// <remarks>
|
|
|
|
|
/// Set to zero if the reactant does not deplete
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[DataField("reactantBreakdownRate")]
|
|
|
|
|
public float ReactantBreakdownRate = 1f;
|
2023-09-04 08:11:57 -05:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// A byproduct gas that is generated when the reactant breaks down
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Leave null if the reactant no byproduct gas is to be formed
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[DataField("byproductPrototype")]
|
|
|
|
|
public Gas? Byproduct = null;
|
2023-09-04 08:11:57 -05:00
|
|
|
|
2023-09-07 13:49:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// The molar ratio of the byproduct gas generated from the reactant gas
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("molarRatio")]
|
|
|
|
|
public float MolarRatio = 1f;
|
2020-10-28 19:19:47 +01:00
|
|
|
}
|