mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 23:27:55 +02:00
BLADEBURNER: Store BlackOp team count in save data (#2675)
This commit is contained in:
@@ -7,6 +7,7 @@ import { Operation } from "../../../src/Bladeburner/Actions/Operation";
|
||||
import {
|
||||
AugmentationName,
|
||||
BladeburnerActionType,
|
||||
BladeburnerBlackOpName,
|
||||
BladeburnerContractName,
|
||||
BladeburnerGeneralActionName,
|
||||
BladeburnerOperationName,
|
||||
@@ -17,15 +18,15 @@ import { FormatsNeedToChange } from "../../../src/ui/formatNumber";
|
||||
import { CrimeWork } from "../../../src/Work/CrimeWork";
|
||||
import type { Action, ActionIdentifier } from "../../../src/Bladeburner/Types";
|
||||
import type { Skills } from "@nsdefs";
|
||||
import { BlackOperations } from "../../../src/Bladeburner/data/BlackOperations";
|
||||
import { applyAugmentation } from "../../../src/Augmentation/AugmentationHelpers";
|
||||
import { PlayerOwnedAugmentation } from "../../../src/Augmentation/PlayerOwnedAugmentation";
|
||||
import { BlackOperation } from "../../../src/Bladeburner/Actions/BlackOperation";
|
||||
|
||||
describe("Bladeburner Actions", () => {
|
||||
const SampleContract = Contract.createId(BladeburnerContractName.Tracking);
|
||||
const SampleGeneralAction = GeneralAction.createId(BladeburnerGeneralActionName.Diplomacy);
|
||||
const SampleOperation = Operation.createId(BladeburnerOperationName.Assassination);
|
||||
const SampleBlackOp = BlackOperations["Operation Centurion"].id;
|
||||
const SampleBlackOp = BlackOperation.createId(BladeburnerBlackOpName.OperationCenturion);
|
||||
|
||||
const ENOUGH_TIME_TO_FINISH_ACTION = 1e5;
|
||||
const BASE_STAT_EXP = 1e6;
|
||||
@@ -37,7 +38,8 @@ describe("Bladeburner Actions", () => {
|
||||
|
||||
const contracts = Object.values(new Bladeburner().contracts);
|
||||
const operations = Object.values(new Bladeburner().operations);
|
||||
const nonGeneralActions = [contracts, operations, Object.values(BlackOperations)].flat();
|
||||
const blackOperations = Object.values(new Bladeburner().blackOperations);
|
||||
const nonGeneralActions = [contracts, operations, blackOperations].flat();
|
||||
|
||||
describe("Without Simulacrum", () => {
|
||||
it("Starting an action cancels player's work immediately", () => {
|
||||
@@ -139,16 +141,13 @@ describe("Bladeburner Actions", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe.each([SampleContract, SampleOperation, BlackOperations["Operation Archangel"].id])(
|
||||
"non-general actions increase rank",
|
||||
(id) => {
|
||||
it(`${id.type}`, () => {
|
||||
before = bb.rank;
|
||||
complete(id, forceSuccess);
|
||||
expect(bb.rank).toBeGreaterThan(before);
|
||||
});
|
||||
},
|
||||
);
|
||||
describe.each([SampleContract, SampleOperation, SampleBlackOp])("non-general actions increase rank", (id) => {
|
||||
it(`${id.type}`, () => {
|
||||
before = bb.rank;
|
||||
complete(id, forceSuccess);
|
||||
expect(bb.rank).toBeGreaterThan(before);
|
||||
});
|
||||
});
|
||||
|
||||
describe("non-general actions increase rank", () => {
|
||||
let beforeMinor, minorGain, beforeMajor, majorGain;
|
||||
|
||||
@@ -9,7 +9,6 @@ import { BladeburnerBlackOpName, BladeburnerContractName, BladeburnerOperationNa
|
||||
import { PlayerObject } from "../../../src/PersonObjects/Player/PlayerObject";
|
||||
import { recalculateNumberOfOwnedSleeves } from "../../../src/PersonObjects/Sleeve/SleeveCovenantPurchases";
|
||||
import { initGameEnvironment } from "../Utilities";
|
||||
import { BlackOperations } from "../../../src/Bladeburner/data/BlackOperations";
|
||||
|
||||
initGameEnvironment();
|
||||
|
||||
@@ -132,17 +131,17 @@ describe("Bladeburner Team", () => {
|
||||
});
|
||||
|
||||
describe("Check teamSize and teamCount", () => {
|
||||
test("Failing actions", () => {
|
||||
test("Failed action", () => {
|
||||
teamSize(10);
|
||||
startAction(OP);
|
||||
forceMaxCasualties();
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(BlackOperations)]) {
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(inst.blackOperations)]) {
|
||||
action.teamCount = 10;
|
||||
expect(action.teamCount).toStrictEqual(10);
|
||||
}
|
||||
actionFails();
|
||||
expect(inst.teamSize).toStrictEqual(0);
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(BlackOperations)]) {
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(inst.blackOperations)]) {
|
||||
expect(action.teamCount).toStrictEqual(0);
|
||||
}
|
||||
});
|
||||
@@ -152,7 +151,7 @@ describe("Bladeburner Team", () => {
|
||||
expect(inst.teamSize).toStrictEqual(9);
|
||||
startAction(OP);
|
||||
forceMaxCasualties();
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(BlackOperations)]) {
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(inst.blackOperations)]) {
|
||||
action.teamCount = 9;
|
||||
expect(action.teamCount).toStrictEqual(9);
|
||||
}
|
||||
@@ -160,17 +159,17 @@ describe("Bladeburner Team", () => {
|
||||
// The teamCount of all operations/black operations should be 8, not 0.
|
||||
assertSleevesHaveBeenShocked();
|
||||
expect(inst.teamSize).toStrictEqual(8);
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(BlackOperations)]) {
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(inst.blackOperations)]) {
|
||||
expect(action.teamCount).toStrictEqual(8);
|
||||
}
|
||||
Player.sleeves[0].stopWork();
|
||||
expect(inst.teamSize).toStrictEqual(7);
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(BlackOperations)]) {
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(inst.blackOperations)]) {
|
||||
expect(action.teamCount).toStrictEqual(7);
|
||||
}
|
||||
Player.sleeves[0].startWork(new SleeveSupportWork());
|
||||
expect(inst.teamSize).toStrictEqual(8);
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(BlackOperations)]) {
|
||||
for (const action of [...Object.values(inst.operations), ...Object.values(inst.blackOperations)]) {
|
||||
expect(action.teamCount).toStrictEqual(7);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { installAugmentations } from "../../../src/Augmentation/AugmentationHelpers";
|
||||
import { blackOpsArray } from "../../../src/Bladeburner/data/BlackOperations";
|
||||
import { AugmentationName, CompanyName, CompletedProgramName, FactionName, JobField, JobName } from "@enums";
|
||||
import { Player } from "@player";
|
||||
import { prestigeSourceFile } from "../../../src/Prestige";
|
||||
@@ -14,6 +13,7 @@ import { Companies } from "../../../src/Company/Companies";
|
||||
import { CompanyPositions } from "../../../src/Company/CompanyPositions";
|
||||
import { getTorRouter } from "../../../src/Server/ServerHelpers";
|
||||
import * as exceptionAlertModule from "../../../src/utils/helpers/exceptionAlert";
|
||||
import { numberOfBlackOperations } from "../../../src/Bladeburner/data/BlackOperations";
|
||||
|
||||
const nextBN = 4;
|
||||
|
||||
@@ -194,7 +194,7 @@ function setUpBeforeDestroyingWD(): void {
|
||||
const wdServer = GetServerOrThrow(SpecialServers.WorldDaemon);
|
||||
wdServer.hasAdminRights = true;
|
||||
Player.startBladeburner();
|
||||
setNumBlackOpsComplete(blackOpsArray.length);
|
||||
setNumBlackOpsComplete(numberOfBlackOperations);
|
||||
}
|
||||
|
||||
describe("b1tflum3", () => {
|
||||
|
||||
@@ -85,6 +85,134 @@ exports[`Check Save File Continuity PlayerSave continuity 1`] = `
|
||||
"automateEnabled": false,
|
||||
"automateThreshHigh": 0,
|
||||
"automateThreshLow": 0,
|
||||
"blackOperations": {
|
||||
"Operation Annihilus": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Archangel": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Ares": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Centurion": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Daedalus": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Deckard": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Hyron": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Ion Storm": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Juggernaut": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation K": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Morpheus": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Red Dragon": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Shoulder of Orion": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Titan": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Typhoon": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Tyrell": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Ultron": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Vindictus": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Wallace": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation X": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
"Operation Zero": {
|
||||
"ctor": "BlackOperation",
|
||||
"data": {
|
||||
"teamCount": 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
"cities": {
|
||||
"Aevum": {
|
||||
"ctor": "City",
|
||||
|
||||
Reference in New Issue
Block a user