Added Bladeburner functions and 'bladeburner' keyword to syntax highlighter for Netscript. Fixed a bug with bladeburner.getSkillLevel() Netscript fn

This commit is contained in:
danielyxie 2018-06-24 22:07:05 -05:00
parent 260598ee8a
commit 58753f9c89
3 changed files with 30 additions and 6 deletions

18
dist/engine.bundle.js vendored

@ -29330,7 +29330,6 @@ Bladeburner.prototype.getGeneralActionNamesNetscriptFn = function(name) {
}
Bladeburner.prototype.getSkillNamesNetscriptFn = function(name) {
return Skills.hasOwnProperty(name);
return Object.keys(Skills);
}
@ -29473,7 +29472,11 @@ Bladeburner.prototype.getSkillLevelNetscriptFn = function(skillName, workerScrip
return -1;
}
return Skills[skillName];
if (this.skills[skillName] == null) {
return 0;
} else {
return this.skills[skillName];
}
}
Bladeburner.prototype.upgradeSkillNetscriptFn = function(skillName, workerScript) {
@ -100091,7 +100094,16 @@ let NetscriptFunctions =
"installAugmentations|hacknetnodes|upgradeLevel|upgradeRam|upgradeCore|" +
"getLevelUpgradeCost|getRamUpgradeCost|getCoreUpgradeCost|" +
"getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" +
"placeOrder|cancelOrder";
"placeOrder|cancelOrder|" +
//Bladeburner functions
"bladeburner|getContractNames|getOperationNames|getBlackOpNames|" +
"getGeneralActionNames|getSkillNames|startAction|stopBladeburnerAction|" +
"getActionTime|getActionEstimatedSuccessChance|getActionCountRemaining|" +
"getRank|getSkillPoints|getSkillLevel|upgradeSkill|getTeamSize|" +
"setTeamSize|getCityEstimatedPopulation|getCityEstimatedCommunities|" +
"getCityChaos|switchCity|getStamina|joinBladeburnerFaction"
;
var NetscriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({

@ -86,7 +86,16 @@ let NetscriptFunctions =
"installAugmentations|hacknetnodes|upgradeLevel|upgradeRam|upgradeCore|" +
"getLevelUpgradeCost|getRamUpgradeCost|getCoreUpgradeCost|" +
"getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" +
"placeOrder|cancelOrder";
"placeOrder|cancelOrder|" +
//Bladeburner functions
"bladeburner|getContractNames|getOperationNames|getBlackOpNames|" +
"getGeneralActionNames|getSkillNames|startAction|stopBladeburnerAction|" +
"getActionTime|getActionEstimatedSuccessChance|getActionCountRemaining|" +
"getRank|getSkillPoints|getSkillLevel|upgradeSkill|getTeamSize|" +
"setTeamSize|getCityEstimatedPopulation|getCityEstimatedCommunities|" +
"getCityChaos|switchCity|getStamina|joinBladeburnerFaction"
;
var NetscriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({

@ -3285,7 +3285,6 @@ Bladeburner.prototype.getGeneralActionNamesNetscriptFn = function(name) {
}
Bladeburner.prototype.getSkillNamesNetscriptFn = function(name) {
return Skills.hasOwnProperty(name);
return Object.keys(Skills);
}
@ -3428,7 +3427,11 @@ Bladeburner.prototype.getSkillLevelNetscriptFn = function(skillName, workerScrip
return -1;
}
return Skills[skillName];
if (this.skills[skillName] == null) {
return 0;
} else {
return this.skills[skillName];
}
}
Bladeburner.prototype.upgradeSkillNetscriptFn = function(skillName, workerScript) {