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

View File

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

View File

@ -1,7 +1,7 @@
import { clientSessionId } from "#app/account";
import BattleScene from "#app/battle-scene";
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 PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species";
import { trainerConfigs } from "#app/data/trainer-config";
@ -136,12 +136,16 @@ export class GameOverPhase extends BattlePhase {
};
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.charSprite.showCharacter(`rival_${this.scene.gameData.gender === PlayerGender.FEMALE ? "m" : "f"}`, getCharVariantFromDialogue(miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1])).then(() => {
this.scene.ui.showDialogue(message, this.scene.gameData.gender === PlayerGender.FEMALE ? trainerConfigs[TrainerType.RIVAL].name : trainerConfigs[TrainerType.RIVAL].nameFemale, null, () => {
const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
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.charSprite.hide().then(() => {
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(),
HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY", "", "HIDDEN_ABILITY.description", "ability_charm", 75),
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)),
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)),

View File

@ -306,30 +306,32 @@ 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;
// Get localized dialogue (if available)
let hasi18n = false;
if (i18next.exists(i18nKey) ) {
const genderIndex = battleScene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex].toLowerCase();
i18nKey = i18next.t(i18nKey, { context: genderStr });
let text = keyOrText;
const genderIndex = battleScene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex].toLowerCase();
if (i18next.exists(keyOrText) ) {
const i18nKey = keyOrText;
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
if (battleScene.skipSeenDialogues &&battleScene.gameData.getSeenDialogues()[i18nKey] === true) {
if (battleScene.skipSeenDialogues && battleScene.gameData.getSeenDialogues()[i18nKey] === true) {
console.log(`Dialogue ${i18nKey} skipped`);
callback();
return;
}
}
let showMessageAndCallback = () => {
hasi18n && battleScene.gameData.saveSeenDialogue(i18nKey);
hasi18n && battleScene.gameData.saveSeenDialogue(keyOrText);
callback();
};
if (i18nKey.indexOf("$") > -1) {
const messagePages = i18nKey.split(/\$/g).map(m => m.trim());
if (text.indexOf("$") > -1) {
const messagePages = text.split(/\$/g).map(m => m.trim());
for (let p = messagePages.length - 1; p >= 0; p--) {
const originalFunc = showMessageAndCallback;
showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc);
@ -338,9 +340,9 @@ export default class UI extends Phaser.GameObjects.Container {
} else {
const handler = this.getHandler();
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 {
this.getMessageHandler().showDialogue(i18nKey, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
this.getMessageHandler().showDialogue(text, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
}
}
}