diff --git a/src/data/splash-messages.ts b/src/data/splash-messages.ts index 531f2c5c24a..8db3f2d77c2 100644 --- a/src/data/splash-messages.ts +++ b/src/data/splash-messages.ts @@ -52,6 +52,7 @@ const SEASONAL_WEIGHT_MULTIPLIER = 10; const commonSplashMessages = [ ...Array(BATTLES_WON_WEIGHT_MULTIPLIER).fill("battlesWon"), + "pokemon", "joinTheDiscord", "infiniteLevels", "everythingIsStackable", diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index 0d69eae0efc..8a12ff7b4f8 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -8,6 +8,8 @@ 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"; export default class TitleUiHandler extends OptionSelectUiHandler { /** If the stats can not be retrieved, use this fallback value */ @@ -92,6 +94,15 @@ 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:pokemon") { + this.splashMessageText.setText(i18next.t(this.splashMessage, { pokemonName: pokemon.name })); + } + } + show(args: any[]): boolean { const ret = super.show(args); @@ -111,6 +122,8 @@ export default class TitleUiHandler extends OptionSelectUiHandler { this.eventDisplay.show(); } + this.randomPokemon(); + this.updateTitleStats(); this.titleStatsTimer = setInterval(() => {