diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 3e51415922a..4b270538850 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -569,7 +569,7 @@ export class InterruptedTag extends BattlerTag { super.onAdd(pokemon); pokemon.getMoveQueue().shift(); - pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.OTHER, targets: [] }); + pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.OTHER, targets: []}); } lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { diff --git a/src/data/move.ts b/src/data/move.ts index 1fc79a4b2db..034bbc53829 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2577,7 +2577,7 @@ export class ChargeAttr extends OverrideMoveEffectAttr { applyMoveAttrs(MoveEffectAttr, user, target, move); } const isVirtual = args[1] as boolean; - user.pushMoveHistory({ move: move.id, targets: [ target.getBattlerIndex() ], result: MoveResult.OTHER}); + user.pushMoveHistory({ move: move.id, targets: [ target.getBattlerIndex() ], result: MoveResult.OTHER }); user.getMoveQueue().push({ move: move.id, targets: [ target.getBattlerIndex() ], virtual: isVirtual }); user.addTag(BattlerTagType.CHARGING, 1, move.id, user.id); resolve(true); @@ -5811,7 +5811,7 @@ export class RandomMovesetMoveAttr extends CallMoveAttr { if (this.includeParty) { allies = user.isPlayer() ? user.scene.getParty() : user.scene.getEnemyParty(); } else { - allies = [user]; + allies = [ user ]; } const partyMoveset = allies.map(p => p.moveset).flat(); const moves = partyMoveset.filter(m => !this.invalidMoves.includes(m!.moveId) && !m!.getMove().name.endsWith(" (N)")); diff --git a/src/test/moves/metronome.test.ts b/src/test/moves/metronome.test.ts index 67514896290..7731934dea4 100644 --- a/src/test/moves/metronome.test.ts +++ b/src/test/moves/metronome.test.ts @@ -1,5 +1,4 @@ import { SemiInvulnerableTag } from "#app/data/battler-tags"; -import { getMoveTargets } from "#app/data/move"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import { Moves } from "#enums/moves"; @@ -25,7 +24,7 @@ describe("Moves - Metronome", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset([Moves.METRONOME, Moves.SPLASH]) + .moveset([ Moves.METRONOME, Moves.SPLASH ]) .battleType("single") .startingLevel(100) .starterSpecies(Species.REGIELEKI) @@ -81,7 +80,7 @@ describe("Moves - Metronome", () => { it("should only target ally for Aromatic Mist", async () => { game.override.battleType("double"); - await game.classicMode.startBattle([Species.REGIELEKI, Species.RATTATA]); + await game.classicMode.startBattle([ Species.REGIELEKI, Species.RATTATA ]); const [ leftPlayer, rightPlayer ] = game.scene.getPlayerField(); const [ leftOpp, rightOpp ] = game.scene.getEnemyField(); vi.spyOn(leftPlayer, "randSeedInt").mockReturnValue(Moves.AROMATIC_MIST); @@ -98,16 +97,15 @@ describe("Moves - Metronome", () => { expect(rightOpp.getStatStage(Stat.SPDEF)).toBe(0); }); - it("should be able to target itself or its ally with Acupressure", {repeats: 20}, async () => { - game.override.battleType("double"); - await game.classicMode.startBattle([Species.REGIELEKI, Species.RATTATA]); - const [ leftPlayer, rightPlayer ] = game.scene.getPlayerField(); - vi.spyOn(leftPlayer, "randSeedInt").mockReturnValue(Moves.ACUPRESSURE); + // it("should be able to target itself or its ally with Acupressure", { repeats: 20 }, async () => { + // game.override.battleType("double"); + // await game.classicMode.startBattle([ Species.REGIELEKI, Species.RATTATA ]); + // vi.spyOn(leftPlayer, "randSeedInt").mockReturnValue(Moves.ACUPRESSURE); - // game.move.select(Moves.METRONOME); - // game.move.select(Moves.SPLASH, 1); - // await game.phaseInterceptor.to("MoveEffectPhase"); - // await game.move.forceHit(); - // await game.toNextTurn(); - }); + // // game.move.select(Moves.METRONOME); + // // game.move.select(Moves.SPLASH, 1); + // // await game.phaseInterceptor.to("MoveEffectPhase"); + // // await game.move.forceHit(); + // // await game.toNextTurn(); + // }); }); diff --git a/src/test/moves/spit_up.test.ts b/src/test/moves/spit_up.test.ts index f3bf6de21c4..96511b3bdfb 100644 --- a/src/test/moves/spit_up.test.ts +++ b/src/test/moves/spit_up.test.ts @@ -124,7 +124,7 @@ describe("Moves - Spit Up", () => { game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(TurnInitPhase); - expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.FAIL, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ] }); + expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.FAIL, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ]}); expect(spitUp.calculateBattlePower).not.toHaveBeenCalled(); }); @@ -147,7 +147,7 @@ describe("Moves - Spit Up", () => { await game.phaseInterceptor.to(TurnInitPhase); - expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ] }); + expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ]}); expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce(); @@ -175,7 +175,7 @@ describe("Moves - Spit Up", () => { game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(TurnInitPhase); - expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ] }); + expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ]}); expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce(); diff --git a/src/test/moves/stockpile.test.ts b/src/test/moves/stockpile.test.ts index 1485b739586..3271a12e02f 100644 --- a/src/test/moves/stockpile.test.ts +++ b/src/test/moves/stockpile.test.ts @@ -71,7 +71,7 @@ describe("Moves - Stockpile", () => { expect(user.getStatStage(Stat.SPDEF)).toBe(3); expect(stockpilingTag).toBeDefined(); expect(stockpilingTag.stockpiledCount).toBe(3); - expect(user.getMoveHistory().at(-1)).toMatchObject({ result: MoveResult.FAIL, move: Moves.STOCKPILE, targets: [ user.getBattlerIndex() ] }); + expect(user.getMoveHistory().at(-1)).toMatchObject({ result: MoveResult.FAIL, move: Moves.STOCKPILE, targets: [ user.getBattlerIndex() ]}); } } }); diff --git a/src/test/moves/swallow.test.ts b/src/test/moves/swallow.test.ts index 0e07e704541..786cdbd9b4c 100644 --- a/src/test/moves/swallow.test.ts +++ b/src/test/moves/swallow.test.ts @@ -134,7 +134,7 @@ describe("Moves - Swallow", () => { game.move.select(Moves.SWALLOW); await game.phaseInterceptor.to(TurnInitPhase); - expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.FAIL, targets: [ pokemon.getBattlerIndex() ] }); + expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.FAIL, targets: [ pokemon.getBattlerIndex() ]}); }); describe("restores stat stage boosts granted by stacks", () => { @@ -155,7 +155,7 @@ describe("Moves - Swallow", () => { await game.phaseInterceptor.to(TurnInitPhase); - expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.SUCCESS, targets: [ pokemon.getBattlerIndex() ] }); + expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.SUCCESS, targets: [ pokemon.getBattlerIndex() ]}); expect(pokemon.getStatStage(Stat.DEF)).toBe(0); expect(pokemon.getStatStage(Stat.SPDEF)).toBe(0); @@ -182,7 +182,7 @@ describe("Moves - Swallow", () => { await game.phaseInterceptor.to(TurnInitPhase); - expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.SUCCESS, targets: [ pokemon.getBattlerIndex() ] }); + expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.SUCCESS, targets: [ pokemon.getBattlerIndex() ]}); expect(pokemon.getStatStage(Stat.DEF)).toBe(1); expect(pokemon.getStatStage(Stat.SPDEF)).toBe(-2);