[Enhancement] add filters for pokerus, HA, cost reduction (#3343)
* add filters for pokerus, HA, cost reduction * add entries for translation * Update src/ui/starter-select-ui-handler.ts Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com> * Update src/ui/starter-select-ui-handler.ts Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com> --------- Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com>
This commit is contained in:
parent
91b32132d0
commit
d323817eb9
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "Passive",
|
||||
"passiveUnlocked": "Passive freigeschaltet",
|
||||
"passiveLocked": "Passive gesperrt",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "Band",
|
||||
"hasWon": "Hat Klassik-Modus gewonnen",
|
||||
"hasNotWon": "Hat Klassik-Modus nicht gewonnen",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "Pokédex-Nummer",
|
||||
"sortByCost": "Kosten",
|
||||
"sortByCandies": "Anzahl Bonbons",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "Passive",
|
||||
"passiveUnlocked": "Passive Unlocked",
|
||||
"passiveLocked": "Passive Locked",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "Ribbon",
|
||||
"hasWon": "Ribbon - Yes",
|
||||
"hasNotWon": "Ribbon - No",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "No.",
|
||||
"sortByCost": "Cost",
|
||||
"sortByCandies": "Candy Count",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "Passive",
|
||||
"passiveUnlocked": "Pasiva Desbloq.",
|
||||
"passiveLocked": "Pasiva Bloq.",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "Ribbon",
|
||||
"hasWon": "Ya ha ganado",
|
||||
"hasNotWon": "Aún no ha ganado",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "Núm.",
|
||||
"sortByCost": "Coste",
|
||||
"sortByCandies": "# Caramelos",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "Passif",
|
||||
"passiveUnlocked": "Passif débloqué",
|
||||
"passiveLocked": "Passif verrouillé",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "Ruban",
|
||||
"hasWon": "Ruban - Oui",
|
||||
"hasNotWon": "Ruban - Non",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "Par N°",
|
||||
"sortByCost": "Par cout",
|
||||
"sortByCandies": "Par bonbons",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "Passive",
|
||||
"passiveUnlocked": "Passiva sbloccata",
|
||||
"passiveLocked": "Passiva bloccata",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "Ribbon",
|
||||
"hasWon": "Ribbon - Yes",
|
||||
"hasNotWon": "Ribbon - No",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "Num. Dex",
|
||||
"sortByCost": "Costo",
|
||||
"sortByCandies": "Caramelle",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "패시브",
|
||||
"passiveUnlocked": "패시브 해금",
|
||||
"passiveLocked": "패시브 잠김",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "클리어 여부",
|
||||
"hasWon": "클리어 함",
|
||||
"hasNotwon": "클리어 안함",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "도감번호",
|
||||
"sortByCost": "코스트",
|
||||
"sortByCandies": "사탕 수",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "Passiva",
|
||||
"passiveUnlocked": "Passiva Desbloq.",
|
||||
"passiveLocked": "Passiva Bloq.",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "Fita",
|
||||
"hasWon": "Fita - Sim",
|
||||
"hasNotWon": "Fita - Não",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "Número",
|
||||
"sortByCost": "Custo",
|
||||
"sortByCandies": "# Doces",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "被动",
|
||||
"passiveUnlocked": "被动解锁",
|
||||
"passiveLocked": "被动未解锁",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "缎带",
|
||||
"hasWon": "有缎带",
|
||||
"hasNotWon": "无缎带",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "编号",
|
||||
"sortByCost": "费用",
|
||||
"sortByCandies": "糖果",
|
||||
|
|
|
@ -13,9 +13,18 @@ export const filterBar: SimpleTranslationEntries = {
|
|||
"passive": "被動",
|
||||
"passiveUnlocked": "被動解鎖",
|
||||
"passiveLocked": "被動未解鎖",
|
||||
"costReduction": "Cost Reduction",
|
||||
"costReductionUnlocked": "Cost Reduction Unlocked",
|
||||
"costReductionLocked": "Cost Reduction Locked",
|
||||
"ribbon": "緞帶",
|
||||
"hasWon": "有緞帶",
|
||||
"hasNotWon": "無緞帶",
|
||||
"hiddenAbility": "Hidden Ability",
|
||||
"hasHiddenAbility": "Hidden Ability - Yes",
|
||||
"noHiddenAbility": "Hidden Ability - No",
|
||||
"pokerus": "Pokerus",
|
||||
"hasPokerus": "Pokerus - Yes",
|
||||
"noPokerus": "Pokerus - No",
|
||||
"sortByNumber": "編號",
|
||||
"sortByCost": "花費",
|
||||
"sortByCandies": "糖果",
|
||||
|
|
|
@ -431,8 +431,16 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
new DropDownLabel(i18next.t("filterBar:passiveUnlocked"), undefined, DropDownState.ON),
|
||||
new DropDownLabel(i18next.t("filterBar:passiveLocked"), undefined, DropDownState.EXCLUDE),
|
||||
];
|
||||
|
||||
const costReductionLabels = [
|
||||
new DropDownLabel(i18next.t("filterBar:costReduction"), undefined, DropDownState.OFF),
|
||||
new DropDownLabel(i18next.t("filterBar:costReductionUnlocked"), undefined, DropDownState.ON),
|
||||
new DropDownLabel(i18next.t("filterBar:costReductionLocked"), undefined, DropDownState.EXCLUDE),
|
||||
];
|
||||
|
||||
const unlocksOptions = [
|
||||
new DropDownOption(this.scene, "PASSIVE", passiveLabels),
|
||||
new DropDownOption(this.scene, "COST_REDUCTION", costReductionLabels),
|
||||
];
|
||||
|
||||
this.filterBar.addFilter(DropDownColumn.UNLOCKS, i18next.t("filterBar:unlocksFilter"), new DropDown(this.scene, 0, 0, unlocksOptions, this.updateStarters, DropDownType.RADIAL));
|
||||
|
@ -443,8 +451,20 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
new DropDownLabel(i18next.t("filterBar:hasWon"), undefined, DropDownState.ON),
|
||||
new DropDownLabel(i18next.t("filterBar:hasNotWon"), undefined, DropDownState.EXCLUDE),
|
||||
];
|
||||
const hiddenAbilityLabels = [
|
||||
new DropDownLabel(i18next.t("filterBar:hiddenAbility"), undefined, DropDownState.OFF),
|
||||
new DropDownLabel(i18next.t("filterBar:hasHiddenAbility"), undefined, DropDownState.ON),
|
||||
new DropDownLabel(i18next.t("filterBar:noHiddenAbility"), undefined, DropDownState.EXCLUDE),
|
||||
];
|
||||
const pokerusLabels = [
|
||||
new DropDownLabel(i18next.t("filterBar:pokerus"), undefined, DropDownState.OFF),
|
||||
new DropDownLabel(i18next.t("filterBar:hasPokerus"), undefined, DropDownState.ON),
|
||||
new DropDownLabel(i18next.t("filterBar:noPokerus"), undefined, DropDownState.EXCLUDE),
|
||||
];
|
||||
const miscOptions = [
|
||||
new DropDownOption(this.scene, "WIN", winLabels),
|
||||
new DropDownOption(this.scene, "HIDDEN_ABILITY", hiddenAbilityLabels),
|
||||
new DropDownOption(this.scene, "POKERUS", pokerusLabels),
|
||||
];
|
||||
this.filterBar.addFilter(DropDownColumn.MISC, i18next.t("filterBar:miscFilter"), new DropDown(this.scene, 0, 0, miscOptions, this.updateStarters, DropDownType.RADIAL));
|
||||
|
||||
|
@ -2100,9 +2120,11 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
const isCaught = !!(caughtVariants & DexAttr.NON_SHINY);
|
||||
const isUncaught = !isCaught && !isVariantCaught && !isVariant2Caught && !isVariant3Caught;
|
||||
const isPassiveUnlocked = this.scene.gameData.starterData[container.species.speciesId].passiveAttr > 0;
|
||||
const isCostReduced = this.scene.gameData.starterData[container.species.speciesId].valueReduction > 0;
|
||||
const isWin = this.scene.gameData.starterData[container.species.speciesId].classicWinCount > 0;
|
||||
const isNotWin = this.scene.gameData.starterData[container.species.speciesId].classicWinCount === 0;
|
||||
const isUndefined = this.scene.gameData.starterData[container.species.speciesId].classicWinCount === undefined;
|
||||
const isHA = this.scene.gameData.starterData[container.species.speciesId].abilityAttr & AbilityAttr.ABILITY_HIDDEN;
|
||||
|
||||
const fitsGen = this.filterBar.getVals(DropDownColumn.GEN).includes(container.species.generation);
|
||||
|
||||
|
@ -2132,6 +2154,16 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
}
|
||||
});
|
||||
|
||||
const fitsCostReduction = this.filterBar.getVals(DropDownColumn.UNLOCKS).some(unlocks => {
|
||||
if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.ON) {
|
||||
return isCostReduced;
|
||||
} else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.EXCLUDE) {
|
||||
return !isCostReduced;
|
||||
} else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.OFF) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
const fitsWin = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||
if (container.species.speciesId < 10) {
|
||||
}
|
||||
|
@ -2144,7 +2176,27 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
}
|
||||
});
|
||||
|
||||
if (fitsGen && fitsType && fitsShiny && fitsPassive && fitsWin) {
|
||||
const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||
if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) {
|
||||
return isHA;
|
||||
} else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.EXCLUDE) {
|
||||
return !isHA;
|
||||
} else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.OFF) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
const fitsPokerus = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||
if (misc.val === "POKERUS" && misc.state === DropDownState.ON) {
|
||||
return this.pokerusSpecies.includes(container.species);
|
||||
} else if (misc.val === "POKERUS" && misc.state === DropDownState.EXCLUDE) {
|
||||
return !this.pokerusSpecies.includes(container.species);
|
||||
} else if (misc.val === "POKERUS" && misc.state === DropDownState.OFF) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
if (fitsGen && fitsType && fitsShiny && fitsPassive && fitsCostReduction && fitsWin && fitsHA && fitsPokerus) {
|
||||
this.filteredStarterContainers.push(container);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue