fix: hypertraining a stat now optionally reflects in the summary screen (#8035)

This commit is contained in:
khbsd 2025-10-25 21:15:03 -05:00 committed by GitHub
parent 9fa6cd6a4c
commit 7b3a2f3aaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View File

@ -8,6 +8,7 @@
#define P_SUMMARY_SCREEN_RENAME TRUE // If TRUE, an option to change Pokémon nicknames replaces the cancel prompt on the summary screen info page.
#define P_SUMMARY_SCREEN_IV_EV_INFO FALSE // If TRUE, will allow player to cycle through the Stats, IVs, and EVs in the summary screen skills page.
#define P_SUMMARY_SCREEN_IV_EV_BOX_ONLY FALSE // If TRUE, will allow player to cycle through the Stats, IVs, and EVs in the summary screen skills page, but only in the PC storage box.
#define P_SUMMARY_SCREEN_IV_HYPERTRAIN TRUE // If TRUE, stats that have been hyper trained will show as 31/S when viewing them in the summary screen
#define P_SUMMARY_SCREEN_IV_EV_TILESET FALSE // If TRUE, loads an alternate tileset to allow changing the "STATS" label in the summary screen skills page. Note: if it's still loading the alternate tileset after changing this and recompiling, you may need a `make clean` before compilation.
#define P_SUMMARY_SCREEN_IV_EV_VALUES FALSE // If TRUE, will show the actual IV value instead of the letter grade.
/*

View File

@ -334,6 +334,7 @@ static const u8 *GetLetterGrade(u32 stat);
static u8 AddWindowFromTemplateList(const struct WindowTemplate *template, u8 templateId);
static u8 IncrementSkillsStatsMode(u8 mode);
static void ClearStatLabel(u32 length, u32 statsCoordX, u32 statsCoordY);
u32 GetAdjustedIvData(struct Pokemon *mon, u32 stat);
static const struct BgTemplate sBgTemplates[] =
{
@ -1173,6 +1174,13 @@ static void DestroyCategoryIcon(void)
sMonSummaryScreen->categoryIconSpriteId = 0xFF;
}
u32 GetAdjustedIvData(struct Pokemon *mon, u32 stat)
{
if (P_SUMMARY_SCREEN_IV_HYPERTRAIN && GetMonData(mon, MON_DATA_HYPER_TRAINED_HP + stat))
return MAX_PER_STAT_IVS;
return GetMonData(mon, MON_DATA_HP_IV + stat);
}
void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void))
{
sMonSummaryScreen = AllocZeroed(sizeof(*sMonSummaryScreen));
@ -1864,12 +1872,12 @@ void ExtractMonSkillStatsData(struct Pokemon *mon, struct PokeSummary *sum)
void ExtractMonSkillIvData(struct Pokemon *mon, struct PokeSummary *sum)
{
sum->currentHP = GetMonData(mon, MON_DATA_HP_IV);
sum->atk = GetMonData(mon, MON_DATA_ATK_IV);
sum->def = GetMonData(mon, MON_DATA_DEF_IV);
sum->spatk = GetMonData(mon, MON_DATA_SPATK_IV);
sum->spdef = GetMonData(mon, MON_DATA_SPDEF_IV);
sum->speed = GetMonData(mon, MON_DATA_SPEED_IV);
sum->currentHP = GetAdjustedIvData(mon, STAT_HP);
sum->atk = GetAdjustedIvData(mon, STAT_ATK);
sum->def = GetAdjustedIvData(mon, STAT_DEF);
sum->spatk = GetAdjustedIvData(mon, STAT_SPATK);
sum->spdef = GetAdjustedIvData(mon, STAT_SPDEF);
sum->speed = GetAdjustedIvData(mon, STAT_SPEED);
}
void ExtractMonSkillEvData(struct Pokemon *mon, struct PokeSummary *sum)