Skip to content

Commit

Permalink
Wind Rider gives an attack boost under Tailwind (#609)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
shrianshChari committed Mar 24, 2024
1 parent 19d188e commit 89d3f07
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions calc/src/mechanics/gen789.ts
Expand Up @@ -28,6 +28,7 @@ import {
checkMultihitBoost,
checkSeedBoost,
checkTeraformZero,
checkWindRider,
checkWonderRoom,
computeFinalStats,
countBoosts,
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions calc/src/mechanics/util.ts
Expand Up @@ -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) {
Expand Down
16 changes: 16 additions & 0 deletions calc/src/test/calc.test.ts
Expand Up @@ -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');
Expand Down

0 comments on commit 89d3f07

Please sign in to comment.