Rip out remaining machine upgrades (#24413)
* Rip out remaining machine upgrades * eek
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Construction.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Atmos.Portable
|
||||
{
|
||||
@@ -39,51 +37,13 @@ namespace Content.Server.Atmos.Portable
|
||||
/// <summary>
|
||||
/// Maximum internal pressure before it refuses to take more.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MaxPressure = 2500;
|
||||
|
||||
/// <summary>
|
||||
/// The base amount of maximum internal pressure
|
||||
/// </summary>
|
||||
[DataField("baseMaxPressure")]
|
||||
public float BaseMaxPressure = 2500;
|
||||
|
||||
/// <summary>
|
||||
/// The machine part that modifies the maximum internal pressure
|
||||
/// </summary>
|
||||
[DataField("machinePartMaxPressure", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
||||
public string MachinePartMaxPressure = "MatterBin";
|
||||
|
||||
/// <summary>
|
||||
/// How much the <see cref="MachinePartMaxPressure"/> will affect the pressure.
|
||||
/// The value will be multiplied by this amount for each increasing part tier.
|
||||
/// </summary>
|
||||
[DataField("partRatingMaxPressureModifier")]
|
||||
public float PartRatingMaxPressureModifier = 1.5f;
|
||||
|
||||
/// <summary>
|
||||
/// The speed at which gas is scrubbed from the environment.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float TransferRate = 800;
|
||||
|
||||
/// <summary>
|
||||
/// The base speed at which gas is scrubbed from the environment.
|
||||
/// </summary>
|
||||
[DataField("baseTransferRate")]
|
||||
public float BaseTransferRate = 800;
|
||||
|
||||
/// <summary>
|
||||
/// The machine part which modifies the speed of <see cref="TransferRate"/>
|
||||
/// </summary>
|
||||
[DataField("machinePartTransferRate", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
||||
public string MachinePartTransferRate = "Manipulator";
|
||||
|
||||
/// <summary>
|
||||
/// How much the <see cref="MachinePartTransferRate"/> will modify the rate.
|
||||
/// The value will be multiplied by this amount for each increasing part tier.
|
||||
/// </summary>
|
||||
[DataField("partRatingTransferRateModifier")]
|
||||
public float PartRatingTransferRateModifier = 1.4f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Server.NodeContainer.NodeGroups;
|
||||
using Content.Server.Audio;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Construction;
|
||||
using Content.Server.NodeContainer.EntitySystems;
|
||||
using Content.Shared.Database;
|
||||
|
||||
@@ -39,8 +38,6 @@ namespace Content.Server.Atmos.Portable
|
||||
SubscribeLocalEvent<PortableScrubberComponent, ExaminedEvent>(OnExamined);
|
||||
SubscribeLocalEvent<PortableScrubberComponent, DestructionEventArgs>(OnDestroyed);
|
||||
SubscribeLocalEvent<PortableScrubberComponent, GasAnalyzerScanEvent>(OnScrubberAnalyzed);
|
||||
SubscribeLocalEvent<PortableScrubberComponent, RefreshPartsEvent>(OnRefreshParts);
|
||||
SubscribeLocalEvent<PortableScrubberComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||
}
|
||||
|
||||
private bool IsFull(PortableScrubberComponent component)
|
||||
@@ -170,20 +167,5 @@ namespace Content.Server.Atmos.Portable
|
||||
}
|
||||
args.GasMixtures = gasMixDict;
|
||||
}
|
||||
|
||||
private void OnRefreshParts(EntityUid uid, PortableScrubberComponent component, RefreshPartsEvent args)
|
||||
{
|
||||
var pressureRating = args.PartRatings[component.MachinePartMaxPressure];
|
||||
var transferRating = args.PartRatings[component.MachinePartTransferRate];
|
||||
|
||||
component.MaxPressure = component.BaseMaxPressure * MathF.Pow(component.PartRatingMaxPressureModifier, pressureRating - 1);
|
||||
component.TransferRate = component.BaseTransferRate * MathF.Pow(component.PartRatingTransferRateModifier, transferRating - 1);
|
||||
}
|
||||
|
||||
private void OnUpgradeExamine(EntityUid uid, PortableScrubberComponent component, UpgradeExamineEvent args)
|
||||
{
|
||||
args.AddPercentageUpgrade("portable-scrubber-component-upgrade-max-pressure", component.MaxPressure / component.BaseMaxPressure);
|
||||
args.AddPercentageUpgrade("portable-scrubber-component-upgrade-transfer-rate", component.TransferRate / component.BaseTransferRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user