Finished BETA version of Missions. All other changes for v0.29.1

This commit is contained in:
danielyxie
2017-09-27 10:13:42 -05:00
parent c84417607f
commit 22a5d3b3cc
9 changed files with 1989 additions and 1795 deletions
+17 -1
View File
@@ -469,6 +469,16 @@ function NetscriptFunctions(workerScript) {
if (arguments.length !== 2 && arguments.length !== 3) {
throw makeRuntimeRejectMsg(workerScript, "Error: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");
}
if (scriptname && scriptname.constructor === Array) {
//Recursively call scp on all elements of array
var res = false;
scriptname.forEach(function(script) {
if (NetscriptFunctions(workerScript).scp(script, ip1, ip2)) {
res = true;
};
});
return res;
}
if (!scriptname.endsWith(".lit") && !scriptname.endsWith(".script")) {
throw makeRuntimeRejectMsg(workerScript, "Error: scp() only works for .script and .lit files");
}
@@ -1124,7 +1134,10 @@ function NetscriptFunctions(workerScript) {
getScriptIncome : function(scriptname, ip) {
if (arguments.length === 0) {
//Get total script income
return updateActiveScriptsItems();
var res = [];
res.push(updateActiveScriptsItems());
res.push(Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug/1000));
return res;
} else {
//Get income for a particular script
var server = getServer(ip);
@@ -1170,6 +1183,9 @@ function NetscriptFunctions(workerScript) {
return runningScriptObj.onlineExpGained / runningScriptObj.onlineRunningTime;
}
},
getTimeSinceLastAug : function() {
return Player.playtimeSinceLastAug;
},
/* Singularity Functions */
universityCourse(universityName, className) {