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');