diff options
Diffstat (limited to 'src/dungeon_ai.c')
-rw-r--r-- | src/dungeon_ai.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 6253a64..5776bfa 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -7,6 +7,17 @@ #include "dungeon_pokemon_attributes_1.h" #include "dungeon_util.h" +extern void CheckRunAwayVisualFlag(struct DungeonEntity *, u8 r1); + +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)) @@ -40,3 +51,13 @@ bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon) return FALSE; } } + +bool8 ShouldAvoidEnemies_2(struct DungeonEntity *pokemon, u8 r1) +{ + if(ShouldAvoidEnemies(pokemon)) + { + CheckRunAwayVisualFlag(pokemon, r1); + return TRUE; + } + return FALSE; +} |