This commit is contained in:
danielyxie
2019-03-13 15:22:14 -07:00
4 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,10 @@
getBlackOpRank() Netscript Function
====================================
.. js:function:: getBlackOpRank(name)
:param string name: name of the BlackOp. Must be an exact match.
Returns the rank required to complete this BlackOp.
Returns -1 if an invalid action is specified.

View File

@ -46,6 +46,7 @@ In :ref:`netscriptjs`::
setActionAutolevel() <bladeburnerapi/setActionAutolevel>
setActionLevel() <bladeburnerapi/setActionLevel>
getRank() <bladeburnerapi/getRank>
getBlackOpRank() <bladeburnerapi/getBlackOpRank>
getSkillPoints() <bladeburnerapi/getSkillPoints>
getSkillLevel() <bladeburnerapi/getSkillLevel>
getSkillUpgradeCost() <bladeburnerapi/getSkillUpgradeCost>

View File

@ -4196,6 +4196,25 @@ function NetscriptFunctions(workerScript) {
throw makeRuntimeRejectMsg(workerScript, "getBlackOpNames() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed " +
"at the Bladeburner division or because you do not have Source-File 7");
},
getBlackOpRank : function(name="") {
if (workerScript.checkingRam) {
return updateStaticRam("getBlackOpRank", CONSTANTS.ScriptBladeburnerApiBaseRamCost / 2);
}
updateDynamicRam("getBlackOpRank", CONSTANTS.ScriptBladeburnerApiBaseRamCost / 2);
if (Player.bladeburner instanceof Bladeburner && (Player.bitNodeN === 7 || hasBladeburner2079SF)) {
const actionId = Player.bladeburner.getActionIdFromTypeAndName('blackops', name)
if (!actionId) {
return -1;
}
const actionObj = Player.bladeburner.getActionObject(actionId);
if (!actionObj) {
return -1;
}
return actionObj.reqdRank;
}
throw makeRuntimeRejectMsg(workerScript, "getBlackOpRank() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed " +
"at the Bladeburner division or because you do not have Source-File 7");
},
getGeneralActionNames : function() {
if (workerScript.checkingRam) {
return updateStaticRam("getGeneralActionNames", CONSTANTS.ScriptBladeburnerApiBaseRamCost / 10);

View File

@ -117,7 +117,7 @@ let NetscriptFunctions =
"getGeneralActionNames|getSkillNames|startAction|stopBladeburnerAction|" +
"getActionTime|getActionEstimatedSuccessChance|getActionCountRemaining|" +
"getActionMaxLevel|getActionCurrentLevel|getActionAutolevel|" +
"getActionRepGain|setActionAutolevel|setActionLevel|" +
"getActionRepGain|setActionAutolevel|setActionLevel|getBlackOpRank|" +
"getRank|getSkillPoints|getSkillLevel|getSkillUpgradeCost|" +
"upgradeSkill|getTeamSize|getCity|getCurrentAction|" +
"setTeamSize|getCityEstimatedPopulation|getCityEstimatedCommunities|" +