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

Calculator does not properly consider Protosynthesis / Quark Drive Def/SpD boosts #567

Open
dillon-odonovan opened this issue Jul 21, 2023 · 0 comments

Comments

@dillon-odonovan
Copy link

When using the calculator and the defending Pokemon's ability is Protosynthesis or Quark Drive and its highest stat is Def or SpD, the damage modifier is not applied. If the weather is manually set to Sun the damage modifier is applied but so would the attacker's, should the attacker also have the ability Protosynthesis or Quark Drive.

I think the offending lines are below:

if (
(defender.hasAbility('Protosynthesis') &&
(field.hasWeather('Sun') || attacker.hasItem('Booster Energy'))) ||
(defender.hasAbility('Quark Drive') &&
(field.hasTerrain('Electric') || attacker.hasItem('Booster Energy')))
) {

where it should instead be:

if ( 
   (defender.hasAbility('Protosynthesis') && 
   (field.hasWeather('Sun') || defender.hasItem('Booster Energy'))) ||  <--- changed to defender
   (defender.hasAbility('Quark Drive') && 
   (field.hasTerrain('Electric') || defender.hasItem('Booster Energy'))) <--- changed to defender
 ) { 

Here are screenshots detailing this on the hosted calc:

Booster Energy Pelipper against no item Flutter Mane applies Protosynthesis boost (incorrect): Screenshot 2023-07-20 at 5 33 18 PM
Booster Energy Flutter Mane against non-Booster Energy Pelipper does not apply Protosynthesis boost (incorrect): Screenshot 2023-07-20 at 5 33 07 PM
No item Flutter Mane in sun applies Protosynthesis boost (correct): Screenshot 2023-07-20 at 5 32 55 PM
No item Flutter Mane in sun against no item Sandy Shocks applies Protosynthesis boost to both (correct): Screenshot 2023-07-20 at 5 32 36 PM
No item Flutter Mane does not get the boost (correct): Screenshot 2023-07-20 at 5 32 21 PM
Booster Energy Flutter Mane does not get the boost (incorrect): Screenshot 2023-07-20 at 5 32 06 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant