From f84fedd588ccfcb2ad92af0a29e3e0685723238c Mon Sep 17 00:00:00 2001 From: Dmitriy K Date: Sat, 22 Jun 2024 12:09:35 -0400 Subject: [PATCH] [Localize(en)] Add EN locale keys to Costar (#2517) * Add unthaw to moves that are missing it Add unthaw to all damaging fire moves Add Status Effect overrides for easier testing clean up comments and readd status cure before fainting * implement Costar ability, refactor TraceAbAttr to be more generic * format code, clean up comments * Revert "Add unthaw to moves that are missing it" This reverts commit 89494fa0c8633c90d42457ff1f125ebebd7153e5. * clean up comments, remove unused call * ability now copies negatives changes as well * separate PostSummonCopy into two different classes * small refactor of copy ability attrs * add costar to test suite * remove abstract declaration from comments * remove broken import statement * actually fix broken imports * add i18n calls * add en keys to other locales and sort by alpha --- src/data/ability.ts | 18 +++++++++++------- src/locales/de/ability-trigger.ts | 4 +++- src/locales/en/ability-trigger.ts | 8 +++++--- src/locales/es/ability-trigger.ts | 4 +++- src/locales/fr/ability-trigger.ts | 6 ++++-- src/locales/it/ability-trigger.ts | 4 +++- src/locales/ko/ability-trigger.ts | 6 ++++-- src/locales/pt_BR/ability-trigger.ts | 6 ++++-- src/locales/zh_CN/ability-trigger.ts | 4 +++- src/locales/zh_TW/ability-trigger.ts | 4 +++- 10 files changed, 43 insertions(+), 21 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index a9d6ef582c7..019c78a91f0 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1987,7 +1987,7 @@ export class PostSummonFormChangeAbAttr extends PostSummonAbAttr { /** Attempts to copy a pokemon's ability */ export class PostSummonCopyAbilityAbAttr extends PostSummonAbAttr { - private targetName: string; + private target: Pokemon; private targetAbilityName: string; applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { @@ -2011,7 +2011,7 @@ export class PostSummonCopyAbilityAbAttr extends PostSummonAbAttr { return false; } - this.targetName = target.name; + this.target = target; this.targetAbilityName = allAbilities[target.getAbility().id].name; pokemon.summonData.ability = target.getAbility().id; setAbilityRevealed(target); @@ -2021,15 +2021,17 @@ export class PostSummonCopyAbilityAbAttr extends PostSummonAbAttr { } getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { - return getPokemonMessage(pokemon, ` copied ${this.targetName}'s\n${this.targetAbilityName}!`); + return i18next.t("abilityTriggers:trace", { + pokemonName: getPokemonNameWithAffix(pokemon), + targetName: getPokemonNameWithAffix(this.target), + abilityName: this.targetAbilityName, + }); } } /** Attempt to copy the stat changes on an ally pokemon */ export class PostSummonCopyAllyStatsAbAttr extends PostSummonAbAttr { - private allyName: string; - applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { if (!pokemon.scene.currentBattle.double) { return false; @@ -2040,7 +2042,6 @@ export class PostSummonCopyAllyStatsAbAttr extends PostSummonAbAttr { return false; } - this.allyName = ally.name; pokemon.summonData.battleStats = ally.summonData.battleStats; pokemon.updateInfo(); @@ -2048,7 +2049,10 @@ export class PostSummonCopyAllyStatsAbAttr extends PostSummonAbAttr { } getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { - return getPokemonMessage(pokemon, ` copied ${this.allyName}'s stat changes!`); + return i18next.t("abilityTriggers:costar", { + pokemonName: getPokemonNameWithAffix(pokemon), + allyName: getPokemonNameWithAffix(pokemon.getAlly()), + }); } } diff --git a/src/locales/de/ability-trigger.ts b/src/locales/de/ability-trigger.ts index 895f2f55c64..a7e01bb594f 100644 --- a/src/locales/de/ability-trigger.ts +++ b/src/locales/de/ability-trigger.ts @@ -3,6 +3,8 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "{{pokemonName}} wurde durch {{abilityName}}\nvor Rückstoß geschützt!", "badDreams": "{{pokemonName}} ist in einem Alptraum gefangen!", - "windPowerCharged": "Der Treffer durch {{moveName}} läd die Stärke von {{pokemonName}} auf!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", "iceFaceAvoidedDamage": "{{pokemonName}} wehrt Schaden\nmit {{abilityName}} ab!", + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", + "windPowerCharged": "Der Treffer durch {{moveName}} läd die Stärke von {{pokemonName}} auf!", } as const; diff --git a/src/locales/en/ability-trigger.ts b/src/locales/en/ability-trigger.ts index 00370d82874..5852eb6315b 100644 --- a/src/locales/en/ability-trigger.ts +++ b/src/locales/en/ability-trigger.ts @@ -1,10 +1,12 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { - "blockRecoilDamage" : "{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!", + "blockRecoilDamage": "{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!", "badDreams": "{{pokemonName}} is tormented!", - "windPowerCharged": "Being hit by {{moveName}} charged {{pokemonName}} with power!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "{{pokemonName}} avoided\ndamage with {{abilityName}}!", "perishBody": "{{pokemonName}}'s {{abilityName}}\nwill faint both pokemon in 3 turns!", "poisonHeal": "{{pokemonName}}'s {{abilityName}}\nrestored its HP a little!", - "iceFaceAvoidedDamage": "{{pokemonName}} avoided\ndamage with {{abilityName}}!" + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", + "windPowerCharged": "Being hit by {{moveName}} charged {{pokemonName}} with power!", } as const; diff --git a/src/locales/es/ability-trigger.ts b/src/locales/es/ability-trigger.ts index 0b0dcbd067b..97153617f1e 100644 --- a/src/locales/es/ability-trigger.ts +++ b/src/locales/es/ability-trigger.ts @@ -3,6 +3,8 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "¡{{abilityName}} de {{pokemonName}}\nlo protegió del daño de retroceso!", "badDreams": "¡{{pokemonName}} está atormentado!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "¡{{pokemonNameWithAffix}} evitó\ndaño con {{abilityName}}!", + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", "windPowerCharged": "¡{{pokemonName}} se ha cargado de electricidad gracias a {{moveName}}!", - "iceFaceAvoidedDamage": "¡{{pokemonNameWithAffix}} evitó\ndaño con {{abilityName}}!" } as const; diff --git a/src/locales/fr/ability-trigger.ts b/src/locales/fr/ability-trigger.ts index 90a2a9ac109..cdf8faa269f 100644 --- a/src/locales/fr/ability-trigger.ts +++ b/src/locales/fr/ability-trigger.ts @@ -3,8 +3,10 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "{{abilityName}}\nde {{pokemonName}} le protège du contrecoup !", "badDreams": "{{pokemonName}} a le sommeil agité !", - "windPowerCharged": "{{pokemonName}} a été touché par la capacité {{moveName}} et se charge en électricité !", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "{{pokemonName}} évite les dégâts\navec {{abilityName}} !", "perishBody": "{{abilityName}} de {{pokemonName}}\nmettra les deux Pokémon K.O. dans trois tours !", "poisonHeal": "{{abilityName}} de {{pokemonName}}\nrestaure un peu ses PV !", - "iceFaceAvoidedDamage": "{{pokemonName}} évite les dégâts\navec {{abilityName}} !" + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", + "windPowerCharged": "{{pokemonName}} a été touché par la capacité {{moveName}} et se charge en électricité !", } as const; diff --git a/src/locales/it/ability-trigger.ts b/src/locales/it/ability-trigger.ts index 17dbfd89fb1..29625456c49 100644 --- a/src/locales/it/ability-trigger.ts +++ b/src/locales/it/ability-trigger.ts @@ -3,6 +3,8 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "{{abilityName}} di {{pokemonName}}\nl'ha protetto dal contraccolpo!", "badDreams": "{{pokemonName}} è tormentato dagli incubi!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "{{pokemonName}} ha evitato\ni danni grazie a {{abilityName}}!", + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", "windPowerCharged": "Venire colpito da {{moveName}} ha caricato {{pokemonName}}!", - "iceFaceAvoidedDamage": "{{pokemonName}} ha evitato\ni danni grazie a {{abilityName}}!" } as const; diff --git a/src/locales/ko/ability-trigger.ts b/src/locales/ko/ability-trigger.ts index c6c29b5f200..2fb40220c36 100644 --- a/src/locales/ko/ability-trigger.ts +++ b/src/locales/ko/ability-trigger.ts @@ -3,8 +3,10 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "{{pokemonName}}[[는]] {{abilityName}} 때문에\n반동 데미지를 받지 않는다!", "badDreams": "{{pokemonName}}[[는]]\n나이트메어 때문에 시달리고 있다!", - "windPowerCharged": "{{pokemonName}}[[는]]\n{{moveName}}에 맞아 충전되었다!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "{{pokemonName}}[[는]] {{abilityName}} 때문에\n데미지를 받지 않는다!", "perishBody": "{{pokemonName}}의 {{abilityName}} 때문에\n양쪽 포켓몬 모두는 3턴 후에 쓰러져 버린다!", "poisonHeal": "{{pokemonName}}[[는]] {{abilityName}}[[로]]인해\n조금 회복했다.", - "iceFaceAvoidedDamage": "{{pokemonName}}[[는]] {{abilityName}} 때문에\n데미지를 받지 않는다!", + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", + "windPowerCharged": "{{pokemonName}}[[는]]\n{{moveName}}에 맞아 충전되었다!", } as const; diff --git a/src/locales/pt_BR/ability-trigger.ts b/src/locales/pt_BR/ability-trigger.ts index 766243c7d7e..2adaa83b1bc 100644 --- a/src/locales/pt_BR/ability-trigger.ts +++ b/src/locales/pt_BR/ability-trigger.ts @@ -3,8 +3,10 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "{{abilityName}} de {{pokemonName}}\nprotegeu-o do dano de recuo!", "badDreams": "{{pokemonName}} está tendo pesadelos!", - "windPowerCharged": "Ser atingido por {{moveName}} carregou {{pokemonName}} com poder!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "{{pokemonName}} evitou\ndanos com sua {{abilityName}}!", "perishBody": "{{abilityName}} de {{pokemonName}}\nirá desmaiar ambos os Pokémon em 3 turnos!", "poisonHeal": "{{abilityName}} de {{pokemonName}}\nrestaurou seus PS um pouco!", - "iceFaceAvoidedDamage": "{{pokemonName}} evitou\ndanos com sua {{abilityName}}!" + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", + "windPowerCharged": "Ser atingido por {{moveName}} carregou {{pokemonName}} com poder!", } as const; diff --git a/src/locales/zh_CN/ability-trigger.ts b/src/locales/zh_CN/ability-trigger.ts index 908b3aaf258..7941433cdf1 100644 --- a/src/locales/zh_CN/ability-trigger.ts +++ b/src/locales/zh_CN/ability-trigger.ts @@ -3,6 +3,8 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "{{pokemonName}} 的 {{abilityName}}\n抵消了反作用力!", "badDreams": "{{pokemonName}} 被折磨着!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "{{pokemonName}} 因为 {{abilityName}}\n避免了伤害!", + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", "windPowerCharged": "受 {{moveName}} 的影响, {{pokemonName}} 提升了能力!", - "iceFaceAvoidedDamage": "{{pokemonName}} 因为 {{abilityName}}\n避免了伤害!" } as const; diff --git a/src/locales/zh_TW/ability-trigger.ts b/src/locales/zh_TW/ability-trigger.ts index 8dcbd0e8408..7809b6deff1 100644 --- a/src/locales/zh_TW/ability-trigger.ts +++ b/src/locales/zh_TW/ability-trigger.ts @@ -3,6 +3,8 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; export const abilityTriggers: SimpleTranslationEntries = { "blockRecoilDamage" : "{{pokemonName}} 的 {{abilityName}}\n抵消了反作用力!", "badDreams": "{{pokemonName}} 被折磨着!", + "costar": "{{pokemonName}} copied {{allyName}}'s stat changes!", + "iceFaceAvoidedDamage": "{{pokemonName}} avoided\ndamage with {{abilityName}}!", + "trace": "{{pokemonName}} copied {{targetName}}'s\n{{abilityName}}!", "windPowerCharged": "Being hit by {{moveName}} charged {{pokemonName}} with power!", - "iceFaceAvoidedDamage": "{{pokemonName}} avoided\ndamage with {{abilityName}}!" } as const;