diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2022-02-17 21:45:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-17 21:45:57 -0800 |
commit | 3555fb7c945ef5152910a84390ecbd1a38ea585d (patch) | |
tree | 4237c0ab086005ea05539b8de7c10b867eec43db /src/dungeon_ai.c | |
parent | 1d64db5214b455bbd6f50ad6369ec04420e03984 (diff) | |
parent | ece475a4804a64790cfa86dfa0ba577a732adee8 (diff) |
Merge pull request #96 from AnonymousRandomPerson/master
Attack AI decomp
Diffstat (limited to 'src/dungeon_ai.c')
-rw-r--r-- | src/dungeon_ai.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 5776bfa..b2e3b2e 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -4,16 +4,15 @@ #include "constants/ability.h" #include "constants/tactic.h" #include "dungeon_pokemon_attributes.h" -#include "dungeon_pokemon_attributes_1.h" #include "dungeon_util.h" -extern void CheckRunAwayVisualFlag(struct DungeonEntity *, u8 r1); +extern void CheckRunAwayVisualFlag(struct DungeonEntity *, bool8 showRunAwayEffect); bool8 ShouldAvoidFirstHit(struct DungeonEntity *pokemon, bool8 forceAvoid) { - if(!HasTactic(pokemon, TACTIC_AVOID_THE_FIRST_HIT)) + if (!HasTactic(pokemon, TACTIC_AVOID_THE_FIRST_HIT)) return FALSE; - if(!forceAvoid) + if (!forceAvoid) return FALSE; return TRUE; } @@ -43,8 +42,8 @@ bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon) return TRUE; } } - if (HasTactic(pokemon, TACTIC_GET_AWAY) - || (HasTactic(pokemon, TACTIC_AVOID_TROUBLE) && pokemonData->HP <= pokemonData->maxHP / 2)) + if (HasTactic(pokemon, TACTIC_GET_AWAY) || + (HasTactic(pokemon, TACTIC_AVOID_TROUBLE) && pokemonData->HP <= pokemonData->maxHP / 2)) { return TRUE; } @@ -52,11 +51,11 @@ bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon) } } -bool8 ShouldAvoidEnemies_2(struct DungeonEntity *pokemon, u8 r1) +bool8 ShouldAvoidEnemiesAndShowEffect(struct DungeonEntity *pokemon, bool8 showRunAwayEffect) { - if(ShouldAvoidEnemies(pokemon)) + if (ShouldAvoidEnemies(pokemon)) { - CheckRunAwayVisualFlag(pokemon, r1); + CheckRunAwayVisualFlag(pokemon, showRunAwayEffect); return TRUE; } return FALSE; |