mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-07 11:04:36 +01:00
added getBlackOpRank
This commit is contained in:
committed by
danielyxie
parent
6969a8f92c
commit
da97c1b4b9
10
doc/source/netscript/bladeburnerapi/getBlackOpRank.rst
Normal file
10
doc/source/netscript/bladeburnerapi/getBlackOpRank.rst
Normal 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.
|
@ -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>
|
||||
|
@ -4195,6 +4195,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);
|
||||
|
@ -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|" +
|
||||
|
Reference in New Issue
Block a user