From dd128d78c6da20395edcbe8dab8a224aa6679146 Mon Sep 17 00:00:00 2001 From: Cheng Hann Gan Date: Thu, 28 Oct 2021 12:01:07 -0400 Subject: 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() --- src/dungeon_capabilities.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/dungeon_capabilities.c (limited to 'src/dungeon_capabilities.c') 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; +} + -- cgit v1.2.3