mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-08 08:37:48 +02:00
remove unused fields on sleeves
This commit is contained in:
@@ -5,7 +5,6 @@ import { Work, WorkType } from "./Work";
|
||||
import { CONSTANTS } from "../../../Constants";
|
||||
import { GeneralActions } from "../../../Bladeburner/data/GeneralActions";
|
||||
import { applyWorkStatsExp, WorkStats } from "../../../Work/WorkStats";
|
||||
import { Contracts } from "src/Bladeburner/data/Contracts";
|
||||
|
||||
interface SleeveBladeburnerWorkParams {
|
||||
type: string;
|
||||
|
||||
@@ -38,12 +38,16 @@ export class SleeveCrimeWork extends Work {
|
||||
});
|
||||
}
|
||||
|
||||
cyclesNeeded(): number {
|
||||
return this.getCrime().time / CONSTANTS._idleSpeed;
|
||||
}
|
||||
|
||||
process(player: IPlayer, sleeve: Sleeve, cycles: number): number {
|
||||
this.cyclesWorked += cycles;
|
||||
|
||||
const crime = this.getCrime();
|
||||
const gains = this.getExp();
|
||||
if (this.cyclesWorked >= crime.time / CONSTANTS._idleSpeed) {
|
||||
if (this.cyclesWorked >= this.cyclesNeeded()) {
|
||||
if (Math.random() < crime.successRate(sleeve)) {
|
||||
applyWorkStats(player, sleeve, gains, 1, "sleeves");
|
||||
|
||||
@@ -51,7 +55,7 @@ export class SleeveCrimeWork extends Work {
|
||||
} else {
|
||||
applyWorkStats(player, sleeve, scaleWorkStats(gains, 0.25), 1, "sleeves");
|
||||
}
|
||||
this.cyclesWorked -= crime.time / CONSTANTS._idleSpeed;
|
||||
this.cyclesWorked -= this.cyclesNeeded();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user