Skip to content

Commit

Permalink
change(farm): Show effect of Petaya with altered berry growth times (p…
Browse files Browse the repository at this point in the history
…okeclicker#5378)

Co-authored-by: CypherX <[email protected]>
  • Loading branch information
wormania and CypherX authored Jun 25, 2024
1 parent d7bf725 commit be37f98
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/scripts/farming/Plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,17 @@ class Plot implements Saveable {

tooltip.push(`<u>${BerryType[this.berry]}</u>`);

const timeBoostType = Settings.getSetting('farmBoostDisplay').observableValue();
// Petaya Effect
if (App.game.farming.berryInFarm(BerryType.Petaya, PlotStage.Berry, true) && this.berry !== BerryType.Petaya && this.stage() == PlotStage.Berry) {
tooltip.push('∞ until death');
if (timeBoostType) {
tooltip.push(`(altered from ${this.formattedBaseStageTimeLeft()})`);
}
// Normal Time
} else {
const timeType = Settings.getSetting('farmDisplay').observableValue();
const timeBoostType = Settings.getSetting('farmBoostDisplay').observableValue();

const growthMultiplierNumber = App.game.farming.getGrowthMultiplier() * this.getGrowthMultiplier();
const altered = growthMultiplierNumber !== 1;

Expand Down Expand Up @@ -252,7 +256,10 @@ class Plot implements Saveable {
}
}

tooltip.push(`${timetip}${altered && timeBoostType ? ` (altered from ${formattedBaseTime})` : ''}`);
tooltip.push(timetip);
if (altered && timeBoostType) {
tooltip.push(`(altered from ${formattedBaseTime})`);
}
}
}

Expand Down

0 comments on commit be37f98

Please sign in to comment.