From dfa399386460d2657695e76faf13d52a33a93c62 Mon Sep 17 00:00:00 2001 From: James Diefenbach <105332964+j-diefenbach@users.noreply.github.com> Date: Sun, 8 Sep 2024 09:32:49 +1000 Subject: [PATCH 01/12] Egg summary background touchup (#4091) * darker egg-summary background * reset old background for beta * update egg summary bg * reset overrides --------- Co-authored-by: James Diefenbach --- public/images/ui/egg_summary_bg.png | Bin 2209 -> 2247 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/images/ui/egg_summary_bg.png b/public/images/ui/egg_summary_bg.png index b4ee3d86a507bfb99b4f9af2d71b5065e4ac943b..e81934b9d75b3acbed35b113f803dfa119a78631 100644 GIT binary patch literal 2247 zcmeH}{a;dd8^@2xRGMkvYeuEyW6ssYRV$W{iB6ruc?k;777XhDvtLxCg(9dFEvZxN%}<6DSC;`;R8hVF<&pLM2`nb!n|hMu|jFgY++ zF@1B7BJ3@irr`ENBMJ_Wj*gxTQ*fDsTy&plfyON~EL6~*jQ(+c(eVB2Dz3?7Dwpi! ztGvCIv|4`qx>lAzTaDh|TjIB;F_+5q8fQiJW#4W}pMur4hlrCB?UQ2pa;wEdMTu-rw>!2(k`mYcE#m;Q^# z!R~haj4N|s)K)z&;kLHR8GmTVZYUH-Q1-2plhY#=tzcq#s|UZXJ$*nXlX0Vqs&9TH zU!;s4zmi3To&3r8WYP4Ne()M+K5g#P0@L;J@l?m5++FiaNCau?ImczRclRF7x8m8l z>gwwH_csxUL|122a3(dr;ojlb#IxIL2mf_@T0=4$$?tEfR>Eb}2czz%?CtFzvuGy6 zQB_h?oKz)nsw9Fbme2MXyXH{0BphmwJHemMXbbkj(GKRaw8yWUy?WOh7OW0AKg7c( zLa^=#OsQfk$w7~ojOU+%CUnvZW2Dd?%Bm)4@vgSsHD3qc!slwS92UZ>N) z_R0C;P5Q+E*o71YrDJ}sCngVg58t#2b^#xUzZ?hgyT5B=R*)fJuX_;!c{vv1H-&6UFaBoNJ(s zQKz8AxHcbkUOKt{z~KgGP6KtV1P<5egSS=+!{gIb5BLT|r#>6Ws44`-LP@Te&iha6 z=p+D6p4zz|Hq0=f2_3$HBffN(BP#+3OuyZ-C*36r=9m{Ny@s1UnSJQtX)x+(-Dwc) zKE&TD)~Ke9;0v|F#5!ogk9nbE#HD>;cm6N?KWM^72wlrU@dBevmR5)(I?J;qg2^+L zLjN6iD+1_DkdgjxSfCA^lM&tZqUqx#X>q01A<@@{&?nD{rgxe~%3YaJk&fOQRARej zf-hZli+wXso3%sXgayxjqF$Kq%Tn-^UrE<2SRGiR@=@=*J$>SxPYw*?XOb78`~4Wl z`r3m4&_2V|0Cj)=Zp9JVo;RFj4D~xToCX5u#q_YFTsGUqQLNXKwVtmuHMY*?E?;sh z67RGyOG?-+mP|_Ok7;3`#6$y{QS*$KF$@s0V0-w$1X>cVQ&Y?IZHkzlj`p7eW(st1opF4XfoH z2vF(;fx6F&gqh@(R9+ywHo~?U#QYzTG0*pWK7U??IhNHz6T<%qI(--%NGr9AGT6m+ zSG5$Q`oI)%Wx!Pmg_(MR5T+A=X&ibnN|4AmMG!w}>dRBl=fB(k3wOYcw=$N7ebv)U z=9px%oIg3K^niAYc+fK?)^$nAl=#C6hjW{&&EGDJ(Ol_pX9C1VB}BGG;J^3_=!8=B literal 2209 zcmeHJdsLEV9R5VSkQ8Pv%jHbd%;kmVQp*BU4DCW4b7h*ru=JEBT3VVYQkk?;OgqsE zrQ0bTLo{zF1YdcZV`-fdFsH03OEb|lykNqrK|eYGD^H;ZQHf65;B8 zXB(?7pFHn@d*8aYzMLLz`-^o-w%nqz9mg-e_Mjy#wz;q87M_VQ0pUl2aBMcaN}NY| zu2fPo5V!JQh)-3le%X3|imEFetXFh)9-@ZS3Izg26M4;4;7DJeQ*$Qqfr7_znUK>+ z!yS~0iC47@hA#%AmhhAwWj$i;I9K1T9pWnWPl(q%Wy9Q?BISYw3%nDQ<61Ds^%1E-LSea)-zIS_?CY_w{*9rcY0e?%4N- zy%&HJOj;gvsVUgB(Z1&^Dm7U29*WH#RHcU4+gTZ#M5T(7K%O3>nm#eylOfkX4%>I1 zFXKrl{2rRh(oL*kE&BanDaKTh5;eH>&`%;%Gu1#Pa*(o2*hGG!wc6~^kYN&C8}5d& z&!Y5*4rRD2t7>a)_(VxU#?tL}c6Lol{dkGyp#RBsqL?A)6KQF1-)oN|_P6hGXGvu& z^w&})R)US8{n%MEV<%KZNRl!$zl!$av`=r$h8I7Ixuuhus|(V{rrtfBo*0hyzScA~ zm9`;uPVMPY?tIrZz7T z9Y(9@^s7#Zr`+i`JP_>gL2CKXYoXvcP_~=PrP$6#AfHuT1f!klLPkEgQ(6rd4|t)x z2!?F(YDY4K;`vQJ=)ZlUN1QS3N*N4+fy^ghp~CZ# z5a~~_T0oSH8}dJc8URIs=+BWtQ3j3vpZ0Sj{P)`SFG{W3*G#TpFy7qe*gb(fy#(@f zZv-s8aSg$z+jG`6E9k%torZr(e7#56S*hJOEq*cj7r99*^ho zv$3Tq7{&4NsQ4f%L0ME(L}Gh*cxYWpvQDZWy&T)20@xBQ5r<=Ab@*N>xmydl`9({b zL-MS>A?LmQ1$Ct$7aqfQLO*k+FN!Nd)f8peOc;}HIwitB=@1GW2poq|avgUxVVYTD9;FVM^C zWK*QB&J#~uMp~p&g|a($rn_6W94?S*;dzYrV+Nz}=`JP=kAnq9$*of3()|d89n+6e zXS+0)X|#Sa%k_=h2W+DO{j=4AXu$C(n+s2KDl26y;6x|~q|FT6mB}BvW7tI@q>|u| z?f)*4M7n37R(}~(?JD!iG{_zRGcHtRKSrcFeEUqbcaBEWW*AK*dRtna)jBdzZUyx? z3r_giAo?UV3p|jv*w+YwObMAw$hHYEE`)^qBr^D8&5sL?1p>M4GMwNK@wD=-Fv#NY zk7Ng$7ydGAMn>m0{GM7YLBQ%Db!Y)2(?du5rcu1YduCAn`C!bTAxgQAIElf&I zu9{loZ)T5nE;jjq{rv`V`n0j8>VTj1&>w&0mNev`2f4V^iFkRSrCEP! Date: Sun, 8 Sep 2024 11:33:33 +1000 Subject: [PATCH 02/12] Fixed small RNG misusage (#4092) --- src/phases/attempt-run-phase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phases/attempt-run-phase.ts b/src/phases/attempt-run-phase.ts index 9cf86fed592..46d68f6005a 100644 --- a/src/phases/attempt-run-phase.ts +++ b/src/phases/attempt-run-phase.ts @@ -28,7 +28,7 @@ export class AttemptRunPhase extends PokemonPhase { applyAbAttrs(RunSuccessAbAttr, playerPokemon, null, false, escapeChance); - if (Utils.randSeedInt(100) < escapeChance.value) { + if (playerPokemon.randSeedInt(100) < escapeChance.value) { this.scene.playSound("se/flee"); this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500); From ffcedfd9a4b9f35ad61c035ebe22a494ecf45500 Mon Sep 17 00:00:00 2001 From: "Amani H." <109637146+xsn34kzx@users.noreply.github.com> Date: Sat, 7 Sep 2024 21:40:45 -0400 Subject: [PATCH 03/12] [Dev] Save Data Version Migration (#4080) * Initial Draft * Successfuly Migration with Vitamins and White Herb * Apply Session Data Patches Earlier * Remove Stray `console.log` --- src/system/game-data.ts | 138 ++++++-------------------------- src/system/modifier-data.ts | 10 +-- src/system/version-converter.ts | 137 +++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+), 120 deletions(-) create mode 100644 src/system/version-converter.ts diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 746af4d47a5..800b8baecff 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1,7 +1,7 @@ import i18next from "i18next"; import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon"; -import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions"; +import { pokemonPrevolutions } from "../data/pokemon-evolutions"; import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species"; import * as Utils from "../utils"; import Overrides from "#app/overrides"; @@ -27,7 +27,7 @@ import { Tutorial } from "../tutorial"; import { speciesEggMoves } from "../data/egg-moves"; import { allMoves } from "../data/move"; import { TrainerVariant } from "../field/trainer"; -import { Variant, variantData } from "#app/data/variant"; +import { Variant } from "#app/data/variant"; import {setSettingGamepad, SettingGamepad, settingGamepadDefaults} from "./settings/settings-gamepad"; import {setSettingKeyboard, SettingKeyboard} from "#app/system/settings/settings-keyboard"; import { TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; @@ -45,6 +45,7 @@ import { TerrainType } from "#app/data/terrain.js"; import { OutdatedPhase } from "#app/phases/outdated-phase.js"; import { ReloadSessionPhase } from "#app/phases/reload-session-phase.js"; import { RUN_HISTORY_LIMIT } from "#app/ui/run-history-ui-handler"; +import { applySessionDataPatches, applySettingsDataPatches, applySystemDataPatches } from "./version-converter"; export const defaultStarterSpecies: Species[] = [ Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, @@ -93,7 +94,7 @@ export function decrypt(data: string, bypassLogin: boolean): string { : (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8))(data); } -interface SystemSaveData { +export interface SystemSaveData { trainerId: integer; secretId: integer; gender: PlayerGender; @@ -456,17 +457,14 @@ export class GameData { localStorage.setItem(`data_${loggedInUser?.username}`, encrypt(systemDataStr, bypassLogin)); - /*const versions = [ this.scene.game.config.gameVersion, data.gameVersion || '0.0.0' ]; - - if (versions[0] !== versions[1]) { - const [ versionNumbers, oldVersionNumbers ] = versions.map(ver => ver.split('.').map(v => parseInt(v))); - }*/ const lsItemKey = `runHistoryData_${loggedInUser?.username}`; const lsItem = localStorage.getItem(lsItemKey); if (!lsItem) { localStorage.setItem(lsItemKey, ""); } + applySystemDataPatches(systemData); + this.trainerId = systemData.trainerId; this.secretId = systemData.secretId; @@ -474,9 +472,7 @@ export class GameData { this.saveSetting(SettingKeys.Player_Gender, systemData.gender === PlayerGender.FEMALE ? 1 : 0); - const initStarterData = !systemData.starterData; - - if (initStarterData) { + if (!systemData.starterData) { this.initStarterData(); if (systemData["starterMoveData"]) { @@ -494,25 +490,20 @@ export class GameData { } this.migrateStarterAbilities(systemData, this.starterData); - } else { - if ([ "1.0.0", "1.0.1" ].includes(systemData.gameVersion)) { - this.migrateStarterAbilities(systemData); - } - //this.fixVariantData(systemData); - this.fixStarterData(systemData); - // Migrate ability starter data if empty for caught species - Object.keys(systemData.starterData).forEach(sd => { - if (systemData.dexData[sd].caughtAttr && !systemData.starterData[sd].abilityAttr) { - systemData.starterData[sd].abilityAttr = 1; + + const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species); + for (const s of starterIds) { + this.starterData[s].candyCount += this.dexData[s].caughtCount; + this.starterData[s].candyCount += this.dexData[s].hatchedCount * 2; + if (this.dexData[s].caughtAttr & DexAttr.SHINY) { + this.starterData[s].candyCount += 4; } - }); + } + } else { this.starterData = systemData.starterData; } if (systemData.gameStats) { - if (systemData.gameStats.legendaryPokemonCaught !== undefined && systemData.gameStats.subLegendaryPokemonCaught === undefined) { - this.fixLegendaryStats(systemData); - } this.gameStats = systemData.gameStats; } @@ -558,17 +549,6 @@ export class GameData { this.consolidateDexData(this.dexData); this.defaultDexData = null; - if (initStarterData) { - const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species); - for (const s of starterIds) { - this.starterData[s].candyCount += this.dexData[s].caughtCount; - this.starterData[s].candyCount += this.dexData[s].hatchedCount * 2; - if (this.dexData[s].caughtAttr & DexAttr.SHINY) { - this.starterData[s].candyCount += 4; - } - } - } - resolve(true); } catch (err) { console.error(err); @@ -747,6 +727,7 @@ export class GameData { setSetting(this.scene, setting, valueIndex); settings[setting] = valueIndex; + settings["gameVersion"] = this.scene.game.config.gameVersion; localStorage.setItem("settings", JSON.stringify(settings)); @@ -857,13 +838,7 @@ export class GameData { const settings = JSON.parse(localStorage.getItem("settings")!); // TODO: is this bang correct? - // TODO: Remove this block after save migration is implemented - if (settings.hasOwnProperty("REROLL_TARGET") && !settings.hasOwnProperty(SettingKeys.Shop_Cursor_Target)) { - settings[SettingKeys.Shop_Cursor_Target] = settings["REROLL_TARGET"]; - delete settings["REROLL_TARGET"]; - localStorage.setItem("settings", JSON.stringify(settings)); - } - // End of block to remove + applySettingsDataPatches(settings); for (const setting of Object.keys(settings)) { setSetting(this.scene, setting, settings[setting]); @@ -1226,7 +1201,7 @@ export class GameData { } parseSessionData(dataStr: string): SessionSaveData { - return JSON.parse(dataStr, (k: string, v: any) => { + const sessionData = JSON.parse(dataStr, (k: string, v: any) => { /*const versions = [ scene.game.config.gameVersion, sessionData.gameVersion || '0.0.0' ]; if (versions[0] !== versions[1]) { @@ -1283,6 +1258,10 @@ export class GameData { return v; }) as SessionSaveData; + + applySessionDataPatches(sessionData); + + return sessionData; } saveAll(scene: BattleScene, skipVerification: boolean = false, sync: boolean = false, useCachedSession: boolean = false, useCachedSystem: boolean = false): Promise { @@ -1885,75 +1864,4 @@ export class GameData { } } } - - fixVariantData(systemData: SystemSaveData): void { - const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species); - const starterData = systemData.starterData; - const dexData = systemData.dexData; - if (starterIds.find(id => (dexData[id].caughtAttr & DexAttr.VARIANT_2 || dexData[id].caughtAttr & DexAttr.VARIANT_3) && !variantData[id])) { - for (const s of starterIds) { - const species = getPokemonSpecies(s); - if (variantData[s]) { - const tempCaughtAttr = dexData[s].caughtAttr; - let seenVariant2 = false; - let seenVariant3 = false; - const checkEvoSpecies = (es: Species) => { - seenVariant2 ||= !!(dexData[es].seenAttr & DexAttr.VARIANT_2); - seenVariant3 ||= !!(dexData[es].seenAttr & DexAttr.VARIANT_3); - if (pokemonEvolutions.hasOwnProperty(es)) { - for (const pe of pokemonEvolutions[es]) { - checkEvoSpecies(pe.speciesId); - } - } - }; - checkEvoSpecies(s); - if (dexData[s].caughtAttr & DexAttr.VARIANT_2 && !seenVariant2) { - dexData[s].caughtAttr ^= DexAttr.VARIANT_2; - } - if (dexData[s].caughtAttr & DexAttr.VARIANT_3 && !seenVariant3) { - dexData[s].caughtAttr ^= DexAttr.VARIANT_3; - } - starterData[s].abilityAttr = (tempCaughtAttr & DexAttr.DEFAULT_VARIANT ? AbilityAttr.ABILITY_1 : 0) - | (tempCaughtAttr & DexAttr.VARIANT_2 && species.ability2 ? AbilityAttr.ABILITY_2 : 0) - | (tempCaughtAttr & DexAttr.VARIANT_3 && species.abilityHidden ? AbilityAttr.ABILITY_HIDDEN : 0); - } else { - const tempCaughtAttr = dexData[s].caughtAttr; - if (dexData[s].caughtAttr & DexAttr.VARIANT_2) { - dexData[s].caughtAttr ^= DexAttr.VARIANT_2; - } - if (dexData[s].caughtAttr & DexAttr.VARIANT_3) { - dexData[s].caughtAttr ^= DexAttr.VARIANT_3; - } - starterData[s].abilityAttr = (tempCaughtAttr & DexAttr.DEFAULT_VARIANT ? AbilityAttr.ABILITY_1 : 0) - | (tempCaughtAttr & DexAttr.VARIANT_2 && species.ability2 ? AbilityAttr.ABILITY_2 : 0) - | (tempCaughtAttr & DexAttr.VARIANT_3 && species.abilityHidden ? AbilityAttr.ABILITY_HIDDEN : 0); - } - } - } - } - - fixStarterData(systemData: SystemSaveData): void { - for (const starterId of defaultStarterSpecies) { - systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1; - systemData.dexData[starterId].caughtAttr |= DexAttr.FEMALE; - } - } - - fixLegendaryStats(systemData: SystemSaveData): void { - systemData.gameStats.subLegendaryPokemonSeen = 0; - systemData.gameStats.subLegendaryPokemonCaught = 0; - systemData.gameStats.subLegendaryPokemonHatched = 0; - allSpecies.filter(s => s.subLegendary).forEach(s => { - const dexEntry = systemData.dexData[s.speciesId]; - systemData.gameStats.subLegendaryPokemonSeen += dexEntry.seenCount; - systemData.gameStats.legendaryPokemonSeen = Math.max(systemData.gameStats.legendaryPokemonSeen - dexEntry.seenCount, 0); - systemData.gameStats.subLegendaryPokemonCaught += dexEntry.caughtCount; - systemData.gameStats.legendaryPokemonCaught = Math.max(systemData.gameStats.legendaryPokemonCaught - dexEntry.caughtCount, 0); - systemData.gameStats.subLegendaryPokemonHatched += dexEntry.hatchedCount; - systemData.gameStats.legendaryPokemonHatched = Math.max(systemData.gameStats.legendaryPokemonHatched - dexEntry.hatchedCount, 0); - }); - systemData.gameStats.subLegendaryPokemonSeen = Math.max(systemData.gameStats.subLegendaryPokemonSeen, systemData.gameStats.subLegendaryPokemonCaught); - systemData.gameStats.legendaryPokemonSeen = Math.max(systemData.gameStats.legendaryPokemonSeen, systemData.gameStats.legendaryPokemonCaught); - systemData.gameStats.mythicalPokemonSeen = Math.max(systemData.gameStats.mythicalPokemonSeen, systemData.gameStats.mythicalPokemonCaught); - } } diff --git a/src/system/modifier-data.ts b/src/system/modifier-data.ts index 0f3e28fe11c..1514f7e3fb3 100644 --- a/src/system/modifier-data.ts +++ b/src/system/modifier-data.ts @@ -3,11 +3,11 @@ import { PersistentModifier } from "../modifier/modifier"; import { GeneratedPersistentModifierType, ModifierType, ModifierTypeGenerator, getModifierTypeFuncById } from "../modifier/modifier-type"; export default class ModifierData { - private player: boolean; - private typeId: string; - private typePregenArgs: any[]; - private args: any[]; - private stackCount: integer; + public player: boolean; + public typeId: string; + public typePregenArgs: any[]; + public args: any[]; + public stackCount: integer; public className: string; diff --git a/src/system/version-converter.ts b/src/system/version-converter.ts new file mode 100644 index 00000000000..ed65fcd99b8 --- /dev/null +++ b/src/system/version-converter.ts @@ -0,0 +1,137 @@ +import { allSpecies } from "#app/data/pokemon-species.js"; +import { AbilityAttr, defaultStarterSpecies, DexAttr, SessionSaveData, SystemSaveData } from "./game-data"; +import { SettingKeys } from "./settings/settings"; + +const LATEST_VERSION = "1.0.5"; + +export function applySessionDataPatches(data: SessionSaveData) { + const curVersion = data.gameVersion; + if (curVersion !== LATEST_VERSION) { + switch (curVersion) { + case "1.0.0": + case "1.0.1": + case "1.0.2": + case "1.0.3": + case "1.0.4": + // --- PATCHES --- + + // Fix Battle Items, Vitamins, and Lures + data.modifiers.forEach((m) => { + if (m.className === "PokemonBaseStatModifier") { + m.className = "BaseStatModifier"; + } else if (m.className === "PokemonResetNegativeStatStageModifier") { + m.className = "ResetNegativeStatStageModifier"; + } else if (m.className === "TempBattleStatBoosterModifier") { + m.className = "TempStatStageBoosterModifier"; + m.typeId = "TEMP_STAT_STAGE_BOOSTER"; + + // Migration from TempBattleStat to Stat + const newStat = m.typePregenArgs[0] + 1; + m.typePregenArgs[0] = newStat; + + // From [ stat, battlesLeft ] to [ stat, maxBattles, battleCount ] + m.args = [ newStat, 5, m.args[1] ]; + } else if (m.className === "DoubleBattleChanceBoosterModifier") { + let maxBattles: number; + switch (m.typeId) { + case "MAX_LURE": + maxBattles = 30; + break; + case "SUPER_LURE": + maxBattles = 15; + break; + default: + maxBattles = 10; + break; + } + + // From [ battlesLeft ] to [ maxBattles, battleCount ] + m.args = [ maxBattles, m.args[0] ]; + } + }); + + data.enemyModifiers.forEach((m) => { + if (m.className === "PokemonBaseStatModifier") { + m.className = "BaseStatModifier"; + } + }); + } + + data.gameVersion = LATEST_VERSION; + } +} + +export function applySystemDataPatches(data: SystemSaveData) { + const curVersion = data.gameVersion; + if (curVersion !== LATEST_VERSION) { + switch (curVersion) { + case "1.0.0": + case "1.0.1": + case "1.0.2": + case "1.0.3": + case "1.0.4": + // --- LEGACY PATCHES --- + if (data.starterData) { + // Migrate ability starter data if empty for caught species + Object.keys(data.starterData).forEach(sd => { + if (data.dexData[sd].caughtAttr && !data.starterData[sd].abilityAttr) { + data.starterData[sd].abilityAttr = 1; + } + }); + } + + // Fix Legendary Stats + if (data.gameStats && (data.gameStats.legendaryPokemonCaught !== undefined && data.gameStats.subLegendaryPokemonCaught === undefined)) { + data.gameStats.subLegendaryPokemonSeen = 0; + data.gameStats.subLegendaryPokemonCaught = 0; + data.gameStats.subLegendaryPokemonHatched = 0; + allSpecies.filter(s => s.subLegendary).forEach(s => { + const dexEntry = data.dexData[s.speciesId]; + data.gameStats.subLegendaryPokemonSeen += dexEntry.seenCount; + data.gameStats.legendaryPokemonSeen = Math.max(data.gameStats.legendaryPokemonSeen - dexEntry.seenCount, 0); + data.gameStats.subLegendaryPokemonCaught += dexEntry.caughtCount; + data.gameStats.legendaryPokemonCaught = Math.max(data.gameStats.legendaryPokemonCaught - dexEntry.caughtCount, 0); + data.gameStats.subLegendaryPokemonHatched += dexEntry.hatchedCount; + data.gameStats.legendaryPokemonHatched = Math.max(data.gameStats.legendaryPokemonHatched - dexEntry.hatchedCount, 0); + }); + data.gameStats.subLegendaryPokemonSeen = Math.max(data.gameStats.subLegendaryPokemonSeen, data.gameStats.subLegendaryPokemonCaught); + data.gameStats.legendaryPokemonSeen = Math.max(data.gameStats.legendaryPokemonSeen, data.gameStats.legendaryPokemonCaught); + data.gameStats.mythicalPokemonSeen = Math.max(data.gameStats.mythicalPokemonSeen, data.gameStats.mythicalPokemonCaught); + } + + // --- PATCHES --- + + // Fix Starter Data + if (data.gameVersion) { + for (const starterId of defaultStarterSpecies) { + data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1; + data.dexData[starterId].caughtAttr |= DexAttr.FEMALE; + } + } + } + + data.gameVersion = LATEST_VERSION; + } +} + +export function applySettingsDataPatches(settings: Object) { + const curVersion = settings.hasOwnProperty("gameVersion") ? settings["gameVersion"] : "1.0.0"; + if (curVersion !== LATEST_VERSION) { + switch (curVersion) { + case "1.0.0": + case "1.0.1": + case "1.0.2": + case "1.0.3": + case "1.0.4": + // --- PATCHES --- + + // Fix Reward Cursor Target + if (settings.hasOwnProperty("REROLL_TARGET") && !settings.hasOwnProperty(SettingKeys.Shop_Cursor_Target)) { + settings[SettingKeys.Shop_Cursor_Target] = settings["REROLL_TARGET"]; + delete settings["REROLL_TARGET"]; + localStorage.setItem("settings", JSON.stringify(settings)); + } + } + // Note that the current game version will be written at `saveSettings` + } +} From f73a830f7749b8289edc282e55dccd5305c772c8 Mon Sep 17 00:00:00 2001 From: DustinLin <39450497+DustinLin@users.noreply.github.com> Date: Sat, 7 Sep 2024 21:36:47 -0700 Subject: [PATCH 04/12] [DOCS] adding JSDocs to `arena.ts` (#3590) * adding some docs * Update src/field/pokemon.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * seems like battleStats changed to statStages * Apply suggestions from code review editing doc text Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Update tsdocs, convert comment to tsdoc in `pokemon.ts` --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> --- src/field/arena.ts | 58 ++++++++++++++++++++++++++++++++++++++++---- src/field/pokemon.ts | 1 + 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/field/arena.ts b/src/field/arena.ts index e8defbd1a8e..5b167791769 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -60,7 +60,7 @@ export class Arena { this.scene.arenaBg.setTexture(`${biomeKey}_bg`); this.scene.arenaBgTransition.setTexture(`${biomeKey}_bg`); - // Redo this on initialise because during save/load the current wave isn't always + // Redo this on initialize because during save/load the current wave isn't always // set correctly during construction this.updatePoolsForTimeOfDay(); } @@ -289,7 +289,7 @@ export class Arena { /** * Sets weather to the override specified in overrides.ts - * @param weather new weather to set of type WeatherType + * @param weather new {@linkcode WeatherType} to set * @returns true to force trySetWeather to return true */ trySetWeatherOverride(weather: WeatherType): boolean { @@ -301,8 +301,8 @@ export class Arena { /** * Attempts to set a new weather to the battle - * @param weather new weather to set of type WeatherType - * @param hasPokemonSource is the new weather from a pokemon + * @param weather {@linkcode WeatherType} new {@linkcode WeatherType} to set + * @param hasPokemonSource boolean if the new weather is from a pokemon * @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use */ trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean { @@ -573,6 +573,12 @@ export class Arena { this.ignoreAbilities = ignoreAbilities; } + /** + * Applies each `ArenaTag` in this Arena, based on which side (self, enemy, or both) is passed in as a parameter + * @param tagType Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply + * @param side {@linkcode ArenaTagSide} which side's arena tags to apply + * @param args array of parameters that the called upon tags may need + */ applyTagsForSide(tagType: ArenaTagType | Constructor, side: ArenaTagSide, ...args: unknown[]): void { let tags = typeof tagType === "string" ? this.tags.filter(t => t.tagType === tagType) @@ -583,11 +589,28 @@ export class Arena { tags.forEach(t => t.apply(this, args)); } + /** + * Applies the specified tag to both sides (ie: both user and trainer's tag that match the Tag specified) + * by calling {@linkcode applyTagsForSide()} + * @param tagType Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply + * @param args array of parameters that the called upon tags may need + */ applyTags(tagType: ArenaTagType | Constructor, ...args: unknown[]): void { this.applyTagsForSide(tagType, ArenaTagSide.BOTH, ...args); } - addTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves | undefined, sourceId: integer, side: ArenaTagSide = ArenaTagSide.BOTH, quiet: boolean = false, targetIndex?: BattlerIndex): boolean { + /** + * Adds a new tag to the arena + * @param tagType {@linkcode ArenaTagType} the tag being added + * @param turnCount How many turns the tag lasts + * @param sourceMove {@linkcode Moves} the move the tag came from, or `undefined` if not from a move + * @param sourceId The ID of the pokemon in play the tag came from (see {@linkcode BattleScene.getPokemonById}) + * @param side {@linkcode ArenaTagSide} which side(s) the tag applies to + * @param quiet If a message should be queued on screen to announce the tag being added + * @param targetIndex The {@linkcode BattlerIndex} of the target pokemon + * @returns `false` if there already exists a tag of this type in the Arena + */ + addTag(tagType: ArenaTagType, turnCount: number, sourceMove: Moves | undefined, sourceId: number, side: ArenaTagSide = ArenaTagSide.BOTH, quiet: boolean = false, targetIndex?: BattlerIndex): boolean { const existingTag = this.getTagOnSide(tagType, side); if (existingTag) { existingTag.onOverlap(this); @@ -600,6 +623,7 @@ export class Arena { return false; } + // creates a new tag object const newTag = getArenaTag(tagType, turnCount || 0, sourceMove, sourceId, targetIndex, side); if (newTag) { this.tags.push(newTag); @@ -613,6 +637,11 @@ export class Arena { return true; } + /** + * Attempts to get a tag from the Arena via {@linkcode getTagOnSide} that applies to both sides + * @param tagType The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get + * @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there + */ getTag(tagType: ArenaTagType | Constructor): ArenaTag | undefined { return this.getTagOnSide(tagType, ArenaTagSide.BOTH); } @@ -621,16 +650,35 @@ export class Arena { return !!this.getTag(tagType); } + /** + * Attempts to get a tag from the Arena from a specific side (the tag passed in has to either apply to both sides, or the specific side only) + * + * eg: `MIST` only applies to the user's side, while `MUD_SPORT` applies to both user and enemy side + * @param tagType The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get + * @param side The {@linkcode ArenaTagSide} to look at + * @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there + */ getTagOnSide(tagType: ArenaTagType | Constructor, side: ArenaTagSide): ArenaTag | undefined { return typeof(tagType) === "string" ? this.tags.find(t => t.tagType === tagType && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side)) : this.tags.find(t => t instanceof tagType && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side)); } + /** + * Uses {@linkcode findTagsOnSide} to filter (using the parameter function) for specific tags that apply to both sides + * @param tagPredicate a function mapping {@linkcode ArenaTag}s to `boolean`s + * @returns array of {@linkcode ArenaTag}s from which the Arena's tags return true and apply to both sides + */ findTags(tagPredicate: (t: ArenaTag) => boolean): ArenaTag[] { return this.findTagsOnSide(tagPredicate, ArenaTagSide.BOTH); } + /** + * Returns specific tags from the arena that pass the `tagPredicate` function passed in as a parameter, and apply to the given side + * @param tagPredicate a function mapping {@linkcode ArenaTag}s to `boolean`s + * @param side The {@linkcode ArenaTagSide} to look at + * @returns array of {@linkcode ArenaTag}s from which the Arena's tags return `true` and apply to the given side + */ findTagsOnSide(tagPredicate: (t: ArenaTag) => boolean, side: ArenaTagSide): ArenaTag[] { return this.tags.filter(t => tagPredicate(t) && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side)); } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f522d50f357..35a33907850 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4501,6 +4501,7 @@ export interface AttackMoveResult { } export class PokemonSummonData { + /** [Atk, Def, SpAtk, SpDef, Spd, Acc, Eva] */ public statStages: number[] = [ 0, 0, 0, 0, 0, 0, 0 ]; public moveQueue: QueuedMove[] = []; public tags: BattlerTag[] = []; From 2fc3179bd90dfd8929ee1f1ff765f0075915d945 Mon Sep 17 00:00:00 2001 From: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> Date: Sun, 8 Sep 2024 13:37:14 +0900 Subject: [PATCH 05/12] [Bug] Fix scrappy (+ some immunity move and ability) in inverse battle (#4067) * fix scrappy + etc. update inverse battle test code * update test code following request from swain --- src/field/pokemon.ts | 12 +- src/test/battle/inverse_battle.test.ts | 155 +++++++++++++++++++------ 2 files changed, 126 insertions(+), 41 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 35a33907850..863b0f41d2c 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1427,22 +1427,26 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } let multiplier = types.map(defType => { + const multiplier = new Utils.NumberHolder(getTypeDamageMultiplier(moveType, defType)); + applyChallenges(this.scene.gameMode, ChallengeType.TYPE_EFFECTIVENESS, multiplier); if (source) { const ignoreImmunity = new Utils.BooleanHolder(false); if (source.isActive(true) && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) { applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, simulated, moveType, defType); } if (ignoreImmunity.value) { - return 1; + if (multiplier.value === 0) { + return 1; + } } const exposedTags = this.findTags(tag => tag instanceof ExposedTag) as ExposedTag[]; if (exposedTags.some(t => t.ignoreImmunity(defType, moveType))) { - return 1; + if (multiplier.value === 0) { + return 1; + } } } - const multiplier = new Utils.NumberHolder(getTypeDamageMultiplier(moveType, defType)); - applyChallenges(this.scene.gameMode, ChallengeType.TYPE_EFFECTIVENESS, multiplier); return multiplier.value; }).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier; diff --git a/src/test/battle/inverse_battle.test.ts b/src/test/battle/inverse_battle.test.ts index be8b04155eb..2a561a09e5e 100644 --- a/src/test/battle/inverse_battle.test.ts +++ b/src/test/battle/inverse_battle.test.ts @@ -1,8 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/move"; import { Type } from "#app/data/type"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { Challenges } from "#enums/challenges"; @@ -11,7 +8,8 @@ import { Species } from "#enums/species"; import { StatusEffect } from "#enums/status-effect"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const TIMEOUT = 20 * 1000; @@ -39,43 +37,63 @@ describe("Inverse Battle", () => { .starterSpecies(Species.FEEBAS) .ability(Abilities.BALL_FETCH) .enemySpecies(Species.MAGIKARP) - .enemyAbility(Abilities.BALL_FETCH); + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(SPLASH_ONLY); }); - it("1. immune types are 2x effective - Thunderbolt against Ground Type", async () => { - game.override.enemySpecies(Species.SANDSHREW); + it("Immune types are 2x effective - Thunderbolt against Ground Type", async () => { + game.override + .moveset([Moves.THUNDERBOLT]) + .enemySpecies(Species.SANDSHREW); + await game.challengeMode.startBattle(); - const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); - expect(enemy.getMoveEffectiveness(player, allMoves[Moves.THUNDERBOLT])).toBe(2); + game.move.select(Moves.THUNDERBOLT); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveLastReturnedWith(2); }, TIMEOUT); - it("2. 2x effective types are 0.5x effective - Thunderbolt against Flying Type", async () => { - game.override.enemySpecies(Species.PIDGEY); + it("2x effective types are 0.5x effective - Thunderbolt against Flying Type", async () => { + game.override + .moveset([Moves.THUNDERBOLT]) + .enemySpecies(Species.PIDGEY); await game.challengeMode.startBattle(); - const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); - expect(enemy.getMoveEffectiveness(player, allMoves[Moves.THUNDERBOLT])).toBe(0.5); + game.move.select(Moves.THUNDERBOLT); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveLastReturnedWith(0.5); }, TIMEOUT); - it("3. 0.5x effective types are 2x effective - Thunderbolt against Electric Type", async () => { - game.override.enemySpecies(Species.CHIKORITA); + it("0.5x effective types are 2x effective - Thunderbolt against Electric Type", async () => { + game.override + .moveset([Moves.THUNDERBOLT]) + .enemySpecies(Species.CHIKORITA); await game.challengeMode.startBattle(); - const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); - expect(enemy.getMoveEffectiveness(player, allMoves[Moves.THUNDERBOLT])).toBe(2); + game.move.select(Moves.THUNDERBOLT); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveLastReturnedWith(2); }, TIMEOUT); - it("4. Stealth Rock follows the inverse matchups - Stealth Rock against Charizard deals 1/32 of max HP", async () => { + it("Stealth Rock follows the inverse matchups - Stealth Rock against Charizard deals 1/32 of max HP", async () => { game.scene.arena.addTag(ArenaTagType.STEALTH_ROCK, 1, Moves.STEALTH_ROCK, 0); game.override .enemySpecies(Species.CHARIZARD) @@ -95,18 +113,24 @@ describe("Inverse Battle", () => { expect(currentHp).toBeGreaterThan(maxHp * 31 / 32 - 1); }, TIMEOUT); - it("5. Freeze Dry is 2x effective against Water Type like other Ice type Move - Freeze Dry against Squirtle", async () => { - game.override.enemySpecies(Species.SQUIRTLE); + it("Freeze Dry is 2x effective against Water Type like other Ice type Move - Freeze Dry against Squirtle", async () => { + game.override + .moveset([Moves.FREEZE_DRY]) + .enemySpecies(Species.SQUIRTLE); await game.challengeMode.startBattle(); - const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); - expect(enemy.getMoveEffectiveness(player, allMoves[Moves.FREEZE_DRY])).toBe(2); + game.move.select(Moves.FREEZE_DRY); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveLastReturnedWith(2); }, TIMEOUT); - it("6. Water Absorb should heal against water moves - Water Absorb against Water gun", async () => { + it("Water Absorb should heal against water moves - Water Absorb against Water gun", async () => { game.override .moveset([Moves.WATER_GUN]) .enemyAbility(Abilities.WATER_ABSORB); @@ -117,13 +141,12 @@ describe("Inverse Battle", () => { enemy.hp = enemy.getMaxHp() - 1; game.move.select(Moves.WATER_GUN); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); - - await game.phaseInterceptor.to(MoveEndPhase); + await game.phaseInterceptor.to("MoveEndPhase"); expect(enemy.hp).toBe(enemy.getMaxHp()); }, TIMEOUT); - it("7. Fire type does not get burned - Will-O-Wisp against Charmander", async () => { + it("Fire type does not get burned - Will-O-Wisp against Charmander", async () => { game.override .moveset([Moves.WILL_O_WISP]) .enemySpecies(Species.CHARMANDER); @@ -135,13 +158,12 @@ describe("Inverse Battle", () => { game.move.select(Moves.WILL_O_WISP); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.move.forceHit(); - - await game.phaseInterceptor.to(MoveEndPhase); + await game.phaseInterceptor.to("MoveEndPhase"); expect(enemy.status?.effect).not.toBe(StatusEffect.BURN); }, TIMEOUT); - it("8. Electric type does not get paralyzed - Nuzzle against Pikachu", async () => { + it("Electric type does not get paralyzed - Nuzzle against Pikachu", async () => { game.override .moveset([Moves.NUZZLE]) .enemySpecies(Species.PIKACHU) @@ -153,14 +175,30 @@ describe("Inverse Battle", () => { game.move.select(Moves.NUZZLE); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); - - await game.phaseInterceptor.to(MoveEndPhase); + await game.phaseInterceptor.to("MoveEndPhase"); expect(enemy.status?.effect).not.toBe(StatusEffect.PARALYSIS); }, TIMEOUT); + it("Ground type is not immune to Thunder Wave - Thunder Wave against Sandshrew", async () => { + game.override + .moveset([Moves.THUNDER_WAVE]) + .enemySpecies(Species.SANDSHREW); - it("10. Anticipation should trigger on 2x effective moves - Anticipation against Thunderbolt", async () => { + await game.challengeMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.THUNDER_WAVE); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.move.forceHit(); + await game.phaseInterceptor.to("MoveEndPhase"); + + expect(enemy.status?.effect).toBe(StatusEffect.PARALYSIS); + }, TIMEOUT); + + + it("Anticipation should trigger on 2x effective moves - Anticipation against Thunderbolt", async () => { game.override .moveset([Moves.THUNDERBOLT]) .enemySpecies(Species.SANDSHREW) @@ -171,7 +209,7 @@ describe("Inverse Battle", () => { expect(game.scene.getEnemyPokemon()?.summonData.abilitiesApplied[0]).toBe(Abilities.ANTICIPATION); }, TIMEOUT); - it("11. Conversion 2 should change the type to the resistive type - Conversion 2 against Dragonite", async () => { + it("Conversion 2 should change the type to the resistive type - Conversion 2 against Dragonite", async () => { game.override .moveset([Moves.CONVERSION_2]) .enemyMoveset([Moves.DRAGON_CLAW, Moves.DRAGON_CLAW, Moves.DRAGON_CLAW, Moves.DRAGON_CLAW]); @@ -183,21 +221,64 @@ describe("Inverse Battle", () => { game.move.select(Moves.CONVERSION_2); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(player.getTypes()[0]).toBe(Type.DRAGON); }, TIMEOUT); - it("12. Flying Press should be 0.25x effective against Grass + Dark Type - Flying Press against Meowscarada", async () => { + it("Flying Press should be 0.25x effective against Grass + Dark Type - Flying Press against Meowscarada", async () => { game.override .moveset([Moves.FLYING_PRESS]) .enemySpecies(Species.MEOWSCARADA); await game.challengeMode.startBattle(); - const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); - expect(enemy.getMoveEffectiveness(player, allMoves[Moves.FLYING_PRESS])).toBe(0.25); + game.move.select(Moves.FLYING_PRESS); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveLastReturnedWith(0.25); + }, TIMEOUT); + + it("Scrappy ability has no effect - Tackle against Ghost Type still 2x effective with Scrappy", async () => { + game.override + .moveset([Moves.TACKLE]) + .ability(Abilities.SCRAPPY) + .enemySpecies(Species.GASTLY); + + await game.challengeMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.TACKLE); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveLastReturnedWith(2); + }, TIMEOUT); + + it("FORESIGHT has no effect - Tackle against Ghost Type still 2x effective with Foresight", async () => { + game.override + .moveset([Moves.FORESIGHT, Moves.TACKLE]) + .enemySpecies(Species.GASTLY); + + await game.challengeMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.FORESIGHT); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to("TurnEndPhase"); + + game.move.select(Moves.TACKLE); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveLastReturnedWith(2); }, TIMEOUT); }); From 2bd07cb84e02d51345a4e2c85543b023a35bdec7 Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Sat, 7 Sep 2024 21:37:37 -0700 Subject: [PATCH 06/12] fix and optimize imports (#4061) - remove any `.js` extension imports - remove unncessary dynamic imports of `modifier.ts` file. The file was being imported statically & dynamically. Made it pure static - increase vite chunk-size warning limit Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com> --- src/@types/common.ts | 2 +- src/@types/i18next.d.ts | 2 +- src/battle-scene.ts | 2 +- src/configs/inputs/pad_procon.ts | 2 +- src/data/challenge.ts | 14 ++++---- src/data/egg.ts | 2 +- src/data/pokemon-forms.ts | 2 +- src/data/terrain.ts | 2 +- src/data/variant.ts | 2 +- src/events/arena.ts | 6 ++-- src/inputs-controller.ts | 2 +- src/main.ts | 4 +-- src/modifier/modifier-type.ts | 2 +- src/modifier/modifier.ts | 6 ++-- src/phases/add-enemy-buff-modifier-phase.ts | 10 +++--- src/phases/attempt-capture-phase.ts | 28 +++++++-------- src/phases/battle-end-phase.ts | 4 +-- src/phases/battle-phase.ts | 6 ++-- src/phases/berry-phase.ts | 12 +++---- src/phases/check-switch-phase.ts | 10 +++--- src/phases/common-anim-phase.ts | 6 ++-- src/phases/damage-phase.ts | 10 +++--- src/phases/end-card-phase.ts | 8 ++--- src/phases/end-evolution-phase.ts | 6 ++-- .../enemy-party-member-pokemon-phase.ts | 4 +-- src/phases/exp-phase.ts | 8 ++--- src/phases/field-phase.ts | 2 +- src/phases/game-over-modifier-reward-phase.ts | 6 ++-- src/phases/hide-party-exp-bar-phase.ts | 2 +- src/phases/learn-move-phase.ts | 18 +++++----- src/phases/level-cap-phase.ts | 4 +-- src/phases/level-up-phase.ts | 14 ++++---- src/phases/login-phase.ts | 12 +++---- src/phases/message-phase.ts | 4 +-- src/phases/modifier-reward-phase.ts | 4 +-- src/phases/money-reward-phase.ts | 8 ++--- src/phases/move-anim-test-phase.ts | 10 +++--- src/phases/move-effect-phase.ts | 28 +++++++-------- src/phases/move-end-phase.ts | 6 ++-- src/phases/move-header-phase.ts | 6 ++-- src/phases/move-phase.ts | 36 +++++++++---------- src/phases/new-biome-encounter-phase.ts | 6 ++-- src/phases/next-encounter-phase.ts | 2 +- src/phases/obtain-status-effect-phase.ts | 14 ++++---- src/phases/outdated-phase.ts | 6 ++-- src/phases/party-heal-phase.ts | 4 +-- src/phases/party-member-pokemon-phase.ts | 4 +-- src/phases/party-status-cure-phase.ts | 6 ++-- .../player-party-member-pokemon-phase.ts | 4 +-- src/phases/pokemon-heal-phase.ts | 20 +++++------ src/phases/pokemon-phase.ts | 6 ++-- src/phases/post-game-over-phase.ts | 4 +-- src/phases/post-summon-phase.ts | 10 +++--- src/phases/post-turn-status-effect-phase.ts | 18 +++++----- src/phases/quiet-form-change-phase.ts | 14 ++++---- src/phases/reload-session-phase.ts | 8 ++--- src/phases/return-phase.ts | 4 +-- src/phases/ribbon-modifier-reward-phase.ts | 8 ++--- src/phases/scan-ivs-phase.ts | 14 ++++---- src/phases/select-biome-phase.ts | 14 ++++---- src/phases/select-challenge-phase.ts | 6 ++-- src/phases/select-gender-phase.ts | 10 +++--- src/phases/select-modifier-phase.ts | 16 ++++----- src/phases/select-starter-phase.ts | 24 ++++++------- src/phases/select-target-phase.ts | 8 ++--- src/phases/shiny-sparkle-phase.ts | 4 +-- src/phases/show-ability-phase.ts | 4 +-- src/phases/show-party-exp-bar-phase.ts | 8 ++--- src/phases/show-trainer-phase.ts | 4 +-- src/phases/summon-missing-phase.ts | 4 +-- src/phases/summon-phase.ts | 18 +++++----- src/phases/switch-biome-phase.ts | 6 ++-- src/phases/switch-phase.ts | 6 ++-- src/phases/switch-summon-phase.ts | 20 +++++------ src/phases/test-message-phase.ts | 2 +- src/phases/title-phase.ts | 34 +++++++++--------- src/phases/toggle-double-position-phase.ts | 4 +-- src/phases/trainer-message-test-phase.ts | 6 ++-- src/phases/trainer-victory-phase.ts | 12 +++---- src/phases/turn-end-phase.ts | 18 +++++----- src/phases/turn-init-phase.ts | 8 ++--- src/phases/unavailable-phase.ts | 6 ++-- src/phases/unlock-phase.ts | 8 ++--- src/phases/victory-phase.ts | 10 +++--- src/phases/weather-effect-phase.ts | 2 +- src/plugins/i18n.ts | 22 ++++++------ src/system/arena-data.ts | 2 +- src/system/challenge-data.ts | 2 +- src/system/egg-data.ts | 2 +- src/system/game-data.ts | 24 ++++++------- src/system/settings/settings.ts | 2 +- src/system/voucher.ts | 4 +-- src/test/abilities/tera_shell.test.ts | 2 +- src/test/battle/damage_calculation.test.ts | 2 +- src/test/moves/gigaton_hammer.test.ts | 2 +- src/test/moves/lunar_blessing.test.ts | 4 +-- src/test/utils/helpers/overridesHelper.ts | 10 +++--- src/test/utils/testUtils.ts | 2 +- src/ui/ability-bar.ts | 2 +- src/ui/admin-ui-handler.ts | 4 +-- src/ui/arena-flyout.ts | 10 +++--- src/ui/ball-ui-handler.ts | 2 +- src/ui/battle-flyout.ts | 6 ++-- src/ui/command-ui-handler.ts | 4 +-- src/ui/dropdown.ts | 4 +-- src/ui/egg-counter-container.ts | 4 +-- src/ui/egg-hatch-scene-handler.ts | 2 +- src/ui/fight-ui-handler.ts | 6 ++-- src/ui/filter-bar.ts | 2 +- src/ui/party-ui-handler.ts | 8 ++--- src/ui/rename-form-ui-handler.ts | 2 +- src/ui/run-info-ui-handler.ts | 15 ++++---- src/ui/save-slot-select-ui-handler.ts | 8 ++--- .../settings/abstract-settings-ui-handler.ts | 2 +- .../settings/move-touch-controls-handler.ts | 4 +-- src/ui/settings/navigationMenu.ts | 2 +- src/ui/settings/settings-audio-ui-handler.ts | 2 +- .../settings/settings-display-ui-handler.ts | 2 +- .../settings/settings-gamepad-ui-handler.ts | 2 +- .../settings/settings-keyboard-ui-handler.ts | 2 +- src/ui/time-of-day-widget.ts | 2 +- src/ui/title-ui-handler.ts | 2 +- vite.config.ts | 1 + 123 files changed, 456 insertions(+), 460 deletions(-) diff --git a/src/@types/common.ts b/src/@types/common.ts index 6868d766008..fcd946656dc 100644 --- a/src/@types/common.ts +++ b/src/@types/common.ts @@ -1,3 +1,3 @@ -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; export type ConditionFn = (scene: BattleScene, args?: any[]) => boolean; diff --git a/src/@types/i18next.d.ts b/src/@types/i18next.d.ts index d895659acef..9e8418a8977 100644 --- a/src/@types/i18next.d.ts +++ b/src/@types/i18next.d.ts @@ -1,4 +1,4 @@ -import { type enConfig } from "#app/locales/en/config.js"; +import { type enConfig } from "#app/locales/en/config"; import { TOptions } from "i18next"; //TODO: this needs to be type properly in the future diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 9123a213f4c..ff4258a13f5 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -63,7 +63,7 @@ import { Moves } from "#enums/moves"; import { PlayerGender } from "#enums/player-gender"; import { Species } from "#enums/species"; import { UiTheme } from "#enums/ui-theme"; -import { TimedEventManager } from "#app/timed-event-manager.js"; +import { TimedEventManager } from "#app/timed-event-manager"; import i18next from "i18next"; import { TrainerType } from "#enums/trainer-type"; import { battleSpecDialogue } from "./data/dialogue"; diff --git a/src/configs/inputs/pad_procon.ts b/src/configs/inputs/pad_procon.ts index 8cb707f882a..be751cc3acc 100644 --- a/src/configs/inputs/pad_procon.ts +++ b/src/configs/inputs/pad_procon.ts @@ -1,4 +1,4 @@ -import {SettingGamepad} from "#app/system/settings/settings-gamepad.js"; +import {SettingGamepad} from "#app/system/settings/settings-gamepad"; import {Button} from "#enums/buttons"; /** diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 62751b92f9c..2205519c532 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -1,18 +1,18 @@ import * as Utils from "../utils"; import i18next from "i18next"; -import { defaultStarterSpecies, DexAttrProps, GameData } from "#app/system/game-data.js"; +import { defaultStarterSpecies, DexAttrProps, GameData } from "#app/system/game-data"; import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm, speciesStarters } from "./pokemon-species"; -import Pokemon, { PokemonMove } from "#app/field/pokemon.js"; -import { BattleType, FixedBattleConfig } from "#app/battle.js"; -import Trainer, { TrainerVariant } from "#app/field/trainer.js"; -import { GameMode } from "#app/game-mode.js"; +import Pokemon, { PokemonMove } from "#app/field/pokemon"; +import { BattleType, FixedBattleConfig } from "#app/battle"; +import Trainer, { TrainerVariant } from "#app/field/trainer"; +import { GameMode } from "#app/game-mode"; import { Type } from "./type"; import { Challenges } from "#enums/challenges"; import { Species } from "#enums/species"; import { TrainerType } from "#enums/trainer-type"; import { Nature } from "./nature"; -import { Moves } from "#app/enums/moves.js"; -import { TypeColor, TypeShadow } from "#app/enums/color.js"; +import { Moves } from "#app/enums/moves"; +import { TypeColor, TypeShadow } from "#app/enums/color"; import { pokemonEvolutions } from "./pokemon-evolutions"; import { pokemonFormChanges } from "./pokemon-forms"; diff --git a/src/data/egg.ts b/src/data/egg.ts index 508263c9c8e..ce27030ebef 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -8,7 +8,7 @@ import { PlayerPokemon } from "#app/field/pokemon"; import i18next from "i18next"; import { EggTier } from "#enums/egg-type"; import { Species } from "#enums/species"; -import { EggSourceType } from "#app/enums/egg-source-types.js"; +import { EggSourceType } from "#app/enums/egg-source-types"; export const EGG_SEED = 1073741824; diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index bc815b91f3a..0d3e511bcba 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -8,7 +8,7 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { TimeOfDay } from "#enums/time-of-day"; -import { getPokemonNameWithAffix } from "#app/messages.js"; +import { getPokemonNameWithAffix } from "#app/messages"; import i18next from "i18next"; import { WeatherType } from "./weather"; diff --git a/src/data/terrain.ts b/src/data/terrain.ts index d4789078af7..6db68b92239 100644 --- a/src/data/terrain.ts +++ b/src/data/terrain.ts @@ -4,7 +4,7 @@ import { Type } from "./type"; import * as Utils from "../utils"; import { ChangeMovePriorityAbAttr, applyAbAttrs } from "./ability"; import { ProtectAttr } from "./move"; -import { BattlerIndex } from "#app/battle.js"; +import { BattlerIndex } from "#app/battle"; import i18next from "i18next"; export enum TerrainType { diff --git a/src/data/variant.ts b/src/data/variant.ts index 48369d112db..b7a01a4be89 100644 --- a/src/data/variant.ts +++ b/src/data/variant.ts @@ -1,4 +1,4 @@ -import { VariantTier } from "#app/enums/variant-tier.js"; +import { VariantTier } from "#app/enums/variant-tier"; export type Variant = 0 | 1 | 2; diff --git a/src/events/arena.ts b/src/events/arena.ts index 9fbbe572601..c05e67d353c 100644 --- a/src/events/arena.ts +++ b/src/events/arena.ts @@ -1,7 +1,7 @@ -import { ArenaTagSide } from "#app/data/arena-tag.js"; +import { ArenaTagSide } from "#app/data/arena-tag"; import { ArenaTagType } from "#enums/arena-tag-type"; -import { TerrainType } from "#app/data/terrain.js"; -import { WeatherType } from "#app/data/weather.js"; +import { TerrainType } from "#app/data/terrain"; +import { WeatherType } from "#app/data/weather"; /** Alias for all {@linkcode ArenaEvent} type strings */ export enum ArenaEventType { diff --git a/src/inputs-controller.ts b/src/inputs-controller.ts index 652e3d58062..bb3cfcbeb3b 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -16,7 +16,7 @@ import { getIconForLatestInput, swap, } from "#app/configs/inputs/configHandler"; import BattleScene from "./battle-scene"; -import {SettingGamepad} from "#app/system/settings/settings-gamepad.js"; +import {SettingGamepad} from "#app/system/settings/settings-gamepad"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; import TouchControl from "#app/touch-controls"; import { Button } from "#enums/buttons"; diff --git a/src/main.ts b/src/main.ts index 8a69d3f1b72..b5f813bdf2f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,8 +4,8 @@ import InvertPostFX from "./pipelines/invert"; import { version } from "../package.json"; import UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin"; import BBCodeTextPlugin from "phaser3-rex-plugins/plugins/bbcodetext-plugin"; -import InputTextPlugin from "phaser3-rex-plugins/plugins/inputtext-plugin.js"; -import TransitionImagePackPlugin from "phaser3-rex-plugins/templates/transitionimagepack/transitionimagepack-plugin.js"; +import InputTextPlugin from "phaser3-rex-plugins/plugins/inputtext-plugin"; +import TransitionImagePackPlugin from "phaser3-rex-plugins/templates/transitionimagepack/transitionimagepack-plugin"; import { LoadingScene } from "./loading-scene"; diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index d6cfd017829..fdfe60332f5 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -25,7 +25,7 @@ import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { getPokemonNameWithAffix } from "#app/messages.js"; +import { getPokemonNameWithAffix } from "#app/messages"; import { PermanentStat, TEMP_BATTLE_STATS, TempBattleStat, Stat, getStatKey } from "#app/enums/stat"; const outputModifierData = false; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index c1d58a7bf39..0b105a0c852 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -26,9 +26,9 @@ import i18next from "i18next"; import { allMoves } from "#app/data/move"; import { Abilities } from "#app/enums/abilities"; -import { LearnMovePhase } from "#app/phases/learn-move-phase.js"; -import { LevelUpPhase } from "#app/phases/level-up-phase.js"; -import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase.js"; +import { LearnMovePhase } from "#app/phases/learn-move-phase"; +import { LevelUpPhase } from "#app/phases/level-up-phase"; +import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; export type ModifierPredicate = (modifier: Modifier) => boolean; diff --git a/src/phases/add-enemy-buff-modifier-phase.ts b/src/phases/add-enemy-buff-modifier-phase.ts index a9936eb765d..451e6e2662c 100644 --- a/src/phases/add-enemy-buff-modifier-phase.ts +++ b/src/phases/add-enemy-buff-modifier-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { ModifierTier } from "#app/modifier/modifier-tier.js"; -import { regenerateModifierPoolThresholds, ModifierPoolType, getEnemyBuffModifierForWave } from "#app/modifier/modifier-type.js"; -import { EnemyPersistentModifier } from "#app/modifier/modifier.js"; -import { Phase } from "#app/phase.js"; +import BattleScene from "#app/battle-scene"; +import { ModifierTier } from "#app/modifier/modifier-tier"; +import { regenerateModifierPoolThresholds, ModifierPoolType, getEnemyBuffModifierForWave } from "#app/modifier/modifier-type"; +import { EnemyPersistentModifier } from "#app/modifier/modifier"; +import { Phase } from "#app/phase"; export class AddEnemyBuffModifierPhase extends Phase { constructor(scene: BattleScene) { diff --git a/src/phases/attempt-capture-phase.ts b/src/phases/attempt-capture-phase.ts index 72995c0f006..55a82affaf6 100644 --- a/src/phases/attempt-capture-phase.ts +++ b/src/phases/attempt-capture-phase.ts @@ -1,17 +1,17 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { getPokeballCatchMultiplier, getPokeballAtlasKey, getPokeballTintColor, doPokeballBounceAnim } from "#app/data/pokeball.js"; -import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect.js"; -import { PokeballType } from "#app/enums/pokeball.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; -import { addPokeballOpenParticles, addPokeballCaptureStars } from "#app/field/anims.js"; -import { EnemyPokemon } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { PokemonHeldItemModifier } from "#app/modifier/modifier.js"; -import { achvs } from "#app/system/achv.js"; -import { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler.js"; -import { SummaryUiMode } from "#app/ui/summary-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { getPokeballCatchMultiplier, getPokeballAtlasKey, getPokeballTintColor, doPokeballBounceAnim } from "#app/data/pokeball"; +import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; +import { PokeballType } from "#app/enums/pokeball"; +import { StatusEffect } from "#app/enums/status-effect"; +import { addPokeballOpenParticles, addPokeballCaptureStars } from "#app/field/anims"; +import { EnemyPokemon } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { PokemonHeldItemModifier } from "#app/modifier/modifier"; +import { achvs } from "#app/system/achv"; +import { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler"; +import { SummaryUiMode } from "#app/ui/summary-ui-handler"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import { PokemonPhase } from "./pokemon-phase"; import { VictoryPhase } from "./victory-phase"; diff --git a/src/phases/battle-end-phase.ts b/src/phases/battle-end-phase.ts index 06315668a8b..f08e04b443a 100644 --- a/src/phases/battle-end-phase.ts +++ b/src/phases/battle-end-phase.ts @@ -1,5 +1,5 @@ -import { applyPostBattleAbAttrs, PostBattleAbAttr } from "#app/data/ability.js"; -import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier.js"; +import { applyPostBattleAbAttrs, PostBattleAbAttr } from "#app/data/ability"; +import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier"; import { BattlePhase } from "./battle-phase"; import { GameOverPhase } from "./game-over-phase"; diff --git a/src/phases/battle-phase.ts b/src/phases/battle-phase.ts index 3e7e0e28596..b51e19bdf0e 100644 --- a/src/phases/battle-phase.ts +++ b/src/phases/battle-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { TrainerSlot } from "#app/data/trainer-config.js"; -import { Phase } from "#app/phase.js"; +import BattleScene from "#app/battle-scene"; +import { TrainerSlot } from "#app/data/trainer-config"; +import { Phase } from "#app/phase"; export class BattlePhase extends Phase { constructor(scene: BattleScene) { diff --git a/src/phases/berry-phase.ts b/src/phases/berry-phase.ts index 504fb6ec163..66ecaa6c7f8 100644 --- a/src/phases/berry-phase.ts +++ b/src/phases/berry-phase.ts @@ -1,10 +1,10 @@ -import { applyAbAttrs, PreventBerryUseAbAttr, HealFromBerryUseAbAttr } from "#app/data/ability.js"; -import { CommonAnim } from "#app/data/battle-anims.js"; -import { BerryUsedEvent } from "#app/events/battle-scene.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { BerryModifier } from "#app/modifier/modifier.js"; +import { applyAbAttrs, PreventBerryUseAbAttr, HealFromBerryUseAbAttr } from "#app/data/ability"; +import { CommonAnim } from "#app/data/battle-anims"; +import { BerryUsedEvent } from "#app/events/battle-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { BerryModifier } from "#app/modifier/modifier"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { FieldPhase } from "./field-phase"; import { CommonAnimPhase } from "./common-anim-phase"; diff --git a/src/phases/check-switch-phase.ts b/src/phases/check-switch-phase.ts index cd8f2b00c46..a069ba224a2 100644 --- a/src/phases/check-switch-phase.ts +++ b/src/phases/check-switch-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattleStyle } from "#app/enums/battle-style.js"; -import { BattlerTagType } from "#app/enums/battler-tag-type.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { BattleStyle } from "#app/enums/battle-style"; +import { BattlerTagType } from "#app/enums/battler-tag-type"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import { BattlePhase } from "./battle-phase"; import { PostSummonPhase } from "./post-summon-phase"; diff --git a/src/phases/common-anim-phase.ts b/src/phases/common-anim-phase.ts index d3663abe3b6..a85cd7629d9 100644 --- a/src/phases/common-anim-phase.ts +++ b/src/phases/common-anim-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims"; import { PokemonPhase } from "./pokemon-phase"; export class CommonAnimPhase extends PokemonPhase { diff --git a/src/phases/damage-phase.ts b/src/phases/damage-phase.ts index 029c1e717f1..5add0345358 100644 --- a/src/phases/damage-phase.ts +++ b/src/phases/damage-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { BattleSpec } from "#app/enums/battle-spec.js"; -import { DamageResult, HitResult } from "#app/field/pokemon.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { BattleSpec } from "#app/enums/battle-spec"; +import { DamageResult, HitResult } from "#app/field/pokemon"; +import * as Utils from "#app/utils"; import { PokemonPhase } from "./pokemon-phase"; export class DamagePhase extends PokemonPhase { diff --git a/src/phases/end-card-phase.ts b/src/phases/end-card-phase.ts index 0b70664b993..274a745017a 100644 --- a/src/phases/end-card-phase.ts +++ b/src/phases/end-card-phase.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; -import { PlayerGender } from "#app/enums/player-gender.js"; -import { Phase } from "#app/phase.js"; -import { addTextObject, TextStyle } from "#app/ui/text.js"; +import BattleScene from "#app/battle-scene"; +import { PlayerGender } from "#app/enums/player-gender"; +import { Phase } from "#app/phase"; +import { addTextObject, TextStyle } from "#app/ui/text"; import i18next from "i18next"; export class EndCardPhase extends Phase { diff --git a/src/phases/end-evolution-phase.ts b/src/phases/end-evolution-phase.ts index 2a6d492a425..8a6ce52553d 100644 --- a/src/phases/end-evolution-phase.ts +++ b/src/phases/end-evolution-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { Mode } from "#app/ui/ui"; export class EndEvolutionPhase extends Phase { diff --git a/src/phases/enemy-party-member-pokemon-phase.ts b/src/phases/enemy-party-member-pokemon-phase.ts index 10af0913f93..bb34f53b475 100644 --- a/src/phases/enemy-party-member-pokemon-phase.ts +++ b/src/phases/enemy-party-member-pokemon-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { EnemyPokemon } from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { EnemyPokemon } from "#app/field/pokemon"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; export abstract class EnemyPartyMemberPokemonPhase extends PartyMemberPokemonPhase { diff --git a/src/phases/exp-phase.ts b/src/phases/exp-phase.ts index 9c2ba95d550..81982980d2a 100644 --- a/src/phases/exp-phase.ts +++ b/src/phases/exp-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { ExpBoosterModifier } from "#app/modifier/modifier.js"; +import BattleScene from "#app/battle-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { ExpBoosterModifier } from "#app/modifier/modifier"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; import { LevelUpPhase } from "./level-up-phase"; diff --git a/src/phases/field-phase.ts b/src/phases/field-phase.ts index b65e903a32b..46c3c4983b4 100644 --- a/src/phases/field-phase.ts +++ b/src/phases/field-phase.ts @@ -1,4 +1,4 @@ -import Pokemon from "#app/field/pokemon.js"; +import Pokemon from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; type PokemonFunc = (pokemon: Pokemon) => void; diff --git a/src/phases/game-over-modifier-reward-phase.ts b/src/phases/game-over-modifier-reward-phase.ts index c27659bf9d4..a698e62e2e1 100644 --- a/src/phases/game-over-modifier-reward-phase.ts +++ b/src/phases/game-over-modifier-reward-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { ModifierTypeFunc } from "#app/modifier/modifier-type.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { ModifierTypeFunc } from "#app/modifier/modifier-type"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import { ModifierRewardPhase } from "./modifier-reward-phase"; diff --git a/src/phases/hide-party-exp-bar-phase.ts b/src/phases/hide-party-exp-bar-phase.ts index c2c9d96462e..303650ea1ad 100644 --- a/src/phases/hide-party-exp-bar-phase.ts +++ b/src/phases/hide-party-exp-bar-phase.ts @@ -1,4 +1,4 @@ -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { BattlePhase } from "./battle-phase"; export class HidePartyExpBarPhase extends BattlePhase { diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index 201019e8860..049fc6951b6 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -1,12 +1,12 @@ -import BattleScene from "#app/battle-scene.js"; -import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims.js"; -import { allMoves } from "#app/data/move.js"; -import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms.js"; -import { Moves } from "#app/enums/moves.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import EvolutionSceneHandler from "#app/ui/evolution-scene-handler.js"; -import { SummaryUiMode } from "#app/ui/summary-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims"; +import { allMoves } from "#app/data/move"; +import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms"; +import { Moves } from "#app/enums/moves"; +import { getPokemonNameWithAffix } from "#app/messages"; +import EvolutionSceneHandler from "#app/ui/evolution-scene-handler"; +import { SummaryUiMode } from "#app/ui/summary-ui-handler"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; diff --git a/src/phases/level-cap-phase.ts b/src/phases/level-cap-phase.ts index db59fbd6473..d1404e45010 100644 --- a/src/phases/level-cap-phase.ts +++ b/src/phases/level-cap-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import { FieldPhase } from "./field-phase"; diff --git a/src/phases/level-up-phase.ts b/src/phases/level-up-phase.ts index a8a6b8f3d80..a99e038acba 100644 --- a/src/phases/level-up-phase.ts +++ b/src/phases/level-up-phase.ts @@ -1,11 +1,11 @@ -import BattleScene from "#app/battle-scene.js"; -import { ExpNotification } from "#app/enums/exp-notification.js"; -import { EvolutionPhase } from "#app/phases/evolution-phase.js"; -import { PlayerPokemon } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { LevelAchv } from "#app/system/achv.js"; +import BattleScene from "#app/battle-scene"; +import { ExpNotification } from "#app/enums/exp-notification"; +import { EvolutionPhase } from "#app/phases/evolution-phase"; +import { PlayerPokemon } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { LevelAchv } from "#app/system/achv"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; import { LearnMovePhase } from "./learn-move-phase"; diff --git a/src/phases/login-phase.ts b/src/phases/login-phase.ts index b58cc9bca1f..89ced201e9e 100644 --- a/src/phases/login-phase.ts +++ b/src/phases/login-phase.ts @@ -1,10 +1,10 @@ -import { updateUserInfo } from "#app/account.js"; -import BattleScene, { bypassLogin } from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; -import { handleTutorial, Tutorial } from "#app/tutorial.js"; -import { Mode } from "#app/ui/ui.js"; +import { updateUserInfo } from "#app/account"; +import BattleScene, { bypassLogin } from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { handleTutorial, Tutorial } from "#app/tutorial"; +import { Mode } from "#app/ui/ui"; import i18next, { t } from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { SelectGenderPhase } from "./select-gender-phase"; import { UnavailablePhase } from "./unavailable-phase"; diff --git a/src/phases/message-phase.ts b/src/phases/message-phase.ts index 46e907ae2ba..2244980c899 100644 --- a/src/phases/message-phase.ts +++ b/src/phases/message-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; export class MessagePhase extends Phase { private text: string; diff --git a/src/phases/modifier-reward-phase.ts b/src/phases/modifier-reward-phase.ts index 4d083a367a6..20a8366d9c6 100644 --- a/src/phases/modifier-reward-phase.ts +++ b/src/phases/modifier-reward-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { ModifierType, ModifierTypeFunc, getModifierType } from "#app/modifier/modifier-type.js"; +import BattleScene from "#app/battle-scene"; +import { ModifierType, ModifierTypeFunc, getModifierType } from "#app/modifier/modifier-type"; import i18next from "i18next"; import { BattlePhase } from "./battle-phase"; diff --git a/src/phases/money-reward-phase.ts b/src/phases/money-reward-phase.ts index e0bff608972..2f0a4f7b990 100644 --- a/src/phases/money-reward-phase.ts +++ b/src/phases/money-reward-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { ArenaTagType } from "#app/enums/arena-tag-type.js"; -import { MoneyMultiplierModifier } from "#app/modifier/modifier.js"; +import BattleScene from "#app/battle-scene"; +import { ArenaTagType } from "#app/enums/arena-tag-type"; +import { MoneyMultiplierModifier } from "#app/modifier/modifier"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { BattlePhase } from "./battle-phase"; export class MoneyRewardPhase extends BattlePhase { diff --git a/src/phases/move-anim-test-phase.ts b/src/phases/move-anim-test-phase.ts index 7fb3c1d61e7..2d3b54bfd9a 100644 --- a/src/phases/move-anim-test-phase.ts +++ b/src/phases/move-anim-test-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { initMoveAnim, loadMoveAnimAssets, MoveAnim } from "#app/data/battle-anims.js"; -import { allMoves, SelfStatusMove } from "#app/data/move.js"; -import { Moves } from "#app/enums/moves.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { initMoveAnim, loadMoveAnimAssets, MoveAnim } from "#app/data/battle-anims"; +import { allMoves, SelfStatusMove } from "#app/data/move"; +import { Moves } from "#app/enums/moves"; +import * as Utils from "#app/utils"; import { BattlePhase } from "./battle-phase"; export class MoveAnimTestPhase extends BattlePhase { diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 9b22c520e19..fb2b82ada03 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -1,18 +1,18 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { applyPreAttackAbAttrs, AddSecondStrikeAbAttr, IgnoreMoveEffectsAbAttr, applyPostDefendAbAttrs, PostDefendAbAttr, applyPostAttackAbAttrs, PostAttackAbAttr, MaxMultiHitAbAttr, AlwaysHitAbAttr } from "#app/data/ability.js"; -import { ArenaTagSide, ConditionalProtectTag } from "#app/data/arena-tag.js"; -import { MoveAnim } from "#app/data/battle-anims.js"; -import { BattlerTagLapseType, ProtectedTag, SemiInvulnerableTag } from "#app/data/battler-tags.js"; -import { MoveTarget, applyMoveAttrs, OverrideMoveEffectAttr, MultiHitAttr, AttackMove, FixedDamageAttr, VariableTargetAttr, MissEffectAttr, MoveFlags, applyFilteredMoveAttrs, MoveAttr, MoveEffectAttr, MoveEffectTrigger, ChargeAttr, MoveCategory, NoEffectAttr, HitsTagAttr } from "#app/data/move.js"; -import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms.js"; -import { BattlerTagType } from "#app/enums/battler-tag-type.js"; -import { Moves } from "#app/enums/moves.js"; -import Pokemon, { PokemonMove, MoveResult, HitResult } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { PokemonMultiHitModifier, FlinchChanceModifier, EnemyAttackStatusEffectChanceModifier, ContactHeldItemTransferChanceModifier, HitHealModifier } from "#app/modifier/modifier.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { applyPreAttackAbAttrs, AddSecondStrikeAbAttr, IgnoreMoveEffectsAbAttr, applyPostDefendAbAttrs, PostDefendAbAttr, applyPostAttackAbAttrs, PostAttackAbAttr, MaxMultiHitAbAttr, AlwaysHitAbAttr } from "#app/data/ability"; +import { ArenaTagSide, ConditionalProtectTag } from "#app/data/arena-tag"; +import { MoveAnim } from "#app/data/battle-anims"; +import { BattlerTagLapseType, ProtectedTag, SemiInvulnerableTag } from "#app/data/battler-tags"; +import { MoveTarget, applyMoveAttrs, OverrideMoveEffectAttr, MultiHitAttr, AttackMove, FixedDamageAttr, VariableTargetAttr, MissEffectAttr, MoveFlags, applyFilteredMoveAttrs, MoveAttr, MoveEffectAttr, MoveEffectTrigger, ChargeAttr, MoveCategory, NoEffectAttr, HitsTagAttr } from "#app/data/move"; +import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms"; +import { BattlerTagType } from "#app/enums/battler-tag-type"; +import { Moves } from "#app/enums/moves"; +import Pokemon, { PokemonMove, MoveResult, HitResult } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { PokemonMultiHitModifier, FlinchChanceModifier, EnemyAttackStatusEffectChanceModifier, ContactHeldItemTransferChanceModifier, HitHealModifier } from "#app/modifier/modifier"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { PokemonPhase } from "./pokemon-phase"; export class MoveEffectPhase extends PokemonPhase { diff --git a/src/phases/move-end-phase.ts b/src/phases/move-end-phase.ts index 4bce2185aea..e03f2ec14b0 100644 --- a/src/phases/move-end-phase.ts +++ b/src/phases/move-end-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { BattlerTagLapseType } from "#app/data/battler-tags.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { BattlerTagLapseType } from "#app/data/battler-tags"; import { PokemonPhase } from "./pokemon-phase"; export class MoveEndPhase extends PokemonPhase { diff --git a/src/phases/move-header-phase.ts b/src/phases/move-header-phase.ts index 5166f287731..c307ff0be6e 100644 --- a/src/phases/move-header-phase.ts +++ b/src/phases/move-header-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { applyMoveAttrs, MoveHeaderAttr } from "#app/data/move.js"; -import Pokemon, { PokemonMove } from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { applyMoveAttrs, MoveHeaderAttr } from "#app/data/move"; +import Pokemon, { PokemonMove } from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; export class MoveHeaderPhase extends BattlePhase { diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 0ccf19a462f..8209bdd44d1 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -1,21 +1,21 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { applyAbAttrs, applyPostMoveUsedAbAttrs, applyPreAttackAbAttrs, BlockRedirectAbAttr, IncreasePpAbAttr, PokemonTypeChangeAbAttr, PostMoveUsedAbAttr, RedirectMoveAbAttr } from "#app/data/ability.js"; -import { CommonAnim } from "#app/data/battle-anims.js"; -import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags.js"; -import { allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, ChargeAttr, CopyMoveAttr, HealStatusEffectAttr, MoveFlags, PreMoveMessageAttr } from "#app/data/move.js"; -import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms.js"; -import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect.js"; -import { Type } from "#app/data/type.js"; -import { getTerrainBlockMessage } from "#app/data/weather.js"; -import { Abilities } from "#app/enums/abilities.js"; -import { BattlerTagType } from "#app/enums/battler-tag-type.js"; -import { Moves } from "#app/enums/moves.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; -import { MoveUsedEvent } from "#app/events/battle-scene.js"; -import Pokemon, { MoveResult, PokemonMove, TurnMove } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { applyAbAttrs, applyPostMoveUsedAbAttrs, applyPreAttackAbAttrs, BlockRedirectAbAttr, IncreasePpAbAttr, PokemonTypeChangeAbAttr, PostMoveUsedAbAttr, RedirectMoveAbAttr } from "#app/data/ability"; +import { CommonAnim } from "#app/data/battle-anims"; +import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags"; +import { allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, ChargeAttr, CopyMoveAttr, HealStatusEffectAttr, MoveFlags, PreMoveMessageAttr } from "#app/data/move"; +import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms"; +import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect"; +import { Type } from "#app/data/type"; +import { getTerrainBlockMessage } from "#app/data/weather"; +import { Abilities } from "#app/enums/abilities"; +import { BattlerTagType } from "#app/enums/battler-tag-type"; +import { Moves } from "#app/enums/moves"; +import { StatusEffect } from "#app/enums/status-effect"; +import { MoveUsedEvent } from "#app/events/battle-scene"; +import Pokemon, { MoveResult, PokemonMove, TurnMove } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import * as Utils from "#app/utils"; import i18next from "i18next"; import { BattlePhase } from "./battle-phase"; import { CommonAnimPhase } from "./common-anim-phase"; diff --git a/src/phases/new-biome-encounter-phase.ts b/src/phases/new-biome-encounter-phase.ts index c447e78f7b1..9f1209fb7ee 100644 --- a/src/phases/new-biome-encounter-phase.ts +++ b/src/phases/new-biome-encounter-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { applyAbAttrs, PostBiomeChangeAbAttr } from "#app/data/ability.js"; -import { getRandomWeatherType } from "#app/data/weather.js"; +import BattleScene from "#app/battle-scene"; +import { applyAbAttrs, PostBiomeChangeAbAttr } from "#app/data/ability"; +import { getRandomWeatherType } from "#app/data/weather"; import { NextEncounterPhase } from "./next-encounter-phase"; export class NewBiomeEncounterPhase extends NextEncounterPhase { diff --git a/src/phases/next-encounter-phase.ts b/src/phases/next-encounter-phase.ts index 89987534fc0..d51aa374b6e 100644 --- a/src/phases/next-encounter-phase.ts +++ b/src/phases/next-encounter-phase.ts @@ -1,4 +1,4 @@ -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { EncounterPhase } from "./encounter-phase"; export class NextEncounterPhase extends EncounterPhase { diff --git a/src/phases/obtain-status-effect-phase.ts b/src/phases/obtain-status-effect-phase.ts index ac6e66a2e9f..bb06fafb1c9 100644 --- a/src/phases/obtain-status-effect-phase.ts +++ b/src/phases/obtain-status-effect-phase.ts @@ -1,10 +1,10 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims.js"; -import { getStatusEffectObtainText, getStatusEffectOverlapText } from "#app/data/status-effect.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; -import Pokemon from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims"; +import { getStatusEffectObtainText, getStatusEffectOverlapText } from "#app/data/status-effect"; +import { StatusEffect } from "#app/enums/status-effect"; +import Pokemon from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; import { PokemonPhase } from "./pokemon-phase"; import { PostTurnStatusEffectPhase } from "./post-turn-status-effect-phase"; diff --git a/src/phases/outdated-phase.ts b/src/phases/outdated-phase.ts index 72d1bb3671d..4baf16d2f56 100644 --- a/src/phases/outdated-phase.ts +++ b/src/phases/outdated-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { Mode } from "#app/ui/ui"; export class OutdatedPhase extends Phase { constructor(scene: BattleScene) { diff --git a/src/phases/party-heal-phase.ts b/src/phases/party-heal-phase.ts index d9179826a19..e6ee11202df 100644 --- a/src/phases/party-heal-phase.ts +++ b/src/phases/party-heal-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import * as Utils from "#app/utils"; import { BattlePhase } from "./battle-phase"; export class PartyHealPhase extends BattlePhase { diff --git a/src/phases/party-member-pokemon-phase.ts b/src/phases/party-member-pokemon-phase.ts index 1f27826884e..2b6ca01261d 100644 --- a/src/phases/party-member-pokemon-phase.ts +++ b/src/phases/party-member-pokemon-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import Pokemon from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import Pokemon from "#app/field/pokemon"; import { FieldPhase } from "./field-phase"; export abstract class PartyMemberPokemonPhase extends FieldPhase { diff --git a/src/phases/party-status-cure-phase.ts b/src/phases/party-status-cure-phase.ts index a11aa01b63a..e4903c7fc1f 100644 --- a/src/phases/party-status-cure-phase.ts +++ b/src/phases/party-status-cure-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { Abilities } from "#app/enums/abilities.js"; -import Pokemon from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { Abilities } from "#app/enums/abilities"; +import Pokemon from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; import { ShowAbilityPhase } from "./show-ability-phase"; diff --git a/src/phases/player-party-member-pokemon-phase.ts b/src/phases/player-party-member-pokemon-phase.ts index 4b1600b33d2..87855b9334c 100644 --- a/src/phases/player-party-member-pokemon-phase.ts +++ b/src/phases/player-party-member-pokemon-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { PlayerPokemon } from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { PlayerPokemon } from "#app/field/pokemon"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; export abstract class PlayerPartyMemberPokemonPhase extends PartyMemberPokemonPhase { diff --git a/src/phases/pokemon-heal-phase.ts b/src/phases/pokemon-heal-phase.ts index 6db8aeb4fca..49db2641e98 100644 --- a/src/phases/pokemon-heal-phase.ts +++ b/src/phases/pokemon-heal-phase.ts @@ -1,14 +1,14 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { CommonAnim } from "#app/data/battle-anims.js"; -import { getStatusEffectHealText } from "#app/data/status-effect.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; -import { HitResult, DamageResult } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { HealingBoosterModifier } from "#app/modifier/modifier.js"; -import { HealAchv } from "#app/system/achv.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { CommonAnim } from "#app/data/battle-anims"; +import { getStatusEffectHealText } from "#app/data/status-effect"; +import { StatusEffect } from "#app/enums/status-effect"; +import { HitResult, DamageResult } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { HealingBoosterModifier } from "#app/modifier/modifier"; +import { HealAchv } from "#app/system/achv"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { CommonAnimPhase } from "./common-anim-phase"; export class PokemonHealPhase extends CommonAnimPhase { diff --git a/src/phases/pokemon-phase.ts b/src/phases/pokemon-phase.ts index 871ee57d7a5..b980c1d1719 100644 --- a/src/phases/pokemon-phase.ts +++ b/src/phases/pokemon-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import Pokemon from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import Pokemon from "#app/field/pokemon"; import { FieldPhase } from "./field-phase"; export abstract class PokemonPhase extends FieldPhase { diff --git a/src/phases/post-game-over-phase.ts b/src/phases/post-game-over-phase.ts index 02413b41a23..beeb30c7260 100644 --- a/src/phases/post-game-over-phase.ts +++ b/src/phases/post-game-over-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; import { EndCardPhase } from "./end-card-phase"; import { TitlePhase } from "./title-phase"; diff --git a/src/phases/post-summon-phase.ts b/src/phases/post-summon-phase.ts index e671bf30ed1..47a5513f0eb 100644 --- a/src/phases/post-summon-phase.ts +++ b/src/phases/post-summon-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { applyPostSummonAbAttrs, PostSummonAbAttr } from "#app/data/ability.js"; -import { ArenaTrapTag } from "#app/data/arena-tag.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { applyPostSummonAbAttrs, PostSummonAbAttr } from "#app/data/ability"; +import { ArenaTrapTag } from "#app/data/arena-tag"; +import { StatusEffect } from "#app/enums/status-effect"; import { PokemonPhase } from "./pokemon-phase"; export class PostSummonPhase extends PokemonPhase { diff --git a/src/phases/post-turn-status-effect-phase.ts b/src/phases/post-turn-status-effect-phase.ts index 47db32303a5..413f9eae65e 100644 --- a/src/phases/post-turn-status-effect-phase.ts +++ b/src/phases/post-turn-status-effect-phase.ts @@ -1,12 +1,12 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { applyAbAttrs, BlockNonDirectDamageAbAttr, BlockStatusDamageAbAttr, ReduceBurnDamageAbAttr } from "#app/data/ability.js"; -import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims.js"; -import { getStatusEffectActivationText } from "#app/data/status-effect.js"; -import { BattleSpec } from "#app/enums/battle-spec.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { applyAbAttrs, BlockNonDirectDamageAbAttr, BlockStatusDamageAbAttr, ReduceBurnDamageAbAttr } from "#app/data/ability"; +import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims"; +import { getStatusEffectActivationText } from "#app/data/status-effect"; +import { BattleSpec } from "#app/enums/battle-spec"; +import { StatusEffect } from "#app/enums/status-effect"; +import { getPokemonNameWithAffix } from "#app/messages"; +import * as Utils from "#app/utils"; import { PokemonPhase } from "./pokemon-phase"; export class PostTurnStatusEffectPhase extends PokemonPhase { diff --git a/src/phases/quiet-form-change-phase.ts b/src/phases/quiet-form-change-phase.ts index 3d30d36907e..6a1d31d137d 100644 --- a/src/phases/quiet-form-change-phase.ts +++ b/src/phases/quiet-form-change-phase.ts @@ -1,10 +1,10 @@ -import BattleScene from "#app/battle-scene.js"; -import { SemiInvulnerableTag } from "#app/data/battler-tags.js"; -import { SpeciesFormChange, getSpeciesFormChangeMessage } from "#app/data/pokemon-forms.js"; -import { getTypeRgb } from "#app/data/type.js"; -import { BattleSpec } from "#app/enums/battle-spec.js"; -import Pokemon, { EnemyPokemon } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; +import BattleScene from "#app/battle-scene"; +import { SemiInvulnerableTag } from "#app/data/battler-tags"; +import { SpeciesFormChange, getSpeciesFormChangeMessage } from "#app/data/pokemon-forms"; +import { getTypeRgb } from "#app/data/type"; +import { BattleSpec } from "#app/enums/battle-spec"; +import Pokemon, { EnemyPokemon } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; import { BattlePhase } from "./battle-phase"; import { MovePhase } from "./move-phase"; import { PokemonHealPhase } from "./pokemon-heal-phase"; diff --git a/src/phases/reload-session-phase.ts b/src/phases/reload-session-phase.ts index a61c52323bf..f8a38105869 100644 --- a/src/phases/reload-session-phase.ts +++ b/src/phases/reload-session-phase.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; -import { Mode } from "#app/ui/ui.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { Mode } from "#app/ui/ui"; +import * as Utils from "#app/utils"; export class ReloadSessionPhase extends Phase { private systemDataStr: string | null; diff --git a/src/phases/return-phase.ts b/src/phases/return-phase.ts index e1753670ad4..dfc458eb817 100644 --- a/src/phases/return-phase.ts +++ b/src/phases/return-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms.js"; +import BattleScene from "#app/battle-scene"; +import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; import { SwitchSummonPhase } from "./switch-summon-phase"; export class ReturnPhase extends SwitchSummonPhase { diff --git a/src/phases/ribbon-modifier-reward-phase.ts b/src/phases/ribbon-modifier-reward-phase.ts index 4a80325b7e7..fabb3bfa1b1 100644 --- a/src/phases/ribbon-modifier-reward-phase.ts +++ b/src/phases/ribbon-modifier-reward-phase.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; -import PokemonSpecies from "#app/data/pokemon-species.js"; -import { ModifierTypeFunc } from "#app/modifier/modifier-type.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import PokemonSpecies from "#app/data/pokemon-species"; +import { ModifierTypeFunc } from "#app/modifier/modifier-type"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import { ModifierRewardPhase } from "./modifier-reward-phase"; diff --git a/src/phases/scan-ivs-phase.ts b/src/phases/scan-ivs-phase.ts index f5e1a814612..ba27e4f1943 100644 --- a/src/phases/scan-ivs-phase.ts +++ b/src/phases/scan-ivs-phase.ts @@ -1,10 +1,10 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims.js"; -import { Stat } from "#app/enums/stat.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { getTextColor, TextStyle } from "#app/ui/text.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims"; +import { Stat } from "#app/enums/stat"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { getTextColor, TextStyle } from "#app/ui/text"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import { PokemonPhase } from "./pokemon-phase"; diff --git a/src/phases/select-biome-phase.ts b/src/phases/select-biome-phase.ts index 68c2cd29f26..fe9b5b3996b 100644 --- a/src/phases/select-biome-phase.ts +++ b/src/phases/select-biome-phase.ts @@ -1,11 +1,11 @@ -import BattleScene from "#app/battle-scene.js"; -import { biomeLinks, getBiomeName } from "#app/data/biomes.js"; -import { Biome } from "#app/enums/biome.js"; -import { MoneyInterestModifier, MapModifier } from "#app/modifier/modifier.js"; -import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { biomeLinks, getBiomeName } from "#app/data/biomes"; +import { Biome } from "#app/enums/biome"; +import { MoneyInterestModifier, MapModifier } from "#app/modifier/modifier"; +import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; +import { Mode } from "#app/ui/ui"; import { BattlePhase } from "./battle-phase"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { PartyHealPhase } from "./party-heal-phase"; import { SwitchBiomePhase } from "./switch-biome-phase"; diff --git a/src/phases/select-challenge-phase.ts b/src/phases/select-challenge-phase.ts index eaf830e0059..9450c60fec5 100644 --- a/src/phases/select-challenge-phase.ts +++ b/src/phases/select-challenge-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { Mode } from "#app/ui/ui"; export class SelectChallengePhase extends Phase { constructor(scene: BattleScene) { diff --git a/src/phases/select-gender-phase.ts b/src/phases/select-gender-phase.ts index 3fc6916e233..7f2c965f1d1 100644 --- a/src/phases/select-gender-phase.ts +++ b/src/phases/select-gender-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { PlayerGender } from "#app/enums/player-gender.js"; -import { Phase } from "#app/phase.js"; -import { SettingKeys } from "#app/system/settings/settings.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { PlayerGender } from "#app/enums/player-gender"; +import { Phase } from "#app/phase"; +import { SettingKeys } from "#app/system/settings/settings"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; export class SelectGenderPhase extends Phase { diff --git a/src/phases/select-modifier-phase.ts b/src/phases/select-modifier-phase.ts index 1c96d278d69..e14638c5dd2 100644 --- a/src/phases/select-modifier-phase.ts +++ b/src/phases/select-modifier-phase.ts @@ -1,12 +1,12 @@ -import BattleScene from "#app/battle-scene.js"; -import { ModifierTier } from "#app/modifier/modifier-tier.js"; -import { regenerateModifierPoolThresholds, ModifierTypeOption, ModifierType, getPlayerShopModifierTypeOptionsForWave, PokemonModifierType, FusePokemonModifierType, PokemonMoveModifierType, TmModifierType, RememberMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, ModifierPoolType, getPlayerModifierTypeOptions } from "#app/modifier/modifier-type.js"; -import { ExtraModifierModifier, Modifier, PokemonHeldItemModifier } from "#app/modifier/modifier.js"; -import ModifierSelectUiHandler, { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/modifier-select-ui-handler.js"; -import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { ModifierTier } from "#app/modifier/modifier-tier"; +import { regenerateModifierPoolThresholds, ModifierTypeOption, ModifierType, getPlayerShopModifierTypeOptionsForWave, PokemonModifierType, FusePokemonModifierType, PokemonMoveModifierType, TmModifierType, RememberMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, ModifierPoolType, getPlayerModifierTypeOptions } from "#app/modifier/modifier-type"; +import { ExtraModifierModifier, Modifier, PokemonHeldItemModifier } from "#app/modifier/modifier"; +import ModifierSelectUiHandler, { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/modifier-select-ui-handler"; +import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { BattlePhase } from "./battle-phase"; import Overrides from "#app/overrides"; diff --git a/src/phases/select-starter-phase.ts b/src/phases/select-starter-phase.ts index ad972a49225..cd3c112549c 100644 --- a/src/phases/select-starter-phase.ts +++ b/src/phases/select-starter-phase.ts @@ -1,15 +1,15 @@ -import BattleScene from "#app/battle-scene.js"; -import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; -import { Gender } from "#app/data/gender.js"; -import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms.js"; -import { getPokemonSpecies } from "#app/data/pokemon-species.js"; -import { Species } from "#app/enums/species.js"; -import { PlayerPokemon } from "#app/field/pokemon.js"; -import { overrideModifiers, overrideHeldItems } from "#app/modifier/modifier.js"; -import { Phase } from "#app/phase.js"; -import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler.js"; -import { Starter } from "#app/ui/starter-select-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { applyChallenges, ChallengeType } from "#app/data/challenge"; +import { Gender } from "#app/data/gender"; +import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms"; +import { getPokemonSpecies } from "#app/data/pokemon-species"; +import { Species } from "#app/enums/species"; +import { PlayerPokemon } from "#app/field/pokemon"; +import { overrideModifiers, overrideHeldItems } from "#app/modifier/modifier"; +import { Phase } from "#app/phase"; +import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler"; +import { Starter } from "#app/ui/starter-select-ui-handler"; +import { Mode } from "#app/ui/ui"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { TitlePhase } from "./title-phase"; import Overrides from "#app/overrides"; diff --git a/src/phases/select-target-phase.ts b/src/phases/select-target-phase.ts index fe72335e312..716d2737a6c 100644 --- a/src/phases/select-target-phase.ts +++ b/src/phases/select-target-phase.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { Command } from "#app/ui/command-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { Command } from "#app/ui/command-ui-handler"; +import { Mode } from "#app/ui/ui"; import { CommandPhase } from "./command-phase"; import { PokemonPhase } from "./pokemon-phase"; diff --git a/src/phases/shiny-sparkle-phase.ts b/src/phases/shiny-sparkle-phase.ts index 4cd2b68f881..49c60a82dd5 100644 --- a/src/phases/shiny-sparkle-phase.ts +++ b/src/phases/shiny-sparkle-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; import { PokemonPhase } from "./pokemon-phase"; export class ShinySparklePhase extends PokemonPhase { diff --git a/src/phases/show-ability-phase.ts b/src/phases/show-ability-phase.ts index ee0b98f7886..cf34e327b4f 100644 --- a/src/phases/show-ability-phase.ts +++ b/src/phases/show-ability-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; import { PokemonPhase } from "./pokemon-phase"; export class ShowAbilityPhase extends PokemonPhase { diff --git a/src/phases/show-party-exp-bar-phase.ts b/src/phases/show-party-exp-bar-phase.ts index 9920472e801..9e019b202a5 100644 --- a/src/phases/show-party-exp-bar-phase.ts +++ b/src/phases/show-party-exp-bar-phase.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; -import { ExpNotification } from "#app/enums/exp-notification.js"; -import { ExpBoosterModifier } from "#app/modifier/modifier.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { ExpNotification } from "#app/enums/exp-notification"; +import { ExpBoosterModifier } from "#app/modifier/modifier"; +import * as Utils from "#app/utils"; import { HidePartyExpBarPhase } from "./hide-party-exp-bar-phase"; import { LevelUpPhase } from "./level-up-phase"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; diff --git a/src/phases/show-trainer-phase.ts b/src/phases/show-trainer-phase.ts index 8a869f582d8..26ccddd53fc 100644 --- a/src/phases/show-trainer-phase.ts +++ b/src/phases/show-trainer-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { PlayerGender } from "#app/enums/player-gender.js"; +import BattleScene from "#app/battle-scene"; +import { PlayerGender } from "#app/enums/player-gender"; import { BattlePhase } from "./battle-phase"; export class ShowTrainerPhase extends BattlePhase { diff --git a/src/phases/summon-missing-phase.ts b/src/phases/summon-missing-phase.ts index bb9607285ad..83ac8779dd8 100644 --- a/src/phases/summon-missing-phase.ts +++ b/src/phases/summon-missing-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; +import BattleScene from "#app/battle-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; import i18next from "i18next"; import { SummonPhase } from "./summon-phase"; diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index f65a2063d4c..2645060c547 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -1,12 +1,12 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattleType } from "#app/battle.js"; -import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball.js"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms.js"; -import { TrainerSlot } from "#app/data/trainer-config.js"; -import { PlayerGender } from "#app/enums/player-gender.js"; -import { addPokeballOpenParticles } from "#app/field/anims.js"; -import Pokemon, { FieldPosition } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; +import BattleScene from "#app/battle-scene"; +import { BattleType } from "#app/battle"; +import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball"; +import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; +import { TrainerSlot } from "#app/data/trainer-config"; +import { PlayerGender } from "#app/enums/player-gender"; +import { addPokeballOpenParticles } from "#app/field/anims"; +import Pokemon, { FieldPosition } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; import i18next from "i18next"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; import { PostSummonPhase } from "./post-summon-phase"; diff --git a/src/phases/switch-biome-phase.ts b/src/phases/switch-biome-phase.ts index f20cd59b240..9cf5635a39f 100644 --- a/src/phases/switch-biome-phase.ts +++ b/src/phases/switch-biome-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { Biome } from "#app/enums/biome.js"; -import { getBiomeKey } from "#app/field/arena.js"; +import BattleScene from "#app/battle-scene"; +import { Biome } from "#app/enums/biome"; +import { getBiomeKey } from "#app/field/arena"; import { BattlePhase } from "./battle-phase"; export class SwitchBiomePhase extends BattlePhase { diff --git a/src/phases/switch-phase.ts b/src/phases/switch-phase.ts index 93b0943febf..b1a2e991ed8 100644 --- a/src/phases/switch-phase.ts +++ b/src/phases/switch-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler"; +import { Mode } from "#app/ui/ui"; import { BattlePhase } from "./battle-phase"; import { SwitchSummonPhase } from "./switch-summon-phase"; diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index 8201f2879ed..2a5fd0cc3ac 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -1,13 +1,13 @@ -import BattleScene from "#app/battle-scene.js"; -import { applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr } from "#app/data/ability.js"; -import { allMoves, ForceSwitchOutAttr } from "#app/data/move.js"; -import { getPokeballTintColor } from "#app/data/pokeball.js"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms.js"; -import { TrainerSlot } from "#app/data/trainer-config.js"; -import Pokemon from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { SwitchEffectTransferModifier } from "#app/modifier/modifier.js"; -import { Command } from "#app/ui/command-ui-handler.js"; +import BattleScene from "#app/battle-scene"; +import { applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr } from "#app/data/ability"; +import { allMoves, ForceSwitchOutAttr } from "#app/data/move"; +import { getPokeballTintColor } from "#app/data/pokeball"; +import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; +import { TrainerSlot } from "#app/data/trainer-config"; +import Pokemon from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { SwitchEffectTransferModifier } from "#app/modifier/modifier"; +import { Command } from "#app/ui/command-ui-handler"; import i18next from "i18next"; import { PostSummonPhase } from "./post-summon-phase"; import { SummonPhase } from "./summon-phase"; diff --git a/src/phases/test-message-phase.ts b/src/phases/test-message-phase.ts index 14fed24ef4b..464a5ed1f94 100644 --- a/src/phases/test-message-phase.ts +++ b/src/phases/test-message-phase.ts @@ -1,4 +1,4 @@ -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { MessagePhase } from "./message-phase"; export class TestMessagePhase extends MessagePhase { diff --git a/src/phases/title-phase.ts b/src/phases/title-phase.ts index 4c89b725c2d..52503501837 100644 --- a/src/phases/title-phase.ts +++ b/src/phases/title-phase.ts @@ -1,21 +1,21 @@ -import { loggedInUser } from "#app/account.js"; -import BattleScene from "#app/battle-scene.js"; -import { BattleType } from "#app/battle.js"; -import { getDailyRunStarters, fetchDailyRunSeed } from "#app/data/daily-run.js"; -import { Gender } from "#app/data/gender.js"; -import { getBiomeKey } from "#app/field/arena.js"; -import { GameModes, GameMode, getGameMode } from "#app/game-mode.js"; -import { regenerateModifierPoolThresholds, ModifierPoolType, modifierTypes, getDailyRunStarterModifiers } from "#app/modifier/modifier-type.js"; -import { Phase } from "#app/phase.js"; -import { SessionSaveData } from "#app/system/game-data.js"; -import { Unlockables } from "#app/system/unlockables.js"; -import { vouchers } from "#app/system/voucher.js"; -import { OptionSelectItem, OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler.js"; -import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler.js"; -import { Mode } from "#app/ui/ui.js"; +import { loggedInUser } from "#app/account"; +import BattleScene from "#app/battle-scene"; +import { BattleType } from "#app/battle"; +import { getDailyRunStarters, fetchDailyRunSeed } from "#app/data/daily-run"; +import { Gender } from "#app/data/gender"; +import { getBiomeKey } from "#app/field/arena"; +import { GameModes, GameMode, getGameMode } from "#app/game-mode"; +import { regenerateModifierPoolThresholds, ModifierPoolType, modifierTypes, getDailyRunStarterModifiers } from "#app/modifier/modifier-type"; +import { Phase } from "#app/phase"; +import { SessionSaveData } from "#app/system/game-data"; +import { Unlockables } from "#app/system/unlockables"; +import { vouchers } from "#app/system/voucher"; +import { OptionSelectItem, OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler"; +import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; -import { Modifier } from "#app/modifier/modifier.js"; +import * as Utils from "#app/utils"; +import { Modifier } from "#app/modifier/modifier"; import { CheckSwitchPhase } from "./check-switch-phase"; import { EncounterPhase } from "./encounter-phase"; import { SelectChallengePhase } from "./select-challenge-phase"; diff --git a/src/phases/toggle-double-position-phase.ts b/src/phases/toggle-double-position-phase.ts index fe3d0482483..563af8575d7 100644 --- a/src/phases/toggle-double-position-phase.ts +++ b/src/phases/toggle-double-position-phase.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { FieldPosition } from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { FieldPosition } from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; export class ToggleDoublePositionPhase extends BattlePhase { diff --git a/src/phases/trainer-message-test-phase.ts b/src/phases/trainer-message-test-phase.ts index 4ea451660c3..8075dd761e2 100644 --- a/src/phases/trainer-message-test-phase.ts +++ b/src/phases/trainer-message-test-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { trainerConfigs } from "#app/data/trainer-config.js"; -import { TrainerType } from "#app/enums/trainer-type.js"; +import BattleScene from "#app/battle-scene"; +import { trainerConfigs } from "#app/data/trainer-config"; +import { TrainerType } from "#app/enums/trainer-type"; import { BattlePhase } from "./battle-phase"; import { TestMessagePhase } from "./test-message-phase"; diff --git a/src/phases/trainer-victory-phase.ts b/src/phases/trainer-victory-phase.ts index a38874c9acd..e925f0c47d4 100644 --- a/src/phases/trainer-victory-phase.ts +++ b/src/phases/trainer-victory-phase.ts @@ -1,10 +1,10 @@ -import BattleScene from "#app/battle-scene.js"; -import { getCharVariantFromDialogue } from "#app/data/dialogue.js"; -import { TrainerType } from "#app/enums/trainer-type.js"; -import { modifierTypes } from "#app/modifier/modifier-type.js"; -import { vouchers } from "#app/system/voucher.js"; +import BattleScene from "#app/battle-scene"; +import { getCharVariantFromDialogue } from "#app/data/dialogue"; +import { TrainerType } from "#app/enums/trainer-type"; +import { modifierTypes } from "#app/modifier/modifier-type"; +import { vouchers } from "#app/system/voucher"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { BattlePhase } from "./battle-phase"; import { ModifierRewardPhase } from "./modifier-reward-phase"; import { MoneyRewardPhase } from "./money-reward-phase"; diff --git a/src/phases/turn-end-phase.ts b/src/phases/turn-end-phase.ts index c8bd3398bb5..724a5206d74 100644 --- a/src/phases/turn-end-phase.ts +++ b/src/phases/turn-end-phase.ts @@ -1,12 +1,12 @@ -import BattleScene from "#app/battle-scene.js"; -import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/ability.js"; -import { BattlerTagLapseType } from "#app/data/battler-tags.js"; -import { TerrainType } from "#app/data/terrain.js"; -import { WeatherType } from "#app/enums/weather-type.js"; -import { TurnEndEvent } from "#app/events/battle-scene.js"; -import Pokemon from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { TurnHealModifier, EnemyTurnHealModifier, EnemyStatusEffectHealChanceModifier, TurnStatusEffectModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier.js"; +import BattleScene from "#app/battle-scene"; +import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/ability"; +import { BattlerTagLapseType } from "#app/data/battler-tags"; +import { TerrainType } from "#app/data/terrain"; +import { WeatherType } from "#app/enums/weather-type"; +import { TurnEndEvent } from "#app/events/battle-scene"; +import Pokemon from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { TurnHealModifier, EnemyTurnHealModifier, EnemyStatusEffectHealChanceModifier, TurnStatusEffectModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier"; import i18next from "i18next"; import { FieldPhase } from "./field-phase"; import { PokemonHealPhase } from "./pokemon-heal-phase"; diff --git a/src/phases/turn-init-phase.ts b/src/phases/turn-init-phase.ts index a999d57ca0f..568cfdc5714 100644 --- a/src/phases/turn-init-phase.ts +++ b/src/phases/turn-init-phase.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex } from "#app/battle.js"; -import { TurnInitEvent } from "#app/events/battle-scene.js"; -import { PlayerPokemon } from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex } from "#app/battle"; +import { TurnInitEvent } from "#app/events/battle-scene"; +import { PlayerPokemon } from "#app/field/pokemon"; import i18next from "i18next"; import { FieldPhase } from "./field-phase"; import { ToggleDoublePositionPhase } from "./toggle-double-position-phase"; diff --git a/src/phases/unavailable-phase.ts b/src/phases/unavailable-phase.ts index 4757af5e15d..59bfca7875e 100644 --- a/src/phases/unavailable-phase.ts +++ b/src/phases/unavailable-phase.ts @@ -1,6 +1,6 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { Mode } from "#app/ui/ui"; import { LoginPhase } from "./login-phase"; export class UnavailablePhase extends Phase { diff --git a/src/phases/unlock-phase.ts b/src/phases/unlock-phase.ts index 1662afaa758..65060309a6c 100644 --- a/src/phases/unlock-phase.ts +++ b/src/phases/unlock-phase.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; -import { Phase } from "#app/phase.js"; -import { Unlockables, getUnlockableName } from "#app/system/unlockables.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { Unlockables, getUnlockableName } from "#app/system/unlockables"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; export class UnlockPhase extends Phase { diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index b7587de4dbb..9679a79a37d 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -1,8 +1,8 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex, BattleType } from "#app/battle.js"; -import { modifierTypes } from "#app/modifier/modifier-type.js"; -import { ExpShareModifier, ExpBalanceModifier, MultipleParticipantExpBonusModifier, PokemonExpBoosterModifier } from "#app/modifier/modifier.js"; -import * as Utils from "#app/utils.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex, BattleType } from "#app/battle"; +import { modifierTypes } from "#app/modifier/modifier-type"; +import { ExpShareModifier, ExpBalanceModifier, MultipleParticipantExpBonusModifier, PokemonExpBoosterModifier } from "#app/modifier/modifier"; +import * as Utils from "#app/utils"; import Overrides from "#app/overrides"; import { BattleEndPhase } from "./battle-end-phase"; import { NewBattlePhase } from "./new-battle-phase"; diff --git a/src/phases/weather-effect-phase.ts b/src/phases/weather-effect-phase.ts index ccfc9abb64f..e85ef0326f6 100644 --- a/src/phases/weather-effect-phase.ts +++ b/src/phases/weather-effect-phase.ts @@ -2,7 +2,7 @@ import BattleScene from "#app/battle-scene"; import { applyPreWeatherEffectAbAttrs, SuppressWeatherEffectAbAttr, PreWeatherDamageAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr } from "#app/data/ability.js"; import { CommonAnim } from "#app/data/battle-anims"; import { Weather, getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weather"; -import { BattlerTagType } from "#app/enums/battler-tag-type.js"; +import { BattlerTagType } from "#app/enums/battler-tag-type"; import { WeatherType } from "#app/enums/weather-type"; import Pokemon, { HitResult } from "#app/field/pokemon"; import * as Utils from "#app/utils"; diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 3d24458a06c..705fd5143a4 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -2,17 +2,17 @@ import i18next from "i18next"; import LanguageDetector from "i18next-browser-languagedetector"; import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor"; -import { caEsConfig} from "#app/locales/ca_ES/config.js"; -import { deConfig } from "#app/locales/de/config.js"; -import { enConfig } from "#app/locales/en/config.js"; -import { esConfig } from "#app/locales/es/config.js"; -import { frConfig } from "#app/locales/fr/config.js"; -import { itConfig } from "#app/locales/it/config.js"; -import { koConfig } from "#app/locales/ko/config.js"; -import { jaConfig } from "#app/locales/ja/config.js"; -import { ptBrConfig } from "#app/locales/pt_BR/config.js"; -import { zhCnConfig } from "#app/locales/zh_CN/config.js"; -import { zhTwConfig } from "#app/locales/zh_TW/config.js"; +import { caEsConfig} from "#app/locales/ca_ES/config"; +import { deConfig } from "#app/locales/de/config"; +import { enConfig } from "#app/locales/en/config"; +import { esConfig } from "#app/locales/es/config"; +import { frConfig } from "#app/locales/fr/config"; +import { itConfig } from "#app/locales/it/config"; +import { koConfig } from "#app/locales/ko/config"; +import { jaConfig } from "#app/locales/ja/config"; +import { ptBrConfig } from "#app/locales/pt_BR/config"; +import { zhCnConfig } from "#app/locales/zh_CN/config"; +import { zhTwConfig } from "#app/locales/zh_TW/config"; interface LoadingFontFaceProperty { face: FontFace, diff --git a/src/system/arena-data.ts b/src/system/arena-data.ts index 886129edcf6..5b907805372 100644 --- a/src/system/arena-data.ts +++ b/src/system/arena-data.ts @@ -2,7 +2,7 @@ import { Arena } from "../field/arena"; import { ArenaTag } from "../data/arena-tag"; import { Biome } from "#enums/biome"; import { Weather } from "../data/weather"; -import { Terrain } from "#app/data/terrain.js"; +import { Terrain } from "#app/data/terrain"; export default class ArenaData { public biome: Biome; diff --git a/src/system/challenge-data.ts b/src/system/challenge-data.ts index 69df11dd395..394d63867be 100644 --- a/src/system/challenge-data.ts +++ b/src/system/challenge-data.ts @@ -1,4 +1,4 @@ -import { Challenge, copyChallenge } from "#app/data/challenge.js"; +import { Challenge, copyChallenge } from "#app/data/challenge"; export default class ChallengeData { public id: integer; diff --git a/src/system/egg-data.ts b/src/system/egg-data.ts index b4bd4368bd9..785ae364efe 100644 --- a/src/system/egg-data.ts +++ b/src/system/egg-data.ts @@ -2,7 +2,7 @@ import { EggTier } from "#enums/egg-type"; import { Species } from "#enums/species"; import { VariantTier } from "#enums/variant-tiers"; import { EGG_SEED, Egg } from "../data/egg"; -import { EggSourceType } from "#app/enums/egg-source-types.js"; +import { EggSourceType } from "#app/enums/egg-source-types"; export default class EggData { public id: integer; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 800b8baecff..677bbe4add6 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -30,20 +30,20 @@ import { TrainerVariant } from "../field/trainer"; import { Variant } from "#app/data/variant"; import {setSettingGamepad, SettingGamepad, settingGamepadDefaults} from "./settings/settings-gamepad"; import {setSettingKeyboard, SettingKeyboard} from "#app/system/settings/settings-keyboard"; -import { TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; -import { EnemyAttackStatusEffectChanceModifier } from "../modifier/modifier"; -import { StatusEffect } from "#app/data/status-effect.js"; +import { TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena"; +import * as Modifier from "../modifier/modifier"; +import { StatusEffect } from "#app/data/status-effect"; import ChallengeData from "./challenge-data"; import { Device } from "#enums/devices"; import { GameDataType } from "#enums/game-data-type"; import { Moves } from "#enums/moves"; import { PlayerGender } from "#enums/player-gender"; import { Species } from "#enums/species"; -import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; -import { WeatherType } from "#app/enums/weather-type.js"; -import { TerrainType } from "#app/data/terrain.js"; -import { OutdatedPhase } from "#app/phases/outdated-phase.js"; -import { ReloadSessionPhase } from "#app/phases/reload-session-phase.js"; +import { applyChallenges, ChallengeType } from "#app/data/challenge"; +import { WeatherType } from "#app/enums/weather-type"; +import { TerrainType } from "#app/data/terrain"; +import { OutdatedPhase } from "#app/phases/outdated-phase"; +import { ReloadSessionPhase } from "#app/phases/reload-session-phase"; import { RUN_HISTORY_LIMIT } from "#app/ui/run-history-ui-handler"; import { applySessionDataPatches, applySettingsDataPatches, applySystemDataPatches } from "./version-converter"; @@ -1065,10 +1065,8 @@ export class GameData { // TODO //scene.arena.tags = sessionData.arena.tags; - const modifiersModule = await import("../modifier/modifier"); - for (const modifierData of sessionData.modifiers) { - const modifier = modifierData.toModifier(scene, modifiersModule[modifierData.className]); + const modifier = modifierData.toModifier(scene, Modifier[modifierData.className]); if (modifier) { scene.addModifier(modifier, true); } @@ -1077,7 +1075,7 @@ export class GameData { scene.updateModifiers(true); for (const enemyModifierData of sessionData.enemyModifiers) { - const modifier = enemyModifierData.toModifier(scene, modifiersModule[enemyModifierData.className]); + const modifier = enemyModifierData.toModifier(scene, Modifier[enemyModifierData.className]); if (modifier) { scene.addEnemyModifier(modifier, true); } @@ -1233,7 +1231,7 @@ export class GameData { if (md?.className === "ExpBalanceModifier") { // Temporarily limit EXP Balance until it gets reworked md.stackCount = Math.min(md.stackCount, 4); } - if (md instanceof EnemyAttackStatusEffectChanceModifier && md.effect === StatusEffect.FREEZE || md.effect === StatusEffect.SLEEP) { + if (md instanceof Modifier.EnemyAttackStatusEffectChanceModifier && md.effect === StatusEffect.FREEZE || md.effect === StatusEffect.SLEEP) { continue; } ret.push(new PersistentModifierData(md, player)); diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index 6b46b6fe96c..bc88c21e1e1 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -8,7 +8,7 @@ import SettingsUiHandler from "#app/ui/settings/settings-ui-handler"; import { EaseType } from "#enums/ease-type"; import { MoneyFormat } from "#enums/money-format"; import { PlayerGender } from "#enums/player-gender"; -import { getIsInitialized, initI18n } from "#app/plugins/i18n.js"; +import { getIsInitialized, initI18n } from "#app/plugins/i18n"; import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; function getTranslation(key: string): string { diff --git a/src/system/voucher.ts b/src/system/voucher.ts index 2f94308d9c8..06edfe5c6a6 100644 --- a/src/system/voucher.ts +++ b/src/system/voucher.ts @@ -3,8 +3,8 @@ import i18next from "i18next"; import { AchvTier, achvs, getAchievementDescription } from "./achv"; import { PlayerGender } from "#enums/player-gender"; import { TrainerType } from "#enums/trainer-type"; -import { ConditionFn } from "#app/@types/common.js"; -import { trainerConfigs } from "#app/data/trainer-config.js"; +import { ConditionFn } from "#app/@types/common"; +import { trainerConfigs } from "#app/data/trainer-config"; export enum VoucherType { REGULAR, diff --git a/src/test/abilities/tera_shell.test.ts b/src/test/abilities/tera_shell.test.ts index f9cb2935619..6a6b7bb252b 100644 --- a/src/test/abilities/tera_shell.test.ts +++ b/src/test/abilities/tera_shell.test.ts @@ -1,7 +1,7 @@ import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; -import { HitResult } from "#app/field/pokemon.js"; +import { HitResult } from "#app/field/pokemon"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/src/test/battle/damage_calculation.test.ts b/src/test/battle/damage_calculation.test.ts index 665000450be..9c7c9dc9d3e 100644 --- a/src/test/battle/damage_calculation.test.ts +++ b/src/test/battle/damage_calculation.test.ts @@ -1,4 +1,4 @@ -import { DamagePhase } from "#app/phases/damage-phase.js"; +import { DamagePhase } from "#app/phases/damage-phase"; import { toDmgValue } from "#app/utils"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; diff --git a/src/test/moves/gigaton_hammer.test.ts b/src/test/moves/gigaton_hammer.test.ts index 9379e9d98b2..0162375cdb2 100644 --- a/src/test/moves/gigaton_hammer.test.ts +++ b/src/test/moves/gigaton_hammer.test.ts @@ -1,4 +1,4 @@ -import { BattlerIndex } from "#app/battle.js"; +import { BattlerIndex } from "#app/battle"; import GameManager from "#app/test/utils/gameManager"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/moves/lunar_blessing.test.ts b/src/test/moves/lunar_blessing.test.ts index 73647716f06..92428c39029 100644 --- a/src/test/moves/lunar_blessing.test.ts +++ b/src/test/moves/lunar_blessing.test.ts @@ -1,5 +1,5 @@ -import { StatusEffect } from "#app/enums/status-effect.js"; -import { CommandPhase } from "#app/phases/command-phase.js"; +import { StatusEffect } from "#app/enums/status-effect"; +import { CommandPhase } from "#app/phases/command-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/test/utils/helpers/overridesHelper.ts b/src/test/utils/helpers/overridesHelper.ts index cc5f9018325..a42ef84b496 100644 --- a/src/test/utils/helpers/overridesHelper.ts +++ b/src/test/utils/helpers/overridesHelper.ts @@ -1,12 +1,12 @@ -import { StatusEffect } from "#app/data/status-effect.js"; +import { StatusEffect } from "#app/data/status-effect"; import { Weather, WeatherType } from "#app/data/weather"; -import { Abilities } from "#app/enums/abilities.js"; +import { Abilities } from "#app/enums/abilities"; import { Biome } from "#app/enums/biome"; -import { Moves } from "#app/enums/moves.js"; -import { Species } from "#app/enums/species.js"; +import { Moves } from "#app/enums/moves"; +import { Species } from "#app/enums/species"; import * as GameMode from "#app/game-mode"; import { GameModes, getGameMode } from "#app/game-mode"; -import { ModifierOverride } from "#app/modifier/modifier-type.js"; +import { ModifierOverride } from "#app/modifier/modifier-type"; import Overrides from "#app/overrides"; import { vi } from "vitest"; import { GameManagerHelper } from "./gameManagerHelper"; diff --git a/src/test/utils/testUtils.ts b/src/test/utils/testUtils.ts index 378c3d23fde..2265cf8d79c 100644 --- a/src/test/utils/testUtils.ts +++ b/src/test/utils/testUtils.ts @@ -1,4 +1,4 @@ -import { Moves } from "#app/enums/moves.js"; +import { Moves } from "#app/enums/moves"; import i18next, { type ParseKeys } from "i18next"; import { vi } from "vitest"; diff --git a/src/ui/ability-bar.ts b/src/ui/ability-bar.ts index b8259af9f3d..a924d545852 100644 --- a/src/ui/ability-bar.ts +++ b/src/ui/ability-bar.ts @@ -1,4 +1,4 @@ -import { getPokemonNameWithAffix } from "#app/messages.js"; +import { getPokemonNameWithAffix } from "#app/messages"; import BattleScene from "../battle-scene"; import Pokemon from "../field/pokemon"; import { TextStyle, addTextObject } from "./text"; diff --git a/src/ui/admin-ui-handler.ts b/src/ui/admin-ui-handler.ts index 5c91a36ab64..c48138853fc 100644 --- a/src/ui/admin-ui-handler.ts +++ b/src/ui/admin-ui-handler.ts @@ -1,9 +1,9 @@ -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { ModalConfig } from "./modal-ui-handler"; import { Mode } from "./ui"; import * as Utils from "../utils"; import { FormModalUiHandler } from "./form-modal-ui-handler"; -import { Button } from "#app/enums/buttons.js"; +import { Button } from "#app/enums/buttons"; export default class AdminUiHandler extends FormModalUiHandler { diff --git a/src/ui/arena-flyout.ts b/src/ui/arena-flyout.ts index 882c15d3d8c..42a2396e665 100644 --- a/src/ui/arena-flyout.ts +++ b/src/ui/arena-flyout.ts @@ -1,10 +1,10 @@ import { addTextObject, TextStyle } from "./text"; -import BattleScene from "#app/battle-scene.js"; -import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag.js"; -import { WeatherType } from "#app/data/weather.js"; -import { TerrainType } from "#app/data/terrain.js"; +import BattleScene from "#app/battle-scene"; +import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; +import { WeatherType } from "#app/data/weather"; +import { TerrainType } from "#app/data/terrain"; import { addWindow, WindowVariant } from "./ui-theme"; -import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; +import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena"; import { BattleSceneEventType, TurnEndEvent } from "../events/battle-scene"; import { ArenaTagType } from "#enums/arena-tag-type"; import TimeOfDayWidget from "./time-of-day-widget"; diff --git a/src/ui/ball-ui-handler.ts b/src/ui/ball-ui-handler.ts index 04691886d9c..332fe5f65b9 100644 --- a/src/ui/ball-ui-handler.ts +++ b/src/ui/ball-ui-handler.ts @@ -6,7 +6,7 @@ import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import { addWindow } from "./ui-theme"; import {Button} from "#enums/buttons"; -import { CommandPhase } from "#app/phases/command-phase.js"; +import { CommandPhase } from "#app/phases/command-phase"; export default class BallUiHandler extends UiHandler { private pokeballSelectContainer: Phaser.GameObjects.Container; diff --git a/src/ui/battle-flyout.ts b/src/ui/battle-flyout.ts index 6204fa2f928..fe561b76c9f 100644 --- a/src/ui/battle-flyout.ts +++ b/src/ui/battle-flyout.ts @@ -1,13 +1,13 @@ import { default as Pokemon } from "../field/pokemon"; import { addTextObject, TextStyle } from "./text"; import * as Utils from "../utils"; -import BattleScene from "#app/battle-scene.js"; -import Move from "#app/data/move.js"; +import BattleScene from "#app/battle-scene"; +import Move from "#app/data/move"; import { BattleSceneEventType, BerryUsedEvent, MoveUsedEvent } from "../events/battle-scene"; import { BerryType } from "#enums/berry-type"; import { Moves } from "#enums/moves"; import { UiTheme } from "#enums/ui-theme"; -import { getPokemonNameWithAffix } from "#app/messages.js"; +import { getPokemonNameWithAffix } from "#app/messages"; /** Container for info about a {@linkcode Move} */ interface MoveInfo { diff --git a/src/ui/command-ui-handler.ts b/src/ui/command-ui-handler.ts index 27ff923e9a3..764e71a8c3f 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -5,8 +5,8 @@ import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import i18next from "i18next"; import {Button} from "#enums/buttons"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { CommandPhase } from "#app/phases/command-phase.js"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { CommandPhase } from "#app/phases/command-phase"; export enum Command { FIGHT = 0, diff --git a/src/ui/dropdown.ts b/src/ui/dropdown.ts index 08d55b03cdb..4e1235c211d 100644 --- a/src/ui/dropdown.ts +++ b/src/ui/dropdown.ts @@ -1,5 +1,5 @@ -import BattleScene from "#app/battle-scene.js"; -import { SceneBase } from "#app/scene-base.js"; +import BattleScene from "#app/battle-scene"; +import { SceneBase } from "#app/scene-base"; import { addTextObject, TextStyle } from "./text"; import { addWindow, WindowVariant } from "./ui-theme"; import i18next from "i18next"; diff --git a/src/ui/egg-counter-container.ts b/src/ui/egg-counter-container.ts index a688b8b7efc..21cebf5d97e 100644 --- a/src/ui/egg-counter-container.ts +++ b/src/ui/egg-counter-container.ts @@ -1,7 +1,7 @@ -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { addWindow } from "./ui-theme"; import { addTextObject, TextStyle } from "./text"; -import { EggCountChangedEvent, EggEventType } from "#app/events/egg.js"; +import { EggCountChangedEvent, EggEventType } from "#app/events/egg"; import EggHatchSceneHandler from "./egg-hatch-scene-handler"; /** diff --git a/src/ui/egg-hatch-scene-handler.ts b/src/ui/egg-hatch-scene-handler.ts index 733873b974e..7b01ef7a3a6 100644 --- a/src/ui/egg-hatch-scene-handler.ts +++ b/src/ui/egg-hatch-scene-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import {Button} from "#enums/buttons"; -import { EggHatchPhase } from "#app/phases/egg-hatch-phase.js"; +import { EggHatchPhase } from "#app/phases/egg-hatch-phase"; export default class EggHatchSceneHandler extends UiHandler { public eggHatchContainer: Phaser.GameObjects.Container; diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index 4bbe88dabd9..60db9d19eef 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -5,11 +5,11 @@ import { Command } from "./command-ui-handler"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import * as Utils from "../utils"; -import { MoveCategory } from "#app/data/move.js"; +import { MoveCategory } from "#app/data/move"; import i18next from "i18next"; import {Button} from "#enums/buttons"; -import Pokemon, { PokemonMove } from "#app/field/pokemon.js"; -import { CommandPhase } from "#app/phases/command-phase.js"; +import Pokemon, { PokemonMove } from "#app/field/pokemon"; +import { CommandPhase } from "#app/phases/command-phase"; export default class FightUiHandler extends UiHandler { public static readonly MOVES_CONTAINER_NAME = "moves"; diff --git a/src/ui/filter-bar.ts b/src/ui/filter-bar.ts index 31d7c562da2..aa0f575d398 100644 --- a/src/ui/filter-bar.ts +++ b/src/ui/filter-bar.ts @@ -1,4 +1,4 @@ -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { DropDown, DropDownType } from "./dropdown"; import { StarterContainer } from "./starter-container"; import { addTextObject, getTextColor, TextStyle } from "./text"; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 98a19402a2b..9e025dbe086 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -15,15 +15,15 @@ import { addWindow } from "./ui-theme"; import { SpeciesFormChangeItemTrigger, FormChangeItem } from "../data/pokemon-forms"; import { getVariantTint } from "#app/data/variant"; import {Button} from "#enums/buttons"; -import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; +import { applyChallenges, ChallengeType } from "#app/data/challenge"; import MoveInfoOverlay from "./move-info-overlay"; import i18next from "i18next"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { CommandPhase } from "#app/phases/command-phase.js"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase.js"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { CommandPhase } from "#app/phases/command-phase"; +import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; const defaultMessage = i18next.t("partyUiHandler:choosePokemon"); diff --git a/src/ui/rename-form-ui-handler.ts b/src/ui/rename-form-ui-handler.ts index 33885509344..078177cafb1 100644 --- a/src/ui/rename-form-ui-handler.ts +++ b/src/ui/rename-form-ui-handler.ts @@ -1,7 +1,7 @@ import { FormModalUiHandler } from "./form-modal-ui-handler"; import { ModalConfig } from "./modal-ui-handler"; import i18next from "i18next"; -import { PlayerPokemon } from "#app/field/pokemon.js"; +import { PlayerPokemon } from "#app/field/pokemon"; export default class RenameFormUiHandler extends FormModalUiHandler { getModalTitle(config?: ModalConfig): string { diff --git a/src/ui/run-info-ui-handler.ts b/src/ui/run-info-ui-handler.ts index 7a183a11d29..d6bafb8599e 100644 --- a/src/ui/run-info-ui-handler.ts +++ b/src/ui/run-info-ui-handler.ts @@ -18,8 +18,7 @@ import { Type, getTypeRgb } from "../data/type"; import { TypeColor, TypeShadow } from "#app/enums/color"; import { getNatureStatMultiplier, getNatureName } from "../data/nature"; import { getVariantTint } from "#app/data/variant"; -import { PokemonHeldItemModifier, TerastallizeModifier } from "../modifier/modifier"; -import {modifierSortFunc} from "../modifier/modifier"; +import * as Modifier from "../modifier/modifier"; import { Species } from "#enums/species"; import { PlayerGender } from "#enums/player-gender"; @@ -68,7 +67,7 @@ export default class RunInfoUiHandler extends UiHandler { override async setup() { this.runContainer = this.scene.add.container(1, -(this.scene.game.canvas.height / 6) + 1); // The import of the modifiersModule is loaded here to sidestep async/await issues. - this.modifiersModule = await import("../modifier/modifier"); + this.modifiersModule = Modifier; this.runContainer.setVisible(false); } @@ -303,7 +302,7 @@ export default class RunInfoUiHandler extends UiHandler { const teraPokemon = {}; this.runInfo.enemyModifiers.forEach((m) => { const modifier = m.toModifier(this.scene, this.modifiersModule[m.className]); - if (modifier instanceof TerastallizeModifier) { + if (modifier instanceof Modifier.TerastallizeModifier) { const teraDetails = modifier?.getArgs(); const pkmnId = teraDetails[0]; teraPokemon[pkmnId] = teraDetails[1]; @@ -434,7 +433,7 @@ export default class RunInfoUiHandler extends UiHandler { modifierIconsContainer.setScale(0.45); for (const m of this.runInfo.modifiers) { const modifier = m.toModifier(this.scene, this.modifiersModule[m.className]); - if (modifier instanceof PokemonHeldItemModifier) { + if (modifier instanceof Modifier.PokemonHeldItemModifier) { continue; } const icon = modifier?.getIcon(this.scene, false); @@ -635,17 +634,17 @@ export default class RunInfoUiHandler extends UiHandler { // Endless/Endless Spliced have a different scale because Pokemon tend to accumulate more items in these runs. const heldItemsScale = (this.runInfo.gameMode === GameModes.SPLICED_ENDLESS || this.runInfo.gameMode === GameModes.ENDLESS) ? 0.25 : 0.5; const heldItemsContainer = this.scene.add.container(-82, 2); - const heldItemsList : PokemonHeldItemModifier[] = []; + const heldItemsList : Modifier.PokemonHeldItemModifier[] = []; if (this.runInfo.modifiers.length) { for (const m of this.runInfo.modifiers) { const modifier = m.toModifier(this.scene, this.modifiersModule[m.className]); - if (modifier instanceof PokemonHeldItemModifier && modifier.pokemonId === pokemon.id) { + if (modifier instanceof Modifier.PokemonHeldItemModifier && modifier.pokemonId === pokemon.id) { modifier.stackCount = m["stackCount"]; heldItemsList.push(modifier); } } if (heldItemsList.length > 0) { - (heldItemsList as PokemonHeldItemModifier[]).sort(modifierSortFunc); + (heldItemsList as Modifier.PokemonHeldItemModifier[]).sort(Modifier.modifierSortFunc); let row = 0; for (const [index, item] of heldItemsList.entries()) { if ( index > 36 ) { diff --git a/src/ui/save-slot-select-ui-handler.ts b/src/ui/save-slot-select-ui-handler.ts index e6ab0d3b3c3..89b20322a68 100644 --- a/src/ui/save-slot-select-ui-handler.ts +++ b/src/ui/save-slot-select-ui-handler.ts @@ -2,7 +2,7 @@ import i18next from "i18next"; import BattleScene from "../battle-scene"; import { Button } from "#enums/buttons"; import { GameMode } from "../game-mode"; -import { PokemonHeldItemModifier } from "../modifier/modifier"; +import * as Modifier from "../modifier/modifier"; import { SessionSaveData } from "../system/game-data"; import PokemonData from "../system/pokemon-data"; import * as Utils from "../utils"; @@ -306,14 +306,12 @@ class SessionSlot extends Phaser.GameObjects.Container { this.add(pokemonIconsContainer); - const modifiersModule = await import("../modifier/modifier"); - const modifierIconsContainer = this.scene.add.container(148, 30); modifierIconsContainer.setScale(0.5); let visibleModifierIndex = 0; for (const m of data.modifiers) { - const modifier = m.toModifier(this.scene, modifiersModule[m.className]); - if (modifier instanceof PokemonHeldItemModifier) { + const modifier = m.toModifier(this.scene, Modifier[m.className]); + if (modifier instanceof Modifier.PokemonHeldItemModifier) { continue; } const icon = modifier?.getIcon(this.scene, false); diff --git a/src/ui/settings/abstract-settings-ui-handler.ts b/src/ui/settings/abstract-settings-ui-handler.ts index f21f2ebcc9d..570377eab43 100644 --- a/src/ui/settings/abstract-settings-ui-handler.ts +++ b/src/ui/settings/abstract-settings-ui-handler.ts @@ -5,7 +5,7 @@ import { Mode } from "../ui"; import UiHandler from "../ui-handler"; import { addWindow } from "../ui-theme"; import {Button} from "#enums/buttons"; -import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler.js"; +import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler"; import NavigationMenu, {NavigationManager} from "#app/ui/settings/navigationMenu"; import { Setting, SettingKeys, SettingType } from "#app/system/settings/settings"; import i18next from "i18next"; diff --git a/src/ui/settings/move-touch-controls-handler.ts b/src/ui/settings/move-touch-controls-handler.ts index cf56bf47d3b..cff68fa523d 100644 --- a/src/ui/settings/move-touch-controls-handler.ts +++ b/src/ui/settings/move-touch-controls-handler.ts @@ -1,5 +1,5 @@ -import TouchControl from "#app/touch-controls.js"; -import UI from "#app/ui/ui.js"; +import TouchControl from "#app/touch-controls"; +import UI from "#app/ui/ui"; import { Scene } from "phaser"; export const TOUCH_CONTROL_POSITIONS_LANDSCAPE = "touchControlPositionsLandscape"; diff --git a/src/ui/settings/navigationMenu.ts b/src/ui/settings/navigationMenu.ts index 370b6f67c76..7d7761b7b69 100644 --- a/src/ui/settings/navigationMenu.ts +++ b/src/ui/settings/navigationMenu.ts @@ -1,6 +1,6 @@ import BattleScene from "#app/battle-scene"; import {Mode} from "#app/ui/ui"; -import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler.js"; +import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler"; import {addTextObject, setTextStyle, TextStyle} from "#app/ui/text"; import {addWindow} from "#app/ui/ui-theme"; import {Button} from "#enums/buttons"; diff --git a/src/ui/settings/settings-audio-ui-handler.ts b/src/ui/settings/settings-audio-ui-handler.ts index 4a895fc3170..86c6a9bce40 100644 --- a/src/ui/settings/settings-audio-ui-handler.ts +++ b/src/ui/settings/settings-audio-ui-handler.ts @@ -1,6 +1,6 @@ import BattleScene from "../../battle-scene"; import { Mode } from "../ui"; -"#app/inputs-controller.js"; +"#app/inputs-controller"; import AbstractSettingsUiHandler from "./abstract-settings-ui-handler"; import { SettingType } from "#app/system/settings/settings"; diff --git a/src/ui/settings/settings-display-ui-handler.ts b/src/ui/settings/settings-display-ui-handler.ts index 25dda6e9bfb..3d602c50a78 100644 --- a/src/ui/settings/settings-display-ui-handler.ts +++ b/src/ui/settings/settings-display-ui-handler.ts @@ -1,6 +1,6 @@ import BattleScene from "../../battle-scene"; import { Mode } from "../ui"; -"#app/inputs-controller.js"; +"#app/inputs-controller"; import AbstractSettingsUiHandler from "./abstract-settings-ui-handler"; import { SettingKeys, SettingType } from "#app/system/settings/settings"; diff --git a/src/ui/settings/settings-gamepad-ui-handler.ts b/src/ui/settings/settings-gamepad-ui-handler.ts index 902d7eff34e..63a9d2ab23b 100644 --- a/src/ui/settings/settings-gamepad-ui-handler.ts +++ b/src/ui/settings/settings-gamepad-ui-handler.ts @@ -12,7 +12,7 @@ import pad_xbox360 from "#app/configs/inputs/pad_xbox360"; import pad_dualshock from "#app/configs/inputs/pad_dualshock"; import pad_unlicensedSNES from "#app/configs/inputs/pad_unlicensedSNES"; import {InterfaceConfig} from "#app/inputs-controller"; -import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler.js"; +import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler"; import {Device} from "#enums/devices"; import {truncateString} from "#app/utils"; import i18next from "i18next"; diff --git a/src/ui/settings/settings-keyboard-ui-handler.ts b/src/ui/settings/settings-keyboard-ui-handler.ts index dc6de8c90dc..7e020034bc6 100644 --- a/src/ui/settings/settings-keyboard-ui-handler.ts +++ b/src/ui/settings/settings-keyboard-ui-handler.ts @@ -9,7 +9,7 @@ import { settingKeyboardOptions } from "#app/system/settings/settings-keyboard"; import {reverseValueToKeySetting, truncateString} from "#app/utils"; -import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler.js"; +import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler"; import {InterfaceConfig} from "#app/inputs-controller"; import {addTextObject, TextStyle} from "#app/ui/text"; import {deleteBind} from "#app/configs/inputs/configHandler"; diff --git a/src/ui/time-of-day-widget.ts b/src/ui/time-of-day-widget.ts index 5d2f184e679..ea80a6e524a 100644 --- a/src/ui/time-of-day-widget.ts +++ b/src/ui/time-of-day-widget.ts @@ -1,5 +1,5 @@ import * as Utils from "../utils"; -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { BattleSceneEventType } from "../events/battle-scene"; import { EaseType } from "#enums/ease-type"; import { TimeOfDay } from "#enums/time-of-day"; diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index 3c25ed34d61..67a4f7260e6 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -5,7 +5,7 @@ import * as Utils from "../utils"; import { TextStyle, addTextObject, getTextStyleOptions } from "./text"; import { getBattleCountSplashMessage, getSplashMessages } from "../data/splash-messages"; import i18next from "i18next"; -import { TimedEventDisplay } from "#app/timed-event-manager.js"; +import { TimedEventDisplay } from "#app/timed-event-manager"; export default class TitleUiHandler extends OptionSelectUiHandler { private titleContainer: Phaser.GameObjects.Container; diff --git a/vite.config.ts b/vite.config.ts index 8fa7d799f27..1fd85e2572f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,6 +10,7 @@ export const defaultConfig: UserConfig = { clearScreen: false, appType: "mpa", build: { + chunkSizeWarningLimit: 10000, minify: 'esbuild', sourcemap: false, rollupOptions: { From df250c8b90c7ca0ebc23906689409243f4484b90 Mon Sep 17 00:00:00 2001 From: Lugiad Date: Sun, 8 Sep 2024 13:57:17 +0200 Subject: [PATCH 07/12] [Localization] New translations batch locales (Move-disabling effects, abilities triggers, error messages and some misc ajustements) (#4068) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update battle.json * Update battler-tags.json * Update battle.json * Update battle.json * Update battler-tags.json * Update battle.json * Update battler-tags.json * Update battler-tags.json * Update battle.json * Update battle.json * Update battler-tags.json * Update battler-tags.json * Update battle.json * Update battle.json * Update battler-tags.json * Update battler-tags.json * Update battle.json * Update battle.json * Update battler-tags.json * Update battle.json * Update battle.json * Update battle.json * Update battler-tags.json * Update battle.json * Update battle.json * Update src/locales/de/battle.json Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update src/locales/de/battler-tags.json Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update battler-tags.json * Update src/locales/ko/battle.json Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> * Update src/locales/ko/battler-tags.json Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> * Update src/locales/it/battle.json Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> * Update src/locales/it/battler-tags.json Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> * Update menu.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update menu.json * Update menu.json * Update menu.json * Update menu.json * Update menu.json * Update menu.json * Update menu.json * Update menu.json * Update src/locales/de/ability-trigger.json Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update src/locales/de/ability-trigger.json Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update src/locales/de/menu.json Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update src/locales/ko/ability-trigger.json Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> * Update src/locales/ko/menu.json Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> * Update src/locales/ko/ability-trigger.json Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> * Update src/locales/ko/menu.json Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> * Update menu.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update ability-trigger.json * Update menu.json * Update ability-trigger.json * Update battle.json * Update battler-tags.json * Update src/locales/zh_CN/battle.json Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> * Update src/locales/zh_TW/battle.json Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update menu.json * Update battler-tags.json * Update battle.json * Update ability-trigger.json * Update battler-tags.json * Update battler-tags.json * Update battler-tags.json * Update battler-tags.json * Update modifier-type.json * Update menu.json * Update battle.json * Update tutorial.json * Update tutorial.json * Update egg.json * Update battle.json * Update battle.json * Update tutorial.json * Update egg.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update modifier-type.json * Update challenges.json * Update src/locales/ko/modifier-type.json Co-authored-by: Enoch * Update src/locales/ko/modifier-type.json Co-authored-by: Enoch * Update src/locales/ja/battle.json Co-authored-by: Chapybara-jp * Update src/locales/ja/menu.json Co-authored-by: Chapybara-jp * Update src/locales/ja/modifier-type.json Co-authored-by: Chapybara-jp * Update src/locales/ja/modifier-type.json Co-authored-by: Chapybara-jp * Update src/locales/ja/modifier-type.json Co-authored-by: Chapybara-jp * Update dialogue.json * Update dialogue-misc.json * Update dialogue-final-boss.json * Update dialogue-double-battle.json * Update ability-trigger.json * Update achv.json * Update arena-tag.json * Update battle.json * Update battler-tags.json * Update command-ui-handler.json * Update menu.json * Update modifier-type.json * Update modifier.json * Update move-trigger.json * Update pokemon-info-container.json * Update pokemon-info.json * Update splash-messages.json * Update status-effect.json * Update tutorial.json * Update voucher.json * Update weather.json * Update ability-trigger.json * Update src/locales/de/modifier-type.json Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update src/locales/de/modifier-type.json Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update modifier-type.json * Update bgm-name.json * Update bgm-name.json * Update src/locales/it/menu.json Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> * types_ja.png update * Apply suggestions from code review Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> --------- Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> Co-authored-by: Enoch Co-authored-by: Chapybara-jp --- public/images/types_ja.png | Bin 9300 -> 7057 bytes src/locales/de/ability-trigger.json | 4 +- src/locales/de/battle.json | 3 +- src/locales/de/battler-tags.json | 6 +- src/locales/de/menu.json | 6 +- src/locales/de/modifier-type.json | 8 +- src/locales/en/ability-trigger.json | 4 +- src/locales/en/challenges.json | 4 +- src/locales/es/ability-trigger.json | 2 + src/locales/es/battle.json | 3 +- src/locales/es/battler-tags.json | 4 +- src/locales/es/menu.json | 4 +- src/locales/es/modifier-type.json | 8 +- src/locales/fr/ability-trigger.json | 18 +-- src/locales/fr/achv.json | 4 +- src/locales/fr/arena-tag.json | 2 +- src/locales/fr/battle.json | 117 +++++++++--------- src/locales/fr/battler-tags.json | 32 ++--- src/locales/fr/command-ui-handler.json | 4 +- src/locales/fr/dialogue-double-battle.json | 42 +++---- src/locales/fr/dialogue-final-boss.json | 6 +- src/locales/fr/dialogue-misc.json | 6 +- src/locales/fr/dialogue.json | 132 ++++++++++----------- src/locales/fr/egg.json | 4 +- src/locales/fr/menu.json | 26 ++-- src/locales/fr/modifier-type.json | 24 ++-- src/locales/fr/modifier.json | 2 +- src/locales/fr/move-trigger.json | 16 +-- src/locales/fr/pokemon-info-container.json | 8 +- src/locales/fr/pokemon-info.json | 4 +- src/locales/fr/splash-messages.json | 66 +++++------ src/locales/fr/status-effect.json | 4 +- src/locales/fr/tutorial.json | 18 +-- src/locales/fr/voucher.json | 10 +- src/locales/fr/weather.json | 54 ++++----- src/locales/it/ability-trigger.json | 4 +- src/locales/it/battle.json | 3 +- src/locales/it/battler-tags.json | 6 +- src/locales/it/menu.json | 6 +- src/locales/it/modifier-type.json | 8 +- src/locales/ja/ability-trigger.json | 4 +- src/locales/ja/battle.json | 3 +- src/locales/ja/battler-tags.json | 4 +- src/locales/ja/menu.json | 4 +- src/locales/ja/modifier-type.json | 8 +- src/locales/ko/ability-trigger.json | 4 +- src/locales/ko/battle.json | 3 +- src/locales/ko/battler-tags.json | 6 +- src/locales/ko/menu.json | 4 +- src/locales/ko/modifier-type.json | 8 +- src/locales/pt_BR/battle.json | 2 +- src/locales/pt_BR/battler-tags.json | 2 +- src/locales/pt_BR/modifier-type.json | 8 +- src/locales/zh_CN/ability-trigger.json | 4 +- src/locales/zh_CN/battle.json | 3 +- src/locales/zh_CN/battler-tags.json | 6 +- src/locales/zh_CN/menu.json | 6 +- src/locales/zh_CN/modifier-type.json | 8 +- src/locales/zh_TW/ability-trigger.json | 4 +- src/locales/zh_TW/battle.json | 3 +- src/locales/zh_TW/battler-tags.json | 6 +- src/locales/zh_TW/menu.json | 6 +- src/locales/zh_TW/modifier-type.json | 8 +- 63 files changed, 444 insertions(+), 352 deletions(-) diff --git a/public/images/types_ja.png b/public/images/types_ja.png index e60d8e071aa42c3ae09c7ae30937704d465606a0..a6f3b00607f6eaa8c3a4f88cf54bc4f14fbd6710 100644 GIT binary patch delta 4764 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 YXO}q%hF2Z^R{rltSIYofpke9vKl Date: Sun, 8 Sep 2024 20:48:09 -0700 Subject: [PATCH 08/12] [Bug] Fix incorrect defensive properties on Terastallized Pokemon (#4070) * Fix incorrect defensive properties on Terastallized Pokemon * Add tests to `effectiveness.test.ts` * Suppress errors from Tera achievement validation --- src/field/pokemon.ts | 5 +++- src/test/moves/effectiveness.test.ts | 39 +++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 863b0f41d2c..6d29e30254a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1049,6 +1049,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const teraType = this.getTeraType(); if (teraType !== Type.UNKNOWN) { types.push(teraType); + if (forDefend) { + return types; + } } } @@ -1368,7 +1371,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { : 1); applyMoveAttrs(VariableMoveTypeMultiplierAttr, source, this, move, typeMultiplier); - if (this.getTypes().find(t => move.isTypeImmune(source, this, t))) { + if (this.getTypes(true, true).find(t => move.isTypeImmune(source, this, t))) { typeMultiplier.value = 0; } diff --git a/src/test/moves/effectiveness.test.ts b/src/test/moves/effectiveness.test.ts index af44586b69d..d1903c79844 100644 --- a/src/test/moves/effectiveness.test.ts +++ b/src/test/moves/effectiveness.test.ts @@ -1,23 +1,32 @@ import { allMoves } from "#app/data/move"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { TrainerSlot } from "#app/data/trainer-config"; +import { Type } from "#app/data/type"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import * as Messages from "#app/messages"; +import { TerastallizeModifier } from "#app/modifier/modifier"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; function testMoveEffectiveness(game: GameManager, move: Moves, targetSpecies: Species, - expected: number, targetAbility: Abilities = Abilities.BALL_FETCH): void { + expected: number, targetAbility: Abilities = Abilities.BALL_FETCH, teraType?: Type): void { // Suppress getPokemonNameWithAffix because it calls on a null battle spec vi.spyOn(Messages, "getPokemonNameWithAffix").mockReturnValue(""); game.override.enemyAbility(targetAbility); + + if (teraType !== undefined) { + game.override.enemyHeldItems([{ name:"TERA_SHARD", type: teraType }]); + } + const user = game.scene.addPlayerPokemon(getPokemonSpecies(Species.SNORLAX), 5); const target = game.scene.addEnemyPokemon(getPokemonSpecies(targetSpecies), 5, TrainerSlot.NONE); expect(target.getMoveEffectiveness(user, allMoves[move])).toBe(expected); + user.destroy(); + target.destroy(); } describe("Moves - Type Effectiveness", () => { @@ -29,6 +38,8 @@ describe("Moves - Type Effectiveness", () => { type: Phaser.HEADLESS, }); game = new GameManager(phaserGame); + TerastallizeModifier.prototype.apply = (args) => true; + game.override.ability(Abilities.BALL_FETCH); }); @@ -67,4 +78,30 @@ describe("Moves - Type Effectiveness", () => { it("Electric-type attacks are negated by Volt Absorb", () => testMoveEffectiveness(game, Moves.THUNDERBOLT, Species.GYARADOS, 0, Abilities.VOLT_ABSORB) ); + + it("Electric-type attacks are super-effective against Tera-Water Pokemon", + () => testMoveEffectiveness(game, Moves.THUNDERBOLT, Species.EXCADRILL, 2, Abilities.BALL_FETCH, Type.WATER) + ); + + it("Powder moves have no effect on Grass-type Pokemon", + () => testMoveEffectiveness(game, Moves.SLEEP_POWDER, Species.AMOONGUSS, 0) + ); + + it("Powder moves have no effect on Tera-Grass Pokemon", + () => testMoveEffectiveness(game, Moves.SLEEP_POWDER, Species.SNORLAX, 0, Abilities.BALL_FETCH, Type.GRASS) + ); + + it("Prankster-boosted status moves have no effect on Dark-type Pokemon", + () => { + game.override.ability(Abilities.PRANKSTER); + testMoveEffectiveness(game, Moves.BABY_DOLL_EYES, Species.MIGHTYENA, 0); + } + ); + + it("Prankster-boosted status moves have no effect on Tera-Dark Pokemon", + () => { + game.override.ability(Abilities.PRANKSTER); + testMoveEffectiveness(game, Moves.BABY_DOLL_EYES, Species.SNORLAX, 0, Abilities.BALL_FETCH, Type.DARK); + } + ); }); From 06f98f6737ba959f2894c1dc48fbdac7e3ecf5ed Mon Sep 17 00:00:00 2001 From: "Adrian T." <68144167+torranx@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:50:47 +0800 Subject: [PATCH 09/12] [Bug] Fix console error from undefined stockpilingTag (#4118) --- src/data/move.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 19014c0eb30..e6e7f574671 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3472,7 +3472,7 @@ export class SpitUpPowerAttr extends VariablePowerAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const stockpilingTag = user.getTag(StockpilingTag); - if (stockpilingTag !== null && stockpilingTag.stockpiledCount > 0) { + if (stockpilingTag && stockpilingTag.stockpiledCount > 0) { const power = args[0] as Utils.IntegerHolder; power.value = this.multiplier * stockpilingTag.stockpiledCount; return true; @@ -3490,7 +3490,7 @@ export class SwallowHealAttr extends HealAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const stockpilingTag = user.getTag(StockpilingTag); - if (stockpilingTag !== null && stockpilingTag?.stockpiledCount > 0) { + if (stockpilingTag && stockpilingTag.stockpiledCount > 0) { const stockpiled = stockpilingTag.stockpiledCount; let healRatio: number; From 39b6a725175aa41b250719945dbf709768813daa Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Sun, 8 Sep 2024 22:10:47 -0700 Subject: [PATCH 10/12] [Bug] Fix #762: All Pokemon become invisible when capturing then switching with your only pokemon that was not fainted (#4025) * fix #762 by using slotIndex to add to party for now the new pokemon was ALWAYS just pushed to the party array. Now it's put into the slot that was also previously selected as the mon to release * add docs for `Pokemon.addToParty()` * add simple tests for addToParty * update `isBetween` docs. Remove `.js` imports --- src/constants.ts | 1 + src/field/pokemon.ts | 19 +++++++++++++--- src/phases/attempt-capture-phase.ts | 6 ++--- src/test/field/pokemon.test.ts | 35 +++++++++++++++++++++++++++++ src/utils.ts | 11 +++++++++ 5 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 src/constants.ts diff --git a/src/constants.ts b/src/constants.ts new file mode 100644 index 00000000000..a2f7e47b996 --- /dev/null +++ b/src/constants.ts @@ -0,0 +1 @@ +export const PLAYER_PARTY_MAX_SIZE = 6; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 6d29e30254a..e2f238e29af 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -58,6 +58,7 @@ import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; import { ToggleDoublePositionPhase } from "#app/phases/toggle-double-position-phase"; import { Challenges } from "#enums/challenges"; +import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; export enum FieldPosition { CENTER, @@ -4465,17 +4466,29 @@ export class EnemyPokemon extends Pokemon { return BattlerIndex.ENEMY + this.getFieldIndex(); } - addToParty(pokeballType: PokeballType) { + /** + * Add a new pokemon to the player's party (at `slotIndex` if set). + * @param pokeballType the type of pokeball the pokemon was caught with + * @param slotIndex an optional index to place the pokemon in the party + * @returns the pokemon that was added or null if the pokemon could not be added + */ + addToParty(pokeballType: PokeballType, slotIndex: number = -1) { const party = this.scene.getParty(); let ret: PlayerPokemon | null = null; - if (party.length < 6) { + if (party.length < PLAYER_PARTY_MAX_SIZE) { this.pokeball = pokeballType; this.metLevel = this.level; this.metBiome = this.scene.arena.biomeType; this.metSpecies = this.species.speciesId; const newPokemon = this.scene.addPlayerPokemon(this.species, this.level, this.abilityIndex, this.formIndex, this.gender, this.shiny, this.variant, this.ivs, this.nature, this); - party.push(newPokemon); + + if (Utils.isBetween(slotIndex, 0, PLAYER_PARTY_MAX_SIZE - 1)) { + party.splice(slotIndex, 0, newPokemon); + } else { + party.push(newPokemon); + } + ret = newPokemon; this.scene.triggerPokemonFormChange(newPokemon, SpeciesFormChangeActiveTrigger, true); } diff --git a/src/phases/attempt-capture-phase.ts b/src/phases/attempt-capture-phase.ts index 55a82affaf6..cf9ce997bfd 100644 --- a/src/phases/attempt-capture-phase.ts +++ b/src/phases/attempt-capture-phase.ts @@ -221,8 +221,8 @@ export class AttemptCapturePhase extends PokemonPhase { this.scene.clearEnemyHeldItemModifiers(); this.scene.field.remove(pokemon, true); }; - const addToParty = () => { - const newPokemon = pokemon.addToParty(this.pokeballType); + const addToParty = (slotIndex?: number) => { + const newPokemon = pokemon.addToParty(this.pokeballType, slotIndex); const modifiers = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier, false); if (this.scene.getParty().filter(p => p.isShiny()).length === 6) { this.scene.validateAchv(achvs.SHINY_PARTY); @@ -253,7 +253,7 @@ export class AttemptCapturePhase extends PokemonPhase { this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => { this.scene.ui.setMode(Mode.MESSAGE).then(() => { if (slotIndex < 6) { - addToParty(); + addToParty(slotIndex); } else { promptRelease(); } diff --git a/src/test/field/pokemon.test.ts b/src/test/field/pokemon.test.ts index d597cd5219c..f7c1cf8bc3d 100644 --- a/src/test/field/pokemon.test.ts +++ b/src/test/field/pokemon.test.ts @@ -1,6 +1,8 @@ import { Species } from "#app/enums/species"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import GameManager from "../utils/gameManager"; +import { PokeballType } from "#app/enums/pokeball"; +import BattleScene from "#app/battle-scene"; describe("Spec - Pokemon", () => { let phaserGame: Phaser.Game; @@ -28,4 +30,37 @@ describe("Spec - Pokemon", () => { expect(pkm.trySetStatus(undefined)).toBe(true); }); + + describe("Add To Party", () => { + let scene: BattleScene; + + beforeEach(async () => { + game.override.enemySpecies(Species.ZUBAT); + await game.classicMode.runToSummon([Species.ABRA, Species.ABRA, Species.ABRA, Species.ABRA, Species.ABRA]); // 5 Abra, only 1 slot left + scene = game.scene; + }); + + it("should append a new pokemon by default", async () => { + const zubat = scene.getEnemyPokemon()!; + zubat.addToParty(PokeballType.LUXURY_BALL); + + const party = scene.getParty(); + expect(party).toHaveLength(6); + party.forEach((pkm, index) =>{ + expect(pkm.species.speciesId).toBe(index === 5 ? Species.ZUBAT : Species.ABRA); + }); + }); + + it("should put a new pokemon into the passed slotIndex", async () => { + const slotIndex = 1; + const zubat = scene.getEnemyPokemon()!; + zubat.addToParty(PokeballType.LUXURY_BALL, slotIndex); + + const party = scene.getParty(); + expect(party).toHaveLength(6); + party.forEach((pkm, index) =>{ + expect(pkm.species.speciesId).toBe(index === slotIndex ? Species.ZUBAT : Species.ABRA); + }); + }); + }); }); diff --git a/src/utils.ts b/src/utils.ts index 592981c7643..7decf9bb4c0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -609,3 +609,14 @@ export function toDmgValue(value: number, minValue: number = 1) { export function getLocalizedSpriteKey(baseKey: string) { return `${baseKey}${verifyLang(i18next.resolvedLanguage) ? `_${i18next.resolvedLanguage}` : ""}`; } + +/** + * Check if a number is **inclusive** between two numbers + * @param num the number to check + * @param min the minimum value (included) + * @param max the maximum value (included) + * @returns true if number is **inclusive** between min and max + */ +export function isBetween(num: number, min: number, max: number): boolean { + return num >= min && num <= max; +} From c710f85fd3bb133a814207fecc6bbd0f04d0ce62 Mon Sep 17 00:00:00 2001 From: innerthunder <168692175+innerthunder@users.noreply.github.com> Date: Sun, 8 Sep 2024 23:19:59 -0700 Subject: [PATCH 11/12] Fix `Pokemon.isTrapped` only checking enemy Pokemon for trapping abilities (#4124) --- src/field/pokemon.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index e2f238e29af..a1305b6b1b2 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1324,9 +1324,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } const trappedByAbility = new Utils.BooleanHolder(false); + const opposingField = this.isPlayer() ? this.scene.getEnemyField() : this.scene.getPlayerField(); - this.scene.getEnemyField()!.forEach(enemyPokemon => - applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trappedByAbility, this, trappedAbMessages, simulated) + opposingField.forEach(opponent => + applyCheckTrappedAbAttrs(CheckTrappedAbAttr, opponent, trappedByAbility, this, trappedAbMessages, simulated) ); return (trappedByAbility.value || !!this.getTag(TrappedTag)); From f5bf766ff7ed0314e98b6d12e6a238848407e0e1 Mon Sep 17 00:00:00 2001 From: "Adrian T." <68144167+torranx@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:42:53 +0800 Subject: [PATCH 12/12] [Move] Fully implement Tar Shot (#4043) --- src/data/battler-tags.ts | 33 ++++++++ src/data/move.ts | 2 +- src/enums/battler-tag-type.ts | 1 + src/field/pokemon.ts | 10 ++- src/locales/en/battler-tags.json | 3 +- src/test/moves/tar_shot.test.ts | 133 +++++++++++++++++++++++++++++++ 6 files changed, 177 insertions(+), 5 deletions(-) create mode 100644 src/test/moves/tar_shot.test.ts diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index ddb85600c18..c26412c776f 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1984,7 +1984,38 @@ export class ExposedTag extends BattlerTag { } } +/** + * Tag that doubles the type effectiveness of Fire-type moves. + * @extends BattlerTag + */ +export class TarShotTag extends BattlerTag { + constructor() { + super(BattlerTagType.TAR_SHOT, BattlerTagLapseType.CUSTOM, 0); + } + /** + * If the Pokemon is terastallized, the tag cannot be added. + * @param {Pokemon} pokemon the {@linkcode Pokemon} to which the tag is added + * @returns whether the tag is applied + */ + override canAdd(pokemon: Pokemon): boolean { + return !pokemon.isTerastallized(); + } + + override onAdd(pokemon: Pokemon): void { + pokemon.scene.queueMessage(i18next.t("battlerTags:tarShotOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })); + } +} + +/** + * Retrieves a {@linkcode BattlerTag} based on the provided tag type, turn count, source move, and source ID. + * + * @param {BattlerTagType} tagType the type of the {@linkcode BattlerTagType}. + * @param turnCount the turn count. + * @param {Moves} sourceMove the source {@linkcode Moves}. + * @param sourceId the source ID. + * @returns {BattlerTag} the corresponding {@linkcode BattlerTag} object. + */ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, sourceMove: Moves, sourceId: number): BattlerTag { switch (tagType) { case BattlerTagType.RECHARGING: @@ -2125,6 +2156,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source case BattlerTagType.GULP_MISSILE_ARROKUDA: case BattlerTagType.GULP_MISSILE_PIKACHU: return new GulpMissileTag(tagType, sourceMove); + case BattlerTagType.TAR_SHOT: + return new TarShotTag(); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/move.ts b/src/data/move.ts index e6e7f574671..21b859b22ac 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -8644,7 +8644,7 @@ export function initMoves() { .condition((user, target, move) => user.getTag(TrappedTag)?.sourceMove !== Moves.NO_RETREAT), // fails if the user is currently trapped by No Retreat new StatusMove(Moves.TAR_SHOT, Type.ROCK, 100, 15, -1, 0, 8) .attr(StatStageChangeAttr, [ Stat.SPD ], -1) - .partial(), + .attr(AddBattlerTagAttr, BattlerTagType.TAR_SHOT, false), new StatusMove(Moves.MAGIC_POWDER, Type.PSYCHIC, 100, 20, -1, 0, 8) .attr(ChangeTypeAttr, Type.PSYCHIC) .powderMove(), diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index a2bcf9e4c0e..0878bd00cd5 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -73,4 +73,5 @@ export enum BattlerTagType { SHELL_TRAP = "SHELL_TRAP", DRAGON_CHEER = "DRAGON_CHEER", NO_RETREAT = "NO_RETREAT", + TAR_SHOT = "TAR_SHOT", } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a1305b6b1b2..01d728d6de0 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -17,7 +17,7 @@ import { initMoveAnim, loadMoveAnimAssets } from "../data/battle-anims"; import { Status, StatusEffect, getRandomStatus } from "../data/status-effect"; import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions"; import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; -import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag } from "../data/battler-tags"; +import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag, TarShotTag } from "../data/battler-tags"; import { WeatherType } from "../data/weather"; import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; import { Ability, AbAttr, StatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatStagesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldStatMultiplierAbAttrs, FieldMultiplyStatAbAttr, AddSecondStrikeAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr, MoveTypeChangeAbAttr, FullHpResistTypeAbAttr, applyCheckTrappedAbAttrs, CheckTrappedAbAttr } from "../data/ability"; @@ -1353,7 +1353,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { /** * Calculates the effectiveness of a move against the Pokémon. - * + * This includes modifiers from move and ability attributes. * @param source {@linkcode Pokemon} The attacking Pokémon. * @param move {@linkcode Move} The move being used by the attacking Pokémon. * @param ignoreAbility Whether to ignore abilities that might affect type effectiveness or immunity (defaults to `false`). @@ -1377,6 +1377,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { typeMultiplier.value = 0; } + if (this.getTag(TarShotTag) && (this.getMoveType(move) === Type.FIRE)) { + typeMultiplier.value *= 2; + } + const cancelledHolder = cancelled ?? new Utils.BooleanHolder(false); if (!ignoreAbility) { applyPreDefendAbAttrs(TypeImmunityAbAttr, this, source, move, cancelledHolder, simulated, typeMultiplier); @@ -1408,7 +1412,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } /** - * Calculates the type effectiveness multiplier for an attack type + * Calculates the move's type effectiveness multiplier based on the target's type/s. * @param moveType {@linkcode Type} the type of the move being used * @param source {@linkcode Pokemon} the Pokemon using the move * @param ignoreStrongWinds whether or not this ignores strong winds (anticipation, forewarn, stealth rocks) diff --git a/src/locales/en/battler-tags.json b/src/locales/en/battler-tags.json index 222aee4087c..5c351fc6961 100644 --- a/src/locales/en/battler-tags.json +++ b/src/locales/en/battler-tags.json @@ -69,5 +69,6 @@ "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", "disabledOnAdd": "{{pokemonNameWithAffix}}'s {{moveName}}\nwas disabled!", - "disabledLapse": "{{pokemonNameWithAffix}}'s {{moveName}}\nis no longer disabled." + "disabledLapse": "{{pokemonNameWithAffix}}'s {{moveName}}\nis no longer disabled.", + "tarShotOnAdd": "{{pokemonNameWithAffix}} became weaker to fire!" } diff --git a/src/test/moves/tar_shot.test.ts b/src/test/moves/tar_shot.test.ts new file mode 100644 index 00000000000..15667122a37 --- /dev/null +++ b/src/test/moves/tar_shot.test.ts @@ -0,0 +1,133 @@ +import { BattlerIndex } from "#app/battle"; +import { Type } from "#app/data/type"; +import { Moves } from "#app/enums/moves"; +import { Species } from "#app/enums/species"; +import { Stat } from "#app/enums/stat"; +import { Abilities } from "#enums/abilities"; +import GameManager from "#test/utils/gameManager"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Moves - Tar Shot", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + const TIMEOUT = 20 * 1000; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(SPLASH_ONLY) + .enemySpecies(Species.TANGELA) + .enemyLevel(1000) + .moveset([Moves.TAR_SHOT, Moves.FIRE_PUNCH]) + .disableCrits(); + }); + + it("lowers the target's Speed stat by one stage and doubles the effectiveness of Fire-type moves used on the target", async () => { + await game.classicMode.startBattle([Species.PIKACHU]); + + const enemy = game.scene.getEnemyPokemon()!; + + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.TAR_SHOT); + + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getStatStage(Stat.SPD)).toBe(-1); + + await game.toNextTurn(); + + game.move.select(Moves.FIRE_PUNCH); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(4); + }, TIMEOUT); + + it("will not double the effectiveness of Fire-type moves used on a target that is already under the effect of Tar Shot (but may still lower its Speed)", async () => { + await game.classicMode.startBattle([Species.PIKACHU]); + + const enemy = game.scene.getEnemyPokemon()!; + + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.TAR_SHOT); + + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getStatStage(Stat.SPD)).toBe(-1); + + await game.toNextTurn(); + + game.move.select(Moves.TAR_SHOT); + + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getStatStage(Stat.SPD)).toBe(-2); + + await game.toNextTurn(); + + game.move.select(Moves.FIRE_PUNCH); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(4); + }, TIMEOUT); + + it("does not double the effectiveness of Fire-type moves against a Pokémon that is Terastallized", async () => { + game.override.enemyHeldItems([{ name: "TERA_SHARD", type: Type.GRASS }]).enemySpecies(Species.SPRIGATITO); + await game.classicMode.startBattle([Species.PIKACHU]); + + const enemy = game.scene.getEnemyPokemon()!; + + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.TAR_SHOT); + + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getStatStage(Stat.SPD)).toBe(-1); + + await game.toNextTurn(); + + game.move.select(Moves.FIRE_PUNCH); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(2); + }, TIMEOUT); + + it("doubles the effectiveness of Fire-type moves against a Pokémon that is already under the effects of Tar Shot before it Terastallized", async () => { + game.override.enemySpecies(Species.SPRIGATITO); + await game.classicMode.startBattle([Species.PIKACHU]); + + const enemy = game.scene.getEnemyPokemon()!; + + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.TAR_SHOT); + + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getStatStage(Stat.SPD)).toBe(-1); + + await game.toNextTurn(); + + game.override.enemyHeldItems([{ name: "TERA_SHARD", type: Type.GRASS }]); + + game.move.select(Moves.FIRE_PUNCH); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(4); + }, TIMEOUT); +});