Skip to content

Commit

Permalink
Utils.Battle: Fix achievement bonus counted twice
Browse files Browse the repository at this point in the history
The game's `getBonus()` function now includes the achievement bonus.

The automation internal `calculateClickAttack` method was out of date
and applied the achievement bonus multiplier twice.

The method now reflects the latest implementation.
  • Loading branch information
Farigh committed Oct 19, 2023
2 parents 2cd4682 + 957d2f3 commit cf940b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/Utils/Battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AutomationUtilsBattle
// We now need to compute the click attack manually,
// since the magikarp island has a dedicated computation that will completly ruin everything...

// From https://github.com/pokeclicker/pokeclicker/blob/7101c0e088bee579d6ecee6d4c968034eabc82f9/src/scripts/party/Party.ts#L250-L265
// From https://github.com/pokeclicker/pokeclicker/blob/cbfa24800d68d08f863c671d99dfc8d3f832db51/src/scripts/party/Party.ts#L287-L304

// Base power
// Shiny pokemon help with a 100% boost
Expand All @@ -50,7 +50,7 @@ class AutomationUtilsBattle
const caught = caughtPokemon.length;
const shiny = caughtPokemon.filter(p => p.shiny).length;
const resistant = caughtPokemon.filter(p => p.pokerus >= GameConstants.Pokerus.Resistant).length;
const clickAttack = Math.pow(caught + shiny + resistant + 1, 1.4) * (1 + AchievementHandler.achievementBonus());
const clickAttack = Math.pow(caught + shiny + resistant + 1, 1.4);

const bonus = App.game.party.multiplier.getBonus('clickAttack', false);

Expand Down

0 comments on commit cf940b1

Please sign in to comment.