diff --git a/src/locales/de/filter-bar.ts b/src/locales/de/filter-bar.ts index 9c1009171e24..5ab2ae23f25f 100644 --- a/src/locales/de/filter-bar.ts +++ b/src/locales/de/filter-bar.ts @@ -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", diff --git a/src/locales/en/filter-bar.ts b/src/locales/en/filter-bar.ts index 18b6ba77e21b..aa234c6ac65c 100644 --- a/src/locales/en/filter-bar.ts +++ b/src/locales/en/filter-bar.ts @@ -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", diff --git a/src/locales/es/filter-bar.ts b/src/locales/es/filter-bar.ts index 33b60cfa4273..5ed91f81c255 100644 --- a/src/locales/es/filter-bar.ts +++ b/src/locales/es/filter-bar.ts @@ -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", diff --git a/src/locales/fr/filter-bar.ts b/src/locales/fr/filter-bar.ts index 8e2c1a53afa1..0fba91ca458a 100644 --- a/src/locales/fr/filter-bar.ts +++ b/src/locales/fr/filter-bar.ts @@ -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", diff --git a/src/locales/it/filter-bar.ts b/src/locales/it/filter-bar.ts index 88745d2c4f85..37b66a2023e9 100644 --- a/src/locales/it/filter-bar.ts +++ b/src/locales/it/filter-bar.ts @@ -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", diff --git a/src/locales/ko/filter-bar.ts b/src/locales/ko/filter-bar.ts index 821a80d78ee8..69f625b2ba10 100644 --- a/src/locales/ko/filter-bar.ts +++ b/src/locales/ko/filter-bar.ts @@ -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": "사탕 수", diff --git a/src/locales/pt_BR/filter-bar.ts b/src/locales/pt_BR/filter-bar.ts index 01f37f55eabd..b0d34c16d0cf 100644 --- a/src/locales/pt_BR/filter-bar.ts +++ b/src/locales/pt_BR/filter-bar.ts @@ -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", diff --git a/src/locales/zh_CN/filter-bar.ts b/src/locales/zh_CN/filter-bar.ts index 5ccc5b8d9d9e..e2f3204e8aee 100644 --- a/src/locales/zh_CN/filter-bar.ts +++ b/src/locales/zh_CN/filter-bar.ts @@ -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": "糖果", diff --git a/src/locales/zh_TW/filter-bar.ts b/src/locales/zh_TW/filter-bar.ts index 0290bda62de0..c338a77e4dca 100644 --- a/src/locales/zh_TW/filter-bar.ts +++ b/src/locales/zh_TW/filter-bar.ts @@ -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": "糖果", diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 22ce5cb75317..5666b4ffcfbe 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -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)); @@ -2107,9 +2127,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); @@ -2139,6 +2161,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) { } @@ -2151,7 +2183,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); } });