mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Fix interaction between Wonder Guard and typeless moves (#11548)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
This commit is contained in:
parent
00fe920ec0
commit
6e5e42e1d3
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user