mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 05:35:45 +01:00
Wrap Singularity API with wrapper
also refactored the RamCosts IMap as it didnt quite work properly due to how the wrapper calculates function names
This commit is contained in:
parent
2d74b493ee
commit
b2689eaa5a
@ -4,6 +4,7 @@ import type { BaseServer } from "../Server/BaseServer";
|
|||||||
import type { WorkerScript } from "./WorkerScript";
|
import type { WorkerScript } from "./WorkerScript";
|
||||||
import { makeRuntimeRejectMsg } from "../NetscriptEvaluator";
|
import { makeRuntimeRejectMsg } from "../NetscriptEvaluator";
|
||||||
import { Player } from "../Player";
|
import { Player } from "../Player";
|
||||||
|
import { CityName } from "src/Locations/data/CityNames";
|
||||||
|
|
||||||
type ExternalFunction = (...args: any[]) => any;
|
type ExternalFunction = (...args: any[]) => any;
|
||||||
type ExternalAPI = {
|
type ExternalAPI = {
|
||||||
@ -37,6 +38,7 @@ type NetscriptHelpers = {
|
|||||||
makeRuntimeErrorMsg: (caller: string, msg: string) => string;
|
makeRuntimeErrorMsg: (caller: string, msg: string) => string;
|
||||||
string: (funcName: string, argName: string, v: unknown) => string;
|
string: (funcName: string, argName: string, v: unknown) => string;
|
||||||
number: (funcName: string, argName: string, v: unknown) => number;
|
number: (funcName: string, argName: string, v: unknown) => number;
|
||||||
|
city: (funcName: string, argName: string, v: unknown) => CityName;
|
||||||
boolean: (v: unknown) => boolean;
|
boolean: (v: unknown) => boolean;
|
||||||
getServer: (hostname: string, callingFnName: string) => BaseServer;
|
getServer: (hostname: string, callingFnName: string) => BaseServer;
|
||||||
checkSingularityAccess: (func: string) => void;
|
checkSingularityAccess: (func: string) => void;
|
||||||
@ -48,6 +50,7 @@ type WrappedNetscriptHelpers = {
|
|||||||
makeRuntimeErrorMsg: (msg: string) => string;
|
makeRuntimeErrorMsg: (msg: string) => string;
|
||||||
string: (argName: string, v: unknown) => string;
|
string: (argName: string, v: unknown) => string;
|
||||||
number: (argName: string, v: unknown) => number;
|
number: (argName: string, v: unknown) => number;
|
||||||
|
city: (argName: string, v: unknown) => CityName;
|
||||||
boolean: (v: unknown) => boolean;
|
boolean: (v: unknown) => boolean;
|
||||||
getServer: (hostname: string) => BaseServer;
|
getServer: (hostname: string) => BaseServer;
|
||||||
checkSingularityAccess: () => void;
|
checkSingularityAccess: () => void;
|
||||||
@ -80,6 +83,7 @@ function wrapFunction(
|
|||||||
makeRuntimeErrorMsg: (msg: string) => helpers.makeRuntimeErrorMsg(functionPath, msg),
|
makeRuntimeErrorMsg: (msg: string) => helpers.makeRuntimeErrorMsg(functionPath, msg),
|
||||||
string: (argName: string, v: unknown) => helpers.string(functionPath, argName, v),
|
string: (argName: string, v: unknown) => helpers.string(functionPath, argName, v),
|
||||||
number: (argName: string, v: unknown) => helpers.number(functionPath, argName, v),
|
number: (argName: string, v: unknown) => helpers.number(functionPath, argName, v),
|
||||||
|
city: (argName: string, v: unknown) => helpers.city(functionPath, argName, v),
|
||||||
boolean: helpers.boolean,
|
boolean: helpers.boolean,
|
||||||
getServer: (hostname: string) => helpers.getServer(hostname, functionPath),
|
getServer: (hostname: string) => helpers.getServer(hostname, functionPath),
|
||||||
checkSingularityAccess: () => helpers.checkSingularityAccess(functionName),
|
checkSingularityAccess: () => helpers.checkSingularityAccess(functionName),
|
||||||
|
@ -81,24 +81,239 @@ function SF4Cost(cost: number): (player: IPlayer) => number {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hacknet API
|
||||||
|
const hacknet: IMap<any> = {
|
||||||
|
numNodes: 0,
|
||||||
|
purchaseNode: 0,
|
||||||
|
getPurchaseNodeCost: 0,
|
||||||
|
getNodeStats: 0,
|
||||||
|
upgradeLevel: 0,
|
||||||
|
upgradeRam: 0,
|
||||||
|
upgradeCore: 0,
|
||||||
|
upgradeCache: 0,
|
||||||
|
getLevelUpgradeCost: 0,
|
||||||
|
getRamUpgradeCost: 0,
|
||||||
|
getCoreUpgradeCost: 0,
|
||||||
|
getCacheUpgradeCost: 0,
|
||||||
|
numHashes: 0,
|
||||||
|
hashCost: 0,
|
||||||
|
spendHashes: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Stock API
|
||||||
|
const stock: IMap<any> = {
|
||||||
|
getSymbols: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
getPrice: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
getAskPrice: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
getBidPrice: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
getPosition: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
getMaxShares: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
getSaleGain: RamCostConstants.ScriptGetStockRamCost,
|
||||||
|
buy: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
sell: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
short: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
sellShort: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
placeOrder: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
cancelOrder: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
getOrders: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
getVolatility: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
getForecast: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
purchaseWseAccount: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
purchaseTixApi: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Singularity API
|
||||||
|
const singularity: IMap<any> = {
|
||||||
|
universityCourse: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
gymWorkout: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
travelToCity: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
goToLocation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
purchaseTor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
purchaseProgram: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
getCurrentServer: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
connect: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
manualHack: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
installBackdoor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
||||||
|
getDarkwebProgramCost: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
||||||
|
getDarkwebPrograms: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
||||||
|
getStats: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
||||||
|
getCharacterInformation: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
||||||
|
hospitalize: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
||||||
|
isBusy: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
||||||
|
stopAction: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 2),
|
||||||
|
upgradeHomeRam: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
||||||
|
upgradeHomeCores: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
||||||
|
getUpgradeHomeRamCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),
|
||||||
|
getUpgradeHomeCoresCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),
|
||||||
|
workForCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
||||||
|
applyToCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
||||||
|
getCompanyRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
||||||
|
getCompanyFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
||||||
|
getCompanyFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),
|
||||||
|
checkFactionInvitations: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
||||||
|
joinFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
||||||
|
workForFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
||||||
|
getFactionRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
||||||
|
getFactionFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
||||||
|
getFactionFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),
|
||||||
|
donateToFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
createProgram: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
commitCrime: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
getCrimeChance: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
getCrimeStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
getOwnedAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
getAugmentationsFromFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
getAugmentationPrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),
|
||||||
|
getAugmentationRepReq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),
|
||||||
|
getAugmentationStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
purchaseAugmentation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
softReset: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
installAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
||||||
|
isFocused: SF4Cost(0.1),
|
||||||
|
setFocus: SF4Cost(0.1),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Gang API
|
||||||
|
const gang: IMap<any> = {
|
||||||
|
createGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||||
|
inGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||||
|
getMemberNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||||
|
getGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
getOtherGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
getMemberInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
canRecruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||||
|
recruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
getTaskNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||||
|
getTaskStats: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||||
|
setMemberTask: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
getEquipmentNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||||
|
getEquipmentCost: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
getEquipmentType: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
getEquipmentStats: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
purchaseEquipment: RamCostConstants.ScriptGangApiBaseRamCost,
|
||||||
|
ascendMember: RamCostConstants.ScriptGangApiBaseRamCost,
|
||||||
|
getAscensionResult: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
setTerritoryWarfare: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||||
|
getChanceToWinClash: RamCostConstants.ScriptGangApiBaseRamCost,
|
||||||
|
getBonusTime: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Bladeburner API
|
||||||
|
const bladeburner: IMap<any> = {
|
||||||
|
getContractNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
||||||
|
getOperationNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
||||||
|
getBlackOpNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
||||||
|
getBlackOpRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,
|
||||||
|
getGeneralActionNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
||||||
|
getSkillNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
||||||
|
startAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
stopBladeburnerAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,
|
||||||
|
getCurrentAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4,
|
||||||
|
getActionTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getActionEstimatedSuccessChance: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getActionRepGain: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getActionCountRemaining: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getActionMaxLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getActionCurrentLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
setActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
setActionLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getSkillPoints: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getSkillLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getSkillUpgradeCost: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
upgradeSkill: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
setTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getCityEstimatedPopulation: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getCityCommunities: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getCityChaos: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
switchCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getStamina: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
joinBladeburnerFaction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
joinBladeburnerDivision: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
||||||
|
getBonusTime: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Coding Contract API
|
||||||
|
const codingcontract: IMap<any> = {
|
||||||
|
attempt: RamCostConstants.ScriptCodingContractBaseRamCost,
|
||||||
|
getContractType: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
|
||||||
|
getData: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
|
||||||
|
getDescription: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
|
||||||
|
getNumTriesRemaining: RamCostConstants.ScriptCodingContractBaseRamCost / 5,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Duplicate Sleeve API
|
||||||
|
const sleeve: IMap<any> = {
|
||||||
|
getNumSleeves: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
setToShockRecovery: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
setToSynchronize: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
setToCommitCrime: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
setToUniversityCourse: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
travel: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
setToCompanyWork: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
setToFactionWork: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
setToGymWorkout: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
getSleeveStats: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
getTask: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
getInformation: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
getSleeveAugmentations: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
getSleevePurchasableAugs: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
purchaseSleeveAug: RamCostConstants.ScriptSleeveBaseRamCost,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Stanek API
|
||||||
|
const stanek: IMap<any> = {
|
||||||
|
giftWidth: RamCostConstants.ScriptStanekWidth,
|
||||||
|
giftHeight: RamCostConstants.ScriptStanekHeight,
|
||||||
|
chargeFragment: RamCostConstants.ScriptStanekCharge,
|
||||||
|
fragmentDefinitions: RamCostConstants.ScriptStanekFragmentDefinitions,
|
||||||
|
activeFragments: RamCostConstants.ScriptStanekPlacedFragments,
|
||||||
|
clearGift: RamCostConstants.ScriptStanekClear,
|
||||||
|
canPlaceFragment: RamCostConstants.ScriptStanekCanPlace,
|
||||||
|
placeFragment: RamCostConstants.ScriptStanekPlace,
|
||||||
|
getFragment: RamCostConstants.ScriptStanekFragmentAt,
|
||||||
|
removeFragment: RamCostConstants.ScriptStanekDeleteAt,
|
||||||
|
};
|
||||||
|
|
||||||
|
// UI API
|
||||||
|
const ui: IMap<any> = {
|
||||||
|
getTheme: 0,
|
||||||
|
setTheme: 0,
|
||||||
|
resetTheme: 0,
|
||||||
|
getStyles: 0,
|
||||||
|
setStyles: 0,
|
||||||
|
resetStyles: 0,
|
||||||
|
getGameInfo: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Grafting API
|
||||||
|
const grafting: IMap<any> = {
|
||||||
|
getAugmentationGraftPrice: 3.75,
|
||||||
|
getAugmentationGraftTime: 3.75,
|
||||||
|
graftAugmentation: 7.5,
|
||||||
|
};
|
||||||
|
|
||||||
export const RamCosts: IMap<any> = {
|
export const RamCosts: IMap<any> = {
|
||||||
hacknet: {
|
hacknet,
|
||||||
numNodes: 0,
|
stock,
|
||||||
purchaseNode: 0,
|
singularity,
|
||||||
getPurchaseNodeCost: 0,
|
...singularity, // singularity is in namespace & toplevel
|
||||||
getNodeStats: 0,
|
gang,
|
||||||
upgradeLevel: 0,
|
bladeburner,
|
||||||
upgradeRam: 0,
|
codingcontract,
|
||||||
upgradeCore: 0,
|
sleeve,
|
||||||
upgradeCache: 0,
|
stanek,
|
||||||
getLevelUpgradeCost: 0,
|
ui,
|
||||||
getRamUpgradeCost: 0,
|
grafting,
|
||||||
getCoreUpgradeCost: 0,
|
|
||||||
getCacheUpgradeCost: 0,
|
|
||||||
numHashes: 0,
|
|
||||||
hashCost: 0,
|
|
||||||
spendHashes: 0,
|
|
||||||
},
|
|
||||||
sprintf: 0,
|
sprintf: 0,
|
||||||
vsprintf: 0,
|
vsprintf: 0,
|
||||||
scan: RamCostConstants.ScriptScanRamCost,
|
scan: RamCostConstants.ScriptScanRamCost,
|
||||||
@ -162,29 +377,6 @@ export const RamCosts: IMap<any> = {
|
|||||||
serverExists: RamCostConstants.ScriptGetServerRamCost,
|
serverExists: RamCostConstants.ScriptGetServerRamCost,
|
||||||
fileExists: RamCostConstants.ScriptFileExistsRamCost,
|
fileExists: RamCostConstants.ScriptFileExistsRamCost,
|
||||||
isRunning: RamCostConstants.ScriptIsRunningRamCost,
|
isRunning: RamCostConstants.ScriptIsRunningRamCost,
|
||||||
stock: {
|
|
||||||
getSymbols: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
getPrice: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
getAskPrice: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
getBidPrice: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
getPosition: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
getMaxShares: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
getSaleGain: RamCostConstants.ScriptGetStockRamCost,
|
|
||||||
buy: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
sell: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
short: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
sellShort: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
placeOrder: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
cancelOrder: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
getOrders: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
getVolatility: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
getForecast: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
purchaseWseAccount: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
purchaseTixApi: RamCostConstants.ScriptBuySellStockRamCost,
|
|
||||||
},
|
|
||||||
getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,
|
getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,
|
||||||
getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,
|
getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,
|
||||||
getPurchasedServerCost: RamCostConstants.ScriptGetPurchaseServerRamCost,
|
getPurchasedServerCost: RamCostConstants.ScriptGetPurchaseServerRamCost,
|
||||||
@ -221,178 +413,6 @@ export const RamCosts: IMap<any> = {
|
|||||||
getOwnedSourceFiles: RamCostConstants.ScriptGetOwnedSourceFiles,
|
getOwnedSourceFiles: RamCostConstants.ScriptGetOwnedSourceFiles,
|
||||||
tail: 0,
|
tail: 0,
|
||||||
toast: 0,
|
toast: 0,
|
||||||
|
|
||||||
// Singularity Functions
|
|
||||||
universityCourse: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
gymWorkout: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
travelToCity: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
goToLocation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
purchaseTor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
purchaseProgram: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
getCurrentServer: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
connect: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
manualHack: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
installBackdoor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),
|
|
||||||
getDarkwebProgramCost: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
|
||||||
getDarkwebPrograms: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
|
||||||
getStats: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
|
||||||
getCharacterInformation: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
|
||||||
hospitalize: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
|
||||||
isBusy: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),
|
|
||||||
stopAction: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 2),
|
|
||||||
upgradeHomeRam: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
|
||||||
upgradeHomeCores: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
|
||||||
getUpgradeHomeRamCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),
|
|
||||||
getUpgradeHomeCoresCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),
|
|
||||||
workForCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
|
||||||
applyToCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
|
||||||
getCompanyRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
|
||||||
getCompanyFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
|
||||||
getCompanyFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),
|
|
||||||
checkFactionInvitations: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
|
||||||
joinFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
|
||||||
workForFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),
|
|
||||||
getFactionRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
|
||||||
getFactionFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),
|
|
||||||
getFactionFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),
|
|
||||||
donateToFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
createProgram: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
commitCrime: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
getCrimeChance: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
getCrimeStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
getOwnedAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
getAugmentationsFromFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
getAugmentationPrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),
|
|
||||||
getAugmentationRepReq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),
|
|
||||||
getAugmentationStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
purchaseAugmentation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
softReset: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
installAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
|
|
||||||
isFocused: SF4Cost(0.1),
|
|
||||||
setFocus: SF4Cost(0.1),
|
|
||||||
|
|
||||||
// Gang API
|
|
||||||
gang: {
|
|
||||||
createGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
|
||||||
inGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
|
||||||
getMemberNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
|
||||||
getGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
getOtherGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
getMemberInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
canRecruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
|
||||||
recruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
getTaskNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
|
||||||
getTaskStats: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
|
||||||
setMemberTask: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
getEquipmentNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
|
||||||
getEquipmentCost: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
getEquipmentType: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
getEquipmentStats: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
purchaseEquipment: RamCostConstants.ScriptGangApiBaseRamCost,
|
|
||||||
ascendMember: RamCostConstants.ScriptGangApiBaseRamCost,
|
|
||||||
getAscensionResult: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
setTerritoryWarfare: RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
|
||||||
getChanceToWinClash: RamCostConstants.ScriptGangApiBaseRamCost,
|
|
||||||
getBonusTime: 0,
|
|
||||||
},
|
|
||||||
|
|
||||||
// Bladeburner API
|
|
||||||
bladeburner: {
|
|
||||||
getContractNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
|
||||||
getOperationNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
|
||||||
getBlackOpNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
|
||||||
getBlackOpRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,
|
|
||||||
getGeneralActionNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
|
||||||
getSkillNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,
|
|
||||||
startAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
stopBladeburnerAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,
|
|
||||||
getCurrentAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4,
|
|
||||||
getActionTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getActionEstimatedSuccessChance: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getActionRepGain: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getActionCountRemaining: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getActionMaxLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getActionCurrentLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
setActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
setActionLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getSkillPoints: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getSkillLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getSkillUpgradeCost: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
upgradeSkill: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
setTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getCityEstimatedPopulation: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getCityCommunities: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getCityChaos: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
switchCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getStamina: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
joinBladeburnerFaction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
joinBladeburnerDivision: RamCostConstants.ScriptBladeburnerApiBaseRamCost,
|
|
||||||
getBonusTime: 0,
|
|
||||||
},
|
|
||||||
|
|
||||||
// Coding Contract API
|
|
||||||
codingcontract: {
|
|
||||||
attempt: RamCostConstants.ScriptCodingContractBaseRamCost,
|
|
||||||
getContractType: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
|
|
||||||
getData: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
|
|
||||||
getDescription: RamCostConstants.ScriptCodingContractBaseRamCost / 2,
|
|
||||||
getNumTriesRemaining: RamCostConstants.ScriptCodingContractBaseRamCost / 5,
|
|
||||||
},
|
|
||||||
|
|
||||||
// Duplicate Sleeve API
|
|
||||||
sleeve: {
|
|
||||||
getNumSleeves: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
setToShockRecovery: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
setToSynchronize: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
setToCommitCrime: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
setToUniversityCourse: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
travel: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
setToCompanyWork: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
setToFactionWork: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
setToGymWorkout: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
getSleeveStats: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
getTask: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
getInformation: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
getSleeveAugmentations: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
getSleevePurchasableAugs: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
purchaseSleeveAug: RamCostConstants.ScriptSleeveBaseRamCost,
|
|
||||||
},
|
|
||||||
|
|
||||||
stanek: {
|
|
||||||
giftWidth: RamCostConstants.ScriptStanekWidth,
|
|
||||||
giftHeight: RamCostConstants.ScriptStanekHeight,
|
|
||||||
chargeFragment: RamCostConstants.ScriptStanekCharge,
|
|
||||||
fragmentDefinitions: RamCostConstants.ScriptStanekFragmentDefinitions,
|
|
||||||
activeFragments: RamCostConstants.ScriptStanekPlacedFragments,
|
|
||||||
clearGift: RamCostConstants.ScriptStanekClear,
|
|
||||||
canPlaceFragment: RamCostConstants.ScriptStanekCanPlace,
|
|
||||||
placeFragment: RamCostConstants.ScriptStanekPlace,
|
|
||||||
getFragment: RamCostConstants.ScriptStanekFragmentAt,
|
|
||||||
removeFragment: RamCostConstants.ScriptStanekDeleteAt,
|
|
||||||
},
|
|
||||||
|
|
||||||
ui: {
|
|
||||||
getTheme: 0,
|
|
||||||
setTheme: 0,
|
|
||||||
resetTheme: 0,
|
|
||||||
getStyles: 0,
|
|
||||||
setStyles: 0,
|
|
||||||
resetStyles: 0,
|
|
||||||
getGameInfo: 0,
|
|
||||||
},
|
|
||||||
|
|
||||||
grafting: {
|
|
||||||
getAugmentationGraftPrice: 3.75,
|
|
||||||
getAugmentationGraftTime: 3.75,
|
|
||||||
graftAugmentation: 7.5,
|
|
||||||
},
|
|
||||||
|
|
||||||
heart: {
|
heart: {
|
||||||
// Easter egg function
|
// Easter egg function
|
||||||
break: 0,
|
break: 0,
|
||||||
|
@ -75,6 +75,7 @@ import { IPort } from "./NetscriptPort";
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
NS as INS,
|
NS as INS,
|
||||||
|
Singularity as ISingularity,
|
||||||
Player as INetscriptPlayer,
|
Player as INetscriptPlayer,
|
||||||
Gang as IGang,
|
Gang as IGang,
|
||||||
Bladeburner as IBladeburner,
|
Bladeburner as IBladeburner,
|
||||||
@ -498,7 +499,8 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
const codingcontract = NetscriptCodingContract(Player, workerScript, helper);
|
const codingcontract = NetscriptCodingContract(Player, workerScript, helper);
|
||||||
const corporation = NetscriptCorporation(Player, workerScript, helper);
|
const corporation = NetscriptCorporation(Player, workerScript, helper);
|
||||||
const formulas = NetscriptFormulas(Player, workerScript, helper);
|
const formulas = NetscriptFormulas(Player, workerScript, helper);
|
||||||
const singularity = NetscriptSingularity(Player, workerScript, helper);
|
const singularity = wrapAPI(helper, {}, workerScript, NetscriptSingularity(Player, workerScript), "singularity")
|
||||||
|
.singularity as unknown as ISingularity;
|
||||||
const stockmarket = NetscriptStockMarket(Player, workerScript, helper);
|
const stockmarket = NetscriptStockMarket(Player, workerScript, helper);
|
||||||
const ui = NetscriptUserInterface(Player, workerScript, helper);
|
const ui = NetscriptUserInterface(Player, workerScript, helper);
|
||||||
const grafting = NetscriptGrafting(Player, workerScript, helper);
|
const grafting = NetscriptGrafting(Player, workerScript, helper);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user