[Beta] Pixilate/etc no longer affect non-Normal type moves (#6661)

This commit is contained in:
NightKev 2025-10-16 14:27:13 -07:00 committed by GitHub
parent 95cc9f6d49
commit ffbaf311c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 11 deletions

View File

@ -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;
}
/**

View File

@ -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