diff --git a/asm/code_8015080.s b/asm/code_8015080.s index 882348670..354ab0a83 100644 --- a/asm/code_8015080.s +++ b/asm/code_8015080.s @@ -1725,97 +1725,4 @@ _08015F34: _08015F40: .4byte gUnknown_80DB098 thumb_func_end sub_8015EB4 - thumb_func_start sub_8015F44 -sub_8015F44: - push {r4,lr} - movs r2, 0 - ldr r0, _08015F78 - ldr r0, [r0] - ldrb r4, [r0, 0x1B] - cmp r2, r4 - bge _08015F7C - adds r3, r0, 0 - adds r3, 0xF8 - ldr r0, [r3] - ldrb r0, [r0] - cmp r0, 0 - beq _08015F7C - movs r2, 0x1 - movs r1, 0x1 -_08015F62: - cmp r1, r4 - bge _08015F7C - ldr r0, [r3] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08015F7C - adds r2, r1, 0x1 - adds r1, r2, 0 - b _08015F62 - .align 2, 0 -_08015F78: .4byte gUnknown_203B1FC -_08015F7C: - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8015F44 - - thumb_func_start sub_8015F84 -sub_8015F84: - push {r4-r7,lr} - movs r6, 0 - movs r5, 0 - ldr r3, _08015FBC - ldr r0, [r3] - ldrb r0, [r0, 0x1B] - cmp r5, r0 - bge _08015FE4 - adds r7, r3, 0 -_08015F96: - ldr r1, [r7] - lsls r4, r5, 1 - adds r0, r1, 0 - adds r0, 0x1E - adds r0, r4 - strh r6, [r0] - adds r0, r1, 0 - adds r0, 0xF8 - ldr r0, [r0] - adds r2, r0, r5 - ldrb r0, [r2] - cmp r0, 0 - bne _08015FC0 - adds r0, r1, 0 - adds r0, 0x8A - adds r0, r4 - movs r1, 0x8 - strh r1, [r0] - b _08015FE4 - .align 2, 0 -_08015FBC: .4byte gUnknown_203B1FC -_08015FC0: - ldrb r0, [r2] - bl ReturnIntFromChar2 - bl GetCharacter - ldr r3, [r7] - adds r1, r3, 0 - adds r1, 0x8A - adds r1, r4 - ldrh r2, [r0, 0x6] - strh r2, [r1] - movs r1, 0x6 - ldrsh r0, [r0, r1] - adds r6, r0 - adds r5, 0x1 - ldrb r3, [r3, 0x1B] - cmp r5, r3 - blt _08015F96 -_08015FE4: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8015F84 - .align 2,0 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index 647e50126..d0e63154f 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -5,91 +5,6 @@ .text - thumb_func_start sub_806A338 -sub_806A338: - push {r4-r6,lr} - movs r5, 0 - ldr r6, _0806A378 -_0806A33E: - ldr r0, [r6] - lsls r1, r5, 2 - ldr r2, _0806A37C - adds r0, r2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _0806A384 - ldr r0, [r4, 0x70] - adds r0, 0xC8 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0806A384 - ldr r1, [r6] - ldr r2, _0806A380 - adds r0, r1, r2 - str r4, [r0] - ldr r0, [r4, 0x70] - adds r2, 0xC - adds r1, r2 - adds r0, 0x98 - ldr r0, [r0] - str r0, [r1] - b _0806A38A - .align 2, 0 -_0806A378: .4byte gDungeon -_0806A37C: .4byte 0x000135cc -_0806A380: .4byte 0x00017b30 -_0806A384: - adds r5, 0x1 - cmp r5, 0x13 - ble _0806A33E -_0806A38A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806A338 - - thumb_func_start sub_806A390 -sub_806A390: - push {r4-r7,lr} - ldr r0, [r0, 0x70] - movs r7, 0 - movs r1, 0x8C - lsls r1, 1 - adds r4, r0, r1 - adds r5, r4, 0 - movs r6, 0x3 -_0806A3A0: - ldrb r1, [r4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806A3C2 - ldrb r1, [r4, 0x1] - movs r0, 0xF7 - ands r0, r1 - movs r1, 0xEF - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r5, 0 - bl GetMoveBasePP - strb r0, [r4, 0x4] -_0806A3C2: - adds r4, 0x8 - adds r5, 0x8 - subs r6, 0x1 - cmp r6, 0 - bge _0806A3A0 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806A390 - thumb_func_start sub_806A3D4 sub_806A3D4: push {r4-r7,lr} diff --git a/asm/code_8086A3C.s b/asm/code_8086A3C.s deleted file mode 100644 index 73589b544..000000000 --- a/asm/code_8086A3C.s +++ /dev/null @@ -1,253 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start ZapdosPreFightDialogue -ZapdosPreFightDialogue: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x70 - bl xxx_call_GetLeader - mov r9, r0 - bl GetPartnerEntity - adds r6, r0, 0 - movs r0, 0x8 - bl GetEntityFromClientType - str r0, [sp, 0x68] - bl sub_8086448 - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - adds r0, r6, 0 - bl SpriteLookAroundEffect - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - adds r0, r6, 0 - movs r1, 0x4 - movs r2, 0x1 - movs r3, 0x2 - bl sub_80869E4 - mov r0, r9 - movs r1, 0x4 - movs r2, 0x2 - movs r3, 0x6 - bl sub_80869E4 - ldr r0, _08087470 - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - adds r0, r6, 0 - movs r1, 0x4 - movs r2, 0x2 - movs r3, 0x4 - bl sub_80869E4 - mov r0, r9 - movs r1, 0x4 - movs r2, 0x1 - movs r3, 0x4 - bl sub_80869E4 - ldr r0, _08087474 - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - movs r0, 0x3 - bl ZapdosScreenFlash - bl DungeonStopBGM - movs r0, 0xED - lsls r0, 1 - bl PlaySoundEffect - ldr r0, _08087478 - bl DisplayDungeonDialogue - ldr r0, [sp, 0x68] - bl ZapdosDropInEffect - movs r0, 0x9 - bl DungeonStartNewBGM - adds r0, r6, 0 - movs r1, 0x6 - movs r2, 0x4 - bl sub_806CDD4 - ldr r0, _0808747C - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - adds r0, r6, 0 - movs r1, 0x2 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80869E4 - mov r1, sp - ldr r0, _08087480 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - mov r0, sp - str r0, [sp, 0x58] - str r6, [sp, 0x5C] - add r4, sp, 0x18 - add r1, sp, 0x58 - add r2, sp, 0x5C - adds r0, r4, 0 - movs r3, 0x1 - bl sub_8085B4C - ldr r0, [r6, 0x70] - ldr r2, _08087484 - adds r1, r0, r2 - movs r0, 0x1 - strb r0, [r1] - add r7, sp, 0x28 - add r3, sp, 0x48 - mov r8, r3 - add r0, sp, 0x60 - mov r10, r0 - mov r1, sp - adds r1, 0x64 - str r1, [sp, 0x6C] - b _0808748E - .align 2, 0 -_08087470: .4byte gUnknown_81014B0 -_08087474: .4byte gUnknown_8101504 -_08087478: .4byte gUnknown_81015A0 -_0808747C: .4byte gUnknown_81015D4 -_08087480: .4byte gUnknown_810744C -_08087484: .4byte 0x0000015f -_08087488: - movs r0, 0x46 - bl sub_803E46C -_0808748E: - adds r0, r4, 0 - bl sub_8085B80 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08087488 - ldr r0, [r6, 0x70] - ldr r2, _08087510 - adds r0, r2 - strb r5, [r0] - ldr r0, [r6, 0x70] - ldr r4, _08087514 - adds r0, r4 - movs r1, 0x1 - strb r1, [r0] - adds r0, r6, 0 - movs r1, 0x2 - movs r2, 0x2 - movs r3, 0x4 - bl sub_80869E4 - ldr r0, _08087518 - bl DisplayDungeonDialogue - movs r0, 0x3C - movs r1, 0x46 - bl sub_803E708 - ldr r0, _0808751C - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - ldr r0, [r6, 0x70] - adds r0, r4 - strb r5, [r0] - adds r0, r6, 0 - movs r1, 0x2 - movs r2, 0x2 - movs r3, 0x5 - bl sub_80869E4 - adds r1, r7, 0 - ldr r0, _08087520 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r3,r4} - stm r1!, {r3,r4} - str r7, [sp, 0x60] - str r6, [sp, 0x64] - mov r0, r8 - mov r1, r10 - ldr r2, [sp, 0x6C] - movs r3, 0x1 - bl sub_8085B4C - mov r4, r9 - adds r4, 0xC - b _0808752A - .align 2, 0 -_08087510: .4byte 0x0000015f -_08087514: .4byte 0x0000015d -_08087518: .4byte gUnknown_81015E8 -_0808751C: .4byte gUnknown_8101624 -_08087520: .4byte gUnknown_8107464 -_08087524: - movs r0, 0x46 - bl sub_803E46C -_0808752A: - mov r0, r8 - bl sub_8085B80 - lsls r0, 24 - cmp r0, 0 - bne _08087524 - adds r0, r6, 0 - movs r1, 0x2 - movs r2, 0x1 - movs r3, 0x3 - bl sub_80869E4 - ldr r0, _080875B0 - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - movs r0, 0x3 - bl ZapdosScreenFlash - ldr r0, _080875B4 - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - movs r0, 0x1 - bl ZapdosScreenFlash - ldr r0, _080875B8 - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - movs r0, 0x2 - bl ZapdosScreenFlash - ldr r0, _080875BC - bl DisplayDungeonDialogue - movs r0, 0xA - movs r1, 0x46 - bl sub_803E708 - movs r1, 0x96 - lsls r1, 1 - ldr r0, [sp, 0x68] - movs r2, 0xB - bl SetupBossFightHP - adds r0, r4, 0 - movs r1, 0x10 - bl ShiftCameraToPosition - add sp, 0x70 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080875B0: .4byte gUnknown_810165C -_080875B4: .4byte gUnknown_8101750 -_080875B8: .4byte gUnknown_810178C -_080875BC: .4byte gUnknown_81017B4 - thumb_func_end ZapdosPreFightDialogue - - .align 2,0 diff --git a/asm/ground_map_1.s b/asm/ground_map_1.s index 8cd5e2798..e25073566 100644 --- a/asm/ground_map_1.s +++ b/asm/ground_map_1.s @@ -5,51 +5,6 @@ .text - thumb_func_start GetAdjustedGroundMap -GetAdjustedGroundMap: - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - cmp r5, 0x9 - beq _080A4D94 - cmp r5, 0x9 - bgt _080A4D90 - cmp r5, 0x2 - beq _080A4DB6 - b _080A4DC4 -_080A4D90: - cmp r5, 0xC - bne _080A4DC4 -_080A4D94: - movs r0, 0 - movs r1, 0x27 - bl GetScriptVarValue - adds r4, r0, 0 - movs r0, 0 - movs r1, 0x28 - bl GetScriptVarValue - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 1 - adds r1, r0 - adds r1, r5, r1 - lsls r1, 16 - asrs r5, r1, 16 - b _080A4DC4 -_080A4DB6: - movs r0, 0x6 - bl sub_80023E4 - lsls r0, 24 - cmp r0, 0 - beq _080A4DC4 - movs r5, 0x3 -_080A4DC4: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetAdjustedGroundMap - thumb_func_start GroundMap_Select GroundMap_Select: push {r4-r6,lr} diff --git a/asm/wonder_mail_3_mid.s b/asm/wonder_mail_3_mid.s deleted file mode 100644 index bccbd96a8..000000000 --- a/asm/wonder_mail_3_mid.s +++ /dev/null @@ -1,137 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_802FBF4 -sub_802FBF4: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r8, r0 - movs r1, 0 - str r1, [sp] -_0802FC08: - ldr r1, [sp] - lsls r0, r1, 16 - asrs r4, r0, 16 - mov r10, r4 - adds r0, r4, 0 - bl sub_80A27CC - lsls r0, 24 - cmp r0, 0 - beq _0802FCCE - cmp r4, 0x13 - beq _0802FCCE - cmp r4, 0x1D - beq _0802FCCE - ldr r7, _0802FC88 - ldr r1, [r7] - mov r0, r8 - lsls r6, r0, 1 - adds r0, r1, r6 - strh r4, [r0] - adds r1, 0x5C - add r1, r8 - movs r0, 0 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x8A - add r0, r8 - movs r1, 0 - strb r1, [r0] - ldr r0, [r7] - adds r0, 0xB8 - ldrb r0, [r0] - cmp r0, 0 - beq _0802FCCA - cmp r4, 0xD - beq _0802FCCA - adds r0, r4, 0 - bl sub_80A270C - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r5, 0 - cmp r4, 0x1E - bgt _0802FCA8 - adds r0, r4, 0 - bl sub_8097384 - lsls r0, 24 - cmp r0, 0 - bne _0802FCA6 - cmp r4, 0x6 - bne _0802FC8C - movs r0, 0x13 - bl sub_8097384 - lsls r0, 24 - cmp r0, 0 - beq _0802FCA8 - ldr r0, [r7] - adds r0, r6 - movs r1, 0x13 - b _0802FCA4 - .align 2, 0 -_0802FC88: .4byte gUnknown_203B314 -_0802FC8C: - mov r0, r10 - cmp r0, 0xA - bne _0802FCA8 - movs r0, 0x1D - bl sub_8097384 - lsls r0, 24 - cmp r0, 0 - beq _0802FCA8 - ldr r0, [r7] - adds r0, r6 - movs r1, 0x1D -_0802FCA4: - strh r1, [r0] -_0802FCA6: - movs r5, 0x1 -_0802FCA8: - ldr r4, _0802FCEC - ldr r0, [r4] - adds r0, 0x5C - add r0, r8 - strb r5, [r0] - cmp r5, 0 - bne _0802FCCA - mov r0, r9 - bl CountJobsinDungeon - cmp r0, 0 - ble _0802FCCA - ldr r0, [r4] - adds r0, 0x8A - add r0, r8 - movs r1, 0x1 - strb r1, [r0] -_0802FCCA: - movs r1, 0x1 - add r8, r1 -_0802FCCE: - ldr r0, [sp] - adds r0, 0x1 - str r0, [sp] - cmp r0, 0x2D - ble _0802FC08 - mov r0, r8 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_0802FCEC: .4byte gUnknown_203B314 - thumb_func_end sub_802FBF4 - - .align 2,0 diff --git a/include/code_80869E4.h b/include/code_80869E4.h index 6a777dac6..43e9bb5f9 100644 --- a/include/code_80869E4.h +++ b/include/code_80869E4.h @@ -38,6 +38,6 @@ void sub_8086854(void); void sub_80868F4(Entity *entity); void sub_8086910(Entity *entity); void sub_808692C(void); -void sub_80869E4(Entity *, s32, u8, s8); +void sub_80869E4(Entity *, s32, u8, s8 direction); #endif // GUARD_CODE_80869E4_H diff --git a/include/dungeon_cutscenes.h b/include/dungeon_cutscenes.h new file mode 100644 index 000000000..1e8c4240a --- /dev/null +++ b/include/dungeon_cutscenes.h @@ -0,0 +1,142 @@ +#ifndef GUARD_DUNGEON_CUTSCENE_H +#define GUARD_DUNGEON_CUTSCENE_H + +#include "structs/dungeon_entity.h" + +void ArticunoPostStoryPreFightDialogue(void); +void ArticunoPreFightDialogue(void); +void ArticunoReFightDialogue(void); +void CelebiJoinDialogue(void); +void DeoxysPreFightDialogue(void); +void DummyFightDialogue(void); +void EnteiPostStoryPreFightDialogue(void); +void EnteiPreFightDialogue(void); +void EnteiReFightDialogue(void); +void GroudonPostStoryPreFightDialogue(void); +void GroudonPreFightDialogue(void); +void GroudonReFightDialogue(void); +void HoOhPreFightDialogue(void); +void HoOhReFightDialogue(void); +void JirachiPreFightDialogue(void); +void JirachiReFightDialogue(void); +void KyogrePreFightDialogue(void); +void LatiosPreFightDialogue(void); +void LatiosReFightDialogue(void); +void LugiaPreFightDialogue(void); +void MagmaCavernMidDialogue(void); +void MedichamRescueDialogue(void); +void MewtwoPreFightDialogue(void); +void MewtwoReFightDialogue(void); +void MoltresPostStoryPreFightDialogue(void); +void MoltresPreFightDialogue(void); +void MoltresReFightDialogue(void); +void RaikouPostStoryPreFightDialogue(void); +void RaikouPreFightDialogue(void); +void RaikouReFightDialogue(void); +void RayquazaPostStoryPreFightDialogue(void); +void RayquazaPreFightDialogue(void); +void RayquazaReFightDialogue(void); +void RegicePreFightDialogue(void); +void RegirockPreFightDialogue(void); +void RegisteelPreFightDialogue(void); +void SkarmoryPreFightDialogue(void); +void SkarmoryReFightDialogue(void); +void SmeargleRescueDialogue(void); +void SuicunePostStoryPreFightDialogue(void); +void SuicunePreFightDialogue(void); +void SuicuneReFightDialogue(void); +void TeamMeaniesPreFightDialogue(void); +void TeamMeaniesReFightDialogue(void); +void ZapdosPostStoryPreFightDialogue(void); +void ZapdosPreFightDialogue(void); +void ZapdosReFightDialogue(void); +void nullsub_100(u8, u8, u8); +void sub_8086B14(void); +void sub_8086B94(void); +void sub_8086BDC(u8, s32); // TODO: should be u8 +void sub_8086E40(void); +void sub_8086E9C(void); +void sub_8086F00(void); +void sub_8086F54(u8, u8); +void sub_8087130(void); +void sub_8087230(void); +void sub_808729C(void); +void sub_8087334(u8, u8); +void sub_80877E8(void); +void sub_8087848(void); +void sub_80878F4(u8, u8); +void sub_8087F54(void); +void sub_8087FB4(void); +void sub_8087FF8(void); +void sub_8088088(u8, u8); +void sub_80885A0(void); +void sub_80885C4(void); +void sub_8088608(void); +void sub_8088618(void); +void sub_808862C(void); +void sub_80886C4(void); +void sub_808875C(void); +void sub_8088818(u8, u8); +void sub_8088DC0(void); +void sub_8088E5C(void); +void sub_8089168(void); +void sub_80892C8(void); +void sub_8089328(void); +void sub_80893B4(u8, u8); +void sub_808970C(void); +void sub_808974C(void); +void sub_8089788(Entity *entity, u8, u8); +void sub_80897F0(void); +void sub_8089878(void); +void sub_80898E4(void); +void sub_8089914(void); +void sub_8089978(void); +void sub_8089A00(u8, u8); +void sub_8089C44(void); +void sub_8089C90(void); +void sub_8089CFC(u8, u8); +void sub_8089EFC(void); +void sub_8089F44(void); +void sub_8089F8C(void); +void sub_8089FF0(u8, u8); +void sub_808A264(void); +void sub_808A2C0(void); +void sub_808A308(void); +void sub_808A36C(u8, u8); +void sub_808A608(void); +void sub_808A668(void); +void sub_808A6E8(u8, u8); +void sub_808A9E4(void); +void sub_808AA3C(void); +void sub_808AA94(void); +void sub_808AAF0(u8, u8); +void sub_808AC3C(void); +void sub_808ACC0(void); +void sub_808AD48(void); +void sub_808ADCC(void); +void sub_808AE54(u8, u8, Position *pos); +void sub_808AEC8(u8, u8, Position *pos); +void sub_808AF3C(u8, u8, Position *pos); +void sub_808AFB0(u8); +void sub_808B030(u8); +void sub_808B0B0(u8); +void sub_808B2F4(void); +void sub_808B35C(void); +void sub_808B3E4(u8, u8, u8); +void sub_808BDEC(void); +void sub_808BE70(u8, u8, u8); +void sub_808C10C(void); +void sub_808C1A4(u8, u8, u8); +void sub_808C3A0(void); +void sub_808C414(u8, u8, u8); +void sub_808C5C0(void); +void sub_808C938(void); +void sub_808C948(Entity *entity, u8); +void sub_808C998(void); +void sub_808C9C4(void); +void sub_808CB5C(void); +void sub_808CBB0(void); +void sub_808CD44(void); +void sub_808CD9C(void); + +#endif /* ifndef GUARD_DUNGEON_CUTSCENE_H */ diff --git a/include/dungeon_util_1.h b/include/dungeon_util_1.h index c9ae2ca3a..3196747eb 100644 --- a/include/dungeon_util_1.h +++ b/include/dungeon_util_1.h @@ -29,5 +29,6 @@ void sub_80859F0(s32 direction); bool8 IsMovingClient(Entity *entity); void sub_8085B0C(Entity *pokemon); void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3); +void sub_80857B8(void); #endif diff --git a/ld_script.txt b/ld_script.txt index f5e9d9dfb..4af6a7ef3 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -166,8 +166,6 @@ SECTIONS { src/wonder_mail_3_mid.o(.text); src/mission_reward.o(.text); src/code_8072F3C.o(.text); - asm/wonder_mail_3_mid.o(.text); - src/wonder_mail_3_1.o(.text); src/makuhita_dojo1.o(.text); src/makuhita_dojo2.o(.text); src/wonder_mail_4.o(.text); @@ -302,9 +300,7 @@ SECTIONS { src/code_8085E98.o(.text); src/code_80861A8.o(.text); src/code_80869E4.o(.text); - src/code_8086A3C.o(.text); - asm/code_8086A3C.o(.text); - src/code_8057824_1.o(.text); + src/dungeon_cutscenes.o(.text); src/pokemon.o(.text); asm/pokemon.o(.text); src/pokemon_mid.o(.text); diff --git a/src/code_8012A18_1.c b/src/code_8012A18_1.c index 99e4919a4..a410a23a2 100644 --- a/src/code_8012A18_1.c +++ b/src/code_8012A18_1.c @@ -1,8 +1,84 @@ #include "global.h" #include "code_8012A18_1.h" +#include "sprite_oam.h" #include "text_util.h" #include "text2.h" +struct unkStruct_203B1FC +{ + // size: 0x198 + u32 unk0; + u8 unk4; + SpriteOAM unk6; + SpriteOAM unkE; + u8 unk16; + u8 unk17; + u8 unk18; + u8 unk1B; + u8 unk1C; + s16 unk1E[1]; + u8 fill20[0x8A - 0x20]; + s16 unk8A[2]; + u8 fill8E[0xF8 - 0x8E]; + u8 *unkF8; + u8 unkFC[54]; +}; + +extern struct unkStruct_203B1FC *gUnknown_203B1FC; + +// https://decomp.me/scratch/6BUMI - Seth +s32 sub_8015F44(void) +{ + +#ifndef NONMATCHING + register s32 index asm("r2"); +#else + s32 index; +#endif + s32 counter; + index = 0; + + if(index < gUnknown_203B1FC->unk1B) + { + if(gUnknown_203B1FC->unkF8[0] == '\0') + return index; + index = 1; + counter = 1; + while (1) { + + if(counter >= gUnknown_203B1FC->unk1B) + return index; + if(gUnknown_203B1FC->unkF8[counter] == '\0') + return index; + index = counter + 1; + counter = index; + } + } + return index; +} + +void sub_8015F84(void) +{ + u32 uVar2; + const struct unkChar *puVar3; + s32 index; + s32 total; + + total = 0; + for(index = 0; index < gUnknown_203B1FC->unk1B; index++) + { + gUnknown_203B1FC->unk1E[index] = total; + if (gUnknown_203B1FC->unkF8[index] == 0) { + gUnknown_203B1FC->unk8A[index] = 8; + return; + } + uVar2 = ReturnIntFromChar2(gUnknown_203B1FC->unkF8[index]); + puVar3 = GetCharacter(uVar2); + gUnknown_203B1FC->unk8A[index] = puVar3->unk6; + total += puVar3->unk6; + } +} + // TODO: Above code is in code_80130A8.s s32 sub_8015FEC(u8 *buffer, s32 size) diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 4e648efad..9af6217c5 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -14,6 +14,7 @@ #include "dungeon_util.h" #include "game_options.h" #include "move_effects_target.h" +#include "moves.h" #include "pokemon.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" @@ -294,3 +295,42 @@ void sub_806A2BC(Entity *pokemon, u8 param_2) void nullsub_95(void) {} + +void sub_806A338(void) +{ + Entity *entity; + s32 index; + + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) + { + entity = gDungeon->allPokemon[index]; + if (EntityExists(entity) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) + { + gDungeon->snatchPokemon = entity; + ASM_MATCH_TRICK(entity); + gDungeon->unk17B3C = GetEntInfo(entity)->unk98; + break; + } + } +} + +void sub_806A390(Entity *pokemon) +{ + s32 index; + EntityInfo *info; + Move *move; + + info = pokemon->info; + for(index = 0; index < MAX_MON_MOVES; index++) + { + move = &info->moves.moves[index]; + + if(move->moveFlags & MOVE_FLAG_EXISTS) + { + move->moveFlags2 &= 0xF7; + move->moveFlags2 &= 0xEF; + move->moveFlags2 |= MOVE_FLAG2_UNK4; + move->PP = GetMoveBasePP(move); + } + } +} diff --git a/src/code_8072F3C.c b/src/code_8072F3C.c index 15b0cf9e7..919548020 100644 --- a/src/code_8072F3C.c +++ b/src/code_8072F3C.c @@ -2,6 +2,8 @@ #include "globaldata.h" #include "constants/input.h" #include "code_80118A4.h" +#include "code_80958E8.h" +#include "code_80A26CC.h" #include "input.h" #include "memory.h" #include "menu_input.h" @@ -61,12 +63,13 @@ ALIGNED(4) const u8 gUnknown_80E0754[] = {0x83, 0xC0}; void sub_802F9C0(void); void sub_802FA50(void); const u8 *sub_80974A0(s16 index); -extern bool8 sub_802FCF0(u32); -extern s32 sub_802FBF4(void); +extern bool8 sub_802FCF0(void); +s32 sub_802FBF4(void); +extern u8 sub_8097384(s16); u32 sub_802F73C(u32 r0, UnkTextStruct2_sub *r1, u32 r2, u8 r3) { - if (sub_802FCF0(r0)) + if (sub_802FCF0()) return 0; if (gUnknown_203B314 == NULL) @@ -223,3 +226,69 @@ void sub_802FA50(void) } sub_80073E0(gUnknown_203B314->sBC.s0.unk34); } + +static inline void sub_802FBF4_sub(u8 *test, s32 counter) +{ + test[counter] = 0; +} + +s32 sub_802FBF4(void) +{ + bool8 bVar1; + u32 dungeonIndex; + s32 iVar6; + s32 counter; + s32 index; + + counter = 0; + for(index = 0; index < 0x2E; index++) + { + iVar6 = iVar6 = (s16)index; // NOTE: LOLOL + if (((sub_80A27CC(index) != 0) && (iVar6 != 0x13)) && (iVar6 != 0x1d)) { + gUnknown_203B314->unk0[counter] = iVar6; + sub_802FBF4_sub(gUnknown_203B314->unk5C, counter); + sub_802FBF4_sub(gUnknown_203B314->unk8A, counter); + if ((gUnknown_203B314->unkB8 != 0) && (iVar6 != 0xd)) { + dungeonIndex = sub_80A270C(index); + bVar1 = FALSE; + if (0x1e >= iVar6) + { + if (sub_8097384(iVar6) == 0) { + if (iVar6 == 6) { + if (sub_8097384(0x13) != 0) { + gUnknown_203B314->unk0[counter] = 0x13; + bVar1 = TRUE; + } + } + else if ((iVar6 == 10) && (sub_8097384(0x1d) != 0)) { + gUnknown_203B314->unk0[counter] = 0x1d; + bVar1 = TRUE; + } + } + else { + bVar1 = TRUE; + } + } + gUnknown_203B314->unk5C[counter] = bVar1; + if ((!bVar1) && (0 < CountJobsinDungeon(dungeonIndex))) { + gUnknown_203B314->unk8A[counter] = 1; + } + } + counter++; + } + } + return counter; +} + +bool8 sub_802FCF0(void) +{ + s32 i; + + for (i = 0; i < 0x2E; i++) { + if (sub_80A27CC(i)) + return FALSE; + } + + return TRUE; +} + diff --git a/src/code_80848F0.c b/src/code_80848F0.c index 86f552111..7499d8597 100644 --- a/src/code_80848F0.c +++ b/src/code_80848F0.c @@ -1,150 +1,12 @@ #include "global.h" #include "constants/weather.h" #include "structs/str_dungeon.h" +#include "dungeon_cutscenes.h" #include "dungeon_music.h" +#include "dungeon_util_1.h" #include "exclusive_pokemon.h" #include "weather.h" -extern void SkarmoryPreFightDialogue(); -extern void SkarmoryReFightDialogue(); -extern void sub_8086E40(); -extern void TeamMeaniesPreFightDialogue(); -extern void TeamMeaniesReFightDialogue(); -extern void sub_8087130(); -extern void ZapdosPreFightDialogue(); -extern void ZapdosReFightDialogue(); -extern void ZapdosPostStoryPreFightDialogue(); -extern void MoltresPreFightDialogue(); -extern void MoltresReFightDialogue(); -extern void MoltresPostStoryPreFightDialogue(); -extern void ArticunoPreFightDialogue(); -extern void ArticunoReFightDialogue(); -extern void ArticunoPostStoryPreFightDialogue(); -extern void sub_8088608(); -extern void sub_8088618(); -extern void GroudonPreFightDialogue(); -extern void GroudonReFightDialogue(); -extern void GroudonPostStoryPreFightDialogue(); -extern void MagmaCavernMidDialogue(); -extern void sub_8089168(); -extern void RayquazaPreFightDialogue(); -extern void RayquazaReFightDialogue(); -extern void RayquazaPostStoryPreFightDialogue(); -extern void sub_80897F0(); -extern void sub_8089878(); -extern void sub_80898E4(); -extern void MewtwoPreFightDialogue(); -extern void MewtwoReFightDialogue(); -extern void EnteiPreFightDialogue(); -extern void EnteiReFightDialogue(); -extern void EnteiPostStoryPreFightDialogue(); -extern void RaikouPreFightDialogue(); -extern void RaikouReFightDialogue(); -extern void RaikouPostStoryPreFightDialogue(); -extern void SuicunePreFightDialogue(); -extern void SuicuneReFightDialogue(); -extern void SuicunePostStoryPreFightDialogue(); -extern void HoOhPreFightDialogue(); -extern void HoOhReFightDialogue(); -extern void LatiosPreFightDialogue(); -extern void LatiosReFightDialogue(); -extern void sub_808AC3C(); -extern void RegirockPreFightDialogue(); -extern void RegicePreFightDialogue(); -extern void RegisteelPreFightDialogue(); -extern void JirachiPreFightDialogue(); -extern void JirachiReFightDialogue(); -extern void LugiaPreFightDialogue(); -extern void KyogrePreFightDialogue(); -extern void DeoxysPreFightDialogue(); -extern void CelebiJoinDialogue(); -extern void sub_808C998(); -extern void MedichamRescueDialogue(); -extern void DummyFightDialogue(); -extern void SmeargleRescueDialogue(); -extern void sub_808CD9C(); -extern void sub_8085764(); -extern void sub_80857B8(); - -extern void sub_8086BDC(u32,u8); -extern void sub_8086F54(u32,u8); -extern void sub_8087334(u32,u8); -extern void sub_80878F4(u32,u8); -extern void sub_8088088(u32,u8); -extern void sub_8088818(u32,u8); -extern void sub_80893B4(u32,u8); -extern void sub_8089788(Entity *,u32,u8); -extern void sub_8089A00(u32,u8); -extern void sub_8089CFC(u32,u8); -extern void sub_8089FF0(u32,u8); -extern void sub_808A36C(u32,u8); -extern void sub_808A6E8(u32,u8); -extern void sub_808AAF0(u32,u8); -extern void sub_808AE54(u32,u8,s16 *); -extern void sub_808AEC8(u32,u8,s16 *); -extern void sub_808AF3C(u32,u8,s16 *); -extern void sub_808B3E4(u32,u8,u8); -extern void sub_808BE70(u32,u8,u8); -extern void sub_808C1A4(u32,u8,u8); -extern void sub_808C414(u32,u8,u8); -extern void nullsub_100(u32,u8,u8); -extern void sub_808C948(Entity *,u8); - -extern void sub_808AFB0(u8); -extern void sub_808B030(u8); -extern void sub_808B0B0(u8); - -extern void sub_8086B14(void); -extern void sub_8086B94(void); -extern void sub_8086E9C(void); -extern void sub_8086F00(void); -extern void sub_8087230(void); -extern void sub_808729C(void); -extern void sub_80877E8(void); -extern void sub_8087848(void); -extern void sub_8087F54(void); -extern void sub_8087FB4(void); -extern void sub_8087FF8(void); -extern void sub_80885A0(void); -extern void sub_80885C4(void); -extern void sub_808862C(void); -extern void sub_80886C4(void); -extern void sub_808875C(void); -extern void sub_8088DC0(void); -extern void sub_8088E5C(void); -extern void sub_80892C8(void); -extern void sub_8089328(void); -extern void sub_808970C(void); -extern void sub_808974C(void); -extern void sub_8089914(void); -extern void sub_8089978(void); -extern void sub_8089C44(void); -extern void sub_8089C90(void); -extern void sub_8089EFC(void); -extern void sub_8089F44(void); -extern void sub_8089F8C(void); -extern void sub_808A264(void); -extern void sub_808A2C0(void); -extern void sub_808A308(void); -extern void sub_808A608(void); -extern void sub_808A668(void); -extern void sub_808A9E4(void); -extern void sub_808AA3C(void); -extern void sub_808AA94(void); -extern void sub_808ACC0(void); -extern void sub_808AD48(void); -extern void sub_808ADCC(void); -extern void sub_808B2F4(void); -extern void sub_808B35C(void); -extern void sub_808BDEC(void); -extern void sub_808C10C(void); -extern void sub_808C3A0(void); -extern void sub_808C5C0(void); -extern void sub_808C938(void); -extern void sub_808C9C4(void); -extern void sub_808CB5C(void); -extern void sub_808CBB0(void); -extern void sub_808CD44(void); extern void sub_8040A84(void); struct unkData_8107234 @@ -156,7 +18,6 @@ extern struct unkData_8107234 gUnknown_8107234[]; void sub_8084854(struct unkData_8107234 *); - void sub_80847D4(void) { u32 bossBattleIndex; @@ -647,13 +508,13 @@ void sub_8084E00(Entity *entity, u8 param_2, u8 param_3) sub_808AAF0(param_2,gDungeon->unk3A0D); break; case 0x2e: - sub_808AE54(param_2,gDungeon->unk3A0D,&entity->pos.x); + sub_808AE54(param_2,gDungeon->unk3A0D,&entity->pos); break; case 0x2f: - sub_808AEC8(param_2,gDungeon->unk3A0D,&entity->pos.x); + sub_808AEC8(param_2,gDungeon->unk3A0D,&entity->pos); break; case 0x30: - sub_808AF3C(param_2,gDungeon->unk3A0D,&entity->pos.x); + sub_808AF3C(param_2,gDungeon->unk3A0D,&entity->pos); break; case 0x31: case 0x32: diff --git a/src/code_8086A3C.c b/src/code_8086A3C.c deleted file mode 100644 index b08a0127a..000000000 --- a/src/code_8086A3C.c +++ /dev/null @@ -1,474 +0,0 @@ -#include "global.h" -#include "code_8086A3C.h" - -#include "code_803E46C.h" -#include "code_803E668.h" -#include "code_806CD90.h" -#include "code_80869E4.h" -#include "constants/bg_music.h" -#include "constants/direction.h" -#include "constants/monster.h" -#include "dungeon_music.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_util_1.h" -#include "dungeon_util.h" -#include "exclusive_pokemon.h" -#include "pokemon_3.h" -#include "pokemon.h" -#include "structs/dungeon_entity.h" -#include "structs/str_dungeon.h" - -extern u8 sub_8044B28(void); -extern u8 gUnknown_202E038[]; -extern void sub_8085374(); -extern void sub_8068FE0(Entity *, u32, u32); -extern void sub_8086448(void); -extern void SkarmoryEntry(Entity *); -extern void sub_8086A54(Entity *); -extern void sub_8087144(); -extern void sub_8072008(Entity *pokemon, Entity *r1, u32 r2, u8 r3, u32); -extern bool8 sub_8085B80(struct_8085B80 *); - -extern const u8 gUnknown_810739C[]; -extern const u8 gUnknown_81073D4[]; -extern const u8 gUnknown_810740C[]; -extern const s16 gUnknown_80F57CC; -extern const struct DungeonDialogueStruct gUnknown_8101440; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_6; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_7; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_8; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_9; -extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_1; -extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_2; -extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_3; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_1; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_2; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_3; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_4; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_5; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_6; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_7; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_1; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_2; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_3; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_4; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_5; - -extern const struct DungeonDialogueStruct gUnknown_8100D3C; - -void sub_8086A3C(Entity *pokemon) -{ - pokemon->info->unk15C = 1; - pokemon->info->unk15E = 1; -} - -void sub_8086A54(Entity *pokemon) -{ - pokemon->info->unk15C = 1; - pokemon->info->unk15E = 0; -} - -void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex) -{ - EntityInfo *entityInfo = GetEntInfo(pokemon); - - entityInfo->bossFlag = TRUE; - - // BUG: Source of the Reviver Seed Boss Glitch - // - // Video to demonstration: - // https://www.youtube.com/watch?v=rHu7EehrZ68 - entityInfo->originalHP = entityInfo->maxHPStat; - if (newHP != 0) { - entityInfo->maxHPStat = newHP; - entityInfo->HP = newHP; - } - - gDungeon->bossSongIndex = songIndex; - SetDefaultIQSkills(entityInfo->IQSkillMenuFlags, entityInfo->bossFlag); - LoadIQSkills(pokemon); -} - -void sub_8086AC0(void) -{ - if(!sub_8044B28()) - if(gDungeon->unk2 == 0) - sub_8097FF8(); -} - -u8 sub_8086AE4(s16 _index) -{ - s32 pokeIndex = _index; - - if(gDungeon->unk65C == 0) - return 1; - else - return HasRecruitedMon(pokeIndex); -} - -void sub_8086B14(void) -{ - Entity * LeaderEntity; - Entity * DiglettEntity; - Entity * SkarmoryEntity; - - LeaderEntity = xxx_call_GetLeader(); - DiglettEntity = GetEntityFromClientType(4); - SkarmoryEntity = GetEntityFromClientType(3); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_8085374(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - sub_8086A3C(SkarmoryEntity); - DiglettEntity->info->unk15C = 1; - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 2); - CopyMonsterNametoBuffer(gUnknown_202E038,MONSTER_DIGLETT); - CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_SKARMORY); -} - -void sub_8086B94(void) -{ - Entity * LeaderEntity; - Entity * DiglettEntity; - Entity * SkarmoryEntity; - - LeaderEntity = xxx_call_GetLeader(); - DiglettEntity = GetEntityFromClientType(4); - SkarmoryEntity = GetEntityFromClientType(3); - - sub_8068FE0(SkarmoryEntity,0x21c,0); - sub_8068FE0(DiglettEntity,0x21c,0); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); -} - -void sub_8086BDC(char param_1, s32 param_2) -{ - if ((((param_2 * 0x1000000) - 0x1000000U) >> 0x18 < 2) && (param_1 == 3)) { - sub_8097FA8(1); - gDungeon->unk2 = 1; - } -} - -void SkarmoryPreFightDialogue(void) -{ - Entity *LeaderEntity; - Entity *PartnerEntity; - Entity * DiglettEntity; - Entity * SkarmoryEntity; - - Position32 pos1; - Position32 pos2; - - LeaderEntity = xxx_call_GetLeader(); // Player - PartnerEntity = GetPartnerEntity(); // Partner - DiglettEntity = GetEntityFromClientType(4); // Diglett - SkarmoryEntity = GetEntityFromClientType(3); // Skarmory - - pos1.x = DiglettEntity->pixelPos.x; - pos1.y = DiglettEntity->pixelPos.y + 0x3000; - - pos2.x = SkarmoryEntity->pixelPos.x; - pos2.y = SkarmoryEntity->pixelPos.y + 0x2000; - - sub_8086448(); - sub_803E708(10,0x46); - SpriteShockEffect(PartnerEntity); - sub_803E708(0x20,0x46); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_1); - ShiftCameraToPosition(&pos1,0x40); - sub_803E708(0x40,0x46); - ShiftCameraToPosition(&pos2,0x30); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_2); - sub_803E708(10,0x46); - DiglettEntity->info->unk15D = 1; - ShiftCameraToPosition(&pos1,0x30); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_3); // Diglett: ...I...\nI'm scared. - sub_803E708(10,0x46); - ShiftCameraToPosition(&pos2,0x20); - sub_803E708(0x20,0x46); - SkarmoryEntry(SkarmoryEntity); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_4); // Skarmory: You!\nWhat do you think you're doing here?! - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_5); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_6); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_7); - sub_803E708(10,0x46); - sub_806CDD4(SkarmoryEntity,0xd,0); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_8); - sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,2); - sub_80869E4(LeaderEntity,4,2,6); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_9); - sub_80869E4(PartnerEntity,4,2,4); - sub_80869E4(LeaderEntity,4,1,4); - sub_803E708(10,0x46); - DungeonStartNewBGM(MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); -} - -void SkarmoryReFightDialogue(void) -{ - Entity * LeaderEntity; - Entity * SkarmoryEntity; - Position32 pos; - - LeaderEntity = xxx_call_GetLeader(); - SkarmoryEntity = GetEntityFromClientType(3); - pos.x = SkarmoryEntity->pixelPos.x; - pos.y = SkarmoryEntity->pixelPos.y + 0x2000; - sub_8086448(); - sub_803E708(10,0x46); - SkarmoryEntry(SkarmoryEntity); - ShiftCameraToPosition(&pos,0x10); - DisplayDungeonDialogue(&gSkarmoryReFightDialogue_1); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gSkarmoryReFightDialogue_2); - sub_803E708(10,0x46); - sub_806CDD4(SkarmoryEntity,0xd,0); - DisplayDungeonDialogue(&gSkarmoryReFightDialogue_3); - sub_803E708(10,0x46); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); - DungeonStartNewBGM(MUS_BOSS_BATTLE); -} - -void sub_8086E40(void) -{ - SpriteLookAroundEffect(xxx_call_GetLeader()); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gUnknown_8100D3C); - sub_803E708(10,0x46); - gDungeon->unk2 = 1; -} - -void SkarmoryEntry(Entity * skarmoryEntity) -{ - sub_806CDD4(skarmoryEntity,0xf,0); - sub_8086A54(skarmoryEntity); - PlaySoundEffect(0x1f8); - sub_803E708(0x44,0x46); -} - -void sub_8086E9C(void) -{ - Entity * LeaderEntity; - - LeaderEntity = xxx_call_GetLeader(); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_8085374(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - sub_808563C(sub_8086A3C); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_METAPOD); - CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_GENGAR); - CopyMonsterNametoBuffer(gUnknown_202E038 + 0xA0, MONSTER_CATERPIE); -} - -void sub_8086F00(void) -{ - Entity * LeaderEntity; - - LeaderEntity = xxx_call_GetLeader(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_METAPOD); - CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_GENGAR); - CopyMonsterNametoBuffer(gUnknown_202E038 + 0xA0, MONSTER_CATERPIE); -} - -// From @jiangzhengwenjz: -// Matches this way for -O2 but can match w/o this hack on -O1 -// https://decomp.me/scratch/BTqWo -void sub_8086F54(u8 param_1, u8 param_2) -{ - Entity *entity; - s32 index; - u32 unk1 = 0; - - - if (param_2 == 4 || param_2 == 5) { - void *labels[2]; - labels[0] = labels[1] = &&label; - - for(index = 0; index < 0x10; index++) - { - entity = gDungeon->wildPokemon[index]; - if ((EntityExists(entity)) && (entity->info->clientType != param_1)) { - return; - } - } - if(!unk1) - { - sub_8097FA8(3); - label: - gDungeon->unk2 = 1; - } - } -} - -void TeamMeaniesPreFightDialogue(void) -{ - Entity *LeaderEntity; - - LeaderEntity = xxx_call_GetLeader(); - sub_8086448(); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_1); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); - sub_803E708(10, 0x46); - sub_8087144(); - DungeonStartNewBGM(MUS_THERES_TROUBLE); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_3); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_4); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_5); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_6); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_7); - sub_803E708(10, 0x46); - ShiftCameraToPosition(&LeaderEntity->pixelPos, 0x10); -} - -void TeamMeaniesReFightDialogue(void) -{ - Entity *LeaderEntity; - Entity *PartnerEntity; - - LeaderEntity = xxx_call_GetLeader(); - PartnerEntity = GetPartnerEntity(); - sub_8086448(); - DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_1); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); - sub_803E708(10, 0x46); - sub_8087144(); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_2); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_3); - sub_803E708(10, 0x46); - sub_806CDD4(LeaderEntity, 6, 4); - sub_806CDD4(PartnerEntity, 6, 4); - sub_803E708(10, 0x46); - sub_806CDD4(LeaderEntity, 7, 4); - sub_806CDD4(PartnerEntity, 7, 4); - sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_4); - DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_5); - sub_803E708(10, 0x46); - ShiftCameraToPosition(&LeaderEntity->pixelPos, 0x10); -} - -void sub_8087130(void) -{ - sub_8086448(); - sub_80866C4(&gUnknown_8101440); -} - -void sub_8087144(void) -{ - Entity *iVar2; - Entity *iVar3; - Entity *iVar4; - s16 auStack_10c[28]; - s16 puStack_60[28]; - s16 puStack_5c[28]; - s16 *puStack_64[3]; - Entity *pEStack_58[3]; - struct_8085B80 auStack_4c[3]; - - iVar2 = GetEntityFromClientType(5); - iVar3 = GetEntityFromClientType(6); - iVar4 = GetEntityFromClientType(7); - memcpy(auStack_10c,gUnknown_810739C, 0x38); - memcpy(puStack_60, gUnknown_81073D4, 0x38); - memcpy(puStack_5c, gUnknown_810740C, 0x38); - puStack_64[0] = auStack_10c; - puStack_64[1] = puStack_60; - puStack_64[2] = puStack_5c; - pEStack_58[0] = iVar2; - pEStack_58[1] = iVar3; - pEStack_58[2] = iVar4; - DungeonStartNewBGM(MUS_THERES_TROUBLE); - sub_8086A54(iVar2); - sub_8086A54(iVar3); - sub_8086A54(iVar4); - sub_8085B4C(auStack_4c,puStack_64,pEStack_58,3); - iVar2->info->unk15F = 1; - iVar3->info->unk15F = 1; - iVar4->info->unk15F = 1; - while( TRUE ) { - if (!sub_8085B80(auStack_4c)) break; - sub_803E46C(0x46); - } - iVar2->info->unk15F = 0; - iVar3->info->unk15F = 0; - iVar4->info->unk15F = 0; -} - -void sub_8087230(void) -{ - Entity *LeaderEntity; - Entity *ZapdosEntity; - - LeaderEntity = xxx_call_GetLeader(); - ZapdosEntity = GetEntityFromClientType(0x8); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_8085374(); - sub_80854D4(); - sub_8085930(4); - sub_80855E4(sub_8086A3C); - SetFacingDirection(ZapdosEntity, 0); - sub_8086A3C(ZapdosEntity); - sub_8085860(LeaderEntity->pos.x, LeaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SHIFTRY); - CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ZAPDOS); -} - -void sub_808729C(void) -{ - Entity *LeaderEntity; - Entity *ZapdosEntity; - - LeaderEntity = xxx_call_GetLeader(); - ZapdosEntity = GetEntityFromClientType(8); - sub_80854D4(); - sub_8085930(4); - sub_80855E4(sub_8086A3C); - if (sub_8086AE4(0x91) != 0) { - sub_8068FE0(ZapdosEntity,0x21c,0); - } - else { - sub_8072008(ZapdosEntity,ZapdosEntity,gUnknown_80F57CC,0,0); - SetFacingDirection(ZapdosEntity,0); - sub_8086A3C(ZapdosEntity); - } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SHIFTRY); - CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ZAPDOS); -} - -void sub_8087334(u8 param_1, u8 param_2) -{ - if ((param_2 == 7 || param_2 == 8 || param_2 == 9) && (param_1 == 8)) { - sub_8097FA8(5); - gDungeon->unk2 = 1; - } -} diff --git a/src/code_8095824.c b/src/code_8095824.c deleted file mode 100644 index f5e7b6272..000000000 --- a/src/code_8095824.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "global.h" -#include "dungeon.h" -#include "memory.h" -#include "pokemon.h" -#include "random.h" -#include "save.h" -#include "text_util.h" -#include "code_8094F88.h" diff --git a/src/code_8057824_1.c b/src/dungeon_cutscenes.c similarity index 69% rename from src/code_8057824_1.c rename to src/dungeon_cutscenes.c index dafdbcd21..4fa360585 100644 --- a/src/code_8057824_1.c +++ b/src/dungeon_cutscenes.c @@ -1,4 +1,5 @@ #include "global.h" +#include "code_800DAC0.h" #include "code_800E9A8.h" #include "code_803E46C.h" #include "code_803E668.h" @@ -16,6 +17,7 @@ #include "dungeon_map_access.h" #include "dungeon_message.h" #include "dungeon_music.h" +#include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" #include "dungeon_util_1.h" #include "dungeon_util.h" @@ -34,67 +36,15 @@ extern u8 gAvailablePokemonNames[0x58]; extern u8 gFormatItems[]; extern const s16 gUnknown_80F57CA; -extern const s16 gUnknown_80F57D2; -extern const s16 gUnknown_80F57D0; +extern const s16 gUnknown_80F57CC; extern const s16 gUnknown_80F57CE; - -extern const struct DungeonDialogueStruct gUnknown_8103D8C; -extern const struct DungeonDialogueStruct gUnknown_8103D98; -extern const struct DungeonDialogueStruct gUnknown_8103DD8; -extern const struct DungeonDialogueStruct gUnknown_8103E28; -extern const struct DungeonDialogueStruct gUnknown_8103BD8; -extern const struct DungeonDialogueStruct gUnknown_8103C00; -extern const struct DungeonDialogueStruct gUnknown_8103C3C; -extern const struct DungeonDialogueStruct gUnknown_8103C74; -extern const struct DungeonDialogueStruct gUnknown_8103CC4; -extern const struct DungeonDialogueStruct gUnknown_8103D0C; -extern const struct DungeonDialogueStruct gUnknown_8103D50; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_6; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_1; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_2; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_3; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_4; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_5; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_6; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_8; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_9; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_10; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_11; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_5; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_6; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_7; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_8; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_9; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_10; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_11; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_12; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_13; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_14; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_15; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_4; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_3; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_2; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_1; -extern const struct DungeonDialogueStruct gUnknown_8103488; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_1; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_2; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_3; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_4; +extern const s16 gUnknown_80F57D0; +extern const s16 gUnknown_80F57D2; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_10; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_11; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_12; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_13; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_14; extern const struct DungeonDialogueStruct GroudonPreFightDialogue_1; extern const struct DungeonDialogueStruct GroudonPreFightDialogue_2; extern const struct DungeonDialogueStruct GroudonPreFightDialogue_3; @@ -104,101 +54,34 @@ extern const struct DungeonDialogueStruct GroudonPreFightDialogue_6; extern const struct DungeonDialogueStruct GroudonPreFightDialogue_7; extern const struct DungeonDialogueStruct GroudonPreFightDialogue_8; extern const struct DungeonDialogueStruct GroudonPreFightDialogue_9; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_10; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_11; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_12; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_13; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_14; -extern const struct DungeonDialogueStruct gUnknown_8102B10; -extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_2; -extern const struct DungeonDialogueStruct gRegicePostFightDialogue_2; -extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_2; -extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_1; -extern const struct DungeonDialogueStruct gRegicePostFightDialogue_1; -extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_1; -extern const struct DungeonDialogueStruct gUnknown_810554C; -extern const struct DungeonDialogueStruct gUnknown_8105558; -extern const struct DungeonDialogueStruct gUnknown_81055F4; -extern const struct DungeonDialogueStruct gRegicePreFightDialogue_1; -extern const struct DungeonDialogueStruct gRegirockPreFightDialogue_1; -extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_1; -extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_2; -extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_3; -extern const struct DungeonDialogueStruct gRegisteelPreFightDialogue_1; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_1; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_2; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_3; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_4; -extern const struct DungeonDialogueStruct gLatiosReFightDialogue_1; -extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_2; -extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_3; -extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_1; extern const struct DungeonDialogueStruct HoOhReFightDialogue_1; extern const struct DungeonDialogueStruct HoOhReFightDialogue_2; extern const struct DungeonDialogueStruct HoOhReFightDialogue_3; extern const struct DungeonDialogueStruct HoOhReFightDialogue_4; extern const struct DungeonDialogueStruct HoOhReFightDialogue_5; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_1; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_2; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_3; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_4; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_5; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_6; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_1; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_2; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_3; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_4; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_5; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_6; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_7; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRaikouReFightDialogue_1; -extern const struct DungeonDialogueStruct gRaikouReFightDialogue_2; -extern const struct DungeonDialogueStruct gRaikouReFightDialogue_3; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_5; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_6; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gEnteiReFightDialogue_1; -extern const struct DungeonDialogueStruct gEnteiReFightDialogue_2; -extern const struct DungeonDialogueStruct gEnteiReFightDialogue_3; -extern const struct DungeonDialogueStruct gUnknown_8104FC8; -extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_1; -extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_2; -extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_3; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_5; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_4; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_3; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_2; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_1; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_5; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_1; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_2; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_3; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_4; -extern const struct DungeonDialogueStruct gUnknown_8103E34; -extern const struct DungeonDialogueStruct gUnknown_8102A9C; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_10; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_11; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_12; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_13; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_14; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_15; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_1; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_2; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_3; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_4; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_5; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_6; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_7; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_8; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_9; extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_1; extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_2; extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_3; extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_4; extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gArticunoReFightDialogue_1; -extern const struct DungeonDialogueStruct gArticunoReFightDialogue_2; -extern const struct DungeonDialogueStruct gArticunoReFightDialogue_3; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_10; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_11; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_12; extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_1; extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_2; extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_3; @@ -208,80 +91,9 @@ extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_6; extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_7; extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_8; extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_9; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_10; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_11; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_12; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gUnknown_8100D3C; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_1; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_2; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_3; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_4; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_5; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_1; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_2; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_3; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_4; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_5; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_6; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_7; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_8; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_9; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_10; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_11; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_12; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_6; -extern const struct DungeonDialogueStruct gUnknown_8105668; -extern const struct DungeonDialogueStruct gUnknown_8105674; -extern const struct DungeonDialogueStruct gUnknown_81056B8; -extern const struct DungeonDialogueStruct gUnknown_81056DC; -extern const struct MenuItem gUnknown_810579C[]; -extern const struct DungeonDialogueStruct gUnknown_8105974; -extern const struct DungeonDialogueStruct gUnknown_810581C; - -extern const struct DungeonDialogueStruct gUnknown_8105BF4; -extern const struct DungeonDialogueStruct gUnknown_8105D2C; -extern const struct DungeonDialogueStruct gUnknown_8105D80; -extern const struct DungeonDialogueStruct gUnknown_8105D9C; -extern const struct DungeonDialogueStruct gUnknown_81058E0; -extern const struct DungeonDialogueStruct gUnknown_810593C; -extern const struct DungeonDialogueStruct gUnknown_8105A08; -extern const struct DungeonDialogueStruct gUnknown_8105AD4; -extern const struct DungeonDialogueStruct gUnknown_8105B20; -extern const struct DungeonDialogueStruct gUnknown_8105B68; -extern const struct DungeonDialogueStruct gUnknown_8105BA8; -extern const u8 *const gUnknown_8105798; -extern const struct DungeonDialogueStruct gJirachiReFightDialogue_1; - -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_8; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_1; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_2; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_3; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_4; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_5; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_6; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_7; -extern const struct DungeonDialogueStruct gUnknown_810697C; -extern const u64 gUnknown_8107544[]; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_1; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_2; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_3; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_4; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_1; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_2; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_3; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_4; -extern const struct DungeonDialogueStruct gUnknown_8106720; - +extern const struct DungeonDialogueStruct gArticunoReFightDialogue_1; +extern const struct DungeonDialogueStruct gArticunoReFightDialogue_2; +extern const struct DungeonDialogueStruct gArticunoReFightDialogue_3; extern const struct DungeonDialogueStruct gCelebiJoinDialogue_10; extern const struct DungeonDialogueStruct gCelebiJoinDialogue_1; extern const struct DungeonDialogueStruct gCelebiJoinDialogue_2; @@ -292,16 +104,52 @@ extern const struct DungeonDialogueStruct gCelebiJoinDialogue_6; extern const struct DungeonDialogueStruct gCelebiJoinDialogue_7; extern const struct DungeonDialogueStruct gCelebiJoinDialogue_8; extern const struct DungeonDialogueStruct gCelebiJoinDialogue_9; -extern const u8 *const gPtrPurityForestAllowCelebiToJoinText; -extern const struct MenuItem gPurityForestAllowCelebiToJoinPrompt[]; -extern const u8 *const gPtrPurityForestRefuseCelebiConfirmText; -extern const struct MenuItem gPurityForestRefuseCelebiConfirmPrompt[]; extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_1; extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_2; extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_3; extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_4; extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_5; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_8; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_1; +extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_2; +extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_3; +extern const struct DungeonDialogueStruct gEnteiReFightDialogue_1; +extern const struct DungeonDialogueStruct gEnteiReFightDialogue_2; +extern const struct DungeonDialogueStruct gEnteiReFightDialogue_3; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_1; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_2; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_3; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_4; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_1; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_2; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_3; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_4; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_5; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_6; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_1; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_2; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_3; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_4; +extern const struct DungeonDialogueStruct gJirachiReFightDialogue_1; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_1; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_2; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_3; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_4; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_5; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_6; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_7; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_8; +extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_1; +extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_2; +extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_3; +extern const struct DungeonDialogueStruct gLatiosReFightDialogue_1; extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_1; extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_2; extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_3; @@ -309,35 +157,254 @@ extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_4; extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_5; extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_6; extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_7; -extern const struct DungeonDialogueStruct gZapdosReFightDialogue_1; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_8; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_1; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_2; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_3; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_4; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_1; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_2; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_3; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_4; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_5; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_1; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_2; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_3; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_4; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_5; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_10; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_11; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_12; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_1; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_2; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_3; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_4; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_5; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_6; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_7; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_8; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_9; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_1; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_2; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_3; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_4; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_5; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_3; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_5; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_6; +extern const struct DungeonDialogueStruct gRaikouReFightDialogue_1; +extern const struct DungeonDialogueStruct gRaikouReFightDialogue_2; +extern const struct DungeonDialogueStruct gRaikouReFightDialogue_3; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_6; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_10; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_11; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_3; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_5; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_6; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_8; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_9; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_1; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_2; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_3; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_4; +extern const struct DungeonDialogueStruct gRegicePostFightDialogue_1; +extern const struct DungeonDialogueStruct gRegicePostFightDialogue_2; +extern const struct DungeonDialogueStruct gRegicePreFightDialogue_1; +extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_1; +extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_2; +extern const struct DungeonDialogueStruct gRegirockPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_1; +extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_2; +extern const struct DungeonDialogueStruct gRegisteelPreFightDialogue_1; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_6; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_7; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_8; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_9; +extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_1; +extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_2; +extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_3; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_1; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_2; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_3; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_4; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_1; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_2; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_3; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_4; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_5; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_6; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_7; +extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_1; +extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_2; +extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_3; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_1; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_2; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_3; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_4; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_5; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_6; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_7; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_1; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_2; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_3; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_4; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_5; +extern const struct DungeonDialogueStruct gUnknown_8100D3C; +extern const struct DungeonDialogueStruct gUnknown_8100D3C; +extern const struct DungeonDialogueStruct gUnknown_8101440; +extern const struct DungeonDialogueStruct gUnknown_81014B0; +extern const struct DungeonDialogueStruct gUnknown_8101504; extern const struct DungeonDialogueStruct gUnknown_81015A0; +extern const struct DungeonDialogueStruct gUnknown_81015D4; +extern const struct DungeonDialogueStruct gUnknown_81015E8; +extern const struct DungeonDialogueStruct gUnknown_8101624; +extern const struct DungeonDialogueStruct gUnknown_810165C; +extern const struct DungeonDialogueStruct gUnknown_8101750; +extern const struct DungeonDialogueStruct gUnknown_810178C; +extern const struct DungeonDialogueStruct gUnknown_81017B4; +extern const struct DungeonDialogueStruct gUnknown_8102A9C; +extern const struct DungeonDialogueStruct gUnknown_8102B10; +extern const struct DungeonDialogueStruct gUnknown_8103488; +extern const struct DungeonDialogueStruct gUnknown_8103BD8; +extern const struct DungeonDialogueStruct gUnknown_8103C00; +extern const struct DungeonDialogueStruct gUnknown_8103C3C; +extern const struct DungeonDialogueStruct gUnknown_8103C74; +extern const struct DungeonDialogueStruct gUnknown_8103CC4; +extern const struct DungeonDialogueStruct gUnknown_8103D0C; +extern const struct DungeonDialogueStruct gUnknown_8103D50; +extern const struct DungeonDialogueStruct gUnknown_8103D8C; +extern const struct DungeonDialogueStruct gUnknown_8103D98; +extern const struct DungeonDialogueStruct gUnknown_8103DD8; +extern const struct DungeonDialogueStruct gUnknown_8103E28; +extern const struct DungeonDialogueStruct gUnknown_8103E34; +extern const struct DungeonDialogueStruct gUnknown_8104FC8; +extern const struct DungeonDialogueStruct gUnknown_810554C; +extern const struct DungeonDialogueStruct gUnknown_8105558; +extern const struct DungeonDialogueStruct gUnknown_81055F4; +extern const struct DungeonDialogueStruct gUnknown_8105668; +extern const struct DungeonDialogueStruct gUnknown_8105674; +extern const struct DungeonDialogueStruct gUnknown_81056B8; +extern const struct DungeonDialogueStruct gUnknown_81056DC; +extern const struct DungeonDialogueStruct gUnknown_810581C; +extern const struct DungeonDialogueStruct gUnknown_81058A8; +extern const struct DungeonDialogueStruct gUnknown_81058C4; +extern const struct DungeonDialogueStruct gUnknown_81058E0; +extern const struct DungeonDialogueStruct gUnknown_810593C; +extern const struct DungeonDialogueStruct gUnknown_8105974; +extern const struct DungeonDialogueStruct gUnknown_8105A08; +extern const struct DungeonDialogueStruct gUnknown_8105AD4; +extern const struct DungeonDialogueStruct gUnknown_8105B20; +extern const struct DungeonDialogueStruct gUnknown_8105B68; +extern const struct DungeonDialogueStruct gUnknown_8105BA8; +extern const struct DungeonDialogueStruct gUnknown_8105BF4; +extern const struct DungeonDialogueStruct gUnknown_8105D2C; +extern const struct DungeonDialogueStruct gUnknown_8105D80; +extern const struct DungeonDialogueStruct gUnknown_8105D9C; +extern const struct DungeonDialogueStruct gUnknown_8106720; +extern const struct DungeonDialogueStruct gUnknown_810697C; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_6; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_1; extern const struct DungeonDialogueStruct gZapdosReFightDialogue_2; extern const struct DungeonDialogueStruct gZapdosReFightDialogue_3; extern const struct DungeonDialogueStruct gZapdosReFightDialogue_4; - -extern const struct DungeonDialogueStruct gUnknown_81058C4; -extern const struct DungeonDialogueStruct gUnknown_81058A8; - +extern const struct MenuItem gPurityForestAllowCelebiToJoinPrompt[]; +extern const struct MenuItem gPurityForestRefuseCelebiConfirmPrompt[]; +extern const struct MenuItem gUnknown_810579C[]; +extern const u64 gUnknown_8107544[]; +extern const u8 *const gPtrPurityForestAllowCelebiToJoinText; +extern const u8 *const gPtrPurityForestRefuseCelebiConfirmText; +extern const u8 *const gUnknown_8105798; +extern const u8 gUnknown_810739C[]; +extern const u8 gUnknown_81073D4[]; +extern const u8 gUnknown_810740C[]; extern const u8 gUnknown_81074FC[]; -extern void sub_800DC14(u32); +struct Zapdos1 +{ + s16 unk0[12]; +}; + +struct Zapdos2 +{ + s16 unk0[16]; +}; + +extern const struct Zapdos1 gUnknown_810744C; +extern struct Zapdos2 gUnknown_8107464; -extern void sub_8086A3C(Entity *r0); extern void sub_8068FE0(Entity *, u32, u32); - -extern void sub_8086448(void); extern void sub_8042B0C(Entity *); extern u8 sub_806FD18(Entity *); extern void sub_806FDF4(Entity *, Entity *, Entity **); -extern u32 sub_80861F8(u32, Entity *, u32); -extern s32 GetCameraXPos(); -extern s32 GetCameraYPos(); +extern s32 GetCameraXPos(void); +extern s32 GetCameraYPos(void); extern void sub_803F878(u32, s32); -extern void SetupBossFightHP(Entity *, u32, u32); extern void BgColorCallNullsub4(void); extern void DeoxysScreenFlash(void); -extern void sub_8085EB0(); +extern void sub_8085EB0(void); +extern void sub_8049884(void); +extern void sub_8049B8C(void); +extern void sub_8049ED4(void); +extern void sub_8040A84(void); +extern void sub_8086A54(Entity *); +extern void sub_806BFC0(EntityInfo *, u32); +extern void sub_808BBA8(Entity * ); +extern void sub_8041888(u32); +extern u32 sub_80861F8(u32, Entity *, u32); +extern u8 sub_80860A8(u32); +extern void sub_8052D44(s16 *, Entity *, Entity *); +extern void sub_80421C0(Entity *, u32); +extern void sub_80464C8(Entity *, Position *, Item *); +extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32); +extern u32 sub_8085EC8(u32, u32, u32, Position *, u32); +extern void sub_807EAA0(u32, u32); +extern void sub_8072008(Entity *, Entity *, s16, u32, u32); +extern void sub_8085374(void); +extern void sub_8045C28(Item *, u8 , u8 *); +extern void sub_8046860(Entity *, Position *, Item *, u32); +extern u32 sub_803D73C(u32); +extern void sub_80460F8(Position *, Item *, u8); +extern u8 sub_8044B28(void); +extern bool8 sub_8085B80(struct_8085B80 *); +void ZapdosScreenFlash(s32 numFlashes); +void ZapdosDropInEffect(Entity *); void SetupDeoxysFightHP(Entity *r0); void sub_808C550(void); void sub_808C590(Entity *r0); @@ -345,108 +412,557 @@ void SetupDeoxysFacingDirection(Entity *r0); void sub_808C9B0(Entity *); void sub_808C8E0(Entity *param_1); void sub_808C360(void); -void KyogreScreenFlash(); - -void sub_808C0CC(); -void LugiaScreenFlash(); -void LugiaScreenFlash2(); - -void nullsub_99(); - -extern void sub_8049884(); -extern void sub_8049B8C(); -extern void sub_8049ED4(); -extern void sub_8040A84(); -extern void sub_8086A54(Entity *); - -extern void sub_806BFC0(EntityInfo *, u32); - -extern void sub_808BBA8(Entity * ); -extern void sub_8041888(u32); - -extern u32 sub_80861F8(u32, Entity *, u32); - - -extern void JirachiWish(); -extern void JirachiSpinEffect(Entity *); -extern void JirachiWishGrantDialogue(Entity *jirachiEntity); -extern void JirachiWishGrantFlash(); -extern void JirachiDropInEffect(Entity *param_1); -extern u8 JirachiFriendAreaSearch(void); - -extern u8 sub_80860A8(u32); -extern void sub_8049ED4(); -extern void sub_8052D44(s16 *, Entity *, Entity *); -extern void sub_80421C0(Entity *, u32); -extern void sub_808B1CC(u8); -extern void sub_80464C8(Entity *, u32 *, Item *); -extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32); - -extern u32 sub_8085EC8(u32, u32, u32, Position *, u32); -extern void sub_807EAA0(u32, u32); - -extern void CreateJirachiWishWarpTile(void); - +void KyogreScreenFlash(void); +void sub_808C0CC(void); +void LugiaScreenFlash(void); +void LugiaScreenFlash2(void); +void nullsub_99(void); +void JirachiWish(void); +void JirachiSpinEffect(Entity *jirachiEntity); +void JirachiWishGrantDialogue(Entity *jirachiEntity); +void JirachiDropInEffect(Entity *jirachiEntity); +u8 JirachiFriendAreaSearch(void); +void sub_808B1CC(u8 itemID); +void CreateJirachiWishWarpTile(void); void EnteiScreenFlash(void); void RaikouScreenFlash(void); void sub_808A528(Entity * param_1); -void SuicuneScreenFlash(); +void SuicuneScreenFlash(void); void HoOhDropInEffect(Entity * param_1); void HoOhScreenFlash(void); void LatiosScreenFlash(void); -void SetupRegiFacingDirection(Entity *r0); -void SetupRegirockFightHP(Entity *r0); -void SetupRegiceFightHP(Entity *r0); -void SetupRegisteelFightHP(Entity *r0); +void SetupRegiFacingDirection(Entity *entity); +void SetupRegirockFightHP(Entity *entity); +void SetupRegiceFightHP(Entity *entity); +void SetupRegisteelFightHP(Entity *entity); void sub_808B50C(void); void MewtwoDropInEffect(Entity *param_1); void MewtwoScreenFlash(void); -void sub_80898F8(Entity *r0); -void sub_8089908(Entity *r0); +void sub_80898F8(Entity *entity); +void sub_8089908(Entity *entity); void RayquazaDropInEffect(Entity *param_1); void RayquazaScreenFlash(void); void sub_80891F0(void); void sub_8089294(void); void GroudonScreenFlash2(void); - -extern u8 sub_8086AE4(s16); - -extern void sub_8072008(Entity *, Entity *, s16, u32, u32); -extern void sub_8085374(); - -extern void sub_803F878(u32,s32); - void SceneGroudonMovement(Entity * param_1); void GroudonScreenFlash(void); void ArticunoScreenFlash(void); void sub_8088484(Entity *param_1); void sub_8088574(void); - void MoltresDropInEffect(Entity * param_1); void MoltresScreenFlash1(s32 r0, s32 r1); void MoltresScreenFlash2(s32 r0, s32 r1); void MoltresScreenFlash3(void); - - void MoltresScreenDarken(void); -void ZapdosDropInEffect(Entity *param_1); -void ZapdosScreenFlash(int param_1); +void EnableJirachiWishWarpTile(void); +void sub_808BB3C(Position *pos); +void sub_8087144(); +void SkarmoryEntry(Entity *); -extern void sub_8045C28(Item *, u8 , u8 *); -extern void EnableJirachiWishWarpTile(void); -extern void sub_808BB3C(Position *); -extern void sub_8046860(Entity *, Position *, Item *, u32); -extern u32 sub_803D73C(u32); +void sub_8086A3C(Entity *pokemon) +{ + pokemon->info->unk15C = 1; + pokemon->info->unk15E = 1; +} -extern void sub_80460F8(Position *, Item *, u8); +void sub_8086A54(Entity *pokemon) +{ + pokemon->info->unk15C = 1; + pokemon->info->unk15E = 0; +} + +void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex) +{ + EntityInfo *entityInfo = GetEntInfo(pokemon); + + entityInfo->bossFlag = TRUE; + + // BUG: Source of the Reviver Seed Boss Glitch + // + // Video to demonstration: + // https://www.youtube.com/watch?v=rHu7EehrZ68 + entityInfo->originalHP = entityInfo->maxHPStat; + if (newHP != 0) { + entityInfo->maxHPStat = newHP; + entityInfo->HP = newHP; + } + + gDungeon->bossSongIndex = songIndex; + SetDefaultIQSkills(entityInfo->IQSkillMenuFlags, entityInfo->bossFlag); + LoadIQSkills(pokemon); +} + +void sub_8086AC0(void) +{ + if(!sub_8044B28()) + if(gDungeon->unk2 == 0) + sub_8097FF8(); +} + +u8 sub_8086AE4(s16 _index) +{ + s32 pokeIndex = _index; + + if(gDungeon->unk65C == 0) + return 1; + else + return HasRecruitedMon(pokeIndex); +} + +void sub_8086B14(void) +{ + Entity * leaderEntity; + Entity * diglettEntity; + Entity * skarmoryEntity; + + leaderEntity = xxx_call_GetLeader(); + diglettEntity = GetEntityFromClientType(4); + skarmoryEntity = GetEntityFromClientType(3); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_8085374(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + sub_8086A3C(skarmoryEntity); + diglettEntity->info->unk15C = 1; + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 2); + CopyMonsterNametoBuffer(gUnknown_202E038,MONSTER_DIGLETT); + CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_SKARMORY); +} + +void sub_8086B94(void) +{ + Entity * leaderEntity; + Entity * diglettEntity; + Entity * skarmoryEntity; + + leaderEntity = xxx_call_GetLeader(); + diglettEntity = GetEntityFromClientType(4); + skarmoryEntity = GetEntityFromClientType(3); + + sub_8068FE0(skarmoryEntity,0x21c,0); + sub_8068FE0(diglettEntity,0x21c,0); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); +} + +// TODO: fix this function as param_2 should be u8 +void sub_8086BDC(u8 param_1, s32 param_2) +{ + if ((((param_2 * 0x1000000) - 0x1000000U) >> 0x18 < 2) && (param_1 == 3)) { + sub_8097FA8(1); + gDungeon->unk2 = 1; + } +} + +void SkarmoryPreFightDialogue(void) +{ + Entity *leaderEntity; + Entity *partnerEntity; + Entity * diglettEntity; + Entity * skarmoryEntity; + + Position32 pos1; + Position32 pos2; + + leaderEntity = xxx_call_GetLeader(); // Player + partnerEntity = GetPartnerEntity(); // Partner + diglettEntity = GetEntityFromClientType(4); // Diglett + skarmoryEntity = GetEntityFromClientType(3); // Skarmory + + pos1.x = diglettEntity->pixelPos.x; + pos1.y = diglettEntity->pixelPos.y + 0x3000; + + pos2.x = skarmoryEntity->pixelPos.x; + pos2.y = skarmoryEntity->pixelPos.y + 0x2000; + + sub_8086448(); + sub_803E708(10,0x46); + SpriteShockEffect(partnerEntity); + sub_803E708(0x20,0x46); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_1); + ShiftCameraToPosition(&pos1,0x40); + sub_803E708(0x40,0x46); + ShiftCameraToPosition(&pos2,0x30); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_2); + sub_803E708(10,0x46); + diglettEntity->info->unk15D = 1; + ShiftCameraToPosition(&pos1,0x30); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_3); // Diglett: ...I...\nI'm scared. + sub_803E708(10,0x46); + ShiftCameraToPosition(&pos2,0x20); + sub_803E708(0x20,0x46); + SkarmoryEntry(skarmoryEntity); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_4); // Skarmory: You!\nWhat do you think you're doing here?! + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_5); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_6); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_7); + sub_803E708(10,0x46); + sub_806CDD4(skarmoryEntity,0xd,DIRECTION_SOUTH); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_8); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_9); + sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); + sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); + sub_803E708(10,0x46); + DungeonStartNewBGM(MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void SkarmoryReFightDialogue(void) +{ + Entity * leaderEntity; + Entity * skarmoryEntity; + Position32 pos; + + leaderEntity = xxx_call_GetLeader(); + skarmoryEntity = GetEntityFromClientType(3); + pos.x = skarmoryEntity->pixelPos.x; + pos.y = skarmoryEntity->pixelPos.y + 0x2000; + sub_8086448(); + sub_803E708(10,0x46); + SkarmoryEntry(skarmoryEntity); + ShiftCameraToPosition(&pos,0x10); + DisplayDungeonDialogue(&gSkarmoryReFightDialogue_1); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gSkarmoryReFightDialogue_2); + sub_803E708(10,0x46); + sub_806CDD4(skarmoryEntity,0xd,DIRECTION_SOUTH); + DisplayDungeonDialogue(&gSkarmoryReFightDialogue_3); + sub_803E708(10,0x46); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + DungeonStartNewBGM(MUS_BOSS_BATTLE); +} + +void sub_8086E40(void) +{ + SpriteLookAroundEffect(xxx_call_GetLeader()); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gUnknown_8100D3C); + sub_803E708(10,0x46); + gDungeon->unk2 = 1; +} + +void SkarmoryEntry(Entity * skarmoryEntity) +{ + sub_806CDD4(skarmoryEntity,0xf,DIRECTION_SOUTH); + sub_8086A54(skarmoryEntity); + PlaySoundEffect(0x1f8); + sub_803E708(0x44,0x46); +} + +void sub_8086E9C(void) +{ + Entity * leaderEntity; + + leaderEntity = xxx_call_GetLeader(); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_8085374(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + sub_808563C(sub_8086A3C); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_METAPOD); + CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_GENGAR); + CopyMonsterNametoBuffer(gUnknown_202E038 + 0xA0, MONSTER_CATERPIE); +} + +void sub_8086F00(void) +{ + Entity * leaderEntity; + + leaderEntity = xxx_call_GetLeader(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_METAPOD); + CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_GENGAR); + CopyMonsterNametoBuffer(gUnknown_202E038 + 0xA0, MONSTER_CATERPIE); +} + +// From @jiangzhengwenjz: +// Matches this way for -O2 but can match w/o this hack on -O1 +// https://decomp.me/scratch/BTqWo +void sub_8086F54(u8 param_1, u8 param_2) +{ + Entity *entity; + s32 index; + u32 unk1 = 0; + + + if (param_2 == 4 || param_2 == 5) { + void *labels[2]; + labels[0] = labels[1] = &&label; + + for(index = 0; index < 0x10; index++) + { + entity = gDungeon->wildPokemon[index]; + if ((EntityExists(entity)) && (entity->info->clientType != param_1)) { + return; + } + } + if(!unk1) + { + sub_8097FA8(3); + label: + gDungeon->unk2 = 1; + } + } +} + +void TeamMeaniesPreFightDialogue(void) +{ + Entity *leaderEntity; + + leaderEntity = xxx_call_GetLeader(); + sub_8086448(); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_1); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); + sub_803E708(10, 0x46); + sub_8087144(); + DungeonStartNewBGM(MUS_THERES_TROUBLE); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_3); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_4); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_5); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_6); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_7); + sub_803E708(10, 0x46); + ShiftCameraToPosition(&leaderEntity->pixelPos, 0x10); +} + +void TeamMeaniesReFightDialogue(void) +{ + Entity *leaderEntity; + Entity *partnerEntity; + + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + sub_8086448(); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_1); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); + sub_803E708(10, 0x46); + sub_8087144(); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_2); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_3); + sub_803E708(10, 0x46); + sub_806CDD4(leaderEntity, 6, DIRECTION_NORTH); + sub_806CDD4(partnerEntity, 6, DIRECTION_NORTH); + sub_803E708(10, 0x46); + sub_806CDD4(leaderEntity, 7, DIRECTION_NORTH); + sub_806CDD4(partnerEntity, 7, DIRECTION_NORTH); + sub_803E708(10, 0x46); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_4); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_5); + sub_803E708(10, 0x46); + ShiftCameraToPosition(&leaderEntity->pixelPos, 0x10); +} + +void sub_8087130(void) +{ + sub_8086448(); + sub_80866C4(&gUnknown_8101440); +} + +void sub_8087144(void) +{ + Entity *iVar2; + Entity *iVar3; + Entity *iVar4; + s16 auStack_10c[28]; + s16 puStack_60[28]; + s16 puStack_5c[28]; + s16 *puStack_64[3]; + Entity *pEStack_58[3]; + struct_8085B80 auStack_4c[3]; + + iVar2 = GetEntityFromClientType(5); + iVar3 = GetEntityFromClientType(6); + iVar4 = GetEntityFromClientType(7); + memcpy(auStack_10c,gUnknown_810739C, 0x38); + memcpy(puStack_60, gUnknown_81073D4, 0x38); + memcpy(puStack_5c, gUnknown_810740C, 0x38); + puStack_64[0] = auStack_10c; + puStack_64[1] = puStack_60; + puStack_64[2] = puStack_5c; + pEStack_58[0] = iVar2; + pEStack_58[1] = iVar3; + pEStack_58[2] = iVar4; + DungeonStartNewBGM(MUS_THERES_TROUBLE); + sub_8086A54(iVar2); + sub_8086A54(iVar3); + sub_8086A54(iVar4); + sub_8085B4C(auStack_4c,puStack_64,pEStack_58,3); + iVar2->info->unk15F = 1; + iVar3->info->unk15F = 1; + iVar4->info->unk15F = 1; + while( TRUE ) { + if (!sub_8085B80(auStack_4c)) break; + sub_803E46C(0x46); + } + iVar2->info->unk15F = 0; + iVar3->info->unk15F = 0; + iVar4->info->unk15F = 0; +} + +void sub_8087230(void) +{ + Entity *leaderEntity; + Entity *zapdosEntity; + + leaderEntity = xxx_call_GetLeader(); + zapdosEntity = GetEntityFromClientType(0x8); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_8085374(); + sub_80854D4(); + sub_8085930(4); + sub_80855E4(sub_8086A3C); + SetFacingDirection(zapdosEntity, DIRECTION_SOUTH); + sub_8086A3C(zapdosEntity); + sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); + CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SHIFTRY); + CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ZAPDOS); +} + +void sub_808729C(void) +{ + Entity *leaderEntity; + Entity *zapdosEntity; + + leaderEntity = xxx_call_GetLeader(); + zapdosEntity = GetEntityFromClientType(8); + sub_80854D4(); + sub_8085930(4); + sub_80855E4(sub_8086A3C); + if (sub_8086AE4(0x91) != 0) { + sub_8068FE0(zapdosEntity,0x21c,0); + } + else { + sub_8072008(zapdosEntity,zapdosEntity,gUnknown_80F57CC,0,0); + SetFacingDirection(zapdosEntity,DIRECTION_SOUTH); + sub_8086A3C(zapdosEntity); + } + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SHIFTRY); + CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ZAPDOS); +} + +void sub_8087334(u8 param_1, u8 param_2) +{ + if ((param_2 == 7 || param_2 == 8 || param_2 == 9) && (param_1 == 8)) { + sub_8097FA8(5); + gDungeon->unk2 = 1; + } +} + +void ZapdosPreFightDialogue(void) +{ + Entity *leaderEntity; + Entity *partnerEntity; + struct Zapdos1 puStack_38; // sp 0x0 + struct_8085B80 auStack_78; + struct Zapdos2 puStack_30; + s16 *puStack_34[1]; // sp 0x58 + struct Entity *pEStack_34[1]; // sp 0x5c + s16 *puStack_4c[1]; // sp 0x60 + Entity *pEStack_2c[1]; // sp 0x64 + Entity *zapdosEntity; // sp 0x68 + struct_8085B80 auStack_48; // r8 + + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + zapdosEntity = GetEntityFromClientType(8); + sub_8086448(); + sub_803E708(10,0x46); + SpriteLookAroundEffect(partnerEntity); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); + DisplayDungeonDialogue(&gUnknown_81014B0); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); + sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); + DisplayDungeonDialogue(&gUnknown_8101504); + sub_803E708(10,0x46); + ZapdosScreenFlash(3); + DungeonStopBGM(); + PlaySoundEffect(0x1da); + DisplayDungeonDialogue(&gUnknown_81015A0); + ZapdosDropInEffect(zapdosEntity); + DungeonStartNewBGM(MUS_RISING_FEAR); + sub_806CDD4(partnerEntity,6,DIRECTION_NORTH); + DisplayDungeonDialogue(&gUnknown_81015D4); // Waah! + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,2,1,DIRECTION_SOUTHEAST); + + puStack_38 = gUnknown_810744C; + puStack_34[0] = puStack_38.unk0; + pEStack_34[0] = partnerEntity; + sub_8085B4C(&auStack_78,puStack_34,pEStack_34,1); + partnerEntity->info->unk15F = 1; + while(sub_8085B80(&auStack_78)) { + sub_803E46C(0x46); + } + + partnerEntity->info->unk15F = 0; + partnerEntity->info->unk15D = 1; + sub_80869E4(partnerEntity,2,2,DIRECTION_NORTH); + DisplayDungeonDialogue(&gUnknown_81015E8); // I warned you! I have no mercy for meddlers + sub_803E708(0x3c,0x46); + DisplayDungeonDialogue(&gUnknown_8101624); + sub_803E708(10,0x46); + partnerEntity->info->unk15D = 0; + sub_80869E4(partnerEntity,2,2,DIRECTION_NORTHWEST); + + puStack_30 = gUnknown_8107464; + puStack_4c[0] = puStack_30.unk0; + pEStack_2c[0] = partnerEntity; + sub_8085B4C(&auStack_48,puStack_4c,pEStack_2c,1); + while (sub_8085B80(&auStack_48)) { + sub_803E46C(0x46); + } + + sub_80869E4(partnerEntity,2,1,DIRECTION_NORTHEAST); + DisplayDungeonDialogue(&gUnknown_810165C); + sub_803E708(10,0x46); + ZapdosScreenFlash(3); + DisplayDungeonDialogue(&gUnknown_8101750); + sub_803E708(10,0x46); + ZapdosScreenFlash(1); + DisplayDungeonDialogue(&gUnknown_810178C); + sub_803E708(10,0x46); + ZapdosScreenFlash(2); + DisplayDungeonDialogue(&gUnknown_81017B4); + sub_803E708(10,0x46); + SetupBossFightHP(zapdosEntity,300, MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} void ZapdosReFightDialogue(void) { - Entity *LeaderEntity; - Entity *ZapdosEntity; + Entity *leaderEntity; + Entity *zapdosEntity; - LeaderEntity = xxx_call_GetLeader(); - ZapdosEntity = GetEntityFromClientType(8); + leaderEntity = xxx_call_GetLeader(); + zapdosEntity = GetEntityFromClientType(8); sub_8086448(); sub_803E708(10,0x46); DisplayDungeonDialogue(&gZapdosReFightDialogue_1); @@ -454,24 +970,24 @@ void ZapdosReFightDialogue(void) PlaySoundEffect(0x1da); DisplayDungeonDialogue(&gUnknown_81015A0); sub_803E708(10,0x46); - ZapdosDropInEffect(ZapdosEntity); + ZapdosDropInEffect(zapdosEntity); sub_803E708(10,0x46); DisplayDungeonDialogue(&gZapdosReFightDialogue_2); ZapdosScreenFlash(1); DisplayDungeonDialogue(&gZapdosReFightDialogue_3); ZapdosScreenFlash(2); DisplayDungeonDialogue(&gZapdosReFightDialogue_4); - SetupBossFightHP(ZapdosEntity,300,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(zapdosEntity,300,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void ZapdosPostStoryPreFightDialogue(void) { - Entity * LeaderEntity; - Entity * ZapdosEntity; + Entity * leaderEntity; + Entity * zapdosEntity; - LeaderEntity = xxx_call_GetLeader(); - ZapdosEntity = GetEntityFromClientType(8); + leaderEntity = xxx_call_GetLeader(); + zapdosEntity = GetEntityFromClientType(8); sub_8086448(); if (sub_8086AE4(MONSTER_ZAPDOS)) { sub_80866C4(&gZapdosPostStoryPreFightDialogue_6); @@ -480,7 +996,7 @@ void ZapdosPostStoryPreFightDialogue(void) ZapdosScreenFlash(1); PlaySoundEffect(0x1da); DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_1); - ZapdosDropInEffect(ZapdosEntity); + ZapdosDropInEffect(zapdosEntity); DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_2); ZapdosScreenFlash(1); DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_3); @@ -489,8 +1005,8 @@ void ZapdosPostStoryPreFightDialogue(void) ZapdosScreenFlash(2); DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_5); sub_803E708(10,0x46); - SetupBossFightHP(ZapdosEntity,300,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(zapdosEntity,300,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -513,31 +1029,26 @@ void ZapdosDropInEffect(Entity *zapdosEntity) void ZapdosScreenFlash(s32 numFlashes) { - s32 iVar1; - s32 iVar2; + s32 index; PlaySoundEffect(0x1f6); if (2 < numFlashes) { - for(iVar2 = 250; iVar2 > 199; iVar2 -= 10) + for(index = 250; index > 199; index -= 10) { - SetDungeonBGColorRGB(iVar2,iVar2,iVar2 / 2,1,1); + SetDungeonBGColorRGB(index,index,index / 2,1,1); sub_803E46C(0x46); } } if (1 < numFlashes) { - for(iVar2 = 250; iVar2 > 199; iVar2 -= 10) + for(index = 250; index > 199; index -= 10) { - SetDungeonBGColorRGB(iVar2,iVar2,iVar2 / 2,1,1); + SetDungeonBGColorRGB(index,index,index / 2,1,1); sub_803E46C(0x46); } } - for(iVar2 = 250; iVar2 >= 0; iVar2 -= 10) + for(index = 250; index >= 0; index -= 10) { - iVar1 = iVar2; - if (iVar2 < 0) { - iVar1 = iVar2 + 3; - } - SetDungeonBGColorRGB(iVar2,iVar2,iVar1 >> 2,1,1); + SetDungeonBGColorRGB(index,index,index / 4,1,1); sub_803E46C(0x46); } sub_8085EB0(); @@ -545,45 +1056,45 @@ void ZapdosScreenFlash(s32 numFlashes) void sub_80877E8(void) { - Entity * LeaderEntity; - Entity * MoltresEntity; + Entity * leaderEntity; + Entity * moltresEntity; - LeaderEntity = xxx_call_GetLeader(); - MoltresEntity = GetEntityFromClientType(9); + leaderEntity = xxx_call_GetLeader(); + moltresEntity = GetEntityFromClientType(9); DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_WEST); sub_80855E4(sub_8086A3C); - SetFacingDirection(MoltresEntity, DIRECTION_SOUTH); - sub_8086A3C(MoltresEntity); - sub_8085860(LeaderEntity->pos.x + -3,LeaderEntity->pos.y + -2); + SetFacingDirection(moltresEntity, DIRECTION_SOUTH); + sub_8086A3C(moltresEntity); + sub_8085860(leaderEntity->pos.x + -3,leaderEntity->pos.y + -2); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_MOLTRES); } void sub_8087848(void) { - Entity *LeaderEntity; - Entity *MoltresEntity; + Entity *leaderEntity; + Entity *moltresEntity; u32 XPos; s32 YPos; - LeaderEntity = xxx_call_GetLeader(); - MoltresEntity = GetEntityFromClientType(9); + leaderEntity = xxx_call_GetLeader(); + moltresEntity = GetEntityFromClientType(9); DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); sub_80854D4(); sub_8085930(DIRECTION_WEST); sub_80855E4(sub_8086A3C); if (sub_8086AE4(MONSTER_MOLTRES)) { - sub_8068FE0(MoltresEntity,0x21c,0); + sub_8068FE0(moltresEntity,0x21c,0); } else { - sub_8072008(MoltresEntity,MoltresEntity,gUnknown_80F57CE,0,0); - SetFacingDirection(MoltresEntity, DIRECTION_SOUTH); - sub_8086A3C(MoltresEntity); + sub_8072008(moltresEntity,moltresEntity,gUnknown_80F57CE,0,0); + SetFacingDirection(moltresEntity, DIRECTION_SOUTH); + sub_8086A3C(moltresEntity); } - sub_8085860(LeaderEntity->pos.x - 5, LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x - 5, leaderEntity->pos.y); XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos, YPos + -0x1000); @@ -600,21 +1111,21 @@ void sub_80878F4(u8 param_1, u8 param_2) void MoltresPreFightDialogue(void) { - Entity *LeaderEntity; - Entity *PartnerEntity; - Entity *MoltresEntity; + Entity *leaderEntity; + Entity *partnerEntity; + Entity *moltresEntity; - LeaderEntity = xxx_call_GetLeader(); - PartnerEntity = GetPartnerEntity(); - MoltresEntity = GetEntityFromClientType(9); + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + moltresEntity = GetEntityFromClientType(9); MoltresScreenFlash1(0xc,5); sub_8086500(); sub_803E708(10,0x46); DisplayDungeonDialogue(&gMoltresPreFightDialogue_1); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,5); + sub_80869E4(partnerEntity,4,1,DIRECTION_NORTHWEST); sub_803E708(4,0x46); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); sub_803E708(10,0x46); DisplayDungeonDialogue(&gMoltresPreFightDialogue_2); sub_803E708(10,0x46); @@ -622,11 +1133,11 @@ void MoltresPreFightDialogue(void) MoltresScreenFlash2(9,5); DisplayDungeonDialogue(&gMoltresPreFightDialogue_3); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,2); - sub_80869E4(LeaderEntity,4,2,6); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); DisplayDungeonDialogue(&gMoltresPreFightDialogue_4); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,2,6); + sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); sub_8086690(); DisplayDungeonDialogue(&gMoltresPreFightDialogue_5); sub_803E708(10,0x46); @@ -641,7 +1152,7 @@ void MoltresPreFightDialogue(void) DisplayDungeonDialogue(&gMoltresPreFightDialogue_7); sub_803E708(10,0x46); PlaySoundEffect(0x1cf); - sub_80856E0(PartnerEntity, DIRECTION_NORTH); + sub_80856E0(partnerEntity, DIRECTION_NORTH); sub_803E708(10,0x46); DisplayDungeonDialogue(&gMoltresPreFightDialogue_8); sub_803E708(10,0x46); @@ -655,7 +1166,7 @@ void MoltresPreFightDialogue(void) sub_803E708(10,0x46); MoltresScreenFlash1(0xc,5); MoltresScreenFlash2(9,5); - MoltresDropInEffect(MoltresEntity); + MoltresDropInEffect(moltresEntity); sub_808663C(); MoltresScreenFlash3(); DisplayDungeonDialogue(&gMoltresPreFightDialogue_11); @@ -663,40 +1174,40 @@ void MoltresPreFightDialogue(void) MoltresScreenFlash2(0xb,6); DisplayDungeonDialogue(&gMoltresPreFightDialogue_12); sub_803E708(10,0x46); - SetupBossFightHP(MoltresEntity,400,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void MoltresReFightDialogue(void) { - Entity *LeaderEntity; - Entity *PartnerEntity; - Entity *MoltresEntity; + Entity *leaderEntity; + Entity *partnerEntity; + Entity *moltresEntity; - LeaderEntity = xxx_call_GetLeader(); - PartnerEntity = GetPartnerEntity(); - MoltresEntity = GetEntityFromClientType(9); + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + moltresEntity = GetEntityFromClientType(9); MoltresScreenFlash1(10,5); sub_8086500(); sub_803E708(10,0x46); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); sub_803E708(10,0x46); DisplayDungeonDialogue(&gMoltresReFightDialogue_1); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,2); - sub_80869E4(LeaderEntity,4,2,6); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); DisplayDungeonDialogue(&gMoltresReFightDialogue_2); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,2,6); - sub_80869E4(LeaderEntity,4,2,6); + sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); sub_8086690(); MoltresScreenDarken(); sub_803E708(10,0x46); sub_8085930(DIRECTION_NORTHWEST); sub_803E708(4,0x46); sub_8085930(DIRECTION_NORTH); - MoltresDropInEffect(MoltresEntity); + MoltresDropInEffect(moltresEntity); sub_808663C(); MoltresScreenFlash3(); DisplayDungeonDialogue(&gMoltresReFightDialogue_3); @@ -706,17 +1217,17 @@ void MoltresReFightDialogue(void) sub_803E708(10,0x46); DisplayDungeonDialogue(&gMoltresReFightDialogue_5); sub_803E708(10,0x46); - SetupBossFightHP(MoltresEntity,400,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void MoltresPostStoryPreFightDialogue(void) { - Entity * LeaderEntity; - Entity * MoltresEntity; + Entity * leaderEntity; + Entity * moltresEntity; - LeaderEntity = xxx_call_GetLeader(); - MoltresEntity = GetEntityFromClientType(9); + leaderEntity = xxx_call_GetLeader(); + moltresEntity = GetEntityFromClientType(9); MoltresScreenFlash1(0xc,5); sub_808654C(); if (sub_8086AE4(MONSTER_MOLTRES)) { @@ -734,7 +1245,7 @@ void MoltresPostStoryPreFightDialogue(void) sub_8085930(DIRECTION_NORTHWEST); sub_803E708(4,0x46); sub_8085930(DIRECTION_NORTH); - MoltresDropInEffect(MoltresEntity); + MoltresDropInEffect(moltresEntity); DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_2); MoltresScreenFlash1(0xc,5); MoltresScreenFlash2(9,5); @@ -744,8 +1255,8 @@ void MoltresPostStoryPreFightDialogue(void) MoltresScreenFlash2(0xb,6); DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_5); sub_803E708(10,0x46); - SetupBossFightHP(MoltresEntity,400,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -954,56 +1465,56 @@ void MoltresScreenDarken(void) void sub_8087F54(void) { - Entity *LeaderEntity; - Entity *ArticunoEntity; + Entity *leaderEntity; + Entity *articunoEntity; - LeaderEntity = xxx_call_GetLeader(); - ArticunoEntity = GetEntityFromClientType(0xd); + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromClientType(0xd); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - SetFacingDirection(ArticunoEntity, DIRECTION_SOUTH); - sub_8086A3C(ArticunoEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y + -3); + SetFacingDirection(articunoEntity, DIRECTION_SOUTH); + sub_8086A3C(articunoEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_ARTICUNO); } void sub_8087FB4(void) { - Entity *ArticunoEntity; + Entity *articunoEntity; - ArticunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromClientType(0xd); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); - SetFacingDirection(ArticunoEntity, DIRECTION_SOUTH); - sub_806CDD4(ArticunoEntity, 0xF, DIRECTION_SOUTH); + SetFacingDirection(articunoEntity, DIRECTION_SOUTH); + sub_806CDD4(articunoEntity, 0xF, DIRECTION_SOUTH); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_ARTICUNO); } void sub_8087FF8(void) { - Entity *LeaderEntity; - Entity *ArticunoEntity; + Entity *leaderEntity; + Entity *articunoEntity; - LeaderEntity = xxx_call_GetLeader(); - ArticunoEntity = GetEntityFromClientType(0xd); + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromClientType(0xd); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); if (sub_8086AE4(MONSTER_ARTICUNO)) { - sub_8068FE0(ArticunoEntity,0x21c,0); + sub_8068FE0(articunoEntity,0x21c,0); } else { - sub_8072008(ArticunoEntity,ArticunoEntity,gUnknown_80F57D0,0,0); - SetFacingDirection(ArticunoEntity, DIRECTION_SOUTH); - sub_8086A3C(ArticunoEntity); + sub_8072008(articunoEntity,articunoEntity,gUnknown_80F57D0,0,0); + SetFacingDirection(articunoEntity, DIRECTION_SOUTH); + sub_8086A3C(articunoEntity); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y + -3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_ARTICUNO); } @@ -1017,49 +1528,49 @@ void sub_8088088(u8 param_1, u8 param_2) void ArticunoPreFightDialogue(void) { - Entity *LeaderEntity; - Entity *PartnerEntity; - Entity *ArticunoEntity; + Entity *leaderEntity; + Entity *partnerEntity; + Entity *articunoEntity; - LeaderEntity = xxx_call_GetLeader(); - PartnerEntity = GetPartnerEntity(); - ArticunoEntity = GetEntityFromClientType(0xd); + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + articunoEntity = GetEntityFromClientType(0xd); sub_8086448(); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); DisplayDungeonDialogue(&gArticunoPreFightDialogue_1); sub_803E708(10,0x46); sub_8086598(); DungeonStopBGM(); DisplayDungeonDialogue(&gArticunoPreFightDialogue_2); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,2); - sub_80869E4(LeaderEntity,4,2,6); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); DisplayDungeonDialogue(&gArticunoPreFightDialogue_3); sub_803E708(10,0x46); - SetFacingDirection(LeaderEntity, DIRECTION_WEST); + SetFacingDirection(leaderEntity, DIRECTION_WEST); sub_803E708(4,0x46); - SetFacingDirection(LeaderEntity, DIRECTION_NORTHWEST); + SetFacingDirection(leaderEntity, DIRECTION_NORTHWEST); sub_803E708(4,0x46); - SetFacingDirection(LeaderEntity, DIRECTION_WEST); + SetFacingDirection(leaderEntity, DIRECTION_WEST); sub_803E708(4,0x46); - SetFacingDirection(LeaderEntity, DIRECTION_SOUTHWEST); + SetFacingDirection(leaderEntity, DIRECTION_SOUTHWEST); sub_803E708(4,0x46); - SetFacingDirection(LeaderEntity, DIRECTION_WEST); + SetFacingDirection(leaderEntity, DIRECTION_WEST); sub_803E708(4,0x46); - SetFacingDirection(LeaderEntity, DIRECTION_NORTHWEST); + SetFacingDirection(leaderEntity, DIRECTION_NORTHWEST); sub_803E708(4,0x46); - SetFacingDirection(LeaderEntity, DIRECTION_WEST); + SetFacingDirection(leaderEntity, DIRECTION_WEST); sub_803E708(10,0x46); DisplayDungeonDialogue(&gArticunoPreFightDialogue_4); sub_803E708(10,0x46); DisplayDungeonDialogue(&gArticunoPreFightDialogue_5); sub_803E708(10,0x46); - sub_80869E4(LeaderEntity,4,1,4); - sub_80869E4(PartnerEntity,4,2,4); + sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); + sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(LeaderEntity); + SpriteLookAroundEffect(leaderEntity); DisplayDungeonDialogue(&gArticunoPreFightDialogue_6); sub_803E708(10,0x46); DisplayDungeonDialogue(&gArticunoPreFightDialogue_7); @@ -1077,51 +1588,51 @@ void ArticunoPreFightDialogue(void) DisplayDungeonDialogue(&gArticunoPreFightDialogue_9); sub_803E708(10,0x46); PlaySoundEffect(0x1ea); - sub_8088484(ArticunoEntity); + sub_8088484(articunoEntity); sub_80865E8(); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoPreFightDialogue_10); - sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoPreFightDialogue_11); - sub_806CDD4(ArticunoEntity,0x10,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoPreFightDialogue_12); - sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); sub_803E708(0x10,0x46); - SetupBossFightHP(ArticunoEntity,0x1c2,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void ArticunoReFightDialogue(void) { - Entity *LeaderEntity; - Entity *ArticunoEntity; + Entity *leaderEntity; + Entity *articunoEntity; - LeaderEntity = xxx_call_GetLeader(); - ArticunoEntity = GetEntityFromClientType(0xd); + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromClientType(0xd); gDungeon->weather.unkE265 = WEATHER_SNOW; sub_807EAA0(0,1); sub_803E708(10,0x46); DisplayDungeonDialogue(&gArticunoReFightDialogue_1); - sub_806CDD4(ArticunoEntity,0x10,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoReFightDialogue_2); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoReFightDialogue_3); - sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); sub_803E708(0x28,0x46); - SetupBossFightHP(ArticunoEntity,0x1c2,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void ArticunoPostStoryPreFightDialogue(void) { - Entity *LeaderEntity; - Entity *ArticunoEntity; + Entity *leaderEntity; + Entity *articunoEntity; - LeaderEntity = xxx_call_GetLeader(); - ArticunoEntity = GetEntityFromClientType(0xd); + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromClientType(0xd); sub_8086448(); if (sub_8086AE4(MONSTER_ARTICUNO)) { sub_80866C4(&gUnknown_8102A9C); @@ -1134,21 +1645,21 @@ void ArticunoPostStoryPreFightDialogue(void) PlaySoundEffect(0x1da); DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_1); sub_803E708(10,0x46); - sub_8088484(ArticunoEntity); + sub_8088484(articunoEntity); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_2); - sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_3); - sub_806CDD4(ArticunoEntity,0x10,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_4); ArticunoScreenFlash(); DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_5); - sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); sub_803E708(0x28,0x46); - SetupBossFightHP(ArticunoEntity,0x1c2,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -1214,16 +1725,16 @@ void sub_80885A0(void) void sub_80885C4(void) { - Entity * LeaderEntity; + Entity * leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); DungeonFadeOutBGM(0x3c); sub_803E708(0x3c,0x46); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); } void sub_8088608(void) @@ -1242,49 +1753,49 @@ void sub_8088618(void) void sub_808862C(void) { - Entity * LeaderEntity; - Entity * AlakazamEntity; - Entity * GroudonEntity; + Entity * leaderEntity; + Entity * alakazamEntity; + Entity * groudonEntity; - LeaderEntity = xxx_call_GetLeader(); - AlakazamEntity = GetEntityFromClientType(10); - GroudonEntity = GetEntityFromClientType(0xe); + leaderEntity = xxx_call_GetLeader(); + alakazamEntity = GetEntityFromClientType(10); + groudonEntity = GetEntityFromClientType(0xe); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80867F4(); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - SetFacingDirection(AlakazamEntity, DIRECTION_NORTH); - sub_80861D4(AlakazamEntity,0xd,DIRECTION_NORTH); - SetFacingDirection(GroudonEntity, DIRECTION_SOUTH); - sub_8086A3C(GroudonEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y -3); + SetFacingDirection(alakazamEntity, DIRECTION_NORTH); + sub_80861D4(alakazamEntity,0xd,DIRECTION_NORTH); + SetFacingDirection(groudonEntity, DIRECTION_SOUTH); + sub_8086A3C(groudonEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y -3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_GROUDON); CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ALAKAZAM); } void sub_80886C4(void) { - Entity * LeaderEntity; - Entity * AlakazamEntity; - Entity * GroudonEntity; + Entity * leaderEntity; + Entity * alakazamEntity; + Entity * groudonEntity; u32 XPos; s32 YPos; - LeaderEntity = xxx_call_GetLeader(); - AlakazamEntity = GetEntityFromClientType(10); - GroudonEntity = GetEntityFromClientType(0xe); + leaderEntity = xxx_call_GetLeader(); + alakazamEntity = GetEntityFromClientType(10); + groudonEntity = GetEntityFromClientType(0xe); PlaySoundEffect(0x3e5); sub_80867F4(); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); - sub_8068FE0(AlakazamEntity,0x21c,0); - SetFacingDirection(GroudonEntity, DIRECTION_SOUTH); - sub_8086A3C(GroudonEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8068FE0(alakazamEntity,0x21c,0); + SetFacingDirection(groudonEntity, DIRECTION_SOUTH); + sub_8086A3C(groudonEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos + -0x1000); @@ -1294,27 +1805,27 @@ void sub_80886C4(void) void sub_808875C(void) { - Entity * LeaderEntity; - Entity * AlakazamEntity; - Entity * GroudonEntity; + Entity * leaderEntity; + Entity * alakazamEntity; + Entity * groudonEntity; - LeaderEntity = xxx_call_GetLeader(); - AlakazamEntity = GetEntityFromClientType(10); - GroudonEntity = GetEntityFromClientType(0xe); + leaderEntity = xxx_call_GetLeader(); + alakazamEntity = GetEntityFromClientType(10); + groudonEntity = GetEntityFromClientType(0xe); sub_80867F4(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - sub_8068FE0(AlakazamEntity,0x21c,0); + sub_8068FE0(alakazamEntity,0x21c,0); if (sub_8086AE4(MONSTER_GROUDON)) { - sub_8068FE0(GroudonEntity,0x21c,0); + sub_8068FE0(groudonEntity,0x21c,0); } else { - sub_8072008(GroudonEntity,GroudonEntity,gUnknown_80F57D2,0,0); - SetFacingDirection(GroudonEntity, DIRECTION_SOUTH); - sub_80861D4(GroudonEntity,0xf,DIRECTION_SOUTH); + sub_8072008(groudonEntity,groudonEntity,gUnknown_80F57D2,0,0); + SetFacingDirection(groudonEntity, DIRECTION_SOUTH); + sub_80861D4(groudonEntity,0xf,DIRECTION_SOUTH); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_GROUDON); CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ALAKAZAM); } @@ -1334,15 +1845,15 @@ void sub_8088848(void) void GroudonPreFightDialogue(void) { - Entity * LeaderEntity; - Entity * PartnerEntity; - Entity * AlakazamEntity; - Entity * GroudonEntity; + Entity * leaderEntity; + Entity * partnerEntity; + Entity * alakazamEntity; + Entity * groudonEntity; - LeaderEntity = xxx_call_GetLeader(); - PartnerEntity = GetPartnerEntity(); - AlakazamEntity = GetEntityFromClientType(10); - GroudonEntity = GetEntityFromClientType(0xe); + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + alakazamEntity = GetEntityFromClientType(10); + groudonEntity = GetEntityFromClientType(0xe); sub_8086448(); DisplayDungeonDialogue(&GroudonPreFightDialogue_1); sub_803E708(10,0x46); @@ -1367,15 +1878,15 @@ void GroudonPreFightDialogue(void) DisplayDungeonDialogue(&GroudonPreFightDialogue_6); sub_803E708(10,0x46); PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); DisplayDungeonDialogue(&GroudonPreFightDialogue_7); sub_803E708(10,0x46); sub_808682C(); sub_803E708(0x3c,0x46); - sub_80861B8(AlakazamEntity,6,DIRECTION_NORTH); + sub_80861B8(alakazamEntity,6,DIRECTION_NORTH); PlaySoundEffect(0x205); sub_8086738(); - sub_8068FE0(AlakazamEntity,0x21c,0); + sub_8068FE0(alakazamEntity,0x21c,0); DisplayDungeonDialogue(&GroudonPreFightDialogue_8); sub_803E708(10,0x46); DisplayDungeonDialogue(&GroudonPreFightDialogue_9); @@ -1384,7 +1895,7 @@ void GroudonPreFightDialogue(void) sub_8086764(); sub_803E708(0x28,0x46); PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); DisplayDungeonDialogue(&GroudonPreFightDialogue_10); sub_803E708(10,0x46); sub_8086838(1,1,1); @@ -1407,20 +1918,20 @@ void GroudonPreFightDialogue(void) sub_8085930(DIRECTION_NORTH); DisplayDungeonDialogue(&GroudonPreFightDialogue_14); sub_803E708(10,0x46); - sub_8086A54(GroudonEntity); + sub_8086A54(groudonEntity); sub_8085930(DIRECTION_NORTH); sub_8086764(); - SetupBossFightHP(GroudonEntity,500,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(groudonEntity,500,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void GroudonReFightDialogue(void) { - Entity * LeaderEntity; - Entity * GroudonEntity; + Entity * leaderEntity; + Entity * groudonEntity; - LeaderEntity = xxx_call_GetLeader(); - GroudonEntity = GetEntityFromClientType(0xe); + leaderEntity = xxx_call_GetLeader(); + groudonEntity = GetEntityFromClientType(0xe); sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); @@ -1439,20 +1950,20 @@ void GroudonReFightDialogue(void) sub_8086738(); DisplayDungeonDialogue(&gGroudonReFightDialogue_4); sub_803E708(10,0x46); - sub_8086A54(GroudonEntity); + sub_8086A54(groudonEntity); sub_8085930(DIRECTION_NORTH); sub_8086764(); - SetupBossFightHP(GroudonEntity,500,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(groudonEntity,500,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void GroudonPostStoryPreFightDialogue(void) { - Entity * LeaderEntity; - Entity * GroudonEntity; + Entity * leaderEntity; + Entity * groudonEntity; - LeaderEntity = xxx_call_GetLeader(); - GroudonEntity = GetEntityFromClientType(0xe); + leaderEntity = xxx_call_GetLeader(); + groudonEntity = GetEntityFromClientType(0xe); sub_8086448(); if (sub_8086AE4(MONSTER_GROUDON)) { sub_80866C4(&gUnknown_8103488); @@ -1460,8 +1971,8 @@ void GroudonPostStoryPreFightDialogue(void) else{ DisplayDungeonDialogue(&gGroudonPostStoryPreFightDialogue_1); sub_803E708(10,0x46); - SceneGroudonMovement(GroudonEntity); - SceneGroudonMovement(GroudonEntity); + SceneGroudonMovement(groudonEntity); + SceneGroudonMovement(groudonEntity); DisplayDungeonDialogue(&gGroudonPostStoryPreFightDialogue_2); PlaySoundEffect(0x1f6); GroudonScreenFlash(); @@ -1470,18 +1981,18 @@ void GroudonPostStoryPreFightDialogue(void) GroudonScreenFlash(); DisplayDungeonDialogue(&gGroudonPostStoryPreFightDialogue_4); sub_803E708(10,0x46); - SetupBossFightHP(GroudonEntity,500,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(groudonEntity,500,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } // Moves Groudon down in a walking fashion -void SceneGroudonMovement(Entity * GroudonEntity) +void SceneGroudonMovement(Entity * groudonEntity) { int iVar1; sub_8086848(0x18,0x10); - sub_806CDD4(GroudonEntity,0,DIRECTION_SOUTH); + sub_806CDD4(groudonEntity,0,DIRECTION_SOUTH); for(iVar1 = 0; iVar1 < 0x2C; iVar1++) { if ((iVar1 == 10) || (iVar1 == 0x20)) { @@ -1490,12 +2001,12 @@ void SceneGroudonMovement(Entity * GroudonEntity) sub_808680C(); } if ((iVar1 - 10U < 0xc) || (iVar1 > 0x1f)) { - IncreaseEntityPixelPos(GroudonEntity,0,0x100); + IncreaseEntityPixelPos(groudonEntity,0,0x100); } sub_803E46C(0x46); } - sub_80856C8(GroudonEntity,GroudonEntity->pos.x,GroudonEntity->pos.y + 1); - sub_80861D4(GroudonEntity,0xf,DIRECTION_SOUTH); + sub_80856C8(groudonEntity,groudonEntity->pos.x,groudonEntity->pos.y + 1); + sub_80861D4(groudonEntity,0xf,DIRECTION_SOUTH); sub_803E708(10,0x46); sub_808682C(); sub_8085930(DIRECTION_NORTH); @@ -1559,45 +2070,45 @@ void GroudonScreenFlash2(void) void sub_8088DC0(void) { - Entity * LeaderEntity; - Entity * uVar2; - Entity * uVar3; + Entity * leaderEntity; + Entity * groudonEntity; + Entity * alakazamEntity; - LeaderEntity = xxx_call_GetLeader(); - uVar2 = GetEntityFromClientType(0xb); - uVar3 = GetEntityFromClientType(0xc); + leaderEntity = xxx_call_GetLeader(); + groudonEntity = GetEntityFromClientType(0xb); + alakazamEntity = GetEntityFromClientType(0xc); sub_80867F4(); sub_8086838(0,1,0); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - sub_8086A3C(uVar2); - sub_806CDD4(uVar2,0xe,DIRECTION_SOUTH); - sub_8086A3C(uVar3); - sub_806CDD4(uVar3,0xe,DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8086A3C(groudonEntity); + sub_806CDD4(groudonEntity,0xe,DIRECTION_SOUTH); + sub_8086A3C(alakazamEntity); + sub_806CDD4(alakazamEntity,0xe,DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_GROUDON); CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ALAKAZAM); } void sub_8088E5C(void) { - Entity * LeaderEntity; - Entity * uVar2; - Entity * uVar3; + Entity * leaderEntity; + Entity * groudonEntity; + Entity * alakazamEntity; - LeaderEntity = xxx_call_GetLeader(); - uVar2 = GetEntityFromClientType(0xb); - uVar3 = GetEntityFromClientType(0xc); + leaderEntity = xxx_call_GetLeader(); + groudonEntity = GetEntityFromClientType(0xb); + alakazamEntity = GetEntityFromClientType(0xc); sub_80867F4(); sub_8086838(0,1,0); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - sub_8068FE0(uVar2,0x21c,0); - sub_8068FE0(uVar3,0x21c,0); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y + -3); + sub_8068FE0(groudonEntity,0x21c,0); + sub_8068FE0(alakazamEntity,0x21c,0); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_GROUDON); CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_ALAKAZAM); } @@ -1610,26 +2121,26 @@ void sub_8088EE8(void) void MagmaCavernMidDialogue(void) { - Entity * LeaderEntity; - Entity * PartnerEntity; - Entity * iVar3; - Entity * iVar4; + Entity * leaderEntity; + Entity * partnerEntity; + Entity * groudonEntity; + Entity * alakazamEntity; s16 IDStack [2]; - Position32 local_20; + Position32 pos; - LeaderEntity = xxx_call_GetLeader(); - PartnerEntity = GetPartnerEntity(); - iVar3 = GetEntityFromClientType(0xb); - iVar4 = GetEntityFromClientType(0xc); - sub_8052D44(IDStack,LeaderEntity,PartnerEntity); + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + groudonEntity = GetEntityFromClientType(0xb); + alakazamEntity = GetEntityFromClientType(0xc); + sub_8052D44(IDStack,leaderEntity,partnerEntity); sub_8086448(); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); // Let's see.. // I wonder where we are? DisplayDungeonDialogue(&MagmaCavernMidDialogue_1); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,2); - sub_80869E4(LeaderEntity,4,2,6); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); // I know we've come pretty // far... // @@ -1660,17 +2171,17 @@ void MagmaCavernMidDialogue(void) DisplayDungeonDialogue(&MagmaCavernMidDialogue_4); sub_803E708(10,0x46); PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); PlaySoundEffect(0x1c7); - sub_80856E0(PartnerEntity, DIRECTION_NORTH); + sub_80856E0(partnerEntity, DIRECTION_NORTH); // Hey! {POKEMON_0}! // Over there! DisplayDungeonDialogue(&MagmaCavernMidDialogue_5); - iVar3->info->unk15E = 0; - iVar4->info->unk15E =0; - local_20.x = (iVar3->pixelPos.x + iVar4->pixelPos.x) / 2; - local_20.y = (iVar3->pixelPos.y + iVar4->pixelPos.y) / 2 + 0x800; - ShiftCameraToPosition(&local_20,0x20); + groudonEntity->info->unk15E = 0; + alakazamEntity->info->unk15E =0; + pos.x = (groudonEntity->pixelPos.x + alakazamEntity->pixelPos.x) / 2; + pos.y = (groudonEntity->pixelPos.y + alakazamEntity->pixelPos.y) / 2 + 0x800; + ShiftCameraToPosition(&pos,0x20); sub_803E708(0x3c,0x46); sub_80891F0(); // Hey! @@ -1683,7 +2194,7 @@ void MagmaCavernMidDialogue(void) // Urrrrgh... DisplayDungeonDialogue(&MagmaCavernMidDialogue_7); sub_803E708(10,0x46); - sub_80869E4(LeaderEntity,4,2,5); + sub_80869E4(leaderEntity,4,2,DIRECTION_NORTHWEST); // What happened to you? // // What happened here? @@ -1696,14 +2207,14 @@ void MagmaCavernMidDialogue(void) sub_803E708(10,0x46); DisplayDungeonDialogue(&MagmaCavernMidDialogue_10); sub_803E708(10,0x46); - sub_80869E4(LeaderEntity,4,1,3); - sub_80869E4(PartnerEntity,4,1,3); + sub_80869E4(leaderEntity,4,1,DIRECTION_NORTHEAST); + sub_80869E4(partnerEntity,4,1,DIRECTION_NORTHEAST); // Grrgh.. // We... It crushed us DisplayDungeonDialogue(&MagmaCavernMidDialogue_11); sub_803E708(10,0x46); PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(PartnerEntity); + SpriteLookAroundEffect(partnerEntity); // That's right... // What happened to {POKEMON_3}? // Where is {POKEMON_3}? @@ -1717,8 +2228,9 @@ void MagmaCavernMidDialogue(void) // Still battling {POKEMON_2}... DisplayDungeonDialogue(&MagmaCavernMidDialogue_13); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,2); - sub_80869E4(LeaderEntity,4,2,6); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); + // {POKEMON_0}! // We've got to hurry! DisplayDungeonDialogue(&MagmaCavernMidDialogue_14); @@ -1731,14 +2243,14 @@ void MagmaCavernMidDialogue(void) void sub_8089168(void) { - Entity *LeaderEntity; + Entity *leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); sub_8086448(); sub_803E708(10,0x46); - SpriteLookAroundEffect(LeaderEntity); + SpriteLookAroundEffect(leaderEntity); sub_803E708(10,0x46); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void sub_808919C(Entity *r0) @@ -1829,10 +2341,10 @@ void sub_8089294(void) void sub_80892C8(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * RayquazaEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); RayquazaEntity = GetEntityFromClientType(0xf); DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN); sub_8085374(); @@ -1841,29 +2353,29 @@ void sub_80892C8(void) sub_80855E4(sub_8086A3C); SetFacingDirection(RayquazaEntity, DIRECTION_SOUTH); sub_8086A3C(RayquazaEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038,MONSTER_RAYQUAZA); } void sub_8089328(void) { - Entity * LeaderEntity; - Entity * RayquazaEntity; + Entity * leaderEntity; + Entity * rayquazaEntity; - LeaderEntity = xxx_call_GetLeader(); - RayquazaEntity = GetEntityFromClientType(0xf); + leaderEntity = xxx_call_GetLeader(); + rayquazaEntity = GetEntityFromClientType(0xf); DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); if (sub_8086AE4(MONSTER_RAYQUAZA)) { - sub_8068FE0(RayquazaEntity,0x21c,0); + sub_8068FE0(rayquazaEntity,0x21c,0); } else { - sub_8072008(RayquazaEntity,RayquazaEntity,gUnknown_80F57CA,0,0); - sub_8086A3C(RayquazaEntity); + sub_8072008(rayquazaEntity,rayquazaEntity,gUnknown_80F57CA,0,0); + sub_8086A3C(rayquazaEntity); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038,MONSTER_RAYQUAZA); } @@ -1877,25 +2389,25 @@ void sub_80893B4(u8 param_1, u8 param_2) void RayquazaPreFightDialogue(void) { - Entity *LeaderEntity; - Entity *PartnerEntity; - Entity *RayquazaEntity; + Entity *leaderEntity; + Entity *partnerEntity; + Entity *rayquazaEntity; - LeaderEntity = xxx_call_GetLeader(); - PartnerEntity = GetPartnerEntity(); - RayquazaEntity = GetEntityFromClientType(0xf); + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + rayquazaEntity = GetEntityFromClientType(0xf); sub_8086448(); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_1); RayquazaScreenFlash(); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_2); - sub_80856E0(PartnerEntity, DIRECTION_NORTH); - SpriteLookAroundEffect(PartnerEntity); + sub_80856E0(partnerEntity, DIRECTION_NORTH); + SpriteLookAroundEffect(partnerEntity); sub_803E708(10,0x46); - sub_80869E4(PartnerEntity,4,1,2); - sub_80869E4(LeaderEntity,4,2,6); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_3); - sub_80869E4(PartnerEntity,4,2,4); - sub_80869E4(LeaderEntity,4,1,4); + sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); + sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_4); sub_803E708(10,0x46); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_5); @@ -1904,7 +2416,7 @@ void RayquazaPreFightDialogue(void) RayquazaScreenFlash(); PlaySoundEffect(0x1da); // Rayquaza Cry DisplayDungeonDialogue(&gRayquazaPreFightDialogue_7); - RayquazaDropInEffect(RayquazaEntity); + RayquazaDropInEffect(rayquazaEntity); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_8); RayquazaScreenFlash(); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_9); @@ -1912,23 +2424,23 @@ void RayquazaPreFightDialogue(void) DisplayDungeonDialogue(&gRayquazaPreFightDialogue_10); RayquazaScreenFlash(); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_11); - SetupBossFightHP(RayquazaEntity,600,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(rayquazaEntity,600,MUS_BATTLE_WITH_RAYQUAZA); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void RayquazaReFightDialogue(void) { - Entity *LeaderEntity; - Entity *RayquazaEntity; + Entity *leaderEntity; + Entity *rayquazaEntity; - LeaderEntity = xxx_call_GetLeader(); - RayquazaEntity = GetEntityFromClientType(0xf); + leaderEntity = xxx_call_GetLeader(); + rayquazaEntity = GetEntityFromClientType(0xf); sub_8086448(); RayquazaScreenFlash(); PlaySoundEffect(0x1da); // Rayquaza Cry DisplayDungeonDialogue(&gRayquazaPreFightDialogue_7); sub_803E708(10,0x46); - RayquazaDropInEffect(RayquazaEntity); + RayquazaDropInEffect(rayquazaEntity); DisplayDungeonDialogue(&gRayquazaReFightDialogue_1); RayquazaScreenFlash(); DisplayDungeonDialogue(&gRayquazaReFightDialogue_2); @@ -1936,17 +2448,17 @@ void RayquazaReFightDialogue(void) DisplayDungeonDialogue(&gRayquazaReFightDialogue_3); RayquazaScreenFlash(); DisplayDungeonDialogue(&gRayquazaReFightDialogue_4); - SetupBossFightHP(RayquazaEntity,600,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(rayquazaEntity,600,MUS_BATTLE_WITH_RAYQUAZA); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void RayquazaPostStoryPreFightDialogue(void) { - Entity *LeaderEntity; - Entity *RayquazaEntity; + Entity *leaderEntity; + Entity *rayquazaEntity; - LeaderEntity = xxx_call_GetLeader(); - RayquazaEntity = GetEntityFromClientType(0xf); + leaderEntity = xxx_call_GetLeader(); + rayquazaEntity = GetEntityFromClientType(0xf); sub_8086448(); if (sub_8086AE4(MONSTER_RAYQUAZA)) { sub_80866C4(&gRayquazaPostStoryPreFightDialogue_6); @@ -1954,7 +2466,7 @@ void RayquazaPostStoryPreFightDialogue(void) else { PlaySoundEffect(0x1da); // Rayquaza Cry DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_1); - RayquazaDropInEffect(RayquazaEntity); + RayquazaDropInEffect(rayquazaEntity); DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_2); RayquazaScreenFlash(); DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_3); @@ -1962,8 +2474,8 @@ void RayquazaPostStoryPreFightDialogue(void) DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_4); RayquazaScreenFlash(); DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_5); - SetupBossFightHP(RayquazaEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(rayquazaEntity,600,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -2018,27 +2530,27 @@ void RayquazaScreenFlash(void) void sub_808970C(void) { - Entity *LeaderEntity; + Entity *leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); DungeonStartNewBGM(MUS_TINY_WOODS); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_808563C(sub_8089908); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y + -3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); } void sub_808974C(void) { - Entity *LeaderEntity; + Entity *leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_808563C(sub_80898F8); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y + -3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); } void sub_8089788(Entity *entity, u8 param_2, u8 param_3) @@ -2067,9 +2579,9 @@ void sub_8089788(Entity *entity, u8 param_2, u8 param_3) void sub_80897F0(void) { - Entity *LeaderEntity; + Entity *leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); sub_8086448(); sub_803E708(10,0x46); sub_808563C(SpriteShockEffect); @@ -2097,16 +2609,16 @@ void sub_80897F0(void) // Get 'em! It's frenzy time! DisplayDungeonDialogue(&gUnknown_8103D50); sub_803E708(10,0x46); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void sub_8089878(void) { - Entity *LeaderEntity; + Entity *leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); sub_8086448(); sub_803E708(10,0x46); sub_808563C(SpriteShockEffect); @@ -2117,7 +2629,7 @@ void sub_8089878(void) DisplayDungeonDialogue(&gUnknown_8103DD8); DisplayDungeonDialogue(&gUnknown_8103E28); sub_803E708(10,0x46); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void sub_80898E4(void) @@ -2138,10 +2650,10 @@ void sub_8089908(Entity *r0) void sub_8089914(void) { - Entity *LeaderEntity; + Entity *leaderEntity; Entity *MewtwoEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); MewtwoEntity = GetEntityFromClientType(0x11); DungeonStopBGM(); gDungeon->unk7 = 1; @@ -2150,16 +2662,16 @@ void sub_8089914(void) sub_80855E4(sub_8086A3C); SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); sub_8086A3C(MewtwoEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038,MONSTER_MEWTWO); } void sub_8089978(void) { - Entity *LeaderEntity; + Entity *leaderEntity; Entity *MewtwoEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); MewtwoEntity = GetEntityFromClientType(0x11); DungeonStopBGM(); sub_80854D4(); @@ -2174,7 +2686,7 @@ void sub_8089978(void) SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); sub_8086A3C(MewtwoEntity); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038,MONSTER_MEWTWO); } @@ -2188,10 +2700,10 @@ void sub_8089A00(u8 param_1, u8 param_2) void MewtwoPreFightDialogue(void) { - Entity *LeaderEntity; + Entity *leaderEntity; Entity *MewtwoEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); MewtwoEntity = GetEntityFromClientType(0x11); sub_8086448(); DisplayDungeonDialogue(&gMewtwoPreFightDialogue_1); @@ -2210,15 +2722,15 @@ void MewtwoPreFightDialogue(void) DisplayDungeonDialogue(&gMewtwoPreFightDialogue_5); sub_803E708(10,0x46); SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void MewtwoReFightDialogue(void) { - Entity *LeaderEntity; + Entity *leaderEntity; Entity *MewtwoEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); MewtwoEntity = GetEntityFromClientType(0x11); sub_8086448(); if(HasRecruitedMon(MONSTER_MEWTWO)) { @@ -2236,7 +2748,7 @@ void MewtwoReFightDialogue(void) MewtwoScreenFlash(); DisplayDungeonDialogue(&gMewtwoReFightDialogue_4); SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -2290,26 +2802,26 @@ void MewtwoScreenFlash(void) void sub_8089C44(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * EnteiEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_ENTEI); } void sub_8089C90(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * EnteiEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); @@ -2320,7 +2832,7 @@ void sub_8089C90(void) else { SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_ENTEI); } @@ -2334,10 +2846,10 @@ void sub_8089CFC(u8 param_1, u8 param_2) void EnteiPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * EnteiEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); EnteiScreenFlash(); DisplayDungeonDialogue(&gEnteiPreFightDialogue_1); @@ -2347,15 +2859,15 @@ void EnteiPreFightDialogue(void) DisplayDungeonDialogue(&gEnteiPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void EnteiReFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * EnteiEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); EnteiScreenFlash(); DisplayDungeonDialogue(&gEnteiReFightDialogue_1); @@ -2365,15 +2877,15 @@ void EnteiReFightDialogue(void) DisplayDungeonDialogue(&gEnteiReFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void EnteiPostStoryPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * EnteiEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); if (HasRecruitedMon(MONSTER_ENTEI)) { sub_80866C4(&gEnteiPostStoryPreFightDialogue_4); @@ -2387,7 +2899,7 @@ void EnteiPostStoryPreFightDialogue(void) DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -2419,42 +2931,42 @@ void EnteiScreenFlash(void) void sub_8089EFC(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * RaikouEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_RAIKOU); } void sub_8089F44(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * RaikouEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_RAIKOU); } void sub_8089F8C(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * RaikouEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); @@ -2465,7 +2977,7 @@ void sub_8089F8C(void) else { SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_RAIKOU); } @@ -2479,10 +2991,10 @@ void sub_8089FF0(u8 param_1, u8 param_2) void RaikouPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * RaikouEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); DisplayDungeonDialogue(&gRaikouPreFightDialogue_1); RaikouScreenFlash(); @@ -2499,15 +3011,15 @@ void RaikouPreFightDialogue(void) DisplayDungeonDialogue(&gRaikouPreFightDialogue_6); sub_803E708(10,70); SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void RaikouReFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * RaikouEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); gDungeon->weather.unkE265 = WEATHER_RAIN; sub_807EAA0(0,1); @@ -2519,15 +3031,15 @@ void RaikouReFightDialogue(void) DisplayDungeonDialogue(&gRaikouReFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void RaikouPostStoryPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * RaikouEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); if (HasRecruitedMon(MONSTER_RAIKOU)) { sub_80866C4(&gRaikouPostStoryPreFightDialogue_4); @@ -2542,7 +3054,7 @@ void RaikouPostStoryPreFightDialogue(void) DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -2574,10 +3086,10 @@ void RaikouScreenFlash(void) void sub_808A264(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * SuicuneEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); @@ -2585,31 +3097,31 @@ void sub_808A264(void) sub_80855E4(sub_8086A3C); SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); sub_8086A3C(SuicuneEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SUICUNE); } void sub_808A2C0(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * SuicuneEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SUICUNE); } void sub_808A308(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * SuicuneEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); @@ -2620,7 +3132,7 @@ void sub_808A308(void) else { SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SUICUNE); } @@ -2634,10 +3146,10 @@ void sub_808A36C(u8 param_1, u8 param_2) void SuicunePreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * SuicuneEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); sub_8086448(); DisplayDungeonDialogue(&gSuicunePreFightDialogue_1); @@ -2657,15 +3169,15 @@ void SuicunePreFightDialogue(void) DisplayDungeonDialogue(&gSuicunePreFightDialogue_7); sub_803E708(10,70); SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void SuicuneReFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * SuicuneEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); DisplayDungeonDialogue(&gSuicuneReFightDialogue_1); SuicuneScreenFlash(); @@ -2674,15 +3186,15 @@ void SuicuneReFightDialogue(void) DisplayDungeonDialogue(&gSuicuneReFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void SuicunePostStoryPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * SuicuneEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); if (HasRecruitedMon(MONSTER_SUICUNE)) { sub_80866C4(&gSuicunePostStoryPreFightDialogue_4); @@ -2695,7 +3207,7 @@ void SuicunePostStoryPreFightDialogue(void) DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -2749,10 +3261,10 @@ void SuicuneScreenFlash(void) void sub_808A608(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * HoOhEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); HoOhEntity = GetEntityFromClientType(0x15); DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); sub_80867F4(); @@ -2761,16 +3273,16 @@ void sub_808A608(void) sub_8085930(DIRECTION_NORTH); SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); sub_8086A3C(HoOhEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y + -6); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -6); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_HO_OH); } void sub_808A668(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * HoOhEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); HoOhEntity = GetEntityFromClientType(0x15); DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); sub_80867F4(); @@ -2784,7 +3296,7 @@ void sub_808A668(void) SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); sub_8086A3C(HoOhEntity); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 6); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 6); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_HO_OH); } @@ -2803,14 +3315,14 @@ void sub_808A718(void) void HoOhPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * HoOhEntity; Position32 local_14; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); HoOhEntity = GetEntityFromClientType(0x15); - local_14.x = LeaderEntity->pixelPos.x; - local_14.y = LeaderEntity->pixelPos.y + -0x1000; + local_14.x = leaderEntity->pixelPos.x; + local_14.y = leaderEntity->pixelPos.y + -0x1000; ShiftCameraToPosition(&local_14,0x88); sub_803E708(0x40,70); DisplayDungeonDialogue(&gHoOhPreFightDialogue_1); @@ -2837,20 +3349,20 @@ void HoOhPreFightDialogue(void) DisplayDungeonDialogue(&gHoOhPreFightDialogue_6); sub_803E708(10,70); SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void HoOhReFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * HoOhEntity; Position32 local_14; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); HoOhEntity = GetEntityFromClientType(0x15); - local_14.x = LeaderEntity->pixelPos.x; - local_14.y = LeaderEntity->pixelPos.y + -0x1000; + local_14.x = leaderEntity->pixelPos.x; + local_14.y = leaderEntity->pixelPos.y + -0x1000; ShiftCameraToPosition(&local_14,0x88); sub_803E708(0x40,70); if (HasRecruitedMon(MONSTER_HO_OH)) { @@ -2873,7 +3385,7 @@ void HoOhReFightDialogue(void) DisplayDungeonDialogue(&HoOhReFightDialogue_4); sub_803E708(10,70); SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -2927,49 +3439,49 @@ void HoOhScreenFlash(void) void sub_808A9E4(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * LatiosEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); LatiosEntity = GetEntityFromClientType(0x16); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(LatiosEntity, DIRECTION_NORTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 4); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 4); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_LATIOS); } void sub_808AA3C(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * LatiosEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); LatiosEntity = GetEntityFromClientType(0x16); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(LatiosEntity, DIRECTION_NORTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_LATIOS); } void sub_808AA94(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * LatiosEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); LatiosEntity = GetEntityFromClientType(0x16); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_8068FE0(LatiosEntity,0x21c,0); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_LATIOS); } @@ -2983,12 +3495,12 @@ void sub_808AAF0(u8 param_1, u8 param_2) void LatiosPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * LatiosEntity; Position32 local_18; Position local_19; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); LatiosEntity = GetEntityFromClientType(0x16); local_18.x = LatiosEntity->pixelPos.x; @@ -3011,15 +3523,15 @@ void LatiosPreFightDialogue(void) DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void LatiosReFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; Entity * LatiosEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); LatiosEntity = GetEntityFromClientType(0x16); sub_8086448(); sub_808692C(); @@ -3030,7 +3542,7 @@ void LatiosReFightDialogue(void) DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void sub_808AC3C(void) @@ -3063,11 +3575,11 @@ void LatiosScreenFlash(void) void sub_808ACC0(void) { - Entity * uVar2; + Entity * entity; if (HasRecruitedMon(MONSTER_REGIROCK)) { - uVar2 = GetEntityFromClientType(0x17); - sub_8068FE0(uVar2,0x21c,0); + entity = GetEntityFromClientType(0x17); + sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); sub_808B1CC(ITEM_ROCK_PART); @@ -3090,11 +3602,11 @@ void sub_808ACC0(void) void sub_808AD48(void) { - Entity * uVar2; + Entity * entity; if (HasRecruitedMon(MONSTER_REGICE)) { - uVar2 = GetEntityFromClientType(0x18); - sub_8068FE0(uVar2,0x21c,0); + entity = GetEntityFromClientType(0x18); + sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); sub_808B1CC(ITEM_ICE_PART); @@ -3118,11 +3630,11 @@ void sub_808AD48(void) void sub_808ADCC(void) { - Entity * uVar2; + Entity * entity; if (HasRecruitedMon(MONSTER_REGISTEEL)) { - uVar2 = GetEntityFromClientType(0x19); - sub_8068FE0(uVar2,0x21c,0); + entity = GetEntityFromClientType(0x19); + sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); sub_808B1CC(ITEM_STEEL_PART); @@ -3143,18 +3655,18 @@ void sub_808ADCC(void) } } -void sub_808AE54(char param_1,char param_2,u32 *param_3) +void sub_808AE54(u8 param_1,u8 param_2,Position *param_3) { - Entity * LeaderEntity; + Entity * leaderEntity; s16 IDStack[2]; Item item; - LeaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,LeaderEntity,0); - if ((sub_8098100(0x22) == 0) && (param_2 == 0x2E) && (param_1 == 0x17)) { + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_2 == 0x2E) && (param_1 == 0x17)) { sub_808B1CC(ITEM_NOTHING); - if (sub_8098100(0x1d) == 0) { + if (!sub_8098100(0x1d)) { xxx_init_itemslot_8090A8C(&item,ITEM_ROCK_PART,0); sub_80464C8(GetLeader(),param_3,&item); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); @@ -3166,18 +3678,18 @@ void sub_808AE54(char param_1,char param_2,u32 *param_3) } -void sub_808AEC8(char param_1,char param_2,u32 *param_3) +void sub_808AEC8(u8 param_1,u8 param_2,Position *param_3) { - Entity * LeaderEntity; + Entity * leaderEntity; s16 IDStack[2]; Item item; - LeaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,LeaderEntity,0); - if ((sub_8098100(0x22) == 0) && (param_2 == 0x2F) && (param_1 == 0x18)) { + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_2 == 0x2F) && (param_1 == 0x18)) { sub_808B1CC(ITEM_NOTHING); - if (sub_8098100(0x1d) == 0) { + if (!sub_8098100(0x1d)) { xxx_init_itemslot_8090A8C(&item,ITEM_ICE_PART,0); sub_80464C8(GetLeader(),param_3,&item); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); @@ -3188,18 +3700,18 @@ void sub_808AEC8(char param_1,char param_2,u32 *param_3) } } -void sub_808AF3C(char param_1,char param_2,u32 *param_3) +void sub_808AF3C(u8 param_1,u8 param_2,Position *param_3) { - Entity * LeaderEntity; + Entity * leaderEntity; s16 IDStack[2]; Item item; - LeaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,LeaderEntity,0); - if ((sub_8098100(0x22) == 0) && (param_2 == 0x30) && (param_1 == 0x19)) { + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_2 == 0x30) && (param_1 == 0x19)) { sub_808B1CC(ITEM_NOTHING); - if (sub_8098100(0x1d) == 0) { + if (!sub_8098100(0x1d)) { xxx_init_itemslot_8090A8C(&item,ITEM_STEEL_PART,0); sub_80464C8(GetLeader(),param_3, &item); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); @@ -3210,14 +3722,14 @@ void sub_808AF3C(char param_1,char param_2,u32 *param_3) } } -void sub_808AFB0(char param_1) +void sub_808AFB0(u8 param_1) { - Entity * LeaderEntity; + Entity * leaderEntity; s16 IDStack [2]; - LeaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,LeaderEntity,0); - if ((sub_8098100(0x22) == 0) && (param_1 == 0x2E) && (sub_8098100(0x1d) == 0) && (sub_80860A8(ITEM_ROCK_PART) != 0)) { + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_1 == 0x2E) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ROCK_PART) != 0)) { sub_8097FD0(0x1d); SetMessageArgument(gAvailablePokemonNames,GetLeader(),0); // {POKEMON_0} obtained the Rock Part that Regirock was guarding @@ -3228,14 +3740,14 @@ void sub_808AFB0(char param_1) } } -void sub_808B030(char param_1) +void sub_808B030(u8 param_1) { - Entity * LeaderEntity; + Entity * leaderEntity; s16 IDStack [2]; - LeaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,LeaderEntity,0); - if ((sub_8098100(0x22) == 0) && (param_1 == 0x2F) && (sub_8098100(0x1d) == 0) && (sub_80860A8(ITEM_ICE_PART) != 0)) { + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_1 == 0x2F) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ICE_PART) != 0)) { sub_8097FD0(0x1d); SetMessageArgument(gAvailablePokemonNames,GetLeader(),0); // {POKEMON_0} obtained the Ice Part that Regice was guarding @@ -3246,14 +3758,14 @@ void sub_808B030(char param_1) } } -void sub_808B0B0(char param_1) +void sub_808B0B0(u8 param_1) { - Entity * LeaderEntity; + Entity * leaderEntity; s16 IDStack [2]; - LeaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,LeaderEntity,0); - if ((sub_8098100(0x22) == 0) && (param_1 == 0x30) && (sub_8098100(0x1d) == 0) && (sub_80860A8(ITEM_STEEL_PART) != 0)) { + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_1 == 0x30) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_STEEL_PART) != 0)) { sub_8097FD0(0x1d); SetMessageArgument(gAvailablePokemonNames, GetLeader(), 0); // {POKEMON_0} obtained the Steel Part that Registeel was guarding @@ -3266,7 +3778,7 @@ void sub_808B0B0(char param_1) void RegirockPreFightDialogue(void) { - if (sub_8098100(0x22) == '\0') { + if (!sub_8098100(0x22)) { sub_8085930(DIRECTION_NORTH); // INTRUDER ALERT // EXTERMINATE @@ -3278,7 +3790,7 @@ void RegirockPreFightDialogue(void) void RegicePreFightDialogue(void) { - if (sub_8098100(0x22) == '\0') { + if (!sub_8098100(0x22)) { sub_8085930(DIRECTION_NORTH); // INTRUDER ALERT // EXTERMINATE @@ -3290,7 +3802,7 @@ void RegicePreFightDialogue(void) void RegisteelPreFightDialogue(void) { - if (sub_8098100(0x22) == '\0') { + if (!sub_8098100(0x22)) { sub_8085930(DIRECTION_NORTH); // INTRUDER ALERT // EXTERMINATE @@ -3357,45 +3869,45 @@ void SetupRegisteelFightHP(Entity *r0) void sub_808B2F4(void) { - Entity * LeaderEntity; - Entity * JirachiEntity; + Entity * leaderEntity; + Entity * jirachiEntity; - LeaderEntity = xxx_call_GetLeader(); - JirachiEntity = GetEntityFromClientType(0x1a); + leaderEntity = xxx_call_GetLeader(); + jirachiEntity = GetEntityFromClientType(0x1a); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); CreateJirachiWishWarpTile(); sub_8049ED4(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - SetFacingDirection(JirachiEntity, DIRECTION_SOUTH); - sub_8086A3C(JirachiEntity); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + SetFacingDirection(jirachiEntity, DIRECTION_SOUTH); + sub_8086A3C(jirachiEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_JIRACHI); } void sub_808B35C(void) { - Entity * LeaderEntity; - Entity * JirachiEntity; + Entity * leaderEntity; + Entity * jirachiEntity; - LeaderEntity = xxx_call_GetLeader(); - JirachiEntity = GetEntityFromClientType(0x1a); + leaderEntity = xxx_call_GetLeader(); + jirachiEntity = GetEntityFromClientType(0x1a); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); if (HasRecruitedMon(MONSTER_JIRACHI)) { - sub_8068FE0(JirachiEntity,0x21c,0); + sub_8068FE0(jirachiEntity,0x21c,0); } else { - SetFacingDirection(JirachiEntity, DIRECTION_SOUTH); - sub_8086A3C(JirachiEntity); + SetFacingDirection(jirachiEntity, DIRECTION_SOUTH); + sub_8086A3C(jirachiEntity); CreateJirachiWishWarpTile(); sub_8049ED4(); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_JIRACHI); } @@ -3426,43 +3938,43 @@ void sub_808B3E4(u8 param_1, u8 param_2, u8 param_3) void JirachiPreFightDialogue(void) { - Entity * LeaderEntity; - Entity * JirachiEntity; + Entity * leaderEntity; + Entity * jirachiEntity; - LeaderEntity = xxx_call_GetLeader(); - JirachiEntity = GetEntityFromClientType(0x1a); + leaderEntity = xxx_call_GetLeader(); + jirachiEntity = GetEntityFromClientType(0x1a); sub_8086448(); sub_803E708(0x40,70); DisplayDungeonDialogue(&gJirachiPreFightDialogue_1); sub_803E708(10,70); - SpriteLookAroundEffect(LeaderEntity); + SpriteLookAroundEffect(leaderEntity); sub_803E708(10,70); DisplayDungeonDialogue(&gJirachiPreFightDialogue_2); - sub_80861F8(0x37,JirachiEntity,1); + sub_80861F8(0x37,jirachiEntity,1); sub_80855E4(SpriteShockEffect); sub_803E708(0x3c,70); - JirachiDropInEffect(JirachiEntity); + JirachiDropInEffect(jirachiEntity); sub_803E708(0x5a,70); DisplayDungeonDialogue(&gJirachiPreFightDialogue_3); sub_803E708(10,70); DisplayDungeonDialogue(&gJirachiPreFightDialogue_4); sub_803E708(10,70); - SetupBossFightHP(JirachiEntity,0x15e,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + SetupBossFightHP(jirachiEntity,0x15e,MUS_BATTLE_WITH_RAYQUAZA); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } void sub_808B50C(void) { - Entity * JirachiEntity; + Entity * jirachiEntity; - JirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromClientType(0x1a); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_JIRACHI); sub_80855E4(sub_808BBA8); - sub_808BBA8(JirachiEntity); + sub_808BBA8(jirachiEntity); sub_8041888(0); - JirachiEntity->info->unk15C = 1; - JirachiEntity->info->unk15E = 0; - sub_80861B8(JirachiEntity,0xe,DIRECTION_SOUTH); + jirachiEntity->info->unk15C = 1; + jirachiEntity->info->unk15E = 0; + sub_80861B8(jirachiEntity,0xe,DIRECTION_SOUTH); DungeonFadeOutBGM(0x1e); sub_803E708(0x1e,70); // Fwaaaahhhh @@ -3473,7 +3985,7 @@ void sub_808B50C(void) // I'm sleepy so I'm going back to sleep. DisplayDungeonDialogue(&gUnknown_8105558); sub_803E708(10,70); - JirachiSpinEffect(JirachiEntity); + JirachiSpinEffect(jirachiEntity); DisplayDungeonDialogue(&gUnknown_81055F4); sub_803E708(10,70); gDungeon->unk2 = 1; @@ -3482,9 +3994,9 @@ void sub_808B50C(void) void JirachiWish(void) { u8 friendArea; - Entity *JirachiEntity; + Entity *jirachiEntity; Position *LeaderPos; - Entity *LeaderEntity; + Entity *leaderEntity; s32 wishChoice; s32 counter; u32 direction; @@ -3496,14 +4008,14 @@ void JirachiWish(void) Position pos2; Position pos3; - JirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromClientType(0x1a); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_JIRACHI); sub_80855E4(sub_808BBA8); - sub_808BBA8(JirachiEntity); + sub_808BBA8(jirachiEntity); sub_8041888(0); - JirachiEntity->info->unk15C = 1; - JirachiEntity->info->unk15E = 0; - sub_80861B8(JirachiEntity,0xe,DIRECTION_SOUTH); + jirachiEntity->info->unk15C = 1; + jirachiEntity->info->unk15E = 0; + sub_80861B8(jirachiEntity,0xe,DIRECTION_SOUTH); sub_80855E4(sub_80861A8); gDungeon->unk1356C = 1; DungeonFadeOutBGM(0x1e); @@ -3512,15 +4024,15 @@ void JirachiWish(void) sub_803E708(10,0x46); PlaySoundEffect(0x1a7); sub_803E708(0x96,0x46); - SpriteShockEffect(JirachiEntity); + SpriteShockEffect(jirachiEntity); DisplayDungeonDialogue(&gUnknown_8105674); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); sub_803E708(10,0x46); - sub_80856E0(JirachiEntity, DIRECTION_SOUTH); + sub_80856E0(jirachiEntity, DIRECTION_SOUTH); PlaySoundEffect(0x16a); DisplayDungeonDialogue(&gUnknown_81056B8); sub_803E708(10,0x46); - SpriteLookAroundEffect(JirachiEntity); + SpriteLookAroundEffect(jirachiEntity); DisplayDungeonDialogue(&gUnknown_81056DC); sub_803E708(10,0x46); while( 1 ) { @@ -3540,7 +4052,7 @@ void JirachiWish(void) // Lots of Money DisplayDungeonDialogue(&gUnknown_810581C); sub_803E708(10,0x46); - JirachiWishGrantDialogue(JirachiEntity); + JirachiWishGrantDialogue(jirachiEntity); for(counter = 0; counter < 6; counter = r8) { @@ -3549,21 +4061,21 @@ void JirachiWish(void) { sub_8045C28(&auStack152[index], ITEM_POKE, 0); } - pos1.x = (JirachiEntity->pos.x + DungeonRandInt(3) - 1); - pos1.y = (JirachiEntity->pos.y + DungeonRandInt(3) + -1); + pos1.x = (jirachiEntity->pos.x + DungeonRandInt(3) - 1); + pos1.y = (jirachiEntity->pos.y + DungeonRandInt(3) + -1); if ((GetTileSafe(pos1.x, pos1.y)->terrainType & 3) != 0) { PlaySoundEffect(0x14c); sub_808BB3C(&pos1); - sub_8046860(JirachiEntity,&pos1,auStack152,9); + sub_8046860(jirachiEntity,&pos1,auStack152,9); } } - JirachiEntity->info->unk15D = 0; + jirachiEntity->info->unk15D = 0; } if (wishChoice == 2) { // Lots of Items DisplayDungeonDialogue(&gUnknown_8105974); sub_803E708(10,0x46); - JirachiWishGrantDialogue(JirachiEntity); + JirachiWishGrantDialogue(jirachiEntity); for(counter = 0; counter < 6; counter++) { @@ -3574,16 +4086,16 @@ void JirachiWish(void) { sub_8045C28(&itemStack[index], sub_803D73C(0),0); } - pos2.x = (JirachiEntity->pos.x + DungeonRandInt(3) - 1); - pos2.y = (JirachiEntity->pos.y + DungeonRandInt(3) + -1); + pos2.x = (jirachiEntity->pos.x + DungeonRandInt(3) - 1); + pos2.y = (jirachiEntity->pos.y + DungeonRandInt(3) + -1); if ((GetTileSafe(pos2.x, pos2.y)->terrainType & 3) != 0) { PlaySoundEffect(400); sub_808BB3C(&pos2); - sub_8046860(JirachiEntity,&pos2,itemStack,9); + sub_8046860(jirachiEntity,&pos2,itemStack,9); } } - JirachiEntity->info->unk15D = 0; + jirachiEntity->info->unk15D = 0; } if (wishChoice == 3) @@ -3602,13 +4114,13 @@ void JirachiWish(void) // You want a friend area? As you wish.. DisplayDungeonDialogue(&gUnknown_8105AD4); sub_803E708(10,0x46); - JirachiWishGrantDialogue(JirachiEntity); - JirachiEntity->info->unk15D = 0; + JirachiWishGrantDialogue(jirachiEntity); + jirachiEntity->info->unk15D = 0; DisplayDungeonDialogue(&gUnknown_8105B20); UnlockFriendArea(friendArea); PlaySoundEffect(0xd4); - LeaderEntity = GetLeader(); - SetMessageArgument(gAvailablePokemonNames,LeaderEntity,0); + leaderEntity = GetLeader(); + SetMessageArgument(gAvailablePokemonNames,leaderEntity,0); WriteFriendAreaName(gFormatItems,friendArea,FALSE); // Obtained the friend area! DisplayDungeonDialogue(&gUnknown_8105B68); @@ -3618,7 +4130,7 @@ void JirachiWish(void) // More Strength.. DisplayDungeonDialogue(&gUnknown_8105BA8); sub_803E708(10,0x46); - JirachiWishGrantDialogue(JirachiEntity); + JirachiWishGrantDialogue(jirachiEntity); for(counter = 0; counter < 5; counter++) { @@ -3628,16 +4140,16 @@ void JirachiWish(void) sub_8045C28(&strengthItems[index],gUnknown_81074FC[DungeonRandInt(8)],0); } - pos3.x = (JirachiEntity->pos.x + DungeonRandInt(3) - 1); - pos3.y = (JirachiEntity->pos.y + DungeonRandInt(3) + -1); + pos3.x = (jirachiEntity->pos.x + DungeonRandInt(3) - 1); + pos3.y = (jirachiEntity->pos.y + DungeonRandInt(3) + -1); if ((GetTileSafe(pos3.x, pos3.y)->terrainType & 3) != 0) { PlaySoundEffect(400); sub_808BB3C(&pos3); - sub_8046860(JirachiEntity,&pos3,strengthItems,4); + sub_8046860(jirachiEntity,&pos3,strengthItems,4); } } - JirachiEntity->info->unk15D = 0; + jirachiEntity->info->unk15D = 0; DisplayDungeonDialogue(&gUnknown_8105BF4); sub_803E708(10,0x46); } @@ -3645,13 +4157,13 @@ void JirachiWish(void) // Something Good... DisplayDungeonDialogue(&gUnknown_8105D2C); sub_803E708(10,0x46); - JirachiWishGrantDialogue(JirachiEntity); - JirachiEntity->info->unk15D = 0; + JirachiWishGrantDialogue(jirachiEntity); + jirachiEntity->info->unk15D = 0; DisplayDungeonDialogue(&gUnknown_8105D80); sub_803E708(10,0x46); LeaderPos = &GetLeader()->pos; - direction = GetDirectionTowardsPosition(&JirachiEntity->pos,LeaderPos); - SetFacingDirection(JirachiEntity,direction); + direction = GetDirectionTowardsPosition(&jirachiEntity->pos,LeaderPos); + SetFacingDirection(jirachiEntity,direction); sub_803E708(10,0x46); DisplayDungeonDialogue(&gUnknown_8105D9C); sub_803E708(10,0x46); @@ -3661,7 +4173,7 @@ void JirachiWish(void) } DisplayDungeonDialogue(&gUnknown_81058E0); - JirachiSpinEffect(JirachiEntity); + JirachiSpinEffect(jirachiEntity); sub_803E708(10,0x46); DisplayDungeonDialogue(&gUnknown_810593C); sub_803E708(10,0x46); @@ -3711,22 +4223,22 @@ void JirachiWishGrantFlash(void) sub_8085EB0(); } -void sub_808BB3C(Position *param_1) +void sub_808BB3C(Position *pos1) { #ifndef NONMATCHING register s32 iVar1 asm("r0"); #else s32 iVar1; #endif - Position local_8; + Position newPos; - iVar1 = param_1->x * 0x1800 + 0xc00; - local_8.x = iVar1 / 256; + iVar1 = pos1->x * 0x1800 + 0xc00; + newPos.x = iVar1 / 256; - iVar1 = param_1->y * 0x1800 + 0x1000; + iVar1 = pos1->y * 0x1800 + 0x1000; - local_8.y = iVar1 / 256; - sub_8085EC8(100,0,0,&local_8,0); + newPos.y = iVar1 / 256; + sub_8085EC8(100,0,0,&newPos,0); } void sub_808BBA8(Entity *jirachiEntity) @@ -3857,28 +4369,28 @@ u8 JirachiFriendAreaSearch(void) void sub_808BDEC(void) { - Entity * LeaderEntity; - Entity * LugiaEntity; + Entity * leaderEntity; + Entity * lugiaEntity; - LeaderEntity = xxx_call_GetLeader(); - LugiaEntity = GetEntityFromClientType(0x1b); + leaderEntity = xxx_call_GetLeader(); + lugiaEntity = GetEntityFromClientType(0x1b); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); if (HasRecruitedMon(MONSTER_LUGIA)) { DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); - sub_8068FE0(LugiaEntity,0x21c,0); + sub_8068FE0(lugiaEntity,0x21c,0); } else { gDungeon->unk7 = 1; - SetFacingDirection(LugiaEntity, DIRECTION_SOUTH); + SetFacingDirection(lugiaEntity, DIRECTION_SOUTH); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_LUGIA); } -void sub_808BE70(u8 param_1,u8 param_2) +void sub_808BE70(u8 param_1,u8 param_2,u8 param_3) { if ((param_2 == 0x33) && (param_1 == 0x1B)) { gDungeon->unk2 = 1; @@ -3888,11 +4400,11 @@ void sub_808BE70(u8 param_1,u8 param_2) void LugiaPreFightDialogue(void) { - Entity * LeaderEntity; - Entity * LugiaEntity; + Entity * leaderEntity; + Entity * lugiaEntity; - LeaderEntity = xxx_call_GetLeader(); - LugiaEntity = GetEntityFromClientType(0x1b); + leaderEntity = xxx_call_GetLeader(); + lugiaEntity = GetEntityFromClientType(0x1b); if (HasRecruitedMon(MONSTER_LUGIA)) { sub_8086448(); sub_80866C4(&gLugiaPreFightDialogue_8); @@ -3909,21 +4421,21 @@ void LugiaPreFightDialogue(void) sub_803E708(10,0x46); DisplayDungeonDialogue(&gLugiaPreFightDialogue_4); PlaySoundEffect(0x1f8); - sub_80861D4(LugiaEntity,0xd,DIRECTION_SOUTH); + sub_80861D4(lugiaEntity,0xd,DIRECTION_SOUTH); sub_803E708(0x2b,0x46); - sub_80861B8(LugiaEntity,0,DIRECTION_SOUTH); + sub_80861B8(lugiaEntity,0,DIRECTION_SOUTH); DisplayDungeonDialogue(&gLugiaPreFightDialogue_5); LugiaScreenFlash(); DisplayDungeonDialogue(&gLugiaPreFightDialogue_6); LugiaScreenFlash2(); SetDungeonBGColorRGB(0xffffff06,0xffffff06,0xffffff06,1,0); DungeonStopBGM(); - sub_80861D4(LugiaEntity,7,DIRECTION_SOUTH); + sub_80861D4(lugiaEntity,7,DIRECTION_SOUTH); DisplayDungeonDialogue(&gLugiaPreFightDialogue_7); LugiaScreenFlash(); - SetupBossFightHP(LugiaEntity,800,MUS_BATTLE_WITH_RAYQUAZA); + SetupBossFightHP(lugiaEntity,800,MUS_BATTLE_WITH_RAYQUAZA); DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -3994,25 +4506,25 @@ void sub_808C0CC(void) void sub_808C10C(void) { - Entity * LeaderEntity; - Entity * KyogreEntity; + Entity * leaderEntity; + Entity * kyogreEntity; u32 XPos; s32 YPos; - LeaderEntity = xxx_call_GetLeader(); - KyogreEntity = GetEntityFromClientType(0x1c); + leaderEntity = xxx_call_GetLeader(); + kyogreEntity = GetEntityFromClientType(0x1c); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); if (HasRecruitedMon(MONSTER_KYOGRE)) { - sub_8068FE0(KyogreEntity,0x21c,0); + sub_8068FE0(kyogreEntity,0x21c,0); } else { gDungeon->unk7 = 1; - SetFacingDirection(KyogreEntity, DIRECTION_SOUTH); + SetFacingDirection(kyogreEntity, DIRECTION_SOUTH); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos + -0x1000); @@ -4021,7 +4533,7 @@ void sub_808C10C(void) CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_GROUDON); } -void sub_808C1A4(u8 param_1,u8 param_2) +void sub_808C1A4(u8 param_1,u8 param_2,u8 param_3) { if ((param_2 == 0x34) && (param_1 == 0x1C)) { gDungeon->unk2 = 1; @@ -4031,15 +4543,15 @@ void sub_808C1A4(u8 param_1,u8 param_2) void KyogrePreFightDialogue(void) { - Entity *LeaderEntity; + Entity *leaderEntity; Entity *KyogreEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); KyogreEntity = GetEntityFromClientType(0x1c); DungeonStopBGM(); if (HasRecruitedMon(MONSTER_KYOGRE)) { DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c); - SpriteLookAroundEffect(LeaderEntity); + SpriteLookAroundEffect(leaderEntity); sub_803E708(10,0x46); DisplayDungeonDialogue(&gKyogrePreFightDialogue_8); sub_803E708(10,0x46); @@ -4073,7 +4585,7 @@ void KyogrePreFightDialogue(void) sub_803E708(10,0x46); SetupBossFightHP(KyogreEntity,600,MUS_BOSS_BATTLE); DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -4116,9 +4628,9 @@ void sub_808C360(void) void sub_808C3A0(void) { - Entity * LeaderEntity; + Entity * leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -4130,11 +4642,11 @@ void sub_808C3A0(void) gDungeon->unk7 = 1; sub_808563C(SetupDeoxysFacingDirection); } - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y - 3); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_DEOXYS_NORMAL); } -void sub_808C414(u8 param_1,u8 param_2) +void sub_808C414(u8 param_1,u8 param_2,u8 param_3) { if ((param_2 == 0x35) && (param_1 == 0x1D)) { gDungeon->unk2 = 1; @@ -4144,9 +4656,9 @@ void sub_808C414(u8 param_1,u8 param_2) void DeoxysPreFightDialogue(void) { - Entity * LeaderEntity; + Entity * leaderEntity; - LeaderEntity = xxx_call_GetLeader(); + leaderEntity = xxx_call_GetLeader(); sub_8086448(); if (HasRecruitedMon(MONSTER_DEOXYS_NORMAL)) { // There appears to be no one here. @@ -4164,7 +4676,7 @@ void DeoxysPreFightDialogue(void) DisplayDungeonDialogue(&gDeoxysPreFightDialogue_4); sub_803E708(10,0x46); sub_808563C(SetupDeoxysFightHP); - ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); } } @@ -4218,51 +4730,51 @@ void SetupDeoxysFightHP(Entity *deoxysEntity) void sub_808C5C0(void) { - Entity * LeaderEntity; - Entity * CelebiEntity; + Entity * leaderEntity; + Entity * celebiEntity; u32 XPos; s32 YPos; - LeaderEntity = xxx_call_GetLeader(); - CelebiEntity = GetEntityFromClientType(0x1e); + leaderEntity = xxx_call_GetLeader(); + celebiEntity = GetEntityFromClientType(0x1e); DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); sub_80854D4(); sub_8085930(DIRECTION_NORTH); - SetFacingDirection(CelebiEntity, DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x,LeaderEntity->pos.y); + SetFacingDirection(celebiEntity, DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); XPos = GetCameraXPos(); YPos = GetCameraYPos(); - sub_803F878(XPos,YPos + 0xfffff000); + sub_803F878(XPos,YPos - 0x1000); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_CELEBI); } -void nullsub_100(u8 r0, u8 r1, u32 r2) +void nullsub_100(u8 r0, u8 r1, u8 r3) { } void CelebiJoinDialogue(void) { - Entity *LeaderEntity; + Entity *leaderEntity; s32 state; s32 menuChoice; - Entity *CelebiEntity; + Entity *celebiEntity; - LeaderEntity = xxx_call_GetLeader(); - CelebiEntity = GetEntityFromClientType(0x1e); - if ((HasRecruitedMon(MONSTER_CELEBI)) || (sub_806FD18(CelebiEntity) == '\0')) + leaderEntity = xxx_call_GetLeader(); + celebiEntity = GetEntityFromClientType(0x1e); + if ((HasRecruitedMon(MONSTER_CELEBI)) || (!sub_806FD18(celebiEntity))) { - sub_8068FE0(CelebiEntity,0x21c,0); - SpriteLookAroundEffect(LeaderEntity); + sub_8068FE0(celebiEntity,0x21c,0); + SpriteLookAroundEffect(leaderEntity); sub_803E708(10,0x46); // ......... DisplayDungeonDialogue(&gCelebiJoinDialogue_10); } else { - SpriteLookAroundEffect(LeaderEntity); + SpriteLookAroundEffect(leaderEntity); sub_803E708(10,0x46); - SpriteShockEffect(LeaderEntity); + SpriteShockEffect(leaderEntity); sub_803E708(10,0x46); // Oh? There's someone there. DisplayDungeonDialogue(&gCelebiJoinDialogue_1); @@ -4274,12 +4786,12 @@ void CelebiJoinDialogue(void) // The Time-Traveling Pokemon {POKEMON_2} (Celebi)! DisplayDungeonDialogue(&gCelebiJoinDialogue_2); PlaySoundEffect(0x1c7); - sub_806CDD4(CelebiEntity,10,DIRECTION_SOUTH); + sub_806CDD4(celebiEntity,10,DIRECTION_SOUTH); sub_803E708(0x14,0x46); - sub_806CE68(CelebiEntity, DIRECTION_SOUTH); + sub_806CE68(celebiEntity, DIRECTION_SOUTH); sub_803E708(4,0x46); PlaySoundEffect(0x1c7); - sub_806CDD4(CelebiEntity,10,DIRECTION_SOUTH); + sub_806CDD4(celebiEntity,10,DIRECTION_SOUTH); DisplayDungeonDialogue(&gCelebiJoinDialogue_3); sub_803E708(10,0x46); state = 0; @@ -4305,7 +4817,7 @@ void CelebiJoinDialogue(void) } DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); PlaySoundEffect(0x1c7); - sub_80861D4(CelebiEntity,0xd,DIRECTION_SOUTH); + sub_80861D4(celebiEntity,0xd,DIRECTION_SOUTH); sub_803E708(0x37,0x46); PlaySoundEffect(0x1d5); sub_803E708(0x1a,0x46); @@ -4313,12 +4825,12 @@ void CelebiJoinDialogue(void) sub_803E708(0x1c,0x46); DisplayDungeonDialogue(&gCelebiJoinDialogue_4); sub_803E708(10,0x46); - sub_806FDF4(LeaderEntity,CelebiEntity,&CelebiEntity); + sub_806FDF4(leaderEntity,celebiEntity,&celebiEntity); DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); DisplayDungeonDialogue(&gCelebiJoinDialogue_5); sub_803E708(10,0x46); PlaySoundEffect(0x1c7); - sub_80861D4(CelebiEntity,0xd,DIRECTION_SOUTH); + sub_80861D4(celebiEntity,0xd,DIRECTION_SOUTH); sub_803E708(0x37,0x46); PlaySoundEffect(0x1d5); sub_803E708(0x1a,0x46); @@ -4346,13 +4858,13 @@ void CelebiJoinDialogue(void) { sub_803E708(10,0x46); DisplayDungeonDialogue(&gCelebiJoinDialogue_7); - sub_80861F8(0x3e,CelebiEntity,1); + sub_80861F8(0x3e,celebiEntity,1); sub_803E708(0x18,0x46); - sub_80861F8(0x3e,CelebiEntity,1); + sub_80861F8(0x3e,celebiEntity,1); sub_803E708(0xe,0x46); DisplayDungeonDialogue(&gCelebiJoinDialogue_8); sub_803E708(10,0x46); - sub_808C8E0(CelebiEntity); + sub_808C8E0(celebiEntity); DisplayDungeonDialogue(&gCelebiJoinDialogue_9); sub_803E708(10,0x46); state = 2; @@ -4366,21 +4878,21 @@ void CelebiJoinDialogue(void) gDungeon->unk2 = 1; } -void sub_808C8E0(Entity *param_1) +void sub_808C8E0(Entity *entity) { s32 iVar1; PlaySoundEffect(0x1a5); - sub_806CDD4(param_1, 0, DIRECTION_SOUTH); + sub_806CDD4(entity, 0, DIRECTION_SOUTH); for(iVar1 = 0; iVar1 < 16; iVar1++){ - param_1->info->unk174 = iVar1 * 256; + entity->info->unk174 = iVar1 * 256; sub_803E46C(0x46); } for(iVar1 = 16; iVar1 < 200; iVar1 += 4){ - param_1->info->unk174 = iVar1 * 256; + entity->info->unk174 = iVar1 * 256; sub_803E46C(0x46); } - sub_8086A3C(param_1); + sub_8086A3C(entity); } void sub_808C938(void) @@ -4425,33 +4937,32 @@ void sub_808C9B0(Entity *param_1) void sub_808C9C4(void) { - Entity *LeaderEntity; - Entity *MedichamEntity; + Entity *leaderEntity; + Entity *medichamEntity; - LeaderEntity = xxx_call_GetLeader(); - MedichamEntity = GetEntityFromClientType(7); + leaderEntity = xxx_call_GetLeader(); + medichamEntity = GetEntityFromClientType(7); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - SetFacingDirection(MedichamEntity, DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x, LeaderEntity->pos.y - 3); + SetFacingDirection(medichamEntity, DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_MEDICHAM); } -// Medicham Rescue Dialogue? void MedichamRescueDialogue(void) { - Entity *MedichamEntity; + Entity *medichamEntity; s32 counter; - MedichamEntity = GetEntityFromClientType(7); - SpriteLookAroundEffect(MedichamEntity); + medichamEntity = GetEntityFromClientType(7); + SpriteLookAroundEffect(medichamEntity); sub_803E708(0xA, 0x46); // Oh my I can't seem to find a way out... DisplayDungeonDialogue(&gMedichamRescueDialogue_1); sub_803E708(0xA, 0x46); - sub_80869E4(MedichamEntity, 4, 2, 4); + sub_80869E4(medichamEntity, 4, 2, DIRECTION_NORTH); sub_803E708(0xA, 0x46); // What am I to do...? DisplayDungeonDialogue(&gMedichamRescueDialogue_2); @@ -4459,18 +4970,18 @@ void MedichamRescueDialogue(void) sub_8086448(); sub_8086598(); sub_803E708(0x20, 0x46); - SpriteShockEffect(MedichamEntity); + SpriteShockEffect(medichamEntity); sub_803E708(0x20, 0x46); - sub_80869E4(MedichamEntity, 4, 2, 0); + sub_80869E4(medichamEntity, 4, 2, DIRECTION_SOUTH); DisplayDungeonDialogue(&gMedichamRescueDialogue_3); sub_803E708(0xA, 0x46); PlaySoundEffect(0x1c7); - sub_806CDD4(MedichamEntity, 0xA, DIRECTION_SOUTH); + sub_806CDD4(medichamEntity, 0xA, DIRECTION_SOUTH); sub_803E708(0x14, 0x46); - sub_806CE68(MedichamEntity, DIRECTION_SOUTH); + sub_806CE68(medichamEntity, DIRECTION_SOUTH); sub_803E708(0x4, 0x46); PlaySoundEffect(0x1c7); - sub_806CDD4(MedichamEntity, 0xA, DIRECTION_SOUTH); + sub_806CDD4(medichamEntity, 0xA, DIRECTION_SOUTH); sub_803E708(0x14, 0x46); // Yes Yes // I am so lucky @@ -4478,32 +4989,32 @@ void MedichamRescueDialogue(void) // There appears to be no one here DisplayDungeonDialogue(&gMedichamRescueDialogue_4); sub_803E708(0xA, 0x46); - sub_806CDD4(MedichamEntity, 0, DIRECTION_SOUTH); + sub_806CDD4(medichamEntity, 0, DIRECTION_SOUTH); for(counter = 0x17; counter >= 0; counter--) { - IncreaseEntityPixelPos(MedichamEntity, 0, 0x80 << 1); + IncreaseEntityPixelPos(medichamEntity, 0, 0x100); sub_803E46C(0x46); } - sub_806CE68(MedichamEntity, DIRECTION_SOUTH); + sub_806CE68(medichamEntity, DIRECTION_SOUTH); sub_803E708(0x20, 0x46); - sub_8042B0C(MedichamEntity); - sub_8068FE0(MedichamEntity, 0x21C, 0); + sub_8042B0C(medichamEntity); + sub_8068FE0(medichamEntity, 0x21C, 0); gDungeon->unk4 = 1; gDungeon->unk11 = 4; } void sub_808CB5C(void) { - Entity *LeaderEntity; - Entity *MedichamEntity; + Entity *leaderEntity; + Entity *medichamEntity; - LeaderEntity = xxx_call_GetLeader(); - MedichamEntity = GetEntityFromClientType(7); + leaderEntity = xxx_call_GetLeader(); + medichamEntity = GetEntityFromClientType(7); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); - sub_8068FE0(MedichamEntity, 0x21C, 0); - sub_8085860(LeaderEntity->pos.x, LeaderEntity->pos.y); + sub_8068FE0(medichamEntity, 0x21C, 0); + sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_MEDICHAM); } @@ -4513,34 +5024,33 @@ void DummyFightDialogue(void) void sub_808CBB0(void) { - Entity *LeaderEntity; - Entity *SmeargleEntity; + Entity *leaderEntity; + Entity *smeargleEntity; - LeaderEntity = xxx_call_GetLeader(); - SmeargleEntity = GetEntityFromClientType(0x1F); + leaderEntity = xxx_call_GetLeader(); + smeargleEntity = GetEntityFromClientType(0x1F); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - SetFacingDirection(SmeargleEntity, DIRECTION_SOUTH); - sub_8085860(LeaderEntity->pos.x, LeaderEntity->pos.y - 3); + SetFacingDirection(smeargleEntity, DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SMEARGLE); } -// Smeargle Rescue dialogue scene void SmeargleRescueDialogue(void) { - Entity *SmeargleEntity; + Entity *smeargleEntity; s32 counter; - SmeargleEntity = GetEntityFromClientType(0x1F); - SpriteLookAroundEffect(SmeargleEntity); + smeargleEntity = GetEntityFromClientType(0x1F); + SpriteLookAroundEffect(smeargleEntity); sub_803E708(0xA, 0x46); // Ohhh... // I've lost my bearings DisplayDungeonDialogue(&gSmeargleRescueDialogue_1); sub_803E708(0xA, 0x46); - sub_80869E4(SmeargleEntity, 4, 2, 4); + sub_80869E4(smeargleEntity, 4, 2, DIRECTION_NORTH); sub_803E708(0xA, 0x46); // I can't get out... // I'm hungry... @@ -4550,34 +5060,34 @@ void SmeargleRescueDialogue(void) sub_8086448(); sub_8086598(); sub_803E708(0x20, 0x46); - SpriteShockEffect(SmeargleEntity); + SpriteShockEffect(smeargleEntity); sub_803E708(0x20, 0x46); - sub_80869E4(SmeargleEntity, 4, 2, 0); + sub_80869E4(smeargleEntity, 4, 2, DIRECTION_SOUTH); // Oh! You are? DisplayDungeonDialogue(&gSmeargleRescueDialogue_3); sub_803E708(0xA, 0x46); PlaySoundEffect(0x1c7); - sub_806CDD4(SmeargleEntity, 0xA, DIRECTION_SOUTH); + sub_806CDD4(smeargleEntity, 0xA, DIRECTION_SOUTH); sub_803E708(0x14, 0x46); - sub_806CE68(SmeargleEntity, DIRECTION_SOUTH); + sub_806CE68(smeargleEntity, DIRECTION_SOUTH); sub_803E708(0x4, 0x46); PlaySoundEffect(0x1c7); - sub_806CDD4(SmeargleEntity, 0xA, DIRECTION_SOUTH); + sub_806CDD4(smeargleEntity, 0xA, DIRECTION_SOUTH); sub_803E708(0x14, 0x46); // Did you maybe come to rescue me? // Am I glad to see you DisplayDungeonDialogue(&gSmeargleRescueDialogue_4); sub_803E708(0xA, 0x46); - sub_806CDD4(SmeargleEntity, 0, DIRECTION_SOUTH); + sub_806CDD4(smeargleEntity, 0, DIRECTION_SOUTH); for(counter = 0x17; counter >= 0; counter--) { - IncreaseEntityPixelPos(SmeargleEntity, 0, 0x80 << 1); + IncreaseEntityPixelPos(smeargleEntity, 0, 0x100); sub_803E46C(0x46); } - sub_806CE68(SmeargleEntity, DIRECTION_SOUTH); + sub_806CE68(smeargleEntity, DIRECTION_SOUTH); sub_803E708(0x20, 0x46); - sub_8042B0C(SmeargleEntity); - sub_8068FE0(SmeargleEntity, 0x21C, 0); + sub_8042B0C(smeargleEntity); + sub_8068FE0(smeargleEntity, 0x21C, 0); gDungeon->unk4 = 1; gDungeon->unk11 = 4; @@ -4585,21 +5095,21 @@ void SmeargleRescueDialogue(void) void sub_808CD44(void) { - Entity *LeaderEntity; - Entity *SmeargleEntity; + Entity *leaderEntity; + Entity *smeargleEntity; - LeaderEntity = xxx_call_GetLeader(); - SmeargleEntity = GetEntityFromClientType(0x1F); + leaderEntity = xxx_call_GetLeader(); + smeargleEntity = GetEntityFromClientType(0x1F); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); - sub_8068FE0(SmeargleEntity, 540, 0); - sub_8085860(LeaderEntity->pos.x, LeaderEntity->pos.y - 3); + sub_8068FE0(smeargleEntity, 540, 0); + sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); CopyMonsterNametoBuffer(gUnknown_202E038, MONSTER_SMEARGLE); } -void sub_808CD9C(u8 r0) +void sub_808CD9C(void) { sub_8086448(); // There appears to be no one here. diff --git a/src/ground_map_1.c b/src/ground_map_1.c index e2286d293..032b87125 100644 --- a/src/ground_map_1.c +++ b/src/ground_map_1.c @@ -1,5 +1,6 @@ #include "global.h" #include "debug.h" +#include "event_flag.h" #include "ground_main.h" #include "ground_map_1.h" #include "ground_script.h" @@ -94,3 +95,27 @@ bool8 sub_80A4D48(s16 index) if (gGroundConversion_811BAF4[index].unk0 != 8) return TRUE; return FALSE; } + +s32 GetAdjustedGroundMap(s16 param_1) +{ + s32 iVar5; + + iVar5 = param_1; + + switch(iVar5) + { + case 9: + case 0xC: + iVar5 = (s16)(iVar5 + ((GetScriptVarValue(NULL, BASE_KIND) * 6) + GetScriptVarValue(NULL, BASE_LEVEL))); + break; + case 2: + if (sub_80023E4(6)) { + iVar5 = 3; + } + break; + default: + break; + } + + return iVar5; +} diff --git a/src/wonder_mail_3_1.c b/src/wonder_mail_3_1.c deleted file mode 100644 index 3f84bed0f..000000000 --- a/src/wonder_mail_3_1.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "global.h" -#include "code_80A26CC.h" - -bool8 sub_802FCF0(void) -{ - s32 i; - - for (i = 0; i < 0x2E; i++) { - if (sub_80A27CC(i)) - return FALSE; - } - - return TRUE; -} \ No newline at end of file diff --git a/src/wonder_mail_5.c b/src/wonder_mail_5.c index 081ae3a27..d0317dfea 100644 --- a/src/wonder_mail_5.c +++ b/src/wonder_mail_5.c @@ -141,7 +141,7 @@ void sub_8030E48(void) case WONDER_MAIL_TYPE_AOK: stack.mailDescriptionType = 10; break; - case 5: + case WONDER_MAIL_TYPE_THANK_YOU: stack.mailDescriptionType = 11; break; case WONDER_MAIL_TYPE_NONE: