mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-09 00:49:27 +02:00
Renamed modifier-se-ect-ui-handler to reward-select-ui-handler
This commit is contained in:
parent
88634ca081
commit
2344bdf32a
@ -34,10 +34,10 @@ import { TrainerItemId } from "#enums/trainer-item-id";
|
|||||||
const namespace = "mysteryEncounters/delibirdy";
|
const namespace = "mysteryEncounters/delibirdy";
|
||||||
|
|
||||||
/** Berries only */
|
/** Berries only */
|
||||||
const OPTION_2_ALLOWED_MODIFIERS = [HeldItemCategoryId.BERRY, HeldItemId.REVIVER_SEED];
|
const OPTION_2_ALLOWED_HELD_ITEMS = [HeldItemCategoryId.BERRY, HeldItemId.REVIVER_SEED];
|
||||||
|
|
||||||
/** Disallowed items are berries, Reviver Seeds, and Vitamins (form change items and fusion items are not PokemonHeldItemModifiers) */
|
/** Disallowed items are berries, Reviver Seeds, and Vitamins (form change items and fusion items are not PokemonHeldItemModifiers) */
|
||||||
const OPTION_3_DISALLOWED_MODIFIERS = [HeldItemCategoryId.BERRY, HeldItemId.REVIVER_SEED];
|
const OPTION_3_DISALLOWED_HELD_ITEMS = [HeldItemCategoryId.BERRY, HeldItemId.REVIVER_SEED];
|
||||||
|
|
||||||
const DELIBIRDY_MONEY_PRICE_MULTIPLIER = 2;
|
const DELIBIRDY_MONEY_PRICE_MULTIPLIER = 2;
|
||||||
|
|
||||||
@ -85,8 +85,8 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
.withPrimaryPokemonRequirement(
|
.withPrimaryPokemonRequirement(
|
||||||
CombinationPokemonRequirement.Some(
|
CombinationPokemonRequirement.Some(
|
||||||
// Must also have either option 2 or 3 available to spawn
|
// Must also have either option 2 or 3 available to spawn
|
||||||
new HoldingItemRequirement(OPTION_2_ALLOWED_MODIFIERS),
|
new HoldingItemRequirement(OPTION_2_ALLOWED_HELD_ITEMS),
|
||||||
new HoldingItemRequirement(OPTION_3_DISALLOWED_MODIFIERS, 1, true),
|
new HoldingItemRequirement(OPTION_3_DISALLOWED_HELD_ITEMS, 1, true),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.withIntroSpriteConfigs([
|
.withIntroSpriteConfigs([
|
||||||
@ -180,7 +180,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
)
|
)
|
||||||
.withOption(
|
.withOption(
|
||||||
MysteryEncounterOptionBuilder.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
MysteryEncounterOptionBuilder.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withPrimaryPokemonRequirement(new HoldingItemRequirement(OPTION_2_ALLOWED_MODIFIERS))
|
.withPrimaryPokemonRequirement(new HoldingItemRequirement(OPTION_2_ALLOWED_HELD_ITEMS))
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}:option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}:option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
@ -195,7 +195,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
||||||
const onPokemonSelected = (pokemon: PlayerPokemon) => {
|
const onPokemonSelected = (pokemon: PlayerPokemon) => {
|
||||||
// Get Pokemon held items and filter for valid ones
|
// Get Pokemon held items and filter for valid ones
|
||||||
const validItems = pokemon.heldItemManager.filterRequestedItems(OPTION_2_ALLOWED_MODIFIERS, true);
|
const validItems = pokemon.heldItemManager.filterRequestedItems(OPTION_2_ALLOWED_HELD_ITEMS, true);
|
||||||
|
|
||||||
return validItems.map((item: HeldItemId) => {
|
return validItems.map((item: HeldItemId) => {
|
||||||
const option: OptionSelectItem = {
|
const option: OptionSelectItem = {
|
||||||
@ -264,7 +264,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
)
|
)
|
||||||
.withOption(
|
.withOption(
|
||||||
MysteryEncounterOptionBuilder.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
MysteryEncounterOptionBuilder.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withPrimaryPokemonRequirement(new HoldingItemRequirement(OPTION_3_DISALLOWED_MODIFIERS, 1, true))
|
.withPrimaryPokemonRequirement(new HoldingItemRequirement(OPTION_3_DISALLOWED_HELD_ITEMS, 1, true))
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}:option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}:option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
@ -279,7 +279,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
||||||
const onPokemonSelected = (pokemon: PlayerPokemon) => {
|
const onPokemonSelected = (pokemon: PlayerPokemon) => {
|
||||||
// Get Pokemon held items and filter for valid ones
|
// Get Pokemon held items and filter for valid ones
|
||||||
const validItems = pokemon.heldItemManager.filterRequestedItems(OPTION_3_DISALLOWED_MODIFIERS, true, true);
|
const validItems = pokemon.heldItemManager.filterRequestedItems(OPTION_3_DISALLOWED_HELD_ITEMS, true, true);
|
||||||
|
|
||||||
return validItems.map((item: HeldItemId) => {
|
return validItems.map((item: HeldItemId) => {
|
||||||
const option: OptionSelectItem = {
|
const option: OptionSelectItem = {
|
||||||
@ -312,7 +312,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
})
|
})
|
||||||
.withOptionPhase(async () => {
|
.withOptionPhase(async () => {
|
||||||
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
||||||
const modifier = encounter.misc.chosenModifier;
|
const chosenItem = encounter.misc.chosenItem;
|
||||||
const chosenPokemon: PlayerPokemon = encounter.misc.chosenPokemon;
|
const chosenPokemon: PlayerPokemon = encounter.misc.chosenPokemon;
|
||||||
|
|
||||||
// Check if the player has max stacks of Healing Charm already
|
// Check if the player has max stacks of Healing Charm already
|
||||||
@ -327,7 +327,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
doEventReward();
|
doEventReward();
|
||||||
}
|
}
|
||||||
|
|
||||||
chosenPokemon.loseHeldItem(modifier, false);
|
chosenPokemon.loseHeldItem(chosenItem, false);
|
||||||
|
|
||||||
leaveEncounterWithoutBattle(true);
|
leaveEncounterWithoutBattle(true);
|
||||||
})
|
})
|
||||||
|
@ -18,8 +18,8 @@ import {
|
|||||||
} from "#app/modifier/modifier-type";
|
} from "#app/modifier/modifier-type";
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import type { Modifier } from "#app/modifier/modifier";
|
import type { Modifier } from "#app/modifier/modifier";
|
||||||
import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import type RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/modifier-select-ui-handler";
|
import { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/reward-select-ui-handler";
|
||||||
import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler";
|
import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -258,7 +258,7 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
globalScene.lockModifierTiers = !globalScene.lockModifierTiers;
|
globalScene.lockModifierTiers = !globalScene.lockModifierTiers;
|
||||||
const uiHandler = globalScene.ui.getHandler() as ModifierSelectUiHandler;
|
const uiHandler = globalScene.ui.getHandler() as RewardSelectUiHandler;
|
||||||
uiHandler.setRerollCost(this.getRerollCost(globalScene.lockModifierTiers));
|
uiHandler.setRerollCost(this.getRerollCost(globalScene.lockModifierTiers));
|
||||||
uiHandler.updateLockRaritiesText();
|
uiHandler.updateLockRaritiesText();
|
||||||
uiHandler.updateRerollCostText();
|
uiHandler.updateRerollCostText();
|
||||||
|
@ -23,7 +23,7 @@ const SINGLE_SHOP_ROW_YOFFSET = 12;
|
|||||||
const DOUBLE_SHOP_ROW_YOFFSET = 24;
|
const DOUBLE_SHOP_ROW_YOFFSET = 24;
|
||||||
const OPTION_BUTTON_YPOSITION = -62;
|
const OPTION_BUTTON_YPOSITION = -62;
|
||||||
|
|
||||||
export default class ModifierSelectUiHandler extends AwaitableUiHandler {
|
export default class RewardSelectUiHandler extends AwaitableUiHandler {
|
||||||
private modifierContainer: Phaser.GameObjects.Container;
|
private modifierContainer: Phaser.GameObjects.Container;
|
||||||
private rerollButtonContainer: Phaser.GameObjects.Container;
|
private rerollButtonContainer: Phaser.GameObjects.Container;
|
||||||
private lockRarityButtonContainer: Phaser.GameObjects.Container;
|
private lockRarityButtonContainer: Phaser.GameObjects.Container;
|
@ -6,7 +6,7 @@ import PartyUiHandler from "./party-ui-handler";
|
|||||||
import FightUiHandler from "./fight-ui-handler";
|
import FightUiHandler from "./fight-ui-handler";
|
||||||
import MessageUiHandler from "./message-ui-handler";
|
import MessageUiHandler from "./message-ui-handler";
|
||||||
import ConfirmUiHandler from "./confirm-ui-handler";
|
import ConfirmUiHandler from "./confirm-ui-handler";
|
||||||
import ModifierSelectUiHandler from "./modifier-select-ui-handler";
|
import RewardSelectUiHandler from "./modifier-select-ui-handler";
|
||||||
import BallUiHandler from "./ball-ui-handler";
|
import BallUiHandler from "./ball-ui-handler";
|
||||||
import SummaryUiHandler from "./summary-ui-handler";
|
import SummaryUiHandler from "./summary-ui-handler";
|
||||||
import StarterSelectUiHandler from "./starter-select-ui-handler";
|
import StarterSelectUiHandler from "./starter-select-ui-handler";
|
||||||
@ -131,7 +131,7 @@ export default class UI extends Phaser.GameObjects.Container {
|
|||||||
new FightUiHandler(),
|
new FightUiHandler(),
|
||||||
new BallUiHandler(),
|
new BallUiHandler(),
|
||||||
new TargetSelectUiHandler(),
|
new TargetSelectUiHandler(),
|
||||||
new ModifierSelectUiHandler(),
|
new RewardSelectUiHandler(),
|
||||||
new SaveSlotSelectUiHandler(),
|
new SaveSlotSelectUiHandler(),
|
||||||
new PartyUiHandler(),
|
new PartyUiHandler(),
|
||||||
new SummaryUiHandler(),
|
new SummaryUiHandler(),
|
||||||
|
@ -2,7 +2,7 @@ import { BiomeId } from "#enums/biome-id";
|
|||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { MapModifier } from "#app/modifier/modifier";
|
import { MapModifier } from "#app/modifier/modifier";
|
||||||
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
|
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
@ -77,7 +77,7 @@ describe("Shop modifications", async () => {
|
|||||||
await game.doKillOpponents();
|
await game.doKillOpponents();
|
||||||
await game.phaseInterceptor.to("BattleEndPhase");
|
await game.phaseInterceptor.to("BattleEndPhase");
|
||||||
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, () => {
|
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, () => {
|
||||||
expect(game.scene.ui.getHandler()).toBeInstanceOf(ModifierSelectUiHandler);
|
expect(game.scene.ui.getHandler()).toBeInstanceOf(RewardSelectUiHandler);
|
||||||
game.modifiers.testCheck("EVIOLITE", false).testCheck("MINI_BLACK_HOLE", false);
|
game.modifiers.testCheck("EVIOLITE", false).testCheck("MINI_BLACK_HOLE", false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -88,7 +88,7 @@ describe("Shop modifications", async () => {
|
|||||||
await game.doKillOpponents();
|
await game.doKillOpponents();
|
||||||
await game.phaseInterceptor.to("BattleEndPhase");
|
await game.phaseInterceptor.to("BattleEndPhase");
|
||||||
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, () => {
|
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, () => {
|
||||||
expect(game.scene.ui.getHandler()).toBeInstanceOf(ModifierSelectUiHandler);
|
expect(game.scene.ui.getHandler()).toBeInstanceOf(RewardSelectUiHandler);
|
||||||
game.modifiers.testCheck("EVIOLITE", true).testCheck("MINI_BLACK_HOLE", true);
|
game.modifiers.testCheck("EVIOLITE", true).testCheck("MINI_BLACK_HOLE", true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,7 @@ import Phase from "phaser";
|
|||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { BattleEndPhase } from "#app/phases/battle-end-phase";
|
import { BattleEndPhase } from "#app/phases/battle-end-phase";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import type RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { Button } from "#app/enums/buttons";
|
import { Button } from "#app/enums/buttons";
|
||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
import { NewBattlePhase } from "#app/phases/new-battle-phase";
|
import { NewBattlePhase } from "#app/phases/new-battle-phase";
|
||||||
@ -71,7 +71,7 @@ describe("Items - Dire Hit", () => {
|
|||||||
"SelectModifierPhase",
|
"SelectModifierPhase",
|
||||||
UiMode.MODIFIER_SELECT,
|
UiMode.MODIFIER_SELECT,
|
||||||
() => {
|
() => {
|
||||||
const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler;
|
const handler = game.scene.ui.getHandler() as RewardSelectUiHandler;
|
||||||
// Traverse to first modifier slot
|
// Traverse to first modifier slot
|
||||||
handler.setCursor(0);
|
handler.setCursor(0);
|
||||||
handler.setRowCursor(ShopCursorTarget.REWARDS);
|
handler.setRowCursor(ShopCursorTarget.REWARDS);
|
||||||
|
@ -5,7 +5,7 @@ import Phaser from "phaser";
|
|||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
|
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import type RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { Button } from "#app/enums/buttons";
|
import { Button } from "#app/enums/buttons";
|
||||||
import { TrainerItemId } from "#enums/trainer-item-id";
|
import { TrainerItemId } from "#enums/trainer-item-id";
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ describe("Items - Double Battle Chance Boosters", () => {
|
|||||||
"SelectModifierPhase",
|
"SelectModifierPhase",
|
||||||
UiMode.MODIFIER_SELECT,
|
UiMode.MODIFIER_SELECT,
|
||||||
() => {
|
() => {
|
||||||
const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler;
|
const handler = game.scene.ui.getHandler() as RewardSelectUiHandler;
|
||||||
// Traverse to first modifier slot
|
// Traverse to first modifier slot
|
||||||
handler.setCursor(0);
|
handler.setCursor(0);
|
||||||
handler.setRowCursor(ShopCursorTarget.REWARDS);
|
handler.setRowCursor(ShopCursorTarget.REWARDS);
|
||||||
|
@ -8,7 +8,7 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
|||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { Button } from "#app/enums/buttons";
|
import { Button } from "#app/enums/buttons";
|
||||||
import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import type RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
|
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
|
||||||
|
|
||||||
describe("Items - Temporary Stat Stage Boosters", () => {
|
describe("Items - Temporary Stat Stage Boosters", () => {
|
||||||
@ -138,7 +138,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
|||||||
"SelectModifierPhase",
|
"SelectModifierPhase",
|
||||||
UiMode.MODIFIER_SELECT,
|
UiMode.MODIFIER_SELECT,
|
||||||
() => {
|
() => {
|
||||||
const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler;
|
const handler = game.scene.ui.getHandler() as RewardSelectUiHandler;
|
||||||
// Traverse to first modifier slot
|
// Traverse to first modifier slot
|
||||||
handler.setCursor(0);
|
handler.setCursor(0);
|
||||||
handler.setRowCursor(ShopCursorTarget.REWARDS);
|
handler.setRowCursor(ShopCursorTarget.REWARDS);
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
} from "#test/mystery-encounter/encounter-test-utils";
|
} from "#test/mystery-encounter/encounter-test-utils";
|
||||||
import type BattleScene from "#app/battle-scene";
|
import type BattleScene from "#app/battle-scene";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { BerryModifier } from "#app/modifier/modifier";
|
import { BerryModifier } from "#app/modifier/modifier";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
@ -153,8 +153,8 @@ describe("Berries Abound - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
for (const option of modifierSelectHandler.options) {
|
for (const option of modifierSelectHandler.options) {
|
||||||
expect(option.modifierTypeOption.type.id).toContain("BERRY");
|
expect(option.modifierTypeOption.type.id).toContain("BERRY");
|
||||||
@ -238,8 +238,8 @@ describe("Berries Abound - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
for (const option of modifierSelectHandler.options) {
|
for (const option of modifierSelectHandler.options) {
|
||||||
expect(option.modifierTypeOption.type.id).toContain("BERRY");
|
expect(option.modifierTypeOption.type.id).toContain("BERRY");
|
||||||
|
@ -22,7 +22,7 @@ import { CommandPhase } from "#app/phases/command-phase";
|
|||||||
import { BugTypeSuperfanEncounter } from "#app/data/mystery-encounters/encounters/bug-type-superfan-encounter";
|
import { BugTypeSuperfanEncounter } from "#app/data/mystery-encounters/encounters/bug-type-superfan-encounter";
|
||||||
import * as encounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import * as encounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { HeldItemId } from "#enums/held-item-id";
|
import { HeldItemId } from "#enums/held-item-id";
|
||||||
|
|
||||||
const namespace = "mysteryEncounters/bugTypeSuperfan";
|
const namespace = "mysteryEncounters/bugTypeSuperfan";
|
||||||
@ -421,8 +421,8 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(2);
|
expect(modifierSelectHandler.options.length).toEqual(2);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("SUPER_LURE");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("SUPER_LURE");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("GREAT_BALL");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("GREAT_BALL");
|
||||||
@ -440,8 +440,8 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("QUICK_CLAW");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("QUICK_CLAW");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("MAX_LURE");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("MAX_LURE");
|
||||||
@ -462,8 +462,8 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("GRIP_CLAW");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("GRIP_CLAW");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("MAX_LURE");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("MAX_LURE");
|
||||||
@ -486,8 +486,8 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(4);
|
expect(modifierSelectHandler.options.length).toEqual(4);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("MASTER_BALL");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("MASTER_BALL");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("MEGA_BRACELET");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("MEGA_BRACELET");
|
||||||
@ -561,8 +561,8 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(2);
|
expect(modifierSelectHandler.options.length).toEqual(2);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("MYSTERY_ENCOUNTER_GOLDEN_BUG_NET");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("MYSTERY_ENCOUNTER_GOLDEN_BUG_NET");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("REVIVER_SEED");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toBe("REVIVER_SEED");
|
||||||
|
@ -16,7 +16,7 @@ import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encount
|
|||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { DancingLessonsEncounter } from "#app/data/mystery-encounters/encounters/dancing-lessons-encounter";
|
import { DancingLessonsEncounter } from "#app/data/mystery-encounters/encounters/dancing-lessons-encounter";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
@ -132,8 +132,8 @@ describe("Dancing Lessons - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3); // Should fill remaining
|
expect(modifierSelectHandler.options.length).toEqual(3); // Should fill remaining
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toContain("BATON");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toContain("BATON");
|
||||||
});
|
});
|
||||||
|
@ -8,7 +8,7 @@ import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encount
|
|||||||
import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils";
|
import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils";
|
||||||
import type BattleScene from "#app/battle-scene";
|
import type BattleScene from "#app/battle-scene";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { DepartmentStoreSaleEncounter } from "#app/data/mystery-encounters/encounters/department-store-sale-encounter";
|
import { DepartmentStoreSaleEncounter } from "#app/data/mystery-encounters/encounters/department-store-sale-encounter";
|
||||||
import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
|
import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
@ -98,8 +98,8 @@ describe("Department Store Sale - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
for (const option of modifierSelectHandler.options) {
|
for (const option of modifierSelectHandler.options) {
|
||||||
expect(option.modifierTypeOption.type.id).toContain("TM_");
|
expect(option.modifierTypeOption.type.id).toContain("TM_");
|
||||||
@ -135,8 +135,8 @@ describe("Department Store Sale - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
for (const option of modifierSelectHandler.options) {
|
for (const option of modifierSelectHandler.options) {
|
||||||
expect(
|
expect(
|
||||||
@ -175,8 +175,8 @@ describe("Department Store Sale - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
for (const option of modifierSelectHandler.options) {
|
for (const option of modifierSelectHandler.options) {
|
||||||
expect(
|
expect(
|
||||||
@ -215,8 +215,8 @@ describe("Department Store Sale - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(4);
|
expect(modifierSelectHandler.options.length).toEqual(4);
|
||||||
for (const option of modifierSelectHandler.options) {
|
for (const option of modifierSelectHandler.options) {
|
||||||
expect(option.modifierTypeOption.type.id).toContain("BALL");
|
expect(option.modifierTypeOption.type.id).toContain("BALL");
|
||||||
|
@ -13,7 +13,7 @@ import { FieldTripEncounter } from "#app/data/mystery-encounters/encounters/fiel
|
|||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
const namespace = "mysteryEncounters/fieldTrip";
|
const namespace = "mysteryEncounters/fieldTrip";
|
||||||
@ -89,8 +89,8 @@ describe("Field Trip - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(0);
|
expect(modifierSelectHandler.options.length).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -101,8 +101,8 @@ describe("Field Trip - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe(
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe(
|
||||||
i18next.t("modifierType:TempStatStageBoosterItem.x_attack"),
|
i18next.t("modifierType:TempStatStageBoosterItem.x_attack"),
|
||||||
@ -150,8 +150,8 @@ describe("Field Trip - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(0);
|
expect(modifierSelectHandler.options.length).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -162,8 +162,8 @@ describe("Field Trip - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe(
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe(
|
||||||
i18next.t("modifierType:TempStatStageBoosterItem.x_sp_atk"),
|
i18next.t("modifierType:TempStatStageBoosterItem.x_sp_atk"),
|
||||||
@ -211,8 +211,8 @@ describe("Field Trip - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(0);
|
expect(modifierSelectHandler.options.length).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -224,8 +224,8 @@ describe("Field Trip - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe(
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe(
|
||||||
i18next.t("modifierType:TempStatStageBoosterItem.x_accuracy"),
|
i18next.t("modifierType:TempStatStageBoosterItem.x_accuracy"),
|
||||||
|
@ -13,7 +13,7 @@ import { MoveId } from "#enums/move-id";
|
|||||||
import type BattleScene from "#app/battle-scene";
|
import type BattleScene from "#app/battle-scene";
|
||||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||||
@ -128,8 +128,8 @@ describe("Fight or Flight - Mystery Encounter", () => {
|
|||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
|
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(item.type.name).toBe(modifierSelectHandler.options[0].modifierTypeOption.type.name);
|
expect(item.type.name).toBe(modifierSelectHandler.options[0].modifierTypeOption.type.name);
|
||||||
});
|
});
|
||||||
@ -188,8 +188,8 @@ describe("Fight or Flight - Mystery Encounter", () => {
|
|||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
|
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(item.type.name).toBe(modifierSelectHandler.options[0].modifierTypeOption.type.name);
|
expect(item.type.name).toBe(modifierSelectHandler.options[0].modifierTypeOption.type.name);
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import { UiMode } from "#enums/ui-mode";
|
|||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { Nature } from "#enums/nature";
|
import { Nature } from "#enums/nature";
|
||||||
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
||||||
@ -189,8 +189,8 @@ describe("Fun And Games! - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(0);
|
expect(modifierSelectHandler.options.length).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -218,8 +218,8 @@ describe("Fun And Games! - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("WIDE_LENS");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("WIDE_LENS");
|
||||||
});
|
});
|
||||||
@ -248,8 +248,8 @@ describe("Fun And Games! - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("SCOPE_LENS");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("SCOPE_LENS");
|
||||||
});
|
});
|
||||||
@ -278,8 +278,8 @@ describe("Fun And Games! - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MULTI_LENS");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MULTI_LENS");
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@ import { GlobalTradeSystemEncounter } from "#app/data/mystery-encounters/encount
|
|||||||
import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
|
import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { RewardTier } from "#enums/reward-tier";
|
import { RewardTier } from "#enums/reward-tier";
|
||||||
import * as Utils from "#app/utils/common";
|
import * as Utils from "#app/utils/common";
|
||||||
import { HeldItemId } from "#enums/held-item-id";
|
import { HeldItemId } from "#enums/held-item-id";
|
||||||
@ -225,8 +225,8 @@ describe("Global Trade System - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.tier).toBe(RewardTier.MASTER);
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.tier).toBe(RewardTier.MASTER);
|
||||||
const soulDewAfter = scene.getPlayerParty()[0].heldItemManager.getStack(HeldItemId.SOUL_DEW);
|
const soulDewAfter = scene.getPlayerParty()[0].heldItemManager.getStack(HeldItemId.SOUL_DEW);
|
||||||
|
@ -21,7 +21,7 @@ import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTem
|
|||||||
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
@ -168,8 +168,8 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toContain("TM_COMMON");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toContain("TM_COMMON");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toContain("TM_GREAT");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toContain("TM_GREAT");
|
||||||
@ -212,8 +212,8 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(4);
|
expect(modifierSelectHandler.options.length).toEqual(4);
|
||||||
expect(
|
expect(
|
||||||
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
||||||
@ -269,8 +269,8 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(4);
|
expect(modifierSelectHandler.options.length).toEqual(4);
|
||||||
expect(
|
expect(
|
||||||
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
||||||
|
@ -9,7 +9,7 @@ import { CommandPhase } from "#app/phases/command-phase";
|
|||||||
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
@ -305,8 +305,8 @@ describe("Teleporting Hijinks - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(
|
expect(
|
||||||
modifierSelectHandler.options.some(
|
modifierSelectHandler.options.some(
|
||||||
opt => opt.modifierTypeOption.type.name === i18next.t("modifierType:AttackTypeBoosterItem.metal_coat"),
|
opt => opt.modifierTypeOption.type.name === i18next.t("modifierType:AttackTypeBoosterItem.metal_coat"),
|
||||||
|
@ -18,7 +18,7 @@ import { Nature } from "#enums/nature";
|
|||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||||
@ -228,8 +228,8 @@ describe("The Strong Stuff - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("SOUL_DEW");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("SOUL_DEW");
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,7 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode
|
|||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { TrainerType } from "#enums/trainer-type";
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
import { Nature } from "#enums/nature";
|
import { Nature } from "#enums/nature";
|
||||||
@ -301,8 +301,8 @@ describe("The Winstrate Challenge - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("MYSTERY_ENCOUNTER_MACHO_BRACE");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("MYSTERY_ENCOUNTER_MACHO_BRACE");
|
||||||
});
|
});
|
||||||
@ -343,8 +343,8 @@ describe("The Winstrate Challenge - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("RARER_CANDY");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("RARER_CANDY");
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@ import { RewardTier } from "#enums/reward-tier";
|
|||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
import { MovePhase } from "#app/phases/move-phase";
|
import { MovePhase } from "#app/phases/move-phase";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import * as Utils from "#app/utils/common";
|
import * as Utils from "#app/utils/common";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
@ -210,8 +210,8 @@ describe("Trash to Treasure - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(4);
|
expect(modifierSelectHandler.options.length).toEqual(4);
|
||||||
expect(
|
expect(
|
||||||
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
} from "#test/mystery-encounter/encounter-test-utils";
|
} from "#test/mystery-encounter/encounter-test-utils";
|
||||||
import type BattleScene from "#app/battle-scene";
|
import type BattleScene from "#app/battle-scene";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||||
@ -145,8 +145,8 @@ describe("Weird Dream - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toEqual("ROGUE_BALL");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toEqual("ROGUE_BALL");
|
||||||
@ -201,8 +201,8 @@ describe("Weird Dream - Mystery Encounter", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(6);
|
expect(modifierSelectHandler.options.length).toEqual(6);
|
||||||
expect(
|
expect(
|
||||||
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
||||||
|
@ -6,7 +6,7 @@ import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
|||||||
import { ModifierTypeOption } from "#app/modifier/modifier-type";
|
import { ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/data/data-lists";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { shiftCharCodes } from "#app/utils/common";
|
import { shiftCharCodes } from "#app/utils/common";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
@ -61,8 +61,8 @@ describe("SelectModifierPhase", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -99,8 +99,8 @@ describe("SelectModifierPhase", () => {
|
|||||||
//const smphase = scene.phaseManager.getCurrentPhase() as SelectModifierPhase;
|
//const smphase = scene.phaseManager.getCurrentPhase() as SelectModifierPhase;
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
|
|
||||||
modifierSelectHandler.processInput(Button.ACTION);
|
modifierSelectHandler.processInput(Button.ACTION);
|
||||||
@ -127,8 +127,8 @@ describe("SelectModifierPhase", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
const firstRollTiers: RewardTier[] = modifierSelectHandler.options.map(o => o.modifierTypeOption.type.tier);
|
const firstRollTiers: RewardTier[] = modifierSelectHandler.options.map(o => o.modifierTypeOption.type.tier);
|
||||||
|
|
||||||
@ -170,8 +170,8 @@ describe("SelectModifierPhase", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toEqual("TM_ULTRA");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toEqual("TM_ULTRA");
|
||||||
@ -207,8 +207,8 @@ describe("SelectModifierPhase", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(5);
|
expect(modifierSelectHandler.options.length).toEqual(5);
|
||||||
expect(
|
expect(
|
||||||
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
modifierSelectHandler.options[0].modifierTypeOption.type.tier -
|
||||||
@ -246,8 +246,8 @@ describe("SelectModifierPhase", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(4);
|
expect(modifierSelectHandler.options.length).toEqual(4);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toEqual("TM_COMMON");
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.id).toEqual("TM_COMMON");
|
||||||
@ -270,8 +270,8 @@ describe("SelectModifierPhase", () => {
|
|||||||
|
|
||||||
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
|
||||||
const modifierSelectHandler = scene.ui.handlers.find(
|
const modifierSelectHandler = scene.ui.handlers.find(
|
||||||
h => h instanceof ModifierSelectUiHandler,
|
h => h instanceof RewardSelectUiHandler,
|
||||||
) as ModifierSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(modifierSelectHandler.options.length).toEqual(3);
|
expect(modifierSelectHandler.options.length).toEqual(3);
|
||||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toEqual("MEMORY_MUSHROOM");
|
||||||
expect(modifierSelectHandler.options[1].modifierTypeOption.type.tier).toEqual(RewardTier.MASTER);
|
expect(modifierSelectHandler.options[1].modifierTypeOption.type.tier).toEqual(RewardTier.MASTER);
|
||||||
|
@ -25,7 +25,7 @@ import { TurnStartPhase } from "#app/phases/turn-start-phase";
|
|||||||
import type BallUiHandler from "#app/ui/ball-ui-handler";
|
import type BallUiHandler from "#app/ui/ball-ui-handler";
|
||||||
import type BattleMessageUiHandler from "#app/ui/battle-message-ui-handler";
|
import type BattleMessageUiHandler from "#app/ui/battle-message-ui-handler";
|
||||||
import type CommandUiHandler from "#app/ui/command-ui-handler";
|
import type CommandUiHandler from "#app/ui/command-ui-handler";
|
||||||
import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import type RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import type PartyUiHandler from "#app/ui/party-ui-handler";
|
import type PartyUiHandler from "#app/ui/party-ui-handler";
|
||||||
import type StarterSelectUiHandler from "#app/ui/starter-select-ui-handler";
|
import type StarterSelectUiHandler from "#app/ui/starter-select-ui-handler";
|
||||||
import type TargetSelectUiHandler from "#app/ui/target-select-ui-handler";
|
import type TargetSelectUiHandler from "#app/ui/target-select-ui-handler";
|
||||||
@ -317,7 +317,7 @@ export default class GameManager {
|
|||||||
"SelectModifierPhase",
|
"SelectModifierPhase",
|
||||||
UiMode.MODIFIER_SELECT,
|
UiMode.MODIFIER_SELECT,
|
||||||
() => {
|
() => {
|
||||||
const handler = this.scene.ui.getHandler() as ModifierSelectUiHandler;
|
const handler = this.scene.ui.getHandler() as RewardSelectUiHandler;
|
||||||
handler.processInput(Button.CANCEL);
|
handler.processInput(Button.CANCEL);
|
||||||
},
|
},
|
||||||
() =>
|
() =>
|
||||||
@ -331,7 +331,7 @@ export default class GameManager {
|
|||||||
"SelectModifierPhase",
|
"SelectModifierPhase",
|
||||||
UiMode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
const handler = this.scene.ui.getHandler() as ModifierSelectUiHandler;
|
const handler = this.scene.ui.getHandler() as RewardSelectUiHandler;
|
||||||
handler.processInput(Button.ACTION);
|
handler.processInput(Button.ACTION);
|
||||||
},
|
},
|
||||||
() =>
|
() =>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Button } from "#app/enums/buttons";
|
import { Button } from "#app/enums/buttons";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import RewardSelectUiHandler from "#app/ui/reward-select-ui-handler";
|
||||||
import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler";
|
import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
@ -44,9 +44,9 @@ describe("UI - Transfer Items", () => {
|
|||||||
game.move.select(MoveId.DRAGON_CLAW);
|
game.move.select(MoveId.DRAGON_CLAW);
|
||||||
|
|
||||||
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, () => {
|
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, () => {
|
||||||
expect(game.scene.ui.getHandler()).toBeInstanceOf(ModifierSelectUiHandler);
|
expect(game.scene.ui.getHandler()).toBeInstanceOf(RewardSelectUiHandler);
|
||||||
|
|
||||||
const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler;
|
const handler = game.scene.ui.getHandler() as RewardSelectUiHandler;
|
||||||
handler.setCursor(1);
|
handler.setCursor(1);
|
||||||
handler.processInput(Button.ACTION);
|
handler.processInput(Button.ACTION);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user