diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index e71b2551e96..99ab116a032 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -9571,7 +9571,7 @@ export function initMoves() { new AttackMove(MoveId.CLOSE_COMBAT, PokemonType.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 4) .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], -1, true), new AttackMove(MoveId.PAYBACK, PokemonType.DARK, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 4) - // Payback boosts power on enemy item use + // Payback boosts power on item use .attr(MovePowerMultiplierAttr, (_user, target) => target.turnData.acted || globalScene.currentBattle.turnCommands[target.getBattlerIndex()]?.command === Command.BALL ? 2 : 1), new AttackMove(MoveId.ASSURANCE, PokemonType.DARK, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 4) .attr(MovePowerMultiplierAttr, (user, target, move) => target.turnData.damageTaken > 0 ? 2 : 1), diff --git a/src/phases/attempt-capture-phase.ts b/src/phases/attempt-capture-phase.ts index f4e6725935a..e8341974274 100644 --- a/src/phases/attempt-capture-phase.ts +++ b/src/phases/attempt-capture-phase.ts @@ -25,6 +25,7 @@ import i18next from "i18next"; import { globalScene } from "#app/global-scene"; import { Gender } from "#app/data/gender"; +// TODO: Refactor and split up to allow for overriding capture chance export class AttemptCapturePhase extends PokemonPhase { public readonly phaseName = "AttemptCapturePhase"; private pokeballType: PokeballType; diff --git a/test/moves/first-attack-double-power.test.ts b/test/moves/first-attack-double-power.test.ts index 97c2327e1df..0c63cc24832 100644 --- a/test/moves/first-attack-double-power.test.ts +++ b/test/moves/first-attack-double-power.test.ts @@ -27,7 +27,7 @@ describe("Moves - Fishious Rend & Bolt Beak", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .ability(AbilityId.BALL_FETCH) + .ability(AbilityId.STURDY) .battleStyle("single") .battleType(BattleType.TRAINER) .criticalHits(false) @@ -77,7 +77,7 @@ describe("Moves - Fishious Rend & Bolt Beak", () => { it("should double power on the turn the target switches in", async () => { await game.classicMode.startBattle([SpeciesId.FEEBAS]); - game.move.select(MoveId.BOLT_BEAK); + game.move.use(MoveId.BOLT_BEAK); game.forceEnemyToSwitch(); await game.toEndOfTurn(); @@ -87,7 +87,7 @@ describe("Moves - Fishious Rend & Bolt Beak", () => { it("should double power on forced switch-induced sendouts", async () => { await game.classicMode.startBattle([SpeciesId.FEEBAS]); - game.move.select(MoveId.BOLT_BEAK); + game.move.use(MoveId.BOLT_BEAK); await game.move.forceEnemyMove(MoveId.U_TURN); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toEndOfTurn(); diff --git a/test/moves/payback.test.ts b/test/moves/payback.test.ts index 95ccb8c5496..0c32037a58e 100644 --- a/test/moves/payback.test.ts +++ b/test/moves/payback.test.ts @@ -1,7 +1,8 @@ -import { allMoves, allSpecies } from "#app/data/data-lists"; +import { allMoves } from "#app/data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; import { SpeciesId } from "#enums/species-id"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; @@ -31,7 +32,8 @@ describe("Move - Payback", () => { .enemyLevel(100) .enemySpecies(SpeciesId.DRACOVISH) .enemyAbility(AbilityId.BALL_FETCH) - .enemyMoveset(MoveId.SPLASH); + .enemyMoveset(MoveId.SPLASH) + .startingModifier([{ name: "POKEBALL", count: 5 }]); powerSpy = vi.spyOn(allMoves[MoveId.PAYBACK], "calculateBattlePower"); }); @@ -54,12 +56,11 @@ describe("Move - Payback", () => { expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.PAYBACK].power); }); - it("should trigger for enemies on player failed ball catch", async () => { - // Make dracovish uncatchable so we don't flake out - vi.spyOn(allSpecies[SpeciesId.DRACOVISH], "catchRate", "get").mockReturnValue(0); + // TODO: Enable test once ability to force catch failure is added + it.todo("should trigger for enemies on player failed ball catch", async () => { await game.classicMode.startBattle([SpeciesId.FEEBAS]); - game.doThrowPokeball(0); + game.doThrowPokeball(PokeballType.POKEBALL); await game.move.forceEnemyMove(MoveId.PAYBACK); await game.toEndOfTurn(); diff --git a/test/testUtils/gameManager.ts b/test/testUtils/gameManager.ts index b9f499d4e0c..ccd9b3b787a 100644 --- a/test/testUtils/gameManager.ts +++ b/test/testUtils/gameManager.ts @@ -57,6 +57,7 @@ import TextInterceptor from "#test/testUtils/TextInterceptor"; import { AES, enc } from "crypto-js"; import fs from "node:fs"; import { expect, vi } from "vitest"; +import type { PokeballType } from "#enums/pokeball"; /** * Class to manage the game state and transitions between phases. @@ -511,9 +512,9 @@ export default class GameManager { /** * Select the BALL option from the command menu, then press Action; in the BALL * menu, select a pokéball type and press Action again to throw it. - * @param ballIndex - The index of the pokeball to throw + * @param ballIndex - The {@linkcode PokeballType} to throw */ - public doThrowPokeball(ballIndex: number) { + public doThrowPokeball(ballIndex: PokeballType) { this.onNextPrompt("CommandPhase", UiMode.COMMAND, () => { (this.scene.ui.getHandler() as CommandUiHandler).setCursor(1); (this.scene.ui.getHandler() as CommandUiHandler).processInput(Button.ACTION);