Added locales for force switch moves

This commit is contained in:
Bertie690 2025-06-03 21:20:42 -04:00
parent dd2f475ded
commit 48a53048eb

View File

@ -138,7 +138,6 @@ export class SwitchSummonPhase extends SummonPhase {
return; return;
} }
if (this.switchType === SwitchType.BATON_PASS) { if (this.switchType === SwitchType.BATON_PASS) {
// If switching via baton pass, update opposing tags coming from the prior pokemon // If switching via baton pass, update opposing tags coming from the prior pokemon
(this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) => (this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) =>
@ -176,19 +175,7 @@ export class SwitchSummonPhase extends SummonPhase {
party[this.slotIndex] = this.lastPokemon; party[this.slotIndex] = this.lastPokemon;
party[this.fieldIndex] = switchedInPokemon; party[this.fieldIndex] = switchedInPokemon;
const showTextAndSummon = () => { const showTextAndSummon = () => {
globalScene.ui.showText( globalScene.ui.showText(this.getSendOutText(switchedInPokemon));
this.player
? i18next.t("battle:playerGo", {
pokemonName: getPokemonNameWithAffix(switchedInPokemon),
})
: i18next.t("battle:trainerGo", {
trainerName: globalScene.currentBattle.trainer?.getName(
!(this.fieldIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER,
),
pokemonName: this.getPokemon().getNameToRender(),
}),
);
/** /**
* If this switch is passing a Substitute, make the switched Pokemon matches the returned Pokemon's state as it left. * If this switch is passing a Substitute, make the switched Pokemon matches the returned Pokemon's state as it left.
* Otherwise, clear any persisting tags on the returned Pokemon. * Otherwise, clear any persisting tags on the returned Pokemon.
@ -267,4 +254,29 @@ export class SwitchSummonPhase extends SummonPhase {
queuePostSummon(): void { queuePostSummon(): void {
globalScene.unshiftPhase(new PostSummonPhase(this.getPokemon().getBattlerIndex())); globalScene.unshiftPhase(new PostSummonPhase(this.getPokemon().getBattlerIndex()));
} }
/**
* Get the text to be displayed when a pokemon is forced to switch and leave the field.
* @param switchedInPokemon - The Pokemon having newly been sent in.
* @returns The text to display.
*/
private getSendOutText(switchedInPokemon: Pokemon): string {
return this.switchType === SwitchType.FORCE_SWITCH
? // "XYZ was forced out!"
i18next.t("battle:pokemonDraggedOut", {
pokemonName: getPokemonNameWithAffix(switchedInPokemon),
})
: // "Go! XYZ!"
this.player
? i18next.t("battle:playerGo", {
pokemonName: getPokemonNameWithAffix(switchedInPokemon),
})
: // "Trainer sent out XYZ!"
i18next.t("battle:trainerGo", {
trainerName: globalScene.currentBattle.trainer?.getName(
!(this.fieldIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER,
),
pokemonName: this.getPokemon().getNameToRender(),
});
}
} }