diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dungeon_ai_1.c | 2 | ||||
-rw-r--r-- | src/dungeon_pokemon_attributes_1.c | 17 | ||||
-rw-r--r-- | src/pokemon_3.c | 17 |
3 files changed, 19 insertions, 17 deletions
diff --git a/src/dungeon_ai_1.c b/src/dungeon_ai_1.c index 7d45909..1d177c7 100644 --- a/src/dungeon_ai_1.c +++ b/src/dungeon_ai_1.c @@ -3,8 +3,8 @@ #include "constants/status.h" #include "constants/targeting.h" +#include "dungeon_pokemon_attributes_1.h" -extern bool8 CanSeeInvisible(struct DungeonEntity*); extern bool8 gTargetingData[3][2][2][2]; u8 CanTarget(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified) diff --git a/src/dungeon_pokemon_attributes_1.c b/src/dungeon_pokemon_attributes_1.c index d3b8cab..a5d6acf 100644 --- a/src/dungeon_pokemon_attributes_1.c +++ b/src/dungeon_pokemon_attributes_1.c @@ -9,6 +9,7 @@ #include "constants/move_id.h" #include "constants/status.h" #include "constants/tactic.h" +#include "pokemon_3.h" extern s16 gItemMasterMinWildLevel; @@ -26,9 +27,9 @@ extern s32 GetMovePower(struct PokemonMove *move); bool8 CanSeeInvisible(struct DungeonEntity *pokemon) { struct DungeonEntityData *pokemonData = pokemon->entityData; - if(pokemonData->eyesightStatus != EYESIGHT_STATUS_EYEDROPS) + if (pokemonData->eyesightStatus != EYESIGHT_STATUS_EYEDROPS) { - if(!HasItem(pokemon, ITEM_ID_GOGGLE_SPECS)) + if (!HasItem(pokemon, ITEM_ID_GOGGLE_SPECS)) return FALSE; else return TRUE; @@ -63,7 +64,7 @@ void LoadIQSkills(struct DungeonEntity *pokemon) u8 *iVar2; s32 IQSkill; struct DungeonEntityData *pokemonData; - + pokemonData = pokemon->entityData; if (pokemonData->isEnemy) { iVar2 = pokemonData->IQSkillsEnabled; @@ -82,8 +83,8 @@ void LoadIQSkills(struct DungeonEntity *pokemon) pokemonData->IQSkillsEnabled[2] = 0; for(IQSkill = IQ_SKILL_TYPE_ADVANTAGE_MASTER; IQSkill < NUM_IQ_SKILLS; IQSkill++) { - if (HasIQForSkill(pokemonData->IQ,IQSkill) && - IsIQSkillSet(pokemonData->IQSkillsSelected, 1 << IQSkill)) + if (HasIQForSkill(pokemonData->IQ,IQSkill) && + IsIQSkillSet(pokemonData->IQSkillsSelected, 1 << IQSkill)) { SetIQSkill(pokemonData->IQSkillsEnabled,IQSkill); } @@ -95,7 +96,7 @@ bool8 CanSeeTeammate(struct DungeonEntity * pokemon) { struct DungeonEntity *teamMember; s32 memberIdx; - + if (pokemon->entityData->isEnemy) { return FALSE; } @@ -132,13 +133,13 @@ s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMo bool8 ToolboxEnabled(struct DungeonEntityData *pokemon) { if(!IsToolboxEnabled(pokemon->entityID)) - return FALSE; + return FALSE; return TRUE; } static inline bool8 sub_8071A8C_sub(struct DungeonEntityData *pokemonData) { - if(pokemonData->joinLocation == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON || + if(pokemonData->joinLocation == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON || pokemonData->joinLocation == DUNGEON_RESCUE_TEAM_BASE) return TRUE; else diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 743a9dd..9d28f98 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -1,4 +1,6 @@ #include "global.h" +#include "pokemon_3.h" + #include "pokemon.h" #include "random.h" #include "constants/iq_skill.h" @@ -45,7 +47,6 @@ extern s16 gUnknown_810AC66; // 0x8 // 2, 4, 6, 7, 8, 9, 0xA, 0xD, 0xF, 0x11 extern s32 gUnknown_810AC90[10]; -extern bool8 IsIQSkillSet(u8 *, u32); extern void SetIQSkill(u8 *, u32); extern void AddSprite(u16 *, u32, u32, u32); @@ -613,22 +614,22 @@ void SetDefaultIQSkills(u8 *param_1, bool8 enableSelfCurer) SetIQSkill(param_1, IQ_SKILL_COURSE_CHECKER); SetIQSkill(param_1, IQ_SKILL_ITEM_MASTER); - // Flag is usually enabled for Boss fights.. + // Flag is usually enabled for Boss fights. if (enableSelfCurer) { SetIQSkill(param_1, IQ_SKILL_SELF_CURER); } } -bool8 IsIQSkillSet(u8 *param_1, u32 param_2) +bool8 IsIQSkillSet(u8 *IQSkillsEnabled, u32 IQSkill) { - - if ((((param_1[0] & param_2) == 0) && - ((param_1[1] & param_2 >> 8) == 0)) && - ((param_1[2] & param_2 >> 0x10) == 0)) + if (!(IQSkillsEnabled[0] & IQSkill) && + !(IQSkillsEnabled[1] & IQSkill >> 8) && + !(IQSkillsEnabled[2] & IQSkill >> 16)) { return FALSE; } - else { + else + { return TRUE; } } |