Compare commits

..

3 Commits

Author SHA1 Message Date
Mumble
87f55a8a1a
[Bug][Beta] Double vouchers fix (#3906)
* The fix.

* Ordinals....

* tsdocs..

* my forgetting

* Fixed issues

* Update src/phases/encounter-phase.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* The actual change

* actual fixes

* This should fix it... maybe

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-08-30 11:06:18 -07:00
flx-sta
87d2300ee8
[Bug] skip-seen-dialogue storing strings instead of i18n keys (#3900)
* fix skipSeenDialogue storing

seen dialogues were stores as actual string instead of their i18n-keys. This fixes it.

Reported on discord:
https://discord.com/channels/1125469663833370665/1176874654015684739/1278794542648131695

* fix falling back to english

* Victory-Rival Dialgoue

* Update src/phases/game-over-phase.ts

Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>

* fix showDialogue for non i18n-key calls

showDialogue can be called with either text or an i18n key. This wasn't taken into account and caused some console spamming.

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-08-30 10:59:39 -07:00
AJ Fontaine
e2db9cb8a4
Even more TM fixes (#3889) 2024-08-30 10:54:48 -07:00
5 changed files with 115 additions and 20 deletions

View File

@ -42431,7 +42431,6 @@ export const tmSpecies: TmSpecies = {
Species.TORTERRA, Species.TORTERRA,
Species.BUDEW, Species.BUDEW,
Species.ROSERADE, Species.ROSERADE,
Species.WORMADAM,
Species.CHERUBI, Species.CHERUBI,
Species.CHERRIM, Species.CHERRIM,
Species.CARNIVINE, Species.CARNIVINE,
@ -42449,6 +42448,7 @@ export const tmSpecies: TmSpecies = {
Species.PETILIL, Species.PETILIL,
Species.LILLIGANT, Species.LILLIGANT,
Species.MARACTUS, Species.MARACTUS,
Species.MINCCINO,
Species.CINCCINO, Species.CINCCINO,
Species.DEERLING, Species.DEERLING,
Species.SAWSBUCK, Species.SAWSBUCK,
@ -42511,6 +42511,10 @@ export const tmSpecies: TmSpecies = {
Species.DIPPLIN, Species.DIPPLIN,
Species.OGERPON, Species.OGERPON,
Species.HYDRAPPLE, Species.HYDRAPPLE,
[
Species.WORMADAM,
"plant",
],
Species.ALOLA_EXEGGUTOR, Species.ALOLA_EXEGGUTOR,
Species.HISUI_VOLTORB, Species.HISUI_VOLTORB,
Species.HISUI_ELECTRODE, Species.HISUI_ELECTRODE,
@ -45984,6 +45988,7 @@ export const tmSpecies: TmSpecies = {
Species.TEDDIURSA, Species.TEDDIURSA,
Species.URSARING, Species.URSARING,
Species.HITMONTOP, Species.HITMONTOP,
Species.COMBUSKEN,
Species.BLAZIKEN, Species.BLAZIKEN,
Species.BRELOOM, Species.BRELOOM,
Species.MAKUHITA, Species.MAKUHITA,
@ -48612,6 +48617,7 @@ export const tmSpecies: TmSpecies = {
Species.WOOBAT, Species.WOOBAT,
Species.SWOOBAT, Species.SWOOBAT,
Species.SEWADDLE, Species.SEWADDLE,
Species.SWADLOON,
Species.LEAVANNY, Species.LEAVANNY,
Species.SIGILYPH, Species.SIGILYPH,
Species.ARCHEOPS, Species.ARCHEOPS,
@ -48641,6 +48647,9 @@ export const tmSpecies: TmSpecies = {
Species.ROWLET, Species.ROWLET,
Species.DARTRIX, Species.DARTRIX,
Species.DECIDUEYE, Species.DECIDUEYE,
Species.PIKIPEK,
Species.TRUMBEAK,
Species.TOUCANNON,
Species.VIKAVOLT, Species.VIKAVOLT,
Species.ORICORIO, Species.ORICORIO,
Species.TYPE_NULL, Species.TYPE_NULL,
@ -49162,6 +49171,8 @@ export const tmSpecies: TmSpecies = {
Species.AZELF, Species.AZELF,
Species.REGIGIGAS, Species.REGIGIGAS,
Species.DARKRAI, Species.DARKRAI,
Species.PIGNITE,
Species.EMBOAR,
Species.AUDINO, Species.AUDINO,
Species.TIMBURR, Species.TIMBURR,
Species.GURDURR, Species.GURDURR,
@ -49792,10 +49803,13 @@ export const tmSpecies: TmSpecies = {
], ],
[Moves.BRAVE_BIRD]: [ [Moves.BRAVE_BIRD]: [
Species.PIDGEY, Species.PIDGEY,
Species.PIDGEOTTO,
Species.PIDGEOT,
Species.ZUBAT, Species.ZUBAT,
Species.GOLBAT, Species.GOLBAT,
Species.FARFETCHD, Species.FARFETCHD,
Species.DODUO, Species.DODUO,
Species.DODRIO,
Species.ARTICUNO, Species.ARTICUNO,
Species.ZAPDOS, Species.ZAPDOS,
Species.MOLTRES, Species.MOLTRES,
@ -49806,6 +49820,7 @@ export const tmSpecies: TmSpecies = {
Species.MURKROW, Species.MURKROW,
Species.DELIBIRD, Species.DELIBIRD,
Species.SKARMORY, Species.SKARMORY,
Species.LUGIA,
Species.HO_OH, Species.HO_OH,
Species.BLAZIKEN, Species.BLAZIKEN,
Species.TAILLOW, Species.TAILLOW,
@ -49833,6 +49848,8 @@ export const tmSpecies: TmSpecies = {
Species.DARTRIX, Species.DARTRIX,
Species.DECIDUEYE, Species.DECIDUEYE,
Species.PIKIPEK, Species.PIKIPEK,
Species.TRUMBEAK,
Species.TOUCANNON,
Species.TAPU_KOKO, Species.TAPU_KOKO,
Species.ROOKIDEE, Species.ROOKIDEE,
Species.CORVISQUIRE, Species.CORVISQUIRE,
@ -50008,6 +50025,7 @@ export const tmSpecies: TmSpecies = {
Species.MUDSDALE, Species.MUDSDALE,
Species.SANDYGAST, Species.SANDYGAST,
Species.PALOSSAND, Species.PALOSSAND,
Species.MINIOR,
Species.NECROZMA, Species.NECROZMA,
Species.RILLABOOM, Species.RILLABOOM,
Species.DREDNAW, Species.DREDNAW,
@ -51968,6 +51986,7 @@ export const tmSpecies: TmSpecies = {
Species.BEHEEYEM, Species.BEHEEYEM,
Species.CRYOGONAL, Species.CRYOGONAL,
Species.DRUDDIGON, Species.DRUDDIGON,
Species.GOLETT,
Species.GOLURK, Species.GOLURK,
Species.PAWNIARD, Species.PAWNIARD,
Species.BISHARP, Species.BISHARP,
@ -52010,6 +52029,7 @@ export const tmSpecies: TmSpecies = {
Species.MELTAN, Species.MELTAN,
Species.MELMETAL, Species.MELMETAL,
Species.CORVIKNIGHT, Species.CORVIKNIGHT,
Species.PERRSERKER,
Species.CUFANT, Species.CUFANT,
Species.COPPERAJAH, Species.COPPERAJAH,
Species.DURALUDON, Species.DURALUDON,
@ -53199,6 +53219,8 @@ export const tmSpecies: TmSpecies = {
Species.NUMEL, Species.NUMEL,
Species.CAMERUPT, Species.CAMERUPT,
Species.TORKOAL, Species.TORKOAL,
Species.TRAPINCH,
Species.VIBRAVA,
Species.FLYGON, Species.FLYGON,
Species.LUNATONE, Species.LUNATONE,
Species.SOLROCK, Species.SOLROCK,
@ -53442,6 +53464,9 @@ export const tmSpecies: TmSpecies = {
Species.NUMEL, Species.NUMEL,
Species.CAMERUPT, Species.CAMERUPT,
Species.TORKOAL, Species.TORKOAL,
Species.TRAPINCH,
Species.VIBRAVA,
Species.FLYGON,
Species.LUNATONE, Species.LUNATONE,
Species.SOLROCK, Species.SOLROCK,
Species.BARBOACH, Species.BARBOACH,
@ -53524,6 +53549,7 @@ export const tmSpecies: TmSpecies = {
Species.HYDREIGON, Species.HYDREIGON,
Species.COBALION, Species.COBALION,
Species.TERRAKION, Species.TERRAKION,
Species.ZEKROM,
Species.LANDORUS, Species.LANDORUS,
Species.BINACLE, Species.BINACLE,
Species.BARBARACLE, Species.BARBARACLE,
@ -54570,6 +54596,7 @@ export const tmSpecies: TmSpecies = {
Species.SLOWBRO, Species.SLOWBRO,
Species.DROWZEE, Species.DROWZEE,
Species.HYPNO, Species.HYPNO,
Species.EXEGGCUTE,
Species.EXEGGUTOR, Species.EXEGGUTOR,
Species.STARMIE, Species.STARMIE,
Species.MR_MIME, Species.MR_MIME,
@ -54621,6 +54648,7 @@ export const tmSpecies: TmSpecies = {
Species.MESPRIT, Species.MESPRIT,
Species.AZELF, Species.AZELF,
Species.CRESSELIA, Species.CRESSELIA,
Species.DARKRAI,
Species.ARCEUS, Species.ARCEUS,
Species.VICTINI, Species.VICTINI,
Species.MUNNA, Species.MUNNA,
@ -54644,6 +54672,7 @@ export const tmSpecies: TmSpecies = {
Species.ESPURR, Species.ESPURR,
Species.MEOWSTIC, Species.MEOWSTIC,
Species.AROMATISSE, Species.AROMATISSE,
Species.INKAY,
Species.MALAMAR, Species.MALAMAR,
Species.SYLVEON, Species.SYLVEON,
Species.KLEFKI, Species.KLEFKI,
@ -55061,6 +55090,7 @@ export const tmSpecies: TmSpecies = {
Species.NIDOQUEEN, Species.NIDOQUEEN,
Species.NIDOKING, Species.NIDOKING,
Species.VILEPLUME, Species.VILEPLUME,
Species.VENOMOTH,
Species.DUGTRIO, Species.DUGTRIO,
Species.BELLSPROUT, Species.BELLSPROUT,
Species.WEEPINBELL, Species.WEEPINBELL,
@ -55165,6 +55195,7 @@ export const tmSpecies: TmSpecies = {
Species.MAGNEMITE, Species.MAGNEMITE,
Species.MAGNETON, Species.MAGNETON,
Species.ONIX, Species.ONIX,
Species.RHYHORN,
Species.RHYDON, Species.RHYDON,
Species.SNORLAX, Species.SNORLAX,
Species.MEW, Species.MEW,
@ -55197,6 +55228,7 @@ export const tmSpecies: TmSpecies = {
Species.TURTWIG, Species.TURTWIG,
Species.GROTLE, Species.GROTLE,
Species.TORTERRA, Species.TORTERRA,
Species.RAMPARDOS,
Species.SHIELDON, Species.SHIELDON,
Species.BASTIODON, Species.BASTIODON,
Species.BRONZOR, Species.BRONZOR,
@ -55212,6 +55244,8 @@ export const tmSpecies: TmSpecies = {
Species.REGIGIGAS, Species.REGIGIGAS,
Species.ARCEUS, Species.ARCEUS,
Species.TEPIG, Species.TEPIG,
Species.PIGNITE,
Species.EMBOAR,
Species.ROGGENROLA, Species.ROGGENROLA,
Species.BOLDORE, Species.BOLDORE,
Species.GIGALITH, Species.GIGALITH,
@ -55222,6 +55256,7 @@ export const tmSpecies: TmSpecies = {
Species.BEARTIC, Species.BEARTIC,
Species.GOLETT, Species.GOLETT,
Species.GOLURK, Species.GOLURK,
Species.COBALION,
Species.CARBINK, Species.CARBINK,
Species.AVALUGG, Species.AVALUGG,
Species.VOLCANION, Species.VOLCANION,
@ -55303,6 +55338,7 @@ export const tmSpecies: TmSpecies = {
Species.FLAAFFY, Species.FLAAFFY,
Species.AMPHAROS, Species.AMPHAROS,
Species.ELEKID, Species.ELEKID,
Species.RAIKOU,
Species.ELECTRIKE, Species.ELECTRIKE,
Species.MANECTRIC, Species.MANECTRIC,
Species.PLUSLE, Species.PLUSLE,
@ -55314,6 +55350,8 @@ export const tmSpecies: TmSpecies = {
Species.MAGNEZONE, Species.MAGNEZONE,
Species.ELECTIVIRE, Species.ELECTIVIRE,
Species.ROTOM, Species.ROTOM,
Species.BLITZLE,
Species.ZEBSTRIKA,
Species.EMOLGA, Species.EMOLGA,
Species.JOLTIK, Species.JOLTIK,
Species.GALVANTULA, Species.GALVANTULA,
@ -59685,6 +59723,7 @@ export const tmSpecies: TmSpecies = {
Species.NIDORINO, Species.NIDORINO,
Species.NIDOKING, Species.NIDOKING,
Species.RAPIDASH, Species.RAPIDASH,
Species.DODRIO,
Species.SEEL, Species.SEEL,
Species.DEWGONG, Species.DEWGONG,
Species.CLOYSTER, Species.CLOYSTER,
@ -59699,6 +59738,7 @@ export const tmSpecies: TmSpecies = {
Species.FORRETRESS, Species.FORRETRESS,
Species.DUNSPARCE, Species.DUNSPARCE,
Species.STEELIX, Species.STEELIX,
Species.SKARMORY,
Species.DELIBIRD, Species.DELIBIRD,
Species.HITMONTOP, Species.HITMONTOP,
Species.BALTOY, Species.BALTOY,
@ -60552,6 +60592,7 @@ export const tmSpecies: TmSpecies = {
Species.ARCANINE, Species.ARCANINE,
Species.PONYTA, Species.PONYTA,
Species.RAPIDASH, Species.RAPIDASH,
Species.DEWGONG,
Species.MEW, Species.MEW,
Species.CYNDAQUIL, Species.CYNDAQUIL,
Species.QUILAVA, Species.QUILAVA,
@ -60582,6 +60623,8 @@ export const tmSpecies: TmSpecies = {
Species.SKITTY, Species.SKITTY,
Species.DELCATTY, Species.DELCATTY,
Species.MAWILE, Species.MAWILE,
Species.PLUSLE,
Species.MINUN,
Species.VOLBEAT, Species.VOLBEAT,
Species.ILLUMISE, Species.ILLUMISE,
Species.SWABLU, Species.SWABLU,
@ -60603,6 +60646,7 @@ export const tmSpecies: TmSpecies = {
Species.UXIE, Species.UXIE,
Species.MESPRIT, Species.MESPRIT,
Species.AZELF, Species.AZELF,
Species.SHAYMIN,
Species.LILLIPUP, Species.LILLIPUP,
Species.HERDIER, Species.HERDIER,
Species.STOUTLAND, Species.STOUTLAND,
@ -66276,8 +66320,13 @@ export const tmSpecies: TmSpecies = {
Species.BLOODMOON_URSALUNA, Species.BLOODMOON_URSALUNA,
], ],
[Moves.ICE_SPINNER]: [ [Moves.ICE_SPINNER]: [
Species.SQUIRTLE,
Species.WARTORTLE,
Species.BLASTOISE,
Species.JIGGLYPUFF, Species.JIGGLYPUFF,
Species.WIGGLYTUFF, Species.WIGGLYTUFF,
Species.SEEL,
Species.DEWGONG,
Species.SHELLDER, Species.SHELLDER,
Species.CLOYSTER, Species.CLOYSTER,
Species.ARTICUNO, Species.ARTICUNO,
@ -66290,9 +66339,12 @@ export const tmSpecies: TmSpecies = {
Species.DUNSPARCE, Species.DUNSPARCE,
Species.DELIBIRD, Species.DELIBIRD,
Species.DONPHAN, Species.DONPHAN,
Species.HITMONTOP,
Species.LUDICOLO, Species.LUDICOLO,
Species.SNORUNT, Species.SNORUNT,
Species.GLALIE, Species.GLALIE,
Species.REGICE,
Species.REGISTEEL,
Species.PIPLUP, Species.PIPLUP,
Species.PRINPLUP, Species.PRINPLUP,
Species.EMPOLEON, Species.EMPOLEON,
@ -66304,10 +66356,14 @@ export const tmSpecies: TmSpecies = {
Species.ABOMASNOW, Species.ABOMASNOW,
Species.WEAVILE, Species.WEAVILE,
Species.FROSLASS, Species.FROSLASS,
Species.CINCCINO,
Species.CRYOGONAL, Species.CRYOGONAL,
Species.MIENSHAO, Species.MIENSHAO,
Species.BERGMITE, Species.BERGMITE,
Species.AVALUGG, Species.AVALUGG,
Species.POPPLIO,
Species.BRIONNE,
Species.PRIMARINA,
Species.CRABOMINABLE, Species.CRABOMINABLE,
Species.MAREANIE, Species.MAREANIE,
Species.TOXAPEX, Species.TOXAPEX,
@ -66845,6 +66901,9 @@ export const tmSpecies: TmSpecies = {
Species.BLOODMOON_URSALUNA, Species.BLOODMOON_URSALUNA,
], ],
[Moves.CHILLING_WATER]: [ [Moves.CHILLING_WATER]: [
Species.SQUIRTLE,
Species.WARTORTLE,
Species.BLASTOISE,
Species.CLEFAIRY, Species.CLEFAIRY,
Species.CLEFABLE, Species.CLEFABLE,
Species.JIGGLYPUFF, Species.JIGGLYPUFF,
@ -66856,12 +66915,19 @@ export const tmSpecies: TmSpecies = {
Species.POLIWAG, Species.POLIWAG,
Species.POLIWHIRL, Species.POLIWHIRL,
Species.POLIWRATH, Species.POLIWRATH,
Species.TENTACOOL,
Species.TENTACRUEL,
Species.SLOWPOKE, Species.SLOWPOKE,
Species.SLOWBRO, Species.SLOWBRO,
Species.SEEL,
Species.DEWGONG,
Species.SHELLDER, Species.SHELLDER,
Species.CLOYSTER, Species.CLOYSTER,
Species.CHANSEY, Species.CHANSEY,
Species.HORSEA,
Species.SEADRA,
Species.GYARADOS, Species.GYARADOS,
Species.LAPRAS,
Species.VAPOREON, Species.VAPOREON,
Species.SNORLAX, Species.SNORLAX,
Species.DRATINI, Species.DRATINI,
@ -66869,8 +66935,13 @@ export const tmSpecies: TmSpecies = {
Species.DRAGONITE, Species.DRAGONITE,
Species.MEWTWO, Species.MEWTWO,
Species.MEW, Species.MEW,
Species.TOTODILE,
Species.CROCONAW,
Species.FERALIGATR,
Species.SENTRET, Species.SENTRET,
Species.FURRET, Species.FURRET,
Species.CHINCHOU,
Species.LANTURN,
Species.CLEFFA, Species.CLEFFA,
Species.MARILL, Species.MARILL,
Species.AZUMARILL, Species.AZUMARILL,
@ -66882,7 +66953,13 @@ export const tmSpecies: TmSpecies = {
Species.DUNSPARCE, Species.DUNSPARCE,
Species.QWILFISH, Species.QWILFISH,
Species.DELIBIRD, Species.DELIBIRD,
Species.KINGDRA,
Species.BLISSEY, Species.BLISSEY,
Species.SUICUNE,
Species.LUGIA,
Species.MUDKIP,
Species.MARSHTOMP,
Species.SWAMPERT,
Species.LOTAD, Species.LOTAD,
Species.LOMBRE, Species.LOMBRE,
Species.LUDICOLO, Species.LUDICOLO,
@ -66908,6 +66985,8 @@ export const tmSpecies: TmSpecies = {
Species.MILOTIC, Species.MILOTIC,
Species.SNORUNT, Species.SNORUNT,
Species.GLALIE, Species.GLALIE,
Species.LATIAS,
Species.LATIOS,
Species.KYOGRE, Species.KYOGRE,
Species.PIPLUP, Species.PIPLUP,
Species.PRINPLUP, Species.PRINPLUP,
@ -66933,6 +67012,8 @@ export const tmSpecies: TmSpecies = {
"", "",
"origin", "origin",
], ],
Species.PHIONE,
Species.MANAPHY,
Species.ARCEUS, Species.ARCEUS,
Species.OSHAWOTT, Species.OSHAWOTT,
Species.DEWOTT, Species.DEWOTT,
@ -66943,6 +67024,8 @@ export const tmSpecies: TmSpecies = {
"blue-striped", "blue-striped",
"white-striped", "white-striped",
], ],
Species.MINCCINO,
Species.CINCCINO,
Species.DUCKLETT, Species.DUCKLETT,
Species.SWANNA, Species.SWANNA,
Species.ALOMOMOLA, Species.ALOMOMOLA,
@ -66950,6 +67033,7 @@ export const tmSpecies: TmSpecies = {
Species.BEARTIC, Species.BEARTIC,
Species.CRYOGONAL, Species.CRYOGONAL,
Species.TORNADUS, Species.TORNADUS,
Species.KELDEO,
Species.FROAKIE, Species.FROAKIE,
Species.FROGADIER, Species.FROGADIER,
[ [
@ -66970,12 +67054,17 @@ export const tmSpecies: TmSpecies = {
Species.GOODRA, Species.GOODRA,
Species.BERGMITE, Species.BERGMITE,
Species.AVALUGG, Species.AVALUGG,
Species.POPPLIO,
Species.BRIONNE,
Species.PRIMARINA,
Species.YUNGOOS, Species.YUNGOOS,
Species.GUMSHOOS, Species.GUMSHOOS,
Species.CRABRAWLER, Species.CRABRAWLER,
Species.CRABOMINABLE, Species.CRABOMINABLE,
Species.MAREANIE, Species.MAREANIE,
Species.TOXAPEX, Species.TOXAPEX,
Species.DEWPIDER,
Species.ARAQUANID,
Species.ORANGURU, Species.ORANGURU,
Species.PASSIMIAN, Species.PASSIMIAN,
Species.SANDYGAST, Species.SANDYGAST,

View File

@ -342,8 +342,8 @@ export class LoadingScene extends SceneBase {
this.loadLoadingScreen(); this.loadLoadingScreen();
initVouchers();
initAchievements(); initAchievements();
initVouchers();
initStatsKeys(); initStatsKeys();
initPokemonPrevolutions(); initPokemonPrevolutions();
initBiomes(); initBiomes();

View File

@ -1,7 +1,7 @@
import { clientSessionId } from "#app/account"; import { clientSessionId } from "#app/account";
import BattleScene from "#app/battle-scene"; import BattleScene from "#app/battle-scene";
import { BattleType } from "#app/battle"; import { BattleType } from "#app/battle";
import { miscDialogue, getCharVariantFromDialogue } from "#app/data/dialogue"; import { getCharVariantFromDialogue } from "#app/data/dialogue";
import { pokemonEvolutions } from "#app/data/pokemon-evolutions"; import { pokemonEvolutions } from "#app/data/pokemon-evolutions";
import PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species"; import PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species";
import { trainerConfigs } from "#app/data/trainer-config"; import { trainerConfigs } from "#app/data/trainer-config";
@ -136,12 +136,16 @@ export class GameOverPhase extends BattlePhase {
}; };
if (this.victory && this.scene.gameMode.isClassic) { if (this.victory && this.scene.gameMode.isClassic) {
const message = miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1]; const dialogueKey = "miscDialogue:ending";
if (!this.scene.ui.shouldSkipDialogue(message)) { if (!this.scene.ui.shouldSkipDialogue(dialogueKey)) {
this.scene.ui.fadeIn(500).then(() => { this.scene.ui.fadeIn(500).then(() => {
this.scene.charSprite.showCharacter(`rival_${this.scene.gameData.gender === PlayerGender.FEMALE ? "m" : "f"}`, getCharVariantFromDialogue(miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1])).then(() => { const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
this.scene.ui.showDialogue(message, this.scene.gameData.gender === PlayerGender.FEMALE ? trainerConfigs[TrainerType.RIVAL].name : trainerConfigs[TrainerType.RIVAL].nameFemale, null, () => { const genderStr = PlayerGender[genderIndex].toLowerCase();
// Dialogue has to be retrieved so that the rival's expressions can be loaded and shown via getCharVariantFromDialogue
const dialogue = i18next.t(dialogueKey, { context: genderStr });
this.scene.charSprite.showCharacter(`rival_${this.scene.gameData.gender === PlayerGender.FEMALE ? "m" : "f"}`, getCharVariantFromDialogue(dialogue)).then(() => {
this.scene.ui.showDialogue(dialogueKey, this.scene.gameData.gender === PlayerGender.FEMALE ? trainerConfigs[TrainerType.RIVAL].name : trainerConfigs[TrainerType.RIVAL].nameFemale, null, () => {
this.scene.ui.fadeOut(500).then(() => { this.scene.ui.fadeOut(500).then(() => {
this.scene.charSprite.hide().then(() => { this.scene.charSprite.hide().then(() => {
const endCardPhase = new EndCardPhase(this.scene); const endCardPhase = new EndCardPhase(this.scene);

View File

@ -324,7 +324,7 @@ export const achvs = {
HATCH_SHINY: new Achv("HATCH_SHINY", "", "HATCH_SHINY.description", "golden_egg", 100).setSecret(), HATCH_SHINY: new Achv("HATCH_SHINY", "", "HATCH_SHINY.description", "golden_egg", 100).setSecret(),
HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY", "", "HIDDEN_ABILITY.description", "ability_charm", 75), HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY", "", "HIDDEN_ABILITY.description", "ability_charm", 75),
PERFECT_IVS: new Achv("PERFECT_IVS", "", "PERFECT_IVS.description", "blunder_policy", 100), PERFECT_IVS: new Achv("PERFECT_IVS", "", "PERFECT_IVS.description", "blunder_policy", 100),
CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY", "", "CLASSIC_VICTORY.description", "relic_crown", 150), CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY", "", "CLASSIC_VICTORY.description", "relic_crown", 150, c => c.gameData.gameStats.sessionsWon === 0),
UNEVOLVED_CLASSIC_VICTORY: new Achv("UNEVOLVED_CLASSIC_VICTORY", "", "UNEVOLVED_CLASSIC_VICTORY.description", "eviolite", 175, c => c.getParty().some(p => p.getSpeciesForm(true).speciesId in pokemonEvolutions)), UNEVOLVED_CLASSIC_VICTORY: new Achv("UNEVOLVED_CLASSIC_VICTORY", "", "UNEVOLVED_CLASSIC_VICTORY.description", "eviolite", 175, c => c.getParty().some(p => p.getSpeciesForm(true).speciesId in pokemonEvolutions)),
MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE", "", "MONO_GEN_ONE.description", "ribbon_gen1", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE", "", "MONO_GEN_ONE.description", "ribbon_gen1", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)),
MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)),

View File

@ -306,16 +306,18 @@ export default class UI extends Phaser.GameObjects.Container {
} }
} }
showDialogue(i18nKey: string, name: string | undefined, delay: integer | null = 0, callback: Function, callbackDelay?: integer, promptDelay?: integer): void { showDialogue(keyOrText: string, name: string | undefined, delay: integer | null = 0, callback: Function, callbackDelay?: integer, promptDelay?: integer): void {
const battleScene = this.scene as BattleScene; const battleScene = this.scene as BattleScene;
// Get localized dialogue (if available) // Get localized dialogue (if available)
let hasi18n = false; let hasi18n = false;
if (i18next.exists(i18nKey) ) { let text = keyOrText;
const genderIndex = battleScene.gameData.gender ?? PlayerGender.UNSET; const genderIndex = battleScene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex].toLowerCase(); const genderStr = PlayerGender[genderIndex].toLowerCase();
i18nKey = i18next.t(i18nKey, { context: genderStr });
if (i18next.exists(keyOrText) ) {
const i18nKey = keyOrText;
hasi18n = true; hasi18n = true;
text = i18next.t(i18nKey, { context: genderStr }); // override text with translation
// Skip dialogue if the player has enabled the option and the dialogue has been already seen // Skip dialogue if the player has enabled the option and the dialogue has been already seen
if (battleScene.skipSeenDialogues && battleScene.gameData.getSeenDialogues()[i18nKey] === true) { if (battleScene.skipSeenDialogues && battleScene.gameData.getSeenDialogues()[i18nKey] === true) {
@ -325,11 +327,11 @@ export default class UI extends Phaser.GameObjects.Container {
} }
} }
let showMessageAndCallback = () => { let showMessageAndCallback = () => {
hasi18n && battleScene.gameData.saveSeenDialogue(i18nKey); hasi18n && battleScene.gameData.saveSeenDialogue(keyOrText);
callback(); callback();
}; };
if (i18nKey.indexOf("$") > -1) { if (text.indexOf("$") > -1) {
const messagePages = i18nKey.split(/\$/g).map(m => m.trim()); const messagePages = text.split(/\$/g).map(m => m.trim());
for (let p = messagePages.length - 1; p >= 0; p--) { for (let p = messagePages.length - 1; p >= 0; p--) {
const originalFunc = showMessageAndCallback; const originalFunc = showMessageAndCallback;
showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc); showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc);
@ -338,9 +340,9 @@ export default class UI extends Phaser.GameObjects.Container {
} else { } else {
const handler = this.getHandler(); const handler = this.getHandler();
if (handler instanceof MessageUiHandler) { if (handler instanceof MessageUiHandler) {
(handler as MessageUiHandler).showDialogue(i18nKey, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay); (handler as MessageUiHandler).showDialogue(text, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
} else { } else {
this.getMessageHandler().showDialogue(i18nKey, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay); this.getMessageHandler().showDialogue(text, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
} }
} }
} }