UI: change time elapsed to time remaining for programs and grafting (#1328)

This commit is contained in:
TheAimMan
2024-06-02 23:51:21 -04:00
committed by GitHub
parent d9f04203cf
commit e622b9b904
3 changed files with 13 additions and 8 deletions
+4 -2
View File
@@ -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();
}