From 4034706ec6e214177d5bdc7e1a1be0a44567cf4e Mon Sep 17 00:00:00 2001 From: Shiva Devarajan Date: Sun, 29 Sep 2024 13:42:38 -0500 Subject: [PATCH] Clean up Flying Press interactions --- calc/src/mechanics/util.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/calc/src/mechanics/util.ts b/calc/src/mechanics/util.ts index 64a24ed7f..1f29a2b9d 100644 --- a/calc/src/mechanics/util.ts +++ b/calc/src/mechanics/util.ts @@ -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]! - ); } }