Fix Heal Bell's interaction with Mold Breaker (#10918)

* Fix Heal Bell's interaction with Mold Breaker

* Update to ESLint 9
This commit is contained in:
André Bastos Dias 2025-02-26 20:51:50 +00:00 committed by GitHub
parent 62023bd299
commit 119fe0be36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 4 deletions

View File

@ -742,7 +742,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
this.add('-activate', source, 'move: Heal Bell');
const allies = [...target.side.pokemon, ...target.side.allySide?.pokemon || []];
for (const ally of allies) {
if (ally.hasAbility('soundproof')) {
if (ally.hasAbility('soundproof') && !this.suppressingAbility(ally)) {
if (ally.isActive) this.add('-immune', ally, '[from] ability: Soundproof');
continue;
}

View File

@ -369,7 +369,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
let success = false;
const allies = [...target.side.pokemon, ...target.side.allySide?.pokemon || []];
for (const ally of allies) {
if (ally.hasAbility('soundproof')) {
if (ally.hasAbility('soundproof') && !this.suppressingAbility(ally)) {
this.add('-immune', ally, '[from] ability: Soundproof');
continue;
}

View File

@ -589,7 +589,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
let success = false;
const allies = [...target.side.pokemon, ...target.side.allySide?.pokemon || []];
for (const ally of allies) {
if (ally !== source) {
if (ally !== source && !this.suppressingAbility(ally)) {
if (ally.hasAbility('sapsipper')) {
this.add('-immune', ally, '[from] ability: Sap Sipper');
continue;
@ -8547,7 +8547,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
let success = false;
const allies = [...target.side.pokemon, ...target.side.allySide?.pokemon || []];
for (const ally of allies) {
if (ally !== source) {
if (ally !== source && !this.suppressingAbility(ally)) {
if (ally.hasAbility('soundproof')) {
this.add('-immune', ally, '[from] ability: Soundproof');
continue;

View File

@ -25,6 +25,32 @@ describe('Heal Bell', () => {
assert.equal(battle.p1.pokemon[1].status, '');
});
it(`should not heal the major status conditions of a Pokemon with Soundproof`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'Kommo-o', ability: 'soundproof', moves: ['sleeptalk'] },
{ species: 'Chansey', moves: ['sleeptalk', 'healbell'] },
], [
{ species: 'Nidoking', moves: ['sleeptalk', 'toxic'] },
{ species: 'Wynaut', moves: ['sleeptalk'] },
]]);
battle.makeChoices('auto', 'move toxic 1, move sleeptalk');
battle.makeChoices('move sleeptalk, move healbell', 'auto');
assert.equal(battle.p1.pokemon[0].status, 'tox');
});
it(`with Mold Breaker should heal the major status conditions of a Pokemon with Soundproof`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'Kommo-o', ability: 'soundproof', moves: ['sleeptalk'] },
{ species: 'Excadrill', ability: 'moldbreaker', moves: ['healbell'] },
], [
{ species: 'Nidoking', moves: ['sleeptalk', 'toxic'] },
{ species: 'Wynaut', moves: ['sleeptalk'] },
]]);
battle.makeChoices('auto', 'move toxic 1, move sleeptalk');
battle.makeChoices('move sleeptalk, move healbell', 'auto');
assert.equal(battle.p1.pokemon[0].status, '');
});
it(`in a Multi Battle, should heal the major status conditions of the ally's team`, () => {
battle = common.createBattle({ gameType: 'multi' }, [[
{ species: 'Machamp', ability: 'noguard', moves: ['poisongas'] },