diff options
author | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-28 21:17:15 -0500 |
---|---|---|
committer | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-03-10 22:32:17 -0500 |
commit | 70ce2c1642376305f26ad0eaebad26d7d3fe9ac9 (patch) | |
tree | 1862acd3b246edb9e5b3491dbe42a04beaf8880f /src | |
parent | 07285e7e82db008b1f322879f3b22c8eb437a8de (diff) |
Decomped LastUsedMoveOutOfPP()
Diffstat (limited to 'src')
-rw-r--r-- | src/status_checker.c | 37 | ||||
-rw-r--r-- | src/status_checker_1.c | 21 |
2 files changed, 33 insertions, 25 deletions
diff --git a/src/status_checker.c b/src/status_checker.c index e835acf..5dfe0f0 100644 --- a/src/status_checker.c +++ b/src/status_checker.c @@ -13,7 +13,6 @@ #include "map.h" #include "moves.h" #include "number_util.h" -#include "status_checker_1.h" #include "status_checks_1.h" #include "tile_types.h" #include "trap.h" @@ -99,8 +98,6 @@ const u8 gDungeonCamouflageTypes[76] = { TYPE_ROCK }; -extern bool8 LastMoveOutOfPP(struct PokemonMove *moves); - bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct PokemonMove *move) { struct DungeonEntityData *pokemonData = pokemon->entityData; @@ -639,7 +636,7 @@ bool8 CanUseOnTargetWithStatusChecker(struct DungeonEntity *user, struct Dungeon } break; case MOVE_SPITE: - if (LastMoveOutOfPP(targetData->moves)) + if (LastUsedMoveOutOfPP(targetData->moves)) { return FALSE; } @@ -919,3 +916,35 @@ bool8 HasDisabledMove(struct PokemonMove *moves) } return FALSE; } + +bool8 LastUsedMoveOutOfPP(struct PokemonMove *moves) +{ + s32 i; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i].moveFlags & MOVE_FLAG_EXISTS && + moves[i].moveFlags & MOVE_FLAG_LAST_USED && + moves[i].PP == 0) + { + return TRUE; + } + } + return FALSE; +} + +bool8 HasLastUsedMove(struct PokemonMove *moves) +{ + s32 i; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags & MOVE_FLAG_LAST_USED) + { + return TRUE; + } + } + if (moves[STRUGGLE_MOVE_INDEX].moveFlags & MOVE_FLAG_LAST_USED) + { + return TRUE; + } + return FALSE; +} diff --git a/src/status_checker_1.c b/src/status_checker_1.c deleted file mode 100644 index ebe6db6..0000000 --- a/src/status_checker_1.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "global.h" -#include "status_checker_1.h" - -#include "dungeon_entity.h" - -bool8 HasLastUsedMove(struct PokemonMove *moves) -{ - s32 i; - for (i = 0; i < MAX_MON_MOVES; i++) - { - if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags & MOVE_FLAG_LAST_USED) - { - return TRUE; - } - } - if (moves[STRUGGLE_MOVE_INDEX].moveFlags & MOVE_FLAG_LAST_USED) - { - return TRUE; - } - return FALSE; -} |