mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Slightly buffed hacknet nodes
This commit is contained in:
parent
b53abeb280
commit
6ff028b5ea
@ -12,20 +12,6 @@
|
|||||||
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
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 {
|
.dialog-box-container {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -18,7 +18,7 @@ CONSTANTS = {
|
|||||||
BaseCostForHacknetNodeCore: 500000,
|
BaseCostForHacknetNodeCore: 500000,
|
||||||
|
|
||||||
/* Hacknet Node constants */
|
/* Hacknet Node constants */
|
||||||
HacknetNodeMoneyGainPerLevel: 1.5,
|
HacknetNodeMoneyGainPerLevel: 1.6,
|
||||||
HacknetNodePurchaseNextMult: 1.39, //Multiplier when purchasing an additional hacknet node
|
HacknetNodePurchaseNextMult: 1.39, //Multiplier when purchasing an additional hacknet node
|
||||||
HacknetNodeUpgradeLevelMult: 1.04, //Multiplier for cost when upgrading level
|
HacknetNodeUpgradeLevelMult: 1.04, //Multiplier for cost when upgrading level
|
||||||
HacknetNodeUpgradeRamMult: 1.26, //Multiplier for cost when upgrading RAM
|
HacknetNodeUpgradeRamMult: 1.26, //Multiplier for cost when upgrading RAM
|
||||||
|
@ -49,7 +49,7 @@ HacknetNode.prototype.updateMoneyGainRate = function() {
|
|||||||
var gainPerLevel = CONSTANTS.HacknetNodeMoneyGainPerLevel;
|
var gainPerLevel = CONSTANTS.HacknetNodeMoneyGainPerLevel;
|
||||||
|
|
||||||
this.moneyGainRatePerSecond = (this.level * gainPerLevel) *
|
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;
|
((this.numCores + 5) / 6) * Player.hacknet_node_money_mult;
|
||||||
if (isNaN(this.moneyGainRatePerSecond)) {
|
if (isNaN(this.moneyGainRatePerSecond)) {
|
||||||
this.moneyGainRatePerSecond = 0;
|
this.moneyGainRatePerSecond = 0;
|
||||||
|
@ -33,7 +33,7 @@ function runScriptsLoop() {
|
|||||||
var ast = Parser(Tokenizer(InputStream(workerScripts[i].code)));
|
var ast = Parser(Tokenizer(InputStream(workerScripts[i].code)));
|
||||||
//console.log(ast);
|
//console.log(ast);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dialogBoxCreate("Syntax ERROR in " + workerScripts[i].name + ":", e, "", "");
|
dialogBoxCreate("Syntax ERROR in " + workerScripts[i].name + ":<br>" + e);
|
||||||
workerScripts[i].env.stopFlag = true;
|
workerScripts[i].env.stopFlag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ scriptCalculateOfflineProduction = function(script) {
|
|||||||
if (serv == null) {continue;}
|
if (serv == null) {continue;}
|
||||||
var timesHacked = Math.round(0.5 * script.numTimesHackMap[ip] / script.onlineRunningTime * timePassed);
|
var timesHacked = Math.round(0.5 * script.numTimesHackMap[ip] / script.onlineRunningTime * timePassed);
|
||||||
console.log(script.filename + " hacked " + serv.hostname + " " + timesHacked + " times while offline");
|
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);
|
serv.fortify(CONSTANTS.ServerFortifyAmount * timesHacked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ scriptCalculateOfflineProduction = function(script) {
|
|||||||
if (serv == null) {continue;}
|
if (serv == null) {continue;}
|
||||||
var timesWeakened = Math.round(0.5 * script.numTimesWeakenMap[ip] / script.onlineRunningTime * timePassed);
|
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");
|
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);
|
serv.weaken(CONSTANTS.ServerWeakenAmount * timesWeakened);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,12 +432,12 @@ scriptCalculateOfflineProduction = function(script) {
|
|||||||
if (serv == null) {continue;}
|
if (serv == null) {continue;}
|
||||||
var timesGrown = Math.round(0.5 * script.numTimesGrowMap[ip] / script.onlineRunningTime * timePassed);
|
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");
|
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");
|
script.log("Called grow() on " + serv.hostname + " " + timesGrown + " times while offline");
|
||||||
//TODO
|
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;
|
return totalOfflineProduction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ function Server() {
|
|||||||
this.scripts = [];
|
this.scripts = [];
|
||||||
this.runningScripts = []; //Names (and only names) of scripts being run
|
this.runningScripts = []; //Names (and only names) of scripts being run
|
||||||
this.programs = [];
|
this.programs = [];
|
||||||
|
this.messages = [];
|
||||||
|
|
||||||
/* Hacking information (only valid for "foreign" aka non-purchased servers) */
|
/* Hacking information (only valid for "foreign" aka non-purchased servers) */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user