Added function to calculate Player's hacking skill based on exp

This commit is contained in:
Daniel Xie 2016-10-21 16:15:45 -05:00
parent 4517020719
commit 0b7f19fd8c

@ -54,4 +54,11 @@ var Player = {
Player.homeComputer.init("19.42.93.219", "home", "Home PC", true, true, true, true, 1); Player.homeComputer.init("19.42.93.219", "home", "Home PC", true, true, true, true, 1);
Player.currentServer = Player.homeComputer; Player.currentServer = Player.homeComputer;
} }
//Calculates hacking skill based on experience
// At the maximum possible exp (MAX_INT = 9007199254740991), the hacking skill will by 1796
// Gets to level 1000 hacking skill at ~1,100,000,000 exp
calculateHackingSkill: function(exp) {
return Math.max(Math.floor(50 * log(9007199254740991+ 2.270) - 40), 1);
}
}; };