mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-11 02:03:58 +01:00
fix prices of augments reseting when refreshing the game
This commit is contained in:
parent
6f5d22c1bd
commit
5486398199
@ -22,6 +22,7 @@ import {
|
|||||||
initUnstableCircadianModulator,
|
initUnstableCircadianModulator,
|
||||||
} from "./AugmentationCreator";
|
} from "./AugmentationCreator";
|
||||||
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
|
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
|
||||||
|
import { update } from "lodash";
|
||||||
|
|
||||||
export function AddToAugmentations(aug: Augmentation): void {
|
export function AddToAugmentations(aug: Augmentation): void {
|
||||||
const name = aug.name;
|
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 {
|
export function updateAugmentationCosts(): void {
|
||||||
for (const name of Object.keys(Augmentations)) {
|
for (const name of Object.keys(Augmentations)) {
|
||||||
if (Augmentations.hasOwnProperty(name)) {
|
if (Augmentations.hasOwnProperty(name)) {
|
||||||
@ -112,7 +119,7 @@ export function updateAugmentationCosts(): void {
|
|||||||
} else if (augmentationToUpdate.factions.includes(FactionNames.Infiltrators)) {
|
} else if (augmentationToUpdate.factions.includes(FactionNames.Infiltrators)) {
|
||||||
updateInfiltratorCosts(augmentationToUpdate);
|
updateInfiltratorCosts(augmentationToUpdate);
|
||||||
} else {
|
} else {
|
||||||
augmentationToUpdate.baseCost *= getGenericAugmentationPriceMultiplier();
|
updateGeneralAugmentationPrice(augmentationToUpdate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user