Skip to content

Commit

Permalink
Merge pull request #269 from danielyxie/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
danielyxie authored Jun 3, 2018
2 parents 25be246 + 5caa247 commit e218311
Show file tree
Hide file tree
Showing 25 changed files with 8,219 additions and 12,765 deletions.
21 changes: 21 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,27 @@ a:link, a:visited {
pointer-events: none;
}

/* Make anchor tags ("a" elements) for activated actions */
.a-link-button-bought {
text-decoration: none;
background-color: #00AA00;
color: #FFFFFF;
padding: 5px;
margin: 5px;
border: 1px solid #00AA00;
cursor: default;
}

.a-link-button-bought:hover .tooltiptext,
.a-link-button-bought:hover .tooltiptexthigh,
.a-link-button-bought:hover .tooltiptextleft {
visibility: visible;
}

.a-link-button-bought:active {
pointer-events: none;
}

/* Notification icon (for create program right now only) */
#create-program-tab {
position:relative;
Expand Down
7,983 changes: 4,023 additions & 3,960 deletions dist/engine.bundle.js

Large diffs are not rendered by default.

7,965 changes: 4,014 additions & 3,951 deletions dist/tests.bundle.js

Large diffs are not rendered by default.

Binary file modified doc/build/doctrees/changelog.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/environment.pickle
Binary file not shown.
14 changes: 12 additions & 2 deletions doc/build/html/_sources/changelog.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
Changelog
=========

v0.37.1
-------
v0.37.2 - 6/2/2018
------------------

* 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

v0.37.1 - 5/22/2018
-------------------
* 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
Expand Down
18 changes: 15 additions & 3 deletions doc/build/html/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,19 @@

<div class="section" id="changelog">
<span id="id1"></span><h1>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline"></a></h1>
<div class="section" id="v0-37-1">
<h2>v0.37.1<a class="headerlink" href="#v0-37-1" title="Permalink to this headline"></a></h2>
<div class="section" id="v0-37-2-6-2-2018">
<h2>v0.37.2 - 6/2/2018<a class="headerlink" href="#v0-37-2-6-2-2018" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>After joining the Bladeburners division, there is now a button to go to the Bladeburner content
in the 'City' page</li>
<li>You now start with $250m in BitNode-8 (increased from $100m)</li>
<li>Bug Fix: You can now no longer directly edit Hacknet Node values through NetscriptJS (hopefully)</li>
<li>Bug Fix: Bladeburners is no longer accessible in BN-8</li>
<li>Bug Fix: getBitNodeMultipliers() Netscript function now returns a copy rather than the original object</li>
</ul>
</div>
<div class="section" id="v0-37-1-5-22-2018">
<h2>v0.37.1 - 5/22/2018<a class="headerlink" href="#v0-37-1-5-22-2018" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>You now earn money from successfully completing Bladeburner contracts. The amount you earn is based
on the difficulty of the contract.</li>
Expand Down Expand Up @@ -971,7 +982,8 @@ <h3>Table Of Contents</h3>
<li class="toctree-l1"><a class="reference internal" href="terminal.html"> Terminal</a></li>
<li class="toctree-l1"><a class="reference internal" href="shortcuts.html"> Keyboard Shortcuts</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#"> Changelog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#v0-37-1">v0.37.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="#v0-37-2-6-2-2018">v0.37.2 - 6/2/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="#v0-37-1-5-22-2018">v0.37.1 - 5/22/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="#v0-37-0-5-20-2018">v0.37.0 - 5/20/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="#v0-36-1-5-11-2018">v0.36.1 - 5/11/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="#v0-36-0-5-2-2018">v0.36.0 - 5/2/2018</a></li>
Expand Down
3 changes: 2 additions & 1 deletion doc/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ <h2>What is Bitburner?<a class="headerlink" href="#what-is-bitburner" title="Per
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html"> Changelog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v0-37-1">v0.37.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v0-37-2-6-2-2018">v0.37.2 - 6/2/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v0-37-1-5-22-2018">v0.37.1 - 5/22/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v0-37-0-5-20-2018">v0.37.0 - 5/20/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v0-36-1-5-11-2018">v0.36.1 - 5/11/2018</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v0-36-0-5-2-2018">v0.36.0 - 5/2/2018</a></li>
Expand Down
2 changes: 1 addition & 1 deletion doc/build/html/searchindex.js

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
Changelog
=========

v0.37.1
-------
v0.37.2 - 6/2/2018
------------------

* 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

v0.37.1 - 5/22/2018
-------------------
* 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
Expand Down
2 changes: 1 addition & 1 deletion netscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,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__|" +
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"async": "^2.1.2",
"bluebird": "^3.5.1",
"brace": "^0.11.1",
"decimal.js": "7.2.3",
"enhanced-resolve": "^3.4.0",
"escope": "^3.6.0",
"file-saver": "^1.3.3",
Expand Down
2 changes: 1 addition & 1 deletion src/Bladeburner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion src/CompanyManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {showLiterature} from "./Literature.js";
import {Locations} from "./Location.js";
import {Player} from "./Player.js";

import Decimal from '../utils/decimal.js';
import Decimal from "decimal.js";
import {dialogBoxCreate} from "../utils/DialogBox.js";
import {getRandomInt, removeElementById,
createElement, createAccordionElement,
Expand Down
19 changes: 8 additions & 11 deletions src/Constants.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -484,16 +484,13 @@ let CONSTANTS = {
"World Stock Exchange account and TIX API Access<br>",

LatestUpdate:
"v0.37.1<br>" +
"* You now earn money from successfully completing Bladeburner contracts. The amount you earn is based " +
"on the difficulty of the contract.<br>" +
"* Completing Field Analysis in Bladeburner now grants 0.1 rank<br>" +
"* The maximum RAM you can get on a purchased server is now 1,048,576GB (2^20)<br>" +
"* Bug Fix: Fixed Netscript syntax highlighting issues with the new NetscriptJS<br>" +
"* Bug Fix: Netscript Functions now properly incur RAM costs in NetscriptJS<br>" +
"* Bug Fix: deleteServer() now fails if its called on the server you are currently connected to<br>" +
"* Removed in-game Netscript documentation, since it was outdated and difficult to maintain.<br>" +
"* Bug Fix: Updated the gymWorkout() Singularity function with the new exp/cost values for gyms<br>"
"v0.37.2<br>" +
"* After joining the Bladeburners division, there is now a button to go to the Bladeburner content " +
"in the 'City' page<br>" +
"* You now start with $250m in BitNode-8 (increased from $100m)<br>" +
"* Bug Fix: You can now no longer directly edit Hacknet Node values through NetscriptJS (hopefully)<br>" +
"* Bug Fix: Bladeburners is no longer accessible in BN-8<br>" +
"* Bug Fix: getBitNodeMultipliers() Netscript function now returns a copy rather than the original object<br>"
}

export {CONSTANTS};
56 changes: 55 additions & 1 deletion src/HacknetNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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]);
}
Expand Down Expand Up @@ -503,4 +557,4 @@ function getHacknetNode(name) {
export {hacknetNodesInit, HacknetNode, purchaseHacknet, updateTotalHacknetProduction,
getCostOfNextHacknetNode, updateHacknetNodesMultiplierButtons, getMaxNumberLevelUpgrades,
displayHacknetNodesContent, updateHacknetNodesContent, processAllHacknetNodeEarnings,
getHacknetNode};
getHacknetNode, createPlayerHacknetNodeWrappers};
1 change: 1 addition & 0 deletions src/Location.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
7 changes: 4 additions & 3 deletions src/NetscriptFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import {makeRuntimeRejectMsg, netscriptDelay, runScriptFromScript,
import {Environment} from "./NetscriptEnvironment.js";
import {NetscriptPort} from "./NetscriptPort.js";

import Decimal from '../utils/decimal.js';
import Decimal from "decimal.js";
import {dialogBoxCreate} from "../utils/DialogBox.js";
import {printArray, powerOfTwo} from "../utils/HelperFunctions.js";
import {createRandomIp} from "../utils/IPAddress.js";
Expand Down Expand Up @@ -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){
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 2 additions & 9 deletions src/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {AllServers, Server, AddToAllServers} from "./Server.js";
import {SpecialServerIps, SpecialServerNames} from "./SpecialServerIps.js";
import {SourceFiles, applySourceFile} from "./SourceFile.js";

import Decimal from '../utils/decimal.js';
import Decimal from "decimal.js";
import {dialogBoxCreate} from "../utils/DialogBox.js";
import {clearEventListeners} from "../utils/HelperFunctions.js";
import {createRandomIp} from "../utils/IPAddress.js";
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
13 changes: 11 additions & 2 deletions src/Prestige.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ import {initStockMarket, initSymbolToStockMap,
stockMarketContentCreated,
setStockMarketContentCreated} from "./StockMarket.js";
import {Terminal, postNetburnerText} from "./Terminal.js";
import Decimal from '../utils/decimal.js';
import Decimal from "decimal.js";
import {dialogBoxCreate} from "../utils/DialogBox.js";
import {createPopup, createElement,
removeElementById, exceptionAlert} from "../utils/HelperFunctions.js";
import {yesNoBoxCreate, yesNoBoxGetYesButton,
yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js";

let BitNode8StartingMoney = 250e6;

//Prestige by purchasing augmentation
function prestigeAugmentation() {
initBitNodeMultipliers();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Loading

0 comments on commit e218311

Please sign in to comment.