mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-02 05:32:24 +02:00
Adding options to see mons with only one or only two cost reductions
This commit is contained in:
parent
10e0f9f0de
commit
5f1e4b23a4
@ -8,7 +8,9 @@ export enum DropDownState {
|
||||
ON = 0,
|
||||
OFF = 1,
|
||||
EXCLUDE = 2,
|
||||
UNLOCKABLE = 3
|
||||
UNLOCKABLE = 3,
|
||||
ONE = 4,
|
||||
TWO = 5
|
||||
}
|
||||
|
||||
export enum DropDownType {
|
||||
@ -56,6 +58,8 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
||||
private offColor = 0x272727;
|
||||
private excludeColor = 0xff5555;
|
||||
private unlockableColor = 0xffff00;
|
||||
private oneColor = 0x33bbff;
|
||||
private twoColor = 0x33bbff;
|
||||
|
||||
constructor(scene: SceneBase, val: any, labels: DropDownLabel | DropDownLabel[]) {
|
||||
super(scene);
|
||||
@ -127,6 +131,12 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
||||
case DropDownState.UNLOCKABLE:
|
||||
this.toggle.setTint(this.unlockableColor);
|
||||
break;
|
||||
case DropDownState.ONE:
|
||||
this.toggle.setTint(this.oneColor);
|
||||
break;
|
||||
case DropDownState.TWO:
|
||||
this.toggle.setTint(this.twoColor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -441,6 +441,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
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:costReductionUnlockedOne"), undefined, DropDownState.ONE),
|
||||
new DropDownLabel(i18next.t("filterBar:costReductionUnlockedTwo"), undefined, DropDownState.TWO),
|
||||
new DropDownLabel(i18next.t("filterBar:costReductionUnlockable"), undefined, DropDownState.UNLOCKABLE),
|
||||
new DropDownLabel(i18next.t("filterBar:costReductionLocked"), undefined, DropDownState.EXCLUDE),
|
||||
];
|
||||
@ -2466,13 +2468,18 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
});
|
||||
|
||||
// Cost Reduction Filter
|
||||
const isCostReduced = starterData.valueReduction > 0;
|
||||
const isCostReducedByOne = starterData.valueReduction === 1;
|
||||
const isCostReducedByTwo = starterData.valueReduction === 2;
|
||||
const isCostReductionUnlockable = this.isValueReductionAvailable(container.species.speciesId);
|
||||
const fitsCostReduction = this.filterBar.getVals(DropDownColumn.UNLOCKS).some(unlocks => {
|
||||
if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.ON) {
|
||||
return isCostReduced;
|
||||
return isCostReducedByOne || isCostReducedByTwo;
|
||||
} else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.ONE) {
|
||||
return isCostReducedByOne;
|
||||
} else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.TWO) {
|
||||
return isCostReducedByTwo;
|
||||
} else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.EXCLUDE) {
|
||||
return isStarterProgressable && !isCostReduced;
|
||||
return isStarterProgressable && !(isCostReducedByOne || isCostReducedByTwo);
|
||||
} else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.UNLOCKABLE) {
|
||||
return isCostReductionUnlockable;
|
||||
} else if (unlocks.val === "COST_REDUCTION" && unlocks.state === DropDownState.OFF) {
|
||||
|
Loading…
Reference in New Issue
Block a user