From 89d3f071d8dbb38916173b87ab411463ce1e83c0 Mon Sep 17 00:00:00 2001 From: shrianshChari <30420527+shrianshChari@users.noreply.github.com> Date: Sat, 23 Mar 2024 20:14:09 -0400 Subject: [PATCH] Wind Rider gives an attack boost under Tailwind (#609) When a Pokemon has the ability Wind Rider and has Tailwind on its side of the field, it will gain an Attack boost. Case: Brambleghast using Power Whip against Brambleghast, with the attacking Brambleghast under Tailwind. Current: `0 Atk Brambleghast Power Whip vs. 0 HP / 0 Def Brambleghast: 97-115 (38.6 - 45.8%) -- guaranteed 3HKO` New: `+1 0 Atk Brambleghast Power Whip vs. 0 HP / 0 Def Brambleghast: 146-172 (58.1 - 68.5%) -- guaranteed 2HKO` --- calc/src/mechanics/gen789.ts | 4 ++++ calc/src/mechanics/util.ts | 6 ++++++ calc/src/test/calc.test.ts | 16 ++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/calc/src/mechanics/gen789.ts b/calc/src/mechanics/gen789.ts index 44cd6143b..66ab49938 100644 --- a/calc/src/mechanics/gen789.ts +++ b/calc/src/mechanics/gen789.ts @@ -28,6 +28,7 @@ import { checkMultihitBoost, checkSeedBoost, checkTeraformZero, + checkWindRider, checkWonderRoom, computeFinalStats, countBoosts, @@ -83,6 +84,9 @@ export function calculateSMSSSV( checkIntrepidSword(attacker, gen); checkIntrepidSword(defender, gen); + checkWindRider(attacker, field.attackerSide); + checkWindRider(defender, field.defenderSide); + if (move.named('Meteor Beam', 'Electro Shot')) { attacker.boosts.spa += attacker.hasAbility('Simple') ? 2 diff --git a/calc/src/mechanics/util.ts b/calc/src/mechanics/util.ts index 0cce20a4f..6145cf884 100644 --- a/calc/src/mechanics/util.ts +++ b/calc/src/mechanics/util.ts @@ -253,6 +253,12 @@ export function checkDauntlessShield(source: Pokemon, gen: Generation) { } } +export function checkWindRider(source: Pokemon, attackingSide: Side) { + if (source.hasAbility('Wind Rider') && attackingSide.isTailwind) { + source.boosts.atk = Math.min(6, source.boosts.atk + 1); + } +} + export function checkEmbody(source: Pokemon, gen: Generation) { if (gen.num < 9) return; switch (source.ability) { diff --git a/calc/src/test/calc.test.ts b/calc/src/test/calc.test.ts index 7e8a0cdb4..de2728f39 100644 --- a/calc/src/test/calc.test.ts +++ b/calc/src/test/calc.test.ts @@ -1222,6 +1222,22 @@ describe('calc', () => { "0 Atk Weavile with an ally's Flower Gift Power Spot boosted switching boosted Pursuit (80 BP) vs. 0 HP / 0 Def Vulpix in Sun: 399-469 (183.8 - 216.1%) -- guaranteed OHKO" ); }); + + test('Wind Rider should give an Attack boost in Tailwind', () => { + const attacker = Pokemon('Brambleghast', {'ability': 'Wind Rider'}); + const defender = Pokemon('Brambleghast', {'ability': 'Wind Rider'}); + const field = Field({ + attackerSide: { + isTailwind: true, + }, + }); + + const result = calculate(attacker, defender, Move('Power Whip'), field); + + expect(attacker.boosts.atk).toBe(0); + expect(result.attacker.boosts.atk).toBe(1); + }); + describe('Tera Stellar', () => { const terastal = Pokemon('Arceus', {teraType: 'Stellar'}); const control = Pokemon('Arceus');