mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-06 23:49:26 +02:00
[Bug] Fix Thrash continuing on caught Pokemon (#6144)
Fix Thrash continuing on caught Pokemon
This commit is contained in:
parent
ab394db9cf
commit
2e3a7d47e0
@ -279,6 +279,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
globalScene.updateModifiers(true);
|
globalScene.updateModifiers(true);
|
||||||
removePokemon();
|
removePokemon();
|
||||||
if (newPokemon) {
|
if (newPokemon) {
|
||||||
|
newPokemon.leaveField(true, true, false);
|
||||||
newPokemon.loadAssets().then(end);
|
newPokemon.loadAssets().then(end);
|
||||||
} else {
|
} else {
|
||||||
end();
|
end();
|
||||||
|
37
test/phases/capture-phase.test.ts
Normal file
37
test/phases/capture-phase.test.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { AbilityId } from "#enums/ability-id";
|
||||||
|
import { MoveId } from "#enums/move-id";
|
||||||
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
import { GameManager } from "#test/test-utils/game-manager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, it } from "vitest";
|
||||||
|
|
||||||
|
describe("Capture Phase", () => {
|
||||||
|
let phaserGame: Phaser.Game;
|
||||||
|
let game: GameManager;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
phaserGame = new Phaser.Game({
|
||||||
|
type: Phaser.HEADLESS,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
game.phaseInterceptor.restoreOg();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
game = new GameManager(phaserGame);
|
||||||
|
game.override
|
||||||
|
.ability(AbilityId.BALL_FETCH)
|
||||||
|
.battleStyle("single")
|
||||||
|
.criticalHits(false)
|
||||||
|
.enemySpecies(SpeciesId.MAGIKARP)
|
||||||
|
.enemyAbility(AbilityId.BALL_FETCH)
|
||||||
|
.enemyMoveset(MoveId.SPLASH)
|
||||||
|
.startingLevel(100)
|
||||||
|
.enemyLevel(100);
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: write test and enable once the phase's logic has been refactored
|
||||||
|
it.todo("should reset the captured Pokemon's temporary data");
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user