diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 33f2394cd1e..7730a32eaa2 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -407,7 +407,7 @@ export class MoveEffectPhase extends PokemonPhase { const semiInvulnerableTag = target.getTag(SemiInvulnerableTag); if (semiInvulnerableTag && !this.move.getMove().getAttrs(HitsTagAttr).some(hta => hta.tagType === semiInvulnerableTag.tagType) - && !(this.move.getMove().getAttrs(ToxicAccuracyAttr) && user.isOfType(Type.POISON)) + && !(this.move.getMove().hasAttr(ToxicAccuracyAttr) && user.isOfType(Type.POISON)) ) { return false; } diff --git a/src/test/moves/toxic.test.ts b/src/test/moves/toxic.test.ts index 2d023c201c1..bfc41c8c92d 100644 --- a/src/test/moves/toxic.test.ts +++ b/src/test/moves/toxic.test.ts @@ -73,4 +73,17 @@ describe("Moves - Toxic", () => { expect(game.scene.getEnemyPokemon()!.status).toBeUndefined(); }); + + it("moves other than Toxic should not hit semi-invulnerable targets even if user is Poison-type", async () => { + game.override.moveset(Moves.SWIFT); + game.override.enemyMoveset(Moves.FLY); + await game.classicMode.startBattle([Species.TOXAPEX]); + + game.move.select(Moves.SWIFT); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to("BerryPhase", false); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + }); });