Skip to content

Commit

Permalink
Magic bounce should not bounce anything during semi-invulnerable state
Browse files Browse the repository at this point in the history
  • Loading branch information
SirzBenjie committed Feb 5, 2025
1 parent 726179a commit 4b61766
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/abilities/magic_bounce.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,23 @@ describe("Abilities - Magic Bounce", () => {
await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.arena.getTagOnSide(ArenaTagType.STICKY_WEB, ArenaTagSide.PLAYER)?.getSourcePokemon()?.getBattlerIndex()).toBe(BattlerIndex.ENEMY);
});

it("should not bounce back status moves that hit through semi-invulnerable states", async () => {
game.override.moveset([ Moves.TOXIC, Moves.CHARM ]);
await game.classicMode.startBattle([ Species.BULBASAUR ]);
game.move.select(Moves.TOXIC);
await game.forceEnemyMove(Moves.FLY);
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]);
await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getEnemyPokemon()!.status?.effect).toBe(StatusEffect.TOXIC);

Check failure on line 341 in src/test/abilities/magic_bounce.test.ts

View workflow job for this annotation

GitHub Actions / Run Tests (6) / Shard 6 of 10

src/test/abilities/magic_bounce.test.ts > Abilities - Magic Bounce > should not bounce back status moves that hit through semi-invulnerable states

AssertionError: expected undefined to be 2 // Object.is equality - Expected: 2 + Received: undefined ❯ src/test/abilities/magic_bounce.test.ts:341:58
expect(game.scene.getPlayerPokemon()!.status).toBeUndefined();

game.override.ability(Abilities.NO_GUARD);
game.move.select(Moves.CHARM);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.ATK)).toBe(-2);
expect(game.scene.getPlayerPokemon()!.getStatStage(Stat.ATK)).toBe(0);
});
});

0 comments on commit 4b61766

Please sign in to comment.