diff --git a/css/popupboxes.css b/css/popupboxes.css
index 61035e963..4cb5d64cd 100644
--- a/css/popupboxes.css
+++ b/css/popupboxes.css
@@ -12,20 +12,6 @@
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
-/*
-.dialog-box-container {
- display: block;
- position: relative;
- z-index: 2;
- margin: auto;
- width: 50%;
- height: 100%;
- vertical-align: middle;
- overflow: auto;
- background-color: black;
- background-color: rgba(0,0,0,0.4);
-}
-*/
.dialog-box-container {
display: block;
position: absolute;
diff --git a/src/Constants.js b/src/Constants.js
index b7dac29c7..1f21a026a 100644
--- a/src/Constants.js
+++ b/src/Constants.js
@@ -1,5 +1,5 @@
CONSTANTS = {
- Version: "0.18.2",
+ Version: "0.18.3",
//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
@@ -18,7 +18,7 @@ CONSTANTS = {
BaseCostForHacknetNodeCore: 500000,
/* Hacknet Node constants */
- HacknetNodeMoneyGainPerLevel: 1.5,
+ HacknetNodeMoneyGainPerLevel: 1.6,
HacknetNodePurchaseNextMult: 1.39, //Multiplier when purchasing an additional hacknet node
HacknetNodeUpgradeLevelMult: 1.04, //Multiplier for cost when upgrading level
HacknetNodeUpgradeRamMult: 1.26, //Multiplier for cost when upgrading RAM
@@ -247,7 +247,11 @@ CONSTANTS = {
"It is important to note that for this reason, conditionals such as if/else statements and certain " +
"commands such as purchaseHacknetNode() or nuke() will not work while the game is offline.
" +
"However, Scripts WILL continue to generate money and hacking exp for you while the game is offline. This " +
- "offline production is based off of the scripts' production while the game is online.
" +
+ "offline production is based off of the scripts' production while the game is online.
" +
+ "grow() and weaken() are two Netscript commands that will also be applied when the game is offline, although at a slower rate " +
+ "compared to if the game was open. This is done by having each script keep track of the " +
+ "rate at which the grow() and weaken() commands are called when the game is online. These calculated rates are used to determine how many times " +
+ "these function calls would be made while the game is offline.
" +
"Also, note that because of the way the Netscript interpreter is implemented, " +
"whenever you reload or re-open the game all of the scripts that you are running will " +
"start running from the BEGINNING of the code. The game does not keep track of where exactly " +
@@ -291,10 +295,10 @@ CONSTANTS = {
"grow(hostname/ip)
Use your hacking skills to increase the amount of money available on a server. The argument passed in " +
"must be a string with either the IP or hostname of the target server. The grow() command requires root access to the target server, but " +
"there is no required hacking level to run the command. " +
- "Grants 1 hacking exp when it completes.
Example: grow('foodnstuff');
" +
+ "Grants 1 hacking exp when it completes. Works offline at a slower rate.
Example: grow('foodnstuff');
" +
"weaken(hostname/ip)
Use your hacking skills to attack a server's security, lowering the server's security level. The argument passed " +
"in must be a string with either the IP or hostname of the target server. This command requires root access to the target server, but " +
- "there is no required hacking level to run the command. Grants 5 hacking exp when it completes.
Example: weaken('foodnstuff');
" +
+ "there is no required hacking level to run the command. Grants 5 hacking exp when it completes. Works offline at a slower rate
Example: weaken('foodnstuff');
" +
"print(x)
Prints a value or a variable to the scripts logs (which can be viewed with the 'tail [script]' terminal command )
" +
"nuke(hostname/ip)
Run NUKE.exe on the target server. NUKE.exe must exist on your home computer. Does NOT work while offline
Example: nuke('foodnstuff');
" +
"brutessh(hostname/ip)
Run BruteSSH.exe on the target server. BruteSSH.exe must exist on your home computer. Does NOT work while offline
Example: brutessh('foodnstuff');
" +
diff --git a/src/HacknetNode.js b/src/HacknetNode.js
index 747ded83d..728229cce 100644
--- a/src/HacknetNode.js
+++ b/src/HacknetNode.js
@@ -49,7 +49,7 @@ HacknetNode.prototype.updateMoneyGainRate = function() {
var gainPerLevel = CONSTANTS.HacknetNodeMoneyGainPerLevel;
this.moneyGainRatePerSecond = (this.level * gainPerLevel) *
- Math.pow(1.03, this.ram-1) *
+ Math.pow(1.035, this.ram-1) *
((this.numCores + 5) / 6) * Player.hacknet_node_money_mult;
if (isNaN(this.moneyGainRatePerSecond)) {
this.moneyGainRatePerSecond = 0;
@@ -76,7 +76,7 @@ HacknetNode.prototype.purchaseLevelUpgrade = function(levels=1) {
if (isNaN(cost)) {return false;}
if (cost > Player.money) {return false;}
Player.loseMoney(cost);
- if (this.level + levels >= CONSTANTS.HacknetNodeMaxLevel) {
+ if (this.level + levels > CONSTANTS.HacknetNodeMaxLevel) {
var diff = Math.max(0, CONSTANTS.HacknetNodeMaxLevel - this.level);
return this.purchaseLevelUpgrade(diff);
}
diff --git a/src/NetscriptWorker.js b/src/NetscriptWorker.js
index 8560f3030..b7b786623 100644
--- a/src/NetscriptWorker.js
+++ b/src/NetscriptWorker.js
@@ -33,7 +33,7 @@ function runScriptsLoop() {
var ast = Parser(Tokenizer(InputStream(workerScripts[i].code)));
//console.log(ast);
} catch (e) {
- dialogBoxCreate("Syntax ERROR in " + workerScripts[i].name + ":", e, "", "");
+ dialogBoxCreate("Syntax ERROR in " + workerScripts[i].name + ":
" + e);
workerScripts[i].env.stopFlag = true;
continue;
}
diff --git a/src/Script.js b/src/Script.js
index d79e853bb..26ae7fb12 100644
--- a/src/Script.js
+++ b/src/Script.js
@@ -406,7 +406,7 @@ scriptCalculateOfflineProduction = function(script) {
if (serv == null) {continue;}
var timesHacked = Math.round(0.5 * script.numTimesHackMap[ip] / script.onlineRunningTime * timePassed);
console.log(script.filename + " hacked " + serv.hostname + " " + timesHacked + " times while offline");
- script.log(script.filename + " hacked " + serv.hostname + " " + timesHacked + " times while offline");
+ script.log("Hacked " + serv.hostname + " " + timesHacked + " times while offline");
serv.fortify(CONSTANTS.ServerFortifyAmount * timesHacked);
}
}
@@ -419,7 +419,7 @@ scriptCalculateOfflineProduction = function(script) {
if (serv == null) {continue;}
var timesWeakened = Math.round(0.5 * script.numTimesWeakenMap[ip] / script.onlineRunningTime * timePassed);
console.log(script.filename + " called weaken() on " + serv.hostname + " " + timesWeakened + " times while offline");
- script.log(script.filename + " called weaken() on " + serv.hostname + " " + timesWeakened + " times while offline");
+ script.log("Called weaken() on " + serv.hostname + " " + timesWeakened + " times while offline");
serv.weaken(CONSTANTS.ServerWeakenAmount * timesWeakened);
}
}
@@ -432,12 +432,12 @@ scriptCalculateOfflineProduction = function(script) {
if (serv == null) {continue;}
var timesGrown = Math.round(0.5 * script.numTimesGrowMap[ip] / script.onlineRunningTime * timePassed);
console.log(script.filename + " called grow() on " + serv.hostname + " " + timesGrown + " times while offline");
- script.log(script.filename + " called grow() on " + serv.hostname + " " + timesGrown + " times while offline");
- //TODO
+ script.log("Called grow() on " + serv.hostname + " " + timesGrown + " times while offline");
+ var growth = processSingleServerGrowth(serv, timesGrown * 450);
+ script.log(serv.hostname + " grown by " + formatNumber(growth * 100 - 100, 6) + "% from grow() calls made while offline");
}
}
-
return totalOfflineProduction;
}
diff --git a/src/Server.js b/src/Server.js
index 35922c3f4..780212254 100644
--- a/src/Server.js
+++ b/src/Server.js
@@ -22,6 +22,7 @@ function Server() {
this.scripts = [];
this.runningScripts = []; //Names (and only names) of scripts being run
this.programs = [];
+ this.messages = [];
/* Hacking information (only valid for "foreign" aka non-purchased servers) */