2023-05-31 15:48:55 +02:00
|
|
|
using Content.Shared.Construction.Prototypes;
|
2022-01-05 17:20:25 +13:00
|
|
|
using Content.Shared.Power;
|
2023-05-31 15:48:55 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2022-01-05 17:20:25 +13:00
|
|
|
|
|
|
|
|
namespace Content.Server.Power.Components
|
|
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
public sealed class ChargerComponent : Component
|
|
|
|
|
{
|
|
|
|
|
[ViewVariables]
|
2022-10-16 03:21:54 -07:00
|
|
|
public CellChargerStatus Status;
|
2022-01-05 17:20:25 +13:00
|
|
|
|
2023-05-31 15:48:55 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The charge rate of the charger, in watts
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
2022-01-05 17:20:25 +13:00
|
|
|
[DataField("chargeRate")]
|
2023-05-31 15:48:55 +02:00
|
|
|
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;
|
2022-01-05 17:20:25 +13:00
|
|
|
|
2022-10-16 03:21:54 -07:00
|
|
|
[DataField("slotId", required: true)]
|
|
|
|
|
public string SlotId = string.Empty;
|
2022-01-05 17:20:25 +13:00
|
|
|
}
|
|
|
|
|
}
|