Merge pull request #452 from DizzyEggg/more_dungeon
Some checks failed
GithubCI / build (push) Has been cancelled

More dungeon files clean-up
This commit is contained in:
Seth Barberee 2025-10-20 10:31:39 -07:00 committed by GitHub
commit 436689e4a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
111 changed files with 1326 additions and 1560 deletions

View File

@ -1,11 +0,0 @@
#ifndef GUARD_CODE_8041AD0_H
#define GUARD_CODE_8041AD0_H
#include "structs/dungeon_entity.h"
#include "structs/str_damage.h"
u32 EntityGetStatusSprites(Entity *entity);
void sub_80420E8(Entity *pokemon, DamageStruct *dmgStruct);
void sub_80421C0(Entity *pokemon, u16);
#endif // GUARD_CODE_8041AD0_H

View File

@ -1,13 +0,0 @@
#ifndef GUARD_CODE_804267C_H
#define GUARD_CODE_804267C_H
#include "structs/dungeon_entity.h"
void PlayStairsSound(void);
void sub_80426C8(u32 a0, u32 a1);
void sub_8042730(Entity *a0, void *unused);
bool8 sub_8042768(Entity* pokemon);
void sub_80427AC(void);
void sub_8042818(u8 a0, bool8 a1);
#endif

167
include/dungeon_8041AD0.h Normal file
View File

@ -0,0 +1,167 @@
#ifndef GUARD_DUNGEON_8041AD0_H
#define GUARD_DUNGEON_8041AD0_H
#include "structs/dungeon_entity.h"
#include "structs/str_damage.h"
s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3);
void sub_804178C(u8 param_1);
u32 EntityGetStatusSprites(Entity *entity);
void sub_8041888(u8 param_1);
void EntityUpdateStatusSprites(Entity *entity);
void sub_8041AD0(Entity *pokemon);
void sub_8041AE0(Entity *pokemon);
void sub_8041AF4(Entity *pokemon);
void nullsub_57(Entity *pokemon);
void sub_8041B18(Entity *pokemon);
void nullsub_58(Entity *pokemon);
void nullsub_59(Entity *pokemon);
void sub_8041B34(Entity *pokemon);
void nullsub_60(Entity *pokemon);
void sub_8041B48(Entity *pokemon);
void nullsub_61(Entity *pokemon);
void sub_8041B5C(Entity *pokemon);
void nullsub_62(Entity *pokemon);
void sub_8041B74(Entity *pokemon);
void nullsub_63(Entity *pokemon);
void nullsub_64(Entity *pokemon);
void sub_8041B90(Entity *pokemon);
void nullsub_65(Entity *pokemon);
void nullsub_66(Entity *pokemon);
void sub_8041BA8(Entity *pokemon);
void nullsub_67(Entity *pokemon);
void sub_8041BBC(Entity *pokemon);
void nullsub_68(Entity *pokemon);
void sub_8041BD0(Entity *pokemon, u8 r1);
void sub_8041BE8(Entity *pokemon);
void sub_8041BF8(Entity *pokemon);
void sub_8041C08(Entity *pokemon);
void sub_8041C1C(Entity *pokemon);
void nullsub_69(Entity *pokemon, Entity *target);
void sub_8041C34(Entity *pokemon);
void nullsub_70(Entity *pokemon);
void nullsub_71(Entity *pokemon);
void sub_8041C4C(Entity *pokemon, u32 r1);
void sub_8041C58(Entity *pokemon);
void sub_8041C6C(Entity *pokemon);
void sub_8041C7C(Entity *pokemon);
void nullsub_72(Entity *pokemon);
void nullsub_73(Entity *pokemon);
void sub_8041C94(Entity *pokemon);
void sub_8041CA8(Entity *pokemon);
void sub_8041CB8(Entity *pokemon);
void sub_8041CCC(Entity *pokemon);
void sub_8041CDC(Entity *pokemon);
void sub_8041CEC(Entity *pokemon);
void nullsub_74(Entity *pokemon);
void sub_8041D00(Entity *pokemon, Entity *target);
void nullsub_75(Entity *pokemon);
void nullsub_76(Entity *pokemon);
void nullsub_77(Entity *pokemon);
void nullsub_78(Entity *pokemon);
void nullsub_79(Entity *pokemon);
void nullsub_80(Entity *pokemon);
void sub_8041D38(Entity * pokemon);
void sub_8041D48(Entity * pokemon);
void nullsub_81(Entity *pokemon);
void sub_8041D5C(Entity *pokemon);
void sub_8041D84(Entity *pokemon);
void nullsub_82(Entity *pokemon);
void nullsub_83(Entity *pokemon);
void sub_8041D9C(Entity *pokemon);
void sub_8041DB0(Entity *pokemon);
void nullsub_84(Entity *pokemon);
void nullsub_85(Entity *pokemon);
void nullsub_86(Entity *pokemon);
void nullsub_87(Entity *pokemon);
void nullsub_88(Entity *pokemon);
void sub_8041DD8(Entity *pokemon, s32 r1);
void nullsub_89(Entity *pokemon);
void sub_8041E0C(Entity *pokemon);
void sub_8041E1C(Entity *pokemon);
void sub_8041E3C(Entity *pokemon);
void sub_8041E4C(Entity *pokemon);
void sub_8041E60(Entity *pokemon);
void sub_8041E74(Entity *pokemon);
void sub_8041E84(Entity *pokemon);
void sub_8041E94(Entity *pokemon);
void sub_8041EA4(Entity *pokemon);
void sub_8041EB4(Entity *pokemon);
void sub_8041EC8(Entity *pokemon);
void sub_8041ED8(Entity *pokemon);
void sub_8041EE8(Entity *pokemon);
void sub_8041EF8(Entity *pokemon);
void sub_8041F08(Entity *pokemon);
void nullsub_90(Entity *pokemon);
void sub_8041F28(Entity *pokemon, u32 r1);
void sub_8041F4C(Entity *pokemon, u32 r1);
void sub_8041F70(Entity *pokemon, u32 r1);
void sub_8041F94(Entity *pokemon, u32 r1);
void sub_8041FB4(Entity *pokemon, u32 r1);
void sub_8041FD8(Entity *pokemon, u32 r1);
void sub_8041FFC(Entity *pokemon, u32 r1);
void sub_804201C(Entity *pokemon, u32 r1);
void sub_8042040(Entity *pokemon, u32 r1);
void sub_8042060(Entity *pokemon, u32 r1);
void sub_8042080(Entity *pokemon, u32 r1);
void sub_80420A0(Entity *pokemon);
void nullsub_91(Entity *pokemon);
void sub_80420B8(Entity *pokemon);
void sub_80420C8(Entity *pokemon);
void nullsub_92(Entity *pokemon);
void sub_80420E8(Entity *pokemon, struct DamageStruct *dmgStruct);
void sub_8042148(Entity *pokemon);
void nullsub_93(DungeonPos *pos);
void sub_804216C(Entity *pokemon, Entity *target, u32 r2);
void sub_804218C(Entity *pokemon, Entity *target);
void sub_804219C(PixelPos *pos);
void sub_80421AC(Entity *pokemon, Entity * target);
void sub_80421C0(Entity *pokemon, u16 r1);
void sub_80421EC(DungeonPos *pos, u16 r1);
void sub_8042208(Entity *pokemon, u8 r1);
void sub_8042238(Entity *pokemon, Entity *target);
void sub_804225C(Entity *entity, DungeonPos *pos, u8 trapId);
void sub_8042390(Entity *entity, Item *item);
void sub_804245C(Entity *entity, Item *item);
s32 sub_8042520(Entity *a0);
void PlayStairsSound(void);
void sub_80426C8(u32 a0, u32 a1);
void sub_8042730(Entity *a0, Entity *unused);
bool8 sub_8042768(Entity* pokemon);
void sub_80427AC(void);
void sub_8042818(u8 a0, bool8 a1);
void sub_80428A0(Entity *r0);
void sub_80428B0(Entity *r0);
void sub_80428C4(Entity *r0);
void sub_80428D8(Entity *r0);
void sub_80428EC(Entity *r0);
void sub_8042900(Entity *r0);
void ShowVisualFlags(Entity *r0);
void sub_8042920(Entity *r0);
void sub_8042930(Entity *r0);
void sub_8042940(Entity *r0);
void sub_8042950(Entity *r0);
void sub_8042968(Entity *r0);
void sub_8042978(Entity *r0);
void sub_804298C(Entity *r0);
void sub_80429A0(Entity *r0);
void sub_80429B4(Entity *r0);
void sub_80429C8(Entity *r0);
void sub_80429D8(Entity *r0);
void sub_80429E8(Entity *r0);
void sub_80429FC(DungeonPos *r0);
void sub_8042A14(DungeonPos *r0);
void sub_8042A24(Entity *r0);
void sub_8042A34(DungeonPos *r0);
void sub_8042A44(Entity *r0);
void sub_8042A54(DungeonPos *r0);
void sub_8042A64(DungeonPos *r0);
void sub_8042A74(Entity *r0);
void sub_8042B0C(Entity *entity);
void sub_8042B20(Entity *entity);
void sub_8042DD4(s32 a0, Entity *a1, s32 a2);
void sub_8042E5C(void);
void sub_8042E98(void);
void sub_8042EC8(Entity *a0, s32 a1);
#endif // GUARD_DUNGEON_8041AD0_H

View File

@ -1,11 +0,0 @@
#ifndef GUARD_DUNGEON_8083AB0_H
#define GUARD_DUNGEON_8083AB0_H
#include "structs/dungeon_entity.h"
void sub_8083AB0(s16 dungeonExitReason, Entity *target, Entity *entity);
bool8 IsUnsuccessfulDungeonExit(void);
bool8 sub_8083C50(void);
bool8 sub_8083C88(u8 param_1);
#endif // GUARD_DUNGEON_8083AB0_H

View File

@ -12,10 +12,10 @@
extern const s16 gMonsterHouseMaxItemsTraps; extern const s16 gMonsterHouseMaxItemsTraps;
extern const s16 gMonsterHouseMinMons; extern const s16 gMonsterHouseMinMons;
extern const s16 gMonsterHouseMaxMons; extern const s16 gMonsterHouseMaxMons;
extern const s16 gUnknown_80F4DA6; extern const s16 gMaxWildMonsInMonsterHouse;
extern const s16 gUnknown_80F4DA8; extern const s16 gMaxWildMonsInRoom;
extern const s16 gUnknown_80F4DAA; extern const s16 gWildSpawnIntervalFrames;
extern const s16 gUnknown_80F4DAC; extern const s16 gKecleonSpawnIntervalFrames;
extern const s16 gCritOddsScopeLensPatsyBand; extern const s16 gCritOddsScopeLensPatsyBand;
extern const s16 gCritOddsIqAdvantageMaster; extern const s16 gCritOddsIqAdvantageMaster;
extern const s16 gAIConfusedAttackChance; extern const s16 gAIConfusedAttackChance;

View File

@ -43,11 +43,11 @@ extern const s32 gUnknown_810A3F0[100];
extern const s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS]; extern const s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS];
extern const s16 gUnknown_810A808[NUM_TYPES][NUMBER_OF_GUMMIS]; extern const s16 gUnknown_810A808[NUM_TYPES][NUMBER_OF_GUMMIS];
extern const FriendAreaSettings gFriendAreaSettings[NUM_FRIEND_AREAS]; extern const FriendAreaSettings gFriendAreaSettings[NUM_FRIEND_AREAS];
extern const s16 gUnknown_810AC60; extern const s16 gPowerBandBoost;
extern const s16 gUnknown_810AC62; extern const s16 gSpecialBandBoost;
extern const s16 gUnknown_810AC64; extern const s16 gDefScarfBoost;
extern const s16 gUnknown_810AC66; extern const s16 gZincBandBoost;
extern const s16 gUnknown_810AC68; extern const s16 gMunchBeltBoost;
extern const u8 gBestResistTypeTable[NUM_TYPES]; extern const u8 gBestResistTypeTable[NUM_TYPES];
extern const bool8 gIsTypePhysicalTable[NUM_TYPES]; extern const bool8 gIsTypePhysicalTable[NUM_TYPES];
extern const s32 gUnknown_810AC90[10]; extern const s32 gUnknown_810AC90[10];

11
include/dungeon_exit.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef GUARD_DUNGEON_EXIT_H
#define GUARD_DUNGEON_EXIT_H
#include "structs/dungeon_entity.h"
void SetUpDungeonExitData(s16 dungeonExitReason, Entity *target, Entity *entity);
bool8 IsUnsuccessfulDungeonExit(void);
bool8 sub_8083C50(void);
bool8 sub_8083C88(u8 param_1);
#endif // GUARD_DUNGEON_EXIT_H

View File

@ -0,0 +1,14 @@
#ifndef GUARD_DUNGEON_MON_RECRUIT_H
#define GUARD_DUNGEON_MON_RECRUIT_H
#include "structs/dungeon_entity.h"
#include "dungeon_misc.h"
bool8 TryRecruitMonster(Entity *attacker, Entity *target);
bool8 IsMonsterRecruitable(s32 species);
bool8 HandleMonsterJoinSequence(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *param_3);
// These two functions are only used for Celebi's scene for some reason.
bool8 CanEntityBeRecruited(Entity *param_1);
bool8 HandleSpecialEntityJoinSequence(Entity *entity1,Entity *entity2,Entity **entityPtr);
#endif // GUARD_DUNGEON_MON_RECRUIT_H

View File

@ -1,9 +1,9 @@
#ifndef GUARD_CODE_806CD90_H #ifndef GUARD_DUNGEON_MON_SPRITE_RENDER_H
#define GUARD_CODE_806CD90_H #define GUARD_DUNGEON_MON_SPRITE_RENDER_H
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
void sub_806C51C(Entity *entity); void UpdateMonsterSprite(Entity *entity);
void sub_806CC10(void); void sub_806CC10(void);
void sub_806CC70(void); void sub_806CC70(void);
void sub_806CCB4(Entity *entity, u8); void sub_806CCB4(Entity *entity, u8);
@ -16,8 +16,7 @@ void sub_806CE94(Entity *entity, u32 newDir);
u8 sub_806CEBC(Entity *entity); u8 sub_806CEBC(Entity *entity);
void sub_806CEFC(Entity *entity, u32 newDir); void sub_806CEFC(Entity *entity, u32 newDir);
void sub_806CF18(Entity *entity); void sub_806CF18(Entity *entity);
u8 sub_806CF54(Entity *entity);
void DetermineAllMonsterShadow(void); void DetermineAllMonsterShadow(void);
u32 DetermineMonsterShadow(Entity *entity); u32 DetermineMonsterShadow(Entity *entity);
#endif // GUARD_CODE_806CD90_H #endif // GUARD_DUNGEON_MON_SPRITE_RENDER_H

View File

@ -0,0 +1,8 @@
#ifndef GUARD_DUNGEON_RECRUIT_RELEASE_MENU_H
#define GUARD_DUNGEON_RECRUIT_RELEASE_MENU_H
#include "structs/str_pokemon.h"
void ShowRecruitReleaseMenu(u8 a0, s32 a1, s32 a2, Pokemon **a3);
#endif // GUARD_DUNGEON_RECRUIT_RELEASE_MENU_H

View File

@ -148,10 +148,10 @@ extern const u8 *const gUnknown_80F9BB0;
extern const u8 *const gUnknown_80F9BD8; extern const u8 *const gUnknown_80F9BD8;
extern const u8 *const gUnknown_80F9C08; extern const u8 *const gUnknown_80F9C08;
extern const u8 *const gUnknown_80F9C2C; extern const u8 *const gUnknown_80F9C2C;
extern const u8 *const gUnknown_80F9C4C; extern const u8 *const gText_SomethingStirring;
extern const u8 *const gUnknown_80F9C70; extern const u8 *const gText_SomethingApproaching;
extern const u8 *const gUnknown_80F9C8C; extern const u8 *const gText_ItsGettingCloser;
extern const u8 *const gUnknown_80F9CBC; extern const u8 *const gText_ItsRightNearbyGustingHard;
extern const u8 *const gUnknown_80F9CC0[]; extern const u8 *const gUnknown_80F9CC0[];
extern const u8 *const gUnknown_80F9CEC[]; extern const u8 *const gUnknown_80F9CEC[];
extern const u8 *const gUnknown_80F9D28[]; extern const u8 *const gUnknown_80F9D28[];
@ -170,13 +170,13 @@ extern const u8 *const gUnknown_80F9F2C;
extern const u8 *const gUnknown_80F9FA4; extern const u8 *const gUnknown_80F9FA4;
extern const u8 *const gUnknown_80F9FE8; extern const u8 *const gUnknown_80F9FE8;
extern const u8 *const gUnknown_80F9FEC; extern const u8 *const gUnknown_80F9FEC;
extern const u8 *const gUnknown_80FA004; extern const u8 *const gText_Pokemon0WentAway;
extern const u8 *const gUnknown_80FA030; extern const u8 *const gText_ThePokemonCouldntJoinTeam;
extern const u8 *const gUnknown_80FA058; extern const u8 *const gText_ButItCouldntJoinTheTeam;
extern const u8 *const gUnknown_80FA090; extern const u8 *const gText_NewMemberJoinedGiveItNickname;
extern const u8 *const gUnknown_80FA0C8; extern const u8 *const gText_PleaseGiveNicknameNewMember;
extern const u8 *const gUnknown_80FA0F0; extern const u8 *const gText_Pokemon0JoinedToGoOnAdventures;
extern const u8 *const gUnknown_80FA120; extern const u8 *const gText_Pokemon0GainedAccessToFriendArea;
extern const u8 *const gUnknown_80FA124[]; extern const u8 *const gUnknown_80FA124[];
extern const u8 *const gUnknown_80FA260; extern const u8 *const gUnknown_80FA260;
extern const u8 *const gUnknown_80FA2B0; extern const u8 *const gUnknown_80FA2B0;
@ -688,7 +688,7 @@ extern const u8 *const gUnknown_80FE690;
extern const u8 *const gUnknown_80FE6B4; extern const u8 *const gUnknown_80FE6B4;
extern const u8 *const gUnknown_80FE6D4; extern const u8 *const gUnknown_80FE6D4;
extern const u8 *const gText_TheLastOuting; extern const u8 *const gText_TheLastOuting;
extern const u8 *const gUnknown_80FE6F4; extern const u8 *const gText_Someone;
extern const u8 *const gUnknown_80FE708; extern const u8 *const gUnknown_80FE708;
extern const u8 *const gUnknown_80FE70C; extern const u8 *const gUnknown_80FE70C;
extern const u8 *const gUnknown_80FE720; extern const u8 *const gUnknown_80FE720;
@ -756,7 +756,7 @@ extern const u8 *const gUnknown_80FED08;
extern const u8 *const gUnknown_80FED0C; extern const u8 *const gUnknown_80FED0C;
extern const u8 *const gUnknown_80FED30; extern const u8 *const gUnknown_80FED30;
extern const u8 *const gUnknown_80FED34; extern const u8 *const gUnknown_80FED34;
extern const u8 *const gUnknown_80FED68; extern const u8 *const gText_Pokemon0Blinked;
extern const u8 *const gUnknown_80FED88; extern const u8 *const gUnknown_80FED88;
extern const u8 *const gUnknown_80FEDA8; extern const u8 *const gUnknown_80FEDA8;
extern const u8 *const gUnknown_80FEDC8; extern const u8 *const gUnknown_80FEDC8;

View File

@ -0,0 +1,6 @@
#ifndef GUARD_DUNGEON_WILD_MON_SPAWN_H
#define GUARD_DUNGEON_WILD_MON_SPAWN_H
void TrySpawnWildMonster(void);
#endif // GUARD_DUNGEON_WILD_MON_SPAWN_H

6
include/dungeon_wind.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_DUNGEON_WIND
#define GUARD_DUNGEON_WIND
void UpdateWindTurns(void);
#endif // GUARD_DUNGEON_WIND

View File

@ -337,7 +337,7 @@ typedef struct EntityInfo
/* 0x1FA */ s16 mobileTurnTimer; // When a Pokémon can pass through walls in a hallway, this counts up to 200 before the Pokémon turns in a random direction. /* 0x1FA */ s16 mobileTurnTimer; // When a Pokémon can pass through walls in a hallway, this counts up to 200 before the Pokémon turns in a random direction.
/* 0x1FC */ u32 expGainedInTurn; // Used to accumulate experience when multiple enemies are defeated in one turn. /* 0x1FC */ u32 expGainedInTurn; // Used to accumulate experience when multiple enemies are defeated in one turn.
/* 0x200 */ u32 statusIcons; /* 0x200 */ u32 statusIcons;
u8 unk204; /* 0x204 */ u8 shadowIndex;
} EntityInfo; } EntityInfo;
// size: 0x74 | Used for Pokémon, items, and traps. // size: 0x74 | Used for Pokémon, items, and traps.

View File

@ -254,14 +254,14 @@ typedef struct unkDungeon644
/* 0x19 */ u8 unk19; /* 0x19 */ u8 unk19;
/* 0x1A */ u8 fill1A[2]; /* 0x1A */ u8 fill1A[2];
/* 0x1C */ s16 fractionalTurn; // Handles turn order when Pokémon have different movement speeds. /* 0x1C */ s16 fractionalTurn; // Handles turn order when Pokémon have different movement speeds.
/* 0x1E */ s16 unk1E; /* 0x1E */ s16 wildMonSpawnFrames;
/* 0x20 */ s16 unk20; /* 0x20 */ s16 enemyDensity; // Taken directly from FloorProperties. Checked only once, if 0 there will be no wild Pokemon in dungeon.
/* 0x22 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon. /* 0x22 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon.
/* 0x24 */ u16 unk24; /* 0x24 */ u16 unk24;
/* 0x26 */ u16 bossSongIndex; /* 0x26 */ u16 bossSongIndex;
/* 0x28 */ u8 unk28; /* 0x28 */ u8 unk28;
/* 0x29 */ u8 unk29; /* 0x29 */ u8 unk29;
/* 0x2A */ u8 unk2A; /* 0x2A */ bool8 stoleFromKecleon;
/* 0x2B */ u8 unk2B; /* 0x2B */ u8 unk2B;
/* 0x2C */ u8 unk2C; /* 0x2C */ u8 unk2C;
/* 0x2D */ bool8 monsterHouseTriggered; /* 0x2D */ bool8 monsterHouseTriggered;
@ -273,7 +273,7 @@ typedef struct unkDungeon644
/* 0x33 */ u8 unk33; /* 0x33 */ u8 unk33;
/* 0x34 */ u8 unk34; /* 0x34 */ u8 unk34;
/* 0x35 */ u8 emptyBellyAlert; // which alert message to show when belly gets empty. /* 0x35 */ u8 emptyBellyAlert; // which alert message to show when belly gets empty.
/* 0x36 */ u8 unk36; /* 0x36 */ u8 windPhase;
/* 0x37 */ s8 unk37; /* 0x37 */ s8 unk37;
/* 0x38 */ u32 unk38; /* 0x38 */ u32 unk38;
/* 0x3C */ u32 unk3C; /* 0x3C */ u32 unk3C;
@ -468,10 +468,10 @@ typedef struct Dungeon
/* 0x15E2C */ Entity trapEntites[DUNGEON_MAX_TRAPS]; /* 0x15E2C */ Entity trapEntites[DUNGEON_MAX_TRAPS];
/* 0x17B2C */ Entity *lightningRodPokemon; /* 0x17B2C */ Entity *lightningRodPokemon;
/* 0x17B30 */ Entity *snatchPokemon; /* 0x17B30 */ Entity *snatchPokemon;
/* 0x17B34 */ Entity *unk17B34; /* 0x17B34 */ Entity *illuminatePokemon;
/* 0x17B38 */ u32 unk17B38; /* 0x17B38 */ u32 unk17B38;
/* 0x17B3C */ u32 unk17B3C; /* 0x17B3C */ u32 unk17B3C;
/* 0x17B3C */ u32 unk17B40; /* 0x17B3C */ u32 illuminateMonSpawnGenID;
/* 0x17B44 */ OpenedFile *sprites[MONSTER_MAX]; /* 0x17B44 */ OpenedFile *sprites[MONSTER_MAX];
/* 0x181E4 */ OpenedFile *paletFile; /* 0x181E4 */ OpenedFile *paletFile;
/* 0x181E8 */ UnkDungeonGlobal_unk181E8_sub unk181e8; /* 0x181E8 */ UnkDungeonGlobal_unk181E8_sub unk181e8;

View File

@ -201,7 +201,7 @@ SECTIONS {
src/dungeon_tilemap.o(.text); src/dungeon_tilemap.o(.text);
src/dungeon_map.o(.text); src/dungeon_map.o(.text);
src/code_8040094_1.o(.text); src/code_8040094_1.o(.text);
src/code_8041AD0.o(.text); src/dungeon_8041AD0.o(.text);
src/run_dungeon.o(.text); src/run_dungeon.o(.text);
src/dungeon_engine.o(.text); src/dungeon_engine.o(.text);
src/dungeon_action.o(.text); src/dungeon_action.o(.text);
@ -233,15 +233,15 @@ SECTIONS {
src/dungeon_menu_others.o(.text); src/dungeon_menu_others.o(.text);
src/dungeon_menu_recruitment.o(.text); src/dungeon_menu_recruitment.o(.text);
src/code_8066D04.o(.text); src/code_8066D04.o(.text);
src/dungeon_8067A80.o(.text); src/dungeon_recruit_release_menu.o(.text);
src/dungeon_misc.o(.text); src/dungeon_misc.o(.text);
src/dungeon_mon_spawn.o(.text); src/dungeon_mon_spawn.o(.text);
src/code_806CD90.o(.text); src/dungeon_mon_sprite_render.o(.text);
src/dungeon_damage.o(.text); src/dungeon_damage.o(.text);
src/code_806FDF4.o(.text); src/dungeon_mon_recruit.o(.text);
src/status_checks.o(.text); src/status_checks.o(.text);
src/dungeon_logic.o(.text); src/dungeon_logic.o(.text);
src/dungeon_8071B48.o(.text); src/dungeon_wild_mon_spawn.o(.text);
src/dungeon_leveling.o(.text); src/dungeon_leveling.o(.text);
src/dungeon_ai_leader.o(.text); src/dungeon_ai_leader.o(.text);
src/dungeon_action_execution.o(.text); src/dungeon_action_execution.o(.text);
@ -273,7 +273,7 @@ SECTIONS {
src/trap.o(.text); src/trap.o(.text);
src/dungeon_serializer.o(.text); src/dungeon_serializer.o(.text);
src/dungeon_range.o(.text); src/dungeon_range.o(.text);
src/dungeon_8083AB0.o(.text); src/dungeon_exit.o(.text);
src/dungeon_music.o(.text); src/dungeon_music.o(.text);
src/dungeon_random.o(.text); src/dungeon_random.o(.text);
src/dungeon_cleared_window.o(.text); src/dungeon_cleared_window.o(.text);
@ -583,7 +583,7 @@ SECTIONS {
src/dungeon_map.o(.rodata); src/dungeon_map.o(.rodata);
src/code_8040094_1.o(.rodata); src/code_8040094_1.o(.rodata);
data/pksdir_0.o(.rodata); data/pksdir_0.o(.rodata);
src/code_8041AD0.o(.rodata); src/dungeon_8041AD0.o(.rodata);
src/run_dungeon.o(.rodata); src/run_dungeon.o(.rodata);
src/dungeon_engine.o(.rodata); src/dungeon_engine.o(.rodata);
src/dungeon_action.o(.rodata); src/dungeon_action.o(.rodata);
@ -618,15 +618,15 @@ SECTIONS {
src/dungeon_menu_others.o(.rodata); src/dungeon_menu_others.o(.rodata);
src/dungeon_menu_recruitment.o(.rodata); src/dungeon_menu_recruitment.o(.rodata);
src/code_8066D04.o(.rodata); src/code_8066D04.o(.rodata);
src/dungeon_8067A80.o(.rodata); src/dungeon_recruit_release_menu.o(.rodata);
src/dungeon_misc.o(.rodata); src/dungeon_misc.o(.rodata);
src/dungeon_mon_spawn.o(.rodata); src/dungeon_mon_spawn.o(.rodata);
src/code_806CD90.o(.rodata); src/dungeon_mon_sprite_render.o(.rodata);
src/dungeon_damage.o(.rodata); src/dungeon_damage.o(.rodata);
src/code_806FDF4.o(.rodata); src/dungeon_mon_recruit.o(.rodata);
src/status_checks.o(.rodata); src/status_checks.o(.rodata);
src/dungeon_logic.o(.rodata); src/dungeon_logic.o(.rodata);
src/dungeon_8071B48.o(.rodata); src/dungeon_wild_mon_spawn.o(.rodata);
src/dungeon_leveling.o(.rodata); src/dungeon_leveling.o(.rodata);
src/dungeon_ai_leader.o(.rodata); src/dungeon_ai_leader.o(.rodata);
src/dungeon_action_execution.o(.rodata); src/dungeon_action_execution.o(.rodata);
@ -661,7 +661,7 @@ SECTIONS {
src/dungeon_serializer.o(.rodata); src/dungeon_serializer.o(.rodata);
data/pksdir_4.o(.rodata); data/pksdir_4.o(.rodata);
src/dungeon_range.o(.rodata); src/dungeon_range.o(.rodata);
src/dungeon_8083AB0.o(.rodata); src/dungeon_exit.o(.rodata);
src/dungeon_music.o(.rodata); src/dungeon_music.o(.rodata);
src/dungeon_random.o(.rodata); src/dungeon_random.o(.rodata);
src/dungeon_cleared_window.o(.rodata); src/dungeon_cleared_window.o(.rodata);

View File

@ -7,7 +7,7 @@
#include "constants/weather.h" #include "constants/weather.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "dungeon_entity_movement.h" #include "dungeon_entity_movement.h"
#include "run_dungeon.h" #include "run_dungeon.h"
@ -20,7 +20,7 @@
#include "move_orb_effects_1.h" #include "move_orb_effects_1.h"
#include "moves.h" #include "moves.h"
#include "move_util.h" #include "move_util.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "weather.h" #include "weather.h"
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"
@ -35,7 +35,6 @@
#include "expose_trap.h" #include "expose_trap.h"
extern void sub_804EB30(); extern void sub_804EB30();
extern void sub_80421AC(Entity * pokemon, Entity * target);
extern void sub_807BB78(Entity *pokemon); extern void sub_807BB78(Entity *pokemon);
void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction) void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction)

View File

@ -10,7 +10,6 @@
#include "effect_data.h" #include "effect_data.h"
#include "effect_sub_1.h" #include "effect_sub_1.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_804267C.h"
#include "dungeon_info.h" #include "dungeon_info.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "dungeon_move.h" #include "dungeon_move.h"
@ -21,6 +20,8 @@
#include "weather.h" #include "weather.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_mon_sprite_render.h"
#include "dungeon_8041AD0.h"
struct UnkStruct_8040094 struct UnkStruct_8040094
{ {
@ -35,10 +36,8 @@ struct UnkStruct_8040094
extern u8 sub_800EC94(s32 param_1); extern u8 sub_800EC94(s32 param_1);
extern s32 sub_800E710(s32 species, u16 moveId); extern s32 sub_800E710(s32 species, u16 moveId);
extern void sub_800EEC8(u16 r0); extern void sub_800EEC8(u16 r0);
extern void sub_8042DD4(s32 a0, Entity *a1, s32 a2);
extern u8 sub_800EA44(s32 species, u16 a2); extern u8 sub_800EA44(s32 species, u16 a2);
extern s32 sub_800E790(s32 species, u16 a2); extern s32 sub_800E790(s32 species, u16 a2);
extern void sub_806CDD4(Entity *entity, u8, u32 direction);
extern s32 sub_800E52C(struct UnkStruct_8040094 *a0); extern s32 sub_800E52C(struct UnkStruct_8040094 *a0);
extern s32 sub_800EA84(struct UnkStruct_8040094 *a0); extern s32 sub_800EA84(struct UnkStruct_8040094 *a0);
extern bool8 sub_800E838(struct UnkStruct_8040094 *a0, s32 a1); extern bool8 sub_800E838(struct UnkStruct_8040094 *a0, s32 a1);
@ -51,7 +50,6 @@ extern bool8 sub_800E7D0(struct UnkStruct_8040094 *a0);
extern bool8 EffectiveMoveHasSineWobble(s32 moveId); extern bool8 EffectiveMoveHasSineWobble(s32 moveId);
extern bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move); extern bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move);
extern bool8 IsSleeping(Entity *pokemon); extern bool8 IsSleeping(Entity *pokemon);
extern void sub_80421C0(Entity *pokemon, u16);
extern const s32 gUnknown_8106A8C[]; extern const s32 gUnknown_8106A8C[];

View File

@ -6,10 +6,10 @@
#include "constants/move_id.h" #include "constants/move_id.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "dungeon_action.h" #include "dungeon_action.h"
#include "code_8066D04.h" #include "code_8066D04.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_jobs.h" #include "dungeon_jobs.h"
#include "run_dungeon.h" #include "run_dungeon.h"
#include "dungeon_items.h" #include "dungeon_items.h"
@ -46,8 +46,6 @@
#include "warp_target.h" #include "warp_target.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"
extern void sub_8042208(Entity *pokemon, u8 r1);
Entity *sub_806773C(Entity *entity); Entity *sub_806773C(Entity *entity);
void sub_8067558(Entity *entity, Entity *targetEntity, s32 a2); void sub_8067558(Entity *entity, Entity *targetEntity, s32 a2);
void sub_8067794(Entity *entity, Entity *targetEntity, s32 a2); void sub_8067794(Entity *entity, Entity *targetEntity, s32 a2);
@ -636,7 +634,7 @@ void sub_8067558(Entity *entity, Entity *targetEntity, s32 a2)
} }
if (info2->monsterBehavior == 1) { if (info2->monsterBehavior == 1) {
if (gDungeon->unk644.unk2A != 0) { if (gDungeon->unk644.stoleFromKecleon != 0) {
DisplayDungeonMessage(NULL, gUnknown_80FF674, TRUE); DisplayDungeonMessage(NULL, gUnknown_80FF674, TRUE);
} }
else if (gDungeon->unk644.unk33) { else if (gDungeon->unk644.unk33) {

View File

@ -1,471 +0,0 @@
#include "global.h"
#include "globaldata.h"
#include "constants/dungeon_exit.h"
#include "constants/fixed_rooms.h"
#include "constants/type.h"
#include "structs/str_pokemon.h"
#include "dungeon_main.h"
#include "dungeon_misc.h"
#include "music_util.h"
#include "dungeon_message.h"
#include "code_806CD90.h"
#include "code_8097670.h"
#include "dungeon_info.h"
#include "dungeon_items.h"
#include "dungeon_logic.h"
#include "dungeon_random.h"
#include "dungeon_vram.h"
#include "dungeon_util.h"
#include "friend_area.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "position_util.h"
#include "text_util.h"
#include "math.h"
#include "dungeon_config.h"
#include "dungeon_strings.h"
#include "dungeon_music.h"
#include "dungeon_cutscene.h"
#include "string_format.h"
#include "dungeon_mon_spawn.h"
#include "move_orb_effects_5.h"
void nullsub_96(Entity *pokemon,Entity *target);
u8 sub_8097900(s16);
void sub_806F910(void);
u8 sub_806F9BC(s16);
bool8 TryRecruitMonster(Entity *attacker, Entity *target)
{
s32 i;
s32 rand;
s32 recruitRate;
EntityInfo *attackerInfo = GetEntInfo(attacker);
EntityInfo *targetInfo = GetEntInfo(target);
s32 foundIndex = -1;
s32 size = GetBodySize(targetInfo->apparentID);
if (gDungeon->fixedRoomNumber != FIXED_ROOM_FROSTY_GROTTO_ARTICUNO
&& gDungeon->fixedRoomNumber != FIXED_ROOM_MT_BLAZE_PEAK_MOLTRES
&& gDungeon->fixedRoomNumber != FIXED_ROOM_WESTERN_CAVE_MEWTWO
&& gDungeon->fixedRoomNumber != FIXED_ROOM_MT_FARAWAY_HO_OH
) {
if (gDungeon->fixedRoomNumber >= FIXED_ROOM_TEAM_SHIFTY_BOSS
&& gDungeon->fixedRoomNumber <= FIXED_ROOM_RESCUE_TEAM_2_BOSS
) {
if (gDungeon->unk644.unk18 == 0)
return FALSE;
}
else if (gDungeon->fixedRoomNumber == FIXED_ROOM_RESCUE_TEAM_MAZE_BOSS) {
if (gDungeon->unk644.unk15 == 0)
return FALSE;
if (!sub_8097900(MONSTER_DEOXYS_NORMAL))
return FALSE;
}
else if (!IsRecruitingEnabled(gDungeon->unk644.dungeonLocation.id)) {
return FALSE;
}
}
if (gDungeon->unk644.unk19 != 0)
return FALSE;
// Legendaries can only be recruited once.
if ((targetInfo->id == MONSTER_ARTICUNO ||
targetInfo->id == MONSTER_ZAPDOS ||
targetInfo->id == MONSTER_MOLTRES ||
targetInfo->id == MONSTER_ENTEI ||
targetInfo->id == MONSTER_RAIKOU ||
targetInfo->id == MONSTER_SUICUNE ||
targetInfo->id == MONSTER_LATIAS ||
targetInfo->id == MONSTER_LATIOS ||
targetInfo->id == MONSTER_JIRACHI ||
targetInfo->id == MONSTER_RAYQUAZA ||
targetInfo->id == MONSTER_DEOXYS_NORMAL ||
targetInfo->id == MONSTER_REGIROCK ||
targetInfo->id == MONSTER_REGICE ||
targetInfo->id == MONSTER_REGISTEEL)
&& HasRecruitedMon(targetInfo->id))
{
return FALSE;
}
if (!sub_806F9BC(targetInfo->id))
return FALSE;
if (abs((attacker->pos).x - (target->pos).x) >= 2 || abs((attacker->pos).y - (target->pos).y) >= 2)
return FALSE;
if (targetInfo->joinedAt.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON)
return FALSE;
if (targetInfo->monsterBehavior == 1)
return FALSE;
if (!CanSeeTarget(target,attacker))
return FALSE;
sub_806F910();
rand = DungeonRandInt(1000);
recruitRate = GetRecruitRate(targetInfo->id);
if (recruitRate == -999)
return FALSE;
if (HasHeldItem(attacker, ITEM_FRIEND_BOW)) {
recruitRate += gFriendBowRecruitRateUpValue;
}
recruitRate += gRecruitRateByLevel[attackerInfo->level];
if (rand >= recruitRate)
return FALSE;
for (i = 0; i <= (6 - size); i++) {
s32 j;
for (j = 0; j < size; j++) {
if (gUnknown_202EE70[i + j] != 0)
break;
}
if (j == size) {
foundIndex = i;
break;
}
}
if (foundIndex == -1) {
nullsub_96(attacker, target);
return FALSE;
}
for (i = 0; i < 4; i++) {
if (!DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[i]))
break;
}
if (i == 4) {
nullsub_96(attacker, target);
return FALSE;
}
for (i = 0; i < 4; i++) {
if (!EntityIsValid(gDungeon->teamPokemon[i]))
break;
}
if (i == 4) {
nullsub_96(attacker, target);
return FALSE;
}
return TRUE;
}
void nullsub_96(Entity *pokemon,Entity *target)
{}
void sub_806F910(void)
{
u8 size;
s32 counter;
Entity *entity;
int totalSize;
int index;
s32 sVar6;
totalSize = 0;
for(index = 0, sVar6 = 0x40; index < MAX_TEAM_MEMBERS; index++)
{
entity = gDungeon->teamPokemon[index];
if (EntityIsValid(entity)) {
size = GetBodySize(GetEntInfo(entity)->apparentID);
entity->axObj.unk40_maybeAnimTimer = sVar6;
GetEntInfo(entity)->unk167 = index;
GetEntInfo(entity)->unk168 = size;
for (counter = 0; counter < size; counter++) {
if (totalSize < MAX_TEAM_BODY_SIZE) {
gUnknown_202EE70[totalSize] = 1;
sVar6 += 0x10;
totalSize++;
}
}
sub_806CCB4(entity,sub_806CEBC(entity));
}
}
for (; totalSize < MAX_TEAM_BODY_SIZE; totalSize++) {
gUnknown_202EE70[totalSize] = 0;
}
}
bool8 sub_806F9BC(s16 species)
{
u8 friendArea;
s32 id;
FriendAreaCapacity auStack_18;
id = species;
if (!gDungeon->unk644.canRecruit) {
return FALSE;
}
else if (!sub_808529C(id)) {
return FALSE;
}
else if (id == MONSTER_MEW && gDungeon->unk644.unk34 == 1) {
return FALSE;
}
else if (id == MONSTER_LATIAS)
{
return FALSE;
}
else if (id == MONSTER_LATIOS)
{
return FALSE;
}
else if (id == MONSTER_DEOXYS_ATTACK)
{
return FALSE;
}
else if (id == MONSTER_DEOXYS_DEFENSE)
{
return FALSE;
}
else if (id == MONSTER_DEOXYS_SPEED)
{
return FALSE;
}
else {
if (GetUnk12(id) == 0) {
friendArea = GetFriendArea(id);
GetFriendAreaCapacity2(friendArea, &auStack_18, FALSE, FALSE);
if (auStack_18.hasFriendArea == FALSE)
return FALSE;
}
return TRUE;
}
}
bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *param_3)
{
u8 friendArea;
bool8 flag;
Entity *leader;
DungeonMon *pokeStruct2;
int pokeIndex;
Entity *local_2c;
s32 iVar2;
u32 direction;
direction = GetDirectionTowardsPosition(&entity2->pos,&entity1->pos);
flag = FALSE;
friendArea = GetFriendArea(param_3->id);
entity2->unk22 = 0;
sub_807A0CC(entity1, entity2);
sub_806CE68(entity2, direction);
CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[0],param_3->id);
if (DisplayDungeonYesNoMessage(0,gUnknown_80F9FE8,1) == 0) {
if (param_3->id != MONSTER_JIRACHI) {
LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA004);
}
return 0;
}
else
{
for(pokeIndex = 0; pokeIndex < MAX_TEAM_MEMBERS; pokeIndex++)
{
if (!(DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[pokeIndex])))
break;
}
if (pokeIndex == MAX_TEAM_MEMBERS) {
LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA030);
return FALSE;
}
else {
if (GetFriendAreaStatus(friendArea) == 0) {
UnlockFriendArea(friendArea);
flag = TRUE;
}
HandleFaint(entity2,DUNGEON_EXIT_TRANSFORMED_INTO_FRIEND,entity1);
pokeStruct2 = &gRecruitedPokemonRef->dungeonTeam[pokeIndex];
pokeStruct2->flags = POKEMON_FLAG_EXISTS | POKEMON_FLAG_ON_TEAM;
pokeStruct2->isTeamLeader = FALSE;
pokeStruct2->level = param_3->level;
pokeStruct2->IQ = 1;
SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE);
pokeStruct2->hiddenPower = param_3->hiddenPower;
pokeStruct2->tacticIndex = 0;
pokeStruct2->recruitedPokemonId = -1;
pokeStruct2->unkC = pokeIndex;
pokeStruct2->speciesNum = param_3->id;
(pokeStruct2->dungeonLocation) = gDungeon->unk644.dungeonLocation;
pokeStruct2->unk10 = param_3->HP;
pokeStruct2->unk12 = param_3->HP;
pokeStruct2->belly = param_3->belly;
pokeStruct2->maxBelly = param_3->maxBelly;
for(iVar2 = 0; iVar2 < 2; iVar2++)
{
pokeStruct2->offense.att[iVar2] = param_3->att[iVar2];
pokeStruct2->offense.def[iVar2] = param_3->def[iVar2];
}
pokeStruct2->currExp = param_3->exp;
pokeStruct2->moves = param_3->moves;
pokeStruct2->itemSlot = param_3->heldItem;
BoundedCopyStringtoBuffer(pokeStruct2->name,GetMonSpecies(param_3->id),10);
IncrementAdventureNumJoined();
if (SpawnTeamMember(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) {
LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA058);
pokeStruct2->flags = 0;
}
else {
sub_8083D88();
sub_803E708(0xa0,0x46);
if (DisplayDungeonYesNoMessage(0,gUnknown_80FA090,1) == 1) {
while (DungeonGiveNameToRecruitedMon(pokeStruct2->name) == 0) {
DisplayDungeonMessage(0,gUnknown_80FA0C8,1);
}
}
sub_808D9DC(gFormatBuffer_Monsters[0],pokeStruct2,0);
LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA0F0);
if (flag) {
leader = CutsceneGetLeader();
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0);
sub_8092558(gFormatBuffer_FriendArea,friendArea);
PlaySound(0xce);
DisplayDungeonMessage(0,gUnknown_80FA120,1);
}
if (param_3->id == MONSTER_MEW) {
gDungeon->unk4 = 1;
gDungeon->unk11 = 3;
}
}
return TRUE;
}
}
}
bool8 sub_806FD18(Entity *param_1)
{
s32 i, j;
EntityInfo *info = GetEntInfo(param_1);
s32 validIndex = -1;
s32 size = GetBodySize(info->apparentID);
if (!sub_806F9BC(info->id))
return FALSE;
sub_806F910();
for (i = 0; i <= (6 - size); i++) {
for (j = 0; j < size; j++){
if (gUnknown_202EE70[i + j] != 0)
break;
}
if (j == size) {
validIndex = i;
break;
}
}
if (validIndex == -1)
return FALSE;
for (i = 0; i < 4; i++) {
if (!(DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[i])))
break;
}
if (i == 4)
return FALSE;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
if(!EntityIsValid(gDungeon->teamPokemon[i]))
break;
}
if (i == MAX_TEAM_MEMBERS)
return FALSE;
return TRUE;
}
bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
{
u8 friendArea;
bool8 flag;
Entity *leader;
DungeonMon *pokeStruct2;
int index;
struct unkStruct_8069D4C local_74;
Entity *local_2c;
u8 *buffer;
s32 index2;
flag = 0;
*entityPtr = NULL;
sub_8069D4C(&local_74,entity2);
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
if (!DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[index])) break;
}
if (index == MAX_TEAM_MEMBERS) {
return FALSE;
}
else {
friendArea = GetFriendArea(local_74.id);
pokeStruct2 = &gRecruitedPokemonRef->dungeonTeam[index];
pokeStruct2->flags = POKEMON_FLAG_EXISTS | POKEMON_FLAG_ON_TEAM;
pokeStruct2->isTeamLeader = FALSE;
pokeStruct2->level = local_74.level;
pokeStruct2->IQ = 1;
SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE);
pokeStruct2->hiddenPower = local_74.hiddenPower;
pokeStruct2->tacticIndex = 0;
pokeStruct2->recruitedPokemonId = -1;
pokeStruct2->unkC = index;
pokeStruct2->speciesNum = local_74.id;
pokeStruct2->dungeonLocation = gDungeon->unk644.dungeonLocation;
pokeStruct2->unk10 = local_74.HP;
pokeStruct2->unk12 = local_74.HP;
pokeStruct2->belly = local_74.belly;
pokeStruct2->maxBelly = local_74.maxBelly;
for(index2 = 0; index2 < 2; index2++)
{
pokeStruct2->offense.att[index2] = local_74.att[index2];
pokeStruct2->offense.def[index2] = local_74.def[index2];
}
pokeStruct2->currExp = local_74.exp;
pokeStruct2->moves = local_74.moves;
pokeStruct2->itemSlot = local_74.heldItem;
buffer = pokeStruct2->name;
BoundedCopyStringtoBuffer(buffer,GetMonSpecies(local_74.id), POKEMON_NAME_LENGTH);
if (GetFriendAreaStatus(friendArea) == 0) {
UnlockFriendArea(friendArea);
flag = TRUE;
}
IncrementAdventureNumJoined();
HandleFaint(entity2,DUNGEON_EXIT_TRANSFORMED_INTO_FRIEND,entity1);
if (SpawnTeamMember(local_74.id,local_74.pos.x,local_74.pos.y,pokeStruct2,&local_2c,0,0) == 0) {
pokeStruct2->flags = 0;
}
else {
if (DisplayDungeonYesNoMessage(0,gUnknown_80FA090,1) == 1) {
while (!DungeonGiveNameToRecruitedMon(buffer)) {
DisplayDungeonMessage(0,gUnknown_80FA0C8,1);
}
}
if (flag) {
leader = CutsceneGetLeader();
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0);
sub_8092558(gFormatBuffer_FriendArea,friendArea);
PlaySound(0xce);
DisplayDungeonMessage(0,gUnknown_80FA120,1);
}
sub_808D9DC(gFormatBuffer_Monsters[3],pokeStruct2,0);
*entityPtr = local_2c;
}
return TRUE;
}
}

View File

@ -5,7 +5,7 @@
#include "constants/weather.h" #include "constants/weather.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "dungeon_ai.h" #include "dungeon_ai.h"
#include "run_dungeon.h" #include "run_dungeon.h"
@ -18,7 +18,7 @@
#include "move_orb_effects_1.h" #include "move_orb_effects_1.h"
#include "moves.h" #include "moves.h"
#include "move_util.h" #include "move_util.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "weather.h" #include "weather.h"
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"

View File

@ -1,5 +1,6 @@
#include "global.h" #include "global.h"
#include "globaldata.h" #include "globaldata.h"
#include "dungeon_8041AD0.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/status.h" #include "constants/status.h"
#include "constants/type.h" #include "constants/type.h"
@ -11,9 +12,7 @@
#include "effect_sub_1.h" #include "effect_sub_1.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_8041AD0.h" #include "dungeon_mon_sprite_render.h"
#include "code_804267C.h"
#include "code_806CD90.h"
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_logic.h" #include "dungeon_logic.h"
#include "dungeon_util.h" #include "dungeon_util.h"
@ -36,25 +35,13 @@
// Unknown dungeon file. File split is correct. // Unknown dungeon file. File split is correct.
void EntityUpdateStatusSprites(Entity *entity);
extern void sub_800DBBC(void); extern void sub_800DBBC(void);
extern void sub_8042E98(void);
extern void sub_800EF28(u8); extern void sub_800EF28(u8);
extern void sub_80429A0(Entity *);
void sub_8042B34(s32 a0, s32 a1, s32 a2);
extern bool8 sub_8042CC0(void);
extern void sub_8042D7C(void);
extern void sub_800F15C(s32); extern void sub_800F15C(s32);
extern void sub_800EF40(u8 r0, u8 r1); extern void sub_800EF40(u8 r0, u8 r1);
extern s32 sub_800E6D8(s32); extern s32 sub_800E6D8(s32);
extern void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, s32 param_4, s32 param_5); extern void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, s32 param_4, s32 param_5);
s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3);
void sub_804178C(u8 param_1);
struct UnkStruct_80F6624 struct UnkStruct_80F6624
{ {
s16 unk0; s16 unk0;
@ -190,6 +177,9 @@ static const u32 sStatusSpriteMasks_MuzzledStatus[] = {
static s32 sub_8041550(Entity *entity, s32 a1, u8 a2, u8 a3, s32 a4, u8 a5); static s32 sub_8041550(Entity *entity, s32 a1, u8 a2, u8 a3, s32 a4, u8 a5);
static u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2); static u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2);
static void sub_8042B34(s32 a0, s32 a1, s32 a2);
static bool8 sub_8042CC0(void);
static void sub_8042D7C(void);
static s32 sub_804151C(Entity *entity, s32 r1, u8 r2) static s32 sub_804151C(Entity *entity, s32 r1, u8 r2)
{ {
@ -461,7 +451,7 @@ void sub_8041AF4(Entity *pokemon)
sub_80421C0(pokemon, 407); sub_80421C0(pokemon, 407);
} }
void nullsub_57(void) void nullsub_57(Entity *pokemon)
{ {
} }
@ -470,11 +460,11 @@ void sub_8041B18(Entity *pokemon)
sub_804151C(pokemon, 321, 1); sub_804151C(pokemon, 321, 1);
} }
void nullsub_58(void) void nullsub_58(Entity *pokemon)
{ {
} }
void nullsub_59(void) void nullsub_59(Entity *pokemon)
{ {
} }
@ -483,7 +473,7 @@ void sub_8041B34(Entity *pokemon)
sub_804151C(pokemon, 7, 1); sub_804151C(pokemon, 7, 1);
} }
void nullsub_60(void) void nullsub_60(Entity *pokemon)
{ {
} }
@ -492,7 +482,7 @@ void sub_8041B48(Entity *pokemon)
sub_804151C(pokemon, 4, 0); sub_804151C(pokemon, 4, 0);
} }
void nullsub_61(void) void nullsub_61(Entity *pokemon)
{ {
} }
@ -510,11 +500,11 @@ void sub_8041B74(Entity *pokemon)
sub_804151C(pokemon, 369, 0); sub_804151C(pokemon, 369, 0);
} }
void nullsub_63(void) void nullsub_63(Entity *pokemon)
{ {
} }
void nullsub_64(void) void nullsub_64(Entity *pokemon)
{ {
} }
@ -523,11 +513,11 @@ void sub_8041B90(Entity *pokemon)
sub_804151C(pokemon, 428, 0); sub_804151C(pokemon, 428, 0);
} }
void nullsub_65(void) void nullsub_65(Entity *pokemon)
{ {
} }
void nullsub_66(void) void nullsub_66(Entity *pokemon)
{ {
} }
@ -536,7 +526,7 @@ void sub_8041BA8(Entity *pokemon)
sub_804151C(pokemon, 4, 1); sub_804151C(pokemon, 4, 1);
} }
void nullsub_67(void) void nullsub_67(Entity *pokemon)
{ {
} }
@ -545,7 +535,7 @@ void sub_8041BBC(Entity *pokemon)
sub_804151C(pokemon, 424, 1); sub_804151C(pokemon, 424, 1);
} }
void nullsub_68(void) void nullsub_68(Entity *pokemon)
{ {
} }
@ -578,7 +568,7 @@ void sub_8041C1C(Entity *pokemon)
sub_804151C(pokemon, 423, 1); sub_804151C(pokemon, 423, 1);
} }
void nullsub_69(void) void nullsub_69(Entity *pokemon, Entity *target)
{ {
} }
@ -587,11 +577,11 @@ void sub_8041C34(Entity *pokemon)
sub_804151C(pokemon, 0x4C, 1); sub_804151C(pokemon, 0x4C, 1);
} }
void nullsub_70(void) void nullsub_70(Entity *pokemon)
{ {
} }
void nullsub_71(void) void nullsub_71(Entity *pokemon)
{ {
} }
@ -615,11 +605,11 @@ void sub_8041C7C(Entity *pokemon)
sub_804151C(pokemon, 0x9D << 1, 1); sub_804151C(pokemon, 0x9D << 1, 1);
} }
void nullsub_72(void) void nullsub_72(Entity *pokemon)
{ {
} }
void nullsub_73(void) void nullsub_73(Entity *pokemon)
{ {
} }
@ -653,7 +643,7 @@ void sub_8041CEC(Entity *pokemon)
sub_80421C0(pokemon, 0x19d); sub_80421C0(pokemon, 0x19d);
} }
void nullsub_74(void) void nullsub_74(Entity *pokemon)
{ {
} }
@ -697,7 +687,7 @@ void sub_8041D48(Entity * pokemon)
sub_80421C0(pokemon, 0x191); sub_80421C0(pokemon, 0x191);
} }
void nullsub_81(void) void nullsub_81(Entity *pokemon)
{ {
} }
@ -714,11 +704,11 @@ void sub_8041D84(Entity *pokemon)
sub_80421C0(pokemon, 0x19f); sub_80421C0(pokemon, 0x19f);
} }
void nullsub_82(void) void nullsub_82(Entity *pokemon)
{ {
} }
void nullsub_83(void) void nullsub_83(Entity *pokemon)
{ {
} }
@ -732,42 +722,41 @@ void sub_8041DB0(Entity *pokemon)
sub_804151C(pokemon, 0x30, 1); sub_804151C(pokemon, 0x30, 1);
} }
void nullsub_84(void) void nullsub_84(Entity *pokemon)
{ {
} }
void nullsub_85(void) void nullsub_85(Entity *pokemon)
{ {
} }
void nullsub_204(void) UNUSED static void nullsub_204(void)
{ {
} }
void nullsub_86(void) void nullsub_86(Entity *pokemon)
{ {
} }
void nullsub_87(void) void nullsub_87(Entity *pokemon)
{ {
} }
void nullsub_88(void) void nullsub_88(Entity *pokemon)
{ {
} }
void sub_8041DD8(Entity *pokemon, s16 r1) void sub_8041DD8(Entity *pokemon, s32 r1)
{ {
u32 temp; s32 temp = (s16) r1;
temp = r1;
if(MonsterIsType(pokemon, TYPE_GHOST) != 0) if (MonsterIsType(pokemon, TYPE_GHOST))
sub_804151C(pokemon, temp, 1); sub_804151C(pokemon, temp, 1);
else else
sub_804151C(pokemon, TYPE_GHOST, 1); sub_804151C(pokemon, TYPE_GHOST, 1);
} }
void nullsub_89(void) void nullsub_89(Entity *pokemon)
{ {
} }
@ -847,7 +836,7 @@ void sub_8041F08(Entity *pokemon)
sub_8041550(pokemon, 0x15, 1, 3, 2, 0); sub_8041550(pokemon, 0x15, 1, 3, 2, 0);
} }
void nullsub_90(void) void nullsub_90(Entity *pokemon)
{ {
} }
@ -983,16 +972,16 @@ void sub_8042080(Entity *pokemon, u32 r1)
} }
} }
void sub_80420A0(Entity *pokemon, u32 r1) void sub_80420A0(Entity *pokemon)
{ {
sub_804151C(pokemon, 0x143, 1); sub_804151C(pokemon, 0x143, 1);
} }
void nullsub_91(void) void nullsub_91(Entity *pokemon)
{ {
} }
void sub_80420B8(Entity *pokemon, u32 r1) void sub_80420B8(Entity *pokemon)
{ {
sub_804151C(pokemon, 0x19, 1); sub_804151C(pokemon, 0x19, 1);
} }
@ -1038,7 +1027,7 @@ void sub_8042148(Entity *pokemon)
sub_804151C(pokemon, 0x9F << 1, 1); sub_804151C(pokemon, 0x9F << 1, 1);
} }
void nullsub_93() void nullsub_93(DungeonPos *pos)
{ {
} }
@ -1299,7 +1288,7 @@ void sub_80426C8(u32 a0, u32 a1)
sub_8052210(1); sub_8052210(1);
} }
void sub_8042730(Entity *a0, void *unused) void sub_8042730(Entity *a0, Entity *unused)
{ {
s32 i; s32 i;
@ -1513,7 +1502,7 @@ void sub_8042A74(Entity *r0)
sub_804151C(r0, 0x18, 1); sub_804151C(r0, 0x18, 1);
} }
void sub_8042A84(s16 param_1, Entity *entity, u32 param_3) static void sub_8042A84(s16 param_1, Entity *entity, u32 param_3)
{ {
s32 iVar3; s32 iVar3;
s32 r6; s32 r6;
@ -1549,7 +1538,7 @@ void sub_8042B20(Entity *entity)
static const unkStruct_2039DB0 gUnknown_80F683C = DEFAULT_UNK_2039DB0_MASKS; static const unkStruct_2039DB0 gUnknown_80F683C = DEFAULT_UNK_2039DB0_MASKS;
void sub_8042B34(s32 a0, s32 a1, s32 a2) static void sub_8042B34(s32 a0, s32 a1, s32 a2)
{ {
unkStruct_80416E0 spStruct; unkStruct_80416E0 spStruct;
s32 i; s32 i;
@ -1593,7 +1582,7 @@ void sub_8042B34(s32 a0, s32 a1, s32 a2)
} }
} }
bool8 sub_8042CC0(void) static bool8 sub_8042CC0(void)
{ {
s32 i; s32 i;
bool8 ret = FALSE; bool8 ret = FALSE;
@ -1623,7 +1612,7 @@ bool8 sub_8042CC0(void)
return ret; return ret;
} }
void sub_8042D7C(void) static void sub_8042D7C(void)
{ {
s32 i; s32 i;

View File

@ -1,118 +0,0 @@
#include "global.h"
#include "globaldata.h"
#include "constants/tactic.h"
#include "dungeon_config.h"
#include "dungeon_range.h"
#include "dungeon_message.h"
#include "code_8041AD0.h"
#include "constants/dungeon.h"
#include "dungeon_map_access.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon_info.h"
#include "pokemon_3.h"
#include "code_805D8C8.h"
#include "dungeon_logic.h"
#include "dungeon_floor_spawns.h"
#include "dungeon_strings.h"
#include "dungeon_misc.h"
#include "dungeon_mon_spawn.h"
extern void sub_8042920(struct Entity *r0);
void sub_8071B48(void)
{
const Tile *tile;
struct Entity *entity2;
struct Entity *entity;
int index;
int index1;
int counter;
struct Entity *entityPtr;
s32 level;
struct Dungeon *dungeon; // feels like a hack
struct MonSpawnInfo local_2c;
entityPtr = NULL;
dungeon = gDungeon;
if ((dungeon->unk644.unk20 != 0) &&
((dungeon->unk644.dungeonLocation.id != DUNGEON_METEOR_CAVE || (dungeon->unk37FD == 0)))) {
dungeon->unk644.unk1E++;
if (dungeon->unk644.unk2A == 0) {
if ( dungeon->unk644.unk1E < gUnknown_80F4DAA) {
return;
}
}
else {
if ( dungeon->unk644.unk1E < gUnknown_80F4DAC) {
return;
}
}
if (dungeon->unk644.unk1E > 900) {
entity2 = dungeon->unk17B34;
if ((EntityIsValid(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) {
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity2,0);
entityPtr = entity2;
}
}
dungeon->unk644.unk1E = 0;
dungeon->unk17B34 = NULL;
counter = 0;
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
entity = dungeon->wildPokemon[index];
if ((EntityIsValid(entity)) &&
(tile = GetTile((entity->pos).x, (entity->pos).y),
(tile->terrainFlags & TERRAIN_TYPE_UNBREAKABLE) == 0)) {
counter++;
}
}
if (dungeon->unk644.unk2A == 0) {
if (gDungeon->monsterHouseRoom == CORRIDOR_ROOM) {
if (counter >= gUnknown_80F4DA6) {
return;
}
}
else
{
if (counter >= gUnknown_80F4DA8) {
return;
}
}
}
if (entityPtr != NULL) {
DisplayDungeonLoggableMessageTrue(0,gUnknown_80FED68);
sub_8042920(entityPtr);
}
if (dungeon->unk644.unk2A != 0) {
index1 = 0x17c;
}
else {
index1 = GetRandomFloorMonsterId(0);
}
level = GetSpawnedMonsterLevel(index1);
if (level == 0) {
level = 1;
}
if ((sub_806AA0C(index1, 0)) && (sub_8083660(&local_2c.pos))) {
local_2c.species = index1;
local_2c.level = level;
local_2c.unk2 = 0;
if(DungeonRandInt(100) < GetRandomMovementChance(gDungeon->unk644.dungeonLocation.id))
{
local_2c.unk4 = 1;
}
else
{
local_2c.unk4 = 0;
}
local_2c.unk10 = 0;
SpawnWildMon(&local_2c, FALSE);
}
}
}

View File

@ -1,114 +0,0 @@
#include "global.h"
#include "globaldata.h"
#include "constants/dungeon_exit.h"
#include "dungeon_8083AB0.h"
#include "dungeon_info.h"
#include "dungeon_util.h"
#include "text_util.h"
#include "dungeon_logic.h"
#include "dungeon_data.h"
#include "dungeon_strings.h"
#include "run_dungeon.h"
void sub_8083AB0(s16 dungeonExitReason_, Entity *target, Entity *entity)
{
u8 *defPtr;
u8 *attackPtr;
u8 *spDefPtr;
EntityInfo * entityInfo;
EntityInfo * targetEntityInfo;
u8 *spAttPtr;
u8 buffer [0x14];
DungeonExitSummary *exitSummary;
u8 *id;
s32 dungeonExitReason = dungeonExitReason_;
exitSummary = &gDungeon->exitSummary;
targetEntityInfo = NULL;
if ((EntityIsValid(target)) && (GetEntityType(target) == ENTITY_MONSTER)) {
targetEntityInfo = GetEntInfo(target);
}
entityInfo = GetEntInfo(entity);
if (targetEntityInfo != NULL) {
CopyEntityNameForDungeonExitSummary(buffer, targetEntityInfo);
CopyStringtoBuffer(exitSummary->buffer1, buffer);
}
else {
CopyStringtoBuffer(exitSummary->buffer1, gUnknown_80FE6F4); // Someone
}
CopyEntityNameForDungeonExitSummary(buffer,entityInfo);
CopyStringtoBuffer(exitSummary->buffer2, buffer);
exitSummary->exitReason = dungeonExitReason;
exitSummary->heldItem = entityInfo->heldItem;
exitSummary->exp = entityInfo->exp;
exitSummary->level = entityInfo->level;
exitSummary->maxHPStat = entityInfo->maxHPStat;
exitSummary->atk = entityInfo->atk[0];
exitSummary->spAtk = entityInfo->atk[1];
exitSummary->def = entityInfo->def[0];
exitSummary->spDef = entityInfo->def[1];
exitSummary->dungeonLocation = gDungeon->unk644.dungeonLocation;
attackPtr = &exitSummary->attBoost;
*attackPtr = 0;
spAttPtr = &exitSummary->spAttBoost;
*spAttPtr = 0;
defPtr = &exitSummary->defBoost;
*defPtr = 0;
spDefPtr = &exitSummary->spDefBoost;
*spDefPtr = 0;
if ((entityInfo->heldItem.flags & ITEM_FLAG_EXISTS) && !(entityInfo->heldItem.flags & ITEM_FLAG_STICKY)) {
id = &entityInfo->heldItem.id;
if (*id == ITEM_POWER_BAND) {
*attackPtr += gUnknown_810AC60;
}
if (*id == ITEM_MUNCH_BELT) {
*attackPtr += gUnknown_810AC68;
}
if (*id == ITEM_SPECIAL_BAND) {
*spAttPtr += gUnknown_810AC62;
}
if (*id == ITEM_MUNCH_BELT) {
*spAttPtr += gUnknown_810AC68;
}
if (*id == ITEM_DEF_SCARF) {
*defPtr += gUnknown_810AC64;
}
if (*id == ITEM_ZINC_BAND) {
*spDefPtr += gUnknown_810AC66;
}
}
}
bool8 IsUnsuccessfulDungeonExit(void)
{
DungeonExitSummary *exitSummary = &gDungeon->exitSummary;
if (exitSummary->exitReason < DUNGEON_EXIT_REASON_SUCCESS)
return TRUE;
return FALSE;
}
bool8 sub_8083C50(void)
{
DungeonExitSummary *exitSummary = &gDungeon->exitSummary;
if (exitSummary->exitReason == DUNGEON_EXIT_CLEARED_DUNGEON
|| exitSummary->exitReason == DUNGEON_EXIT_BEFRIENDED_MEW
|| exitSummary->exitReason == DUNGEON_EXIT_SUCCEEDED_IN_RESCUE_MISSION)
return TRUE;
return FALSE;
}
bool8 sub_8083C88(u8 param_1)
{
DungeonExitSummary *exitSummary = &gDungeon->exitSummary;
if ((!HasCheckpoint(gDungeon->unk644.dungeonLocation.id) && (gDungeon->unk644.unk18 != 0 || param_1 != 0))
|| exitSummary->exitReason != DUNGEON_EXIT_CLEARED_DUNGEON) {
return TRUE;
}
return FALSE;
}

View File

@ -4,8 +4,7 @@
#include "dungeon_ai_leader.h" #include "dungeon_ai_leader.h"
#include "dungeon_move_util.h" #include "dungeon_move_util.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h"
#include "code_8066D04.h" #include "code_8066D04.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "constants/dungeon_action.h" #include "constants/dungeon_action.h"
@ -42,7 +41,6 @@
#include "dungeon_entity_movement.h" #include "dungeon_entity_movement.h"
void sub_8075BA4(Entity *param_1, u8 param_2); void sub_8075BA4(Entity *param_1, u8 param_2);
void sub_804178C(u8 param_1);
void nullsub_95(Entity *); void nullsub_95(Entity *);
extern void sub_80671A0(Entity *); extern void sub_80671A0(Entity *);
extern void sub_8067110(Entity *); extern void sub_8067110(Entity *);

View File

@ -3,7 +3,7 @@
#include "dungeon_ai_attack.h" #include "dungeon_ai_attack.h"
#include "dungeon_move_util.h" #include "dungeon_move_util.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_action.h" #include "constants/dungeon_action.h"
#include "constants/iq_skill.h" #include "constants/iq_skill.h"

View File

@ -20,11 +20,10 @@
const s16 gMonsterHouseMaxItemsTraps = 7; // Items and traps are included together const s16 gMonsterHouseMaxItemsTraps = 7; // Items and traps are included together
const s16 gMonsterHouseMinMons = 8; const s16 gMonsterHouseMinMons = 8;
const s16 gMonsterHouseMaxMons = 12; const s16 gMonsterHouseMaxMons = 12;
// ? See sub_8071B48 const s16 gMaxWildMonsInMonsterHouse = 10;
const s16 gUnknown_80F4DA6 = 10; const s16 gMaxWildMonsInRoom = 4;
const s16 gUnknown_80F4DA8 = 4; const s16 gWildSpawnIntervalFrames = 36;
const s16 gUnknown_80F4DAA = 36; const s16 gKecleonSpawnIntervalFrames = 5;
const s16 gUnknown_80F4DAC = 5;
const s16 gCritOddsScopeLensPatsyBand = 40; const s16 gCritOddsScopeLensPatsyBand = 40;
const s16 gCritOddsIqAdvantageMaster = 40; const s16 gCritOddsIqAdvantageMaster = 40;

View File

@ -19,7 +19,7 @@
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_range.h" #include "dungeon_range.h"
#include "random.h" #include "random.h"
#include "math.h" #include "math.h"

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -33,12 +32,8 @@
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
#include "weather.h" #include "weather.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_8088484(Entity *param_1); static void sub_8088484(Entity *param_1);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,13 +31,10 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "weather.h" #include "weather.h"
#include "dungeon_mon_recruit.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_808C8E0(Entity *entity); static void sub_808C8E0(Entity *entity);
@ -78,7 +74,7 @@ void CelebiJoinDialogue(void)
leaderEntity = CutsceneGetLeader(); leaderEntity = CutsceneGetLeader();
celebiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_CELEBI); celebiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_CELEBI);
if ((HasRecruitedMon(MONSTER_CELEBI)) || (!sub_806FD18(celebiEntity))) if ((HasRecruitedMon(MONSTER_CELEBI)) || (!CanEntityBeRecruited(celebiEntity)))
{ {
HandleFaint(celebiEntity,DUNGEON_EXIT_DELETED_FOR_EVENT,0); HandleFaint(celebiEntity,DUNGEON_EXIT_DELETED_FOR_EVENT,0);
SpriteLookAroundEffect(leaderEntity); SpriteLookAroundEffect(leaderEntity);
@ -141,7 +137,7 @@ void CelebiJoinDialogue(void)
sub_803E708(0x1c,0x46); sub_803E708(0x1c,0x46);
DisplayDungeonDialogue(&gCelebiJoinDialogue_4); DisplayDungeonDialogue(&gCelebiJoinDialogue_4);
sub_803E708(10,0x46); sub_803E708(10,0x46);
sub_806FDF4(leaderEntity,celebiEntity,&celebiEntity); HandleSpecialEntityJoinSequence(leaderEntity,celebiEntity,&celebiEntity);
DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST);
DisplayDungeonDialogue(&gCelebiJoinDialogue_5); DisplayDungeonDialogue(&gCelebiJoinDialogue_5);
sub_803E708(10,0x46); sub_803E708(10,0x46);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,12 +31,8 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void DeoxysScreenFlash(void); static void DeoxysScreenFlash(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/friend_area.h" #include "constants/friend_area.h"

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void EnteiScreenFlash(void); static void EnteiScreenFlash(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -33,12 +32,8 @@
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void SceneGroudonMovement(Entity * groudonEntity); static void SceneGroudonMovement(Entity * groudonEntity);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void HoOhDropInEffect(Entity * param_1); static void HoOhDropInEffect(Entity * param_1);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -33,13 +32,10 @@
#include "dungeon_floor_spawns.h" #include "dungeon_floor_spawns.h"
#include "dungeon_map.h" #include "dungeon_map.h"
#include "dungeon_mon_spawn.h" #include "dungeon_mon_spawn.h"
#include "dungeon_8041AD0.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_808B50C(void); static void sub_808B50C(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -33,12 +32,8 @@
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "dungeon_map.h" #include "dungeon_map.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void nullsub_99(void); static void nullsub_99(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,12 +31,8 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void LatiosScreenFlash(void); static void LatiosScreenFlash(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,12 +31,8 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void LugiaScreenFlash(void); static void LugiaScreenFlash(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_80891F0(void); static void sub_80891F0(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_80898F8(Entity *r0); static void sub_80898F8(Entity *r0);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/friend_area.h" #include "constants/friend_area.h"
@ -30,12 +29,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_8087144(void); static void sub_8087144(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
void sub_808C9C4(void) void sub_808C9C4(void)

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void MewtwoDropInEffect(Entity *mewtwoEntity); static void MewtwoDropInEffect(Entity *mewtwoEntity);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -33,12 +32,8 @@
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void MoltresDropInEffect(Entity * moltresEntity); static void MoltresDropInEffect(Entity * moltresEntity);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,12 +31,8 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
#include "weather.h" #include "weather.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void RaikouScreenFlash(void); static void RaikouScreenFlash(void);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,12 +31,8 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void RayquazaDropInEffect(Entity *rayquazaEntity); static void RayquazaDropInEffect(Entity *rayquazaEntity);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,12 +31,8 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
#include "dungeon_map.h" #include "dungeon_map.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_808B1CC(u8 itemID); static void sub_808B1CC(u8 itemID);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void SkarmoryEntry(Entity * skarmoryEntity); static void SkarmoryEntry(Entity * skarmoryEntity);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
void DummyFightDialogue(void) void DummyFightDialogue(void)

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -31,12 +30,8 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
static void sub_808A528(Entity * param_1); static void sub_808A528(Entity * param_1);

View File

@ -3,9 +3,8 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h" #include "dungeon_mon_sprite_render.h"
#include "code_806CD90.h"
#include "constants/bg_music.h" #include "constants/bg_music.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -32,12 +31,8 @@
#include "dungeon_boss_dialogue.h" #include "dungeon_boss_dialogue.h"
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);
extern void sub_8049884(void); extern void sub_8049884(void);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
extern void sub_8041888(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *); extern void sub_8052D44(s16 *, Entity *, Entity *);
struct Zapdos1 struct Zapdos1

View File

@ -27,12 +27,11 @@
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
#include "weather.h" #include "weather.h"
#include "game_options.h" #include "game_options.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/dungeon.h" #include "constants/dungeon.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_data.h" #include "dungeon_data.h"
@ -44,34 +43,17 @@
#include "exclusive_pokemon.h" #include "exclusive_pokemon.h"
#include "hurl_orb.h" #include "hurl_orb.h"
#include "dungeon_mon_spawn.h" #include "dungeon_mon_spawn.h"
#include "dungeon_mon_recruit.h"
#include "move_orb_actions_1.h" #include "move_orb_actions_1.h"
#include "move_orb_effects_2.h" #include "move_orb_effects_2.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"
extern void sub_8041B18(Entity *pokemon);
extern void sub_8041B90(Entity *pokemon);
extern void sub_8041D00(Entity *pokemon, Entity *target);
extern void sub_8042238(Entity *pokemon, Entity *target);
extern void sub_803ED30(s32, Entity *r0, u8, s32); extern void sub_803ED30(s32, Entity *r0, u8, s32);
extern bool8 sub_806A458(Entity *); extern bool8 sub_806A458(Entity *);
extern bool8 TryRecruitMonster(Entity *attacker, Entity *target);
extern bool8 sub_806A58C(s16 a0); extern bool8 sub_806A58C(s16 a0);
extern void sub_8042148(Entity *pokemon);
extern void sub_8042A24(Entity *r0);
extern void sub_806A390(Entity *r0); extern void sub_806A390(Entity *r0);
extern void sub_800DBBC(void); extern void sub_800DBBC(void);
extern bool8 sub_806FA5C(Entity *, Entity *, struct unkStruct_8069D4C *);
extern void EntityUpdateStatusSprites(Entity *);
extern void PointCameraToMonster(Entity *); extern void PointCameraToMonster(Entity *);
extern void sub_8041B74(Entity *pokemon);
extern void sub_8041B5C(Entity *pokemon);
extern void sub_8042940(Entity *r0);
extern void sub_80428B0(Entity *r0);
extern void sub_80428C4(Entity *r0);
extern void sub_80428D8(Entity *);
extern void sub_8042978(Entity *);
extern void sub_804298C(Entity *);
extern void sub_80428EC(Entity *);
static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struct DamageStruct *r5, bool32 isFalseSwipe, bool32 giveExp, s16 dungeonExitReason_, s32 arg8); static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struct DamageStruct *r5, bool32 isFalseSwipe, bool32 giveExp, s16 dungeonExitReason_, s32 arg8);
static bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, DamageStruct *dmgStruct); static bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, DamageStruct *dmgStruct);
@ -737,7 +719,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
sub_8069D4C(&sp, target); sub_8069D4C(&sp, target);
if (TryRecruitMonster(attacker, target)) { if (TryRecruitMonster(attacker, target)) {
if (!sub_806FA5C(attacker, target, &sp)) { if (!HandleMonsterJoinSequence(attacker, target, &sp)) {
HandleFaint(target, DUNGEON_EXIT_LEFT_WITHOUT_BEING_BEFRIENDED, attacker); HandleFaint(target, DUNGEON_EXIT_LEFT_WITHOUT_BEING_BEFRIENDED, attacker);
} }
else { else {
@ -1225,30 +1207,30 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3
rand = DungeonRandInt(100); rand = DungeonRandInt(100);
if (splitIndex == 0) { if (splitIndex == 0) {
if (HasHeldItem(attacker, ITEM_POWER_BAND)) { if (HasHeldItem(attacker, ITEM_POWER_BAND)) {
atkStat += gUnknown_810AC60; atkStat += gPowerBandBoost;
gDungeon->unk134.unk160 += gUnknown_810AC60; gDungeon->unk134.unk160 += gPowerBandBoost;
} }
if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) {
atkStat += gUnknown_810AC68; atkStat += gMunchBeltBoost;
gDungeon->unk134.unk160 += gUnknown_810AC68; gDungeon->unk134.unk160 += gMunchBeltBoost;
} }
if (arg_10 && HasHeldItem(target, ITEM_DEF_SCARF)) { if (arg_10 && HasHeldItem(target, ITEM_DEF_SCARF)) {
defStat += gUnknown_810AC64; defStat += gDefScarfBoost;
gDungeon->unk134.unk162 += gUnknown_810AC64; gDungeon->unk134.unk162 += gDefScarfBoost;
} }
} }
else { else {
if (arg_10 && HasHeldItem(target, ITEM_ZINC_BAND)) { if (arg_10 && HasHeldItem(target, ITEM_ZINC_BAND)) {
defStat += gUnknown_810AC66; defStat += gZincBandBoost;
gDungeon->unk134.unk163 += gUnknown_810AC66; gDungeon->unk134.unk163 += gZincBandBoost;
} }
if (HasHeldItem(attacker, ITEM_SPECIAL_BAND)) { if (HasHeldItem(attacker, ITEM_SPECIAL_BAND)) {
atkStat += gUnknown_810AC62; atkStat += gSpecialBandBoost;
gDungeon->unk134.unk161 += gUnknown_810AC62; gDungeon->unk134.unk161 += gSpecialBandBoost;
} }
if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) {
atkStat += gUnknown_810AC68; atkStat += gMunchBeltBoost;
gDungeon->unk134.unk161 += gUnknown_810AC68; gDungeon->unk134.unk161 += gMunchBeltBoost;
} }
} }

View File

@ -455,11 +455,11 @@ const FriendAreaSettings gFriendAreaSettings[NUM_FRIEND_AREAS] =
}, },
}; };
const s16 gUnknown_810AC60 = 12; const s16 gPowerBandBoost = 12;
const s16 gUnknown_810AC62 = 12; const s16 gSpecialBandBoost = 12;
const s16 gUnknown_810AC64 = 8; const s16 gDefScarfBoost = 8;
const s16 gUnknown_810AC66 = 8; const s16 gZincBandBoost = 8;
const s16 gUnknown_810AC68 = 8; const s16 gMunchBeltBoost = 8;
const u8 gBestResistTypeTable[NUM_TYPES] = const u8 gBestResistTypeTable[NUM_TYPES] =
{ {

View File

@ -19,11 +19,11 @@
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "menu_input.h" #include "menu_input.h"
#include "weather.h" #include "weather.h"
#include "dungeon_wild_mon_spawn.h"
#include "dungeon_entity_movement.h"
#include "dungeon_wind.h"
extern void sub_807E378(void);
extern u8 DisplayActions(u32);
extern void sub_805F02C(void); extern void sub_805F02C(void);
extern void sub_8071B48(void);
static void sub_8044454(void); static void sub_8044454(void);
static bool8 RunLeaderTurn(bool8); static bool8 RunLeaderTurn(bool8);
@ -53,7 +53,7 @@ void RunFractionalTurn(bool8 param_1)
cVar2 = RunLeaderTurn(param_1); cVar2 = RunLeaderTurn(param_1);
if (IsFloorOver()) return; if (IsFloorOver()) return;
if (cVar2) { if (cVar2) {
sub_807E378(); UpdateWindTurns();
if (IsFloorOver()) return; if (IsFloorOver()) return;
} }
if (IsFloorOver()) return; if (IsFloorOver()) return;
@ -384,7 +384,7 @@ static void TrySpawnMonsterAndActivatePlusMinus(void)
s32 index; s32 index;
if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn] != 0) { if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn] != 0) {
sub_8071B48(); TrySpawnWildMonster();
gDungeon->plusIsActive[0] = FALSE; gDungeon->plusIsActive[0] = FALSE;
gDungeon->plusIsActive[1] = FALSE; gDungeon->plusIsActive[1] = FALSE;
gDungeon->minusIsActive[0] = FALSE; gDungeon->minusIsActive[0] = FALSE;

View File

@ -5,7 +5,7 @@
#include "constants/item.h" #include "constants/item.h"
#include "constants/status.h" #include "constants/status.h"
#include "constants/type.h" #include "constants/type.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "dungeon_range.h" #include "dungeon_range.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
@ -23,7 +23,7 @@
#include "dungeon_music.h" #include "dungeon_music.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "game_options.h" #include "game_options.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "moves.h" #include "moves.h"
@ -52,6 +52,7 @@
#include "dungeon_action_execution.h" #include "dungeon_action_execution.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "run_dungeon.h" #include "run_dungeon.h"
#include "dungeon_8041AD0.h"
static EWRAM_DATA s32 sSpeedMultiplier = 0; static EWRAM_DATA s32 sSpeedMultiplier = 0;
@ -59,7 +60,6 @@ static void sub_8075050(EntityInfo *info, Unk_Entity_x184 *strPtr);
static void nullsub_97(Entity *entity); static void nullsub_97(Entity *entity);
static void TryInteractWithTile(Entity *entity); static void TryInteractWithTile(Entity *entity);
extern void sub_8041888(u32);
extern void sub_8073D14(Entity *entity); extern void sub_8073D14(Entity *entity);
static inline void SetSpeedMultiplier(void) static inline void SetSpeedMultiplier(void)

103
src/dungeon_exit.c Normal file
View File

@ -0,0 +1,103 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_exit.h"
#include "constants/dungeon_exit.h"
#include "dungeon_info.h"
#include "dungeon_util.h"
#include "text_util.h"
#include "dungeon_logic.h"
#include "dungeon_data.h"
#include "dungeon_strings.h"
#include "run_dungeon.h"
#include "items.h"
void SetUpDungeonExitData(s16 dungeonExitReason_, Entity *target, Entity *entity)
{
EntityInfo * entityInfo;
u8 buffer [0x14];
s32 dungeonExitReason = dungeonExitReason_;
DungeonExitSummary *exitSummary = &gDungeon->exitSummary;
EntityInfo * targetEntityInfo = NULL;
if (EntityIsValid(target) && GetEntityType(target) == ENTITY_MONSTER) {
targetEntityInfo = GetEntInfo(target);
}
entityInfo = GetEntInfo(entity);
if (targetEntityInfo != NULL) {
CopyEntityNameForDungeonExitSummary(buffer, targetEntityInfo);
CopyStringtoBuffer(exitSummary->buffer1, buffer);
}
else {
CopyStringtoBuffer(exitSummary->buffer1, gText_Someone); // Someone
}
CopyEntityNameForDungeonExitSummary(buffer,entityInfo);
CopyStringtoBuffer(exitSummary->buffer2, buffer);
exitSummary->exitReason = dungeonExitReason;
exitSummary->heldItem = entityInfo->heldItem;
exitSummary->exp = entityInfo->exp;
exitSummary->level = entityInfo->level;
exitSummary->maxHPStat = entityInfo->maxHPStat;
exitSummary->atk = entityInfo->atk[0];
exitSummary->spAtk = entityInfo->atk[1];
exitSummary->def = entityInfo->def[0];
exitSummary->spDef = entityInfo->def[1];
exitSummary->dungeonLocation = gDungeon->unk644.dungeonLocation;
exitSummary->attBoost = 0;
exitSummary->spAttBoost = 0;
exitSummary->defBoost = 0;
exitSummary->spDefBoost = 0;
if (ItemExists(&entityInfo->heldItem) && !(entityInfo->heldItem.flags & ITEM_FLAG_STICKY)) {
if (entityInfo->heldItem.id == ITEM_POWER_BAND) {
exitSummary->attBoost += gPowerBandBoost;
}
if (entityInfo->heldItem.id == ITEM_MUNCH_BELT) {
exitSummary->attBoost += gMunchBeltBoost;
}
if (entityInfo->heldItem.id == ITEM_SPECIAL_BAND) {
exitSummary->spAttBoost += gSpecialBandBoost;
}
if (entityInfo->heldItem.id == ITEM_MUNCH_BELT) {
exitSummary->spAttBoost += gMunchBeltBoost;
}
if (entityInfo->heldItem.id == ITEM_DEF_SCARF) {
exitSummary->defBoost += gDefScarfBoost;
}
if (entityInfo->heldItem.id == ITEM_ZINC_BAND) {
exitSummary->spDefBoost += gZincBandBoost;
}
}
}
bool8 IsUnsuccessfulDungeonExit(void)
{
DungeonExitSummary *exitSummary = &gDungeon->exitSummary;
if (exitSummary->exitReason < DUNGEON_EXIT_REASON_SUCCESS)
return TRUE;
return FALSE;
}
bool8 sub_8083C50(void)
{
DungeonExitSummary *exitSummary = &gDungeon->exitSummary;
if (exitSummary->exitReason == DUNGEON_EXIT_CLEARED_DUNGEON
|| exitSummary->exitReason == DUNGEON_EXIT_BEFRIENDED_MEW
|| exitSummary->exitReason == DUNGEON_EXIT_SUCCEEDED_IN_RESCUE_MISSION)
return TRUE;
return FALSE;
}
bool8 sub_8083C88(u8 param_1)
{
DungeonExitSummary *exitSummary = &gDungeon->exitSummary;
if ((!HasCheckpoint(gDungeon->unk644.dungeonLocation.id) && (gDungeon->unk644.unk18 != 0 || param_1 != 0))
|| exitSummary->exitReason != DUNGEON_EXIT_CLEARED_DUNGEON) {
return TRUE;
}
return FALSE;
}

View File

@ -24,7 +24,6 @@
extern s32 sub_803DA20(s16 species); extern s32 sub_803DA20(s16 species);
extern void sub_8049840(void); extern void sub_8049840(void);
extern void sub_80429FC(DungeonPos *r0);
extern void sub_80498A8(s32, s32); extern void sub_80498A8(s32, s32);
extern void sub_8049B8C(void); extern void sub_8049B8C(void);
@ -186,7 +185,7 @@ void GenerateFloor(void)
ResetFloor(); ResetFloor();
gDungeon->unk644.unk20 = abs(floorProps->enemyDensity); gDungeon->unk644.enemyDensity = abs(floorProps->enemyDensity);
gDungeon->unk3A09 = 0; gDungeon->unk3A09 = 0;
gDungeon->unk3A0A = 0; gDungeon->unk3A0A = 0;
@ -4425,7 +4424,7 @@ static void SpawnEnemies(FloorProperties *floorProps, bool8 isEmptyMonsterHouse)
s32 enemyDensity = floorProps->enemyDensity; s32 enemyDensity = floorProps->enemyDensity;
// BUG: Game assumes floorProps->enemyDensity is a signed byte, but in reality it's unsigned. // BUG: Game assumes floorProps->enemyDensity is a signed byte, but in reality it's unsigned.
// Attempting to use a negative density will instead produce a very large positive density up to 255. // Attempting to use a negative density will instead produce a very large positive density up to 255.
// This only matters for unused dungeons, as Deoxys has its own logic despite Meteor Cave having an effective enemy density of 255. // This only matters for unused dungeons, as Deoxys has its own logic despite Meteor Cave having an effective enemy density of 255.
if (enemyDensity > 0) { if (enemyDensity > 0) {
// Positive means value with variance // Positive means value with variance

View File

@ -14,8 +14,7 @@
#include "constants/trap.h" #include "constants/trap.h"
#include "constants/item.h" #include "constants/item.h"
#include "dungeon_mon_spawn.h" #include "dungeon_mon_spawn.h"
#include "dungeon_8041AD0.h"
extern void sub_80429FC(DungeonPos *r0);
static bool8 sub_805210C(u8 itemId); static bool8 sub_805210C(u8 itemId);

View File

@ -1,7 +1,7 @@
#include "global.h" #include "global.h"
#include "globaldata.h" #include "globaldata.h"
#include "dungeon_item_action.h" #include "dungeon_item_action.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/dungeon_action.h" #include "constants/dungeon_action.h"
@ -41,10 +41,6 @@
#include "move_orb_effects_2.h" #include "move_orb_effects_2.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"
extern void sub_804245C(Entity *, Item *);
extern s32 sub_8042520(Entity *);
extern void sub_8042390(Entity *, Item *);
static void StunSeedItemAction(Entity *, Entity *); static void StunSeedItemAction(Entity *, Entity *);
static void MaxElixirAction(Entity *, Entity *); static void MaxElixirAction(Entity *, Entity *);
static void ProteinItemAction(Entity *, Entity *); static void ProteinItemAction(Entity *, Entity *);

View File

@ -1,7 +1,7 @@
#include "global.h" #include "global.h"
#include "globaldata.h" #include "globaldata.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "dungeon_range.h" #include "dungeon_range.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "dungeon_util.h" #include "dungeon_util.h"
@ -28,10 +28,6 @@
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "sprite.h" #include "sprite.h"
extern void sub_80416E0(PixelPos *r0, u32, bool8);
extern void sub_804178C(u32);
extern void sub_804219C(PixelPos *pos);
static void MusicBoxCreation(void); static void MusicBoxCreation(void);
static u8 sub_8046D70(void); static u8 sub_8046D70(void);

View File

@ -9,6 +9,7 @@
#include "dungeon_range.h" #include "dungeon_range.h"
#include "string_format.h" #include "string_format.h"
#include "code_80958E8.h" #include "code_80958E8.h"
#include "dungeon_8041AD0.h"
#include "mailbox.h" #include "mailbox.h"
#include "items.h" #include "items.h"
#include "pokemon.h" #include "pokemon.h"
@ -16,9 +17,6 @@
#include "constants/dungeon.h" #include "constants/dungeon.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
extern void sub_8042A34(DungeonPos *r0);
extern void sub_804178C(u32);
void sub_80842F0(void) void sub_80842F0(void)
{ {
s32 i; s32 i;

View File

@ -2,7 +2,6 @@
#include "globaldata.h" #include "globaldata.h"
#include "dungeon_kecleon_shop.h" #include "dungeon_kecleon_shop.h"
#include "weather.h" #include "weather.h"
#include "code_804267C.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_info.h" #include "dungeon_info.h"
#include "dungeon_config.h" #include "dungeon_config.h"
@ -17,7 +16,7 @@
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "position_util.h" #include "position_util.h"
#include "dungeon_ai.h" #include "dungeon_ai.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "dungeon_items.h" #include "dungeon_items.h"
@ -53,7 +52,7 @@ void sub_807EC28(bool8 arg0)
isShopTile = (GetTileAtEntitySafe(leader)->terrainFlags & TERRAIN_TYPE_SHOP) != 0; isShopTile = (GetTileAtEntitySafe(leader)->terrainFlags & TERRAIN_TYPE_SHOP) != 0;
gDungeon->unk644.unk54 = isShopTile; gDungeon->unk644.unk54 = isShopTile;
gDungeon->unk644.unk55 = isShopTile; gDungeon->unk644.unk55 = isShopTile;
if (gDungeon->unk644.unk2A || gDungeon->unk644.unk50 == 0) if (gDungeon->unk644.stoleFromKecleon || gDungeon->unk644.unk50 == 0)
return; return;
if (leaderInfo->invisibleClassStatus.status == STATUS_INVISIBLE) { if (leaderInfo->invisibleClassStatus.status == STATUS_INVISIBLE) {
@ -313,7 +312,7 @@ static void sub_807F33C(void)
{ {
s32 i, x, y; s32 i, x, y;
gDungeon->unk644.unk2A = 1; gDungeon->unk644.stoleFromKecleon = 1;
gDungeon->unk644.unk2B = 1; gDungeon->unk644.unk2B = 1;
LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FE4B8); // Help! Thief! I've been robbed! Help me catch the thief. LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FE4B8); // Help! Thief! I've been robbed! Help me catch the thief.
for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) {

View File

@ -5,7 +5,7 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_range.h" #include "dungeon_range.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "constants/dungeon.h" #include "constants/dungeon.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"
@ -19,7 +19,7 @@
#include "dungeon_logic.h" #include "dungeon_logic.h"
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_menu_moves.h" #include "dungeon_menu_moves.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "moves.h" #include "moves.h"
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
#include "structs/map.h" #include "structs/map.h"

View File

@ -30,12 +30,10 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_pos_data.h" #include "dungeon_pos_data.h"
#include "dungeon_data.h" #include "dungeon_data.h"
#include "dungeon_8041AD0.h"
// This file deals with things like controlling movement, walkable tiles, ai targeting, status checks and pokemon attributes. // This file deals with things like controlling movement, walkable tiles, ai targeting, status checks and pokemon attributes.
extern void sub_80429B4(Entity *r0);
extern void ShowVisualFlags(Entity *r0);
EWRAM_DATA u8 gWalkableTileToCrossableTerrain[8] = {0}; EWRAM_DATA u8 gWalkableTileToCrossableTerrain[8] = {0};
u8 GetCrossableTerrain(s16 species) u8 GetCrossableTerrain(s16 species)
@ -354,7 +352,7 @@ s32 CalcSpeedStage(Entity *pokemon)
speed++; speed++;
} }
if ((entityInfo->id == MONSTER_KECLEON) && entityInfo->isNotTeamMember && if ((entityInfo->id == MONSTER_KECLEON) && entityInfo->isNotTeamMember &&
gDungeon->unk644.unk2A) { gDungeon->unk644.stoleFromKecleon) {
speed++; speed++;
} }
if (speed < 0) { if (speed < 0) {

View File

@ -19,7 +19,7 @@
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "dungeon_action.h" #include "dungeon_action.h"
#include "code_8066D04.h" #include "code_8066D04.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_action.h" #include "dungeon_action.h"
#include "dungeon_ai_movement.h" #include "dungeon_ai_movement.h"
#include "dungeon_logic.h" #include "dungeon_logic.h"
@ -60,6 +60,7 @@
#include "dungeon_item_action.h" #include "dungeon_item_action.h"
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_entity_movement.h" #include "dungeon_entity_movement.h"
#include "dungeon_8041AD0.h"
extern void HandleUnsetItemAction(Entity *,bool8); extern void HandleUnsetItemAction(Entity *,bool8);
extern void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4); extern void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
@ -75,8 +76,6 @@ bool8 sub_8070F80(Entity * pokemon, s32 direction);
void sub_806752C(ActionContainer *a0); void sub_806752C(ActionContainer *a0);
void sub_8067768(ActionContainer *a0); void sub_8067768(ActionContainer *a0);
extern bool8 sub_8071A8C(Entity *pokemon); extern bool8 sub_8071A8C(Entity *pokemon);
extern void sub_8041AD0(Entity *pokemon);
extern void sub_8041AE0(Entity *pokemon);
static EWRAM_DATA bool8 sInDiagonalMode = 0; static EWRAM_DATA bool8 sInDiagonalMode = 0;
static EWRAM_DATA bool8 sInRotateMode = 0; static EWRAM_DATA bool8 sInRotateMode = 0;
@ -1052,7 +1051,7 @@ void sub_805F02C(void)
else if (PlayerHasItemWithFlag(ITEM_FLAG_IN_SHOP) || sub_807EF48()) { else if (PlayerHasItemWithFlag(ITEM_FLAG_IN_SHOP) || sub_807EF48()) {
DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C08); DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C08);
} }
else if (gDungeon->unk644.unk2A) { else if (gDungeon->unk644.stoleFromKecleon) {
DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C2C); DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C2C);
} }
else { else {

View File

@ -16,11 +16,10 @@
#include "game_options.h" #include "game_options.h"
#include "random.h" #include "random.h"
#include "text_1.h" #include "text_1.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_pos_data.h" #include "dungeon_pos_data.h"
#include "dungeon_data.h" #include "dungeon_data.h"
#include "dungeon_8041AD0.h"
extern void sub_8042A14(DungeonPos *);
EWRAM_DATA OpenedFile *gDungeonPaletteFile = {0}; EWRAM_DATA OpenedFile *gDungeonPaletteFile = {0};
EWRAM_DATA unkStruct_202EE8C gUnknown_202EE8C[32] = {0}; EWRAM_DATA unkStruct_202EE8C gUnknown_202EE8C[32] = {0};

View File

@ -29,9 +29,7 @@
#include "code_801B3C0.h" #include "code_801B3C0.h"
#include "dungeon_engine.h" #include "dungeon_engine.h"
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_8041AD0.h"
extern void sub_8041AD0(Entity *pokemon);
extern void sub_8041AE0(Entity *pokemon);
static EWRAM_DATA ActionParameter sUnknownActionUnk4 = {0}; static EWRAM_DATA ActionParameter sUnknownActionUnk4 = {0};
static EWRAM_DATA s32 sUnknown_202F240 = 0; static EWRAM_DATA s32 sUnknown_202F240 = 0;

View File

@ -7,7 +7,7 @@
#include "dungeon_action.h" #include "dungeon_action.h"
#include "code_8097DD0.h" #include "code_8097DD0.h"
#include "dungeon_info.h" #include "dungeon_info.h"
#include "dungeon_8083AB0.h" #include "dungeon_exit.h"
#include "dungeon_action.h" #include "dungeon_action.h"
#include "dungeon_range.h" #include "dungeon_range.h"
#include "dungeon_main.h" #include "dungeon_main.h"
@ -443,7 +443,7 @@ static bool8 AskToGiveUp(void)
return TRUE; return TRUE;
} }
SetMonsterActionFields(GetLeaderActionContainer(), ACTION_GIVE_UP); SetMonsterActionFields(GetLeaderActionContainer(), ACTION_GIVE_UP);
sub_8083AB0(DUNGEON_EXIT_GAVE_UP_EXPLORATION, NULL, GetLeader()); SetUpDungeonExitData(DUNGEON_EXIT_GAVE_UP_EXPLORATION, NULL, GetLeader());
gDungeon->unk644.unk10 = 1; gDungeon->unk644.unk10 = 1;
return FALSE; return FALSE;
} }

View File

@ -20,11 +20,7 @@
#include "text_3.h" #include "text_3.h"
#include "dungeon_engine.h" #include "dungeon_engine.h"
#include "dungeon_cutscene.h" #include "dungeon_cutscene.h"
#include "dungeon_mon_recruit.h"
extern u16 GetLeaderActionId(void);
extern u8 sub_806F9BC(s32);
extern bool8 sub_806A564(s32 r0);
struct MonRecruitList struct MonRecruitList
{ {
@ -296,7 +292,7 @@ static void SetRecruitableMons(struct MonRecruitList *tabsData)
spArray[ExtractSpeciesIndex(&gDungeon->monsterSpawns[id])] = byte; spArray[ExtractSpeciesIndex(&gDungeon->monsterSpawns[id])] = byte;
} }
if (gDungeon->unk644.unk2A) { if (gDungeon->unk644.stoleFromKecleon) {
spArray[MONSTER_KECLEON] = 1; spArray[MONSTER_KECLEON] = 1;
} }
@ -320,7 +316,7 @@ static void SetRecruitableMons(struct MonRecruitList *tabsData)
if (i == TAB_POTENTIAL_RECRUITS) { if (i == TAB_POTENTIAL_RECRUITS) {
u32 recruitRate, unrecruitableRate; u32 recruitRate, unrecruitableRate;
if (!sub_806F9BC(speciesId)) if (!IsMonsterRecruitable(speciesId))
continue; continue;
if (!IsExclusivePokemonUnlocked(speciesId)) if (!IsExclusivePokemonUnlocked(speciesId))
continue; continue;

View File

@ -13,7 +13,7 @@
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "dungeon_action.h" #include "dungeon_action.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "code_8097DD0.h" #include "code_8097DD0.h"
#include "dungeon_action.h" #include "dungeon_action.h"
#include "dungeon_ai_movement.h" #include "dungeon_ai_movement.h"

View File

@ -28,7 +28,7 @@
#include "constants/status.h" #include "constants/status.h"
#include "constants/type.h" #include "constants/type.h"
#include "constants/weather.h" #include "constants/weather.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_util.h" #include "dungeon_util.h"
#include "exclusive_pokemon.h" #include "exclusive_pokemon.h"
#include "dungeon_config.h" #include "dungeon_config.h"
@ -42,7 +42,7 @@
#include "def_filearchives.h" #include "def_filearchives.h"
#include "code_803D110.h" #include "code_803D110.h"
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_8083AB0.h" #include "dungeon_exit.h"
#include "dungeon_pos_data.h" #include "dungeon_pos_data.h"
#include "dungeon_data.h" #include "dungeon_data.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
@ -53,30 +53,22 @@
#include "dungeon_monster_house.h" #include "dungeon_monster_house.h"
#include "move_orb_effects_2.h" #include "move_orb_effects_2.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"
#include "dungeon_recruit_release_menu.h"
#include "dungeon_8041AD0.h"
static void EnsureCastformLoaded(void); static void EnsureCastformLoaded(void);
static void EnsureDeoxysLoaded(void); static void EnsureDeoxysLoaded(void);
extern bool8 sub_806A58C(s16 r0); extern bool8 sub_806A58C(s16 r0);
extern void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3);
extern bool8 sub_8070F80(Entity * pokemon, s32 direction); extern bool8 sub_8070F80(Entity * pokemon, s32 direction);
extern s32 sub_806A4DC(EntityInfo *info); extern s32 sub_806A4DC(EntityInfo *info);
extern void sub_8042900(Entity *r0);
extern void sub_8042968(Entity *r0);
extern void sub_8041BBC(Entity *r0);
extern void sub_804178C(u32);
extern void sub_8042B20(Entity *entity);
extern void sub_8042B0C(Entity *entity);
extern s16 sub_803D970(u32); extern s16 sub_803D970(u32);
extern bool8 sub_80860A8(u8 id); extern bool8 sub_80860A8(u8 id);
extern u8 sub_803D73C(s32 a0); extern u8 sub_803D73C(s32 a0);
extern void DeletePokemonDungeonSprite(s32 id); extern void DeletePokemonDungeonSprite(s32 id);
extern void sub_80429E8(Entity *r0);
extern s32 sub_803DA20(s32 param_1); extern s32 sub_803DA20(s32 param_1);
extern void sub_8042EC8(Entity *a0, s32 a1);
extern Entity *sub_804550C(s16 a); extern Entity *sub_804550C(s16 a);
extern Entity *sub_80453AC(s16 id); extern Entity *sub_80453AC(s16 id);
extern void EntityUpdateStatusSprites(Entity *);
extern u8 gUnknown_202F32C; extern u8 gUnknown_202F32C;
@ -394,7 +386,7 @@ void sub_8068BDC(bool8 a0)
WriteFriendAreaName(gFormatBuffer_Items[0], friendAreaId, FALSE); WriteFriendAreaName(gFormatBuffer_Items[0], friendAreaId, FALSE);
DisplayDungeonMessage(NULL, gUnknown_80FE1A4, TRUE); // The Friend Area is full, a friend must be released. DisplayDungeonMessage(NULL, gUnknown_80FE1A4, TRUE); // The Friend Area is full, a friend must be released.
while (1) { while (1) {
sub_8067A80(friendAreaId, j - areaCapacity.maxPokemon, j, monPointers); ShowRecruitReleaseMenu(friendAreaId, j - areaCapacity.maxPokemon, j, monPointers);
for (id = 0; id < j; id++) { for (id = 0; id < j; id++) {
Pokemon *monPtr = monPointers[id]; Pokemon *monPtr = monPointers[id];
if (PokemonExists(monPtr) && (monPtr->flags & POKEMON_FLAG_x8000)) { if (PokemonExists(monPtr) && (monPtr->flags & POKEMON_FLAG_x8000)) {
@ -523,7 +515,7 @@ void HandleFaint(Entity *entity, s32 dungeonExitReason_, Entity *param_3)
sub_803E708(0x3c,0x49); sub_803E708(0x3c,0x49);
DisplayMessageLog(); DisplayMessageLog();
if (gDungeon->unk6 == 0) { if (gDungeon->unk6 == 0) {
if (gDungeon->unk644.unk2A == 0 if (gDungeon->unk644.stoleFromKecleon == 0
&& dungeonExitReason != DUNGEON_EXIT_DELETED_FOR_EVENT && dungeonExitReason != DUNGEON_EXIT_DELETED_FOR_EVENT
&& dungeonExitReason != DUNGEON_EXIT_FAILED_TO_PROTECT_CLIENT && dungeonExitReason != DUNGEON_EXIT_FAILED_TO_PROTECT_CLIENT
&& dungeonExitReason != DUNGEON_EXIT_BLOWN_OUT_UNSEEN_FORCE && dungeonExitReason != DUNGEON_EXIT_BLOWN_OUT_UNSEEN_FORCE
@ -553,7 +545,7 @@ void HandleFaint(Entity *entity, s32 dungeonExitReason_, Entity *param_3)
return; return;
} }
sub_8083AB0(dungeonExitReason,param_3,entity); SetUpDungeonExitData(dungeonExitReason,param_3,entity);
if (dungeonExitReason == DUNGEON_EXIT_RETURNED_WITH_FALLEN_PARTNER) { if (dungeonExitReason == DUNGEON_EXIT_RETURNED_WITH_FALLEN_PARTNER) {
EntityInfo *partnerInfo = NULL; EntityInfo *partnerInfo = NULL;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
@ -843,22 +835,22 @@ void SetMonSummaryInfoFromEntity(struct MonSummaryInfo *param_1, Entity *target)
*spDefBoost = 0; *spDefBoost = 0;
if ((info->heldItem.flags & ITEM_FLAG_EXISTS) && ((info->heldItem.flags & ITEM_FLAG_STICKY) == 0)) { if ((info->heldItem.flags & ITEM_FLAG_EXISTS) && ((info->heldItem.flags & ITEM_FLAG_STICKY) == 0)) {
if (info->heldItem.id == ITEM_POWER_BAND) { if (info->heldItem.id == ITEM_POWER_BAND) {
*atkPtr += gUnknown_810AC60; *atkPtr += gPowerBandBoost;
} }
if (info->heldItem.id == ITEM_MUNCH_BELT) { if (info->heldItem.id == ITEM_MUNCH_BELT) {
*atkPtr += gUnknown_810AC68; *atkPtr += gMunchBeltBoost;
} }
if (info->heldItem.id == ITEM_SPECIAL_BAND) { if (info->heldItem.id == ITEM_SPECIAL_BAND) {
*spAtkPtr += gUnknown_810AC62; *spAtkPtr += gSpecialBandBoost;
} }
if (info->heldItem.id == ITEM_MUNCH_BELT) { if (info->heldItem.id == ITEM_MUNCH_BELT) {
*spAtkPtr += gUnknown_810AC68; *spAtkPtr += gMunchBeltBoost;
} }
if (info->heldItem.id == ITEM_DEF_SCARF) { if (info->heldItem.id == ITEM_DEF_SCARF) {
*defPtr += gUnknown_810AC64; *defPtr += gDefScarfBoost;
} }
if (info->heldItem.id == ITEM_ZINC_BAND) { if (info->heldItem.id == ITEM_ZINC_BAND) {
*spDefBoost += gUnknown_810AC66; *spDefBoost += gZincBandBoost;
} }
} }
param_1->tactic = info->tactic; param_1->tactic = info->tactic;

445
src/dungeon_mon_recruit.c Normal file
View File

@ -0,0 +1,445 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_mon_recruit.h"
#include "constants/dungeon_exit.h"
#include "constants/fixed_rooms.h"
#include "constants/type.h"
#include "structs/str_pokemon.h"
#include "dungeon_main.h"
#include "dungeon_misc.h"
#include "music_util.h"
#include "dungeon_message.h"
#include "dungeon_mon_sprite_render.h"
#include "code_8097670.h"
#include "dungeon_info.h"
#include "dungeon_items.h"
#include "dungeon_logic.h"
#include "dungeon_random.h"
#include "dungeon_vram.h"
#include "dungeon_util.h"
#include "friend_area.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "position_util.h"
#include "text_util.h"
#include "math.h"
#include "dungeon_config.h"
#include "dungeon_strings.h"
#include "dungeon_music.h"
#include "dungeon_cutscene.h"
#include "string_format.h"
#include "dungeon_mon_spawn.h"
#include "move_orb_effects_5.h"
extern bool8 sub_8097900(s16 pokeIndex);
static void nullsub_96(Entity *pokemon,Entity *target);
static void sub_806F910(void);
bool8 TryRecruitMonster(Entity *attacker, Entity *target)
{
s32 i;
s32 rand;
s32 recruitRate;
EntityInfo *attackerInfo = GetEntInfo(attacker);
EntityInfo *targetInfo = GetEntInfo(target);
s32 foundIndex = -1;
s32 size = GetBodySize(targetInfo->apparentID);
if (gDungeon->fixedRoomNumber != FIXED_ROOM_FROSTY_GROTTO_ARTICUNO
&& gDungeon->fixedRoomNumber != FIXED_ROOM_MT_BLAZE_PEAK_MOLTRES
&& gDungeon->fixedRoomNumber != FIXED_ROOM_WESTERN_CAVE_MEWTWO
&& gDungeon->fixedRoomNumber != FIXED_ROOM_MT_FARAWAY_HO_OH
) {
if (gDungeon->fixedRoomNumber >= FIXED_ROOM_TEAM_SHIFTY_BOSS
&& gDungeon->fixedRoomNumber <= FIXED_ROOM_RESCUE_TEAM_2_BOSS
) {
if (gDungeon->unk644.unk18 == 0)
return FALSE;
}
else if (gDungeon->fixedRoomNumber == FIXED_ROOM_RESCUE_TEAM_MAZE_BOSS) {
if (gDungeon->unk644.unk15 == 0)
return FALSE;
if (!sub_8097900(MONSTER_DEOXYS_NORMAL))
return FALSE;
}
else if (!IsRecruitingEnabled(gDungeon->unk644.dungeonLocation.id)) {
return FALSE;
}
}
if (gDungeon->unk644.unk19 != 0)
return FALSE;
// Legendaries can only be recruited once.
if ((targetInfo->id == MONSTER_ARTICUNO ||
targetInfo->id == MONSTER_ZAPDOS ||
targetInfo->id == MONSTER_MOLTRES ||
targetInfo->id == MONSTER_ENTEI ||
targetInfo->id == MONSTER_RAIKOU ||
targetInfo->id == MONSTER_SUICUNE ||
targetInfo->id == MONSTER_LATIAS ||
targetInfo->id == MONSTER_LATIOS ||
targetInfo->id == MONSTER_JIRACHI ||
targetInfo->id == MONSTER_RAYQUAZA ||
targetInfo->id == MONSTER_DEOXYS_NORMAL ||
targetInfo->id == MONSTER_REGIROCK ||
targetInfo->id == MONSTER_REGICE ||
targetInfo->id == MONSTER_REGISTEEL)
&& HasRecruitedMon(targetInfo->id))
{
return FALSE;
}
if (!IsMonsterRecruitable(targetInfo->id))
return FALSE;
if (abs((attacker->pos).x - (target->pos).x) >= 2 || abs((attacker->pos).y - (target->pos).y) >= 2)
return FALSE;
if (targetInfo->joinedAt.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON)
return FALSE;
if (targetInfo->monsterBehavior == 1)
return FALSE;
if (!CanSeeTarget(target,attacker))
return FALSE;
sub_806F910();
rand = DungeonRandInt(1000);
recruitRate = GetRecruitRate(targetInfo->id);
if (recruitRate == -999)
return FALSE;
if (HasHeldItem(attacker, ITEM_FRIEND_BOW)) {
recruitRate += gFriendBowRecruitRateUpValue;
}
recruitRate += gRecruitRateByLevel[attackerInfo->level];
if (rand >= recruitRate)
return FALSE;
for (i = 0; i <= (MAX_TEAM_BODY_SIZE - size); i++) {
s32 j;
for (j = 0; j < size; j++) {
if (gUnknown_202EE70[i + j] != 0)
break;
}
if (j == size) {
foundIndex = i;
break;
}
}
if (foundIndex == -1) {
nullsub_96(attacker, target);
return FALSE;
}
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
if (!DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[i]))
break;
}
if (i == MAX_TEAM_MEMBERS) {
nullsub_96(attacker, target);
return FALSE;
}
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
if (!EntityIsValid(gDungeon->teamPokemon[i]))
break;
}
if (i == MAX_TEAM_MEMBERS) {
nullsub_96(attacker, target);
return FALSE;
}
return TRUE;
}
static void nullsub_96(Entity *pokemon,Entity *target)
{}
static void sub_806F910(void)
{
s32 i, j;
int totalSize;
s32 unkMaybeTimer;
totalSize = 0;
for (i = 0, unkMaybeTimer = 0x40; i < MAX_TEAM_MEMBERS; i++) {
Entity *entity = gDungeon->teamPokemon[i];
if (EntityIsValid(entity)) {
s32 size = GetBodySize(GetEntInfo(entity)->apparentID);
entity->axObj.unk40_maybeAnimTimer = unkMaybeTimer;
GetEntInfo(entity)->unk167 = i;
GetEntInfo(entity)->unk168 = size;
for (j = 0; j < size; j++) {
if (totalSize < MAX_TEAM_BODY_SIZE) {
gUnknown_202EE70[totalSize] = 1;
unkMaybeTimer += 0x10;
totalSize++;
}
}
sub_806CCB4(entity,sub_806CEBC(entity));
}
}
for (; totalSize < MAX_TEAM_BODY_SIZE; totalSize++) {
gUnknown_202EE70[totalSize] = 0;
}
}
bool8 IsMonsterRecruitable(s32 species)
{
s32 id = (s16) species;
if (!gDungeon->unk644.canRecruit) {
return FALSE;
}
else if (!sub_808529C(id)) {
return FALSE;
}
else if (id == MONSTER_MEW && gDungeon->unk644.unk34 == 1) {
return FALSE;
}
else if (id == MONSTER_LATIAS) {
return FALSE;
}
else if (id == MONSTER_LATIOS) {
return FALSE;
}
else if (id == MONSTER_DEOXYS_ATTACK) {
return FALSE;
}
else if (id == MONSTER_DEOXYS_DEFENSE) {
return FALSE;
}
else if (id == MONSTER_DEOXYS_SPEED) {
return FALSE;
}
else {
if (GetUnk12(id) == 0) {
FriendAreaCapacity friendAreaCapacity;
u8 friendArea = GetFriendArea(id);
GetFriendAreaCapacity2(friendArea, &friendAreaCapacity, FALSE, FALSE);
if (friendAreaCapacity.hasFriendArea == FALSE)
return FALSE;
}
return TRUE;
}
}
bool8 HandleMonsterJoinSequence(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *param_3)
{
DungeonMon *dungeonMon;
int pokeIndex;
Entity *local_2c;
s32 i;
s32 direction = GetDirectionTowardsPosition(&entity2->pos,&entity1->pos);
bool8 unlockedFriendArea = FALSE;
u8 friendArea = GetFriendArea(param_3->id);
entity2->unk22 = 0;
sub_807A0CC(entity1, entity2);
sub_806CE68(entity2, direction);
CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[0],param_3->id);
if (DisplayDungeonYesNoMessage(0,gUnknown_80F9FE8,1) == 0) {
if (param_3->id != MONSTER_JIRACHI) {
LogMessageByIdWithPopupCheckUser(entity1,gText_Pokemon0WentAway);
}
return FALSE;
}
for (pokeIndex = 0; pokeIndex < MAX_TEAM_MEMBERS; pokeIndex++) {
if (!(DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[pokeIndex])))
break;
}
if (pokeIndex == MAX_TEAM_MEMBERS) {
LogMessageByIdWithPopupCheckUser(entity1,gText_ThePokemonCouldntJoinTeam);
return FALSE;
}
if (GetFriendAreaStatus(friendArea) == 0) {
UnlockFriendArea(friendArea);
unlockedFriendArea = TRUE;
}
HandleFaint(entity2,DUNGEON_EXIT_TRANSFORMED_INTO_FRIEND,entity1);
dungeonMon = &gRecruitedPokemonRef->dungeonTeam[pokeIndex];
dungeonMon->flags = POKEMON_FLAG_EXISTS | POKEMON_FLAG_ON_TEAM;
dungeonMon->isTeamLeader = FALSE;
dungeonMon->level = param_3->level;
dungeonMon->IQ = 1;
SetDefaultIQSkills(&dungeonMon->IQSkills,FALSE);
dungeonMon->hiddenPower = param_3->hiddenPower;
dungeonMon->tacticIndex = 0;
dungeonMon->recruitedPokemonId = -1;
dungeonMon->unkC = pokeIndex;
dungeonMon->speciesNum = param_3->id;
dungeonMon->dungeonLocation = gDungeon->unk644.dungeonLocation;
dungeonMon->unk10 = param_3->HP;
dungeonMon->unk12 = param_3->HP;
dungeonMon->belly = param_3->belly;
dungeonMon->maxBelly = param_3->maxBelly;
for (i = 0; i < 2; i++) {
dungeonMon->offense.att[i] = param_3->att[i];
dungeonMon->offense.def[i] = param_3->def[i];
}
dungeonMon->currExp = param_3->exp;
dungeonMon->moves = param_3->moves;
dungeonMon->itemSlot = param_3->heldItem;
BoundedCopyStringtoBuffer(dungeonMon->name,GetMonSpecies(param_3->id),10);
IncrementAdventureNumJoined();
if (SpawnTeamMember(param_3->id,param_3->pos.x,param_3->pos.y,dungeonMon,&local_2c,0,1) == 0) {
LogMessageByIdWithPopupCheckUser(entity1,gText_ButItCouldntJoinTheTeam);
dungeonMon->flags = 0;
}
else {
sub_8083D88();
sub_803E708(0xa0,0x46);
if (DisplayDungeonYesNoMessage(0,gText_NewMemberJoinedGiveItNickname,TRUE) == 1) {
while (DungeonGiveNameToRecruitedMon(dungeonMon->name) == 0) {
DisplayDungeonMessage(0,gText_PleaseGiveNicknameNewMember,TRUE);
}
}
sub_808D9DC(gFormatBuffer_Monsters[0],dungeonMon,0);
LogMessageByIdWithPopupCheckUser(entity1,gText_Pokemon0JoinedToGoOnAdventures);
if (unlockedFriendArea) {
Entity *leader = CutsceneGetLeader();
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0);
sub_8092558(gFormatBuffer_FriendArea, friendArea);
PlaySound(0xce);
DisplayDungeonMessage(0,gText_Pokemon0GainedAccessToFriendArea,1);
}
if (param_3->id == MONSTER_MEW) {
gDungeon->unk4 = 1;
gDungeon->unk11 = 3;
}
}
return TRUE;
}
bool8 CanEntityBeRecruited(Entity *param_1)
{
s32 i, j;
EntityInfo *info = GetEntInfo(param_1);
s32 validIndex = -1;
s32 size = GetBodySize(info->apparentID);
if (!IsMonsterRecruitable(info->id))
return FALSE;
sub_806F910();
for (i = 0; i <= (MAX_TEAM_BODY_SIZE - size); i++) {
for (j = 0; j < size; j++){
if (gUnknown_202EE70[i + j] != 0)
break;
}
if (j == size) {
validIndex = i;
break;
}
}
if (validIndex == -1)
return FALSE;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
if (!(DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[i])))
break;
}
if (i == MAX_TEAM_MEMBERS)
return FALSE;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
if(!EntityIsValid(gDungeon->teamPokemon[i]))
break;
}
if (i == MAX_TEAM_MEMBERS)
return FALSE;
return TRUE;
}
bool8 HandleSpecialEntityJoinSequence(Entity *entity1,Entity *entity2,Entity **entityPtr)
{
u8 friendArea;
DungeonMon *dungeonMon;
int index;
struct unkStruct_8069D4C local_74;
Entity *local_2c;
s32 i;
bool8 unlockedFriendArea = FALSE;
*entityPtr = NULL;
sub_8069D4C(&local_74,entity2);
for (index = 0; index < MAX_TEAM_MEMBERS; index++) {
if (!DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[index]))
break;
}
if (index == MAX_TEAM_MEMBERS) {
return FALSE;
}
friendArea = GetFriendArea(local_74.id);
dungeonMon = &gRecruitedPokemonRef->dungeonTeam[index];
dungeonMon->flags = POKEMON_FLAG_EXISTS | POKEMON_FLAG_ON_TEAM;
dungeonMon->isTeamLeader = FALSE;
dungeonMon->level = local_74.level;
dungeonMon->IQ = 1;
SetDefaultIQSkills(&dungeonMon->IQSkills,FALSE);
dungeonMon->hiddenPower = local_74.hiddenPower;
dungeonMon->tacticIndex = 0;
dungeonMon->recruitedPokemonId = -1;
dungeonMon->unkC = index;
dungeonMon->speciesNum = local_74.id;
dungeonMon->dungeonLocation = gDungeon->unk644.dungeonLocation;
dungeonMon->unk10 = local_74.HP;
dungeonMon->unk12 = local_74.HP;
dungeonMon->belly = local_74.belly;
dungeonMon->maxBelly = local_74.maxBelly;
for (i = 0; i < 2; i++) {
dungeonMon->offense.att[i] = local_74.att[i];
dungeonMon->offense.def[i] = local_74.def[i];
}
dungeonMon->currExp = local_74.exp;
dungeonMon->moves = local_74.moves;
dungeonMon->itemSlot = local_74.heldItem;
BoundedCopyStringtoBuffer(dungeonMon->name,GetMonSpecies(local_74.id), POKEMON_NAME_LENGTH);
if (GetFriendAreaStatus(friendArea) == 0) {
UnlockFriendArea(friendArea);
unlockedFriendArea = TRUE;
}
IncrementAdventureNumJoined();
HandleFaint(entity2,DUNGEON_EXIT_TRANSFORMED_INTO_FRIEND,entity1);
if (SpawnTeamMember(local_74.id,local_74.pos.x,local_74.pos.y,dungeonMon,&local_2c,0,0) == 0) {
dungeonMon->flags = 0;
}
else {
if (DisplayDungeonYesNoMessage(0,gText_NewMemberJoinedGiveItNickname,TRUE) == 1) {
while (!DungeonGiveNameToRecruitedMon(dungeonMon->name)) {
DisplayDungeonMessage(0,gText_PleaseGiveNicknameNewMember,TRUE);
}
}
if (unlockedFriendArea) {
Entity *leader = CutsceneGetLeader();
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0);
sub_8092558(gFormatBuffer_FriendArea, friendArea);
PlaySound(0xce);
DisplayDungeonMessage(0,gText_Pokemon0GainedAccessToFriendArea,1);
}
sub_808D9DC(gFormatBuffer_Monsters[3],dungeonMon,0);
*entityPtr = local_2c;
}
return TRUE;
}

View File

@ -11,7 +11,7 @@
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_config.h" #include "dungeon_config.h"
#include "run_dungeon.h" #include "run_dungeon.h"
#include "dungeon_range.h" #include "dungeon_range.h"
@ -36,19 +36,12 @@
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "dungeon_engine.h" #include "dungeon_engine.h"
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
#include "dungeon_8041AD0.h"
extern void sub_8042900(Entity *r0);
extern void sub_8042968(Entity *r0);
void sub_8041BBC(Entity *r0);
extern void sub_804178C(u32);
extern void sub_8042B20(Entity *entity);
extern void sub_8042B0C(Entity *entity);
extern bool8 sub_80860A8(u8 id); extern bool8 sub_80860A8(u8 id);
extern u8 gUnknown_202F32C; extern u8 gUnknown_202F32C;
extern void sub_80429E8(Entity *r0);
extern Entity *sub_804550C(s16 a); extern Entity *sub_804550C(s16 a);
extern Entity *sub_80453AC(s16 id); extern Entity *sub_80453AC(s16 id);
extern void EntityUpdateStatusSprites(Entity *);
static s32 CalcSpeciesHPAtLevel(s32 species, s32 level); static s32 CalcSpeciesHPAtLevel(s32 species, s32 level);
static s32 CalcSpeciesAtkAtLevel(s32 species, s32 level, s32 categoryIndex); static s32 CalcSpeciesAtkAtLevel(s32 species, s32 level, s32 categoryIndex);
@ -719,7 +712,7 @@ static void InitEntityFromSpawnInfo(bool8 a0, Entity *entity, struct MonSpawnInf
if (!a0) { if (!a0) {
if (monSpawnInfo->species == MONSTER_KECLEON if (monSpawnInfo->species == MONSTER_KECLEON
&& !gDungeon->unk644.unk2A && !gDungeon->unk644.stoleFromKecleon
&& gDungeon->unk3A0A && gDungeon->unk3A0A
&& !monSpawnInfo->unk2) && !monSpawnInfo->unk2)
{ {

View File

@ -1,5 +1,6 @@
#include "global.h" #include "global.h"
#include "globaldata.h" #include "globaldata.h"
#include "dungeon_mon_sprite_render.h"
#include "constants/direction.h" #include "constants/direction.h"
#include "constants/status.h" #include "constants/status.h"
#include "constants/ability.h" #include "constants/ability.h"
@ -8,10 +9,8 @@
#include "constants/iq_skill.h" #include "constants/iq_skill.h"
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h"
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
@ -32,18 +31,17 @@
#include "sprite.h" #include "sprite.h"
#include "random.h" #include "random.h"
const u8 gUnknown_8106EC8[][13] = { static const u8 gUnknown_8106EC8[][13] = {
{0, 1, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7}, {0, 1, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7},
{7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7}, {7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7},
{7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 11, 7}, {7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 11, 7},
}; };
const u8 gUnknown_8106EEF[] = {0x03, 0x04, 0x05, 0x0}; static const u8 gUnknown_8106EEF[] = {0x03, 0x04, 0x05, 0x0};
static u8 GetEntityShadowIndex(Entity *entity);
extern void sub_8042EC8(Entity *a0, s32 a1); void UpdateMonsterSprite(Entity *entity)
void sub_806C51C(Entity *entity)
{ {
s32 x, y, y2; s32 x, y, y2;
bool8 var_3C; bool8 var_3C;
@ -53,7 +51,7 @@ void sub_806C51C(Entity *entity)
DungeonPos posArray[4]; DungeonPos posArray[4];
u32 statusSprites; u32 statusSprites;
bool8 r4; bool8 r4;
u8 r7; u8 shadowIndex;
unkStruct_2039DB0 spriteMasks; unkStruct_2039DB0 spriteMasks;
s32 xSprite, ySprite; s32 xSprite, ySprite;
@ -240,7 +238,7 @@ void sub_806C51C(Entity *entity)
return; return;
r4 = FALSE; r4 = FALSE;
r7 = sub_806CF54(entity); shadowIndex = GetEntityShadowIndex(entity);
spriteMasks.unk0 = 0xF3FF; spriteMasks.unk0 = 0xF3FF;
spriteMasks.unk2 = 0xFFFF; spriteMasks.unk2 = 0xFFFF;
@ -294,8 +292,8 @@ void sub_806C51C(Entity *entity)
xSprite = entInfo->pixelPos.x - gDungeon->unk181e8.cameraPixelPos.x; xSprite = entInfo->pixelPos.x - gDungeon->unk181e8.cameraPixelPos.x;
ySprite = entInfo->pixelPos.y - gDungeon->unk181e8.cameraPixelPos.y; ySprite = entInfo->pixelPos.y - gDungeon->unk181e8.cameraPixelPos.y;
if (xSprite >= -32 && ySprite >= -32 && xSprite <= 271 && ySprite <= 191 && r7 != 6 && entity->unk22 == 0) { if (xSprite >= -32 && ySprite >= -32 && xSprite <= 271 && ySprite <= 191 && shadowIndex != 6 && entity->unk22 == 0) {
struct unkStruct_202ED28 *spriteStructPtr = &gUnknown_202ED28[var_34][r7]; struct unkStruct_202ED28 *spriteStructPtr = &gUnknown_202ED28[var_34][shadowIndex];
if (entInfo->unk156 != 0) { if (entInfo->unk156 != 0) {
SpriteSetX(&spriteStructPtr->sprite, xSprite + spriteStructPtr->pos.x); SpriteSetX(&spriteStructPtr->sprite, xSprite + spriteStructPtr->pos.x);
SpriteSetY(&spriteStructPtr->sprite, ySprite + spriteStructPtr->pos.y); SpriteSetY(&spriteStructPtr->sprite, ySprite + spriteStructPtr->pos.y);
@ -307,15 +305,13 @@ void sub_806C51C(Entity *entity)
void sub_806CC10(void) void sub_806CC10(void)
{ {
EntityInfo *entityInfo;
Entity *entity;
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
entity = gDungeon->activePokemon[i]; Entity *entity = gDungeon->activePokemon[i];
if (EntityIsValid(entity)) { if (EntityIsValid(entity)) {
entityInfo = GetEntInfo(entity); EntityInfo *entityInfo = GetEntInfo(entity);
if (entityInfo->unk166 != 0) { if (entityInfo->unk166 != 0) {
entityInfo->unk166--; entityInfo->unk166--;
@ -479,18 +475,17 @@ void sub_806CF18(Entity *entity)
} }
} }
u8 sub_806CF54(Entity *entity) static u8 GetEntityShadowIndex(Entity *entity)
{ {
return GetEntInfo(entity)->unk204; return GetEntInfo(entity)->shadowIndex;
} }
void DetermineAllMonsterShadow(void) void DetermineAllMonsterShadow(void)
{ {
Entity *entity;
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
entity = gDungeon->activePokemon[i]; Entity *entity = gDungeon->activePokemon[i];
if (EntityIsValid(entity)) if (EntityIsValid(entity))
DetermineMonsterShadow(entity); DetermineMonsterShadow(entity);
@ -514,6 +509,6 @@ u32 DetermineMonsterShadow(Entity *entity)
else if (terrainType == TERRAIN_TYPE_SECONDARY && gDungeonWaterType[gDungeon->tileset] != DUNGEON_WATER_TYPE_LAVA) else if (terrainType == TERRAIN_TYPE_SECONDARY && gDungeonWaterType[gDungeon->tileset] != DUNGEON_WATER_TYPE_LAVA)
shadowSize = gUnknown_8106EEF[shadowSize]; shadowSize = gUnknown_8106EEF[shadowSize];
entityInfo->unk204 = shadowSize; entityInfo->shadowIndex = shadowSize;
return shadowSize; return shadowSize;
} }

View File

@ -5,7 +5,7 @@
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/item.h" #include "constants/item.h"
@ -29,8 +29,7 @@
#include "dungeon_misc.h" #include "dungeon_misc.h"
#include "dungeon_mon_spawn.h" #include "dungeon_mon_spawn.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"
#include "dungeon_8041AD0.h"
extern void sub_804178C(u32);
void TryWakeSleepingWildPokemon(void) void TryWakeSleepingWildPokemon(void)
{ {

View File

@ -11,8 +11,8 @@
#include "effect_data.h" #include "effect_data.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "dungeon_logic.h" #include "dungeon_logic.h"
#include "dungeon_config.h" #include "dungeon_config.h"
@ -44,22 +44,14 @@
#include "dungeon_engine.h" #include "dungeon_engine.h"
#include "warp_target.h" #include "warp_target.h"
extern void sub_80429C8(Entity *r0);
extern s16 GetDungeonExitReasonFromMoveOrItem(Move *move, s32 itemID); extern s16 GetDungeonExitReasonFromMoveOrItem(Move *move, s32 itemID);
extern void sub_8042238(Entity *pokemon, Entity *target);
extern void sub_806A1E8(Entity *pokemon); extern void sub_806A1E8(Entity *pokemon);
extern void sub_804178C(u32);
extern void sub_80428A0(Entity *r0);
extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8); extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8);
extern void sub_8040DA0(Entity *entity, Move *move); extern void sub_8040DA0(Entity *entity, Move *move);
extern u16 GetEffectiveMoveId(u16 moveId, u8 weather, u8 hasSpecialEffect); extern u16 GetEffectiveMoveId(u16 moveId, u8 weather, u8 hasSpecialEffect);
extern void sub_800EF10(u16 r0); extern void sub_800EF10(u16 r0);
extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2); extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2);
extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *); extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *);
extern void sub_8042930(Entity *r0);
extern void sub_8041B48(Entity *pokemon);
extern void sub_8041BA8(Entity *pokemon);
extern void sub_8042950(Entity *r0);
static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct DamageStruct *dmgStruct, s16 unk_); static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct DamageStruct *dmgStruct, s16 unk_);
@ -1381,9 +1373,9 @@ static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct Dam
bool32 isFalseSwipe = (move->id == MOVE_FALSE_SWIPE); bool32 isFalseSwipe = (move->id == MOVE_FALSE_SWIPE);
if (AbilityIsActive(target, ABILITY_ILLUMINATE)) { if (AbilityIsActive(target, ABILITY_ILLUMINATE)) {
gDungeon->unk644.unk1E = 999; gDungeon->unk644.wildMonSpawnFrames = 999;
gDungeon->unk17B34 = target; gDungeon->illuminatePokemon = target;
gDungeon->unk17B40 = target->spawnGenID; gDungeon->illuminateMonSpawnGenID = target->spawnGenID;
} }
HandleDealingDamage(attacker, target, dmgStruct, isFalseSwipe, TRUE, dungeonExitReason, TRUE, 0); HandleDealingDamage(attacker, target, dmgStruct, isFalseSwipe, TRUE, dungeonExitReason, TRUE, 0);

View File

@ -11,8 +11,8 @@
#include "effect_sub_1.h" #include "effect_sub_1.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "dungeon_logic.h" #include "dungeon_logic.h"
#include "dungeon_config.h" #include "dungeon_config.h"
@ -44,10 +44,7 @@
#include "dungeon_damage.h" #include "dungeon_damage.h"
#include "dungeon_leveling.h" #include "dungeon_leveling.h"
extern void sub_80429C8(Entity *r0);
extern void sub_806A1E8(Entity *pokemon); extern void sub_806A1E8(Entity *pokemon);
extern void sub_804178C(u32);
extern void sub_80428A0(Entity *r0);
extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8); extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8);
extern void sub_8040DA0(Entity *entity, Move *move); extern void sub_8040DA0(Entity *entity, Move *move);
extern u16 GetEffectiveMoveId(u16 moveId, u8 weather, u8 hasSpecialEffect); extern u16 GetEffectiveMoveId(u16 moveId, u8 weather, u8 hasSpecialEffect);

View File

@ -10,7 +10,7 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_pos_data.h" #include "dungeon_pos_data.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "move_util.h" #include "move_util.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"

View File

@ -5,10 +5,10 @@
#include "constants/move_id.h" #include "constants/move_id.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "dungeon_action.h" #include "dungeon_action.h"
#include "code_8066D04.h" #include "code_8066D04.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "run_dungeon.h" #include "run_dungeon.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "dungeon_range.h" #include "dungeon_range.h"
@ -37,23 +37,22 @@
#include "dungeon_submenu.h" #include "dungeon_submenu.h"
#include "dungeon_engine.h" #include "dungeon_engine.h"
extern void sub_80684C4(void); static EWRAM_DATA WindowHeader sReleaseMenuWinHeader = {0};
extern void sub_8068344(void);
void sub_8068310(s32 n, Pokemon **monPtrs);
void sub_8067F00(u8 a0, Pokemon **a1, s32 a2, s32 a3, s32 a4);
void sub_806806C(Pokemon *a0);
static EWRAM_DATA WindowHeader gUnknown_202F308 = {0};
static EWRAM_DATA s32 gUnknown_202F30C = 0; static EWRAM_DATA s32 gUnknown_202F30C = 0;
static EWRAM_DATA s32 gUnknown_202F310 = 0; static EWRAM_DATA s32 gUnknown_202F310 = 0;
static void sub_8067F00(u8 a0, Pokemon **a1, s32 a2_, s32 a3, s32 a4);
static void ShowPokemonSummary(Pokemon *a0);
static void sub_8068310(s32 n, Pokemon **monPtrs);
static void ShowUpArrowSprite(void);
static void ShowDownArrowSprite(void);
// It's likely a struct only used in Blue version. Touchpad maybe? // It's likely a struct only used in Blue version. Touchpad maybe?
static const u8 sTouchScreenArrowPressData[] = { static const u8 sTouchScreenArrowPressData[] = {
0x01, 0, 0x38, 0, 0, 0, 0x18, 0, 0x18, 0, 0, 0, 0x02, 0, 0x38, 0, 0x68, 0, 0x18, 0, 0x18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0x01, 0, 0x38, 0, 0, 0, 0x18, 0, 0x18, 0, 0, 0, 0x02, 0, 0x38, 0, 0x68, 0, 0x18, 0, 0x18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}; };
static const WindowTemplates gUnknown_8106DC8 = { static const WindowTemplates sReleaseMenuWindowTemplates = {
.id = { .id = {
[0] = [0] =
{ {
@ -64,7 +63,7 @@ static const WindowTemplates gUnknown_8106DC8 = {
.height = 0x0E, .height = 0x0E,
.unk10 = 0x12, .unk10 = 0x12,
.unk12 = 0x02, .unk12 = 0x02,
.header = &gUnknown_202F308 .header = &sReleaseMenuWinHeader
}, },
[1] = [1] =
{ {
@ -82,11 +81,11 @@ static const WindowTemplates gUnknown_8106DC8 = {
} }
}; };
void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3) void ShowRecruitReleaseMenu(u8 a0, s32 a1, s32 a2, Pokemon **a3)
{ {
s32 i; s32 i;
s32 r10; s32 r10;
WindowTemplates spTxtStruct = gUnknown_8106DC8; WindowTemplates winTemplates = sReleaseMenuWindowTemplates;
gUnknown_202F30C = 0; gUnknown_202F30C = 0;
r10 = 0; r10 = 0;
@ -101,14 +100,14 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3)
while (1) { while (1) {
s32 r7 = 0, r5 = 0; s32 r7 = 0, r5 = 0;
gUnknown_202F308.count = 1; sReleaseMenuWinHeader.count = 1;
gUnknown_202F308.currId = 0; sReleaseMenuWinHeader.currId = 0;
gUnknown_202F308.width = 0xE; sReleaseMenuWinHeader.width = 0xE;
gUnknown_202F308.f3 = 0; sReleaseMenuWinHeader.f3 = 0;
ASM_MATCH_TRICK(r7); ASM_MATCH_TRICK(r7);
DungeonShowWindows(&spTxtStruct, 1); DungeonShowWindows(&winTemplates, 1);
sub_8067F00(a0, a3, gUnknown_202F30C, a2, a1); sub_8067F00(a0, a3, gUnknown_202F30C, a2, a1);
gDungeonMenu.currPageEntries = min(a2, 8); gDungeonMenu.currPageEntries = min(a2, 8);
gDungeonMenu.menuIndex = r10; gDungeonMenu.menuIndex = r10;
@ -131,11 +130,11 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3)
r7 = 0; r7 = 0;
if (a2 - gUnknown_202F30C > 8) { if (a2 - gUnknown_202F30C > 8) {
r5 = 1; r5 = 1;
sub_80684C4(); ShowDownArrowSprite();
} }
if (gUnknown_202F30C != 0) { if (gUnknown_202F30C != 0) {
r7 = 1; r7 = 1;
sub_8068344(); ShowUpArrowSprite();
} }
touchScreenArrow = GetTouchScreenArrowPress(0, sTouchScreenArrowPressData); touchScreenArrow = GetTouchScreenArrowPress(0, sTouchScreenArrowPressData);
@ -243,7 +242,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3)
} }
else if (r7 == 3) { else if (r7 == 3) {
r10 = gDungeonMenu.menuIndex; r10 = gDungeonMenu.menuIndex;
sub_806806C(a3[gUnknown_202F30C + r10]); ShowPokemonSummary(a3[gUnknown_202F30C + r10]);
continue; continue;
} }
else { else {
@ -270,7 +269,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3)
} }
sub_8045064(); sub_8045064();
CreateDungeonMenuSubWindow(&spTxtStruct.id[0], 0x15); CreateDungeonMenuSubWindow(&winTemplates.id[0], 0x15);
while (1) { while (1) {
AddMenuCursorSprite(&gDungeonMenu); AddMenuCursorSprite(&gDungeonMenu);
@ -312,7 +311,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3)
sub_8068310(a2, a3); sub_8068310(a2, a3);
} }
else { else {
sub_806806C(a3[arrId]); ShowPokemonSummary(a3[arrId]);
} }
} }
continue; continue;
@ -321,7 +320,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3)
} }
} }
void sub_8067F00(u8 a0, Pokemon **a1, s32 a2_, s32 a3, s32 a4) static void sub_8067F00(u8 a0, Pokemon **a1, s32 a2_, s32 a3, s32 a4)
{ {
s32 i, y; s32 i, y;
s32 a2; s32 a2;
@ -375,24 +374,24 @@ void sub_8067F00(u8 a0, Pokemon **a1, s32 a2_, s32 a3, s32 a4)
sub_80073E0(1); sub_80073E0(1);
} }
void sub_806806C(Pokemon *a0) static void ShowPokemonSummary(Pokemon *a0)
{ {
struct MonSummaryInfo unkStruct; struct MonSummaryInfo unkStruct;
struct UnkInfoTabStruct var_C8; struct UnkInfoTabStruct var_C8;
WindowTemplates spTxtStruct = {0}; WindowTemplates winTemplates = {0};
s32 r7; s32 r7;
spTxtStruct.id[0].type = WINDOW_TYPE_WITH_HEADER; winTemplates.id[0].type = WINDOW_TYPE_WITH_HEADER;
spTxtStruct.id[0].pos.x = 2; winTemplates.id[0].pos.x = 2;
spTxtStruct.id[0].pos.y = 2; winTemplates.id[0].pos.y = 2;
spTxtStruct.id[0].width = 0x12; winTemplates.id[0].width = 0x12;
spTxtStruct.id[0].height = 0xE; winTemplates.id[0].height = 0xE;
spTxtStruct.id[0].unk10 = 0x12; winTemplates.id[0].unk10 = 0x12;
spTxtStruct.id[0].unk12 = 2; winTemplates.id[0].unk12 = 2;
spTxtStruct.id[0].header = &gUnknown_202F308; winTemplates.id[0].header = &sReleaseMenuWinHeader;
spTxtStruct.id[1].type = WINDOW_TYPE_NORMAL; winTemplates.id[1].type = WINDOW_TYPE_NORMAL;
spTxtStruct.id[2].type = WINDOW_TYPE_NORMAL; winTemplates.id[2].type = WINDOW_TYPE_NORMAL;
spTxtStruct.id[3].type = WINDOW_TYPE_NORMAL; winTemplates.id[3].type = WINDOW_TYPE_NORMAL;
r7 = 0; r7 = 0;
unkStruct.unk40 = 0; unkStruct.unk40 = 0;
@ -403,10 +402,10 @@ void sub_806806C(Pokemon *a0)
bool32 loopBreak = FALSE; bool32 loopBreak = FALSE;
s32 spF8[4] = {2, 3, 4, 5}; s32 spF8[4] = {2, 3, 4, 5};
gUnknown_202F308.count = 4; sReleaseMenuWinHeader.count = 4;
gUnknown_202F308.currId = r7; sReleaseMenuWinHeader.currId = r7;
gUnknown_202F308.width = 10; sReleaseMenuWinHeader.width = 10;
gUnknown_202F308.f3 = 0; sReleaseMenuWinHeader.f3 = 0;
gDungeonMenu.currPage = r7; gDungeonMenu.currPage = r7;
gDungeonMenu.pagesCount = 4; gDungeonMenu.pagesCount = 4;
@ -419,7 +418,7 @@ void sub_806806C(Pokemon *a0)
gDungeonMenu.windowId = 0; gDungeonMenu.windowId = 0;
ResetTouchScreenMenuInput(&gDungeonMenu.touchScreen); ResetTouchScreenMenuInput(&gDungeonMenu.touchScreen);
DungeonShowWindows(&spTxtStruct, 1); DungeonShowWindows(&winTemplates, 1);
SetMonSummaryInfo(&unkStruct, a0, gDungeon->unk644.unk16); SetMonSummaryInfo(&unkStruct, a0, gDungeon->unk644.unk16);
ShowPokemonSummaryWindow(spF8[r7], r7, &unkStruct, &var_C8, 0); ShowPokemonSummaryWindow(spF8[r7], r7, &unkStruct, &var_C8, 0);
@ -432,10 +431,10 @@ void sub_806806C(Pokemon *a0)
AddMenuCursorSprite(&gDungeonMenu); AddMenuCursorSprite(&gDungeonMenu);
if (spF8[r7] == 4) { if (spF8[r7] == 4) {
if (var_C8.unk0[8] != 0) { if (var_C8.unk0[8] != 0) {
sub_80684C4(); ShowDownArrowSprite();
} }
if (unkStruct.unk40 != 0) { if (unkStruct.unk40 != 0) {
sub_8068344(); ShowUpArrowSprite();
} }
} }
@ -506,7 +505,7 @@ void sub_806806C(Pokemon *a0)
sub_803EAF0(0, NULL); sub_803EAF0(0, NULL);
} }
void sub_8068310(s32 n, Pokemon **monPtrs) static void sub_8068310(s32 n, Pokemon **monPtrs)
{ {
s32 i; s32 i;
s32 counter = 0; s32 counter = 0;
@ -519,7 +518,8 @@ void sub_8068310(s32 n, Pokemon **monPtrs)
gUnknown_202F310 = counter; gUnknown_202F310 = counter;
} }
void sub_8068344(void) // Identical to the functions in dungeon_menu_team.c
static void ShowUpArrowSprite(void)
{ {
if ((gDungeonFramesCounter & 8) != 0) { if ((gDungeonFramesCounter & 8) != 0) {
Window *window = &gWindows[0]; Window *window = &gWindows[0];
@ -542,8 +542,7 @@ void sub_8068344(void)
} }
} }
// The same as sub_80623B0 static void ShowDownArrowSprite(void)
void sub_80684C4(void)
{ {
if ((gDungeonFramesCounter & 8) != 0) { if ((gDungeonFramesCounter & 8) != 0) {
Window *window = &gWindows[0]; Window *window = &gWindows[0];

View File

@ -2,7 +2,7 @@
#include "globaldata.h" #include "globaldata.h"
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "dungeon_map.h" #include "dungeon_map.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"

View File

@ -307,10 +307,10 @@ const u8 *const gUnknown_80F9BB0 = _("{POKEMON_0} became the leader!");
const u8 *const gUnknown_80F9BD8 = _("The leader couldn't be switched!"); const u8 *const gUnknown_80F9BD8 = _("The leader couldn't be switched!");
const u8 *const gUnknown_80F9C08 = _("You haven't paid for the merchandise yet!"); const u8 *const gUnknown_80F9C08 = _("You haven't paid for the merchandise yet!");
const u8 *const gUnknown_80F9C2C = _("A thief can't switch leaders!"); const u8 *const gUnknown_80F9C2C = _("A thief can't switch leaders!");
const u8 *const gUnknown_80F9C4C = _("...Something's stirring."); const u8 *const gText_SomethingStirring = _("...Something's stirring.");
const u8 *const gUnknown_80F9C70 = _("...Something's approaching."); const u8 *const gText_SomethingApproaching = _("...Something's approaching.");
const u8 *const gUnknown_80F9C8C = _("It's getting closer!"); const u8 *const gText_ItsGettingCloser = _("It's getting closer!");
const u8 *const gUnknown_80F9CBC = _("It's right nearby! It's gusting hard!"); const u8 *const gText_ItsRightNearbyGustingHard = _("It's right nearby! It's gusting hard!");
const u8 *const gUnknown_80F9CC0[] = { const u8 *const gUnknown_80F9CC0[] = {
[0] = _("{POKEMON_1} was defeated!"), [0] = _("{POKEMON_1} was defeated!"),
[1] = _("{POKEMON_1} fainted!"), [1] = _("{POKEMON_1} fainted!"),
@ -357,13 +357,13 @@ const u8 *const gUnknown_80F9F2C = _("{POKEMON_0} didn't learn the new move.");
const u8 *const gUnknown_80F9FA4 = _("This Pokémon learned a new move,\nso it must forget an old one. Moves can\nbe relearned at the Gulpin Link Shop."); const u8 *const gUnknown_80F9FA4 = _("This Pokémon learned a new move,\nso it must forget an old one. Moves can\nbe relearned at the Gulpin Link Shop.");
const u8 *const gUnknown_80F9FE8 = _("Yes! {POKEMON_0} wants to join the team!\nAccept {POKEMON_0} as a team member?"); const u8 *const gUnknown_80F9FE8 = _("Yes! {POKEMON_0} wants to join the team!\nAccept {POKEMON_0} as a team member?");
const u8 *const gUnknown_80F9FEC = _(""); const u8 *const gUnknown_80F9FEC = _("");
const u8 *const gUnknown_80FA004 = _("{POKEMON_0} went away..."); const u8 *const gText_Pokemon0WentAway = _("{POKEMON_0} went away...");
const u8 *const gUnknown_80FA030 = _("The Pokémon couldn't join the team..."); const u8 *const gText_ThePokemonCouldntJoinTeam = _("The Pokémon couldn't join the team...");
const u8 *const gUnknown_80FA058 = _("But it couldn't join the team."); const u8 *const gText_ButItCouldntJoinTheTeam = _("But it couldn't join the team.");
const u8 *const gUnknown_80FA090 = _("A new member joined the team!\nGive it a nickname?"); const u8 *const gText_NewMemberJoinedGiveItNickname = _("A new member joined the team!\nGive it a nickname?");
const u8 *const gUnknown_80FA0C8 = _("Please give your new team member\na proper nickname!"); const u8 *const gText_PleaseGiveNicknameNewMember = _("Please give your new team member\na proper nickname!");
const u8 *const gUnknown_80FA0F0 = _("{POKEMON_0} joined $t to\ngo on adventures!"); const u8 *const gText_Pokemon0JoinedToGoOnAdventures = _("{POKEMON_0} joined $t to\ngo on adventures!");
const u8 *const gUnknown_80FA120 = _("{POKEMON_0} gained access to\nthe Friend Area {FRIEND_AREA}."); const u8 *const gText_Pokemon0GainedAccessToFriendArea = _("{POKEMON_0} gained access to\nthe Friend Area {FRIEND_AREA}.");
const u8 *const gUnknown_80FA124[] = { const u8 *const gUnknown_80FA124[] = {
[0] = _("{POKEMON_0} was slowed!"), [0] = _("{POKEMON_0} was slowed!"),
[1] = _("{POKEMON_0} returned to normal speed!"), [1] = _("{POKEMON_0} returned to normal speed!"),
@ -917,7 +917,7 @@ const u8 *const gUnknown_80FE690 = _("{POKEMON_0} was sent flying!");
const u8 *const gUnknown_80FE6B4 = _("But it didn't go anywhere."); const u8 *const gUnknown_80FE6B4 = _("But it didn't go anywhere.");
const u8 *const gUnknown_80FE6D4 = _("{POKEMON_0} can't throw items!"); const u8 *const gUnknown_80FE6D4 = _("{POKEMON_0} can't throw items!");
const u8 *const gText_TheLastOuting = _("The Last Outing"); const u8 *const gText_TheLastOuting = _("The Last Outing");
const u8 *const gUnknown_80FE6F4 = _("Someone"); const u8 *const gText_Someone = _("Someone");
const u8 *const gUnknown_80FE708 = _("Tile underfoot"); const u8 *const gUnknown_80FE708 = _("Tile underfoot");
const u8 *const gUnknown_80FE70C = _("Stairs"); const u8 *const gUnknown_80FE70C = _("Stairs");
const u8 *const gUnknown_80FE720 = _("Rescue Point"); const u8 *const gUnknown_80FE720 = _("Rescue Point");
@ -1003,7 +1003,7 @@ const u8 *const gUnknown_80FED08 = _("But nothing happened!");
const u8 *const gUnknown_80FED0C = _("But nothing happened!"); const u8 *const gUnknown_80FED0C = _("But nothing happened!");
const u8 *const gUnknown_80FED30 = _("It bounced off the trick tile!"); const u8 *const gUnknown_80FED30 = _("It bounced off the trick tile!");
const u8 *const gUnknown_80FED34 = _("{POKEMON_0} disappeared in the blast!"); const u8 *const gUnknown_80FED34 = _("{POKEMON_0} disappeared in the blast!");
const u8 *const gUnknown_80FED68 = _("{POKEMON_0} blinked."); const u8 *const gText_Pokemon0Blinked = _("{POKEMON_0} blinked.");
const u8 *const gUnknown_80FED88 = _("Overgrow boosted its power!"); const u8 *const gUnknown_80FED88 = _("Overgrow boosted its power!");
const u8 *const gUnknown_80FEDA8 = _("Torrent boosted its power!"); const u8 *const gUnknown_80FEDA8 = _("Torrent boosted its power!");
const u8 *const gUnknown_80FEDC8 = _("Swarm boosted its power!"); const u8 *const gUnknown_80FEDC8 = _("Swarm boosted its power!");

View File

@ -11,7 +11,7 @@
#include "effect_data.h" #include "effect_data.h"
#include "code_801602C.h" #include "code_801602C.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_info.h" #include "dungeon_info.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "dungeon_map.h" #include "dungeon_map.h"
@ -32,8 +32,7 @@
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "run_dungeon.h" #include "run_dungeon.h"
#include "effect_main.h" #include "effect_main.h"
#include "dungeon_8041AD0.h"
extern void sub_8041888(u8 param_1);
static void sub_803F38C(void); static void sub_803F38C(void);
static void sub_803F7BC(void); static void sub_803F7BC(void);

View File

@ -11,7 +11,7 @@
#include "dungeon_music.h" #include "dungeon_music.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "game_options.h" #include "game_options.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "moves.h" #include "moves.h"
@ -40,12 +40,11 @@
#include "move_orb_effects_1.h" #include "move_orb_effects_1.h"
#include "warp_target.h" #include "warp_target.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"
#include "dungeon_8041AD0.h"
#include "dungeon_entity_movement.h"
extern void sub_805229C(void); extern void sub_805229C(void);
extern void sub_80420B8(Entity *pokemon);
extern void sub_8041C4C(Entity *pokemon, u32 r1);
extern void sub_805E804(void); extern void sub_805E804(void);
extern bool8 DisplayActions(Entity *a0);
void ApplyEndOfTurnEffects(Entity *entity) void ApplyEndOfTurnEffects(Entity *entity)
{ {

View File

@ -4,8 +4,8 @@
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "structs/str_traps.h" #include "structs/str_traps.h"
#include "structs/map.h" #include "structs/map.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_items.h" #include "dungeon_items.h"
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
@ -144,7 +144,7 @@ void sub_804522C(void)
{ {
if(entity == gDungeon->unk181e8.cameraTarget) if(entity == gDungeon->unk181e8.cameraTarget)
{ {
sub_806C51C(entity); UpdateMonsterSprite(entity);
} }
else else
{ {
@ -162,7 +162,7 @@ void sub_804522C(void)
entity2 = gDungeon->teamPokemon[index]; entity2 = gDungeon->teamPokemon[index];
if(EntityIsValid(entity2)) if(EntityIsValid(entity2))
{ {
sub_806C51C(entity2); UpdateMonsterSprite(entity2);
} }
} }
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
@ -170,7 +170,7 @@ void sub_804522C(void)
entity2 = gDungeon->wildPokemon[index]; entity2 = gDungeon->wildPokemon[index];
if(EntityIsValid(entity2)) if(EntityIsValid(entity2))
{ {
sub_806C51C(entity2); UpdateMonsterSprite(entity2);
} }
} }
@ -615,7 +615,7 @@ void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3)
GetTrapName(buffer, GetTrapData_1(entity)->id); GetTrapName(buffer, GetTrapData_1(entity)->id);
break; break;
default: default:
strcpy(buffer, gUnknown_80FE6F4); strcpy(buffer, gText_Someone);
break; break;
} }
} }

View File

@ -0,0 +1,111 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_wild_mon_spawn.h"
#include "constants/tactic.h"
#include "dungeon_config.h"
#include "dungeon_range.h"
#include "dungeon_message.h"
#include "dungeon_8041AD0.h"
#include "constants/dungeon.h"
#include "dungeon_map_access.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon_info.h"
#include "pokemon_3.h"
#include "code_805D8C8.h"
#include "dungeon_logic.h"
#include "dungeon_floor_spawns.h"
#include "dungeon_strings.h"
#include "dungeon_misc.h"
#include "dungeon_mon_spawn.h"
void TrySpawnWildMonster(void)
{
s32 i;
s32 species;
s32 wildMonsCount;
struct Entity *illuminateEntity;
s32 level;
struct Dungeon *dungeon;
struct MonSpawnInfo monSpawnInfo;
illuminateEntity = NULL;
dungeon = gDungeon;
if (dungeon->unk644.enemyDensity == 0)
return;
if (dungeon->unk644.dungeonLocation.id == DUNGEON_METEOR_CAVE && dungeon->unk37FD != 0)
return;
dungeon->unk644.wildMonSpawnFrames++;
if (!dungeon->unk644.stoleFromKecleon) {
if (dungeon->unk644.wildMonSpawnFrames < gWildSpawnIntervalFrames)
return;
}
else {
if (dungeon->unk644.wildMonSpawnFrames < gKecleonSpawnIntervalFrames)
return;
}
if (dungeon->unk644.wildMonSpawnFrames > 900) {
Entity *entity = dungeon->illuminatePokemon;
if (EntityIsValid(entity) && entity->spawnGenID == dungeon->illuminateMonSpawnGenID) {
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0);
illuminateEntity = entity;
}
}
dungeon->unk644.wildMonSpawnFrames = 0;
dungeon->illuminatePokemon = NULL;
wildMonsCount = 0;
for (i = 0; i < DUNGEON_MAX_WILD_POKEMON; i++) {
Entity *entity = dungeon->wildPokemon[i];
if (EntityIsValid(entity)) {
const Tile *tile = GetTile(entity->pos.x, entity->pos.y);
if (!(tile->terrainFlags & TERRAIN_TYPE_UNBREAKABLE)) {
wildMonsCount++;
}
}
}
if (!dungeon->unk644.stoleFromKecleon) {
if (gDungeon->monsterHouseRoom == CORRIDOR_ROOM) {
if (wildMonsCount >= gMaxWildMonsInMonsterHouse)
return;
}
else {
if (wildMonsCount >= gMaxWildMonsInRoom)
return;
}
}
if (illuminateEntity != NULL) {
DisplayDungeonLoggableMessageTrue(0,gText_Pokemon0Blinked);
sub_8042920(illuminateEntity);
}
if (dungeon->unk644.stoleFromKecleon) {
species = MONSTER_KECLEON;
}
else {
species = GetRandomFloorMonsterId(0);
}
level = GetSpawnedMonsterLevel(species);
if (level == 0) {
level = 1;
}
if (sub_806AA0C(species, 0) && sub_8083660(&monSpawnInfo.pos)) {
monSpawnInfo.species = species;
monSpawnInfo.level = level;
monSpawnInfo.unk2 = 0;
if (DungeonRandInt(100) < GetRandomMovementChance(gDungeon->unk644.dungeonLocation.id)) {
monSpawnInfo.unk4 = 1;
}
else {
monSpawnInfo.unk4 = 0;
}
monSpawnInfo.unk10 = 0;
SpawnWildMon(&monSpawnInfo, FALSE);
}
}

View File

@ -1,7 +1,7 @@
#include "global.h" #include "global.h"
#include "globaldata.h" #include "globaldata.h"
#include "dungeon_wind.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"
#include "code_804267C.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -19,69 +19,67 @@
#include "moves.h" #include "moves.h"
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "dungeon_engine.h" #include "dungeon_engine.h"
#include "dungeon_entity_movement.h"
#include "dungeon_8041AD0.h"
extern u8 DisplayActions(Entity *); void UpdateWindTurns(void)
void sub_807E378(void)
{ {
u16 uVar2; Entity *leader = GetLeader();
Entity *leader;
leader = GetLeader(); if (!EntityIsValid(leader))
if (EntityIsValid(leader)) { return;
uVar2 = gDungeon->unk644.windTurns; if (gDungeon->unk644.windTurns <= 0 || --gDungeon->unk644.windTurns < 1) {
if ((gDungeon->unk644.windTurns < 1) || gDungeon->unk644.windPhase = 3;
(gDungeon->unk644.windTurns--, ((uVar2 - 1) << 0x10) < 1)) {
gDungeon->unk644.unk36 = 3;
} }
if (gDungeon->unk644.unk36 == 0) { if (gDungeon->unk644.windPhase == 0) {
if (gDungeon->unk644.windTurns < 0xfa) { if (gDungeon->unk644.windTurns < 0xfa) {
sub_805E804(); sub_805E804();
TryPointCameraToMonster(leader,1); TryPointCameraToMonster(leader,1);
DisplayActions(leader); DisplayActions(leader);
if (IsFloorOver() == 0) { if (!IsFloorOver()) {
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C4C); LogMessageByIdWithPopupCheckUser(leader,gText_SomethingStirring);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0);
gDungeon->unk644.unk36 = 1; gDungeon->unk644.windPhase = 1;
}
} }
}
} }
else if (gDungeon->unk644.unk36 == 1) { else if (gDungeon->unk644.windPhase == 1) {
if (gDungeon->unk644.windTurns < 0x96) { if (gDungeon->unk644.windTurns < 0x96) {
sub_805E804(); sub_805E804();
TryPointCameraToMonster(leader,1); TryPointCameraToMonster(leader,1);
DisplayActions(leader); DisplayActions(leader);
if (IsFloorOver() == 0) { if (!IsFloorOver()) {
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C70); LogMessageByIdWithPopupCheckUser(leader,gText_SomethingApproaching);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1);
gDungeon->unk644.unk36 = 2; gDungeon->unk644.windPhase = 2;
}
} }
}
} }
else if (gDungeon->unk644.unk36 == 2) { else if (gDungeon->unk644.windPhase == 2) {
if (gDungeon->unk644.windTurns < 0x32) { if (gDungeon->unk644.windTurns < 0x32) {
sub_805E804(); sub_805E804();
TryPointCameraToMonster(leader,1); TryPointCameraToMonster(leader,1);
DisplayActions(leader); DisplayActions(leader);
if (IsFloorOver() == 0) { if (!IsFloorOver()) {
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C8C); LogMessageByIdWithPopupCheckUser(leader,gText_ItsGettingCloser);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2);
gDungeon->unk644.unk36 = 3; gDungeon->unk644.windPhase = 3;
}
} }
}
} }
else if (gDungeon->unk644.windTurns < 1) { else {
sub_805E804(); if (gDungeon->unk644.windTurns < 1) {
TryPointCameraToMonster(leader,1); sub_805E804();
DisplayActions(leader); TryPointCameraToMonster(leader,1);
if (IsFloorOver() == 0) { DisplayActions(leader);
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9CBC); if (!IsFloorOver()) {
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); LogMessageByIdWithPopupCheckUser(leader,gText_ItsRightNearbyGustingHard);
gDungeon->unk644.unk36 = 4; sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3);
HandleFaint(leader,DUNGEON_EXIT_BLOWN_OUT_UNSEEN_FORCE,leader); gDungeon->unk644.windPhase = 4;
} HandleFaint(leader,DUNGEON_EXIT_BLOWN_OUT_UNSEEN_FORCE,leader);
}
}
} }
}
} }

View File

@ -6,7 +6,7 @@
#include "constants/weather.h" #include "constants/weather.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "dungeon_ai.h" #include "dungeon_ai.h"
#include "run_dungeon.h" #include "run_dungeon.h"
@ -19,7 +19,7 @@
#include "move_orb_effects_1.h" #include "move_orb_effects_1.h"
#include "moves.h" #include "moves.h"
#include "move_util.h" #include "move_util.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "weather.h" #include "weather.h"
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"
@ -28,9 +28,6 @@
#include "dungeon_engine.h" #include "dungeon_engine.h"
#include "dungeon_damage.h" #include "dungeon_damage.h"
extern void sub_804216C(Entity *pokemon, Entity *target, u32 r2);
extern void sub_804218C(Entity *pokemon, Entity *target);
static EWRAM_INIT u32 gUnknown_203B444[3] = {0x28, 0x28, 0x50}; static EWRAM_INIT u32 gUnknown_203B444[3] = {0x28, 0x28, 0x50};
static const DungeonPos gUnknown_81070E8[] = { static const DungeonPos gUnknown_81070E8[] = {

View File

@ -5,7 +5,7 @@
#include "constants/weather.h" #include "constants/weather.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
#include "dungeon_ai.h" #include "dungeon_ai.h"
#include "run_dungeon.h" #include "run_dungeon.h"
@ -18,7 +18,7 @@
#include "move_orb_effects_1.h" #include "move_orb_effects_1.h"
#include "moves.h" #include "moves.h"
#include "move_util.h" #include "move_util.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "weather.h" #include "weather.h"
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"

View File

@ -2,10 +2,9 @@
#include "globaldata.h" #include "globaldata.h"
#include "hurl_orb.h" #include "hurl_orb.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_8041AD0.h" #include "dungeon_8041AD0.h"
#include "code_804267C.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
#include "constants/monster.h" #include "constants/monster.h"

View File

@ -5,7 +5,7 @@
#include "dungeon_move_util.h" #include "dungeon_move_util.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"

View File

@ -5,7 +5,7 @@
#include "dungeon_move_util.h" #include "dungeon_move_util.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"

View File

@ -3,7 +3,7 @@
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "move_orb_actions_3.h" #include "move_orb_actions_3.h"
#include "dungeon_tilemap.h" #include "dungeon_tilemap.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"

View File

@ -8,7 +8,7 @@
#include "dungeon_move_util.h" #include "dungeon_move_util.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "dungeon_move.h" #include "dungeon_move.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -634,7 +634,7 @@ bool8 TrawlOrbAction(Entity * pokemon, Entity * target, Move *move, s32 itemId)
bool8 EscapeOrbAction(Entity * pokemon, Entity * target, Move *move, s32 itemId) bool8 EscapeOrbAction(Entity * pokemon, Entity * target, Move *move, s32 itemId)
{ {
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
if (gDungeon->unk644.unk2A != 0) { if (gDungeon->unk644.stoleFromKecleon != 0) {
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD4DC); // $m0 can't escape! TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD4DC); // $m0 can't escape!
} }
else { else {

View File

@ -11,15 +11,13 @@
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_util.h" #include "dungeon_util.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_pos_data.h" #include "dungeon_pos_data.h"
#include "dungeon_floor_spawns.h" #include "dungeon_floor_spawns.h"
#include "hurl_orb.h" #include "hurl_orb.h"
#include "trap.h" #include "trap.h"
#include "move_orb_effects_2.h" #include "move_orb_effects_2.h"
#include "dungeon_8041AD0.h"
extern void sub_8042A54(DungeonPos *);
extern void sub_8042A64(DungeonPos *);
bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 itemId) bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 itemId)
{ {

View File

@ -2,7 +2,7 @@
#include "globaldata.h" #include "globaldata.h"
#include "move_orb_effects_1.h" #include "move_orb_effects_1.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/direction.h" #include "constants/direction.h"
@ -32,40 +32,7 @@
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "dungeon_pos_data.h" #include "dungeon_pos_data.h"
#include "dungeon_data.h" #include "dungeon_data.h"
#include "dungeon_8041AD0.h"
extern void sub_80420A0(Entity *);
extern void sub_8041C58(Entity *r0);
extern void sub_8041F28(Entity *, s32);
extern void sub_8041F4C(Entity *, s32);
extern void sub_8041F70(Entity *, s32);
extern void sub_8041F94(Entity *, s32);
extern void sub_8041C08(Entity *);
extern void sub_8076CB4(s32);
extern void sub_8041F08(Entity *);
extern void sub_8041C7C(Entity *);
extern void sub_8041C6C(Entity *);
extern void sub_8041C34(Entity *);
extern void sub_8041EF8(Entity *);
extern void sub_8041EE8(Entity *);
extern void sub_8041EC8(Entity *);
extern void sub_8041ED8(Entity *);
extern void EntityUpdateStatusSprites(Entity *);
extern void sub_8041AF4(Entity *);
extern void nullsub_91(Entity *);
extern void nullsub_90(Entity *);
extern void nullsub_72(Entity *);
extern void nullsub_71(Entity *);
extern void nullsub_70(Entity *);
extern void nullsub_69(Entity *, Entity *);
extern void sub_8041CB8(Entity *r0);
extern void sub_8041C1C(Entity *r0);
extern void sub_8042060(Entity *, s32);
extern void sub_8041FB4(Entity *r0, u32 r1);
extern void sub_8041FD8(Entity *r0, u32 r1);
extern void sub_804201C(Entity *r0, u32 r1);
extern void sub_8041FFC(Entity *r0, u32 r1);
extern void sub_8041CCC(Entity *);
extern void sub_8042040(Entity *, s32);
u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns) u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns)
{ {

View File

@ -2,7 +2,7 @@
#include "globaldata.h" #include "globaldata.h"
#include "move_orb_effects_2.h" #include "move_orb_effects_2.h"
#include "dungeon_vram.h" #include "dungeon_vram.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/status.h" #include "constants/status.h"
@ -30,65 +30,7 @@
#include "move_orb_actions_1.h" #include "move_orb_actions_1.h"
#include "move_orb_effects_5.h" #include "move_orb_effects_5.h"
#include "run_dungeon.h" #include "run_dungeon.h"
#include "dungeon_8041AD0.h"
extern void sub_8041D84(Entity *);
extern void sub_804178C(u32);
extern void sub_8041D5C(Entity *);
extern void sub_8041D48(Entity *);
extern void sub_8041D38(Entity * pokemon);
extern void sub_8041CDC(Entity *pokemon);
extern void sub_8041CEC(Entity *pokemon);
extern void nullsub_73(Entity *);
extern void nullsub_74(Entity *);
extern void nullsub_75(Entity *);
extern void nullsub_76(Entity *);
extern void nullsub_77(Entity *);
extern void nullsub_78(Entity *);
extern void nullsub_79(Entity *);
extern void nullsub_80(Entity *);
extern void nullsub_81(Entity *);
extern void nullsub_82(Entity *);
extern void nullsub_83(Entity *);
extern void nullsub_84(Entity *);
extern void nullsub_85(Entity *);
extern void EntityUpdateStatusSprites(Entity *);
extern void sub_8042A74(Entity *r0);
extern void sub_80420C8(Entity *r0);
extern void nullsub_68(Entity *);
extern void nullsub_67(Entity *);
extern void nullsub_66(Entity *);
extern void nullsub_65(Entity *);
extern void nullsub_64(Entity *);
extern void nullsub_63(Entity *);
extern void nullsub_62(Entity *);
extern void nullsub_61(Entity *);
extern void nullsub_60(Entity *);
extern void nullsub_59(Entity *);
extern void nullsub_58(Entity *);
extern void nullsub_57(Entity *);
extern void sub_8041B34(Entity *);
void sub_8041BD0(Entity *r0, u8 r1);
void sub_8041EB4(Entity *);
void sub_8041EA4(Entity *);
extern void sub_8041E84(Entity *);
extern void sub_8041E94(Entity *);
extern void sub_8041E74(Entity *);
extern void sub_8041E60(Entity *);
extern void sub_8041E4C(Entity *);
extern void sub_8041E3C(Entity *);
extern void sub_8041E1C(Entity *);
extern void nullsub_89(Entity *);
extern void nullsub_88(Entity *);
extern void nullsub_87(Entity *);
extern void nullsub_86(Entity *);
extern void sub_8041E0C(Entity *);
extern void sub_8041DD8(Entity *r0, s32 r1); // NOTE: is s16 in another file
extern void sub_8041D9C(Entity *);
extern void sub_8041DB0(Entity *pokemon);
extern void sub_8041CA8(Entity *);
extern void sub_8041C94(Entity *);
extern void sub_8041BF8(Entity *);
extern void sub_8041BE8(Entity *);
void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage)
{ {

View File

@ -5,7 +5,7 @@
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/item.h" #include "constants/item.h"
@ -26,9 +26,7 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_pos_data.h" #include "dungeon_pos_data.h"
#include "dungeon_8041AD0.h"
extern void sub_8041BD0(Entity *r0, u8 r1);
extern void EntityUpdateStatusSprites(Entity *);
void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *move, const u8 *message) void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *move, const u8 *message)
{ {

View File

@ -5,7 +5,7 @@
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/item.h" #include "constants/item.h"
@ -26,22 +26,7 @@
#include "dungeon_config.h" #include "dungeon_config.h"
#include "dungeon_strings.h" #include "dungeon_strings.h"
#include "dungeon_misc.h" #include "dungeon_misc.h"
#include "dungeon_8041AD0.h"
extern void EntityUpdateStatusSprites(Entity *);
extern void nullsub_68(Entity *);
extern void nullsub_67(Entity *);
extern void nullsub_66(Entity *);
extern void nullsub_65(Entity *);
extern void nullsub_64(Entity *);
extern void nullsub_63(Entity *);
extern void nullsub_62(Entity *);
extern void nullsub_61(Entity *);
extern void nullsub_60(Entity *);
extern void nullsub_59(Entity *);
extern void nullsub_58(Entity *);
extern void nullsub_57(Entity *);
extern void sub_8041B34(Entity *pokemon);
extern void sub_80420C8(Entity *pokemon);
void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus)
{ {

View File

@ -5,7 +5,7 @@
#include "dungeon_map_access.h" #include "dungeon_map_access.h"
#include "dungeon_message.h" #include "dungeon_message.h"
#include "code_805D8C8.h" #include "code_805D8C8.h"
#include "code_806CD90.h" #include "dungeon_mon_sprite_render.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "constants/ability.h" #include "constants/ability.h"
#include "constants/dungeon_exit.h" #include "constants/dungeon_exit.h"
@ -34,38 +34,7 @@
#include "dungeon_kecleon_shop.h" #include "dungeon_kecleon_shop.h"
#include "dungeon_map.h" #include "dungeon_map.h"
#include "move_orb_effects_2.h" #include "move_orb_effects_2.h"
#include "dungeon_8041AD0.h"
extern void EntityUpdateStatusSprites(Entity *);
extern void sub_8042A74(Entity *r0);
extern void sub_80420C8(Entity *r0);
extern void nullsub_68(Entity *);
extern void nullsub_67(Entity *);
extern void nullsub_66(Entity *);
extern void nullsub_65(Entity *);
extern void nullsub_64(Entity *);
extern void nullsub_63(Entity *);
extern void nullsub_62(Entity *);
extern void nullsub_61(Entity *);
extern void nullsub_60(Entity *);
extern void nullsub_59(Entity *);
extern void nullsub_58(Entity *);
extern void nullsub_57(Entity *);
extern void sub_8041B34(Entity *);
void sub_8041BD0(Entity *r0, u8 r1);
void sub_8041EB4(Entity *);
void sub_8041EA4(Entity *);
extern void sub_8041E84(Entity *);
extern void sub_8041E94(Entity *);
extern void sub_8041E74(Entity *);
extern void sub_8041E60(Entity *);
extern void sub_8041E4C(Entity *);
extern void sub_8041E3C(Entity *);
extern void sub_8041E1C(Entity *);
extern void nullsub_89(Entity *);
extern void nullsub_88(Entity *);
extern void nullsub_87(Entity *);
extern void nullsub_86(Entity *);
extern void sub_8041E0C(Entity *);
void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4)
{ {

Some files were not shown because too many files have changed in this diff Show More