summaryrefslogtreecommitdiff
path: root/src/status_checks_1.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2022-02-27 08:43:59 -0800
committerGitHub <noreply@github.com>2022-02-27 08:43:59 -0800
commitea1aa9c0c5c3a4167912d1078fffdd5e69cbbe98 (patch)
tree1d3f29615f1683fae77ade7d8713e7bfe5a11c26 /src/status_checks_1.c
parent0dd38993f6a4383d6d5743fd0ae0abc01210ae25 (diff)
parenta5296a2f994a0f8e4421c4afd6bac1cedcfb72be (diff)
Merge pull request #97 from AnonymousRandomPerson/master
More attack AI decomp
Diffstat (limited to 'src/status_checks_1.c')
-rw-r--r--src/status_checks_1.c16
1 files changed, 16 insertions, 0 deletions
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;
+}