diff --git a/src/data/ability.ts b/src/data/ability.ts index c657582f596..4f8da9d8dd5 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1678,7 +1678,8 @@ export class SynchronizeStatusAbAttr extends PostSetStatusAbAttr { ]); if (sourcePokemon && syncStatuses.has(effect)) { - return sourcePokemon.trySetStatus(effect, true, pokemon); + sourcePokemon.trySetStatus(effect, true, pokemon); + return true; } return false; diff --git a/src/test/abilities/synchronize.test.ts b/src/test/abilities/synchronize.test.ts index f34a6b0103a..3b0218f4428 100644 --- a/src/test/abilities/synchronize.test.ts +++ b/src/test/abilities/synchronize.test.ts @@ -210,6 +210,30 @@ describe("Abilities - Synchronize", () => { expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase"); }, 20000); + it("shows ability even if it fails to set the status of the opponent Pokemon", async () => { + // Arrange + const moveToUse = Moves.THUNDER_WAVE; + + // Starter mocks + vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.PIKACHU); + vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); + vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.STATIC); + + // Act + await game.startBattle(); + game.doAttack(getMovePosition(game.scene, 0, moveToUse)); + + await game.phaseInterceptor.to(MoveEffectPhase, false); + vi.spyOn(game.scene.getCurrentPhase() as MoveEffectPhase, "hitCheck").mockReturnValue(true); + + await game.phaseInterceptor.to(TurnEndPhase); + + // Assert + expect(game.scene.getParty()[0].status?.effect).toBe(undefined); + expect(game.scene.getEnemyParty()[0].status?.effect).toBe(StatusEffect.PARALYSIS); + expect(game.phaseInterceptor.log).toContain("ShowAbilityPhase"); + }, 20000); + it("should activate with Psycho Shift after the move clears the status", async () => { // Arrange const moveToUse = Moves.PSYCHO_SHIFT;