mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 11:27:04 +02:00
UI: change time elapsed to time remaining for programs and grafting (#1328)
This commit is contained in:
@@ -21,10 +21,12 @@ interface GraftingWorkParams {
|
||||
export class GraftingWork extends Work {
|
||||
augmentation: AugmentationName;
|
||||
unitCompleted: number;
|
||||
unitRate: number;
|
||||
|
||||
constructor(params?: GraftingWorkParams) {
|
||||
super(WorkType.GRAFTING, params?.singularity ?? true);
|
||||
this.unitCompleted = 0;
|
||||
this.unitRate = 0;
|
||||
this.augmentation = params?.augmentation ?? AugmentationName.Targeting1;
|
||||
const gAugs = GraftableAugmentations();
|
||||
if (params) Player.loseMoney(gAugs[this.augmentation].cost, "augmentations");
|
||||
@@ -37,8 +39,8 @@ export class GraftingWork extends Work {
|
||||
process(cycles: number): boolean {
|
||||
const focusBonus = Player.focusPenalty();
|
||||
this.cyclesWorked += cycles;
|
||||
this.unitCompleted += CONSTANTS.MilliPerCycle * cycles * graftingIntBonus() * focusBonus;
|
||||
|
||||
this.unitRate = CONSTANTS.MilliPerCycle * cycles * graftingIntBonus() * focusBonus;
|
||||
this.unitCompleted += this.unitRate;
|
||||
return this.unitCompleted >= this.unitNeeded();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user