constructable rechargers (#16367)

This commit is contained in:
Segonist
2023-05-31 15:48:55 +02:00
committed by GitHub
parent a96dfcb68c
commit 863d8e8601
7 changed files with 169 additions and 5 deletions

View File

@@ -1,4 +1,6 @@
using Content.Shared.Construction.Prototypes;
using Content.Shared.Power;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Power.Components
{
@@ -8,8 +10,32 @@ namespace Content.Server.Power.Components
[ViewVariables]
public CellChargerStatus Status;
/// <summary>
/// The charge rate of the charger, in watts
/// </summary>
[DataField("chargeRate")]
public int ChargeRate = 20;
public float ChargeRate = 20.0f;
/// <summary>
/// The charge rate with no machine upgrades
/// </summary>
[DataField("baseChargeRate")]
public float BaseChargeRate = 20.0f;
/// <summary>
/// The machine part that affects the charge rate multiplier of the charger
/// </summary>
[DataField("machinePartChargeRateModifier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartChargeRateModifier = "Capacitor";
/// <summary>
/// A value used to scale the charge rate multiplier
/// with the corresponding part rating.
/// </summary>
[DataField("partRatingChargeRateModifier")]
public float PartRatingChargeRateModifier = 1.5f;
[DataField("slotId", required: true)]
public string SlotId = string.Empty;