From 922a17048c07b99c5b3d315c14f6ac68c7d4e936 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Thu, 27 Feb 2025 22:50:46 +0100 Subject: [PATCH 1/2] [Bug] Save data migrator to fix starters with no selectable forms (#5425) Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com> --- .../version_migration/versions/v1_7_0.ts | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/system/version_migration/versions/v1_7_0.ts b/src/system/version_migration/versions/v1_7_0.ts index 2acb9d8151a..bdb9e6aab9f 100644 --- a/src/system/version_migration/versions/v1_7_0.ts +++ b/src/system/version_migration/versions/v1_7_0.ts @@ -1,8 +1,29 @@ -import { getPokemonSpeciesForm } from "#app/data/pokemon-species"; -import type { SessionSaveData } from "#app/system/game-data"; +import { getPokemonSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-species"; +import { globalScene } from "#app/global-scene"; +import { DexAttr, type SessionSaveData, type SystemSaveData } from "#app/system/game-data"; import * as Utils from "#app/utils"; -export const systemMigrators = [] as const; +export const systemMigrators = [ + /** + * If a starter is caught, but the only forms registered as caught are not starterSelectable, + * unlock the default form. + * @param data {@linkcode SystemSaveData} + */ + function migrateUnselectableForms(data: SystemSaveData) { + if (data.starterData && data.dexData) { + Object.keys(data.starterData).forEach(sd => { + const caughtAttr = data.dexData[sd]?.caughtAttr; + const species = getPokemonSpecies(Number(sd)); + if (caughtAttr && species.forms?.length > 1) { + const selectableForms = species.forms.filter((form, formIndex) => form.isStarterSelectable && (caughtAttr & globalScene.gameData.getFormAttr(formIndex))); + if (selectableForms.length === 0) { + data.dexData[sd].caughtAttr += DexAttr.DEFAULT_FORM; + } + } + }); + } + }, +] as const; export const settingsMigrators = [] as const; From 9ff20af8b7d86f6a6d656b78b67cbf7b38bd3e0c Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Fri, 28 Feb 2025 09:13:35 +1100 Subject: [PATCH 2/2] [UI] Make fight cursor tera icon while tera-ing (#5402) Co-authored-by: damocleas Co-authored-by: Madmadness65 --- public/images/ui/cursor_tera.png | Bin 0 -> 253 bytes public/images/ui/legacy/cursor_tera.png | Bin 0 -> 262 bytes src/loading-scene.ts | 1 + src/ui/fight-ui-handler.ts | 4 +++- 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 public/images/ui/cursor_tera.png create mode 100644 public/images/ui/legacy/cursor_tera.png diff --git a/public/images/ui/cursor_tera.png b/public/images/ui/cursor_tera.png new file mode 100644 index 0000000000000000000000000000000000000000..34cbe0958959da88b819c9b1f129e59b1d71810e GIT binary patch literal 253 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CP!3HERJk;|9QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4uUY_j)~cCfr67fT^vI+g69S~3N^G+E}p8jB0L%+mh$DfK`n%1(6 z8&0lEvSho~cJJZ=ucAp$G?#8xSFMn`xN@(2xz6%U?4KTM?9f!$SbaIr^6>Y_w@Ys^ yq#8b-?eu)Tw@}d4UB-W>+i2fq+qs+V0PoflXZB9)_bvgtj=|H_&t;ucLK6UAH)56m literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/cursor_tera.png b/public/images/ui/legacy/cursor_tera.png new file mode 100644 index 0000000000000000000000000000000000000000..f2e77046137c64e4bb015ce419eecbb4ac00b246 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CP!3HERJk;|9QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4uLSEsD@VqP;j=Vi(`mJaPK5XzGed+mbo480}9^=e^Tj_ zsg!aLkqg;!QO{7b(@N+__RYwgME@mI_Wj;htC8}MmR`z(1D$~vkp-uLbJ{We{FYNkAQN}vatF}LW-V_#`_u;7S6_W)w z_#^M1F?eoxdchK%Z1bmoAK2UEx|jS{-9J}v?d`K?{N&~oew@^qbQ|bQ22WQ%mvv4F FO#q|#Vr>8b literal 0 HcmV?d00001 diff --git a/src/loading-scene.ts b/src/loading-scene.ts index de1df784b2b..183b38c49e5 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -101,6 +101,7 @@ export class LoadingScene extends SceneBase { this.loadImage("icon_lock", "ui", "icon_lock.png"); this.loadImage("icon_stop", "ui", "icon_stop.png"); this.loadImage("icon_tera", "ui"); + this.loadImage("cursor_tera", "ui"); this.loadImage("type_tera", "ui"); this.loadAtlas("type_bgs", "ui"); this.loadAtlas("button_tera", "ui"); diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index 1c1dceb24a5..8e8b197117c 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -226,7 +226,9 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { } if (!this.cursorObj) { - this.cursorObj = globalScene.add.image(0, 0, "cursor"); + const isTera = this.fromCommand === Command.TERA; + this.cursorObj = globalScene.add.image(0, 0, isTera ? "cursor_tera" : "cursor"); + this.cursorObj.setScale(isTera ? 0.7 : 1); ui.add(this.cursorObj); }