From ffbaf311c6fbe502fc456050f30146fa083551c0 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Thu, 16 Oct 2025 14:27:13 -0700 Subject: [PATCH] [Beta] Pixilate/etc no longer affect non-Normal type moves (#6661) --- src/data/abilities/ability.ts | 4 +-- .../abilities/normal-move-type-change.test.ts | 33 ++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index d9357ff860c..f3eb6244bce 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -1747,9 +1747,7 @@ export class MoveTypeChangeAbAttr extends PreAttackAbAttr { super(false); this.newType = newType; this.powerMultiplier = powerMultiplier; - if (this.condition != null) { - this.condition = condition; - } + this.condition = condition; } /** diff --git a/test/abilities/normal-move-type-change.test.ts b/test/abilities/normal-move-type-change.test.ts index 11ea7a2e5f0..0142f6607e4 100644 --- a/test/abilities/normal-move-type-change.test.ts +++ b/test/abilities/normal-move-type-change.test.ts @@ -46,7 +46,6 @@ describe.each([ game.override .battleStyle("single") .startingLevel(100) - .starterSpecies(SpeciesId.MAGIKARP) .ability(ab) .moveset([MoveId.TACKLE, MoveId.REVELATION_DANCE, MoveId.FURY_SWIPES, MoveId.CRUSH_GRIP]) .enemySpecies(SpeciesId.DUSCLOPS) @@ -56,7 +55,7 @@ describe.each([ }); it(`should change Normal-type attacks to ${tyName} type and boost their power`, async () => { - await game.classicMode.startBattle(); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); const playerPokemon = game.field.getPlayerPokemon(); const typeSpy = vi.spyOn(playerPokemon, "getMoveType"); @@ -75,9 +74,27 @@ describe.each([ expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp()); }); + it("should not affect moves that are not Normal type", async () => { + await game.classicMode.startBattle([SpeciesId.FEEBAS]); + + const feebas = game.field.getPlayerPokemon(); + const typeSpy = vi.spyOn(feebas, "getMoveType"); + + const enemy = game.field.getEnemyPokemon(); + const enemySpy = vi.spyOn(enemy, "getMoveEffectiveness"); + const powerSpy = vi.spyOn(allMoves[MoveId.SHADOW_BALL], "calculateBattlePower"); + + game.move.use(MoveId.SHADOW_BALL); + await game.toEndOfTurn(); + + expect(typeSpy).toHaveLastReturnedWith(PokemonType.GHOST); + expect(enemySpy).toHaveReturnedWith(2); + expect(powerSpy).toHaveReturnedWith(80); + }); + // Regression test to ensure proper ordering of effects it("should still boost variable-power moves", async () => { - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); const playerPokemon = game.field.getPlayerPokemon(); const typeSpy = vi.spyOn(playerPokemon, "getMoveType"); @@ -101,7 +118,7 @@ describe.each([ it("should cause Normal-type attacks to activate Volt Absorb", async () => { game.override.enemyAbility(AbilityId.VOLT_ABSORB); - await game.classicMode.startBattle(); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); const playerPokemon = game.field.getPlayerPokemon(); const tySpy = vi.spyOn(playerPokemon, "getMoveType"); @@ -135,7 +152,7 @@ describe.each([ .moveset([move]) .starterSpecies(SpeciesId.MAGIKARP); - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); const playerPokemon = game.field.getPlayerPokemon(); const tySpy = vi.spyOn(playerPokemon, "getMoveType"); @@ -147,7 +164,7 @@ describe.each([ }); it("should affect all hits of a Normal-type multi-hit move", async () => { - await game.classicMode.startBattle(); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); const playerPokemon = game.field.getPlayerPokemon(); const tySpy = vi.spyOn(playerPokemon, "getMoveType"); @@ -173,7 +190,7 @@ describe.each([ it("should not be affected by silk scarf after changing the move's type", async () => { game.override.startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.NORMAL }]); - await game.classicMode.startBattle(); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); const testMoveInstance = allMoves[MoveId.TACKLE]; @@ -192,7 +209,7 @@ describe.each([ it("should be affected by the type boosting item after changing the move's type", async () => { game.override.startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: ty }]); - await game.classicMode.startBattle(); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); // get the power boost from the ability so we can compare it to the item // @ts-expect-error power multiplier is private