Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Localization] add missed move trigger and remove getPokemonMessage #3281

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/data/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./
import { BattleEndPhase, MoveEndPhase, MovePhase, NewBattlePhase, PartyStatusCurePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases";
import { BattleStat, getBattleStatName } from "./battle-stat";
import { EncoreTag, HelpingHandTag, SemiInvulnerableTag, StockpilingTag, TypeBoostTag } from "./battler-tags";
import { getPokemonMessage, getPokemonNameWithAffix } from "../messages";
import { getPokemonNameWithAffix } from "../messages";
import Pokemon, { AttackMoveResult, EnemyPokemon, HitResult, MoveResult, PlayerPokemon, PokemonMove, TurnMove } from "../field/pokemon";
import { StatusEffect, getStatusEffectHealText, isNonVolatileStatusEffect, getNonVolatileStatusEffects} from "./status-effect";
import { getTypeResistances, Type } from "./type";
Expand Down Expand Up @@ -1388,7 +1388,7 @@ export class HealAttr extends MoveEffectAttr {
*/
addHealPhase(target: Pokemon, healRatio: number) {
target.scene.unshiftPhase(new PokemonHealPhase(target.scene, target.getBattlerIndex(),
Math.max(Math.floor(target.getMaxHp() * healRatio), 1), getPokemonMessage(target, " \nhad its HP restored."), true, !this.showAnim));
Math.max(Math.floor(target.getMaxHp() * healRatio), 1), i18next.t("moveTriggers:healHp", {pokemonName: getPokemonNameWithAffix(target)}), true, !this.showAnim));
}

getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
Expand Down Expand Up @@ -1482,7 +1482,7 @@ export class SacrificialFullRestoreAttr extends SacrificialAttr {
const maxPartyMemberHp = user.scene.getParty().map(p => p.getMaxHp()).reduce((maxHp: integer, hp: integer) => Math.max(hp, maxHp), 0);

user.scene.pushPhase(new PokemonHealPhase(user.scene, user.getBattlerIndex(),
maxPartyMemberHp, getPokemonMessage(user, "'s Healing Wish\nwas granted!"), true, false, false, true), true);
maxPartyMemberHp, i18next.t("moveTriggers:sacrificialFullRestore", {pokemonName: getPokemonNameWithAffix(user)}), true, false, false, true), true);
EnochG1 marked this conversation as resolved.
Show resolved Hide resolved

return true;
}
Expand Down Expand Up @@ -2712,7 +2712,7 @@ export class InvertStatsAttr extends MoveEffectAttr {
target.updateInfo();
user.updateInfo();

target.scene.queueMessage(getPokemonMessage(target, "'s stat changes\nwere all reversed!"));
target.scene.queueMessage(i18next.t("moveTriggers:invertStats", {pokemonName: getPokemonNameWithAffix(target)}));

return true;
}
Expand All @@ -2730,7 +2730,7 @@ export class ResetStatsAttr extends MoveEffectAttr {
target.updateInfo();
user.updateInfo();

target.scene.queueMessage(getPokemonMessage(target, "'s stat changes\nwere eliminated!"));
target.scene.queueMessage(i18next.t("moveTriggers:resetStats", {pokemonName: getPokemonNameWithAffix(target)}));

return true;
}
Expand Down Expand Up @@ -4138,7 +4138,7 @@ export class DisableMoveAttr extends MoveEffectAttr {
target.summonData.disabledMove = disabledMove.moveId;
target.summonData.disabledTurns = 4;

user.scene.queueMessage(getPokemonMessage(target, `'s ${disabledMove.getName()}\nwas disabled!`));
user.scene.queueMessage(i18next.t("abilityTriggers:postDefendMoveDisable", { pokemonNameWithAffix: getPokemonNameWithAffix(target), moveName: disabledMove.getName()}));

return true;
}
Expand Down Expand Up @@ -4445,7 +4445,7 @@ export class FaintCountdownAttr extends AddBattlerTagAttr {
return false;
}

user.scene.queueMessage(getPokemonMessage(target, `\nwill faint in ${this.turnCountMin - 1} turns.`));
user.scene.queueMessage(i18next.t("moveTriggers:faintCountdown", {pokemonName: getPokemonNameWithAffix(target), turnCount: this.turnCountMin - 1}));

return true;
}
Expand Down Expand Up @@ -4685,7 +4685,7 @@ export class SwapArenaTagsAttr extends MoveEffectAttr {
}


user.scene.queueMessage( `${getPokemonNameWithAffix(user)} swapped the battle effects affecting each side of the field!`);
user.scene.queueMessage( i18next.t("moveTriggers:swapArenaTags", {pokemonName: getPokemonNameWithAffix(user)}));
return true;
}
}
Expand Down Expand Up @@ -4917,7 +4917,7 @@ export class CopyTypeAttr extends MoveEffectAttr {
user.summonData.types = target.getTypes(true);
user.updateInfo();

user.scene.queueMessage(getPokemonMessage(user, `'s type\nchanged to match ${getPokemonNameWithAffix(target)}'s!`));
user.scene.queueMessage(i18next.t("moveTriggers:copyType", {pokemonName: getPokemonNameWithAffix(user), targetPokemonName: getPokemonNameWithAffix(target)}));

return true;
}
Expand Down Expand Up @@ -5598,7 +5598,7 @@ export class SuppressAbilitiesAttr extends MoveEffectAttr {

target.summonData.abilitySuppressed = true;

target.scene.queueMessage(getPokemonMessage(target, "'s ability\nwas suppressed!"));
target.scene.queueMessage(i18next.t("moveTriggers:suppressAbilities", {pokemonName: getPokemonNameWithAffix(target)}));

return true;
}
Expand Down
10 changes: 9 additions & 1 deletion src/locales/de/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}} verwandelt sich in {{targetName}}!",
"tryingToTakeFoeDown": "{{pokemonName}} versucht, den Angreifer mit sich zu nehmen!",
"addType": "{{pokemonName}} nimmt zusätzlich den Typ {{typeName}} an!",
"cannotUseMove": "{{pokemonName}} kann {{moveName}} nicht einsetzen!"
"cannotUseMove": "{{pokemonName}} kann {{moveName}} nicht einsetzen!",
"healHp": "KP von {{pokemonName}} wurden aufgefrischt!",
"sacrificialFullRestore": "Das Heilopfer von {{pokemonName}} erreicht sein Ziel!",
"invertStats": "Alle Statusveränderungen von {{pokemonName}} wurden invertiert!",
"resetStats": "Die Statusveränderungen von {{pokemonName}} wurden aufgehoben!",
"faintCountdown": "{{pokemonName}} geht nach {{turnCount}} Runden K.O.!",
"copyType": "{{pokemonName}} hat den Typ von {{targetPokemonName}} angenommen!",
"suppressAbilities": "Die Fähigkeit von {{pokemonName}} wirkt nicht mehr!",
"swapArenaTags": "{{pokemonName}} hat die Effekte, die auf den beiden Seiten des Kampffeldes wirken, miteinander getauscht!",
} as const;
10 changes: 9 additions & 1 deletion src/locales/en/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}} transformed\ninto {{targetName}}!",
"tryingToTakeFoeDown": "{{pokemonName}} is hoping to take its attacker down with it!",
"addType": "{{typeName}} was added to\n{{pokemonName}}!",
"cannotUseMove": "{{pokemonName}} cannot use {{moveName}}!"
"cannotUseMove": "{{pokemonName}} cannot use {{moveName}}!",
"healHp": "{{pokemonName}} had its HP restored.",
"sacrificialFullRestore": "{{pokemonName}}'s Healing Wish\nwas granted!",
"invertStats": "{{pokemonName}}'s stat changes\nwere all reversed!",
"resetStats": "{{pokemonName}}'s stat changes\nwere eliminated!",
"faintCountdown": "{{pokemonName}}\nwill faint in {{turnCount}} turns.",
"copyType": "{{pokemonName}}'s type became the same as\n{{targetPokemonName}}'s type!",
"suppressAbilities": "{{pokemonName}}'s ability\nwas suppressed!",
"swapArenaTags": "{{pokemonName}} swapped the battle effects affecting each side of the field!",
} as const;
10 changes: 9 additions & 1 deletion src/locales/es/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}} transformed\ninto {{targetName}}!",
"tryingToTakeFoeDown": "{{pokemonName}} is hoping to take its attacker down with it!",
"addType": "{{typeName}} was added to\n{{pokemonName}}!",
"cannotUseMove": "{{pokemonName}} cannot use {{moveName}}!"
"cannotUseMove": "{{pokemonName}} cannot use {{moveName}}!",
"healHp": "{{pokemonName}} had its HP restored.",
"sacrificialFullRestore": "{{pokemonName}}'s Healing Wish\nwas granted!",
"invertStats": "{{pokemonName}}'s stat changes\nwere all reversed!",
"resetStats": "{{pokemonName}}'s stat changes\nwere eliminated!",
"faintCountdown": "{{pokemonName}}\nwill faint in {{turnCount}} turns.",
"copyType": "{{pokemonName}}'s type\nchanged to match {{targetPokemonName}}'s!",
"suppressAbilities": "{{pokemonName}}'s ability\nwas suppressed!",
"swapArenaTags": "{{pokemonName}} swapped the battle effects affecting each side of the field!",
} as const;
10 changes: 9 additions & 1 deletion src/locales/fr/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}} prend\nl’apparence de {{targetName}} !",
"tryingToTakeFoeDown": "{{pokemonName}} veut entrainer\nson assaillant dans sa chute !",
"addType": "{{pokemonName}} gagne\nle type {{typeName}}.",
"cannotUseMove": "{{pokemonName}} ne peut pas\nutiliser la capacité {{moveName}} !"
"cannotUseMove": "{{pokemonName}} ne peut pas\nutiliser la capacité {{moveName}} !",
"healHp": "{{pokemonName}}\nrécupère des PV !",
"sacrificialFullRestore": "Le Vœu Soin est exaucé et profite\nà {{pokemonName}} !",
"invertStats": "Les changements de stats\nde {{pokemonName}} sont inversés !",
"resetStats": "Les changements de stats\nde {{pokemonName}} ont tous été annulés !",
"faintCountdown": "{{pokemonName}}\nsera K.O. dans {{turnCount}} tours !",
"copyType": "{{pokemonName}} prend le type\nde {{targetPokemonName}} !",
"suppressAbilities": "Le talent de {{pokemonName}}\na été rendu inactif !",
"swapArenaTags": "Les effets affectant chaque côté du terrain\nont été échangés par {{pokemonName}} !",
} as const;
10 changes: 9 additions & 1 deletion src/locales/it/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}} assume le sembianze\ndi {{targetName}}!",
"tryingToTakeFoeDown": "{{pokemonName}} tenta di far subire a chi lo manda KO la sua stessa sorte!",
"addType": "Adesso {{pokemonName}} è anche\ndi tipo {{typeName}}!",
"cannotUseMove": "{{pokemonName}} non può usare {{moveName}}!"
"cannotUseMove": "{{pokemonName}} non può usare {{moveName}}!",
"healHp": "{{pokemonName}} ha recuperato dei PS.",
"sacrificialFullRestore": "{{pokemonName}} riceve i benefici\neffetti di Curardore!",
"invertStats": "Le modifiche alle statistiche di {{pokemonName}}\nvengono invertite!",
"resetStats": "Tutte le modifiche alle statistiche sono state annullate!",
"faintCountdown": "{{pokemonName}}\nandrà KO dopo {{turnCount}} turni.",
"copyType": "{{pokemonName}} assume il tipo\ndi {{targetPokemonName}}!",
"suppressAbilities": "L’abilità di {{pokemonName}}\nperde ogni efficacia!",
"swapArenaTags": "{{pokemonName}} ha invertito gli effetti attivi\nnelle due metà del campo!",
} as const;
10 changes: 9 additions & 1 deletion src/locales/ko/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}}[[는]]\n{{targetName}}[[로]] 변신했다!",
"tryingToTakeFoeDown": "{{pokemonName}}[[는]] 상대를\n길동무로 삼으려 하고 있다!",
"addType": "{{pokemonName}}에게\n{{typeName}}타입이 추가되었다!",
"cannotUseMove": "{{pokemonName}}[[는]]\n{{moveName}}[[를]] 쓸 수 없다!"
"cannotUseMove": "{{pokemonName}}[[는]]\n{{moveName}}[[를]] 쓸 수 없다!",
"healHp": "{{pokemonName}}의\n체력이 회복되었다!",
"sacrificialFullRestore": "{{pokemonName}}의\n치유소원이 이루어졌다!",
"invertStats": "{{pokemonName}}[[는]]\n능력 변화가 뒤집혔다!",
"resetStats": "{{pokemonName}}의 모든 상태가\n원래대로 되돌아왔다!",
"faintCountdown": "{{pokemonName}}[[는]]\n{{turnCount}}턴 후에 쓰러져 버린다!",
"copyType": "{{pokemonName}}[[는]]\n{{targetPokemonName}}[[와]] 같은 타입이 되었다!",
"suppressAbilities": "{{pokemonName}}의\n특성이 효과를 발휘하지 못하게 되었다!",
"swapArenaTags": "{{pokemonName}}[[는]]\n서로의 필드 효과를 교체했다!",
} as const;
10 changes: 9 additions & 1 deletion src/locales/pt_BR/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}} se transformou\nem um(a) {{targetName}}!",
"tryingToTakeFoeDown": "{{pokemonName}} está tentando derrubar o atacante com ele!",
"addType": "{{pokemonName}} recebeu\no tipo {{typeName}}!",
"cannotUseMove": "{{pokemonName}} não pode usar {{moveName}}!"
"cannotUseMove": "{{pokemonName}} não pode usar {{moveName}}!",
"healHp": "{{pokemonName}} teve seus PS recuperados.",
"sacrificialFullRestore": "O Healing Wish de {{pokemonName}}\nfoi concedido!",
"invertStats": "As mudanças de atributo de {{pokemonName}}\nforam revertidas!",
"resetStats": "As mudanças de atributo de {{pokemonName}}\nforam eliminadas!",
"faintCountdown": "{{pokemonName}}\nirá desmaiar em {{turnCount}} turnos.",
"copyType": "O tipo de {{pokemonName}}\nmudou para combinar com {{targetPokemonName}}!",
"suppressAbilities": "A habilidade de {{pokemonName}}\nfoi suprimida!",
"swapArenaTags": "{{pokemonName}} trocou os efeitos de batalha que afetam cada lado do campo!",
} as const;
10 changes: 9 additions & 1 deletion src/locales/zh_CN/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}}\n变身成了{{targetName}}!",
"tryingToTakeFoeDown": "{{pokemonName}}\n想和对手同归于尽!",
"addType": "{{pokemonName}}\n增加了{{typeName}}属性!",
"cannotUseMove": "{{pokemonName}}\n无法使用{{moveName}}!"
"cannotUseMove": "{{pokemonName}}\n无法使用{{moveName}}!",
"healHp": "{{pokemonName}}的\n体力回复了!",
"sacrificialFullRestore": "{{pokemonName}}的\n治愈之愿实现了!",
EnochG1 marked this conversation as resolved.
Show resolved Hide resolved
"invertStats": "{{pokemonName}}的\n能力变化颠倒过来了!",
"resetStats": "{{pokemonName}}的\n能力变化复原了!",
"faintCountdown": "{{pokemonName}}\n将在{{turnCount}}回合后灭亡!",
"copyType": "{{pokemonName}}\n变成了{{targetPokemonName}}的属性!",
"suppressAbilities": "{{pokemonName}}的特性\n变得无效了!",
"swapArenaTags": "{{pokemonName}}\n交换了双方的场地效果!",
} as const;
10 changes: 9 additions & 1 deletion src/locales/zh_TW/move-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ export const moveTriggers: SimpleTranslationEntries = {
"transformedIntoTarget": "{{pokemonName}}\n變身成了{{targetName}}!",
"tryingToTakeFoeDown": "{{pokemonName}}\n想和對手同歸於盡!",
"addType": "{{pokemonName}}\n增加了{{typeName}}屬性!",
"cannotUseMove": "{{pokemonName}}\n無法使用{{moveName}}!"
"cannotUseMove": "{{pokemonName}}\n無法使用{{moveName}}!",
"healHp": "{{pokemonName}}的\n體力回復了!",
"sacrificialFullRestore": "{{pokemonName}}的\n治癒之願實現了!",
EnochG1 marked this conversation as resolved.
Show resolved Hide resolved
"invertStats": "{{pokemonName}}的\n能力變化顛倒過來了!",
"resetStats": "{{pokemonName}}的\n能力變化復原了!",
"faintCountdown": "{{pokemonName}}\n將在{{turnCount}}回合後滅亡!",
"copyType": "{{pokemonName}}變成了{{targetPokemonName}}的屬性!",
"suppressAbilities": "{{pokemonName}}的特性\n變得無效了!",
"swapArenaTags": "{{pokemonName}}\n交換了雙方的場地效果!",
} as const;
11 changes: 0 additions & 11 deletions src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ import { BattleSpec } from "#enums/battle-spec";
import Pokemon from "./field/pokemon";
import i18next from "i18next";

/**
* Builds a message by concatenating the Pokemon name with its potential affix and the given text
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance for {@linkcode getPokemonNameWithAffix}
* @param {string} content any text
* @returns {string} ex: "Wild Gengar fainted!", "Ectoplasma sauvage est K.O!"
* @see {@linkcode getPokemonNameWithAffix} for the Pokemon's name and potentiel affix
*/
export function getPokemonMessage(pokemon: Pokemon, content: string): string {
return `${getPokemonNameWithAffix(pokemon)}${content}`;
}

/**
* Retrieves the Pokemon's name, potentially with an affix indicating its role (wild or foe) in the current battle context, translated
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance
Expand Down
Loading