[Beta] Fix hit check so Poison-types do not brick semi-invuln. (#4567)
This commit is contained in:
parent
9c56c15a6c
commit
74ea358f18
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue