From 118bdcc49ea317785c8e67e7e62ee94fcbf7807a Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 1 Mar 2025 01:15:11 +0100 Subject: [PATCH 1/6] =?UTF-8?q?[Bug][UI/UX]=20Never=20select=20invisible?= =?UTF-8?q?=20containers=20in=20Pok=C3=A9dex=20(#5449)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/pokedex-ui-handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index a18f138e4f7..02c19f11813 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -986,7 +986,7 @@ export default class PokedexUiHandler extends MessageUiHandler { this.updateScroll(); const proportion = this.filterBarCursor / Math.max(1, this.filterBar.numFilters - 1); const targetCol = Math.min(8, proportion < 0.5 ? Math.floor(proportion * 8) : Math.ceil(proportion * 8)); - this.setCursor(Math.min(targetCol, numberOfStarters)); + this.setCursor(Math.min(targetCol, numberOfStarters - 1)); success = true; } break; @@ -1108,7 +1108,7 @@ export default class PokedexUiHandler extends MessageUiHandler { } break; case Button.DOWN: - if (currentRow < numOfRows - 1) { // not last row + if ((currentRow < numOfRows - 1) && (this.cursor + 9 < this.filteredPokemonData.length)) { // not last row if (currentRow - this.scrollCursor === 8) { // last row of visible pokemon this.scrollCursor++; this.updateScroll(); From 7cc5f40af8f0b37fc2e790f8d23c9310b0f72907 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 1 Mar 2025 01:55:22 +0100 Subject: [PATCH 2/6] =?UTF-8?q?[Bug][UI/UX]=20Restore=20egg/tm=20move=20an?= =?UTF-8?q?d=20passive=20icons=20when=20using=20filters=20in=20Pok=C3=A9de?= =?UTF-8?q?x=20(#5450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/pokedex-ui-handler.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 02c19f11813..83739ba26a8 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -1577,6 +1577,37 @@ export default class PokedexUiHandler extends MessageUiHandler { container.icon.setTint(0); } + if (data.eggMove1) { + container.eggMove1Icon.setVisible(true); + } else { + container.eggMove1Icon.setVisible(false); + } + if (data.eggMove2) { + container.eggMove2Icon.setVisible(true); + } else { + container.eggMove2Icon.setVisible(false); + } + if (data.tmMove1) { + container.tmMove1Icon.setVisible(true); + } else { + container.tmMove1Icon.setVisible(false); + } + if (data.tmMove2) { + container.tmMove2Icon.setVisible(true); + } else { + container.tmMove2Icon.setVisible(false); + } + if (data.passive1) { + container.passive1Icon.setVisible(true); + } else { + container.passive1Icon.setVisible(false); + } + if (data.passive2) { + container.passive2Icon.setVisible(true); + } else { + container.passive2Icon.setVisible(false); + } + if (this.showDecorations) { if (this.pokerusSpecies.includes(data.species)) { From b348626ec2257352dc758e5aecaf4dcdd153fff7 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 1 Mar 2025 02:00:56 +0100 Subject: [PATCH 3/6] [Bug][UI/UX] Make candy icons show up again in starter select screen (#5451) --- src/ui/abstact-option-select-ui-handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/abstact-option-select-ui-handler.ts b/src/ui/abstact-option-select-ui-handler.ts index 07e43a344dd..a462ed158cb 100644 --- a/src/ui/abstact-option-select-ui-handler.ts +++ b/src/ui/abstact-option-select-ui-handler.ts @@ -147,7 +147,7 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { itemIcon.setScale(3 * this.scale); this.optionSelectIcons.push(itemIcon); - this.optionSelectContainer.add(itemIcon); + this.optionSelectTextContainer.add(itemIcon); itemIcon.setPositionRelative(this.optionSelectText, 36 * this.scale, 7 + i * (114 * this.scale - 3)); @@ -156,7 +156,7 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { itemOverlayIcon.setScale(3 * this.scale); this.optionSelectIcons.push(itemOverlayIcon); - this.optionSelectContainer.add(itemOverlayIcon); + this.optionSelectTextContainer.add(itemOverlayIcon); itemOverlayIcon.setPositionRelative(this.optionSelectText, 36 * this.scale, 7 + i * (114 * this.scale - 3)); From d16197e950bbe59bf86976a5245a10a34c4c6af4 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 1 Mar 2025 04:34:49 +0100 Subject: [PATCH 4/6] =?UTF-8?q?[Bug]=20Gendered=20forms=20display=20correc?= =?UTF-8?q?t=20information=20in=20Pok=C3=A9dex=20(#5452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/pokedex-page-ui-handler.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 49bb52dddbb..e9060fb43b6 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -602,6 +602,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.battleForms = []; const species = this.species; + + let formKey = this.species?.forms.length > 0 ? this.species.forms[this.formIndex].formKey : ""; + this.isFormGender = formKey === "male" || formKey === "female"; + if (this.isFormGender && ((this.savedStarterAttributes.female === true && formKey === "male") || (this.savedStarterAttributes.female === false && formKey === "female"))) { + this.formIndex = (this.formIndex + 1) % 2; + formKey = this.species.forms[this.formIndex].formKey; + } + const formIndex = this.formIndex ?? 0; this.starterId = this.getStarterSpeciesId(this.species.speciesId); @@ -635,12 +643,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.eggMoves = speciesEggMoves[this.starterId] ?? []; this.hasEggMoves = Array.from({ length: 4 }, (_, em) => (globalScene.gameData.starterData[this.starterId].eggMoves & (1 << em)) !== 0); - const formKey = this.species?.forms.length > 0 ? this.species.forms[this.formIndex].formKey : ""; this.tmMoves = speciesTmMoves[species.speciesId]?.filter(m => Array.isArray(m) ? (m[0] === formKey ? true : false ) : true) .map(m => Array.isArray(m) ? m[1] : m).sort((a, b) => allMoves[a].name > allMoves[b].name ? 1 : -1) ?? []; - this.isFormGender = formKey === "male" || formKey === "female"; - const passiveId = starterPassiveAbilities.hasOwnProperty(species.speciesId) ? species.speciesId : starterPassiveAbilities.hasOwnProperty(this.starterId) ? this.starterId : pokemonPrevolutions[this.starterId]; const passives = starterPassiveAbilities[passiveId]; From 89e8085c39c4f193124b731b5ea26b12734a367d Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 1 Mar 2025 05:22:51 +0100 Subject: [PATCH 5/6] =?UTF-8?q?[Bug]=20Display=20Pok=C3=A9mon=20name=20in?= =?UTF-8?q?=20Focus=20Punch=20lost=20focus=20message=20(#5448)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/data/move.ts | 2 +- test/moves/focus_punch.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 18f4b220911..11ce7069664 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -9384,7 +9384,7 @@ export function initMoves() { .attr(BypassBurnDamageReductionAttr), new AttackMove(Moves.FOCUS_PUNCH, Type.FIGHTING, MoveCategory.PHYSICAL, 150, 100, 20, -1, -3, 3) .attr(MessageHeaderAttr, (user, move) => i18next.t("moveTriggers:isTighteningFocus", { pokemonName: getPokemonNameWithAffix(user) })) - .attr(PreUseInterruptAttr, i18next.t("moveTriggers:lostFocus"), user => !!user.turnData.attacksReceived.find(r => r.damage)) + .attr(PreUseInterruptAttr, (user, target, move) => i18next.t("moveTriggers:lostFocus", { pokemonName: getPokemonNameWithAffix(user) }), user => !!user.turnData.attacksReceived.find(r => r.damage)) .punchingMove(), new AttackMove(Moves.SMELLING_SALTS, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 10, -1, 0, 3) .attr(MovePowerMultiplierAttr, (user, target, move) => target.status?.effect === StatusEffect.PARALYSIS ? 2 : 1) diff --git a/test/moves/focus_punch.test.ts b/test/moves/focus_punch.test.ts index 9bf858dfda5..1f14a19fbd7 100644 --- a/test/moves/focus_punch.test.ts +++ b/test/moves/focus_punch.test.ts @@ -140,6 +140,6 @@ describe("Moves - Focus Punch", () => { await game.phaseInterceptor.to("MessagePhase", false); const consoleSpy = vi.spyOn(console, "log"); await game.phaseInterceptor.to("MoveEndPhase", true); - expect(consoleSpy).nthCalledWith(1, i18next.t("moveTriggers:lostFocus")); + expect(consoleSpy).nthCalledWith(1, i18next.t("moveTriggers:lostFocus", { pokemonName: "Charizard" })); }); }); From c7df847e661727c02bc0980337cd767f99dcb048 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 1 Mar 2025 20:33:31 +0100 Subject: [PATCH 6/6] [Bug] Unlocking correct base form of Zygarde when captured (#5453) --- src/system/game-data.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 57e25325ba4..aefc583a98a 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1645,11 +1645,19 @@ export class GameData { } else if (formIndex === 3) { dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(1); } - } - const allFormChanges = pokemonFormChanges.hasOwnProperty(species.speciesId) ? pokemonFormChanges[species.speciesId] : []; - const toCurrentFormChanges = allFormChanges.filter(f => (f.formKey === formKey)); - if (toCurrentFormChanges.length > 0) { - dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(0); + } else if (pokemon.species.speciesId === Species.ZYGARDE) { + if (formIndex === 4) { + dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(2); + } else if (formIndex === 5) { + dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(3); + } + } else { + const allFormChanges = pokemonFormChanges.hasOwnProperty(species.speciesId) ? pokemonFormChanges[species.speciesId] : []; + const toCurrentFormChanges = allFormChanges.filter(f => (f.formKey === formKey)); + if (toCurrentFormChanges.length > 0) { + // Needs to do this or Castform can unlock the wrong form, etc. + dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(0); + } } }