Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pokemon with Wind Rider should gain an Attack boost if in Tailwind #609

Merged
merged 4 commits into from Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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