[UI] Tera type on summary screen (#5419)

This commit is contained in:
Xavion3 2025-02-27 04:03:22 +11:00 committed by GitHub
parent 883bf45bc0
commit 71f644c453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,6 +28,7 @@ import { modifierSortFunc } from "#app/modifier/modifier";
import { PlayerGender } from "#enums/player-gender";
import { Stat, PERMANENT_STATS, getStatKey } from "#enums/stat";
import { Nature } from "#enums/nature";
import { achvs } from "#app/system/achv";
enum Page {
PROFILE,
@ -783,9 +784,6 @@ export default class SummaryUiHandler extends UiHandler {
if (types.length > 1) {
profileContainer.add(getTypeIcon(1, types[1]));
}
if (this.pokemon?.isTerastallized) {
profileContainer.add(getTypeIcon(types.length, this.pokemon.getTeraType(), true));
}
if (this.pokemon?.getLuck()) {
const luckLabelText = addTextObject(141, 28, i18next.t("common:luckIndicator"), TextStyle.SUMMARY_ALT);
@ -798,6 +796,13 @@ export default class SummaryUiHandler extends UiHandler {
profileContainer.add(luckText);
}
if (globalScene.gameData.achvUnlocks.hasOwnProperty(achvs.TERASTALLIZE.id) && !Utils.isNullOrUndefined(this.pokemon)) {
const teraIcon = globalScene.add.sprite(123, 26, "button_tera");
teraIcon.setName("terrastallize-icon");
teraIcon.setFrame(Type[this.pokemon.getTeraType()].toLowerCase());
profileContainer.add(teraIcon);
}
this.abilityContainer = {
labelImage: globalScene.add.image(0, 0, "summary_profile_ability"),
ability: this.pokemon?.getAbility(true)!, // TODO: is this bang correct?