mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-17 01:37:36 +00:00
* Disable Luck in Daily Runs If the Game Mode is Daily Run, the player's Luck is set to 0, and the Luck value is hidden. * Give free map in daily Adds a Map to the player's pool of starting items for Daily Runs. * Disable Eviolite in Daily Runs Disables Eviolite spawning in Daily Run mode. * Write shop test and add new overrides Adds new overrides that allow you to force content to be locked or unlocked These overrides were also added to the OverridesHelper to make them available to tests Adds a new check function for content unlocks, which returns `true` if it is overrode to be unlocked, `false` if it is overrode to be locked, and the unlock data mapped to a Boolean otherwise All existing checks (other than the ones that involve actually unlocking things) for unlockables have been changed to use this Added a pair of new exporting booleans, specifically for my test, that check if Eviolite or Mini Black Hole are in the loot table * Prevent shinies from altering runs Places variant rolls inside of an ExecuteWithSeedOffset block, using the current floor's RNG seed as the seed and the Pokémon's ID as the offset. --------- Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
101 lines
3.1 KiB
TypeScript
101 lines
3.1 KiB
TypeScript
import { MapModifier } from "#app/modifier/modifier";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
import GameManager from "./utils/gameManager";
|
|
import { Moves } from "#app/enums/moves";
|
|
import { Biome } from "#app/enums/biome";
|
|
import { Mode } from "#app/ui/ui";
|
|
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
|
|
|
//const TIMEOUT = 20 * 1000;
|
|
|
|
describe("Daily Mode", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
it("should initialize properly", async () => {
|
|
await game.dailyMode.runToSummon();
|
|
|
|
const party = game.scene.getParty();
|
|
expect(party).toHaveLength(3);
|
|
party.forEach(pkm => {
|
|
expect(pkm.level).toBe(20);
|
|
expect(pkm.moveset.length).toBeGreaterThan(0);
|
|
});
|
|
expect(game.scene.getModifiers(MapModifier).length).toBeGreaterThan(0);
|
|
});
|
|
});
|
|
|
|
describe("Shop modifications", async () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
|
|
game.override
|
|
.startingWave(9)
|
|
.startingBiome(Biome.ICE_CAVE) // Will lead to Snowy Forest with randomly generated weather
|
|
.battleType("single")
|
|
.startingLevel(100) // Avoid levelling up
|
|
.enemyLevel(1000) // Avoid opponent dying before game.doKillOpponents()
|
|
.disableTrainerWaves()
|
|
.moveset([Moves.KOWTOW_CLEAVE])
|
|
.enemyMoveset(Moves.SPLASH);
|
|
game.modifiers
|
|
.addCheck("EVIOLITE")
|
|
.addCheck("MINI_BLACK_HOLE");
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
game.modifiers.clearChecks();
|
|
});
|
|
|
|
it("should not have Eviolite and Mini Black Hole available in Classic if not unlocked", async () => {
|
|
await game.classicMode.startBattle();
|
|
game.move.select(Moves.KOWTOW_CLEAVE);
|
|
await game.phaseInterceptor.to("DamagePhase");
|
|
await game.doKillOpponents();
|
|
await game.phaseInterceptor.to("BattleEndPhase");
|
|
game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => {
|
|
expect(game.scene.ui.getHandler()).toBeInstanceOf(ModifierSelectUiHandler);
|
|
game.modifiers
|
|
.testCheck("EVIOLITE", false)
|
|
.testCheck("MINI_BLACK_HOLE", false);
|
|
});
|
|
});
|
|
|
|
it("should have Eviolite and Mini Black Hole available in Daily", async () => {
|
|
await game.dailyMode.startBattle();
|
|
game.move.select(Moves.KOWTOW_CLEAVE);
|
|
await game.phaseInterceptor.to("DamagePhase");
|
|
await game.doKillOpponents();
|
|
await game.phaseInterceptor.to("BattleEndPhase");
|
|
game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => {
|
|
expect(game.scene.ui.getHandler()).toBeInstanceOf(ModifierSelectUiHandler);
|
|
game.modifiers
|
|
.testCheck("EVIOLITE", true)
|
|
.testCheck("MINI_BLACK_HOLE", true);
|
|
});
|
|
});
|
|
});
|