From 23445a917d821d61667f26fcb64684d0ed679109 Mon Sep 17 00:00:00 2001 From: Jesse Clark Date: Thu, 23 May 2024 01:55:06 -0700 Subject: [PATCH] Give the player starting money and programs as declared in augmentation definitions (#1304) --- src/Augmentation/Augmentation.ts | 9 +++++++++ src/Prestige.ts | 20 ++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/Augmentation/Augmentation.ts b/src/Augmentation/Augmentation.ts index fd238cc33..4f3c77c5b 100644 --- a/src/Augmentation/Augmentation.ts +++ b/src/Augmentation/Augmentation.ts @@ -195,6 +195,12 @@ export class Augmentation { // The Player/Person classes mults: Multipliers = defaultMultipliers(); + // Amount of money given to the Player when prestiging with this augmentation. + startingMoney: number; + + // Array of programs to be given to the player when prestiging with this augmentation. + programs: CompletedProgramName[]; + // Factions that offer this aug. factions: FactionName[] = []; @@ -219,6 +225,9 @@ export class Augmentation { if (mult) this.mults[multName] = mult; } + this.startingMoney = params.startingMoney ?? 0; + this.programs = params.programs ?? []; + if (params.stats === undefined) this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney); else this.stats = params.stats; diff --git a/src/Prestige.ts b/src/Prestige.ts index 96479e4a8..4aacc3c67 100644 --- a/src/Prestige.ts +++ b/src/Prestige.ts @@ -1,4 +1,5 @@ import { AugmentationName, CityName, CompletedProgramName, FactionName, LiteratureName, CompanyName } from "@enums"; +import { Augmentations } from "./Augmentation/Augmentations"; import { initBitNodeMultipliers } from "./BitNode/BitNode"; import { Companies } from "./Company/Companies"; import { resetIndustryResearchTrees } from "./Corporation/data/IndustryData"; @@ -60,19 +61,14 @@ export function prestigeAugmentation(): void { AddToAllServers(homeComp); prestigeHomeComputer(homeComp); - if (Player.hasAugmentation(AugmentationName.Neurolink, true)) { - homeComp.programs.push(CompletedProgramName.ftpCrack); - homeComp.programs.push(CompletedProgramName.relaySmtp); + // Receive starting money and programs from installed augmentations + for (const ownedAug of Player.augmentations) { + const aug = Augmentations[ownedAug.name]; + Player.gainMoney(aug.startingMoney, "other"); + for (const program of aug.programs) { + homeComp.programs.push(program); + } } - if (Player.hasAugmentation(AugmentationName.CashRoot, true)) { - Player.setMoney(1e6); - homeComp.programs.push(CompletedProgramName.bruteSsh); - } - if (Player.hasAugmentation(AugmentationName.PCMatrix, true)) { - homeComp.programs.push(CompletedProgramName.deepScan1); - homeComp.programs.push(CompletedProgramName.autoLink); - } - if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) { homeComp.programs.push(CompletedProgramName.formulas); }