mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-23 15:59:26 +02:00
[Enhancement] Separate encountered stat from seen stat (#6315)
* Using seenCount in pokedex and game stats * Species seen now also include caught data --------- Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
This commit is contained in:
parent
c59a2013b9
commit
14bd80f639
@ -48,10 +48,17 @@ const displayStats: DisplayStats = {
|
|||||||
return `${starterCount} (${Math.floor((starterCount / Object.keys(speciesStarterCosts).length) * 1000) / 10}%)`;
|
return `${starterCount} (${Math.floor((starterCount / Object.keys(speciesStarterCosts).length) * 1000) / 10}%)`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
dexEncountered: {
|
||||||
|
label_key: "speciesEncountered",
|
||||||
|
sourceFunc: gameData => {
|
||||||
|
const seenCount = gameData.getSpeciesCount(d => !!d.seenCount);
|
||||||
|
return `${seenCount} (${Math.floor((seenCount / Object.keys(gameData.dexData).length) * 1000) / 10}%)`;
|
||||||
|
},
|
||||||
|
},
|
||||||
dexSeen: {
|
dexSeen: {
|
||||||
label_key: "speciesSeen",
|
label_key: "speciesSeen",
|
||||||
sourceFunc: gameData => {
|
sourceFunc: gameData => {
|
||||||
const seenCount = gameData.getSpeciesCount(d => !!d.seenAttr);
|
const seenCount = gameData.getSpeciesCount(d => !!d.seenAttr || !!d.caughtAttr);
|
||||||
return `${seenCount} (${Math.floor((seenCount / Object.keys(gameData.dexData).length) * 1000) / 10}%)`;
|
return `${seenCount} (${Math.floor((seenCount / Object.keys(gameData.dexData).length) * 1000) / 10}%)`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -416,6 +416,11 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
new DropDownLabel(i18next.t("filterBar:isSeen"), undefined, DropDownState.ON),
|
new DropDownLabel(i18next.t("filterBar:isSeen"), undefined, DropDownState.ON),
|
||||||
new DropDownLabel(i18next.t("filterBar:isUnseen"), undefined, DropDownState.EXCLUDE),
|
new DropDownLabel(i18next.t("filterBar:isUnseen"), undefined, DropDownState.EXCLUDE),
|
||||||
];
|
];
|
||||||
|
const encounteredSpeciesLabels = [
|
||||||
|
new DropDownLabel(i18next.t("filterBar:encounteredSpecies"), undefined, DropDownState.OFF),
|
||||||
|
new DropDownLabel(i18next.t("filterBar:isEncountered"), undefined, DropDownState.ON),
|
||||||
|
new DropDownLabel(i18next.t("filterBar:isNotEncountered"), undefined, DropDownState.EXCLUDE),
|
||||||
|
];
|
||||||
const eggLabels = [
|
const eggLabels = [
|
||||||
new DropDownLabel(i18next.t("filterBar:egg"), undefined, DropDownState.OFF),
|
new DropDownLabel(i18next.t("filterBar:egg"), undefined, DropDownState.OFF),
|
||||||
new DropDownLabel(i18next.t("filterBar:eggPurchasable"), undefined, DropDownState.ON),
|
new DropDownLabel(i18next.t("filterBar:eggPurchasable"), undefined, DropDownState.ON),
|
||||||
@ -430,6 +435,7 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
new DropDownOption("WIN", winLabels),
|
new DropDownOption("WIN", winLabels),
|
||||||
new DropDownOption("HIDDEN_ABILITY", hiddenAbilityLabels),
|
new DropDownOption("HIDDEN_ABILITY", hiddenAbilityLabels),
|
||||||
new DropDownOption("SEEN_SPECIES", seenSpeciesLabels),
|
new DropDownOption("SEEN_SPECIES", seenSpeciesLabels),
|
||||||
|
new DropDownOption("ENCOUNTERED_SPECIES", encounteredSpeciesLabels),
|
||||||
new DropDownOption("EGG", eggLabels),
|
new DropDownOption("EGG", eggLabels),
|
||||||
new DropDownOption("POKERUS", pokerusLabels),
|
new DropDownOption("POKERUS", pokerusLabels),
|
||||||
];
|
];
|
||||||
@ -810,6 +816,10 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isEncountered(_species: PokemonSpecies, dexEntry: DexEntry, _seenFilter?: boolean): boolean {
|
||||||
|
return !!dexEntry.seenCount;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if 'Icon' based upgrade notifications should be shown
|
* Determines if 'Icon' based upgrade notifications should be shown
|
||||||
* @returns true if upgrade notifications are enabled and set to display an 'Icon'
|
* @returns true if upgrade notifications are enabled and set to display an 'Icon'
|
||||||
@ -1628,7 +1638,7 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
// Seen Filter
|
// Seen Filter
|
||||||
const dexEntry = globalScene.gameData.dexData[species.speciesId];
|
const dexEntry = globalScene.gameData.dexData[species.speciesId];
|
||||||
const isItSeen = this.isSeen(species, dexEntry, true);
|
const isItSeen = this.isSeen(species, dexEntry, true) || !!dexEntry.caughtAttr;
|
||||||
const fitsSeen = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
const fitsSeen = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||||
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.ON) {
|
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.ON) {
|
||||||
return isItSeen;
|
return isItSeen;
|
||||||
@ -1641,6 +1651,20 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Encountered Filter
|
||||||
|
const isItEncountered = this.isEncountered(species, dexEntry, true);
|
||||||
|
const fitsEncountered = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||||
|
if (misc.val === "ENCOUNTERED_SPECIES" && misc.state === DropDownState.ON) {
|
||||||
|
return isItEncountered;
|
||||||
|
}
|
||||||
|
if (misc.val === "ENCOUNTERED_SPECIES" && misc.state === DropDownState.EXCLUDE) {
|
||||||
|
return !isItEncountered;
|
||||||
|
}
|
||||||
|
if (misc.val === "ENCOUNTERED_SPECIES" && misc.state === DropDownState.OFF) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Egg Purchasable Filter
|
// Egg Purchasable Filter
|
||||||
const isEggPurchasable = this.isSameSpeciesEggAvailable(species.speciesId);
|
const isEggPurchasable = this.isSameSpeciesEggAvailable(species.speciesId);
|
||||||
const fitsEgg = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
const fitsEgg = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||||
@ -1683,6 +1707,7 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
fitsWin &&
|
fitsWin &&
|
||||||
fitsHA &&
|
fitsHA &&
|
||||||
fitsSeen &&
|
fitsSeen &&
|
||||||
|
fitsEncountered &&
|
||||||
fitsEgg &&
|
fitsEgg &&
|
||||||
fitsPokerus
|
fitsPokerus
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user