mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 14:55:22 +01:00
* chnage nature locales use * chnage party ui locales use * change pokemon category locales use * chnage pokemon evos locales uses * change pokemon form battle use * change pokemon form uses * Change pokemon info uses * fix `stat.ts` workflow fail * Change pokemon summary * Change pokemon localize * Temporarily revert changes to `achv.ts` * Re-add changes to `achv.ts` * Update locales submodule
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import { getPokemonNameWithAffix } from "#app/messages";
|
|
import { CommonBattleAnim } from "#data/battle-anims";
|
|
import { SpeciesFormChangeTeraTrigger } from "#data/form-change-triggers";
|
|
import { CommonAnim } from "#enums/move-anims-common";
|
|
import { PokemonType } from "#enums/pokemon-type";
|
|
import type { Pokemon } from "#field/pokemon";
|
|
import { BattlePhase } from "#phases/battle-phase";
|
|
import { achvs } from "#system/achv";
|
|
import { toCamelCase } from "#utils/strings";
|
|
import i18next from "i18next";
|
|
|
|
export class TeraPhase extends BattlePhase {
|
|
public readonly phaseName = "TeraPhase";
|
|
public pokemon: Pokemon;
|
|
|
|
constructor(pokemon: Pokemon) {
|
|
super();
|
|
|
|
this.pokemon = pokemon;
|
|
}
|
|
|
|
start() {
|
|
super.start();
|
|
|
|
globalScene.phaseManager.queueMessage(
|
|
i18next.t("battle:pokemonTerastallized", {
|
|
pokemonNameWithAffix: getPokemonNameWithAffix(this.pokemon),
|
|
type: i18next.t(`pokemonInfo:type.${toCamelCase(PokemonType[this.pokemon.getTeraType()])}`),
|
|
}),
|
|
);
|
|
new CommonBattleAnim(CommonAnim.TERASTALLIZE, this.pokemon).play(false, () => {
|
|
this.end();
|
|
});
|
|
}
|
|
|
|
end() {
|
|
this.pokemon.isTerastallized = true;
|
|
this.pokemon.updateSpritePipelineData();
|
|
|
|
if (this.pokemon.isPlayer()) {
|
|
globalScene.arena.playerTerasUsed += 1;
|
|
}
|
|
|
|
globalScene.triggerPokemonFormChange(this.pokemon, SpeciesFormChangeTeraTrigger);
|
|
|
|
if (this.pokemon.isPlayer()) {
|
|
globalScene.validateAchv(achvs.TERASTALLIZE);
|
|
if (this.pokemon.getTeraType() === PokemonType.STELLAR) {
|
|
globalScene.validateAchv(achvs.STELLAR_TERASTALLIZE);
|
|
}
|
|
}
|
|
|
|
super.end();
|
|
}
|
|
}
|