From 6e5e42e1d34f8df3d04cea55a640cb336e286daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= <80102738+andrebastosdias@users.noreply.github.com> Date: Fri, 31 Oct 2025 23:31:59 +0000 Subject: [PATCH] Fix interaction between Wonder Guard and typeless moves (#11548) --- data/abilities.ts | 2 +- data/mods/gen4/abilities.ts | 2 +- test/sim/abilities/wonderguard.js | 35 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/data/abilities.ts b/data/abilities.ts index 1c35e743d0..5a11e4b865 100644 --- a/data/abilities.ts +++ b/data/abilities.ts @@ -5478,7 +5478,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, wonderguard: { onTryHit(target, source, move) { - if (target === source || move.category === 'Status' || move.type === '???' || move.id === 'struggle') return; + if (target === source || move.category === 'Status' || move.id === 'struggle') return; if (move.id === 'skydrop' && !source.volatiles['skydrop']) return; this.debug('Wonder Guard immunity: ' + move.id); if (target.runEffectiveness(move) <= 0 || !target.runImmunity(move)) { diff --git a/data/mods/gen4/abilities.ts b/data/mods/gen4/abilities.ts index 3300758ce7..e1af9904bf 100644 --- a/data/mods/gen4/abilities.ts +++ b/data/mods/gen4/abilities.ts @@ -549,7 +549,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa this.hint("In Gen 4, Fire Fang is always able to hit through Wonder Guard.", true, target.side); return; } - if (target === source || move.category === 'Status' || move.type === '???' || move.id === 'struggle') return; + if (target === source || move.category === 'Status' || move.type === '???') return; this.debug('Wonder Guard immunity: ' + move.id); if (target.runEffectiveness(move) <= 0 || !target.runImmunity(move)) { this.add('-immune', target, '[from] ability: Wonder Guard'); diff --git a/test/sim/abilities/wonderguard.js b/test/sim/abilities/wonderguard.js index 8ace51543a..54739b773f 100644 --- a/test/sim/abilities/wonderguard.js +++ b/test/sim/abilities/wonderguard.js @@ -53,4 +53,39 @@ describe('Wonder Guard', () => { battle.makeChoices(); assert(battle.log.some(line => line.includes('|-immune|p2a: Muk|[from] ability: Wonder Guard'))); }); + + it('should not make the user immune to Struggle', () => { + battle = common.createBattle([[ + { species: 'Pawmot', moves: ['sleeptalk'] }, + ], [ + { species: 'Shedinja', ability: 'wonderguard', moves: ['sleeptalk', 'disable'] }, + ]]); + battle.makeChoices('move sleeptalk', 'move disable'); + assert.hurts(battle.p2.active[0], () => battle.makeChoices()); + }); + + it('should make the user immune to typeless moves', () => { + battle = common.createBattle([[ + { species: 'Arcanine', moves: ['burnup', 'revelationdance'] }, + ], [ + { species: 'Clefable', moves: ['sleeptalk'] }, + { species: 'Shedinja', ability: 'wonderguard', moves: ['sleeptalk'] }, + ]]); + battle.makeChoices('move burnup', 'move sleeptalk'); + battle.makeChoices('move revelationdance', 'switch 2'); + assert.fullHP(battle.p2.active[0]); + }); + + describe('[Gen 4]', () => { + it('should not make the user immune to typeless moves', () => { + battle = common.gen(4).createBattle([[ + { species: 'Jirachi', moves: ['doomdesire', 'beatup', 'sleeptalk'] }, + ], [ + { species: 'Clefable', ability: 'wonderguard', moves: ['sleeptalk'] }, + ]]); + battle.makeChoices('move doomdesire', 'move sleeptalk'); + assert.hurts(battle.p2.active[0], () => battle.makeChoices('move beatup', 'move sleeptalk')); + assert.hurts(battle.p2.active[0], () => battle.makeChoices('move sleeptalk', 'move sleeptalk')); + }); + }); });