Skip to content

Commit

Permalink
Dynamic Ivy Cudgel is summary screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Galaxeeh committed Aug 3, 2024
1 parent 8e965cd commit eb20244
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/config/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define P_ONLY_OBTAINABLE_SHINIES FALSE // If TRUE, Pokémon encountered in the Battle Pyramid won't be shiny.
#define P_NO_SHINIES_WITHOUT_POKEBALLS FALSE // If TRUE, Pokémon encountered when the player is out of Poké Balls won't be shiny
#define P_DYNAMIC_HIDDEN_POWER_TYPES FALSE // If TRUE, Pokémon will display their Hidden Power type in summary screens and in battle.
#define P_DYNAMIC_IVY_CUDGEL FALSE // If TRUE, Ivy Cudgel type will display in summary screens according to Ogerpon's held mask.

// Learnset helper toggles
#define P_LEARNSET_HELPER_TEACHABLE TRUE // If TRUE, teachable_learnsets.h will be populated by tools/learnset_helpers/teachable.py using the included JSON files based on available TMs and tutors.
Expand Down
25 changes: 23 additions & 2 deletions src/pokemon_summary_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3964,8 +3964,16 @@ static void SetMoveTypeIcons(void)
{
if (summary->moves[i] != MOVE_NONE)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES);

if (P_DYNAMIC_IVY_CUDGEL && summary->moves[i] == MOVE_IVY_CUDGEL && (species == SPECIES_OGERPON_WELLSPRING_MASK || species == SPECIES_OGERPON_WELLSPRING_MASK_TERA
|| species == SPECIES_OGERPON_HEARTHFLAME_MASK || species == SPECIES_OGERPON_HEARTHFLAME_MASK_TERA
|| species == SPECIES_OGERPON_CORNERSTONE_MASK || species == SPECIES_OGERPON_CORNERSTONE_MASK_TERA))
{
SetTypeSpritePosAndPal(gSpeciesInfo[summary->species].types[1], 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE);
}

if (P_DYNAMIC_HIDDEN_POWER_TYPES && summary->moves[i] == MOVE_HIDDEN_POWER)
else if (P_DYNAMIC_HIDDEN_POWER_TYPES && summary->moves[i] == MOVE_HIDDEN_POWER)
{
u8 typeBits = ((GetMonData(mon, MON_DATA_HP_IV) & 1) << 0)
| ((GetMonData(mon, MON_DATA_ATK_IV) & 1) << 1)
Expand Down Expand Up @@ -4008,6 +4016,7 @@ static void SetContestMoveTypeIcons(void)
static void SetNewMoveTypeIcon(void)
{
struct Pokemon *mon = &sMonSummaryScreen->currentMon;
struct PokeSummary *summary = &sMonSummaryScreen->summary;

if (sMonSummaryScreen->newMove == MOVE_NONE)
{
Expand All @@ -4016,7 +4025,17 @@ static void SetNewMoveTypeIcon(void)
else
{
if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES)
if (P_DYNAMIC_HIDDEN_POWER_TYPES && sMonSummaryScreen->newMove == MOVE_HIDDEN_POWER)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES);

if (P_DYNAMIC_IVY_CUDGEL && sMonSummaryScreen->newMove == MOVE_IVY_CUDGEL && (species == SPECIES_OGERPON_WELLSPRING_MASK || species == SPECIES_OGERPON_WELLSPRING_MASK_TERA
|| species == SPECIES_OGERPON_HEARTHFLAME_MASK || species == SPECIES_OGERPON_HEARTHFLAME_MASK_TERA
|| species == SPECIES_OGERPON_CORNERSTONE_MASK || species == SPECIES_OGERPON_CORNERSTONE_MASK_TERA))
{
SetTypeSpritePosAndPal(gSpeciesInfo[summary->species].types[1], 85, 96, SPRITE_ARR_ID_TYPE + 4);
}

else if (P_DYNAMIC_HIDDEN_POWER_TYPES && sMonSummaryScreen->newMove == MOVE_HIDDEN_POWER)
{
u8 typeBits = ((GetMonData(mon, MON_DATA_HP_IV) & 1) << 0)
| ((GetMonData(mon, MON_DATA_ATK_IV) & 1) << 1)
Expand All @@ -4035,6 +4054,8 @@ static void SetNewMoveTypeIcon(void)
{
SetTypeSpritePosAndPal(gMovesInfo[sMonSummaryScreen->newMove].type, 85, 96, SPRITE_ARR_ID_TYPE + 4);
}
}

else
SetTypeSpritePosAndPal(NUMBER_OF_MON_TYPES + gMovesInfo[sMonSummaryScreen->newMove].contestCategory, 85, 96, SPRITE_ARR_ID_TYPE + 4);
}
Expand Down

0 comments on commit eb20244

Please sign in to comment.