diff options
author | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-21 15:59:34 -0500 |
---|---|---|
committer | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-21 17:03:34 -0500 |
commit | 598a588589cb581b269f2e46373c657ec897a3a3 (patch) | |
tree | 7a7cc3f2b8fc689e764b2a09f20233897f8ada9c /src/dungeon_ai.c | |
parent | 33d2d6175067e75cd222b8f05234221ec2d2b82b (diff) |
Decomped CanAttackInFront()
Diffstat (limited to 'src/dungeon_ai.c')
-rw-r--r-- | src/dungeon_ai.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c deleted file mode 100644 index b2e3b2e..0000000 --- a/src/dungeon_ai.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "global.h" -#include "dungeon_ai.h" - -#include "constants/ability.h" -#include "constants/tactic.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_util.h" - -extern void CheckRunAwayVisualFlag(struct DungeonEntity *, bool8 showRunAwayEffect); - -bool8 ShouldAvoidFirstHit(struct DungeonEntity *pokemon, bool8 forceAvoid) -{ - if (!HasTactic(pokemon, TACTIC_AVOID_THE_FIRST_HIT)) - return FALSE; - if (!forceAvoid) - return FALSE; - return TRUE; -} - -bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon) -{ - if (!EntityExists(pokemon)) - { - return FALSE; - } - else - { - struct DungeonEntityData *pokemonData = pokemon->entityData; - if (pokemonData->terrifiedTurnsLeft != 0) - { - return TRUE; - } - if (pokemonData->isLeader) - { - return FALSE; - } - if (HasAbility(pokemon, ABILITY_RUN_AWAY)) - { - bool8 runAwayActive = pokemonData->HP < pokemonData->maxHP / 2; - if (runAwayActive) - { - return TRUE; - } - } - if (HasTactic(pokemon, TACTIC_GET_AWAY) || - (HasTactic(pokemon, TACTIC_AVOID_TROUBLE) && pokemonData->HP <= pokemonData->maxHP / 2)) - { - return TRUE; - } - return FALSE; - } -} - -bool8 ShouldAvoidEnemiesAndShowEffect(struct DungeonEntity *pokemon, bool8 showRunAwayEffect) -{ - if (ShouldAvoidEnemies(pokemon)) - { - CheckRunAwayVisualFlag(pokemon, showRunAwayEffect); - return TRUE; - } - return FALSE; -} |