mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
Added gang.getTaskStats which returns the stats of a gang task
This commit is contained in:
@@ -29,7 +29,11 @@ import {
|
||||
calculateGrowTime,
|
||||
calculateWeakenTime
|
||||
} from "./Hacking";
|
||||
import { AllGangs, GangMemberUpgrades } from "./Gang";
|
||||
import {
|
||||
AllGangs,
|
||||
GangMemberUpgrades,
|
||||
GangMemberTasks
|
||||
} from "./Gang";
|
||||
import { Faction } from "./Faction/Faction";
|
||||
import { Factions, factionExists } from "./Faction/Factions";
|
||||
import { joinFaction, purchaseAugmentation } from "./Faction/FactionHelpers";
|
||||
@@ -3712,6 +3716,17 @@ function NetscriptFunctions(workerScript) {
|
||||
throw makeRuntimeRejectMsg(workerScript, nsGang.unknownGangApiExceptionMessage("setMemberTask", e));
|
||||
}
|
||||
},
|
||||
getTaskStats: function(taskName) {
|
||||
updateDynamicRam("getTaskStats", getRamCost("gang", "getTaskStats"));
|
||||
nsGang.checkGangApiAccess(workerScript, "getTaskStats");
|
||||
const task = GangMemberTasks[taskName];
|
||||
if (!task) {
|
||||
throw makeRuntimeRejectMsg(workerScript, nsGang.unknownGangApiExceptionMessage("getTaskStats", `${taskName} does not exists`));
|
||||
}
|
||||
const copy = Object.assign({}, task);
|
||||
copy.territory = Object.assign({}, task.territory)
|
||||
return copy;
|
||||
},
|
||||
getEquipmentNames: function() {
|
||||
updateDynamicRam("getEquipmentNames", getRamCost("gang", "getEquipmentNames"));
|
||||
nsGang.checkGangApiAccess(workerScript, "getEquipmentNames");
|
||||
|
||||
Reference in New Issue
Block a user