mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-28 19:22:29 +02:00
Prevolutions are shown properly again; battle forms are considered caught as long as the base form is caught
This commit is contained in:
parent
05d11b40fc
commit
a71015e97c
@ -659,7 +659,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
// This takes care of Cosplay Pikachu (Pichu is not shown)
|
// This takes care of Cosplay Pikachu (Pichu is not shown)
|
||||||
(preSpecies.forms.some(form => form.formKey === species.forms[formIndex]?.formKey)) ||
|
(preSpecies.forms.some(form => form.formKey === species.forms[formIndex]?.formKey)) ||
|
||||||
// This takes care of Gholdengo
|
// This takes care of Gholdengo
|
||||||
(preSpecies.forms.length > 0 && species.forms.length === 0)
|
(preSpecies.forms.length > 0 && species.forms.length === 0) ||
|
||||||
|
// This takes care of everything else
|
||||||
|
(preSpecies.forms.length === 0 && (species.forms.length === 0 || species.forms[formIndex]?.formKey === ""))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
// This takes care of Burmy, Shellos etc
|
// This takes care of Burmy, Shellos etc
|
||||||
@ -729,6 +731,16 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
return biomes;
|
return biomes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isFormCaught(): boolean {
|
||||||
|
const allFormChanges = pokemonFormChanges.hasOwnProperty(this.species.speciesId) ? pokemonFormChanges[this.species.speciesId] : [];
|
||||||
|
// This shows battle forms such as megas and gmax as unlocked.
|
||||||
|
const formChangeAccess = allFormChanges.filter(f => (f.formKey === this.species.forms[this.formIndex].formKey)).length > 0;
|
||||||
|
const isFormCaught = this.speciesStarterDexEntry ?
|
||||||
|
(this.speciesStarterDexEntry.caughtAttr & globalScene.gameData.getFormAttr(this.formIndex ?? 0)) > 0n || formChangeAccess
|
||||||
|
: false;
|
||||||
|
return isFormCaught;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the starter attributes for the given PokemonSpecies, after sanitizing them.
|
* Get the starter attributes for the given PokemonSpecies, after sanitizing them.
|
||||||
* If somehow a preference is set for a form, variant, gender, ability or nature
|
* If somehow a preference is set for a form, variant, gender, ability or nature
|
||||||
@ -882,7 +894,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
let error = false;
|
let error = false;
|
||||||
|
|
||||||
const isCaught = this.speciesStarterDexEntry?.caughtAttr;
|
const isCaught = this.speciesStarterDexEntry?.caughtAttr;
|
||||||
const isFormCaught = (this.speciesStarterDexEntry!.caughtAttr! & globalScene.gameData.getFormAttr(this.formIndex ?? 0)) > 0n;
|
const isFormCaught = this.isFormCaught();
|
||||||
|
|
||||||
if (this.blockInputOverlay) {
|
if (this.blockInputOverlay) {
|
||||||
if (button === Button.CANCEL || button === Button.ACTION) {
|
if (button === Button.CANCEL || button === Button.ACTION) {
|
||||||
@ -1820,10 +1832,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let isFormCaught: Boolean = false;
|
const isFormCaught = this.isFormCaught();
|
||||||
if (this.speciesStarterDexEntry) {
|
|
||||||
isFormCaught = (this.speciesStarterDexEntry?.caughtAttr! & globalScene.gameData.getFormAttr(this.formIndex ?? 0)) > 0n;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.speciesStarterDexEntry?.caughtAttr) {
|
if (this.speciesStarterDexEntry?.caughtAttr) {
|
||||||
if (isFormCaught) {
|
if (isFormCaught) {
|
||||||
@ -1877,7 +1886,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
|
|
||||||
const isFormCaught = this.speciesStarterDexEntry ? (this.speciesStarterDexEntry.caughtAttr & globalScene.gameData.getFormAttr(this.formIndex ?? 0)) > 0n : false;
|
const isFormCaught = this.isFormCaught();
|
||||||
|
|
||||||
if ((this.speciesStarterDexEntry?.caughtAttr && isFormCaught) || (this.speciesStarterDexEntry?.seenAttr && cursor === 5)) {
|
if ((this.speciesStarterDexEntry?.caughtAttr && isFormCaught) || (this.speciesStarterDexEntry?.seenAttr && cursor === 5)) {
|
||||||
ui.showText(this.menuDescriptions[cursor]);
|
ui.showText(this.menuDescriptions[cursor]);
|
||||||
@ -2146,7 +2155,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isFormCaught = (this.speciesStarterDexEntry!.caughtAttr! & globalScene.gameData.getFormAttr(formIndex ?? 0)) > 0n;
|
const isFormCaught = this.isFormCaught();
|
||||||
|
|
||||||
this.shinyOverlay.setVisible(shiny ?? false); // TODO: is false the correct default?
|
this.shinyOverlay.setVisible(shiny ?? false); // TODO: is false the correct default?
|
||||||
this.pokemonNumberText.setColor(this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, false));
|
this.pokemonNumberText.setColor(this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, false));
|
||||||
|
Loading…
Reference in New Issue
Block a user