From ec927fe1f49820c31df2db50449dfe18867f3efc Mon Sep 17 00:00:00 2001 From: phyzical Date: Tue, 8 Mar 2022 17:28:45 +0800 Subject: [PATCH] added ram charge for stanek width and height --- src/Netscript/RamCostGenerator.ts | 4 ++++ src/NetscriptFunctions/Stanek.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Netscript/RamCostGenerator.ts b/src/Netscript/RamCostGenerator.ts index 8aae3ee2c..3c71c04af 100644 --- a/src/Netscript/RamCostGenerator.ts +++ b/src/Netscript/RamCostGenerator.ts @@ -59,6 +59,8 @@ export const RamCostConstants: IMap = { ScriptBladeburnerApiBaseRamCost: 4, + ScriptStanekWidth: 0.4, + ScriptStanekHeight: 0.4, ScriptStanekCharge: 0.4, ScriptStanekFragmentDefinitions: 0, ScriptStanekPlacedFragments: 5, @@ -354,6 +356,8 @@ export const RamCosts: IMap = { }, stanek: { + width: RamCostConstants.ScriptStanekWidth, + height: RamCostConstants.ScriptStanekHeight, charge: RamCostConstants.ScriptStanekCharge, fragmentDefinitions: RamCostConstants.ScriptStanekFragmentDefinitions, activeFragments: RamCostConstants.ScriptStanekPlacedFragments, diff --git a/src/NetscriptFunctions/Stanek.ts b/src/NetscriptFunctions/Stanek.ts index a7b10ba90..623426f3c 100644 --- a/src/NetscriptFunctions/Stanek.ts +++ b/src/NetscriptFunctions/Stanek.ts @@ -23,9 +23,13 @@ export function NetscriptStanek(player: IPlayer, workerScript: WorkerScript, hel return { width: function (): number { + helper.updateDynamicRam("width", getRamCost(player, "stanek", "width")); + checkStanekAPIAccess("width"); return staneksGift.width(); }, height: function (): number { + helper.updateDynamicRam("height", getRamCost(player, "stanek", "height")); + checkStanekAPIAccess("height"); return staneksGift.height(); }, charge: function (arootX: unknown, arootY: unknown): Promise {