Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(calculateClickAttack): Fix achievement bonus counted twice #318

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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