mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-23 07:49:36 +02:00
[Bug] Potential fix for Expert Breeder's Pokemon being invisible
This commit is contained in:
parent
8981f0e7a8
commit
b5a812b0e3
@ -245,7 +245,7 @@ export const TheExpertPokemonBreederEncounter: MysteryEncounter =
|
|||||||
}
|
}
|
||||||
|
|
||||||
encounter.onGameOver = onGameOver;
|
encounter.onGameOver = onGameOver;
|
||||||
initBattleWithEnemyConfig(scene, config);
|
return initBattleWithEnemyConfig(scene, config);
|
||||||
})
|
})
|
||||||
.withPostOptionPhase(async (scene: BattleScene) => {
|
.withPostOptionPhase(async (scene: BattleScene) => {
|
||||||
await doPostEncounterCleanup(scene);
|
await doPostEncounterCleanup(scene);
|
||||||
@ -297,7 +297,7 @@ export const TheExpertPokemonBreederEncounter: MysteryEncounter =
|
|||||||
}
|
}
|
||||||
|
|
||||||
encounter.onGameOver = onGameOver;
|
encounter.onGameOver = onGameOver;
|
||||||
initBattleWithEnemyConfig(scene, config);
|
return initBattleWithEnemyConfig(scene, config);
|
||||||
})
|
})
|
||||||
.withPostOptionPhase(async (scene: BattleScene) => {
|
.withPostOptionPhase(async (scene: BattleScene) => {
|
||||||
await doPostEncounterCleanup(scene);
|
await doPostEncounterCleanup(scene);
|
||||||
@ -349,7 +349,7 @@ export const TheExpertPokemonBreederEncounter: MysteryEncounter =
|
|||||||
}
|
}
|
||||||
|
|
||||||
encounter.onGameOver = onGameOver;
|
encounter.onGameOver = onGameOver;
|
||||||
initBattleWithEnemyConfig(scene, config);
|
return initBattleWithEnemyConfig(scene, config);
|
||||||
})
|
})
|
||||||
.withPostOptionPhase(async (scene: BattleScene) => {
|
.withPostOptionPhase(async (scene: BattleScene) => {
|
||||||
await doPostEncounterCleanup(scene);
|
await doPostEncounterCleanup(scene);
|
||||||
|
@ -124,10 +124,31 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the trainer", async () => {
|
it("should start battle against the trainer with correctly loaded assets", async () => {
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER, defaultParty);
|
||||||
|
|
||||||
|
let successfullyLoaded = false;
|
||||||
|
vi.spyOn(scene, "getEnemyParty").mockImplementation(() => {
|
||||||
|
const ace = scene.currentBattle?.enemyParty[0];
|
||||||
|
if (ace) {
|
||||||
|
// Pretend that loading assets takes an extra 500ms
|
||||||
|
vi.spyOn(ace, "loadAssets").mockImplementation(() => new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
successfullyLoaded = true;
|
||||||
|
resolve();
|
||||||
|
}, 500);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
return scene.currentBattle?.enemyParty || [];
|
||||||
|
});
|
||||||
|
|
||||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||||
|
|
||||||
|
// Check that assets are successfully loaded
|
||||||
|
expect(successfullyLoaded).toBe(true);
|
||||||
|
|
||||||
|
// Check usual battle stuff
|
||||||
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
|
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
|
||||||
expect(scene.currentBattle.trainer).toBeDefined();
|
expect(scene.currentBattle.trainer).toBeDefined();
|
||||||
expect(scene.currentBattle.mysteryEncounter?.encounterMode).toBe(MysteryEncounterMode.TRAINER_BATTLE);
|
expect(scene.currentBattle.mysteryEncounter?.encounterMode).toBe(MysteryEncounterMode.TRAINER_BATTLE);
|
||||||
@ -182,10 +203,31 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the trainer", async () => {
|
it("should start battle against the trainer with correctly loaded assets", async () => {
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER, defaultParty);
|
||||||
|
|
||||||
|
let successfullyLoaded = false;
|
||||||
|
vi.spyOn(scene, "getEnemyParty").mockImplementation(() => {
|
||||||
|
const ace = scene.currentBattle?.enemyParty[0];
|
||||||
|
if (ace) {
|
||||||
|
// Pretend that loading assets takes an extra 500ms
|
||||||
|
vi.spyOn(ace, "loadAssets").mockImplementation(() => new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
successfullyLoaded = true;
|
||||||
|
resolve();
|
||||||
|
}, 500);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
return scene.currentBattle?.enemyParty || [];
|
||||||
|
});
|
||||||
|
|
||||||
await runMysteryEncounterToEnd(game, 2, undefined, true);
|
await runMysteryEncounterToEnd(game, 2, undefined, true);
|
||||||
|
|
||||||
|
// Check that assets are successfully loaded
|
||||||
|
expect(successfullyLoaded).toBe(true);
|
||||||
|
|
||||||
|
// Check usual battle stuff
|
||||||
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
|
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
|
||||||
expect(scene.currentBattle.trainer).toBeDefined();
|
expect(scene.currentBattle.trainer).toBeDefined();
|
||||||
expect(scene.currentBattle.mysteryEncounter?.encounterMode).toBe(MysteryEncounterMode.TRAINER_BATTLE);
|
expect(scene.currentBattle.mysteryEncounter?.encounterMode).toBe(MysteryEncounterMode.TRAINER_BATTLE);
|
||||||
@ -240,10 +282,31 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the trainer", async () => {
|
it("should start battle against the trainer with correctly loaded assets", async () => {
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER, defaultParty);
|
||||||
|
|
||||||
|
let successfullyLoaded = false;
|
||||||
|
vi.spyOn(scene, "getEnemyParty").mockImplementation(() => {
|
||||||
|
const ace = scene.currentBattle?.enemyParty[0];
|
||||||
|
if (ace) {
|
||||||
|
// Pretend that loading assets takes an extra 500ms
|
||||||
|
vi.spyOn(ace, "loadAssets").mockImplementation(() => new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
successfullyLoaded = true;
|
||||||
|
resolve();
|
||||||
|
}, 500);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
return scene.currentBattle?.enemyParty || [];
|
||||||
|
});
|
||||||
|
|
||||||
await runMysteryEncounterToEnd(game, 3, undefined, true);
|
await runMysteryEncounterToEnd(game, 3, undefined, true);
|
||||||
|
|
||||||
|
// Check that assets are successfully loaded
|
||||||
|
expect(successfullyLoaded).toBe(true);
|
||||||
|
|
||||||
|
// Check usual battle stuff
|
||||||
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
|
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
|
||||||
expect(scene.currentBattle.trainer).toBeDefined();
|
expect(scene.currentBattle.trainer).toBeDefined();
|
||||||
expect(scene.currentBattle.mysteryEncounter?.encounterMode).toBe(MysteryEncounterMode.TRAINER_BATTLE);
|
expect(scene.currentBattle.mysteryEncounter?.encounterMode).toBe(MysteryEncounterMode.TRAINER_BATTLE);
|
||||||
|
Loading…
Reference in New Issue
Block a user