diff --git a/graphics/battle_environment/building/palette2.pal b/graphics/battle_environment/building/gym.pal similarity index 100% rename from graphics/battle_environment/building/palette2.pal rename to graphics/battle_environment/building/gym.pal diff --git a/graphics/battle_environment/building/palette3.pal b/graphics/battle_environment/building/leader.pal similarity index 100% rename from graphics/battle_environment/building/palette3.pal rename to graphics/battle_environment/building/leader.pal diff --git a/graphics/battle_environment/stadium/palette1.pal b/graphics/battle_environment/stadium/aqua.pal similarity index 100% rename from graphics/battle_environment/stadium/palette1.pal rename to graphics/battle_environment/stadium/aqua.pal diff --git a/graphics/battle_environment/stadium/palette6.pal b/graphics/battle_environment/stadium/drake.pal similarity index 100% rename from graphics/battle_environment/stadium/palette6.pal rename to graphics/battle_environment/stadium/drake.pal diff --git a/graphics/battle_environment/stadium/palette5.pal b/graphics/battle_environment/stadium/glacia.pal similarity index 100% rename from graphics/battle_environment/stadium/palette5.pal rename to graphics/battle_environment/stadium/glacia.pal diff --git a/graphics/battle_environment/stadium/palette2.pal b/graphics/battle_environment/stadium/magma.pal similarity index 100% rename from graphics/battle_environment/stadium/palette2.pal rename to graphics/battle_environment/stadium/magma.pal diff --git a/graphics/battle_environment/stadium/palette4.pal b/graphics/battle_environment/stadium/phoebe.pal similarity index 100% rename from graphics/battle_environment/stadium/palette4.pal rename to graphics/battle_environment/stadium/phoebe.pal diff --git a/graphics/battle_environment/stadium/palette3.pal b/graphics/battle_environment/stadium/sidney.pal similarity index 100% rename from graphics/battle_environment/stadium/palette3.pal rename to graphics/battle_environment/stadium/sidney.pal diff --git a/graphics/battle_environment/stadium/palette7.pal b/graphics/battle_environment/stadium/wallace.pal similarity index 100% rename from graphics/battle_environment/stadium/palette7.pal rename to graphics/battle_environment/stadium/wallace.pal diff --git a/include/item_use.h b/include/item_use.h index ccb0f4f3df..226f9d90d3 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -63,4 +63,11 @@ enum { bool32 CanThrowBall(void); bool32 CannotUseItemsInBattle(u16 itemId, struct Pokemon *mon); +enum ItemTMHMOrEvolutionStone +{ + ITEM_IS_OTHER, + ITEM_IS_TM_HM, + ITEM_IS_EVOLUTION_STONE, +}; + #endif // GUARD_ITEM_USE_H diff --git a/src/data/graphics/battle_environment.h b/src/data/graphics/battle_environment.h index 4d271ea82d..c1802892e3 100644 --- a/src/data/graphics/battle_environment.h +++ b/src/data/graphics/battle_environment.h @@ -8,15 +8,15 @@ const u16 gBattleEnvironmentPalette_Building[] = INCBIN_U16("graphics/battle_env const u16 gBattleEnvironmentPalette_Kyogre[] = INCBIN_U16("graphics/battle_environment/water/kyogre.gbapal"); const u16 gBattleEnvironmentPalette_Groudon[] = INCBIN_U16("graphics/battle_environment/cave/groudon.gbapal"); -const u16 gBattleEnvironmentPalette_BuildingGym[] = INCBIN_U16("graphics/battle_environment/building/palette2.gbapal"); -const u16 gBattleEnvironmentPalette_BuildingLeader[] = INCBIN_U16("graphics/battle_environment/building/palette3.gbapal"); -const u16 gBattleEnvironmentPalette_StadiumAqua[] = INCBIN_U16("graphics/battle_environment/stadium/palette1.gbapal"); -const u16 gBattleEnvironmentPalette_StadiumMagma[] = INCBIN_U16("graphics/battle_environment/stadium/palette2.gbapal"); -const u16 gBattleEnvironmentPalette_StadiumSidney[] = INCBIN_U16("graphics/battle_environment/stadium/palette3.gbapal"); -const u16 gBattleEnvironmentPalette_StadiumPhoebe[] = INCBIN_U16("graphics/battle_environment/stadium/palette4.gbapal"); -const u16 gBattleEnvironmentPalette_StadiumGlacia[] = INCBIN_U16("graphics/battle_environment/stadium/palette5.gbapal"); -const u16 gBattleEnvironmentPalette_StadiumDrake[] = INCBIN_U16("graphics/battle_environment/stadium/palette6.gbapal"); -const u16 gBattleEnvironmentPalette_StadiumWallace[] = INCBIN_U16("graphics/battle_environment/stadium/palette7.gbapal"); +const u16 gBattleEnvironmentPalette_BuildingGym[] = INCBIN_U16("graphics/battle_environment/building/gym.gbapal"); +const u16 gBattleEnvironmentPalette_BuildingLeader[] = INCBIN_U16("graphics/battle_environment/building/leader.gbapal"); +const u16 gBattleEnvironmentPalette_StadiumAqua[] = INCBIN_U16("graphics/battle_environment/stadium/aqua.gbapal"); +const u16 gBattleEnvironmentPalette_StadiumMagma[] = INCBIN_U16("graphics/battle_environment/stadium/magma.gbapal"); +const u16 gBattleEnvironmentPalette_StadiumSidney[] = INCBIN_U16("graphics/battle_environment/stadium/sidney.gbapal"); +const u16 gBattleEnvironmentPalette_StadiumPhoebe[] = INCBIN_U16("graphics/battle_environment/stadium/phoebe.gbapal"); +const u16 gBattleEnvironmentPalette_StadiumGlacia[] = INCBIN_U16("graphics/battle_environment/stadium/glacia.gbapal"); +const u16 gBattleEnvironmentPalette_StadiumDrake[] = INCBIN_U16("graphics/battle_environment/stadium/drake.gbapal"); +const u16 gBattleEnvironmentPalette_StadiumWallace[] = INCBIN_U16("graphics/battle_environment/stadium/wallace.gbapal"); const u16 gBattleEnvironmentPalette_Rayquaza[] = INCBIN_U16("graphics/battle_environment/sky/palette.gbapal"); const u32 gBattleEnvironmentAnimTiles_TallGrass[] = INCBIN_U32("graphics/battle_environment/tall_grass/anim_tiles.4bpp.smol"); diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index a46f292517..5111e0ece3 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -277,7 +277,11 @@ static const u8 sRSAvatarGfxIds[GENDER_COUNT] = [FEMALE] = OBJ_EVENT_GFX_LINK_RS_MAY }; -static const u8 sPlayerAvatarGfxToStateFlag[GENDER_COUNT][5][2] = +static const struct __attribute__((packed)) +{ + u8 graphicsId; + u8 playerFlag; +} sPlayerAvatarGfxToStateFlag[GENDER_COUNT][5] = { [MALE] = { @@ -1577,8 +1581,8 @@ static u8 GetPlayerAvatarStateTransitionByGraphicsId(u16 graphicsId, u8 gender) for (i = 0; i < ARRAY_COUNT(sPlayerAvatarGfxToStateFlag[0]); i++) { - if (sPlayerAvatarGfxToStateFlag[gender][i][0] == graphicsId) - return sPlayerAvatarGfxToStateFlag[gender][i][1]; + if (sPlayerAvatarGfxToStateFlag[gender][i].graphicsId == graphicsId) + return sPlayerAvatarGfxToStateFlag[gender][i].playerFlag; } return PLAYER_AVATAR_FLAG_ON_FOOT; } @@ -1590,8 +1594,8 @@ u16 GetPlayerAvatarGraphicsIdByCurrentState(void) for (i = 0; i < ARRAY_COUNT(sPlayerAvatarGfxToStateFlag[0]); i++) { - if (sPlayerAvatarGfxToStateFlag[gPlayerAvatar.gender][i][1] & flags) - return sPlayerAvatarGfxToStateFlag[gPlayerAvatar.gender][i][0]; + if (sPlayerAvatarGfxToStateFlag[gPlayerAvatar.gender][i].playerFlag & flags) + return sPlayerAvatarGfxToStateFlag[gPlayerAvatar.gender][i].graphicsId; } return 0; } diff --git a/src/item_use.c b/src/item_use.c index ff8ff9d588..ad08d016b0 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -222,11 +222,11 @@ static void Task_CloseCantUseKeyItemMessage(u8 taskId) u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId) { if (GetItemFieldFunc(itemId) == ItemUseOutOfBattle_TMHM) - return 1; + return ITEM_IS_TM_HM; else if (GetItemFieldFunc(itemId) == ItemUseOutOfBattle_EvolutionStone) - return 2; + return ITEM_IS_EVOLUTION_STONE; 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) diff --git a/src/party_menu.c b/src/party_menu.c index 6c1be78b45..2a54c921d7 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1152,10 +1152,10 @@ static bool8 DisplayPartyPokemonDataForMoveTutorOrEvolutionItem(u8 slot) { default: return FALSE; - case 1: // TM/HM + case ITEM_IS_TM_HM: // TM/HM DisplayPartyPokemonDataToTeachMove(slot, ItemIdToBattleMoveId(item)); break; - case 2: // Evolution stone + case ITEM_IS_EVOLUTION_STONE: // Evolution stone if (!GetMonData(currentPokemon, MON_DATA_IS_EGG) && GetEvolutionTargetSpecies(currentPokemon, EVO_MODE_ITEM_CHECK, item, NULL, NULL, CHECK_EVO) != SPECIES_NONE) return FALSE; DisplayPartyPokemonDescriptionData(slot, PARTYBOX_DESC_NO_USE);