Merge branch 'beta' into tsconfig
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 5.5 KiB |
@ -174,19 +174,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.
|
||||||
@ -265,4 +253,32 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
queuePostSummon(): void {
|
queuePostSummon(): void {
|
||||||
globalScene.phaseManager.unshiftNew("PostSummonPhase", this.getPokemon().getBattlerIndex());
|
globalScene.phaseManager.unshiftNew("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 {
|
||||||
|
if (this.switchType === SwitchType.FORCE_SWITCH) {
|
||||||
|
// "XYZ was dragged out!"
|
||||||
|
return i18next.t("battle:pokemonDraggedOut", {
|
||||||
|
pokemonName: getPokemonNameWithAffix(switchedInPokemon),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (this.player) {
|
||||||
|
// "Go! XYZ!"
|
||||||
|
return i18next.t("battle:playerGo", {
|
||||||
|
pokemonName: getPokemonNameWithAffix(switchedInPokemon),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// "Trainer sent out XYZ!"
|
||||||
|
return i18next.t("battle:trainerGo", {
|
||||||
|
trainerName: globalScene.currentBattle.trainer?.getName(
|
||||||
|
!(this.fieldIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER,
|
||||||
|
),
|
||||||
|
pokemonName: this.getPokemon().getNameToRender(),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|