diff options
author | Cheng Hann Gan <chenghanngan.us@gmail.com> | 2021-10-28 12:01:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 09:01:07 -0700 |
commit | dd128d78c6da20395edcbe8dab8a224aa6679146 (patch) | |
tree | deec8715283a26754ec64e7dabdeca25faf7e361 /src/dungeon_capabilities.c | |
parent | c98fb2c11272680a20b9cfb9efe2ce482d3779dd (diff) |
Decomped more dungeon AI (#67)
* Decomped IsMovingClient()
* Fixed typos in boss dialogue
* Fixed spelling of Pelipper
* Decomped CannotUseItems
* Decomped ShouldAvoidEnemies()
* Decomped HasAbility()
* Decomped HasTactic()
* Decomped CannotMove
* Decomped CannotAct() and IsCharging()
Diffstat (limited to 'src/dungeon_capabilities.c')
-rw-r--r-- | src/dungeon_capabilities.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c new file mode 100644 index 0000000..7a62149 --- /dev/null +++ b/src/dungeon_capabilities.c @@ -0,0 +1,25 @@ +#include "global.h" +#include "dungeon_capabilities.h" + +#include "constants/status.h" + +bool8 CannotMove(struct DungeonEntity *pokemon, bool8 checkBlinker) +{ + struct DungeonEntityData *pokemonData = pokemon->entityData; + if ((checkBlinker && pokemonData->eyesightStatus == EYESIGHT_STATUS_BLINKER) + || pokemonData->sleepStatus == SLEEP_STATUS_SLEEP + || pokemonData->sleepStatus == SLEEP_STATUS_NAPPING + || pokemonData->sleepStatus == SLEEP_STATUS_NIGHTMARE + || pokemonData->volatileStatus == VOLATILE_STATUS_PAUSED + || pokemonData->volatileStatus == VOLATILE_STATUS_INFATUATED + || pokemonData->immobilizeStatus == IMMOBILIZE_STATUS_PETRIFIED) + { + return TRUE; + } + if (pokemonData->terrifiedTurnsLeft != 0) + { + return TRUE; + } + return FALSE; +} + |