mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 22:02:18 +02:00
Minor revisions
This commit is contained in:
parent
a7481b8c8b
commit
1920fed71d
@ -155,8 +155,7 @@ export class EncounterPhase extends BattlePhase {
|
||||
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||
if (!this.loaded) {
|
||||
this.trySetWeatherIfNewBiome(); // Set weather before session gets saved
|
||||
//@ts-ignore
|
||||
this.scene.gameData.saveAll(this.scene, true, battle.waveIndex % 10 === 1 || this.scene.lastSavePlayTime >= 300).then(success => { // TODO: get rid of ts-ignore
|
||||
this.scene.gameData.saveAll(this.scene, true, battle.waveIndex % 10 === 1 || (this.scene.lastSavePlayTime ?? 0) >= 300).then(success => { // TODO: get rid of ts-ignore
|
||||
this.scene.disableMenu = false;
|
||||
if (!success) {
|
||||
return this.scene.reset(true);
|
||||
|
@ -292,26 +292,6 @@ describe("Test Battle Phase", () => {
|
||||
expect(game.scene.currentBattle.turn).toBeGreaterThan(turn);
|
||||
}, 20000);
|
||||
|
||||
// Made redundant by the "same biome" test, which is copied from this test, should this be removed?
|
||||
it.skip("to next wave with pokemon killed, single", async () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.starterSpecies(Species.MEWTWO);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.startingWave(3);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
await game.startBattle();
|
||||
const waveIndex = game.scene.currentBattle.waveIndex;
|
||||
game.move.select(moveToUse);
|
||||
await game.doKillOpponents();
|
||||
await game.toNextWave();
|
||||
expect(game.scene.currentBattle.waveIndex).toBeGreaterThan(waveIndex);
|
||||
}, 20000);
|
||||
|
||||
it("does not set new weather if staying in same biome", async () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override
|
||||
|
@ -36,7 +36,34 @@ describe("Reload", () => {
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
|
||||
it("should not have RNG or weather inconsistencies after a biome switch", async () => {
|
||||
it("should not have RNG inconsistencies after a biome switch", async () => {
|
||||
game.override
|
||||
.startingWave(10)
|
||||
.battleType("single")
|
||||
.startingLevel(100) // Avoid levelling up
|
||||
.enemyLevel(1000) // Avoid opponent dying before game.doKillOpponents()
|
||||
.disableTrainerWaves()
|
||||
.moveset([Moves.KOWTOW_CLEAVE])
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
await game.dailyMode.startBattle();
|
||||
|
||||
// Transition from Wave 10 to Wave 11 in order to trigger biome switch
|
||||
game.move.select(Moves.KOWTOW_CLEAVE);
|
||||
await game.phaseInterceptor.to("DamagePhase");
|
||||
await game.doKillOpponents();
|
||||
await game.toNextWave();
|
||||
expect(game.phaseInterceptor.log).toContain("NewBiomeEncounterPhase");
|
||||
|
||||
const preReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
await game.reload.reloadSession();
|
||||
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
|
||||
it("should not have weather inconsistencies after a biome switch", async () => {
|
||||
game.override
|
||||
.startingWave(10)
|
||||
.startingBiome(Biome.ICE_CAVE) // Will lead to Snowy Forest with randomly generated weather
|
||||
@ -55,16 +82,13 @@ describe("Reload", () => {
|
||||
await game.toNextWave();
|
||||
expect(game.phaseInterceptor.log).toContain("NewBiomeEncounterPhase");
|
||||
|
||||
const preReloadRngState = Phaser.Math.RND.state();
|
||||
const preReloadWeather = game.scene.arena.weather;
|
||||
|
||||
await game.reload.reloadSession();
|
||||
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
const postReloadWeather = game.scene.arena.weather;
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
expect(preReloadWeather).toStrictEqual(postReloadWeather);
|
||||
expect(postReloadWeather).toStrictEqual(preReloadWeather);
|
||||
}, 20000);
|
||||
|
||||
it("should not have RNG inconsistencies at a Daily run wild Pokemon fight", async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user