change location of home cores cost formula

This commit is contained in:
Olivier Gagnon 2021-10-13 15:48:34 -04:00
parent e2c8fed307
commit b7823f46e4
4 changed files with 8 additions and 1 deletions

@ -19,7 +19,7 @@ export function CoresButton(props: IProps): React.ReactElement {
return <Button>Upgrade 'home' cores - MAX</Button>; return <Button>Upgrade 'home' cores - MAX</Button>;
} }
const cost = 1e9 * Math.pow(7.5, homeComputer.cpuCores); const cost = props.p.getUpgradeHomeCoresCost();
function buy(): void { function buy(): void {
if (maxCores) return; if (maxCores) return;

@ -191,6 +191,7 @@ export interface IPlayer {
getHomeComputer(): Server; getHomeComputer(): Server;
getNextCompanyPosition(company: Company, entryPosType: CompanyPosition): CompanyPosition | null; getNextCompanyPosition(company: Company, entryPosType: CompanyPosition): CompanyPosition | null;
getUpgradeHomeRamCost(): number; getUpgradeHomeRamCost(): number;
getUpgradeHomeCoresCost(): number;
gotoLocation(to: LocationName): boolean; gotoLocation(to: LocationName): boolean;
hasAugmentation(aug: string | Augmentation): boolean; hasAugmentation(aug: string | Augmentation): boolean;
hasCorporation(): boolean; hasCorporation(): boolean;

@ -198,6 +198,7 @@ export class PlayerObject implements IPlayer {
getHomeComputer: () => Server; getHomeComputer: () => Server;
getNextCompanyPosition: (company: Company, entryPosType: CompanyPosition) => CompanyPosition | null; getNextCompanyPosition: (company: Company, entryPosType: CompanyPosition) => CompanyPosition | null;
getUpgradeHomeRamCost: () => number; getUpgradeHomeRamCost: () => number;
getUpgradeHomeCoresCost: () => number;
gotoLocation: (to: LocationName) => boolean; gotoLocation: (to: LocationName) => boolean;
hasAugmentation: (aug: string | Augmentation) => boolean; hasAugmentation: (aug: string | Augmentation) => boolean;
hasCorporation: () => boolean; hasCorporation: () => boolean;
@ -567,6 +568,7 @@ export class PlayerObject implements IPlayer {
this.getCurrentServer = serverMethods.getCurrentServer; this.getCurrentServer = serverMethods.getCurrentServer;
this.getHomeComputer = serverMethods.getHomeComputer; this.getHomeComputer = serverMethods.getHomeComputer;
this.getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost; this.getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost;
this.getUpgradeHomeCoresCost = serverMethods.getUpgradeHomeCoresCost;
this.createHacknetServer = serverMethods.createHacknetServer; this.createHacknetServer = serverMethods.createHacknetServer;
this.factionWorkType = ""; this.factionWorkType = "";
this.committingCrimeThruSingFn = false; this.committingCrimeThruSingFn = false;

@ -40,6 +40,10 @@ export function getUpgradeHomeRamCost(this: IPlayer): number {
return cost; return cost;
} }
export function getUpgradeHomeCoresCost(this: IPlayer): number {
return 1e9 * Math.pow(7.5, this.getHomeComputer().cpuCores);
}
export function createHacknetServer(this: IPlayer): HacknetServer { export function createHacknetServer(this: IPlayer): HacknetServer {
const numOwned = this.hacknetNodes.length; const numOwned = this.hacknetNodes.length;
const name = `hacknet-node-${numOwned}`; const name = `hacknet-node-${numOwned}`;