Give the player starting money and programs as declared in augmentation definitions (#1304)

This commit is contained in:
Jesse Clark 2024-05-23 01:55:06 -07:00 committed by GitHub
parent 8703da4ab6
commit 23445a917d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 12 deletions

@ -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;

@ -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);
}