mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 08:13:50 +02:00
DEVMENU: Easier to add/remove sleeves (#908)
This commit is contained in:
@@ -32,7 +32,7 @@ import { resetGangs } from "../../Gang/AllGangs";
|
||||
import { Cities } from "../../Locations/Cities";
|
||||
import { Locations } from "../../Locations/Locations";
|
||||
import { Sleeve } from "../Sleeve/Sleeve";
|
||||
import { isSleeveCompanyWork } from "../Sleeve/Work/SleeveCompanyWork";
|
||||
import { SleeveWorkType } from "../Sleeve/Work/Work";
|
||||
import { calculateSkillProgress as calculateSkillProgressF, ISkillProgress } from "../formulas/skill";
|
||||
import { AddToAllServers, createUniqueRandomIp } from "../../Server/AllServers";
|
||||
import { safelyCreateUniqueServer } from "../../Server/ServerHelpers";
|
||||
@@ -109,11 +109,7 @@ export function prestigeAugmentation(this: PlayerObject): void {
|
||||
|
||||
this.queuedAugmentations = [];
|
||||
|
||||
const numSleeves = Math.min(3, this.sourceFileLvl(10) + (this.bitNodeN === 10 ? 1 : 0)) + this.sleevesFromCovenant;
|
||||
if (this.sleeves.length > numSleeves) this.sleeves.length = numSleeves;
|
||||
for (let i = this.sleeves.length; i < numSleeves; i++) {
|
||||
this.sleeves.push(new Sleeve());
|
||||
}
|
||||
Sleeve.recalculateNumOwned();
|
||||
|
||||
this.sleeves.forEach((sleeve) => (sleeve.shock <= 0 ? sleeve.synchronize() : sleeve.shockRecovery()));
|
||||
|
||||
@@ -369,7 +365,7 @@ export function quitJob(this: PlayerObject, company: CompanyName): void {
|
||||
this.finishWork(true);
|
||||
}
|
||||
for (const sleeve of this.sleeves) {
|
||||
if (isSleeveCompanyWork(sleeve.currentWork) && sleeve.currentWork.companyName === company) {
|
||||
if (sleeve.currentWork?.type === SleeveWorkType.COMPANY && sleeve.currentWork.companyName === company) {
|
||||
sleeve.stopWork();
|
||||
dialogBoxCreate(`You quit ${company} while one of your sleeves was working there. The sleeve is now idle.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user