diff options
author | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-04 23:13:01 -0500 |
---|---|---|
committer | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-04 23:13:01 -0500 |
commit | f728e7e90ebd50521dbc32f7f2b2be5858d91477 (patch) | |
tree | ddf974706a076365616d3aa7503c5ffa63a0e1b9 /src/dungeon_ai.c | |
parent | 1d64db5214b455bbd6f50ad6369ec04420e03984 (diff) |
Decomped DecideAttack()
Diffstat (limited to 'src/dungeon_ai.c')
-rw-r--r-- | src/dungeon_ai.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 5776bfa..263ef16 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -7,13 +7,13 @@ #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 +43,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 +52,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; |