mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
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:
parent
62023bd299
commit
119fe0be36
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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'] },
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user