Compare commits

...

13 Commits

Author SHA1 Message Date
Blitzy
ed8ce45e55
Merge 0d08865d13 into bb86bdd2a6 2025-08-06 04:16:10 +00:00
Blitzy
0d08865d13 Update on changes from sheet 2025-08-05 23:16:02 -05:00
damocleas
bb86bdd2a6
[Balance] Add Scientist to Lab, Swimmer to Seabed to account for ME's
https://github.com/pagefaultgames/pokerogue/pull/6217
2025-08-05 19:57:51 -07:00
Sirz Benjie
1633df75c4
[UI/UX] Add change password ui (#5938)
* Add change password ui

* Ensure input fields are cleared after submit or cancel

* Play select sound on successful submission or cancel

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-08-05 16:35:58 -06:00
Blitzy
eedf2871ab Update Morty 2025-08-01 09:47:04 -05:00
Blitzy
2e63914a34
Merge branch 'beta' into ChampionAdjustments 2025-08-01 09:42:06 -05:00
Blitzy
81cde974fc
Merge branch 'beta' into ChampionAdjustments 2025-07-31 09:13:13 -05:00
Blitzy
62fcf73fb6
Merge branch 'beta' into ChampionAdjustments 2025-07-27 15:44:14 -05:00
Blitzy
bcd49bd1b1 Merge branch 'ChampionAdjustments' of https://github.com/Blitz425/pokerogue into pr/6132 2025-07-25 21:17:28 -05:00
Blitzy
f69b340b17 Update trainer-config.ts 2025-07-25 21:17:09 -05:00
Blitzy
d1708c4ffd
Merge branch 'beta' into ChampionAdjustments 2025-07-25 20:55:50 -05:00
Blitzy
0b79ac67af Update trainer-config.ts 2025-07-25 20:55:23 -05:00
Blitzy
eac0938205
Update trainer-config.ts 2025-07-23 15:58:13 -05:00
12 changed files with 413 additions and 321 deletions

View File

@ -15,3 +15,10 @@ export interface AccountRegisterRequest {
username: string;
password: string;
}
export interface AccountChangePwRequest {
password: string;
}
export interface AccountChangePwResponse {
success: boolean;
}

View File

@ -1641,10 +1641,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: []
},
[BiomeId.PLAINS]: {
[BiomePoolTier.COMMON]: [ TrainerType.BREEDER, TrainerType.TWINS ],
@ -1652,10 +1649,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.CILAN, TrainerType.CHILI, TrainerType.CRESS, TrainerType.CHEREN ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.CILAN, TrainerType.CHILI, TrainerType.CRESS, TrainerType.CHEREN ]
},
[BiomeId.GRASS]: {
[BiomePoolTier.COMMON]: [ TrainerType.BREEDER, TrainerType.SCHOOL_KID ],
@ -1663,10 +1657,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.ERIKA ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.ERIKA ]
},
[BiomeId.TALL_GRASS]: {
[BiomePoolTier.COMMON]: [],
@ -1674,10 +1665,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.GARDENIA, TrainerType.VIOLA, TrainerType.BRASSIUS ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.GARDENIA, TrainerType.VIOLA, TrainerType.BRASSIUS ]
},
[BiomeId.METROPOLIS]: {
[BiomePoolTier.COMMON]: [ TrainerType.BEAUTY, TrainerType.CLERK, TrainerType.CYCLIST, TrainerType.OFFICER, TrainerType.WAITER ],
@ -1685,10 +1673,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [ TrainerType.ARTIST, TrainerType.RICH_KID ],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.WHITNEY, TrainerType.NORMAN, TrainerType.IONO, TrainerType.LARRY ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.WHITNEY, TrainerType.NORMAN, TrainerType.IONO, TrainerType.LARRY ]
},
[BiomeId.FOREST]: {
[BiomePoolTier.COMMON]: [ TrainerType.RANGER ],
@ -1696,10 +1681,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.BUGSY, TrainerType.BURGH, TrainerType.KATY ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.BUGSY, TrainerType.BURGH, TrainerType.KATY ]
},
[BiomeId.SEA]: {
[BiomePoolTier.COMMON]: [ TrainerType.SAILOR, TrainerType.SWIMMER ],
@ -1707,10 +1689,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.MARLON ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.MARLON ]
},
[BiomeId.SWAMP]: {
[BiomePoolTier.COMMON]: [ TrainerType.PARASOL_LADY ],
@ -1718,10 +1697,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.JANINE, TrainerType.ROXIE ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.JANINE, TrainerType.ROXIE ]
},
[BiomeId.BEACH]: {
[BiomePoolTier.COMMON]: [ TrainerType.FISHERMAN, TrainerType.SAILOR ],
@ -1729,10 +1705,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.MISTY, TrainerType.KOFU ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.MISTY, TrainerType.KOFU ]
},
[BiomeId.LAKE]: {
[BiomePoolTier.COMMON]: [ TrainerType.BREEDER, TrainerType.FISHERMAN, TrainerType.PARASOL_LADY ],
@ -1740,21 +1713,15 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.CRASHER_WAKE ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.CRASHER_WAKE ]
},
[BiomeId.SEABED]: {
[BiomePoolTier.COMMON]: [],
[BiomePoolTier.COMMON]: [ TrainerType.SWIMMER ],
[BiomePoolTier.UNCOMMON]: [],
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.JUAN ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.JUAN ]
},
[BiomeId.MOUNTAIN]: {
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.BLACK_BELT, TrainerType.HIKER ],
@ -1762,10 +1729,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.FALKNER, TrainerType.WINONA, TrainerType.SKYLA ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.FALKNER, TrainerType.WINONA, TrainerType.SKYLA ]
},
[BiomeId.BADLANDS]: {
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.HIKER ],
@ -1773,10 +1737,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.CLAY, TrainerType.GRANT ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.CLAY, TrainerType.GRANT ]
},
[BiomeId.CAVE]: {
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.HIKER ],
@ -1784,10 +1745,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.BROCK, TrainerType.ROXANNE, TrainerType.ROARK ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.BROCK, TrainerType.ROXANNE, TrainerType.ROARK ]
},
[BiomeId.DESERT]: {
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.SCIENTIST ],
@ -1795,10 +1753,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.GORDIE ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.GORDIE ]
},
[BiomeId.ICE_CAVE]: {
[BiomePoolTier.COMMON]: [ TrainerType.SNOW_WORKER ],
@ -1806,10 +1761,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.PRYCE, TrainerType.BRYCEN, TrainerType.WULFRIC, TrainerType.GRUSHA ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.PRYCE, TrainerType.BRYCEN, TrainerType.WULFRIC, TrainerType.GRUSHA ]
},
[BiomeId.MEADOW]: {
[BiomePoolTier.COMMON]: [ TrainerType.BEAUTY, TrainerType.MUSICIAN, TrainerType.PARASOL_LADY ],
@ -1817,10 +1769,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.LENORA, TrainerType.MILO ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.LENORA, TrainerType.MILO ]
},
[BiomeId.POWER_PLANT]: {
[BiomePoolTier.COMMON]: [ TrainerType.GUITARIST, TrainerType.WORKER ],
@ -1828,10 +1777,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.VOLKNER, TrainerType.ELESA, TrainerType.CLEMONT ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.VOLKNER, TrainerType.ELESA, TrainerType.CLEMONT ]
},
[BiomeId.VOLCANO]: {
[BiomePoolTier.COMMON]: [ TrainerType.FIREBREATHER ],
@ -1839,10 +1785,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.BLAINE, TrainerType.FLANNERY, TrainerType.KABU ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.BLAINE, TrainerType.FLANNERY, TrainerType.KABU ]
},
[BiomeId.GRAVEYARD]: {
[BiomePoolTier.COMMON]: [ TrainerType.PSYCHIC ],
@ -1850,10 +1793,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.MORTY, TrainerType.ALLISTER, TrainerType.RYME ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.MORTY, TrainerType.ALLISTER, TrainerType.RYME ]
},
[BiomeId.DOJO]: {
[BiomePoolTier.COMMON]: [ TrainerType.BLACK_BELT ],
@ -1861,10 +1801,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.BRAWLY, TrainerType.MAYLENE, TrainerType.KORRINA, TrainerType.BEA ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.BRAWLY, TrainerType.MAYLENE, TrainerType.KORRINA, TrainerType.BEA ]
},
[BiomeId.FACTORY]: {
[BiomePoolTier.COMMON]: [ TrainerType.WORKER ],
@ -1872,10 +1809,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.JASMINE, TrainerType.BYRON ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.JASMINE, TrainerType.BYRON ]
},
[BiomeId.RUINS]: {
[BiomePoolTier.COMMON]: [ TrainerType.PSYCHIC, TrainerType.SCIENTIST ],
@ -1883,10 +1817,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.SABRINA, TrainerType.TATE, TrainerType.LIZA, TrainerType.TULIP ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.SABRINA, TrainerType.TATE, TrainerType.LIZA, TrainerType.TULIP ]
},
[BiomeId.WASTELAND]: {
[BiomePoolTier.COMMON]: [ TrainerType.VETERAN ],
@ -1894,10 +1825,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.CLAIR, TrainerType.DRAYDEN, TrainerType.RAIHAN ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.CLAIR, TrainerType.DRAYDEN, TrainerType.RAIHAN ]
},
[BiomeId.ABYSS]: {
[BiomePoolTier.COMMON]: [],
@ -1905,10 +1833,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.MARNIE ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.MARNIE ]
},
[BiomeId.SPACE]: {
[BiomePoolTier.COMMON]: [],
@ -1916,10 +1841,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.OLYMPIA ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.OLYMPIA ]
},
[BiomeId.CONSTRUCTION_SITE]: {
[BiomePoolTier.COMMON]: [ TrainerType.OFFICER, TrainerType.WORKER ],
@ -1927,10 +1849,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.LT_SURGE, TrainerType.CHUCK, TrainerType.WATTSON ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.LT_SURGE, TrainerType.CHUCK, TrainerType.WATTSON ]
},
[BiomeId.JUNGLE]: {
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.RANGER ],
@ -1938,10 +1857,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.RAMOS ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.RAMOS ]
},
[BiomeId.FAIRY_CAVE]: {
[BiomePoolTier.COMMON]: [ TrainerType.BEAUTY ],
@ -1949,10 +1865,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.VALERIE, TrainerType.OPAL, TrainerType.BEDE ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.VALERIE, TrainerType.OPAL, TrainerType.BEDE ]
},
[BiomeId.TEMPLE]: {
[BiomePoolTier.COMMON]: [],
@ -1960,10 +1873,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.FANTINA ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.FANTINA ]
},
[BiomeId.SLUM]: {
[BiomePoolTier.COMMON]: [ TrainerType.BIKER, TrainerType.OFFICER, TrainerType.ROUGHNECK ],
@ -1971,10 +1881,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.PIERS ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.PIERS ]
},
[BiomeId.SNOWY_FOREST]: {
[BiomePoolTier.COMMON]: [ TrainerType.SNOW_WORKER ],
@ -1982,10 +1889,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.CANDICE, TrainerType.MELONY ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.CANDICE, TrainerType.MELONY ]
},
[BiomeId.ISLAND]: {
[BiomePoolTier.COMMON]: [ TrainerType.RICH_KID ],
@ -1993,21 +1897,15 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.NESSA ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.NESSA ]
},
[BiomeId.LABORATORY]: {
[BiomePoolTier.COMMON]: [],
[BiomePoolTier.COMMON]: [ TrainerType.SCIENTIST ],
[BiomePoolTier.UNCOMMON]: [],
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [ TrainerType.GIOVANNI ],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: [ TrainerType.GIOVANNI ]
},
[BiomeId.END]: {
[BiomePoolTier.COMMON]: [],
@ -2015,13 +1913,9 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[BiomePoolTier.RARE]: [],
[BiomePoolTier.SUPER_RARE]: [],
[BiomePoolTier.ULTRA_RARE]: [],
[BiomePoolTier.BOSS]: [],
[BiomePoolTier.BOSS_RARE]: [],
[BiomePoolTier.BOSS_SUPER_RARE]: [],
[BiomePoolTier.BOSS_ULTRA_RARE]: []
[BiomePoolTier.BOSS]: []
}
};
export function initBiomes() {
const pokemonBiomes = [
[ SpeciesId.BULBASAUR, PokemonType.GRASS, PokemonType.POISON, [

View File

@ -30,7 +30,7 @@ export const signatureSpecies: SignatureSpecies = new Proxy({
FALKNER: [SpeciesId.PIDGEY, SpeciesId.HOOTHOOT, SpeciesId.NATU, SpeciesId.MURKROW],
BUGSY: [SpeciesId.SCYTHER, SpeciesId.SHUCKLE, SpeciesId.YANMA, [SpeciesId.PINSIR, SpeciesId.HERACROSS]],
WHITNEY: [SpeciesId.MILTANK, SpeciesId.AIPOM, SpeciesId.IGGLYBUFF, [SpeciesId.GIRAFARIG, SpeciesId.STANTLER]],
MORTY: [SpeciesId.GASTLY, SpeciesId.MISDREAVUS, SpeciesId.DUSKULL, SpeciesId.SABLEYE],
MORTY: [SpeciesId.GASTLY, SpeciesId.MISDREAVUS, SpeciesId.DUSKULL, SpeciesId.HISUI_TYPHLOSION],
CHUCK: [SpeciesId.POLIWRATH, SpeciesId.MANKEY, SpeciesId.TYROGUE, SpeciesId.MACHOP],
JASMINE: [SpeciesId.STEELIX, SpeciesId.MAGNEMITE, SpeciesId.PINECO, SpeciesId.SKARMORY],
PRYCE: [SpeciesId.SWINUB, SpeciesId.SEEL, SpeciesId.SHELLDER, SpeciesId.SNEASEL],

View File

@ -3791,27 +3791,27 @@ export const trainerConfigs: TrainerConfigs = {
.setDoubleTrainerType(TrainerType.RED)
.setDoubleTitle("champion_double")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALAKAZAM]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MACHAMP]))
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.HO_OH], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.RHYPERIOR, SpeciesId.ELECTIVIRE]))
.setPartyMemberFunc(
4,
1,
getRandomPartyMemberFunc(
[SpeciesId.ARCANINE, SpeciesId.EXEGGUTOR, SpeciesId.GYARADOS],
TrainerSlot.TRAINER,
true,
p => {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
p.teraType = p.species.type1;
},
),
)
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.RHYPERIOR, SpeciesId.ELECTIVIRE]))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MACHAMP]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.HO_OH], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc([SpeciesId.PIDGEOT], TrainerSlot.TRAINER, true, p => {
@ -3819,9 +3819,10 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.generateName();
p.gender = Gender.MALE;
p.setBoss(true, 2);
}),
)
.setInstantTera(3), // Tera Ground or Rock Rhyperior / Electric Electivire / Fire Magmortar
.setInstantTera(2), // Tera Fire Arcanine, Tera Grass Exeggutor, Tera Water Gyarados
[TrainerType.RED]: new TrainerConfig(++t)
.initForChampion(true)
.setBattleBgm("battle_johto_champion")
@ -3838,22 +3839,16 @@ export const trainerConfigs: TrainerConfigs = {
p.gender = Gender.MALE;
}),
)
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.UMBREON, SpeciesId.SYLVEON]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MEGANIUM, SpeciesId.TYPHLOSION, SpeciesId.FERALIGATR]))
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.UMBREON, SpeciesId.SYLVEON]))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SNORLAX]))
.setPartyMemberFunc(
2,
4,
getRandomPartyMemberFunc([SpeciesId.LUGIA], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MEGANIUM, SpeciesId.TYPHLOSION, SpeciesId.FERALIGATR]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.SNORLAX], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
}),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc(
@ -3865,10 +3860,11 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.generateName();
p.gender = Gender.MALE;
p.setBoss(true, 2);
},
),
)
.setInstantTera(3), // Tera Grass Meganium / Fire Typhlosion / Water Feraligatr
.setInstantTera(1), // Tera Grass Meganium / Fire Typhlosion / Water Feraligatr
[TrainerType.LANCE_CHAMPION]: new TrainerConfig(++t)
.setName("Lance")
.initForChampion(true)
@ -3876,37 +3872,38 @@ export const trainerConfigs: TrainerConfigs = {
.setMixedBattleBgm("battle_johto_champion")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.GYARADOS, SpeciesId.KINGDRA]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.AERODACTYL]))
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.CHARIZARD]))
.setPartyMemberFunc(
2,
3,
getRandomPartyMemberFunc(
[SpeciesId.TYRANITAR, SpeciesId.GARCHOMP, SpeciesId.HYDREIGON],
TrainerSlot.TRAINER,
true,
p => {
p.abilityIndex = 2; // Unnerve Tyranitar, Rough Skin Garchomp, Levitate Hydreigon
p.generateAndPopulateMoveset();
},
),
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.SALAMENCE], TrainerSlot.TRAINER, true, p => {
p.formIndex = 1; // Mega Salamence
p.generateAndPopulateMoveset();
p.generateName();
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.CHARIZARD]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc(
[SpeciesId.TYRANITAR, SpeciesId.GARCHOMP, SpeciesId.KOMMO_O],
TrainerSlot.TRAINER,
true,
p => {
p.teraType = PokemonType.DRAGON;
p.generateAndPopulateMoveset();
p.abilityIndex = p.species.speciesId === SpeciesId.KOMMO_O ? 1 : 2; // Soundproof Kommo-o, Unnerve Tyranitar, Rough Skin Garchomp
},
),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.abilityIndex = 2; // Multiscale
p.gender = Gender.MALE;
p.setBoss(true, 2);
p.teraType = PokemonType.DRAGON;
}),
)
.setInstantTera(4), // Tera Dragon Tyranitar / Garchomp / Kommo-o
.setInstantTera(5), // Tera Dragon Dragonite
[TrainerType.STEVEN]: new TrainerConfig(++t)
.initForChampion(true)
.setBattleBgm("battle_hoenn_champion_g5")
@ -3914,16 +3911,22 @@ export const trainerConfigs: TrainerConfigs = {
.setHasDouble("steven_wallace_double")
.setDoubleTrainerType(TrainerType.WALLACE)
.setDoubleTitle("champion_double")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SKARMORY]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.CRADILY, SpeciesId.ARMALDO]))
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.AGGRON], TrainerSlot.TRAINER, true, p => {
0,
getRandomPartyMemberFunc([SpeciesId.GIGALITH], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 1; // Sand Stream
p.generateAndPopulateMoveset();
}),
)
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.SKARMORY, SpeciesId.CLAYDOL]))
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.AGGRON]))
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc([SpeciesId.GOLURK, SpeciesId.RUNERIGUS], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 0; // Iron Fist Golurk, Wandering Spirit Runerigus
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOLURK, SpeciesId.RUNERIGUS]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc(
@ -3942,6 +3945,7 @@ export const trainerConfigs: TrainerConfigs = {
p.formIndex = 1; // Mega Metagross
p.generateAndPopulateMoveset();
p.generateName();
p.setBoss(true, 2);
}),
)
.setInstantTera(4), // Tera Rock Regirock / Ice Regice / Steel Registeel
@ -3954,26 +3958,33 @@ export const trainerConfigs: TrainerConfigs = {
.setDoubleTitle("champion_double")
.setPartyMemberFunc(
0,
getRandomPartyMemberFunc([SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 1; // Drizzle
getRandomPartyMemberFunc([SpeciesId.POLITOED, SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = p.species.speciesId === SpeciesId.POLITOED ? 2 : 1; // Drizzle
p.generateAndPopulateMoveset();
}),
)
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.LUDICOLO]))
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.LATIAS, SpeciesId.LATIOS], TrainerSlot.TRAINER, true, p => {
p.formIndex = 1; // Mega Latios or Mega Latias
getRandomPartyMemberFunc([SpeciesId.TENTACRUEL, SpeciesId.WALREIN], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = p.species.speciesId === SpeciesId.TENTACRUEL ? 2 : 0; // Rain Dish Tentacruel, Thick Fat Walrein
p.generateAndPopulateMoveset();
p.generateName();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SWAMPERT, SpeciesId.GASTRODON, SpeciesId.SEISMITOAD]))
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc([SpeciesId.LATIAS, SpeciesId.LATIOS], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.generateName();
p.pokeball = PokeballType.ULTRA_BALL;
}),
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.REGIELEKI, SpeciesId.REGIDRAGO], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.SWAMPERT], TrainerSlot.TRAINER, true, p => {
p.formIndex = 1; // Mega Swampert
p.generateAndPopulateMoveset();
p.generateName();
p.pokeball = PokeballType.ULTRA_BALL;
}),
)
@ -3985,22 +3996,14 @@ export const trainerConfigs: TrainerConfigs = {
p.setBoss(true, 2);
}),
)
.setInstantTera(4), // Tera Electric Regieleki / Dragon Regidrago
.setInstantTera(5), // Tera Water Milotic
[TrainerType.CYNTHIA]: new TrainerConfig(++t)
.initForChampion(false)
.setBattleBgm("battle_sinnoh_champion")
.setMixedBattleBgm("battle_sinnoh_champion")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SPIRITOMB]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.LUCARIO]))
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.GIRATINA], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
3,
1,
getRandomPartyMemberFunc(
[SpeciesId.MILOTIC, SpeciesId.ROSERADE, SpeciesId.HISUI_ARCANINE],
TrainerSlot.TRAINER,
@ -4011,11 +4014,13 @@ export const trainerConfigs: TrainerConfigs = {
},
),
)
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.TOGEKISS]))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.LUCARIO]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.TOGEKISS], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.GIRATINA], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
@ -4025,9 +4030,10 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.generateName();
p.gender = Gender.FEMALE;
p.setBoss(true, 2);
}),
)
.setInstantTera(3), // Tera Water Milotic / Grass Roserade / Fire Hisuian Arcanine
.setInstantTera(1), // Tera Water Milotic / Grass Roserade / Fire Hisuian Arcanine
[TrainerType.ALDER]: new TrainerConfig(++t)
.initForChampion(true)
.setHasDouble("alder_iris_double")
@ -4050,29 +4056,26 @@ export const trainerConfigs: TrainerConfigs = {
)
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.ZEKROM], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.KELDEO], TrainerSlot.TRAINER, true, p => {
p.pokeball = PokeballType.ULTRA_BALL;
p.formIndex = 1; // Resolute Form
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SECRET_SWORD)) {
// Check if Secret Sword is in the moveset, if not, replace the third move with Secret Sword.
p.moveset[2] = new PokemonMove(MoveId.SECRET_SWORD);
}
}),
)
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc([SpeciesId.KELDEO], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.ULTRA_BALL;
}),
getRandomPartyMemberFunc([SpeciesId.CHANDELURE, SpeciesId.KROOKODILE, SpeciesId.REUNICLUS, SpeciesId.CONKELDURR]),
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc(
[SpeciesId.CHANDELURE, SpeciesId.KROOKODILE, SpeciesId.REUNICLUS, SpeciesId.CONKELDURR],
TrainerSlot.TRAINER,
true,
p => {
p.generateAndPopulateMoveset();
p.teraType = p.species.speciesId === SpeciesId.KROOKODILE ? PokemonType.DARK : p.species.type1;
},
),
getRandomPartyMemberFunc([SpeciesId.ZEKROM], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
5,
@ -4080,9 +4083,10 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.gender = Gender.MALE;
p.setBoss(true, 2);
p.teraType = PokemonType.FIRE;
}),
)
.setInstantTera(4), // Tera Ghost Chandelure / Dark Krookodile / Psychic Reuniclus / Fighting Conkeldurr
.setInstantTera(5), // Tera Fire Volcarona
[TrainerType.IRIS]: new TrainerConfig(++t)
.initForChampion(false)
.setBattleBgm("battle_champion_iris")
@ -4091,34 +4095,29 @@ export const trainerConfigs: TrainerConfigs = {
.setDoubleTrainerType(TrainerType.ALDER)
.setDoubleTitle("champion_double")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRUDDIGON]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.ARCHEOPS]))
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.RESHIRAM], TrainerSlot.TRAINER, true, p => {
1,
getRandomPartyMemberFunc([SpeciesId.ARCHEOPS], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 2; // Emergency Exit
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.AGGRON, SpeciesId.HYDREIGON, SpeciesId.ARCHALUDON]))
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc(
[SpeciesId.SALAMENCE, SpeciesId.HYDREIGON, SpeciesId.ARCHALUDON],
TrainerSlot.TRAINER,
true,
p => {
p.generateAndPopulateMoveset();
p.teraType = PokemonType.DRAGON;
},
),
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.LAPRAS], TrainerSlot.TRAINER, true, p => {
p.formIndex = 1; // G-Max Lapras
p.generateAndPopulateMoveset();
p.generateName();
}),
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.RESHIRAM], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc([SpeciesId.HAXORUS], TrainerSlot.TRAINER, true, p => {
@ -4128,37 +4127,32 @@ export const trainerConfigs: TrainerConfigs = {
p.setBoss(true, 2);
}),
)
.setInstantTera(3), // Tera Dragon Salamence / Hydreigon / Archaludon
.setInstantTera(5), // Tera Dragon Haxorus
[TrainerType.DIANTHA]: new TrainerConfig(++t)
.initForChampion(false)
.setMixedBattleBgm("battle_kalos_champion")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HAWLUCHA]))
.setPartyMemberFunc(
0,
getRandomPartyMemberFunc([SpeciesId.HAWLUCHA], TrainerSlot.TRAINER, true, p => {
1,
getRandomPartyMemberFunc([SpeciesId.TREVENANT, SpeciesId.GOURGEIST], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 2; // Harvest Trevenant, Insomnia Gourgeist
p.generateAndPopulateMoveset();
}),
)
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.TREVENANT, SpeciesId.GOURGEIST]))
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.XERNEAS], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc([SpeciesId.TYRANTRUM, SpeciesId.AURORUS], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.abilityIndex = 2; // Rock Head Tyrantrum, Snow Warning Aurorus
p.teraType = p.species.type2!;
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOODRA]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.GOODRA], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.XERNEAS], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
@ -4168,6 +4162,7 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.generateName();
p.gender = Gender.FEMALE;
p.setBoss(true, 2);
}),
)
.setInstantTera(3), // Tera Dragon Tyrantrum / Ice Aurorus
@ -4181,7 +4176,13 @@ export const trainerConfigs: TrainerConfigs = {
p.formIndex = 2; // Dusk Lycanroc
}),
)
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE, SpeciesId.ALOLA_NINETALES]))
.setPartyMemberFunc(
1,
getRandomPartyMemberFunc([SpeciesId.MAGNEZONE, SpeciesId.ALOLA_NINETALES], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.abilityIndex = p.species.speciesId === SpeciesId.MAGNEZONE ? 1 : 2; // Sturdy Magnezone, Snow Warning Ninetales
}),
)
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc(
@ -4197,9 +4198,8 @@ export const trainerConfigs: TrainerConfigs = {
)
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc([SpeciesId.TAPU_KOKO, SpeciesId.TAPU_FINI], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.TAPU_LELE, SpeciesId.TAPU_FINI], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
p.pokeball = PokeballType.ULTRA_BALL;
}),
)
@ -4216,6 +4216,7 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.gender = Gender.MALE;
p.teraType = p.species.type2!;
p.setBoss(true, 2);
}),
)
.setInstantTera(5), // Tera Dark Incineroar / Fighting Hisuian Decidueye
@ -4223,28 +4224,32 @@ export const trainerConfigs: TrainerConfigs = {
.initForChampion(true)
.setMixedBattleBgm("battle_alola_champion")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALOLA_RAICHU]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.NOIVERN]))
.setPartyMemberFunc(
1,
getRandomPartyMemberFunc([SpeciesId.NOIVERN], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 1; // Infiltrator
p.generateAndPopulateMoveset();
}),
)
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.SOLGALEO], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.BLACEPHALON, SpeciesId.STAKATAKA], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
p.pokeball = PokeballType.ROGUE_BALL;
}),
)
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc([SpeciesId.TAPU_LELE, SpeciesId.TAPU_BULU], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.TAPU_KOKO, SpeciesId.TAPU_BULU], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.ULTRA_BALL;
p.teraType = p.species.type1;
}),
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.ZYGARDE], TrainerSlot.TRAINER, true, p => {
p.formIndex = 1; // Zygarde 10% forme, Aura Break
getRandomPartyMemberFunc([SpeciesId.SOLGALEO], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.ROGUE_BALL;
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
@ -4253,34 +4258,35 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
p.gender = p.species.speciesId === SpeciesId.PRIMARINA ? Gender.FEMALE : Gender.MALE;
p.teraType = p.species.speciesId === SpeciesId.PRIMARINA ? PokemonType.WATER : PokemonType.GHOST;
}),
)
.setInstantTera(3), // Tera Psychic Tapu Lele / Grass Tapu Bulu
.setInstantTera(5), // Tera Ghost Decidueye, Water Primarina
[TrainerType.LEON]: new TrainerConfig(++t)
.initForChampion(true)
.setMixedBattleBgm("battle_galar_champion")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.AEGISLASH]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.RHYPERIOR, SpeciesId.SEISMITOAD, SpeciesId.MR_RIME]))
.setPartyMemberFunc(
2,
1,
getRandomPartyMemberFunc(
[SpeciesId.RHYPERIOR, SpeciesId.SEISMITOAD, SpeciesId.MR_RIME],
TrainerSlot.TRAINER,
true,
p => {
p.abilityIndex = 1; // Solid Rock Rhyperior, Poison Touch Seismitoad, Screen Cleaner Mr. Rime
p.generateAndPopulateMoveset();
},
),
)
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DRAGAPULT]))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.RILLABOOM, SpeciesId.CINDERACE, SpeciesId.INTELEON]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.ZACIAN], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DRAGAPULT]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc(
[SpeciesId.RILLABOOM, SpeciesId.CINDERACE, SpeciesId.INTELEON],
TrainerSlot.TRAINER,
true,
p => {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
},
),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc([SpeciesId.CHARIZARD], TrainerSlot.TRAINER, true, p => {
@ -4288,9 +4294,10 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.generateName();
p.gender = Gender.MALE;
p.setBoss(true, 2);
}),
)
.setInstantTera(3), // Tera Dragapult to Ghost or Dragon
.setInstantTera(3), // Tera Grass Rillaboom, Fire Cinderace, Water Inteleon
[TrainerType.MUSTARD]: new TrainerConfig(++t)
.initForChampion(true)
.setMixedBattleBgm("battle_mustard")
@ -4312,36 +4319,38 @@ export const trainerConfigs: TrainerConfigs = {
2,
getRandomPartyMemberFunc([SpeciesId.GALAR_SLOWBRO, SpeciesId.GALAR_SLOWKING], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.abilityIndex = p.species.speciesId === SpeciesId.GALAR_SLOWBRO ? 0 : 2; // Quick Draw Galar Slowbro, Regenerator Galar Slowking
p.pokeball = PokeballType.ULTRA_BALL;
p.teraType = p.species.type1;
}),
)
.setPartyMemberFunc(
3,
getRandomPartyMemberFunc([SpeciesId.GALAR_DARMANITAN], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.BLASTOISE, SpeciesId.VENUSAUR], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.ULTRA_BALL;
p.formIndex = 2; // G-Max Blastoise, G-Max Venusaur
}),
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.BLASTOISE, SpeciesId.VENUSAUR], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.ZAMAZENTA], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.setBoss(true, 2);
p.pokeball = PokeballType.ULTRA_BALL;
}),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc([SpeciesId.URSHIFU], TrainerSlot.TRAINER, true, p => {
p.formIndex = randSeedIntRange(2, 3); // Random G-Max Urshifu
p.formIndex = randSeedIntRange(0, 1); // Random Urshifu form
p.generateAndPopulateMoveset();
p.generateName();
p.gender = Gender.MALE;
p.pokeball = PokeballType.ULTRA_BALL;
p.setBoss(true, 2);
p.teraType = p.formIndex === 0 ? PokemonType.DARK : PokemonType.WATER;
}),
)
.setInstantTera(2), // Tera Poison Galar-Slowbro / Galar-Slowking
.setInstantTera(5), // Tera Dark Urshifu Single / Tera Water Urshifu Rapid
[TrainerType.GEETA]: new TrainerConfig(++t)
.initForChampion(false)
.setMixedBattleBgm("battle_champion_geeta")
@ -4353,16 +4362,22 @@ export const trainerConfigs: TrainerConfigs = {
p.setBoss(true, 2);
}),
)
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.ESPATHRA, SpeciesId.VELUZA]))
.setPartyMemberFunc(
2,
1,
getRandomPartyMemberFunc([SpeciesId.ESPATHRA], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 0; // Opportunist
p.generateAndPopulateMoveset();
}),
)
.setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.BAXCALIBUR]))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.CHESNAUGHT, SpeciesId.DELPHOX, SpeciesId.GRENINJA]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.MIRAIDON], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.BAXCALIBUR]))
.setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CHESNAUGHT, SpeciesId.DELPHOX, SpeciesId.GRENINJA]))
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc([SpeciesId.KINGAMBIT], TrainerSlot.TRAINER, true, p => {
@ -4389,19 +4404,19 @@ export const trainerConfigs: TrainerConfigs = {
.setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.PAWMOT]))
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.DUDUNSPARCE], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 0; // Serene Grace
p.generateAndPopulateMoveset();
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.CERULEDGE, SpeciesId.ARMAROUGE]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.KORAIDON], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GHOLDENGO]))
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.ARMAROUGE, SpeciesId.CERULEDGE], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.teraType = p.species.type2!;
}),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc(
@ -4412,10 +4427,11 @@ export const trainerConfigs: TrainerConfigs = {
p.generateAndPopulateMoveset();
p.gender = Gender.MALE;
p.setBoss(true, 2);
p.teraType = p.species.type1!;
},
),
)
.setInstantTera(4), // Tera Psychic Armarouge / Ghost Ceruledge
.setInstantTera(5), // Tera Grass Meowscarada, Fire Skeledirge, Water Quaquaval
[TrainerType.KIERAN]: new TrainerConfig(++t)
.initForChampion(true)
.setMixedBattleBgm("battle_champion_kieran")
@ -4429,9 +4445,9 @@ export const trainerConfigs: TrainerConfigs = {
)
.setPartyMemberFunc(
2,
getRandomPartyMemberFunc([SpeciesId.TERAPAGOS], TrainerSlot.TRAINER, true, p => {
getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 2; // Multiscale
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
@ -4443,25 +4459,29 @@ export const trainerConfigs: TrainerConfigs = {
)
.setPartyMemberFunc(
4,
getRandomPartyMemberFunc([SpeciesId.OGERPON], TrainerSlot.TRAINER, true, p => {
p.formIndex = randSeedInt(4); // Random Ogerpon Tera Mask
getRandomPartyMemberFunc([SpeciesId.TERAPAGOS], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.ULTRA_BALL;
if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.IVY_CUDGEL)) {
// Check if Ivy Cudgel is in the moveset, if not, replace the first move with Ivy Cudgel.
p.moveset[0] = new PokemonMove(MoveId.IVY_CUDGEL);
if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_STARSTORM)) {
// Check if Tera Starstorm is in the moveset, if not, replace the first move with Tera Starstorm.
p.moveset[0] = new PokemonMove(MoveId.TERA_STARSTORM);
}
p.pokeball = PokeballType.MASTER_BALL;
}),
)
.setPartyMemberFunc(
5,
getRandomPartyMemberFunc([SpeciesId.HYDRAPPLE], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.gender = Gender.MALE;
p.setBoss(true, 2);
p.teraType = PokemonType.FIGHTING;
p.generateAndPopulateMoveset();
if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) {
// Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast.
p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST);
}
}),
)
.setInstantTera(4), // Tera Ogerpon
.setInstantTera(5), // Tera Fighting Hydrapple
[TrainerType.RIVAL]: new TrainerConfig((t = TrainerType.RIVAL))
.setName("Finn")

View File

@ -43,5 +43,6 @@ export enum UiMode {
TEST_DIALOGUE,
AUTO_COMPLETE,
ADMIN,
MYSTERY_ENCOUNTER
MYSTERY_ENCOUNTER,
CHANGE_PASSWORD_FORM,
}

View File

@ -145,7 +145,7 @@ export class Arena {
? BiomePoolTier.BOSS_SUPER_RARE
: BiomePoolTier.BOSS_ULTRA_RARE;
console.log(BiomePoolTier[tier]);
while (!this.pokemonPool[tier].length) {
while (!this.pokemonPool[tier]?.length) {
console.log(`Downgraded rarity tier from ${BiomePoolTier[tier]} to ${BiomePoolTier[tier - 1]}`);
tier--;
}

View File

@ -1,6 +1,7 @@
import { ApiBase } from "#api/api-base";
import { SESSION_ID_COOKIE_NAME } from "#app/constants";
import type {
AccountChangePwRequest,
AccountInfoResponse,
AccountLoginRequest,
AccountLoginResponse,
@ -95,4 +96,19 @@ export class PokerogueAccountApi extends ApiBase {
removeCookie(SESSION_ID_COOKIE_NAME); // we are always clearing the cookie.
}
public async changePassword(changePwData: AccountChangePwRequest) {
try {
const response = await this.doPost("/account/changepw", changePwData, "form-urlencoded");
if (response.ok) {
return null;
}
console.warn("Change password failed!", response.status, response.statusText);
return response.text();
} catch (err) {
console.warn("Change password failed!", err);
}
return "Unknown error!";
}
}

View File

@ -0,0 +1,124 @@
import { globalScene } from "#app/global-scene";
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
import { UiMode } from "#enums/ui-mode";
import type { InputFieldConfig } from "#ui/form-modal-ui-handler";
import { FormModalUiHandler } from "#ui/form-modal-ui-handler";
import type { ModalConfig } from "#ui/modal-ui-handler";
import i18next from "i18next";
export class ChangePasswordFormUiHandler extends FormModalUiHandler {
private readonly ERR_PASSWORD: string = "invalid password";
private readonly ERR_ACCOUNT_EXIST: string = "account doesn't exist";
private readonly ERR_PASSWORD_MISMATCH: string = "password doesn't match";
constructor(mode: UiMode | null = null) {
super(mode);
}
setup(): void {
super.setup();
}
override getModalTitle(_config?: ModalConfig): string {
return i18next.t("menu:changePassword");
}
override getWidth(_config?: ModalConfig): number {
return 160;
}
override getMargin(_config?: ModalConfig): [number, number, number, number] {
return [0, 0, 48, 0];
}
override getButtonLabels(_config?: ModalConfig): string[] {
return [i18next.t("settings:buttonSubmit"), i18next.t("menu:cancel")];
}
override getReadableErrorMessage(error: string): string {
const colonIndex = error?.indexOf(":");
if (colonIndex > 0) {
error = error.slice(0, colonIndex);
}
switch (error) {
case this.ERR_PASSWORD:
return i18next.t("menu:invalidRegisterPassword");
case this.ERR_ACCOUNT_EXIST:
return i18next.t("menu:accountNonExistent");
case this.ERR_PASSWORD_MISMATCH:
return i18next.t("menu:passwordNotMatchingConfirmPassword");
}
return super.getReadableErrorMessage(error);
}
override getInputFieldConfigs(): InputFieldConfig[] {
const inputFieldConfigs: InputFieldConfig[] = [];
inputFieldConfigs.push({
label: i18next.t("menu:password"),
isPassword: true,
});
inputFieldConfigs.push({
label: i18next.t("menu:confirmPassword"),
isPassword: true,
});
return inputFieldConfigs;
}
override show(args: [ModalConfig, ...any]): boolean {
if (super.show(args)) {
const config = args[0];
const originalSubmitAction = this.submitAction;
this.submitAction = () => {
if (globalScene.tweens.getTweensOf(this.modalContainer).length === 0) {
// Prevent overlapping overrides on action modification
this.submitAction = originalSubmitAction;
this.sanitizeInputs();
globalScene.ui.setMode(UiMode.LOADING, { buttonActions: [] });
const onFail = (error: string | null) => {
globalScene.ui.setMode(UiMode.CHANGE_PASSWORD_FORM, Object.assign(config, { errorMessage: error?.trim() }));
globalScene.ui.playError();
};
const [passwordInput, confirmPasswordInput] = this.inputs;
if (!passwordInput?.text) {
return onFail(this.getReadableErrorMessage("invalid password"));
}
if (passwordInput.text !== confirmPasswordInput.text) {
return onFail(this.ERR_PASSWORD_MISMATCH);
}
pokerogueApi.account.changePassword({ password: passwordInput.text }).then(error => {
if (!error && originalSubmitAction) {
globalScene.ui.playSelect();
originalSubmitAction();
// Only clear inputs if the action was successful
for (const input of this.inputs) {
input.setText("");
}
} else {
onFail(error);
}
});
}
};
// Upon pressing cancel, the inputs should be cleared
const originalCancelAction = this.cancelAction;
this.cancelAction = () => {
globalScene.ui.playSelect();
for (const input of this.inputs) {
input.setText("");
}
originalCancelAction?.();
};
return true;
}
return false;
}
override clear() {
super.clear();
this.setMouseCursorStyle("default"); //reset cursor
}
}

View File

@ -19,6 +19,7 @@ export abstract class FormModalUiHandler extends ModalUiHandler {
protected inputs: InputText[];
protected errorMessage: Phaser.GameObjects.Text;
protected submitAction: Function | null;
protected cancelAction: (() => void) | null;
protected tween: Phaser.Tweens.Tween;
protected formLabels: Phaser.GameObjects.Text[];
@ -126,22 +127,37 @@ export abstract class FormModalUiHandler extends ModalUiHandler {
});
}
show(args: any[]): boolean {
override show(args: any[]): boolean {
if (super.show(args)) {
this.inputContainers.map(ic => ic.setVisible(true));
const config = args[0] as FormModalConfig;
this.submitAction = config.buttonActions.length ? config.buttonActions[0] : null;
this.cancelAction = config.buttonActions[1] ?? null;
if (this.buttonBgs.length) {
this.buttonBgs[0].off("pointerdown");
this.buttonBgs[0].on("pointerdown", () => {
if (this.submitAction && globalScene.tweens.getTweensOf(this.modalContainer).length === 0) {
this.submitAction();
// #region: Override button pointerDown
// Override the pointerDown event for the buttonBgs to call the `submitAction` and `cancelAction`
// properties that we set above, allowing their behavior to change after this method terminates
// Some subclasses use this to add behavior to the submit and cancel action
this.buttonBgs[0].off("pointerdown");
this.buttonBgs[0].on("pointerdown", () => {
if (this.submitAction && globalScene.tweens.getTweensOf(this.modalContainer).length === 0) {
this.submitAction();
}
});
const cancelBg = this.buttonBgs[1];
if (cancelBg) {
cancelBg.off("pointerdown");
cancelBg.on("pointerdown", () => {
// The seemingly redundant cancelAction check is intentionally left in as a defensive programming measure
if (this.cancelAction && globalScene.tweens.getTweensOf(this.modalContainer).length === 0) {
this.cancelAction();
}
});
}
//#endregion: Override pointerDown events
this.modalContainer.y += 24;
this.modalContainer.setAlpha(0);

View File

@ -311,6 +311,17 @@ export class MenuUiHandler extends MessageUiHandler {
},
keepOpen: true,
},
{
// Note: i18n key is under `menu`, not `menuUiHandler` to avoid duplication
label: i18next.t("menu:changePassword"),
handler: () => {
ui.setOverlayMode(UiMode.CHANGE_PASSWORD_FORM, {
buttonActions: [() => ui.revertMode(), () => ui.revertMode()],
});
return true;
},
keepOpen: true,
},
{
label: i18next.t("menuUiHandler:consentPreferences"),
handler: () => {

View File

@ -7,7 +7,7 @@ import { UiHandler } from "#ui/ui-handler";
import { addWindow, WindowVariant } from "#ui/ui-theme";
export interface ModalConfig {
buttonActions: Function[];
buttonActions: ((...args: any[]) => any)[];
}
export abstract class ModalUiHandler extends UiHandler {

View File

@ -13,6 +13,7 @@ import { BallUiHandler } from "#ui/ball-ui-handler";
import { BattleMessageUiHandler } from "#ui/battle-message-ui-handler";
import type { BgmBar } from "#ui/bgm-bar";
import { GameChallengesUiHandler } from "#ui/challenges-select-ui-handler";
import { ChangePasswordFormUiHandler } from "#ui/change-password-form-ui-handler";
import { CommandUiHandler } from "#ui/command-ui-handler";
import { ConfirmUiHandler } from "#ui/confirm-ui-handler";
import { EggGachaUiHandler } from "#ui/egg-gacha-ui-handler";
@ -102,6 +103,7 @@ const noTransitionModes = [
UiMode.ADMIN,
UiMode.MYSTERY_ENCOUNTER,
UiMode.RUN_INFO,
UiMode.CHANGE_PASSWORD_FORM,
];
export class UI extends Phaser.GameObjects.Container {
@ -172,6 +174,7 @@ export class UI extends Phaser.GameObjects.Container {
new AutoCompleteUiHandler(),
new AdminUiHandler(),
new MysteryEncounterUiHandler(),
new ChangePasswordFormUiHandler(),
];
}