diff --git a/include/dungeon.h b/include/dungeon.h index c64816f0..d79be463 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -12,6 +12,8 @@ #define DUNGEON_MAX_SIZE_Y 32 #define CORRIDOR_ROOM 0xFF +extern struct dungeon *DUNGEON_PTR[]; + enum terrain_type { // These 3 seem to indicate the 'main' type of the terrain. See helper functions for how they're set. diff --git a/src/dg_camera.c b/src/dg_camera.c index b6ee9e5f..b3f9e5eb 100644 --- a/src/dg_camera.c +++ b/src/dg_camera.c @@ -3,8 +3,6 @@ #include "dungeon_items.h" #include "dungeon_pokemon_attributes.h" -extern struct dungeon *DUNGEON_PTR[]; - // file starts at 0x022e26b68 bool8 EntityIsValid__022E32E8(struct entity *entity) diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 9ca1bf98..fcb5e950 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -22,8 +22,6 @@ #define WATCHING_CAREFULLY_MESSAGE 0xDEE #endif -extern struct dungeon *DUNGEON_PTR[]; - extern void EndFrozenClassStatus(struct entity *user, struct entity *target, bool8 log); extern void SubstitutePlaceholderStringTags(u8 *string_id, struct entity *entity, u32 param_3); extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id); diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 13b10bc3..5c18458b 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -16,7 +16,6 @@ #include "overlay_29_0231ACAC.h" #include "position_util.h" -extern struct dungeon *DUNGEON_PTR[]; extern bool8 AI_CAN_ATTACK_IN_DIRECTION[NUM_DIRECTIONS]; extern u8 AI_POTENTIAL_ATTACK_TARGET_DIRECTIONS[NUM_DIRECTIONS]; extern s32 AI_POTENTIAL_ATTACK_TARGET_WEIGHTS[NUM_DIRECTIONS]; diff --git a/src/dungeon_ai_itcm.c b/src/dungeon_ai_itcm.c index 66a32ab7..42ad0148 100644 --- a/src/dungeon_ai_itcm.c +++ b/src/dungeon_ai_itcm.c @@ -23,8 +23,6 @@ // Each index in the array corresponds to the number of attacks (0-4) the AI can use (i.e., is enabled and has PP remaining). const s16 AI_REGULAR_ATTACK_WEIGHTS[5] = { 100, 20, 30, 40, 50 }; -extern struct dungeon *DUNGEON_PTR[]; - extern bool8 ov29_02338350(struct entity *monster); extern bool8 TargetRegularAttack(struct entity *pokemon, u32 *target_dir, bool8 skip_petrified); extern void SetActionRegularAttack(struct action_data *monster_action, u8 direction); diff --git a/src/dungeon_ai_items_1.c b/src/dungeon_ai_items_1.c index 99b33786..0f0050b2 100644 --- a/src/dungeon_ai_items_1.c +++ b/src/dungeon_ai_items_1.c @@ -17,7 +17,6 @@ // This needs to be marked as non-volatile here to match GetPossibleAiThrownItemDirections, // but AiDecideUseItem needs it to be volatile to match. extern s32 AI_THROWN_ITEM_ACTION_CHOICE_COUNT; -extern struct dungeon *DUNGEON_PTR[]; void GetPossibleAiThrownItemDirections(struct entity *entity, s32 ally_or_enemy, struct item *item, bool8 always_add) { diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 4d666ef9..9b851f69 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -3,7 +3,6 @@ extern struct tile DEFAULT_TILE_COPY; extern struct tile* DEFAULT_TILE; -extern struct dungeon *DUNGEON_PTR[]; struct tile* GetTile(s32 x, s32 y) { diff --git a/src/dungeon_pokemon_attributes_1.c b/src/dungeon_pokemon_attributes_1.c index b219d79f..dfd84202 100644 --- a/src/dungeon_pokemon_attributes_1.c +++ b/src/dungeon_pokemon_attributes_1.c @@ -4,8 +4,6 @@ #include "overlay_29_023000E4.h" #include "pokemon.h" -extern struct dungeon *DUNGEON_PTR[]; - bool8 CanSeeInvisibleMonsters(struct entity *entity) { if (GetEntInfo(entity)->blinker_class_status.blinded == STATUS_BLINKER_EYEDROPS) diff --git a/src/dungeon_range.c b/src/dungeon_range.c index cfb71a1d..108984f3 100644 --- a/src/dungeon_range.c +++ b/src/dungeon_range.c @@ -4,8 +4,6 @@ #include "dungeon_map_access.h" #include "main_0208655C.h" -extern struct dungeon *DUNGEON_PTR[]; - bool8 IsPositionActuallyInSight(struct position *origin, struct position *target, bool8 user_has_dropeye) { u8 origin_room; diff --git a/src/move_checks.c b/src/move_checks.c index c7e8c123..3ab0efb0 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -7,11 +7,9 @@ #include "overlay_29_023197A8.h" #include "run_dungeon_1.h" #include "tileset.h" +#include "trap.h" #include "weather.h" -extern struct dungeon *DUNGEON_PTR[]; - -extern bool8 CanLayTrap(struct position *pos); extern bool8 Conversion2IsActive(struct entity *entity); extern bool8 HasLowHealth(struct entity *entity); extern struct tile* GetTileAtEntity(struct entity *entity); diff --git a/src/overlay_29_022DEAB0.c b/src/overlay_29_022DEAB0.c index e3a90700..089bdb63 100644 --- a/src/overlay_29_022DEAB0.c +++ b/src/overlay_29_022DEAB0.c @@ -1,6 +1,5 @@ #include "overlay_29_022DEAB0.h" - -extern struct dungeon *DUNGEON_PTR[]; +#include "dungeon.h" void MemFree(void* ptr); void MemZero(void* ptr, u32 len); diff --git a/src/overlay_29_022FB538.c b/src/overlay_29_022FB538.c index d256f391..9b0ea8d0 100644 --- a/src/overlay_29_022FB538.c +++ b/src/overlay_29_022FB538.c @@ -5,8 +5,6 @@ #include "overlay_29_022F7364.h" #include "targeting.h" -extern struct dungeon *DUNGEON_PTR[]; - #ifndef JAPAN void SetDecoyAiTracker(struct entity* entity) { diff --git a/src/overlay_29_023000E4.c b/src/overlay_29_023000E4.c index b68b36c1..129b4ec2 100644 --- a/src/overlay_29_023000E4.c +++ b/src/overlay_29_023000E4.c @@ -8,7 +8,6 @@ bool8 EntityIsValid__023000E4(struct entity *entity) return entity->type != ENTITY_NOTHING; } -extern struct dungeon *DUNGEON_PTR[]; #ifndef JAPAN enum display_name_type GetMonsterDisplayNameType(struct monster *monster) { struct dungeon *dungeon = DUNGEON_PTR[0]; diff --git a/src/overlay_29_02338390.c b/src/overlay_29_02338390.c index 2d9be55c..26f40415 100644 --- a/src/overlay_29_02338390.c +++ b/src/overlay_29_02338390.c @@ -1,8 +1,6 @@ #include "overlay_29_02338390.h" #include "dungeon.h" -extern struct dungeon *DUNGEON_PTR[]; - bool8 GravityIsActive() { return DUNGEON_PTR[0]->gravity; diff --git a/src/overlay_29_02338548.c b/src/overlay_29_02338548.c index 8ec67a33..2a9efa14 100644 --- a/src/overlay_29_02338548.c +++ b/src/overlay_29_02338548.c @@ -2,7 +2,6 @@ #include "dungeon.h" -extern struct dungeon *DUNGEON_PTR[]; bool8 TeamMemberHasExclusiveItemEffectActive(u8); bool8 ShouldBoostKecleonShopSpawnChance(void) diff --git a/src/overlay_29_02338604.c b/src/overlay_29_02338604.c index c411d597..7039b96c 100644 --- a/src/overlay_29_02338604.c +++ b/src/overlay_29_02338604.c @@ -2,8 +2,6 @@ #include "dungeon.h" -extern struct dungeon *DUNGEON_PTR[]; - bool8 IsSecretBazaar() { return DUNGEON_PTR[0]->gen_info.fixed_room_id==FIXED_SECRET_BAZAAR; diff --git a/src/overlay_31_02382820.c b/src/overlay_31_02382820.c index 7cdc16a0..76471e74 100644 --- a/src/overlay_31_02382820.c +++ b/src/overlay_31_02382820.c @@ -2,8 +2,6 @@ #include "dungeon_ai_targeting.h" #include "number_util.h" -extern struct dungeon *DUNGEON_PTR[]; - extern const u8 DUNGEON_MENU_SWITCH_STR1[];// = "[dungeon:0]"; extern struct struct_1* OVERLAY31_UNKNOWN_POINTER__NA_238A260[2]; diff --git a/src/run_dungeon.c b/src/run_dungeon.c index 068ddbd2..a794ce10 100644 --- a/src/run_dungeon.c +++ b/src/run_dungeon.c @@ -2,8 +2,6 @@ #include "dungeon.h" #include "overlay_10_022C2574.h" -extern struct dungeon *DUNGEON_PTR[]; - bool8 IsCurrentTilesetBackground() { return IsBackgroundTileset(DUNGEON_PTR[0]->gen_info.tileset_id); diff --git a/src/run_dungeon_1.c b/src/run_dungeon_1.c index 213b6d70..2514eb0d 100644 --- a/src/run_dungeon_1.c +++ b/src/run_dungeon_1.c @@ -2,8 +2,6 @@ #include "dungeon.h" #include "enums.h" -extern struct dungeon *DUNGEON_PTR[]; - bool8 IsBossFight(enum fixed_room_id fixed_room_id) { if (fixed_room_id != FIXED_NONE && fixed_room_id < FIXED_ZERO_ISLE_NORTH) diff --git a/src/weather.c b/src/weather.c index 83de076c..481748ae 100644 --- a/src/weather.c +++ b/src/weather.c @@ -3,8 +3,6 @@ #include "dungeon_items.h" #include "dungeon_pokemon_attributes.h" -extern struct dungeon *DUNGEON_PTR[]; - enum weather_id GetApparentWeather(struct entity *entity) { if (entity != NULL)