mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 06:45:24 +01:00
[Beta] Pixilate/etc no longer affect non-Normal type moves (#6661)
This commit is contained in:
parent
95cc9f6d49
commit
ffbaf311c6
@ -1747,9 +1747,7 @@ export class MoveTypeChangeAbAttr extends PreAttackAbAttr {
|
|||||||
super(false);
|
super(false);
|
||||||
this.newType = newType;
|
this.newType = newType;
|
||||||
this.powerMultiplier = powerMultiplier;
|
this.powerMultiplier = powerMultiplier;
|
||||||
if (this.condition != null) {
|
this.condition = condition;
|
||||||
this.condition = condition;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -46,7 +46,6 @@ describe.each([
|
|||||||
game.override
|
game.override
|
||||||
.battleStyle("single")
|
.battleStyle("single")
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.starterSpecies(SpeciesId.MAGIKARP)
|
|
||||||
.ability(ab)
|
.ability(ab)
|
||||||
.moveset([MoveId.TACKLE, MoveId.REVELATION_DANCE, MoveId.FURY_SWIPES, MoveId.CRUSH_GRIP])
|
.moveset([MoveId.TACKLE, MoveId.REVELATION_DANCE, MoveId.FURY_SWIPES, MoveId.CRUSH_GRIP])
|
||||||
.enemySpecies(SpeciesId.DUSCLOPS)
|
.enemySpecies(SpeciesId.DUSCLOPS)
|
||||||
@ -56,7 +55,7 @@ describe.each([
|
|||||||
});
|
});
|
||||||
|
|
||||||
it(`should change Normal-type attacks to ${tyName} type and boost their power`, async () => {
|
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 playerPokemon = game.field.getPlayerPokemon();
|
||||||
const typeSpy = vi.spyOn(playerPokemon, "getMoveType");
|
const typeSpy = vi.spyOn(playerPokemon, "getMoveType");
|
||||||
@ -75,9 +74,27 @@ describe.each([
|
|||||||
expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp());
|
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
|
// Regression test to ensure proper ordering of effects
|
||||||
it("should still boost variable-power moves", async () => {
|
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 playerPokemon = game.field.getPlayerPokemon();
|
||||||
const typeSpy = vi.spyOn(playerPokemon, "getMoveType");
|
const typeSpy = vi.spyOn(playerPokemon, "getMoveType");
|
||||||
@ -101,7 +118,7 @@ describe.each([
|
|||||||
it("should cause Normal-type attacks to activate Volt Absorb", async () => {
|
it("should cause Normal-type attacks to activate Volt Absorb", async () => {
|
||||||
game.override.enemyAbility(AbilityId.VOLT_ABSORB);
|
game.override.enemyAbility(AbilityId.VOLT_ABSORB);
|
||||||
|
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
const playerPokemon = game.field.getPlayerPokemon();
|
const playerPokemon = game.field.getPlayerPokemon();
|
||||||
const tySpy = vi.spyOn(playerPokemon, "getMoveType");
|
const tySpy = vi.spyOn(playerPokemon, "getMoveType");
|
||||||
@ -135,7 +152,7 @@ describe.each([
|
|||||||
.moveset([move])
|
.moveset([move])
|
||||||
.starterSpecies(SpeciesId.MAGIKARP);
|
.starterSpecies(SpeciesId.MAGIKARP);
|
||||||
|
|
||||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
const playerPokemon = game.field.getPlayerPokemon();
|
const playerPokemon = game.field.getPlayerPokemon();
|
||||||
const tySpy = vi.spyOn(playerPokemon, "getMoveType");
|
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 () => {
|
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 playerPokemon = game.field.getPlayerPokemon();
|
||||||
const tySpy = vi.spyOn(playerPokemon, "getMoveType");
|
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 () => {
|
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 }]);
|
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];
|
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 () => {
|
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 }]);
|
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
|
// get the power boost from the ability so we can compare it to the item
|
||||||
// @ts-expect-error power multiplier is private
|
// @ts-expect-error power multiplier is private
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user