From 3868b4a7a495aa748c07ed72efbe21edc59661a2 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Wed, 18 Sep 2024 21:58:15 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: VMSolidus --- .../Tests/Construction/Interaction/MachineConstruction.cs | 4 ---- Content.Server/Bed/BedSystem.cs | 2 +- Content.Server/Power/EntitySystems/UpgradePowerSystem.cs | 4 ++++ .../Equipment/Systems/TraversalDistorterSystem.cs | 1 - Content.Shared/Cloning/CloningPodComponent.cs | 2 +- .../en-US/construction/components/machine-part-component.ftl | 2 +- Resources/Locale/en-US/machine/machine.ftl | 2 +- Resources/Locale/en-US/nutrition/components/fat-extractor.ftl | 2 +- .../Locale/en-US/singularity/components/emitter-component.ftl | 2 +- .../Prototypes/Entities/Markers/Spawners/Random/salvage.yml | 2 +- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Content.IntegrationTests/Tests/Construction/Interaction/MachineConstruction.cs b/Content.IntegrationTests/Tests/Construction/Interaction/MachineConstruction.cs index 17630405a45..f2120df244f 100644 --- a/Content.IntegrationTests/Tests/Construction/Interaction/MachineConstruction.cs +++ b/Content.IntegrationTests/Tests/Construction/Interaction/MachineConstruction.cs @@ -66,9 +66,7 @@ public async Task UpgradeLathe() // Initially has all quality-1 parts. foreach (var part in SConstruction.GetAllParts(serverTarget)) - { Assert.That(part.Rating, Is.EqualTo(1)); - } // Partially deconstruct lathe await Interact(Screw, Pry, Pry); @@ -81,9 +79,7 @@ public async Task UpgradeLathe() // Query now returns higher quality parts. foreach (var part in SConstruction.GetAllParts(SEntMan.GetEntity(Target!.Value))) - { Assert.That(part.Rating, Is.EqualTo(4)); - } } } diff --git a/Content.Server/Bed/BedSystem.cs b/Content.Server/Bed/BedSystem.cs index bb31049c55e..976ef5139c3 100644 --- a/Content.Server/Bed/BedSystem.cs +++ b/Content.Server/Bed/BedSystem.cs @@ -134,7 +134,7 @@ private void UpdateMetabolisms(EntityUid uid, StasisBedComponent component, bool private void OnRefreshParts(EntityUid uid, StasisBedComponent component, RefreshPartsEvent args) { var metabolismRating = args.PartRatings[component.MachinePartMetabolismModifier]; - component.Multiplier = component.BaseMultiplier * metabolismRating; //linear scaling so it's not OP + component.Multiplier = component.BaseMultiplier * metabolismRating; // Linear scaling so it's not OP if (HasComp(uid)) component.Multiplier = 1f / component.Multiplier; } diff --git a/Content.Server/Power/EntitySystems/UpgradePowerSystem.cs b/Content.Server/Power/EntitySystems/UpgradePowerSystem.cs index fb8702d9395..d2f6ee4f568 100644 --- a/Content.Server/Power/EntitySystems/UpgradePowerSystem.cs +++ b/Content.Server/Power/EntitySystems/UpgradePowerSystem.cs @@ -39,6 +39,7 @@ private void OnRefreshParts(EntityUid uid, UpgradePowerDrawComponent component, var load = component.BaseLoad; var rating = args.PartRatings[component.MachinePartPowerDraw]; switch (component.Scaling) + { case MachineUpgradeScalingType.Linear: load += component.PowerDrawMultiplier * (rating - 1); @@ -51,6 +52,7 @@ private void OnRefreshParts(EntityUid uid, UpgradePowerDrawComponent component, load = 0; break; } + if (TryComp(uid, out var powa)) powa.Load = load; if (TryComp(uid, out var powa2)) @@ -80,6 +82,7 @@ private void OnSupplierRefreshParts(EntityUid uid, UpgradePowerSupplierComponent var supply = component.BaseSupplyRate; var rating = args.PartRatings[component.MachinePartPowerSupply]; switch (component.Scaling) + { case MachineUpgradeScalingType.Linear: supply += component.PowerSupplyMultiplier * component.BaseSupplyRate * (rating - 1); @@ -119,6 +122,7 @@ private void OnSupplyRampingRefreshParts(EntityUid uid, UpgradePowerSupplyRampin var rampRate = component.BaseRampRate; var rating = args.PartRatings[component.MachinePartRampRate]; switch (component.Scaling) + { case MachineUpgradeScalingType.Linear: rampRate += component.SupplyRampingMultiplier * component.BaseRampRate * (rating - 1); diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs index d313f9a25bf..bb662925a92 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs @@ -73,7 +73,6 @@ private void OnExamine(EntityUid uid, TraversalDistorterComponent component, Exa examine = Loc.GetString("traversal-distorter-desc-out"); break; } - args.PushMarkup(examine); } diff --git a/Content.Shared/Cloning/CloningPodComponent.cs b/Content.Shared/Cloning/CloningPodComponent.cs index 15c9cf9ea55..c9a6fd4500b 100644 --- a/Content.Shared/Cloning/CloningPodComponent.cs +++ b/Content.Shared/Cloning/CloningPodComponent.cs @@ -46,7 +46,7 @@ public sealed partial class CloningPodComponent : Component public float PartRatingSpeedMultiplier = 0.75f; /// - /// The machine part that affects cloning speed + /// The machine part that affects cloning speed /// [DataField] public ProtoId MachinePartCloningSpeed = "Manipulator"; diff --git a/Resources/Locale/en-US/construction/components/machine-part-component.ftl b/Resources/Locale/en-US/construction/components/machine-part-component.ftl index 2db3b92da96..0613f505161 100644 --- a/Resources/Locale/en-US/construction/components/machine-part-component.ftl +++ b/Resources/Locale/en-US/construction/components/machine-part-component.ftl @@ -1,2 +1,2 @@ machine-part-component-on-examine-rating-text = [color=white]Rating:[/color] [color=cyan]{$rating}[/color] -machine-part-component-on-examine-type-text = [color=white]Type:[/color] [color=cyan]{$type}[/color] \ No newline at end of file +machine-part-component-on-examine-type-text = [color=white]Type:[/color] [color=cyan]{$type}[/color] diff --git a/Resources/Locale/en-US/machine/machine.ftl b/Resources/Locale/en-US/machine/machine.ftl index 458e7830596..26059505160 100644 --- a/Resources/Locale/en-US/machine/machine.ftl +++ b/Resources/Locale/en-US/machine/machine.ftl @@ -24,4 +24,4 @@ two-way-lever-cant = can't push the lever that way! recycler-count-items = Recycled {$items} objects. -machine-already-in-use = {CAPITALIZE(THE($machine))} is already in use. \ No newline at end of file +machine-already-in-use = {CAPITALIZE(THE($machine))} is already in use. diff --git a/Resources/Locale/en-US/nutrition/components/fat-extractor.ftl b/Resources/Locale/en-US/nutrition/components/fat-extractor.ftl index b2df0e079ec..611b8ef5406 100644 --- a/Resources/Locale/en-US/nutrition/components/fat-extractor.ftl +++ b/Resources/Locale/en-US/nutrition/components/fat-extractor.ftl @@ -5,4 +5,4 @@ fat-extractor-fact-2 = Adults should get a recommended 20-35% of their energy in fat-extractor-fact-3 = Being overweight or obese puts you at an increased risk of chronic diseases, such as cardiovascular diseases, metabolic syndrome, type 2 diabetes, and some types of cancers. fat-extractor-fact-4 = Not all fats are bad. A certain amount of fat is an essential part of a healthy balanced diet. fat-extractor-fact-5 = Saturated fat should form no more than 11% of your daily calories. -fat-extractor-fact-6 = Unsaturated fat, that is monounsaturated fats, polyunsaturated fats, and omega-3 fatty acids, is found in plants and fish. \ No newline at end of file +fat-extractor-fact-6 = Unsaturated fat, that is monounsaturated fats, polyunsaturated fats, and omega-3 fatty acids, is found in plants and fish. diff --git a/Resources/Locale/en-US/singularity/components/emitter-component.ftl b/Resources/Locale/en-US/singularity/components/emitter-component.ftl index 7c1b33d96b4..c7db1a93bba 100644 --- a/Resources/Locale/en-US/singularity/components/emitter-component.ftl +++ b/Resources/Locale/en-US/singularity/components/emitter-component.ftl @@ -15,4 +15,4 @@ comp-emitter-not-anchored = The {$target} isn't anchored to the ground! emitter-component-upgrade-fire-rate = fire rate emitter-component-current-type = The current selected type is: {$type}. -emitter-component-type-set = Type set to: {$type} \ No newline at end of file +emitter-component-type-set = Type set to: {$type} diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/salvage.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/salvage.yml index 8d81f56feaa..4beffbc9c22 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/Random/salvage.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/salvage.yml @@ -304,4 +304,4 @@ prototypes: - CrateSalvageAssortedGoodies chance: 0.9 - offset: 0.2 \ No newline at end of file + offset: 0.2