mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Exclude species without HA from HA filters in starter select
This commit is contained in:
parent
f7169868f3
commit
f23019f832
@ -45,6 +45,7 @@ import { DropDownColumn, FilterBar } from "./filter-bar";
|
|||||||
import { ScrollBar } from "./scroll-bar";
|
import { ScrollBar } from "./scroll-bar";
|
||||||
import { SelectChallengePhase } from "#app/phases/select-challenge-phase.js";
|
import { SelectChallengePhase } from "#app/phases/select-challenge-phase.js";
|
||||||
import { TitlePhase } from "#app/phases/title-phase.js";
|
import { TitlePhase } from "#app/phases/title-phase.js";
|
||||||
|
import { Abilities } from "#app/enums/abilities.js";
|
||||||
|
|
||||||
export type StarterSelectCallback = (starters: Starter[]) => void;
|
export type StarterSelectCallback = (starters: Starter[]) => void;
|
||||||
|
|
||||||
@ -2450,12 +2451,13 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// HA Filter
|
// HA Filter
|
||||||
|
const speciesHasHiddenAbility = container.species.abilityHidden !== container.species.ability1 && container.species.abilityHidden !== Abilities.NONE;
|
||||||
const hasHA = starterData.abilityAttr & AbilityAttr.ABILITY_HIDDEN;
|
const hasHA = starterData.abilityAttr & AbilityAttr.ABILITY_HIDDEN;
|
||||||
const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||||
if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) {
|
if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) {
|
||||||
return hasHA;
|
return hasHA;
|
||||||
} else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.EXCLUDE) {
|
} else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.EXCLUDE) {
|
||||||
return !hasHA;
|
return speciesHasHiddenAbility && !hasHA;
|
||||||
} else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.OFF) {
|
} else if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.OFF) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user