summaryrefslogtreecommitdiff
path: root/src/dungeon_capabilities.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dungeon_capabilities.c')
-rw-r--r--src/dungeon_capabilities.c25
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;
+}
+