diff --git a/include/dungeon.h b/include/dungeon.h index b29f6cec..5eff8b43 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -1,5 +1,5 @@ -#ifndef HEADERS_TYPES_DUNGEON_MODE_DUNGEON_H_ -#define HEADERS_TYPES_DUNGEON_MODE_DUNGEON_H_ +#ifndef PMDSKY_DUNGEON_H +#define PMDSKY_DUNGEON_H #include "dungeon_mode.h" #include "enums.h" @@ -1762,5 +1762,4 @@ struct dungeon { u8 field_0x2cb13; }; - -#endif +#endif // PMDSKY_DUNGEON_H diff --git a/include/dungeon_mode.h b/include/dungeon_mode.h index b86a6df0..0b0d9574 100644 --- a/include/dungeon_mode.h +++ b/include/dungeon_mode.h @@ -2,9 +2,9 @@ #define PMDSKY_DUNGEON_MODE_H #include "direction.h" -#include "dungeon_mode_common.h" #include "enums.h" #include "item.h" +#include "move.h" #include "graphics.h" #include "util.h" diff --git a/include/enums.h b/include/enums.h index 76e50d78..3cbac546 100644 --- a/include/enums.h +++ b/include/enums.h @@ -2900,17 +2900,6 @@ enum movement_flag MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY = 1 << 15, // Set if the Pokémon is petrified and the leader cures them by swapping places. }; -enum move_flag -{ - MOVE_FLAG_EXISTS = 1 << 0, - MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN = 1 << 1, // This move is linked with the previous move in the Pokémon's moveset. - MOVE_FLAG_ENABLED_FOR_AI = 1 << 2, // Enabled for the AI to use. - MOVE_FLAG_SET = 1 << 3, // This move can be triggered by pressing L+A instead of having to go to the move menu. - MOVE_FLAG_LAST_USED = 1 << 4, // The most recent move used by the Pokémon. - MOVE_FLAG_DISABLED = 1 << 5, // Disabled by an effect like Taunt. - MOVE_FLAG_INTERNAL_MARKER = 1 << 7 // Possibly some kind of flag used internally to mark a move and find it again -}; - // Mobility types for monsters enum mobility_type { MOBILITY_NORMAL = 0, diff --git a/include/dungeon_mode_common.h b/include/move.h similarity index 61% rename from include/dungeon_mode_common.h rename to include/move.h index 5742009e..9c9cc830 100644 --- a/include/dungeon_mode_common.h +++ b/include/move.h @@ -1,17 +1,28 @@ -#ifndef HEADERS_TYPES_DUNGEON_MODE_COMMON_H_ -#define HEADERS_TYPES_DUNGEON_MODE_COMMON_H_ +#ifndef PMDSKY_MOVE_H +#define PMDSKY_MOVE_H #include "enums.h" -enum move_flags_2 +enum move_flag { - MOVE_FLAGS_SEALED = 1 << 0, - MOVE_FLAGS_CONSUME_PP = 1 << 2, - MOVE_FLAGS_CONSUME_2_PP = 1 << 3, - MOVE_FLAGS_CONSUME_4_PP = 1 << 5, - MOVE_FLAGS_MULTITALENT_PP_BOOST = 1 << 8, - MOVE_FLAGS_EXCLUSIVE_ITEM_PP_BOOST = 1 << 9, - MOVE_FLAGS_UNKNOWN_PP_BOOST = 1 << 10, + MOVE_FLAG_EXISTS = 1 << 0, + MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN = 1 << 1, // This move is linked with the previous move in the Pokémon's moveset. + MOVE_FLAG_ENABLED_FOR_AI = 1 << 2, // Enabled for the AI to use. + MOVE_FLAG_SET = 1 << 3, // This move can be triggered by pressing L+A instead of having to go to the move menu. + MOVE_FLAG_LAST_USED = 1 << 4, // The most recent move used by the Pokémon. + MOVE_FLAG_DISABLED = 1 << 5, // Disabled by an effect like Taunt. + MOVE_FLAG_INTERNAL_MARKER = 1 << 7 // Possibly some kind of flag used internally to mark a move and find it again +}; + +enum move_flag_2 +{ + MOVE_FLAG_SEALED = 1 << 0, + MOVE_FLAG_CONSUME_PP = 1 << 2, + MOVE_FLAG_CONSUME_2_PP = 1 << 3, + MOVE_FLAG_CONSUME_4_PP = 1 << 5, + MOVE_FLAG_MULTITALENT_PP_BOOST = 1 << 8, + MOVE_FLAG_EXCLUSIVE_ITEM_PP_BOOST = 1 << 9, + MOVE_FLAG_UNKNOWN_PP_BOOST = 1 << 10, }; // Monster move info @@ -49,4 +60,4 @@ struct move { u8 ginseng; // 0x7: Ginseng boost }; -#endif +#endif // PMDSKY_MOVE_H diff --git a/include/moves.h b/include/moves.h index 9b03e65d..09163f4b 100644 --- a/include/moves.h +++ b/include/moves.h @@ -1,7 +1,7 @@ #ifndef PMDSKY_MOVES_H #define PMDSKY_MOVES_H -#include "dungeon_mode_common.h" +#include "move.h" // Gets the maximum PP for a given move. // return: max PP for the given move, capped at 99 diff --git a/include/overlay_29_0231E9F0.h b/include/overlay_29_0231E9F0.h index 098d7811..90f18103 100644 --- a/include/overlay_29_0231E9F0.h +++ b/include/overlay_29_0231E9F0.h @@ -1,7 +1,7 @@ #ifndef PMDSKY_OVERLAY_29_0231E9F0_H #define PMDSKY_OVERLAY_29_0231E9F0_H -#include "dungeon_mode_common.h" +#include "move.h" // Gets the maximum PP for a given move. A wrapper around the function in the ARM 9 binary. // return: max PP for the given move, capped at 99 diff --git a/include/overlay_29_0232E250.h b/include/overlay_29_0232E250.h index 35c8e17c..691948c5 100644 --- a/include/overlay_29_0232E250.h +++ b/include/overlay_29_0232E250.h @@ -2,7 +2,7 @@ #define PMDSKY_OVERLAY_29_0232E250_H #include "dungeon_mode.h" -#include "dungeon_mode_common.h" +#include "move.h" #include "item.h" // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). diff --git a/src/moves.c b/src/moves.c index ef17437f..2e4d39d1 100644 --- a/src/moves.c +++ b/src/moves.c @@ -9,16 +9,15 @@ extern s16 UNKNOWN_PP_BOOST_AMOUNT; u32 GetMaxPp(struct move *move) { - struct move_data *moves = DUNGEON_MOVE_TABLES.moves->moves; - s16 pp = moves[move->id].pp; + s16 pp = DUNGEON_MOVE_TABLES.moves->moves[move->id].pp; - if (move->flags2 & MOVE_FLAGS_MULTITALENT_PP_BOOST) + if (move->flags2 & MOVE_FLAG_MULTITALENT_PP_BOOST) pp += MULTITALENT_PP_BOOST_AMOUNT; - if (move->flags2 & MOVE_FLAGS_EXCLUSIVE_ITEM_PP_BOOST) + if (move->flags2 & MOVE_FLAG_EXCLUSIVE_ITEM_PP_BOOST) pp += EXCLUSIVE_ITEM_PP_BOOST_AMOUNT; - if (move->flags2 & MOVE_FLAGS_UNKNOWN_PP_BOOST) + if (move->flags2 & MOVE_FLAG_UNKNOWN_PP_BOOST) pp += UNKNOWN_PP_BOOST_AMOUNT; if (pp > 99)