diff --git a/dist/engine.bundle.js b/dist/engine.bundle.js index 440662d87..4a19c58e7 100644 --- a/dist/engine.bundle.js +++ b/dist/engine.bundle.js @@ -197,6 +197,7 @@ function PlayerObject() { this.currentServer = ""; //IP address of Server currently being accessed through terminal this.purchasedServers = []; //IP Addresses of purchased servers this.hacknetNodes = []; + this.hacknetNodeWrappers = []; this.totalHacknetNodeProduction = 0; //Factions @@ -488,16 +489,8 @@ PlayerObject.prototype.prestigeSourceFile = function() { if (this.bitNodeN === 3) {this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_15__["default"](150e9);} this.corporation = 0; - //Reset Bladeburner this.bladeburner = 0; - //BitNode 8: Ghost of Wall Street - if (this.bitNodeN === 8) {this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_15__["default"](100000000);} - if (this.bitNodeN === 8 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_11__["hasWallStreetSF"]) { - this.hasWseAccount = true; - this.hasTixApiAccess = true; - } - this.playtimeSinceLastAug = 0; this.scriptProdSinceLastAug = 0; } @@ -2956,7 +2949,7 @@ function generateRandomString(n) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONSTANTS", function() { return CONSTANTS; }); let CONSTANTS = { - Version: "0.37.1", + Version: "0.37.2", //Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience //and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then @@ -3441,16 +3434,13 @@ let CONSTANTS = { "World Stock Exchange account and TIX API Access
", LatestUpdate: - "v0.37.1
" + - "* You now earn money from successfully completing Bladeburner contracts. The amount you earn is based " + - "on the difficulty of the contract.
" + - "* Completing Field Analysis in Bladeburner now grants 0.1 rank
" + - "* The maximum RAM you can get on a purchased server is now 1,048,576 GB (2^20)
" + - "* Bug Fix: Fixed Netscript syntax highlighting issues with the new NetscriptJS
" + - "* Bug Fix: Netscript Functions now properly incur RAM costs in NetscriptJS
" + - "* Bug Fix: deleteServer() now fails if its called on the server you are currently connected to
" + - "* Removed in-game Netscript documentation, since it was outdated and difficult to maintain.
" + - "* Bug Fix: Updated the gymWorkout() Singularity function with the new exp/cost values for gyms
" + "v0.37.2
" + + "* After joining the Bladeburners division, there is now a button to go to the Bladeburner content " + + "in the 'City' page
" + + "* You now start with $250m in BitNode-8 (increased from $100m)
" + + "* Bug Fix: You can now no longer directly edit Hacknet Node values through NetscriptJS (hopefully)
" + + "* Bug Fix: Bladeburners is no longer accessible in BN-8
" + + "* Bug Fix: getBitNodeMultipliers() Netscript function now returns a copy rather than the original object
" } @@ -4198,6 +4188,7 @@ function displayLocationContent() { securityJob.style.display = "block"; agentJob.style.display = "block"; if (_Player_js__WEBPACK_IMPORTED_MODULE_8__["Player"].bitNodeN === 6 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_7__["hasBladeburnerSF"] === true) { + if (_Player_js__WEBPACK_IMPORTED_MODULE_8__["Player"].bitNodeN === 8) {break;} if (_Player_js__WEBPACK_IMPORTED_MODULE_8__["Player"].bladeburner instanceof _Bladeburner_js__WEBPACK_IMPORTED_MODULE_0__["Bladeburner"]) { //Note: Can't infiltrate NSA when part of bladeburner nsaBladeburner.innerText = "Enter Bladeburner Headquarters"; @@ -6348,6 +6339,7 @@ let Engine = { //Generic Locations (common to every city): // World Stock Exchange // Corporation (if applicable) + // Bladeburner HQ (if applicable); var genericLocationsList = document.getElementById("generic-locations-list"); genericLocationsList.style.display = "inline"; Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_2__["removeChildrenFromElement"])(genericLocationsList); @@ -6374,6 +6366,18 @@ let Engine = { })); genericLocationsList.appendChild(li); } + + if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].bladeburner instanceof _Bladeburner_js__WEBPACK_IMPORTED_MODULE_9__["Bladeburner"]) { + var li = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_2__["createElement"])("li"); + li.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_2__["createElement"])("a", { + innerText:"Bladeburner Headquarters", class:"a-link-button", + clickListener:()=>{ + Engine.loadBladeburnerContent(); + return false; + } + })); + genericLocationsList.appendChild(li); + } }, displayFactionsInfo: function() { @@ -6436,9 +6440,9 @@ let Engine = { clickListener:()=>{ Object(_Faction_js__WEBPACK_IMPORTED_MODULE_15__["joinFaction"])(_Faction_js__WEBPACK_IMPORTED_MODULE_15__["Factions"][factionName]); for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations.length; ++i) { - if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations[i] == factionName) { + if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations[i] == factionName || _Faction_js__WEBPACK_IMPORTED_MODULE_15__["Factions"][_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations[i]].isBanned) { _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations.splice(i, 1); - break; + i--; } } Engine.displayFactionsInfo(); @@ -18855,6 +18859,9 @@ function displayStockMarketContent() { wseAccountButton.innerText = "Buy WSE Account - $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_10__["formatNumber"])(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].WSEAccountCost, 2).toString(); if (!_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasWseAccount && _Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].money.gte(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].WSEAccountCost)) { wseAccountButton.setAttribute("class", "a-link-button"); + } else if (_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasWseAccount){ + wseAccountButton.innerText = "WSE Account - Purchased"; + wseAccountButton.setAttribute("class", "a-link-button-bought"); } else { wseAccountButton.setAttribute("class", "a-link-button-inactive"); } @@ -18873,6 +18880,9 @@ function displayStockMarketContent() { Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_10__["formatNumber"])(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].TIXAPICost, 2).toString(); if (!_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasTixApiAccess && _Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].money.gte(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].TIXAPICost)) { tixApiAccessButton.setAttribute("class", "a-link-button"); + } else if(_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasTixApiAccess) { + tixApiAccessButton.innerText = "Trade Information eXchange (TIX) API Access - Purchased" + tixApiAccessButton.setAttribute("class", "a-link-button-bought"); } else { tixApiAccessButton.setAttribute("class", "a-link-button-inactive"); } @@ -25616,6 +25626,7 @@ function parseOnlyRamCalculate(server, code, workerScript) { // onto the main reference map, and a list of modules that need to be parsed. function parseOnlyCalculateDeps(code, currentModule) { const ast = Object(_utils_acorn_js__WEBPACK_IMPORTED_MODULE_12__["parse"])(code, {sourceType:"module", ecmaVersion: 8}); + console.log(ast); // Everything from the global scope goes in ".". Everything else goes in ".function", where only // the outermost layer of functions counts. @@ -29304,7 +29315,7 @@ function initBladeburner() { Skills[SkillNames.Overclock] = new Skill({ name:SkillNames.Overclock, desc:"Each level of this skill decreases the time it takes " + - "to attempt a contract or operation by 1% (Max Level: 99)", + "to attempt a contract or operation by 1% (Max Level: 95)", baseCost:5, costInc:1, maxLvl:95, actionTime:1 }); @@ -30405,7 +30416,7 @@ function NetscriptFunctions(workerScript) { Math : Math, Date : Date, Number : Number, - hacknetnodes : _Player_js__WEBPACK_IMPORTED_MODULE_15__["Player"].hacknetNodes, + hacknetnodes : _Player_js__WEBPACK_IMPORTED_MODULE_15__["Player"].hacknetNodeWrappers, sprintf : sprintf, vsprintf: vsprintf, scan : function(ip=workerScript.serverIp, hostnames=true){ @@ -31372,7 +31383,8 @@ function NetscriptFunctions(workerScript) { if (!hasAISF) { throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_24__["makeRuntimeRejectMsg"])(workerScript, "Cannot run getBitNodeMultipliers(). It requires Source-File 5 to run."); } - return _BitNode_js__WEBPACK_IMPORTED_MODULE_2__["BitNodeMultipliers"]; + let copy = Object.assign({}, _BitNode_js__WEBPACK_IMPORTED_MODULE_2__["BitNodeMultipliers"]); + return copy; }, getServerMoneyAvailable : function(ip){ if (workerScript.checkingRam) { @@ -52283,6 +52295,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateHacknetNodesContent", function() { return updateHacknetNodesContent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "processAllHacknetNodeEarnings", function() { return processAllHacknetNodeEarnings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHacknetNode", function() { return getHacknetNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlayerHacknetNodeWrappers", function() { return createPlayerHacknetNodeWrappers; }); /* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BitNode.js */ 15); /* harmony import */ var _Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Constants.js */ 3); /* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./engine.js */ 5); @@ -52348,6 +52361,7 @@ function HacknetNode(name) { this.moneyGainRatePerSecond = 0; } + HacknetNode.prototype.updateMoneyGainRate = function() { //How much extra $/s is gained per level var gainPerLevel = _Constants_js__WEBPACK_IMPORTED_MODULE_1__["CONSTANTS"].HacknetNodeMoneyGainPerLevel; @@ -52472,6 +52486,36 @@ HacknetNode.fromJSON = function(value) { _utils_JSONReviver_js__WEBPACK_IMPORTED_MODULE_7__["Reviver"].constructors.HacknetNode = HacknetNode; +var HacknetNodeWrapper = function(hacknetNodeObj) { + var _node = hacknetNodeObj; + return { + name : _node.name, + level : _node.level, + ram : _node.ram, + cores : _node.cores, + totalMoneyGenerated : _node.totalMoneyGenerated, + onlineTimeSeconds : _node.onlineTimeSeconds, + moneyGainRatePerSecond : _node.moneyGainRatePerSecond, + upgradeLevel : function(n) { + return _node.upgradeLevel(n); + }, + upgradeRam : function() { + return _node.upgradeRam(); + }, + upgradeCore : function() { + return _node.upgradeCore(); + }, + getLevelUpgradeCost : function(n) { + return _node.getLevelUpgradeCost(n); + }, + getRamUpgradeCost : function() { + return _node.getRamUpgradeCost(); + }, + getCoreUpgradeCost : function() { + return _node.getCoreUpgradeCost(); + } + } +} function purchaseHacknet() { /* INTERACTIVE TUTORIAL */ @@ -52761,8 +52805,31 @@ function updateHacknetNodeDomElement(nodeObj) { } } +function createPlayerHacknetNodeWrappers() { + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers.length = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length; + for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length; ++i) { + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i] = new HacknetNodeWrapper(_Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i]); + } +} + +function updatePlayerHacknetNodeWrappers() { + if (_Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers.length !== _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length) { + return createPlayerHacknetNodeWrappers(); + } + for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers.length; ++i) { + if (!(_Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i] instanceof HacknetNodeWrapper)) {return createPlayerHacknetNodeWrappers();} + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].level = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].level; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].ram = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].ram; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].cores = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].cores; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].totalMoneyGenerated = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].totalMoneyGenerated; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].onlineTimeSeconds = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].onlineTimeSeconds; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].moneyGainRatePerSecond = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].moneyGainRatePerSecond; + } +} + function processAllHacknetNodeEarnings(numCycles) { var total = 0; + updatePlayerHacknetNodeWrappers(); for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length; ++i) { total += processSingleHacknetNodeEarnings(numCycles, _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i]); } @@ -59020,6 +59087,8 @@ function loadGame(saveString) { } } + //Re-initialize Hacknet Node Wrappers + Object(_HacknetNode_js__WEBPACK_IMPORTED_MODULE_7__["createPlayerHacknetNodeWrappers"])(); return true; } @@ -59236,6 +59305,9 @@ function loadImportedGame(saveObj, saveString) { } } + //Re-initialize Hacknet Node Wrappers + Object(_HacknetNode_js__WEBPACK_IMPORTED_MODULE_7__["createPlayerHacknetNodeWrappers"])(); + var popupId = "import-game-restart-game-notice"; var txt = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_17__["createElement"])("p", { innerText:"Imported game! I would suggest saving the game and then reloading the page " + @@ -60698,6 +60770,8 @@ __webpack_require__.r(__webpack_exports__); + +let BitNode8StartingMoney = 250e6; //Prestige by purchasing augmentation function prestigeAugmentation() { @@ -60792,7 +60866,7 @@ function prestigeAugmentation() { _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bladeburner = null; //BitNode 8: Ghost of Wall Street - if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8) {_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].money = new decimal_js__WEBPACK_IMPORTED_MODULE_18__["default"](100e6);} + if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8) {_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].money = new decimal_js__WEBPACK_IMPORTED_MODULE_18__["default"](BitNode8StartingMoney);} if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_11__["hasWallStreetSF"]) { _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasWseAccount = true; _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasTixApiAccess = true; @@ -60970,6 +61044,13 @@ function prestigeSourceFile() { } + //BitNode 8: Ghost of Wall Street + if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8) {_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].money = new decimal_js__WEBPACK_IMPORTED_MODULE_18__["default"](BitNode8StartingMoney);} + if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_11__["hasWallStreetSF"]) { + _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasWseAccount = true; + _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasTixApiAccess = true; + } + //Gain int exp _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].gainIntelligenceExp(5); } @@ -95680,7 +95761,7 @@ var NetscriptHighlightRules = function(options) { "JSON|Math|" + // Other "this|arguments|prototype|window|document" , // Pseudo "keyword": - "const|yield|import|get|set|async|await|foop|" + + "const|yield|import|get|set|async|await|" + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + "__parent__|__count__|escape|unescape|with|__proto__|" + diff --git a/dist/tests.bundle.js b/dist/tests.bundle.js index 4bc4c1264..f5fa65bfe 100644 --- a/dist/tests.bundle.js +++ b/dist/tests.bundle.js @@ -197,6 +197,7 @@ function PlayerObject() { this.currentServer = ""; //IP address of Server currently being accessed through terminal this.purchasedServers = []; //IP Addresses of purchased servers this.hacknetNodes = []; + this.hacknetNodeWrappers = []; this.totalHacknetNodeProduction = 0; //Factions @@ -488,16 +489,8 @@ PlayerObject.prototype.prestigeSourceFile = function() { if (this.bitNodeN === 3) {this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_15__["default"](150e9);} this.corporation = 0; - //Reset Bladeburner this.bladeburner = 0; - //BitNode 8: Ghost of Wall Street - if (this.bitNodeN === 8) {this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_15__["default"](100000000);} - if (this.bitNodeN === 8 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_11__["hasWallStreetSF"]) { - this.hasWseAccount = true; - this.hasTixApiAccess = true; - } - this.playtimeSinceLastAug = 0; this.scriptProdSinceLastAug = 0; } @@ -2956,7 +2949,7 @@ function generateRandomString(n) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONSTANTS", function() { return CONSTANTS; }); let CONSTANTS = { - Version: "0.37.1", + Version: "0.37.2", //Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience //and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then @@ -3441,16 +3434,13 @@ let CONSTANTS = { "World Stock Exchange account and TIX API Access
", LatestUpdate: - "v0.37.1
" + - "* You now earn money from successfully completing Bladeburner contracts. The amount you earn is based " + - "on the difficulty of the contract.
" + - "* Completing Field Analysis in Bladeburner now grants 0.1 rank
" + - "* The maximum RAM you can get on a purchased server is now 1,048,576 GB (2^20)
" + - "* Bug Fix: Fixed Netscript syntax highlighting issues with the new NetscriptJS
" + - "* Bug Fix: Netscript Functions now properly incur RAM costs in NetscriptJS
" + - "* Bug Fix: deleteServer() now fails if its called on the server you are currently connected to
" + - "* Removed in-game Netscript documentation, since it was outdated and difficult to maintain.
" + - "* Bug Fix: Updated the gymWorkout() Singularity function with the new exp/cost values for gyms
" + "v0.37.2
" + + "* After joining the Bladeburners division, there is now a button to go to the Bladeburner content " + + "in the 'City' page
" + + "* You now start with $250m in BitNode-8 (increased from $100m)
" + + "* Bug Fix: You can now no longer directly edit Hacknet Node values through NetscriptJS (hopefully)
" + + "* Bug Fix: Bladeburners is no longer accessible in BN-8
" + + "* Bug Fix: getBitNodeMultipliers() Netscript function now returns a copy rather than the original object
" } @@ -4198,6 +4188,7 @@ function displayLocationContent() { securityJob.style.display = "block"; agentJob.style.display = "block"; if (_Player_js__WEBPACK_IMPORTED_MODULE_8__["Player"].bitNodeN === 6 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_7__["hasBladeburnerSF"] === true) { + if (_Player_js__WEBPACK_IMPORTED_MODULE_8__["Player"].bitNodeN === 8) {break;} if (_Player_js__WEBPACK_IMPORTED_MODULE_8__["Player"].bladeburner instanceof _Bladeburner_js__WEBPACK_IMPORTED_MODULE_0__["Bladeburner"]) { //Note: Can't infiltrate NSA when part of bladeburner nsaBladeburner.innerText = "Enter Bladeburner Headquarters"; @@ -6348,6 +6339,7 @@ let Engine = { //Generic Locations (common to every city): // World Stock Exchange // Corporation (if applicable) + // Bladeburner HQ (if applicable); var genericLocationsList = document.getElementById("generic-locations-list"); genericLocationsList.style.display = "inline"; Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_2__["removeChildrenFromElement"])(genericLocationsList); @@ -6374,6 +6366,18 @@ let Engine = { })); genericLocationsList.appendChild(li); } + + if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].bladeburner instanceof _Bladeburner_js__WEBPACK_IMPORTED_MODULE_9__["Bladeburner"]) { + var li = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_2__["createElement"])("li"); + li.appendChild(Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_2__["createElement"])("a", { + innerText:"Bladeburner Headquarters", class:"a-link-button", + clickListener:()=>{ + Engine.loadBladeburnerContent(); + return false; + } + })); + genericLocationsList.appendChild(li); + } }, displayFactionsInfo: function() { @@ -6436,9 +6440,9 @@ let Engine = { clickListener:()=>{ Object(_Faction_js__WEBPACK_IMPORTED_MODULE_15__["joinFaction"])(_Faction_js__WEBPACK_IMPORTED_MODULE_15__["Factions"][factionName]); for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations.length; ++i) { - if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations[i] == factionName) { + if (_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations[i] == factionName || _Faction_js__WEBPACK_IMPORTED_MODULE_15__["Factions"][_Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations[i]].isBanned) { _Player_js__WEBPACK_IMPORTED_MODULE_26__["Player"].factionInvitations.splice(i, 1); - break; + i--; } } Engine.displayFactionsInfo(); @@ -18855,6 +18859,9 @@ function displayStockMarketContent() { wseAccountButton.innerText = "Buy WSE Account - $" + Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_10__["formatNumber"])(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].WSEAccountCost, 2).toString(); if (!_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasWseAccount && _Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].money.gte(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].WSEAccountCost)) { wseAccountButton.setAttribute("class", "a-link-button"); + } else if (_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasWseAccount){ + wseAccountButton.innerText = "WSE Account - Purchased"; + wseAccountButton.setAttribute("class", "a-link-button-bought"); } else { wseAccountButton.setAttribute("class", "a-link-button-inactive"); } @@ -18873,6 +18880,9 @@ function displayStockMarketContent() { Object(_utils_StringHelperFunctions_js__WEBPACK_IMPORTED_MODULE_10__["formatNumber"])(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].TIXAPICost, 2).toString(); if (!_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasTixApiAccess && _Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].money.gte(_Constants_js__WEBPACK_IMPORTED_MODULE_0__["CONSTANTS"].TIXAPICost)) { tixApiAccessButton.setAttribute("class", "a-link-button"); + } else if(_Player_js__WEBPACK_IMPORTED_MODULE_5__["Player"].hasTixApiAccess) { + tixApiAccessButton.innerText = "Trade Information eXchange (TIX) API Access - Purchased" + tixApiAccessButton.setAttribute("class", "a-link-button-bought"); } else { tixApiAccessButton.setAttribute("class", "a-link-button-inactive"); } @@ -25616,6 +25626,7 @@ function parseOnlyRamCalculate(server, code, workerScript) { // onto the main reference map, and a list of modules that need to be parsed. function parseOnlyCalculateDeps(code, currentModule) { const ast = Object(_utils_acorn_js__WEBPACK_IMPORTED_MODULE_12__["parse"])(code, {sourceType:"module", ecmaVersion: 8}); + console.log(ast); // Everything from the global scope goes in ".". Everything else goes in ".function", where only // the outermost layer of functions counts. @@ -29304,7 +29315,7 @@ function initBladeburner() { Skills[SkillNames.Overclock] = new Skill({ name:SkillNames.Overclock, desc:"Each level of this skill decreases the time it takes " + - "to attempt a contract or operation by 1% (Max Level: 99)", + "to attempt a contract or operation by 1% (Max Level: 95)", baseCost:5, costInc:1, maxLvl:95, actionTime:1 }); @@ -30405,7 +30416,7 @@ function NetscriptFunctions(workerScript) { Math : Math, Date : Date, Number : Number, - hacknetnodes : _Player_js__WEBPACK_IMPORTED_MODULE_15__["Player"].hacknetNodes, + hacknetnodes : _Player_js__WEBPACK_IMPORTED_MODULE_15__["Player"].hacknetNodeWrappers, sprintf : sprintf, vsprintf: vsprintf, scan : function(ip=workerScript.serverIp, hostnames=true){ @@ -31372,7 +31383,8 @@ function NetscriptFunctions(workerScript) { if (!hasAISF) { throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_24__["makeRuntimeRejectMsg"])(workerScript, "Cannot run getBitNodeMultipliers(). It requires Source-File 5 to run."); } - return _BitNode_js__WEBPACK_IMPORTED_MODULE_2__["BitNodeMultipliers"]; + let copy = Object.assign({}, _BitNode_js__WEBPACK_IMPORTED_MODULE_2__["BitNodeMultipliers"]); + return copy; }, getServerMoneyAvailable : function(ip){ if (workerScript.checkingRam) { @@ -52283,6 +52295,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateHacknetNodesContent", function() { return updateHacknetNodesContent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "processAllHacknetNodeEarnings", function() { return processAllHacknetNodeEarnings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHacknetNode", function() { return getHacknetNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlayerHacknetNodeWrappers", function() { return createPlayerHacknetNodeWrappers; }); /* harmony import */ var _BitNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BitNode.js */ 15); /* harmony import */ var _Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Constants.js */ 3); /* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./engine.js */ 5); @@ -52348,6 +52361,7 @@ function HacknetNode(name) { this.moneyGainRatePerSecond = 0; } + HacknetNode.prototype.updateMoneyGainRate = function() { //How much extra $/s is gained per level var gainPerLevel = _Constants_js__WEBPACK_IMPORTED_MODULE_1__["CONSTANTS"].HacknetNodeMoneyGainPerLevel; @@ -52472,6 +52486,36 @@ HacknetNode.fromJSON = function(value) { _utils_JSONReviver_js__WEBPACK_IMPORTED_MODULE_7__["Reviver"].constructors.HacknetNode = HacknetNode; +var HacknetNodeWrapper = function(hacknetNodeObj) { + var _node = hacknetNodeObj; + return { + name : _node.name, + level : _node.level, + ram : _node.ram, + cores : _node.cores, + totalMoneyGenerated : _node.totalMoneyGenerated, + onlineTimeSeconds : _node.onlineTimeSeconds, + moneyGainRatePerSecond : _node.moneyGainRatePerSecond, + upgradeLevel : function(n) { + return _node.upgradeLevel(n); + }, + upgradeRam : function() { + return _node.upgradeRam(); + }, + upgradeCore : function() { + return _node.upgradeCore(); + }, + getLevelUpgradeCost : function(n) { + return _node.getLevelUpgradeCost(n); + }, + getRamUpgradeCost : function() { + return _node.getRamUpgradeCost(); + }, + getCoreUpgradeCost : function() { + return _node.getCoreUpgradeCost(); + } + } +} function purchaseHacknet() { /* INTERACTIVE TUTORIAL */ @@ -52761,8 +52805,31 @@ function updateHacknetNodeDomElement(nodeObj) { } } +function createPlayerHacknetNodeWrappers() { + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers.length = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length; + for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length; ++i) { + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i] = new HacknetNodeWrapper(_Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i]); + } +} + +function updatePlayerHacknetNodeWrappers() { + if (_Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers.length !== _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length) { + return createPlayerHacknetNodeWrappers(); + } + for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers.length; ++i) { + if (!(_Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i] instanceof HacknetNodeWrapper)) {return createPlayerHacknetNodeWrappers();} + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].level = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].level; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].ram = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].ram; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].cores = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].cores; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].totalMoneyGenerated = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].totalMoneyGenerated; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].onlineTimeSeconds = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].onlineTimeSeconds; + _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodeWrappers[i].moneyGainRatePerSecond = _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i].moneyGainRatePerSecond; + } +} + function processAllHacknetNodeEarnings(numCycles) { var total = 0; + updatePlayerHacknetNodeWrappers(); for (var i = 0; i < _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes.length; ++i) { total += processSingleHacknetNodeEarnings(numCycles, _Player_js__WEBPACK_IMPORTED_MODULE_4__["Player"].hacknetNodes[i]); } @@ -59020,6 +59087,8 @@ function loadGame(saveString) { } } + //Re-initialize Hacknet Node Wrappers + Object(_HacknetNode_js__WEBPACK_IMPORTED_MODULE_7__["createPlayerHacknetNodeWrappers"])(); return true; } @@ -59236,6 +59305,9 @@ function loadImportedGame(saveObj, saveString) { } } + //Re-initialize Hacknet Node Wrappers + Object(_HacknetNode_js__WEBPACK_IMPORTED_MODULE_7__["createPlayerHacknetNodeWrappers"])(); + var popupId = "import-game-restart-game-notice"; var txt = Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_17__["createElement"])("p", { innerText:"Imported game! I would suggest saving the game and then reloading the page " + @@ -60698,6 +60770,8 @@ __webpack_require__.r(__webpack_exports__); + +let BitNode8StartingMoney = 250e6; //Prestige by purchasing augmentation function prestigeAugmentation() { @@ -60792,7 +60866,7 @@ function prestigeAugmentation() { _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bladeburner = null; //BitNode 8: Ghost of Wall Street - if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8) {_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].money = new decimal_js__WEBPACK_IMPORTED_MODULE_18__["default"](100e6);} + if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8) {_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].money = new decimal_js__WEBPACK_IMPORTED_MODULE_18__["default"](BitNode8StartingMoney);} if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_11__["hasWallStreetSF"]) { _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasWseAccount = true; _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasTixApiAccess = true; @@ -60970,6 +61044,13 @@ function prestigeSourceFile() { } + //BitNode 8: Ghost of Wall Street + if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8) {_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].money = new decimal_js__WEBPACK_IMPORTED_MODULE_18__["default"](BitNode8StartingMoney);} + if (_Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].bitNodeN === 8 || _NetscriptFunctions_js__WEBPACK_IMPORTED_MODULE_11__["hasWallStreetSF"]) { + _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasWseAccount = true; + _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].hasTixApiAccess = true; + } + //Gain int exp _Player_js__WEBPACK_IMPORTED_MODULE_13__["Player"].gainIntelligenceExp(5); } @@ -96998,7 +97079,7 @@ var NetscriptHighlightRules = function(options) { "JSON|Math|" + // Other "this|arguments|prototype|window|document" , // Pseudo "keyword": - "const|yield|import|get|set|async|await|foop|" + + "const|yield|import|get|set|async|await|" + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + "__parent__|__count__|escape|unescape|with|__proto__|" + diff --git a/package-lock.json b/package-lock.json index 099f14180..f49103202 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1903,7 +1903,6 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.2.4", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -5729,6 +5728,14 @@ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -5739,14 +5746,6 @@ "strip-ansi": "3.0.1" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -6368,6 +6367,14 @@ "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.6.tgz", "integrity": "sha1-kQ9dKu17Ugxud3SZwfMuE5/eyxA=" }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -6378,14 +6385,6 @@ "strip-ansi": "3.0.1" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -8687,468 +8686,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "optional": true, - "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "optional": true, - "requires": { - "minipass": "2.2.4" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "optional": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "optional": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "optional": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "optional": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "requires": { - "safe-buffer": "5.1.1", - "yallist": "3.0.2" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "optional": true, - "requires": { - "minipass": "2.2.4" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "optional": true, - "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.21", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "optional": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.0", - "nopt": "4.0.1", - "npm-packlist": "1.1.10", - "npmlog": "4.1.2", - "rc": "1.2.7", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.1" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "optional": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "optional": true, - "requires": { - "deep-extend": "0.5.1", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "optional": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "optional": true, - "requires": { - "chownr": "1.0.1", - "fs-minipass": "1.2.5", - "minipass": "2.2.4", - "minizlib": "1.1.0", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.1", - "yallist": "3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -12438,12 +11975,6 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", - "optional": true - }, "nanomatch": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", @@ -15232,7 +14763,7 @@ }, "should-equal": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/should-equal/-/should-equal-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-1.0.1.tgz", "integrity": "sha1-C26VFvJgGp+wuy3MNpr6HH4gCvc=", "dev": true, "requires": { @@ -15883,6 +15414,14 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, "string-template": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", @@ -15918,14 +15457,6 @@ } } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -16989,7 +16520,6 @@ "anymatch": "2.0.0", "async-each": "1.0.1", "braces": "2.3.1", - "fsevents": "1.2.4", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -17737,7 +17267,6 @@ "anymatch": "2.0.0", "async-each": "1.0.1", "braces": "2.3.2", - "fsevents": "1.2.4", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", diff --git a/src/Bladeburner.js b/src/Bladeburner.js index 312363f8b..daca05e91 100644 --- a/src/Bladeburner.js +++ b/src/Bladeburner.js @@ -3185,7 +3185,7 @@ function initBladeburner() { Skills[SkillNames.Overclock] = new Skill({ name:SkillNames.Overclock, desc:"Each level of this skill decreases the time it takes " + - "to attempt a contract or operation by 1% (Max Level: 99)", + "to attempt a contract or operation by 1% (Max Level: 95)", baseCost:5, costInc:1, maxLvl:95, actionTime:1 }); diff --git a/src/Constants.js b/src/Constants.js index b405ea9ed..3e665a663 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -1,5 +1,5 @@ let CONSTANTS = { - Version: "0.37.1", + Version: "0.37.2", //Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience //and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then @@ -484,16 +484,13 @@ let CONSTANTS = { "World Stock Exchange account and TIX API Access
", LatestUpdate: - "v0.37.1
" + - "* You now earn money from successfully completing Bladeburner contracts. The amount you earn is based " + - "on the difficulty of the contract.
" + - "* Completing Field Analysis in Bladeburner now grants 0.1 rank
" + - "* The maximum RAM you can get on a purchased server is now 1,048,576 GB (2^20)
" + - "* Bug Fix: Fixed Netscript syntax highlighting issues with the new NetscriptJS
" + - "* Bug Fix: Netscript Functions now properly incur RAM costs in NetscriptJS
" + - "* Bug Fix: deleteServer() now fails if its called on the server you are currently connected to
" + - "* Removed in-game Netscript documentation, since it was outdated and difficult to maintain.
" + - "* Bug Fix: Updated the gymWorkout() Singularity function with the new exp/cost values for gyms
" + "v0.37.2
" + + "* After joining the Bladeburners division, there is now a button to go to the Bladeburner content " + + "in the 'City' page
" + + "* You now start with $250m in BitNode-8 (increased from $100m)
" + + "* Bug Fix: You can now no longer directly edit Hacknet Node values through NetscriptJS (hopefully)
" + + "* Bug Fix: Bladeburners is no longer accessible in BN-8
" + + "* Bug Fix: getBitNodeMultipliers() Netscript function now returns a copy rather than the original object
" } export {CONSTANTS}; diff --git a/src/HacknetNode.js b/src/HacknetNode.js index 4c7597b73..8461dd58a 100644 --- a/src/HacknetNode.js +++ b/src/HacknetNode.js @@ -56,6 +56,7 @@ function HacknetNode(name) { this.moneyGainRatePerSecond = 0; } + HacknetNode.prototype.updateMoneyGainRate = function() { //How much extra $/s is gained per level var gainPerLevel = CONSTANTS.HacknetNodeMoneyGainPerLevel; @@ -180,6 +181,36 @@ HacknetNode.fromJSON = function(value) { Reviver.constructors.HacknetNode = HacknetNode; +var HacknetNodeWrapper = function(hacknetNodeObj) { + var _node = hacknetNodeObj; + return { + name : _node.name, + level : _node.level, + ram : _node.ram, + cores : _node.cores, + totalMoneyGenerated : _node.totalMoneyGenerated, + onlineTimeSeconds : _node.onlineTimeSeconds, + moneyGainRatePerSecond : _node.moneyGainRatePerSecond, + upgradeLevel : function(n) { + return _node.upgradeLevel(n); + }, + upgradeRam : function() { + return _node.upgradeRam(); + }, + upgradeCore : function() { + return _node.upgradeCore(); + }, + getLevelUpgradeCost : function(n) { + return _node.getLevelUpgradeCost(n); + }, + getRamUpgradeCost : function() { + return _node.getRamUpgradeCost(); + }, + getCoreUpgradeCost : function() { + return _node.getCoreUpgradeCost(); + } + } +} function purchaseHacknet() { /* INTERACTIVE TUTORIAL */ @@ -469,8 +500,31 @@ function updateHacknetNodeDomElement(nodeObj) { } } +function createPlayerHacknetNodeWrappers() { + Player.hacknetNodeWrappers.length = Player.hacknetNodes.length; + for (var i = 0; i < Player.hacknetNodes.length; ++i) { + Player.hacknetNodeWrappers[i] = new HacknetNodeWrapper(Player.hacknetNodes[i]); + } +} + +function updatePlayerHacknetNodeWrappers() { + if (Player.hacknetNodeWrappers.length !== Player.hacknetNodes.length) { + return createPlayerHacknetNodeWrappers(); + } + for (var i = 0; i < Player.hacknetNodeWrappers.length; ++i) { + if (!(Player.hacknetNodeWrappers[i] instanceof HacknetNodeWrapper)) {return createPlayerHacknetNodeWrappers();} + Player.hacknetNodeWrappers[i].level = Player.hacknetNodes[i].level; + Player.hacknetNodeWrappers[i].ram = Player.hacknetNodes[i].ram; + Player.hacknetNodeWrappers[i].cores = Player.hacknetNodes[i].cores; + Player.hacknetNodeWrappers[i].totalMoneyGenerated = Player.hacknetNodes[i].totalMoneyGenerated; + Player.hacknetNodeWrappers[i].onlineTimeSeconds = Player.hacknetNodes[i].onlineTimeSeconds; + Player.hacknetNodeWrappers[i].moneyGainRatePerSecond = Player.hacknetNodes[i].moneyGainRatePerSecond; + } +} + function processAllHacknetNodeEarnings(numCycles) { var total = 0; + updatePlayerHacknetNodeWrappers(); for (var i = 0; i < Player.hacknetNodes.length; ++i) { total += processSingleHacknetNodeEarnings(numCycles, Player.hacknetNodes[i]); } @@ -503,4 +557,4 @@ function getHacknetNode(name) { export {hacknetNodesInit, HacknetNode, purchaseHacknet, updateTotalHacknetProduction, getCostOfNextHacknetNode, updateHacknetNodesMultiplierButtons, getMaxNumberLevelUpgrades, displayHacknetNodesContent, updateHacknetNodesContent, processAllHacknetNodeEarnings, - getHacknetNode}; + getHacknetNode, createPlayerHacknetNodeWrappers}; diff --git a/src/Location.js b/src/Location.js index 65ad38c67..30e8bdf1c 100644 --- a/src/Location.js +++ b/src/Location.js @@ -726,6 +726,7 @@ function displayLocationContent() { securityJob.style.display = "block"; agentJob.style.display = "block"; if (Player.bitNodeN === 6 || hasBladeburnerSF === true) { + if (Player.bitNodeN === 8) {break;} if (Player.bladeburner instanceof Bladeburner) { //Note: Can't infiltrate NSA when part of bladeburner nsaBladeburner.innerText = "Enter Bladeburner Headquarters"; diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 9d3caa194..6e40dddbb 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -151,7 +151,7 @@ function NetscriptFunctions(workerScript) { Math : Math, Date : Date, Number : Number, - hacknetnodes : Player.hacknetNodes, + hacknetnodes : Player.hacknetNodeWrappers, sprintf : sprintf, vsprintf: vsprintf, scan : function(ip=workerScript.serverIp, hostnames=true){ @@ -1118,7 +1118,8 @@ function NetscriptFunctions(workerScript) { if (!hasAISF) { throw makeRuntimeRejectMsg(workerScript, "Cannot run getBitNodeMultipliers(). It requires Source-File 5 to run."); } - return BitNodeMultipliers; + let copy = Object.assign({}, BitNodeMultipliers); + return copy; }, getServerMoneyAvailable : function(ip){ if (workerScript.checkingRam) { diff --git a/src/Player.js b/src/Player.js index f61bbeb56..4d76c79de 100644 --- a/src/Player.js +++ b/src/Player.js @@ -99,6 +99,7 @@ function PlayerObject() { this.currentServer = ""; //IP address of Server currently being accessed through terminal this.purchasedServers = []; //IP Addresses of purchased servers this.hacknetNodes = []; + this.hacknetNodeWrappers = []; this.totalHacknetNodeProduction = 0; //Factions @@ -390,16 +391,8 @@ PlayerObject.prototype.prestigeSourceFile = function() { if (this.bitNodeN === 3) {this.money = new Decimal(150e9);} this.corporation = 0; - //Reset Bladeburner this.bladeburner = 0; - //BitNode 8: Ghost of Wall Street - if (this.bitNodeN === 8) {this.money = new Decimal(100000000);} - if (this.bitNodeN === 8 || hasWallStreetSF) { - this.hasWseAccount = true; - this.hasTixApiAccess = true; - } - this.playtimeSinceLastAug = 0; this.scriptProdSinceLastAug = 0; } diff --git a/src/Prestige.js b/src/Prestige.js index 2c3c68eae..51ba47355 100644 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -34,6 +34,8 @@ import {createPopup, createElement, import {yesNoBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js"; +let BitNode8StartingMoney = 250e6; + //Prestige by purchasing augmentation function prestigeAugmentation() { initBitNodeMultipliers(); @@ -127,7 +129,7 @@ function prestigeAugmentation() { Player.bladeburner = null; //BitNode 8: Ghost of Wall Street - if (Player.bitNodeN === 8) {Player.money = new Decimal(100e6);} + if (Player.bitNodeN === 8) {Player.money = new Decimal(BitNode8StartingMoney);} if (Player.bitNodeN === 8 || hasWallStreetSF) { Player.hasWseAccount = true; Player.hasTixApiAccess = true; @@ -305,6 +307,13 @@ function prestigeSourceFile() { } + //BitNode 8: Ghost of Wall Street + if (Player.bitNodeN === 8) {Player.money = new Decimal(BitNode8StartingMoney);} + if (Player.bitNodeN === 8 || hasWallStreetSF) { + Player.hasWseAccount = true; + Player.hasTixApiAccess = true; + } + //Gain int exp Player.gainIntelligenceExp(5); } diff --git a/src/SaveObject.js b/src/SaveObject.js index 6d1340009..244c8820c 100644 --- a/src/SaveObject.js +++ b/src/SaveObject.js @@ -8,7 +8,8 @@ import {loadFactions, Factions, processPassiveFactionRepGain} from "./Faction.js"; import {FconfSettings, loadFconf} from "./Fconf.js"; import {loadAllGangs, AllGangs} from "./Gang.js"; -import {processAllHacknetNodeEarnings} from "./HacknetNode.js"; +import {processAllHacknetNodeEarnings, + createPlayerHacknetNodeWrappers} from "./HacknetNode.js"; import {loadMessages, initMessages, Messages} from "./Message.js"; import {Player, loadPlayer} from "./Player.js"; import {loadAllRunningScripts} from "./Script.js"; @@ -227,6 +228,8 @@ function loadGame(saveString) { } } + //Re-initialize Hacknet Node Wrappers + createPlayerHacknetNodeWrappers(); return true; } @@ -443,6 +446,9 @@ function loadImportedGame(saveObj, saveString) { } } + //Re-initialize Hacknet Node Wrappers + createPlayerHacknetNodeWrappers(); + var popupId = "import-game-restart-game-notice"; var txt = createElement("p", { innerText:"Imported game! I would suggest saving the game and then reloading the page " + diff --git a/src/Script.js b/src/Script.js index 8b7b1ee7f..4fe9d6c58 100644 --- a/src/Script.js +++ b/src/Script.js @@ -484,6 +484,7 @@ function parseOnlyRamCalculate(server, code, workerScript) { // onto the main reference map, and a list of modules that need to be parsed. function parseOnlyCalculateDeps(code, currentModule) { const ast = parse(code, {sourceType:"module", ecmaVersion: 8}); + console.log(ast); // Everything from the global scope goes in ".". Everything else goes in ".function", where only // the outermost layer of functions counts. diff --git a/src/StockMarket.js b/src/StockMarket.js index eef9d5e47..9c9a6b6b3 100644 --- a/src/StockMarket.js +++ b/src/StockMarket.js @@ -703,7 +703,7 @@ function displayStockMarketContent() { if (!Player.hasWseAccount && Player.money.gte(CONSTANTS.WSEAccountCost)) { wseAccountButton.setAttribute("class", "a-link-button"); } else if (Player.hasWseAccount){ - wseAccountButton.innerText = "WSE Account - acquired"; + wseAccountButton.innerText = "WSE Account - Purchased"; wseAccountButton.setAttribute("class", "a-link-button-bought"); } else { wseAccountButton.setAttribute("class", "a-link-button-inactive"); @@ -724,7 +724,7 @@ function displayStockMarketContent() { if (!Player.hasTixApiAccess && Player.money.gte(CONSTANTS.TIXAPICost)) { tixApiAccessButton.setAttribute("class", "a-link-button"); } else if(Player.hasTixApiAccess) { - tixApiAccessButton.innerText = "Trade Information eXchange (TIX) API Access - granted" + tixApiAccessButton.innerText = "Trade Information eXchange (TIX) API Access - Purchased" tixApiAccessButton.setAttribute("class", "a-link-button-bought"); } else { tixApiAccessButton.setAttribute("class", "a-link-button-inactive"); diff --git a/src/engine.js b/src/engine.js index dd0845bc7..d913f3952 100644 --- a/src/engine.js +++ b/src/engine.js @@ -650,6 +650,7 @@ let Engine = { //Generic Locations (common to every city): // World Stock Exchange // Corporation (if applicable) + // Bladeburner HQ (if applicable); var genericLocationsList = document.getElementById("generic-locations-list"); genericLocationsList.style.display = "inline"; removeChildrenFromElement(genericLocationsList); @@ -676,6 +677,18 @@ let Engine = { })); genericLocationsList.appendChild(li); } + + if (Player.bladeburner instanceof Bladeburner) { + var li = createElement("li"); + li.appendChild(createElement("a", { + innerText:"Bladeburner Headquarters", class:"a-link-button", + clickListener:()=>{ + Engine.loadBladeburnerContent(); + return false; + } + })); + genericLocationsList.appendChild(li); + } }, displayFactionsInfo: function() {