mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 07:02:26 +01:00
parent
3bd7ad77b7
commit
0b95c09563
@ -3335,6 +3335,38 @@ Bladeburner.prototype.startActionNetscriptFn = function(type, name, workerScript
|
||||
return false;
|
||||
}
|
||||
|
||||
// Special logic for Black Ops
|
||||
if (actionId.type === ActionTypes["BlackOp"]) {
|
||||
// Can't start a BlackOp if you don't have the required rank
|
||||
let action = this.getActionObject(actionId);
|
||||
if (action.reqdRank > this.rank) {
|
||||
workerScript.log(`Failed to start Black Op ${actionId.name} due to insufficient rank`);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Can't start a BlackOp if you haven't done the one before it
|
||||
var blackops = [];
|
||||
for (const nm in BlackOperations) {
|
||||
if (BlackOperations.hasOwnProperty(nm)) {
|
||||
blackops.push(nm);
|
||||
}
|
||||
}
|
||||
blackops.sort(function(a, b) {
|
||||
return (BlackOperations[a].reqdRank - BlackOperations[b].reqdRank); // Sort black ops in intended order
|
||||
});
|
||||
|
||||
let i = blackops.indexOf(actionId.name);
|
||||
if (i === -1) {
|
||||
workerScript.log("ERROR: Invalid Black Operation name passed into bladeburner.startAction(). Note that this name is case-sensitive & whitespace-sensitive");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (i > 0 && this.blackops[blackops[i-1]] == null) {
|
||||
workerScript.log(`ERROR: Cannot attempt Black Operation ${actionId.name} because you have not done the preceding one`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
this.startAction(actionId);
|
||||
if (workerScript.shouldLog("startAction")) {
|
||||
@ -3436,9 +3468,14 @@ Bladeburner.prototype.getActionCountRemainingNetscriptFn = function(type, name,
|
||||
switch (actionId.type) {
|
||||
case ActionTypes["Contract"]:
|
||||
case ActionTypes["Operation"]:
|
||||
return actionObj.count;
|
||||
case ActionTypes["BlackOp"]:
|
||||
case ActionTypes["BlackOperation"]:
|
||||
return actionObj.count;
|
||||
if (this.blackops[name] != null) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
case ActionTypes["Training"]:
|
||||
case ActionTypes["Field Analysis"]:
|
||||
case ActionTypes["FieldAnalysis"]:
|
||||
|
@ -519,6 +519,8 @@ let CONSTANTS = {
|
||||
* Bug Fix: Netscript calls that throw errors will now no longer cause the 'concurrent calls' error if they are caught in the script. i.e. try/catch should now work properly in scripts
|
||||
* Bug Fix: Fixed a bug where sometimes the NeuroFlux Governor Augmentation level would be incorrectly calculated when the game was loaded
|
||||
* Bug Fix: Fixed a bug where calling the scp() Netscript function with invalid hostname/ips would throw an unclear error message
|
||||
* Bug Fix: Bladeburner API function getActionCountRemaining() should now work properly for BlackOps
|
||||
* Bug Fix: Black Ops can no longer be attempted out-of-order or without the required rank via Bladeburner API
|
||||
* RAM cost for basic Netscript functions added to documentation (by CBJamo)
|
||||
`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user