Files
wwdpublic/Content.Server/Power/Components/UpgradePowerDrawComponent.cs
VMSolidus 96ac353f4a Reimplement Part Upgrading (#917)
# Description

By extremely popular demand(Both internally, and from our downstreams),
this PR reimplements Part Upgrading. Since some of the systems that this
PR touches were substantially changed since the removal of Parts, I had
to do a lot of very in depth by-hand edits of individual systems.
Shockingly, the only one that really proved any trouble was Cloning
System, so I'm genuinely surprised wizden didn't substantially touch any
of these codes since removing parts..

# Changelog

🆑
- add: Part Upgrading has returned!

---------

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
2024-10-19 13:15:15 +07:00

42 lines
1.4 KiB
C#

using Content.Server.Construction.Components;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Power.Components;
/// <summary>
/// This is used for machines whose power draw
/// can be decreased through machine part upgrades.
/// </summary>
[RegisterComponent]
public sealed partial class UpgradePowerDrawComponent : Component
{
/// <summary>
/// The base power draw of the machine.
/// Prioritizes hv/mv draw over lv draw.
/// Value is initializezd on map init from <see cref="ApcPowerReceiverComponent"/>
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float BaseLoad;
/// <summary>
/// The machine part that affects the power draw.
/// </summary>
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string MachinePartPowerDraw = "Capacitor";
/// <summary>
/// The multiplier used for scaling the power draw.
/// </summary>
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
public float PowerDrawMultiplier = 1f;
/// <summary>
/// What type of scaling is being used?
/// </summary>
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
public MachineUpgradeScalingType Scaling;
}