ItemTMHMOrEvolutionStone enum (#2192)

This commit is contained in:
Bassoonian 2026-01-02 21:59:12 +01:00 committed by GitHub
parent b11741855d
commit a5ee0f2727
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 5 deletions

View File

@ -33,4 +33,11 @@ void Task_UseDigEscapeRopeOnField(u8 taskId);
bool8 CanUseDigOrEscapeRopeOnCurMap(void); bool8 CanUseDigOrEscapeRopeOnCurMap(void);
u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId); u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId);
enum ItemTMHMOrEvolutionStone
{
ITEM_IS_OTHER,
ITEM_IS_TM_HM,
ITEM_IS_EVOLUTION_STONE,
};
#endif // GUARD_ITEM_USE_H #endif // GUARD_ITEM_USE_H

View File

@ -176,11 +176,11 @@ static void Task_CloseCantUseKeyItemMessage(u8 taskId)
u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId) u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId)
{ {
if (GetItemFieldFunc(itemId) == ItemUseOutOfBattle_TMHM) if (GetItemFieldFunc(itemId) == ItemUseOutOfBattle_TMHM)
return 1; return ITEM_IS_TM_HM;
else if (GetItemFieldFunc(itemId) == ItemUseOutOfBattle_EvolutionStone) else if (GetItemFieldFunc(itemId) == ItemUseOutOfBattle_EvolutionStone)
return 2; return ITEM_IS_EVOLUTION_STONE;
else else
return 0; return ITEM_IS_OTHER;
} }
// Mail in the bag menu can't have a message but it can be checked (view the mail background, no message) // Mail in the bag menu can't have a message but it can be checked (view the mail background, no message)

View File

@ -987,10 +987,10 @@ static bool8 DisplayPartyPokemonDataForMoveTutorOrEvolutionItem(u8 slot)
{ {
default: default:
return FALSE; return FALSE;
case 1: // TM/HM case ITEM_IS_TM_HM:
DisplayPartyPokemonDataToTeachMove(slot, item, 0); DisplayPartyPokemonDataToTeachMove(slot, item, 0);
break; break;
case 2: // Evolution stone case ITEM_IS_EVOLUTION_STONE:
if (!GetMonData(currentPokemon, MON_DATA_IS_EGG) && GetEvolutionTargetSpecies(currentPokemon, EVO_MODE_ITEM_CHECK, item) != SPECIES_NONE) if (!GetMonData(currentPokemon, MON_DATA_IS_EGG) && GetEvolutionTargetSpecies(currentPokemon, EVO_MODE_ITEM_CHECK, item) != SPECIES_NONE)
return FALSE; return FALSE;
DisplayPartyPokemonDescriptionData(slot, PARTYBOX_DESC_NO_USE); DisplayPartyPokemonDescriptionData(slot, PARTYBOX_DESC_NO_USE);