From 19c61a041fdbe22936b05030c9e19171c102dcc5 Mon Sep 17 00:00:00 2001 From: damocleas Date: Thu, 27 Mar 2025 22:56:26 -0400 Subject: [PATCH 1/5] [Misc] New Splash Texts, March 2025 (#5345) * Update splash-messages.ts 1 * Add Pokemon name splash text This will display a random Pokemon's name, followed by an exclamation point (ex. "Bulbasaur!"). * Make Pokemon name splash message weighted * Update splash-messages.ts * Update splash-messages.ts * fix trailing spaces * Update splash-messages.ts * Update splash-messages.ts * Add splashes which use random Pokemon * Update splash message tests * Update splash-messages.ts * Update splash-messages.ts * Missing comma * Fix length on test It even says to do so whenever weight multipliers are adjusted... * Update splash-messages.ts * add missing prefix thing * adjusted comment in splash_messages.test.ts * Update splash-messages.ts * fix blank line * Add gender splash message code This makes the specific April Fools splash message functional. Also fixed a linter issue with the randomPokemon code. * Update title-ui-handler.ts changed battles won fallback number to -1 * Update splash-messages.ts * changed afd to 2 days * Update splash_messages.test.ts * Update src/data/splash-messages.ts Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> --------- Co-authored-by: Madmadness65 Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com> Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> --- src/data/splash-messages.ts | 144 ++++++++++++++++++++++++++---- src/ui/title-ui-handler.ts | 31 ++++++- test/data/splash_messages.test.ts | 28 +++--- 3 files changed, 174 insertions(+), 29 deletions(-) diff --git a/src/data/splash-messages.ts b/src/data/splash-messages.ts index 9fd71d9d95b..de14e913664 100644 --- a/src/data/splash-messages.ts +++ b/src/data/splash-messages.ts @@ -44,14 +44,17 @@ interface Season { //#region Constants /** The weight multiplier for the battles-won splash message */ -const BATTLES_WON_WEIGHT_MULTIPLIER = 10; +const BATTLES_WON_WEIGHT_MULTIPLIER = 15; +/** The weight multiplier for the Pokémon names splash message */ +const POKEMON_NAMES_WEIGHT_MULTIPLIER = 10; /** The weight multiplier for the seasonal splash messages */ -const SEASONAL_WEIGHT_MULTIPLIER = 10; +const SEASONAL_WEIGHT_MULTIPLIER = 15; //#region Common Messages const commonSplashMessages = [ ...Array(BATTLES_WON_WEIGHT_MULTIPLIER).fill("battlesWon"), + ...Array(POKEMON_NAMES_WEIGHT_MULTIPLIER).fill("underratedPokemon"), "joinTheDiscord", "infiniteLevels", "everythingIsStackable", @@ -78,7 +81,7 @@ const commonSplashMessages = [ "mostlyConsistentSeeds", "achievementPointsDontDoAnything", "nothingBeatsAJellyFilledDonut", - "dontTalkAboutTheTinkatonIncident", + "dontTalkAboutThePokemonIncident", "alsoTryPokengine", "alsoTryEmeraldRogue", "alsoTryRadicalRed", @@ -176,41 +179,146 @@ const commonSplashMessages = [ "timeForYourDeliDelivery", "goodFirstImpression", "iPreferRarerCandies", + "pocketRoguelite", + "porygonDidNothingWrong", + "critMattered", + "pickupNotRequired", + "stayHydrated", + "alsoTryCobblemon", + "alsoTryPokeDoku", + "mySleepStyleIsDoesnt", + "makeYourOwnWorldChampDifference", + "yoChampInTheMaking", + "notLiableForDecisionAnxiety", + "theAirIsTastyHere", + "continue", + "startANewRunToday", + "neverGiveUp", + "theresAlwaysNextTime", + "oneTwoThreeAndPoof", + "yourPokemonOnlyGoToLevelOneHundred", + "theBattlesWillBeLegendary", + "levelCurveBetterThanJohto", + "alsoTryShowering", + "wellStillBeHere", + "weHopeToSeeYouAgain", + "aHealthyTeamCanMeanGreaterRewards", + "aWildPokemonAppeared", + "isThisThingOn", + "needsMoreTesting", + "whoChecksStatChanges", + "whenTwoTrainersEyesMeet", + "notOfficiallyOnSteam", + "fiftyFifty", + "metaNotIncluded", + "bornToBeAWinner", + "onARollout", + "itsAlwaysNightDeepInTheAbyss", + "folksThisIsInsane" ]; //#region Seasonal Messages const seasonalSplashMessages: Season[] = [ + { + name: "New Year's", + start: "01-01", + end: "01-15", + messages: [ + "newYears.happyNewYear", + "newYears.andAHappyNewYear" + ], + }, + { + name: "Valentines", + start: "02-07", + end: "02-21", + messages: [ + "valentines.happyValentines", + "valentines.fullOfLove", + "valentines.applinForYou", + "valentines.thePowerOfLoveIsThreeThirtyBST", + "valentines.haveAHeartScale", + "valentines.i<3You" + ], + }, + { + name: "April Fools", + start: "04-01", + end: "04-03", + messages: [ + "aprilFools.battlesOne", + "aprilFools.aprilFools", + "aprilFools.removedPokemon", + "aprilFools.helloKyleAmber", + "aprilFools.gotcha", + "aprilFools.alsoTryPokerogueTwo", + "aprilFools.nowWithSameScumCountermeasures", + "aprilFools.neverGonnaGiveYouGoodRolls", + "aprilFools.youBumblingBuffoon", + "aprilFools.doubleShinyOddsForTrainersOnly", + "aprilFools.nowWithZMoves", + "aprilFools.newLightType", + "aprilFools.removedMegas", + "aprilFools.nerfedYourFavorites", + "aprilFools.grrr", + "aprilFools.enabledEternatusPassiveGoodLuck", + "aprilFools.theDarkestDaySoundsLikeAFutureProblem", + "aprilFools.tmShopWhen", + "aprilFools.whoIsFinn", + "aprilFools.watchOutForShadowPokemon", + "aprilFools.nowWithDarkTypeLuxray", + "aprilFools.onlyOnPokerogueNetAGAIN", + "aprilFools.noFreeVouchers", + "aprilFools.altffourAchievementPoints", + "aprilFools.rokePogue", + "aprilFools.readMe", + "aprilFools.winningNotIncluded", + "aprilFools.timeForYourSoloUnownRun", + "aprilFools.nowARealTimeStrategyGame", + "aprilFools.nowWithQuickTimeEncounters", + "aprilFools.timeYourInputsForHigherCatchrate", + "aprilFools.certifiedButtonSimulator", + "aprilFools.iHopeYouGetSuckerPunched" + ], + }, { name: "Halloween", - start: "09-15", + start: "10-15", end: "10-31", messages: [ + "halloween.happyHalloween", + "halloween.boo", "halloween.pumpkabooAbout", "halloween.mayContainSpiders", "halloween.spookyScarySkeledirge", "halloween.gourgeistUsedTrickOrTreat", - "halloween.letsSnuggleForever", + "halloween.letsSnuggleForever" ], }, { - name: "XMAS", + name: "Winter Holiday", start: "12-01", - end: "12-26", + end: "12-31", messages: [ - "xmas.happyHolidays", - "xmas.unaffilicatedWithDelibirdServices", - "xmas.delibirdSeason", - "xmas.diamondsFromTheSky", - "xmas.holidayStylePikachuNotIncluded", + "winterHoliday.happyHolidays", + "winterHoliday.unaffilicatedWithDelibirdServices", + "winterHoliday.delibirdSeason", + "winterHoliday.diamondsFromTheSky", + "winterHoliday.holidayStylePikachuNotIncluded", + "winterHoliday.delibirdDirectlyToYourHouse", + "winterHoliday.haveAnIceDay", + "winterHoliday.spinTheClaydol", + "winterHoliday.beGoodForGoodnessSake", + "winterHoliday.moomooMilkAndLavaCookies", + "winterHoliday.iNeedAYacheBerry", + "winterHoliday.getJolly", + "winterHoliday.tisTheSeasonToBeSpeSpa", + "winterHoliday.deckTheHalls", + "winterHoliday.saveScummingGetsYouOnTheNaughtyList", + "winterHoliday.badTrainersGetRolycoly" ], }, - { - name: "New Year's", - start: "01-01", - end: "01-31", - messages: ["newYears.happyNewYear"], - }, ]; //#endregion diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index 2f797bb4bfb..a9fdf22ec57 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -8,10 +8,13 @@ import { TimedEventDisplay } from "#app/timed-event-manager"; import { version } from "../../package.json"; import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; import { globalScene } from "#app/global-scene"; +import type { Species } from "#enums/species"; +import { getPokemonSpecies } from "#app/data/pokemon-species"; +import { PlayerGender } from "#enums/player-gender"; export default class TitleUiHandler extends OptionSelectUiHandler { /** If the stats can not be retrieved, use this fallback value */ - private static readonly BATTLES_WON_FALLBACK: number = -99999999; + private static readonly BATTLES_WON_FALLBACK: number = -1; private titleContainer: Phaser.GameObjects.Container; private playerCountLabel: Phaser.GameObjects.Text; @@ -98,6 +101,29 @@ export default class TitleUiHandler extends OptionSelectUiHandler { }); } + /** Used solely to display a random Pokémon name in a splash message. */ + randomPokemon(): void { + const rand = Utils.randInt(1025, 1); + const pokemon = getPokemonSpecies(rand as Species); + if ( + this.splashMessage === "splashMessages:underratedPokemon" || + this.splashMessage === "splashMessages:dontTalkAboutThePokemonIncident" || + this.splashMessage === "splashMessages:aWildPokemonAppeared" || + this.splashMessage === "splashMessages:aprilFools.removedPokemon" + ) { + this.splashMessageText.setText(i18next.t(this.splashMessage, { pokemonName: pokemon.name })); + } + } + + /** Used for a specific April Fools splash message. */ + genderSplash(): void { + if (this.splashMessage === "splashMessages:aprilFools.helloKyleAmber") { + globalScene.gameData.gender === PlayerGender.MALE + ? this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:player_m") })) + : this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:player_f") })); + } + } + show(args: any[]): boolean { const ret = super.show(args); @@ -121,6 +147,9 @@ export default class TitleUiHandler extends OptionSelectUiHandler { this.eventDisplay.show(); } + this.randomPokemon(); + this.genderSplash(); + this.updateTitleStats(); this.titleStatsTimer = setInterval(() => { diff --git a/test/data/splash_messages.test.ts b/test/data/splash_messages.test.ts index 8ae13366670..bd29a17339a 100644 --- a/test/data/splash_messages.test.ts +++ b/test/data/splash_messages.test.ts @@ -7,10 +7,10 @@ describe("Data - Splash Messages", () => { expect(getSplashMessages().length).toBeGreaterThanOrEqual(15); }); - // make sure to adjust this test if the weight it changed! - it("should add contain 10 `battlesWon` splash messages", () => { - const battlesWonMessages = getSplashMessages().filter(message => message === "splashMessages:battlesWon"); - expect(battlesWonMessages).toHaveLength(10); + // Make sure to adjust this test if the weight is changed! + it("should add contain 15 `battlesWon` splash messages", () => { + const battlesWonMessages = getSplashMessages().filter((message) => message === "splashMessages:battlesWon"); + expect(battlesWonMessages).toHaveLength(15); }); describe("Seasonal", () => { @@ -22,16 +22,24 @@ describe("Data - Splash Messages", () => { vi.useRealTimers(); // reset system time }); - it("should contain halloween messages from Sep 15 to Oct 31", () => { - testSeason(new Date("2024-09-15"), new Date("2024-10-31"), "halloween"); + it("should contain new years messages from Jan 1 to Jan 15", () => { + testSeason(new Date("2025-01-01"), new Date("2025-01-15"), "newYears"); }); - it("should contain xmas messages from Dec 1 to Dec 26", () => { - testSeason(new Date("2024-12-01"), new Date("2024-12-26"), "xmas"); + it("should contain valentines messages from Feb 7 to Feb 21", () => { + testSeason(new Date("2025-02-07"), new Date("2025-02-21"), "valentines"); }); - it("should contain new years messages frm Jan 1 to Jan 31", () => { - testSeason(new Date("2024-01-01"), new Date("2024-01-31"), "newYears"); + it("should contain april fools messages from April 1 to April 3", () => { + testSeason(new Date("2025-04-01"), new Date("2025-04-03"), "aprilFools"); + }); + + it("should contain halloween messages from Oct 15 to Oct 31", () => { + testSeason(new Date("2025-10-15"), new Date("2025-10-31"), "halloween"); + }); + + it("should contain winter holiday messages from Dec 1 to Dec 31", () => { + testSeason(new Date("2025-12-01"), new Date("2025-12-31"), "winterHoliday"); }); }); }); From 0ea8edcf75c094f2cb9f53a3b511672d8f636cc9 Mon Sep 17 00:00:00 2001 From: damocleas Date: Thu, 27 Mar 2025 22:58:53 -0400 Subject: [PATCH 2/5] [i18n] Update locales submodule --- public/locales | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales b/public/locales index cd4057af258..cae82762eab 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit cd4057af258b659ba2c1ed2778bb2793fa1f6141 +Subproject commit cae82762eab25f928500b73e0e9a3e7df1ae6bbe From 46d110e705f8ceb957dd67d3743a53f2e478a579 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Fri, 28 Mar 2025 04:59:05 +0100 Subject: [PATCH 3/5] =?UTF-8?q?[UI/UX]=20Grey=20options=20in=20Pok=C3=A9de?= =?UTF-8?q?x=20for=20uncaught=20mons=20(#5529)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Options in Pokédex page are dark if unselectable * Fixed docstring * Changing display of seen Pokémon in the dex * Changed visibility of icons in main Pokédex page --- src/data/pokemon-species.ts | 2 +- src/ui/pokedex-page-ui-handler.ts | 73 +++++++++++++++++++++++-------- src/ui/pokedex-ui-handler.ts | 17 ++++--- 3 files changed, 68 insertions(+), 24 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 15c60d28969..eca7d65ac6a 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -7,7 +7,7 @@ import i18next from "i18next"; import type { AnySound } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; import type { GameMode } from "#app/game-mode"; -import { DexAttr, type StarterMoveset } from "#app/system/game-data"; +import { DexAttr, DexEntry, type StarterMoveset } from "#app/system/game-data"; import * as Utils from "#app/utils"; import { uncatchableSpecies } from "#app/data/balance/biomes"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 8f96f1e44c2..b359c188e0c 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -25,7 +25,7 @@ import { AbilityAttr, DexAttr } from "#app/system/game-data"; import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; import MessageUiHandler from "#app/ui/message-ui-handler"; import { StatsContainer } from "#app/ui/stats-container"; -import { TextStyle, addTextObject, getTextStyleOptions } from "#app/ui/text"; +import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor, getTextStyleOptions } from "#app/ui/text"; import { Mode } from "#app/ui/ui"; import { addWindow } from "#app/ui/ui-theme"; import { Egg } from "#app/data/egg"; @@ -63,6 +63,7 @@ import { TimeOfDay } from "#app/enums/time-of-day"; import type { Abilities } from "#app/enums/abilities"; import { BaseStatsOverlay } from "#app/ui/base-stats-overlay"; import { globalScene } from "#app/global-scene"; +import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; interface LanguageSetting { starterInfoTextSize: string; @@ -250,7 +251,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { // Menu private menuContainer: Phaser.GameObjects.Container; private menuBg: Phaser.GameObjects.NineSlice; - protected optionSelectText: Phaser.GameObjects.Text; + protected optionSelectText: BBCodeText; private menuOptions: MenuOptions[]; protected scale = 0.1666666667; private menuDescriptions: string[]; @@ -593,14 +594,13 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.menuOptions = Utils.getEnumKeys(MenuOptions).map(m => Number.parseInt(MenuOptions[m]) as MenuOptions); - this.optionSelectText = addTextObject( + this.optionSelectText = addBBCodeTextObject( 0, 0, this.menuOptions.map(o => `${i18next.t(`pokedexUiHandler:${MenuOptions[o]}`)}`).join("\n"), TextStyle.WINDOW, - { maxLines: this.menuOptions.length }, + { maxLines: this.menuOptions.length, lineSpacing: 12 }, ); - this.optionSelectText.setLineSpacing(12); this.menuDescriptions = [ i18next.t("pokedexUiHandler:showBaseStats"), @@ -623,7 +623,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { ); this.menuBg.setOrigin(0, 0); - this.optionSelectText.setPositionRelative(this.menuBg, 10 + 24 * this.scale, 6); + this.optionSelectText.setPosition(this.menuBg.x + 10 + 24 * this.scale, this.menuBg.y + 6); this.menuContainer.add(this.menuBg); @@ -704,11 +704,39 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.setSpecies(); this.updateInstructions(); + this.optionSelectText.setText(this.getMenuText()); + this.setCursor(0); return true; } + getMenuText(): string { + const isSeen = this.isSeen(); + const isStarterCaught = !!this.isCaught(this.getStarterSpecies(this.species)); + + return this.menuOptions + .map(o => { + const label = `${i18next.t(`pokedexUiHandler:${MenuOptions[o]}`)}`; + const isDark = + !isSeen || + (!isStarterCaught && (o === MenuOptions.TOGGLE_IVS || o === MenuOptions.NATURES)) || + (this.tmMoves.length < 1 && o === MenuOptions.TM_MOVES); + const color = getTextColor( + isDark ? TextStyle.SHADOW_TEXT : TextStyle.SETTINGS_VALUE, + false, + globalScene.uiTheme, + ); + const shadow = getTextColor( + isDark ? TextStyle.SHADOW_TEXT : TextStyle.SETTINGS_VALUE, + true, + globalScene.uiTheme, + ); + return `[shadow=${shadow}][color=${color}]${label}[/color][/shadow]`; + }) + .join("\n"); + } + starterSetup(): void { this.evolutions = []; this.prevolutions = []; @@ -904,6 +932,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { return (dexEntry?.caughtAttr ?? 0n) & (starterDexEntry?.caughtAttr ?? 0n) & species.getFullUnlocksData(); } + /** * Check whether a given form is caught for a given species. * All forms that can be reached through a form change during battle are considered caught and show up in the dex as such. @@ -928,6 +957,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler { return isFormCaught; } + isSeen(): boolean { + if (this.speciesStarterDexEntry?.seenAttr) { + return true; + } + const starterCaughtAttr = this.isCaught(this.getStarterSpecies(this.species)); + return !!starterCaughtAttr; + } + /** * Get the starter attributes for the given PokemonSpecies, after sanitizing them. * If somehow a preference is set for a form, variant, gender, ability or nature @@ -1076,6 +1113,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler { const isCaught = this.isCaught(); const isFormCaught = this.isFormCaught(); + const isSeen = this.isSeen(); + const isStarterCaught = !!this.isCaught(this.getStarterSpecies(this.species)); if (this.blockInputOverlay) { if (button === Button.CANCEL || button === Button.ACTION) { @@ -1130,7 +1169,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { if (button === Button.ACTION) { switch (this.cursor) { case MenuOptions.BASE_STATS: - if (!isCaught || !isFormCaught) { + if (!isSeen) { error = true; } else { this.blockInput = true; @@ -1150,7 +1189,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.LEVEL_MOVES: - if (!isCaught || !isFormCaught) { + if (!isSeen) { error = true; } else { this.blockInput = true; @@ -1208,7 +1247,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.EGG_MOVES: - if (!isCaught || !isFormCaught) { + if (!isSeen) { error = true; } else { this.blockInput = true; @@ -1275,7 +1314,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.TM_MOVES: - if (!isCaught || !isFormCaught) { + if (!isSeen) { error = true; } else if (this.tmMoves.length < 1) { ui.showText(i18next.t("pokedexUiHandler:noTmMoves")); @@ -1326,7 +1365,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.ABILITIES: - if (!isCaught || !isFormCaught) { + if (!isSeen) { error = true; } else { this.blockInput = true; @@ -1414,7 +1453,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.BIOMES: - if (!(isCaught || this.speciesStarterDexEntry?.seenAttr)) { + if (!isSeen) { error = true; } else { this.blockInput = true; @@ -1493,7 +1532,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.EVOLUTIONS: - if (!isCaught || !isFormCaught) { + if (!isSeen) { error = true; } else { this.blockInput = true; @@ -1677,7 +1716,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.TOGGLE_IVS: - if (!isCaught || !isFormCaught) { + if (!isStarterCaught) { error = true; } else { this.toggleStatsMode(); @@ -1687,7 +1726,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { break; case MenuOptions.NATURES: - if (!isCaught || !isFormCaught) { + if (!isStarterCaught) { error = true; } else { this.blockInput = true; @@ -2392,8 +2431,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } if (species) { - const dexEntry = globalScene.gameData.dexData[species.speciesId]; - const caughtAttr = this.isCaught(species); if (!caughtAttr) { @@ -2414,7 +2451,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } const isFormCaught = this.isFormCaught(); - const isFormSeen = dexEntry ? (dexEntry.seenAttr & globalScene.gameData.getFormAttr(formIndex ?? 0)) > 0n : false; + const isFormSeen = this.isSeen(); this.shinyOverlay.setVisible(shiny ?? false); // TODO: is false the correct default? this.pokemonNumberText.setColor(this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, false)); diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index d55b278a148..198d9606258 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -781,6 +781,15 @@ export default class PokedexUiHandler extends MessageUiHandler { this.starterSelectMessageBoxContainer.setVisible(!!text?.length); } + isSeen(species: PokemonSpecies, dexEntry: DexEntry): boolean { + if (dexEntry?.seenAttr) { + return true; + } + + const starterDexEntry = globalScene.gameData.dexData[this.getStarterSpeciesId(species.speciesId)]; + return !!starterDexEntry?.caughtAttr; + } + /** * Determines if 'Icon' based upgrade notifications should be shown * @returns true if upgrade notifications are enabled and set to display an 'Icon' @@ -1740,7 +1749,7 @@ export default class PokedexUiHandler extends MessageUiHandler { if (caughtAttr & data.species.getFullUnlocksData() || globalScene.dexForDevs) { container.icon.clearTint(); - } else if (dexEntry.seenAttr) { + } else if (this.isSeen(data.species, dexEntry)) { container.icon.setTint(0x808080); } else { container.icon.setTint(0); @@ -1931,13 +1940,11 @@ export default class PokedexUiHandler extends MessageUiHandler { const props = this.getSanitizedProps(globalScene.gameData.getSpeciesDexAttrProps(this.lastSpecies, dexAttr)); this.trayContainers = []; + const isFormSeen = this.isSeen(species, dexEntry); this.trayForms.map((f, index) => { const isFormCaught = dexEntry ? (dexEntry.caughtAttr & species.getFullUnlocksData() & globalScene.gameData.getFormAttr(f.formIndex ?? 0)) > 0n : false; - const isFormSeen = dexEntry - ? (dexEntry.seenAttr & globalScene.gameData.getFormAttr(f.formIndex ?? 0)) > 0n - : false; const formContainer = new PokedexMonContainer(species, { formIndex: f.formIndex, female: props.female, @@ -2147,7 +2154,7 @@ export default class PokedexUiHandler extends MessageUiHandler { } const isFormCaught = dexEntry ? (caughtAttr & globalScene.gameData.getFormAttr(formIndex ?? 0)) > 0n : false; - const isFormSeen = dexEntry ? (dexEntry.seenAttr & globalScene.gameData.getFormAttr(formIndex ?? 0)) > 0n : false; + const isFormSeen = this.isSeen(species, dexEntry); const assetLoadCancelled = new BooleanHolder(false); this.assetLoadCancelled = assetLoadCancelled; From 188647d2e57106256f3351e37a7b45713f0502da Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:02:42 +0100 Subject: [PATCH 4/5] =?UTF-8?q?[Bug][UI/UX]=20Pok=C3=A9dex=20filters=20pro?= =?UTF-8?q?perly=20track=20TMs=20for=20evolutions=20(#5568)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looking at speciesId for TMs --- src/ui/pokedex-ui-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 198d9606258..a98415f72d2 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -1373,7 +1373,7 @@ export default class PokedexUiHandler extends MessageUiHandler { const levelMoves = pokemonSpeciesLevelMoves[species.speciesId].map(m => allMoves[m[1]].name); // This always gets egg moves from the starter const eggMoves = speciesEggMoves[starterId]?.map(m => allMoves[m].name) ?? []; - const tmMoves = speciesTmMoves[starterId]?.map(m => allMoves[Array.isArray(m) ? m[1] : m].name) ?? []; + const tmMoves = speciesTmMoves[species.speciesId]?.map(m => allMoves[Array.isArray(m) ? m[1] : m].name) ?? []; const selectedMove1 = this.filterText.getValue(FilterTextRow.MOVE_1); const selectedMove2 = this.filterText.getValue(FilterTextRow.MOVE_2); From f09c77c81b453a1c24e1220b33d95f22e6a951dd Mon Sep 17 00:00:00 2001 From: Dean <69436131+emdeann@users.noreply.github.com> Date: Fri, 28 Mar 2025 11:38:20 -0700 Subject: [PATCH 5/5] [Bug] Fix Extra Ability Activation Flyouts during AI Decisions (#5563) Fix extra messages in getMoveChance --- src/data/moves/move.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 1af872e0915..c85ec7db295 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -1233,7 +1233,7 @@ export class MoveEffectAttr extends MoveAttr { getMoveChance(user: Pokemon, target: Pokemon, move: Move, selfEffect?: Boolean, showAbility?: Boolean): number { const moveChance = new Utils.NumberHolder(this.effectChanceOverride ?? move.chance); - applyAbAttrs(MoveEffectChanceMultiplierAbAttr, user, null, false, moveChance, move, target, selfEffect, showAbility); + applyAbAttrs(MoveEffectChanceMultiplierAbAttr, user, null, !showAbility, moveChance, move); if ((!move.hasAttr(FlinchAttr) || moveChance.value <= move.chance) && !move.hasAttr(SecretPowerAttr)) { const userSide = user.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY; @@ -1241,7 +1241,7 @@ export class MoveEffectAttr extends MoveAttr { } if (!selfEffect) { - applyPreDefendAbAttrs(IgnoreMoveEffectsAbAttr, target, user, null, null, false, moveChance); + applyPreDefendAbAttrs(IgnoreMoveEffectsAbAttr, target, user, null, null, !showAbility, moveChance); } return moveChance.value; }