diff options
author | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-20 22:51:36 -0500 |
---|---|---|
committer | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-20 22:51:36 -0500 |
commit | ec6abc684ebc571fc186ca61f1410770ea17fa14 (patch) | |
tree | 6159c9e9bf9d2d39288cbd3931578a0e76d64e1e /src | |
parent | 7c714bd14e68ee9528512108e8b2cbd7f9da46c7 (diff) |
Decomped HasQuarterHPOrLess
Diffstat (limited to 'src')
-rw-r--r-- | src/status_checker.c | 1 | ||||
-rw-r--r-- | src/status_checks_1.c | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/status_checker.c b/src/status_checker.c index 6f521f1..e0bf251 100644 --- a/src/status_checker.c +++ b/src/status_checker.c @@ -95,7 +95,6 @@ const u8 gDungeonCamouflageTypes[76] = { TYPE_ROCK }; -extern bool8 HasQuarterHPOrLess(struct DungeonEntity*); extern bool8 IsTileGround(struct MapTile*); extern bool8 CanLayTrap(struct Position*); diff --git a/src/status_checks_1.c b/src/status_checks_1.c index 9d0bfe8..c49e127 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -53,3 +53,19 @@ bool8 IsSleeping(struct DungeonEntity *pokemon) } return TRUE; } + +bool8 HasQuarterHPOrLess(struct DungeonEntity* pokemon) +{ + struct DungeonEntityData *pokemonData = pokemon->entityData; + struct DungeonEntityData *pokemonData2 = pokemon->entityData; + s32 maxHP = pokemonData->maxHP; + if (maxHP < 0) + { + maxHP += 3; + } + if (pokemonData2->HP <= maxHP >> 2) + { + return TRUE; + } + return FALSE; +} |