Portable Generator Rework (#19302)
This commit is contained in:
committed by
GitHub
parent
50828363fe
commit
bf16698efa
@@ -1,23 +1,40 @@
|
||||
using Content.Shared.Materials;
|
||||
using Content.Shared.Power.Generator;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Power.Generator;
|
||||
|
||||
/// <summary>
|
||||
/// This is used for allowing you to insert fuel into gens.
|
||||
/// Fuels a <see cref="FuelGeneratorComponent"/> through solid materials.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Must be accompanied with a <see cref="MaterialStorageComponent"/> to store the actual material and handle insertion logic.
|
||||
/// You should set a whitelist there for the fuel material.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The component itself stores a "fractional" fuel value to allow stack materials to be gradually consumed.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[RegisterComponent, Access(typeof(GeneratorSystem))]
|
||||
public sealed partial class SolidFuelGeneratorAdapterComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The material to accept as fuel.
|
||||
/// </summary>
|
||||
[DataField("fuelMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("fuelMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>))]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string FuelMaterial = "Plasma";
|
||||
|
||||
/// <summary>
|
||||
/// How much fuel that material should count for.
|
||||
/// How much material (can be fractional) is left in the generator.
|
||||
/// </summary>
|
||||
[DataField("fractionalMaterial"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float FractionalMaterial;
|
||||
|
||||
/// <summary>
|
||||
/// Value to multiply material amount by to get fuel amount.
|
||||
/// </summary>
|
||||
[DataField("multiplier"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Multiplier = 1.0f;
|
||||
public float Multiplier;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user