summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-02-13 23:13:47 -0500
committerAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-02-13 23:15:33 -0500
commit2a2a0805b481b8425b4d1047d868fb1159993e6c (patch)
treeaacd438bd14b32c816c54a564785fd9716e70fae
parent3bbb6035e746cdb83b128b1d6153436756cb3be0 (diff)
Decomped HasType()
-rw-r--r--asm/code_8071858.s37
-rw-r--r--include/dungeon_pokemon_attributes.h16
-rw-r--r--include/dungeon_pokemon_attributes_1.h21
-rw-r--r--include/moves.h2
-rw-r--r--include/pokemon_3.h2
-rwxr-xr-xld_script.txt4
-rw-r--r--src/code_8041AD0.c9
-rw-r--r--src/code_8057824.c2
-rw-r--r--src/dungeon_ai.c1
-rw-r--r--src/dungeon_ai_1.c2
-rw-r--r--src/dungeon_ai_attack.c1
-rw-r--r--src/dungeon_ai_attack_1.c2
-rw-r--r--src/dungeon_ai_item_weight.c2
-rw-r--r--src/dungeon_ai_items.c2
-rw-r--r--src/dungeon_ai_movement.c2
-rw-r--r--src/dungeon_capabilities_1.c2
-rw-r--r--src/dungeon_pokemon_attributes.c171
-rw-r--r--src/dungeon_pokemon_attributes_1.c161
-rw-r--r--src/dungeon_visibility.c2
-rw-r--r--src/items.c1
-rw-r--r--src/pokemon_3.c1
-rw-r--r--src/targeting_flags.c3
22 files changed, 204 insertions, 242 deletions
diff --git a/asm/code_8071858.s b/asm/code_8071858.s
deleted file mode 100644
index 9fc337a..0000000
--- a/asm/code_8071858.s
+++ /dev/null
@@ -1,37 +0,0 @@
- #include "asm/constants/gba_constants.inc"
- #include "asm/macros.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start HasType
-HasType:
- push {lr}
- lsls r1, 24
- lsrs r1, 24
- adds r3, r1, 0
- ldr r0, [r0, 0x70]
- adds r2, r0, 0
- cmp r1, 0
- beq _0807187A
- adds r0, 0x5C
- ldrb r0, [r0]
- cmp r0, r1
- beq _0807187E
- adds r0, r2, 0
- adds r0, 0x5D
- ldrb r0, [r0]
- cmp r0, r3
- beq _0807187E
-_0807187A:
- movs r0, 0
- b _08071880
-_0807187E:
- movs r0, 0x1
-_08071880:
- pop {r1}
- bx r1
- thumb_func_end HasType
-
- .align 2, 0
diff --git a/include/dungeon_pokemon_attributes.h b/include/dungeon_pokemon_attributes.h
index 941c966..40b13ee 100644
--- a/include/dungeon_pokemon_attributes.h
+++ b/include/dungeon_pokemon_attributes.h
@@ -5,5 +5,21 @@
// 0x71824
bool8 HasAbility(struct DungeonEntity *pokemon, u8 ability);
+// 0x71858
+bool8 HasType(struct DungeonEntity *pokemon, u8 type);
+// 0x71884
+bool8 CanSeeInvisible(struct DungeonEntity *pokemon);
+// 0x718AC
+bool8 HasTactic(struct DungeonEntity *pokemon, u8 tactic);
+// 0x718D8
+bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill);
+
+void LoadIQSkills(struct DungeonEntity *pokemon);
+bool8 CanSeeTeammate(struct DungeonEntity * pokemon);
+u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
+
+// 0x71A44
+s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
+bool8 ToolboxEnabled(struct DungeonEntityData *pokemon);
#endif
diff --git a/include/dungeon_pokemon_attributes_1.h b/include/dungeon_pokemon_attributes_1.h
deleted file mode 100644
index c81c4b9..0000000
--- a/include/dungeon_pokemon_attributes_1.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef GUARD_DUNGEON_POKEMON_ATTRIBUTES_1_H
-#define GUARD_DUNGEON_POKEMON_ATTRIBUTES_1_H
-
-#include "dungeon_entity.h"
-
-// 0x71884
-bool8 CanSeeInvisible(struct DungeonEntity *pokemon);
-// 0x718AC
-bool8 HasTactic(struct DungeonEntity *pokemon, u8 tactic);
-// 0x718D8
-bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill);
-
-void LoadIQSkills(struct DungeonEntity *pokemon);
-bool8 CanSeeTeammate(struct DungeonEntity * pokemon);
-u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
-
-// 0x71A44
-s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
-bool8 ToolboxEnabled(struct DungeonEntityData *pokemon);
-
-#endif
diff --git a/include/moves.h b/include/moves.h
index dca2ac4..d301b0a 100644
--- a/include/moves.h
+++ b/include/moves.h
@@ -7,8 +7,10 @@
void InitPokemonMove(struct PokemonMove *move, u16 moveID);
// 0x92AE0
s16 GetMoveTargetingFlags(struct PokemonMove *move, u32 isAI);
+u8 GetMoveType(struct PokemonMove *move);
// 0x92B90
u8 GetMoveWeight(struct PokemonMove *move);
+s32 GetMovePower(struct PokemonMove *move);
// 0x92BF4
u32 GetMoveMaxPP(struct PokemonMove *move);
// 0x92C54
diff --git a/include/pokemon_3.h b/include/pokemon_3.h
index 968e2ef..c68da39 100644
--- a/include/pokemon_3.h
+++ b/include/pokemon_3.h
@@ -1,6 +1,8 @@
#ifndef GUARD_POKEMON_3_H
#define GUARD_POKEMON_3_H
+bool8 HasIQForSkill(s32 pokeIQ, u8 IQSkillIndex);
+void SetIQSkill(u8 *param_1, u32 skillIndex);
bool8 IsIQSkillSet(u8 *IQSkillsEnabled, u32 IQSkill);
#endif
diff --git a/ld_script.txt b/ld_script.txt
index 7570ced..1f95d54 100755
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -226,8 +226,6 @@ SECTIONS {
src/dungeon_ai_1.o(.text);
asm/code_807167C.o(.text);
src/dungeon_pokemon_attributes.o(.text);
- asm/code_8071858.o(.text);
- src/dungeon_pokemon_attributes_1.o(.text);
asm/code_80718D8.o(.text);
src/dungeon_ai_items.o(.text);
asm/code_8073CF0.o(.text);
@@ -410,7 +408,7 @@ SECTIONS {
data/data_80F4DB4.o(.rodata);
src/dungeon_ai_attack.o(.rodata);
data/data_80F4E2C.o(.rodata);
- src/dungeon_pokemon_attributes_1.o(.rodata);
+ src/dungeon_pokemon_attributes.o(.rodata);
data/data_80F59C8.o(.rodata);
src/charge_move.o(.rodata);
data/data_8106A4C.o(.rodata);
diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c
index 0091e9a..e1d3a1a 100644
--- a/src/code_8041AD0.c
+++ b/src/code_8041AD0.c
@@ -1,7 +1,9 @@
#include "global.h"
+#include "constants/direction.h"
+#include "constants/type.h"
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
-#include "constants/direction.h"
+#include "dungeon_pokemon_attributes.h"
struct unkStruct_80420E8
{
@@ -16,7 +18,6 @@ extern void sub_804151C(struct DungeonEntity *r0, u32 r1, u8 r2);
extern void sub_80416E0(struct DungeonEntity *r0, u32, u32);
extern u8 sub_8042768(struct DungeonEntity *r0);
extern void sub_806CDD4(struct DungeonEntity *r0, u8, u32);
-extern u8 HasType(struct DungeonEntity *r0, u8);
extern u32 sub_806F62C(u32);
extern void PlaySoundEffect(u32);
extern u8 sub_803F428(struct DungeonEntity *r0);
@@ -343,10 +344,10 @@ void sub_8041DD8(struct DungeonEntity *r0, s16 r1)
u32 temp;
temp = r1;
- if(HasType(r0, 0xE) != 0)
+ if(HasType(r0, TYPE_GHOST) != 0)
sub_804151C(r0, temp, 1);
else
- sub_804151C(r0, 0xE, 1);
+ sub_804151C(r0, TYPE_GHOST, 1);
}
void nullsub_89(void)
diff --git a/src/code_8057824.c b/src/code_8057824.c
index 172f949..d763925 100644
--- a/src/code_8057824.c
+++ b/src/code_8057824.c
@@ -2,6 +2,7 @@
#include "dungeon_global_data.h"
#include "dungeon_entity.h"
#include "constants/move.h"
+#include "moves.h"
extern u32 gUnknown_80FCF74;
extern u32 gUnknown_80FCF80;
@@ -30,7 +31,6 @@ extern void sub_806F370(struct DungeonEntity *r0, struct DungeonEntity *r1, u32,
extern u32 gUnknown_80FD018;
extern s16 sub_8057600(void*, u32);
-extern u32 GetMoveType(void*);
bool32 sub_8057824(struct DungeonEntity *param_1, struct DungeonEntity *param_2)
{
diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c
index 263ef16..b2e3b2e 100644
--- a/src/dungeon_ai.c
+++ b/src/dungeon_ai.c
@@ -4,7 +4,6 @@
#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 *, bool8 showRunAwayEffect);
diff --git a/src/dungeon_ai_1.c b/src/dungeon_ai_1.c
index 4550c83..78c899f 100644
--- a/src/dungeon_ai_1.c
+++ b/src/dungeon_ai_1.c
@@ -3,7 +3,7 @@
#include "constants/status.h"
#include "constants/targeting.h"
-#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_pokemon_attributes.h"
const u8 gTargetingData[3][2][2][2] = {
{
diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c
index f0362ed..6e202b5 100644
--- a/src/dungeon_ai_attack.c
+++ b/src/dungeon_ai_attack.c
@@ -16,7 +16,6 @@
#include "dungeon_global_data.h"
#include "dungeon_map_access.h"
#include "dungeon_pokemon_attributes.h"
-#include "dungeon_pokemon_attributes_1.h"
#include "dungeon_random.h"
#include "dungeon_random_1.h"
#include "dungeon_util.h"
diff --git a/src/dungeon_ai_attack_1.c b/src/dungeon_ai_attack_1.c
index e846b4b..8a186ea 100644
--- a/src/dungeon_ai_attack_1.c
+++ b/src/dungeon_ai_attack_1.c
@@ -4,7 +4,7 @@
#include "constants/iq_skill.h"
#include "dungeon_global_data.h"
#include "dungeon_map_access.h"
-#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange)
diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c
index 829bc2d..0fe019f 100644
--- a/src/dungeon_ai_item_weight.c
+++ b/src/dungeon_ai_item_weight.c
@@ -5,7 +5,7 @@
#include "constants/targeting.h"
#include "dungeon_ai_1.h"
#include "dungeon_map_access.h"
-#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "moves.h"
#include "number_util.h"
diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c
index 5e60708..183d143 100644
--- a/src/dungeon_ai_items.c
+++ b/src/dungeon_ai_items.c
@@ -15,7 +15,7 @@
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
#include "dungeon_map_access.h"
-#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_random_1.h"
#include "dungeon_util.h"
diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c
index d0e5f7d..5fa6d87 100644
--- a/src/dungeon_ai_movement.c
+++ b/src/dungeon_ai_movement.c
@@ -12,7 +12,7 @@
#include "dungeon_ai_items.h"
#include "dungeon_capabilities_1.h"
#include "dungeon_global_data.h"
-#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"
diff --git a/src/dungeon_capabilities_1.c b/src/dungeon_capabilities_1.c
index bbe48bc..e6ec6fa 100644
--- a/src/dungeon_capabilities_1.c
+++ b/src/dungeon_capabilities_1.c
@@ -11,7 +11,7 @@
#include "dungeon_items.h"
#include "dungeon_map_access.h"
#include "dungeon_movement.h"
-#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "map.h"
diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c
index 9f01c2b..bd3a1f6 100644
--- a/src/dungeon_pokemon_attributes.c
+++ b/src/dungeon_pokemon_attributes.c
@@ -1,15 +1,27 @@
#include "global.h"
#include "dungeon_pokemon_attributes.h"
-#include "dungeon_util.h"
#include "constants/ability.h"
+#include "constants/dungeon.h"
+#include "constants/iq_skill.h"
+#include "constants/move_id.h"
#include "constants/status.h"
+#include "constants/tactic.h"
+#include "constants/type.h"
+#include "dungeon_global_data.h"
+#include "dungeon_items.h"
+#include "dungeon_util.h"
+#include "dungeon_visibility.h"
+#include "moves.h"
+#include "pokemon.h"
+#include "pokemon_3.h"
+
+const s16 gItemMasterMinWildLevel[] = {16};
extern u8 gAvailablePokemonNames[];
extern u32 gUnknown_80FC31C;
extern u32 gUnknown_80FCEFC;
extern u32 gUnknown_80FC2FC;
-
extern bool8 sub_805744C(struct DungeonEntity *, struct PokemonMove *, u32);
extern void SetMessageArgument(char[], struct DungeonEntity*, u32);
extern void sub_80522F4(struct DungeonEntity *r1, struct DungeonEntity *r2, u32);
@@ -90,3 +102,158 @@ bool8 HasAbility(struct DungeonEntity *pokemon, u8 ability)
return FALSE;
}
}
+
+bool8 HasType(struct DungeonEntity *pokemon, u8 type)
+{
+ struct DungeonEntityData *pokemonData = pokemonData = pokemon->entityData;
+ if (type == TYPE_NONE)
+ {
+ return FALSE;
+ }
+ if (pokemonData->type1 == type)
+ {
+ return TRUE;
+ }
+ if (pokemonData->type2 == type)
+ {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool8 CanSeeInvisible(struct DungeonEntity *pokemon)
+{
+ struct DungeonEntityData *pokemonData = pokemon->entityData;
+ if (pokemonData->eyesightStatus != EYESIGHT_STATUS_EYEDROPS)
+ {
+ if (!HasItem(pokemon, ITEM_ID_GOGGLE_SPECS))
+ return FALSE;
+ else
+ return TRUE;
+ }
+ else
+ return TRUE;
+}
+
+bool8 HasTactic(struct DungeonEntity *pokemon, u8 tactic)
+{
+ struct DungeonEntityData *pokemonData = pokemon->entityData;
+ if (pokemonData->isLeader)
+ {
+ bool8 isGoTheOtherWay = tactic == TACTIC_GO_THE_OTHER_WAY;
+ return isGoTheOtherWay;
+ }
+ return pokemonData->tactic == tactic;
+}
+
+bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill)
+{
+ return IsIQSkillSet(pokemon->entityData->IQSkillsEnabled, 1 << IQSkill);
+}
+
+bool8 HasIQSkillPair(struct DungeonEntity *pokemon, u8 IQSkill1, u8 IQSkill2)
+{
+ return IsIQSkillSet(pokemon->entityData->IQSkillsEnabled, 1 << IQSkill1 | 1 << IQSkill2);
+}
+
+void LoadIQSkills(struct DungeonEntity *pokemon)
+{
+ u8 *iVar2;
+ s32 IQSkill;
+ struct DungeonEntityData *pokemonData;
+
+ pokemonData = pokemon->entityData;
+ if (pokemonData->isEnemy) {
+ iVar2 = pokemonData->IQSkillsEnabled;
+ SetIQSkill(iVar2, IQ_SKILL_STATUS_CHECKER);
+ SetIQSkill(iVar2, IQ_SKILL_PP_CHECKER);
+ SetIQSkill(iVar2, IQ_SKILL_ITEM_CATCHER);
+ if (pokemonData->isBoss)
+ SetIQSkill(iVar2, IQ_SKILL_SELF_CURER);
+ if (pokemonData->level >= *gItemMasterMinWildLevel)
+ SetIQSkill(iVar2, IQ_SKILL_ITEM_MASTER);
+ pokemonData->tactic = TACTIC_GO_AFTER_FOES;
+ }
+ else {
+ pokemonData->IQSkillsEnabled[0] = 0;
+ pokemonData->IQSkillsEnabled[1] = 0;
+ 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))
+ {
+ SetIQSkill(pokemonData->IQSkillsEnabled,IQSkill);
+ }
+ }
+ }
+}
+
+bool8 CanSeeTeammate(struct DungeonEntity * pokemon)
+{
+ struct DungeonEntity *teamMember;
+ s32 memberIdx;
+
+ if (pokemon->entityData->isEnemy) {
+ return FALSE;
+ }
+ else
+ {
+ for(memberIdx = 0; memberIdx < MAX_TEAM_MEMBERS; memberIdx++)
+ {
+ teamMember = gDungeonGlobalData->teamPokemon[memberIdx];
+ if (EntityExists(pokemon) && (pokemon != teamMember) && (CanSee(pokemon,teamMember)))
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+}
+
+u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove)
+{
+ if (pokeMove->moveID == MOVE_HIDDEN_POWER)
+ return pokemon->entityData->hiddenPowerType;
+ else
+ return GetMoveType(pokeMove);
+}
+
+s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove)
+{
+ if(pokeMove->moveID == MOVE_HIDDEN_POWER)
+ return (pokemon->entityData->hiddenPowerPower + pokeMove->powerBoost);
+ else
+ return (GetMovePower(pokeMove) + pokeMove->powerBoost);
+}
+
+bool8 ToolboxEnabled(struct DungeonEntityData *pokemon)
+{
+ if(!IsToolboxEnabled(pokemon->entityID))
+ return FALSE;
+ return TRUE;
+}
+
+static inline bool8 sub_8071A8C_sub(struct DungeonEntityData *pokemonData)
+{
+ if(pokemonData->joinLocation == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON ||
+ pokemonData->joinLocation == DUNGEON_RESCUE_TEAM_BASE)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+bool8 sub_8071A8C(struct DungeonEntity *pokemon)
+{
+ struct DungeonEntityData *pokemonData;
+ if(EntityExists(pokemon))
+ {
+ pokemonData = pokemon->entityData;
+ if(pokemonData->clientType != CLIENT_TYPE_CLIENT)
+ {
+ if(!sub_8071A8C_sub(pokemonData))
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
diff --git a/src/dungeon_pokemon_attributes_1.c b/src/dungeon_pokemon_attributes_1.c
deleted file mode 100644
index c7d3a13..0000000
--- a/src/dungeon_pokemon_attributes_1.c
+++ /dev/null
@@ -1,161 +0,0 @@
-#include "global.h"
-#include "dungeon_pokemon_attributes_1.h"
-
-#include "constants/dungeon.h"
-#include "constants/iq_skill.h"
-#include "constants/move_id.h"
-#include "constants/status.h"
-#include "constants/tactic.h"
-#include "dungeon_global_data.h"
-#include "dungeon_items.h"
-#include "dungeon_util.h"
-#include "pokemon.h"
-#include "pokemon_3.h"
-
-const s16 gItemMasterMinWildLevel[] = {16};
-
-extern bool8 IsIQSkillSet(u8 *, u32);
-extern void SetIQSkill(u8 *param_1, u32 skillIndex);
-extern bool8 HasIQForSkill(s32 pokeIQ, u8 IQSkillIndex);
-
-extern bool8 CanSee(struct DungeonEntity *, struct DungeonEntity *);
-
-extern u8 GetMoveType(struct PokemonMove *move);
-extern s32 GetMovePower(struct PokemonMove *move);
-
-bool8 CanSeeInvisible(struct DungeonEntity *pokemon)
-{
- struct DungeonEntityData *pokemonData = pokemon->entityData;
- if (pokemonData->eyesightStatus != EYESIGHT_STATUS_EYEDROPS)
- {
- if (!HasItem(pokemon, ITEM_ID_GOGGLE_SPECS))
- return FALSE;
- else
- return TRUE;
- }
- else
- return TRUE;
-}
-
-bool8 HasTactic(struct DungeonEntity *pokemon, u8 tactic)
-{
- struct DungeonEntityData *pokemonData = pokemon->entityData;
- if (pokemonData->isLeader)
- {
- bool8 isGoTheOtherWay = tactic == TACTIC_GO_THE_OTHER_WAY;
- return isGoTheOtherWay;
- }
- return pokemonData->tactic == tactic;
-}
-
-bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill)
-{
- return IsIQSkillSet(pokemon->entityData->IQSkillsEnabled, 1 << IQSkill);
-}
-
-bool8 HasIQSkillPair(struct DungeonEntity *pokemon, u8 IQSkill1, u8 IQSkill2)
-{
- return IsIQSkillSet(pokemon->entityData->IQSkillsEnabled, 1 << IQSkill1 | 1 << IQSkill2);
-}
-
-void LoadIQSkills(struct DungeonEntity *pokemon)
-{
- u8 *iVar2;
- s32 IQSkill;
- struct DungeonEntityData *pokemonData;
-
- pokemonData = pokemon->entityData;
- if (pokemonData->isEnemy) {
- iVar2 = pokemonData->IQSkillsEnabled;
- SetIQSkill(iVar2, IQ_SKILL_STATUS_CHECKER);
- SetIQSkill(iVar2, IQ_SKILL_PP_CHECKER);
- SetIQSkill(iVar2, IQ_SKILL_ITEM_CATCHER);
- if (pokemonData->isBoss)
- SetIQSkill(iVar2, IQ_SKILL_SELF_CURER);
- if (pokemonData->level >= *gItemMasterMinWildLevel)
- SetIQSkill(iVar2, IQ_SKILL_ITEM_MASTER);
- pokemonData->tactic = TACTIC_GO_AFTER_FOES;
- }
- else {
- pokemonData->IQSkillsEnabled[0] = 0;
- pokemonData->IQSkillsEnabled[1] = 0;
- 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))
- {
- SetIQSkill(pokemonData->IQSkillsEnabled,IQSkill);
- }
- }
- }
-}
-
-bool8 CanSeeTeammate(struct DungeonEntity * pokemon)
-{
- struct DungeonEntity *teamMember;
- s32 memberIdx;
-
- if (pokemon->entityData->isEnemy) {
- return FALSE;
- }
- else
- {
- for(memberIdx = 0; memberIdx < MAX_TEAM_MEMBERS; memberIdx++)
- {
- teamMember = gDungeonGlobalData->teamPokemon[memberIdx];
- if (EntityExists(pokemon) && (pokemon != teamMember) && (CanSee(pokemon,teamMember)))
- {
- return TRUE;
- }
- }
- return FALSE;
- }
-}
-
-u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove)
-{
- if (pokeMove->moveID == MOVE_HIDDEN_POWER)
- return pokemon->entityData->hiddenPowerType;
- else
- return GetMoveType(pokeMove);
-}
-
-s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove)
-{
- if(pokeMove->moveID == MOVE_HIDDEN_POWER)
- return (pokemon->entityData->hiddenPowerPower + pokeMove->powerBoost);
- else
- return (GetMovePower(pokeMove) + pokeMove->powerBoost);
-}
-
-bool8 ToolboxEnabled(struct DungeonEntityData *pokemon)
-{
- if(!IsToolboxEnabled(pokemon->entityID))
- return FALSE;
- return TRUE;
-}
-
-static inline bool8 sub_8071A8C_sub(struct DungeonEntityData *pokemonData)
-{
- if(pokemonData->joinLocation == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON ||
- pokemonData->joinLocation == DUNGEON_RESCUE_TEAM_BASE)
- return TRUE;
- else
- return FALSE;
-}
-
-bool8 sub_8071A8C(struct DungeonEntity *pokemon)
-{
- struct DungeonEntityData *pokemonData;
- if(EntityExists(pokemon))
- {
- pokemonData = pokemon->entityData;
- if(pokemonData->clientType != CLIENT_TYPE_CLIENT)
- {
- if(!sub_8071A8C_sub(pokemonData))
- return TRUE;
- }
- }
- return FALSE;
-}
diff --git a/src/dungeon_visibility.c b/src/dungeon_visibility.c
index 862e1a0..4a76b69 100644
--- a/src/dungeon_visibility.c
+++ b/src/dungeon_visibility.c
@@ -2,7 +2,7 @@
#include "dungeon_visibility.h"
#include "constants/status.h"
-#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_pokemon_attributes.h"
#include "dungeon_range.h"
#include "dungeon_util.h"
diff --git a/src/items.c b/src/items.c
index 999fd7d..4b5a710 100644
--- a/src/items.c
+++ b/src/items.c
@@ -40,7 +40,6 @@ extern s32 sub_8090FEC(s32 a1, u8* a2, u8 a3);
extern void sub_80073B8(u32);
extern u32 sub_8097DF0(char *, struct subStruct_203B240 **);
extern void sub_80078A4(u32, u32, u32, u32, u32);
-extern u32 GetMoveType(void*);
extern u8* GetUnformattedTypeString(s16);
extern void sub_80073E0(u32);
extern void xxx_format_and_draw(u32, u32, u8 *, u32, u32);
diff --git a/src/pokemon_3.c b/src/pokemon_3.c
index 9d28f98..68c894b 100644
--- a/src/pokemon_3.c
+++ b/src/pokemon_3.c
@@ -47,7 +47,6 @@ extern s16 gUnknown_810AC66; // 0x8
// 2, 4, 6, 7, 8, 9, 0xA, 0xD, 0xF, 0x11
extern s32 gUnknown_810AC90[10];
-extern void SetIQSkill(u8 *, u32);
extern void AddSprite(u16 *, u32, u32, u32);
extern void xxx_save_poke_sub_4_80902F4(struct unkStruct_8094924*, struct unkPokeSubStruct_4*);
diff --git a/src/targeting_flags.c b/src/targeting_flags.c
index d342d51..f315cdf 100644
--- a/src/targeting_flags.c
+++ b/src/targeting_flags.c
@@ -3,10 +3,9 @@
#include "constants/move_id.h"
#include "constants/type.h"
+#include "dungeon_pokemon_attributes.h"
#include "moves.h"
-extern bool8 HasType(struct DungeonEntity *pokemon, u8 type);
-
s16 GetMoveTargetingFlagsForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *move, u32 isAI)
{
if (move->moveID == MOVE_CURSE && !isAI && !HasType(pokemon, TYPE_GHOST))