Allow chemical-fueled generators to use multiple reagents (#24258)
multi-reagent generators
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Content.Shared.Chemistry.Components.SolutionManager;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Power.Generator;
|
||||
@@ -13,11 +14,10 @@ namespace Content.Server.Power.Generator;
|
||||
public sealed partial class ChemicalFuelGeneratorAdapterComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The reagent to accept as fuel.
|
||||
/// A dictionary relating a reagent to accept as fuel to a value to multiply reagent amount by to get fuel amount.
|
||||
/// </summary>
|
||||
[DataField("reagent", customTypeSerializer: typeof(PrototypeIdSerializer<ReagentPrototype>))]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string Reagent = "WeldingFuel";
|
||||
[DataField]
|
||||
public Dictionary<ProtoId<ReagentPrototype>, float> Reagents = new();
|
||||
|
||||
/// <summary>
|
||||
/// The name of <see cref="Solution"/>.
|
||||
@@ -32,16 +32,10 @@ public sealed partial class ChemicalFuelGeneratorAdapterComponent : Component
|
||||
[DataField("solutionRef")]
|
||||
public Entity<SolutionComponent>? Solution = null;
|
||||
|
||||
/// <summary>
|
||||
/// Value to multiply reagent amount by to get fuel amount.
|
||||
/// </summary>
|
||||
[DataField("multiplier"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Multiplier = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// How much reagent (can be fractional) is left in the generator.
|
||||
/// Stored in units of <see cref="FixedPoint2.Epsilon"/>.
|
||||
/// </summary>
|
||||
[DataField("fractionalReagent"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float FractionalReagent;
|
||||
[DataField]
|
||||
public Dictionary<ProtoId<ReagentPrototype>, float> FractionalReagents = new();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user