diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2021-12-01 16:33:06 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 14:33:06 -0800 |
commit | 4fc272fea6bc7332fae031ebeb12362cff1c35de (patch) | |
tree | 88092c6da3a6bb741caceab54f5372aee4ad5bae /src/dungeon_ai.c | |
parent | fd8720b75c56ef3f641e6c5abf6c446929c824b9 (diff) |
No wifi + 2 days on train = more decomp (#80)
* No wifi + 2 days on train = more decomp
* layin some more
* one func, one file
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; +} |