Slightly buffed hacknet nodes

This commit is contained in:
Daniel Xie 2017-06-01 08:36:49 -05:00
parent b53abeb280
commit 6ff028b5ea
6 changed files with 9 additions and 22 deletions

@ -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;

@ -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

@ -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;

@ -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 + ":<br>" + e);
workerScripts[i].env.stopFlag = true;
continue;
}

@ -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;
}

@ -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) */