mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 03:25:44 +02:00
TYPESAFETY: Strict internal typing for AugmentationName (#608)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import { AddToAllServers, createUniqueRandomIp, GetServer, renameServer } from "./AllServers";
|
||||
import { safelyCreateUniqueServer } from "./ServerHelpers";
|
||||
|
||||
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
|
||||
import { currentNodeMults } from "../BitNode/BitNodeMultipliers";
|
||||
import { CONSTANTS } from "../Constants";
|
||||
import { Player } from "@player";
|
||||
|
||||
@@ -34,8 +34,8 @@ export function getPurchaseServerCost(ram: number): number {
|
||||
return (
|
||||
sanitizedRam *
|
||||
CONSTANTS.BaseCostFor1GBOfRamServer *
|
||||
BitNodeMultipliers.PurchasedServerCost *
|
||||
Math.pow(BitNodeMultipliers.PurchasedServerSoftcap, upg)
|
||||
currentNodeMults.PurchasedServerCost *
|
||||
Math.pow(currentNodeMults.PurchasedServerSoftcap, upg)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -86,11 +86,11 @@ export const renamePurchasedServer = (hostname: string, newName: string): void =
|
||||
};
|
||||
|
||||
export function getPurchaseServerLimit(): number {
|
||||
return Math.round(CONSTANTS.PurchasedServerLimit * BitNodeMultipliers.PurchasedServerLimit);
|
||||
return Math.round(CONSTANTS.PurchasedServerLimit * currentNodeMults.PurchasedServerLimit);
|
||||
}
|
||||
|
||||
export function getPurchaseServerMaxRam(): number {
|
||||
const ram = Math.round(CONSTANTS.PurchasedServerMaxRam * BitNodeMultipliers.PurchasedServerMaxRam);
|
||||
const ram = Math.round(CONSTANTS.PurchasedServerMaxRam * currentNodeMults.PurchasedServerMaxRam);
|
||||
|
||||
// Round this to the nearest power of 2
|
||||
return 1 << (31 - Math.clz32(ram));
|
||||
|
||||
Reference in New Issue
Block a user