Merge pull request #129 from danielyxie/dev

Added javascript math module
This commit is contained in:
danielyxie 2017-09-11 18:32:14 -05:00 committed by GitHub
commit dee665b106
4 changed files with 6 additions and 2 deletions

4
dist/bundle.js vendored

@ -1343,7 +1343,7 @@ PlayerObject.prototype.startClass = function(costMult, expMult, className) {
agiExp = baseGymExp * expMult / gameCPS; agiExp = baseGymExp * expMult / gameCPS;
break; break;
default: default:
throw new Error("ERR: Invalid/recognized class name"); throw new Error("ERR: Invalid/unrecognized class name");
return; return;
} }
@ -3333,6 +3333,7 @@ let CONSTANTS = {
LatestUpdate: LatestUpdate:
"v0.28.4<br>" + "v0.28.4<br>" +
"-Added getScriptIncome() Netscript function<br>" + "-Added getScriptIncome() Netscript function<br>" +
"-Added Javascript's Math module to Netscript. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math<br>" +
"-Added several member variables for the Hacknet Node API that allow you to access info about their income<br>" + "-Added several member variables for the Hacknet Node API that allow you to access info about their income<br>" +
"-All valid Netscript functions are now syntax highlighted as keywords in the editor. This means they will a different " + "-All valid Netscript functions are now syntax highlighted as keywords in the editor. This means they will a different " +
"color than invalid netscript functions. The color will depend on your theme. " + "color than invalid netscript functions. The color will depend on your theme. " +
@ -34860,6 +34861,7 @@ function initSingularitySFFlags() {
function NetscriptFunctions(workerScript) { function NetscriptFunctions(workerScript) {
return { return {
Math : Math,
hacknetnodes : __WEBPACK_IMPORTED_MODULE_11__Player_js__["a" /* Player */].hacknetNodes, hacknetnodes : __WEBPACK_IMPORTED_MODULE_11__Player_js__["a" /* Player */].hacknetNodes,
scan : function(ip=workerScript.serverIp){ scan : function(ip=workerScript.serverIp){
var server = Object(__WEBPACK_IMPORTED_MODULE_13__Server_js__["e" /* getServer */])(ip); var server = Object(__WEBPACK_IMPORTED_MODULE_13__Server_js__["e" /* getServer */])(ip);

@ -877,6 +877,7 @@ let CONSTANTS = {
LatestUpdate: LatestUpdate:
"v0.28.4<br>" + "v0.28.4<br>" +
"-Added getScriptIncome() Netscript function<br>" + "-Added getScriptIncome() Netscript function<br>" +
"-Added Javascript's Math module to Netscript. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math<br>" +
"-Added several member variables for the Hacknet Node API that allow you to access info about their income<br>" + "-Added several member variables for the Hacknet Node API that allow you to access info about their income<br>" +
"-All valid Netscript functions are now syntax highlighted as keywords in the editor. This means they will a different " + "-All valid Netscript functions are now syntax highlighted as keywords in the editor. This means they will a different " +
"color than invalid netscript functions. The color will depend on your theme. " + "color than invalid netscript functions. The color will depend on your theme. " +

@ -55,6 +55,7 @@ function initSingularitySFFlags() {
function NetscriptFunctions(workerScript) { function NetscriptFunctions(workerScript) {
return { return {
Math : Math,
hacknetnodes : Player.hacknetNodes, hacknetnodes : Player.hacknetNodes,
scan : function(ip=workerScript.serverIp){ scan : function(ip=workerScript.serverIp){
var server = getServer(ip); var server = getServer(ip);

@ -1256,7 +1256,7 @@ PlayerObject.prototype.startClass = function(costMult, expMult, className) {
agiExp = baseGymExp * expMult / gameCPS; agiExp = baseGymExp * expMult / gameCPS;
break; break;
default: default:
throw new Error("ERR: Invalid/recognized class name"); throw new Error("ERR: Invalid/unrecognized class name");
return; return;
} }