mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-20 16:42:45 +02:00
[Refactor] Remove circular imports part 1 (#5663)
* Extract Mode enum out of UI and into its own file Reduces circular imports from 909 to 773 * Move around utility files Reduces cyclical dependencies from 773 to 765 * Remove starterColors and bypassLogin from battle-scene Reduces cyclical dependencies from 765 to 623 * Fix test runner error * Update import for bypassLogin in test * Update mocks for utils in tests * Fix broken tests * Update selectWithTera override * Update path for utils in ab-attr.ts * Update path for utils in ability-class.ts * Fix utils import path in healer.test.ts
This commit is contained in:
parent
a6e87c8438
commit
5854b21da0
@ -1,7 +1,7 @@
|
|||||||
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
|
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
|
||||||
import type { UserInfo } from "#app/@types/UserInfo";
|
import type { UserInfo } from "#app/@types/UserInfo";
|
||||||
import { bypassLogin } from "#app/battle-scene";
|
import { bypassLogin } from "./global-vars/bypass-login";
|
||||||
import { randomString } from "#app/utils";
|
import { randomString } from "#app/utils/common";
|
||||||
|
|
||||||
export let loggedInUser: UserInfo | null = null;
|
export let loggedInUser: UserInfo | null = null;
|
||||||
// This is a random string that is used to identify the client session - unique per session (tab or window) so that the game will only save on the one that the server is expecting
|
// This is a random string that is used to identify the client session - unique per session (tab or window) so that the game will only save on the one that the server is expecting
|
||||||
|
@ -18,7 +18,7 @@ import {
|
|||||||
isNullOrUndefined,
|
isNullOrUndefined,
|
||||||
BooleanHolder,
|
BooleanHolder,
|
||||||
type Constructor,
|
type Constructor,
|
||||||
} from "#app/utils";
|
} from "#app/utils/common";
|
||||||
import type { Modifier, ModifierPredicate, TurnHeldItemTransferModifier } from "./modifier/modifier";
|
import type { Modifier, ModifierPredicate, TurnHeldItemTransferModifier } from "./modifier/modifier";
|
||||||
import {
|
import {
|
||||||
ConsumableModifier,
|
ConsumableModifier,
|
||||||
@ -185,8 +185,8 @@ import { HideAbilityPhase } from "#app/phases/hide-ability-phase";
|
|||||||
import { expSpriteKeys } from "./sprites/sprite-keys";
|
import { expSpriteKeys } from "./sprites/sprite-keys";
|
||||||
import { hasExpSprite } from "./sprites/sprite-utils";
|
import { hasExpSprite } from "./sprites/sprite-utils";
|
||||||
import { timedEventManager } from "./global-event-manager";
|
import { timedEventManager } from "./global-event-manager";
|
||||||
|
import { starterColors } from "./global-vars/starter-colors";
|
||||||
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
import { startingWave } from "./starting-wave";
|
||||||
|
|
||||||
const DEBUG_RNG = false;
|
const DEBUG_RNG = false;
|
||||||
|
|
||||||
@ -194,13 +194,6 @@ const OPP_IVS_OVERRIDE_VALIDATED: number[] = (
|
|||||||
Array.isArray(Overrides.OPP_IVS_OVERRIDE) ? Overrides.OPP_IVS_OVERRIDE : new Array(6).fill(Overrides.OPP_IVS_OVERRIDE)
|
Array.isArray(Overrides.OPP_IVS_OVERRIDE) ? Overrides.OPP_IVS_OVERRIDE : new Array(6).fill(Overrides.OPP_IVS_OVERRIDE)
|
||||||
).map(iv => (Number.isNaN(iv) || iv === null || iv > 31 ? -1 : iv));
|
).map(iv => (Number.isNaN(iv) || iv === null || iv > 31 ? -1 : iv));
|
||||||
|
|
||||||
export const startingWave = Overrides.STARTING_WAVE_OVERRIDE || 1;
|
|
||||||
|
|
||||||
export let starterColors: StarterColors;
|
|
||||||
interface StarterColors {
|
|
||||||
[key: string]: [string, string];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PokeballCounts {
|
export interface PokeballCounts {
|
||||||
[pb: string]: number;
|
[pb: string]: number;
|
||||||
}
|
}
|
||||||
@ -810,11 +803,11 @@ export default class BattleScene extends SceneBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async initStarterColors(): Promise<void> {
|
async initStarterColors(): Promise<void> {
|
||||||
if (starterColors) {
|
if (Object.keys(starterColors).length > 0) {
|
||||||
|
// already initialized
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const sc = await this.cachedFetch("./starter-colors.json").then(res => res.json());
|
const sc = await this.cachedFetch("./starter-colors.json").then(res => res.json());
|
||||||
starterColors = {};
|
|
||||||
for (const key of Object.keys(sc)) {
|
for (const key of Object.keys(sc)) {
|
||||||
starterColors[key] = sc[key];
|
starterColors[key] = sc[key];
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
shiftCharCodes,
|
shiftCharCodes,
|
||||||
randSeedItem,
|
randSeedItem,
|
||||||
randInt,
|
randInt,
|
||||||
} from "#app/utils";
|
} from "#app/utils/common";
|
||||||
import Trainer, { TrainerVariant } from "./field/trainer";
|
import Trainer, { TrainerVariant } from "./field/trainer";
|
||||||
import type { GameMode } from "./game-mode";
|
import type { GameMode } from "./game-mode";
|
||||||
import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier";
|
import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { AbAttrCondition } from "#app/@types/ability-types";
|
import type { AbAttrCondition } from "#app/@types/ability-types";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import type * as Utils from "#app/utils";
|
import type { BooleanHolder } from "#app/utils/common";
|
||||||
|
|
||||||
export abstract class AbAttr {
|
export abstract class AbAttr {
|
||||||
public showAbility: boolean;
|
public showAbility: boolean;
|
||||||
@ -22,7 +22,7 @@ export abstract class AbAttr {
|
|||||||
_pokemon: Pokemon,
|
_pokemon: Pokemon,
|
||||||
_passive: boolean,
|
_passive: boolean,
|
||||||
_simulated: boolean,
|
_simulated: boolean,
|
||||||
_cancelled: Utils.BooleanHolder | null,
|
_cancelled: BooleanHolder | null,
|
||||||
_args: any[],
|
_args: any[],
|
||||||
): void {}
|
): void {}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import type { AbAttrCondition } from "#app/@types/ability-types";
|
|||||||
import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
|
import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { Localizable } from "#app/interfaces/locales";
|
import type { Localizable } from "#app/interfaces/locales";
|
||||||
import type { Constructor } from "#app/utils";
|
import type { Constructor } from "#app/utils/common";
|
||||||
|
|
||||||
export class Ability implements Localizable {
|
export class Ability implements Localizable {
|
||||||
public id: Abilities;
|
public id: Abilities;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { HitResult, MoveResult, PlayerPokemon } from "#app/field/pokemon";
|
import { HitResult, MoveResult, PlayerPokemon } from "#app/field/pokemon";
|
||||||
import { BooleanHolder, NumberHolder, toDmgValue, isNullOrUndefined, randSeedItem, randSeedInt, type Constructor } from "#app/utils";
|
import { BooleanHolder, NumberHolder, toDmgValue, isNullOrUndefined, randSeedItem, randSeedInt, type Constructor } from "#app/utils/common";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { BattlerTagLapseType, GroundedTag } from "#app/data/battler-tags";
|
import { BattlerTagLapseType, GroundedTag } from "#app/data/battler-tags";
|
||||||
import { getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "#app/data/status-effect";
|
import { getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "#app/data/status-effect";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { Arena } from "#app/field/arena";
|
import type { Arena } from "#app/field/arena";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { BooleanHolder, NumberHolder, toDmgValue } from "#app/utils";
|
import { BooleanHolder, NumberHolder, toDmgValue } from "#app/utils/common";
|
||||||
import { allMoves } from "#app/data/moves/move";
|
import { allMoves } from "#app/data/moves/move";
|
||||||
import { MoveTarget } from "#enums/MoveTarget";
|
import { MoveTarget } from "#enums/MoveTarget";
|
||||||
import { MoveCategory } from "#enums/MoveCategory";
|
import { MoveCategory } from "#enums/MoveCategory";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { randSeedInt, getEnumValues } from "#app/utils";
|
import { randSeedInt, getEnumValues } from "#app/utils/common";
|
||||||
import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions";
|
import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { allMoves } from "#app/data/moves/move";
|
import { allMoves } from "#app/data/moves/move";
|
||||||
import { getEnumKeys, getEnumValues } from "#app/utils";
|
import { getEnumKeys, getEnumValues } from "#app/utils/common";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { Gender } from "#app/data/gender";
|
|||||||
import { PokeballType } from "#enums/pokeball";
|
import { PokeballType } from "#enums/pokeball";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { WeatherType } from "#enums/weather-type";
|
import { WeatherType } from "#enums/weather-type";
|
||||||
import { Nature } from "#enums/nature";
|
import { Nature } from "#enums/nature";
|
||||||
import { Biome } from "#enums/biome";
|
import { Biome } from "#enums/biome";
|
||||||
@ -14,6 +14,7 @@ import { DamageMoneyRewardModifier, ExtraModifierModifier, MoneyMultiplierModifi
|
|||||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||||
import { speciesStarterCosts } from "./starters";
|
import { speciesStarterCosts } from "./starters";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
import { initI18n } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
|
||||||
export enum SpeciesWildEvolutionDelay {
|
export enum SpeciesWildEvolutionDelay {
|
||||||
@ -95,6 +96,9 @@ export class SpeciesFormEvolution {
|
|||||||
public description = "";
|
public description = "";
|
||||||
|
|
||||||
constructor(speciesId: Species, preFormKey: string | null, evoFormKey: string | null, level: number, item: EvolutionItem | null, condition: SpeciesEvolutionCondition | null, wildDelay?: SpeciesWildEvolutionDelay) {
|
constructor(speciesId: Species, preFormKey: string | null, evoFormKey: string | null, level: number, item: EvolutionItem | null, condition: SpeciesEvolutionCondition | null, wildDelay?: SpeciesWildEvolutionDelay) {
|
||||||
|
if (!i18next.isInitialized) {
|
||||||
|
initI18n();
|
||||||
|
}
|
||||||
this.speciesId = speciesId;
|
this.speciesId = speciesId;
|
||||||
this.preFormKey = preFormKey;
|
this.preFormKey = preFormKey;
|
||||||
this.evoFormKey = evoFormKey;
|
this.evoFormKey = evoFormKey;
|
||||||
|
@ -2,11 +2,11 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { AttackMove, BeakBlastHeaderAttr, DelayedAttackAttr, SelfStatusMove, allMoves } from "./moves/move";
|
import { AttackMove, BeakBlastHeaderAttr, DelayedAttackAttr, SelfStatusMove, allMoves } from "./moves/move";
|
||||||
import { MoveFlags } from "#enums/MoveFlags";
|
import { MoveFlags } from "#enums/MoveFlags";
|
||||||
import type Pokemon from "../field/pokemon";
|
import type Pokemon from "../field/pokemon";
|
||||||
import { type nil, getFrameMs, getEnumKeys, getEnumValues, animationFileName } from "../utils";
|
import { type nil, getFrameMs, getEnumKeys, getEnumValues, animationFileName } from "../utils/common";
|
||||||
import type { BattlerIndex } from "../battle";
|
import type { BattlerIndex } from "../battle";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { SubstituteTag } from "./battler-tags";
|
import { SubstituteTag } from "./battler-tags";
|
||||||
import { isNullOrUndefined } from "../utils";
|
import { isNullOrUndefined } from "../utils/common";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { EncounterAnim } from "#enums/encounter-anims";
|
import { EncounterAnim } from "#enums/encounter-anims";
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase";
|
|||||||
import type { StatStageChangeCallback } from "#app/phases/stat-stage-change-phase";
|
import type { StatStageChangeCallback } from "#app/phases/stat-stage-change-phase";
|
||||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import { BooleanHolder, getFrameMs, NumberHolder, toDmgValue } from "#app/utils";
|
import { BooleanHolder, getFrameMs, NumberHolder, toDmgValue } from "#app/utils/common";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
@ -42,7 +42,7 @@ import { Species } from "#enums/species";
|
|||||||
import { EFFECTIVE_STATS, getStatKey, Stat, type BattleStat, type EffectiveStat } from "#enums/stat";
|
import { EFFECTIVE_STATS, getStatKey, Stat, type BattleStat, type EffectiveStat } from "#enums/stat";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import { WeatherType } from "#enums/weather-type";
|
import { WeatherType } from "#enums/weather-type";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
|
|
||||||
export enum BattlerTagLapseType {
|
export enum BattlerTagLapseType {
|
||||||
FAINT,
|
FAINT,
|
||||||
|
@ -2,7 +2,7 @@ import { getPokemonNameWithAffix } from "../messages";
|
|||||||
import type Pokemon from "../field/pokemon";
|
import type Pokemon from "../field/pokemon";
|
||||||
import { HitResult } from "../field/pokemon";
|
import { HitResult } from "../field/pokemon";
|
||||||
import { getStatusEffectHealText } from "./status-effect";
|
import { getStatusEffectHealText } from "./status-effect";
|
||||||
import { NumberHolder, toDmgValue, randSeedInt } from "#app/utils";
|
import { NumberHolder, toDmgValue, randSeedInt } from "#app/utils/common";
|
||||||
import {
|
import {
|
||||||
DoubleBerryEffectAbAttr,
|
DoubleBerryEffectAbAttr,
|
||||||
PostItemLostAbAttr,
|
PostItemLostAbAttr,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BooleanHolder, type NumberHolder, randSeedItem, deepCopy } from "#app/utils";
|
import { BooleanHolder, type NumberHolder, randSeedItem, deepCopy } from "#app/utils/common";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { DexAttrProps, GameData } from "#app/system/game-data";
|
import type { DexAttrProps, GameData } from "#app/system/game-data";
|
||||||
import { defaultStarterSpecies } from "#app/system/game-data";
|
import { defaultStarterSpecies } from "#app/system/game-data";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { Abilities } from "#enums/abilities";
|
import type { Abilities } from "#enums/abilities";
|
||||||
import type { PokemonType } from "#enums/pokemon-type";
|
import type { PokemonType } from "#enums/pokemon-type";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import type { Nature } from "#enums/nature";
|
import type { Nature } from "#enums/nature";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@ import type { Species } from "#enums/species";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { PlayerPokemon } from "#app/field/pokemon";
|
import { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type { Starter } from "#app/ui/starter-select-ui-handler";
|
import type { Starter } from "#app/ui/starter-select-ui-handler";
|
||||||
import { randSeedGauss, randSeedInt, randSeedItem, getEnumValues } from "#app/utils";
|
import { randSeedGauss, randSeedInt, randSeedItem, getEnumValues } from "#app/utils/common";
|
||||||
import type { PokemonSpeciesForm } from "#app/data/pokemon-species";
|
import type { PokemonSpeciesForm } from "#app/data/pokemon-species";
|
||||||
import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-species";
|
import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-species";
|
||||||
import { speciesStarterCosts } from "#app/data/balance/starters";
|
import { speciesStarterCosts } from "#app/data/balance/starters";
|
||||||
|
@ -4,7 +4,7 @@ import type PokemonSpecies from "#app/data/pokemon-species";
|
|||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import { speciesStarterCosts } from "#app/data/balance/starters";
|
import { speciesStarterCosts } from "#app/data/balance/starters";
|
||||||
import { VariantTier } from "#enums/variant-tier";
|
import { VariantTier } from "#enums/variant-tier";
|
||||||
import { randInt, randomString, randSeedInt, getIvsFromId } from "#app/utils";
|
import { randInt, randomString, randSeedInt, getIvsFromId } from "#app/utils/common";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
|
@ -29,7 +29,7 @@ import {
|
|||||||
} from "../status-effect";
|
} from "../status-effect";
|
||||||
import { getTypeDamageMultiplier } from "../type";
|
import { getTypeDamageMultiplier } from "../type";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { BooleanHolder, NumberHolder, isNullOrUndefined, toDmgValue, randSeedItem, randSeedInt, getEnumValues, toReadableString, type Constructor } from "#app/utils";
|
import { BooleanHolder, NumberHolder, isNullOrUndefined, toDmgValue, randSeedItem, randSeedInt, getEnumValues, toReadableString, type Constructor } from "#app/utils/common";
|
||||||
import { WeatherType } from "#enums/weather-type";
|
import { WeatherType } from "#enums/weather-type";
|
||||||
import type { ArenaTrapTag } from "../arena-tag";
|
import type { ArenaTrapTag } from "../arena-tag";
|
||||||
import { ArenaTagSide, WeakenMoveTypeTag } from "../arena-tag";
|
import { ArenaTagSide, WeakenMoveTypeTag } from "../arena-tag";
|
||||||
|
@ -14,7 +14,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
|||||||
import { TrainerType } from "#enums/trainer-type";
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { IEggOptions } from "#app/data/egg";
|
import type { IEggOptions } from "#app/data/egg";
|
||||||
import { EggSourceType } from "#enums/egg-source-types";
|
import { EggSourceType } from "#enums/egg-source-types";
|
||||||
|
@ -24,7 +24,7 @@ import { BerryModifier, PokemonInstantReviveModifier } from "#app/modifier/modif
|
|||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { randInt } from "#app/utils";
|
import { randInt } from "#app/utils/common";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import {
|
import {
|
||||||
applyModifierTypeToPlayerPokemon,
|
applyModifierTypeToPlayerPokemon,
|
||||||
|
@ -13,7 +13,7 @@ import type { PlayerPokemon } from "#app/field/pokemon";
|
|||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import type { BerryModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
import type { BerryModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
import { ModifierPoolType, modifierTypes, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
import { ModifierPoolType, modifierTypes, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -16,7 +16,7 @@ import { TrainerSlot } from "#enums/trainer-slot";
|
|||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils/common";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter";
|
import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
|
@ -31,9 +31,9 @@ import {
|
|||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { randSeedInt, randSeedShuffle } from "#app/utils";
|
import { randSeedInt, randSeedShuffle } from "#app/utils/common";
|
||||||
import { showEncounterDialogue, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
import { showEncounterDialogue, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
@ -437,7 +437,7 @@ async function handleSwapAbility() {
|
|||||||
await showEncounterDialogue(`${namespace}:option.1.apply_ability_dialogue`, `${namespace}:speaker`);
|
await showEncounterDialogue(`${namespace}:option.1.apply_ability_dialogue`, `${namespace}:speaker`);
|
||||||
await showEncounterText(`${namespace}:option.1.apply_ability_message`);
|
await showEncounterText(`${namespace}:option.1.apply_ability_message`);
|
||||||
|
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
displayYesNoOptions(resolve);
|
displayYesNoOptions(resolve);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -467,7 +467,7 @@ function displayYesNoOptions(resolve) {
|
|||||||
maxOptions: 7,
|
maxOptions: 7,
|
||||||
yOffset: 0,
|
yOffset: 0,
|
||||||
};
|
};
|
||||||
globalScene.ui.setModeWithoutClear(Mode.OPTION_SELECT, config, null, true);
|
globalScene.ui.setModeWithoutClear(UiMode.OPTION_SELECT, config, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onYesAbilitySwap(resolve) {
|
function onYesAbilitySwap(resolve) {
|
||||||
@ -477,11 +477,11 @@ function onYesAbilitySwap(resolve) {
|
|||||||
|
|
||||||
applyAbilityOverrideToPokemon(pokemon, encounter.misc.ability);
|
applyAbilityOverrideToPokemon(pokemon, encounter.misc.ability);
|
||||||
encounter.setDialogueToken("chosenPokemon", pokemon.getNameToRender());
|
encounter.setDialogueToken("chosenPokemon", pokemon.getNameToRender());
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => resolve(true));
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => resolve(true));
|
||||||
};
|
};
|
||||||
|
|
||||||
const onPokemonNotSelected = () => {
|
const onPokemonNotSelected = () => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
displayYesNoOptions(resolve);
|
displayYesNoOptions(resolve);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { PokemonType } from "#enums/pokemon-type";
|
import type { PokemonType } from "#enums/pokemon-type";
|
||||||
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -32,7 +32,7 @@ import { modifierTypes } from "#app/modifier/modifier-type";
|
|||||||
import { ModifierRewardPhase } from "#app/phases/modifier-reward-phase";
|
import { ModifierRewardPhase } from "#app/phases/modifier-reward-phase";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import { randSeedItem } from "#app/utils";
|
import { randSeedItem } from "#app/utils/common";
|
||||||
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 { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
@ -4,7 +4,7 @@ import {
|
|||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { ModifierTypeFunc } from "#app/modifier/modifier-type";
|
import type { ModifierTypeFunc } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -30,7 +30,7 @@ import { PokemonMove } from "#app/field/pokemon";
|
|||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { EncounterBattleAnim } from "#app/data/battle-anims";
|
import { EncounterBattleAnim } from "#app/data/battle-anims";
|
||||||
import { WeatherType } from "#enums/weather-type";
|
import { WeatherType } from "#enums/weather-type";
|
||||||
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||||
import {
|
import {
|
||||||
|
@ -31,7 +31,7 @@ import {
|
|||||||
import PokemonData from "#app/system/pokemon-data";
|
import PokemonData from "#app/system/pokemon-data";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
|
@ -23,7 +23,14 @@ import { allSpecies, getPokemonSpecies } from "#app/data/pokemon-species";
|
|||||||
import { getTypeRgb } from "#app/data/type";
|
import { getTypeRgb } from "#app/data/type";
|
||||||
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { NumberHolder, isNullOrUndefined, randInt, randSeedInt, randSeedShuffle, randSeedItem } from "#app/utils";
|
import {
|
||||||
|
NumberHolder,
|
||||||
|
isNullOrUndefined,
|
||||||
|
randInt,
|
||||||
|
randSeedInt,
|
||||||
|
randSeedShuffle,
|
||||||
|
randSeedItem,
|
||||||
|
} from "#app/utils/common";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { EnemyPokemon, PokemonMove } from "#app/field/pokemon";
|
import { EnemyPokemon, PokemonMove } from "#app/field/pokemon";
|
||||||
|
@ -12,7 +12,7 @@ import { modifierTypes } from "#app/modifier/modifier-type";
|
|||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter";
|
import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
|
@ -18,7 +18,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
import { GameOverPhase } from "#app/phases/game-over-phase";
|
import { GameOverPhase } from "#app/phases/game-over-phase";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
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";
|
||||||
|
@ -15,7 +15,7 @@ import { HiddenAbilityRateBoosterModifier, IvScannerModifier } from "#app/modifi
|
|||||||
import type { EnemyPokemon } from "#app/field/pokemon";
|
import type { EnemyPokemon } from "#app/field/pokemon";
|
||||||
import { PokeballType } from "#enums/pokeball";
|
import { PokeballType } from "#enums/pokeball";
|
||||||
import { PlayerGender } from "#enums/player-gender";
|
import { PlayerGender } from "#enums/player-gender";
|
||||||
import { NumberHolder, randSeedInt } from "#app/utils";
|
import { NumberHolder, randSeedInt } from "#app/utils/common";
|
||||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
transitionMysteryEncounterIntroVisuals,
|
transitionMysteryEncounterIntroVisuals,
|
||||||
updatePlayerMoney,
|
updatePlayerMoney,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { randSeedShuffle } from "#app/utils";
|
import { randSeedShuffle } from "#app/utils/common";
|
||||||
import type MysteryEncounter from "../mystery-encounter";
|
import type MysteryEncounter from "../mystery-encounter";
|
||||||
import { MysteryEncounterBuilder } from "../mystery-encounter";
|
import { MysteryEncounterBuilder } from "../mystery-encounter";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
transitionMysteryEncounterIntroVisuals,
|
transitionMysteryEncounterIntroVisuals,
|
||||||
updatePlayerMoney,
|
updatePlayerMoney,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -15,7 +15,7 @@ import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
|||||||
import { AbilityAttr } from "#app/system/game-data";
|
import { AbilityAttr } from "#app/system/game-data";
|
||||||
import PokemonData from "#app/system/pokemon-data";
|
import PokemonData from "#app/system/pokemon-data";
|
||||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import { isNullOrUndefined, randSeedShuffle } from "#app/utils";
|
import { isNullOrUndefined, randSeedShuffle } from "#app/utils/common";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -27,7 +27,7 @@ import { Moves } from "#enums/moves";
|
|||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { PokemonMove } from "#app/field/pokemon";
|
import { PokemonMove } from "#app/field/pokemon";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounters/trashToTreasure";
|
const namespace = "mysteryEncounters/trashToTreasure";
|
||||||
|
@ -27,7 +27,7 @@ import {
|
|||||||
getSpriteKeysFromPokemon,
|
getSpriteKeysFromPokemon,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
import PokemonData from "#app/system/pokemon-data";
|
import PokemonData from "#app/system/pokemon-data";
|
||||||
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
||||||
import type { Moves } from "#enums/moves";
|
import type { Moves } from "#enums/moves";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { SelfStatusMove } from "#app/data/moves/move";
|
import { SelfStatusMove } from "#app/data/moves/move";
|
||||||
|
@ -17,7 +17,7 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode
|
|||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { PokemonMove } from "#app/field/pokemon";
|
import { PokemonMove } from "#app/field/pokemon";
|
||||||
import { NumberHolder, isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils";
|
import { NumberHolder, isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils/common";
|
||||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||||
import { allSpecies, getPokemonSpecies } from "#app/data/pokemon-species";
|
import { allSpecies, getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
} from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
} from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
||||||
import type { CanLearnMoveRequirementOptions } from "./requirements/can-learn-move-requirement";
|
import type { CanLearnMoveRequirementOptions } from "./requirements/can-learn-move-requirement";
|
||||||
import { CanLearnMoveRequirement } from "./requirements/can-learn-move-requirement";
|
import { CanLearnMoveRequirement } from "./requirements/can-learn-move-requirement";
|
||||||
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noConfusingVoidType: void unions in callbacks are OK
|
// biome-ignore lint/suspicious/noConfusingVoidType: void unions in callbacks are OK
|
||||||
|
@ -9,7 +9,7 @@ import { WeatherType } from "#enums/weather-type";
|
|||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import { AttackTypeBoosterModifier } from "#app/modifier/modifier";
|
import { AttackTypeBoosterModifier } from "#app/modifier/modifier";
|
||||||
import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type";
|
import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import type { Abilities } from "#enums/abilities";
|
import type { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT } from "#app/data/mystery-encounters/mystery-encounters";
|
import { BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT } from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import type { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import type { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
|
|
||||||
export class SeenEncounterData {
|
export class SeenEncounterData {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon";
|
import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { capitalizeFirstLetter, isNullOrUndefined } from "#app/utils";
|
import { capitalizeFirstLetter, isNullOrUndefined } from "#app/utils/common";
|
||||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import type { MysteryEncounterSpriteConfig } from "#app/field/mystery-encounter-intro";
|
import type { MysteryEncounterSpriteConfig } from "#app/field/mystery-encounter-intro";
|
||||||
import MysteryEncounterIntroVisuals from "#app/field/mystery-encounter-intro";
|
import MysteryEncounterIntroVisuals from "#app/field/mystery-encounter-intro";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import type { StatusEffect } from "#enums/status-effect";
|
import type { StatusEffect } from "#enums/status-effect";
|
||||||
import type { OptionTextDisplay } from "./mystery-encounter-dialogue";
|
import type { OptionTextDisplay } from "./mystery-encounter-dialogue";
|
||||||
import type MysteryEncounterDialogue from "./mystery-encounter-dialogue";
|
import type MysteryEncounterDialogue from "./mystery-encounter-dialogue";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import type { Moves } from "#app/enums/moves";
|
import type { Moves } from "#app/enums/moves";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import { PokemonMove } from "#app/field/pokemon";
|
import { PokemonMove } from "#app/field/pokemon";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import { EncounterPokemonRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
import { EncounterPokemonRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import type { TextStyle } from "#app/ui/text";
|
import type { TextStyle } from "#app/ui/text";
|
||||||
import { getTextWithColors } from "#app/ui/text";
|
import { getTextWithColors } from "#app/ui/text";
|
||||||
import { UiTheme } from "#enums/ui-theme";
|
import { UiTheme } from "#enums/ui-theme";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,8 +30,8 @@ import type PokemonData from "#app/system/pokemon-data";
|
|||||||
import type { OptionSelectConfig, OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectConfig, OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import type { PartyOption, PokemonSelectFilter } from "#app/ui/party-ui-handler";
|
import type { PartyOption, PokemonSelectFilter } from "#app/ui/party-ui-handler";
|
||||||
import { PartyUiMode } from "#app/ui/party-ui-handler";
|
import { PartyUiMode } from "#app/ui/party-ui-handler";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { isNullOrUndefined, randSeedInt, randomString, randSeedItem } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt, randomString, randSeedItem } from "#app/utils/common";
|
||||||
import type { BattlerTagType } from "#enums/battler-tag-type";
|
import type { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { Biome } from "#enums/biome";
|
import { Biome } from "#enums/biome";
|
||||||
import type { TrainerType } from "#enums/trainer-type";
|
import type { TrainerType } from "#enums/trainer-type";
|
||||||
@ -563,7 +563,7 @@ export function selectPokemonForOption(
|
|||||||
|
|
||||||
// Open party screen to choose pokemon
|
// Open party screen to choose pokemon
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.PARTY,
|
UiMode.PARTY,
|
||||||
PartyUiMode.SELECT,
|
PartyUiMode.SELECT,
|
||||||
-1,
|
-1,
|
||||||
(slotIndex: number, _option: PartyOption) => {
|
(slotIndex: number, _option: PartyOption) => {
|
||||||
@ -581,7 +581,7 @@ export function selectPokemonForOption(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// There is a second option to choose after selecting the Pokemon
|
// There is a second option to choose after selecting the Pokemon
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
const displayOptions = () => {
|
const displayOptions = () => {
|
||||||
// Always appends a cancel option to bottom of options
|
// Always appends a cancel option to bottom of options
|
||||||
const fullOptions = secondaryOptions
|
const fullOptions = secondaryOptions
|
||||||
@ -623,7 +623,7 @@ export function selectPokemonForOption(
|
|||||||
if (fullOptions[0].onHover) {
|
if (fullOptions[0].onHover) {
|
||||||
fullOptions[0].onHover();
|
fullOptions[0].onHover();
|
||||||
}
|
}
|
||||||
globalScene.ui.setModeWithoutClear(Mode.OPTION_SELECT, config, null, true);
|
globalScene.ui.setModeWithoutClear(UiMode.OPTION_SELECT, config, null, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const textPromptKey =
|
const textPromptKey =
|
||||||
@ -673,20 +673,20 @@ export function selectOptionThenPokemon(
|
|||||||
const modeToSetOnExit = globalScene.ui.getMode();
|
const modeToSetOnExit = globalScene.ui.getMode();
|
||||||
|
|
||||||
const displayOptions = (config: OptionSelectConfig) => {
|
const displayOptions = (config: OptionSelectConfig) => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
if (!optionSelectPromptKey) {
|
if (!optionSelectPromptKey) {
|
||||||
// Do hover over the starting selection option
|
// Do hover over the starting selection option
|
||||||
if (fullOptions[0].onHover) {
|
if (fullOptions[0].onHover) {
|
||||||
fullOptions[0].onHover();
|
fullOptions[0].onHover();
|
||||||
}
|
}
|
||||||
globalScene.ui.setMode(Mode.OPTION_SELECT, config);
|
globalScene.ui.setMode(UiMode.OPTION_SELECT, config);
|
||||||
} else {
|
} else {
|
||||||
showEncounterText(optionSelectPromptKey).then(() => {
|
showEncounterText(optionSelectPromptKey).then(() => {
|
||||||
// Do hover over the starting selection option
|
// Do hover over the starting selection option
|
||||||
if (fullOptions[0].onHover) {
|
if (fullOptions[0].onHover) {
|
||||||
fullOptions[0].onHover();
|
fullOptions[0].onHover();
|
||||||
}
|
}
|
||||||
globalScene.ui.setMode(Mode.OPTION_SELECT, config);
|
globalScene.ui.setMode(UiMode.OPTION_SELECT, config);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -695,7 +695,7 @@ export function selectOptionThenPokemon(
|
|||||||
const selectPokemonAfterOption = (selectedOptionIndex: number) => {
|
const selectPokemonAfterOption = (selectedOptionIndex: number) => {
|
||||||
// Open party screen to choose a Pokemon
|
// Open party screen to choose a Pokemon
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.PARTY,
|
UiMode.PARTY,
|
||||||
PartyUiMode.SELECT,
|
PartyUiMode.SELECT,
|
||||||
-1,
|
-1,
|
||||||
(slotIndex: number, _option: PartyOption) => {
|
(slotIndex: number, _option: PartyOption) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
||||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||||
import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
|
import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
@ -14,7 +14,7 @@ import { PlayerGender } from "#enums/player-gender";
|
|||||||
import { addPokeballCaptureStars, addPokeballOpenParticles } from "#app/field/anims";
|
import { addPokeballCaptureStars, addPokeballOpenParticles } from "#app/field/anims";
|
||||||
import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
|
import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
|
||||||
import { achvs } from "#app/system/achv";
|
import { achvs } from "#app/system/achv";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type { PartyOption } from "#app/ui/party-ui-handler";
|
import type { PartyOption } from "#app/ui/party-ui-handler";
|
||||||
import { PartyUiMode } from "#app/ui/party-ui-handler";
|
import { PartyUiMode } from "#app/ui/party-ui-handler";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
@ -714,7 +714,7 @@ export async function catchPokemon(
|
|||||||
() => {
|
() => {
|
||||||
globalScene.pokemonInfoContainer.makeRoomForConfirmUi(1, true);
|
globalScene.pokemonInfoContainer.makeRoomForConfirmUi(1, true);
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
const newPokemon = globalScene.addPlayerPokemon(
|
const newPokemon = globalScene.addPlayerPokemon(
|
||||||
pokemon.species,
|
pokemon.species,
|
||||||
@ -729,12 +729,12 @@ export async function catchPokemon(
|
|||||||
pokemon,
|
pokemon,
|
||||||
);
|
);
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.SUMMARY,
|
UiMode.SUMMARY,
|
||||||
newPokemon,
|
newPokemon,
|
||||||
0,
|
0,
|
||||||
SummaryUiMode.DEFAULT,
|
SummaryUiMode.DEFAULT,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
promptRelease();
|
promptRelease();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -749,13 +749,13 @@ export async function catchPokemon(
|
|||||||
female: pokemon.gender === Gender.FEMALE,
|
female: pokemon.gender === Gender.FEMALE,
|
||||||
};
|
};
|
||||||
globalScene.ui.setOverlayMode(
|
globalScene.ui.setOverlayMode(
|
||||||
Mode.POKEDEX_PAGE,
|
UiMode.POKEDEX_PAGE,
|
||||||
pokemon.species,
|
pokemon.species,
|
||||||
pokemon.formIndex,
|
pokemon.formIndex,
|
||||||
attributes,
|
attributes,
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
promptRelease();
|
promptRelease();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -763,11 +763,11 @@ export async function catchPokemon(
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.PARTY,
|
UiMode.PARTY,
|
||||||
PartyUiMode.RELEASE,
|
PartyUiMode.RELEASE,
|
||||||
0,
|
0,
|
||||||
(slotIndex: number, _option: PartyOption) => {
|
(slotIndex: number, _option: PartyOption) => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
if (slotIndex < 6) {
|
if (slotIndex < 6) {
|
||||||
addToParty(slotIndex);
|
addToParty(slotIndex);
|
||||||
} else {
|
} else {
|
||||||
@ -778,7 +778,7 @@ export async function catchPokemon(
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
removePokemon();
|
removePokemon();
|
||||||
end();
|
end();
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import { getFrameMs } from "#app/utils";
|
import { getFrameMs } from "#app/utils/common";
|
||||||
import { cos, sin } from "#app/field/anims";
|
import { cos, sin } from "#app/field/anims";
|
||||||
import { getTypeRgb } from "#app/data/type";
|
import { getTypeRgb } from "#app/data/type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { toReadableString } from "#app/utils";
|
import { toReadableString } from "#app/utils/common";
|
||||||
import { TextStyle, getBBCodeFrag } from "../ui/text";
|
import { TextStyle, getBBCodeFrag } from "../ui/text";
|
||||||
import { Nature } from "#enums/nature";
|
import { Nature } from "#enums/nature";
|
||||||
import { UiTheme } from "#enums/ui-theme";
|
import { UiTheme } from "#enums/ui-theme";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { CriticalCatchChanceBoosterModifier } from "#app/modifier/modifier";
|
import { CriticalCatchChanceBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { NumberHolder } from "#app/utils";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { PokeballType } from "#enums/pokeball";
|
import { PokeballType } from "#enums/pokeball";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import type Pokemon from "../field/pokemon";
|
|||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import { allMoves } from "./moves/move";
|
import { allMoves } from "./moves/move";
|
||||||
import { MoveCategory } from "#enums/MoveCategory";
|
import { MoveCategory } from "#enums/MoveCategory";
|
||||||
import type { Constructor, nil } from "#app/utils";
|
import type { Constructor, nil } from "#app/utils/common";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
@ -8,7 +8,7 @@ import type { AnySound } from "#app/battle-scene";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { GameMode } from "#app/game-mode";
|
import type { GameMode } from "#app/game-mode";
|
||||||
import { DexAttr, type StarterMoveset } from "#app/system/game-data";
|
import { DexAttr, type StarterMoveset } from "#app/system/game-data";
|
||||||
import { isNullOrUndefined, capitalizeString, randSeedInt, randSeedGauss, randSeedItem } from "#app/utils";
|
import { isNullOrUndefined, capitalizeString, randSeedInt, randSeedGauss, randSeedItem } from "#app/utils/common";
|
||||||
import { uncatchableSpecies } from "#app/data/balance/biomes";
|
import { uncatchableSpecies } from "#app/data/balance/biomes";
|
||||||
import { speciesEggMoves } from "#app/data/balance/egg-moves";
|
import { speciesEggMoves } from "#app/data/balance/egg-moves";
|
||||||
import { GrowthRate } from "#app/data/exp";
|
import { GrowthRate } from "#app/data/exp";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { randIntRange } from "#app/utils";
|
import { randIntRange } from "#app/utils/common";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import type { ParseKeys } from "i18next";
|
import type { ParseKeys } from "i18next";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { TrainerType } from "#enums/trainer-type";
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
import { toReadableString } from "#app/utils";
|
import { toReadableString } from "#app/utils/common";
|
||||||
|
|
||||||
class TrainerNameConfig {
|
class TrainerNameConfig {
|
||||||
public urls: string[];
|
public urls: string[];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { startingWave } from "#app/battle-scene";
|
import { startingWave } from "#app/starting-wave";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { PokemonMove } from "#app/field/pokemon";
|
import { PokemonMove } from "#app/field/pokemon";
|
||||||
import { toReadableString, isNullOrUndefined, randSeedItem, randSeedInt } from "#app/utils";
|
import { toReadableString, isNullOrUndefined, randSeedItem, randSeedInt } from "#app/utils/common";
|
||||||
import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import { tmSpecies } from "#app/data/balance/tms";
|
import { tmSpecies } from "#app/data/balance/tms";
|
||||||
|
@ -5,7 +5,7 @@ import type Pokemon from "../field/pokemon";
|
|||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import type Move from "./moves/move";
|
import type Move from "./moves/move";
|
||||||
import { AttackMove } from "./moves/move";
|
import { AttackMove } from "./moves/move";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { SuppressWeatherEffectAbAttr } from "./abilities/ability";
|
import { SuppressWeatherEffectAbAttr } from "./abilities/ability";
|
||||||
import { TerrainType, getTerrainName } from "./terrain";
|
import { TerrainType, getTerrainName } from "./terrain";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
47
src/enums/ui-mode.ts
Normal file
47
src/enums/ui-mode.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
export enum UiMode {
|
||||||
|
MESSAGE,
|
||||||
|
TITLE,
|
||||||
|
COMMAND,
|
||||||
|
FIGHT,
|
||||||
|
BALL,
|
||||||
|
TARGET_SELECT,
|
||||||
|
MODIFIER_SELECT,
|
||||||
|
SAVE_SLOT,
|
||||||
|
PARTY,
|
||||||
|
SUMMARY,
|
||||||
|
STARTER_SELECT,
|
||||||
|
EVOLUTION_SCENE,
|
||||||
|
EGG_HATCH_SCENE,
|
||||||
|
EGG_HATCH_SUMMARY,
|
||||||
|
CONFIRM,
|
||||||
|
OPTION_SELECT,
|
||||||
|
MENU,
|
||||||
|
MENU_OPTION_SELECT,
|
||||||
|
SETTINGS,
|
||||||
|
SETTINGS_DISPLAY,
|
||||||
|
SETTINGS_AUDIO,
|
||||||
|
SETTINGS_GAMEPAD,
|
||||||
|
GAMEPAD_BINDING,
|
||||||
|
SETTINGS_KEYBOARD,
|
||||||
|
KEYBOARD_BINDING,
|
||||||
|
ACHIEVEMENTS,
|
||||||
|
GAME_STATS,
|
||||||
|
EGG_LIST,
|
||||||
|
EGG_GACHA,
|
||||||
|
POKEDEX,
|
||||||
|
POKEDEX_SCAN,
|
||||||
|
POKEDEX_PAGE,
|
||||||
|
LOGIN_FORM,
|
||||||
|
REGISTRATION_FORM,
|
||||||
|
LOADING,
|
||||||
|
SESSION_RELOAD,
|
||||||
|
UNAVAILABLE,
|
||||||
|
CHALLENGE_SELECT,
|
||||||
|
RENAME_POKEMON,
|
||||||
|
RUN_HISTORY,
|
||||||
|
RUN_INFO,
|
||||||
|
TEST_DIALOGUE,
|
||||||
|
AUTO_COMPLETE,
|
||||||
|
ADMIN,
|
||||||
|
MYSTERY_ENCOUNTER
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { PokeballType } from "#enums/pokeball";
|
import { PokeballType } from "#enums/pokeball";
|
||||||
import type { Variant } from "#app/sprites/variant";
|
import type { Variant } from "#app/sprites/variant";
|
||||||
import { getFrameMs, randGauss } from "#app/utils";
|
import { getFrameMs, randGauss } from "#app/utils/common";
|
||||||
|
|
||||||
export function addPokeballOpenParticles(x: number, y: number, pokeballType: PokeballType): void {
|
export function addPokeballOpenParticles(x: number, y: number, pokeballType: PokeballType): void {
|
||||||
switch (pokeballType) {
|
switch (pokeballType) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { BiomeTierTrainerPools, PokemonPools } from "#app/data/balance/biomes";
|
import type { BiomeTierTrainerPools, PokemonPools } from "#app/data/balance/biomes";
|
||||||
import { biomePokemonPools, BiomePoolTier, biomeTrainerPools } from "#app/data/balance/biomes";
|
import { biomePokemonPools, BiomePoolTier, biomeTrainerPools } from "#app/data/balance/biomes";
|
||||||
import { randSeedInt, NumberHolder, isNullOrUndefined, type Constructor } from "#app/utils";
|
import { randSeedInt, NumberHolder, isNullOrUndefined, type Constructor } from "#app/utils/common";
|
||||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import {
|
import {
|
||||||
|
@ -2,7 +2,7 @@ import { TextStyle, addTextObject } from "../ui/text";
|
|||||||
import type { DamageResult } from "./pokemon";
|
import type { DamageResult } from "./pokemon";
|
||||||
import type Pokemon from "./pokemon";
|
import type Pokemon from "./pokemon";
|
||||||
import { HitResult } from "./pokemon";
|
import { HitResult } from "./pokemon";
|
||||||
import { formatStat, fixedInt } from "#app/utils";
|
import { formatStat, fixedInt } from "#app/utils/common";
|
||||||
import type { BattlerIndex } from "../battle";
|
import type { BattlerIndex } from "../battle";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import type { GameObjects } from "phaser";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import type { Species } from "#enums/species";
|
import type { Species } from "#enums/species";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
import type { Variant } from "#app/sprites/variant";
|
import type { Variant } from "#app/sprites/variant";
|
||||||
import { doShinySparkleAnim } from "#app/field/anims";
|
import { doShinySparkleAnim } from "#app/field/anims";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import Pokemon from "./pokemon";
|
import Pokemon from "./pokemon";
|
||||||
import { fixedInt, randInt } from "#app/utils";
|
import { fixedInt, randInt } from "#app/utils/common";
|
||||||
|
|
||||||
export default class PokemonSpriteSparkleHandler {
|
export default class PokemonSpriteSparkleHandler {
|
||||||
private sprites: Set<Phaser.GameObjects.Sprite>;
|
private sprites: Set<Phaser.GameObjects.Sprite>;
|
||||||
|
@ -55,7 +55,7 @@ import {
|
|||||||
getStarterValueFriendshipCap,
|
getStarterValueFriendshipCap,
|
||||||
speciesStarterCosts,
|
speciesStarterCosts,
|
||||||
} from "#app/data/balance/starters";
|
} from "#app/data/balance/starters";
|
||||||
import { NumberHolder, randSeedInt, getIvsFromId, BooleanHolder, randSeedItem, isNullOrUndefined, getEnumValues, toDmgValue, fixedInt, rgbaToInt, rgbHexToRgba, rgbToHsv, deltaRgb, isBetween, type nil, type Constructor } from "#app/utils";
|
import { NumberHolder, randSeedInt, getIvsFromId, BooleanHolder, randSeedItem, isNullOrUndefined, getEnumValues, toDmgValue, fixedInt, rgbaToInt, rgbHexToRgba, rgbToHsv, deltaRgb, isBetween, type nil, type Constructor } from "#app/utils/common";
|
||||||
import type { TypeDamageMultiplier } from "#app/data/type";
|
import type { TypeDamageMultiplier } from "#app/data/type";
|
||||||
import { getTypeDamageMultiplier, getTypeRgb } from "#app/data/type";
|
import { getTypeDamageMultiplier, getTypeRgb } from "#app/data/type";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
@ -193,7 +193,7 @@ import {
|
|||||||
import { allAbilities } from "#app/data/data-lists";
|
import { allAbilities } from "#app/data/data-lists";
|
||||||
import type PokemonData from "#app/system/pokemon-data";
|
import type PokemonData from "#app/system/pokemon-data";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type { PartyOption } from "#app/ui/party-ui-handler";
|
import type { PartyOption } from "#app/ui/party-ui-handler";
|
||||||
import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler";
|
import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler";
|
||||||
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
||||||
@ -6581,7 +6581,7 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
this.leaveField(switchType === SwitchType.SWITCH);
|
this.leaveField(switchType === SwitchType.SWITCH);
|
||||||
|
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.PARTY,
|
UiMode.PARTY,
|
||||||
PartyUiMode.FAINT_SWITCH,
|
PartyUiMode.FAINT_SWITCH,
|
||||||
this.getFieldIndex(),
|
this.getFieldIndex(),
|
||||||
(slotIndex: number, option: PartyOption) => {
|
(slotIndex: number, option: PartyOption) => {
|
||||||
@ -6599,7 +6599,7 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
MoveEndPhase,
|
MoveEndPhase,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(resolve);
|
globalScene.ui.setMode(UiMode.MESSAGE).then(resolve);
|
||||||
},
|
},
|
||||||
PartyUiHandler.FilterNonFainted,
|
PartyUiHandler.FilterNonFainted,
|
||||||
);
|
);
|
||||||
|
@ -11,7 +11,7 @@ import { TrainerSlot } from "#enums/trainer-slot";
|
|||||||
import { TrainerPoolTier } from "#enums/trainer-pool-tier";
|
import { TrainerPoolTier } from "#enums/trainer-pool-tier";
|
||||||
import { TeraAIMode } from "#enums/tera-ai-mode";
|
import { TeraAIMode } from "#enums/tera-ai-mode";
|
||||||
import type { EnemyPokemon } from "#app/field/pokemon";
|
import type { EnemyPokemon } from "#app/field/pokemon";
|
||||||
import { randSeedWeightedItem, randSeedItem, randSeedInt } from "#app/utils";
|
import { randSeedWeightedItem, randSeedItem, randSeedInt } from "#app/utils/common";
|
||||||
import type { PersistentModifier } from "#app/modifier/modifier";
|
import type { PersistentModifier } from "#app/modifier/modifier";
|
||||||
import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag";
|
import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag";
|
||||||
import { getIsInitialized, initI18n } from "#app/plugins/i18n";
|
import { getIsInitialized, initI18n } from "#app/plugins/i18n";
|
||||||
|
@ -7,7 +7,7 @@ import type PokemonSpecies from "./data/pokemon-species";
|
|||||||
import { allSpecies } from "./data/pokemon-species";
|
import { allSpecies } from "./data/pokemon-species";
|
||||||
import type { Arena } from "./field/arena";
|
import type { Arena } from "./field/arena";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { randSeedInt, randSeedItem } from "#app/utils";
|
import { randSeedInt, randSeedItem } from "#app/utils/common";
|
||||||
import { Biome } from "#enums/biome";
|
import { Biome } from "#enums/biome";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { Challenges } from "./enums/challenges";
|
import { Challenges } from "./enums/challenges";
|
||||||
|
1
src/global-vars/bypass-login.ts
Normal file
1
src/global-vars/bypass-login.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
4
src/global-vars/starter-colors.ts
Normal file
4
src/global-vars/starter-colors.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export const starterColors: StarterColors = {};
|
||||||
|
interface StarterColors {
|
||||||
|
[key: string]: [string, string];
|
||||||
|
}
|
@ -1,11 +1,11 @@
|
|||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { deepCopy, getEnumValues } from "#app/utils";
|
import { deepCopy, getEnumValues } from "#app/utils/common";
|
||||||
import pad_generic from "./configs/inputs/pad_generic";
|
import pad_generic from "./configs/inputs/pad_generic";
|
||||||
import pad_unlicensedSNES from "./configs/inputs/pad_unlicensedSNES";
|
import pad_unlicensedSNES from "./configs/inputs/pad_unlicensedSNES";
|
||||||
import pad_xbox360 from "./configs/inputs/pad_xbox360";
|
import pad_xbox360 from "./configs/inputs/pad_xbox360";
|
||||||
import pad_dualshock from "./configs/inputs/pad_dualshock";
|
import pad_dualshock from "./configs/inputs/pad_dualshock";
|
||||||
import pad_procon from "./configs/inputs/pad_procon";
|
import pad_procon from "./configs/inputs/pad_procon";
|
||||||
import { Mode } from "./ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler";
|
import type SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler";
|
||||||
import type SettingsKeyboardUiHandler from "./ui/settings/settings-keyboard-ui-handler";
|
import type SettingsKeyboardUiHandler from "./ui/settings/settings-keyboard-ui-handler";
|
||||||
import cfg_keyboard_qwerty from "./configs/inputs/cfg_keyboard_qwerty";
|
import cfg_keyboard_qwerty from "./configs/inputs/cfg_keyboard_qwerty";
|
||||||
@ -235,7 +235,7 @@ export class InputsController {
|
|||||||
if (gamepadName) {
|
if (gamepadName) {
|
||||||
this.selectedDevice[Device.GAMEPAD] = gamepadName.toLowerCase();
|
this.selectedDevice[Device.GAMEPAD] = gamepadName.toLowerCase();
|
||||||
}
|
}
|
||||||
const handler = globalScene.ui?.handlers[Mode.SETTINGS_GAMEPAD] as SettingsGamepadUiHandler;
|
const handler = globalScene.ui?.handlers[UiMode.SETTINGS_GAMEPAD] as SettingsGamepadUiHandler;
|
||||||
handler?.updateChosenGamepadDisplay();
|
handler?.updateChosenGamepadDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ export class InputsController {
|
|||||||
if (layoutKeyboard) {
|
if (layoutKeyboard) {
|
||||||
this.selectedDevice[Device.KEYBOARD] = layoutKeyboard.toLowerCase();
|
this.selectedDevice[Device.KEYBOARD] = layoutKeyboard.toLowerCase();
|
||||||
}
|
}
|
||||||
const handler = globalScene.ui?.handlers[Mode.SETTINGS_KEYBOARD] as SettingsKeyboardUiHandler;
|
const handler = globalScene.ui?.handlers[UiMode.SETTINGS_KEYBOARD] as SettingsKeyboardUiHandler;
|
||||||
handler?.updateChosenKeyboardDisplay();
|
handler?.updateChosenKeyboardDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ export class InputsController {
|
|||||||
globalScene.gameData?.saveMappingConfigs(gamepadID, this.configs[gamepadID]);
|
globalScene.gameData?.saveMappingConfigs(gamepadID, this.configs[gamepadID]);
|
||||||
}
|
}
|
||||||
this.lastSource = "gamepad";
|
this.lastSource = "gamepad";
|
||||||
const handler = globalScene.ui?.handlers[Mode.SETTINGS_GAMEPAD] as SettingsGamepadUiHandler;
|
const handler = globalScene.ui?.handlers[UiMode.SETTINGS_GAMEPAD] as SettingsGamepadUiHandler;
|
||||||
handler?.updateChosenGamepadDisplay();
|
handler?.updateChosenGamepadDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ export class InputsController {
|
|||||||
this.lastSource = "gamepad";
|
this.lastSource = "gamepad";
|
||||||
if (
|
if (
|
||||||
!this.selectedDevice[Device.GAMEPAD] ||
|
!this.selectedDevice[Device.GAMEPAD] ||
|
||||||
(globalScene.ui.getMode() !== Mode.GAMEPAD_BINDING &&
|
(globalScene.ui.getMode() !== UiMode.GAMEPAD_BINDING &&
|
||||||
this.selectedDevice[Device.GAMEPAD] !== pad.id.toLowerCase())
|
this.selectedDevice[Device.GAMEPAD] !== pad.id.toLowerCase())
|
||||||
) {
|
) {
|
||||||
this.setChosenGamepad(pad.id);
|
this.setChosenGamepad(pad.id);
|
||||||
|
@ -4,7 +4,7 @@ import CacheBustedLoaderPlugin from "#app/plugins/cache-busted-loader-plugin";
|
|||||||
import { SceneBase } from "#app/scene-base";
|
import { SceneBase } from "#app/scene-base";
|
||||||
import { WindowVariant, getWindowVariantSuffix } from "#app/ui/ui-theme";
|
import { WindowVariant, getWindowVariantSuffix } from "#app/ui/ui-theme";
|
||||||
import { isMobile } from "#app/touch-controls";
|
import { isMobile } from "#app/touch-controls";
|
||||||
import { localPing, getEnumValues, hasAllLocalizedSprites, getEnumKeys } from "#app/utils";
|
import { localPing, getEnumValues, hasAllLocalizedSprites, getEnumKeys } from "#app/utils/common";
|
||||||
import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions";
|
import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { initBiomes } from "#app/data/balance/biomes";
|
import { initBiomes } from "#app/data/balance/biomes";
|
||||||
import { initEggMoves } from "#app/data/balance/egg-moves";
|
import { initEggMoves } from "#app/data/balance/egg-moves";
|
||||||
|
@ -114,7 +114,7 @@ import {
|
|||||||
NumberHolder,
|
NumberHolder,
|
||||||
padInt,
|
padInt,
|
||||||
randSeedInt,
|
randSeedInt,
|
||||||
} from "#app/utils";
|
} from "#app/utils/common";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { BerryType } from "#enums/berry-type";
|
import { BerryType } from "#enums/berry-type";
|
||||||
|
@ -15,7 +15,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase";
|
|||||||
import type { VoucherType } from "#app/system/voucher";
|
import type { VoucherType } from "#app/system/voucher";
|
||||||
import { Command } from "#app/ui/command-ui-handler";
|
import { Command } from "#app/ui/command-ui-handler";
|
||||||
import { addTextObject, TextStyle } from "#app/ui/text";
|
import { addTextObject, TextStyle } from "#app/ui/text";
|
||||||
import { BooleanHolder, hslToHex, isNullOrUndefined, NumberHolder, toDmgValue } from "#app/utils";
|
import { BooleanHolder, hslToHex, isNullOrUndefined, NumberHolder, toDmgValue } from "#app/utils/common";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { BerryType } from "#enums/berry-type";
|
import { BerryType } from "#enums/berry-type";
|
||||||
import type { Moves } from "#enums/moves";
|
import type { Moves } from "#enums/moves";
|
||||||
|
@ -19,7 +19,7 @@ import { achvs } from "#app/system/achv";
|
|||||||
import type { PartyOption } from "#app/ui/party-ui-handler";
|
import type { PartyOption } from "#app/ui/party-ui-handler";
|
||||||
import { PartyUiMode } from "#app/ui/party-ui-handler";
|
import { PartyUiMode } from "#app/ui/party-ui-handler";
|
||||||
import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type { PokeballType } from "#enums/pokeball";
|
import type { PokeballType } from "#enums/pokeball";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -295,7 +295,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
() => {
|
() => {
|
||||||
globalScene.pokemonInfoContainer.makeRoomForConfirmUi(1, true);
|
globalScene.pokemonInfoContainer.makeRoomForConfirmUi(1, true);
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
const newPokemon = globalScene.addPlayerPokemon(
|
const newPokemon = globalScene.addPlayerPokemon(
|
||||||
pokemon.species,
|
pokemon.species,
|
||||||
@ -310,12 +310,12 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
pokemon,
|
pokemon,
|
||||||
);
|
);
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.SUMMARY,
|
UiMode.SUMMARY,
|
||||||
newPokemon,
|
newPokemon,
|
||||||
0,
|
0,
|
||||||
SummaryUiMode.DEFAULT,
|
SummaryUiMode.DEFAULT,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
promptRelease();
|
promptRelease();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -329,19 +329,26 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
form: pokemon.formIndex,
|
form: pokemon.formIndex,
|
||||||
female: pokemon.gender === Gender.FEMALE,
|
female: pokemon.gender === Gender.FEMALE,
|
||||||
};
|
};
|
||||||
globalScene.ui.setOverlayMode(Mode.POKEDEX_PAGE, pokemon.species, attributes, null, null, () => {
|
globalScene.ui.setOverlayMode(
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
UiMode.POKEDEX_PAGE,
|
||||||
promptRelease();
|
pokemon.species,
|
||||||
});
|
attributes,
|
||||||
});
|
null,
|
||||||
|
null,
|
||||||
|
() => {
|
||||||
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
|
promptRelease();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.PARTY,
|
UiMode.PARTY,
|
||||||
PartyUiMode.RELEASE,
|
PartyUiMode.RELEASE,
|
||||||
this.fieldIndex,
|
this.fieldIndex,
|
||||||
(slotIndex: number, _option: PartyOption) => {
|
(slotIndex: number, _option: PartyOption) => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
if (slotIndex < 6) {
|
if (slotIndex < 6) {
|
||||||
addToParty(slotIndex);
|
addToParty(slotIndex);
|
||||||
} else {
|
} else {
|
||||||
@ -352,7 +359,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
removePokemon();
|
removePokemon();
|
||||||
end();
|
end();
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,7 @@ import { StatusEffect } from "#enums/status-effect";
|
|||||||
import type { PlayerPokemon, EnemyPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon, EnemyPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { NumberHolder } from "#app/utils";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { BattleEndPhase } from "./battle-end-phase";
|
import { BattleEndPhase } from "./battle-end-phase";
|
||||||
import { NewBattlePhase } from "./new-battle-phase";
|
import { NewBattlePhase } from "./new-battle-phase";
|
||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
|
@ -4,7 +4,7 @@ import { BerryUsedEvent } from "#app/events/battle-scene";
|
|||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { BerryModifier } from "#app/modifier/modifier";
|
import { BerryModifier } from "#app/modifier/modifier";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { BooleanHolder } from "#app/utils";
|
import { BooleanHolder } from "#app/utils/common";
|
||||||
import { FieldPhase } from "./field-phase";
|
import { FieldPhase } from "./field-phase";
|
||||||
import { CommonAnimPhase } from "./common-anim-phase";
|
import { CommonAnimPhase } from "./common-anim-phase";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { BattleStyle } from "#app/enums/battle-style";
|
import { BattleStyle } from "#app/enums/battle-style";
|
||||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { BattlePhase } from "./battle-phase";
|
import { BattlePhase } from "./battle-phase";
|
||||||
import { SummonMissingPhase } from "./summon-missing-phase";
|
import { SummonMissingPhase } from "./summon-missing-phase";
|
||||||
@ -64,14 +64,14 @@ export class CheckSwitchPhase extends BattlePhase {
|
|||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.unshiftPhase(new SwitchPhase(SwitchType.INITIAL_SWITCH, this.fieldIndex, false, true));
|
globalScene.unshiftPhase(new SwitchPhase(SwitchType.INITIAL_SWITCH, this.fieldIndex, false, true));
|
||||||
this.end();
|
this.end();
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
this.end();
|
this.end();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -15,12 +15,12 @@ import type { PlayerPokemon, TurnMove } from "#app/field/pokemon";
|
|||||||
import { FieldPosition } from "#app/field/pokemon";
|
import { FieldPosition } from "#app/field/pokemon";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { Command } from "#app/ui/command-ui-handler";
|
import { Command } from "#app/ui/command-ui-handler";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { FieldPhase } from "./field-phase";
|
import { FieldPhase } from "./field-phase";
|
||||||
import { SelectTargetPhase } from "./select-target-phase";
|
import { SelectTargetPhase } from "./select-target-phase";
|
||||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import { ArenaTagSide } from "#app/data/arena-tag";
|
import { ArenaTagSide } from "#app/data/arena-tag";
|
||||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
|
|
||||||
globalScene.updateGameInfo();
|
globalScene.updateGameInfo();
|
||||||
|
|
||||||
const commandUiHandler = globalScene.ui.handlers[Mode.COMMAND];
|
const commandUiHandler = globalScene.ui.handlers[UiMode.COMMAND];
|
||||||
|
|
||||||
// If one of these conditions is true, we always reset the cursor to Command.FIGHT
|
// If one of these conditions is true, we always reset the cursor to Command.FIGHT
|
||||||
const cursorResetEvent =
|
const cursorResetEvent =
|
||||||
@ -127,7 +127,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
) {
|
) {
|
||||||
this.handleCommand(Command.FIGHT, moveIndex, queuedMove.ignorePP, queuedMove);
|
this.handleCommand(Command.FIGHT, moveIndex, queuedMove.ignorePP, queuedMove);
|
||||||
} else {
|
} else {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -136,9 +136,9 @@ export class CommandPhase extends FieldPhase {
|
|||||||
globalScene.currentBattle.mysteryEncounter?.skipToFightInput
|
globalScene.currentBattle.mysteryEncounter?.skipToFightInput
|
||||||
) {
|
) {
|
||||||
globalScene.ui.clearText();
|
globalScene.ui.clearText();
|
||||||
globalScene.ui.setMode(Mode.FIGHT, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.FIGHT, this.fieldIndex);
|
||||||
} else {
|
} else {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
success = true;
|
success = true;
|
||||||
} else if (cursor < playerPokemon.getMoveset().length) {
|
} else if (cursor < playerPokemon.getMoveset().length) {
|
||||||
const move = playerPokemon.getMoveset()[cursor];
|
const move = playerPokemon.getMoveset()[cursor];
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
|
|
||||||
// Decides between a Disabled, Not Implemented, or No PP translation message
|
// Decides between a Disabled, Not Implemented, or No PP translation message
|
||||||
const errorMessage = playerPokemon.isMoveRestricted(move.moveId, playerPokemon)
|
const errorMessage = playerPokemon.isMoveRestricted(move.moveId, playerPokemon)
|
||||||
@ -226,7 +226,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.clearText();
|
globalScene.ui.clearText();
|
||||||
globalScene.ui.setMode(Mode.FIGHT, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.FIGHT, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
@ -244,27 +244,27 @@ export class CommandPhase extends FieldPhase {
|
|||||||
globalScene.arena.biomeType === Biome.END &&
|
globalScene.arena.biomeType === Biome.END &&
|
||||||
(!globalScene.gameMode.isClassic || globalScene.gameMode.isFreshStartChallenge() || notInDex)
|
(!globalScene.gameMode.isClassic || globalScene.gameMode.isFreshStartChallenge() || notInDex)
|
||||||
) {
|
) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:noPokeballForce"),
|
i18next.t("battle:noPokeballForce"),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
} else if (globalScene.currentBattle.battleType === BattleType.TRAINER) {
|
} else if (globalScene.currentBattle.battleType === BattleType.TRAINER) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:noPokeballTrainer"),
|
i18next.t("battle:noPokeballTrainer"),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
@ -273,14 +273,14 @@ export class CommandPhase extends FieldPhase {
|
|||||||
globalScene.currentBattle.isBattleMysteryEncounter() &&
|
globalScene.currentBattle.isBattleMysteryEncounter() &&
|
||||||
!globalScene.currentBattle.mysteryEncounter!.catchAllowed
|
!globalScene.currentBattle.mysteryEncounter!.catchAllowed
|
||||||
) {
|
) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:noPokeballMysteryEncounter"),
|
i18next.t("battle:noPokeballMysteryEncounter"),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
@ -291,14 +291,14 @@ export class CommandPhase extends FieldPhase {
|
|||||||
.filter(p => p.isActive(true))
|
.filter(p => p.isActive(true))
|
||||||
.map(p => p.getBattlerIndex());
|
.map(p => p.getBattlerIndex());
|
||||||
if (targets.length > 1) {
|
if (targets.length > 1) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:noPokeballMulti"),
|
i18next.t("battle:noPokeballMulti"),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
@ -311,14 +311,14 @@ export class CommandPhase extends FieldPhase {
|
|||||||
!targetPokemon?.hasAbility(Abilities.WONDER_GUARD, false, true) &&
|
!targetPokemon?.hasAbility(Abilities.WONDER_GUARD, false, true) &&
|
||||||
cursor < PokeballType.MASTER_BALL
|
cursor < PokeballType.MASTER_BALL
|
||||||
) {
|
) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:noPokeballStrong"),
|
i18next.t("battle:noPokeballStrong"),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
@ -347,14 +347,14 @@ export class CommandPhase extends FieldPhase {
|
|||||||
(arena.biomeType === Biome.END ||
|
(arena.biomeType === Biome.END ||
|
||||||
(!isNullOrUndefined(mysteryEncounterFleeAllowed) && !mysteryEncounterFleeAllowed))
|
(!isNullOrUndefined(mysteryEncounterFleeAllowed) && !mysteryEncounterFleeAllowed))
|
||||||
) {
|
) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:noEscapeForce"),
|
i18next.t("battle:noEscapeForce"),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
@ -364,14 +364,14 @@ export class CommandPhase extends FieldPhase {
|
|||||||
(currentBattle.battleType === BattleType.TRAINER ||
|
(currentBattle.battleType === BattleType.TRAINER ||
|
||||||
currentBattle.mysteryEncounter?.encounterMode === MysteryEncounterMode.TRAINER_BATTLE)
|
currentBattle.mysteryEncounter?.encounterMode === MysteryEncounterMode.TRAINER_BATTLE)
|
||||||
) {
|
) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:noEscapeTrainer"),
|
i18next.t("battle:noEscapeTrainer"),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
@ -389,7 +389,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
}
|
}
|
||||||
} else if (trappedAbMessages.length > 0) {
|
} else if (trappedAbMessages.length > 0) {
|
||||||
if (!isSwitch) {
|
if (!isSwitch) {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
}
|
}
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
trappedAbMessages[0],
|
trappedAbMessages[0],
|
||||||
@ -397,7 +397,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
if (!isSwitch) {
|
if (!isSwitch) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
@ -412,8 +412,8 @@ export class CommandPhase extends FieldPhase {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isSwitch) {
|
if (!isSwitch) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
}
|
}
|
||||||
const showNoEscapeText = (tag: any) => {
|
const showNoEscapeText = (tag: any) => {
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
@ -429,7 +429,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
() => {
|
() => {
|
||||||
globalScene.ui.showText("", 0);
|
globalScene.ui.showText("", 0);
|
||||||
if (!isSwitch) {
|
if (!isSwitch) {
|
||||||
globalScene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
@ -471,6 +471,6 @@ export class CommandPhase extends FieldPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
end() {
|
end() {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => super.end());
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => super.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import type { BattlerIndex } from "#app/battle";
|
import type { BattlerIndex } from "#app/battle";
|
||||||
import { BattleSpec } from "#enums/battle-spec";
|
import { BattleSpec } from "#enums/battle-spec";
|
||||||
import { type DamageResult, HitResult } from "#app/field/pokemon";
|
import { type DamageResult, HitResult } from "#app/field/pokemon";
|
||||||
import { fixedInt } from "#app/utils";
|
import { fixedInt } from "#app/utils/common";
|
||||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||||
|
|
||||||
export class DamageAnimPhase extends PokemonPhase {
|
export class DamageAnimPhase extends PokemonPhase {
|
||||||
|
@ -8,10 +8,10 @@ import { achvs } from "#app/system/achv";
|
|||||||
import EggCounterContainer from "#app/ui/egg-counter-container";
|
import EggCounterContainer from "#app/ui/egg-counter-container";
|
||||||
import type EggHatchSceneHandler from "#app/ui/egg-hatch-scene-handler";
|
import type EggHatchSceneHandler from "#app/ui/egg-hatch-scene-handler";
|
||||||
import PokemonInfoContainer from "#app/ui/pokemon-info-container";
|
import PokemonInfoContainer from "#app/ui/pokemon-info-container";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
||||||
import { fixedInt, getFrameMs, randInt } from "#app/utils";
|
import { fixedInt, getFrameMs, randInt } from "#app/utils/common";
|
||||||
import type { EggLapsePhase } from "./egg-lapse-phase";
|
import type { EggLapsePhase } from "./egg-lapse-phase";
|
||||||
import type { EggHatchData } from "#app/data/egg-hatch-data";
|
import type { EggHatchData } from "#app/data/egg-hatch-data";
|
||||||
import { doShinySparkleAnim } from "#app/field/anims";
|
import { doShinySparkleAnim } from "#app/field/anims";
|
||||||
@ -76,7 +76,7 @@ export class EggHatchPhase extends Phase {
|
|||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
globalScene.ui.setModeForceTransition(Mode.EGG_HATCH_SCENE).then(() => {
|
globalScene.ui.setModeForceTransition(UiMode.EGG_HATCH_SCENE).then(() => {
|
||||||
if (!this.egg) {
|
if (!this.egg) {
|
||||||
return this.end();
|
return this.end();
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import { Phase } from "#app/phase";
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { EggHatchPhase } from "./egg-hatch-phase";
|
import { EggHatchPhase } from "./egg-hatch-phase";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { achvs } from "#app/system/achv";
|
import { achvs } from "#app/system/achv";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import { EggSummaryPhase } from "./egg-summary-phase";
|
import { EggSummaryPhase } from "./egg-summary-phase";
|
||||||
@ -41,7 +41,7 @@ export class EggLapsePhase extends Phase {
|
|||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
globalScene.ui.setModeWithoutClear(
|
globalScene.ui.setModeWithoutClear(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
this.hatchEggsSkipped(eggsToHatch);
|
this.hatchEggsSkipped(eggsToHatch);
|
||||||
this.showSummary();
|
this.showSummary();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { Phase } from "#app/phase";
|
import { Phase } from "#app/phase";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type { EggHatchData } from "#app/data/egg-hatch-data";
|
import type { EggHatchData } from "#app/data/egg-hatch-data";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,7 +22,7 @@ export class EggSummaryPhase extends Phase {
|
|||||||
// updates next pokemon once the current update has been completed
|
// updates next pokemon once the current update has been completed
|
||||||
const updateNextPokemon = (i: number) => {
|
const updateNextPokemon = (i: number) => {
|
||||||
if (i >= this.eggHatchData.length) {
|
if (i >= this.eggHatchData.length) {
|
||||||
globalScene.ui.setModeForceTransition(Mode.EGG_HATCH_SUMMARY, this.eggHatchData).then(() => {
|
globalScene.ui.setModeForceTransition(UiMode.EGG_HATCH_SUMMARY, this.eggHatchData).then(() => {
|
||||||
globalScene.fadeOutBgm(undefined, false);
|
globalScene.fadeOutBgm(undefined, false);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -39,7 +39,7 @@ export class EggSummaryPhase extends Phase {
|
|||||||
|
|
||||||
end() {
|
end() {
|
||||||
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
|
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
|
||||||
globalScene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {
|
globalScene.ui.setModeForceTransition(UiMode.MESSAGE).then(() => {
|
||||||
super.end();
|
super.end();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,8 @@ import { SummonPhase } from "#app/phases/summon-phase";
|
|||||||
import { ToggleDoublePositionPhase } from "#app/phases/toggle-double-position-phase";
|
import { ToggleDoublePositionPhase } from "#app/phases/toggle-double-position-phase";
|
||||||
import { achvs } from "#app/system/achv";
|
import { achvs } from "#app/system/achv";
|
||||||
import { handleTutorial, Tutorial } from "#app/tutorial";
|
import { handleTutorial, Tutorial } from "#app/tutorial";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { randSeedInt, randSeedItem } from "#app/utils";
|
import { randSeedInt, randSeedItem } from "#app/utils/common";
|
||||||
import { BattleSpec } from "#enums/battle-spec";
|
import { BattleSpec } from "#enums/battle-spec";
|
||||||
import { Biome } from "#enums/biome";
|
import { Biome } from "#enums/biome";
|
||||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||||
@ -298,7 +298,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
globalScene.currentBattle.trainer!.genAI(globalScene.getEnemyParty());
|
globalScene.currentBattle.trainer!.genAI(globalScene.getEnemyParty());
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
if (!this.loaded) {
|
if (!this.loaded) {
|
||||||
this.trySetWeatherIfNewBiome(); // Set weather before session gets saved
|
this.trySetWeatherIfNewBiome(); // Set weather before session gets saved
|
||||||
// Game syncs to server on waves X1 and X6 (As of 1.2.0)
|
// Game syncs to server on waves X1 and X6 (As of 1.2.0)
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { Phase } from "#app/phase";
|
import { Phase } from "#app/phase";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
|
|
||||||
export class EndEvolutionPhase extends Phase {
|
export class EndEvolutionPhase extends Phase {
|
||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
globalScene.ui.setModeForceTransition(Mode.MESSAGE).then(() => this.end());
|
globalScene.ui.setModeForceTransition(UiMode.MESSAGE).then(() => this.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions";
|
import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { FusionSpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions";
|
import { FusionSpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions";
|
||||||
import type EvolutionSceneHandler from "#app/ui/evolution-scene-handler";
|
import type EvolutionSceneHandler from "#app/ui/evolution-scene-handler";
|
||||||
import { fixedInt, getFrameMs, randInt } from "#app/utils";
|
import { fixedInt, getFrameMs, randInt } from "#app/utils/common";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { cos, sin } from "#app/field/anims";
|
import { cos, sin } from "#app/field/anims";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
@ -53,7 +53,7 @@ export class EvolutionPhase extends Phase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setMode(): Promise<void> {
|
setMode(): Promise<void> {
|
||||||
return globalScene.ui.setModeForceTransition(Mode.EVOLUTION_SCENE);
|
return globalScene.ui.setModeForceTransition(UiMode.EVOLUTION_SCENE);
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
@ -280,7 +280,7 @@ export class EvolutionPhase extends Phase {
|
|||||||
this.end();
|
this.end();
|
||||||
};
|
};
|
||||||
globalScene.ui.setOverlayMode(
|
globalScene.ui.setOverlayMode(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.revertMode();
|
globalScene.ui.revertMode();
|
||||||
this.pokemon.pauseEvolutions = true;
|
this.pokemon.pauseEvolutions = true;
|
||||||
|
@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { ExpBoosterModifier } from "#app/modifier/modifier";
|
import { ExpBoosterModifier } from "#app/modifier/modifier";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { NumberHolder } from "#app/utils";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";
|
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";
|
||||||
import { LevelUpPhase } from "./level-up-phase";
|
import { LevelUpPhase } from "./level-up-phase";
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ import { SwitchPhase } from "./switch-phase";
|
|||||||
import { SwitchSummonPhase } from "./switch-summon-phase";
|
import { SwitchSummonPhase } from "./switch-summon-phase";
|
||||||
import { ToggleDoublePositionPhase } from "./toggle-double-position-phase";
|
import { ToggleDoublePositionPhase } from "./toggle-double-position-phase";
|
||||||
import { VictoryPhase } from "./victory-phase";
|
import { VictoryPhase } from "./victory-phase";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import { FRIENDSHIP_LOSS_FROM_FAINT } from "#app/data/balance/starters";
|
import { FRIENDSHIP_LOSS_FROM_FAINT } from "#app/data/balance/starters";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { fixedInt } from "#app/utils";
|
import { fixedInt } from "#app/utils/common";
|
||||||
import { achvs } from "../system/achv";
|
import { achvs } from "../system/achv";
|
||||||
import type { SpeciesFormChange } from "../data/pokemon-forms";
|
import type { SpeciesFormChange } from "../data/pokemon-forms";
|
||||||
import { getSpeciesFormChangeMessage } from "../data/pokemon-forms";
|
import { getSpeciesFormChangeMessage } from "../data/pokemon-forms";
|
||||||
import type { PlayerPokemon } from "../field/pokemon";
|
import type { PlayerPokemon } from "../field/pokemon";
|
||||||
import { Mode } from "../ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type PartyUiHandler from "../ui/party-ui-handler";
|
import type PartyUiHandler from "../ui/party-ui-handler";
|
||||||
import { getPokemonNameWithAffix } from "../messages";
|
import { getPokemonNameWithAffix } from "../messages";
|
||||||
import { EndEvolutionPhase } from "./end-evolution-phase";
|
import { EndEvolutionPhase } from "./end-evolution-phase";
|
||||||
@ -31,7 +31,7 @@ export class FormChangePhase extends EvolutionPhase {
|
|||||||
if (!this.modal) {
|
if (!this.modal) {
|
||||||
return super.setMode();
|
return super.setMode();
|
||||||
}
|
}
|
||||||
return globalScene.ui.setOverlayMode(Mode.EVOLUTION_SCENE);
|
return globalScene.ui.setOverlayMode(UiMode.EVOLUTION_SCENE);
|
||||||
}
|
}
|
||||||
|
|
||||||
doEvolution(): void {
|
doEvolution(): void {
|
||||||
@ -181,7 +181,7 @@ export class FormChangePhase extends EvolutionPhase {
|
|||||||
this.pokemon.findAndRemoveTags(t => t.tagType === BattlerTagType.AUTOTOMIZED);
|
this.pokemon.findAndRemoveTags(t => t.tagType === BattlerTagType.AUTOTOMIZED);
|
||||||
if (this.modal) {
|
if (this.modal) {
|
||||||
globalScene.ui.revertMode().then(() => {
|
globalScene.ui.revertMode().then(() => {
|
||||||
if (globalScene.ui.getMode() === Mode.PARTY) {
|
if (globalScene.ui.getMode() === UiMode.PARTY) {
|
||||||
const partyUiHandler = globalScene.ui.getHandler() as PartyUiHandler;
|
const partyUiHandler = globalScene.ui.getHandler() as PartyUiHandler;
|
||||||
partyUiHandler.clearPartySlots();
|
partyUiHandler.clearPartySlots();
|
||||||
partyUiHandler.populatePartySlots();
|
partyUiHandler.populatePartySlots();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ export class GameOverModifierRewardPhase extends ModifierRewardPhase {
|
|||||||
globalScene.addModifier(newModifier);
|
globalScene.addModifier(newModifier);
|
||||||
// Sound loaded into game as is
|
// Sound loaded into game as is
|
||||||
globalScene.playSound("level_up_fanfare");
|
globalScene.playSound("level_up_fanfare");
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.fadeIn(250).then(() => {
|
globalScene.ui.fadeIn(250).then(() => {
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:rewardGain", {
|
i18next.t("battle:rewardGain", {
|
||||||
|
@ -19,8 +19,8 @@ import { SummonPhase } from "#app/phases/summon-phase";
|
|||||||
import { UnlockPhase } from "#app/phases/unlock-phase";
|
import { UnlockPhase } from "#app/phases/unlock-phase";
|
||||||
import { achvs, ChallengeAchv } from "#app/system/achv";
|
import { achvs, ChallengeAchv } from "#app/system/achv";
|
||||||
import { Unlockables } from "#app/system/unlockables";
|
import { Unlockables } from "#app/system/unlockables";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { isLocal, isLocalServerConnected } from "#app/utils";
|
import { isLocal, isLocalServerConnected } from "#app/utils/common";
|
||||||
import { PlayerGender } from "#enums/player-gender";
|
import { PlayerGender } from "#enums/player-gender";
|
||||||
import { TrainerType } from "#enums/trainer-type";
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -78,7 +78,7 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
} else {
|
} else {
|
||||||
globalScene.ui.showText(i18next.t("battle:retryBattle"), null, () => {
|
globalScene.ui.showText(i18next.t("battle:retryBattle"), null, () => {
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.fadeOut(1250).then(() => {
|
globalScene.ui.fadeOut(1250).then(() => {
|
||||||
globalScene.reset();
|
globalScene.reset();
|
||||||
|
@ -8,7 +8,7 @@ import { getPokemonNameWithAffix } from "#app/messages";
|
|||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import EvolutionSceneHandler from "#app/ui/evolution-scene-handler";
|
import EvolutionSceneHandler from "#app/ui/evolution-scene-handler";
|
||||||
import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { PlayerPartyMemberPokemonPhase } from "#app/phases/player-party-member-pokemon-phase";
|
import { PlayerPartyMemberPokemonPhase } from "#app/phases/player-party-member-pokemon-phase";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
@ -25,7 +25,7 @@ export enum LearnMoveType {
|
|||||||
|
|
||||||
export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
||||||
private moveId: Moves;
|
private moveId: Moves;
|
||||||
private messageMode: Mode;
|
private messageMode: UiMode;
|
||||||
private learnMoveType: LearnMoveType;
|
private learnMoveType: LearnMoveType;
|
||||||
private cost: number;
|
private cost: number;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.messageMode =
|
this.messageMode =
|
||||||
globalScene.ui.getHandler() instanceof EvolutionSceneHandler ? Mode.EVOLUTION_SCENE : Mode.MESSAGE;
|
globalScene.ui.getHandler() instanceof EvolutionSceneHandler ? UiMode.EVOLUTION_SCENE : UiMode.MESSAGE;
|
||||||
globalScene.ui.setMode(this.messageMode);
|
globalScene.ui.setMode(this.messageMode);
|
||||||
// If the Pokemon has less than 4 moves, the new move is added to the largest empty moveset index
|
// If the Pokemon has less than 4 moves, the new move is added to the largest empty moveset index
|
||||||
// If it has 4 moves, the phase then checks if the player wants to replace the move itself.
|
// If it has 4 moves, the phase then checks if the player wants to replace the move itself.
|
||||||
@ -90,7 +90,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
await globalScene.ui.showTextPromise(preQText);
|
await globalScene.ui.showTextPromise(preQText);
|
||||||
await globalScene.ui.showTextPromise(shouldReplaceQ, undefined, false);
|
await globalScene.ui.showTextPromise(shouldReplaceQ, undefined, false);
|
||||||
await globalScene.ui.setModeWithoutClear(
|
await globalScene.ui.setModeWithoutClear(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => this.forgetMoveProcess(move, pokemon), // Yes
|
() => this.forgetMoveProcess(move, pokemon), // Yes
|
||||||
() => {
|
() => {
|
||||||
// No
|
// No
|
||||||
@ -115,7 +115,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
globalScene.ui.setMode(this.messageMode);
|
globalScene.ui.setMode(this.messageMode);
|
||||||
await globalScene.ui.showTextPromise(i18next.t("battle:learnMoveForgetQuestion"), undefined, true);
|
await globalScene.ui.showTextPromise(i18next.t("battle:learnMoveForgetQuestion"), undefined, true);
|
||||||
await globalScene.ui.setModeWithoutClear(
|
await globalScene.ui.setModeWithoutClear(
|
||||||
Mode.SUMMARY,
|
UiMode.SUMMARY,
|
||||||
pokemon,
|
pokemon,
|
||||||
SummaryUiMode.LEARN_MOVE,
|
SummaryUiMode.LEARN_MOVE,
|
||||||
move,
|
move,
|
||||||
@ -153,7 +153,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
globalScene.ui.setModeWithoutClear(
|
globalScene.ui.setModeWithoutClear(
|
||||||
Mode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(this.messageMode);
|
globalScene.ui.setMode(this.messageMode);
|
||||||
globalScene.ui
|
globalScene.ui
|
||||||
@ -228,7 +228,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
|
globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
|
||||||
this.end();
|
this.end();
|
||||||
},
|
},
|
||||||
this.messageMode === Mode.EVOLUTION_SCENE ? 1000 : undefined,
|
this.messageMode === UiMode.EVOLUTION_SCENE ? 1000 : undefined,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { FieldPhase } from "./field-phase";
|
import { FieldPhase } from "./field-phase";
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ export class LevelCapPhase extends FieldPhase {
|
|||||||
start(): void {
|
start(): void {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||||
// Sound loaded into game as is
|
// Sound loaded into game as is
|
||||||
globalScene.playSound("level_up_fanfare");
|
globalScene.playSound("level_up_fanfare");
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
|
@ -6,7 +6,7 @@ import { EvolutionPhase } from "#app/phases/evolution-phase";
|
|||||||
import { LearnMovePhase } from "#app/phases/learn-move-phase";
|
import { LearnMovePhase } from "#app/phases/learn-move-phase";
|
||||||
import { PlayerPartyMemberPokemonPhase } from "#app/phases/player-party-member-pokemon-phase";
|
import { PlayerPartyMemberPokemonPhase } from "#app/phases/player-party-member-pokemon-phase";
|
||||||
import { LevelAchv } from "#app/system/achv";
|
import { LevelAchv } from "#app/system/achv";
|
||||||
import { NumberHolder } from "#app/utils";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export class LevelUpPhase extends PlayerPartyMemberPokemonPhase {
|
export class LevelUpPhase extends PlayerPartyMemberPokemonPhase {
|
||||||
@ -71,7 +71,7 @@ export class LevelUpPhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
if (!this.pokemon.pauseEvolutions) {
|
if (!this.pokemon.pauseEvolutions) {
|
||||||
const evolution = this.pokemon.getEvolution();
|
const evolution = this.pokemon.getEvolution();
|
||||||
if (evolution) {
|
if (evolution) {
|
||||||
this.pokemon.breakIllusion()
|
this.pokemon.breakIllusion();
|
||||||
globalScene.unshiftPhase(new EvolutionPhase(this.pokemon, evolution, this.lastLevel));
|
globalScene.unshiftPhase(new EvolutionPhase(this.pokemon, evolution, this.lastLevel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { updateUserInfo } from "#app/account";
|
import { updateUserInfo } from "#app/account";
|
||||||
import { bypassLogin } from "#app/battle-scene";
|
import { bypassLogin } from "#app/global-vars/bypass-login";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { Phase } from "#app/phase";
|
import { Phase } from "#app/phase";
|
||||||
import { handleTutorial, Tutorial } from "#app/tutorial";
|
import { handleTutorial, Tutorial } from "#app/tutorial";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import i18next, { t } from "i18next";
|
import i18next, { t } from "i18next";
|
||||||
import { getCookie, sessionIdKey, executeIf, removeCookie } from "#app/utils";
|
import { sessionIdKey, executeIf } from "#app/utils/common";
|
||||||
|
import { getCookie, removeCookie } from "#app/utils/cookies";
|
||||||
import { SelectGenderPhase } from "./select-gender-phase";
|
import { SelectGenderPhase } from "./select-gender-phase";
|
||||||
import { UnavailablePhase } from "./unavailable-phase";
|
import { UnavailablePhase } from "./unavailable-phase";
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ export class LoginPhase extends Phase {
|
|||||||
|
|
||||||
const hasSession = !!getCookie(sessionIdKey);
|
const hasSession = !!getCookie(sessionIdKey);
|
||||||
|
|
||||||
globalScene.ui.setMode(Mode.LOADING, { buttonActions: [] });
|
globalScene.ui.setMode(UiMode.LOADING, { buttonActions: [] });
|
||||||
executeIf(bypassLogin || hasSession, updateUserInfo).then(response => {
|
executeIf(bypassLogin || hasSession, updateUserInfo).then(response => {
|
||||||
const success = response ? response[0] : false;
|
const success = response ? response[0] : false;
|
||||||
const statusCode = response ? response[1] : null;
|
const statusCode = response ? response[1] : null;
|
||||||
@ -46,7 +47,7 @@ export class LoginPhase extends Phase {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
globalScene.ui.setMode(Mode.LOGIN_FORM, {
|
globalScene.ui.setMode(UiMode.LOGIN_FORM, {
|
||||||
buttonActions: [
|
buttonActions: [
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.playSelect();
|
globalScene.ui.playSelect();
|
||||||
@ -54,7 +55,7 @@ export class LoginPhase extends Phase {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.playSound("menu_open");
|
globalScene.playSound("menu_open");
|
||||||
globalScene.ui.setMode(Mode.REGISTRATION_FORM, {
|
globalScene.ui.setMode(UiMode.REGISTRATION_FORM, {
|
||||||
buttonActions: [
|
buttonActions: [
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.playSelect();
|
globalScene.ui.playSelect();
|
||||||
@ -101,7 +102,7 @@ export class LoginPhase extends Phase {
|
|||||||
if (success || bypassLogin) {
|
if (success || bypassLogin) {
|
||||||
this.end();
|
this.end();
|
||||||
} else {
|
} else {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
globalScene.ui.showText(t("menu:failedToLoadSaveData"));
|
globalScene.ui.showText(t("menu:failedToLoadSaveData"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -109,7 +110,7 @@ export class LoginPhase extends Phase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
end(): void {
|
end(): void {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
|
|
||||||
if (!globalScene.gameData.gender) {
|
if (!globalScene.gameData.gender) {
|
||||||
globalScene.unshiftPhase(new SelectGenderPhase());
|
globalScene.unshiftPhase(new SelectGenderPhase());
|
||||||
|
@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
||||||
import { MoneyMultiplierModifier } from "#app/modifier/modifier";
|
import { MoneyMultiplierModifier } from "#app/modifier/modifier";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { NumberHolder } from "#app/utils";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { BattlePhase } from "./battle-phase";
|
import { BattlePhase } from "./battle-phase";
|
||||||
|
|
||||||
export class MoneyRewardPhase extends BattlePhase {
|
export class MoneyRewardPhase extends BattlePhase {
|
||||||
|
@ -5,7 +5,7 @@ import { applyMoveChargeAttrs, MoveEffectAttr, InstantChargeAttr } from "#app/da
|
|||||||
import type { PokemonMove } from "#app/field/pokemon";
|
import type { PokemonMove } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { MoveResult } from "#app/field/pokemon";
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
import { BooleanHolder } from "#app/utils";
|
import { BooleanHolder } from "#app/utils/common";
|
||||||
import { MovePhase } from "#app/phases/move-phase";
|
import { MovePhase } from "#app/phases/move-phase";
|
||||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
@ -61,8 +61,8 @@ import {
|
|||||||
PokemonMultiHitModifier,
|
PokemonMultiHitModifier,
|
||||||
} from "#app/modifier/modifier";
|
} from "#app/modifier/modifier";
|
||||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||||
import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#app/utils";
|
import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#app/utils/common";
|
||||||
import type { nil } from "#app/utils";
|
import type { nil } from "#app/utils/common";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import type { Moves } from "#enums/moves";
|
import type { Moves } from "#enums/moves";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
@ -43,7 +43,7 @@ import { CommonAnimPhase } from "#app/phases/common-anim-phase";
|
|||||||
import { MoveChargePhase } from "#app/phases/move-charge-phase";
|
import { MoveChargePhase } from "#app/phases/move-charge-phase";
|
||||||
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||||
import { MoveEndPhase } from "#app/phases/move-end-phase";
|
import { MoveEndPhase } from "#app/phases/move-end-phase";
|
||||||
import { NumberHolder } from "#app/utils";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
@ -25,8 +25,8 @@ import { transitionMysteryEncounterIntroVisuals } from "../data/mystery-encounte
|
|||||||
import { TrainerSlot } from "#enums/trainer-slot";
|
import { TrainerSlot } from "#enums/trainer-slot";
|
||||||
import { IvScannerModifier } from "../modifier/modifier";
|
import { IvScannerModifier } from "../modifier/modifier";
|
||||||
import { Phase } from "../phase";
|
import { Phase } from "../phase";
|
||||||
import { Mode } from "../ui/ui";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { isNullOrUndefined, randSeedItem } from "#app/utils";
|
import { isNullOrUndefined, randSeedItem } from "#app/utils/common";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will handle (in order):
|
* Will handle (in order):
|
||||||
@ -72,7 +72,7 @@ export class MysteryEncounterPhase extends Phase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initiates encounter dialogue window and option select
|
// Initiates encounter dialogue window and option select
|
||||||
globalScene.ui.setMode(Mode.MYSTERY_ENCOUNTER, this.optionSelectSettings);
|
globalScene.ui.setMode(UiMode.MYSTERY_ENCOUNTER, this.optionSelectSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,7 +130,7 @@ export class MysteryEncounterPhase extends Phase {
|
|||||||
const optionSelectDialogue = globalScene.currentBattle?.mysteryEncounter?.selectedOption?.dialogue;
|
const optionSelectDialogue = globalScene.currentBattle?.mysteryEncounter?.selectedOption?.dialogue;
|
||||||
if (optionSelectDialogue?.selected && optionSelectDialogue.selected.length > 0) {
|
if (optionSelectDialogue?.selected && optionSelectDialogue.selected.length > 0) {
|
||||||
// Handle intermediate dialogue (between player selection event and the onOptionSelect logic)
|
// Handle intermediate dialogue (between player selection event and the onOptionSelect logic)
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
const selectedDialogue = optionSelectDialogue.selected;
|
const selectedDialogue = optionSelectDialogue.selected;
|
||||||
let i = 0;
|
let i = 0;
|
||||||
const showNextDialogue = () => {
|
const showNextDialogue = () => {
|
||||||
@ -167,7 +167,7 @@ export class MysteryEncounterPhase extends Phase {
|
|||||||
* Ends phase
|
* Ends phase
|
||||||
*/
|
*/
|
||||||
end() {
|
end() {
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => super.end());
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => super.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,7 +629,7 @@ export class PostMysteryEncounterPhase extends Phase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
globalScene.ui.setMode(Mode.MESSAGE);
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||||
if (title) {
|
if (title) {
|
||||||
globalScene.ui.showDialogue(
|
globalScene.ui.showDialogue(
|
||||||
text ?? "",
|
text ?? "",
|
||||||
|
@ -8,7 +8,7 @@ import { getPokemonNameWithAffix } from "#app/messages";
|
|||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
import { SpeciesFormChangeStatusEffectTrigger } from "#app/data/pokemon-forms";
|
import { SpeciesFormChangeStatusEffectTrigger } from "#app/data/pokemon-forms";
|
||||||
import { applyPostSetStatusAbAttrs, PostSetStatusAbAttr } from "#app/data/abilities/ability";
|
import { applyPostSetStatusAbAttrs, PostSetStatusAbAttr } from "#app/data/abilities/ability";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
|
|
||||||
export class ObtainStatusEffectPhase extends PokemonPhase {
|
export class ObtainStatusEffectPhase extends PokemonPhase {
|
||||||
private statusEffect?: StatusEffect;
|
private statusEffect?: StatusEffect;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user