another multipler based on purchases

This commit is contained in:
phyzical 2022-03-21 23:17:52 +08:00
parent 7d647c0b1b
commit dc9c05b345

@ -19,6 +19,7 @@ import { SourceFileFlags } from "../SourceFile/SourceFileFlags";
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { dialogBoxCreate } from "../ui/React/DialogBox";
import { InvitationEvent } from "./ui/InvitationModal"; import { InvitationEvent } from "./ui/InvitationModal";
import { FactionNames } from "./data/FactionNames"; import { FactionNames } from "./data/FactionNames";
import { infiltratorsAugmentations } from "../Augmentation/AugmentationHelpers";
export function inviteToFaction(faction: Faction): void { export function inviteToFaction(faction: Faction): void {
Player.receiveInvite(faction.name); Player.receiveInvite(faction.name);
@ -123,27 +124,14 @@ export function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = fal
} }
} }
//todo make this exportable also bladburner and the other one
const infiltrationAugs = [
AugmentationNames.BagOfSand,
AugmentationNames.IntellisenseModule,
AugmentationNames.ReverseDictionary,
AugmentationNames.AmuletOfPersuasian,
AugmentationNames.GameSharkRepository,
AugmentationNames.CyberDecoder,
AugmentationNames.MineDetector,
AugmentationNames.WireCuttingManual
]
// If you just purchased an infiltrator aug, recalculate cost // If you just purchased an infiltrator aug, recalculate cost
if (infiltrationAugs.includes(aug.name)) { if (infiltratorsAugmentations.map(augmentation => augmentation.name).includes(aug.name)) {
const unpurchasedInfiltrationAugs = infiltrationAugs.filter(augName => Player.hasAugmentation(augName, false)) const unpurchasedInfiltrationAugs = infiltratorsAugmentations.filter(augmentation => Player.hasAugmentation(augmentation.name, false))
const purchasedInfiltrationAugsCount = infiltrationAugs.length - unpurchasedInfiltrationAugs.length const purchasedInfiltrationAugsCount = infiltratorsAugmentations.length - unpurchasedInfiltrationAugs.length
unpurchasedInfiltrationAugs unpurchasedInfiltrationAugs
.map(augName => { .map(augmentation => {
const aug = getAug(augName) augmentation.baseRepRequirement = augmentation.startingCost * purchasedInfiltrationAugsCount
aug.baseRepRequirement = augTrueBaseRepCost * purchasedInfiltrationAugsCount augmentation.baseCost = augmentation.startingRepRequirement ^ purchasedInfiltrationAugsCount
aug.baseCost = augTrueBaseCost ^ purchasedInfiltrationAugsCount
}) })
} }