diff --git a/doc/source/advancedgameplay/sourcefiles.rst b/doc/source/advancedgameplay/sourcefiles.rst
index b33bca7fa..ca60ee1a6 100644
--- a/doc/source/advancedgameplay/sourcefiles.rst
+++ b/doc/source/advancedgameplay/sourcefiles.rst
@@ -47,7 +47,7 @@ List of all Source-Files
+------------------------------------+-------------------------------------------------------------------------------------+
| BitNode-9: Coming Soon | |
+------------------------------------+-------------------------------------------------------------------------------------+
-| BitNode-10: Digital Carbon | * Each level of this grants a Duplicate Sleeve |
+| BitNode-10: Digital Carbon | * Each level of this grants a Duplicate Sleeve. |
| | * Allows the player to access the :ref:`netscript_sleeveapi` in other BitNodes |
+------------------------------------+-------------------------------------------------------------------------------------+
| BitNode-11: The Big Crash | * Company favor increases both the player's salary and reputation gain at that |
diff --git a/doc/source/guidesandtips/recommendedbitnodeorder.rst b/doc/source/guidesandtips/recommendedbitnodeorder.rst
index 4f19f4758..550ac9705 100644
--- a/doc/source/guidesandtips/recommendedbitnodeorder.rst
+++ b/doc/source/guidesandtips/recommendedbitnodeorder.rst
@@ -323,7 +323,7 @@ Source-File
:Max Level: 3
This Source-File unlocks Sleeve technology in other BitNodes.
- Each level of this Source-File also grants you a Duplicate Sleeve
+ Each level of this Source-File also grants you a Duplicate Sleeve.
Difficulty
Hard
diff --git a/doc/source/netscript/advancedfunctions/getServer.rst b/doc/source/netscript/advancedfunctions/getServer.rst
index 9e7c95056..5a592e907 100644
--- a/doc/source/netscript/advancedfunctions/getServer.rst
+++ b/doc/source/netscript/advancedfunctions/getServer.rst
@@ -1,9 +1,10 @@
getServer() Netscript Function
==========================================
-.. js:function:: getServer()
+.. js:function:: getServer([hostname])
:RAM cost: 4 GB
+ :param string hostname: Hostname of the server, defaults to host server.
If you are not in BitNode-5, then you must have Source-File 5-1 in order to run this function.
diff --git a/doc/source/netscript/codingcontractapi/getData.rst b/doc/source/netscript/codingcontractapi/getData.rst
index b330f56cd..6476734e1 100644
--- a/doc/source/netscript/codingcontractapi/getData.rst
+++ b/doc/source/netscript/codingcontractapi/getData.rst
@@ -3,6 +3,7 @@ getData() Netscript Function
.. js:function:: getData(filename[, hostname=current hostname])
+ :RAM cost: 5 GB
:param string filename: Filename of the contract
:param string hostname: Hostname of the server containing the contract.
Optional. Defaults to current server if not provided
diff --git a/doc/source/netscript/formulasapi/basic/growPercent.rst b/doc/source/netscript/formulasapi/basic/growPercent.rst
index 3f63e3947..b29fd6b82 100644
--- a/doc/source/netscript/formulasapi/basic/growPercent.rst
+++ b/doc/source/netscript/formulasapi/basic/growPercent.rst
@@ -20,4 +20,4 @@ growPercent() Netscript Function
.. code-block:: javascript
- tprint(growPercent(getServer(), 50, getPlayer()))
\ No newline at end of file
+ tprint(formulas.basic.growPercent(getServer(), 50, getPlayer()))
\ No newline at end of file
diff --git a/doc/source/netscript/formulasapi/basic/growTime.rst b/doc/source/netscript/formulasapi/basic/growTime.rst
index 43a6f65cd..84673887d 100644
--- a/doc/source/netscript/formulasapi/basic/growTime.rst
+++ b/doc/source/netscript/formulasapi/basic/growTime.rst
@@ -21,4 +21,4 @@ growTime() Netscript Function
server = getServer();
server.hackDifficulty = server.minDifficulty;
- tprint(growTime(server, getPlayer()));
\ No newline at end of file
+ tprint(formulas.basic.growTime(server, getPlayer()));
\ No newline at end of file
diff --git a/doc/source/netscript/formulasapi/basic/hackChance.rst b/doc/source/netscript/formulasapi/basic/hackChance.rst
index a0108cac5..81194deb3 100644
--- a/doc/source/netscript/formulasapi/basic/hackChance.rst
+++ b/doc/source/netscript/formulasapi/basic/hackChance.rst
@@ -21,4 +21,4 @@ hackChance() Netscript Function
server = getServer();
server.hackDifficulty = server.minDifficulty;
- tprint(hackChance(server, getPlayer()));
\ No newline at end of file
+ tprint(formulas.basic.hackChance(server, getPlayer()));
\ No newline at end of file
diff --git a/doc/source/netscript/formulasapi/basic/hackExp.rst b/doc/source/netscript/formulasapi/basic/hackExp.rst
index 3ff92669b..1654327dc 100644
--- a/doc/source/netscript/formulasapi/basic/hackExp.rst
+++ b/doc/source/netscript/formulasapi/basic/hackExp.rst
@@ -21,4 +21,4 @@ hackExp() Netscript Function
server = getServer();
server.hackDifficulty = 99.9;
- tprint(hackExp(server, getPlayer()));
\ No newline at end of file
+ tprint(formulas.basic.hackExp(server, getPlayer()));
\ No newline at end of file
diff --git a/doc/source/netscript/formulasapi/basic/hackPercent.rst b/doc/source/netscript/formulasapi/basic/hackPercent.rst
index 5c826d3fa..7b85663cd 100644
--- a/doc/source/netscript/formulasapi/basic/hackPercent.rst
+++ b/doc/source/netscript/formulasapi/basic/hackPercent.rst
@@ -22,4 +22,4 @@ hackPercent() Netscript Function
server = getServer();
server.hackDifficulty = server.minDifficulty;
- tprint(hackPercent(server, getPlayer()));
\ No newline at end of file
+ tprint(formulas.basic.hackPercent(server, getPlayer()));
\ No newline at end of file
diff --git a/doc/source/netscript/formulasapi/basic/hackTime.rst b/doc/source/netscript/formulasapi/basic/hackTime.rst
index b7497f043..81d3089e0 100644
--- a/doc/source/netscript/formulasapi/basic/hackTime.rst
+++ b/doc/source/netscript/formulasapi/basic/hackTime.rst
@@ -21,4 +21,4 @@ hackTime() Netscript Function
server = getServer();
server.hackDifficulty = server.minDifficulty;
- tprint(hackTime(server, getPlayer()));
\ No newline at end of file
+ tprint(formulas.basic.hackTime(server, getPlayer()));
\ No newline at end of file
diff --git a/doc/source/netscript/formulasapi/basic/weakenTime.rst b/doc/source/netscript/formulasapi/basic/weakenTime.rst
index 26edca09b..3a050640c 100644
--- a/doc/source/netscript/formulasapi/basic/weakenTime.rst
+++ b/doc/source/netscript/formulasapi/basic/weakenTime.rst
@@ -21,4 +21,4 @@ weakenTime() Netscript Function
server = getServer();
server.hackDifficulty = server.minDifficulty;
- tprint(weakenTime(server, getPlayer()));
\ No newline at end of file
+ tprint(formulas.basic.weakenTime(server, getPlayer()));
\ No newline at end of file
diff --git a/src/Augmentation/ui/PlayerMultipliers.tsx b/src/Augmentation/ui/PlayerMultipliers.tsx
index 4f089796f..c64a5203d 100644
--- a/src/Augmentation/ui/PlayerMultipliers.tsx
+++ b/src/Augmentation/ui/PlayerMultipliers.tsx
@@ -44,6 +44,18 @@ export function PlayerMultipliers(): React.ReactElement {
}
+ function BladeburnerMults(): React.ReactElement {
+ if(!Player.canAccessBladeburner()) return (<>>);
+ return (<>
+ {MultiplierTable([
+ ['Bladeburner Success Chance', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
+ ['Bladeburner Max Stamina', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
+ ['Bladeburner Stamina Gain', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
+ ['Bladeburner Field Analysis', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
+ ])}
+ >);
+ }
+
return (
<>
Multipliers:
@@ -103,6 +115,8 @@ export function PlayerMultipliers(): React.ReactElement {
['Crime success ', Player.crime_success_mult, Player.crime_success_mult*mults.crime_success_mult],
['Crime money ', Player.crime_money_mult, Player.crime_money_mult*mults.crime_money_mult],
])}
+
+
>
)
}
diff --git a/src/BitNode/BitNode.ts b/src/BitNode/BitNode.ts
index 67adcc3c9..1f26fab53 100644
--- a/src/BitNode/BitNode.ts
+++ b/src/BitNode/BitNode.ts
@@ -221,7 +221,7 @@ BitNodes["BitNode11"] = new BitNode(11, "The Big Crash", "Okay. Sell it all.",
"The growth rate of servers is significantly reduced
" +
"Weakening a server is twice as effective
" +
"Company wages are decreased by 50%
" +
- "Corporation valuations are 99% lower and are therefore significantly less profitable
" +
+ "Corporation valuations are 90% lower and are therefore significantly less profitable
" +
"Hacknet Node production is significantly decreased
" +
"Crime and Infiltration are more lucrative
" +
"Augmentations are twice as expensive
" +
diff --git a/src/Bladeburner.jsx b/src/Bladeburner.jsx
index f786d5d96..6893feaeb 100644
--- a/src/Bladeburner.jsx
+++ b/src/Bladeburner.jsx
@@ -736,7 +736,7 @@ Bladeburner.prototype.completeAction = function() {
}
}
var logLossText = "";
- if (loss > 0) {logLossText += "Lost " + formatNumber(loss, 3) + " rank.";}
+ if (loss > 0) {logLossText += "Lost " + formatNumber(loss, 3) + " rank. ";}
if (damage > 0) {logLossText += "Took " + formatNumber(damage, 0) + " damage.";}
if (isOperation && this.logging.ops) {
this.log(action.name + " failed! " + logLossText);
diff --git a/src/Faction/FactionHelpers.jsx b/src/Faction/FactionHelpers.jsx
index 7c2abeca3..3a597a79a 100644
--- a/src/Faction/FactionHelpers.jsx
+++ b/src/Faction/FactionHelpers.jsx
@@ -62,9 +62,6 @@ export function joinFaction(faction) {
i--;
}
}
- if (routing.isOn(Page.Factions)) {
- Engine.loadFactionsContent();
- }
}
export function startHackingMission(faction) {
diff --git a/src/Faction/ui/DonateOption.tsx b/src/Faction/ui/DonateOption.tsx
index b1b1c21fe..a02727323 100644
--- a/src/Faction/ui/DonateOption.tsx
+++ b/src/Faction/ui/DonateOption.tsx
@@ -75,7 +75,7 @@ export class DonateOption extends React.Component {
}
handleChange(e: React.ChangeEvent): void {
- const amt = numeralWrapper.parse(e.target.value);
+ const amt = numeralWrapper.parseMoney(e.target.value);
if (isNaN(amt)) {
this.setState({
diff --git a/src/Hacknet/HacknetHelpers.jsx b/src/Hacknet/HacknetHelpers.jsx
index 22ed184e1..862281bcc 100644
--- a/src/Hacknet/HacknetHelpers.jsx
+++ b/src/Hacknet/HacknetHelpers.jsx
@@ -421,7 +421,9 @@ function processAllHacknetServerEarnings(numCycles) {
// Also, update the hash rate before processing
const hserver = AllServers[Player.hacknetNodes[i]];
hserver.updateHashRate(Player.hacknet_node_money_mult);
- hashes += hserver.process(numCycles);
+ const h = hserver.process(numCycles);
+ hserver.totalHashesGenerated += h;
+ hashes += h;
}
Player.hashManager.storeHashes(hashes);
diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js
index 3ba922e74..d85cc6c48 100644
--- a/src/NetscriptFunctions.js
+++ b/src/NetscriptFunctions.js
@@ -3981,7 +3981,7 @@ function NetscriptFunctions(workerScript) {
setActionAutolevel: function(type="", name="", autoLevel=true) {
updateDynamicRam("setActionAutolevel", getRamCost("bladeburner", "setActionAutolevel"));
checkBladeburnerAccess("setActionAutolevel");
- const action = getBladeburnerActionObject("getActionCurrentLevel", type, name);
+ const action = getBladeburnerActionObject("setActionAutolevel", type, name);
action.autoLevel = autoLevel;
},
setActionLevel: function(type="", name="", level=1) {
@@ -3991,7 +3991,7 @@ function NetscriptFunctions(workerScript) {
if(level < 1 || level > action.maxLevel) {
throw makeRuntimeErrorMsg("bladeburner.setActionLevel", `Level must be between 1 and ${action.maxLevel}, is ${level}`)
}
- actionObj.level = level;
+ action.level = level;
},
getRank: function() {
updateDynamicRam("getRank", getRamCost("bladeburner", "getRank"));
diff --git a/src/ScriptEditor/CodeMirror.js b/src/ScriptEditor/CodeMirror.js
index 51d72c4db..7e35560c4 100644
--- a/src/ScriptEditor/CodeMirror.js
+++ b/src/ScriptEditor/CodeMirror.js
@@ -178,7 +178,7 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
netscriptFns.push(name);
//Get functions from namespaces
- const namespaces = ["bladeburner", "hacknet", "codingcontract", "gang", "sleeve"];
+ const namespaces = ["bladeburner", "hacknet", "codingcontract", "gang", "sleeve", "heart", "formulas"];
if (namespaces.includes(name)) {
let namespace = fnsObj[name];
if (typeof namespace !== "object") {continue;}
@@ -189,6 +189,7 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
}
}
}
+ netscriptFns.sort().reverse();
CodeMirror.hint.netscript = function(editor) {
const origList = CodeMirror.hint.javascript(editor) || {from: editor.getCursor(), to: editor.getCursor(), list: []};
diff --git a/src/ScriptEditor/CodeMirrorNetscriptMode.js b/src/ScriptEditor/CodeMirrorNetscriptMode.js
index 079d77eec..7ffb2b14c 100644
--- a/src/ScriptEditor/CodeMirrorNetscriptMode.js
+++ b/src/ScriptEditor/CodeMirrorNetscriptMode.js
@@ -1,5 +1,7 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
+import CodeMirror from "codemirror/lib/codemirror.js";
+import { NetscriptFunctions } from "../NetscriptFunctions";
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
@@ -26,7 +28,7 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) {
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
- return {
+ const ret = {
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
"return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
"debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
@@ -40,234 +42,16 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) {
// Netscript Basic Functions
"hack": atom,
- "hackAnalyzeThreads": atom,
- "hackAnalyzePercent": atom,
- "hackChance": atom,
- "sleep": atom,
- "grow": atom,
- "weaken": atom,
- "growthAnalyze": atom,
- "print": atom,
- "tprint": atom,
- "scan": atom,
- "nuke": atom,
- "brutessh": atom,
- "ftpcrack": atom,
- "clearLog": atom,
- "disableLog": atom,
- "enableLog": atom,
- "isLogEnabled": atom,
- "getScriptLogs": atom,
- "tail": atom,
- "relaysmtp": atom,
- "httpworm": atom,
- "sqlinject": atom,
- "run": atom,
- "exec": atom,
- "spawn": atom,
- "kill": atom,
- "killall": atom,
- "exit": atom,
- "scp": atom,
- "ls": atom,
- "ps": atom,
- "hasRootAccess": atom,
- "getIp": atom,
- "getHackingMultipliers": atom,
- "getBitNodeMultipliers": atom,
- "getStats": atom,
- "isBusy": atom,
- "getHacknetMultipliers": atom,
- "getHostname": atom,
- "getHackingLevel": atom,
- "getServerMoneyAvailable": atom,
- "getServerMaxMoney": atom,
- "getServerGrowth": atom,
- "getServerSecurityLevel": atom,
- "getServerBaseSecurityLevel": atom,
- "getServerMinSecurityLevel": atom,
- "getServerRequiredHackingLevel": atom,
- "getServerNumPortsRequired": atom,
- "getServerRam": atom,
- "serverExists": atom,
- "fileExists": atom,
- "isRunning": atom,
- "deleteServer": atom,
- "getPurchasedServers": atom,
- "getPurchasedServerLimit": atom,
- "getPurchasedServerMaxRam": atom,
- "getPurchasedServerCost": atom,
- "purchaseServer": atom,
- "round": atom,
- "write": atom,
- "tryWrite": atom,
- "read": atom,
- "peek": atom,
- "clear": atom,
- "rm": atom,
- "getPortHandle": atom,
- "scriptRunning": atom,
- "scriptKill": atom,
- "getScriptName": atom,
- "getScriptRam": atom,
- "getHackTime": atom,
- "getGrowTime": atom,
- "getWeakenTime": atom,
- "getScriptIncome": atom,
- "getScriptExpGain": atom,
- "getTimeSinceLastAug": atom,
- "prompt": atom,
-
- // Netscript Singularity Functions
- "universityCourse": atom,
- "getCharacterInformation": atom,
- "gymWorkout": atom,
- "travelToCity": atom,
- "purchaseTor": atom,
- "purchaseProgram": atom,
- "upgradeHomeRam": atom,
- "getUpgradeHomeRamCost": atom,
- "workForCompany": atom,
- "applyToCompany": atom,
- "getCompanyRep": atom,
- "getCompanyFavor": atom,
- "stopAction": atom,
- "getFactionFavor": atom,
- "getFavorToDonate": atom,
- "getFactionFavorGain": atom,
- "getCompanyFavorGain": atom,
- "checkFactionInvitations": atom,
- "joinFaction": atom,
- "workForFaction": atom,
- "getFactionRep": atom,
- "donateToFaction": atom,
- "createProgram": atom,
- "commitCrime": atom,
- "getCrimeChance": atom,
- "getOwnedAugmentations": atom,
- "getOwnedSourceFiles": atom,
- "getAugmentationsFromFaction": atom,
- "getAugmentationPrereq": atom,
- "getAugmentationCost": atom,
- "purchaseAugmentation": atom,
- "installAugmentations": atom,
-
- // Netscript TIX API
- "getStockPrice": atom,
- "getStockAskPrice": atom,
- "getStockBidPrice": atom,
- "getStockPosition": atom,
- "getStockSymbols": atom,
- "getStockMaxShares": atom,
- "getStockPurchaseCost": atom,
- "getStockSaleGain": atom,
- "buyStock": atom,
- "sellStock": atom,
- "shortStock": atom,
- "sellShort": atom,
- "placeOrder": atom,
- "cancelOrder": atom,
- "getOrders": atom,
- "getStockVolatility": atom,
- "getStockForecast": atom,
- "purchase4SMarketData": atom,
- "purchase4SMarketDataTixApi": atom,
-
- // Netscript Hacknet Node API
- "hacknet": atom,
- "numNodes": atom,
- "purchaseNode": atom,
- "getPurchaseNodeCost": atom,
- "getNodeStats": atom,
- "upgradeLevel": atom,
- "upgradeRam": atom,
- "upgradeCore": atom,
- "upgradeCache": atom,
- "getLevelUpgradeCost": atom,
- "getRamUpgradeCost": atom,
- "getCoreUpgradeCost": atom,
- "getCacheUpgradeCost": atom,
-
- // Netscript Gang API
- "gang": atom,
- "getMemberNames": atom,
- "getGangInformation": atom,
- "getMemberInformation": atom,
- "canRecruitMember": atom,
- "recruitMember": atom,
- "getTaskNames": atom,
- "setMemberTask": atom,
- "getEquipmentNames": atom,
- "getEquipmentCost": atom,
- "getEquipmentType": atom,
- "purchaseEquipment": atom,
- "ascendMember": atom,
- "setTerritoryWarfare": atom,
- "getChanceToWinClash": atom,
- "getBonusTime": atom,
-
- // Netscript Bladeburner API
- "bladeburner": atom,
- "getContractNames": atom,
- "getOperationNames": atom,
- "getBlackOpNames": atom,
- "getGeneralActionNames": atom,
- "getSkillNames": atom,
- "startAction": atom,
- "stopBladeburnerAction": atom,
- "getCurrentAction": atom,
- "getActionTime": atom,
- "getActionEstimatedSuccessChance": atom,
- "getActionCountRemaining": atom,
- "getActionMaxLevel": atom,
- "getActionCurrentLevel": atom,
- "getActionAutolevel": atom,
- "getActionRepGain": atom,
- "setActionAutolevel": atom,
- "setActionLevel": atom,
- "getRank": atom,
- "getBlackOpRank": atom,
- "getSkillPoints": atom,
- "getSkillLevel": atom,
- "getSkillUpgradeCost": atom,
- "upgradeSkill": atom,
- "getTeamSize": atom,
- "getCity": atom,
- "setTeamSize": atom,
- "getCityEstimatedPopulation": atom,
- "getCityEstimatedCommunities": atom,
- "getCityChaos": atom,
- "switchCity": atom,
- "getStamina": atom,
- "joinBladeburnerFaction": atom,
- // Repeat of above "getBonusTime": atom,
-
- // Netscript Coding Contract API
- "codingcontract": atom,
- "attempt": atom,
- "getContractType": atom,
- "getData": atom,
- "getDescription": atom,
- "getNumTriesRemaining": atom,
-
- // Sleeve API
- "sleeve": atom,
- "getNumSleeves": atom,
- "setToShockRecovery": atom,
- "setToSynchronize": atom,
- "setToCommitCrime": atom,
- "setToUniversityCourse": atom,
- "travel": atom,
- "setToCompanyWork": atom,
- "setToFactionWork": atom,
- "setToGymWorkout": atom,
- "getSleeveStats": atom,
- "getTask": atom,
- "getInformation": atom,
- "getSleeveAugmentations": atom,
- "getSleevePurchasableAugs": atom,
- "purchaseSleeveAug": atom,
};
+
+ function push(obj) {
+ for(const key of Object.keys(obj)) {
+ if(typeof obj[key] === 'function') ret[key] = atom;
+ if(typeof obj[key] === 'object') push(obj[key]);
+ }
+ }
+ push(NetscriptFunctions(null));
+ return ret;
}());
var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
diff --git a/src/ui/CharacterInfo.tsx b/src/ui/CharacterInfo.tsx
index fbd98f6cf..dcfa2fffb 100644
--- a/src/ui/CharacterInfo.tsx
+++ b/src/ui/CharacterInfo.tsx
@@ -108,6 +108,18 @@ export function CharacterInfo(p: IPlayer): React.ReactElement {
>
}
+ function BladeburnerMults(): React.ReactElement {
+ if(!p.canAccessBladeburner()) return (<>>);
+ return (<>
+
+ >);
+ }
+
function CurrentBitNode(): React.ReactElement {
if(p.sourceFiles.length > 0) {
@@ -233,7 +245,9 @@ export function CharacterInfo(p: IPlayer): React.ReactElement {
+ ]} />
+
+
Misc.
{`Servers owned: ${p.purchasedServers.length} / ${getPurchaseServerLimit()}`}
diff --git a/src/ui/numeralFormat.ts b/src/ui/numeralFormat.ts
index 0e2c372e6..8f68d24a8 100644
--- a/src/ui/numeralFormat.ts
+++ b/src/ui/numeralFormat.ts
@@ -139,7 +139,7 @@ class NumeralFormatter {
return this.format(n, "0,0");
}
- parse(s: string): number {
+ parseMoney(s: string): number {
// numeral library does not handle formats like 1e10 well (returns 110),
// so if both return a valid number, return the biggest one
const numeralValue = numeral(s).value();
diff --git a/utils/InfiltrationBox.js b/utils/InfiltrationBox.js
index ab05179cc..9c55a5232 100644
--- a/utils/InfiltrationBox.js
+++ b/utils/InfiltrationBox.js
@@ -1,6 +1,6 @@
import { dialogBoxCreate } from "./DialogBox";
import { clearEventListeners } from "./uiHelpers/clearEventListeners";
-import { formatNumber } from "./StringHelperFunctions";
+import { numeralWrapper } from "../src/ui/numeralFormat";
import { BitNodeMultipliers } from "../src/BitNode/BitNodeMultipliers";
import { CONSTANTS } from "../src/Constants";
@@ -38,12 +38,12 @@ function infiltrationBoxCreate(inst) {
Player.gainIntelligenceExp(inst.calcGainedIntelligenceExp());
const expGainText = ["You gained:",
- `${formatNumber(inst.calcGainedHackingExp(), 3)} hacking exp`,
- `${formatNumber(inst.calcGainedStrengthExp(), 3)} str exp`,
- `${formatNumber(inst.calcGainedDefenseExp(), 3)} def exp`,
- `${formatNumber(inst.calcGainedDexterityExp(), 3)} dex exp`,
- `${formatNumber(inst.calcGainedAgilityExp(), 3)} agi exp`,
- `${formatNumber(inst.calcGainedCharismaExp(), 3)} cha exp`].join("\n");
+ `${numeralWrapper.formatExp(inst.calcGainedHackingExp(), 3)} hacking exp`,
+ `${numeralWrapper.formatExp(inst.calcGainedStrengthExp(), 3)} str exp`,
+ `${numeralWrapper.formatExp(inst.calcGainedDefenseExp(), 3)} def exp`,
+ `${numeralWrapper.formatExp(inst.calcGainedDexterityExp(), 3)} dex exp`,
+ `${numeralWrapper.formatExp(inst.calcGainedAgilityExp(), 3)} agi exp`,
+ `${numeralWrapper.formatExp(inst.calcGainedCharismaExp(), 3)} cha exp`].join("\n");
var totalValue = 0;
for (var i = 0; i < inst.secretsStolen.length; ++i) {
@@ -58,9 +58,9 @@ function infiltrationBoxCreate(inst) {
CONSTANTS.InfiltrationRepValue * BitNodeMultipliers.InfiltrationRep;
var moneyValue = totalValue * CONSTANTS.InfiltrationMoneyValue * BitNodeMultipliers.InfiltrationMoney;
infiltrationSetText("You can sell the classified documents and secrets " +
- "you stole from " + inst.companyName + " for $" +
- formatNumber(moneyValue, 2) + " on the black market or you can give it " +
- "to a faction to gain " + formatNumber(facValue, 3) + " reputation with " +
+ "you stole from " + inst.companyName + " for " +
+ numeralWrapper.formatMoney(moneyValue) + " on the black market or you can give it " +
+ "to a faction to gain " + numeralWrapper.formatReputation(facValue) + " reputation with " +
"that faction.");
var selector = document.getElementById("infiltration-faction-select");
selector.innerHTML = "";
@@ -88,7 +88,7 @@ function infiltrationBoxCreate(inst) {
Player.gainMoney(moneyValue);
Player.recordMoneySource(moneyValue, "infiltration");
dialogBoxCreate("You sold the classified information you stole from " + inst.companyName +
- " for $" + formatNumber(moneyValue, 2) + " on the black market!
" +
+ " for " + numeralWrapper.formatMoney(moneyValue) + " on the black market!
" +
expGainText);
infiltrationBoxClose();
return false;
@@ -108,7 +108,7 @@ function infiltrationBoxCreate(inst) {
}
faction.playerReputation += facValue;
dialogBoxCreate("You gave the classified information you stole from " + inst.companyName +
- " to " + facName + " and gained " + formatNumber(facValue, 3) + " reputation with the faction.
" +
+ " to " + facName + " and gained " + numeralWrapper.formatReputation(facValue) + " reputation with the faction.
" +
expGainText);
infiltrationBoxClose();
return false;