From 4553c1c34ffdbbdda2696bbd69315b3b5a294950 Mon Sep 17 00:00:00 2001 From: PrabbyDD <147005742+PrabbyDD@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:20:16 -0700 Subject: [PATCH] [Bug] Fix Octolock Ignores Clear Body, White Smoke, Big Pecks #3876 Pecks, Clear Body, and White Smoke Adding tests for octolock --- src/data/battler-tags.ts | 2 +- src/test/moves/octolock.test.ts | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 2e280634d5d..92df6fc294f 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -767,7 +767,7 @@ export class OctolockTag extends TrappedTag { const shouldLapse = lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType); if (shouldLapse) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.DEF, BattleStat.SPDEF], -1)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, [BattleStat.DEF, BattleStat.SPDEF], -1)); return true; } diff --git a/src/test/moves/octolock.test.ts b/src/test/moves/octolock.test.ts index 389e4a4c4cf..34dad13b0d9 100644 --- a/src/test/moves/octolock.test.ts +++ b/src/test/moves/octolock.test.ts @@ -61,6 +61,48 @@ describe("Moves - Octolock", () => { expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(-2); }); + it("If target pokemon has Big Pecks, Octolock should only reduce spdef by 1", { timeout: 10000 }, async () => { + game.override.enemyAbility(Abilities.BIG_PECKS); + await game.startBattle([Species.GRAPPLOCT]); + + const enemyPokemon = game.scene.getEnemyField(); + + // use Octolock and advance to init phase of next turn to check for stat changes + game.move.select(Moves.OCTOLOCK); + await game.phaseInterceptor.to(TurnInitPhase); + + expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(0); + expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(-1); + }); + + it("If target pokemon has White Smoke, Octolock should not reduce any stats", { timeout: 10000 }, async () => { + game.override.enemyAbility(Abilities.WHITE_SMOKE); + await game.startBattle([Species.GRAPPLOCT]); + + const enemyPokemon = game.scene.getEnemyField(); + + // use Octolock and advance to init phase of next turn to check for stat changes + game.move.select(Moves.OCTOLOCK); + await game.phaseInterceptor.to(TurnInitPhase); + + expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(0); + expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(0); + }); + + it("If target pokemon has Clear Body, Octolock should not reduce any stats", { timeout: 10000 }, async () => { + game.override.enemyAbility(Abilities.CLEAR_BODY); + await game.startBattle([Species.GRAPPLOCT]); + + const enemyPokemon = game.scene.getEnemyField(); + + // use Octolock and advance to init phase of next turn to check for stat changes + game.move.select(Moves.OCTOLOCK); + await game.phaseInterceptor.to(TurnInitPhase); + + expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(0); + expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(0); + }); + it("Traps the target pokemon", { timeout: 10000 }, async () => { await game.startBattle([Species.GRAPPLOCT]);