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>;
}
const cost = 1e9 * Math.pow(7.5, homeComputer.cpuCores);
const cost = props.p.getUpgradeHomeCoresCost();
function buy(): void {
if (maxCores) return;

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

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

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