Skip to content

Commit

Permalink
Clean up Flying Press interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaD173 committed Sep 29, 2024
1 parent 1acaf80 commit 4034706
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions calc/src/mechanics/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,16 @@ export function getMoveEffectiveness(
return 1;
} else if (move.named('Freeze-Dry') && type === 'Water') {
return 2;
} else if (!move.named('Flying Press')) {
const effectiveness = gen.types.get(toID(move.type))!.effectiveness[type]!;
} else {
let effectiveness = gen.types.get(toID(move.type))!.effectiveness[type]!;
if (effectiveness === 0 && isRingTarget) {
return 1;
effectiveness = 1;
}
if (move.named('Flying Press')) {
// Can only do this because flying has no other interactions
effectiveness *= gen.types.get('flying' as ID)!.effectiveness[type]!;
}
return effectiveness;
} else {
// Flying Press done last so Ghost Reveal and Ring Target take precedence
return (
gen.types.get('fighting' as ID)!.effectiveness[type]! *
gen.types.get('flying' as ID)!.effectiveness[type]!
);
}
}

Expand Down

0 comments on commit 4034706

Please sign in to comment.