mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Merge branch 'beta' into damo-MysteryEncounterCollection
This commit is contained in:
commit
a050fba567
16524
public/images/items.json
16524
public/images/items.json
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 58 KiB |
Binary file not shown.
Before Width: | Height: | Size: 915 B After Width: | Height: | Size: 884 B |
@ -1 +1 @@
|
||||
Subproject commit e98f0eb9c2022bc78b53f0444424c636498e725a
|
||||
Subproject commit 833dc40ec7409031fcea147ccbc45ec9c0ba0213
|
@ -3408,8 +3408,12 @@ export class BlockCritAbAttr extends AbAttr {
|
||||
super(false);
|
||||
}
|
||||
|
||||
override apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: BooleanHolder, args: any[]): void {
|
||||
(args[0] as BooleanHolder).value = true;
|
||||
/**
|
||||
* Apply the block crit ability by setting the value in the provided boolean holder to false
|
||||
* @param args - [0] is a boolean holder representing whether the attack can crit
|
||||
*/
|
||||
override apply(_pokemon: Pokemon, _passive: boolean, _simulated: boolean, _cancelled: BooleanHolder, args: [BooleanHolder, ...any]): void {
|
||||
(args[0]).value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -921,16 +921,22 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||
return biomes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the caughtAttr of a given species, sanitized.
|
||||
*
|
||||
* @param otherSpecies The species to check; defaults to current species
|
||||
* @returns caught DexAttr for the species
|
||||
*/
|
||||
isCaught(otherSpecies?: PokemonSpecies): bigint {
|
||||
const species = otherSpecies ? otherSpecies : this.species;
|
||||
|
||||
if (globalScene.dexForDevs) {
|
||||
return 255n;
|
||||
species.getFullUnlocksData();
|
||||
}
|
||||
|
||||
const species = otherSpecies ? otherSpecies : this.species;
|
||||
const dexEntry = globalScene.gameData.dexData[species.speciesId];
|
||||
const starterDexEntry = globalScene.gameData.dexData[this.getStarterSpeciesId(species.speciesId)];
|
||||
|
||||
return (dexEntry?.caughtAttr ?? 0n) & (starterDexEntry?.caughtAttr ?? 0n) & species.getFullUnlocksData();
|
||||
return (dexEntry?.caughtAttr ?? 0n) & species.getFullUnlocksData();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -939,7 +945,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||
*
|
||||
* @param otherSpecies The species to check; defaults to current species
|
||||
* @param otherFormIndex The form index of the form to check; defaults to current form
|
||||
* @returns StarterAttributes for the species
|
||||
* @returns `true` if the form is caught
|
||||
*/
|
||||
isFormCaught(otherSpecies?: PokemonSpecies, otherFormIndex?: number | undefined): boolean {
|
||||
if (globalScene.dexForDevs) {
|
||||
@ -954,6 +960,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||
}
|
||||
|
||||
const isFormCaught = (caughtAttr & globalScene.gameData.getFormAttr(formIndex ?? 0)) > 0n;
|
||||
|
||||
return isFormCaught;
|
||||
}
|
||||
|
||||
@ -1151,7 +1158,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||
this.blockInput = false;
|
||||
} else {
|
||||
ui.revertMode().then(() => {
|
||||
console.log("exitCallback", this.exitCallback);
|
||||
if (this.exitCallback instanceof Function) {
|
||||
const exitCallback = this.exitCallback;
|
||||
this.exitCallback = null;
|
||||
|
1
test/testUtils/saves/data_pokedex_tests_v2.prsv
Normal file
1
test/testUtils/saves/data_pokedex_tests_v2.prsv
Normal file
File diff suppressed because one or more lines are too long
@ -12,6 +12,8 @@ import { DropDownColumn } from "#app/ui/filter-bar";
|
||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import PokedexPageUiHandler from "#app/ui/pokedex-page-ui-handler";
|
||||
import type { StarterAttributes } from "#app/system/game-data";
|
||||
|
||||
/*
|
||||
Information for the `data_pokedex_tests.psrv`:
|
||||
@ -80,6 +82,26 @@ describe("UI - Pokedex", () => {
|
||||
return handler as PokedexUiHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the game to open the pokedex UI.
|
||||
* @returns The handler for the pokedex UI.
|
||||
*/
|
||||
async function runToPokedexPage(
|
||||
species: PokemonSpecies,
|
||||
starterAttributes: StarterAttributes = {},
|
||||
): Promise<PokedexPageUiHandler> {
|
||||
// Open the pokedex UI.
|
||||
await game.runToTitle();
|
||||
|
||||
await game.phaseInterceptor.setOverlayMode(UiMode.POKEDEX_PAGE, species, starterAttributes);
|
||||
|
||||
// Get the handler for the current UI.
|
||||
const handler = game.scene.ui.getHandler();
|
||||
expect(handler).toBeInstanceOf(PokedexPageUiHandler);
|
||||
|
||||
return handler as PokedexPageUiHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute a set of pokemon that have a specific ability in allAbilities
|
||||
* @param ability - The ability to filter for
|
||||
@ -489,4 +511,37 @@ describe("UI - Pokedex", () => {
|
||||
expect(selectedPokemon).toEqual(pokedexHandler.lastSpecies.speciesId);
|
||||
},
|
||||
);
|
||||
|
||||
/****************************
|
||||
* Tests for Pokédex Pages *
|
||||
****************************/
|
||||
|
||||
it("should show caught battle form as caught", async () => {
|
||||
await game.importData("./test/testUtils/saves/data_pokedex_tests_v2.prsv");
|
||||
const pageHandler = await runToPokedexPage(getPokemonSpecies(Species.VENUSAUR), { form: 1 });
|
||||
|
||||
// @ts-expect-error - `species` is private
|
||||
expect(pageHandler.species.speciesId).toEqual(Species.VENUSAUR);
|
||||
|
||||
// @ts-expect-error - `formIndex` is private
|
||||
expect(pageHandler.formIndex).toEqual(1);
|
||||
|
||||
expect(pageHandler.isFormCaught()).toEqual(true);
|
||||
expect(pageHandler.isSeen()).toEqual(true);
|
||||
});
|
||||
|
||||
//TODO: check tint of the sprite
|
||||
it("should show uncaught battle form as seen", async () => {
|
||||
await game.importData("./test/testUtils/saves/data_pokedex_tests_v2.prsv");
|
||||
const pageHandler = await runToPokedexPage(getPokemonSpecies(Species.VENUSAUR), { form: 2 });
|
||||
|
||||
// @ts-expect-error - `species` is private
|
||||
expect(pageHandler.species.speciesId).toEqual(Species.VENUSAUR);
|
||||
|
||||
// @ts-expect-error - `formIndex` is private
|
||||
expect(pageHandler.formIndex).toEqual(2);
|
||||
|
||||
expect(pageHandler.isFormCaught()).toEqual(false);
|
||||
expect(pageHandler.isSeen()).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user