diff --git a/src/data/ability.ts b/src/data/ability.ts index b1f0d2b197c..eb55f661e66 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2910,7 +2910,7 @@ export class PostTurnResetStatusAbAttr extends PostTurnAbAttr { } if (this.target?.status) { - this.target.scene.queueMessage(getPokemonMessage(this.target, getStatusEffectHealText(this.target.status?.effect))); + this.target.scene.queueMessage(getStatusEffectHealText(this.target.status?.effect, getPokemonNameWithAffix(this.target))); this.target.resetStatus(false); this.target.updateInfo(); return true; diff --git a/src/data/berry.ts b/src/data/berry.ts index 4e0d1dbd85f..2f0f466d8a9 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -1,5 +1,5 @@ import { PokemonHealPhase, StatChangePhase } from "../phases"; -import { getPokemonMessage } from "../messages"; +import { getPokemonMessage, getPokemonNameWithAffix } from "../messages"; import Pokemon, { HitResult } from "../field/pokemon"; import { BattleStat } from "./battle-stat"; import { getStatusEffectHealText } from "./status-effect"; @@ -80,7 +80,7 @@ export function getBerryEffectFunc(berryType: BerryType): BerryEffectFunc { pokemon.battleData.berriesEaten.push(berryType); } if (pokemon.status) { - pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect))); + pokemon.scene.queueMessage(getStatusEffectHealText(pokemon.status.effect, getPokemonNameWithAffix(pokemon))); } pokemon.resetStatus(true, true); pokemon.updateInfo(); diff --git a/src/data/move.ts b/src/data/move.ts index 5ab4b1e8a64..c62d7e3b53f 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1763,7 +1763,7 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr { if (!target.status || (target.status.effect === statusToApply && move.chance < 0)) { const statusAfflictResult = target.trySetStatus(statusToApply, true, user); if (statusAfflictResult) { - user.scene.queueMessage(getPokemonMessage(user, getStatusEffectHealText(user.status.effect))); + user.scene.queueMessage(getStatusEffectHealText(user.status.effect, getPokemonNameWithAffix(user))); user.resetStatus(); user.updateInfo(); } @@ -2037,7 +2037,7 @@ export class HealStatusEffectAttr extends MoveEffectAttr { const pokemon = this.selfTarget ? user : target; if (pokemon.status && this.effects.includes(pokemon.status.effect)) { - pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect))); + pokemon.scene.queueMessage(getStatusEffectHealText(pokemon.status.effect, getPokemonNameWithAffix(pokemon))); pokemon.resetStatus(); pokemon.updateInfo(); diff --git a/src/data/status-effect.ts b/src/data/status-effect.ts index 810bd4d9482..5949fb2f130 100644 --- a/src/data/status-effect.ts +++ b/src/data/status-effect.ts @@ -1,4 +1,5 @@ import * as Utils from "../utils"; +import i18next, { ParseKeys } from "i18next"; export enum StatusEffect { NONE, @@ -31,94 +32,52 @@ export class Status { } } -export function getStatusEffectObtainText(statusEffect: StatusEffect, sourceText?: string): string { - const sourceClause = sourceText ? ` ${statusEffect !== StatusEffect.SLEEP ? "by" : "from"} ${sourceText}` : ""; +function getStatusEffectMessageKey(statusEffect: StatusEffect): string { switch (statusEffect) { case StatusEffect.POISON: - return `\nwas poisoned${sourceClause}!`; + return "statusEffect:poison"; case StatusEffect.TOXIC: - return `\nwas badly poisoned${sourceClause}!`; + return "statusEffect:toxic"; case StatusEffect.PARALYSIS: - return ` was paralyzed${sourceClause}!\nIt may be unable to move!`; + return "statusEffect:paralysis"; case StatusEffect.SLEEP: - return `\nfell asleep${sourceClause}!`; + return "statusEffect:sleep"; case StatusEffect.FREEZE: - return `\nwas frozen solid${sourceClause}!`; + return "statusEffect:freeze"; case StatusEffect.BURN: - return `\nwas burned${sourceClause}!`; + return "statusEffect:burn"; + default: + return "statusEffect:none"; } - - return ""; } -export function getStatusEffectActivationText(statusEffect: StatusEffect): string { - switch (statusEffect) { - case StatusEffect.POISON: - case StatusEffect.TOXIC: - return " is hurt\nby poison!"; - case StatusEffect.PARALYSIS: - return " is paralyzed!\nIt can't move!"; - case StatusEffect.SLEEP: - return " is fast asleep."; - case StatusEffect.FREEZE: - return " is\nfrozen solid!"; - case StatusEffect.BURN: - return " is hurt\nby its burn!"; +export function getStatusEffectObtainText(statusEffect: StatusEffect, pokemonNameWithAffix: string, sourceText?: string): string { + if (!sourceText) { + const i18nKey = `${getStatusEffectMessageKey(statusEffect)}.obtain`as ParseKeys; + return i18next.t(i18nKey, { pokemonNameWithAffix: pokemonNameWithAffix }); } - - return ""; + const i18nKey = `${getStatusEffectMessageKey(statusEffect)}.obtainSource`as ParseKeys; + return i18next.t(i18nKey, { pokemonNameWithAffix: pokemonNameWithAffix, sourceText: sourceText }); } -export function getStatusEffectOverlapText(statusEffect: StatusEffect): string { - switch (statusEffect) { - case StatusEffect.POISON: - case StatusEffect.TOXIC: - return " is\nalready poisoned!"; - case StatusEffect.PARALYSIS: - return " is\nalready paralyzed!"; - case StatusEffect.SLEEP: - return " is\nalready asleep!"; - case StatusEffect.FREEZE: - return " is\nalready frozen!"; - case StatusEffect.BURN: - return " is\nalready burned!"; - } - - return ""; +export function getStatusEffectActivationText(statusEffect: StatusEffect, pokemonNameWithAffix: string): string { + const i18nKey = `${getStatusEffectMessageKey(statusEffect)}.activation` as ParseKeys; + return i18next.t(i18nKey, { pokemonNameWithAffix: pokemonNameWithAffix }); } -export function getStatusEffectHealText(statusEffect: StatusEffect): string { - switch (statusEffect) { - case StatusEffect.POISON: - case StatusEffect.TOXIC: - return " was\ncured of its poison!"; - case StatusEffect.PARALYSIS: - return " was\nhealed of paralysis!"; - case StatusEffect.SLEEP: - return " woke up!"; - case StatusEffect.FREEZE: - return " was\ndefrosted!"; - case StatusEffect.BURN: - return " was\nhealed of its burn!"; - } +export function getStatusEffectOverlapText(statusEffect: StatusEffect, pokemonNameWithAffix: string): string { + const i18nKey = `${getStatusEffectMessageKey(statusEffect)}.overlap` as ParseKeys; + return i18next.t(i18nKey, { pokemonNameWithAffix: pokemonNameWithAffix }); +} - return ""; +export function getStatusEffectHealText(statusEffect: StatusEffect, pokemonNameWithAffix: string): string { + const i18nKey = `${getStatusEffectMessageKey(statusEffect)}.heal` as ParseKeys; + return i18next.t(i18nKey, { pokemonNameWithAffix: pokemonNameWithAffix }); } export function getStatusEffectDescriptor(statusEffect: StatusEffect): string { - switch (statusEffect) { - case StatusEffect.POISON: - case StatusEffect.TOXIC: - return "poisoning"; - case StatusEffect.PARALYSIS: - return "paralysis"; - case StatusEffect.SLEEP: - return "sleep"; - case StatusEffect.FREEZE: - return "freezing"; - case StatusEffect.BURN: - return "burn"; - } + const i18nKey = `${getStatusEffectMessageKey(statusEffect)}.description` as ParseKeys; + return i18next.t(i18nKey); } export function getStatusEffectCatchRateMultiplier(statusEffect: StatusEffect): number { diff --git a/src/interfaces/locales.ts b/src/interfaces/locales.ts index 76dc76058aa..5f7c52100c1 100644 --- a/src/interfaces/locales.ts +++ b/src/interfaces/locales.ts @@ -58,6 +58,20 @@ export interface BerryTranslationEntries { [key: string]: BerryTranslationEntry } +export interface StatusEffectTranslationEntries { + [key: string]: StatusEffectTranslationEntry +} + +export interface StatusEffectTranslationEntry { + name: string, + obtain: string, + obtainSource: string, + activation: string, + overlap: string, + heal: string + description: string, +} + export interface AchievementTranslationEntry { name?: string, description?: string, diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index b7bb827d8d3..77834849d2f 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -35,13 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; -import { settings } from "#app/locales/de/settings.js"; -import { common } from "#app/locales/de/common.js"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const deConfig = { ability: ability, @@ -82,6 +83,7 @@ export const deConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/de/status-effect.ts b/src/locales/de/status-effect.ts new file mode 100644 index 00000000000..997d005987e --- /dev/null +++ b/src/locales/de/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "None", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "Gift", + description: "Vergiftungen", + obtain: "{{pokemonNameWithAffix}} wurde vergiftet!", + obtainSource: "{{pokemonNameWithAffix}} wurde durch {{sourceText}} vergiftet!", + activation: "{{pokemonNameWithAffix}} wird durch Gift verletzt!", + overlap: "{{pokemonNameWithAffix}} ist bereits vergiftet!", + heal: "Die Vergiftung von {{pokemonNameWithAffix}} wurde geheilt!" + }, + toxic: { + name: "Gift", + description: "Vergiftungen", + obtain: "{{pokemonNameWithAffix}} wurde schwer vergiftet!", + obtainSource: "{{pokemonNameWithAffix}} wurde durch {{sourceText}} schwer vergiftet!", + activation: "{{pokemonNameWithAffix}} wird durch Gift verletzt!", + overlap: "{{pokemonNameWithAffix}} ist bereits vergiftet!", + heal: "Die Vergiftung von {{pokemonNameWithAffix}} wurde geheilt!" + }, + paralysis: { + name: "Paralyse", + description: "Paralyse", + obtain: "{{pokemonNameWithAffix}} wurde paralysiert!\nEs kann eventuell nicht handeln!", + obtainSource: "{{pokemonNameWithAffix}} wurde durch {{sourceText}} paralysiert,\nEs kann eventuell nicht handeln!", + activation: "{{pokemonNameWithAffix}}ist paralysiert!\nEs kann nicht angreifen!", + overlap: "{{pokemonNameWithAffix}} ist bereits paralysiert!", + heal: "Die Paralyse von {{pokemonNameWithAffix}} wurde aufgehoben!" + }, + sleep: { + name: "Schlaf", + description: "Einschlafen", + obtain: "{{pokemonNameWithAffix}} ist eingeschlafen!", + obtainSource: "{{pokemonNameWithAffix}}ist durch {{sourceText}} eingeschlafen!", + activation: "{{pokemonNameWithAffix}} schläft tief und fest!", + overlap: "{{pokemonNameWithAffix}} schläft bereits!", + heal: "{{pokemonNameWithAffix}} ist aufgewacht!" + }, + freeze: { + name: "Gefroren", + description: "Einfrieren", + obtain: "{{pokemonNameWithAffix}} erstarrt zu Eis!", + obtainSource: "{{pokemonNameWithAffix}} erstarrt durch {{sourceText}} zu Eis!", + activation: "{{pokemonNameWithAffix}} ist eingefroren und kann nicht handeln!", + overlap: "{{pokemonNameWithAffix}} ist bereits eingefroren!", + heal: "{{pokemonNameWithAffix}} wurde aufgetaut!" + }, + burn: { + name: "Verbrennung ", + description: "Verbrennungen", + obtain: "{{pokemonNameWithAffix}} erleidet Verbrennungen!", + obtainSource: "{{pokemonNameWithAffix}} erleidet durch {{sourceText}} Verbrennungen!", + activation: "Die Verbrennungen schaden {{pokemonNameWithAffix}}!", + overlap: "{{pokemonNameWithAffix}} leidet bereits unter Verbrennungen!", + heal: "Die Verbrennungen von {{pokemonNameWithAffix}} wurden geheilt!" + }, +} as const; diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index fbbae3df329..1d40e61bbad 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -1,5 +1,5 @@ -import { common } from "#app/locales/en/common.js"; -import { settings } from "#app/locales/en/settings.js"; +import { common } from "./common.js"; +import { settings } from "./settings.js"; import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; import { PGFachv, PGMachv } from "./achv"; @@ -38,6 +38,7 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; @@ -83,6 +84,7 @@ export const enConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/en/status-effect.ts b/src/locales/en/status-effect.ts new file mode 100644 index 00000000000..162b2ada281 --- /dev/null +++ b/src/locales/en/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "None", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "Poison", + description: "poisoning", + obtain: "{{pokemonNameWithAffix}}\nwas poisoned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas poisoned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby poison!", + overlap: "{{pokemonNameWithAffix}} is\nalready poisoned!", + heal: "{{pokemonNameWithAffix}} was\ncured of its poison!" + }, + toxic: { + name: "Toxic", + description: "poisoning", + obtain: "{{pokemonNameWithAffix}}\nwas badly poisoned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas badly poisoned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby poison!", + overlap: "{{pokemonNameWithAffix}} is\nalready poisoned!", + heal: "{{pokemonNameWithAffix}} was\ncured of its poison!" + }, + paralysis: { + name: "Paralysis", + description: "paralysis", + obtain: "{{pokemonNameWithAffix}} was paralyzed,\nIt may be unable to move!", + obtainSource: "{{pokemonNameWithAffix}} was paralyzed by {{sourceText}}!\nIt may be unable to move!", + activation: "{{pokemonNameWithAffix}} is paralyzed!\nIt can't move!", + overlap: "{{pokemonNameWithAffix}} is\nalready paralyzed!", + heal: "{{pokemonNameWithAffix}} was\nhealed of paralysis!" + }, + sleep: { + name: "Sleep", + description: "sleep", + obtain: "{{pokemonNameWithAffix}}\nfell asleep!", + obtainSource: "{{pokemonNameWithAffix}}\nfell asleep from {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is fast asleep.", + overlap: "{{pokemonNameWithAffix}} is\nalready asleep!", + heal: "{{pokemonNameWithAffix}} woke up!" + }, + freeze: { + name: "Freeze", + description: "freezing", + obtain: "{{pokemonNameWithAffix}}\nwas frozen solid!", + obtainSource: "{{pokemonNameWithAffix}}\nwas frozen solid by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is\nfrozen solid!", + overlap: "{{pokemonNameWithAffix}} is\nalready frozen!", + heal: "{{pokemonNameWithAffix}} was\ndefrosted!" + }, + burn: { + name: "Burn", + description: "burn", + obtain: "{{pokemonNameWithAffix}}\nwas burned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas burned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby its burn!", + overlap: "{{pokemonNameWithAffix}} is\nalready burned!", + heal: "{{pokemonNameWithAffix}} was\nhealed of its burn!" + }, +} as const; diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index e09224ce85e..551c7a2f6dc 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -35,13 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; -import { settings } from "#app/locales/es/settings.js"; -import { common } from "#app/locales/es/common.js"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const esConfig = { ability: ability, @@ -82,6 +83,7 @@ export const esConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/es/status-effect.ts b/src/locales/es/status-effect.ts new file mode 100644 index 00000000000..975288fc451 --- /dev/null +++ b/src/locales/es/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "Ninguno", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "Envenenamiento", + description: "envenenamiento", + obtain: "¡{{pokemonNameWithAffix}}\nha sido envenenado!", + obtainSource: "¡{{pokemonNameWithAffix}}\nha sido envenenado por {{sourceText}}!", + activation: "¡El veneno resta PS a {{pokemonNameWithAffix}}!", + overlap: "¡{{pokemonNameWithAffix}} ya\nestá envenenado!", + heal: "¡{{pokemonNameWithAffix}} ya no\nestá envenenado!" + }, + toxic: { + name: "Envenenamiento grave", + description: "envenenamiento grave", + obtain: "¡{{pokemonNameWithAffix}}\nha sido gravemente envenenado!", + obtainSource: "¡{{pokemonNameWithAffix}}\nha sido gravemente envenenado por {{sourceText}}!", + activation: "¡El veneno resta PS a {{pokemonNameWithAffix}}!", + overlap: "¡{{pokemonNameWithAffix}} ya\nestá envenenado!", + heal: "¡{{pokemonNameWithAffix}} ya no\nestá envenenado!" + }, + paralysis: { + name: "Parálisis", + description: "parálisis", + obtain: "¡{{pokemonNameWithAffix}} sufre parálisis!\nQuizás no se pueda mover.", + obtainSource: "¡{{pokemonNameWithAffix}} sufre parálisis por {{sourceText}}!\nQuizás no se pueda mover.", + activation: "¡{{pokemonNameWithAffix}} está paralizado!\n¡No se puede mover!", + overlap: "¡{{pokemonNameWithAffix}} ya\nestá paralizado!", + heal: "¡{{pokemonNameWithAffix}} ya no\nestá paralizado!" + }, + sleep: { + name: "Dormir", + description: "dormir", + obtain: "¡{{pokemonNameWithAffix}}\nse ha dormido!", + obtainSource: "¡{{pokemonNameWithAffix}}\nse ha dormido\npor culpa de {{sourceText}}!", + activation: "¡{{pokemonNameWithAffix}} está/ndormido como un tronco.", + overlap: "¡{{pokemonNameWithAffix}} ya\nestá dormido!", + heal: "¡{{pokemonNameWithAffix}} se despertó!" + }, + freeze: { + name: "Congelamiento", + description: "congelamiento", + obtain: "¡{{pokemonNameWithAffix}}\nha sido congelado!", + obtainSource: "¡{{pokemonNameWithAffix}}\nha sido congelado por {{sourceText}}!", + activation: "¡{{pokemonNameWithAffix}} está\ncongelado!", + overlap: "¡{{pokemonNameWithAffix}} ya\nestá congelado!", + heal: "¡{{pokemonNameWithAffix}} se\nha descongelado!" + }, + burn: { + name: "Quemadura", + description: "quemadura", + obtain: "¡{{pokemonNameWithAffix}}\nse ha quemado!", + obtainSource: "¡{{pokemonNameWithAffix}}\nse ha quemado por {{sourceText}}!", + activation: "¡{{pokemonNameWithAffix}} se resiente\nde las quemaduras!", + overlap: "¡{{pokemonNameWithAffix}} ya\nestá quemado!", + heal: "¡{{pokemonNameWithAffix}} ya no\nestá quemado!" + }, +} as const; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index 6bc5a53a376..04af81adf52 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -35,13 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; -import { settings } from "#app/locales/fr/settings.js"; -import { common } from "#app/locales/fr/common.js"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const frConfig = { ability: ability, @@ -82,6 +83,7 @@ export const frConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/fr/status-effect.ts b/src/locales/fr/status-effect.ts new file mode 100644 index 00000000000..f4f210406c6 --- /dev/null +++ b/src/locales/fr/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "Aucun", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "Empoisonnement", + description: "empoisonné", + obtain: "{{pokemonNameWithAffix}} est\nempoisonné !", + obtainSource: "{{pokemonNameWithAffix}} est\nempoisonné par {{sourceText}} !", + activation: "{{pokemonNameWithAffix}}\nsouffre du poison !", + overlap: "{{pokemonNameWithAffix}} est\ndéjà empoisonné.", + heal: "{{pokemonNameWithAffix}} n’est\nplus empoisonné !" + }, + toxic: { + name: "Empoisonnement grave", + description: "gravement empoisonné", + obtain: "{{pokemonNameWithAffix}} est\ngravement empoisonné !", + obtainSource: "{{pokemonNameWithAffix}} est\ngravement empoisonné par {{sourceText}} !", + activation: "{{pokemonNameWithAffix}}\nsouffre du poison !", + overlap: "{{pokemonNameWithAffix}} est\ndéjà empoisonné.", + heal: "{{pokemonNameWithAffix}} n’est\nplus empoisonné !" + }, + paralysis: { + name: "Paralysie", + description: "paralysé", + obtain: "{{pokemonNameWithAffix}} est paralysé !\nIl aura du mal à attaquer !", + obtainSource: "{{pokemonNameWithAffix}} est paralysé\npar {{sourceText}} ! Il aura du mal à attaquer !", + activation: "{{pokemonNameWithAffix}} est paralysé !\nIl n’a pas pu attaquer !", + overlap: "{{pokemonNameWithAffix}} est\ndéjà paralysé.", + heal: "{{pokemonNameWithAffix}} n’est\nplus paralysé !" + }, + sleep: { + name: "Sommeil", + description: "endormi", + obtain: "{{pokemonNameWithAffix}}\ns’est endormi !", + obtainSource: "{{pokemonNameWithAffix}} est\nendormi par {{sourceText}} !", + activation: "{{pokemonNameWithAffix}}\ndort profondément.", + overlap: "{{pokemonNameWithAffix}}\ndort déjà.", + heal: "{{pokemonNameWithAffix}}\nse réveille !" + }, + freeze: { + name: "Gelé", + description: "gelé", + obtain: "{{pokemonNameWithAffix}} est\ngelé !", + obtainSource: "{{pokemonNameWithAffix}} est\ngelé par {{sourceText}} !", + activation: "{{pokemonNameWithAffix}}est gelé !\nIl ne peut plus attaquer !", + overlap: "{{pokemonNameWithAffix}} est\ndéjà gelé.", + heal: "{{pokemonNameWithAffix}} n’est\nplus gelé !" + }, + burn: { + name: "Brulure", + description: "brulé", + obtain: "{{pokemonNameWithAffix}} est\nbrulé !", + obtainSource: "{{pokemonNameWithAffix}} est\nbrulé par {{sourceText}} !", + activation: "{{pokemonNameWithAffix}}\nsouffre de sa brulure !", + overlap: "{{pokemonNameWithAffix}} est\ndéjà brulé.", + heal: "{{pokemonNameWithAffix}} n’est\nplus brulé !" + }, +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index fa0ddb5add2..ac2e37c2df5 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -35,13 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; -import { settings } from "#app/locales/it/settings.js"; -import { common } from "#app/locales/it/common.js"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const itConfig = { ability: ability, @@ -82,6 +83,7 @@ export const itConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/it/status-effect.ts b/src/locales/it/status-effect.ts new file mode 100644 index 00000000000..1a402ac30fd --- /dev/null +++ b/src/locales/it/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "None", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "Poison", + description: "poisoning", + obtain: "{{pokemonNameWithAffix}}\nwas poisoned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas poisoned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby poison!", + overlap: "{{pokemonNameWithAffix}} is\nalready poisoned!", + heal: "{{pokemonNameWithAffix}} was\ncured of its poison!" + }, + toxic: { + name: "Toxic", + description: "poisoning", + obtain: "{{pokemonNameWithAffix}}\nwas badly poisoned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas badly poisoned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby poison!", + overlap: "{{pokemonNameWithAffix}} is\nalready poisoned!", + heal: "{{pokemonNameWithAffix}} was\ncured of its poison!" + }, + paralysis: { + name: "Paralysis", + description: "paralysis", + obtain: "{{pokemonNameWithAffix}} was paralyzed,\nIt may be unable to move!", + obtainSource: "{{pokemonNameWithAffix}} was paralyzed by {{sourceText}},\nIt may be unable to move!", + activation: "{{pokemonNameWithAffix}} is paralyzed!\nIt can't move!", + overlap: "{{pokemonNameWithAffix}} is\nalready paralyzed!", + heal: "{{pokemonNameWithAffix}} was\nhealed of paralysis!" + }, + sleep: { + name: "Sleep", + description: "sleep", + obtain: "{{pokemonNameWithAffix}}\nfell asleep!", + obtainSource: "{{pokemonNameWithAffix}}\nfell asleep from {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is fast asleep.", + overlap: "{{pokemonNameWithAffix}} is\nalready asleep!", + heal: "{{pokemonNameWithAffix}} woke up!" + }, + freeze: { + name: "Freeze", + description: "freezing", + obtain: "{{pokemonNameWithAffix}}\nwas frozen solid!", + obtainSource: "{{pokemonNameWithAffix}}\nwas frozen solid by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is\nfrozen solid!", + overlap: "{{pokemonNameWithAffix}} is\nalready frozen!", + heal: "{{pokemonNameWithAffix}} was\ndefrosted!" + }, + burn: { + name: "Burn", + description: "burn", + obtain: "{{pokemonNameWithAffix}}\nwas burned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas burned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby its burn!", + overlap: "{{pokemonNameWithAffix}} is\nalready burned!", + heal: "{{pokemonNameWithAffix}} was\nhealed of its burn!" + }, +} as const; diff --git a/src/locales/ko/config.ts b/src/locales/ko/config.ts index 10fa5cb9a3d..59603c8519d 100644 --- a/src/locales/ko/config.ts +++ b/src/locales/ko/config.ts @@ -35,13 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; -import { settings } from "#app/locales/ko/settings.js"; -import { common } from "#app/locales/ko/common.js"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const koConfig = { ability: ability, @@ -82,6 +83,7 @@ export const koConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/ko/status-effect.ts b/src/locales/ko/status-effect.ts new file mode 100644 index 00000000000..c4e0ab52722 --- /dev/null +++ b/src/locales/ko/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "없음", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "독", + description: "독", + obtain: "{{pokemonNameWithAffix}}의\n몸에 독이 퍼졌다!", + obtainSource: "{{pokemonNameWithAffix}}[[는]]\n{{sourceText}} 때문에 몸에 독이 퍼졌다!", + activation: "{{pokemonNameWithAffix}}[[는]]\n독에 의한 데미지를 입었다!", + overlap: "{{pokemonNameWithAffix}}[[는]] 이미\n몸에 독이 퍼진 상태다.", + heal: "{{pokemonNameWithAffix}}의 독은\n말끔하게 해독됐다!" + }, + toxic: { + name: "맹독", + description: "독", + obtain: "{{pokemonNameWithAffix}}의\n몸에 맹독이 퍼졌다!", + obtainSource: "{{pokemonNameWithAffix}}[[는]]\n{{sourceText}} 때문에 몸에 맹독이 퍼졌다!", + activation: "{{pokemonNameWithAffix}}[[는]]\n독에 의한 데미지를 입었다!", + overlap: "{{pokemonNameWithAffix}}[[는]] 이미\n몸에 독이 퍼진 상태다.", + heal: "{{pokemonNameWithAffix}}의 독은\n말끔하게 해독됐다!" + }, + paralysis: { + name: "마비", + description: "마비", + obtain: "{{pokemonNameWithAffix}}[[는]] 마비되어\n기술이 나오기 어려워졌다!", + obtainSource: "{{pokemonNameWithAffix}}[[는]] {{sourceText}} 때문에\n마비되어 기술이 나오기 어려워졌다!", + activation: "{{pokemonNameWithAffix}}[[는]]\n몸이 저려서 움직일 수 없다!", + overlap: "{{pokemonNameWithAffix}}[[는]]\n이미 마비되어 있다!", + heal: "{{pokemonNameWithAffix}}의\n몸저림이 풀렸다!" + }, + sleep: { + name: "잠듦", + description: "잠듦", + obtain: "{{pokemonNameWithAffix}}[[는]]\n잠들어 버렸다!", + obtainSource: "{{pokemonNameWithAffix}}[[는]]\n{{sourceText}} 때문에 잠들어 버렸다!", + activation: "{{pokemonNameWithAffix}}[[는]]\n쿨쿨 잠들어 있다.", + overlap: "{{pokemonNameWithAffix}}[[는]]\n이미 잠들어 있다.", + heal: "{{pokemonNameWithAffix}}[[는]]\n눈을 떴다!" + }, + freeze: { + name: "얼음", + description: "얼음", + obtain: "{{pokemonNameWithAffix}}[[는]]\n얼어붙었다!", + obtainSource: "{{pokemonNameWithAffix}}[[는]]\n{{sourceText}} 때문에 얼어붙었다!", + activation: "{{pokemonNameWithAffix}}[[는]]\n얼어 버려서 움직일 수 없다!", + overlap: "{{pokemonNameWithAffix}}[[는]]\n이미 얼어 있다.", + heal: "{{pokemonNameWithAffix}}의\n얼음 상태가 나았다!" + }, + burn: { + name: "화상", + description: "화상", + obtain: "{{pokemonNameWithAffix}}[[는]]\n화상을 입었다!", + obtainSource: "{{pokemonNameWithAffix}}[[는]]\n{{sourceText}} 때문에 화상을 입었다!", + activation: "{{pokemonNameWithAffix}}[[는]]\n화상 데미지를 입었다!", + overlap: "{{pokemonNameWithAffix}}[[는]] 이미\n화상을 입은 상태다.", + heal: "{{pokemonNameWithAffix}}의\n화상이 나았다!" + }, +} as const; diff --git a/src/locales/pt_BR/config.ts b/src/locales/pt_BR/config.ts index 53195fbc32e..ac4176144c6 100644 --- a/src/locales/pt_BR/config.ts +++ b/src/locales/pt_BR/config.ts @@ -1,5 +1,3 @@ -import { common } from "#app/locales/pt_BR/common.js"; -import { settings } from "#app/locales/pt_BR/settings.js"; import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; import { PGFachv, PGMachv } from "./achv"; @@ -30,7 +28,6 @@ import { menuUiHandler } from "./menu-ui-handler"; import { modifierType } from "./modifier-type"; import { move } from "./move"; import { nature } from "./nature"; -import { partyUiHandler } from "./party-ui-handler"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonInfo } from "./pokemon-info"; @@ -38,10 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const ptBrConfig = { ability: ability, @@ -80,6 +81,7 @@ export const ptBrConfig = { pokemonInfo: pokemonInfo, pokemonInfoContainer: pokemonInfoContainer, saveSlotSelectUiHandler: saveSlotSelectUiHandler, + statusEffect: statusEffect, settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, diff --git a/src/locales/pt_BR/status-effect.ts b/src/locales/pt_BR/status-effect.ts new file mode 100644 index 00000000000..d99e2bd5ec1 --- /dev/null +++ b/src/locales/pt_BR/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "Nenhum", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "Envenenamento", + description: "envenenamento", + obtain: "{{pokemonNameWithAffix}}\nfoi envenenado!", + obtainSource: "{{pokemonNameWithAffix}}\nfoi envenenado por {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} foi ferido\ncom o veneno!", + overlap: "{{pokemonNameWithAffix}} já\nestá envenenado!", + heal: "{{pokemonNameWithAffix}} se\ncurou do envenenamento!" + }, + toxic: { + name: "Toxic", + description: "envenenamento", + obtain: "{{pokemonNameWithAffix}}\nfoi seriamente envenenado!", + obtainSource: "{{pokemonNameWithAffix}} foi seriamente\nenvenenado por {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} foi ferido\ncom o veneno!", + overlap: "{{pokemonNameWithAffix}} já\nestá envenenado!", + heal: "{{pokemonNameWithAffix}} se\ncurou do envenenamento!" + }, + paralysis: { + name: "Paralisia", + description: "paralisia", + obtain: "{{pokemonNameWithAffix}} foi paralisado,\nTalvez ele não consiga se mover!", + obtainSource: "{{pokemonNameWithAffix}} foi paralisado por {{sourceText}},\nTalvez ele não consiga se mover!", + activation: "{{pokemonNameWithAffix}} está paralisado!\nEle não consegue se mover!", + overlap: "{{pokemonNameWithAffix}} já\nestá paralisado!", + heal: "{{pokemonNameWithAffix}} foi\ncurado da paralisia!" + }, + sleep: { + name: "Dormindo", + description: "dormindo", + obtain: "{{pokemonNameWithAffix}}\nadormeceu!", + obtainSource: "{{pokemonNameWithAffix}}\ndormiu devido a {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} está dormindo profundamente.", + overlap: "{{pokemonNameWithAffix}} já\nestá dormindo!", + heal: "{{pokemonNameWithAffix}} acordou!" + }, + freeze: { + name: "Congelamento", + description: "congelando", + obtain: "{{pokemonNameWithAffix}}\nfoi congelado!", + obtainSource: "{{pokemonNameWithAffix}}\nfoi congelado por {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} está\ncongelado!", + overlap: "{{pokemonNameWithAffix}} já\nestá congelado!", + heal: "{{pokemonNameWithAffix}} foi\ndescongelado!" + }, + burn: { + name: "Queimadura", + description: "queimadura", + obtain: "{{pokemonNameWithAffix}}\nfoi queimado!", + obtainSource: "{{pokemonNameWithAffix}}\nfoi queimado por {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} foi ferido\npor sua queimadura!", + overlap: "{{pokemonNameWithAffix}} já\nestá queimado!", + heal: "{{pokemonNameWithAffix}} foi\ncurado de sua queimadura!" + }, +} as const; diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 169c91535ed..1d987eaec16 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -35,13 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; -import { settings } from "#app/locales/zh_CN/settings.js"; -import { common } from "#app/locales/zh_CN/common.js"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const zhCnConfig = { ability: ability, @@ -82,6 +83,7 @@ export const zhCnConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/zh_CN/status-effect.ts b/src/locales/zh_CN/status-effect.ts new file mode 100644 index 00000000000..b9df1733bc1 --- /dev/null +++ b/src/locales/zh_CN/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "无", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "中毒", + description: "中毒", + obtain: "{{pokemonNameWithAffix}}中毒了!", + obtainSource: "{{pokemonNameWithAffix}}因{{sourceText}}中毒了!", + activation: "{{pokemonNameWithAffix}}受到了毒的伤害!", + overlap: "{{pokemonNameWithAffix}}已经中毒了!", + heal: "{{pokemonNameWithAffix}}中的毒彻底清除了!" + }, + toxic: { + name: "剧毒", + description: "中毒", + obtain: "{{pokemonNameWithAffix}}中了剧毒!", + obtainSource: "{{pokemonNameWithAffix}}因{{sourceText}}中了剧毒!", + activation: "{{pokemonNameWithAffix}}受到了毒的伤害!", + overlap: "{{pokemonNameWithAffix}}已经中毒了!", + heal: "{{pokemonNameWithAffix}}中的毒彻底清除了!" + }, + paralysis: { + name: "麻痹", + description: "麻痹", + obtain: "{{pokemonNameWithAffix}}麻痹了,很难使出招式!", + obtainSource: "{{pokemonNameWithAffix}}被{{sourceText}}麻痹了,很难使出招式!", + activation: "{{pokemonNameWithAffix}}因身体麻痹而无法行动!", + overlap: "{{pokemonNameWithAffix}}已经麻痹了!", + heal: "{{pokemonNameWithAffix}}的麻痹治愈了!" + }, + sleep: { + name: "睡眠", + description: "睡眠", + obtain: "{{pokemonNameWithAffix}}睡着了!", + obtainSource: "{{pokemonNameWithAffix}}因{{sourceText}}睡着了!", + activation: "{{pokemonNameWithAffix}}正在呼呼大睡。", + overlap: "{{pokemonNameWithAffix}}已经睡着了!", + heal: "{{pokemonNameWithAffix}}醒了!" + }, + freeze: { + name: "冰冻", + description: "冰冻", + obtain: "{{pokemonNameWithAffix}}冻住了!", + obtainSource: "{{pokemonNameWithAffix}}因{{sourceText}}冻住了!", + activation: "{{pokemonNameWithAffix}}因冻住了而无法行动!", + overlap: "{{pokemonNameWithAffix}}已经冻住了!", + heal: "{{pokemonNameWithAffix}}治愈了冰冻状态!" + }, + burn: { + name: "灼伤", + description: "灼伤", + obtain: "{{pokemonNameWithAffix}}被灼伤了!", + obtainSource: "{{pokemonNameWithAffix}}因{{sourceText}}被灼伤了!", + activation: "{{pokemonNameWithAffix}}受到了灼伤的伤害!", + overlap: "{{pokemonNameWithAffix}}已经被灼伤了!", + heal: "{{pokemonNameWithAffix}}的灼伤治愈了!" + }, +} as const; diff --git a/src/locales/zh_TW/config.ts b/src/locales/zh_TW/config.ts index 1cbb4e6e2c1..688f3b47033 100644 --- a/src/locales/zh_TW/config.ts +++ b/src/locales/zh_TW/config.ts @@ -35,13 +35,14 @@ import { pokemonInfoContainer } from "./pokemon-info-container"; import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler"; import { splashMessages } from "./splash-messages"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; +import { statusEffect } from "./status-effect"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; import { partyUiHandler } from "./party-ui-handler"; -import { settings } from "#app/locales/zh_TW/settings.js"; -import { common } from "#app/locales/zh_TW/common.js"; +import { settings } from "./settings.js"; +import { common } from "./common.js"; export const zhTwConfig = { ability: ability, @@ -82,6 +83,7 @@ export const zhTwConfig = { settings: settings, splashMessages: splashMessages, starterSelectUiHandler: starterSelectUiHandler, + statusEffect: statusEffect, titles: titles, trainerClasses: trainerClasses, trainerNames: trainerNames, diff --git a/src/locales/zh_TW/status-effect.ts b/src/locales/zh_TW/status-effect.ts new file mode 100644 index 00000000000..1a402ac30fd --- /dev/null +++ b/src/locales/zh_TW/status-effect.ts @@ -0,0 +1,67 @@ +import { StatusEffectTranslationEntries } from "#app/interfaces/locales.js"; + +export const statusEffect: StatusEffectTranslationEntries = { + none: { + name: "None", + description: "", + obtain: "", + obtainSource: "", + activation: "", + overlap: "", + heal: "" + }, + poison: { + name: "Poison", + description: "poisoning", + obtain: "{{pokemonNameWithAffix}}\nwas poisoned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas poisoned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby poison!", + overlap: "{{pokemonNameWithAffix}} is\nalready poisoned!", + heal: "{{pokemonNameWithAffix}} was\ncured of its poison!" + }, + toxic: { + name: "Toxic", + description: "poisoning", + obtain: "{{pokemonNameWithAffix}}\nwas badly poisoned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas badly poisoned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby poison!", + overlap: "{{pokemonNameWithAffix}} is\nalready poisoned!", + heal: "{{pokemonNameWithAffix}} was\ncured of its poison!" + }, + paralysis: { + name: "Paralysis", + description: "paralysis", + obtain: "{{pokemonNameWithAffix}} was paralyzed,\nIt may be unable to move!", + obtainSource: "{{pokemonNameWithAffix}} was paralyzed by {{sourceText}},\nIt may be unable to move!", + activation: "{{pokemonNameWithAffix}} is paralyzed!\nIt can't move!", + overlap: "{{pokemonNameWithAffix}} is\nalready paralyzed!", + heal: "{{pokemonNameWithAffix}} was\nhealed of paralysis!" + }, + sleep: { + name: "Sleep", + description: "sleep", + obtain: "{{pokemonNameWithAffix}}\nfell asleep!", + obtainSource: "{{pokemonNameWithAffix}}\nfell asleep from {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is fast asleep.", + overlap: "{{pokemonNameWithAffix}} is\nalready asleep!", + heal: "{{pokemonNameWithAffix}} woke up!" + }, + freeze: { + name: "Freeze", + description: "freezing", + obtain: "{{pokemonNameWithAffix}}\nwas frozen solid!", + obtainSource: "{{pokemonNameWithAffix}}\nwas frozen solid by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is\nfrozen solid!", + overlap: "{{pokemonNameWithAffix}} is\nalready frozen!", + heal: "{{pokemonNameWithAffix}} was\ndefrosted!" + }, + burn: { + name: "Burn", + description: "burn", + obtain: "{{pokemonNameWithAffix}}\nwas burned!", + obtainSource: "{{pokemonNameWithAffix}}\nwas burned by {{sourceText}}!", + activation: "{{pokemonNameWithAffix}} is hurt\nby its burn!", + overlap: "{{pokemonNameWithAffix}} is\nalready burned!", + heal: "{{pokemonNameWithAffix}} was\nhealed of its burn!" + }, +} as const; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index b680cdd41c4..f7c23406179 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -9,7 +9,7 @@ import { addTextObject, TextStyle } from "../ui/text"; import { Type } from "../data/type"; import { EvolutionPhase } from "../evolution-phase"; import { FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions"; -import { getPokemonMessage } from "../messages"; +import {getPokemonMessage, getPokemonNameWithAffix} from "../messages"; import * as Utils from "../utils"; import { TempBattleStat } from "../data/temp-battle-stat"; import { getBerryEffectFunc, getBerryPredicate } from "../data/berry"; @@ -2469,7 +2469,7 @@ export class EnemyStatusEffectHealChanceModifier extends EnemyPersistentModifier apply(args: any[]): boolean { const target = (args[0] as Pokemon); if (target.status && Phaser.Math.RND.realInRange(0, 1) < (this.chance * this.getStackCount())) { - target.scene.queueMessage(getPokemonMessage(target, getStatusEffectHealText(target.status.effect))); + target.scene.queueMessage(getStatusEffectHealText(target.status.effect, getPokemonNameWithAffix(target))); target.resetStatus(); target.updateInfo(); return true; diff --git a/src/phases.ts b/src/phases.ts index b14a84526c7..9f069a60dc5 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2781,12 +2781,12 @@ export class MovePhase extends BattlePhase { } if (activated) { - this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectActivationText(this.pokemon.status.effect))); + this.scene.queueMessage(getStatusEffectActivationText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon))); this.scene.unshiftPhase(new CommonAnimPhase(this.scene, this.pokemon.getBattlerIndex(), undefined, CommonAnim.POISON + (this.pokemon.status.effect - 1))); doMove(); } else { if (healed) { - this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectHealText(this.pokemon.status.effect))); + this.scene.queueMessage(getStatusEffectHealText(this.pokemon.status.effect, getPokemonNameWithAffix(this.pokemon))); this.pokemon.resetStatus(); this.pokemon.updateInfo(); } @@ -3506,7 +3506,7 @@ export class ObtainStatusEffectPhase extends PokemonPhase { } pokemon.updateInfo(true); new CommonBattleAnim(CommonAnim.POISON + (this.statusEffect - 1), pokemon).play(this.scene, () => { - this.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectObtainText(this.statusEffect, this.sourceText))); + this.scene.queueMessage(getStatusEffectObtainText(this.statusEffect, getPokemonNameWithAffix(pokemon), this.sourceText)); if (pokemon.status.isPostTurn()) { this.scene.pushPhase(new PostTurnStatusEffectPhase(this.scene, this.battlerIndex)); } @@ -3515,7 +3515,7 @@ export class ObtainStatusEffectPhase extends PokemonPhase { return; } } else if (pokemon.status.effect === this.statusEffect) { - this.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectOverlapText(this.statusEffect))); + this.scene.queueMessage(getStatusEffectOverlapText(this.statusEffect, getPokemonNameWithAffix(pokemon))); } this.end(); } @@ -3535,7 +3535,7 @@ export class PostTurnStatusEffectPhase extends PokemonPhase { applyAbAttrs(BlockStatusDamageAbAttr, pokemon, cancelled); if (!cancelled.value) { - this.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectActivationText(pokemon.status.effect))); + this.scene.queueMessage(getStatusEffectActivationText(pokemon.status.effect, getPokemonNameWithAffix(pokemon))); let damage: integer = 0; switch (pokemon.status.effect) { case StatusEffect.POISON: @@ -4757,7 +4757,7 @@ export class PokemonHealPhase extends CommonAnimPhase { } if (this.healStatus && lastStatusEffect && !hasMessage) { - this.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(lastStatusEffect))); + this.scene.queueMessage(getStatusEffectHealText(lastStatusEffect, getPokemonNameWithAffix(pokemon))); } if (!healOrDamage && !lastStatusEffect) { diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index 6aacfd0e5e7..64dc3191d88 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -15,6 +15,7 @@ import {StatusEffect} from "#app/data/status-effect"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import i18next, { initI18n } from "#app/plugins/i18n"; describe("Items - Toxic orb", () => { @@ -48,6 +49,8 @@ describe("Items - Toxic orb", () => { }); it("TOXIC ORB", async() => { + initI18n(); + i18next.changeLanguage("en"); const moveToUse = Moves.GROWTH; await game.startBattle([ Species.MIGHTYENA, diff --git a/src/test/lokalisation/status-effect.test.ts b/src/test/lokalisation/status-effect.test.ts new file mode 100644 index 00000000000..4c79dacbff7 --- /dev/null +++ b/src/test/lokalisation/status-effect.test.ts @@ -0,0 +1,301 @@ +import { beforeAll, describe, expect, it, vi } from "vitest"; +import { + StatusEffect, + getStatusEffectActivationText, + getStatusEffectDescriptor, + getStatusEffectHealText, + getStatusEffectObtainText, + getStatusEffectOverlapText, +} from "#app/data/status-effect"; +import i18next, { ParseKeys } from "i18next"; +import { afterEach } from "node:test"; + +const tMock = (key: ParseKeys) => key; +const pokemonName = "PKM"; +const sourceText = "SOURCE"; + +describe("status-effect", () => { + beforeAll(() => { + i18next.init(); + }); + + describe("NONE", () => { + const statusEffect = StatusEffect.NONE; + + it("should return the obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:none.obtain"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).toBe("statusEffect:none.obtain"); + }); + + it("should return the source-obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName, sourceText); + expect(text).toBe("statusEffect:none.obtainSource"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).not.toBe("statusEffect:none.obtainSource"); + }); + + it("should return the activation text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectActivationText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:none.activation"); + }); + + it("should return the overlap text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectOverlapText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:none.overlap"); + }); + + it("should return the heal text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectHealText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:none.heal"); + }); + + it("should return the descriptor", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectDescriptor(statusEffect); + expect(text).toBe("statusEffect:none.description"); + }); + }); + + describe("POISON", () => { + const statusEffect = StatusEffect.POISON; + + it("should return the obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:poison.obtain"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).toBe("statusEffect:poison.obtain"); + }); + + it("should return the activation text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectActivationText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:poison.activation"); + }); + + it("should return the descriptor", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectDescriptor(statusEffect); + expect(text).toBe("statusEffect:poison.description"); + }); + + it("should return the heal text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectHealText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:poison.heal"); + }); + + it("should return the overlap text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectOverlapText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:poison.overlap"); + }); + }); + + describe("TOXIC", () => { + const statusEffect = StatusEffect.TOXIC; + + it("should return the obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:toxic.obtain"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).toBe("statusEffect:toxic.obtain"); + }); + + it("should return the activation text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectActivationText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:toxic.activation"); + }); + + it("should return the descriptor", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectDescriptor(statusEffect); + expect(text).toBe("statusEffect:toxic.description"); + }); + + it("should return the heal text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectHealText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:toxic.heal"); + }); + + it("should return the overlap text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectOverlapText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:toxic.overlap"); + }); + }); + + describe("PARALYSIS", () => { + const statusEffect = StatusEffect.PARALYSIS; + + it("should return the obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:paralysis.obtain"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).toBe("statusEffect:paralysis.obtain"); + }); + + it("should return the activation text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectActivationText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:paralysis.activation"); + }); + + it("should return the descriptor", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectDescriptor(statusEffect); + expect(text).toBe("statusEffect:paralysis.description"); + }); + + it("should return the heal text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectHealText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:paralysis.heal"); + }); + + it("should return the overlap text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectOverlapText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:paralysis.overlap"); + }); + }); + + describe("SLEEP", () => { + const statusEffect = StatusEffect.SLEEP; + + it("should return the obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:sleep.obtain"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).toBe("statusEffect:sleep.obtain"); + }); + + it("should return the activation text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectActivationText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:sleep.activation"); + }); + + it("should return the descriptor", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectDescriptor(statusEffect); + expect(text).toBe("statusEffect:sleep.description"); + }); + + it("should return the heal text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectHealText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:sleep.heal"); + }); + + it("should return the overlap text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectOverlapText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:sleep.overlap"); + }); + }); + + describe("FREEZE", () => { + const statusEffect = StatusEffect.FREEZE; + + it("should return the obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:freeze.obtain"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).toBe("statusEffect:freeze.obtain"); + }); + + it("should return the activation text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectActivationText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:freeze.activation"); + }); + + it("should return the descriptor", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectDescriptor(statusEffect); + expect(text).toBe("statusEffect:freeze.description"); + }); + + it("should return the heal text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectHealText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:freeze.heal"); + }); + + it("should return the overlap text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectOverlapText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:freeze.overlap"); + }); + }); + + describe("BURN", () => { + const statusEffect = StatusEffect.BURN; + + it("should return the obtain text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + + const text = getStatusEffectObtainText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:burn.obtain"); + + const emptySourceText = getStatusEffectObtainText(statusEffect, pokemonName, ""); + expect(emptySourceText).toBe("statusEffect:burn.obtain"); + }); + + it("should return the activation text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectActivationText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:burn.activation"); + }); + + it("should return the descriptor", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectDescriptor(statusEffect); + expect(text).toBe("statusEffect:burn.description"); + }); + + it("should return the heal text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectHealText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:burn.heal"); + }); + + it("should return the overlap text", () => { + vi.spyOn(i18next, "t").mockImplementation(tMock); + const text = getStatusEffectOverlapText(statusEffect, pokemonName); + expect(text).toBe("statusEffect:burn.overlap"); + }); + }); + + afterEach(() => { + vi.resetAllMocks(); + }); +});