Player starts with 8GB of RAM on home. scan-analyze displays RAM. Increased percentage money hacked

This commit is contained in:
Daniel Xie 2017-05-24 00:05:31 -05:00
parent 5d415a1a60
commit f756f09dbe
5 changed files with 9 additions and 7 deletions

@ -15,10 +15,10 @@ CONSTANTS = {
BaseCostFor1GBOfRamHacknetNode: 30000, BaseCostFor1GBOfRamHacknetNode: 30000,
BaseCostForHacknetNode: 1000, BaseCostForHacknetNode: 1000,
BaseCostForHacknetNodeCore: 400000, BaseCostForHacknetNodeCore: 500000,
/* Hacknet Node constants */ /* Hacknet Node constants */
HacknetNodeMoneyGainPerLevel: 1.25, HacknetNodeMoneyGainPerLevel: 1.5,
HacknetNodePurchaseNextMult: 1.33, //Multiplier when purchasing an additional hacknet node HacknetNodePurchaseNextMult: 1.33, //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.22, //Multiplier for cost when upgrading RAM HacknetNodeUpgradeRamMult: 1.22, //Multiplier for cost when upgrading RAM

@ -50,7 +50,7 @@ HacknetNode.prototype.updateMoneyGainRate = function() {
this.moneyGainRatePerSecond = (this.level * gainPerLevel) * this.moneyGainRatePerSecond = (this.level * gainPerLevel) *
Math.pow(1.04, this.ram-1) * Math.pow(1.04, this.ram-1) *
((this.numCores + 1) / 2) * Player.hacknet_node_money_mult; ((this.numCores + 3) / 4) * Player.hacknet_node_money_mult;
if (isNaN(this.moneyGainRatePerSecond)) { if (isNaN(this.moneyGainRatePerSecond)) {
this.moneyGainRatePerSecond = 0; this.moneyGainRatePerSecond = 0;
dialogBoxCreate("Error in calculating Hacknet Node production. Please report to game developer"); dialogBoxCreate("Error in calculating Hacknet Node production. Please report to game developer");

@ -745,6 +745,7 @@ function evaluate(exp, workerScript) {
if (cost > Player.money) { if (cost > Player.money) {
workerScript.scriptRef.log("Could not afford to purchase new Hacknet Node"); workerScript.scriptRef.log("Could not afford to purchase new Hacknet Node");
resolve(""); resolve("");
return;
} }
//Auto generate a name for the node for now...TODO //Auto generate a name for the node for now...TODO
@ -1127,7 +1128,7 @@ function scriptCalculateExpGain(server) {
function scriptCalculatePercentMoneyHacked(server) { function scriptCalculatePercentMoneyHacked(server) {
var difficultyMult = (100 - server.hackDifficulty) / 100; var difficultyMult = (100 - server.hackDifficulty) / 100;
var skillMult = (Player.hacking_skill - (server.requiredHackingSkill - 1)) / Player.hacking_skill; var skillMult = (Player.hacking_skill - (server.requiredHackingSkill - 1)) / Player.hacking_skill;
var percentMoneyHacked = difficultyMult * skillMult * Player.hacking_money_mult / 950; var percentMoneyHacked = difficultyMult * skillMult * Player.hacking_money_mult / 875;
if (percentMoneyHacked < 0) {return 0;} if (percentMoneyHacked < 0) {return 0;}
if (percentMoneyHacked > 1) {return 1;} if (percentMoneyHacked > 1) {return 1;}
return percentMoneyHacked; return percentMoneyHacked;

@ -176,7 +176,7 @@ function PlayerObject() {
PlayerObject.prototype.init = function() { PlayerObject.prototype.init = function() {
/* Initialize Player's home computer */ /* Initialize Player's home computer */
var t_homeComp = new Server(); var t_homeComp = new Server();
t_homeComp.init(createRandomIp(), "home", "Home PC", true, true, true, true, 2); t_homeComp.init(createRandomIp(), "home", "Home PC", true, true, true, true, 8);
this.homeComputer = t_homeComp.ip; this.homeComputer = t_homeComp.ip;
this.currentServer = t_homeComp.ip; this.currentServer = t_homeComp.ip;
AddToAllServers(t_homeComp); AddToAllServers(t_homeComp);
@ -243,7 +243,7 @@ PlayerObject.prototype.calculateHackingTime = function() {
PlayerObject.prototype.calculatePercentMoneyHacked = function() { PlayerObject.prototype.calculatePercentMoneyHacked = function() {
var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100; var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100;
var skillMult = (this.hacking_skill - (this.getCurrentServer().requiredHackingSkill - 1)) / this.hacking_skill; var skillMult = (this.hacking_skill - (this.getCurrentServer().requiredHackingSkill - 1)) / this.hacking_skill;
var percentMoneyHacked = difficultyMult * skillMult * this.hacking_money_mult / 950; var percentMoneyHacked = difficultyMult * skillMult * this.hacking_money_mult / 875;
console.log("Percent money hacked calculated to be: " + percentMoneyHacked); console.log("Percent money hacked calculated to be: " + percentMoneyHacked);
if (percentMoneyHacked < 0) {return 0;} if (percentMoneyHacked < 0) {return 0;}
if (percentMoneyHacked > 1) {return 1;} if (percentMoneyHacked > 1) {return 1;}

@ -851,7 +851,8 @@ var Terminal = {
if (serv.hasAdminRights) {c = "Y";} if (serv.hasAdminRights) {c = "Y";}
post("--Root Access: " + c); post("--Root Access: " + c);
post("--Required hacking skill: " + serv.requiredHackingSkill); post("--Required hacking skill: " + serv.requiredHackingSkill);
post("--Number open ports required to NUKE: " + serv.numOpenPortsRequired); post("--Number of open ports required to NUKE: " + serv.numOpenPortsRequired);
post("--RAM: " + serv.maxRam);
post(" "); post(" ");
} }
}, },