From 71fa6dd2fdaabea63eff8c4044a0d06befb8c5b9 Mon Sep 17 00:00:00 2001 From: Buck Mayzes Date: Sat, 15 Jan 2022 17:03:17 -0500 Subject: [PATCH] Fix `constants()` function typing for hacknet nodes/servers --- src/ScriptEditor/NetscriptDefinitions.d.ts | 72 +++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index b5630b1fd..0c566397b 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -351,6 +351,74 @@ export interface HacknetMultipliers { levelCost: number; } +/** + * Hacknet node related constants + * @public + */ +export interface HacknetNodeConstants { + /** Amount of money gained per level */ + MoneyGainPerLevel: number; + /** Base cost for a new node */ + BaseCost: number; + /** Base cost per level */ + LevelBaseCost: number; + /** Base cost to incrase RAM */ + RamBaseCost: number; + /** Base cost to increase cores */ + CoreBaseCost: number; + /** Multiplier to purchase new node */ + PurchaseNextMult: number; + /** Multiplier to increase node level */ + UpgradeLevelMult: number; + /** Multiplier to increase RAM */ + UpgradeRamMult: number; + /** Multiplier to increase cores */ + UpgradeCoreMult: number; + /** Max node level */ + MaxLevel: number; + /** Max amount of RAM in GB */ + MaxRam: number; + /** Max number of cores */ + MaxCores: number; +} + +/** + * Hacknet server related constants + * @public + */ +export interface HacknetServerConstants { + /** Number of hashes calculated per level */ + HashesPerLevel: number; + /** Base cost for a new server */ + BaseCost: number; + /** Base cost to increase RAM */ + RamBaseCost: number; + /** Base cost to increase cores */ + CoreBaseCost: number; + /** Base cost to upgrade cache */ + CacheBaseCost: number; + /** Multiplier to purchase a new server */ + PurchaseMult: number; + /** Multiplier to increase server level */ + UpgradeLevelMult: number; + /** Multiplier to increase RAM */ + UpgradeRamMult: number; + /** Multiplier to increase cores */ + UpgradeCoreMult: number; + /** Multiplier to upgrade cache */ + UpgradeCacheMult: number; + /** Max number of servers */ + MaxServers: number; + /** Max level for a server */ + MaxLevel: number; + /** Max amount of RAM in GB */ + MaxRam: number; + /** Max number of cores */ + MaxCores: number; + /** Max cache size */ + MaxCache: number; +} + /** * A single server. * @public @@ -3581,7 +3649,7 @@ interface HacknetNodesFormulas { * All constants used by the game. * @returns An object with all hacknet node constants used by the game. */ - constants(): number; + constants(): HacknetNodeConstants; } /** @@ -3648,7 +3716,7 @@ interface HacknetServersFormulas { * All constants used by the game. * @returns An object with all hacknet server constants used by the game. */ - constants(): any; + constants(): HacknetServerConstants; } /**