diff --git a/data/abilities.ts b/data/abilities.ts index 21a8a105d9164..81d833abc5887 100644 --- a/data/abilities.ts +++ b/data/abilities.ts @@ -301,7 +301,6 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, aurabreak: { onStart(pokemon) { - if (this.suppressingAbility(pokemon)) return; this.add('-ability', pokemon, 'Aura Break'); }, onAnyTryPrimaryHit(target, source, move) { diff --git a/data/mods/gen9ssb/abilities.ts b/data/mods/gen9ssb/abilities.ts index d4cc2cc38fae0..58d5b4fef88eb 100644 --- a/data/mods/gen9ssb/abilities.ts +++ b/data/mods/gen9ssb/abilities.ts @@ -236,7 +236,6 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa desc: "Active Pokemon without this Ability have their Attack multiplied by 0.85x. This Pokemon ignores other Pokemon's stat stages when taking or doing damage.", name: "Clod of Ruin", onStart(pokemon) { - if (this.suppressingAbility(pokemon)) return; this.add('-ability', pokemon, 'Clod of Ruin'); }, onAnyModifyAtk(atk, target, source, move) { diff --git a/sim/battle.ts b/sim/battle.ts index c25b554bfc165..cd92436367a93 100644 --- a/sim/battle.ts +++ b/sim/battle.ts @@ -565,6 +565,11 @@ export class Battle { // it's changed; call it off return relayVar; } + if (eventid === 'SwitchIn' && effect.effectType === 'Ability' && effect.flags['breakable'] && + this.suppressingAbility(target as Pokemon)) { + this.debug(eventid + ' handler suppressed by Mold Breaker'); + return relayVar; + } if (eventid !== 'Start' && eventid !== 'TakeItem' && effect.effectType === 'Item' && (target instanceof Pokemon) && target.ignoringItem()) { this.debug(eventid + ' handler suppressed by Embargo, Klutz or Magic Room'); diff --git a/test/sim/abilities/flowergift.js b/test/sim/abilities/flowergift.js index 1054f84c14969..af125bb07d326 100644 --- a/test/sim/abilities/flowergift.js +++ b/test/sim/abilities/flowergift.js @@ -65,4 +65,16 @@ describe('Flower Gift', () => { battle.makeChoices('auto', 'move blastburn dynamax'); assert(battle.log.every(line => !line.startsWith('|-formechange'))); }); + + it(`should not trigger if dragged in by a Mold Breaker Pokemon`, () => { + battle = common.createBattle([[ + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, + { species: 'Cherrim', ability: 'flowergift', moves: ['sleeptalk'] }, + ], [ + { species: 'Haxorus', ability: 'moldbreaker', moves: ['roar'] }, + ]]); + battle.makeChoices(); + assert.equal(battle.field.weather, 'sunnyday'); + assert.species(battle.p1.active[0], 'Cherrim'); + }); });