This commit is contained in:
Olivier Gagnon
2021-08-19 16:37:59 -04:00
parent ee3530d9b9
commit df457a0c6e
18 changed files with 194 additions and 105 deletions
+3 -2
View File
@@ -3,7 +3,7 @@ import { Server } from "../Server";
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
import { IPlayer } from "../../PersonObjects/IPlayer";
export function calculateServerGrowth(server: Server, threads: number, p: IPlayer): number {
export function calculateServerGrowth(server: Server, threads: number, p: IPlayer, cores: number = 1): number {
const numServerGrowthCycles = Math.max(Math.floor(threads), 0);
//Get adjusted growth rate, which accounts for server security
@@ -16,5 +16,6 @@ export function calculateServerGrowth(server: Server, threads: number, p: IPlaye
const numServerGrowthCyclesAdjusted = numServerGrowthCycles * serverGrowthPercentage * BitNodeMultipliers.ServerGrowthRate;
//Apply serverGrowth for the calculated number of growth cycles
return Math.pow(adjGrowthRate, numServerGrowthCyclesAdjusted * p.hacking_grow_mult);
const coreBonus = 1+(cores-1)/16;
return Math.pow(adjGrowthRate, numServerGrowthCyclesAdjusted * p.hacking_grow_mult * coreBonus);
}