Fix interaction between Max Weather Ball and -ate Abilities (#11138)
Some checks failed
Node.js CI / build (18.x) (push) Waiting to run
Publish to npm / test (push) Has been cancelled
Publish to npm / get-version (push) Has been cancelled
Publish to npm / npm-publish (push) Has been cancelled

* Fix interaction between Max Weather Ball and -ate Abilities

* Apply to the other moves

* Revert Normalize

* Revert "Revert Normalize"

This reverts commit e6f670daa8.
This commit is contained in:
André Bastos Dias 2025-07-15 18:36:07 +01:00 committed by GitHub
parent 6cf20d2101
commit 53fe99a6ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 46 additions and 34 deletions

View File

@ -60,7 +60,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
const noModifyType = [
'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'terrainpulse', 'weatherball',
];
if (move.type === 'Normal' && !noModifyType.includes(move.id) &&
if (move.type === 'Normal' && (!noModifyType.includes(move.id) || this.activeMove?.isMax) &&
!(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) {
move.type = 'Flying';
move.typeChangerBoosted = this.effect;
@ -1547,7 +1547,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
const noModifyType = [
'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'terrainpulse', 'weatherball',
];
if (move.type === 'Normal' && !noModifyType.includes(move.id) &&
if (move.type === 'Normal' && (!noModifyType.includes(move.id) || this.activeMove?.isMax) &&
!(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) {
move.type = 'Electric';
move.typeChangerBoosted = this.effect;
@ -2930,9 +2930,9 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
const noModifyType = [
'hiddenpower', 'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'struggle', 'technoblast', 'terrainpulse', 'weatherball',
];
if (!(move.isZ && move.category !== 'Status') && !noModifyType.includes(move.id) &&
if (!(move.isZ && move.category !== 'Status') &&
// TODO: Figure out actual interaction
!(move.name === 'Tera Blast' && pokemon.terastallized)) {
(!noModifyType.includes(move.id) || this.activeMove?.isMax) && !(move.name === 'Tera Blast' && pokemon.terastallized)) {
move.type = 'Normal';
move.typeChangerBoosted = this.effect;
}
@ -3226,7 +3226,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
const noModifyType = [
'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'terrainpulse', 'weatherball',
];
if (move.type === 'Normal' && !noModifyType.includes(move.id) &&
if (move.type === 'Normal' && (!noModifyType.includes(move.id) || this.activeMove?.isMax) &&
!(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) {
move.type = 'Fairy';
move.typeChangerBoosted = this.effect;
@ -3745,7 +3745,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
const noModifyType = [
'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'terrainpulse', 'weatherball',
];
if (move.type === 'Normal' && !noModifyType.includes(move.id) &&
if (move.type === 'Normal' && (!noModifyType.includes(move.id) || this.activeMove?.isMax) &&
!(move.isZ && move.category !== 'Status') && !(move.name === 'Tera Blast' && pokemon.terastallized)) {
move.type = 'Ice';
move.typeChangerBoosted = this.effect;

View File

@ -56,7 +56,7 @@ describe('Download', () => {
assert.statStage(battle.p1.active[0], 'atk', 1);
});
describe('Gen 4', () => {
describe('[Gen 4]', () => {
it('should not trigger if the foe is behind a Substitute', () => {
battle = common.gen(4).createBattle([[
{ species: 'furret', moves: ['sleeptalk'] },

View File

@ -180,7 +180,7 @@ describe('Protean', () => {
assert(cinder.hasType('Normal'));
});
describe('Gen 6-8', () => {
describe('[Gen 6-8]', () => {
it(`should activate on both turns of a charge move`, () => {
battle = common.gen(8).createBattle([[
{ species: 'Wynaut', ability: 'protean', moves: ['bounce'] },

View File

@ -36,35 +36,47 @@ describe('Weather Ball', () => {
assert(!battle.p2.active[0].fainted);
});
it('should not trigger counter when it is special during gen 3', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'drizzle', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['counter'] }] });
battle.makeChoices();
assert.fullHP(battle.p1.active[0]);
it('should change max moves if it has an -ate ability', () => {
battle = common.gen(8).createBattle([[
{ species: 'Aurorus', ability: 'refrigerate', moves: ['weatherball'] },
], [
{ species: 'Cofagrigus', ability: 'shellarmor', moves: ['sleeptalk'] },
]]);
assert.hurts(battle.p2.active[0], () => battle.makeChoices('move weatherball dynamax', 'move sleeptalk'));
assert(battle.getDebugLog().includes('Max Hailstorm'));
});
it('should trigger mirror coat when it is special during gen 3', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'drought', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['mirrorcoat'] }] });
battle.makeChoices();
assert.false.fullHP(battle.p1.active[0]);
});
describe('[Gen 3]', () => {
it('should not trigger counter when it is special', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'drizzle', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['counter'] }] });
battle.makeChoices();
assert.fullHP(battle.p1.active[0]);
});
it('should not trigger mirror coat when it is physical during gen 3', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['mirrorcoat'] }] });
battle.makeChoices();
assert.fullHP(battle.p1.active[0]);
});
it('should trigger mirror coat when it is special', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'drought', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['mirrorcoat'] }] });
battle.makeChoices();
assert.false.fullHP(battle.p1.active[0]);
});
it('should trigger counter when it is physical during gen 3', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'sandstream', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['counter'] }] });
battle.makeChoices();
assert.false.fullHP(battle.p1.active[0]);
it('should not trigger mirror coat when it is physical', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['mirrorcoat'] }] });
battle.makeChoices();
assert.fullHP(battle.p1.active[0]);
});
it('should trigger counter when it is physical', () => {
battle = common.gen(3).createBattle();
battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'sandstream', moves: ['weatherball'] }] });
battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['counter'] }] });
battle.makeChoices();
assert.false.fullHP(battle.p1.active[0]);
});
});
});