Skip to content

Commit

Permalink
added iron ball check to immunity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmagier committed Mar 28, 2021
1 parent 02e79d3 commit 086326f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion calc/src/mechanics/gen56.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ export function calculateBWXY(
} else if (defender.types[1] && effectiveness[defender.types[1]]! === 0) {
typeEffectiveness = type1Effectiveness;
}
} else if (typeEffectiveness === 0 && move.hasType('Ground') && defender.hasItem('Iron Ball')) {
typeEffectiveness = 1;
}

if (typeEffectiveness === 0) {
Expand All @@ -202,7 +204,8 @@ export function calculateBWXY(
(move.hasType('Electric') &&
defender.hasAbility('Lightning Rod', 'Motor Drive', 'Volt Absorb')) ||
(move.hasType('Ground') &&
!field.isGravity && !move.named('Thousand Arrows') && defender.hasAbility('Levitate')) ||
!field.isGravity && !defender.hasItem('Iron Ball') &&
!move.named('Thousand Arrows') && defender.hasAbility('Levitate')) ||
(move.flags.bullet && defender.hasAbility('Bulletproof')) ||
(move.flags.sound && defender.hasAbility('Soundproof'))
) {
Expand Down

0 comments on commit 086326f

Please sign in to comment.