From a3ce3a569d3354676648562e6477641722536f83 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 21 Jan 2025 21:19:41 +0100 Subject: [PATCH] Converts a bunch of defines to enums (#6071) --- include/battle_setup.h | 2 +- include/battle_tower.h | 4 +- include/constants/battle.h | 52 ++-- include/constants/map_types.h | 44 +-- include/constants/trade.h | 11 +- include/constants/trainers.h | 137 ++++---- include/data.h | 2 +- include/frontier_util.h | 2 +- include/overworld.h | 18 +- include/pokemon.h | 11 +- include/pokemon_animation.h | 378 ++++++++++++----------- include/trainer_hill.h | 2 +- src/battle_bg.c | 11 +- src/battle_script_commands.c | 1 - src/battle_setup.c | 5 +- src/battle_tower.c | 6 +- src/bike.c | 1 - src/data/pokemon/trainer_class_lookups.h | 2 +- src/debug.c | 8 +- src/dexnav.c | 5 +- src/event_object_movement.c | 1 - src/field_control_avatar.c | 1 - src/field_effect.c | 1 - src/field_screen_effect.c | 4 +- src/field_specials.c | 1 - src/fldeff_flash.c | 5 +- src/fldeff_rocksmash.c | 1 - src/frontier_util.c | 2 +- src/item_use.c | 3 +- src/overworld.c | 31 +- src/pokemon.c | 8 +- src/pokemon_animation.c | 11 +- src/pokemon_sprite_visualizer.c | 2 +- src/pokenav_match_call_list.c | 2 +- src/region_map.c | 1 - src/scrcmd.c | 4 +- src/secret_base.c | 1 - src/trainer_hill.c | 2 +- 38 files changed, 396 insertions(+), 387 deletions(-) diff --git a/include/battle_setup.h b/include/battle_setup.h index a2009eea4122..028f30a6cef7 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -29,7 +29,7 @@ void BattleSetup_StartLatiBattle(void); void BattleSetup_StartLegendaryBattle(void); void StartGroudonKyogreBattle(void); void StartRegiBattle(void); -u8 BattleSetup_GetTerrainId(void); +enum BattleTerrain BattleSetup_GetTerrainId(void); u8 GetWildBattleTransition(void); u8 GetTrainerBattleTransition(void); u8 GetSpecialBattleTransition(s32 id); diff --git a/include/battle_tower.h b/include/battle_tower.h index 45c9d683ff7b..be725a2f81b4 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -49,7 +49,7 @@ void SetEReaderTrainerGfxId(void); u16 GetBattleFacilityTrainerGfxId(u16 trainerId); void PutNewBattleTowerRecord(struct EmeraldBattleTowerRecord *newRecordEm); u8 GetFrontierTrainerFrontSpriteId(u16 trainerId); -u8 GetFrontierOpponentClass(u16 trainerId); +enum TrainerClassID GetFrontierOpponentClass(u16 trainerId); void GetFrontierTrainerName(u8 *dst, u16 trainerId); void FillFrontierTrainerParty(u8 monsCount); void FillFrontierTrainersParties(u8 monsCount); @@ -60,7 +60,7 @@ void CalcEmeraldBattleTowerChecksum(struct EmeraldBattleTowerRecord *record); void CalcRubyBattleTowerChecksum(struct RSBattleTowerRecord *record); u16 GetCurrentBattleTowerWinStreak(u8 lvlMode, u8 battleMode); u8 GetEreaderTrainerFrontSpriteId(void); -u8 GetEreaderTrainerClassId(void); +enum TrainerClassID GetEreaderTrainerClassId(void); void GetEreaderTrainerName(u8 *dst); void ValidateEReaderTrainer(void); void ClearEReaderTrainer(struct BattleTowerEReaderTrainer *ereaderTrainer); diff --git a/include/constants/battle.h b/include/constants/battle.h index 561d4f81e58f..a05d9e8e967e 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -425,31 +425,33 @@ enum BattleWeather #define MOVE_EFFECT_CONTINUE 0x8000 // Battle terrain defines for gBattleTerrain. -#define BATTLE_TERRAIN_GRASS 0 -#define BATTLE_TERRAIN_LONG_GRASS 1 -#define BATTLE_TERRAIN_SAND 2 -#define BATTLE_TERRAIN_UNDERWATER 3 -#define BATTLE_TERRAIN_WATER 4 -#define BATTLE_TERRAIN_POND 5 -#define BATTLE_TERRAIN_MOUNTAIN 6 -#define BATTLE_TERRAIN_CAVE 7 -#define BATTLE_TERRAIN_BUILDING 8 -#define BATTLE_TERRAIN_PLAIN 9 -// New battle terrains are used for Secret Power but not fully implemented. -#define BATTLE_TERRAIN_SOARING 10 -#define BATTLE_TERRAIN_SKY_PILLAR 11 -#define BATTLE_TERRAIN_BURIAL_GROUND 12 -#define BATTLE_TERRAIN_PUDDLE 13 -#define BATTLE_TERRAIN_MARSH 14 -#define BATTLE_TERRAIN_SWAMP 15 -#define BATTLE_TERRAIN_SNOW 16 -#define BATTLE_TERRAIN_ICE 17 -#define BATTLE_TERRAIN_VOLCANO 18 -#define BATTLE_TERRAIN_DISTORTION_WORLD 19 -#define BATTLE_TERRAIN_SPACE 20 -#define BATTLE_TERRAIN_ULTRA_SPACE 21 - -#define BATTLE_TERRAIN_COUNT 22 +enum BattleTerrain +{ + BATTLE_TERRAIN_GRASS, + BATTLE_TERRAIN_LONG_GRASS, + BATTLE_TERRAIN_SAND, + BATTLE_TERRAIN_UNDERWATER, + BATTLE_TERRAIN_WATER, + BATTLE_TERRAIN_POND, + BATTLE_TERRAIN_MOUNTAIN, + BATTLE_TERRAIN_CAVE, + BATTLE_TERRAIN_BUILDING, + BATTLE_TERRAIN_PLAIN, + // New battle terrains are used for Secret Power but not fully implemented. + BATTLE_TERRAIN_SOARING, + BATTLE_TERRAIN_SKY_PILLAR, + BATTLE_TERRAIN_BURIAL_GROUND, + BATTLE_TERRAIN_PUDDLE, + BATTLE_TERRAIN_MARSH, + BATTLE_TERRAIN_SWAMP, + BATTLE_TERRAIN_SNOW, + BATTLE_TERRAIN_ICE, + BATTLE_TERRAIN_VOLCANO, + BATTLE_TERRAIN_DISTORTION_WORLD, + BATTLE_TERRAIN_SPACE, + BATTLE_TERRAIN_ULTRA_SPACE, + BATTLE_TERRAIN_COUNT, +}; #define B_WAIT_TIME_LONG (B_WAIT_TIME_MULTIPLIER * 4) #define B_WAIT_TIME_MED (B_WAIT_TIME_MULTIPLIER * 3) diff --git a/include/constants/map_types.h b/include/constants/map_types.h index 03a3f0a9a07b..86571434e4a2 100755 --- a/include/constants/map_types.h +++ b/include/constants/map_types.h @@ -1,25 +1,31 @@ #ifndef GUARD_CONSTANTS_MAP_TYPES_H #define GUARD_CONSTANTS_MAP_TYPES_H -#define MAP_TYPE_NONE 0 -#define MAP_TYPE_TOWN 1 -#define MAP_TYPE_CITY 2 -#define MAP_TYPE_ROUTE 3 -#define MAP_TYPE_UNDERGROUND 4 -#define MAP_TYPE_UNDERWATER 5 -#define MAP_TYPE_OCEAN_ROUTE 6 -#define MAP_TYPE_UNKNOWN 7 // Not used by any map. -#define MAP_TYPE_INDOOR 8 -#define MAP_TYPE_SECRET_BASE 9 +enum MapType +{ + MAP_TYPE_NONE, + MAP_TYPE_TOWN, + MAP_TYPE_CITY, + MAP_TYPE_ROUTE, + MAP_TYPE_UNDERGROUND, + MAP_TYPE_UNDERWATER, + MAP_TYPE_OCEAN_ROUTE, + MAP_TYPE_UNKNOWN, // Not used by any map. + MAP_TYPE_INDOOR, + MAP_TYPE_SECRET_BASE, +}; -#define MAP_BATTLE_SCENE_NORMAL 0 -#define MAP_BATTLE_SCENE_GYM 1 -#define MAP_BATTLE_SCENE_MAGMA 2 -#define MAP_BATTLE_SCENE_AQUA 3 -#define MAP_BATTLE_SCENE_SIDNEY 4 -#define MAP_BATTLE_SCENE_PHOEBE 5 -#define MAP_BATTLE_SCENE_GLACIA 6 -#define MAP_BATTLE_SCENE_DRAKE 7 -#define MAP_BATTLE_SCENE_FRONTIER 8 +enum MapBattleScene +{ + MAP_BATTLE_SCENE_NORMAL, + MAP_BATTLE_SCENE_GYM, + MAP_BATTLE_SCENE_MAGMA, + MAP_BATTLE_SCENE_AQUA, + MAP_BATTLE_SCENE_SIDNEY, + MAP_BATTLE_SCENE_PHOEBE, + MAP_BATTLE_SCENE_GLACIA, + MAP_BATTLE_SCENE_DRAKE, + MAP_BATTLE_SCENE_FRONTIER, +}; #endif // GUARD_CONSTANTS_MAP_TYPES_H diff --git a/include/constants/trade.h b/include/constants/trade.h index e387d13cd8c1..4049a0f19aa2 100644 --- a/include/constants/trade.h +++ b/include/constants/trade.h @@ -5,10 +5,13 @@ #define TRADE_PARTNER 1 // In-game Trade IDs -#define INGAME_TRADE_SEEDOT 0 -#define INGAME_TRADE_PLUSLE 1 -#define INGAME_TRADE_HORSEA 2 -#define INGAME_TRADE_MEOWTH 3 +enum InGameTradeID +{ + INGAME_TRADE_SEEDOT, + INGAME_TRADE_PLUSLE, + INGAME_TRADE_HORSEA, + INGAME_TRADE_MEOWTH, +}; // Return values for CanTradeSelectedMon and CanSpinTradeMon #define CAN_TRADE_MON 0 diff --git a/include/constants/trainers.h b/include/constants/trainers.h index ebfc18eef0d5..4f2200841069 100644 --- a/include/constants/trainers.h +++ b/include/constants/trainers.h @@ -285,73 +285,76 @@ #define RS_FACILITY_CLASSES_COUNT 0x4D -#define TRAINER_CLASS_PKMN_TRAINER_1 0x0 // Unused -#define TRAINER_CLASS_PKMN_TRAINER_2 0x1 // Unused -#define TRAINER_CLASS_HIKER 0x2 -#define TRAINER_CLASS_TEAM_AQUA 0x3 -#define TRAINER_CLASS_PKMN_BREEDER 0x4 -#define TRAINER_CLASS_COOLTRAINER 0x5 -#define TRAINER_CLASS_BIRD_KEEPER 0x6 -#define TRAINER_CLASS_COLLECTOR 0x7 -#define TRAINER_CLASS_SWIMMER_M 0x8 -#define TRAINER_CLASS_TEAM_MAGMA 0x9 -#define TRAINER_CLASS_EXPERT 0xa -#define TRAINER_CLASS_AQUA_ADMIN 0xb -#define TRAINER_CLASS_BLACK_BELT 0xc -#define TRAINER_CLASS_AQUA_LEADER 0xd -#define TRAINER_CLASS_HEX_MANIAC 0xe -#define TRAINER_CLASS_AROMA_LADY 0xf -#define TRAINER_CLASS_RUIN_MANIAC 0x10 -#define TRAINER_CLASS_INTERVIEWER 0x11 -#define TRAINER_CLASS_TUBER_F 0x12 -#define TRAINER_CLASS_TUBER_M 0x13 -#define TRAINER_CLASS_LADY 0x14 -#define TRAINER_CLASS_BEAUTY 0x15 -#define TRAINER_CLASS_RICH_BOY 0x16 -#define TRAINER_CLASS_POKEMANIAC 0x17 -#define TRAINER_CLASS_GUITARIST 0x18 -#define TRAINER_CLASS_KINDLER 0x19 -#define TRAINER_CLASS_CAMPER 0x1a -#define TRAINER_CLASS_PICNICKER 0x1b -#define TRAINER_CLASS_BUG_MANIAC 0x1c -#define TRAINER_CLASS_PSYCHIC 0x1d -#define TRAINER_CLASS_GENTLEMAN 0x1e -#define TRAINER_CLASS_ELITE_FOUR 0x1f -#define TRAINER_CLASS_LEADER 0x20 -#define TRAINER_CLASS_SCHOOL_KID 0x21 -#define TRAINER_CLASS_SR_AND_JR 0x22 -#define TRAINER_CLASS_WINSTRATE 0x23 -#define TRAINER_CLASS_POKEFAN 0x24 -#define TRAINER_CLASS_YOUNGSTER 0x25 -#define TRAINER_CLASS_CHAMPION 0x26 -#define TRAINER_CLASS_FISHERMAN 0x27 -#define TRAINER_CLASS_TRIATHLETE 0x28 -#define TRAINER_CLASS_DRAGON_TAMER 0x29 -#define TRAINER_CLASS_NINJA_BOY 0x2a -#define TRAINER_CLASS_BATTLE_GIRL 0x2b -#define TRAINER_CLASS_PARASOL_LADY 0x2c -#define TRAINER_CLASS_SWIMMER_F 0x2d -#define TRAINER_CLASS_TWINS 0x2e -#define TRAINER_CLASS_SAILOR 0x2f -#define TRAINER_CLASS_COOLTRAINER_2 0x30 // Used for only one trainer. -#define TRAINER_CLASS_MAGMA_ADMIN 0x31 -#define TRAINER_CLASS_RIVAL 0x32 -#define TRAINER_CLASS_BUG_CATCHER 0x33 -#define TRAINER_CLASS_PKMN_RANGER 0x34 -#define TRAINER_CLASS_MAGMA_LEADER 0x35 -#define TRAINER_CLASS_LASS 0x36 -#define TRAINER_CLASS_YOUNG_COUPLE 0x37 -#define TRAINER_CLASS_OLD_COUPLE 0x38 -#define TRAINER_CLASS_SIS_AND_BRO 0x39 -#define TRAINER_CLASS_SALON_MAIDEN 0x3a -#define TRAINER_CLASS_DOME_ACE 0x3b -#define TRAINER_CLASS_PALACE_MAVEN 0x3c -#define TRAINER_CLASS_ARENA_TYCOON 0x3d -#define TRAINER_CLASS_FACTORY_HEAD 0x3e -#define TRAINER_CLASS_PIKE_QUEEN 0x3f -#define TRAINER_CLASS_PYRAMID_KING 0x40 -#define TRAINER_CLASS_RS_PROTAG 0x41 -#define TRAINER_CLASS_COUNT 0x42 +enum TrainerClassID +{ + TRAINER_CLASS_PKMN_TRAINER_1, // Unused + TRAINER_CLASS_PKMN_TRAINER_2, // Unused + TRAINER_CLASS_HIKER, + TRAINER_CLASS_TEAM_AQUA, + TRAINER_CLASS_PKMN_BREEDER, + TRAINER_CLASS_COOLTRAINER, + TRAINER_CLASS_BIRD_KEEPER, + TRAINER_CLASS_COLLECTOR, + TRAINER_CLASS_SWIMMER_M, + TRAINER_CLASS_TEAM_MAGMA, + TRAINER_CLASS_EXPERT, + TRAINER_CLASS_AQUA_ADMIN, + TRAINER_CLASS_BLACK_BELT, + TRAINER_CLASS_AQUA_LEADER, + TRAINER_CLASS_HEX_MANIAC, + TRAINER_CLASS_AROMA_LADY, + TRAINER_CLASS_RUIN_MANIAC, + TRAINER_CLASS_INTERVIEWER, + TRAINER_CLASS_TUBER_F, + TRAINER_CLASS_TUBER_M, + TRAINER_CLASS_LADY, + TRAINER_CLASS_BEAUTY, + TRAINER_CLASS_RICH_BOY, + TRAINER_CLASS_POKEMANIAC, + TRAINER_CLASS_GUITARIST, + TRAINER_CLASS_KINDLER, + TRAINER_CLASS_CAMPER, + TRAINER_CLASS_PICNICKER, + TRAINER_CLASS_BUG_MANIAC, + TRAINER_CLASS_PSYCHIC, + TRAINER_CLASS_GENTLEMAN, + TRAINER_CLASS_ELITE_FOUR, + TRAINER_CLASS_LEADER, + TRAINER_CLASS_SCHOOL_KID, + TRAINER_CLASS_SR_AND_JR, + TRAINER_CLASS_WINSTRATE, + TRAINER_CLASS_POKEFAN, + TRAINER_CLASS_YOUNGSTER, + TRAINER_CLASS_CHAMPION, + TRAINER_CLASS_FISHERMAN, + TRAINER_CLASS_TRIATHLETE, + TRAINER_CLASS_DRAGON_TAMER, + TRAINER_CLASS_NINJA_BOY, + TRAINER_CLASS_BATTLE_GIRL, + TRAINER_CLASS_PARASOL_LADY, + TRAINER_CLASS_SWIMMER_F, + TRAINER_CLASS_TWINS, + TRAINER_CLASS_SAILOR, + TRAINER_CLASS_COOLTRAINER_2, // Used for only one trainer. + TRAINER_CLASS_MAGMA_ADMIN, + TRAINER_CLASS_RIVAL, + TRAINER_CLASS_BUG_CATCHER, + TRAINER_CLASS_PKMN_RANGER, + TRAINER_CLASS_MAGMA_LEADER, + TRAINER_CLASS_LASS, + TRAINER_CLASS_YOUNG_COUPLE, + TRAINER_CLASS_OLD_COUPLE, + TRAINER_CLASS_SIS_AND_BRO, + TRAINER_CLASS_SALON_MAIDEN, + TRAINER_CLASS_DOME_ACE, + TRAINER_CLASS_PALACE_MAVEN, + TRAINER_CLASS_ARENA_TYCOON, + TRAINER_CLASS_FACTORY_HEAD, + TRAINER_CLASS_PIKE_QUEEN, + TRAINER_CLASS_PYRAMID_KING, + TRAINER_CLASS_RS_PROTAG, + TRAINER_CLASS_COUNT, +}; #define TRAINER_ENCOUNTER_MUSIC_MALE 0 // standard male encounter music #define TRAINER_ENCOUNTER_MUSIC_FEMALE 1 // standard female encounter music diff --git a/include/data.h b/include/data.h index 1d2a1291f954..6cf7f46ded8d 100644 --- a/include/data.h +++ b/include/data.h @@ -200,7 +200,7 @@ static inline const struct Trainer *GetTrainerStructFromId(u16 trainerId) return &gTrainers[difficulty][sanitizedTrainerId]; } -static inline const u8 GetTrainerClassFromId(u16 trainerId) +static inline const enum TrainerClassID GetTrainerClassFromId(u16 trainerId) { u32 sanitizedTrainerId = SanitizeTrainerId(trainerId); enum DifficultyLevel difficulty = GetTrainerDifficultyLevel(sanitizedTrainerId); diff --git a/include/frontier_util.h b/include/frontier_util.h index 0d617782a34b..5494aa5f0b08 100644 --- a/include/frontier_util.h +++ b/include/frontier_util.h @@ -13,7 +13,7 @@ void ScrollRankingHallRecordsWindow(void); void ClearRankingHallRecords(void); void SaveGameFrontier(void); u8 GetFrontierBrainTrainerPicIndex(void); -u8 GetFrontierBrainTrainerClass(void); +enum TrainerClassID GetFrontierBrainTrainerClass(void); void CopyFrontierBrainTrainerName(u8 *dst); bool8 IsFrontierBrainFemale(void); void SetFrontierBrainObjEventGfx_2(void); diff --git a/include/overworld.h b/include/overworld.h index ea23c15b3040..2a4cdc326cb5 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -1,6 +1,8 @@ #ifndef GUARD_OVERWORLD_H #define GUARD_OVERWORLD_H +#include "constants/map_types.h" + #define LINK_KEY_CODE_NULL 0x00 #define LINK_KEY_CODE_EMPTY 0x11 #define LINK_KEY_CODE_DPAD_DOWN 0x12 @@ -116,16 +118,16 @@ void TryFadeOutOldMapMusic(void); bool8 BGMusicStopped(void); void Overworld_FadeOutMapMusic(void); void UpdateAmbientCry(s16 *state, u16 *delayCounter); -u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum); -u8 GetMapTypeByWarpData(struct WarpData *warp); -u8 GetCurrentMapType(void); -u8 GetLastUsedWarpMapType(void); -bool8 IsMapTypeOutdoors(u8 mapType); -bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType); -bool8 IsMapTypeIndoors(u8 mapType); +enum MapType GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum); +enum MapType GetMapTypeByWarpData(struct WarpData *warp); +enum MapType GetCurrentMapType(void); +enum MapType GetLastUsedWarpMapType(void); +bool8 IsMapTypeOutdoors(enum MapType mapType); +bool8 Overworld_MapTypeAllowsTeleportAndFly(enum MapType mapType); +bool8 IsMapTypeIndoors(enum MapType mapType); u8 GetSavedWarpRegionMapSectionId(void); u8 GetCurrentRegionMapSectionId(void); -u8 GetCurrentMapBattleScene(void); +enum MapBattleScene GetCurrentMapBattleScene(void); void CleanupOverworldWindowsAndTilemaps(void); bool32 IsOverworldLinkActive(void); void CB1_Overworld(void); diff --git a/include/pokemon.h b/include/pokemon.h index bc92b73c7564..2d19ba6ad237 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -1,11 +1,12 @@ #ifndef GUARD_POKEMON_H #define GUARD_POKEMON_H +#include "contest_effect.h" #include "sprite.h" #include "constants/items.h" -#include "constants/region_map_sections.h" #include "constants/map_groups.h" -#include "contest_effect.h" +#include "constants/region_map_sections.h" +#include "constants/trainers.h" #define GET_BASE_SPECIES_ID(speciesId) (GetFormSpeciesId(speciesId, 0)) #define FORM_SPECIES_END (0xffff) @@ -609,7 +610,7 @@ extern struct SpriteTemplate gMultiuseSpriteTemplate; extern u16 gFollowerSteps; extern const u8 gFacilityClassToPicIndex[]; -extern const u8 gFacilityClassToTrainerClass[]; +extern const enum TrainerClassID gFacilityClassToTrainerClass[]; extern const struct SpeciesInfo gSpeciesInfo[]; extern const u32 gExperienceTables[][MAX_LEVEL + 1]; extern const u8 gPPUpGetMask[]; @@ -641,7 +642,7 @@ void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest); bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId); u16 GetUnionRoomTrainerPic(void); -u16 GetUnionRoomTrainerClass(void); +enum TrainerClassID GetUnionRoomTrainerClass(void); void CreateEnemyEventMon(void); void CalculateMonStats(struct Pokemon *mon); void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest); @@ -694,7 +695,7 @@ u16 GetAbilityBySpecies(u16 species, u8 abilityNum); u16 GetMonAbility(struct Pokemon *mon); void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord); u8 GetSecretBaseTrainerPicIndex(void); -u8 GetSecretBaseTrainerClass(void); +enum TrainerClassID GetSecretBaseTrainerClass(void); bool8 IsPlayerPartyAndPokemonStorageFull(void); bool8 IsPokemonStorageFull(void); const u8 *GetSpeciesName(u16 species); diff --git a/include/pokemon_animation.h b/include/pokemon_animation.h index 748eb4b36d13..8d25d3025ce4 100644 --- a/include/pokemon_animation.h +++ b/include/pokemon_animation.h @@ -1,195 +1,201 @@ #ifndef GUARD_POKEMON_ANIMATION_H #define GUARD_POKEMON_ANIMATION_H -u8 GetSpeciesBackAnimSet(u16 species); -void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId); -void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId); -void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet); -void SetSpriteCB_MonAnimDummy(struct Sprite *sprite); - // Pokémon back animation sets -#define BACK_ANIM_NONE 0 -#define BACK_ANIM_H_VIBRATE 1 -#define BACK_ANIM_H_SLIDE 2 -#define BACK_ANIM_H_SPRING 3 -#define BACK_ANIM_H_SPRING_REPEATED 4 -#define BACK_ANIM_SHRINK_GROW 5 -#define BACK_ANIM_GROW 6 -#define BACK_ANIM_CIRCLE_COUNTERCLOCKWISE 7 -#define BACK_ANIM_H_SHAKE 8 -#define BACK_ANIM_V_SHAKE 9 -#define BACK_ANIM_V_SHAKE_H_SLIDE 10 -#define BACK_ANIM_V_STRETCH 11 -#define BACK_ANIM_H_STRETCH 12 -#define BACK_ANIM_GROW_STUTTER 13 -#define BACK_ANIM_V_SHAKE_LOW 14 -#define BACK_ANIM_TRIANGLE_DOWN 15 -#define BACK_ANIM_CONCAVE_ARC_LARGE 16 -#define BACK_ANIM_CONVEX_DOUBLE_ARC 17 -#define BACK_ANIM_CONCAVE_ARC_SMALL 18 -#define BACK_ANIM_DIP_RIGHT_SIDE 19 -#define BACK_ANIM_SHRINK_GROW_VIBRATE 20 -#define BACK_ANIM_JOLT_RIGHT 21 -#define BACK_ANIM_SHAKE_FLASH_YELLOW 22 -#define BACK_ANIM_SHAKE_GLOW_RED 23 -#define BACK_ANIM_SHAKE_GLOW_GREEN 24 -#define BACK_ANIM_SHAKE_GLOW_BLUE 25 +enum BackAnim +{ + BACK_ANIM_NONE, + BACK_ANIM_H_VIBRATE, + BACK_ANIM_H_SLIDE, + BACK_ANIM_H_SPRING, + BACK_ANIM_H_SPRING_REPEATED, + BACK_ANIM_SHRINK_GROW, + BACK_ANIM_GROW, + BACK_ANIM_CIRCLE_COUNTERCLOCKWISE, + BACK_ANIM_H_SHAKE, + BACK_ANIM_V_SHAKE, + BACK_ANIM_V_SHAKE_H_SLIDE, + BACK_ANIM_V_STRETCH, + BACK_ANIM_H_STRETCH, + BACK_ANIM_GROW_STUTTER, + BACK_ANIM_V_SHAKE_LOW, + BACK_ANIM_TRIANGLE_DOWN, + BACK_ANIM_CONCAVE_ARC_LARGE, + BACK_ANIM_CONVEX_DOUBLE_ARC, + BACK_ANIM_CONCAVE_ARC_SMALL, + BACK_ANIM_DIP_RIGHT_SIDE, + BACK_ANIM_SHRINK_GROW_VIBRATE, + BACK_ANIM_JOLT_RIGHT, + BACK_ANIM_SHAKE_FLASH_YELLOW, + BACK_ANIM_SHAKE_GLOW_RED, + BACK_ANIM_SHAKE_GLOW_GREEN, + BACK_ANIM_SHAKE_GLOW_BLUE, +}; // Pokémon animation function ids (for front and back) // Each front anim uses 1, and each back anim uses a set of 3 -#define ANIM_V_SQUISH_AND_BOUNCE 0 -#define ANIM_CIRCULAR_STRETCH_TWICE 1 -#define ANIM_H_VIBRATE 2 -#define ANIM_H_SLIDE 3 -#define ANIM_V_SLIDE 4 -#define ANIM_BOUNCE_ROTATE_TO_SIDES 5 -#define ANIM_V_JUMPS_H_JUMPS 6 -#define ANIM_ROTATE_TO_SIDES 7 -#define ANIM_ROTATE_TO_SIDES_TWICE 8 -#define ANIM_GROW_VIBRATE 9 -#define ANIM_ZIGZAG_FAST 10 -#define ANIM_SWING_CONCAVE 11 -#define ANIM_SWING_CONCAVE_FAST 12 -#define ANIM_SWING_CONVEX 13 -#define ANIM_SWING_CONVEX_FAST 14 -#define ANIM_H_SHAKE 15 -#define ANIM_V_SHAKE 16 -#define ANIM_CIRCULAR_VIBRATE 17 -#define ANIM_TWIST 18 -#define ANIM_SHRINK_GROW 19 -#define ANIM_CIRCLE_C_CLOCKWISE 20 -#define ANIM_GLOW_BLACK 21 -#define ANIM_H_STRETCH 22 -#define ANIM_V_STRETCH 23 -#define ANIM_RISING_WOBBLE 24 -#define ANIM_V_SHAKE_TWICE 25 -#define ANIM_TIP_MOVE_FORWARD 26 -#define ANIM_H_PIVOT 27 -#define ANIM_V_SLIDE_WOBBLE 28 -#define ANIM_H_SLIDE_WOBBLE 29 -#define ANIM_V_JUMPS_BIG 30 -#define ANIM_SPIN_LONG 31 -#define ANIM_GLOW_ORANGE 32 -#define ANIM_GLOW_RED 33 -#define ANIM_GLOW_BLUE 34 -#define ANIM_GLOW_YELLOW 35 -#define ANIM_GLOW_PURPLE 36 -#define ANIM_BACK_AND_LUNGE 37 -#define ANIM_BACK_FLIP 38 -#define ANIM_FLICKER 39 -#define ANIM_BACK_FLIP_BIG 40 -#define ANIM_FRONT_FLIP 41 -#define ANIM_TUMBLING_FRONT_FLIP 42 -#define ANIM_FIGURE_8 43 -#define ANIM_FLASH_YELLOW 44 -#define ANIM_SWING_CONCAVE_FAST_SHORT 45 -#define ANIM_SWING_CONVEX_FAST_SHORT 46 -#define ANIM_ROTATE_UP_SLAM_DOWN 47 -#define ANIM_DEEP_V_SQUISH_AND_BOUNCE 48 -#define ANIM_H_JUMPS 49 -#define ANIM_H_JUMPS_V_STRETCH 50 -#define ANIM_ROTATE_TO_SIDES_FAST 51 -#define ANIM_ROTATE_UP_TO_SIDES 52 -#define ANIM_FLICKER_INCREASING 53 -#define ANIM_TIP_HOP_FORWARD 54 -#define ANIM_PIVOT_SHAKE 55 -#define ANIM_TIP_AND_SHAKE 56 -#define ANIM_VIBRATE_TO_CORNERS 57 -#define ANIM_GROW_IN_STAGES 58 -#define ANIM_V_SPRING 59 -#define ANIM_V_REPEATED_SPRING 60 -#define ANIM_SPRING_RISING 61 -#define ANIM_H_SPRING 62 -#define ANIM_H_REPEATED_SPRING_SLOW 63 -#define ANIM_H_SLIDE_SHRINK 64 -#define ANIM_LUNGE_GROW 65 -#define ANIM_CIRCLE_INTO_BG 66 -#define ANIM_RAPID_H_HOPS 67 -#define ANIM_FOUR_PETAL 68 -#define ANIM_V_SQUISH_AND_BOUNCE_SLOW 69 -#define ANIM_H_SLIDE_SLOW 70 -#define ANIM_V_SLIDE_SLOW 71 -#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL 72 -#define ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW 73 -#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW 74 -#define ANIM_ZIGZAG_SLOW 75 -#define ANIM_H_SHAKE_SLOW 76 -#define ANIM_V_SHAKE_SLOW 77 -#define ANIM_TWIST_TWICE 78 -#define ANIM_CIRCLE_C_CLOCKWISE_SLOW 79 -#define ANIM_V_SHAKE_TWICE_SLOW 80 -#define ANIM_V_SLIDE_WOBBLE_SMALL 81 -#define ANIM_V_JUMPS_SMALL 82 -#define ANIM_SPIN 83 -#define ANIM_TUMBLING_FRONT_FLIP_TWICE 84 -#define ANIM_DEEP_V_SQUISH_AND_BOUNCE_TWICE 85 -#define ANIM_H_JUMPS_V_STRETCH_TWICE 86 -#define ANIM_V_SHAKE_BACK 87 -#define ANIM_V_SHAKE_BACK_SLOW 88 -#define ANIM_V_SHAKE_H_SLIDE_SLOW 89 -#define ANIM_V_STRETCH_BOTH_ENDS_SLOW 90 -#define ANIM_H_STRETCH_FAR_SLOW 91 -#define ANIM_V_SHAKE_LOW_TWICE 92 -#define ANIM_H_SHAKE_FAST 93 -#define ANIM_H_SLIDE_FAST 94 -#define ANIM_H_VIBRATE_FAST 95 -#define ANIM_H_VIBRATE_FASTEST 96 -#define ANIM_V_SHAKE_BACK_FAST 97 -#define ANIM_V_SHAKE_LOW_TWICE_SLOW 98 -#define ANIM_V_SHAKE_LOW_TWICE_FAST 99 -#define ANIM_CIRCLE_C_CLOCKWISE_LONG 100 -#define ANIM_GROW_STUTTER_SLOW 101 -#define ANIM_V_SHAKE_H_SLIDE 102 -#define ANIM_V_SHAKE_H_SLIDE_FAST 103 -#define ANIM_TRIANGLE_DOWN_SLOW 104 -#define ANIM_TRIANGLE_DOWN 105 -#define ANIM_TRIANGLE_DOWN_TWICE 106 -#define ANIM_GROW 107 -#define ANIM_GROW_TWICE 108 -#define ANIM_H_SPRING_FAST 109 -#define ANIM_H_SPRING_SLOW 110 -#define ANIM_H_REPEATED_SPRING_FAST 111 -#define ANIM_H_REPEATED_SPRING 112 -#define ANIM_SHRINK_GROW_FAST 113 -#define ANIM_SHRINK_GROW_SLOW 114 -#define ANIM_V_STRETCH_BOTH_ENDS 115 -#define ANIM_V_STRETCH_BOTH_ENDS_TWICE 116 -#define ANIM_H_STRETCH_FAR_TWICE 117 -#define ANIM_H_STRETCH_FAR 118 -#define ANIM_GROW_STUTTER_TWICE 119 -#define ANIM_GROW_STUTTER 120 -#define ANIM_CONCAVE_ARC_LARGE_SLOW 121 -#define ANIM_CONCAVE_ARC_LARGE 122 -#define ANIM_CONCAVE_ARC_LARGE_TWICE 123 -#define ANIM_CONVEX_DOUBLE_ARC_SLOW 124 -#define ANIM_CONVEX_DOUBLE_ARC 125 -#define ANIM_CONVEX_DOUBLE_ARC_TWICE 126 -#define ANIM_CONCAVE_ARC_SMALL_SLOW 127 -#define ANIM_CONCAVE_ARC_SMALL 128 -#define ANIM_CONCAVE_ARC_SMALL_TWICE 129 -#define ANIM_H_DIP 130 -#define ANIM_H_DIP_FAST 131 -#define ANIM_H_DIP_TWICE 132 -#define ANIM_SHRINK_GROW_VIBRATE_FAST 133 -#define ANIM_SHRINK_GROW_VIBRATE 134 -#define ANIM_SHRINK_GROW_VIBRATE_SLOW 135 -#define ANIM_JOLT_RIGHT_FAST 136 -#define ANIM_JOLT_RIGHT 137 -#define ANIM_JOLT_RIGHT_SLOW 138 -#define ANIM_SHAKE_FLASH_YELLOW_FAST 139 -#define ANIM_SHAKE_FLASH_YELLOW 140 -#define ANIM_SHAKE_FLASH_YELLOW_SLOW 141 -#define ANIM_SHAKE_GLOW_RED_FAST 142 -#define ANIM_SHAKE_GLOW_RED 143 -#define ANIM_SHAKE_GLOW_RED_SLOW 144 -#define ANIM_SHAKE_GLOW_GREEN_FAST 145 -#define ANIM_SHAKE_GLOW_GREEN 146 -#define ANIM_SHAKE_GLOW_GREEN_SLOW 147 -#define ANIM_SHAKE_GLOW_BLUE_FAST 148 -#define ANIM_SHAKE_GLOW_BLUE 149 -#define ANIM_SHAKE_GLOW_BLUE_SLOW 150 -#define ANIM_SHAKE_GLOW_BLACK_SLOW 151 -#define ANIM_SHAKE_GLOW_WHITE_SLOW 152 -#define ANIM_SHAKE_GLOW_PURPLE_SLOW 153 +enum AnimFunctionIDs +{ + ANIM_V_SQUISH_AND_BOUNCE, + ANIM_CIRCULAR_STRETCH_TWICE, + ANIM_H_VIBRATE, + ANIM_H_SLIDE, + ANIM_V_SLIDE, + ANIM_BOUNCE_ROTATE_TO_SIDES, + ANIM_V_JUMPS_H_JUMPS, + ANIM_ROTATE_TO_SIDES, + ANIM_ROTATE_TO_SIDES_TWICE, + ANIM_GROW_VIBRATE, + ANIM_ZIGZAG_FAST, + ANIM_SWING_CONCAVE, + ANIM_SWING_CONCAVE_FAST, + ANIM_SWING_CONVEX, + ANIM_SWING_CONVEX_FAST, + ANIM_H_SHAKE, + ANIM_V_SHAKE, + ANIM_CIRCULAR_VIBRATE, + ANIM_TWIST, + ANIM_SHRINK_GROW, + ANIM_CIRCLE_C_CLOCKWISE, + ANIM_GLOW_BLACK, + ANIM_H_STRETCH, + ANIM_V_STRETCH, + ANIM_RISING_WOBBLE, + ANIM_V_SHAKE_TWICE, + ANIM_TIP_MOVE_FORWARD, + ANIM_H_PIVOT, + ANIM_V_SLIDE_WOBBLE, + ANIM_H_SLIDE_WOBBLE, + ANIM_V_JUMPS_BIG, + ANIM_SPIN_LONG, + ANIM_GLOW_ORANGE, + ANIM_GLOW_RED, + ANIM_GLOW_BLUE, + ANIM_GLOW_YELLOW, + ANIM_GLOW_PURPLE, + ANIM_BACK_AND_LUNGE, + ANIM_BACK_FLIP, + ANIM_FLICKER, + ANIM_BACK_FLIP_BIG, + ANIM_FRONT_FLIP, + ANIM_TUMBLING_FRONT_FLIP, + ANIM_FIGURE_8, + ANIM_FLASH_YELLOW, + ANIM_SWING_CONCAVE_FAST_SHORT, + ANIM_SWING_CONVEX_FAST_SHORT, + ANIM_ROTATE_UP_SLAM_DOWN, + ANIM_DEEP_V_SQUISH_AND_BOUNCE, + ANIM_H_JUMPS, + ANIM_H_JUMPS_V_STRETCH, + ANIM_ROTATE_TO_SIDES_FAST, + ANIM_ROTATE_UP_TO_SIDES, + ANIM_FLICKER_INCREASING, + ANIM_TIP_HOP_FORWARD, + ANIM_PIVOT_SHAKE, + ANIM_TIP_AND_SHAKE, + ANIM_VIBRATE_TO_CORNERS, + ANIM_GROW_IN_STAGES, + ANIM_V_SPRING, + ANIM_V_REPEATED_SPRING, + ANIM_SPRING_RISING, + ANIM_H_SPRING, + ANIM_H_REPEATED_SPRING_SLOW, + ANIM_H_SLIDE_SHRINK, + ANIM_LUNGE_GROW, + ANIM_CIRCLE_INTO_BG, + ANIM_RAPID_H_HOPS, + ANIM_FOUR_PETAL, + ANIM_V_SQUISH_AND_BOUNCE_SLOW, + ANIM_H_SLIDE_SLOW, + ANIM_V_SLIDE_SLOW, + ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW, + ANIM_ZIGZAG_SLOW, + ANIM_H_SHAKE_SLOW, + ANIM_V_SHAKE_SLOW, + ANIM_TWIST_TWICE, + ANIM_CIRCLE_C_CLOCKWISE_SLOW, + ANIM_V_SHAKE_TWICE_SLOW, + ANIM_V_SLIDE_WOBBLE_SMALL, + ANIM_V_JUMPS_SMALL, + ANIM_SPIN, + ANIM_TUMBLING_FRONT_FLIP_TWICE, + ANIM_DEEP_V_SQUISH_AND_BOUNCE_TWICE, + ANIM_H_JUMPS_V_STRETCH_TWICE, + ANIM_V_SHAKE_BACK, + ANIM_V_SHAKE_BACK_SLOW, + ANIM_V_SHAKE_H_SLIDE_SLOW, + ANIM_V_STRETCH_BOTH_ENDS_SLOW, + ANIM_H_STRETCH_FAR_SLOW, + ANIM_V_SHAKE_LOW_TWICE, + ANIM_H_SHAKE_FAST, + ANIM_H_SLIDE_FAST, + ANIM_H_VIBRATE_FAST, + ANIM_H_VIBRATE_FASTEST, + ANIM_V_SHAKE_BACK_FAST, + ANIM_V_SHAKE_LOW_TWICE_SLOW, + ANIM_V_SHAKE_LOW_TWICE_FAST, + ANIM_CIRCLE_C_CLOCKWISE_LONG, + ANIM_GROW_STUTTER_SLOW, + ANIM_V_SHAKE_H_SLIDE, + ANIM_V_SHAKE_H_SLIDE_FAST, + ANIM_TRIANGLE_DOWN_SLOW, + ANIM_TRIANGLE_DOWN, + ANIM_TRIANGLE_DOWN_TWICE, + ANIM_GROW, + ANIM_GROW_TWICE, + ANIM_H_SPRING_FAST, + ANIM_H_SPRING_SLOW, + ANIM_H_REPEATED_SPRING_FAST, + ANIM_H_REPEATED_SPRING, + ANIM_SHRINK_GROW_FAST, + ANIM_SHRINK_GROW_SLOW, + ANIM_V_STRETCH_BOTH_ENDS, + ANIM_V_STRETCH_BOTH_ENDS_TWICE, + ANIM_H_STRETCH_FAR_TWICE, + ANIM_H_STRETCH_FAR, + ANIM_GROW_STUTTER_TWICE, + ANIM_GROW_STUTTER, + ANIM_CONCAVE_ARC_LARGE_SLOW, + ANIM_CONCAVE_ARC_LARGE, + ANIM_CONCAVE_ARC_LARGE_TWICE, + ANIM_CONVEX_DOUBLE_ARC_SLOW, + ANIM_CONVEX_DOUBLE_ARC, + ANIM_CONVEX_DOUBLE_ARC_TWICE, + ANIM_CONCAVE_ARC_SMALL_SLOW, + ANIM_CONCAVE_ARC_SMALL, + ANIM_CONCAVE_ARC_SMALL_TWICE, + ANIM_H_DIP, + ANIM_H_DIP_FAST, + ANIM_H_DIP_TWICE, + ANIM_SHRINK_GROW_VIBRATE_FAST, + ANIM_SHRINK_GROW_VIBRATE, + ANIM_SHRINK_GROW_VIBRATE_SLOW, + ANIM_JOLT_RIGHT_FAST, + ANIM_JOLT_RIGHT, + ANIM_JOLT_RIGHT_SLOW, + ANIM_SHAKE_FLASH_YELLOW_FAST, + ANIM_SHAKE_FLASH_YELLOW, + ANIM_SHAKE_FLASH_YELLOW_SLOW, + ANIM_SHAKE_GLOW_RED_FAST, + ANIM_SHAKE_GLOW_RED, + ANIM_SHAKE_GLOW_RED_SLOW, + ANIM_SHAKE_GLOW_GREEN_FAST, + ANIM_SHAKE_GLOW_GREEN, + ANIM_SHAKE_GLOW_GREEN_SLOW, + ANIM_SHAKE_GLOW_BLUE_FAST, + ANIM_SHAKE_GLOW_BLUE, + ANIM_SHAKE_GLOW_BLUE_SLOW, + ANIM_SHAKE_GLOW_BLACK_SLOW, + ANIM_SHAKE_GLOW_WHITE_SLOW, + ANIM_SHAKE_GLOW_PURPLE_SLOW, +}; + +enum BackAnim GetSpeciesBackAnimSet(u16 species); +void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, enum AnimFunctionIDs frontAnimId); +void StartMonSummaryAnimation(struct Sprite *sprite, enum AnimFunctionIDs frontAnimId); +void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, enum BackAnim backAnimSet); +void SetSpriteCB_MonAnimDummy(struct Sprite *sprite); #endif // GUARD_POKEMON_ANIMATION_H diff --git a/include/trainer_hill.h b/include/trainer_hill.h index 6e2ec0ba0ac6..848e40e7d5ac 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -45,7 +45,7 @@ extern u32 *gTrainerHillVBlankCounter; void CallTrainerHillFunction(void); void ResetTrainerHillResults(void); -u8 GetTrainerHillOpponentClass(u16 trainerId); +enum TrainerClassID GetTrainerHillOpponentClass(u16 trainerId); void GetTrainerHillTrainerName(u8 *dst, u16 trainerId); u8 GetTrainerHillTrainerFrontSpriteId(u16 trainerId); void InitTrainerHillBattleStruct(void); diff --git a/src/battle_bg.c b/src/battle_bg.c index 328f990653e0..8779d8f349a0 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -21,7 +21,6 @@ #include "text_window.h" #include "trig.h" #include "window.h" -#include "constants/map_types.h" #include "constants/rgb.h" #include "constants/songs.h" #include "constants/trainers.h" @@ -806,7 +805,7 @@ void DrawMainBattleBackground(void) { if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + enum TrainerClassID trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); if (trainerClass == TRAINER_CLASS_LEADER) { LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); @@ -1207,7 +1206,7 @@ void DrawBattleEntryBackground(void) { if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + enum TrainerClassID trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); if (trainerClass == TRAINER_CLASS_LEADER) { LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); @@ -1272,7 +1271,7 @@ bool8 LoadChosenBattleElement(u8 caseId) { if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + enum TrainerClassID trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); if (trainerClass == TRAINER_CLASS_LEADER) { LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); @@ -1334,7 +1333,7 @@ bool8 LoadChosenBattleElement(u8 caseId) { if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + enum TrainerClassID trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); if (trainerClass == TRAINER_CLASS_LEADER) { LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); @@ -1396,7 +1395,7 @@ bool8 LoadChosenBattleElement(u8 caseId) { if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + enum TrainerClassID trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); if (trainerClass == TRAINER_CLASS_LEADER) { LoadCompressedPalette(gBattleTerrainPalette_BuildingLeader, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 741ed0239070..ec98f9fcd653 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -56,7 +56,6 @@ #include "constants/hold_effects.h" #include "constants/items.h" #include "constants/item_effects.h" -#include "constants/map_types.h" #include "constants/moves.h" #include "constants/party_menu.h" #include "constants/rgb.h" diff --git a/src/battle_setup.c b/src/battle_setup.c index 37204c1d8d80..d73b6321ee8f 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -45,7 +45,6 @@ #include "constants/game_stat.h" #include "constants/items.h" #include "constants/songs.h" -#include "constants/map_types.h" #include "constants/trainers.h" #include "constants/trainer_hill.h" #include "constants/weather.h" @@ -745,7 +744,7 @@ static void CB2_EndScriptedWildBattle(void) } } -u8 BattleSetup_GetTerrainId(void) +enum BattleTerrain BattleSetup_GetTerrainId(void) { u16 tileBehavior; s16 x, y; @@ -897,7 +896,7 @@ u8 GetTrainerBattleTransition(void) u8 enemyLevel; u8 playerLevel; u32 trainerId = SanitizeTrainerId(gTrainerBattleOpponent_A); - u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + enum TrainerClassID trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); if (DoesTrainerHaveMugshot(trainerId)) return B_TRANSITION_MUGSHOT; diff --git a/src/battle_tower.c b/src/battle_tower.c index 7fcdf1b8dd52..47b85af65c43 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -1352,9 +1352,9 @@ u8 GetFrontierTrainerFrontSpriteId(u16 trainerId) } } -u8 GetFrontierOpponentClass(u16 trainerId) +enum TrainerClassID GetFrontierOpponentClass(u16 trainerId) { - u8 trainerClass = 0; + enum TrainerClassID trainerClass = 0; enum DifficultyLevel difficulty = GetBattlePartnerDifficultyLevel(trainerId); SetFacilityPtrsGetLevel(); @@ -2847,7 +2847,7 @@ u8 GetEreaderTrainerFrontSpriteId(void) #endif //FREE_BATTLE_TOWER_E_READER } -u8 GetEreaderTrainerClassId(void) +enum TrainerClassID GetEreaderTrainerClassId(void) { #if FREE_BATTLE_TOWER_E_READER == FALSE return gFacilityClassToTrainerClass[gSaveBlock2Ptr->frontier.ereaderTrainer.facilityClass]; diff --git a/src/bike.c b/src/bike.c index afc3099ab7e8..50ed705da38b 100644 --- a/src/bike.c +++ b/src/bike.c @@ -7,7 +7,6 @@ #include "metatile_behavior.h" #include "overworld.h" #include "sound.h" -#include "constants/map_types.h" #include "constants/songs.h" // this file's functions diff --git a/src/data/pokemon/trainer_class_lookups.h b/src/data/pokemon/trainer_class_lookups.h index 909d3d7dcbb9..a88f705f0148 100644 --- a/src/data/pokemon/trainer_class_lookups.h +++ b/src/data/pokemon/trainer_class_lookups.h @@ -84,7 +84,7 @@ const u8 gFacilityClassToPicIndex[] = [FACILITY_CLASS_RS_MAY] = TRAINER_PIC_RS_MAY, }; -const u8 gFacilityClassToTrainerClass[] = +const enum TrainerClassID gFacilityClassToTrainerClass[] = { [FACILITY_CLASS_HIKER] = TRAINER_CLASS_HIKER, [FACILITY_CLASS_AQUA_GRUNT_M] = TRAINER_CLASS_TEAM_AQUA, diff --git a/src/debug.c b/src/debug.c index d9b382092d56..a2432787706b 100644 --- a/src/debug.c +++ b/src/debug.c @@ -168,7 +168,7 @@ enum FlagsVarsDebugMenu DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING, }; -enum BattleType +enum DebugBattleType { DEBUG_BATTLE_0_MENU_ITEM_WILD, DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE, @@ -177,7 +177,7 @@ enum BattleType DEBUG_BATTLE_0_MENU_ITEM_MULTI, }; -enum BattleAIFlags +enum DebugBattleAIFlags { DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01, @@ -200,7 +200,7 @@ enum BattleAIFlags DEBUG_BATTLE_1_MENU_ITEM_CONTINUE, }; -enum BattleTerrain +enum DebugBattleTerrain { DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1, @@ -310,7 +310,7 @@ struct DebugBattleData { u8 submenu; u8 battleType; - u8 battleTerrain; + enum BattleTerrain battleTerrain; bool8 aiFlags[AI_FLAG_COUNT]; }; diff --git a/src/dexnav.c b/src/dexnav.c index 61b7b78ba0e4..8abaf31e8b30 100644 --- a/src/dexnav.c +++ b/src/dexnav.c @@ -49,7 +49,6 @@ #include "text_window.h" #include "wild_encounter.h" #include "window.h" -#include "constants/map_types.h" #include "constants/species.h" #include "constants/maps.h" #include "constants/field_effects.h" @@ -613,7 +612,7 @@ static bool8 DexNavPickTile(u8 environment, u8 areaX, u8 areaY, bool8 smallScan) bool8 nextIter; u8 scale = 0; u8 weight = 0; - u8 currMapType = GetCurrentMapType(); + enum MapType currMapType = GetCurrentMapType(); u8 tileBehaviour; u8 tileBuffer = 2; u8 *xPos = AllocZeroed((botX - topX) * (botY - topY) * sizeof(u8)); @@ -725,7 +724,7 @@ static bool8 DexNavPickTile(u8 environment, u8 areaX, u8 areaY, bool8 smallScan) static bool8 TryStartHiddenMonFieldEffect(u8 environment, u8 xSize, u8 ySize, bool8 smallScan) { - u8 currMapType = GetCurrentMapType(); + enum MapType currMapType = GetCurrentMapType(); u8 fldEffId = 0; if (DexNavPickTile(environment, xSize, ySize, smallScan)) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 80423aa3169e..7b652b4eec29 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -44,7 +44,6 @@ #include "constants/event_objects.h" #include "constants/field_effects.h" #include "constants/items.h" -#include "constants/map_types.h" #include "constants/mauville_old_man.h" #include "constants/rgb.h" #include "constants/region_map_sections.h" diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index a9be5b55a078..96f034675def 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -35,7 +35,6 @@ #include "constants/event_bg.h" #include "constants/event_objects.h" #include "constants/field_poison.h" -#include "constants/map_types.h" #include "constants/metatile_behaviors.h" #include "constants/songs.h" #include "constants/trainer_hill.h" diff --git a/src/field_effect.c b/src/field_effect.c index 45631be6a348..65ec704adde9 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -36,7 +36,6 @@ #include "constants/metatile_behaviors.h" #include "constants/rgb.h" #include "constants/songs.h" -#include "constants/map_types.h" #define subsprite_table(ptr) {.subsprites = ptr, .subspriteCount = (sizeof ptr) / (sizeof(struct Subsprite))} diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index e07d067afc6c..3fe73c1cc59c 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -86,7 +86,7 @@ static void FillPalBufferBlack(void) void WarpFadeInScreen(void) { - u8 previousMapType = GetLastUsedWarpMapType(); + enum MapType previousMapType = GetLastUsedWarpMapType(); switch (GetMapPairFadeFromType(previousMapType, GetCurrentMapType())) { case 0: @@ -113,7 +113,7 @@ void FadeInFromBlack(void) void WarpFadeOutScreen(void) { - u8 currentMapType = GetCurrentMapType(); + enum MapType currentMapType = GetCurrentMapType(); switch (GetMapPairFadeToType(currentMapType, GetDestinationWarpMapHeader()->mapType)) { case 0: diff --git a/src/field_specials.c b/src/field_specials.c index e04a8011fe80..9573fabec8b8 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -59,7 +59,6 @@ #include "constants/field_specials.h" #include "constants/items.h" #include "constants/heal_locations.h" -#include "constants/map_types.h" #include "constants/mystery_gift.h" #include "constants/slot_machine.h" #include "constants/songs.h" diff --git a/src/fldeff_flash.c b/src/fldeff_flash.c index 1e2b9a95fc72..5663c86c27c0 100644 --- a/src/fldeff_flash.c +++ b/src/fldeff_flash.c @@ -14,7 +14,6 @@ #include "sprite.h" #include "task.h" #include "constants/songs.h" -#include "constants/map_types.h" struct FlashStruct { @@ -154,8 +153,8 @@ void CB2_DoChangeMap(void) static bool8 TryDoMapTransition(void) { u8 i; - u8 fromType = GetLastUsedWarpMapType(); - u8 toType = GetCurrentMapType(); + enum MapType fromType = GetLastUsedWarpMapType(); + enum MapType toType = GetCurrentMapType(); for (i = 0; sTransitionTypes[i].fromType; i++) { diff --git a/src/fldeff_rocksmash.c b/src/fldeff_rocksmash.c index 39f64adb877b..61ae0639e5fd 100644 --- a/src/fldeff_rocksmash.c +++ b/src/fldeff_rocksmash.c @@ -16,7 +16,6 @@ #include "constants/event_object_movement.h" #include "constants/event_objects.h" #include "constants/field_effects.h" -#include "constants/map_types.h" #include "constants/songs.h" static void Task_DoFieldMove_Init(u8 taskId); diff --git a/src/frontier_util.c b/src/frontier_util.c index 30c22d4442bc..7d2dab818c37 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -2459,7 +2459,7 @@ u8 GetFrontierBrainTrainerPicIndex(void) return GetTrainerPicFromId(gFrontierBrainInfo[facility].trainerId); } -u8 GetFrontierBrainTrainerClass(void) +enum TrainerClassID GetFrontierBrainTrainerClass(void) { s32 facility; diff --git a/src/item_use.c b/src/item_use.c index 64db57a16d06..09eceaf6e7aa 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -44,7 +44,6 @@ #include "constants/item_effects.h" #include "constants/items.h" #include "constants/songs.h" -#include "constants/map_types.h" static void SetUpItemUseCallback(u8); static void FieldCB_UseItemOnField(void); @@ -1472,7 +1471,7 @@ static bool32 IsValidLocationForVsSeeker(void) { u16 mapGroup = gSaveBlock1Ptr->location.mapGroup; u16 mapNum = gSaveBlock1Ptr->location.mapNum; - u16 mapType = gMapHeader.mapType; + enum MapType mapType = gMapHeader.mapType; typedef struct { u16 mapGroup; diff --git a/src/overworld.c b/src/overworld.c index 05c04d0fbadd..2a717b758611 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -67,7 +67,6 @@ #include "frontier_util.h" #include "constants/abilities.h" #include "constants/layouts.h" -#include "constants/map_types.h" #include "constants/region_map_sections.h" #include "constants/songs.h" #include "constants/trainer_hill.h" @@ -173,8 +172,8 @@ static void SetKeyInterceptCallback(u16 (*func)(u32)); static void SetFieldVBlankCallback(void); static void FieldClearVBlankHBlankCallbacks(void); static void TransitionMapMusic(void); -static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *, u16, u8); -static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *, u8, u16, u8); +static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 metatileBehavior, enum MapType mapType); +static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStruct, u8 transitionFlags, u16 metatileBehavior, enum MapType mapType); static u16 GetCenterScreenMetatileBehavior(void); static void *sUnusedOverworldCallback; @@ -719,8 +718,8 @@ void SetLastHealLocationWarp(u8 healLocationId) void UpdateEscapeWarp(s16 x, s16 y) { - u8 currMapType = GetCurrentMapType(); - u8 destMapType = GetMapTypeByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum); + enum MapType currMapType = GetCurrentMapType(); + enum MapType destMapType = GetMapTypeByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum); if (IsMapTypeOutdoors(currMapType) && IsMapTypeOutdoors(destMapType) != TRUE) SetEscapeWarp(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, x - MAP_OFFSET, y - MAP_OFFSET + 1); } @@ -965,7 +964,7 @@ void StoreInitialPlayerAvatarState(void) static struct InitialPlayerAvatarState *GetInitialPlayerAvatarState(void) { struct InitialPlayerAvatarState playerStruct; - u8 mapType = GetCurrentMapType(); + enum MapType mapType = GetCurrentMapType(); u16 metatileBehavior = GetCenterScreenMetatileBehavior(); u8 transitionFlags = GetAdjustedInitialTransitionFlags(&sInitialPlayerAvatarState, metatileBehavior, mapType); playerStruct.transitionFlags = transitionFlags; @@ -974,7 +973,7 @@ static struct InitialPlayerAvatarState *GetInitialPlayerAvatarState(void) return &sInitialPlayerAvatarState; } -static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 metatileBehavior, u8 mapType) +static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 metatileBehavior, enum MapType mapType) { if (mapType != MAP_TYPE_INDOOR && FlagGet(FLAG_SYS_CRUISE_MODE)) return PLAYER_AVATAR_FLAG_ON_FOOT; @@ -992,7 +991,7 @@ static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *pla return PLAYER_AVATAR_FLAG_ACRO_BIKE; } -static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStruct, u8 transitionFlags, u16 metatileBehavior, u8 mapType) +static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStruct, u8 transitionFlags, u16 metatileBehavior, enum MapType mapType) { if (FlagGet(FLAG_SYS_CRUISE_MODE) && mapType == MAP_TYPE_OCEAN_ROUTE) return DIR_EAST; @@ -1401,27 +1400,27 @@ static void ChooseAmbientCrySpecies(void) } } -u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum) +enum MapType GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum) { return Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum)->mapType; } -u8 GetMapTypeByWarpData(struct WarpData *warp) +enum MapType GetMapTypeByWarpData(struct WarpData *warp) { return GetMapTypeByGroupAndId(warp->mapGroup, warp->mapNum); } -u8 GetCurrentMapType(void) +enum MapType GetCurrentMapType(void) { return GetMapTypeByWarpData(&gSaveBlock1Ptr->location); } -u8 GetLastUsedWarpMapType(void) +enum MapType GetLastUsedWarpMapType(void) { return GetMapTypeByWarpData(&gLastUsedWarp); } -bool8 IsMapTypeOutdoors(u8 mapType) +bool8 IsMapTypeOutdoors(enum MapType mapType) { if (mapType == MAP_TYPE_ROUTE || mapType == MAP_TYPE_TOWN @@ -1433,7 +1432,7 @@ bool8 IsMapTypeOutdoors(u8 mapType) return FALSE; } -bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType) +bool8 Overworld_MapTypeAllowsTeleportAndFly(enum MapType mapType) { if (mapType == MAP_TYPE_ROUTE || mapType == MAP_TYPE_TOWN @@ -1444,7 +1443,7 @@ bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType) return FALSE; } -bool8 IsMapTypeIndoors(u8 mapType) +bool8 IsMapTypeIndoors(enum MapType mapType) { if (mapType == MAP_TYPE_INDOOR || mapType == MAP_TYPE_SECRET_BASE) @@ -1463,7 +1462,7 @@ u8 GetCurrentRegionMapSectionId(void) return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum)->regionMapSectionId; } -u8 GetCurrentMapBattleScene(void) +enum MapBattleScene GetCurrentMapBattleScene(void) { return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum)->battleType; } diff --git a/src/pokemon.c b/src/pokemon.c index 748a21d3f8bd..e9acd576ecb3 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1688,7 +1688,7 @@ u16 GetUnionRoomTrainerPic(void) return FacilityClassToPicIndex(gUnionRoomFacilityClasses[arrId]); } -u16 GetUnionRoomTrainerClass(void) +enum TrainerClassID GetUnionRoomTrainerClass(void) { u8 linkId; u32 arrId; @@ -3519,7 +3519,7 @@ u8 GetSecretBaseTrainerPicIndex(void) return gFacilityClassToPicIndex[facilityClass]; } -u8 GetSecretBaseTrainerClass(void) +enum TrainerClassID GetSecretBaseTrainerClass(void) { u8 facilityClass = sSecretBaseFacilityClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % NUM_SECRET_BASE_CLASSES]; return gFacilityClassToTrainerClass[facilityClass]; @@ -5181,7 +5181,7 @@ void AdjustFriendship(struct Pokemon *mon, u8 event) { u8 friendshipLevel = 0; s16 friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0); - u32 opponentTrainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + enum TrainerClassID opponentTrainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); if (friendship > 99) friendshipLevel++; @@ -5745,7 +5745,7 @@ u16 GetBattleBGM(void) } else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - u8 trainerClass; + enum TrainerClassID trainerClass; if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) trainerClass = GetFrontierOpponentClass(gTrainerBattleOpponent_A); diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 6bd32ee514b8..e660ad5f25d7 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -468,7 +468,7 @@ static void SetPosForRotation(struct Sprite *sprite, u16 index, s16 amplitudeX, sprite->y2 = yAdder + amplitudeY; } -u8 GetSpeciesBackAnimSet(u16 species) +enum BackAnim GetSpeciesBackAnimSet(u16 species) { if (gSpeciesInfo[species].backAnimId != BACK_ANIM_NONE) return gSpeciesInfo[species].backAnimId - 1; @@ -527,7 +527,7 @@ static void Task_HandleMonAnimation(u8 taskId) } } -void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId) +void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, enum AnimFunctionIDs frontAnimId) { u8 taskId = CreateTask(Task_HandleMonAnimation, 128); gTasks[taskId].tPtrHi = (u32)(sprite) >> 16; @@ -535,16 +535,17 @@ void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId) gTasks[taskId].tAnimId = frontAnimId; } -void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId) +void StartMonSummaryAnimation(struct Sprite *sprite, enum AnimFunctionIDs frontAnimId) { // sDontFlip is expected to still be FALSE here, not explicitly cleared sIsSummaryAnim = TRUE; sprite->callback = sMonAnimFunctions[frontAnimId]; } -void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) +void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, enum BackAnim backAnimSet) { - u8 nature, taskId, animId, battlerId; + u8 nature, taskId, battlerId; + enum AnimFunctionIDs animId; taskId = CreateTask(Task_HandleMonAnimation, 128); gTasks[taskId].tPtrHi = (u32)(sprite) >> 16; diff --git a/src/pokemon_sprite_visualizer.c b/src/pokemon_sprite_visualizer.c index c6bb39faaff8..4323e833a0ce 100644 --- a/src/pokemon_sprite_visualizer.c +++ b/src/pokemon_sprite_visualizer.c @@ -922,7 +922,7 @@ static void LoadAndCreateEnemyShadowSpriteCustom(struct PokemonSpriteVisualizer } //Battle background functions -static void LoadBattleBg(u8 battleBgType, u8 battleTerrain) +static void LoadBattleBg(u8 battleBgType, enum BattleTerrain battleTerrain) { switch (battleBgType) { diff --git a/src/pokenav_match_call_list.c b/src/pokenav_match_call_list.c index 9a51c092e9f0..a4f186f443ba 100755 --- a/src/pokenav_match_call_list.c +++ b/src/pokenav_match_call_list.c @@ -410,7 +410,7 @@ void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8 { int index = GetTrainerIdxByRematchIdx(matchCallEntry->headerId); const struct Trainer *trainer = GetTrainerStructFromId(index); - int class = trainer->trainerClass; + enum TrainerClassID class = trainer->trainerClass; className = gTrainerClasses[class].name; trainerName = trainer->trainerName; } diff --git a/src/region_map.c b/src/region_map.c index aba1162f5b91..351240c825fb 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -24,7 +24,6 @@ #include "heal_location.h" #include "constants/field_specials.h" #include "constants/heal_locations.h" -#include "constants/map_types.h" #include "constants/rgb.h" #include "constants/weather.h" diff --git a/src/scrcmd.c b/src/scrcmd.c index cf65ad270d77..b2bb99cf996d 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2939,7 +2939,7 @@ static void CloseBrailleWindow(void) bool8 ScrCmd_buffertrainerclassname(struct ScriptContext *ctx) { u8 stringVarIndex = ScriptReadByte(ctx); - u16 trainerClassId = VarGet(ScriptReadHalfword(ctx)); + enum TrainerClassID trainerClassId = VarGet(ScriptReadHalfword(ctx)); Script_RequestEffects(SCREFF_V1); @@ -2950,7 +2950,7 @@ bool8 ScrCmd_buffertrainerclassname(struct ScriptContext *ctx) bool8 ScrCmd_buffertrainername(struct ScriptContext *ctx) { u8 stringVarIndex = ScriptReadByte(ctx); - u16 trainerClassId = VarGet(ScriptReadHalfword(ctx)); + enum TrainerClassID trainerClassId = VarGet(ScriptReadHalfword(ctx)); Script_RequestEffects(SCREFF_V1); diff --git a/src/secret_base.c b/src/secret_base.c index 7e0c1ae10738..3cb81af46979 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -39,7 +39,6 @@ #include "constants/event_objects.h" #include "constants/field_specials.h" #include "constants/items.h" -#include "constants/map_types.h" #include "constants/metatile_behaviors.h" #include "constants/metatile_labels.h" #include "constants/moves.h" diff --git a/src/trainer_hill.c b/src/trainer_hill.c index dd8ae78aa774..f443217bcd42 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -309,7 +309,7 @@ static u8 GetFloorId(void) return gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F; } -u8 GetTrainerHillOpponentClass(u16 trainerId) +enum TrainerClassID GetTrainerHillOpponentClass(u16 trainerId) { u8 id = trainerId - 1;