diff --git a/package.json b/package.json index 6f63459baed..574beb80466 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.10.5", + "version": "1.10.6", "type": "module", "scripts": { "start": "vite", diff --git a/public/images/arenas/beach_b_2.png b/public/images/arenas/beach_b_2.png index 50c9be97b0d..6c3e89c1b25 100644 Binary files a/public/images/arenas/beach_b_2.png and b/public/images/arenas/beach_b_2.png differ diff --git a/public/images/arenas/cave_b_2.png b/public/images/arenas/cave_b_2.png index f76560e1f03..99c850ecdf6 100644 Binary files a/public/images/arenas/cave_b_2.png and b/public/images/arenas/cave_b_2.png differ diff --git a/public/images/arenas/factory_b_3.png b/public/images/arenas/factory_b_3.png index f2bb93128cf..e7716f0e168 100644 Binary files a/public/images/arenas/factory_b_3.png and b/public/images/arenas/factory_b_3.png differ diff --git a/public/images/arenas/forest_b.png b/public/images/arenas/forest_b.png index dcd1981a5e9..9f2cfc20c09 100644 Binary files a/public/images/arenas/forest_b.png and b/public/images/arenas/forest_b.png differ diff --git a/public/images/arenas/ice_cave_b_2.png b/public/images/arenas/ice_cave_b_2.png index d7e6fb1784e..636f4e95946 100644 Binary files a/public/images/arenas/ice_cave_b_2.png and b/public/images/arenas/ice_cave_b_2.png differ diff --git a/public/images/arenas/island_bg.png b/public/images/arenas/island_bg.png index e05c3afa775..8a8d703af5d 100644 Binary files a/public/images/arenas/island_bg.png and b/public/images/arenas/island_bg.png differ diff --git a/public/images/arenas/jungle_bg.png b/public/images/arenas/jungle_bg.png index e03de2a3223..4a8fa41fbb3 100644 Binary files a/public/images/arenas/jungle_bg.png and b/public/images/arenas/jungle_bg.png differ diff --git a/public/images/arenas/laboratory_b_2.png b/public/images/arenas/laboratory_b_2.png index fcd945b8b86..b5d73b8a9ed 100644 Binary files a/public/images/arenas/laboratory_b_2.png and b/public/images/arenas/laboratory_b_2.png differ diff --git a/public/images/arenas/laboratory_bg.png b/public/images/arenas/laboratory_bg.png index 0e64877c0b6..decb26240b3 100644 Binary files a/public/images/arenas/laboratory_bg.png and b/public/images/arenas/laboratory_bg.png differ diff --git a/public/images/arenas/lake_b_1.png b/public/images/arenas/lake_b_1.png index 5426dd1e8d9..8786fb6c728 100644 Binary files a/public/images/arenas/lake_b_1.png and b/public/images/arenas/lake_b_1.png differ diff --git a/public/images/arenas/lake_b_2.png b/public/images/arenas/lake_b_2.png index b08ccd7b8e4..454c9e89d29 100644 Binary files a/public/images/arenas/lake_b_2.png and b/public/images/arenas/lake_b_2.png differ diff --git a/public/images/arenas/metropolis_bg.png b/public/images/arenas/metropolis_bg.png index 374744f245e..b790221b323 100644 Binary files a/public/images/arenas/metropolis_bg.png and b/public/images/arenas/metropolis_bg.png differ diff --git a/public/images/arenas/plains_b_2.png b/public/images/arenas/plains_b_2.png index a35dbec9917..4d8d679d12f 100644 Binary files a/public/images/arenas/plains_b_2.png and b/public/images/arenas/plains_b_2.png differ diff --git a/public/images/arenas/plains_bg.png b/public/images/arenas/plains_bg.png index f2cbec9197c..9c0cff9b7dc 100644 Binary files a/public/images/arenas/plains_bg.png and b/public/images/arenas/plains_bg.png differ diff --git a/public/images/arenas/snowy_forest_b_3.png b/public/images/arenas/snowy_forest_b_3.png index 14c8f4c64aa..d8c89496d14 100644 Binary files a/public/images/arenas/snowy_forest_b_3.png and b/public/images/arenas/snowy_forest_b_3.png differ diff --git a/public/images/arenas/snowy_forest_bg.png b/public/images/arenas/snowy_forest_bg.png index b0dcc3ddfc5..62ff03f5b1c 100644 Binary files a/public/images/arenas/snowy_forest_bg.png and b/public/images/arenas/snowy_forest_bg.png differ diff --git a/public/images/arenas/wasteland_b_1.png b/public/images/arenas/wasteland_b_1.png index d10a7f27699..7f62b29f9a8 100644 Binary files a/public/images/arenas/wasteland_b_1.png and b/public/images/arenas/wasteland_b_1.png differ diff --git a/public/images/arenas/wasteland_b_3.png b/public/images/arenas/wasteland_b_3.png index cdc5a2bdd50..73a5b283861 100644 Binary files a/public/images/arenas/wasteland_b_3.png and b/public/images/arenas/wasteland_b_3.png differ diff --git a/public/images/battle_anims/PRAS- Pulverizing Pancake BG2.png b/public/images/battle_anims/PRAS- Pulverizing Pancake BG2.png index 44b50a6d385..4c55dd5f1c8 100644 Binary files a/public/images/battle_anims/PRAS- Pulverizing Pancake BG2.png and b/public/images/battle_anims/PRAS- Pulverizing Pancake BG2.png differ diff --git a/public/images/battle_anims/PRAS- Pulverizing Pancake.png b/public/images/battle_anims/PRAS- Pulverizing Pancake.png index 519a52c63c6..b284493c6da 100644 Binary files a/public/images/battle_anims/PRAS- Pulverizing Pancake.png and b/public/images/battle_anims/PRAS- Pulverizing Pancake.png differ diff --git a/public/images/battle_anims/PRAS- Spectral thief BG.png b/public/images/battle_anims/PRAS- Spectral thief BG.png index 35fc434fdca..92c356c5ec5 100644 Binary files a/public/images/battle_anims/PRAS- Spectral thief BG.png and b/public/images/battle_anims/PRAS- Spectral thief BG.png differ diff --git a/public/images/egg/egg_crack.png b/public/images/egg/egg_crack.png index 9d553ebf378..f5b5ee7b7e1 100644 Binary files a/public/images/egg/egg_crack.png and b/public/images/egg/egg_crack.png differ diff --git a/public/images/items.png b/public/images/items.png index a4ca454a153..ecc8d42daea 100644 Binary files a/public/images/items.png and b/public/images/items.png differ diff --git a/public/images/items/common_egg.png b/public/images/items/common_egg.png index 5eccff2f690..c449611d532 100644 Binary files a/public/images/items/common_egg.png and b/public/images/items/common_egg.png differ diff --git a/public/images/items/great_ribbon.png b/public/images/items/great_ribbon.png index 4db20f29c1f..284ee6a3b3b 100644 Binary files a/public/images/items/great_ribbon.png and b/public/images/items/great_ribbon.png differ diff --git a/public/images/mystery-encounters/fun_and_games_wobbuffet.png b/public/images/mystery-encounters/fun_and_games_wobbuffet.png index 71997be5692..5d61512ea78 100644 Binary files a/public/images/mystery-encounters/fun_and_games_wobbuffet.png and b/public/images/mystery-encounters/fun_and_games_wobbuffet.png differ diff --git a/public/images/mystery-encounters/mysterious_chest_blue.png b/public/images/mystery-encounters/mysterious_chest_blue.png index f959db13aa7..6fa3a7c5475 100644 Binary files a/public/images/mystery-encounters/mysterious_chest_blue.png and b/public/images/mystery-encounters/mysterious_chest_blue.png differ diff --git a/public/images/ui/champion_ribbon_bronze.png b/public/images/ui/champion_ribbon_bronze.png index b69efbb8f88..4bd1cb8ea2d 100644 Binary files a/public/images/ui/champion_ribbon_bronze.png and b/public/images/ui/champion_ribbon_bronze.png differ diff --git a/public/images/ui/champion_ribbon_diamond.png b/public/images/ui/champion_ribbon_diamond.png index fd0e1f77480..207ade56c19 100644 Binary files a/public/images/ui/champion_ribbon_diamond.png and b/public/images/ui/champion_ribbon_diamond.png differ diff --git a/public/images/ui/champion_ribbon_silver.png b/public/images/ui/champion_ribbon_silver.png index 92b6f4cf8c7..52cde028406 100644 Binary files a/public/images/ui/champion_ribbon_silver.png and b/public/images/ui/champion_ribbon_silver.png differ diff --git a/public/images/ui/legacy/champion_ribbon_bronze.png b/public/images/ui/legacy/champion_ribbon_bronze.png index b69efbb8f88..4bd1cb8ea2d 100644 Binary files a/public/images/ui/legacy/champion_ribbon_bronze.png and b/public/images/ui/legacy/champion_ribbon_bronze.png differ diff --git a/public/images/ui/legacy/champion_ribbon_diamond.png b/public/images/ui/legacy/champion_ribbon_diamond.png index fd0e1f77480..207ade56c19 100644 Binary files a/public/images/ui/legacy/champion_ribbon_diamond.png and b/public/images/ui/legacy/champion_ribbon_diamond.png differ diff --git a/public/images/ui/legacy/champion_ribbon_silver.png b/public/images/ui/legacy/champion_ribbon_silver.png index 92b6f4cf8c7..52cde028406 100644 Binary files a/public/images/ui/legacy/champion_ribbon_silver.png and b/public/images/ui/legacy/champion_ribbon_silver.png differ diff --git a/public/locales b/public/locales index 102cbdcd924..2686cd3edc0 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit 102cbdcd924e2a7cdc7eab64d1ce79f6ec7604ff +Subproject commit 2686cd3edc0bd2c7a7f12cc54c00c109e51a48d7 diff --git a/src/battle-scene.ts b/src/battle-scene.ts index be02962867c..9ac6e385220 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2318,7 +2318,7 @@ export class BattleScene extends SceneBase { }); } - playSound(sound: string | AnySound, config?: object): AnySound { + playSound(sound: string | AnySound, config?: object): AnySound | null { const key = typeof sound === "string" ? sound : sound.key; config = config ?? {}; try { @@ -2354,16 +2354,19 @@ export class BattleScene extends SceneBase { this.sound.play(key, config); return this.sound.get(key) as AnySound; } catch { - console.log(`${key} not found`); - return sound as AnySound; + console.warn(`${key} not found`); + return null; } } - playSoundWithoutBgm(soundName: string, pauseDuration?: number): AnySound { + playSoundWithoutBgm(soundName: string, pauseDuration?: number): AnySound | null { this.bgmCache.add(soundName); const resumeBgm = this.pauseBgm(); this.playSound(soundName); - const sound = this.sound.get(soundName) as AnySound; + const sound = this.sound.get(soundName); + if (!sound) { + return sound; + } if (this.bgmResumeTimer) { this.bgmResumeTimer.destroy(); } @@ -2373,7 +2376,7 @@ export class BattleScene extends SceneBase { this.bgmResumeTimer = null; }); } - return sound; + return sound as AnySound; } /** The loop point of any given battle, mystery encounter, or title track, read as seconds and milliseconds. */ diff --git a/src/data/balance/tms.ts b/src/data/balance/tms.ts index bd7cf401ad1..f7c330e3d95 100644 --- a/src/data/balance/tms.ts +++ b/src/data/balance/tms.ts @@ -68875,27 +68875,27 @@ interface TmPoolTiers { export const tmPoolTiers: TmPoolTiers = { [MoveId.MEGA_PUNCH]: ModifierTier.GREAT, - [MoveId.PAY_DAY]: ModifierTier.ULTRA, + [MoveId.PAY_DAY]: ModifierTier.COMMON, [MoveId.FIRE_PUNCH]: ModifierTier.GREAT, [MoveId.ICE_PUNCH]: ModifierTier.GREAT, [MoveId.THUNDER_PUNCH]: ModifierTier.GREAT, - [MoveId.SWORDS_DANCE]: ModifierTier.COMMON, + [MoveId.SWORDS_DANCE]: ModifierTier.GREAT, [MoveId.CUT]: ModifierTier.COMMON, - [MoveId.FLY]: ModifierTier.COMMON, + [MoveId.FLY]: ModifierTier.GREAT, [MoveId.MEGA_KICK]: ModifierTier.GREAT, [MoveId.BODY_SLAM]: ModifierTier.GREAT, [MoveId.TAKE_DOWN]: ModifierTier.GREAT, [MoveId.DOUBLE_EDGE]: ModifierTier.ULTRA, - [MoveId.PIN_MISSILE]: ModifierTier.COMMON, + [MoveId.PIN_MISSILE]: ModifierTier.GREAT, [MoveId.ROAR]: ModifierTier.COMMON, [MoveId.FLAMETHROWER]: ModifierTier.ULTRA, [MoveId.HYDRO_PUMP]: ModifierTier.ULTRA, [MoveId.SURF]: ModifierTier.ULTRA, [MoveId.ICE_BEAM]: ModifierTier.ULTRA, [MoveId.BLIZZARD]: ModifierTier.ULTRA, - [MoveId.PSYBEAM]: ModifierTier.GREAT, + [MoveId.PSYBEAM]: ModifierTier.COMMON, [MoveId.HYPER_BEAM]: ModifierTier.ULTRA, - [MoveId.LOW_KICK]: ModifierTier.COMMON, + [MoveId.LOW_KICK]: ModifierTier.GREAT, [MoveId.COUNTER]: ModifierTier.COMMON, [MoveId.STRENGTH]: ModifierTier.GREAT, [MoveId.SOLAR_BEAM]: ModifierTier.ULTRA, @@ -68907,9 +68907,9 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.DIG]: ModifierTier.GREAT, [MoveId.TOXIC]: ModifierTier.GREAT, [MoveId.PSYCHIC]: ModifierTier.ULTRA, - [MoveId.AGILITY]: ModifierTier.COMMON, + [MoveId.AGILITY]: ModifierTier.GREAT, [MoveId.NIGHT_SHADE]: ModifierTier.COMMON, - [MoveId.SCREECH]: ModifierTier.COMMON, + [MoveId.SCREECH]: ModifierTier.GREAT, [MoveId.DOUBLE_TEAM]: ModifierTier.COMMON, [MoveId.CONFUSE_RAY]: ModifierTier.COMMON, [MoveId.LIGHT_SCREEN]: ModifierTier.COMMON, @@ -68921,7 +68921,7 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.FIRE_BLAST]: ModifierTier.ULTRA, [MoveId.WATERFALL]: ModifierTier.GREAT, [MoveId.SWIFT]: ModifierTier.COMMON, - [MoveId.AMNESIA]: ModifierTier.COMMON, + [MoveId.AMNESIA]: ModifierTier.GREAT, [MoveId.DREAM_EATER]: ModifierTier.GREAT, [MoveId.LEECH_LIFE]: ModifierTier.ULTRA, [MoveId.FLASH]: ModifierTier.COMMON, @@ -68933,11 +68933,11 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.SUBSTITUTE]: ModifierTier.COMMON, [MoveId.THIEF]: ModifierTier.GREAT, [MoveId.SNORE]: ModifierTier.COMMON, - [MoveId.CURSE]: ModifierTier.COMMON, + [MoveId.CURSE]: ModifierTier.GREAT, [MoveId.REVERSAL]: ModifierTier.COMMON, [MoveId.SPITE]: ModifierTier.COMMON, [MoveId.PROTECT]: ModifierTier.COMMON, - [MoveId.SCARY_FACE]: ModifierTier.COMMON, + [MoveId.SCARY_FACE]: ModifierTier.GREAT, [MoveId.SLUDGE_BOMB]: ModifierTier.GREAT, [MoveId.MUD_SLAP]: ModifierTier.COMMON, [MoveId.SPIKES]: ModifierTier.COMMON, @@ -68979,8 +68979,8 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.TORMENT]: ModifierTier.COMMON, [MoveId.WILL_O_WISP]: ModifierTier.COMMON, [MoveId.FACADE]: ModifierTier.GREAT, - [MoveId.FOCUS_PUNCH]: ModifierTier.COMMON, - [MoveId.NATURE_POWER]: ModifierTier.COMMON, + [MoveId.FOCUS_PUNCH]: ModifierTier.GREAT, + [MoveId.NATURE_POWER]: ModifierTier.GREAT, [MoveId.CHARGE]: ModifierTier.COMMON, [MoveId.TAUNT]: ModifierTier.COMMON, [MoveId.HELPING_HAND]: ModifierTier.COMMON, @@ -68993,7 +68993,7 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.ENDEAVOR]: ModifierTier.COMMON, [MoveId.SKILL_SWAP]: ModifierTier.COMMON, [MoveId.IMPRISON]: ModifierTier.COMMON, - [MoveId.SECRET_POWER]: ModifierTier.COMMON, + [MoveId.SECRET_POWER]: ModifierTier.GREAT, [MoveId.DIVE]: ModifierTier.GREAT, [MoveId.FEATHER_DANCE]: ModifierTier.COMMON, [MoveId.BLAZE_KICK]: ModifierTier.GREAT, @@ -69001,12 +69001,12 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.BLAST_BURN]: ModifierTier.ULTRA, [MoveId.HYDRO_CANNON]: ModifierTier.ULTRA, [MoveId.WEATHER_BALL]: ModifierTier.COMMON, - [MoveId.FAKE_TEARS]: ModifierTier.COMMON, + [MoveId.FAKE_TEARS]: ModifierTier.GREAT, [MoveId.AIR_CUTTER]: ModifierTier.GREAT, [MoveId.OVERHEAT]: ModifierTier.ULTRA, [MoveId.ROCK_TOMB]: ModifierTier.GREAT, - [MoveId.METAL_SOUND]: ModifierTier.COMMON, - [MoveId.COSMIC_POWER]: ModifierTier.COMMON, + [MoveId.METAL_SOUND]: ModifierTier.GREAT, + [MoveId.COSMIC_POWER]: ModifierTier.GREAT, [MoveId.SIGNAL_BEAM]: ModifierTier.GREAT, [MoveId.SAND_TOMB]: ModifierTier.COMMON, [MoveId.MUDDY_WATER]: ModifierTier.GREAT, @@ -69016,10 +69016,10 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.IRON_DEFENSE]: ModifierTier.GREAT, [MoveId.DRAGON_CLAW]: ModifierTier.ULTRA, [MoveId.FRENZY_PLANT]: ModifierTier.ULTRA, - [MoveId.BULK_UP]: ModifierTier.COMMON, + [MoveId.BULK_UP]: ModifierTier.GREAT, [MoveId.BOUNCE]: ModifierTier.GREAT, [MoveId.MUD_SHOT]: ModifierTier.GREAT, - [MoveId.POISON_TAIL]: ModifierTier.GREAT, + [MoveId.POISON_TAIL]: ModifierTier.COMMON, [MoveId.COVET]: ModifierTier.GREAT, [MoveId.MAGICAL_LEAF]: ModifierTier.GREAT, [MoveId.CALM_MIND]: ModifierTier.GREAT, @@ -69047,7 +69047,7 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.TOXIC_SPIKES]: ModifierTier.GREAT, [MoveId.FLARE_BLITZ]: ModifierTier.ULTRA, [MoveId.AURA_SPHERE]: ModifierTier.GREAT, - [MoveId.ROCK_POLISH]: ModifierTier.COMMON, + [MoveId.ROCK_POLISH]: ModifierTier.GREAT, [MoveId.POISON_JAB]: ModifierTier.GREAT, [MoveId.DARK_PULSE]: ModifierTier.GREAT, [MoveId.AQUA_TAIL]: ModifierTier.GREAT, @@ -69063,8 +69063,8 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.ENERGY_BALL]: ModifierTier.GREAT, [MoveId.BRAVE_BIRD]: ModifierTier.ULTRA, [MoveId.EARTH_POWER]: ModifierTier.ULTRA, - [MoveId.GIGA_IMPACT]: ModifierTier.GREAT, - [MoveId.NASTY_PLOT]: ModifierTier.COMMON, + [MoveId.GIGA_IMPACT]: ModifierTier.ULTRA, + [MoveId.NASTY_PLOT]: ModifierTier.GREAT, [MoveId.AVALANCHE]: ModifierTier.GREAT, [MoveId.SHADOW_CLAW]: ModifierTier.GREAT, [MoveId.THUNDER_FANG]: ModifierTier.GREAT, @@ -69084,7 +69084,7 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.IRON_HEAD]: ModifierTier.GREAT, [MoveId.STONE_EDGE]: ModifierTier.ULTRA, [MoveId.STEALTH_ROCK]: ModifierTier.COMMON, - [MoveId.GRASS_KNOT]: ModifierTier.ULTRA, + [MoveId.GRASS_KNOT]: ModifierTier.GREAT, [MoveId.BUG_BITE]: ModifierTier.GREAT, [MoveId.CHARGE_BEAM]: ModifierTier.GREAT, [MoveId.HONE_CLAWS]: ModifierTier.COMMON, @@ -69102,7 +69102,7 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.FOUL_PLAY]: ModifierTier.ULTRA, [MoveId.ROUND]: ModifierTier.COMMON, [MoveId.ECHOED_VOICE]: ModifierTier.COMMON, - [MoveId.STORED_POWER]: ModifierTier.COMMON, + [MoveId.STORED_POWER]: ModifierTier.GREAT, [MoveId.ALLY_SWITCH]: ModifierTier.COMMON, [MoveId.SCALD]: ModifierTier.GREAT, [MoveId.HEX]: ModifierTier.GREAT, @@ -69130,7 +69130,7 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.SNARL]: ModifierTier.COMMON, [MoveId.PHANTOM_FORCE]: ModifierTier.ULTRA, [MoveId.PETAL_BLIZZARD]: ModifierTier.GREAT, - [MoveId.DISARMING_VOICE]: ModifierTier.GREAT, + [MoveId.DISARMING_VOICE]: ModifierTier.COMMON, [MoveId.DRAINING_KISS]: ModifierTier.GREAT, [MoveId.GRASSY_TERRAIN]: ModifierTier.COMMON, [MoveId.MISTY_TERRAIN]: ModifierTier.COMMON, @@ -69161,12 +69161,12 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.BREAKING_SWIPE]: ModifierTier.GREAT, [MoveId.STEEL_BEAM]: ModifierTier.ULTRA, [MoveId.EXPANDING_FORCE]: ModifierTier.GREAT, - [MoveId.STEEL_ROLLER]: ModifierTier.COMMON, + [MoveId.STEEL_ROLLER]: ModifierTier.GREAT, [MoveId.SCALE_SHOT]: ModifierTier.ULTRA, [MoveId.METEOR_BEAM]: ModifierTier.GREAT, - [MoveId.MISTY_EXPLOSION]: ModifierTier.COMMON, + [MoveId.MISTY_EXPLOSION]: ModifierTier.GREAT, [MoveId.GRASSY_GLIDE]: ModifierTier.COMMON, - [MoveId.RISING_VOLTAGE]: ModifierTier.COMMON, + [MoveId.RISING_VOLTAGE]: ModifierTier.GREAT, [MoveId.TERRAIN_PULSE]: ModifierTier.COMMON, [MoveId.SKITTER_SMACK]: ModifierTier.GREAT, [MoveId.BURNING_JEALOUSY]: ModifierTier.GREAT, @@ -69175,20 +69175,20 @@ export const tmPoolTiers: TmPoolTiers = { [MoveId.CORROSIVE_GAS]: ModifierTier.COMMON, [MoveId.COACHING]: ModifierTier.COMMON, [MoveId.FLIP_TURN]: ModifierTier.COMMON, - [MoveId.TRIPLE_AXEL]: ModifierTier.COMMON, - [MoveId.DUAL_WINGBEAT]: ModifierTier.COMMON, + [MoveId.TRIPLE_AXEL]: ModifierTier.ULTRA, + [MoveId.DUAL_WINGBEAT]: ModifierTier.GREAT, [MoveId.SCORCHING_SANDS]: ModifierTier.GREAT, [MoveId.TERA_BLAST]: ModifierTier.GREAT, [MoveId.ICE_SPINNER]: ModifierTier.GREAT, [MoveId.SNOWSCAPE]: ModifierTier.COMMON, [MoveId.POUNCE]: ModifierTier.COMMON, - [MoveId.TRAILBLAZE]: ModifierTier.COMMON, + [MoveId.TRAILBLAZE]: ModifierTier.GREAT, [MoveId.CHILLING_WATER]: ModifierTier.COMMON, [MoveId.HARD_PRESS]: ModifierTier.GREAT, [MoveId.DRAGON_CHEER]: ModifierTier.COMMON, [MoveId.ALLURING_VOICE]: ModifierTier.GREAT, [MoveId.TEMPER_FLARE]: ModifierTier.GREAT, - [MoveId.SUPERCELL_SLAM]: ModifierTier.GREAT, + [MoveId.SUPERCELL_SLAM]: ModifierTier.ULTRA, [MoveId.PSYCHIC_NOISE]: ModifierTier.GREAT, [MoveId.UPPER_HAND]: ModifierTier.COMMON, }; diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index aa4951f3263..5ff4472d148 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -291,9 +291,17 @@ class AnimTimedSoundEvent extends AnimTimedEvent { } catch (err) { console.error(err); } - return Math.ceil((globalScene.sound.get(`battle_anims/${this.resourceName}`).totalDuration * 1000) / 33.33); + const sound = globalScene.sound.get(`battle_anims/${this.resourceName}`); + if (!sound) { + return 0; + } + return Math.ceil((sound.totalDuration * 1000) / 33.33); } - return Math.ceil((battleAnim.user!.cry(soundConfig).totalDuration * 1000) / 33.33); // TODO: is the bang behind user correct? + const cry = battleAnim.user!.cry(soundConfig); // TODO: is the bang behind user correct? + if (!cry) { + return 0; + } + return Math.ceil((cry.totalDuration * 1000) / 33.33); } getEventType(): string { diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 01e6fa78ffc..cea8661e78c 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -27,7 +27,7 @@ import type { DexEntry } from "#types/dex-data"; import { type BooleanHolder, isBetween, type NumberHolder, randSeedItem } from "#utils/common"; import { deepCopy } from "#utils/data"; import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils"; -import { toCamelCase, toSnakeCase } from "#utils/strings"; +import { toCamelCase } from "#utils/strings"; import i18next from "i18next"; /** A constant for the default max cost of the starting party before a run */ @@ -764,7 +764,7 @@ export class SingleTypeChallenge extends Challenge { } getValue(overrideValue: number = this.value): string { - return toSnakeCase(PokemonType[overrideValue - 1]); + return i18next.t(`pokemonInfo:type.${toCamelCase(PokemonType[overrideValue - 1])}`); } getDescription(overrideValue: number = this.value): string { diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 4a744d6e9c3..5a22b352e73 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -6856,12 +6856,15 @@ export class CopyBiomeTypeAttr extends MoveEffectAttr { } } +/** + * Attribute to override the target's current types to the given type. + * Used by {@linkcode MoveId.SOAK} and {@linkcode MoveId.MAGIC_POWDER}. + */ export class ChangeTypeAttr extends MoveEffectAttr { private type: PokemonType; constructor(type: PokemonType) { super(false); - this.type = type; } @@ -6869,7 +6872,7 @@ export class ChangeTypeAttr extends MoveEffectAttr { target.summonData.types = [ this.type ]; target.updateInfo(); - globalScene.phaseManager.queueMessage(i18next.t("moveTriggers:transformedIntoType", { pokemonName: getPokemonNameWithAffix(target), typeName: i18next.t(`pokemonInfo:Type.${PokemonType[this.type]}`) })); + globalScene.phaseManager.queueMessage(i18next.t("moveTriggers:transformedIntoType", { pokemonName: getPokemonNameWithAffix(target), typeName: i18next.t(`pokemonInfo:type.${toCamelCase(PokemonType[this.type])}`) })); return true; } diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index fd8551f2289..d5049569e61 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -593,14 +593,14 @@ export abstract class PokemonSpeciesForm { }); } - cry(soundConfig?: Phaser.Types.Sound.SoundConfig, ignorePlay?: boolean): AnySound { + cry(soundConfig?: Phaser.Types.Sound.SoundConfig, ignorePlay?: boolean): AnySound | null { const cryKey = this.getCryKey(this.formIndex); let cry: AnySound | null = globalScene.sound.get(cryKey) as AnySound; if (cry?.pendingRemove) { cry = null; } cry = globalScene.playSound(cry ?? cryKey, soundConfig); - if (ignorePlay) { + if (cry && ignorePlay) { cry.stop(); } return cry; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index dab96e4090a..aac2ed55a72 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4547,28 +4547,36 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { }); } - cry(soundConfig?: Phaser.Types.Sound.SoundConfig, sceneOverride?: BattleScene): AnySound { + cry(soundConfig?: Phaser.Types.Sound.SoundConfig, sceneOverride?: BattleScene): AnySound | null { const scene = sceneOverride ?? globalScene; // TODO: is `sceneOverride` needed? const cry = this.getSpeciesForm(undefined, true).cry(soundConfig); + if (!cry) { + return cry; + } let duration = cry.totalDuration * 1000; if (this.fusionSpecies && this.getSpeciesForm(undefined, true) !== this.getFusionSpeciesForm(undefined, true)) { - let fusionCry = this.getFusionSpeciesForm(undefined, true).cry(soundConfig, true); + const fusionCry = this.getFusionSpeciesForm(undefined, true).cry(soundConfig, true); + if (!fusionCry) { + return cry; + } duration = Math.min(duration, fusionCry.totalDuration * 1000); fusionCry.destroy(); scene.time.delayedCall(fixedInt(Math.ceil(duration * 0.4)), () => { try { SoundFade.fadeOut(scene, cry, fixedInt(Math.ceil(duration * 0.2))); - fusionCry = this.getFusionSpeciesForm(undefined, true).cry({ + const fusionCryInner = this.getFusionSpeciesForm(undefined, true).cry({ seek: Math.max(fusionCry.totalDuration * 0.4, 0), ...soundConfig, }); - SoundFade.fadeIn( - scene, - fusionCry, - fixedInt(Math.ceil(duration * 0.2)), - scene.masterVolume * scene.fieldVolume, - 0, - ); + if (fusionCryInner) { + SoundFade.fadeIn( + scene, + fusionCryInner, + fixedInt(Math.ceil(duration * 0.2)), + scene.masterVolume * scene.fieldVolume, + 0, + ); + } } catch (err) { console.error(err); } @@ -4596,14 +4604,14 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { crySoundConfig.rate = 0.7; } } - const cry = globalScene.playSound(key, crySoundConfig) as AnySound; + const cry = globalScene.playSound(key, crySoundConfig); if (!cry || globalScene.fieldVolume === 0) { callback(); return; } const sprite = this.getSprite(); const tintSprite = this.getTintSprite(); - const delay = Math.max(globalScene.sound.get(key).totalDuration * 50, 25); + const delay = Math.max(cry.totalDuration * 50, 25); let frameProgress = 0; let frameThreshold: number; @@ -4656,20 +4664,20 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { const key = this.species.getCryKey(this.formIndex); let i = 0; let rate = 0.85; - const cry = globalScene.playSound(key, { rate: rate }) as AnySound; + const cry = globalScene.playSound(key, { rate: rate }); const sprite = this.getSprite(); const tintSprite = this.getTintSprite(); - let duration = cry.totalDuration * 1000; const fusionCryKey = this.fusionSpecies!.getCryKey(this.fusionFormIndex); let fusionCry = globalScene.playSound(fusionCryKey, { rate: rate, - }) as AnySound; + }); if (!cry || !fusionCry || globalScene.fieldVolume === 0) { callback(); return; } fusionCry.stop(); + let duration = cry.totalDuration * 1000; duration = Math.min(duration, fusionCry.totalDuration * 1000); fusionCry.destroy(); const delay = Math.max(duration * 0.05, 25); @@ -4712,16 +4720,20 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { if (i === transitionIndex && fusionCryKey) { SoundFade.fadeOut(globalScene, cry, fixedInt(Math.ceil((duration / rate) * 0.2))); fusionCry = globalScene.playSound(fusionCryKey, { - seek: Math.max(fusionCry.totalDuration * 0.4, 0), + // TODO: This bang is correct as this callback can only be called once, but + // this whole block with conditionally reassigning fusionCry needs a second lock. + seek: Math.max(fusionCry!.totalDuration * 0.4, 0), rate: rate, }); - SoundFade.fadeIn( - globalScene, - fusionCry, - fixedInt(Math.ceil((duration / rate) * 0.2)), - globalScene.masterVolume * globalScene.fieldVolume, - 0, - ); + if (fusionCry) { + SoundFade.fadeIn( + globalScene, + fusionCry, + fixedInt(Math.ceil((duration / rate) * 0.2)), + globalScene.masterVolume * globalScene.fieldVolume, + 0, + ); + } } rate *= 0.99; if (cry && !cry.pendingRemove) { @@ -6916,7 +6928,7 @@ export class EnemyPokemon extends Pokemon { const leftoverStats = EFFECTIVE_STATS.filter((s: EffectiveStat) => this.getStatStage(s) < 6); const statWeights = leftoverStats.map((s: EffectiveStat) => this.getStat(s, false)); - let boostedStat: EffectiveStat; + let boostedStat: EffectiveStat | undefined; const statThresholds: number[] = []; let totalWeight = 0; @@ -6934,6 +6946,11 @@ export class EnemyPokemon extends Pokemon { } } + if (boostedStat === undefined) { + this.bossSegmentIndex--; + return; + } + let stages = 1; // increase the boost if the boss has at least 3 segments and we passed last shield @@ -6949,7 +6966,7 @@ export class EnemyPokemon extends Pokemon { "StatStageChangePhase", this.getBattlerIndex(), true, - [boostedStat!], + [boostedStat], stages, true, true, diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index 6ca0679af4d..37e07c6c282 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -456,7 +456,7 @@ export class CommandPhase extends FieldPhase { const numBallTypes = 5; if (cursor < numBallTypes) { - const targetPokemon = globalScene.getEnemyPokemon(); + const targetPokemon = globalScene.getEnemyPokemon(false); if ( targetPokemon?.isBoss() && targetPokemon?.bossSegmentIndex >= 1 && diff --git a/src/phases/egg-hatch-phase.ts b/src/phases/egg-hatch-phase.ts index e9d28e0fe2a..547ca778c6b 100644 --- a/src/phases/egg-hatch-phase.ts +++ b/src/phases/egg-hatch-phase.ts @@ -64,7 +64,7 @@ export class EggHatchPhase extends Phase { private canSkip: boolean; private skipped: boolean; /** The sound effect being played when the egg is hatched */ - private evolutionBgm: AnySound; + private evolutionBgm: AnySound | null; private eggLapsePhase: EggLapsePhase; constructor(hatchScene: EggLapsePhase, egg: Egg, eggsToHatchCount: number) { diff --git a/src/phases/evolution-phase.ts b/src/phases/evolution-phase.ts index ad3db97d520..6095dfafa21 100644 --- a/src/phases/evolution-phase.ts +++ b/src/phases/evolution-phase.ts @@ -28,9 +28,10 @@ export class EvolutionPhase extends Phase { private evolution: SpeciesFormEvolution | null; private fusionSpeciesEvolved: boolean; // Whether the evolution is of the fused species - private evolutionBgm: AnySound; + private evolutionBgm: AnySound | null; private evolutionHandler: EvolutionSceneHandler; + /** Container for all assets used by the scene. When the scene is cleared, the children within this are destroyed. */ protected evolutionContainer: Phaser.GameObjects.Container; protected evolutionBaseBg: Phaser.GameObjects.Image; protected evolutionBg: Phaser.GameObjects.Video; @@ -297,7 +298,9 @@ export class EvolutionPhase extends Phase { this.evolutionBg.setVisible(false); }, }); - SoundFade.fadeOut(globalScene, this.evolutionBgm, 100); + if (this.evolutionBgm) { + SoundFade.fadeOut(globalScene, this.evolutionBgm, 100); + } } /** @@ -377,7 +380,9 @@ export class EvolutionPhase extends Phase { * Fadeout evolution music, play the cry, show the evolution completed text, and end the phase */ private onEvolutionComplete(evolvedPokemon: Pokemon) { - SoundFade.fadeOut(globalScene, this.evolutionBgm, 100); + if (this.evolutionBgm) { + SoundFade.fadeOut(globalScene, this.evolutionBgm, 100); + } globalScene.time.delayedCall(250, () => { this.pokemon.cry(); globalScene.time.delayedCall(1250, () => { @@ -522,6 +527,7 @@ export class EvolutionPhase extends Phase { return; } if (i === lastCycle) { + this.pokemonTintSprite.setVisible(false).setActive(false); this.pokemonEvoTintSprite.setScale(1); } }, diff --git a/src/phases/party-heal-phase.ts b/src/phases/party-heal-phase.ts index 1030d5eb9d9..154e95bc970 100644 --- a/src/phases/party-heal-phase.ts +++ b/src/phases/party-heal-phase.ts @@ -38,13 +38,15 @@ export class PartyHealPhase extends BattlePhase { pokemon.updateInfo(true); } const healSong = globalScene.playSoundWithoutBgm("heal"); - globalScene.time.delayedCall(fixedInt(healSong.totalDuration * 1000), () => { - healSong.destroy(); - if (this.resumeBgm && bgmPlaying) { - globalScene.playBgm(); - } - globalScene.ui.fadeIn(500).then(() => this.end()); - }); + if (healSong) { + globalScene.time.delayedCall(fixedInt(healSong.totalDuration * 1000), () => { + healSong.destroy(); + if (this.resumeBgm && bgmPlaying) { + globalScene.playBgm(); + } + globalScene.ui.fadeIn(500).then(() => this.end()); + }); + } }); globalScene.arena.playerTerasUsed = 0; } diff --git a/src/ui/battle-info/enemy-battle-info.ts b/src/ui/battle-info/enemy-battle-info.ts index 4b37adc74aa..7a2af017219 100644 --- a/src/ui/battle-info/enemy-battle-info.ts +++ b/src/ui/battle-info/enemy-battle-info.ts @@ -115,6 +115,9 @@ export class EnemyBattleInfo extends BattleInfo { globalScene.gameData.starterData[pokemon.species.getRootSpeciesId()].classicWinCount > 0 && globalScene.gameData.starterData[pokemon.species.getRootSpeciesId(true)].classicWinCount > 0 ) { + // move the ribbon to the left if there is no owned icon + const championRibbonX = this.ownedIcon.visible ? 8 : 0; + this.championRibbon.setPositionRelative(this.nameText, championRibbonX, 11.75); this.championRibbon.setVisible(true); } @@ -180,12 +183,12 @@ export class EnemyBattleInfo extends BattleInfo { this.ownedIcon, this.championRibbon, this.statusIndicator, - this.levelContainer, this.statValuesContainer, ].map(e => (e.x += 48 * (boss ? -1 : 1))); this.hpBar.x += 38 * (boss ? -1 : 1); this.hpBar.y += 2 * (this.boss ? -1 : 1); this.hpBar.setTexture(`overlay_hp${boss ? "_boss" : ""}`); + this.levelContainer.x += 2 * (boss ? -1 : 1); this.box.setTexture(this.getTextureName()); this.statsBox.setTexture(`${this.getTextureName()}_stats`); } diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 73fc1bfc010..a7c7a134488 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -613,6 +613,20 @@ export class PartyUiHandler extends MessageUiHandler { ui.playSelect(); return true; } + + if (option === PartyOption.SUMMARY) { + return this.processSummaryOption(pokemon); + } + if (option === PartyOption.POKEDEX) { + return this.processPokedexOption(pokemon); + } + if (option === PartyOption.UNPAUSE_EVOLUTION) { + return this.processUnpauseEvolutionOption(pokemon); + } + if (option === PartyOption.RENAME) { + return this.processRenameOption(pokemon); + } + return false; } diff --git a/src/ui/text.ts b/src/ui/text.ts index 8aa50983874..bac53f81ba6 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -349,6 +349,15 @@ export function getTextStyleOptions( styleOptions.fontSize = defaultFontSize - 42; styleOptions.padding = { top: 4 }; break; + case "ko": + styleOptions.fontSize = defaultFontSize - 38; + styleOptions.padding = { top: 4, left: 6 }; + break; + case "zh-CN": + case "zh-TW": + styleOptions.fontSize = defaultFontSize - 42; + styleOptions.padding = { top: 5, left: 14 }; + break; default: styleOptions.fontSize = defaultFontSize - 30; styleOptions.padding = { left: 12 }; diff --git a/test/ui/transfer-item-options.test.ts b/test/ui/transfer-item-options.test.ts new file mode 100644 index 00000000000..901aa261f50 --- /dev/null +++ b/test/ui/transfer-item-options.test.ts @@ -0,0 +1,235 @@ +import { BerryType } from "#enums/berry-type"; +import { Button } from "#enums/buttons"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { GameManager } from "#test/test-utils/game-manager"; +import { type PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler"; +import type { RenameFormUiHandler } from "#ui/rename-form-ui-handler"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +// todo: Some tests fail when running all tests at once, but pass when running individually. Seams like it's always the 2nd and 4th (non todo) tests that fail. +describe("UI - Transfer Item Options", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(async () => { + game = new GameManager(phaserGame); + game.override + .battleStyle("single") + .startingLevel(100) + .startingHeldItems([ + { name: "BERRY", count: 1, type: BerryType.SITRUS }, + { name: "BERRY", count: 2, type: BerryType.APICOT }, + { name: "BERRY", count: 2, type: BerryType.LUM }, + ]) + .enemySpecies(SpeciesId.MAGIKARP) + .enemyMoveset(MoveId.SPLASH); + + await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.SQUIRTLE, SpeciesId.CHARMANDER]); + + game.move.use(MoveId.DRAGON_CLAW); + + await game.phaseInterceptor.to("SelectModifierPhase"); + await game.scene.ui.setModeWithoutClear(UiMode.PARTY, PartyUiMode.MODIFIER_TRANSFER); + }); + + it.todo("should open the summary screen while transfering an item", async () => { + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + + // Select first party member + handler.setCursor(0); + handler.processInput(Button.ACTION); + + resolve(); + }); + }); + + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + // select item to transfer + handler.processInput(Button.ACTION); + resolve(); + }); + }); + + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + + // move to second pokemon + handler.setCursor(1); + handler.processInput(Button.ACTION); + + // select summary + handler.processInput(Button.DOWN); + handler.processInput(Button.ACTION); + + await new Promise(r => setTimeout(r, 100)); + expect(game.scene.ui.getMode()).toBe(UiMode.SUMMARY); + }); + + it.todo("should open the pokèdex screen while transfering an item", async () => { + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + + // Select first party member + handler.setCursor(0); + handler.processInput(Button.ACTION); + + resolve(); + }); + }); + + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + // select item to transfer + handler.processInput(Button.ACTION); + resolve(); + }); + }); + + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + // move to second pokemon + handler.setCursor(1); + handler.processInput(Button.ACTION); + + // select pokèdex + handler.processInput(Button.DOWN); + handler.processInput(Button.DOWN); + handler.processInput(Button.ACTION); + + await new Promise(r => setTimeout(r, 100)); + expect(game.scene.ui.getMode()).toBe(UiMode.POKEDEX_PAGE); + }); + + it.todo("should open the rename screen and rename the pokemon while transfering an item", async () => { + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + + // Select first party member + handler.setCursor(0); + handler.processInput(Button.ACTION); + + resolve(); + }); + }); + + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + // select item to transfer + handler.processInput(Button.ACTION); + resolve(); + }); + }); + + await new Promise(r => setTimeout(r, 100)); + let handler: PartyUiHandler | RenameFormUiHandler | undefined; + handler = game.scene.ui.getHandler() as PartyUiHandler; + + // move to second pokemon + handler.setCursor(1); + handler.processInput(Button.ACTION); + + // select rename + handler.processInput(Button.DOWN); + handler.processInput(Button.DOWN); + handler.processInput(Button.DOWN); + handler.processInput(Button.ACTION); + + const pokemon = game.scene.getPlayerParty()[1]; + if (!pokemon) { + expect.fail("Pokemon is undefined"); + } + const nickname = pokemon.nickname; + + expect(nickname).toBe(undefined); + + await new Promise(r => setTimeout(r, 100)); + expect(game.scene.ui.getMode()).toBe(UiMode.RENAME_POKEMON); + await new Promise(r => setTimeout(r, 100)); + handler = game.scene.ui.getHandler() as RenameFormUiHandler; + handler["inputs"][0].setText("New nickname"); + handler.processInput(Button.SUBMIT); + await new Promise(r => setTimeout(r, 100)); + // get the sanitized name + const sanitizedName = btoa(unescape(encodeURIComponent("New nickname"))); + expect(pokemon.nickname).toBe(sanitizedName); + }); + + it.todo("should pause the evolution while transfering an item", async () => { + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + + // Select first party member + handler.setCursor(0); + handler.processInput(Button.ACTION); + + resolve(); + }); + }); + + await new Promise(resolve => { + game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => { + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + // select item to transfer + handler.processInput(Button.ACTION); + resolve(); + }); + }); + + await new Promise(r => setTimeout(r, 100)); + const handler = game.scene.ui.getHandler() as PartyUiHandler; + + // move to second pokemon + handler.setCursor(1); + handler.processInput(Button.ACTION); + + const pokemon = game.scene.getPlayerParty()[1]; + + if (!pokemon) { + expect.fail("Pokemon is undefined"); + } + if (pokemon.pauseEvolutions !== undefined) { + expect(pokemon.pauseEvolutions).toBe(false); + } + + // select pause evolution + handler.processInput(Button.DOWN); + handler.processInput(Button.DOWN); + handler.processInput(Button.DOWN); + handler.processInput(Button.DOWN); + handler.processInput(Button.ACTION); + + await new Promise(r => setTimeout(r, 100)); + expect(game.scene.ui.getMode()).toBe(UiMode.PARTY); + expect(pokemon.pauseEvolutions).toBe(true); + }); +});