From 5486398199c9aeaab9c09a6f596325d7e15c7007 Mon Sep 17 00:00:00 2001 From: phyzical Date: Wed, 30 Mar 2022 21:58:27 +0800 Subject: [PATCH] fix prices of augments reseting when refreshing the game --- src/Augmentation/AugmentationHelpers.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index 7b64bf229..99e10eb12 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -22,6 +22,7 @@ import { initUnstableCircadianModulator, } from "./AugmentationCreator"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; +import { update } from "lodash"; export function AddToAugmentations(aug: Augmentation): void { const name = aug.name; @@ -103,6 +104,12 @@ function updateInfiltratorCosts(infiltratorAugmentation: Augmentation): void { } } +function updateGeneralAugmentationPrice(augmentation: Augmentation): void { + for (let i = 0; i < Player.queuedAugmentations.length; ++i) { + augmentation.baseCost = augmentation.startingCost * getGenericAugmentationPriceMultiplier(); + } +} + export function updateAugmentationCosts(): void { for (const name of Object.keys(Augmentations)) { if (Augmentations.hasOwnProperty(name)) { @@ -112,7 +119,7 @@ export function updateAugmentationCosts(): void { } else if (augmentationToUpdate.factions.includes(FactionNames.Infiltrators)) { updateInfiltratorCosts(augmentationToUpdate); } else { - augmentationToUpdate.baseCost *= getGenericAugmentationPriceMultiplier(); + updateGeneralAugmentationPrice(augmentationToUpdate); } } }