[Localization] Achievements are now based on Player Gender (because some languages differ based on that). (#1721)

* Achivments(localization of name and description) now depend on the player gender

* Fixed Name in ptBr config

* Now the achivments are also shown with a gender specific title

* Changed it so it checks if PlayerGender is undefined first

* Update src/locales/de/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/en/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/es/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/fr/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/it/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/ko/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/pt_BR/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/system/voucher.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/zh_CN/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/locales/zh_TW/config.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/ui/achv-bar.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/ui/achv-bar.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/ui/achv-bar.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/ui/achv-bar.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/system/achv.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/system/achv.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/system/achv.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/ui/achvs-ui-handler.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/ui/achvs-ui-handler.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update src/ui/achvs-ui-handler.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* instantiate player gender on in AchvBar constructor

* Reverted the change made only for the tests. And adjusted the import to use the new enum file

* Changed a import to make vite build it again correctly

* Again some changes to the imports for the github docs that was complaining

* The new challenges are also now localized and gender based

* Readded getDescription

---------

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
This commit is contained in:
Jannik Tappert 2024-06-09 18:40:23 +02:00 committed by GitHub
parent c77508aef3
commit a99bcbce3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 1000 additions and 137 deletions

View File

@ -1,6 +1,7 @@
import {AchievementTranslationEntries} from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Errungenschaften",
},
@ -10,7 +11,7 @@ export const achv: AchievementTranslationEntries = {
"MoneyAchv": {
description:"Häufe eine Gesamtsumme von {{moneyAmount}} ₽ an",
description: "Häufe eine Gesamtsumme von {{moneyAmount}} ₽ an.",
},
"10K_MONEY": {
name: "Besserverdiener",
@ -26,7 +27,7 @@ export const achv: AchievementTranslationEntries = {
},
"DamageAchv": {
description: "Füge mit einem Treffer {{damageAmount}} Schaden zu",
description: "Füge mit einem Treffer {{damageAmount}} Schaden zu.",
},
"250_DMG": {
name: "Harte Treffer",
@ -42,7 +43,7 @@ export const achv: AchievementTranslationEntries = {
},
"HealAchv": {
description: "Heile {{healAmount}} {{HP}} auf einmal. Mit einer Attacke, Fähigkeit oder einem gehaltenen Gegenstand",
description: "Heile {{healAmount}} {{HP}} auf einmal. Mit einer Attacke, Fähigkeit oder einem gehaltenen Gegenstand.",
},
"250_HEAL": {
name: "Anfänger-Heiler",
@ -58,7 +59,7 @@ export const achv: AchievementTranslationEntries = {
},
"LevelAchv": {
description: "Erhöhe das Level eines Pokémon auf {{level}}",
description: "Erhöhe das Level eines Pokémon auf {{level}}.",
},
"LV_100": {
name: "Warte, es gibt mehr!",
@ -71,7 +72,7 @@ export const achv: AchievementTranslationEntries = {
},
"RibbonAchv": {
description: "Sammle insgesamt {{ribbonAmount}} Bänder",
description: "Sammle insgesamt {{ribbonAmount}} Bänder.",
},
"10_RIBBONS": {
name: "Champion der Pokémon Liga",
@ -91,82 +92,286 @@ export const achv: AchievementTranslationEntries = {
"TRANSFER_MAX_BATTLE_STAT": {
name: "Teamwork",
description: "Nutze Staffette, während der Anwender mindestens eines Statuswertes maximiert hat",
description: "Nutze Staffette, während der Anwender mindestens eines Statuswertes maximiert hat.",
},
"MAX_FRIENDSHIP": {
name: "Freundschaftsmaximierung",
description: "Erreiche maximale Freundschaft bei einem Pokémon",
description: "Erreiche maximale Freundschaft bei einem Pokémon.",
},
"MEGA_EVOLVE": {
name: "Megaverwandlung",
description: "Megaentwickle ein Pokémon",
description: "Megaentwickle ein Pokémon.",
},
"GIGANTAMAX": {
name: "Absolute Einheit",
description: "Gigadynamaximiere ein Pokémon",
description: "Gigadynamaximiere ein Pokémon.",
},
"TERASTALLIZE": {
name: "Typen-Bonus Enthusiast",
description: "Terrakristallisiere ein Pokémon",
description: "Terrakristallisiere ein Pokémon.",
},
"STELLAR_TERASTALLIZE": {
name: "Der geheime Typ",
description: "Terrakristallisiere ein Pokémon zum Typen Stellar",
description: "Terrakristallisiere ein Pokémon zum Typen Stellar.",
},
"SPLICE": {
name: "Unendliche Fusion",
description: "Kombiniere zwei Pokémon mit einem DNS-Keil",
description: "Kombiniere zwei Pokémon mit einem DNS-Keil.",
},
"MINI_BLACK_HOLE": {
name: "Ein Loch voller Items",
description: "Erlange ein Mini-Schwarzes Loch",
description: "Erlange ein Mini-Schwarzes Loch.",
},
"CATCH_MYTHICAL": {
name: "Mysteriöses!",
description: "Fange ein mysteriöses Pokémon",
description: "Fange ein mysteriöses Pokémon.",
},
"CATCH_SUB_LEGENDARY": {
name: "Sub-Legendär",
description: "Fange ein sub-legendäres Pokémon",
description: "Fange ein sub-legendäres Pokémon.",
},
"CATCH_LEGENDARY": {
name: "Legendär",
description: "Fange ein legendäres Pokémon",
description: "Fange ein legendäres Pokémon.",
},
"SEE_SHINY": {
name: "Schillerndes Licht",
description: "Finde ein wildes schillerndes Pokémon",
description: "Finde ein wildes schillerndes Pokémon.",
},
"SHINY_PARTY": {
name: "Das ist Hingabe",
description: "Habe ein Team aus schillernden Pokémon",
description: "Habe ein Team aus schillernden Pokémon.",
},
"HATCH_MYTHICAL": {
name: "Mysteriöses Ei",
description: "Lass ein mysteriöses Pokémon aus einem Ei schlüpfen",
description: "Lass ein mysteriöses Pokémon aus einem Ei schlüpfen.",
},
"HATCH_SUB_LEGENDARY": {
name: "Sub-Legendäres Ei",
description: "Lass ein sub-legendäres Pokémon aus einem Ei schlüpfen",
description: "Lass ein sub-legendäres Pokémon aus einem Ei schlüpfen.",
},
"HATCH_LEGENDARY": {
name: "Legendäres Ei",
description: "Lass ein legendäres Pokémon aus einem Ei schlüpfen",
description: "Lass ein legendäres Pokémon aus einem Ei schlüpfen.",
},
"HATCH_SHINY": {
name: "Schillerndes Ei",
description: "Lass ein schillerndes Pokémon aus einem Ei schlüpfen",
description: "Lass ein schillerndes Pokémon aus einem Ei schlüpfen.",
},
"HIDDEN_ABILITY": {
name: "Geheimes Talent",
description: "Fang ein Pokémon mit versteckter Fähigkeit",
description: "Fang ein Pokémon mit versteckter Fähigkeit.",
},
"PERFECT_IVS": {
name: "Zertifikat der Echtheit",
description: "Erhalte ein Pokémon mit perfekten IS-Werten",
description: "Erhalte ein Pokémon mit perfekten IS-Werten.",
},
"CLASSIC_VICTORY": {
name: "Ungeschlagen",
description: "Beende den klassischen Modus erfolgreich",
description: "Beende den klassischen Modus erfolgreich.",
},
"MONO_GEN_ONE": {
name: "Der originale Rivale",
description: "Schließe die 'Nur 1. Generation' Herausforderung ab.",
},
"MONO_GEN_TWO": {
name: "Generation 1.5",
description: "Schließe die 'Nur 2. Generation' Herausforderung ab.",
},
"MONO_GEN_THREE": {
name: "Zu viel Wasser?",
description: "Schließe die 'Nur 3. Generation' Herausforderung ab.",
},
"MONO_GEN_FOUR": {
name: "Ist SIE wirklich die Stärkste?",
description: "Schließe die 'Nur 4. Generation' Herausforderung ab.",
},
"MONO_GEN_FIVE": {
name: "Komplett Original",
description: "Schließe die 'Nur 5. Generation' Herausforderung ab.",
},
"MONO_GEN_SIX": {
name: "Fast Königlich",
description: "Schließe die 'Nur 6. Generation' Herausforderung ab."
},
"MONO_GEN_SEVEN": {
name: "Technisch gesehen",
description: "Schließe die 'Nur 7. Generation' Herausforderung ab."
},
"MONO_GEN_EIGHT": {
name: "Die Zeit des Champions",
description: "Schließe die 'Nur 8. Generation' Herausforderung ab."
},
"MONO_GEN_NINE": {
name: "Sie hat es dir leicht gemacht...",
description: "Schließe die 'Nur 9. Generation' Herausforderung ab."
},
"MonoType": {
description: "Beende die Monotyp-{{type}} Herausforderung."
},
"MONO_NORMAL": {
name: "Normaler Typ",
},
"MONO_FIGHTING": {
name: "Ich kenne Kung Fu."
},
"MONO_FLYING": {
name: "Ich glaube ich kann fliegen.",
},
"MONO_POISON": {
name: "Kantos Liebling",
},
"MONO_GROUND": {
name: "Auf dem Boden bleiben.",
},
"MONO_ROCK": {
name: "So hart wie Rocko.",
},
"MONO_BUG": {
name: "Steche wie ein Bibor.",
},
"MONO_GHOST": {
name: "Wer wird angerufen?",
},
"MONO_STEEL": {
name: "Stahlharte Entschlossenheit",
},
"MONO_FIRE": {
name: "Brennende Leidenschaft",
},
"MONO_WATER": {
name: "Wenn es regnet, schüttet es!",
},
"MONO_GRASS": {
name: "Grüner Daumen",
},
"MONO_ELECTRIC": {
name: "Elektrisierend",
},
"MONO_PSYCHIC": {
name: "Übernatürliches Talent",
},
"MONO_ICE": {
name: "Eis Eis Baby",
},
"MONO_DRAGON": {
name: "Siegfried bist du es?",
},
"MONO_DARK": {
name: "Es ist nur eine Phase!",
},
"MONO_FAIRY": {
name: "Ein ewiges Abenteuer!",
},
} as const;
// Achievement translations for the when the player character is female
export const PGFachv: AchievementTranslationEntries = {
"Achievements": {
name: PGMachv.Achievements.name,
},
"Locked": {
name: PGMachv.Locked.name,
},
"MoneyAchv": PGMachv.MoneyAchv,
"10K_MONEY": {
name: "Besserverdienerin",
},
"100K_MONEY": PGMachv["100K_MONEY"],
"1M_MONEY": {
name: "Millionärin",
},
"10M_MONEY": PGMachv["10M_MONEY"],
"DamageAchv": PGMachv.DamageAchv,
"250_DMG": PGMachv["250_DMG"],
"1000_DMG": PGMachv["1000_DMG"],
"2500_DMG": PGMachv["2500_DMG"],
"10000_DMG": {
name: "One Punch Woman",
},
"HealAchv": PGMachv.HealAchv,
"250_HEAL": {
name: "Anfänger-Heilerin",
},
"1000_HEAL": PGMachv["1000_HEAL"],
"2500_HEAL": {
name: "Klerikerin",
},
"10000_HEAL": {
name: "Wiederherstellungsmeisterin",
},
"LevelAchv": PGMachv.LevelAchv,
"LV_100": PGMachv["LV_100"],
"LV_250": PGMachv["LV_250"],
"LV_1000": PGMachv["LV_1000"],
"RibbonAchv": PGMachv.RibbonAchv,
"10_RIBBONS": PGMachv["10_RIBBONS"],
"25_RIBBONS": {
name: "Bänder-Sammlerin",
},
"50_RIBBONS": {
name: "Bänder-Expertin",
},
"75_RIBBONS": PGMachv["75_RIBBONS"],
"100_RIBBONS": {
name: "Bänder-Meisterin",
},
"TRANSFER_MAX_BATTLE_STAT": PGMachv.TRANSFER_MAX_BATTLE_STAT,
"MAX_FRIENDSHIP": PGMachv.MAX_FRIENDSHIP,
"MEGA_EVOLVE": PGMachv.MEGA_EVOLVE,
"GIGANTAMAX": PGMachv.GIGANTAMAX,
"TERASTALLIZE": PGMachv.TERASTALLIZE,
"STELLAR_TERASTALLIZE": PGMachv.STELLAR_TERASTALLIZE,
"SPLICE": PGMachv.SPLICE,
"MINI_BLACK_HOLE": PGMachv.MINI_BLACK_HOLE,
"CATCH_MYTHICAL": PGMachv.CATCH_MYTHICAL,
"CATCH_SUB_LEGENDARY": PGMachv.CATCH_SUB_LEGENDARY,
"CATCH_LEGENDARY": PGMachv.CATCH_LEGENDARY,
"SEE_SHINY": PGMachv.SEE_SHINY,
"SHINY_PARTY": PGMachv.SHINY_PARTY,
"HATCH_MYTHICAL": PGMachv.HATCH_MYTHICAL,
"HATCH_SUB_LEGENDARY": PGMachv.HATCH_SUB_LEGENDARY,
"HATCH_LEGENDARY": PGMachv.HATCH_LEGENDARY,
"HATCH_SHINY": PGMachv.HATCH_SHINY,
"HIDDEN_ABILITY": PGMachv.HIDDEN_ABILITY,
"PERFECT_IVS": PGMachv.PERFECT_IVS,
"CLASSIC_VICTORY": PGMachv.CLASSIC_VICTORY,
"MONO_GEN_ONE": PGMachv.MONO_GEN_ONE,
"MONO_GEN_TWO": PGMachv.MONO_GEN_TWO,
"MONO_GEN_THREE": PGMachv.MONO_GEN_THREE,
"MONO_GEN_FOUR": PGMachv.MONO_GEN_FOUR,
"MONO_GEN_FIVE": PGMachv.MONO_GEN_FIVE,
"MONO_GEN_SIX": PGMachv.MONO_GEN_SIX,
"MONO_GEN_SEVEN": PGMachv.MONO_GEN_SEVEN,
"MONO_GEN_EIGHT": PGMachv.MONO_GEN_EIGHT,
"MONO_GEN_NINE": PGMachv.MONO_GEN_NINE,
"MonoType": PGMachv.MonoType,
"MONO_NORMAL": PGMachv.MONO_NORMAL,
"MONO_FIGHTING": PGMachv.MONO_FIGHTING,
"MONO_FLYING": PGMachv.MONO_FLYING,
"MONO_POISON": PGMachv.MONO_POISON,
"MONO_GROUND": PGMachv.MONO_GROUND,
"MONO_ROCK": PGMachv.MONO_ROCK,
"MONO_BUG": PGMachv.MONO_BUG,
"MONO_GHOST": PGMachv.MONO_GHOST,
"MONO_STEEL": PGMachv.MONO_STEEL,
"MONO_FIRE": PGMachv.MONO_FIRE,
"MONO_WATER": PGMachv.MONO_WATER,
"MONO_GRASS": PGMachv.MONO_GRASS,
"MONO_ELECTRIC": PGMachv.MONO_ELECTRIC,
"MONO_PSYCHIC": PGMachv.MONO_PSYCHIC,
"MONO_ICE": PGMachv.MONO_ICE,
"MONO_DRAGON": PGMachv.MONO_DRAGON,
"MONO_DARK": PGMachv.MONO_DARK,
"MONO_FAIRY": PGMachv.MONO_FAIRY,
} as const;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const deConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Achievements",
},
@ -264,3 +265,6 @@ export const achv: AchievementTranslationEntries = {
name: "Mono FAIRY",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const enConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Logros",
},
@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = {
name: "Imbatible",
description: "Completa el juego en modo clásico.",
},
"MONO_GEN_ONE": {
name: "The Original Rival",
description: "Complete the generation one only challenge.",
},
"MONO_GEN_TWO": {
name: "Generation 1.5",
description: "Complete the generation two only challenge.",
},
"MONO_GEN_THREE": {
name: "Too much water?",
description: "Complete the generation three only challenge.",
},
"MONO_GEN_FOUR": {
name: "Is she really the hardest?",
description: "Complete the generation four only challenge.",
},
"MONO_GEN_FIVE": {
name: "All Original",
description: "Complete the generation five only challenge.",
},
"MONO_GEN_SIX": {
name: "Almost Royalty",
description: "Complete the generation six only challenge.",
},
"MONO_GEN_SEVEN": {
name: "Only Technically",
description: "Complete the generation seven only challenge.",
},
"MONO_GEN_EIGHT": {
name: "A Champion Time!",
description: "Complete the generation eight only challenge.",
},
"MONO_GEN_NINE": {
name: "She was going easy on you",
description: "Complete the generation nine only challenge.",
},
"MonoType": {
description: "Complete the {{type}} monotype challenge.",
},
"MONO_NORMAL": {
name: "Mono NORMAL",
},
"MONO_FIGHTING": {
name: "I Know Kung Fu",
},
"MONO_FLYING": {
name: "Mono FLYING",
},
"MONO_POISON": {
name: "Kanto's Favourite",
},
"MONO_GROUND": {
name: "Mono GROUND",
},
"MONO_ROCK": {
name: "Brock Hard",
},
"MONO_BUG": {
name: "Sting Like A Beedrill",
},
"MONO_GHOST": {
name: "Who you gonna call?",
},
"MONO_STEEL": {
name: "Mono STEEL",
},
"MONO_FIRE": {
name: "Mono FIRE",
},
"MONO_WATER": {
name: "When It Rains, It Pours",
},
"MONO_GRASS": {
name: "Mono GRASS",
},
"MONO_ELECTRIC": {
name: "Mono ELECTRIC",
},
"MONO_PSYCHIC": {
name: "Mono PSYCHIC",
},
"MONO_ICE": {
name: "Mono ICE",
},
"MONO_DRAGON": {
name: "Mono DRAGON",
},
"MONO_DARK": {
name: "It's just a phase",
},
"MONO_FAIRY": {
name: "Mono FAIRY",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const esConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Succès",
},
@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = {
name: "Invaincu·e",
description: "Terminer le jeu en mode classique",
},
"MONO_GEN_ONE": {
name: "The Original Rival",
description: "Complete the generation one only challenge.",
},
"MONO_GEN_TWO": {
name: "Generation 1.5",
description: "Complete the generation two only challenge.",
},
"MONO_GEN_THREE": {
name: "Too much water?",
description: "Complete the generation three only challenge.",
},
"MONO_GEN_FOUR": {
name: "Is she really the hardest?",
description: "Complete the generation four only challenge.",
},
"MONO_GEN_FIVE": {
name: "All Original",
description: "Complete the generation five only challenge.",
},
"MONO_GEN_SIX": {
name: "Almost Royalty",
description: "Complete the generation six only challenge.",
},
"MONO_GEN_SEVEN": {
name: "Only Technically",
description: "Complete the generation seven only challenge.",
},
"MONO_GEN_EIGHT": {
name: "A Champion Time!",
description: "Complete the generation eight only challenge.",
},
"MONO_GEN_NINE": {
name: "She was going easy on you",
description: "Complete the generation nine only challenge.",
},
"MonoType": {
description: "Complete the {{type}} monotype challenge.",
},
"MONO_NORMAL": {
name: "Mono NORMAL",
},
"MONO_FIGHTING": {
name: "I Know Kung Fu",
},
"MONO_FLYING": {
name: "Mono FLYING",
},
"MONO_POISON": {
name: "Kanto's Favourite",
},
"MONO_GROUND": {
name: "Mono GROUND",
},
"MONO_ROCK": {
name: "Brock Hard",
},
"MONO_BUG": {
name: "Sting Like A Beedrill",
},
"MONO_GHOST": {
name: "Who you gonna call?",
},
"MONO_STEEL": {
name: "Mono STEEL",
},
"MONO_FIRE": {
name: "Mono FIRE",
},
"MONO_WATER": {
name: "When It Rains, It Pours",
},
"MONO_GRASS": {
name: "Mono GRASS",
},
"MONO_ELECTRIC": {
name: "Mono ELECTRIC",
},
"MONO_PSYCHIC": {
name: "Mono PSYCHIC",
},
"MONO_ICE": {
name: "Mono ICE",
},
"MONO_DRAGON": {
name: "Mono DRAGON",
},
"MONO_DARK": {
name: "It's just a phase",
},
"MONO_FAIRY": {
name: "Mono FAIRY",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const frConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Achievements",
},
@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = {
name: "Undefeated",
description: "Beat the game in classic mode",
},
"MONO_GEN_ONE": {
name: "The Original Rival",
description: "Complete the generation one only challenge.",
},
"MONO_GEN_TWO": {
name: "Generation 1.5",
description: "Complete the generation two only challenge.",
},
"MONO_GEN_THREE": {
name: "Too much water?",
description: "Complete the generation three only challenge.",
},
"MONO_GEN_FOUR": {
name: "Is she really the hardest?",
description: "Complete the generation four only challenge.",
},
"MONO_GEN_FIVE": {
name: "All Original",
description: "Complete the generation five only challenge.",
},
"MONO_GEN_SIX": {
name: "Almost Royalty",
description: "Complete the generation six only challenge.",
},
"MONO_GEN_SEVEN": {
name: "Only Technically",
description: "Complete the generation seven only challenge.",
},
"MONO_GEN_EIGHT": {
name: "A Champion Time!",
description: "Complete the generation eight only challenge.",
},
"MONO_GEN_NINE": {
name: "She was going easy on you",
description: "Complete the generation nine only challenge.",
},
"MonoType": {
description: "Complete the {{type}} monotype challenge.",
},
"MONO_NORMAL": {
name: "Mono NORMAL",
},
"MONO_FIGHTING": {
name: "I Know Kung Fu",
},
"MONO_FLYING": {
name: "Mono FLYING",
},
"MONO_POISON": {
name: "Kanto's Favourite",
},
"MONO_GROUND": {
name: "Mono GROUND",
},
"MONO_ROCK": {
name: "Brock Hard",
},
"MONO_BUG": {
name: "Sting Like A Beedrill",
},
"MONO_GHOST": {
name: "Who you gonna call?",
},
"MONO_STEEL": {
name: "Mono STEEL",
},
"MONO_FIRE": {
name: "Mono FIRE",
},
"MONO_WATER": {
name: "When It Rains, It Pours",
},
"MONO_GRASS": {
name: "Mono GRASS",
},
"MONO_ELECTRIC": {
name: "Mono ELECTRIC",
},
"MONO_PSYCHIC": {
name: "Mono PSYCHIC",
},
"MONO_ICE": {
name: "Mono ICE",
},
"MONO_DRAGON": {
name: "Mono DRAGON",
},
"MONO_DARK": {
name: "It's just a phase",
},
"MONO_FAIRY": {
name: "Mono FAIRY",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const itConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "업적",
},
@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = {
name: "무패",
description: "클래식 모드 클리어",
},
"MONO_GEN_ONE": {
name: "The Original Rival",
description: "Complete the generation one only challenge.",
},
"MONO_GEN_TWO": {
name: "Generation 1.5",
description: "Complete the generation two only challenge.",
},
"MONO_GEN_THREE": {
name: "Too much water?",
description: "Complete the generation three only challenge.",
},
"MONO_GEN_FOUR": {
name: "Is she really the hardest?",
description: "Complete the generation four only challenge.",
},
"MONO_GEN_FIVE": {
name: "All Original",
description: "Complete the generation five only challenge.",
},
"MONO_GEN_SIX": {
name: "Almost Royalty",
description: "Complete the generation six only challenge.",
},
"MONO_GEN_SEVEN": {
name: "Only Technically",
description: "Complete the generation seven only challenge.",
},
"MONO_GEN_EIGHT": {
name: "A Champion Time!",
description: "Complete the generation eight only challenge.",
},
"MONO_GEN_NINE": {
name: "She was going easy on you",
description: "Complete the generation nine only challenge.",
},
"MonoType": {
description: "Complete the {{type}} monotype challenge.",
},
"MONO_NORMAL": {
name: "Mono NORMAL",
},
"MONO_FIGHTING": {
name: "I Know Kung Fu",
},
"MONO_FLYING": {
name: "Mono FLYING",
},
"MONO_POISON": {
name: "Kanto's Favourite",
},
"MONO_GROUND": {
name: "Mono GROUND",
},
"MONO_ROCK": {
name: "Brock Hard",
},
"MONO_BUG": {
name: "Sting Like A Beedrill",
},
"MONO_GHOST": {
name: "Who you gonna call?",
},
"MONO_STEEL": {
name: "Mono STEEL",
},
"MONO_FIRE": {
name: "Mono FIRE",
},
"MONO_WATER": {
name: "When It Rains, It Pours",
},
"MONO_GRASS": {
name: "Mono GRASS",
},
"MONO_ELECTRIC": {
name: "Mono ELECTRIC",
},
"MONO_PSYCHIC": {
name: "Mono PSYCHIC",
},
"MONO_ICE": {
name: "Mono ICE",
},
"MONO_DRAGON": {
name: "Mono DRAGON",
},
"MONO_DARK": {
name: "It's just a phase",
},
"MONO_FAIRY": {
name: "Mono FAIRY",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const koConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Conquistas",
},
@ -170,6 +171,7 @@ export const achv: AchievementTranslationEntries = {
},
"MONO_GEN_ONE": {
name: "O Início de Tudo",
description: "Complete o desafio da geração um.",
},
@ -264,3 +266,6 @@ export const achv: AchievementTranslationEntries = {
name: "Clube das Winx",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { weather } from "./weather";
export const ptBrConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Achievements",
},
@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = {
name: "Undefeated",
description: "Beat the game in classic mode",
},
"MONO_GEN_ONE": {
name: "The Original Rival",
description: "Complete the generation one only challenge.",
},
"MONO_GEN_TWO": {
name: "Generation 1.5",
description: "Complete the generation two only challenge.",
},
"MONO_GEN_THREE": {
name: "Too much water?",
description: "Complete the generation three only challenge.",
},
"MONO_GEN_FOUR": {
name: "Is she really the hardest?",
description: "Complete the generation four only challenge.",
},
"MONO_GEN_FIVE": {
name: "All Original",
description: "Complete the generation five only challenge.",
},
"MONO_GEN_SIX": {
name: "Almost Royalty",
description: "Complete the generation six only challenge.",
},
"MONO_GEN_SEVEN": {
name: "Only Technically",
description: "Complete the generation seven only challenge.",
},
"MONO_GEN_EIGHT": {
name: "A Champion Time!",
description: "Complete the generation eight only challenge.",
},
"MONO_GEN_NINE": {
name: "She was going easy on you",
description: "Complete the generation nine only challenge.",
},
"MonoType": {
description: "Complete the {{type}} monotype challenge.",
},
"MONO_NORMAL": {
name: "Mono NORMAL",
},
"MONO_FIGHTING": {
name: "I Know Kung Fu",
},
"MONO_FLYING": {
name: "Mono FLYING",
},
"MONO_POISON": {
name: "Kanto's Favourite",
},
"MONO_GROUND": {
name: "Mono GROUND",
},
"MONO_ROCK": {
name: "Brock Hard",
},
"MONO_BUG": {
name: "Sting Like A Beedrill",
},
"MONO_GHOST": {
name: "Who you gonna call?",
},
"MONO_STEEL": {
name: "Mono STEEL",
},
"MONO_FIRE": {
name: "Mono FIRE",
},
"MONO_WATER": {
name: "When It Rains, It Pours",
},
"MONO_GRASS": {
name: "Mono GRASS",
},
"MONO_ELECTRIC": {
name: "Mono ELECTRIC",
},
"MONO_PSYCHIC": {
name: "Mono PSYCHIC",
},
"MONO_ICE": {
name: "Mono ICE",
},
"MONO_DRAGON": {
name: "Mono DRAGON",
},
"MONO_DARK": {
name: "It's just a phase",
},
"MONO_FAIRY": {
name: "Mono FAIRY",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const zhCnConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -1,6 +1,7 @@
import { AchievementTranslationEntries } from "#app/plugins/i18n.js";
export const achv: AchievementTranslationEntries = {
// Achievement translations for the when the player character is male
export const PGMachv: AchievementTranslationEntries = {
"Achievements": {
name: "Achievements",
},
@ -168,4 +169,102 @@ export const achv: AchievementTranslationEntries = {
name: "Undefeated",
description: "Beat the game in classic mode",
},
"MONO_GEN_ONE": {
name: "The Original Rival",
description: "Complete the generation one only challenge.",
},
"MONO_GEN_TWO": {
name: "Generation 1.5",
description: "Complete the generation two only challenge.",
},
"MONO_GEN_THREE": {
name: "Too much water?",
description: "Complete the generation three only challenge.",
},
"MONO_GEN_FOUR": {
name: "Is she really the hardest?",
description: "Complete the generation four only challenge.",
},
"MONO_GEN_FIVE": {
name: "All Original",
description: "Complete the generation five only challenge.",
},
"MONO_GEN_SIX": {
name: "Almost Royalty",
description: "Complete the generation six only challenge.",
},
"MONO_GEN_SEVEN": {
name: "Only Technically",
description: "Complete the generation seven only challenge.",
},
"MONO_GEN_EIGHT": {
name: "A Champion Time!",
description: "Complete the generation eight only challenge.",
},
"MONO_GEN_NINE": {
name: "She was going easy on you",
description: "Complete the generation nine only challenge.",
},
"MonoType": {
description: "Complete the {{type}} monotype challenge.",
},
"MONO_NORMAL": {
name: "Mono NORMAL",
},
"MONO_FIGHTING": {
name: "I Know Kung Fu",
},
"MONO_FLYING": {
name: "Mono FLYING",
},
"MONO_POISON": {
name: "Kanto's Favourite",
},
"MONO_GROUND": {
name: "Mono GROUND",
},
"MONO_ROCK": {
name: "Brock Hard",
},
"MONO_BUG": {
name: "Sting Like A Beedrill",
},
"MONO_GHOST": {
name: "Who you gonna call?",
},
"MONO_STEEL": {
name: "Mono STEEL",
},
"MONO_FIRE": {
name: "Mono FIRE",
},
"MONO_WATER": {
name: "When It Rains, It Pours",
},
"MONO_GRASS": {
name: "Mono GRASS",
},
"MONO_ELECTRIC": {
name: "Mono ELECTRIC",
},
"MONO_PSYCHIC": {
name: "Mono PSYCHIC",
},
"MONO_ICE": {
name: "Mono ICE",
},
"MONO_DRAGON": {
name: "Mono DRAGON",
},
"MONO_DARK": {
name: "It's just a phase",
},
"MONO_FAIRY": {
name: "Mono FAIRY",
},
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)
export const PGFachv: AchievementTranslationEntries = PGMachv;

View File

@ -1,6 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { achv } from "./achv";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry";
@ -43,13 +43,14 @@ import { partyUiHandler } from "./party-ui-handler";
export const zhTwConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
achv: achv,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,
biome: biome,
challenges: challenges,
commandUiHandler: commandUiHandler,
PGMachv: PGMachv,
PGFachv: PGFachv,
PGMdialogue: PGMdialogue,
PGFdialogue: PGFdialogue,
PGMbattleSpecDialogue: PGMbattleSpecDialogue,

View File

@ -205,6 +205,7 @@ declare module "i18next" {
biome: SimpleTranslationEntries;
challenges: SimpleTranslationEntries;
commandUiHandler: SimpleTranslationEntries;
PGMachv: AchievementTranslationEntries;
PGMdialogue: DialogueTranslationEntries;
PGMbattleSpecDialogue: SimpleTranslationEntries;
PGMmiscDialogue: SimpleTranslationEntries;
@ -213,6 +214,7 @@ declare module "i18next" {
PGFbattleSpecDialogue: SimpleTranslationEntries;
PGFmiscDialogue: SimpleTranslationEntries;
PGFdoubleBattleDialogue: DialogueTranslationEntries;
PGFachv: AchievementTranslationEntries;
egg: SimpleTranslationEntries;
fightUiHandler: SimpleTranslationEntries;
gameMode: SimpleTranslationEntries;
@ -248,3 +250,4 @@ export function getIsInitialized(): boolean {
}
let isInitialized = false;

View File

@ -3,6 +3,8 @@ import BattleScene from "../battle-scene";
import { TurnHeldItemTransferModifier } from "../modifier/modifier";
import i18next from "../plugins/i18n";
import * as Utils from "../utils";
import { PlayerGender } from "#app/data/enums/player-gender";
import { ParseKeys } from "i18next";
import { Challenge, SingleGenerationChallenge, SingleTypeChallenge } from "#app/data/challenge.js";
export enum AchvTier {
@ -36,9 +38,15 @@ export class Achv {
this.localizationKey = localizationKey;
}
getName(): string {
/**
* Get the name of the achievement based on the gender of the player
* @param playerGender - the gender of the player
* @returns the name of the achievement localized for the player gender
*/
getName(playerGender: PlayerGender): string {
const prefix = playerGender === PlayerGender.FEMALE ?"PGF" : "PGM";
// Localization key is used to get the name of the achievement
return i18next.t(`achv:${this.localizationKey}.name`);
return i18next.t(`${prefix}achv:${this.localizationKey}.name` as ParseKeys);
}
getDescription(): string {
@ -140,105 +148,115 @@ export class ChallengeAchv extends Achv {
* @returns The description of the achievement
*/
export function getAchievementDescription(localizationKey: string): string {
// We need to get the player gender from the game data to add the correct prefix to the achievement name
let playerGender = PlayerGender.MALE;
if (this?.scene) {
playerGender = this.scene.gameData.gender;
}
let genderPrefix = "PGM";
if (playerGender === PlayerGender.FEMALE) {
genderPrefix = "PGF";
}
switch (localizationKey) {
case "10K_MONEY":
return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._10K_MONEY.moneyAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._10K_MONEY.moneyAmount.toLocaleString("en-US")});
case "100K_MONEY":
return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._100K_MONEY.moneyAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._100K_MONEY.moneyAmount.toLocaleString("en-US")});
case "1M_MONEY":
return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._1M_MONEY.moneyAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._1M_MONEY.moneyAmount.toLocaleString("en-US")});
case "10M_MONEY":
return i18next.t("achv:MoneyAchv.description", {"moneyAmount": achvs._10M_MONEY.moneyAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:MoneyAchv.description` as ParseKeys, {"moneyAmount": achvs._10M_MONEY.moneyAmount.toLocaleString("en-US")});
case "250_DMG":
return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._250_DMG.damageAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._250_DMG.damageAmount.toLocaleString("en-US")});
case "1000_DMG":
return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._1000_DMG.damageAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._1000_DMG.damageAmount.toLocaleString("en-US")});
case "2500_DMG":
return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._2500_DMG.damageAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._2500_DMG.damageAmount.toLocaleString("en-US")});
case "10000_DMG":
return i18next.t("achv:DamageAchv.description", {"damageAmount": achvs._10000_DMG.damageAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:DamageAchv.description` as ParseKeys, {"damageAmount": achvs._10000_DMG.damageAmount.toLocaleString("en-US")});
case "250_HEAL":
return i18next.t("achv:HealAchv.description", {"healAmount": achvs._250_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._250_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
case "1000_HEAL":
return i18next.t("achv:HealAchv.description", {"healAmount": achvs._1000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._1000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
case "2500_HEAL":
return i18next.t("achv:HealAchv.description", {"healAmount": achvs._2500_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._2500_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
case "10000_HEAL":
return i18next.t("achv:HealAchv.description", {"healAmount": achvs._10000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
return i18next.t(`${genderPrefix}achv:HealAchv.description` as ParseKeys, {"healAmount": achvs._10000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")});
case "LV_100":
return i18next.t("achv:LevelAchv.description", {"level": achvs.LV_100.level});
return i18next.t(`${genderPrefix}achv:LevelAchv.description` as ParseKeys, {"level": achvs.LV_100.level});
case "LV_250":
return i18next.t("achv:LevelAchv.description", {"level": achvs.LV_250.level});
return i18next.t(`${genderPrefix}achv:LevelAchv.description` as ParseKeys, {"level": achvs.LV_250.level});
case "LV_1000":
return i18next.t("achv:LevelAchv.description", {"level": achvs.LV_1000.level});
return i18next.t(`${genderPrefix}achv:LevelAchv.description` as ParseKeys, {"level": achvs.LV_1000.level});
case "10_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._10_RIBBONS.ribbonAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._10_RIBBONS.ribbonAmount.toLocaleString("en-US")});
case "25_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._25_RIBBONS.ribbonAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._25_RIBBONS.ribbonAmount.toLocaleString("en-US")});
case "50_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._50_RIBBONS.ribbonAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._50_RIBBONS.ribbonAmount.toLocaleString("en-US")});
case "75_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._75_RIBBONS.ribbonAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._75_RIBBONS.ribbonAmount.toLocaleString("en-US")});
case "100_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {"ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")});
return i18next.t(`${genderPrefix}achv:RibbonAchv.description` as ParseKeys, {"ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")});
case "TRANSFER_MAX_BATTLE_STAT":
return i18next.t("achv:TRANSFER_MAX_BATTLE_STAT.description");
return i18next.t(`${genderPrefix}achv:TRANSFER_MAX_BATTLE_STAT.description` as ParseKeys);
case "MAX_FRIENDSHIP":
return i18next.t("achv:MAX_FRIENDSHIP.description");
return i18next.t(`${genderPrefix}achv:MAX_FRIENDSHIP.description` as ParseKeys);
case "MEGA_EVOLVE":
return i18next.t("achv:MEGA_EVOLVE.description");
return i18next.t(`${genderPrefix}achv:MEGA_EVOLVE.description` as ParseKeys);
case "GIGANTAMAX":
return i18next.t("achv:GIGANTAMAX.description");
return i18next.t(`${genderPrefix}achv:GIGANTAMAX.description` as ParseKeys);
case "TERASTALLIZE":
return i18next.t("achv:TERASTALLIZE.description");
return i18next.t(`${genderPrefix}achv:TERASTALLIZE.description` as ParseKeys);
case "STELLAR_TERASTALLIZE":
return i18next.t("achv:STELLAR_TERASTALLIZE.description");
return i18next.t(`${genderPrefix}achv:STELLAR_TERASTALLIZE.description` as ParseKeys);
case "SPLICE":
return i18next.t("achv:SPLICE.description");
return i18next.t(`${genderPrefix}achv:SPLICE.description` as ParseKeys);
case "MINI_BLACK_HOLE":
return i18next.t("achv:MINI_BLACK_HOLE.description");
return i18next.t(`${genderPrefix}achv:MINI_BLACK_HOLE.description` as ParseKeys);
case "CATCH_MYTHICAL":
return i18next.t("achv:CATCH_MYTHICAL.description");
return i18next.t(`${genderPrefix}achv:CATCH_MYTHICAL.description` as ParseKeys);
case "CATCH_SUB_LEGENDARY":
return i18next.t("achv:CATCH_SUB_LEGENDARY.description");
return i18next.t(`${genderPrefix}achv:CATCH_SUB_LEGENDARY.description` as ParseKeys);
case "CATCH_LEGENDARY":
return i18next.t("achv:CATCH_LEGENDARY.description");
return i18next.t(`${genderPrefix}achv:CATCH_LEGENDARY.description` as ParseKeys);
case "SEE_SHINY":
return i18next.t("achv:SEE_SHINY.description");
return i18next.t(`${genderPrefix}achv:SEE_SHINY.description` as ParseKeys);
case "SHINY_PARTY":
return i18next.t("achv:SHINY_PARTY.description");
return i18next.t(`${genderPrefix}achv:SHINY_PARTY.description` as ParseKeys);
case "HATCH_MYTHICAL":
return i18next.t("achv:HATCH_MYTHICAL.description");
return i18next.t(`${genderPrefix}achv:HATCH_MYTHICAL.description` as ParseKeys);
case "HATCH_SUB_LEGENDARY":
return i18next.t("achv:HATCH_SUB_LEGENDARY.description");
return i18next.t(`${genderPrefix}achv:HATCH_SUB_LEGENDARY.description` as ParseKeys);
case "HATCH_LEGENDARY":
return i18next.t("achv:HATCH_LEGENDARY.description");
return i18next.t(`${genderPrefix}achv:HATCH_LEGENDARY.description` as ParseKeys);
case "HATCH_SHINY":
return i18next.t("achv:HATCH_SHINY.description");
return i18next.t(`${genderPrefix}achv:HATCH_SHINY.description` as ParseKeys);
case "HIDDEN_ABILITY":
return i18next.t("achv:HIDDEN_ABILITY.description");
return i18next.t(`${genderPrefix}achv:HIDDEN_ABILITY.description` as ParseKeys);
case "PERFECT_IVS":
return i18next.t("achv:PERFECT_IVS.description");
return i18next.t(`${genderPrefix}achv:PERFECT_IVS.description` as ParseKeys);
case "CLASSIC_VICTORY":
return i18next.t("achv:CLASSIC_VICTORY.description");
return i18next.t(`${genderPrefix}achv:CLASSIC_VICTORY.description` as ParseKeys);
case "MONO_GEN_ONE":
return i18next.t("achv:MONO_GEN_ONE.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_ONE.description` as ParseKeys);
case "MONO_GEN_TWO":
return i18next.t("achv:MONO_GEN_TWO.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_TWO.description` as ParseKeys);
case "MONO_GEN_THREE":
return i18next.t("achv:MONO_GEN_THREE.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_THREE.description` as ParseKeys);
case "MONO_GEN_FOUR":
return i18next.t("achv:MONO_GEN_FOUR.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_FOUR.description` as ParseKeys);
case "MONO_GEN_FIVE":
return i18next.t("achv:MONO_GEN_FIVE.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_FIVE.description` as ParseKeys);
case "MONO_GEN_SIX":
return i18next.t("achv:MONO_GEN_SIX.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_SIX.description` as ParseKeys);
case "MONO_GEN_SEVEN":
return i18next.t("achv:MONO_GEN_SEVEN.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_SEVEN.description` as ParseKeys);
case "MONO_GEN_EIGHT":
return i18next.t("achv:MONO_GEN_EIGHT.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_EIGHT.description` as ParseKeys);
case "MONO_GEN_NINE":
return i18next.t("achv:MONO_GEN_NINE.description");
return i18next.t(`${genderPrefix}achv:MONO_GEN_NINE.description` as ParseKeys);
case "MONO_NORMAL":
case "MONO_FIGHTING":
case "MONO_FLYING":
@ -257,7 +275,7 @@ export function getAchievementDescription(localizationKey: string): string {
case "MONO_DRAGON":
case "MONO_DARK":
case "MONO_FAIRY":
return i18next.t("achv:MonoType.description", {"type": i18next.t(`pokemonInfo:Type.${localizationKey.slice(5)}`)});
return i18next.t(`${genderPrefix}achv:MonoType.description` as ParseKeys, {"type": i18next.t(`pokemonInfo:Type.${localizationKey.slice(5)}`)});
default:
return "";
}

View File

@ -2,6 +2,7 @@ import BattleScene from "../battle-scene";
import { TrainerType } from "../data/enums/trainer-type";
import i18next from "../plugins/i18n";
import { Achv, AchvTier, achvs, getAchievementDescription } from "./achv";
import { PlayerGender } from "#app/data/enums/player-gender";
export enum VoucherType {
REGULAR,
@ -27,7 +28,12 @@ export class Voucher {
return !this.conditionFunc || this.conditionFunc(scene, args);
}
getName(): string {
/**
* Get the name of the voucher
* @param playerGender - this is ignored here. It's only there to match the signature of the function in the Achv class
* @returns the name of the voucher
*/
getName(playerGender: PlayerGender): string {
return getVoucherTypeName(this.voucherType);
}

View File

@ -2,6 +2,7 @@ import BattleScene from "../battle-scene";
import { Achv, getAchievementDescription } from "../system/achv";
import { Voucher } from "../system/voucher";
import { TextStyle, addTextObject } from "./text";
import { PlayerGender } from "#app/data/enums/player-gender";
export default class AchvBar extends Phaser.GameObjects.Container {
private defaultWidth: number;
@ -14,11 +15,13 @@ export default class AchvBar extends Phaser.GameObjects.Container {
private descriptionText: Phaser.GameObjects.Text;
private queue: (Achv | Voucher)[] = [];
private playerGender: PlayerGender;
public shown: boolean;
constructor(scene: BattleScene) {
super(scene, scene.game.canvas.width / 6, 0);
this.playerGender = scene.gameData.gender;
}
setup(): void {
@ -64,7 +67,7 @@ export default class AchvBar extends Phaser.GameObjects.Container {
this.bg.setTexture(`achv_bar${tier ? `_${tier + 1}` : ""}`);
this.icon.setFrame(achv.getIconImage());
this.titleText.setText(achv.getName());
this.titleText.setText(achv.getName(this.playerGender));
this.scoreText.setVisible(achv instanceof Achv);
if (achv instanceof Achv) {
this.descriptionText.setText(getAchievementDescription((achv as Achv).localizationKey));
@ -96,13 +99,13 @@ export default class AchvBar extends Phaser.GameObjects.Container {
ease: "Sine.easeOut"
});
this.scene.time.delayedCall(10000, () => this.hide());
this.scene.time.delayedCall(10000, () => this.hide(this.playerGender));
this.setVisible(true);
this.shown = true;
}
protected hide(): void {
protected hide(playerGender: PlayerGender): void {
if (!this.shown) {
return;
}

View File

@ -3,9 +3,11 @@ import { Button } from "../enums/buttons";
import i18next from "../plugins/i18n";
import { Achv, achvs, getAchievementDescription } from "../system/achv";
import MessageUiHandler from "./message-ui-handler";
import { TextStyle, addTextObject } from "./text";
import { addTextObject, TextStyle } from "./text";
import { Mode } from "./ui";
import { addWindow } from "./ui-theme";
import { PlayerGender } from "#app/data/enums/player-gender";
import { ParseKeys } from "i18next";
export default class AchvsUiHandler extends MessageUiHandler {
private achvsContainer: Phaser.GameObjects.Container;
@ -33,7 +35,14 @@ export default class AchvsUiHandler extends MessageUiHandler {
const headerBg = addWindow(this.scene, 0, 0, (this.scene.game.canvas.width / 6) - 2, 24);
headerBg.setOrigin(0, 0);
const headerText = addTextObject(this.scene, 0, 0, i18next.t("achv:Achievements.name"), TextStyle.SETTINGS_LABEL);
// We need to get the player gender from the game data to add the correct prefix to the achievement name
const playerGender = this.scene.gameData.gender;
let genderPrefix = "PGM";
if (playerGender === PlayerGender.FEMALE) {
genderPrefix = "PGF";
}
const headerText = addTextObject(this.scene, 0, 0, i18next.t(`${genderPrefix}achv:Achievements.name` as ParseKeys), TextStyle.SETTINGS_LABEL);
headerText.setOrigin(0, 0);
headerText.setPositionRelative(headerBg, 8, 4);
@ -137,7 +146,14 @@ export default class AchvsUiHandler extends MessageUiHandler {
}
protected showAchv(achv: Achv) {
achv.name = i18next.t(`achv:${achv.localizationKey}.name`);
// We need to get the player gender from the game data to add the correct prefix to the achievement name
const playerGender = this.scene.gameData.gender;
let genderPrefix = "PGM";
if (playerGender === PlayerGender.FEMALE) {
genderPrefix = "PGF";
}
achv.name = i18next.t(`${genderPrefix}achv:${achv.localizationKey}.name` as ParseKeys);
achv.description = getAchievementDescription(achv.localizationKey);
const achvUnlocks = this.scene.gameData.achvUnlocks;
const unlocked = achvUnlocks.hasOwnProperty(achv.id);
@ -145,7 +161,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.titleText.setText(unlocked ? achv.name : "???");
this.showText(!hidden ? achv.description : "");
this.scoreText.setText(`${achv.score}pt`);
this.unlockText.setText(unlocked ? new Date(achvUnlocks[achv.id]).toLocaleDateString() : i18next.t("achv:Locked.name"));
this.unlockText.setText(unlocked ? new Date(achvUnlocks[achv.id]).toLocaleDateString() : i18next.t(`${genderPrefix}achv:Locked.name` as ParseKeys));
}
processInput(button: Button): boolean {