mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 06:32:26 +01:00
commit
e3bf2d4d42
@ -181,6 +181,8 @@ export const RamCosts: IMap<any> = {
|
|||||||
getForecast: RamCostConstants.ScriptBuySellStockRamCost,
|
getForecast: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,
|
purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,
|
purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
purchaseWseAccount: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
purchaseTixApi: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
},
|
},
|
||||||
getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,
|
getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,
|
||||||
getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,
|
getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,
|
||||||
|
@ -8,7 +8,7 @@ import { getBuyTransactionCost, getSellTransactionGain } from "../StockMarket/St
|
|||||||
import { OrderTypes } from "../StockMarket/data/OrderTypes";
|
import { OrderTypes } from "../StockMarket/data/OrderTypes";
|
||||||
import { PositionTypes } from "../StockMarket/data/PositionTypes";
|
import { PositionTypes } from "../StockMarket/data/PositionTypes";
|
||||||
import { StockSymbols } from "../StockMarket/data/StockSymbols";
|
import { StockSymbols } from "../StockMarket/data/StockSymbols";
|
||||||
import { getStockMarket4SDataCost, getStockMarket4STixApiCost } from "../StockMarket/StockMarketCosts";
|
import { getStockMarket4SDataCost, getStockMarket4STixApiCost, getStockMarketWseCost, getStockMarketTixApiCost } from "../StockMarket/StockMarketCosts";
|
||||||
import { Stock } from "../StockMarket/Stock";
|
import { Stock } from "../StockMarket/Stock";
|
||||||
import { TIX } from "../ScriptEditor/NetscriptDefinitions";
|
import { TIX } from "../ScriptEditor/NetscriptDefinitions";
|
||||||
|
|
||||||
@ -388,5 +388,47 @@ export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript
|
|||||||
workerScript.log("stock.purchase4SMarketDataTixApi", () => "Purchased 4S Market Data TIX API");
|
workerScript.log("stock.purchase4SMarketDataTixApi", () => "Purchased 4S Market Data TIX API");
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
purchaseWseAccount: function (): boolean {
|
||||||
|
helper.updateDynamicRam("PurchaseWseAccount", getRamCost(player, "stock", "purchaseWseAccount"));
|
||||||
|
|
||||||
|
if (player.hasWseAccount) {
|
||||||
|
workerScript.log("stock.purchaseWseAccount", () => "Already purchased WSE Account");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.money < getStockMarketWseCost()) {
|
||||||
|
workerScript.log(
|
||||||
|
"stock.purchaseWseAccount",
|
||||||
|
() => "Not enough money to purchase WSE Account Access",
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
player.hasWseAccount = true;
|
||||||
|
player.loseMoney(getStockMarketWseCost(), "stock");
|
||||||
|
workerScript.log("stock.purchaseWseAccount", () => "Purchased WSE Account Access");
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
purchaseTixApi: function (): boolean {
|
||||||
|
helper.updateDynamicRam("purchaseTixApi", getRamCost(player, "stock", "purchaseTixApi"));
|
||||||
|
|
||||||
|
if (player.hasTixApiAccess) {
|
||||||
|
workerScript.log("stock.purchaseTixApi", () => "Already purchased TIX API");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.money < getStockMarketTixApiCost()) {
|
||||||
|
workerScript.log(
|
||||||
|
"stock.purchaseTixApi",
|
||||||
|
() => "Not enough money to purchase TIX API Access",
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
player.hasTixApiAccess = true;
|
||||||
|
player.loseMoney(getStockMarketTixApiCost(), "stock");
|
||||||
|
workerScript.log("stock.purchaseTixApi", () => "Purchased TIX API");
|
||||||
|
return true;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
14
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
14
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -1506,6 +1506,20 @@ export interface TIX {
|
|||||||
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
||||||
*/
|
*/
|
||||||
purchase4SMarketDataTixApi(): boolean;
|
purchase4SMarketDataTixApi(): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Purchase WSE Account.
|
||||||
|
* @remarks RAM cost: 2.5 GB
|
||||||
|
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
||||||
|
*/
|
||||||
|
purchaseWseAccount(): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Purchase TIX API Access
|
||||||
|
* @remarks RAM cost: 2.5 GB
|
||||||
|
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
||||||
|
*/
|
||||||
|
purchaseTixApi(): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,3 +8,11 @@ export function getStockMarket4SDataCost(): number {
|
|||||||
export function getStockMarket4STixApiCost(): number {
|
export function getStockMarket4STixApiCost(): number {
|
||||||
return CONSTANTS.MarketDataTixApi4SCost * BitNodeMultipliers.FourSigmaMarketDataApiCost;
|
return CONSTANTS.MarketDataTixApi4SCost * BitNodeMultipliers.FourSigmaMarketDataApiCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getStockMarketWseCost(): number {
|
||||||
|
return CONSTANTS.WSEAccountCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getStockMarketTixApiCost(): number {
|
||||||
|
return CONSTANTS.TIXAPICost;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user