diff --git a/asm/code_2.s b/asm/code_2.s index 0eaed6f9b..499f7d72c 100644 --- a/asm/code_2.s +++ b/asm/code_2.s @@ -169,7 +169,7 @@ QuickSave: movs r1, 0 movs r2, 0 movs r3, 0x20 - bl xxx_info_box_80141B4 + bl CreateDialogueBoxAndPortrait b _08000892 .align 2, 0 _080007AC: .4byte gUnknown_2026E4E @@ -234,7 +234,7 @@ _08000822: movs r1, 0 movs r2, 0 ldr r3, _08000838 - bl xxx_info_box_80141B4 + bl CreateDialogueBoxAndPortrait movs r6, 0x3C movs r4, 0x1 b _08000892 @@ -248,7 +248,7 @@ _0800083C: movs r1, 0 movs r2, 0 movs r3, 0 - bl xxx_info_box_80141B4 + bl CreateDialogueBoxAndPortrait movs r4, 0x3 b _08000892 .align 2, 0 @@ -258,7 +258,7 @@ _08000854: movs r1, 0 movs r2, 0 ldr r3, _08000868 - bl xxx_info_box_80141B4 + bl CreateDialogueBoxAndPortrait _08000860: movs r4, 0x2 b _08000892 @@ -358,7 +358,7 @@ _08000934: movs r1, 0 movs r2, 0 movs r3, 0x20 - bl xxx_info_box_80141B4 + bl CreateDialogueBoxAndPortrait movs r4, 0x2 b _080009A2 .align 2, 0 @@ -374,7 +374,7 @@ _08000952: ldr r3, _08000964 movs r1, 0 movs r2, 0 - bl xxx_info_box_80141B4 + bl CreateDialogueBoxAndPortrait _0800095C: movs r4, 0x1 b _080009A2 diff --git a/asm/code_800F990.s b/asm/code_800F990.s index 1cd89a760..983e35980 100644 --- a/asm/code_800F990.s +++ b/asm/code_800F990.s @@ -2325,9 +2325,9 @@ sub_8010C10: str r1, [sp, 0x10] movs r1, 0 movs r3, 0 - bl sub_8014248 + bl CreateMenuDialogueBoxAndPortrait _08010C2C: - bl xxx_draw_string_80144C4 + bl DrawDialogueBoxString bl sub_8010960 add r0, sp, 0x14 bl sub_80144A4 diff --git a/asm/code_80140DC.s b/asm/code_80140DC.s index 2edf8e45f..84135d85c 100644 --- a/asm/code_80140DC.s +++ b/asm/code_80140DC.s @@ -5,8 +5,8 @@ .text - thumb_func_start sub_8014248 -sub_8014248: + thumb_func_start CreateMenuDialogueBoxAndPortrait +CreateMenuDialogueBoxAndPortrait: push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -277,7 +277,7 @@ _08014480: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_8014248 + thumb_func_end CreateMenuDialogueBoxAndPortrait thumb_func_start sub_8014490 sub_8014490: @@ -311,8 +311,8 @@ _080144BC: .4byte gUnknown_202EC1C _080144C0: .4byte gUnknown_202E744 thumb_func_end sub_80144A4 - thumb_func_start xxx_draw_string_80144C4 -xxx_draw_string_80144C4: + thumb_func_start DrawDialogueBoxString +DrawDialogueBoxString: push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -1018,7 +1018,7 @@ _08014A72: bx r0 .align 2, 0 _08014A84: .4byte gUnknown_202E744 - thumb_func_end xxx_draw_string_80144C4 + thumb_func_end DrawDialogueBoxString thumb_func_start sub_8014A88 sub_8014A88: diff --git a/asm/code_8040094.s b/asm/code_8040094.s index 24124f794..6b1bf2584 100644 --- a/asm/code_8040094.s +++ b/asm/code_8040094.s @@ -1728,7 +1728,7 @@ _08040E6E: ldr r0, _08040ECC ldr r1, [r0] adds r0, r6, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r1, 0xD2 lsls r1, 1 adds r0, r6, 0 diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s index 6c935b712..12fcf8310 100644 --- a/asm/code_8045A00.s +++ b/asm/code_8045A00.s @@ -278,7 +278,7 @@ _08045FAC: _08045FD0: ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08045FF2 .align 2, 0 _08045FDC: .4byte 0x00ff0008 @@ -288,10 +288,10 @@ _08045FE8: ldr r0, _08045FFC ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08045FF2: ldrb r0, [r5, 0x2] - bl HandleOnPickupTutorial + bl TryDisplayItemPickupTutorialMessage b _080460E0 .align 2, 0 _08045FFC: .4byte gPickedUpItemToolbox @@ -336,7 +336,7 @@ _0804602E: _08046048: ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _080460E0 .align 2, 0 _08046054: .4byte gFormatItems @@ -379,7 +379,7 @@ _08046094: _080460AC: ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _080460DA .align 2, 0 _080460B8: .4byte gAvailablePokemonNames @@ -394,10 +394,10 @@ _080460C0: ldr r0, _080460F4 ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _080460DA: ldrb r0, [r5, 0x2] - bl HandleOnPickupTutorial + bl TryDisplayItemPickupTutorialMessage _080460E0: add sp, 0xB8 pop {r3-r5} @@ -996,7 +996,7 @@ sub_804652C: ldr r0, _080465A4 ldr r1, [r0] mov r0, r10 - bl SendMessage + bl TryDisplayDungeonLoggableMessage mov r0, r9 ldrb r1, [r0] movs r0, 0x1 @@ -1156,7 +1156,7 @@ _080466B6: ldr r2, [r0] mov r0, r10 mov r1, sp - bl sub_8052364 + bl TryDisplayDungeonLoggableMessage5 b _0804671E .align 2, 0 _080466C4: .4byte gItemFellOutOfSight @@ -1202,7 +1202,7 @@ _0804670C: ldr r2, [r0] mov r0, r10 mov r1, sp - bl sub_8052364 + bl TryDisplayDungeonLoggableMessage5 _0804671E: add sp, 0x10 pop {r3-r5} @@ -1721,7 +1721,7 @@ _08046B0A: ldr r4, _08046B38 add r4, sp ldr r0, [r4] - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08046C7C .align 2, 0 _08046B2C: .4byte 0x0000052c @@ -1734,7 +1734,7 @@ _08046B3C: ldr r5, _08046B50 add r5, sp ldr r0, [r5] - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08046C7C .align 2, 0 _08046B4C: .4byte gItemLost @@ -1748,7 +1748,7 @@ _08046B54: ldr r2, _08046C94 add r2, sp ldr r0, [r2] - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08046B68: movs r3, 0 mov r9, r3 diff --git a/asm/code_8046CE4.s b/asm/code_8046CE4.s index 80c6fec09..73a27c892 100644 --- a/asm/code_8046CE4.s +++ b/asm/code_8046CE4.s @@ -418,7 +418,7 @@ _08047462: ldr r2, [r0] mov r0, r9 adds r1, r4, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 mov r0, r9 adds r1, r4, 0 bl TrySendImmobilizeSleepEndMsg @@ -475,7 +475,7 @@ _080474E2: ldr r2, [r0] mov r0, r9 adds r1, r4, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _08047524 .align 2, 0 _0804750C: .4byte gAvailablePokemonNames @@ -486,7 +486,7 @@ _08047518: ldr r2, [r0] mov r0, r9 adds r1, r4, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 _08047524: adds r5, 0x8 subs r6, 0x1 @@ -552,7 +552,7 @@ _08047596: ldr r0, _080475C0 ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _080475A8: movs r3, 0x90 lsls r3, 2 @@ -924,7 +924,7 @@ _0804786E: ldr r2, [r0] ldr r0, [sp, 0x10] adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 ldr r0, [sp, 0x10] adds r1, r5, 0 bl TrySendImmobilizeSleepEndMsg @@ -962,7 +962,7 @@ _080478DC: ldr r2, [r0] ldr r0, [sp, 0x10] adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _08047900 .align 2, 0 _080478F0: .4byte gUnknown_80F9510 @@ -971,7 +971,7 @@ _080478F4: ldr r2, [r0] ldr r0, [sp, 0x10] adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 _08047900: movs r2, 0x1 str r2, [sp, 0x20] diff --git a/asm/code_804FD30.s b/asm/code_804FD30.s index 37a33e990..e8517f86b 100644 --- a/asm/code_804FD30.s +++ b/asm/code_804FD30.s @@ -4118,7 +4118,7 @@ sub_8051E7C: ldr r0, _08051EB4 ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _080520F6 .align 2, 0 _08051EB4: .4byte gUnknown_80FDDF0 @@ -4378,7 +4378,7 @@ _0805207A: ldr r0, _080520E8 ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0x14 movs r1, 0x3C bl sub_803E708 @@ -4399,7 +4399,7 @@ _080520EC: ldr r0, _08052108 ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _080520F6: add sp, 0x14 pop {r3-r5} @@ -4518,103 +4518,4 @@ _080521CA: bx r1 thumb_func_end sub_805210C - thumb_func_start sub_80521D0 -sub_80521D0: - push {r4-r6,lr} - movs r1, 0 - ldr r5, _08052200 - ldr r6, _08052204 - ldr r4, _08052208 - ldr r3, _0805220C - movs r2, 0 -_080521DE: - ldr r0, [r4] - adds r0, r3 - adds r0, r1 - strb r2, [r0] - adds r1, 0x1 - cmp r1, 0x9 - ble _080521DE - movs r0, 0 - str r0, [r5] - movs r0, 0x1 - strb r0, [r6] - movs r0, 0 - bl sub_8052210 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_08052200: .4byte gUnknown_202F1E8 -_08052204: .4byte gUnknown_203B434 -_08052208: .4byte gDungeon -_0805220C: .4byte 0x0001c054 - thumb_func_end sub_80521D0 - - thumb_func_start sub_8052210 -sub_8052210: - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, _08052280 -_0805221A: - lsls r0, r4, 6 - ldr r1, [r5] - adds r0, r1 - ldr r1, _08052284 - adds r0, r1 - ldr r1, _08052288 - bl strcpy - adds r4, 0x1 - cmp r4, 0x9 - ble _0805221A - ldr r1, _08052280 - ldr r0, [r1] - ldr r2, _0805228C - adds r0, r2 - movs r3, 0 - strb r3, [r0] - ldr r0, [r1] - adds r2, 0x1 - adds r1, r0, r2 - strh r3, [r1] - adds r2, 0x2 - adds r1, r0, r2 - strh r3, [r1] - adds r2, 0x2 - adds r1, r0, r2 - strh r3, [r1] - ldr r1, _08052290 - adds r2, r0, r1 - movs r1, 0x4 - strh r1, [r2] - ldr r2, _08052294 - adds r0, r2 - str r3, [r0] - cmp r6, 0 - beq _08052278 - ldr r0, _08052298 - ldr r0, [r0] - cmp r0, 0x3 - bne _08052278 - movs r0, 0 - movs r1, 0 - bl sub_803EAF0 - movs r0, 0xB - bl sub_803E46C -_08052278: - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_08052280: .4byte gDungeon -_08052284: .4byte 0x0001bdd4 -_08052288: .4byte gUnknown_80F7AE8 -_0805228C: .4byte 0x0001c05f -_08052290: .4byte 0x0001c066 -_08052294: .4byte 0x0001c06c -_08052298: .4byte gUnknown_202EDD0 - thumb_func_end sub_8052210 - .align 2,0 diff --git a/asm/code_80521D0.s b/asm/code_80521D0.s deleted file mode 100644 index 535565cc8..000000000 --- a/asm/code_80521D0.s +++ /dev/null @@ -1,9152 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_80523A8 -sub_80523A8: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - adds r3, r0, 0 - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - ldr r0, _080523D0 - ldr r1, [r0] - adds r2, r0, 0 - cmp r1, r3 - beq _080523D8 - movs r7, 0x1 - ldr r1, _080523D4 - b _080523DE - .align 2, 0 -_080523D0: .4byte gUnknown_202F1E8 -_080523D4: .4byte gUnknown_203B434 -_080523D8: - ldr r0, _080523F0 - ldrb r7, [r0] - adds r1, r0, 0 -_080523DE: - movs r0, 0x1 - mov r8, r0 - str r3, [r2] - movs r0, 0 - strb r0, [r1] - movs r1, 0 - mov r9, r1 - b _080523FA - .align 2, 0 -_080523F0: .4byte gUnknown_203B434 -_080523F4: - movs r0, 0 - bl sub_803E46C -_080523FA: - ldr r6, _0805249C - ldr r2, [r6] - ldr r3, _080524A0 - adds r0, r2, r3 - movs r3, 0 - ldrsh r1, [r0, r3] - adds r1, 0x1 - cmp r1, 0xA - bne _0805240E - movs r1, 0 -_0805240E: - ldr r3, _080524A4 - adds r0, r2, r3 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - beq _080523F4 - ldrb r0, [r4] - cmp r0, 0 - beq _080524B0 - ldr r5, _080524A0 - adds r0, r2, r5 - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r3, _080524A8 - adds r0, r2, r3 - adds r0, r1 - strb r7, [r0] - adds r0, r4, 0 - mov r1, sp - mov r2, sp - adds r2, 0x3E - movs r3, 0x80 - bl xxx_format_string - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xD - bne _08052448 - adds r4, 0x1 -_08052448: - ldrb r0, [r4] - cmp r0, 0xA - bne _08052450 - adds r4, 0x1 -_08052450: - mov r0, sp - adds r1, r7, 0 - mov r2, r8 - bl sub_8053210 - movs r7, 0 - movs r0, 0 - mov r8, r0 - mov r1, r10 - cmp r1, 0 - beq _080523FA - movs r2, 0x1 - mov r9, r2 - ldr r1, [r6] - adds r0, r1, r5 - movs r3, 0 - ldrsh r0, [r0, r3] - lsls r0, 6 - adds r0, r1 - ldr r1, _080524AC - adds r0, r1 - mov r1, sp - movs r2, 0x40 - bl strncpy - ldr r0, [r6] - adds r1, r0, r5 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _080523FA - mov r2, r8 - strh r2, [r1] - b _080523FA - .align 2, 0 -_0805249C: .4byte gDungeon -_080524A0: .4byte 0x0001c060 -_080524A4: .4byte 0x0001c062 -_080524A8: .4byte 0x0001c054 -_080524AC: .4byte 0x0001bdd4 -_080524B0: - mov r3, r9 - cmp r3, 0 - beq _080524D4 - ldr r0, _080524E4 - ldr r2, [r0] - ldr r3, _080524E8 - adds r1, r2, r3 - movs r0, 0xF0 - strh r0, [r1] - ldr r0, _080524EC - adds r2, r0 - ldr r0, [r2] - cmp r0, 0 - bne _080524D0 - movs r0, 0x1 - str r0, [r2] -_080524D0: - bl sub_805E804 -_080524D4: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080524E4: .4byte gDungeon -_080524E8: .4byte 0x0001c064 -_080524EC: .4byte 0x0001c06c - thumb_func_end sub_80523A8 - - thumb_func_start xxx_draw_string_80524F0 -xxx_draw_string_80524F0: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x3C - ldr r0, _0805251C - ldr r0, [r0] - ldr r1, _08052520 - adds r7, r0, r1 - ldr r2, _08052524 - adds r5, r0, r2 - ldr r1, [r5] - cmp r1, 0x1 - beq _08052528 - cmp r1, 0x1 - bcs _08052510 - b _0805267C -_08052510: - cmp r1, 0x2 - beq _0805253C - cmp r1, 0x3 - bne _0805251A - b _0805265C -_0805251A: - b _0805267C - .align 2, 0 -_0805251C: .4byte gDungeon -_08052520: .4byte 0x0001bdd4 -_08052524: .4byte 0x0001c06c -_08052528: - bl sub_800EC74 - lsls r0, 24 - cmp r0, 0 - beq _08052534 - b _0805267C -_08052534: - movs r0, 0x3 - movs r1, 0 - bl sub_803EAF0 -_0805253C: - ldr r3, _08052560 - adds r0, r7, r3 - movs r1, 0 - ldrsh r4, [r0, r1] - movs r2, 0xA3 - lsls r2, 2 - adds r0, r7, r2 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r4, r0 - bne _08052564 - movs r0, 0xA6 - lsls r0, 2 - adds r1, r7, r0 - movs r0, 0 - str r0, [r1] - b _0805267C - .align 2, 0 -_08052560: .4byte 0x0000028e -_08052564: - lsls r0, r4, 6 - adds r5, r7, r0 - add r1, sp, 0x4 - movs r0, 0x4 - strh r0, [r1] - ldr r2, _080525B0 - adds r6, r7, r2 - ldrh r0, [r6] - strh r0, [r1, 0x2] - movs r3, 0x7 - mov r8, r3 - str r3, [sp, 0x14] - movs r0, 0 - bl sub_80073B8 - movs r1, 0xA0 - lsls r1, 2 - adds r0, r7, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080525AA - movs r2, 0 - ldrsh r0, [r6, r2] - cmp r0, 0x7 - ble _080525AA - adds r2, r0, 0 - subs r2, 0x1 - mov r0, r8 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r3, 0xE0 - bl sub_80078A4 -_080525AA: - adds r6, r4, 0x1 - b _080525F2 - .align 2, 0 -_080525B0: .4byte 0x00000292 -_080525B4: - add r1, sp, 0x38 - adds r0, r5, 0 - bl xxx_get_next_char_from_string - adds r5, r0, 0 - ldr r4, [sp, 0x38] - cmp r4, 0x60 - bne _080525D0 - add r1, sp, 0x4 - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x6 - strh r0, [r1] - b _080525F2 -_080525D0: - add r0, sp, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - add r1, sp, 0x4 - movs r2, 0x2 - ldrsh r1, [r1, r2] - ldr r3, [sp, 0x14] - movs r2, 0 - str r2, [sp] - adds r2, r4, 0 - bl xxx_call_draw_char - add r2, sp, 0x4 - adds r1, r2, 0 - ldrh r1, [r1] - adds r1, r0 - strh r1, [r2] -_080525F2: - adds r0, r5, 0 - add r1, sp, 0x4 - bl xxx_handle_format_global - adds r5, r0, 0 - ldrb r0, [r5] - cmp r0, 0 - beq _0805260A - cmp r0, 0xD - beq _0805260A - cmp r0, 0xA - bne _080525B4 -_0805260A: - movs r0, 0 - bl sub_80073E0 - movs r3, 0xA4 - lsls r3, 2 - adds r1, r7, r3 - movs r0, 0xF0 - strh r0, [r1] - adds r4, r6, 0 - cmp r4, 0xA - bne _08052622 - movs r4, 0 -_08052622: - ldr r1, _08052654 - adds r0, r7, r1 - strh r4, [r0] - ldr r2, _08052658 - adds r1, r7, r2 - ldrh r0, [r1] - adds r0, 0xB - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2F - ble _0805267C - movs r0, 0x25 - strh r0, [r1] - movs r3, 0xA5 - lsls r3, 2 - adds r1, r7, r3 - movs r0, 0 - strh r0, [r1] - movs r0, 0xA6 - lsls r0, 2 - adds r1, r7, r0 - movs r0, 0x3 - str r0, [r1] - b _0805267C - .align 2, 0 -_08052654: .4byte 0x0000028e -_08052658: .4byte 0x00000292 -_0805265C: - ldr r1, _080526C4 - adds r4, r0, r1 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - ldr r0, _080526C8 - ldr r1, [r0] - movs r0, 0 - bl _call_via_r1 - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r0, 0xA - ble _0805267C - movs r0, 0x2 - str r0, [r5] -_0805267C: - ldr r3, _080526CC - adds r0, r7, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080526B8 - movs r0, 0xA4 - lsls r0, 2 - adds r1, r7, r0 - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _080526B8 - subs r0, r2, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _080526B8 - movs r2, 0xA6 - lsls r2, 2 - adds r0, r7, r2 - str r1, [r0] - movs r0, 0 - movs r1, 0 - bl sub_803EAF0 - movs r0, 0 - bl sub_8052210 -_080526B8: - add sp, 0x3C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080526C4: .4byte 0x0001c068 -_080526C8: .4byte gUnknown_203B08C -_080526CC: .4byte 0x0000028a - thumb_func_end xxx_draw_string_80524F0 - - thumb_func_start sub_80526D0 -sub_80526D0: - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, _0805272C - ldr r1, [r0] - ldr r0, _08052730 - adds r4, r1, r0 - ldr r2, _08052734 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - bne _080526FA - ldr r3, _08052738 - adds r0, r1, r3 - subs r2, 0xA - adds r1, r2 - movs r3, 0 - ldrsh r2, [r0, r3] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r2, r0 - beq _08052724 -_080526FA: - adds r0, r5, 0 - bl sub_803E46C - movs r1, 0xA6 - lsls r1, 2 - adds r0, r4, r1 - ldr r0, [r0] - cmp r0, 0 - bne _080526FA - ldr r0, _0805272C - ldr r0, [r0] - ldr r2, _08052738 - adds r1, r0, r2 - ldr r3, _0805273C - adds r0, r3 - movs r2, 0 - ldrsh r1, [r1, r2] - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - bne _080526FA -_08052724: - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_0805272C: .4byte gDungeon -_08052730: .4byte 0x0001bdd4 -_08052734: .4byte 0x0001c06c -_08052738: .4byte 0x0001c060 -_0805273C: .4byte 0x0001c062 - thumb_func_end sub_80526D0 - - thumb_func_start sub_8052740 -sub_8052740: - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldr r0, _080527B0 - ldr r4, [r0] - ldr r0, _080527B4 - adds r7, r4, r0 - adds r0, r5, 0 - bl sub_80526D0 - movs r6, 0 - ldr r1, _080527B8 - adds r4, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0xB3 - ble _080527A4 - ldr r2, _080527BC - ldrh r1, [r2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x3 - beq _080527A4 - adds r4, r2, 0 - ldr r0, _080527C0 - mov r8, r0 -_08052776: - ldrh r0, [r4, 0x2] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _080527A4 - adds r0, r5, 0 - bl sub_803E46C - adds r6, 0x1 - cmp r6, 0xEF - bgt _080527A4 - movs r1, 0xA4 - lsls r1, 2 - adds r0, r7, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0xB3 - ble _080527A4 - ldrh r1, [r4] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x3 - bne _08052776 -_080527A4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080527B0: .4byte gDungeon -_080527B4: .4byte 0x0001bdd4 -_080527B8: .4byte 0x0001c064 -_080527BC: .4byte gRealInputs -_080527C0: .4byte 0x0000030f - thumb_func_end sub_8052740 - - thumb_func_start PrintFieldMessage -PrintFieldMessage: - push {r4-r7,lr} - sub sp, 0x28 - adds r4, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, _08052858 - ldrb r0, [r0] - cmp r0, 0 - beq _080527DE - movs r0, 0xA - bl sub_8052740 -_080527DE: - movs r0, 0x2 - movs r1, 0 - bl sub_803EAF0 - movs r0, 0 - bl sub_8052210 - movs r5, 0 - str r5, [sp, 0x14] - str r5, [sp, 0x18] - ldr r0, _0805285C - ldr r1, [r0] - ldr r2, _08052860 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08052844 - adds r2, 0x6 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08052844 - cmp r4, 0 - beq _08052844 - movs r1, 0 - ldrsh r0, [r4, r1] - ldrb r1, [r4, 0x2] - bl IsPokemonDialogueSpriteAvail - lsls r0, 24 - cmp r0, 0 - beq _08052844 - movs r2, 0 - ldrsh r0, [r4, r2] - bl GetDialogueSpriteDataPtr - str r0, [sp, 0x14] - ldr r0, [r0, 0x4] - str r0, [sp, 0x18] - add r1, sp, 0x14 - movs r2, 0 - movs r0, 0x2 - strh r0, [r1, 0x8] - movs r0, 0x9 - strh r0, [r1, 0xA] - ldrb r0, [r4, 0x2] - strb r0, [r1, 0xC] - adds r0, r1, 0 - strb r2, [r0, 0xD] - strb r2, [r0, 0xE] - adds r5, r0, 0 -_08052844: - movs r1, 0 - str r1, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r5, [sp, 0xC] - cmp r6, 0 - beq _08052868 - ldr r0, _08052864 - b _0805286C - .align 2, 0 -_08052858: .4byte gUnknown_203B40C -_0805285C: .4byte gDungeon -_08052860: .4byte 0x0001820a -_08052864: .4byte 0x00000701 -_08052868: - movs r0, 0x80 - lsls r0, 3 -_0805286C: - str r0, [sp, 0x10] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_8014248 - ldr r0, _080528D0 - ldr r0, [r0] - ldr r1, _080528D4 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - add r4, sp, 0x24 -_08052888: - bl xxx_draw_string_80144C4 - movs r0, 0x9 - bl sub_803E46C - adds r0, r4, 0 - bl sub_80144A4 - adds r1, r0, 0 - cmp r1, 0 - bne _08052888 - ldr r0, _080528D0 - ldr r0, [r0] - ldr r2, _080528D4 - adds r0, r2 - strb r1, [r0] - ldr r0, [sp, 0x14] - cmp r0, 0 - beq _080528B2 - bl CloseFile -_080528B2: - cmp r6, 0 - beq _080528E4 - bl sub_805E804 - bl sub_8040238 - ldr r0, _080528D8 - ldrb r0, [r0] - cmp r0, 0 - beq _080528DC - movs r0, 0 - movs r1, 0 - bl sub_803EAF0 - b _080528E4 - .align 2, 0 -_080528D0: .4byte gDungeon -_080528D4: .4byte 0x0001c05f -_080528D8: .4byte gUnknown_202EE01 -_080528DC: - movs r0, 0x1 - movs r1, 0 - bl sub_803EAF0 -_080528E4: - movs r0, 0x8 - movs r1, 0x9 - bl sub_803E708 - add sp, 0x28 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end PrintFieldMessage - - thumb_func_start sub_80528F4 -sub_80528F4: - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r0, 0 - movs r2, 0x1 - bl PrintFieldMessage - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80522E8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80528F4 - - thumb_func_start DisplayDungeonDialogue -DisplayDungeonDialogue: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r6, r0, 0 - bl xxx_call_GetLeader - adds r4, r0, 0 - bl GetPartnerEntity - adds r5, r0, 0 - movs r0, 0 - mov r9, r0 - cmp r4, 0 - beq _0805295C - ldr r4, [r4, 0x70] - ldr r2, _08052950 - ldrb r1, [r4, 0xA] - movs r0, 0x64 - muls r0, r1 - ldr r1, _08052954 - adds r0, r1 - ldr r1, [r2] - adds r1, r0 - ldr r0, _08052958 - bl sub_808DA0C - movs r2, 0x4 - ldrsh r7, [r4, r2] - b _08052966 - .align 2, 0 -_08052950: .4byte gRecruitedPokemonRef -_08052954: .4byte 0x00008df8 -_08052958: .4byte gAvailablePokemonNames -_0805295C: - movs r7, 0 - ldr r0, _08052988 - ldr r1, _0805298C - bl strcpy -_08052966: - cmp r5, 0 - beq _0805299C - ldr r4, [r5, 0x70] - ldr r2, _08052990 - ldrb r1, [r4, 0xA] - movs r0, 0x64 - muls r0, r1 - ldr r1, _08052994 - adds r0, r1 - ldr r1, [r2] - adds r1, r0 - ldr r0, _08052998 - bl sub_808DA0C - movs r2, 0x4 - ldrsh r4, [r4, r2] - b _080529A6 - .align 2, 0 -_08052988: .4byte gAvailablePokemonNames -_0805298C: .4byte gUnknown_80F7AF8 -_08052990: .4byte gRecruitedPokemonRef -_08052994: .4byte 0x00008df8 -_08052998: .4byte gUnknown_202DFE8 -_0805299C: - movs r4, 0 - ldr r0, _080529C0 - ldr r1, _080529C4 - bl strcpy -_080529A6: - movs r0, 0x4 - ldrsh r1, [r6, r0] - movs r0, 0xD5 - lsls r0, 1 - cmp r1, r0 - beq _080529F0 - cmp r1, r0 - bgt _080529C8 - subs r0, 0x1 - cmp r1, r0 - beq _080529D4 - b _08052A1C - .align 2, 0 -_080529C0: .4byte gUnknown_202DFE8 -_080529C4: .4byte gUnknown_80F7AF8 -_080529C8: - ldr r0, _080529D0 - cmp r1, r0 - beq _08052A08 - b _08052A1C - .align 2, 0 -_080529D0: .4byte 0x000001ab -_080529D4: - adds r4, r7, 0 - ldr r0, _080529E4 - ldr r1, _080529E8 - ldr r2, _080529EC - bl sprintfStatic - b _08052A28 - .align 2, 0 -_080529E4: .4byte gUnknown_202E5D8 -_080529E8: .4byte gUnknown_80F7AFC -_080529EC: .4byte gAvailablePokemonNames -_080529F0: - ldr r0, _080529FC - ldr r1, _08052A00 - ldr r2, _08052A04 - bl sprintfStatic - b _08052A28 - .align 2, 0 -_080529FC: .4byte gUnknown_202E5D8 -_08052A00: .4byte gUnknown_80F7AFC -_08052A04: .4byte gUnknown_202DFE8 -_08052A08: - movs r4, 0 - ldr r0, _08052A14 - ldr r1, _08052A18 - bl strcpy - b _08052A28 - .align 2, 0 -_08052A14: .4byte gUnknown_202E5D8 -_08052A18: .4byte gUnknown_80F7B04 -_08052A1C: - movs r1, 0x4 - ldrsh r4, [r6, r1] - ldr r0, _08052A48 - adds r1, r4, 0 - bl CopyYellowMonsterNametoBuffer -_08052A28: - ldrh r0, [r6] - subs r0, 0x2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _08052A3C - ldr r0, _08052A48 - ldr r1, _08052A4C - bl strcpy -_08052A3C: - movs r2, 0x6 - ldrsh r0, [r6, r2] - ldr r2, _08052A50 - add r7, sp, 0x10 - b _08052A8E - .align 2, 0 -_08052A48: .4byte gUnknown_202E5D8 -_08052A4C: .4byte gUnknown_80F7B04 -_08052A50: .4byte gDungeon -_08052A54: - movs r0, 0x6 - ldrsh r1, [r6, r0] - cmp r1, 0x1 - bne _08052A78 - cmp r4, 0x1 - beq _08052A9E - cmp r4, 0x9B - beq _08052A9E - ldr r0, _08052B08 - cmp r4, r0 - beq _08052A9E - cmp r4, 0x19 - beq _08052A9E - cmp r4, 0x4 - beq _08052A9E - subs r0, 0x6 - cmp r4, r0 - beq _08052A9E -_08052A78: - movs r0, 0x8C - lsls r0, 1 - cmp r1, r0 - bne _08052A88 - cmp r4, r1 - beq _08052A9E - cmp r4, 0x98 - beq _08052A9E -_08052A88: - adds r6, 0xC - movs r1, 0x6 - ldrsh r0, [r6, r1] -_08052A8E: - cmp r0, 0 - beq _08052A9E - cmp r0, 0x7 - bne _08052A54 - cmp r4, 0x7 - beq _08052A9E - cmp r4, 0x9E - bne _08052A54 -_08052A9E: - ldr r1, [r2] - ldr r2, _08052B0C - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08052B14 - adds r2, 0x6 - adds r0, r1, r2 - ldrb r0, [r0] - mov r8, r0 - cmp r0, 0 - bne _08052B14 - ldrh r0, [r6] - cmp r0, 0x4 - beq _08052B14 - ldrb r0, [r6, 0x2] - cmp r0, 0x80 - beq _08052B14 - cmp r4, 0 - beq _08052B14 - ldrb r0, [r6, 0x3] - bl sub_808CDB0 - adds r5, r0, 0 - mov r9, sp - adds r0, r4, 0 - bl GetDialogueSpriteDataPtr - str r0, [sp] - cmp r0, 0 - beq _08052B10 - ldr r0, [r0, 0x4] - str r0, [sp, 0x4] - mov r1, r8 - mov r0, r9 - strb r1, [r0, 0xE] - ldrb r0, [r6, 0x2] - mov r2, r9 - strb r0, [r2, 0xC] - ldrb r0, [r5, 0x4] - strb r0, [r2, 0xD] - ldrh r0, [r5] - strh r0, [r2, 0x8] - ldrh r0, [r5, 0x2] - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _08052B14 - movs r0, 0x2 - strh r0, [r2, 0xA] - b _08052B14 - .align 2, 0 -_08052B08: .4byte 0x0000011b -_08052B0C: .4byte 0x0001820a -_08052B10: - movs r0, 0 - mov r9, r0 -_08052B14: - movs r0, 0xA - bl sub_8052740 - movs r0, 0x2 - movs r1, 0 - bl sub_803EAF0 - movs r0, 0 - bl sub_8052210 - ldr r0, [r6, 0x8] - ldr r2, _08052B88 - ldrh r1, [r6] - lsls r1, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0 - mov r2, r9 - bl xxx_info_box_80141B4 -_08052B3C: - bl xxx_draw_string_80144C4 - movs r0, 0x9 - bl sub_803E46C - adds r0, r7, 0 - bl sub_80144A4 - cmp r0, 0 - bne _08052B3C - mov r1, r9 - cmp r1, 0 - beq _08052B5C - ldr r0, [r1] - bl CloseFile -_08052B5C: - ldrh r0, [r6] - cmp r0, 0x1 - beq _08052B72 - cmp r0, 0x3 - beq _08052B72 - bl sub_8040238 - movs r0, 0 - movs r1, 0 - bl sub_803EAF0 -_08052B72: - movs r0, 0x8 - movs r1, 0x9 - bl sub_803E708 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08052B88: .4byte gUnknown_80F7AEA - thumb_func_end DisplayDungeonDialogue - - thumb_func_start sub_8052B8C -sub_8052B8C: - push {r4-r7,lr} - sub sp, 0x14 - adds r4, r0, 0 - adds r6, r1, 0 - adds r7, r2, 0 - movs r0, 0xA - bl sub_8052740 - movs r0, 0x2 - movs r1, 0 - bl sub_803EAF0 - movs r0, 0 - bl sub_8052210 - movs r5, 0 - str r5, [sp] - str r5, [sp, 0x4] - ldr r0, _08052C14 - ldr r1, [r0] - ldr r2, _08052C18 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08052C02 - adds r2, 0x6 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08052C02 - cmp r4, 0 - beq _08052C02 - movs r1, 0 - ldrsh r0, [r4, r1] - ldrb r1, [r4, 0x2] - bl IsPokemonDialogueSpriteAvail - lsls r0, 24 - cmp r0, 0 - beq _08052C02 - movs r2, 0 - ldrsh r0, [r4, r2] - bl GetDialogueSpriteDataPtr - str r0, [sp] - ldr r0, [r0, 0x4] - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x2 - strh r0, [r1, 0x8] - movs r0, 0x9 - strh r0, [r1, 0xA] - ldrb r0, [r4, 0x2] - strb r0, [r1, 0xC] - mov r0, sp - strb r2, [r0, 0xD] - strb r2, [r0, 0xE] - mov r5, sp -_08052C02: - cmp r7, 0x1 - bne _08052C1C - movs r2, 0xC0 - lsls r2, 2 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80141E0 - b _08052C28 - .align 2, 0 -_08052C14: .4byte gDungeon -_08052C18: .4byte 0x0001820a -_08052C1C: - movs r2, 0xC0 - lsls r2, 2 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_8014214 -_08052C28: - add r4, sp, 0x10 -_08052C2A: - bl xxx_draw_string_80144C4 - movs r0, 0x9 - bl sub_803E46C - adds r0, r4, 0 - bl sub_80144A4 - cmp r0, 0 - bne _08052C2A - ldr r0, [sp] - cmp r0, 0 - beq _08052C48 - bl CloseFile -_08052C48: - bl sub_8040238 - movs r0, 0 - movs r1, 0 - bl sub_803EAF0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - beq _08052C5E - movs r0, 0 - b _08052C60 -_08052C5E: - movs r0, 0x1 -_08052C60: - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8052B8C - - thumb_func_start sub_8052C68 -sub_8052C68: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r2 - lsls r3, 16 - lsrs r6, r3, 16 - movs r0, 0xA - bl sub_8052740 - movs r0, 0x2 - movs r1, 0 - bl sub_803EAF0 - movs r0, 0 - bl sub_8052210 - movs r5, 0 - str r5, [sp, 0x14] - str r5, [sp, 0x18] - ldr r0, _08052D3C - ldr r1, [r0] - ldr r2, _08052D40 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08052CE6 - adds r2, 0x6 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08052CE6 - cmp r4, 0 - beq _08052CE6 - movs r1, 0 - ldrsh r0, [r4, r1] - ldrb r1, [r4, 0x2] - bl IsPokemonDialogueSpriteAvail - lsls r0, 24 - cmp r0, 0 - beq _08052CE6 - movs r2, 0 - ldrsh r0, [r4, r2] - bl GetDialogueSpriteDataPtr - str r0, [sp, 0x14] - ldr r0, [r0, 0x4] - str r0, [sp, 0x18] - add r1, sp, 0x14 - movs r2, 0 - movs r0, 0x2 - strh r0, [r1, 0x8] - movs r0, 0x9 - strh r0, [r1, 0xA] - ldrb r0, [r4, 0x2] - strb r0, [r1, 0xC] - adds r0, r1, 0 - strb r2, [r0, 0xD] - strb r2, [r0, 0xE] - adds r5, r0, 0 -_08052CE6: - movs r2, 0x1 - negs r2, r2 - movs r1, 0 - str r1, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r5, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r7, 0 - mov r3, r8 - bl sub_8014248 - add r4, sp, 0x24 -_08052D02: - bl xxx_draw_string_80144C4 - movs r0, 0x9 - bl sub_803E46C - adds r0, r4, 0 - bl sub_80144A4 - cmp r0, 0 - bne _08052D02 - ldr r0, [sp, 0x14] - cmp r0, 0 - beq _08052D20 - bl CloseFile -_08052D20: - bl sub_8040238 - movs r0, 0 - movs r1, 0 - bl sub_803EAF0 - ldr r0, [sp, 0x24] - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08052D3C: .4byte gDungeon -_08052D40: .4byte 0x0001820a - thumb_func_end sub_8052C68 - - thumb_func_start sub_8052D44 -sub_8052D44: - push {r4-r7,lr} - adds r7, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _08052D70 - ldr r0, _08052D6C - adds r1, r4, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, [r4, 0x70] - ldrh r0, [r0, 0x4] - strh r0, [r7] - b _08052D7A - .align 2, 0 -_08052D6C: .4byte gAvailablePokemonNames -_08052D70: - ldr r0, _08052D9C - ldr r1, _08052DA0 - bl strcpy - strh r5, [r7] -_08052D7A: - adds r0, r6, 0 - bl EntityExists - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08052DA8 - ldr r0, _08052DA4 - adds r1, r6, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, [r6, 0x70] - ldrh r0, [r0, 0x4] - strh r0, [r7, 0x2] - b _08052DB2 - .align 2, 0 -_08052D9C: .4byte gAvailablePokemonNames -_08052DA0: .4byte gUnknown_80F7AF8 -_08052DA4: .4byte gUnknown_202DFE8 -_08052DA8: - ldr r0, _08052DB8 - ldr r1, _08052DBC - bl strcpy - strh r4, [r7, 0x2] -_08052DB2: - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08052DB8: .4byte gUnknown_202DFE8 -_08052DBC: .4byte gUnknown_80F7AF8 - thumb_func_end sub_8052D44 - - thumb_func_start sub_8052DC0 -sub_8052DC0: - push {lr} - bl sub_8045888 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8052DC0 - - thumb_func_start sub_8052DD0 -sub_8052DD0: - push {r4-r6,lr} - bl GetLeader - adds r5, r0, 0 - ldr r6, _08052E68 - ldr r4, [r6] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - beq _08052E46 - ldr r6, _08052E6C - ldr r4, [r6] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - beq _08052E46 - ldr r6, _08052E70 - ldr r4, [r6] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - beq _08052E46 - ldr r0, _08052E74 - ldr r0, [r0] - ldr r1, _08052E78 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08052EB6 - ldr r6, _08052E7C - ldr r4, [r6] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - beq _08052E46 - ldr r6, _08052E80 - ldr r4, [r6] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - beq _08052E46 - ldr r6, _08052E84 - ldr r4, [r6] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - bne _08052E88 -_08052E46: - adds r0, r4, 0 - bl SetTutorialFlag - bl sub_8083E28 - ldr r4, [r6, 0x4] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl PrintFieldMessage - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80522E8 - b _08052EB6 - .align 2, 0 -_08052E68: .4byte gUnknown_80FF020 -_08052E6C: .4byte gUnknown_80FF080 -_08052E70: .4byte gUnknown_80FF0D8 -_08052E74: .4byte gDungeon -_08052E78: .4byte 0x00000644 -_08052E7C: .4byte gUnknown_80FF13C -_08052E80: .4byte gUnknown_80FF1B4 -_08052E84: .4byte gMovementTutorial -_08052E88: - ldr r6, _08052EBC - ldr r4, [r6] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - bne _08052EB6 - adds r0, r4, 0 - bl SetTutorialFlag - bl sub_8083E28 - ldr r4, [r6, 0x4] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl PrintFieldMessage - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80522E8 -_08052EB6: - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_08052EBC: .4byte gHungerTutorial - thumb_func_end sub_8052DD0 - - thumb_func_start HandleOnPickupTutorial -HandleOnPickupTutorial: - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - adds r0, r4, 0 - bl GetItemCategory - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _08052EE0 - ldr r5, _08052EDC - b _08052F22 - .align 2, 0 -_08052EDC: .4byte gFoodTutorial -_08052EE0: - cmp r4, 0x37 - bne _08052EEC - ldr r5, _08052EE8 - b _08052F22 - .align 2, 0 -_08052EE8: .4byte gOranTutorial -_08052EEC: - cmp r4, 0x43 - bne _08052EF8 - ldr r5, _08052EF4 - b _08052F22 - .align 2, 0 -_08052EF4: .4byte gCheriTutorial -_08052EF8: - cmp r4, 0x48 - bne _08052F04 - ldr r5, _08052F00 - b _08052F22 - .align 2, 0 -_08052F00: .4byte gBlastSeedTutorial -_08052F04: - cmp r4, 0x7 - bne _08052F10 - ldr r5, _08052F0C - b _08052F22 - .align 2, 0 -_08052F0C: .4byte gUnknown_80FF4A0 -_08052F10: - cmp r4, 0x42 - bne _08052F1C - ldr r5, _08052F18 - b _08052F22 - .align 2, 0 -_08052F18: .4byte gPechaTutorial -_08052F1C: - cmp r4, 0x45 - bne _08052F4C - ldr r5, _08052F48 -_08052F22: - ldr r4, [r5] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - bne _08052F74 - adds r0, r4, 0 - bl SetTutorialFlag - bl sub_8083E28 - ldr r1, [r5, 0x4] - movs r0, 0 - movs r2, 0x1 - bl PrintFieldMessage - b _08052F74 - .align 2, 0 -_08052F48: .4byte gSleepSeedTutorial -_08052F4C: - cmp r5, 0x69 - bne _08052F74 - ldr r5, _08052F7C - ldr r4, [r5] - adds r0, r4, 0 - bl GetTutorialFlag - lsls r0, 24 - cmp r0, 0 - bne _08052F74 - adds r0, r4, 0 - bl SetTutorialFlag - bl sub_8083E28 - ldr r1, [r5, 0x4] - movs r0, 0 - movs r2, 0x1 - bl PrintFieldMessage -_08052F74: - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08052F7C: .4byte gMoneyTutorial - thumb_func_end HandleOnPickupTutorial - - thumb_func_start sub_8052F80 -sub_8052F80: - push {lr} - ldr r0, _08052F9C - ldr r0, [r0] - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _08052FA4 - ldr r0, _08052FA0 - ldr r1, [r0] - movs r0, 0 - movs r2, 0x1 - bl PrintFieldMessage - b _08052FB0 - .align 2, 0 -_08052F9C: .4byte gDungeon -_08052FA0: .4byte gUnknown_80FF6F8 -_08052FA4: - ldr r0, _08052FB4 - ldr r1, [r0] - movs r0, 0 - movs r2, 0x1 - bl PrintFieldMessage -_08052FB0: - pop {r0} - bx r0 - .align 2, 0 -_08052FB4: .4byte gUnknown_80FF6A4 - thumb_func_end sub_8052F80 - - thumb_func_start sub_8052FB8 -sub_8052FB8: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r3, r0, 0 - movs r0, 0 - mov r8, r0 - ldr r0, _08053030 - movs r2, 0 - adds r0, 0x2 - movs r1, 0x1C -_08052FD2: - strh r2, [r0] - adds r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08052FD2 - movs r0, 0 - str r0, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - movs r0, 0x30 - str r0, [sp, 0x10] - adds r0, r3, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_8014248 - movs r1, 0 - mov r9, r1 - ldr r7, _08053034 - ldr r2, _08053038 - mov r10, r2 -_08053002: - mov r3, r8 - cmp r3, 0x3D - bgt _08053040 - movs r4, 0x1 - add r8, r4 - movs r5, 0 - mov r1, r8 - lsrs r0, r1, 31 - adds r6, r1, r0 - ldr r4, _0805303C -_08053016: - adds r0, r5, 0 - adds r0, 0xF0 - adds r1, r4, 0 - asrs r2, r6, 1 - movs r3, 0 - bl SetBGPaletteBufferColorRGB - adds r4, 0x4 - adds r5, 0x1 - cmp r5, 0x7 - ble _08053016 - b _080530CA - .align 2, 0 -_08053030: .4byte gUnknown_202B038 -_08053034: .4byte gUnknown_202F1F0 -_08053038: .4byte 0x0000f3ff -_0805303C: .4byte gFontPalette -_08053040: - movs r2, 0x1 - add r9, r2 - movs r0, 0x8 - mov r3, r9 - ands r0, r3 - cmp r0, 0 - beq _080530BE - ldrh r0, [r7] - ldr r4, _080530D8 - adds r1, r4, 0 - ands r0, r1 - ldr r2, _080530DC - adds r1, r2, 0 - ands r0, r1 - mov r3, r10 - ands r0, r3 - ldr r4, _080530E0 - adds r1, r4, 0 - ands r0, r1 - ldr r2, _080530E4 - adds r1, r2, 0 - ands r0, r1 - ldr r3, _080530E8 - ands r0, r3 - movs r4, 0x80 - lsls r4, 7 - orrs r0, r4 - strh r0, [r7] - movs r2, 0xFC - lsls r2, 2 - ldrh r0, [r7, 0x4] - movs r3, 0xFC - lsls r3, 8 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - movs r4, 0 - orrs r0, r4 - mov r1, r10 - ands r0, r1 - movs r2, 0xF - movs r3, 0xF0 - lsls r3, 8 - ldr r4, _080530EC - adds r1, r4, 0 - ands r0, r1 - orrs r0, r3 - strh r0, [r7, 0x4] - movs r1, 0xF0 - lsls r1, 3 - ldrh r0, [r7, 0x6] - ands r2, r0 - orrs r2, r1 - strh r2, [r7, 0x6] - movs r0, 0x70 - strh r0, [r7, 0x2] - adds r0, r7, 0 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0 - movs r3, 0 - bl AddSprite -_080530BE: - ldr r0, _080530F0 - ldrh r1, [r0, 0x2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080530F4 -_080530CA: - bl xxx_draw_string_80144C4 - movs r0, 0x9 - bl sub_803E46C - b _08053002 - .align 2, 0 -_080530D8: .4byte 0x0000feff -_080530DC: .4byte 0x0000fdff -_080530E0: .4byte 0x0000efff -_080530E4: .4byte 0x0000dfff -_080530E8: .4byte 0x00003fff -_080530EC: .4byte 0x00000fff -_080530F0: .4byte gRealInputs -_080530F4: - mov r0, r8 - cmp r0, 0 - blt _08053134 - ldr r1, _08053178 - mov r9, r1 -_080530FE: - movs r5, 0 - mov r7, r8 - subs r7, 0x1 - mov r2, r8 - lsrs r0, r2, 31 - adds r6, r2, r0 - mov r4, r9 -_0805310C: - adds r0, r5, 0 - adds r0, 0xF0 - adds r1, r4, 0 - asrs r2, r6, 1 - movs r3, 0 - bl SetBGPaletteBufferColorRGB - adds r4, 0x4 - adds r5, 0x1 - cmp r5, 0x7 - ble _0805310C - bl xxx_draw_string_80144C4 - movs r0, 0x9 - bl sub_803E46C - mov r8, r7 - mov r3, r8 - cmp r3, 0 - bge _080530FE -_08053134: - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1 - bl xxx_call_save_unk_text_struct_800641C - movs r0, 0x9 - bl sub_803E46C - bl sub_8040238 - movs r5, 0 - ldr r4, _08053178 -_0805314C: - adds r0, r5, 0 - adds r0, 0xF0 - adds r1, r4, 0 - bl SetBGPaletteBufferColorArray - adds r4, 0x4 - adds r5, 0x1 - cmp r5, 0x7 - ble _0805314C - movs r0, 0x8 - movs r1, 0x9 - bl sub_803E708 - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08053178: .4byte gFontPalette - thumb_func_end sub_8052FB8 - - thumb_func_start sub_805317C -sub_805317C: - push {lr} - ldr r0, _08053198 - ldr r1, [r0] - movs r2, 0xCF - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0805319C - subs r2, 0x34 - adds r0, r1, r2 - ldrb r0, [r0] - b _0805319E - .align 2, 0 -_08053198: .4byte gDungeon -_0805319C: - movs r0, 0x3F -_0805319E: - bl GetDungeonName1 - pop {r1} - bx r1 - thumb_func_end sub_805317C - - thumb_func_start sub_80531A8 -sub_80531A8: - push {r4-r6,lr} - ldr r2, _080531F0 - ldr r1, [r2] - movs r0, 0 - strh r0, [r1, 0x16] - movs r0, 0x1 - strb r0, [r1, 0xB] - movs r4, 0 - movs r3, 0 - ldr r5, _080531F4 -_080531BC: - ldr r0, [r2] - lsls r1, r4, 6 - adds r0, r1 - adds r0, r5 - strb r3, [r0] - ldr r0, [r2] - adds r0, r1 - ldr r6, _080531F8 - adds r0, r6 - strb r3, [r0] - ldr r0, [r2] - adds r0, r1 - adds r6, 0x1 - adds r0, r6 - strb r3, [r0] - ldr r0, [r2] - adds r0, r1 - ldr r1, _080531FC - adds r0, r1 - strb r3, [r0] - adds r4, 0x1 - cmp r4, 0x13 - ble _080531BC - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080531F0: .4byte gDungeon -_080531F4: .4byte 0x0001c073 -_080531F8: .4byte 0x0001c070 -_080531FC: .4byte 0x0001c072 - thumb_func_end sub_80531A8 - - thumb_func_start sub_8053200 -sub_8053200: - ldr r0, _0805320C - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0xB] - bx lr - .align 2, 0 -_0805320C: .4byte gDungeon - thumb_func_end sub_8053200 - - thumb_func_start sub_8053210 -sub_8053210: - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldr r0, _08053264 - mov r12, r0 - ldr r3, [r0] - movs r0, 0x16 - ldrsh r4, [r3, r0] - lsls r4, 6 - ldr r5, _08053268 - adds r0, r4, r5 - adds r0, r3, r0 - adds r7, r0, 0x3 - adds r0, 0x3E - mov r8, r0 - adds r3, r4 - adds r3, r5 - movs r0, 0x1 - strb r0, [r3] - mov r4, r12 - ldr r3, [r4] - movs r4, 0x16 - ldrsh r0, [r3, r4] - lsls r0, 6 - adds r3, r0 - ldr r0, _0805326C - adds r3, r0 - strb r1, [r3] - mov r3, r12 - ldr r1, [r3] - movs r4, 0x16 - ldrsh r0, [r1, r4] - lsls r0, 6 - adds r1, r0 - ldr r0, _08053270 - adds r1, r0 - strb r2, [r1] - ldrb r2, [r6] - adds r0, r2, 0 - mov r1, r12 - b _08053282 - .align 2, 0 -_08053264: .4byte gDungeon -_08053268: .4byte 0x0001c070 -_0805326C: .4byte 0x0001c071 -_08053270: .4byte 0x0001c072 -_08053274: - cmp r7, r8 - bcs _0805327C - strb r2, [r7] - adds r7, 0x1 -_0805327C: - adds r6, 0x1 - ldrb r2, [r6] - adds r0, r2, 0 -_08053282: - cmp r0, 0 - beq _0805328A - cmp r0, 0xD - bne _08053274 -_0805328A: - movs r0, 0 - strb r0, [r7] - ldr r2, [r1] - ldrh r0, [r2, 0x16] - adds r0, 0x1 - strh r0, [r2, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080532A2 - movs r0, 0 - strh r0, [r2, 0x16] -_080532A2: - ldr r1, [r1] - movs r0, 0x1 - strb r0, [r1, 0xB] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8053210 - - thumb_func_start sub_80532B4 -sub_80532B4: - push {r4-r6,lr} - sub sp, 0xC - mov r0, sp - bl sub_801317C - movs r0, 0x9 - movs r1, 0 - bl sub_803EAF0 -_080532C6: - movs r0, 0xD - bl sub_803E46C - movs r0, 0 - bl sub_8008D8C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080532C6 - ldr r0, _08053374 - str r1, [r0] - ldr r4, _08053378 - strb r1, [r4] - bl sub_80533A4 - adds r6, r4, 0 -_080532E8: - movs r5, 0 - strb r5, [r6] - mov r0, sp - movs r1, 0 - bl nullsub_34 - movs r0, 0 - ldr r1, _0805337C - bl sub_8014140 - adds r4, r0, 0 - bl sub_8053430 - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r5, r1, 31 - adds r0, r4, 0 - bl sub_8053540 - lsls r0, 24 - cmp r0, 0 - beq _0805331A - movs r5, 0x1 -_0805331A: - cmp r5, 0 - bne _08053324 - movs r0, 0xD - bl sub_803E46C -_08053324: - ldrb r1, [r6] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0805333A - movs r0, 0x1 - movs r1, 0x8 - negs r1, r1 - bl sub_805363C -_0805333A: - ldrb r1, [r6] - movs r4, 0x2 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0805334E - movs r0, 0 - movs r1, 0x72 - bl sub_805363C -_0805334E: - bl sub_80048C8 - lsls r0, 24 - cmp r0, 0 - bne _080532E8 - ldr r0, _08053380 - ldrh r1, [r0, 0x2] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _0805336C - mov r0, sp - ldrb r0, [r0, 0x2] - cmp r0, 0 - beq _08053384 -_0805336C: - bl sub_8083D30 - b _08053390 - .align 2, 0 -_08053374: .4byte gUnknown_202F1F8 -_08053378: .4byte gUnknown_202F1FC -_0805337C: .4byte gUnknown_8106990 -_08053380: .4byte gRealInputs -_08053384: - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080532E8 - bl sub_8083D08 -_08053390: - movs r0, 0 - movs r1, 0 - bl sub_803EAF0 - movs r0, 0x1 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80532B4 - - thumb_func_start sub_80533A4 -sub_80533A4: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r5, _08053428 - ldr r0, [r5] - movs r1, 0x16 - ldrsh r4, [r0, r1] - movs r6, 0x10 - subs r4, 0x8 - cmp r4, 0 - bge _080533BE - adds r4, 0x14 -_080533BE: - movs r0, 0 - bl sub_80073B8 - mov r8, r5 - movs r7, 0x7 -_080533C8: - lsls r0, r4, 6 - ldr r2, _0805342C - adds r0, r2 - mov r2, r8 - ldr r1, [r2] - adds r5, r1, r0 - ldrb r0, [r5] - cmp r0, 0 - beq _08053402 - ldrb r0, [r5, 0x1] - cmp r0, 0 - beq _080533F0 - movs r0, 0x7 - str r0, [sp] - movs r0, 0 - movs r1, 0 - adds r2, r6, 0 - movs r3, 0xE0 - bl sub_80078A4 -_080533F0: - adds r1, r6, 0x3 - adds r2, r5, 0x3 - movs r0, 0xD - str r0, [sp] - movs r0, 0x8 - movs r3, 0 - bl PrintStringOnWindow - adds r6, 0xE -_08053402: - adds r4, 0x1 - cmp r4, 0x13 - ble _0805340A - movs r4, 0 -_0805340A: - subs r7, 0x1 - cmp r7, 0 - bge _080533C8 - movs r0, 0 - bl sub_80073E0 - movs r0, 0 - bl sub_8007334 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08053428: .4byte gDungeon -_0805342C: .4byte 0x0001c070 - thumb_func_end sub_80533A4 - - thumb_func_start sub_8053430 -sub_8053430: - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r3, _08053454 - ldr r0, [r3] - movs r2, 0x16 - ldrsh r1, [r0, r2] - ldr r2, _08053458 - ldr r0, [r2] - adds r1, r0 - movs r6, 0x2 - subs r1, 0x9 - cmp r1, 0 - bge _0805345E -_0805344C: - adds r1, 0x14 - cmp r1, 0 - blt _0805344C - b _0805345E - .align 2, 0 -_08053454: .4byte gDungeon -_08053458: .4byte gUnknown_202F1F8 -_0805345C: - subs r1, 0x14 -_0805345E: - cmp r1, 0x13 - bgt _0805345C - ldr r0, [r3] - lsls r1, 6 - adds r0, r1 - ldr r3, _0805349C - adds r0, r3 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0 - beq _08053498 - ldr r1, [r2] - movs r0, 0xC - negs r0, r0 - cmp r1, r0 - ble _08053498 - ldr r2, _080534A0 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r0, _080534A4 - ldrh r1, [r0, 0x4] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080534A8 - cmp r5, 0x1 - beq _080534A8 -_08053498: - movs r0, 0 - b _08053528 - .align 2, 0 -_0805349C: .4byte 0x0001c070 -_080534A0: .4byte gUnknown_202F1FC -_080534A4: .4byte gRealInputs -_080534A8: - movs r0, 0 - bl sub_8083CE0 - movs r0, 0 - bl sub_80073B8 - ldr r0, _08053530 - ldr r2, _08053534 - adds r1, r4, r2 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _080534FA - movs r0, 0x10 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0xD0 - bl sub_80087EC - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _080534EA - movs r0, 0x7 - str r0, [sp] - movs r0, 0 - movs r1, 0 - adds r2, r6, 0 - movs r3, 0xE0 - bl sub_80078A4 -_080534EA: - adds r1, r6, 0x3 - adds r2, r4, 0x3 - movs r0, 0xD - str r0, [sp] - movs r0, 0x8 - movs r3, 0 - bl PrintStringOnWindow -_080534FA: - movs r0, 0 - bl sub_80073E0 - movs r0, 0xD - bl sub_803E46C - ldr r5, _08053538 - movs r4, 0x6 -_0805350A: - ldr r1, [r5] - movs r0, 0 - bl _call_via_r1 - movs r0, 0xD - bl sub_803E46C - subs r4, 0x1 - cmp r4, 0 - bge _0805350A - ldr r1, _0805353C - ldr r0, [r1] - subs r0, 0x1 - str r0, [r1] - movs r0, 0x1 -_08053528: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .align 2, 0 -_08053530: .4byte gDungeon -_08053534: .4byte 0x0001c070 -_08053538: .4byte gUnknown_203B084 -_0805353C: .4byte gUnknown_202F1F8 - thumb_func_end sub_8053430 - - thumb_func_start sub_8053540 -sub_8053540: - push {r4,r5,lr} - sub sp, 0x4 - adds r3, r0, 0 - ldr r0, _08053564 - ldr r0, [r0] - movs r1, 0x16 - ldrsh r2, [r0, r1] - ldr r1, _08053568 - ldr r0, [r1] - adds r4, r2, r0 - movs r5, 0x80 - cmp r4, 0 - bge _0805356E -_0805355A: - adds r4, 0x14 - cmp r4, 0 - blt _0805355A - b _0805356E - .align 2, 0 -_08053564: .4byte gDungeon -_08053568: .4byte gUnknown_202F1F8 -_0805356C: - subs r4, 0x14 -_0805356E: - cmp r4, 0x13 - bgt _0805356C - ldr r0, [r1] - cmp r0, 0 - bge _08053592 - ldr r2, _08053598 - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldr r0, _0805359C - ldrh r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080535A0 - cmp r3, 0x2 - beq _080535A0 -_08053592: - movs r0, 0 - b _08053622 - .align 2, 0 -_08053598: .4byte gUnknown_202F1FC -_0805359C: .4byte gRealInputs -_080535A0: - movs r0, 0 - bl sub_8083CE0 - movs r0, 0 - bl sub_80073B8 - ldr r1, _0805362C - lsls r0, r4, 6 - ldr r2, _08053630 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0 - beq _080535F4 - movs r0, 0x10 - str r0, [sp] - movs r0, 0 - movs r1, 0 - adds r2, r5, 0 - movs r3, 0x68 - bl sub_80087EC - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _080535E4 - movs r0, 0x7 - str r0, [sp] - movs r0, 0 - movs r1, 0 - adds r2, r5, 0 - movs r3, 0xE0 - bl sub_80078A4 -_080535E4: - adds r1, r5, 0x3 - adds r2, r4, 0x3 - movs r0, 0xD - str r0, [sp] - movs r0, 0x8 - movs r3, 0 - bl PrintStringOnWindow -_080535F4: - movs r0, 0 - bl sub_80073E0 - movs r0, 0xD - bl sub_803E46C - ldr r5, _08053634 - movs r4, 0x6 -_08053604: - ldr r1, [r5] - movs r0, 0 - bl _call_via_r1 - movs r0, 0xD - bl sub_803E46C - subs r4, 0x1 - cmp r4, 0 - bge _08053604 - ldr r1, _08053638 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - movs r0, 0x1 -_08053622: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .align 2, 0 -_0805362C: .4byte gDungeon -_08053630: .4byte 0x0001c070 -_08053634: .4byte gUnknown_203B080 -_08053638: .4byte gUnknown_202F1F8 - thumb_func_end sub_8053540 - - thumb_func_start sub_805363C -sub_805363C: - push {r4-r7,lr} - mov r12, r1 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, _080536D0 - ldr r0, _080536D4 - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080536C8 - ldr r0, _080536D8 - ldrh r1, [r0] - ldr r3, _080536DC - ands r3, r1 - ldr r1, _080536E0 - ands r3, r1 - ldr r1, _080536E4 - ands r3, r1 - ldr r1, _080536E8 - ands r3, r1 - ldr r1, _080536EC - ands r3, r1 - negs r1, r2 - orrs r1, r2 - asrs r1, 31 - movs r2, 0x80 - lsls r2, 6 - ands r2, r1 - ldrh r1, [r0, 0x2] - ldr r4, _080536F0 - ands r4, r1 - orrs r4, r2 - movs r5, 0xF - ldr r2, _080536F4 - movs r6, 0x2 - ldrsh r1, [r7, r6] - lsls r1, 3 - add r1, r12 - ands r1, r2 - lsls r1, 4 - ldrh r2, [r0, 0x6] - ands r5, r2 - orrs r5, r1 - strh r5, [r0, 0x6] - movs r2, 0 - ldrsh r1, [r7, r2] - lsls r1, 3 - adds r1, 0x5C - ldr r2, _080536F8 - ands r1, r2 - movs r2, 0xFE - lsls r2, 8 - ands r4, r2 - orrs r4, r1 - movs r2, 0x80 - lsls r2, 7 - ldr r1, _080536FC - ands r3, r1 - orrs r3, r2 - strh r3, [r0] - ands r4, r1 - strh r4, [r0, 0x2] - ldr r1, _08053700 - strh r1, [r0, 0x4] - movs r1, 0x7F - movs r2, 0 - movs r3, 0 - bl AddSprite -_080536C8: - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080536D0: .4byte gUnknown_2027370 -_080536D4: .4byte gUnknown_202EDCC -_080536D8: .4byte gUnknown_202F200 -_080536DC: .4byte 0x0000feff -_080536E0: .4byte 0x0000fdff -_080536E4: .4byte 0x0000f3ff -_080536E8: .4byte 0x0000efff -_080536EC: .4byte 0x0000dfff -_080536F0: .4byte 0x0000c1ff -_080536F4: .4byte 0x00000fff -_080536F8: .4byte 0x000001ff -_080536FC: .4byte 0x00003fff -_08053700: .4byte 0x0000f3f0 - thumb_func_end sub_805363C - - thumb_func_start sub_8053704 -sub_8053704: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x48 - str r0, [sp, 0x10] - adds r7, r1, 0 - mov r8, r2 - mov r9, r3 - movs r0, 0 - str r0, [sp, 0x14] - ldrh r1, [r2, 0x2] - str r1, [sp, 0x18] - bl _08055570 -_08053724: - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _08053734 - bl _0805556A -_08053734: - str r7, [sp, 0x1C] - ldr r2, [r5, 0x70] - str r2, [sp, 0x24] - movs r3, 0xAD - lsls r3, 1 - adds r0, r2, r3 - add r1, sp, 0x20 - ldrb r1, [r1] - strb r1, [r0] - ldr r0, [sp, 0x18] - bl CanBeSnatched - lsls r0, 24 - cmp r0, 0 - beq _080537B4 - ldr r6, _080537A4 - ldr r0, [r6] - ldr r2, _080537A8 - adds r0, r2 - ldr r4, [r0] - cmp r4, 0 - beq _080537B4 - adds r0, r4, 0 - bl GetEntityType - cmp r0, 0x1 - beq _0805376C - b _08053A1C -_0805376C: - cmp r4, r7 - bne _08053772 - b _08053A1C -_08053772: - ldr r1, [r4, 0x70] - adds r1, 0x98 - ldr r0, [r6] - ldr r3, _080537AC - adds r0, r3 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - beq _08053786 - b _08053A1C -_08053786: - ldr r0, [sp, 0x24] - adds r0, 0xFF - ldrb r0, [r0] - cmp r0, 0 - beq _08053792 - b _08053A1C -_08053792: - ldr r0, _080537B0 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - adds r5, r4, 0 - b _08053A1C - .align 2, 0 -_080537A4: .4byte gDungeon -_080537A8: .4byte 0x00017b30 -_080537AC: .4byte 0x00017b3c -_080537B0: .4byte gUnknown_80FCD28 -_080537B4: - adds r0, r7, 0 - mov r1, r8 - bl GetMoveTypeForMonster - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _08053854 - ldr r2, _08053844 - ldr r0, [r2] - ldr r1, _08053848 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _08053854 - adds r4, r0, 0 - str r2, [sp, 0x44] - bl GetEntityType - ldr r2, [sp, 0x44] - cmp r0, 0x1 - beq _080537E2 - b _08053A1C -_080537E2: - ldr r6, [r4, 0x70] - adds r1, r6, 0 - adds r1, 0x98 - ldr r0, [r2] - ldr r2, _0805384C - adds r0, r2 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - beq _080537F8 - b _08053A1C -_080537F8: - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0 - bl GetTreatmentBetweenMonsters - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0805380E - b _08053A1C -_0805380E: - ldr r0, [sp, 0x24] - adds r0, 0xFF - ldrb r0, [r0] - cmp r0, 0 - bne _08053822 - adds r0, r6, 0 - adds r0, 0xFF - ldrb r0, [r0] - cmp r0, 0 - beq _08053828 -_08053822: - cmp r5, r4 - beq _08053828 - b _08053A1C -_08053828: - adds r0, r4, 0 - bl sub_8042930 - ldr r0, _08053850 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - adds r5, r4, 0 - movs r3, 0x1 - str r3, [sp, 0x2C] - b _08053A1C - .align 2, 0 -_08053844: .4byte gDungeon -_08053848: .4byte 0x00017b2c -_0805384C: .4byte 0x00017b38 -_08053850: .4byte gUnknown_80FCD0C -_08053854: - adds r0, r5, 0 - movs r1, 0x2C - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - bne _08053864 - b _08053A1C -_08053864: - adds r0, r5, 0 - movs r1, 0 - bl CannotAttack - lsls r0, 24 - cmp r0, 0 - beq _08053874 - b _08053A1C -_08053874: - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl GetMoveTargetAndRangeForPokemon - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0 - beq _08053888 - b _08053A1C -_08053888: - ldr r1, [sp, 0x24] - movs r2, 0x9E - lsls r2, 1 - adds r0, r1, r2 - ldr r0, [r0] - bl FixedPointToInt - ldr r1, _080538C4 - movs r3, 0 - ldrsh r1, [r1, r3] - cmp r0, r1 - bge _080538A2 - b _08053A1C -_080538A2: - ldr r0, [sp, 0x24] - adds r0, 0xFF - ldrb r0, [r0] - cmp r0, 0 - beq _080538AE - b _08053A1C -_080538AE: - ldr r0, [sp, 0x24] - adds r0, 0x46 - ldrb r4, [r0] - mov r10, r4 - bl IsBossFight - lsls r0, 24 - cmp r0, 0 - beq _080538CC - ldr r0, _080538C8 - b _080539FA - .align 2, 0 -_080538C4: .4byte gUnknown_80F5006 -_080538C8: .4byte gUnknown_80FDD88 -_080538CC: - movs r0, 0 - str r0, [sp, 0x34] - movs r2, 0x9E - lsls r2, 1 - ldr r1, [sp, 0x24] - adds r2, r1, r2 - str r2, [sp, 0x3C] -_080538DA: - movs r3, 0x1 - add r10, r3 - movs r0, 0x7 - mov r1, r10 - ands r1, r0 - mov r10, r1 - movs r2, 0x4 - ldrsh r0, [r5, r2] - ldr r1, _080539B4 - mov r3, r10 - lsls r2, r3, 2 - adds r2, r1 - movs r3, 0 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r3, 0x6 - ldrsh r1, [r5, r3] - movs r3, 0x2 - ldrsh r2, [r2, r3] - adds r1, r2 - bl GetTile - ldr r0, [r0, 0x10] - str r0, [sp, 0x38] - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _080539DC - ldr r0, [sp, 0x38] - bl GetEntityType - cmp r0, 0x1 - bne _080539DC - adds r0, r5, 0 - bl sub_8045888 - lsls r0, 24 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x40] - cmp r0, 0 - beq _0805397C - movs r6, 0x17 -_08053932: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806CE68 - movs r0, 0x2 - movs r1, 0x43 - bl sub_803E708 - adds r4, 0x1 - movs r2, 0x7 - ands r4, r2 - subs r6, 0x1 - cmp r6, 0 - bge _08053932 - cmp r4, r10 - beq _0805396C - movs r6, 0x7 -_08053954: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806CE68 - movs r0, 0x2 - movs r1, 0x43 - bl sub_803E708 - adds r4, 0x1 - ands r4, r6 - cmp r4, r10 - bne _08053954 -_0805396C: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806CE68 - movs r0, 0x2 - movs r1, 0x43 - bl sub_803E708 -_0805397C: - ldr r3, [sp, 0x3C] - ldr r4, [r3] - ldr r0, _080539B8 - movs r2, 0 - ldrsh r1, [r0, r2] - add r0, sp, 0x8 - bl IntToFixedPoint - ldr r2, [sp, 0x8] - ldr r0, [sp, 0x40] - adds r1, r4, 0 - bl FixedPoint_Subtract - ldr r0, [sp, 0xC] - ldr r3, [sp, 0x3C] - str r0, [r3] - mov r0, r8 - ldrh r1, [r0, 0x2] - ldr r0, _080539BC - cmp r1, r0 - bne _080539C4 - ldr r0, _080539C0 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - b _080539D0 - .align 2, 0 -_080539B4: .4byte gAdjacentTileOffsets -_080539B8: .4byte gUnknown_80F5006 -_080539BC: .4byte 0x00000163 -_080539C0: .4byte gUnknown_80FDDA8 -_080539C4: - ldr r0, _080539D8 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 -_080539D0: - str r5, [sp, 0x20] - ldr r5, [sp, 0x38] - b _080539E8 - .align 2, 0 -_080539D8: .4byte gUnknown_80FDD20 -_080539DC: - ldr r1, [sp, 0x34] - adds r1, 0x1 - str r1, [sp, 0x34] - cmp r1, 0x7 - bgt _080539E8 - b _080538DA -_080539E8: - ldr r2, [sp, 0x34] - cmp r2, 0x8 - bne _08053A1C - mov r3, r8 - ldrh r1, [r3, 0x2] - ldr r0, _08053A08 - cmp r1, r0 - bne _08053A10 - ldr r0, _08053A0C -_080539FA: - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - b _08053A1C - .align 2, 0 -_08053A08: .4byte 0x00000163 -_08053A0C: .4byte gUnknown_80FDDAC -_08053A10: - ldr r0, _08053AD8 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 -_08053A1C: - ldr r1, _08053ADC - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, _08053AE0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, [r5, 0x70] - str r0, [sp, 0x24] - movs r6, 0xAD - lsls r6, 1 - adds r1, r0, r6 - movs r0, 0 - strb r0, [r1] - ldr r1, [sp, 0x24] - ldrb r0, [r1, 0x6] - cmp r0, 0 - beq _08053A4C - movs r2, 0xB6 - lsls r2, 1 - adds r1, r2 - ldr r0, [r7, 0x4] - str r0, [r1] -_08053A4C: - adds r0, r5, 0 - bl sub_806A1E8 - adds r0, r7, 0 - adds r1, r5, 0 - bl TrySendImmobilizeSleepEndMsg - movs r4, 0 - adds r0, r7, 0 - mov r1, r8 - bl MoveMatchesChargingStatus - lsls r0, 24 - cmp r0, 0 - bne _08053A7E - mov r3, r8 - ldrh r1, [r3, 0x2] - adds r0, r7, 0 - bl sub_805755C - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 -_08053A7E: - ldr r0, [sp, 0x2C] - cmp r0, 0 - beq _08053A86 - b _08053BAE -_08053A86: - ldr r0, [sp, 0x24] - adds r0, 0xC4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _08053AE8 - ldr r0, [sp, 0x18] - bl IsReflectedByMagicCoat - lsls r0, 24 - cmp r0, 0 - beq _08053B5C - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_8055988 - lsls r0, 24 - cmp r0, 0 - beq _08053B5C - ldr r0, _08053AE4 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - adds r0, r5, 0 - bl sub_8041B48 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_80559DC - adds r5, r7, 0 - ldr r1, [r7, 0x70] - str r1, [sp, 0x24] - adds r0, r1, r6 - add r2, sp, 0x2C - ldrb r2, [r2] - strb r2, [r0] - movs r3, 0x1 - str r3, [sp, 0x30] - b _08053B5C - .align 2, 0 -_08053AD8: .4byte gUnknown_80FDD48 -_08053ADC: .4byte gUnknown_202F208 -_08053AE0: .4byte gUnknown_202F20C -_08053AE4: .4byte gUnknown_80FC52C -_08053AE8: - cmp r0, 0xB - bne _08053B5C - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl GetMoveTargetAndRangeForPokemon - lsls r0, 16 - asrs r1, r0, 16 - ldr r0, _08053C88 - ldr r2, [sp, 0x18] - cmp r2, r0 - beq _08053B5C - adds r0, 0x32 - cmp r2, r0 - beq _08053B5C - cmp r4, 0 - bne _08053B5C - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _08053B20 - cmp r0, 0x4 - beq _08053B20 - cmp r0, 0x5 - beq _08053B20 - cmp r0, 0x2 - bne _08053B5C -_08053B20: - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_8055988 - lsls r0, 24 - cmp r0, 0 - beq _08053B5C - ldr r0, _08053C8C - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - adds r0, r5, 0 - bl sub_8041BA8 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_80559DC - adds r5, r7, 0 - ldr r3, [r7, 0x70] - str r3, [sp, 0x24] - movs r0, 0xAD - lsls r0, 1 - adds r1, r3, r0 - movs r0, 0 - strb r0, [r1] - movs r1, 0x1 - str r1, [sp, 0x30] -_08053B5C: - ldr r2, [sp, 0x2C] - cmp r2, 0 - bne _08053BAE - ldr r0, [sp, 0x24] - adds r0, 0xC4 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08053BAE - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl GetMoveTargetAndRangeForPokemon - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 12 - ands r1, r0 - asrs r1, 16 - cmp r1, 0 - beq _08053B90 - cmp r1, 0x4 - beq _08053B90 - cmp r1, 0x5 - beq _08053B90 - cmp r1, 0x2 - bne _08053BAE -_08053B90: - cmp r4, 0 - bne _08053BAE - ldr r0, _08053C90 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, _08053C94 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - movs r3, 0 - str r3, [sp, 0x28] -_08053BAE: - adds r0, r5, 0 - mov r1, r8 - bl sub_80571F0 - lsls r0, 24 - cmp r0, 0 - beq _08053BC0 - movs r0, 0 - str r0, [sp, 0x28] -_08053BC0: - ldr r1, [sp, 0x28] - cmp r1, 0 - beq _08053C4A - adds r0, r5, 0 - movs r1, 0x3C - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _08053BFA - mov r0, r8 - bl IsSoundMove - lsls r0, 24 - cmp r0, 0 - beq _08053BFA - ldr r0, _08053C90 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, _08053C98 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - movs r2, 0 - str r2, [sp, 0x28] -_08053BFA: - ldr r3, [sp, 0x28] - cmp r3, 0 - beq _08053C4A - movs r0, 0 - ldr r1, [sp, 0x30] - cmp r1, 0 - bne _08053C0A - movs r0, 0x1 -_08053C0A: - adds r2, r0, 0 - mov r3, r8 - ldrh r1, [r3, 0x2] - cmp r1, 0x68 - beq _08053C20 - ldr r0, _08053C9C - cmp r1, r0 - beq _08053C20 - subs r0, 0x4 - cmp r1, r0 - bne _08053C22 -_08053C20: - movs r2, 0 -_08053C22: - str r2, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - movs r3, 0 - bl sub_8056B34 - lsls r0, 24 - cmp r0, 0 - bne _08053C3A - movs r0, 0 - str r0, [sp, 0x28] -_08053C3A: - ldr r1, [sp, 0x28] - cmp r1, 0 - beq _08053C4A - ldr r2, [sp, 0x2C] - cmp r2, 0 - beq _08053C4A - movs r3, 0 - str r3, [sp, 0x28] -_08053C4A: - adds r0, r5, 0 - bl sub_8045888 - lsls r0, 24 - cmp r0, 0 - beq _08053C6A - movs r0, 0x4 - movs r1, 0x4A - bl sub_803E708 - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - movs r3, 0 - bl sub_8041168 -_08053C6A: - ldr r0, [sp, 0x28] - cmp r0, 0 - beq _08053C72 - b _08053D72 -_08053C72: - ldr r0, [r7, 0x70] - ldrb r0, [r0, 0x7] - cmp r0, 0 - beq _08053CA0 - movs r1, 0xAB - lsls r1, 1 - adds r0, r7, 0 - bl sub_80421C0 - b _08053CA8 - .align 2, 0 -_08053C88: .4byte 0x00000163 -_08053C8C: .4byte gUnknown_80FC558 -_08053C90: .4byte gUnknown_202DFE8 -_08053C94: .4byte gUnknown_80FC574 -_08053C98: .4byte gUnknown_8100524 -_08053C9C: .4byte 0x00000131 -_08053CA0: - ldr r1, _08053CC4 - adds r0, r7, 0 - bl sub_80421C0 -_08053CA8: - ldr r0, _08053CC8 - ldr r1, [r5, 0x70] - movs r2, 0 - bl SetMessageArgument_2 - cmp r7, r5 - bne _08053CD0 - ldr r0, _08053CCC - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r7, 0 - bl sub_80522F4 - b _08053D10 - .align 2, 0 -_08053CC4: .4byte 0x00000157 -_08053CC8: .4byte gUnknown_202DFE8 -_08053CCC: .4byte gUnknown_80F9380 -_08053CD0: - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0 - bl GetTreatmentBetweenMonsters - lsls r0, 24 - cmp r0, 0 - bne _08053CEC - ldr r0, _08053CE8 - b _08053CF4 - .align 2, 0 -_08053CE8: .4byte gUnknown_80F9384 -_08053CEC: - ldr r1, [sp, 0x2C] - cmp r1, 0 - beq _08053D04 - ldr r0, _08053D00 -_08053CF4: - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 - b _08053D10 - .align 2, 0 -_08053D00: .4byte gUnknown_80F93A4 -_08053D04: - ldr r0, _08053D48 - ldr r2, [r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80522F4 -_08053D10: - adds r0, r5, 0 - bl sub_8045888 - lsls r0, 24 - cmp r0, 0 - beq _08053D2A - ldr r0, _08053D4C - movs r3, 0x1 - negs r3, r3 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_803ED30 -_08053D2A: - ldr r2, [sp, 0x18] - cmp r2, 0xCC - beq _08053D50 - cmp r2, 0xCE - bne _08053D60 - movs r0, 0x1 - str r0, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059FC8 - b _08053D60 - .align 2, 0 -_08053D48: .4byte gUnknown_80F9364 -_08053D4C: .4byte 0x0000270f -_08053D50: - movs r0, 0x1 - str r0, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059E54 -_08053D60: - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - beq _08053D6E - bl _080555A2 -_08053D6E: - bl _08055568 -_08053D72: - ldr r0, [sp, 0x24] - adds r0, 0xFB - ldrb r3, [r0] - mov r10, r3 - ldr r2, [sp, 0x24] - ldrb r1, [r2, 0x6] - adds r6, r0, 0 - cmp r1, 0 - beq _08053DA8 - mov r3, r8 - ldrh r1, [r3, 0x2] - ldr r0, _08053E88 - cmp r1, r0 - beq _08053D9E - mov r0, r9 - cmp r0, 0 - bne _08053D9E - mov r1, r10 - cmp r1, 0 - bne _08053D9E - movs r0, 0x1 - strb r0, [r6] -_08053D9E: - ldr r2, [sp, 0x68] - cmp r2, 0x1 - bne _08053DA8 - movs r0, 0x2 - strb r0, [r6] -_08053DA8: - ldr r3, [sp, 0x24] - movs r0, 0xB2 - lsls r0, 1 - adds r4, r3, r0 - ldrb r0, [r4] - cmp r0, 0xFF - bne _08053DCE - adds r0, r5, 0 - movs r1, 0xE3 - bl sub_80717A4 - lsls r0, 24 - cmp r0, 0 - beq _08053DCE - adds r0, r5, 0x4 - adds r1, r7, 0x4 - bl GetDirectionTowardsPosition - strb r0, [r4] -_08053DCE: - ldr r1, [sp, 0x24] - ldr r2, _08053E8C - adds r4, r1, r2 - ldrb r0, [r4] - cmp r0, 0xFF - bne _08053DF2 - adds r0, r5, 0 - movs r1, 0x19 - bl sub_80717A4 - lsls r0, 24 - cmp r0, 0 - beq _08053DF2 - adds r0, r5, 0x4 - adds r1, r7, 0x4 - bl GetDirectionTowardsPosition - strb r0, [r4] -_08053DF2: - adds r0, r5, 0 - movs r1, 0x39 - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _08053E4A - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0 - bl GetTreatmentBetweenMonsters - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08053E4A - mov r3, r8 - ldrh r1, [r3, 0x2] - ldr r0, _08053E88 - cmp r1, r0 - beq _08053E4A - subs r0, 0x3 - cmp r1, r0 - beq _08053E4A - mov r0, r9 - cmp r0, 0 - bne _08053E4A - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _08053E4A - ldrb r1, [r3, 0x1] - movs r4, 0x10 - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08053E42 - adds r0, r7, 0 - bl sub_8042950 -_08053E42: - mov r1, r8 - ldrb r0, [r1, 0x1] - orrs r0, r4 - strb r0, [r1, 0x1] -_08053E4A: - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl GetMoveTargetAndRangeForPokemon - movs r1, 0xF - ands r1, r0 - cmp r1, 0 - bne _08053E64 - adds r0, r7, 0 - adds r1, r5, 0 - bl SetShopkeeperAggression -_08053E64: - ldr r2, [sp, 0x24] - movs r3, 0xAC - lsls r3, 1 - adds r0, r2, r3 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0xCE - lsls r0, 1 - ldr r1, [sp, 0x18] - cmp r1, r0 - bls _08053E7E - bl _080554C0 -_08053E7E: - lsls r0, r1, 2 - ldr r1, _08053E90 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08053E88: .4byte 0x00000163 -_08053E8C: .4byte 0x00000165 -_08053E90: .4byte _08053E94 - .align 2, 0 -_08053E94: - .4byte _08054520 - .4byte _08054DB8 - .4byte _08054C18 - .4byte _08054888 - .4byte _08054878 - .4byte _08054D80 - .4byte _08054D8E - .4byte _08054FB0 - .4byte _08054FE8 - .4byte _08054508 - .4byte _08054FF6 - .4byte _08055270 - .4byte _08055190 - .4byte _080548C8 - .4byte _080552B6 - .4byte _08054E1A - .4byte _0805527E - .4byte _080551F2 - .4byte _08054508 - .4byte _080549C8 - .4byte _08054EEC - .4byte _08054968 - .4byte _08054EDE - .4byte _0805528C - .4byte _08054B18 - .4byte _08055422 - .4byte _08054E1A - .4byte _08054AB8 - .4byte _08054508 - .4byte _0805529A - .4byte _080547A8 - .4byte _08055200 - .4byte _0805460A - .4byte _08054948 - .4byte _08054878 - .4byte _0805519E - .4byte _080545AE - .4byte _0805514A - .4byte _08054CD4 - .4byte _08054508 - .4byte _08055396 - .4byte _08054EB4 - .4byte _08054A68 - .4byte _08054C28 - .4byte _08054A58 - .4byte _08054E8A - .4byte _080547A8 - .4byte _08054DD4 - .4byte _080553DC - .4byte _0805504A - .4byte _080554A0 - .4byte _08054CD4 - .4byte _0805455E - .4byte _0805456E - .4byte _080552D2 - .4byte _080549B8 - .4byte _08055004 - .4byte _0805453E - .4byte _08054F94 - .4byte _08054818 - .4byte _08054D56 - .4byte _08054CE2 - .4byte _080547B8 - .4byte _08054788 - .4byte _08054868 - .4byte _08054868 - .4byte _08054F16 - .4byte _08055112 - .4byte _080545AE - .4byte _080545FA - .4byte _08054F94 - .4byte _080546D8 - .4byte _08054F86 - .4byte _08054928 - .4byte _0805459E - .4byte _08054D64 - .4byte _08054AD8 - .4byte _080550DA - .4byte _08054E52 - .4byte _08054878 - .4byte _08054AD8 - .4byte _080545AE - .4byte _080546E8 - .4byte _08054ED0 - .4byte _08054878 - .4byte _080550CC - .4byte _0805462A - .4byte _080545AE - .4byte _08054E28 - .4byte _0805462A - .4byte _080545AE - .4byte _08054B78 - .4byte _08055120 - .4byte _080546E8 - .4byte _08054C48 - .4byte _08054CC6 - .4byte _080551D6 - .4byte _08054928 - .4byte _08054FA2 - .4byte _08054A38 - .4byte _08054B58 - .4byte _0805457E - .4byte _08055090 - .4byte _080547E8 - .4byte _08055238 - .4byte _08054C18 - .4byte _08054A88 - .4byte _080546F8 - .4byte _08054DF0 - .4byte _0805464A - .4byte _08054A78 - .4byte _08054878 - .4byte _08054B98 - .4byte _0805512E - .4byte _080546F8 - .4byte _08055414 - .4byte _08054AF8 - .4byte _08054C78 - .4byte _0805452E - .4byte _0805536C - .4byte _08054768 - .4byte _080550DA - .4byte _08054DC6 - .4byte _080550E8 - .4byte _08054858 - .4byte _080545FA - .4byte _08054508 - .4byte _080547B8 - .4byte _08055104 - .4byte _08054898 - .4byte _08054BF8 - .4byte _080545CA - .4byte _08054508 - .4byte _08054778 - .4byte _08054BE8 - .4byte _08054B08 - .4byte _08054508 - .4byte _080553B2 - .4byte _08055388 - .4byte _08054798 - .4byte _08054AE8 - .4byte _08054BD8 - .4byte _08054EA6 - .4byte _080545FA - .4byte _08054768 - .4byte _08054508 - .4byte _08054EA6 - .4byte _08054738 - .4byte _080549F8 - .4byte _08054748 - .4byte _080545DA - .4byte _08054B48 - .4byte _08054838 - .4byte _08054FBE - .4byte _08054508 - .4byte _080550F6 - .4byte _08054FDA - .4byte _0805456E - .4byte _08054508 - .4byte _08054A48 - .4byte _08055166 - .4byte _08054508 - .4byte _080546C8 - .4byte _08054508 - .4byte _08054B38 - .4byte _08054C38 - .4byte _08054508 - .4byte _08054508 - .4byte _08054508 - .4byte _08054988 - .4byte _08054AC8 - .4byte _080548C8 - .4byte _080550BE - .4byte _08054C58 - .4byte _08054508 - .4byte _08054508 - .4byte _08054508 - .4byte _080548B8 - .4byte _08054508 - .4byte _08054508 - .4byte _08054508 - .4byte _080549D8 - .4byte _08054508 - .4byte _080553C0 - .4byte _08055468 - .4byte _08055246 - .4byte _08054A28 - .4byte _08054F5C - .4byte _08054758 - .4byte _08054508 - .4byte _08054508 - .4byte _080548C8 - .4byte _080548E8 - .4byte _08054908 - .4byte _080548A8 - .4byte _080549B8 - .4byte _080548D8 - .4byte _08054EC2 - .4byte _08054BA8 - .4byte _080548D8 - .4byte _0805463A - .4byte _08054508 - .4byte _08054A28 - .4byte _08054AF8 - .4byte _0805509E - .4byte _08054FCC - .4byte _08054D28 - .4byte _080547D8 - .4byte _08054508 - .4byte _08054C98 - .4byte _08054B28 - .4byte _08054508 - .4byte _08054DAA - .4byte _08054E98 - .4byte _08054CB8 - .4byte _08054A08 - .4byte _08054AC8 - .4byte _08054A98 - .4byte _08054C78 - .4byte _0805461A - .4byte _080553A4 - .4byte _08054788 - .4byte _08054508 - .4byte _0805520E - .4byte _08054DC6 - .4byte _08054E7C - .4byte _08054828 - .4byte _08054D0C - .4byte _0805521C - .4byte _08055066 - .4byte _0805456E - .4byte _08054878 - .4byte _08054C68 - .4byte _08054DE2 - .4byte _080546F8 - .4byte _08054768 - .4byte _08055182 - .4byte _08054D1A - .4byte _0805458E - .4byte _0805458E - .4byte _08054508 - .4byte _08054508 - .4byte _0805458E - .4byte _08054918 - .4byte _0805469C - .4byte _08055174 - .4byte _08054938 - .4byte _080545DA - .4byte _08054508 - .4byte _08055012 - .4byte _08054508 - .4byte _080545AE - .4byte _08054F24 - .4byte _08054B78 - .4byte _080552E0 - .4byte _080546D8 - .4byte _08055074 - .4byte _08055254 - .4byte _08054A28 - .4byte _08054C08 - .4byte _08054508 - .4byte _08054778 - .4byte _0805456E - .4byte _0805535E - .4byte _080547C8 - .4byte _080549A8 - .4byte _08055326 - .4byte _08054AA8 - .4byte _08054958 - .4byte _0805530A - .4byte _0805457E - .4byte _08054788 - .4byte _08054D3A - .4byte _08054EA6 - .4byte _080548C8 - .4byte _08054728 - .4byte _080547F8 - .4byte _08054BB8 - .4byte _0805513C - .4byte _0805463A - .4byte _0805463A - .4byte _080548F8 - .4byte _080552A8 - .4byte _080546B8 - .4byte _08054958 - .4byte _08054508 - .4byte _080553F8 - .4byte _08054CB8 - .4byte _08054978 - .4byte _08054778 - .4byte _08054508 - .4byte _080545FA - .4byte _0805456E - .4byte _080551C8 - .4byte _08054B88 - .4byte _08054E0C - .4byte _08054E60 - .4byte _08054508 - .4byte _08054D72 - .4byte _08054928 - .4byte _08054508 - .4byte _080550B0 - .4byte _08054A18 - .4byte _08054788 - .4byte _08055090 - .4byte _080550B0 - .4byte _08054508 - .4byte _08054DAA - .4byte _08054508 - .4byte _08054708 - .4byte _080547C8 - .4byte _08054508 - .4byte _08054508 - .4byte _080551E4 - .4byte _08054EFA - .4byte _080552D2 - .4byte _080551BA - .4byte _08055074 - .4byte _08054C38 - .4byte _080549E8 - .4byte _08054AD8 - .4byte _08054508 - .4byte _08054508 - .4byte _08054508 - .4byte _08054D48 - .4byte _08054680 - .4byte _08054808 - .4byte _08055492 - .4byte _08055406 - .4byte _08054DFE - .4byte _0805544C - .4byte _08054F32 - .4byte _08054664 - .4byte _080549B8 - .4byte _080553EA - .4byte _08054718 - .4byte _080545AE - .4byte _08055430 - .4byte _08054BC8 - .4byte _08054E1A - .4byte _08054CE2 - .4byte _08054848 - .4byte _08054768 - .4byte _08054998 - .4byte _0805457E - .4byte _0805457E - .4byte _08054508 - .4byte _08054508 - .4byte _08054E6E - .4byte _08054FA2 - .4byte _08054508 - .4byte _08054A88 - .4byte _0805454E - .4byte _08054508 - .4byte _08054AF8 - .4byte _08054512 - .4byte _080554C0 - .4byte _08054CF0 - .4byte _080554C0 - .4byte _080554C0 - .4byte _08054508 - .4byte _0805529A - .4byte _08054508 - .4byte _08055158 - .4byte _08054CA8 - .4byte _08055318 - .4byte _08054508 - .4byte _08054F24 - .4byte _08054958 - .4byte _08054F5C - .4byte _080552EE - .4byte _08054B68 - .4byte _08054CC6 - .4byte _08054F40 - .4byte _08055058 - .4byte _080552FC - .4byte _08055476 - .4byte _08055484 - .4byte _080553CE - .4byte _08055326 - .4byte _08055090 - .4byte _08054E44 - .4byte _080548C8 - .4byte _08054F08 - .4byte _0805543E - .4byte _08055350 - .4byte _08054C88 - .4byte _08054E36 - .4byte _08054F6A - .4byte _08055020 - .4byte _08055334 - .4byte _080551AC - .4byte _080545EA - .4byte _0805545A - .4byte _08054D9C - .4byte _08055342 - .4byte _08055082 - .4byte _080554AE - .4byte _08055262 - .4byte _0805522A - .4byte _08054F4E - .4byte _08054CFE - .4byte _080554C0 - .4byte _0805537A - .4byte _080554C0 - .4byte _080554C0 - .4byte _080554A0 - .4byte _080552C4 - .4byte _080554C0 - .4byte _08054F78 - .4byte _0805502E - .4byte _080554C0 - .4byte _0805503C -_08054508: - movs r3, 0x80 - lsls r3, 1 - mov r2, r9 - str r2, [sp] - b _080545B6 -_08054512: - mov r3, r9 - str r3, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - movs r3, 0x80 - b _080545BC -_08054520: - mov r0, r9 - str r0, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - movs r3, 0 - b _080545BC -_0805452E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058F04 - bl _080554BA -_0805453E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058270 - bl _080554BA -_0805454E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B968 - bl _080554BA -_0805455E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805816C - bl _080554BA -_0805456E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80581D0 - bl _080554BA -_0805457E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058B3C - bl _080554BA -_0805458E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A568 - bl _080554BA -_0805459E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl FocusEnergyMoveAction - bl _080554BA -_080545AE: - movs r3, 0x80 - lsls r3, 1 - mov r1, r9 - str r1, [sp] -_080545B6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 -_080545BC: - bl sub_8055640 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - bl _080554C2 -_080545CA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80590D4 - bl _080554BA -_080545DA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80595EC - bl _080554BA -_080545EA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C138 - bl _080554BA -_080545FA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B17C - bl _080554BA -_0805460A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl WhirlpoolMoveAction - bl _080554BA -_0805461A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SurfMoveAction - bl _080554BA -_0805462A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805889C - bl _080554BA -_0805463A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059E0C - bl _080554BA -_0805464A: - ldr r0, _08054660 - ldr r3, [r0] - mov r2, r9 - str r2, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - bl sub_8058C98 - bl _080554BA - .align 2, 0 -_08054660: .4byte gUnknown_8106A50 -_08054664: - ldr r0, _0805467C - ldr r3, [r0] - mov r0, r9 - str r0, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - bl sub_8058C98 - bl _080554BA - .align 2, 0 -_0805467C: .4byte gUnknown_8106A4C -_08054680: - ldr r0, _08054698 - ldr r3, [r0] - mov r1, r9 - str r1, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - bl sub_805B3FC - bl _080554BA - .align 2, 0 -_08054698: .4byte gUnknown_8106A4C -_0805469C: - ldr r0, _080546B4 - ldr r3, [r0] - mov r2, r9 - str r2, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - bl sub_805A5E8 - bl _080554BA - .align 2, 0 -_080546B4: .4byte gUnknown_8106A4C -_080546B8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B074 - bl _080554BA -_080546C8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059928 - bl _080554BA -_080546D8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058580 - bl _080554BA -_080546E8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058930 - bl _080554BA -_080546F8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058C00 - bl _080554BA -_08054708: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B324 - bl _080554BA -_08054718: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B910 - bl _080554BA -_08054728: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AE74 - bl _080554BA -_08054738: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059540 - bl _080554BA -_08054748: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80595A0 - bl _080554BA -_08054758: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059D00 - bl _080554BA -_08054768: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058FBC - bl _080554BA -_08054778: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059190 - bl _080554BA -_08054788: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058430 - bl _080554BA -_08054798: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059424 - bl _080554BA -_080547A8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057C88 - bl _080554BA -_080547B8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80583D8 - bl _080554BA -_080547C8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AC90 - bl _080554BA -_080547D8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl TriAttackMoveAction - bl _080554BA -_080547E8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058B84 - bl _080554BA -_080547F8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AECC - bl _080554BA -_08054808: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B454 - bl _080554BA -_08054818: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80582C4 - bl _080554BA -_08054828: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A408 - bl _080554BA -_08054838: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059714 - bl _080554BA -_08054848: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B808 - bl _080554BA -_08054858: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059050 - bl _080554BA -_08054868: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058478 - bl _080554BA -_08054878: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80576F8 - bl _080554BA -_08054888: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl YawnMoveAction - bl _080554BA -_08054898: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059080 - bl _080554BA -_080548A8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059D98 - bl _080554BA -_080548B8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059AF8 - bl _080554BA -_080548C8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059AA8 - bl _080554BA -_080548D8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059DA4 - bl _080554BA -_080548E8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059D48 - bl _080554BA -_080548F8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B028 - bl _080554BA -_08054908: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059D58 - bl _080554BA -_08054918: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl TickleMoveAction - bl _080554BA -_08054928: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058638 - bl _080554BA -_08054938: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A688 - bl _080554BA -_08054948: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057D7C - bl _080554BA -_08054958: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B0BC - bl _080554BA -_08054968: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl PainSplitMoveAction - bl _080554BA -_08054978: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B164 - bl _080554BA -_08054988: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059A18 - bl _080554BA -_08054998: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B884 - bl _080554BA -_080549A8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl BulkUpMoveAction - bl _080554BA -_080549B8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80582D4 - bl _080554BA -_080549C8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl RageMoveAction - bl _080554BA -_080549D8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059B94 - bl _080554BA -_080549E8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B3B4 - bl _080554BA -_080549F8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059588 - bl _080554BA -_08054A08: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A2B0 - bl _080554BA -_08054A18: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B2FC - bl _080554BA -_08054A28: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059CD8 - bl _080554BA -_08054A38: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058A7C - bl _080554BA -_08054A48: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80598CC - bl _080554BA -_08054A58: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057F7C - bl _080554BA -_08054A68: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057ED0 - bl _080554BA -_08054A78: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058CEC - bl _080554BA -_08054A88: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058BF0 - bl _080554BA -_08054A98: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A2C8 - bl _080554BA -_08054AA8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AD34 - bl _080554BA -_08054AB8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057C68 - bl _080554BA -_08054AC8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059A2C - bl _080554BA -_08054AD8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80586DC - bl _080554BA -_08054AE8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805946C - bl _080554BA -_08054AF8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058E5C - bl _080554BA -_08054B08: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80591E4 - bl _080554BA -_08054B18: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057BC4 - bl _080554BA -_08054B28: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A210 - bl _080554BA -_08054B38: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059988 - bl _080554BA -_08054B48: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SolarBeamMoveAction - bl _080554BA -_08054B58: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SkyAttackMoveAction - bl _080554BA -_08054B68: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BE90 - bl _080554BA -_08054B78: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80588B8 - bl _080554BA -_08054B88: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl WrapMoveAction - bl _080554BA -_08054B98: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058D38 - bl _080554BA -_08054BA8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059DC4 - bl _080554BA -_08054BB8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl PresentMoveAction - bl _080554BA -_08054BC8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl ReflectMoveAction - bl _080554BA -_08054BD8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SandstormMoveAction - bl _080554BA -_08054BE8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SafeguardMoveAction - bl _080554BA -_08054BF8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl MistMoveAction - bl _080554BA -_08054C08: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl LightScreenMoveAction - bl _080554BA -_08054C18: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805768C - bl _080554BA -_08054C28: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057F24 - bl _080554BA -_08054C38: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80599EC - bl _080554BA -_08054C48: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80589D4 - bl _080554BA -_08054C58: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059AC4 - bl _080554BA -_08054C68: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A4D4 - bl _080554BA -_08054C78: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058EE0 - bl _080554BA -_08054C88: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl ScannerOrbAction - bl _080554BA -_08054C98: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A120 - bl _080554BA -_08054CA8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BA50 - bl _080554BA -_08054CB8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A2A0 - b _080554BA -_08054CC6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058A08 - b _080554BA -_08054CD4: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl CounterMoveAction - b _080554BA -_08054CE2: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl BideMoveAction - b _080554BA -_08054CF0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805836C - b _080554BA -_08054CFE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl TrapperOrbAction - b _080554BA -_08054D0C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A450 - b _080554BA -_08054D1A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl CurseMoveAction - b _080554BA -_08054D28: - movs r0, 0 - str r0, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059FC8 - b _080554BA -_08054D3A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AE3C - b _080554BA -_08054D48: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B3E0 - b _080554BA -_08054D56: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl RazorWindMoveAction - b _080554BA -_08054D64: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl FocusPunchMoveAction - b _080554BA -_08054D72: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl MagicCoatMoveAction - b _080554BA -_08054D80: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl NightmareMoveAction - b _080554BA -_08054D8E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057748 - b _080554BA -_08054D9C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C1BC - b _080554BA -_08054DAA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl MudWaterSportMoveAction - b _080554BA -_08054DB8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057634 - b _080554BA -_08054DC6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A3DC - b _080554BA -_08054DD4: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057FF4 - b _080554BA -_08054DE2: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A4FC - b _080554BA -_08054DF0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058C48 - b _080554BA -_08054DFE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl LeechSeedMoveAction - b _080554BA -_08054E0C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SpikesMoveAction - b _080554BA -_08054E1A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80578EC - b _080554BA -_08054E28: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80588A8 - b _080554BA -_08054E36: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl RadarOrbAction - b _080554BA -_08054E44: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BC70 - b _080554BA -_08054E52: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80587E8 - b _080554BA -_08054E60: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B264 - b _080554BA -_08054E6E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SkullBashMoveAction - b _080554BA -_08054E7C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl WishMoveAction - b _080554BA -_08054E8A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057FCC - b _080554BA -_08054E98: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A258 - b _080554BA -_08054EA6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059528 - b _080554BA -_08054EB4: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057E6C - b _080554BA -_08054EC2: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059DB4 - b _080554BA -_08054ED0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058838 - b _080554BA -_08054EDE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl TormentMoveAction - b _080554BA -_08054EEC: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057974 - b _080554BA -_08054EFA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B388 - b _080554BA -_08054F08: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BC98 - b _080554BA -_08054F16: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80584C0 - b _080554BA -_08054F24: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BB74 - b _080554BA -_08054F32: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B668 - b _080554BA -_08054F40: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl LuminousOrbAction - b _080554BA -_08054F4E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl FillInOrbAction - b _080554BA -_08054F5C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059CF0 - b _080554BA -_08054F6A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BF34 - b _080554BA -_08054F78: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl StairsOrbAction - b _080554BA -_08054F86: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl BrickBreakMoveAction - b _080554BA -_08054F94: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80582AC - b _080554BA -_08054FA2: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058A54 - b _080554BA -_08054FB0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl VitalThrowMoveAction - b _080554BA -_08054FBE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl FlyMoveAction - b _080554BA -_08054FCC: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059F38 - b _080554BA -_08054FDA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl DiveMoveAction - b _080554BA -_08054FE8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl DigMoveAction - b _080554BA -_08054FF6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057824 - b _080554BA -_08055004: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805825C - b _080554BA -_08055012: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl KnockOffMoveAction - b _080554BA -_08055020: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl TrapbustOrbAction - b _080554BA -_0805502E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl LongtossOrbAction - b _080554BA -_0805503C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl PierceOrbAction - b _080554BA -_0805504A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl GrudgeMoveAction - b _080554BA -_08055058: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl PetrifyOrbAction - b _080554BA -_08055066: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A4C0 - b _080554BA -_08055074: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AAD0 - b _080554BA -_08055082: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl ShockerOrbAction - b _080554BA -_08055090: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B314 - b _080554BA -_0805509E: - movs r0, 0 - str r0, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059E54 - b _080554BA -_080550B0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl ProtectMoveAction - b _080554BA -_080550BE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059AB8 - b _080554BA -_080550CC: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058858 - b _080554BA -_080550DA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058770 - b _080554BA -_080550E8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8059004 - b _080554BA -_080550F6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80597F0 - b _080554BA -_08055104: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl ChargeMoveAction - b _080554BA -_08055112: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058548 - b _080554BA -_08055120: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80588F4 - b _080554BA -_0805512E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058D44 - b _080554BA -_0805513C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AFA4 - b _080554BA -_0805514A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SmokescreenMoveAction - b _080554BA -_08055158: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BA44 - b _080554BA -_08055166: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl StockpileMoveAction - b _080554BA -_08055174: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SpitUpMoveAction - b _080554BA -_08055182: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SwallowMoveAction - b _080554BA -_08055190: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl RainDanceMoveAction - b _080554BA -_0805519E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057D9C - b _080554BA -_080551AC: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl InvisifyOrbAction - b _080554BA -_080551BA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl MirrorCoatMoveAction - b _080554BA -_080551C8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl PerishSongMoveAction - b _080554BA -_080551D6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058A18 - b _080554BA -_080551E4: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl DestinyBondMoveAction - b _080554BA -_080551F2: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl EncoreMoveAction - b _080554BA -_08055200: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057CD0 - b _080554BA -_0805520E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SunnyDayMoveAction - b _080554BA -_0805521C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A464 - b _080554BA -_0805522A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C2A0 - b _080554BA -_08055238: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl EndureMoveAction - b _080554BA -_08055246: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl HelpingHandMoveAction - b _080554BA -_08055254: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl BellyDrumMoveAction - b _080554BA -_08055262: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C288 - b _080554BA -_08055270: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805783C - b _080554BA -_0805527E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_80578FC - b _080554BA -_0805528C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057BB4 - b _080554BA -_0805529A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl RockSmashMoveAction - b _080554BA -_080552A8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl TransformMoveAction - b _080554BA -_080552B6: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl HailMoveAction - b _080554BA -_080552C4: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl MobileOrbAction - b _080554BA -_080552D2: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8058234 - b _080554BA -_080552E0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805A85C - b _080554BA -_080552EE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl TransferOrbAction - b _080554BA -_080552FC: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BB98 - b _080554BA -_0805530A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AD54 - b _080554BA -_08055318: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl ReboundOrbAction - b _080554BA -_08055326: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805AD04 - b _080554BA -_08055334: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C080 - b _080554BA -_08055342: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C1E4 - b _080554BA -_08055350: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl EscapeOrbAction - b _080554BA -_0805535E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SecretPowerMoveAction - b _080554BA -_0805536C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl NaturePowerMoveAction - b _080554BA -_0805537A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C3F8 - b _080554BA -_08055388: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SketchMoveAction - b _080554BA -_08055396: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_8057E50 - b _080554BA -_080553A4: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl RolePlayMoveAction - b _080554BA -_080553B2: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SkillSwapMoveAction - b _080554BA -_080553C0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl ConversionMoveAction - b _080554BA -_080553CE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl CleanseOrbAction - b _080554BA -_080553DC: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805805C - b _080554BA -_080553EA: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SnatchMoveAction - b _080554BA -_080553F8: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl HandleColorChange - b _080554BA -_08055406: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B53C - b _080554BA -_08055414: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl PsychUpMoveAction - b _080554BA -_08055422: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SnoreMoveAction - b _080554BA -_08055430: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl RecycleMoveAction - b _080554BA -_0805543E: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl SilenceOrbAction - b _080554BA -_0805544C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805B618 - b _080554BA -_0805545A: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl IdentifyOrbAction - b _080554BA -_08055468: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl Conversion2MoveAction - b _080554BA -_08055476: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BEB8 - b _080554BA -_08055484: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805BEC8 - b _080554BA -_08055492: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl MimicMoveAction - b _080554BA -_080554A0: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C45C - b _080554BA -_080554AE: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - mov r3, r9 - bl sub_805C208 -_080554BA: - lsls r0, 24 - lsrs r4, r0, 24 - b _080554C2 -_080554C0: - movs r4, 0 -_080554C2: - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - bne _080555A2 - ldr r0, [sp, 0x20] - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _080554E6 - ldr r3, [sp, 0x20] - ldr r0, [r3, 0x70] - adds r0, 0x46 - ldrb r1, [r0] - adds r0, r3, 0 - bl sub_806CE68 -_080554E6: - cmp r4, 0 - bne _08055510 - adds r0, r7, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055530 - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055530 - ldr r1, [sp, 0x24] - ldrb r0, [r1, 0x6] - cmp r0, 0 - beq _08055530 - mov r2, r10 - strb r2, [r6] - b _08055530 -_08055510: - mov r0, r8 - bl MoveCausesPaused - lsls r0, 24 - cmp r0, 0 - beq _08055530 - adds r0, r7, 0 - movs r1, 0 - bl sub_8057308 - lsls r0, 24 - cmp r0, 0 - beq _08055530 - ldr r1, _08055614 - movs r0, 0x1 - strb r0, [r1] -_08055530: - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055548 - ldr r3, [sp, 0x24] - movs r0, 0xAC - lsls r0, 1 - adds r1, r3, r0 - movs r0, 0x1 - strb r0, [r1] -_08055548: - ldr r1, [sp, 0x18] - cmp r1, 0x89 - beq _08055568 - adds r0, r7, 0 - bl sub_8055DDC - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - bl sub_8069F9C - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - bl sub_806A120 -_08055568: - ldr r7, [sp, 0x1C] -_0805556A: - ldr r2, [sp, 0x14] - adds r2, 0x1 - str r2, [sp, 0x14] -_08055570: - ldr r3, [sp, 0x14] - cmp r3, 0x3F - bgt _080555A2 - movs r0, 0 - str r0, [sp, 0x20] - lsls r0, r3, 2 - ldr r1, [sp, 0x10] - adds r0, r1 - ldr r5, [r0] - movs r2, 0x1 - str r2, [sp, 0x28] - movs r3, 0 - str r3, [sp, 0x2C] - movs r0, 0 - str r0, [sp, 0x30] - cmp r5, 0 - beq _080555A2 - adds r0, r7, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _080555A2 - bl _08053724 -_080555A2: - bl sub_8044B28 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08055604 - adds r0, r7, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _080555D6 - ldr r0, [r7, 0x70] - movs r2, 0xAA - lsls r2, 1 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _080555D6 - strb r4, [r1] - adds r0, r7, 0 - adds r1, r7, 0 - movs r2, 0 - movs r3, 0 - bl sub_807D148 -_080555D6: - adds r0, r7, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055604 - ldr r0, [r7, 0x70] - ldr r3, _08055618 - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, 0 - beq _08055604 - movs r0, 0 - strb r0, [r1] - ldr r1, _0805561C - ldr r2, [r1] - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r7, 0 - adds r1, r7, 0 - movs r3, 0x2 - bl LowerAttackStageTarget -_08055604: - add sp, 0x48 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08055614: .4byte gUnknown_202F222 -_08055618: .4byte 0x00000155 -_0805561C: .4byte gUnknown_8106A50 - thumb_func_end sub_8053704 - - thumb_func_start sub_8055620 -sub_8055620: - push {r4,lr} - sub sp, 0x4 - movs r4, 0x80 - lsls r4, 1 - str r3, [sp] - adds r3, r4, 0 - bl sub_8055640 - cmp r0, 0 - beq _08055636 - movs r0, 0x1 -_08055636: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8055620 - - thumb_func_start sub_8055640 -sub_8055640: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - adds r6, r0, 0 - mov r10, r1 - adds r5, r2, 0 - mov r9, r3 - ldr r7, [sp, 0x44] - adds r1, r5, 0 - bl GetMoveTypeForMonster - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl GetMovePower - mov r8, r0 - adds r0, r5, 0 - bl GetMoveCritChance - str r0, [sp] - add r0, sp, 0x14 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - ldrh r0, [r5, 0x2] - str r0, [sp, 0xC] - movs r0, 0x1 - str r0, [sp, 0x10] - adds r0, r6, 0 - mov r1, r10 - adds r2, r4, 0 - mov r3, r8 - bl sub_806EAF4 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_8057600 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - adds r0, r6, 0 - mov r1, r10 - adds r2, r5, 0 - add r3, sp, 0x14 - bl sub_8055728 - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8055640 - - thumb_func_start sub_80556BC -sub_80556BC: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x24 - adds r6, r0, 0 - mov r9, r1 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r7, [sp, 0x40] - lsls r4, 24 - lsrs r4, 24 - adds r1, r5, 0 - bl GetMovePower - mov r8, r0 - adds r0, r5, 0 - bl GetMoveCritChance - str r0, [sp] - add r0, sp, 0x14 - str r0, [sp, 0x4] - str r7, [sp, 0x8] - ldrh r0, [r5, 0x2] - str r0, [sp, 0xC] - movs r0, 0x1 - str r0, [sp, 0x10] - adds r0, r6, 0 - mov r1, r9 - adds r2, r4, 0 - mov r3, r8 - bl sub_806EAF4 - adds r0, r5, 0 - ldr r1, [sp, 0x44] - bl sub_8057600 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - adds r0, r6, 0 - mov r1, r9 - adds r2, r5, 0 - add r3, sp, 0x14 - bl sub_8055728 - add sp, 0x24 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80556BC - - thumb_func_start sub_8055728 -sub_8055728: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - mov r8, r3 - ldr r0, [sp, 0x30] - lsls r0, 16 - asrs r0, 16 - mov r9, r0 - movs r7, 0x1 - str r7, [sp] - adds r0, r6, 0 - movs r3, 0x1 - bl sub_8056B34 - lsls r0, 24 - cmp r0, 0 - beq _080557C0 - movs r0, 0 - mov r10, r0 - ldrh r1, [r5, 0x2] - movs r0, 0x9D - lsls r0, 1 - cmp r1, r0 - bne _08055768 - movs r1, 0x1 - mov r10, r1 -_08055768: - adds r0, r4, 0 - movs r1, 0x2E - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _08055790 - ldr r0, _080557AC - ldr r1, [r0] - ldr r0, _080557B0 - adds r2, r1, r0 - ldr r0, _080557B4 - strh r0, [r2] - ldr r2, _080557B8 - adds r0, r1, r2 - str r4, [r0] - ldr r0, _080557BC - adds r1, r0 - ldrh r0, [r4, 0x26] - str r0, [r1] -_08055790: - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r6, 0 - adds r1, r4, 0 - mov r2, r8 - mov r3, r10 - bl HandleDealingDamage - b _08055826 - .align 2, 0 -_080557AC: .4byte gDungeon -_080557B0: .4byte 0x00000662 -_080557B4: .4byte 0x000003e7 -_080557B8: .4byte 0x00017b34 -_080557BC: .4byte 0x00017b40 -_080557C0: - ldr r0, _08055808 - ldr r1, [r4, 0x70] - movs r2, 0 - bl SetMessageArgument_2 - adds r0, r6, 0 - bl sub_8045888 - lsls r0, 24 - cmp r0, 0 - beq _08055814 - adds r0, r4, 0 - bl sub_8045888 - lsls r0, 24 - cmp r0, 0 - beq _08055814 - ldr r0, _0805580C - movs r3, 0x1 - negs r3, r3 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_803ED30 - ldr r0, _08055810 - ldr r2, [r0] - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_805232C - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8042238 - b _08055820 - .align 2, 0 -_08055808: .4byte gUnknown_202DFE8 -_0805580C: .4byte 0x0000270f -_08055810: .4byte gUnknown_80F9688 -_08055814: - ldr r0, _08055834 - ldr r2, [r0] - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80522F4 -_08055820: - movs r0, 0x1 - mov r2, r8 - strb r0, [r2, 0xF] -_08055826: - mov r1, r8 - ldrb r0, [r1, 0xF] - cmp r0, 0 - beq _08055838 - movs r0, 0 - b _08055854 - .align 2, 0 -_08055834: .4byte gUnknown_80F9688 -_08055838: - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055850 - ldr r0, [r4, 0x70] - movs r2, 0xAD - lsls r2, 1 - adds r1, r0, r2 - movs r0, 0x1 - strb r0, [r1] -_08055850: - mov r1, r8 - ldr r0, [r1] -_08055854: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8055728 - - thumb_func_start sub_8055864 -sub_8055864: - push {r4-r7,lr} - sub sp, 0x20 - adds r4, r0, 0 - adds r7, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - adds r1, r5, 0 - bl GetMoveTypeForMonster - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - add r0, sp, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r7, 0 - adds r3, r6, 0 - bl sub_806F2BC - adds r0, r5, 0 - ldr r1, [sp, 0x34] - bl sub_8057600 - lsls r0, 16 - asrs r0, 16 - movs r5, 0x1 - str r5, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r1, r7, 0 - add r2, sp, 0x10 - movs r3, 0 - bl HandleDealingDamage - add r0, sp, 0x10 - ldrb r0, [r0, 0xF] - cmp r0, 0 - beq _080558BA - movs r0, 0 - b _080558D2 -_080558BA: - adds r0, r7, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _080558D0 - ldr r0, [r7, 0x70] - movs r1, 0xAD - lsls r1, 1 - adds r0, r1 - strb r5, [r0] -_080558D0: - ldr r0, [sp, 0x10] -_080558D2: - add sp, 0x20 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8055864 - - thumb_func_start sub_80558DC -sub_80558DC: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - movs r4, 0x1 - movs r2, 0 - mov r9, r2 - ldr r1, [r1, 0x70] - mov r10, r1 - bl GetMoveType - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - beq _08055902 - cmp r1, 0x7 - bne _08055906 -_08055902: - movs r5, 0x1 - mov r9, r5 -_08055906: - ldr r6, _08055944 - mov r8, r6 - mov r3, r10 - adds r3, 0x5C - ldr r7, _08055948 - mov r12, r7 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - str r0, [sp, 0x10] - adds r2, r3, 0 -_0805591C: - mov r0, sp - mov r1, r8 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - mov r0, r9 - cmp r0, 0 - beq _0805594C - ldrb r0, [r2] - cmp r0, 0xE - bne _0805594C - mov r0, r10 - adds r0, 0xF5 - ldrb r0, [r0] - cmp r0, 0 - bne _0805594C - movs r0, 0 - b _0805595A - .align 2, 0 -_08055944: .4byte gUnknown_81069BC -_08055948: .4byte gTypeEffectivenessChart -_0805594C: - ldrb r0, [r2] - lsls r0, 1 - ldr r1, [sp, 0x10] - adds r0, r1 - add r0, r12 - movs r5, 0 - ldrsh r0, [r0, r5] -_0805595A: - lsls r0, 2 - add r0, sp - ldr r0, [r0] - muls r4, r0 - cmp r4, 0 - beq _0805596E - adds r2, 0x1 - adds r0, r3, 0x1 - cmp r2, r0 - ble _0805591C -_0805596E: - adds r0, r4, 0 - cmp r0, 0 - beq _08055976 - movs r0, 0x1 -_08055976: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80558DC - - thumb_func_start sub_8055988 -sub_8055988: - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - cmp r2, r4 - beq _080559D4 - movs r0, 0x4 - ldrsh r1, [r2, r0] - movs r3, 0x4 - ldrsh r0, [r4, r3] - subs r1, r0 - cmp r1, 0 - bge _080559A2 - negs r1, r1 -_080559A2: - cmp r1, 0x1 - bgt _080559D4 - movs r0, 0x6 - ldrsh r1, [r2, r0] - movs r3, 0x6 - ldrsh r0, [r4, r3] - subs r1, r0 - cmp r1, 0 - bge _080559B6 - negs r1, r1 -_080559B6: - cmp r1, 0x1 - bgt _080559D4 - adds r0, r4, 0x4 - adds r1, r2, 0x4 - bl GetDirectionTowardsPosition - adds r1, r0, 0 - adds r0, r4, 0 - bl CanAttackInDirection - lsls r0, 24 - cmp r0, 0 - beq _080559D4 - movs r0, 0x1 - b _080559D6 -_080559D4: - movs r0, 0 -_080559D6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8055988 - - thumb_func_start sub_80559DC -sub_80559DC: - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, [r5, 0x70] - adds r0, r5, 0x4 - adds r1, 0x4 - bl GetDirectionTowardsPosition - adds r1, r0, 0 - movs r2, 0x7 - ands r0, r2 - adds r4, 0x46 - strb r0, [r4] - adds r0, r5, 0 - bl sub_806CE68 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80559DC - - thumb_func_start sub_8055A00 -sub_8055A00: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - adds r5, r0, 0 - mov r9, r1 - str r2, [sp, 0x20] - str r3, [sp, 0x24] - ldr r0, [r5, 0x70] - mov r10, r0 - mov r7, r9 - cmp r7, 0x3 - ble _08055A22 - movs r0, 0 - b _08055DB4 -_08055A22: - movs r0, 0xBC - lsls r0, 1 - add r0, r10 - movs r1, 0 - movs r2, 0 - strh r2, [r0] - ldr r0, _08055A4C - add r0, r10 - strb r1, [r0] - mov r0, r10 - adds r0, 0xBC - ldrb r0, [r0] - cmp r0, 0x1 - bne _08055A58 - ldr r0, _08055A50 - adds r1, r5, 0 - bl SetMessageArgument - ldr r0, _08055A54 - b _08055A8A - .align 2, 0 -_08055A4C: .4byte 0x00000159 -_08055A50: .4byte gAvailablePokemonNames -_08055A54: .4byte gUnknown_80FC714 -_08055A58: - cmp r0, 0x7 - bne _08055A74 - ldr r0, _08055A6C - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, _08055A70 - b _08055A8A - .align 2, 0 -_08055A6C: .4byte gAvailablePokemonNames -_08055A70: .4byte gUnknown_80FC718 -_08055A74: - mov r0, r10 - adds r0, 0xAC - ldrb r0, [r0] - cmp r0, 0x4 - bne _08055AA0 - ldr r0, _08055A98 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, _08055A9C -_08055A8A: - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage - movs r0, 0 - b _08055DB4 - .align 2, 0 -_08055A98: .4byte gAvailablePokemonNames -_08055A9C: .4byte gUnknown_80FC6A8 -_08055AA0: - ldr r0, _08055B24 - strb r1, [r0] - ldr r0, _08055B28 - str r2, [r0] - ldr r0, _08055B2C - strb r1, [r0] - adds r0, r7, 0x1 - movs r2, 0 - movs r6, 0x3 - movs r1, 0xC0 - lsls r1, 1 - add r1, r10 -_08055AB8: - strh r2, [r1] - subs r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08055AB8 - movs r6, 0 - movs r3, 0x1 - adds r7, r0, 0 - cmp r7, 0x3 - bgt _08055B06 - lsls r2, r7, 3 - mov r1, r10 - adds r0, r1, r2 - movs r4, 0x8C - lsls r4, 1 - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08055B06 - movs r0, 0x2 - mov r8, r0 - adds r0, r2, r4 - mov r1, r10 - adds r2, r0, r1 -_08055AEC: - adds r6, 0x1 - cmp r6, 0x3 - bgt _08055B06 - adds r3, 0x1 - adds r2, 0x8 - adds r7, 0x1 - cmp r7, 0x3 - bgt _08055B06 - ldrb r1, [r2] - mov r0, r8 - ands r0, r1 - cmp r0, 0 - bne _08055AEC -_08055B06: - movs r0, 0 - str r0, [sp, 0x28] - cmp r3, 0x1 - ble _08055B12 - movs r1, 0x1 - str r1, [sp, 0x28] -_08055B12: - mov r7, r9 - lsls r0, r7, 3 - movs r1, 0x8C - lsls r1, 1 - adds r0, r1 - add r0, r10 - mov r8, r0 - b _08055CB4 - .align 2, 0 -_08055B24: .4byte gUnknown_202F222 -_08055B28: .4byte gUnknown_202F208 -_08055B2C: .4byte gUnknown_202F221 -_08055B30: - mov r1, r8 - ldrh r0, [r1, 0x2] - cmp r0, 0x19 - beq _08055B3C - cmp r0, 0xE3 - bne _08055B4E -_08055B3C: - adds r0, r5, 0 - bl IsSleeping - lsls r0, 24 - cmp r0, 0 - bne _08055B5E - adds r0, r5, 0 - movs r1, 0x1 - b _08055B52 -_08055B4E: - adds r0, r5, 0 - movs r1, 0 -_08055B52: - bl CannotAttack - lsls r0, 24 - cmp r0, 0 - beq _08055B5E - b _08055CCE -_08055B5E: - ldr r0, _08055B9C - ldrb r0, [r0] - cmp r0, 0 - beq _08055B68 - b _08055CCE -_08055B68: - ldrb r1, [r6] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08055B74 - b _08055C82 -_08055B74: - movs r2, 0x1 - movs r0, 0 - str r0, [sp, 0x2C] - adds r0, r5, 0 - adds r1, r6, 0 - str r2, [sp, 0x30] - bl MoveMatchesChargingStatus - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6, 0x4] - ldr r2, [sp, 0x30] - cmp r0, 0 - beq _08055BA0 - cmp r4, 0 - bne _08055BBA - movs r1, 0x1 - str r1, [sp, 0x2C] - b _08055BBA - .align 2, 0 -_08055B9C: .4byte gUnknown_202F221 -_08055BA0: - cmp r4, 0 - bne _08055BBA - ldr r0, _08055C08 - adds r1, r6, 0 - movs r2, 0 - bl sub_80928C0 - ldr r0, _08055C0C - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage - movs r2, 0 -_08055BBA: - cmp r2, 0 - beq _08055C82 - ldr r0, _08055C10 - ldr r0, [r0] - mov r9, r0 - ldr r0, _08055C14 - add r0, r10 - strb r4, [r0] - ldrh r0, [r6, 0x2] - cmp r0, 0xE5 - bne _08055C20 - ldr r0, [r6] - ldr r1, [r6, 0x4] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - adds r0, r5, 0 - bl sub_8057144 - lsls r0, 16 - ldr r2, _08055C18 - ldr r1, [sp, 0x8] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x8] - ldr r0, _08055C08 - add r1, sp, 0x8 - movs r2, 0 - bl sub_80928C0 - ldr r0, _08055C1C - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage - ldr r0, [sp, 0x28] - str r0, [sp] - add r1, sp, 0x8 - str r1, [sp, 0x4] - b _08055C26 - .align 2, 0 -_08055C08: .4byte gFormatItems -_08055C0C: .4byte gUnknown_80F93C8 -_08055C10: .4byte gUnknown_202F208 -_08055C14: .4byte 0x00000159 -_08055C18: .4byte 0x0000ffff -_08055C1C: .4byte gUnknown_80FD2DC -_08055C20: - ldr r0, [sp, 0x28] - str r0, [sp] - str r6, [sp, 0x4] -_08055C26: - adds r0, r5, 0 - ldr r1, [sp, 0x20] - ldr r2, [sp, 0x24] - ldr r3, [sp, 0x54] - bl sub_8055FA0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp, 0x2C] - cmp r1, 0 - beq _08055C56 - cmp r0, 0 - beq _08055C56 - ldrb r1, [r6, 0x1] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08055C50 - movs r0, 0xFB - ands r0, r1 - b _08055C54 -_08055C50: - movs r0, 0x8 - orrs r0, r1 -_08055C54: - strb r0, [r6, 0x1] -_08055C56: - ldr r0, _08055C70 - ldr r0, [r0] - cmp r9, r0 - bne _08055C82 - ldr r0, [sp, 0x24] - cmp r0, 0 - bne _08055C78 - ldr r0, _08055C74 - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage - b _08055C82 - .align 2, 0 -_08055C70: .4byte gUnknown_202F208 -_08055C74: .4byte gUnknown_80FC690 -_08055C78: - ldr r0, _08055DC4 - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage -_08055C82: - movs r0, 0x1 - bl sub_804178C - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055CCE - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - bne _08055CCE - movs r1, 0x8 - add r8, r1 - adds r7, 0x1 - cmp r7, 0x3 - bgt _08055CCE - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08055CCE -_08055CB4: - mov r6, r8 - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055CCE - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - bne _08055CCE - b _08055B30 -_08055CCE: - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055D54 - movs r6, 0 -_08055CDC: - lsls r0, r6, 1 - movs r1, 0xBD - lsls r1, 1 - add r1, r10 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08055D4E - add r4, sp, 0x10 - adds r1, r0, 0 - adds r0, r4, 0 - bl sub_8092AA8 - ldrb r1, [r4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08055D48 - ldrh r0, [r4, 0x2] - cmp r0, 0xE5 - bne _08055D36 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - adds r0, r5, 0 - bl sub_8057144 - lsls r0, 16 - ldr r2, _08055DC8 - ldr r1, [sp, 0x18] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x18] - add r4, sp, 0x18 - ldr r0, _08055DCC - adds r1, r4, 0 - movs r2, 0 - bl sub_80928C0 - ldr r0, _08055DD0 - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage -_08055D36: - ldr r1, [sp, 0x28] - str r1, [sp] - str r4, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0 - ldr r2, [sp, 0x24] - ldr r3, [sp, 0x54] - bl sub_8055FA0 -_08055D48: - movs r0, 0x1 - bl sub_804178C -_08055D4E: - adds r6, 0x1 - cmp r6, 0x3 - ble _08055CDC -_08055D54: - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055DB2 - adds r0, r5, 0 - bl sub_8071DA4 - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055DB2 - ldr r1, _08055DD4 - ldrb r0, [r1] - cmp r0, 0 - beq _08055DB2 - movs r0, 0 - strb r0, [r1] - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08055DB2 - ldr r4, [r5, 0x70] - ldr r1, _08055DD8 - adds r0, r5, 0 - movs r2, 0x1 - bl CalculateStatusTurns - adds r3, r0, 0 - movs r0, 0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl PausedStatusTarget - adds r4, 0xFB - ldrb r0, [r4] - cmp r0, 0 - bne _08055DB2 - movs r0, 0x1 - strb r0, [r4] -_08055DB2: - movs r0, 0x1 -_08055DB4: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08055DC4: .4byte gUnknown_80FC6A4 -_08055DC8: .4byte 0x0000ffff -_08055DCC: .4byte gFormatItems -_08055DD0: .4byte gUnknown_80FD2DC -_08055DD4: .4byte gUnknown_202F222 -_08055DD8: .4byte gUnknown_80F4E70 - thumb_func_end sub_8055A00 - - thumb_func_start sub_8055DDC -sub_8055DDC: - push {r4-r7,lr} - adds r4, r0, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _08055DEC - b _08055F62 -_08055DEC: - ldr r6, [r4, 0x70] - movs r7, 0xBC - lsls r7, 1 - adds r5, r6, r7 - ldrh r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08055E10 - ldr r0, _08055F68 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - bl ImmobilizedStatusTarget -_08055E10: - ldrh r1, [r5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08055E2C - ldr r0, _08055F6C - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - bl ImmobilizedStatusTarget -_08055E2C: - ldrh r1, [r5] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08055E48 - ldr r0, _08055F70 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - bl ImmobilizedStatusTarget -_08055E48: - ldrh r1, [r5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08055E66 - ldr r0, _08055F74 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl ParalyzeStatusTarget -_08055E66: - ldrh r1, [r5] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08055E84 - ldr r0, _08055F78 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl ParalyzeStatusTarget -_08055E84: - ldrh r1, [r5] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08055EA2 - ldr r0, _08055F7C - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl PoisonedStatusTarget -_08055EA2: - ldrh r1, [r5] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08055EC0 - ldr r0, _08055F80 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl PoisonedStatusTarget -_08055EC0: - ldrh r1, [r5] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08055EEA - ldr r0, _08055F84 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - ldr r1, _08055F88 - adds r0, r4, 0 - movs r2, 0x1 - bl CalculateStatusTurns - adds r2, r0, 0 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_8075C58 -_08055EEA: - ldrh r1, [r5] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08055F0C - ldr r0, _08055F8C - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl BurnedStatusTarget -_08055F0C: - ldrh r1, [r5] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _08055F2C - ldr r0, _08055F90 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl InfatuateStatusTarget -_08055F2C: - adds r5, r6, r7 - ldrh r1, [r5] - movs r0, 0x80 - lsls r0, 3 - ands r0, r1 - cmp r0, 0 - beq _08055F5E - ldr r0, _08055F94 - adds r1, r4, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, _08055F98 - ldr r1, [r0] - adds r0, r4, 0 - bl SendMessage - adds r0, r4, 0 - bl sub_80428A0 - ldr r0, _08055F9C - ldrh r1, [r0] - adds r0, r6, 0 - adds r0, 0xFA - strb r1, [r0] -_08055F5E: - movs r0, 0 - strh r0, [r5] -_08055F62: - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08055F68: .4byte gUnknown_80FEEA4 -_08055F6C: .4byte gUnknown_80FEEC8 -_08055F70: .4byte gUnknown_80FEEEC -_08055F74: .4byte gUnknown_80FEF0C -_08055F78: .4byte gUnknown_80FEF30 -_08055F7C: .4byte gUnknown_80FEF4C -_08055F80: .4byte gUnknown_80FEF50 -_08055F84: .4byte gUnknown_80FEF54 -_08055F88: .4byte gUnknown_80F4E74 -_08055F8C: .4byte gUnknown_80FEF74 -_08055F90: .4byte gUnknown_80FEF98 -_08055F94: .4byte gAvailablePokemonNames -_08055F98: .4byte gUnknown_80FEFD0 -_08055F9C: .4byte gUnknown_80F5004 - thumb_func_end sub_8055DDC - - thumb_func_start sub_8055FA0 -sub_8055FA0: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x130 - adds r5, r0, 0 - adds r6, r1, 0 - mov r10, r2 - str r3, [sp, 0x120] - ldr r7, [sp, 0x154] - movs r0, 0 - mov r8, r0 - str r0, [sp, 0xC] - movs r0, 0x1 - bl sub_804178C - ldrh r1, [r7, 0x2] - movs r0, 0xA5 - lsls r0, 1 - cmp r1, r0 - bne _08056010 - movs r0, 0x69 - bl DungeonRandInt - ldr r1, _08056004 - str r0, [r1] - add r4, sp, 0x110 - ldr r1, _08056008 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0] - adds r0, r4, 0 - bl InitPokemonMove - ldrb r1, [r7] - add r0, sp, 0x110 - strb r1, [r0] - ldrb r0, [r7, 0x1] - strb r0, [r4, 0x1] - ldr r0, _0805600C - ldr r2, [r0] - mov r1, r10 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - b _08056056 - .align 2, 0 -_08056004: .4byte gUnknown_202F228 -_08056008: .4byte gUnknown_80F59C8 -_0805600C: .4byte gUnknown_80FECBC -_08056010: - cmp r1, 0x77 - bne _08056068 - ldr r0, _08056108 - ldr r0, [r0] - ldr r1, _0805610C - adds r0, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _08056026 - movs r0, 0 -_08056026: - cmp r0, 0x4A - ble _0805602C - movs r0, 0x4A -_0805602C: - add r4, sp, 0x118 - ldr r1, _08056110 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0] - adds r0, r4, 0 - bl InitPokemonMove - ldrb r1, [r7] - add r0, sp, 0x118 - strb r1, [r0] - ldrb r0, [r7, 0x1] - strb r0, [r4, 0x1] - ldr r0, _08056114 - ldr r2, [r0] - mov r0, r10 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] -_08056056: - adds r0, r5, 0 - adds r1, r7, 0 - add r3, sp, 0xC - bl sub_8056468 - movs r0, 0x1 - bl sub_804178C - adds r7, r4, 0 -_08056068: - movs r2, 0 - str r2, [sp, 0x128] - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - bl GetMoveTargetAndRangeForPokemon - movs r4, 0xF0 - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0x50 - bne _08056084 - movs r0, 0xA - str r0, [sp, 0x128] -_08056084: - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - bl GetMoveTargetAndRangeForPokemon - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0x80 - bne _080560CC - movs r1, 0x1 - str r1, [sp, 0x128] - ldrh r0, [r7, 0x2] - cmp r0, 0x97 - bne _080560AE - adds r0, r5, 0 - bl GetApparentWeather - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080560CC -_080560AE: - ldrh r0, [r7, 0x2] - bl DoesMoveCharge - lsls r0, 24 - cmp r0, 0 - beq _080560CC - adds r0, r5, 0 - adds r1, r7, 0 - bl MoveMatchesChargingStatus - lsls r0, 24 - cmp r0, 0 - bne _080560CC - movs r2, 0 - str r2, [sp, 0x128] -_080560CC: - ldr r0, _08056118 - ldr r1, [r5, 0x70] - movs r2, 0 - bl SetMessageArgument_2 - ldr r0, _0805611C - adds r1, r7, 0 - movs r2, 0 - bl sub_80928C0 - adds r0, r5, 0 - adds r1, r7, 0 - bl MoveMatchesChargingStatus - lsls r0, 24 - cmp r0, 0 - beq _08056124 - ldr r0, _08056120 - ldr r0, [r0] - mov r8, r0 - ldr r0, [r5, 0x70] - adds r0, 0xFF - movs r1, 0 - strb r1, [r0] - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - bl sub_805744C - b _08056142 - .align 2, 0 -_08056108: .4byte gDungeon -_0805610C: .4byte 0x00003a0e -_08056110: .4byte gNaturePowerMoveTable -_08056114: .4byte gUnknown_80FECE0 -_08056118: .4byte gAvailablePokemonNames -_0805611C: .4byte gFormatItems -_08056120: .4byte gUnknown_80FC72C -_08056124: - mov r0, r10 - cmp r0, 0 - bne _08056132 - ldrh r0, [r7, 0x2] - bl GetMoveUseText - b _08056136 -_08056132: - ldr r0, _08056194 - ldr r0, [r0] -_08056136: - mov r8, r0 - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - bl CanMonsterUseMove -_08056142: - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08056156 - cmp r6, 0 - beq _08056156 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_806ACE8 -_08056156: - ldr r0, [r5, 0x70] - adds r0, 0xEC - ldrb r0, [r0] - cmp r0, 0x1 - bne _080561A0 - ldrh r0, [r7, 0x2] - bl FailsWhileMuzzled - lsls r0, 24 - cmp r0, 0 - beq _080561A0 - ldr r0, _08056198 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument - adds r0, r5, 0 - mov r1, r8 - bl SendMessage - movs r0, 0xA - movs r1, 0x3F - bl sub_803E708 - ldr r0, _0805619C -_08056188: - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage -_08056190: - movs r0, 0 - b _08056446 - .align 2, 0 -_08056194: .4byte gUnknown_80F9158 -_08056198: .4byte gAvailablePokemonNames -_0805619C: .4byte gUnknown_80FC710 -_080561A0: - cmp r4, 0 - bne _08056214 - ldr r0, _080561D4 - ldr r1, [r5, 0x70] - movs r2, 0 - bl SetMessageArgument_2 - mov r1, r10 - cmp r1, 0 - bne _080561E0 - ldr r0, _080561D8 - adds r1, r7, 0 - movs r2, 0 - bl sub_80928C0 - adds r0, r5, 0 - mov r1, r8 - bl SendMessage - movs r0, 0xA - movs r1, 0x3F - bl sub_803E708 - ldr r0, _080561DC - b _08056188 - .align 2, 0 -_080561D4: .4byte gAvailablePokemonNames -_080561D8: .4byte gFormatItems -_080561DC: .4byte gUnknown_80FC6D0 -_080561E0: - ldr r0, _0805620C - mov r2, r10 - lsls r1, r2, 24 - lsrs r1, 24 - movs r2, 0 - bl BufferItemName - adds r0, r5, 0 - mov r1, r8 - bl SendMessage - movs r0, 0xA - movs r1, 0x3F - bl sub_803E708 - ldr r0, _08056210 - ldr r1, [r0] - adds r0, r5, 0 - bl SendMessage - b _08056190 - .align 2, 0 -_0805620C: .4byte gFormatItems -_08056210: .4byte gUnknown_80FC6FC -_08056214: - ldr r0, _0805625C - movs r1, 0 - str r1, [r0] - ldr r0, _08056260 - str r1, [r0] - ldr r0, _08056264 - str r1, [r0] - ldr r0, _08056268 - strb r1, [r0] - ldr r0, _0805626C - strb r1, [r0] - ldr r0, _08056270 - strb r1, [r0] - ldr r0, _08056274 - str r1, [r0] - ldr r0, _08056278 - strb r1, [r0] - ldr r0, [sp, 0x150] - cmp r0, 0 - beq _0805624C - ldr r0, [r5, 0x70] - ldr r2, _0805627C - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x3 - bhi _0805624C - adds r0, 0x1 - strb r0, [r1] -_0805624C: - adds r0, r7, 0 - bl sub_8057070 - str r0, [sp, 0x124] - movs r0, 0 - mov r9, r0 - b _080563E4 - .align 2, 0 -_0805625C: .4byte gUnknown_202F214 -_08056260: .4byte gUnknown_202F20C -_08056264: .4byte gUnknown_202F210 -_08056268: .4byte gUnknown_202F218 -_0805626C: .4byte gUnknown_202F219 -_08056270: .4byte gUnknown_202F21A -_08056274: .4byte gUnknown_202F21C -_08056278: .4byte gUnknown_202F220 -_0805627C: .4byte 0x00000153 -_08056280: - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _0805628E - b _08056444 -_0805628E: - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - beq _0805629A - b _08056444 -_0805629A: - ldr r4, [r5, 0x70] - ldr r0, [sp, 0x120] - cmp r0, 0 - bne _080562AC - ldrh r0, [r7, 0x2] - cmp r0, 0x19 - beq _080562AC - cmp r0, 0xE3 - bne _080562BE -_080562AC: - adds r0, r5, 0 - bl IsSleeping - lsls r0, 24 - cmp r0, 0 - bne _080562CE - adds r0, r5, 0 - movs r1, 0x1 - b _080562C2 -_080562BE: - adds r0, r5, 0 - movs r1, 0 -_080562C2: - bl CannotAttack - lsls r0, 24 - cmp r0, 0 - beq _080562CE - b _08056400 -_080562CE: - movs r1, 0xA5 - lsls r1, 1 - adds r0, r4, r1 - movs r6, 0 - strb r6, [r0] - ldrh r0, [r7, 0x2] - cmp r0, 0x9 - bne _080562F4 - ldr r4, [r5, 0x70] - movs r0, 0x8 - bl DungeonRandInt - adds r4, 0x46 - strb r0, [r4] - adds r0, r5, 0 - bl TargetTileInFront - movs r2, 0 - str r2, [sp, 0x12C] -_080562F4: - ldr r0, _080563A0 - str r6, [r0] - str r6, [sp, 0xC] - ldr r0, [sp, 0x128] - cmp r0, 0x1 - bhi _08056324 - add r0, sp, 0xC - adds r1, r5, 0 - adds r2, r7, 0 - bl sub_8056CE8 - add r0, sp, 0xC - adds r1, r5, 0 - bl sub_80574C4 - mov r1, r9 - cmp r1, 0 - beq _08056324 - ldr r2, [sp, 0x12C] - cmp r2, 0 - beq _08056324 - ldr r0, [sp, 0xC] - cmp r0, 0 - beq _08056400 -_08056324: - mov r0, r10 - str r0, [sp] - movs r0, 0 - mov r1, r9 - cmp r1, 0 - bne _08056332 - movs r0, 0x1 -_08056332: - str r0, [sp, 0x4] - ldr r2, [sp, 0x128] - str r2, [sp, 0x8] - adds r0, r5, 0 - adds r1, r7, 0 - mov r2, r8 - add r3, sp, 0xC - bl sub_8056468 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r0, _080563A0 - ldr r0, [r0] - cmp r0, 0 - beq _08056358 - bl sub_806A1E8 -_08056358: - ldr r1, [r5, 0x70] - adds r0, r1, 0 - adds r0, 0xBC - ldrb r0, [r0] - cmp r0, 0x2 - beq _0805637C - cmp r0, 0x4 - beq _0805637C - movs r2, 0xB6 - lsls r2, 1 - adds r0, r1, r2 - mov r2, r8 - strh r2, [r0] - movs r2, 0xB7 - lsls r2, 1 - adds r0, r1, r2 - mov r1, r8 - strh r1, [r0] -_0805637C: - ldr r1, _080563A4 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r2, [sp, 0x128] - cmp r2, 0 - beq _080563A8 - mov r0, r10 - str r0, [sp] - ldr r1, [sp, 0x150] - str r1, [sp, 0x4] - adds r0, r5, 0 - adds r1, r7, 0 - adds r3, r4, 0 - bl sub_80566F8 - b _080563B8 - .align 2, 0 -_080563A0: .4byte gUnknown_203B438 -_080563A4: .4byte gUnknown_202F214 -_080563A8: - ldr r2, [sp, 0x150] - str r2, [sp] - add r0, sp, 0xC - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r10 - bl sub_8053704 -_080563B8: - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08056400 - adds r0, r5, 0 - bl sub_806CF18 - ldr r0, [r5, 0x70] - movs r2, 0xA5 - lsls r2, 1 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _080563E0 - strb r0, [r1] - adds r0, r5, 0 - bl sub_8079764 -_080563E0: - movs r0, 0x1 - add r9, r0 -_080563E4: - ldr r1, [sp, 0x124] - cmp r9, r1 - bge _08056400 - movs r2, 0x1 - str r2, [sp, 0x12C] - ldr r0, _08056458 - ldrb r0, [r0] - cmp r0, 0 - bne _08056400 - ldr r0, _0805645C - ldrb r0, [r0] - cmp r0, 0 - bne _08056400 - b _08056280 -_08056400: - ldr r0, _08056460 - ldrb r0, [r0] - cmp r0, 0 - beq _08056418 - adds r0, r5, 0 - adds r1, r5, 0 - bl SendImmobilizeEndMessage - adds r0, r5, 0 - adds r1, r5, 0 - bl SendLinkedEndMessage -_08056418: - ldr r0, _08056464 - ldrb r0, [r0] - cmp r0, 0 - beq _08056444 - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08056444 - ldr r4, [r5, 0x70] - adds r0, r5, 0 - adds r1, r5, 0 - movs r2, 0 - bl ConfuseStatusTarget - adds r4, 0xFB - ldrb r0, [r4] - cmp r0, 0 - bne _08056444 - movs r0, 0x1 - strb r0, [r4] -_08056444: - movs r0, 0x1 -_08056446: - add sp, 0x130 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08056458: .4byte gUnknown_202F220 -_0805645C: .4byte gUnknown_202F221 -_08056460: .4byte gUnknown_202F21A -_08056464: .4byte gUnknown_202F219 - thumb_func_end sub_8055FA0 - - thumb_func_start sub_8056468 -sub_8056468: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r0, 0 - mov r8, r1 - mov r9, r2 - adds r4, r3, 0 - ldr r0, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - mov r10, r0 - adds r0, r6, 0 - bl sub_8045888 - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r7, r1, 31 - mov r2, r9 - cmp r2, 0 - beq _08056518 - movs r5, 0 - b _080564A6 -_080564A2: - adds r4, 0x4 - adds r5, 0x1 -_080564A6: - cmp r5, 0x40 - bgt _080564BC - ldr r0, [r4] - cmp r0, 0 - beq _080564BC - bl sub_8045888 - lsls r0, 24 - cmp r0, 0 - beq _080564A2 - movs r7, 0x1 -_080564BC: - cmp r7, 0 - beq _080564F2 - ldr r0, _080564DC - ldr r1, [r6, 0x70] - movs r2, 0 - bl SetMessageArgument_2 - ldr r0, [sp, 0x24] - cmp r0, 0 - bne _080564E4 - ldr r0, _080564E0 - mov r1, r8 - movs r2, 0 - bl sub_80928C0 - b _080564F2 - .align 2, 0 -_080564DC: .4byte gAvailablePokemonNames -_080564E0: .4byte gFormatItems -_080564E4: - ldr r0, _08056508 - ldr r2, [sp, 0x24] - lsls r1, r2, 24 - lsrs r1, 24 - movs r2, 0 - bl BufferItemName -_080564F2: - mov r0, r8 - ldrh r1, [r0, 0x2] - ldr r0, _0805650C - cmp r1, r0 - beq _08056510 - adds r0, r6, 0 - mov r1, r9 - bl sub_805239C - b _08056518 - .align 2, 0 -_08056508: .4byte gFormatItems -_0805650C: .4byte 0x00000163 -_08056510: - adds r0, r6, 0 - mov r1, r9 - bl sub_80522E8 -_08056518: - cmp r7, 0 - beq _08056544 - ldr r2, [sp] - cmp r2, 0 - beq _0805652A - adds r0, r6, 0 - mov r1, r8 - movs r2, 0x1 - b _08056530 -_0805652A: - adds r0, r6, 0 - mov r1, r8 - movs r2, 0 -_08056530: - bl sub_8040BB0 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r6, 0 - mov r1, r8 - bl sub_8040DA0 - b _08056550 -_08056544: - ldr r0, [r6, 0x70] - adds r0, 0x46 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_806CE68 -_08056550: - mov r0, r10 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8056468 - - thumb_func_start sub_8056564 -sub_8056564: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - adds r4, r3, 0 - ldr r0, [r6, 0x70] - mov r8, r0 - ldr r0, _08056680 - ldr r0, [r0] - ldr r1, _08056684 - adds r0, r1 - ldrb r0, [r0] - mov r9, r0 - cmp r0, 0 - beq _0805658C - b _080566E4 -_0805658C: - mov r2, r8 - movs r1, 0x4 - ldrsh r0, [r2, r1] - bl GetBodySize - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _080565A4 - cmp r4, 0x1 - bne _080565A4 - b _080566E4 -_080565A4: - ldrh r4, [r7, 0x2] - adds r0, r6, 0 - bl GetApparentWeather - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_80412E0 - lsls r0, 16 - lsrs r0, 16 - bl sub_800ECB8 - movs r2, 0x6 - ldrsh r4, [r0, r2] - movs r1, 0 - ldrsh r0, [r5, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 11 - movs r0, 0x2 - ldrsh r2, [r5, r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 11 - movs r2, 0x80 - lsls r2, 5 - adds r3, r0, r2 - movs r2, 0xC0 - lsls r2, 4 - adds r0, r1, r2 - cmp r0, 0 - bge _080565EC - adds r0, 0xFF -_080565EC: - lsls r0, 8 - lsrs r0, 16 - ldr r1, _08056688 - ldr r2, [sp, 0x14] - ands r2, r1 - orrs r2, r0 - str r2, [sp, 0x14] - adds r0, r3, 0 - cmp r0, 0 - bge _08056602 - adds r0, 0xFF -_08056602: - lsls r0, 8 - lsrs r0, 16 - lsls r0, 16 - ldr r1, _0805668C - ands r2, r1 - orrs r2, r0 - str r2, [sp, 0x14] - cmp r4, 0 - beq _080566E4 - ldrh r4, [r7, 0x2] - adds r0, r6, 0 - bl GetApparentWeather - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_80412E0 - lsls r0, 16 - lsrs r0, 16 - bl sub_800EF10 - bl sub_800EF64 - movs r0, 0x5E - bl sub_803E46C - mov r0, r8 - movs r1, 0x4 - ldrsh r5, [r0, r1] - ldrh r4, [r7, 0x2] - adds r0, r6, 0 - bl GetApparentWeather - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_80412E0 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_800E710 - adds r2, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _08056690 - add r0, sp, 0x8 - adds r1, r6, 0 - adds r1, 0x28 - lsls r2, 24 - lsrs r2, 24 - bl sub_800569C - b _08056694 - .align 2, 0 -_08056680: .4byte gDungeon -_08056684: .4byte 0x0001820a -_08056688: .4byte 0xffff0000 -_0805668C: .4byte 0x0000ffff -_08056690: - mov r2, r9 - str r2, [sp, 0x8] -_08056694: - ldrh r4, [r7, 0x2] - adds r0, r6, 0 - bl GetApparentWeather - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_80412E0 - mov r1, sp - strh r0, [r1] - mov r2, r8 - ldrh r0, [r2, 0x4] - strh r0, [r1, 0x2] - ldr r0, [r6, 0xC] - cmp r0, 0 - bge _080566BC - adds r0, 0xFF -_080566BC: - asrs r0, 8 - strh r0, [r1, 0x4] - mov r1, sp - ldr r0, [r6, 0x10] - cmp r0, 0 - bge _080566CA - adds r0, 0xFF -_080566CA: - asrs r0, 8 - strh r0, [r1, 0x6] - mov r0, r8 - adds r0, 0x46 - ldrb r0, [r0] - str r0, [sp, 0xC] - movs r0, 0 - str r0, [sp, 0x10] - add r1, sp, 0x14 - mov r0, sp - bl sub_800E308 - b _080566E8 -_080566E4: - movs r0, 0x1 - negs r0, r0 -_080566E8: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8056564 - - thumb_func_start sub_80566F8 -sub_80566F8: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x54 - mov r10, r0 - str r1, [sp, 0x1C] - str r2, [sp, 0x20] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x24] - movs r0, 0 - str r0, [sp, 0x34] - movs r7, 0 - mov r1, r10 - ldr r6, [r1, 0x70] - ldr r2, [sp, 0x1C] - ldrh r0, [r2, 0x2] - bl sub_800ED20 - movs r1, 0x2 - str r1, [sp, 0x44] - cmp r0, 0x1 - beq _08056736 - movs r2, 0x6 - str r2, [sp, 0x44] - cmp r0, 0x2 - bne _08056736 - movs r0, 0x3 - str r0, [sp, 0x44] -_08056736: - mov r1, r10 - ldrh r0, [r1, 0x6] - lsls r0, 16 - ldrh r3, [r1, 0x4] - orrs r3, r0 - str r3, [sp, 0xC] - ldr r1, _08056814 - adds r2, r6, 0 - adds r2, 0x46 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - movs r1, 0 - ldrsh r6, [r0, r1] - str r6, [sp, 0x28] - movs r1, 0x2 - ldrsh r6, [r0, r1] - str r6, [sp, 0x2C] - movs r6, 0 - str r6, [sp, 0x30] - mov r8, r2 - ldr r0, [sp, 0x20] - cmp r6, r0 - bge _080567EC - add r0, sp, 0xC - movs r2, 0 - ldrsh r1, [r0, r2] - cmp r1, 0 - blt _080567EC - asrs r0, r3, 16 - cmp r0, 0 - blt _080567EC - cmp r1, 0x37 - bgt _080567EC - cmp r0, 0x1F - bgt _080567EC - add r6, sp, 0xC -_08056780: - ldrh r0, [r6] - ldr r1, [sp, 0x28] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - ldr r2, _08056818 - ands r2, r3 - orrs r2, r0 - asrs r0, r2, 16 - ldr r1, [sp, 0x2C] - adds r0, r1 - lsls r0, 16 - ldr r1, _0805681C - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0xC] - adds r7, 0x1 - movs r2, 0 - ldrsh r0, [r6, r2] - asrs r1, 16 - bl GetTile - adds r2, r0, 0 - ldrh r1, [r2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _080567EC - ldr r0, [r2, 0x10] - cmp r0, 0 - beq _080567C6 - bl GetEntityType - cmp r0, 0x1 - beq _080567EC -_080567C6: - ldr r0, [sp, 0x30] - adds r0, 0x1 - str r0, [sp, 0x30] - ldr r1, [sp, 0x20] - cmp r0, r1 - bge _080567EC - movs r0, 0 - ldrsh r2, [r6, r0] - cmp r2, 0 - blt _080567EC - ldr r0, [sp, 0xC] - asrs r1, r0, 16 - adds r3, r0, 0 - cmp r1, 0 - blt _080567EC - cmp r2, 0x37 - bgt _080567EC - cmp r1, 0x1F - ble _08056780 -_080567EC: - ldr r2, [sp, 0x1C] - ldrh r1, [r2, 0x2] - mov r0, r10 - bl sub_805755C - lsls r0, 24 - cmp r0, 0 - beq _08056820 - mov r0, r10 - ldr r1, [sp, 0x1C] - bl MoveMatchesChargingStatus - lsls r0, 24 - cmp r0, 0 - bne _08056820 - movs r6, 0x1 - negs r6, r6 - str r6, [sp, 0x40] - b _0805682E - .align 2, 0 -_08056814: .4byte gAdjacentTileOffsets -_08056818: .4byte 0xffff0000 -_0805681C: .4byte 0x0000ffff -_08056820: - mov r0, r10 - add r1, sp, 0xC - ldr r2, [sp, 0x1C] - ldr r3, [sp, 0x20] - bl sub_8056564 - str r0, [sp, 0x40] -_0805682E: - mov r0, r10 - ldrh r1, [r0, 0x4] - add r0, sp, 0xC - strh r1, [r0] - mov r2, r10 - ldrh r1, [r2, 0x6] - strh r1, [r0, 0x2] - ldr r1, _08056874 - mov r6, r8 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - str r1, [sp, 0x28] - movs r1, 0x2 - ldrsh r6, [r0, r1] - str r6, [sp, 0x2C] - movs r0, 0x18 - ldr r1, [sp, 0x44] - bl __divsi3 - adds r1, r7, 0 - muls r1, r0 - ldr r2, [sp, 0x20] - cmp r2, 0x1 - ble _08056878 - adds r6, r1, 0 - adds r6, 0x8 - str r6, [sp, 0x38] - cmp r6, 0x3F - ble _0805687C - movs r0, 0x40 - str r0, [sp, 0x38] - b _0805687C - .align 2, 0 -_08056874: .4byte gAdjacentTileOffsets -_08056878: - movs r2, 0x20 - str r2, [sp, 0x38] -_0805687C: - movs r6, 0 - mov r9, r6 - movs r0, 0x80 - lsls r0, 12 - bl __divsi3 - str r0, [sp, 0x48] - ldr r1, _0805696C - mov r2, r8 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x3C] - ldr r0, _08056970 - ldr r0, [r0] - ldr r6, _08056974 - adds r0, r6 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0 - str r0, [sp, 0x30] - ldr r1, [sp, 0x20] - cmp r0, r1 - blt _080568B0 - b _08056AB6 -_080568B0: - add r0, sp, 0xC - movs r2, 0 - ldrsh r1, [r0, r2] - cmp r1, 0 - bge _080568BC - b _08056AB6 -_080568BC: - ldrh r0, [r0, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _080568C8 - b _08056AB6 -_080568C8: - cmp r1, 0x37 - ble _080568CE - b _08056AB6 -_080568CE: - cmp r0, 0x1F - ble _080568D4 - b _08056AB6 -_080568D4: - add r7, sp, 0xC -_080568D6: - ldr r6, [sp, 0xC] - ldrh r0, [r7] - ldr r1, [sp, 0x28] - adds r0, r1 - strh r0, [r7] - ldrh r0, [r7, 0x2] - ldr r2, [sp, 0x2C] - adds r0, r2 - strh r0, [r7, 0x2] - add r0, sp, 0xC - bl sub_803F428 - lsls r0, 24 - cmp r0, 0 - bne _080568F6 - b _08056A00 -_080568F6: - ldr r0, _08056970 - ldr r0, [r0] - ldr r1, _08056978 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08056906 - b _08056A00 -_08056906: - lsls r1, r6, 16 - asrs r1, 16 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 11 - movs r2, 0xC0 - lsls r2, 4 - adds r4, r0, r2 - asrs r1, r6, 16 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 11 - movs r6, 0x80 - lsls r6, 5 - adds r5, r0, r6 - ldr r1, [sp, 0x28] - lsls r0, r1, 8 - ldr r6, [sp, 0x44] - adds r2, r6, 0 - muls r2, r0 - str r2, [sp, 0x4C] - ldr r1, [sp, 0x2C] - lsls r0, r1, 8 - adds r2, r6, 0 - muls r2, r0 - str r2, [sp, 0x50] - movs r6, 0 - movs r0, 0x18 - ldr r1, [sp, 0x44] - bl __divsi3 - mov r8, r0 - cmp r6, r8 - bge _08056A0E -_0805694A: - ldr r0, [sp, 0x40] - cmp r0, 0 - blt _080569D4 - ldr r1, [sp, 0x24] - cmp r1, 0 - beq _0805697C - mov r0, r9 - cmp r0, 0 - bge _0805695E - adds r0, 0xFF -_0805695E: - asrs r0, 8 - bl sin_abs_4096 - ldr r2, [sp, 0x38] - adds r3, r0, 0 - muls r3, r2 - b _0805697E - .align 2, 0 -_0805696C: .4byte gUnknown_81069D4 -_08056970: .4byte gDungeon -_08056974: .4byte 0x0001c05e -_08056978: .4byte 0x0001820a -_0805697C: - movs r3, 0 -_0805697E: - adds r0, r4, 0 - cmp r4, 0 - bge _08056986 - adds r0, 0xFF -_08056986: - lsls r0, 8 - lsrs r0, 16 - ldr r1, _080569F0 - ldr r2, [sp, 0x10] - ands r2, r1 - orrs r2, r0 - str r2, [sp, 0x10] - subs r0, r5, r3 - cmp r0, 0 - bge _0805699C - adds r0, 0xFF -_0805699C: - lsls r0, 8 - lsrs r0, 16 - lsls r0, 16 - ldr r1, _080569F4 - ands r2, r1 - orrs r2, r0 - str r2, [sp, 0x10] - adds r2, r5, 0 - cmp r2, 0 - bge _080569B2 - adds r2, 0xFF -_080569B2: - asrs r2, 8 - ldr r0, _080569F8 - ldr r0, [r0] - ldr r1, _080569FC - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - subs r2, r0 - lsrs r0, r2, 31 - adds r2, r0 - asrs r2, 1 - ldr r0, [sp, 0x3C] - adds r2, r0 - ldr r0, [sp, 0x40] - add r1, sp, 0x10 - bl sub_800E3AC -_080569D4: - movs r0, 0x30 - bl sub_803E46C - ldr r1, [sp, 0x4C] - adds r4, r1 - ldr r2, [sp, 0x50] - adds r5, r2 - ldr r0, [sp, 0x48] - add r9, r0 - adds r6, 0x1 - cmp r6, r8 - blt _0805694A - b _08056A0E - .align 2, 0 -_080569F0: .4byte 0xffff0000 -_080569F4: .4byte 0x0000ffff -_080569F8: .4byte gDungeon -_080569FC: .4byte 0x000181f2 -_08056A00: - movs r0, 0x18 - ldr r1, [sp, 0x44] - bl __divsi3 - ldr r1, [sp, 0x48] - muls r0, r1 - add r9, r0 -_08056A0E: - movs r2, 0 - ldrsh r0, [r7, r2] - movs r6, 0x2 - ldrsh r1, [r7, r6] - bl GetTile - adds r6, r0, 0 - ldrh r1, [r6] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08056AB6 - ldr r0, [r6, 0x10] - cmp r0, 0 - beq _08056A8E - bl GetEntityType - cmp r0, 0x1 - bne _08056A8E - ldr r0, [r6, 0x10] - ldr r1, [sp, 0x1C] - bl sub_80571F0 - lsls r0, 24 - cmp r0, 0 - bne _08056A8E - ldr r0, [sp, 0x34] - cmp r0, 0 - bgt _08056AB6 - movs r4, 0 - mov r2, r10 - ldr r1, [r2, 0x70] - adds r0, r1, 0 - adds r0, 0xBC - ldrb r2, [r0] - cmp r2, 0x2 - beq _08056A64 - adds r0, 0x2C - ldrb r0, [r0] - cmp r0, 0x1 - beq _08056A64 - cmp r2, 0x4 - bne _08056A66 -_08056A64: - movs r4, 0x1 -_08056A66: - mov r0, r10 - ldr r1, [sp, 0x1C] - movs r2, 0 - bl GetMoveTargetAndRangeForPokemon - adds r2, r0, 0 - lsls r2, 16 - asrs r2, 16 - ldr r0, [r6, 0x10] - str r0, [sp] - ldr r6, [sp, 0x1C] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - ldr r0, [sp, 0x34] - add r1, sp, 0x14 - mov r3, r10 - bl sub_8056F80 - str r0, [sp, 0x34] - b _08056AB6 -_08056A8E: - ldr r0, [sp, 0x30] - adds r0, 0x1 - str r0, [sp, 0x30] - ldr r1, [sp, 0x20] - cmp r0, r1 - bge _08056AB6 - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r1, 0 - blt _08056AB6 - ldrh r0, [r7, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - blt _08056AB6 - cmp r1, 0x37 - bgt _08056AB6 - cmp r0, 0x1F - bgt _08056AB6 - b _080568D6 -_08056AB6: - ldr r6, [sp, 0x40] - cmp r6, 0 - blt _08056AC2 - adds r0, r6, 0 - bl sub_800DC14 -_08056AC2: - movs r0, 0x1 - bl sub_804178C - ldr r0, _08056AF4 - ldr r0, [r0] - ldr r1, _08056AF8 - adds r0, r1 - movs r2, 0 - strb r2, [r0] - ldr r6, [sp, 0x34] - cmp r6, 0 - ble _08056AFC - lsls r1, r6, 2 - add r0, sp, 0x14 - adds r1, r0 - str r2, [r1] - ldr r1, [sp, 0x78] - str r1, [sp] - mov r1, r10 - ldr r2, [sp, 0x1C] - ldr r3, [sp, 0x74] - bl sub_8053704 - b _08056B22 - .align 2, 0 -_08056AF4: .4byte gDungeon -_08056AF8: .4byte 0x0001c05e -_08056AFC: - ldr r0, [sp, 0x20] - cmp r0, 0x1 - bne _08056B22 - add r0, sp, 0xC - bl sub_803F428 - lsls r0, 24 - cmp r0, 0 - beq _08056B22 - movs r0, 0x1 - movs r1, 0x4A - bl sub_803E708 - mov r0, r10 - movs r1, 0 - ldr r2, [sp, 0x1C] - add r3, sp, 0xC - bl sub_8041168 -_08056B22: - add sp, 0x54 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80566F8 - - thumb_func_start sub_8056B34 -sub_8056B34: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - adds r6, r1, 0 - mov r8, r2 - adds r1, r3, 0 - ldr r4, [sp, 0x24] - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - bl GetMoveAccuracyOrAIChance - adds r5, r0, 0 - movs r0, 0x64 - bl DungeonRandInt - str r0, [sp] - ldr r0, [r7, 0x70] - mov r9, r0 - ldr r1, [r6, 0x70] - mov r10, r1 - cmp r4, 0 - beq _08056B70 - cmp r7, r6 - bne _08056B70 - b _08056CD4 -_08056B70: - mov r0, r8 - ldrh r1, [r0, 0x2] - ldr r0, _08056CC4 - cmp r1, r0 - bne _08056B8A - adds r0, r7, 0 - movs r1, 0x4 - bl IQSkillIsEnabled - lsls r0, 24 - cmp r0, 0 - beq _08056B8A - b _08056CD4 -_08056B8A: - mov r0, r9 - adds r0, 0xDC - ldrb r0, [r0] - cmp r0, 0x1 - bne _08056B96 - b _08056CD4 -_08056B96: - cmp r0, 0x2 - bne _08056B9C - b _08056CBE -_08056B9C: - cmp r5, 0x64 - ble _08056BA2 - b _08056CD4 -_08056BA2: - adds r0, r6, 0 - movs r1, 0x23 - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _08056BB6 - ldr r0, _08056CC8 - ldr r0, [r0] - subs r5, r0 -_08056BB6: - adds r0, r6, 0 - movs r1, 0x5 - bl IQSkillIsEnabled - lsls r0, 24 - cmp r0, 0 - beq _08056BCA - ldr r0, _08056CCC - ldr r0, [r0] - subs r5, r0 -_08056BCA: - mov r1, r9 - movs r0, 0x24 - ldrsh r4, [r1, r0] - adds r0, r7, 0 - movs r1, 0x33 - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _08056BE0 - adds r4, 0x2 -_08056BE0: - mov r1, r8 - ldrh r0, [r1, 0x2] - cmp r0, 0x40 - bne _08056BFC - adds r0, r7, 0 - bl GetApparentWeather - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _08056CD4 - cmp r0, 0x1 - bne _08056BFC - subs r4, 0x2 -_08056BFC: - cmp r4, 0 - bge _08056C02 - movs r4, 0 -_08056C02: - cmp r4, 0x14 - ble _08056C08 - movs r4, 0x14 -_08056C08: - ldr r1, _08056CD0 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bge _08056C16 - movs r0, 0 -_08056C16: - movs r1, 0xC8 - lsls r1, 7 - cmp r0, r1 - ble _08056C20 - adds r0, r1, 0 -_08056C20: - muls r5, r0 - adds r0, r5, 0 - cmp r5, 0 - bge _08056C2A - adds r0, 0xFF -_08056C2A: - asrs r5, r0, 8 - mov r0, r10 - movs r1, 0x26 - ldrsh r4, [r0, r1] - adds r0, 0xF5 - ldrb r0, [r0] - cmp r0, 0 - beq _08056C3C - movs r4, 0xA -_08056C3C: - adds r0, r6, 0 - bl GetApparentWeather - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08056C5A - adds r0, r6, 0 - movs r1, 0x1D - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _08056C5A - adds r4, 0x2 -_08056C5A: - adds r0, r7, 0 - movs r1, 0x30 - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _08056C86 - mov r0, r8 - bl GetMoveType - lsls r0, 24 - lsrs r0, 24 - bl IsTypePhysical - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _08056C80 - movs r1, 0x1 -_08056C80: - cmp r1, 0 - bne _08056C86 - adds r4, 0x2 -_08056C86: - cmp r4, 0 - bge _08056C8C - movs r4, 0 -_08056C8C: - cmp r4, 0x14 - ble _08056C92 - movs r4, 0x14 -_08056C92: - ldr r0, _08056CD0 - lsls r1, r4, 2 - adds r0, 0x54 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bge _08056CA2 - movs r0, 0 -_08056CA2: - movs r1, 0xC8 - lsls r1, 7 - cmp r0, r1 - ble _08056CAC - adds r0, r1, 0 -_08056CAC: - muls r5, r0 - adds r0, r5, 0 - cmp r5, 0 - bge _08056CB6 - adds r0, 0xFF -_08056CB6: - asrs r5, r0, 8 - ldr r0, [sp] - cmp r0, r5 - blt _08056CD4 -_08056CBE: - movs r0, 0 - b _08056CD6 - .align 2, 0 -_08056CC4: .4byte 0x00000163 -_08056CC8: .4byte gUnknown_80F519C -_08056CCC: .4byte gUnknown_80F51A0 -_08056CD0: .4byte gUnknown_80F50F4 -_08056CD4: - movs r0, 0x1 -_08056CD6: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8056B34 - - thumb_func_start sub_8056CE8 -sub_8056CE8: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - str r0, [sp, 0x10] - adds r5, r1, 0 - mov r8, r2 - movs r0, 0 - mov r9, r0 - movs r3, 0 - ldr r1, [r5, 0x70] - adds r0, r1, 0 - adds r0, 0xBC - ldrb r2, [r0] - cmp r2, 0x2 - beq _08056D18 - adds r0, 0x2C - ldrb r0, [r0] - cmp r0, 0x1 - beq _08056D18 - cmp r2, 0x4 - bne _08056D1A -_08056D18: - movs r3, 0x1 -_08056D1A: - mov r10, r3 - movs r1, 0 - ldr r0, [r5, 0x70] - adds r0, 0xBC - ldrb r0, [r0] - cmp r0, 0x2 - beq _08056D2C - cmp r0, 0x4 - bne _08056D2E -_08056D2C: - movs r1, 0x1 -_08056D2E: - str r1, [sp, 0x14] - adds r0, r5, 0 - movs r1, 0x7 - bl IQSkillIsEnabled - lsls r0, 24 - cmp r0, 0 - beq _08056D44 - movs r1, 0 - str r1, [sp, 0x14] - mov r10, r1 -_08056D44: - adds r0, r5, 0 - mov r1, r8 - movs r2, 0 - bl GetMoveTargetAndRangeForPokemon - lsls r0, 16 - asrs r7, r0, 16 - movs r0, 0xF - ands r0, r7 - cmp r0, 0x4 - bne _08056D86 - adds r0, r5, 0 - mov r1, r8 - bl MoveMatchesChargingStatus - lsls r0, 24 - lsrs r4, r0, 24 - mov r2, r8 - ldrh r0, [r2, 0x2] - cmp r0, 0x97 - bne _08056D7E - adds r0, r5, 0 - bl GetApparentWeather - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08056D7E - movs r4, 0x1 -_08056D7E: - movs r7, 0x73 - cmp r4, 0 - beq _08056D86 - movs r7, 0 -_08056D86: - movs r1, 0xF0 - ands r1, r7 - cmp r1, 0 - bne _08056DA6 - adds r0, r5, 0 - bl sub_80696A8 - cmp r0, 0 - bne _08056D9A - b _08056F64 -_08056D9A: - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - b _08056F56 -_08056DA6: - cmp r1, 0x10 - beq _08056DAE - cmp r1, 0x20 - bne _08056E34 -_08056DAE: - ldr r0, [r5, 0x70] - cmp r1, 0x20 - bne _08056DBC - adds r0, 0x46 - ldrb r4, [r0] - movs r0, 0x8 - b _08056DCA -_08056DBC: - adds r0, 0x46 - ldrb r0, [r0] - subs r4, r0, 0x1 - movs r0, 0x3 - cmp r0, 0 - bne _08056DCA - b _08056F64 -_08056DCA: - adds r6, r0, 0 -_08056DCC: - movs r0, 0x7 - ands r4, r0 - ldr r0, _08056E28 - lsls r3, r4, 2 - adds r3, r0 - ldrh r0, [r3] - ldrh r2, [r5, 0x4] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - ldr r2, _08056E2C - ldr r1, [sp, 0xC] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0xC] - ldrh r2, [r3, 0x2] - ldrh r0, [r5, 0x6] - adds r2, r0 - lsls r2, 16 - ldr r0, _08056E30 - ands r1, r0 - orrs r1, r2 - str r1, [sp, 0xC] - add r0, sp, 0xC - bl sub_804AD0C - cmp r0, 0 - beq _08056E1C - str r0, [sp] - mov r1, r8 - str r1, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - mov r0, r9 - ldr r1, [sp, 0x10] - adds r2, r7, 0 - adds r3, r5, 0 - bl sub_8056F80 - mov r9, r0 -_08056E1C: - subs r6, 0x1 - adds r4, 0x1 - cmp r6, 0 - bne _08056DCC - b _08056F64 - .align 2, 0 -_08056E28: .4byte gAdjacentTileOffsets -_08056E2C: .4byte 0xffff0000 -_08056E30: .4byte 0x0000ffff -_08056E34: - cmp r1, 0x30 - bne _08056E9C - movs r6, 0 -_08056E3A: - ldr r0, _08056E74 - ldr r0, [r0] - lsls r1, r6, 2 - ldr r2, _08056E78 - adds r0, r2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08056E94 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8045A70 - lsls r0, 24 - cmp r0, 0 - beq _08056E94 - cmp r4, r5 - bne _08056E7C - str r5, [sp] - mov r0, r8 - str r0, [sp, 0x4] - ldr r1, [sp, 0x14] - str r1, [sp, 0x8] - b _08056E86 - .align 2, 0 -_08056E74: .4byte gDungeon -_08056E78: .4byte 0x000135cc -_08056E7C: - str r4, [sp] - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] -_08056E86: - mov r0, r9 - ldr r1, [sp, 0x10] - adds r2, r7, 0 - adds r3, r5, 0 - bl sub_8056F80 - mov r9, r0 -_08056E94: - adds r6, 0x1 - cmp r6, 0x13 - ble _08056E3A - b _08056F64 -_08056E9C: - cmp r1, 0x40 - bne _08056EEA - movs r4, 0 - adds r0, r5, 0 - bl sub_80696FC - cmp r0, 0 - beq _08056ED0 - mov r4, r9 - str r0, [sp] - mov r1, r8 - str r1, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - adds r0, r4, 0 - ldr r1, [sp, 0x10] - adds r2, r7, 0 - adds r3, r5, 0 - bl sub_8056F80 - mov r9, r0 - mov r1, r9 - eors r1, r4 - negs r0, r1 - orrs r0, r1 - lsrs r4, r0, 31 -_08056ED0: - cmp r4, 0 - bne _08056F64 - adds r0, r5, 0 - bl sub_806977C - cmp r0, 0 - beq _08056F64 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - b _08056F56 -_08056EEA: - cmp r1, 0x50 - beq _08056F64 - cmp r1, 0x80 - bne _08056F00 - adds r0, r5, 0 - bl sub_80696FC - cmp r0, 0 - beq _08056F64 - str r0, [sp] - b _08056F4E -_08056F00: - cmp r1, 0x60 - bne _08056F48 - movs r6, 0 -_08056F06: - ldr r0, _08056F40 - ldr r0, [r0] - lsls r1, r6, 2 - ldr r2, _08056F44 - adds r0, r2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08056F38 - str r4, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - mov r0, r9 - ldr r1, [sp, 0x10] - adds r2, r7, 0 - adds r3, r5, 0 - bl sub_8056F80 - mov r9, r0 -_08056F38: - adds r6, 0x1 - cmp r6, 0x13 - ble _08056F06 - b _08056F64 - .align 2, 0 -_08056F40: .4byte gDungeon -_08056F44: .4byte 0x000135cc -_08056F48: - cmp r1, 0x70 - bne _08056F64 - str r5, [sp] -_08056F4E: - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] -_08056F56: - mov r0, r9 - ldr r1, [sp, 0x10] - adds r2, r7, 0 - adds r3, r5, 0 - bl sub_8056F80 - mov r9, r0 -_08056F64: - mov r1, r9 - lsls r0, r1, 2 - ldr r2, [sp, 0x10] - adds r0, r2 - movs r1, 0 - str r1, [r0] - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8056CE8 - - thumb_func_start sub_8056F80 -sub_8056F80: - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - mov r8, r1 - adds r4, r3, 0 - ldr r7, [sp, 0x18] - ldr r0, [sp, 0x20] - lsls r2, 16 - asrs r2, 16 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - movs r6, 0 - ldr r1, [r7, 0x70] - ldr r3, [sp, 0x1C] - ldrh r0, [r3, 0x2] - cmp r0, 0xFC - bne _08056FAA - cmp r4, r7 - beq _08057060 -_08056FAA: - ldrb r0, [r1, 0x8] - cmp r0, 0x1 - beq _08057060 - adds r0, r1, 0 - adds r0, 0xA4 - ldrb r0, [r0] - cmp r0, 0x4 - beq _08057060 - cmp r0, 0x1 - beq _08057060 - mov r0, r12 - cmp r0, 0 - bne _0805702C - movs r0, 0xF - ands r0, r2 - cmp r0, 0 - beq _08056FD0 - cmp r0, 0x4 - bne _08056FE6 -_08056FD0: - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0 - bl GetTreatmentBetweenMonsters - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805702E - b _0805702C -_08056FE6: - cmp r0, 0x1 - bne _08056FFE - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0 - bl GetTreatmentBetweenMonsters - lsls r0, 24 - cmp r0, 0 - bne _0805702E - b _0805702C -_08056FFE: - cmp r0, 0x2 - beq _0805702C - cmp r0, 0x5 - bne _0805700C - cmp r4, r7 - beq _0805702E - b _0805702C -_0805700C: - cmp r0, 0x6 - bne _08057028 - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0 - bl GetTreatmentBetweenMonsters - lsls r0, 24 - cmp r0, 0 - bne _0805702E - cmp r4, r7 - beq _0805702E - b _0805702C -_08057028: - cmp r0, 0x3 - bne _0805702E -_0805702C: - movs r6, 0x1 -_0805702E: - adds r0, r7, 0 - ldr r1, [sp, 0x1C] - bl sub_80571F0 - lsls r0, 24 - cmp r0, 0 - beq _0805703E - movs r6, 0 -_0805703E: - cmp r6, 0 - beq _08057060 - cmp r5, 0x3F - bgt _08057060 - lsls r0, r5, 2 - add r0, r8 - str r7, [r0] - ldr r0, [r7, 0x70] - ldrb r0, [r0, 0x6] - cmp r0, 0 - bne _0805705E - ldr r1, _0805706C - ldr r0, [r1] - cmp r0, 0 - bne _0805705E - str r7, [r1] -_0805705E: - adds r5, 0x1 -_08057060: - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_0805706C: .4byte gUnknown_203B438 - thumb_func_end sub_8056F80 - - .align 2, 0 diff --git a/asm/code_805D8C8.s b/asm/code_805D8C8.s index 282179114..7c45e093e 100644 --- a/asm/code_805D8C8.s +++ b/asm/code_805D8C8.s @@ -4122,7 +4122,7 @@ _08063AEC: ldr r0, _08063B2C ldr r1, [r0] adds r0, r6, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08063B3A .align 2, 0 _08063B1C: .4byte gDungeon @@ -4134,7 +4134,7 @@ _08063B30: ldr r0, _08063B50 ldr r1, [r0] adds r0, r6, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08063B3A: movs r0, 0x78 movs r1, 0x1F @@ -4442,7 +4442,7 @@ _08063D70: ldr r0, _08063DAC ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08063DBA .align 2, 0 _08063D98: .4byte gDungeon @@ -4455,7 +4455,7 @@ _08063DB0: ldr r0, _08063DD0 ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08063DBA: movs r0, 0x78 movs r1, 0x1F @@ -4914,7 +4914,7 @@ _0806414E: ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage adds r3, r0, 0 b _08064162 .align 2, 0 @@ -6385,7 +6385,7 @@ _08064CF2: ldr r0, [r5] cmp r0, 0x2 bne _08064CFC - bl sub_80532B4 + bl DisplayMessageLog _08064CFC: ldr r0, [r5] cmp r0, 0x3 @@ -6817,7 +6817,7 @@ _08065062: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _08065088 ldr r0, _08065094 @@ -6846,7 +6846,7 @@ sub_806509C: ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _080650B8 movs r0, 0 @@ -7001,7 +7001,7 @@ sub_80651D0: ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _080651F4 bl GetLeaderActionContainer @@ -7025,7 +7025,7 @@ sub_80651FC: ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage adds r5, r0, 0 cmp r5, 0x1 bne _08065248 @@ -8730,7 +8730,7 @@ _08065FFE: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _08066194 .align 2, 0 _0806600C: .4byte 0x0000065d diff --git a/asm/code_805D8C8_1.s b/asm/code_805D8C8_1.s index be8f4e4bc..7e850607d 100644 --- a/asm/code_805D8C8_1.s +++ b/asm/code_805D8C8_1.s @@ -341,7 +341,7 @@ _08068BB2: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _08068BD0 .align 2, 0 _08068BC0: .4byte gUnknown_80FE168 @@ -350,7 +350,7 @@ _08068BC4: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _08068BD0: pop {r4-r7} pop {r0} @@ -653,7 +653,7 @@ _08068E1C: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage add r4, sp, 0x3C _08068E34: add r0, sp, 0x214 @@ -709,7 +709,7 @@ _08068E8E: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _08068E34 _08068EA2: @@ -1028,7 +1028,7 @@ _08069104: movs r0, 0x3C movs r1, 0x49 bl sub_803E708 - bl sub_80532B4 + bl DisplayMessageLog ldr r5, _08069198 ldr r2, [r5] ldrb r0, [r2, 0x6] @@ -1071,7 +1071,7 @@ _08069104: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage adds r4, r0, 0 cmp r4, 0x1 bne _080691E0 @@ -1079,7 +1079,7 @@ _08069104: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage ldr r0, [r5] strb r4, [r0, 0x4] ldr r0, [r5] @@ -1107,7 +1107,7 @@ _080691B4: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _080691E0 .align 2, 0 _080691C4: .4byte gUnknown_80FE2D0 @@ -1353,7 +1353,7 @@ _08069384: ldr r0, _080694A4 ldr r1, [r0] mov r0, r8 - bl sub_805239C + bl DisplayDungeonLoggableMessageTrue bl sub_803E178 bl sub_8049ED4 _080693C6: diff --git a/asm/code_8066D04.s b/asm/code_8066D04.s index 389223b99..3fe1490cd 100644 --- a/asm/code_8066D04.s +++ b/asm/code_8066D04.s @@ -135,7 +135,7 @@ _08066ECC: _08066F1E: ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08066F7E .align 2, 0 _08066F28: .4byte 0xffffff00 @@ -167,7 +167,7 @@ _08066F46: ldr r0, _08066F98 ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage ldr r0, _08066F9C ldr r0, [r0] ldr r2, _08066FA0 @@ -314,7 +314,7 @@ _08067040: _0806709E: ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _080670EE .align 2, 0 _080670A8: .4byte gUnknown_202DEA8 @@ -339,7 +339,7 @@ _080670CA: ldr r0, _08067104 ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage ldr r0, _08067108 ldr r0, [r0] ldr r1, _0806710C @@ -390,7 +390,7 @@ sub_8067110: bl sub_80464AC adds r1, r0, 0 adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage ldr r0, [r6] str r0, [sp, 0x8] adds r0, r5, 0 @@ -498,7 +498,7 @@ _08067220: _08067230: ldr r1, [r0] adds r0, r6, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0x14 movs r1, 0x4C bl sub_803E708 @@ -677,7 +677,7 @@ _08067384: ldr r0, _080673B8 ldr r1, [r0] adds r0, r6, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _080673C6 .align 2, 0 _080673B0: .4byte gFormatItems @@ -687,7 +687,7 @@ _080673BC: ldr r0, _080673F8 ldr r1, [r0] adds r0, r6, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _080673C6: add r0, sp, 0x4 ldrb r0, [r0, 0x2] @@ -1109,14 +1109,14 @@ _08067708: mov r1, sp _08067716: movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _0806772A _0806771E: ldr r0, _08067738 ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _0806772A: add sp, 0x12C pop {r3,r4} @@ -1190,7 +1190,7 @@ sub_8067794: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _0806786C .align 2, 0 _080677B0: .4byte gCannotFarewell @@ -1257,7 +1257,7 @@ _08067834: movs r0, 0 adds r1, r5, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _0806786C ldr r4, _0806787C @@ -1276,7 +1276,7 @@ _08067834: movs r0, 0 adds r1, r6, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _0806786C: add sp, 0x40 pop {r4-r7} @@ -1401,7 +1401,7 @@ _0806794C: _08067962: ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08067A56 .align 2, 0 _0806796C: .4byte gAvailablePokemonNames @@ -1441,7 +1441,7 @@ _0806798E: mov r1, r10 movs r2, 0 movs r3, 0 - bl sub_8055FA0 + bl TryUseChosenMove adds r0, r5, 0 bl EntityExists lsls r0, 24 @@ -1477,7 +1477,7 @@ _080679DE: ldr r0, _08067A70 ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08067A04: ldrb r0, [r6, 0x7] cmp r0, 0 @@ -1869,7 +1869,7 @@ _08067D20: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _08067D32 b _08067ED8 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index 2a76b35cc..647e50126 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -484,7 +484,7 @@ _0806A6C4: beq _0806A6D2 adds r0, r6, 0 mov r1, r8 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0806A6D2: add sp, 0x4 pop {r3} @@ -706,7 +706,7 @@ _0806A85C: ldr r0, _0806A894 ldr r1, [r0] movs r0, 0 - bl sub_805239C + bl DisplayDungeonLoggableMessageTrue _0806A87A: adds r2, r4, 0 cmp r2, 0x17 @@ -902,7 +902,7 @@ _0806A9E0: _0806A9E6: ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _0806AA02 .align 2, 0 _0806A9F0: .4byte gPtrLinkMoveOneUseWarningMessage @@ -912,7 +912,7 @@ _0806A9F4: ldr r0, _0806AA08 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0806AA02: pop {r4,r5} pop {r0} diff --git a/asm/code_806E8B0.s b/asm/code_806E8B0.s index 0db99eb57..640692a65 100644 --- a/asm/code_806E8B0.s +++ b/asm/code_806E8B0.s @@ -695,7 +695,7 @@ _0806F036: ldr r2, [r0] ldr r0, [sp, 0x70] mov r1, r9 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _0806F0BC .align 2, 0 _0806F098: .4byte gDungeon @@ -709,7 +709,7 @@ _0806F0B0: ldr r2, [r0] ldr r0, [sp, 0x70] mov r1, r9 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 _0806F0BC: ldr r1, [sp, 0x78] cmp r1, 0 diff --git a/asm/code_80718D8.s b/asm/code_80718D8.s index 76ddef32f..1fda8adc4 100644 --- a/asm/code_80718D8.s +++ b/asm/code_80718D8.s @@ -175,7 +175,7 @@ _08072894: ldr r0, _080728D0 ldr r1, [r0] mov r0, r9 - bl sub_80528F4 + bl DisplayDungeonLoggableMessage b _08072928 .align 2, 0 _080728C8: .4byte gAvailablePokemonNames @@ -202,7 +202,7 @@ _080728D4: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _08072902: movs r2, 0x1 str r2, [sp, 0xCC] @@ -370,7 +370,7 @@ _08072A0C: ldr r0, _08072A4C ldr r1, [r0] mov r0, r9 - bl sub_80528F4 + bl DisplayDungeonLoggableMessage b _08072A8C .align 2, 0 _08072A44: .4byte gAvailablePokemonNames @@ -387,7 +387,7 @@ _08072A50: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage mov r0, r9 mov r1, sp movs r2, 0x1 @@ -421,7 +421,7 @@ _08072A92: ldr r0, _08072AC4 ldr r1, [r0] mov r0, r9 - bl sub_80528F4 + bl DisplayDungeonLoggableMessage _08072AAE: movs r0, 0x1 _08072AB0: diff --git a/asm/code_8072CF4.s b/asm/code_8072CF4.s index eb6f4b4f7..305f13b9a 100644 --- a/asm/code_8072CF4.s +++ b/asm/code_8072CF4.s @@ -152,7 +152,7 @@ _080733FC: ldr r0, _0807343C ldr r1, [r0] mov r0, r8 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0x7 mov r1, r9 ands r1, r0 @@ -166,7 +166,7 @@ _080733FC: movs r1, 0 movs r2, 0 movs r3, 0x1 - bl sub_8055FA0 + bl TryUseChosenMove movs r5, 0x1 b _08073456 .align 2, 0 @@ -364,7 +364,7 @@ _0807359C: ldr r0, _08073604 ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0x7 mov r1, r8 ands r1, r0 @@ -378,7 +378,7 @@ _0807359C: movs r1, 0 movs r2, 0 movs r3, 0x1 - bl sub_8055FA0 + bl TryUseChosenMove ldr r2, _08073608 adds r1, r6, r2 ldrb r0, [r1] diff --git a/asm/code_807CD9C.s b/asm/code_807CD9C.s index a23bf106b..40d18888a 100644 --- a/asm/code_807CD9C.s +++ b/asm/code_807CD9C.s @@ -165,7 +165,7 @@ _0807D634: ldr r2, _0807D650 add r2, sp ldr r0, [r2] - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _0807D9F4 .align 2, 0 _0807D650: .4byte 0x00000d08 @@ -585,7 +585,7 @@ _0807D996: ldr r2, _0807D9C4 add r2, sp ldr r0, [r2] - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _0807D9EE .align 2, 0 _0807D9B4: .4byte gUnknown_80F4468 @@ -605,7 +605,7 @@ _0807D9E0: ldr r3, _0807DA0C add r3, sp ldr r0, [r3] - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0807D9EE: movs r0, 0x1 bl sub_807EC28 @@ -663,7 +663,7 @@ _0807DA5C: ldr r2, [r0] adds r0, r5, 0 adds r1, r6, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _0807DB5E .align 2, 0 _0807DA68: .4byte gUnknown_80FC9C0 @@ -818,7 +818,7 @@ _0807DB94: _0807DBA0: ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _0807DC54 .align 2, 0 _0807DBAC: .4byte gUnknown_80FD08C @@ -878,7 +878,7 @@ _0807DBF4: ldr r0, _0807DC2C ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _0807DC3A .align 2, 0 _0807DC24: .4byte 0x0000fffc @@ -888,7 +888,7 @@ _0807DC30: ldr r0, _0807DC60 ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0807DC3A: ldr r0, _0807DC64 ldr r0, [r0] @@ -953,7 +953,7 @@ _0807DCAC: _0807DCB8: ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _0807DF0E .align 2, 0 _0807DCC4: .4byte gUnknown_80FD3D0 @@ -1192,7 +1192,7 @@ _0807DE74: ldr r0, _0807DF30 ldr r1, [r0] mov r0, r9 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0x28 movs r1, 0x2B bl sub_803E708 @@ -1334,7 +1334,7 @@ _0807DFC2: ldr r2, [r0] ldr r0, [sp, 0x8] mov r1, r10 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _0807E174 .align 2, 0 _0807DFD0: .4byte gUnknown_80F96EC @@ -1351,7 +1351,7 @@ _0807DFD4: ldr r2, [r0] ldr r0, [sp, 0x8] mov r1, r10 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 movs r5, 0 ldr r0, _0807E18C lsls r1, r6, 2 diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index b7e573f24..29e0b4e27 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -228,7 +228,7 @@ _0807E816: ldr r0, _0807E884 ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0807E844: movs r5, 0 _0807E846: @@ -494,7 +494,7 @@ MudWaterSportEffect: bl GetLeader ldr r1, _0807EA68 ldr r1, [r1] - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _0807EA8C .align 2, 0 _0807EA5C: .4byte gUnknown_80F4EAC @@ -514,7 +514,7 @@ _0807EA6C: bl GetLeader ldr r1, _0807EA9C ldr r1, [r1] - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0807EA8C: pop {r0} bx r0 @@ -677,7 +677,7 @@ _0807EBA6: bl GetLeader ldr r1, _0807EC1C ldr r1, [r1] - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0807EBD4: ldr r4, _0807EC14 ldr r0, [r4] @@ -697,7 +697,7 @@ _0807EBD4: bl GetLeader ldr r1, _0807EC24 ldr r1, [r1] - bl SendMessage + bl TryDisplayDungeonLoggableMessage _0807EC00: ldr r0, [sp, 0x8] add sp, 0xC @@ -856,7 +856,7 @@ _0807ED3A: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _0807EF32 .align 2, 0 _0807ED48: .4byte gDungeon @@ -1100,7 +1100,7 @@ _0807EF04: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _0807EF32: add sp, 0x1C pop {r3-r5} @@ -1180,7 +1180,7 @@ sub_807EF84: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _0807EFEE .align 2, 0 _0807EFD0: .4byte 0xffff0000 @@ -1194,7 +1194,7 @@ _0807EFE2: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _0807EFEE: add sp, 0x4 pop {r4} @@ -1244,7 +1244,7 @@ _0807F036: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 beq _0807F04E b _0807F158 @@ -1378,7 +1378,7 @@ _0807F134: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _0807F158: add sp, 0x10 pop {r3-r5} @@ -1440,7 +1440,7 @@ _0807F1CE: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 beq _0807F204 _0807F1E6: @@ -1466,7 +1466,7 @@ _0807F204: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage movs r0, 0x2 b _0807F31C .align 2, 0 @@ -1588,7 +1588,7 @@ _0807F2F8: ldr r1, [r0] mov r0, sp movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage _0807F31A: movs r0, 0 _0807F31C: @@ -1621,7 +1621,7 @@ sub_807F33C: bl GetLeader ldr r1, _0807F428 ldr r1, [r1] - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r6, 0 _0807F360: movs r5, 0 @@ -2037,7 +2037,7 @@ _0807F694: ldr r0, [sp, 0xEC] _0807F698: mov r1, r8 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _0807F99C .align 2, 0 _0807F6A0: .4byte 0xffff0000 @@ -2051,7 +2051,7 @@ _0807F6A8: ldr r2, [r0] ldr r0, [sp, 0xEC] mov r1, r8 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 mov r0, r8 bl sub_8045888 lsls r0, 24 diff --git a/asm/code_807FCD4.s b/asm/code_807FCD4.s index 3049241bf..e871f643d 100644 --- a/asm/code_807FCD4.s +++ b/asm/code_807FCD4.s @@ -206,7 +206,7 @@ _08080A26: _08080A2E: ldr r1, [r0] ldr r0, [sp, 0x14] - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08080A46 .align 2, 0 _08080A38: .4byte gUnknown_80FDACC @@ -214,7 +214,7 @@ _08080A3C: ldr r0, _08080A58 ldr r1, [r0] ldr r0, [sp, 0x14] - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08080A46: add sp, 0x30 pop {r3-r5} diff --git a/asm/code_808417C.s b/asm/code_808417C.s index e311a9a49..73881682c 100644 --- a/asm/code_808417C.s +++ b/asm/code_808417C.s @@ -350,7 +350,7 @@ _08084484: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 beq _080844A4 b _080845D4 @@ -399,7 +399,7 @@ _080844F0: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _080845D4 .align 2, 0 _080844FC: .4byte gDungeon @@ -421,7 +421,7 @@ _08084514: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage ldr r0, _0808453C b _0808455E .align 2, 0 @@ -432,14 +432,14 @@ _08084540: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _080845D4 ldr r0, _080845B4 ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage ldr r0, _080845B8 _0808455E: ldr r4, [r0] @@ -460,14 +460,14 @@ _08084582: movs r0, 0 adds r1, r4, 0 movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _080845C4 ldr r0, _080845C0 ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage adds r1, r0, 0 cmp r1, 0x1 bne _08084582 @@ -488,7 +488,7 @@ _080845C4: ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _08084582 _080845D4: @@ -608,7 +608,7 @@ _080846B4: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage b _08084768 .align 2, 0 _080846C0: .4byte gUnknown_80FA500 @@ -617,7 +617,7 @@ _080846C4: ldr r1, [r0] movs r0, 0 movs r2, 0x1 - bl PrintFieldMessage + bl DisplayDungeonMessage mov r1, r8 movs r2, 0x2 ldrsh r0, [r1, r2] @@ -651,14 +651,14 @@ _08084716: movs r0, 0 ldr r1, [r4] movs r2, 0x1 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _08084758 ldr r0, _08084754 ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage adds r1, r0, 0 cmp r1, 0x1 bne _08084716 @@ -679,7 +679,7 @@ _08084758: ldr r1, [r0] movs r0, 0 movs r2, 0 - bl sub_8052B8C + bl DisplayDungeonYesNoMessage cmp r0, 0x1 bne _08084716 _08084768: diff --git a/asm/code_809A560.s b/asm/code_809A560.s index 7eff883d3..878a73988 100644 --- a/asm/code_809A560.s +++ b/asm/code_809A560.s @@ -1110,7 +1110,7 @@ _0809B14A: adds r1, r4, 0 adds r2, r7, 0 mov r3, r8 - bl sub_8014248 + bl CreateMenuDialogueBoxAndPortrait ldr r0, _0809B184 ldr r0, [r0] ldr r1, _0809B188 @@ -1462,7 +1462,7 @@ _0809B3EA: mov r1, r9 mov r2, r12 movs r3, 0 - bl sub_8014248 + bl CreateMenuDialogueBoxAndPortrait _0809B3FA: movs r0, 0x1 _0809B3FC: @@ -1681,7 +1681,7 @@ _0809B578: .4byte gUnknown_3001B64 sub_809B57C: push {r4,r5,lr} sub sp, 0x8 - bl xxx_draw_string_80144C4 + bl DrawDialogueBoxString ldr r5, _0809B5C8 ldr r0, [r5] ldr r1, [r0] diff --git a/data/data_80F59C8.s b/data/data_80F59C8.s index 13c143642..99c6433b4 100644 --- a/data/data_80F59C8.s +++ b/data/data_80F59C8.s @@ -2,375 +2,7 @@ .section .rodata #.incbin "baserom.gba", 0xF59C4, 0x4 -.global gUnknown_80F59C8 -gUnknown_80F59C8: @ 80F59C8 -@ replacing .incbin "baserom.gba", 0xF59C8, 0x348 -.byte 0x01, 0x00, 0x00, 0x00 -.4byte sub_8057634 -.byte 0x03, 0x00, 0x00, 0x00 -.4byte YawnMoveAction -.byte 0x05, 0x00, 0x00, 0x00 -.4byte NightmareMoveAction -.byte 0x0b, 0x00, 0x00, 0x00 -.4byte sub_805783C -.byte 0x11, 0x00, 0x00, 0x00 -.4byte EncoreMoveAction -.byte 0x14, 0x00, 0x00, 0x00 -.4byte sub_8057974 -.byte 0x15, 0x00, 0x00, 0x00 -.4byte PainSplitMoveAction -.byte 0x16, 0x00, 0x00, 0x00 -.4byte TormentMoveAction -.byte 0x18, 0x00, 0x00, 0x00 -.4byte sub_8057BC4 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x20, 0x00, 0x00, 0x00 -.4byte WhirlpoolMoveAction -.byte 0x21, 0x00, 0x00, 0x00 -.4byte sub_8057D7C -.byte 0x23, 0x00, 0x00, 0x00 -.4byte sub_8057D9C -.byte 0x25, 0x00, 0x00, 0x00 -.4byte SmokescreenMoveAction -.byte 0x2d, 0x00, 0x00, 0x00 -.4byte sub_8057FCC -.byte 0x2f, 0x00, 0x00, 0x00 -.4byte sub_8057FF4 -.byte 0x30, 0x00, 0x00, 0x00 -.4byte sub_805805C -.byte 0x34, 0x00, 0x00, 0x00 -.4byte sub_805816C -.byte 0x39, 0x00, 0x00, 0x00 -.4byte sub_8058270 -.byte 0x3b, 0x00, 0x00, 0x00 -.4byte sub_80582C4 -.byte 0x3e, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x3f, 0x00, 0x00, 0x00 -.4byte sub_8058430 -.byte 0x40, 0x00, 0x00, 0x00 -.4byte sub_8058478 -.byte 0x42, 0x00, 0x00, 0x00 -.4byte sub_80584C0 -.byte 0x43, 0x00, 0x00, 0x00 -.4byte sub_8058548 -.byte 0x47, 0x00, 0x00, 0x00 -.4byte sub_8058580 -.byte 0x48, 0x00, 0x00, 0x00 -.4byte BrickBreakMoveAction -.byte 0x49, 0x00, 0x00, 0x00 -.4byte sub_8058638 -.byte 0x4c, 0x00, 0x00, 0x00 -.4byte sub_80586DC -.byte 0x4d, 0x00, 0x00, 0x00 -.4byte sub_8058770 -.byte 0x4e, 0x00, 0x00, 0x00 -.4byte sub_80587E8 -.byte 0x53, 0x00, 0x00, 0x00 -.4byte sub_8058838 -.byte 0x55, 0x00, 0x00, 0x00 -.4byte sub_8058858 -.byte 0x5b, 0x00, 0x00, 0x00 -.4byte sub_80588B8 -.byte 0x5c, 0x00, 0x00, 0x00 -.4byte sub_80588F4 -.byte 0x5d, 0x00, 0x00, 0x00 -.4byte sub_8058930 -.byte 0x60, 0x00, 0x00, 0x00 -.4byte sub_8058A18 -.byte 0x6a, 0x00, 0x00, 0x00 -.4byte sub_8058BF0 -.byte 0x74, 0x00, 0x00, 0x00 -.4byte sub_8058E5C -.byte 0x78, 0x00, 0x00, 0x00 -.4byte sub_8058FBC -.byte 0x83, 0x00, 0x00, 0x00 -.4byte sub_80590D4 -.byte 0x85, 0x00, 0x00, 0x00 -.4byte sub_8059190 -.byte 0x87, 0x00, 0x00, 0x00 -.4byte sub_80591E4 -.byte 0x89, 0x00, 0x00, 0x00 -.4byte SkillSwapMoveAction -.byte 0x8b, 0x00, 0x00, 0x00 -.4byte sub_8059424 -.byte 0x8c, 0x00, 0x00, 0x00 -.4byte sub_805946C -.byte 0x8e, 0x00, 0x00, 0x00 -.4byte sub_8059528 -.byte 0x93, 0x00, 0x00, 0x00 -.4byte sub_8059540 -.byte 0x95, 0x00, 0x00, 0x00 -.4byte sub_80595A0 -.byte 0x96, 0x00, 0x00, 0x00 -.4byte sub_80595EC -.byte 0x9f, 0x00, 0x00, 0x00 -.4byte sub_80598CC -.byte 0xa2, 0x00, 0x00, 0x00 -.4byte sub_8059928 -.byte 0xa4, 0x00, 0x00, 0x00 -.4byte sub_8059988 -.byte 0xaa, 0x00, 0x00, 0x00 -.4byte sub_8059A2C -.byte 0xab, 0x00, 0x00, 0x00 -.4byte sub_8059AA8 -.byte 0xac, 0x00, 0x00, 0x00 -.4byte sub_8059AB8 -.byte 0xb1, 0x00, 0x00, 0x00 -.4byte sub_8059AF8 -.byte 0xbc, 0x00, 0x00, 0x00 -.4byte sub_8059D00 -.byte 0xc0, 0x00, 0x00, 0x00 -.4byte sub_8059D48 -.byte 0xc2, 0x00, 0x00, 0x00 -.4byte sub_8059D98 -.byte 0xc4, 0x00, 0x00, 0x00 -.4byte sub_8059DA4 -.byte 0xc5, 0x00, 0x00, 0x00 -.4byte sub_8059DB4 -.byte 0xc6, 0x00, 0x00, 0x00 -.4byte sub_8059DC4 -.byte 0xc8, 0x00, 0x00, 0x00 -.4byte sub_8059E0C -.byte 0xcf, 0x00, 0x00, 0x00 -.4byte TriAttackMoveAction -.byte 0xd1, 0x00, 0x00, 0x00 -.4byte sub_805A120 -.byte 0xd2, 0x00, 0x00, 0x00 -.4byte sub_805A210 -.byte 0xd5, 0x00, 0x00, 0x00 -.4byte sub_805A258 -.byte 0xd6, 0x00, 0x00, 0x00 -.4byte sub_805A2A0 -.byte 0xdc, 0x00, 0x00, 0x00 -.4byte RolePlayMoveAction -.byte 0xe0, 0x00, 0x00, 0x00 -.4byte sub_805A3DC -.byte 0xe4, 0x00, 0x00, 0x00 -.4byte sub_805A464 -.byte 0xed, 0x00, 0x00, 0x00 -.4byte CurseMoveAction -.byte 0xee, 0x00, 0x00, 0x00 -.4byte sub_805A568 -.byte 0xf3, 0x00, 0x00, 0x00 -.4byte TickleMoveAction -.byte 0xf6, 0x00, 0x00, 0x00 -.4byte sub_805A688 -.byte 0xf9, 0x00, 0x00, 0x00 -.4byte KnockOffMoveAction -.byte 0x07, 0x01, 0x00, 0x00 -.4byte SecretPowerMoveAction -.byte 0x08, 0x01, 0x00, 0x00 -.4byte sub_805AC90 -.byte 0x0a, 0x01, 0x00, 0x00 -.4byte sub_805AD04 -.byte 0x0b, 0x01, 0x00, 0x00 -.4byte sub_805AD34 -.byte 0x0d, 0x01, 0x00, 0x00 -.4byte sub_805AD54 -.byte 0x10, 0x01, 0x00, 0x00 -.4byte sub_805AE3C -.byte 0x13, 0x01, 0x00, 0x00 -.4byte sub_805AE74 -.byte 0x14, 0x01, 0x00, 0x00 -.4byte sub_805AECC -.byte 0x15, 0x01, 0x00, 0x00 -.4byte PresentMoveAction -.byte 0x16, 0x01, 0x00, 0x00 -.4byte sub_805AFA4 -.byte 0x19, 0x01, 0x00, 0x00 -.4byte sub_805B028 -.byte 0x1b, 0x01, 0x00, 0x00 -.4byte sub_805B074 -.byte 0x1c, 0x01, 0x00, 0x00 -.4byte sub_805B0BC -.byte 0x23, 0x01, 0x00, 0x00 -.4byte sub_805B17C -.byte 0x26, 0x01, 0x00, 0x00 -.4byte WrapMoveAction -.byte 0x28, 0x01, 0x00, 0x00 -.4byte sub_805B264 -.byte 0x35, 0x01, 0x00, 0x00 -.4byte sub_805B324 -.byte 0x39, 0x01, 0x00, 0x00 -.4byte DestinyBondMoveAction -.byte 0x3a, 0x01, 0x00, 0x00 -.4byte sub_805B388 -.byte 0x44, 0x01, 0x00, 0x00 -.4byte sub_805B3E0 -.byte 0x46, 0x01, 0x00, 0x00 -.4byte sub_805B454 -.byte 0x47, 0x01, 0x00, 0x00 -.4byte MimicMoveAction -.byte 0x48, 0x01, 0x00, 0x00 -.4byte sub_805B53C -.byte 0x49, 0x01, 0x00, 0x00 -.4byte LeechSeedMoveAction -.byte 0x4b, 0x01, 0x00, 0x00 -.4byte sub_805B668 -.byte 0x4f, 0x01, 0x00, 0x00 -.4byte sub_805B910 -.byte 0x55, 0x01, 0x00, 0x00 -.4byte sub_805B808 -.byte 0xe2, 0x00, 0x00, 0x00 -.4byte sub_805A408 -.global gNaturePowerMoveTable -gNaturePowerMoveTable: @ 80F5D10 -@ replacing .incbin "baserom.gba", 0xF5D10, 0x260 -.byte 0xdb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x76, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x76, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0xfb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0xfb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0xfb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x76, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0xdb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x76, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0xff, 0x00, 0x00, 0x00 -.4byte sub_8058580 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x7f, 0x00, 0x00, 0x00 -.4byte sub_80583D8 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x7c, 0x00, 0x00, 0x00 -.4byte sub_8059050 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0xfb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8057C88 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x91, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0xdb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0xdb, 0x00, 0x00, 0x00 -.4byte sub_8055620 -.byte 0x1e, 0x00, 0x00, 0x00 -.4byte sub_8055620 .global gUnknown_80F5F70 gUnknown_80F5F70: @ 80F5F70 @@ -14613,24 +14245,3 @@ gUnknown_810697C: @ 810697C .byte 0x04, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .4byte gUnknown_8103E40 -.string "pksdir0\0" -.align 2,0 - -.global gUnknown_8106990 -gUnknown_8106990: @ 8106990 -@ replacing .incbin "baserom.gba", 0x106990, 0x2C -.byte 0x01, 0x00, 0x54, 0x00, 0xf0, 0xff, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x54, 0x00 -.byte 0x6a, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 - -.global gUnknown_81069BC -gUnknown_81069BC: @ 81069BC -@ replacing .incbin "baserom.gba", 0x1069BC, 0x18 -.byte 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 - -.global gUnknown_81069D4 -gUnknown_81069D4: @ 81069D4 -@ replacing .incbin "baserom.gba", 0x1069D4, 0x20 -.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 diff --git a/include/called_move_data.h b/include/called_move_data.h new file mode 100644 index 000000000..e641b8701 --- /dev/null +++ b/include/called_move_data.h @@ -0,0 +1,18 @@ +#ifndef GUARD_CALLED_MOVE_DATA_H +#define GUARD_CALLED_MOVE_DATA_H + +#include "structs/dungeon_entity.h" +#include "structs/str_moves.h" + +typedef bool8 (*MoveCallback)(Entity *pokemon, Entity *target, Move *move, s32 param_4); +struct CalledMove +{ + u16 moveID; + MoveCallback callback; +}; + +#define METRONOME_AVAILABLE_CALLED_MOVES 105 +extern const struct CalledMove gMetronomeCalledMoves[METRONOME_AVAILABLE_CALLED_MOVES]; +extern const struct CalledMove gNaturePowerCalledMoves[]; + +#endif diff --git a/include/code_80130A8.h b/include/code_80130A8.h index 30c0441ac..ab8094171 100644 --- a/include/code_80130A8.h +++ b/include/code_80130A8.h @@ -5,20 +5,32 @@ #include "structs/menu.h" #include "structs/str_text.h" +struct MonPortraitMsg +{ + OpenedFile *faceFile; + void *faceData; + Position pos; + u8 spriteId; // Which mon's sprite to use. For example Kecleon has multiple sprites depending on whether it's green or purple. + bool8 flip; // Whether the mon's sprite is flipped. + u8 unkE; +}; + // code_80130A8.s -extern void sub_8013E54(void); -extern void sub_8013F84(void); -extern void sub_80140B4(UnkTextStruct2 *); -extern void sub_80140DC(void); -extern void sub_8014114(void); -extern void xxx_info_box_80141B4(const u8 *, u32, OpenedFile **, u16); -extern void sub_8014248(const u8 *, u32, u32, const MenuItem *, void *, u32, u32, OpenedFile **, u32); -extern s32 sub_80144A4(s32 *); -extern void sub_80151C0(u32, u8 *); -extern u32 sub_80154F0(void); -extern void sub_80155F0(void); -extern void xxx_draw_string_80144C4(void); -extern void PrintFormatStringOnWindow(u32, u32, const u8 *, u32 windowId, u32); -extern void xxx_format_string(const u8 *, u8 *, u8 *, u32); +void sub_8013E54(void); +void sub_8013F84(void); +void sub_80140B4(UnkTextStruct2 *); +void sub_80140DC(void); +void sub_8014114(void); +void CreateDialogueBoxAndPortrait(const u8 *, u32, struct MonPortraitMsg *, u16); +void CreateYesNoDialogueBoxAndPortrait_DefaultYes(const u8 *text, struct MonPortraitMsg *monPortraitPtr, u16 param_3); +void CreateYesNoDialogueBoxAndPortrait_DefaultNo(const u8 *text, struct MonPortraitMsg *monPortraitPtr, u16 param_3); +void CreateMenuDialogueBoxAndPortrait(const u8 *, u32, u32, const MenuItem *, void *, u32, u32, struct MonPortraitMsg *, u32); +s32 sub_80144A4(s32 *); +void sub_80151C0(u32, u8 *); +u32 sub_80154F0(void); +void sub_80155F0(void); +void DrawDialogueBoxString(void); +void PrintFormatStringOnWindow(u32, u32, const u8 *, u32 windowId, u32); +u8 *xxx_format_string(const u8 *, u8 *, u8 *, u32); #endif // GUARD_CODE_80130A8_H diff --git a/include/code_802DB28.h b/include/code_802DB28.h index ebf7ad19e..636c992aa 100644 --- a/include/code_802DB28.h +++ b/include/code_802DB28.h @@ -4,6 +4,7 @@ #include "file_system.h" #include "structs/str_text.h" #include "structs/str_wonder_mail.h" +#include "code_80130A8.h" // size: 0xA8 struct unkStruct_203B2FC @@ -13,13 +14,7 @@ struct unkStruct_203B2FC unkStruct_802F204 unk8; /* 0x30 */ u8 jobSlotIndex; /* 0x34 */ WonderMail *jobInfo; - /* 0x38 */ OpenedFile *faceFile; - /* 0x3C */ u8 *faceData; - u16 unk40; - u16 unk42; - u8 unk44; - u8 unk45; - u8 unk46; + /* 0x38 */ struct MonPortraitMsg monPortrait; UnkTextStruct2 unk48[4]; }; @@ -27,4 +22,4 @@ bool8 sub_802DB28(u8 jobSlotIndex, u8 dungeon); u32 sub_802DBD4(void); void sub_802DC00(void); -#endif // GUARD_CODE_802DB28_H \ No newline at end of file +#endif // GUARD_CODE_802DB28_H diff --git a/include/code_80521D0.h b/include/code_80521D0.h deleted file mode 100644 index bc98b6563..000000000 --- a/include/code_80521D0.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef GUARD_CODE_80521D0_H -#define GUARD_CODE_80521D0_H - -#include "structs/dungeon_entity.h" - -void SendMessage(Entity *pokemon, const char message[]); - -#endif // GUARD_CODE_80521D0_H \ No newline at end of file diff --git a/include/code_808417C.h b/include/code_808417C.h index 4830ac082..12359877f 100644 --- a/include/code_808417C.h +++ b/include/code_808417C.h @@ -3,6 +3,6 @@ #include "structs/dungeon_entity.h" -s32 CalculateStatusTurns(Entity *target, s16 *turnRange, bool8 factorCurerSkills); +s32 CalculateStatusTurns(Entity *target, const s16 *turnRange, bool8 factorCurerSkills); #endif // GUARD_808417C_H diff --git a/include/code_80869E4.h b/include/code_80869E4.h index 64ca99035..6a777dac6 100644 --- a/include/code_80869E4.h +++ b/include/code_80869E4.h @@ -2,6 +2,7 @@ #define GUARD_CODE_80869E4_H #include "structs/dungeon_entity.h" +#include "dungeon_message.h" // size: 0x8 typedef struct unkStruct_202F3D0 @@ -24,7 +25,7 @@ void sub_8086598(void); void sub_80865E8(void); void sub_808663C(void); void sub_8086690(void); -void sub_80866C4(const u8 *dialogue); +void sub_80866C4(const struct DungeonDialogueStruct *dialogue); void sub_8086738(void); void sub_8086764(void); void sub_8086794(void); @@ -39,4 +40,4 @@ void sub_8086910(Entity *entity); void sub_808692C(void); void sub_80869E4(Entity *, s32, u8, s8); -#endif // GUARD_CODE_80869E4_H \ No newline at end of file +#endif // GUARD_CODE_80869E4_H diff --git a/include/constants/move.h b/include/constants/move.h index 87215f2e8..736d020e9 100644 --- a/include/constants/move.h +++ b/include/constants/move.h @@ -19,6 +19,7 @@ enum MoveFlag2 MOVE_FLAG_SEALED = 1 << 0, MOVE_FLAG2_UNK4 = 1 << 2, MOVE_FLAG_TEMPORARY = 1 << 3, // Used for moves copied by Mimic. + MOVE_FLAG2_x10 = 1 << 4, // Checked with pressure's pp loss MOVE_FLAG_REPLACE = 1 << 5 // Used for moves copied by Sketch. }; diff --git a/include/dungeon_message.h b/include/dungeon_message.h new file mode 100644 index 000000000..15c371209 --- /dev/null +++ b/include/dungeon_message.h @@ -0,0 +1,54 @@ +#ifndef GUARD_DUNGEON_MESSAGE_H +#define GUARD_DUNGEON_MESSAGE_H + +#include "structs/dungeon_entity.h" +#include "code_80130A8.h" + +struct MonDialogueSpriteInfo +{ + s16 species; + u8 spriteId; +}; + +struct DungeonDialogueStruct +{ + u16 unk0; + u8 unk2; + u8 unk3; + s16 unk4; + s16 unk6; + const u8 *str; +}; + +void sub_80521D0(void); +void sub_8052210(bool8 a0); + +// These functions display the string if certain conditions are met. The conditions differ depending on the function. The string is then saved to the message log. +void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str); +void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str); +void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str); +void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str); +void TryDisplayDungeonLoggableMessage5(Entity *pokemon, Position *pos, const u8 *str); + +// As opposed to the above - these always display the string and save it in the message log. False/True stand for an unknown argument. Not sure what the practical difference is between these. +void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str); +void DisplayDungeonLoggableMessageFalse(Entity *pokemon, const u8 *str); +void DisplayDungeonLoggableMessageTrue(Entity *pokemon, const u8 *str); + +void xxx_draw_string_80524F0(void); +void sub_80526D0(s32 r0); +void sub_8052740(s32 a0); +void DisplayDungeonMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8 *str, bool8 a2); +void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo); +bool32 DisplayDungeonYesNoMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8 *str, bool32 defaultYes); +s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8 *str, const MenuItem *menuItems, u16 unkArg); +void sub_8052D44(s16 *ids, Entity *leader, Entity *partner); +void TryDisplayGeneralTutorialMessage(void); +void TryDisplayItemPickupTutorialMessage(u8 itemId); +void DisplayYouReachedDestFloorStr(void); +void sub_8052FB8(const u8 *str); +const u8 *GetCurrentDungeonName(void); +void ResetMessageLog(void); +bool32 DisplayMessageLog(void); + +#endif // GUARD_DUNGEON_MESSAGE_H diff --git a/include/felicity_bank.h b/include/felicity_bank.h index 93ae9b2f2..b1973753b 100644 --- a/include/felicity_bank.h +++ b/include/felicity_bank.h @@ -4,6 +4,7 @@ #include "file_system.h" #include "structs/menu.h" #include "structs/str_text.h" +#include "code_80130A8.h" #define FELICITY_BANK_ACTION_WITHDRAW 0 #define FELICITY_BANK_ACTION_DEPOSIT 1 @@ -19,15 +20,8 @@ typedef struct FelicityBankWork MenuItem unk14[8]; u16 unk54[8]; unkStructFor8013AA0 unk64; - /* 0x94 */ OpenedFile *faceFile; - /* 0x98 */ u8 *faceData; - u16 unk9C; - u16 unk9E; - u8 unkA0; - u8 unkA1; - u8 unkA2; - u8 unkA3; - OpenedFile **unkA4; + /* 0x94 */ struct MonPortraitMsg monPortrait; + struct MonPortraitMsg *monPortraitPtr; UnkTextStruct2 unkA8[4]; } FelicityBankWork; @@ -36,4 +30,4 @@ void DestroyFelicityBank(void); void DrawTeamMoneyBox(u32); u32 FelicityBankCallback(void); -#endif // GUARD_FELICITY_BANK_H \ No newline at end of file +#endif // GUARD_FELICITY_BANK_H diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index 93ee23ff9..c4fb0bbd4 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -699,6 +699,7 @@ #define KEY_OR_INTR 0x0000 #define KEY_AND_INTR 0x8000 #define DPAD_ANY ((DPAD_RIGHT | DPAD_LEFT | DPAD_UP | DPAD_DOWN)) // 0xF0 +#define AB_BUTTONS (A_BUTTON | B_BUTTON) #define JOY_EXCL_DPAD 0x030F // interrupt flags diff --git a/include/gulpin_shop.h b/include/gulpin_shop.h index 6a2aed0af..c369055cf 100644 --- a/include/gulpin_shop.h +++ b/include/gulpin_shop.h @@ -5,6 +5,7 @@ #include "structs/menu.h" #include "structs/str_text.h" #include "structs/str_moves.h" +#include "code_80130A8.h" // size: 0x18C typedef struct GulpinShopWork @@ -24,15 +25,8 @@ typedef struct GulpinShopWork u16 unk68[8]; MenuStruct unk78; u8 fillC8[0x118 - 0xC8]; - /* 0x118 */ OpenedFile *faceFile; - /* 0x11C */ u8 *faceData; - u16 unk120; - u16 unk122; - u8 unk124; - u8 unk125; - u8 unk126; - u8 unk127; - OpenedFile **unk128; + /* 0x118 */ struct MonPortraitMsg monPortrait; + struct MonPortraitMsg *monPortraitPtr; UnkTextStruct2 unk12C[4]; } GulpinShopWork; diff --git a/include/gulpin_shop_801FB50.h b/include/gulpin_shop_801FB50.h index 375182732..a3bc8f0f8 100644 --- a/include/gulpin_shop_801FB50.h +++ b/include/gulpin_shop_801FB50.h @@ -33,14 +33,8 @@ typedef struct unkStruct_203B27C u16 unkBC[8]; MenuStruct unkCC; u8 fill11C[0x16C - 0x11C]; - /* 0x16C */ OpenedFile *faceFile; - /* 0x170 */ u8 *faceData; - u16 unk174; - u16 unk176; - u8 unk178; - u8 unk179; - u8 unk17A; - OpenedFile **unk17C; + /* 0x16C */ struct MonPortraitMsg monPortrait; + struct MonPortraitMsg *monPortraitPtr; UnkTextStruct2 unk180[4]; } unkStruct_203B27C; @@ -48,4 +42,4 @@ bool8 sub_801FB50(u32 mode); u32 sub_801FC40(void); void sub_801FD7C(void); -#endif // GUARD_GULPIN_SHOP_801FB50_H \ No newline at end of file +#endif // GUARD_GULPIN_SHOP_801FB50_H diff --git a/include/kangaskhan_storage1.h b/include/kangaskhan_storage1.h index 4d61010c7..08f4edffe 100644 --- a/include/kangaskhan_storage1.h +++ b/include/kangaskhan_storage1.h @@ -18,7 +18,7 @@ enum KangaskhanStorageStates KANGASKHAN_STORAGE_IS_MONEY_USED_TM = 9, }; -enum KangaskhanStorageMenuActions +enum KangaskhanStorageMenuActions { MENU_CANCEL = 1, MENU_STORE = 2, @@ -45,14 +45,8 @@ struct KangaskhanStorageWork u16 unk4C[5]; MenuStruct unk58; unkStructFor8013AA0 unkA8; - /* 0xD8 */ OpenedFile *faceFile; - /* 0xDC */ u8 *faceData; // Written to but never read - u16 unkE0; // Written to but never read - u16 unkE2; // Written to but never read - bool8 unkE4; - u8 unkE5; // Written to but never read - u8 unkE6; // Written to but never read - OpenedFile **unkE8; + /* 0xD8 */ struct MonPortraitMsg monPortrait; + struct MonPortraitMsg *monPortraitPtr; UnkTextStruct2 unkEC[4]; }; diff --git a/include/kecleon_bros1.h b/include/kecleon_bros1.h index 399ae7b7a..43427d2db 100644 --- a/include/kecleon_bros1.h +++ b/include/kecleon_bros1.h @@ -63,15 +63,8 @@ typedef struct KecleonBrosWork1 /* 0x34 */ MenuItem menuItems[8]; u16 unk74[8]; /* 0x84 */ MenuStruct menu; - /* 0xD4 */ OpenedFile *faceFile; - /* 0xD8 */ u8 *faceData; - u16 unkDC; - u16 unkDE; - u8 unkE0; - u8 unkE1; - u8 unkE2; - u8 unkE3; - OpenedFile **unkE4; + /* 0xD4 */ struct MonPortraitMsg monPortrait; + struct MonPortraitMsg *monPortraitPtr; UnkTextStruct2 unkE8[4]; } KecleonBrosWork1; diff --git a/include/makuhita_dojo1.h b/include/makuhita_dojo1.h index 15950be8d..6b5615300 100644 --- a/include/makuhita_dojo1.h +++ b/include/makuhita_dojo1.h @@ -28,15 +28,8 @@ typedef struct MakuhitaDojoWork1 /* 0x14 */ s32 menuAction; MenuItem unk18[4]; u8 fill38[0x58 - 0x38]; - /* 0x58 */ OpenedFile *faceFile; - /* 0x5C */ u8 *faceData; - u16 unk60; - u16 unk62; - u8 unk64; - u8 unk65; - u8 unk66; - u8 unk67; - OpenedFile** unk68; + /* 0x58 */ struct MonPortraitMsg monPortrait; + struct MonPortraitMsg *monPortraitPtr; UnkTextStruct2 unk6C[4]; } MakuhitaDojoWork1; diff --git a/include/menu_input.h b/include/menu_input.h index 1d4bf20a7..0f7415b78 100644 --- a/include/menu_input.h +++ b/include/menu_input.h @@ -41,7 +41,7 @@ void sub_8013984(MenuInputStruct * param_1); void sub_8013A54(MenuInputStruct *param_1); void sub_8013A7C(MenuInputStruct *param_1); void AddMenuCursorSprite_(MenuInputStruct *, u8 *); -void nullsub_34(MenuInputStructSub *); +void nullsub_34(MenuInputStructSub *, s32 a1); void sub_8013AA0(unkStructFor8013AA0 *); u32 sub_8013BBC(unkStructFor8013AA0 *); diff --git a/include/pokemon.h b/include/pokemon.h index 98a351c80..c48239df6 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -76,9 +76,9 @@ s16 GetInternalNo(s16 index); s32 CalculateEXPGain(s16 index, s32 level); s16 GetPokemonEvolveConditons(s16 index, unkEvolve *); u8 GetPokemonOverworldPalette(s16 index, u32 r1); -bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 r1); +bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 spriteId); OpenedFile *OpenPokemonDialogueSpriteFile(s16 index); -OpenedFile *GetDialogueSpriteDataPtr(s16 index); +OpenedFile *GetDialogueSpriteDataPtr(s32 index); s32 GetUnownIndex(s16 index); void GenerateHiddenPower(HiddenPower *); s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *); diff --git a/include/post_office_guide1.h b/include/post_office_guide1.h index b80e89dbb..87be1ab38 100644 --- a/include/post_office_guide1.h +++ b/include/post_office_guide1.h @@ -8,17 +8,11 @@ typedef struct PostOfficeWork { /* 0x0 */ u8 state; /* 0x4 */ s32 currMenuChoice; - /* 0x8 */ OpenedFile *faceFile; - /* 0xC */ u8 *faceData; - u16 unk10; - u16 unk12; - u8 unk14; - u8 unk15; - u8 unk16; + /* 0x8 */ struct MonPortraitMsg monPortrait; } PostOfficeWork; void CleanHelperPelipper(void); bool8 CreateHelperPelipperMenu(s16 speciesID); u32 HelperPelipperCallback(void); -#endif // GUARD_POST_OFFICE_GUIDE1_H \ No newline at end of file +#endif // GUARD_POST_OFFICE_GUIDE1_H diff --git a/include/save_write.h b/include/save_write.h index 8fa8be3ef..80d0e76c1 100644 --- a/include/save_write.h +++ b/include/save_write.h @@ -9,14 +9,7 @@ typedef struct SavePakWrite /* 0x0 */ u32 state; s32 unk4; /* 0x8 */ u32 saveStatus; - /* 0xC */ OpenedFile *faceFile; - /* 0x10 */ u8 *faceData; - u16 unk14; - u16 unk16; - u8 unk18; - u8 unk19; - u8 unk1A; - u8 unk1B; + /* 0xC */ struct MonPortraitMsg monPortrait; /* 0x1C */ u16 pokeID; } SavePakWrite; @@ -25,4 +18,4 @@ u32 GetSavePakStatus(void); void PrepareSavePakWrite(s16 pokemonID); bool8 WriteSavePak(void); -#endif // GUARD_SAVE_WRITE_H \ No newline at end of file +#endif // GUARD_SAVE_WRITE_H diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index beddfc0bd..1edccca96 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -260,7 +260,7 @@ typedef struct EntityInfo /* 0xF8 */ bool8 speedStageChanged; // Toggled when pokemon is movement speed is sped up /* 0xF9 */ u8 unkF9; /* 0xFA */ u8 terrifiedTurns; // Doubles as a bool for whether the Pokémon is terrified. - u8 expMultiplier; + /* 0xFB */ u8 expMultiplier; // Set to true if the player makes a teammate use their held item. // This is done by going to the teammate's held item in the toolbox and selecting "Use". /* 0xFC */ bool8 useHeldItem; @@ -318,7 +318,7 @@ typedef struct EntityInfo /* 0x16C */ Position targetPos; /* 0x170 */ Position pixelPos; u32 unk174; - u16 unk178; + u16 abilityEffectFlags; // See enum AbilityEffectFlags /* 0x17A */ u16 mimicMoveIDs[MAX_MON_MOVES]; // All moves that Mimic has copied (not sure on size...) // Previous value of targetPosition for movement, 1 and 2 moves ago. /* 0x184 */ Unk_Entity_x184 unk184[4]; @@ -381,6 +381,21 @@ enum MovementFlag MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY = 1 << 15 // Set if the Pokémon is petrified and the leader cures them by swapping places. }; +enum AbilityEffectFlags +{ + ABILITY_FLAG_ARENA_TRAP = 1 << 0, + ABILITY_FLAG_SHADOW_TAG = 1 << 1, + ABILITY_FLAG_MAGNET_PULL = 1 << 2, + ABILITY_FLAG_STATIC = 1 << 3, + ABILITY_FLAG_EFFECT_SPORE_PRLZ = 1 << 4, + ABILITY_FLAG_POISON_POINT = 1 << 5, + ABILITY_FLAG_EFFECT_SPORE_PSN = 1 << 6, + ABILITY_FLAG_EFFECT_SPORE_SLP = 1 << 7, + ABILITY_FLAG_FLAME_BODY = 1 << 8, + ABILITY_FLAG_CUTE_CHARM = 1 << 9, + ABILITY_FLAG_STENCH = 1 << 10, +}; + enum ShopkeeperMode { SHOPKEEPER_MODE_NORMAL, @@ -422,7 +437,7 @@ enum ExpMultiplier { EXP_HALVED, // 0.5x when fainting a mon with only the regular attack and no moves EXP_REGULAR, // 1x - EXP_BOOSTED, // 1.5x so far use not found, but most likely linked moves ; to be confirmed once more code is decompiled + EXP_BOOSTED, // 1.5x when using linked moves }; static inline bool8 ExpMultiplierChanged(EntityInfo *info) diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index 3509f4646..5f6cec483 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -211,6 +211,33 @@ struct unkStruct_Dungeon64C u32 unk4; }; +#define UNK_1BBD4_STR_COUNT 10 + +struct UnkStructDungeon1BDD4 +{ + u8 unk0[UNK_1BBD4_STR_COUNT][64]; + u8 unk1C054[UNK_1BBD4_STR_COUNT]; // 0x280 + u8 unk1C05E; // 0x28A + u8 unk1C05F; // 0x28B + s16 unk1C060; // 0x28C + s16 unk1C062; // 0x29E + s16 unk1C064; // 0x290 + s16 unk1C066; // 0x292 + s16 unk1C068; // 0x294 + u32 unk1C06C; // 0x298 +}; + +#define MESSAGE_LOG_STRINGS_COUNT 20 +#define MESSAGE_LOG_BUFFER_SIZE 60 + +struct MessageLogString +{ + u8 unk0; + u8 unk1; + u8 unk2; + u8 str[MESSAGE_LOG_BUFFER_SIZE]; +}; + // size: 0x1CEDC typedef struct Dungeon { @@ -234,6 +261,7 @@ typedef struct Dungeon u8 unk11; s16 unk12; s16 unk14; + s16 unk16; u32 unk18[(0xB8 - 0x18) / 4]; Entity *unkB8; Entity *unkBC; @@ -379,11 +407,9 @@ typedef struct Dungeon /* 0x17B44 */ OpenedFile *sprites[MONSTER_MAX]; /* 0x181E4 */ OpenedFile *paletFile; /* 0x181E8 */ UnkDungeonGlobal_unk181E8_sub unk181e8; - u8 fill18220[0x1C05E - 0x1822C]; - u8 unk1C05E; - u8 fill1C05F[0x1C06C - 0x1C05F]; - u32 unk1C06C; - u8 fill1C070[0x1C570 - 0x1C070]; + u8 fill18220[0x1BDD4 - 0x1822C]; + struct UnkStructDungeon1BDD4 unk1BDD4; + struct MessageLogString messageLogStrings[MESSAGE_LOG_STRINGS_COUNT]; /* 0x1C570 */ DungeonLocation unk1C570; /* 0x1C574 */ UnkDungeonGlobal_unk1C574 unk1C574; /* 0x1C590 */ UnkDungeonGlobal_unk1C590 unk1C590[4]; diff --git a/include/text2.h b/include/text2.h index 07e118c22..c55f610e5 100644 --- a/include/text2.h +++ b/include/text2.h @@ -32,6 +32,39 @@ struct unkStruct_80B8848 u32 xxx_call_draw_char(s32, s32, u32, u32, u32); +struct UnkDrawStringStruct; + +struct UnkDrawStringStruct +{ + s16 unk0; + s16 unk2; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; + s32 unkC; + u32 unk10; + u32 unk14; + u32 unk18; + u32 unk1C; + u8 unk20; + u8 unk21; + u8 fill22; + u8 fill23; + const u8* (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct*); + u8 fill28; + u8 fill29; + u8 fill2A; + u8 fill2B; + u32 unk2C; + u8 fill30; + u8 fill31; + u8 fill32; + u8 fill33; + u32 unk34; +}; + + void RestoreUnkTextStruct_8006518(UnkTextStruct2 *); void sub_8006554(UnkTextStruct1 *, u32 *, u32 *, u16 *, u32, const UnkTextStruct2 *, u8, u32, UnkTextStruct2_sub *, u8); void sub_80073B8(s32); @@ -41,6 +74,8 @@ void sub_800792C(u32, s32, s32, s32, u32); void sub_8007A78(u32, s32, s32, s32, u32); void sub_8007B7C(u32, s32, s32, s32, u32); void sub_8007E20(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4, u32 *a5, u32 a6); +const u8 *xxx_get_next_char_from_string(const u8 *a1, u32 *a0); +const u8 *xxx_handle_format_global(const u8 *str, struct UnkDrawStringStruct *unkStrPtr); // text.s extern const struct unkChar *GetCharacter(s32); diff --git a/include/thank_you_wonder_mail.h b/include/thank_you_wonder_mail.h index e16fe78b9..4ed0248ab 100644 --- a/include/thank_you_wonder_mail.h +++ b/include/thank_you_wonder_mail.h @@ -25,13 +25,7 @@ typedef struct WonderMailStruct_203B2C4 UnkTextStruct2 unk35C[4]; UnkTextStruct2 unk3BC[4]; Item unk41C; - /* 0x420 */ OpenedFile *faceFile; - /* 0x424 */ u8 *faceData; - u16 unk428; - u16 unk42A; - u8 unk42C; - u8 unk42D; - u8 unk42E; + /* 0x420 */ struct MonPortraitMsg monPortrait; u32 unk430; /* 0x434 */ u8 formattedString[0x100]; /* 0x534 */ s32 wonderMailMethod; @@ -39,4 +33,4 @@ typedef struct WonderMailStruct_203B2C4 unkStruct_802F204 unk53C; } WonderMailStruct_203B2C4; -#endif // GUARD_THANK_YOU_WONDER_MAIL_H \ No newline at end of file +#endif // GUARD_THANK_YOU_WONDER_MAIL_H diff --git a/include/wigglytuff_shop3.h b/include/wigglytuff_shop3.h index f90797f39..48a12c019 100644 --- a/include/wigglytuff_shop3.h +++ b/include/wigglytuff_shop3.h @@ -52,15 +52,8 @@ typedef struct WigglytuffShop3Work MenuItem unk1C[8]; u16 unk5C[8]; MenuStruct unk6C; - /* 0xBC */ OpenedFile *faceFile; - /* 0xC0 */ u8 *faceData; - u16 unkC4; - u16 unkC6; - u8 unkC8; - u8 unkC9; - u8 unkCA; - u8 fillCB; - OpenedFile **unkCC; + /* 0xBC */ struct MonPortraitMsg monPortrait; + struct MonPortraitMsg *monPortraitPtr; UnkTextStruct2 unkD0[4]; u32 unk130; u32 unk134; diff --git a/include/wonder_mail.h b/include/wonder_mail.h index e821bb0fb..fc0d120ae 100644 --- a/include/wonder_mail.h +++ b/include/wonder_mail.h @@ -25,13 +25,7 @@ typedef struct WonderMailStruct_203B2C0 UnkTextStruct2 unk35C[4]; UnkTextStruct2 unk3BC[4]; /* 0x41C */ u32 unkfill; // ItemSlot? - /* 0x420 */ OpenedFile *faceFile; - /* 0x424 */ u8 *faceData; - u16 unk428; - u16 unk42A; - u8 unk42C; - u8 unk42D; - u8 unk42E; + /* 0x420 */ struct MonPortraitMsg monPortrait; /* 0x430 */ u8 padding3[0x534 - 0x430]; u32 unk534; s32 unk538; // A7 << 3 @@ -40,4 +34,4 @@ typedef struct WonderMailStruct_203B2C0 /* 0x544 */ s16 speciesNum; } WonderMailStruct_203B2C0; -#endif // GUARD_WONDER_MAIL_H \ No newline at end of file +#endif // GUARD_WONDER_MAIL_H diff --git a/ld_script.txt b/ld_script.txt index 690c1b432..f5e9d9dfb 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -234,10 +234,8 @@ SECTIONS { asm/code_804AFAC.o(.text); src/code_804AFAC.o(.text); asm/code_804FD30.o(.text); - src/code_80521D0.o(.text); - asm/code_80521D0.o(.text); - src/charge_move.o(.text); - src/move_util.o(.text); + src/dungeon_message.o(.text); + src/dungeon_move.o(.text); src/move_actions.o(.text); src/status_actions.o(.text); src/move_checks.o(.text); @@ -556,8 +554,10 @@ SECTIONS { src/move_checks.o(.rodata); data/data_80F5668.o(.rodata); src/dungeon_pokemon_attributes.o(.rodata); + src/called_move_data.o(.rodata); data/data_80F59C8.o(.rodata); - src/charge_move.o(.rodata); + src/dungeon_message.o(.rodata); + src/dungeon_move.o(.rodata); data/data_8106A4C.o(.rodata); src/code_806CD90.o(.rodata); src/type_effectiveness.o(.data); diff --git a/src/called_move_data.c b/src/called_move_data.c new file mode 100644 index 000000000..f83ab7cd3 --- /dev/null +++ b/src/called_move_data.c @@ -0,0 +1,306 @@ +#include "global.h" +#include "called_move_data.h" +#include "constants/move_id.h" + +extern bool8 sub_8057634(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 YawnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 NightmareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805783C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057974(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 PainSplitMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057BC4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057C88(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 WhirlpoolMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057D7C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057D9C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SmokescreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057FCC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057FF4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805805C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805816C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058270(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80582C4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80583D8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058430(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058478(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80584C0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058548(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058638(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80586DC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058770(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80587E8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058838(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058858(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80588B8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80588F4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058930(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058A18(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058BF0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058FBC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80590D4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059190(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80591E4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059424(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805946C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059540(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80595A0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80595EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80598CC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059928(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059988(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059A2C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059AA8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059AB8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059AF8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059D00(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059D48(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059D98(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059DA4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059DB4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059DC4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059E0C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TriAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A120(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A210(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A258(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A2A0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A3DC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A464(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A568(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A688(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SecretPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AC90(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AD04(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AD34(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AD54(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AE3C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AE74(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AECC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 PresentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AFA4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B028(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B074(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B0BC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B17C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 WrapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B264(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B324(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 DestinyBondMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B388(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B3E0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B454(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 MimicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B53C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 LeechSeedMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B668(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B910(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B808(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A408(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 HandleRegularDamagingMove(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059050(Entity *pokemon, Entity *target, Move *move, s32 param_4); + +// Todo: move this data to some better place once the file structure is better understood + +// These are random +const struct CalledMove gMetronomeCalledMoves[METRONOME_AVAILABLE_CALLED_MOVES] = +{ + {MOVE_IRON_TAIL, sub_8057634}, + {MOVE_YAWN, YawnMoveAction}, + {MOVE_NIGHTMARE, NightmareMoveAction}, + {MOVE_CHARM, sub_805783C}, + {MOVE_ENCORE, EncoreMoveAction}, + {MOVE_SUPER_FANG, sub_8057974}, + {MOVE_PAIN_SPLIT, PainSplitMoveAction}, + {MOVE_TORMENT, TormentMoveAction}, + {MOVE_SWAGGER, sub_8057BC4}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_WHIRLPOOL, WhirlpoolMoveAction}, + {MOVE_FAKE_TEARS, sub_8057D7C}, + {MOVE_SPITE, sub_8057D9C}, + {MOVE_SMOKESCREEN, SmokescreenMoveAction}, + {MOVE_FLATTER, sub_8057FCC}, + {MOVE_WILL_O_WISP, sub_8057FF4}, + {MOVE_RETURN, sub_805805C}, + {MOVE_FLAME_WHEEL, sub_805816C}, + {MOVE_GUST, sub_8058270}, + {MOVE_DISABLE, sub_80582C4}, + {MOVE_CRUNCH, sub_80583D8}, + {MOVE_BITE, sub_8058430}, + {MOVE_THUNDER, sub_8058478}, + {MOVE_ENDEAVOR, sub_80584C0}, + {MOVE_FACADE, sub_8058548}, + {MOVE_CONSTRICT, sub_8058580}, + {MOVE_BRICK_BREAK, BrickBreakMoveAction}, + {MOVE_ROCK_TOMB, sub_8058638}, + {MOVE_GIGA_DRAIN, sub_80586DC}, + {MOVE_REVERSAL, sub_8058770}, + {MOVE_SMELLINGSALT, sub_80587E8}, + {MOVE_METAL_SOUND, sub_8058838}, + {MOVE_TICKLE, sub_8058858}, + {MOVE_OUTRAGE, sub_80588B8}, + {MOVE_LOW_KICK, sub_80588F4}, + {MOVE_ANCIENTPOWER, sub_8058930}, + {MOVE_RAPID_SPIN, sub_8058A18}, + {MOVE_SCARY_FACE, sub_8058BF0}, + {MOVE_SUBMISSION, sub_8058E5C}, + {MOVE_LICK, sub_8058FBC}, + {MOVE_FISSURE, sub_80590D4}, + {MOVE_EXTRASENSORY, sub_8059190}, + {MOVE_ABSORB, sub_80591E4}, + {MOVE_SKILL_SWAP, SkillSwapMoveAction}, + {MOVE_HEADBUTT, sub_8059424}, + {MOVE_DOUBLE_EDGE, sub_805946C}, + {MOVE_SAND_ATTACK, sub_8059528}, + {MOVE_SMOG, sub_8059540}, + {MOVE_SACRED_FIRE, sub_80595A0}, + {MOVE_SHEER_COLD, sub_80595EC}, + {MOVE_MUDDY_WATER, sub_80598CC}, + {MOVE_TWISTER, sub_8059928}, + {MOVE_TWINEEDLE, sub_8059988}, + {MOVE_SEISMIC_TOSS, sub_8059A2C}, + {MOVE_SUPERSONIC, sub_8059AA8}, + {MOVE_TAUNT, sub_8059AB8}, + {MOVE_HORN_DRILL, sub_8059AF8}, + {MOVE_THUNDERSHOCK, sub_8059D00}, + {MOVE_THUNDER_WAVE, sub_8059D48}, + {MOVE_BLOCK, sub_8059D98}, + {MOVE_POISON_GAS, sub_8059DA4}, + {MOVE_TOXIC, sub_8059DB4}, + {MOVE_POISON_FANG, sub_8059DC4}, + {MOVE_POISON_STING, sub_8059E0C}, + {MOVE_TRI_ATTACK, TriAttackMoveAction}, + {MOVE_TRICK, sub_805A120}, + {MOVE_TRIPLE_KICK, sub_805A210}, + {MOVE_MUD_SLAP, sub_805A258}, + {MOVE_THIEF, sub_805A2A0}, + {MOVE_ROLE_PLAY, RolePlayMoveAction}, + {MOVE_LEER, sub_805A3DC}, + {MOVE_PAY_DAY, sub_805A464}, + {MOVE_CURSE, CurseMoveAction}, + {MOVE_FRENZY_PLANT, sub_805A568}, + {MOVE_SUPERPOWER, TickleMoveAction}, + {MOVE_DYNAMICPUNCH, sub_805A688}, + {MOVE_KNOCK_OFF, KnockOffMoveAction}, + {MOVE_SECRET_POWER, SecretPowerMoveAction}, + {MOVE_DIZZY_PUNCH, sub_805AC90}, + {MOVE_IMPRISON, sub_805AD04}, + {MOVE_FEATHERDANCE, sub_805AD34}, + {MOVE_BEAT_UP, sub_805AD54}, + {MOVE_BLAST_BURN, sub_805AE3C}, + {MOVE_CRUSH_CLAW, sub_805AE74}, + {MOVE_BLAZE_KICK, sub_805AECC}, + {MOVE_PRESENT, PresentMoveAction}, + {MOVE_ERUPTION, sub_805AFA4}, + {MOVE_GLARE, sub_805B028}, + {MOVE_POISON_TAIL, sub_805B074}, + {MOVE_ROAR, sub_805B0BC}, + {MOVE_FIRE_SPIN, sub_805B17C}, + {MOVE_WRAP, WrapMoveAction}, + {MOVE_MAGNITUDE, sub_805B264}, + {MOVE_MIST_BALL, sub_805B324}, + {MOVE_DESTINY_BOND, DestinyBondMoveAction}, + {MOVE_FALSE_SWIPE, sub_805B388}, + {MOVE_HIDDEN_POWER, sub_805B3E0}, + {MOVE_ATTRACT, sub_805B454}, + {MOVE_MIMIC, MimicMoveAction}, + {MOVE_FRUSTRATION, sub_805B53C}, + {MOVE_LEECH_SEED, LeechSeedMoveAction}, + {MOVE_DREAM_EATER, sub_805B668}, + {MOVE_LUSTER_PURGE, sub_805B910}, + {MOVE_DRAGON_RAGE, sub_805B808}, + {MOVE_FAKE_OUT, sub_805A408}, +}; + +// These correspond to dungeon's tileset id +const struct CalledMove gNaturePowerCalledMoves[] = +{ + {MOVE_SURF, HandleRegularDamagingMove}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_EARTHQUAKE, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_EARTHQUAKE, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_RAZOR_LEAF, HandleRegularDamagingMove}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_RAZOR_LEAF, HandleRegularDamagingMove}, + {MOVE_RAZOR_LEAF, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_EARTHQUAKE, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_SURF, HandleRegularDamagingMove}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_EARTHQUAKE, HandleRegularDamagingMove}, + {MOVE_BUBBLEBEAM, sub_8058580}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_SHADOW_BALL, sub_80583D8}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_STUN_SPORE, sub_8059050}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_RAZOR_LEAF, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, sub_8057C88}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SWIFT, HandleRegularDamagingMove}, + {MOVE_SURF, HandleRegularDamagingMove}, + {MOVE_SURF, HandleRegularDamagingMove}, + {MOVE_ROCK_SLIDE, HandleRegularDamagingMove}, +}; + +// diff --git a/src/charge_move.c b/src/charge_move.c deleted file mode 100644 index e77533f65..000000000 --- a/src/charge_move.c +++ /dev/null @@ -1,123 +0,0 @@ -#include "global.h" -#include "charge_move.h" - -#include "constants/move_id.h" -#include "constants/status.h" -#include "dungeon_random.h" -#include "dungeon_util.h" -#include "moves.h" - -struct MultiTurnChargeMove -{ - u16 moveID; - u8 chargingStatus; -}; - -const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { - {MOVE_SOLARBEAM, STATUS_SOLARBEAM}, - {MOVE_SKY_ATTACK, STATUS_SKY_ATTACK}, - {MOVE_RAZOR_WIND, STATUS_RAZOR_WIND}, - {MOVE_FOCUS_PUNCH, STATUS_FOCUS_PUNCH}, - {MOVE_SKULL_BASH, STATUS_SKULL_BASH}, - {MOVE_FLY, STATUS_FLYING}, - {MOVE_BOUNCE, STATUS_BOUNCING}, - {MOVE_DIVE, STATUS_DIVING}, - {MOVE_DIG, STATUS_DIGGING}, - {MOVE_NOTHING, STATUS_NONE} -}; - -const u32 gMultiTurnChargingStatuses[10] = { - STATUS_SOLARBEAM, - STATUS_SKY_ATTACK, - STATUS_RAZOR_WIND, - STATUS_FOCUS_PUNCH, - STATUS_SKULL_BASH, - STATUS_FLYING, - STATUS_BOUNCING, - STATUS_DIVING, - STATUS_DIGGING, - STATUS_NONE -}; - -u32 sub_8057070(Move *move) -{ - u32 numberOfChainedHits; - numberOfChainedHits = GetMoveNumberOfChainedHits(move); - if(numberOfChainedHits == 0) - return DungeonRandRange(2, 6); - else - return numberOfChainedHits; -} - -bool8 MoveCausesPaused(Move *move) -{ - if(move->id == MOVE_FRENZY_PLANT) return TRUE; - if(move->id == MOVE_HYDRO_CANNON) return TRUE; - if(move->id == MOVE_HYPER_BEAM) return TRUE; - if(move->id == MOVE_BLAST_BURN) return TRUE; - - return FALSE; -} - -bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move) -{ - if (!EntityExists(pokemon)) - { - return FALSE; - } - else - { - EntityInfo *pokemonInfo = pokemon->info; - s32 i; - for (i = 0; i < 100; i++) - { - if (gMultiTurnChargeMoves[i].moveID == MOVE_NOTHING) - { - return FALSE; - } - if (move->id == gMultiTurnChargeMoves[i].moveID && - pokemonInfo->charging.chargingStatus == gMultiTurnChargeMoves[i].chargingStatus) - { - return TRUE; - } - } - return FALSE; - } -} - -bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) -{ - if (!EntityExists(pokemon)) - { - return FALSE; - } - else - { - EntityInfo *pokemonInfo = pokemon->info; - int i = 0; - u8 *chargingStatusPointer = &pokemonInfo->charging.chargingStatus; - u8 *chargingStatusPointer2; - u8 chargeStatus = STATUS_CHARGING; - for (; i < 100; i++) - { - u8 currentStatus = gMultiTurnChargingStatuses[i]; - u8 chargingStatus; - if (currentStatus == STATUS_NONE) - { - return FALSE; - } - chargingStatus = *chargingStatusPointer; - chargingStatusPointer2 = &pokemonInfo->charging.chargingStatus; - if (chargingStatus == currentStatus) - { - return TRUE; - } - } - // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnChargingStatuses array. - if (checkCharge && *chargingStatusPointer2 == chargeStatus) - { - return TRUE; - } - return FALSE; - } -} diff --git a/src/code_2.c b/src/code_2.c index a61aba40f..50875aa5a 100644 --- a/src/code_2.c +++ b/src/code_2.c @@ -179,7 +179,7 @@ void GameLoop(void) void xxx_update_stuff(u32 r0) { - xxx_draw_string_80144C4(); + DrawDialogueBoxString(); sub_8005838(NULL, 0); nullsub_8(gGameOptionsRef->unkA); sub_8005180(); diff --git a/src/code_8012A18.c b/src/code_8012A18.c index 1f3506f34..f288b6cc0 100644 --- a/src/code_8012A18.c +++ b/src/code_8012A18.c @@ -13,7 +13,7 @@ extern void xxx_call_update_bg_vram(); void sub_8012A18() { sub_8011860(); - xxx_draw_string_80144C4(); + DrawDialogueBoxString(); nullsub_8(gGameOptionsRef->unkA); sub_8005180(); sub_80060EC(); diff --git a/src/code_80140DC.c b/src/code_80140DC.c index 1f31a7d65..d0861caee 100644 --- a/src/code_80140DC.c +++ b/src/code_80140DC.c @@ -61,12 +61,12 @@ u32 sub_8014128(void) { } u32 sub_801413C(void) -{ +{ return 0; } u32 sub_8014140(void) -{ +{ return 0; } @@ -91,18 +91,18 @@ void sub_801416C(s32 param_1,s32 param_2) gUnknown_202E73C = (param_2 < 0 ) ? 0 : param_2; } -void xxx_info_box_80141B4(const u8 *text, u32 param_2, OpenedFile **file, u16 param_4) +void CreateDialogueBoxAndPortrait(const u8 *text, u32 param_2, struct MonPortraitMsg *monPortraitPtr, u16 param_4) { - sub_8014248(text, param_2, -1, NULL, NULL, 3, 0, file, param_4); + CreateMenuDialogueBoxAndPortrait(text, param_2, -1, NULL, NULL, 3, 0, monPortraitPtr, param_4); } -void sub_80141E0(const u8 *text, OpenedFile **file, u16 param_3) +void CreateYesNoDialogueBoxAndPortrait_DefaultYes(const u8 *text, struct MonPortraitMsg *monPortraitPtr, u16 param_3) { - sub_8014248(text, 0, -1, gUnknown_80D485C, NULL, 3, 0, file, param_3 | 0x300); + CreateMenuDialogueBoxAndPortrait(text, 0, -1, gUnknown_80D485C, NULL, 3, 0, monPortraitPtr, param_3 | 0x300); } -void sub_8014214(const u8 *text, OpenedFile **file, u16 param_3) +void CreateYesNoDialogueBoxAndPortrait_DefaultNo(const u8 *text, struct MonPortraitMsg *monPortraitPtr, u16 param_3) { - sub_8014248(text, 0, -1, gUnknown_80D4880, NULL, 3, 0, file, param_3 | 0x300); + CreateMenuDialogueBoxAndPortrait(text, 0, -1, gUnknown_80D4880, NULL, 3, 0, monPortraitPtr, param_3 | 0x300); } diff --git a/src/code_801602C.c b/src/code_801602C.c index c3510f8a0..64df2d0d4 100644 --- a/src/code_801602C.c +++ b/src/code_801602C.c @@ -109,14 +109,14 @@ static void sub_8016110(void) else sub_80922B4(gAvailablePokemonNames, sUnknown_203B200->pokeName, POKEMON_NAME_LENGTH); - sub_8014248(sIsNameOKPrompt, 0, 3, sUnknown_203B200->menus, 0, 4, 0, NULL, 32); + CreateMenuDialogueBoxAndPortrait(sIsNameOKPrompt, 0, 3, sUnknown_203B200->menus, 0, 4, 0, NULL, 32); break; case CONFIRM_NAME_MENU_TOO_LONG: - xxx_info_box_80141B4(sNameTooLong, 0, 0, 0x121); + CreateDialogueBoxAndPortrait(sNameTooLong, 0, 0, 0x121); break; case CONFIRM_NAME_MENU_EMPTY: - xxx_info_box_80141B4(sEnterAName, 0, 0, 0x121); + CreateDialogueBoxAndPortrait(sEnterAName, 0, 0, 0x121); break; default: break; diff --git a/src/code_801AFA4.c b/src/code_801AFA4.c index e68905371..f97e2bf03 100644 --- a/src/code_801AFA4.c +++ b/src/code_801AFA4.c @@ -87,7 +87,7 @@ static void sub_801B080(void) switch (sUnknown_203B22C->state) { case 0: sub_801B178(); - sub_8014248(sFmtWhoWillLearnTheMove, 0, sUnknown_203B22C->unk60, sUnknown_203B22C->menuItems, 0, 4, 0, NULL, 32); + CreateMenuDialogueBoxAndPortrait(sFmtWhoWillLearnTheMove, 0, sUnknown_203B22C->unk60, sUnknown_203B22C->menuItems, 0, 4, 0, NULL, 32); break; case 1: CreateGulpinShop(2, sUnknown_203B22C->chosenPokemon, sUnknown_203B22C->moves); @@ -99,10 +99,10 @@ static void sub_801B080(void) gTeamInventoryRef->teamItems[sUnknown_203B22C->teamItemIndex].id = ITEM_TM_USED_TM; } PlaySound(312); - xxx_info_box_80141B4(sFmtLearnedTheMove, 0, 0, 0x121); + CreateDialogueBoxAndPortrait(sFmtLearnedTheMove, 0, 0, 0x121); break; case 3: - xxx_info_box_80141B4(sFmtNoOneCanLearnThisMove, 0, 0, 0x121); + CreateDialogueBoxAndPortrait(sFmtNoOneCanLearnThisMove, 0, 0, 0x121); break; default: case 4: diff --git a/src/code_801B60C.c b/src/code_801B60C.c index a9b7d456a..7a0ffedd1 100644 --- a/src/code_801B60C.c +++ b/src/code_801B60C.c @@ -212,31 +212,31 @@ store: break; case 1: if (GetUnitSum_808D544(0) < 2) - xxx_info_box_80141B4(sFmtReceivedThePromised, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtReceivedThePromised, 0, 0, 0x101); else - xxx_info_box_80141B4(sFmtTeamReceivedThePromised, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtTeamReceivedThePromised, 0, 0, 0x101); break; case 2: - xxx_info_box_80141B4(sFmtTeamAlsoReceived, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtTeamAlsoReceived, 0, 0, 0x101); break; case 3: PlaySound(212); - xxx_info_box_80141B4(sFmtReceivedStatue, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtReceivedStatue, 0, 0, 0x101); break; case 4: - xxx_info_box_80141B4(sFmtReceive1000Instead, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtReceive1000Instead, 0, 0, 0x101); break; case 5: sUnknown_203B234->fallbackState = 16; - xxx_info_box_80141B4(sFmtFullSoSentToStorage, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtFullSoSentToStorage, 0, 0, 0x101); break; case 6: sub_801BB20(); - sub_8014248(sFmtFullSoPrompt, 0, 4, sUnknown_203B234->unkCC, 0, 4, 0, 0, 0); + CreateMenuDialogueBoxAndPortrait(sFmtFullSoPrompt, 0, 4, sUnknown_203B234->unkCC, 0, 4, 0, 0, 0); break; case 7: sub_801BC24(); - sub_8014248(sFmtConfirmThrowAway, 0, 3, sUnknown_203B234->unkCC, 0, 4, 0, 0, 0); + CreateMenuDialogueBoxAndPortrait(sFmtConfirmThrowAway, 0, 3, sUnknown_203B234->unkCC, 0, 4, 0, 0, 0); break; case 8: sub_801A5D8(1, 3, NULL, 10); @@ -259,15 +259,15 @@ store: break; case 13: sUnknown_203B234->fallbackState = 16; - xxx_info_box_80141B4(sFmtThrownAway, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtThrownAway, 0, 0, 0x101); break; case 14: sUnknown_203B234->fallbackState = 16; - xxx_info_box_80141B4(sFmtPutInStorageForReceive, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtPutInStorageForReceive, 0, 0, 0x101); break; case 15: sUnknown_203B234->fallbackState = 16; - xxx_info_box_80141B4(sFmtDiscardedForReceive, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtDiscardedForReceive, 0, 0, 0x101); break; case 16: break; diff --git a/src/code_80227B8.c b/src/code_80227B8.c index 9265850f1..11e1a225d 100644 --- a/src/code_80227B8.c +++ b/src/code_80227B8.c @@ -167,19 +167,19 @@ static void sub_8022A10(void) sub_801B3C0(&sUnknown_203B294->item); break; case 5: - xxx_info_box_80141B4(sDoesNotAppearHungry, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sDoesNotAppearHungry, 0, 0, 0x301); break; case 6: - xxx_info_box_80141B4(sFmtGummiBigFav, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtGummiBigFav, 0, 0, 0x101); break; case 7: - xxx_info_box_80141B4(sFmtGummiFav, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtGummiFav, 0, 0, 0x101); break; case 8: - xxx_info_box_80141B4(sFmtGummiOkay, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtGummiOkay, 0, 0, 0x101); break; case 9: - xxx_info_box_80141B4(sFmtGummiSatisfied, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtGummiSatisfied, 0, 0, 0x101); break; case 10: do { @@ -204,7 +204,7 @@ static void sub_8022A10(void) sUnknown_203B294->fallbackState = 10; strcpy(gUnknown_202DEA8, GetIQSkillName(sUnknown_203B294->unk40)); PlaySound(203); - xxx_info_box_80141B4(sFmtIQHelpedLearn, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sFmtIQHelpedLearn, 0, 0, 0x101); sUnknown_203B294->unk40++; break; } @@ -239,35 +239,35 @@ static void sub_8022A10(void) } break; case 12: - xxx_info_box_80141B4(sFmtPlusEverything, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sFmtPlusEverything, 0, 0, 0x301); break; case 13: - xxx_info_box_80141B4(sFmtPlusAtk, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sFmtPlusAtk, 0, 0, 0x301); break; case 14: - xxx_info_box_80141B4(sFmtPlusSpAtk, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sFmtPlusSpAtk, 0, 0, 0x301); break; case 15: - xxx_info_box_80141B4(sFmtPlusDef, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sFmtPlusDef, 0, 0, 0x301); break; case 16: - xxx_info_box_80141B4(sFmtPlusSpDef, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sFmtPlusSpDef, 0, 0, 0x301); break; case 17: sUnknown_203B294->fallbackState = 22; - xxx_info_box_80141B4(sNoGummis, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sNoGummis, 0, 0, 0x301); break; case 18: sUnknown_203B294->fallbackState = 22; - xxx_info_box_80141B4(sNoItem, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sNoItem, 0, 0, 0x301); break; case 19: sUnknown_203B294->fallbackState = 22; - xxx_info_box_80141B4(sGummiGone, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sGummiGone, 0, 0, 0x301); break; case 20: sUnknown_203B294->fallbackState = 22; - xxx_info_box_80141B4(sItemGone, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sItemGone, 0, 0, 0x301); break; case 21: sub_801AFA4(sUnknown_203B294->itemIndex); diff --git a/src/code_802DB28.c b/src/code_802DB28.c index 04579969a..fd0a25691 100644 --- a/src/code_802DB28.c +++ b/src/code_802DB28.c @@ -45,16 +45,16 @@ bool8 sub_802DB28(u8 jobSlotIndex, u8 dungeon) sub_8096EEC(sUnknown_203B2FC->jobInfo); sub_803C21C(sUnknown_203B2FC->jobInfo, &sUnknown_203B2FC->unk8); - sUnknown_203B2FC->faceFile = GetDialogueSpriteDataPtr(sUnknown_203B2FC->jobInfo->clientSpecies); - sUnknown_203B2FC->faceData = NULL; - sUnknown_203B2FC->unk44 = 0; - sUnknown_203B2FC->unk45 = 0; - sUnknown_203B2FC->unk46 = 0; - sUnknown_203B2FC->unk40 = 2; - sUnknown_203B2FC->unk42 = 8; + sUnknown_203B2FC->monPortrait.faceFile = GetDialogueSpriteDataPtr(sUnknown_203B2FC->jobInfo->clientSpecies); + sUnknown_203B2FC->monPortrait.faceData = NULL; + sUnknown_203B2FC->monPortrait.spriteId = 0; + sUnknown_203B2FC->monPortrait.flip = FALSE; + sUnknown_203B2FC->monPortrait.unkE = 0; + sUnknown_203B2FC->monPortrait.pos.x = 2; + sUnknown_203B2FC->monPortrait.pos.y = 8; - if (sUnknown_203B2FC->faceFile != NULL) - sUnknown_203B2FC->faceData = sUnknown_203B2FC->faceFile->data; + if (sUnknown_203B2FC->monPortrait.faceFile != NULL) + sUnknown_203B2FC->monPortrait.faceData = sUnknown_203B2FC->monPortrait.faceFile->data; sub_802DC28(0); return TRUE; @@ -78,8 +78,8 @@ u32 sub_802DBD4(void) void sub_802DC00(void) { if (sUnknown_203B2FC != NULL) { - if (sUnknown_203B2FC->faceFile != NULL) - CloseFile(sUnknown_203B2FC->faceFile); + if (sUnknown_203B2FC->monPortrait.faceFile != NULL) + CloseFile(sUnknown_203B2FC->monPortrait.faceFile); MemoryFree(sUnknown_203B2FC); sUnknown_203B2FC = NULL; @@ -150,16 +150,16 @@ static void sub_802DC9C(void) } break; case 1: - xxx_info_box_80141B4(sThanksForRescuingMe, 0, &sUnknown_203B2FC->faceFile, 0x10D); + CreateDialogueBoxAndPortrait(sThanksForRescuingMe, 0, &sUnknown_203B2FC->monPortrait, 0x10D); break; case 2: - xxx_info_box_80141B4(sThanksForRescuingThem, 0, &sUnknown_203B2FC->faceFile, 0x10D); + CreateDialogueBoxAndPortrait(sThanksForRescuingThem, 0, &sUnknown_203B2FC->monPortrait, 0x10D); break; case 3: - xxx_info_box_80141B4(sThanksForEscortingMe, 0, &sUnknown_203B2FC->faceFile, 0x10D); + CreateDialogueBoxAndPortrait(sThanksForEscortingMe, 0, &sUnknown_203B2FC->monPortrait, 0x10D); break; case 5: - xxx_info_box_80141B4(sThanksForDelivering, 0, &sUnknown_203B2FC->faceFile, 0x10D); + CreateDialogueBoxAndPortrait(sThanksForDelivering, 0, &sUnknown_203B2FC->monPortrait, 0x10D); break; case 4: index = FindItemInInventory(sUnknown_203B2FC->jobInfo->targetItem); @@ -167,7 +167,7 @@ static void sub_802DC9C(void) ShiftItemsDownFrom(index); FillInventoryGaps(); } - xxx_info_box_80141B4(sThanksForGetting, 0, &sUnknown_203B2FC->faceFile, 0x10D); + CreateDialogueBoxAndPortrait(sThanksForGetting, 0, &sUnknown_203B2FC->monPortrait, 0x10D); break; case 6: sub_802F204(&sUnknown_203B2FC->unk8, 1); diff --git a/src/code_803E46C.c b/src/code_803E46C.c index c0ce17aed..d086befff 100644 --- a/src/code_803E46C.c +++ b/src/code_803E46C.c @@ -86,9 +86,9 @@ void sub_803E490(u32 unused) sub_803EDF0(); - if(gDungeon->unk181e8.unk18215 != 0 && gDungeon->unk1C06C != 3) + if(gDungeon->unk181e8.unk18215 != 0 && gDungeon->unk1BDD4.unk1C06C != 3) sub_8004AF0(gUnknown_203B40D, gUnknown_202EE8C, 0xA0, 0x20, gUnknown_202EDC8, (u8 *)gDungeon->unk17C); - + nullsub_8(gGameOptionsRef->unkA); sub_8005180(); nullsub_12(); @@ -103,13 +103,13 @@ void sub_803E490(u32 unused) nullsub_13(); sub_8005304(); nullsub_14(); - + TransferBGPaletteBuffer(); sub_8009908(); xxx_call_update_bg_vram(); sub_8040788(); xxx_call_update_bg_sound_input(); - + gDungeon->unk181e8.unk18213 = 0; UpdateDungeonMusic(); sub_8011860(); @@ -156,7 +156,7 @@ void sub_803E708(s32 a0, u32 a1) void sub_803E724(s32 r0) { - do + do { sub_803E46C(r0); } while (gRealInputs.held & 0xF0); @@ -225,7 +225,7 @@ void sub_803E7C8(void) gUnknown_203B40D = 0; } -void sub_803E830(void) +void sub_803E830(void) { s32 index; diff --git a/src/code_803E724.c b/src/code_803E724.c index a600a73b8..b74b412f6 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -17,6 +17,7 @@ #include "game_options.h" #include "code_800558C.h" #include "dungeon_range.h" +#include "dungeon_message.h" #include "code_806CD90.h" #include "dungeon_items.h" #include "constants/item.h" @@ -63,10 +64,8 @@ extern u8 gUnknown_202D068[]; extern s32 gUnknown_202EDCC; extern u32 gUnknown_3001018[]; -extern void sub_8052210(u32); extern void sub_8040A84(); extern void sub_8083D44(void); -extern void sub_8052210(u32); extern void sub_8049ED4(void); extern void sub_8040A84(void); extern void sub_80400D4(void); @@ -101,7 +100,7 @@ void sub_803E874(bool8 r10, s32 r9) index++; } - if (gDungeon->unk181e8.unk18215 == 0 || gDungeon->unk1C06C == 3) { + if (gDungeon->unk181e8.unk18215 == 0 || gDungeon->unk1BDD4.unk1C06C == 3) { sub_8004AF0(TRUE, gUnknown_202EE8C, 0xA0, 0x20, gUnknown_202EDC8, (void *) &gDungeon->unk17C); } @@ -169,7 +168,7 @@ void sub_803EA10(void) index++; } - if (gDungeon->unk181e8.unk18215 == 0 || gDungeon->unk1C06C == 3) { + if (gDungeon->unk181e8.unk18215 == 0 || gDungeon->unk1BDD4.unk1C06C == 3) { sub_8004AF0(TRUE, gUnknown_202EE8C, 0xA0, 0x20, gUnknown_202EDC8, (void *) &gDungeon->unk17C); } diff --git a/src/code_8040094.c b/src/code_8040094.c index aeb697ad5..e54661ade 100644 --- a/src/code_8040094.c +++ b/src/code_8040094.c @@ -2,7 +2,7 @@ #include "code_800558C.h" #include "code_800C9CC.h" #include "code_80118A4.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" #include "dungeon_map_access.h" @@ -44,7 +44,7 @@ void HandleLuminousOrbAction(Entity *pokemon) sub_803F580(0); sub_8049ED4(); sub_8040A84(); - SendMessage(pokemon, gUnknown_80FD040); + TryDisplayDungeonLoggableMessage(pokemon, gUnknown_80FD040); } void sub_8040094(u8 r0) diff --git a/src/code_804267C.c b/src/code_804267C.c index 87b53f959..b6bf98d48 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -8,6 +8,7 @@ #include "dungeon.h" #include "dungeon_engine.h" #include "dungeon_leader.h" +#include "dungeon_message.h" #include "dungeon_music.h" #include "dungeon_util.h" #include "structs/str_dungeon.h" @@ -32,8 +33,6 @@ extern bool8 sub_8042CC0(void); extern void sub_8042D7C(void); extern u8 sub_8043D10(void); extern bool8 sub_8045888(Entity *); -extern void sub_8052210(u32); -extern void sub_805239C(Entity *, const u8 *); // This func plays the appropriate ascend/descend SFX for stairs depending on the direction void PlayStairsSound(void) @@ -115,7 +114,7 @@ void sub_80427AC(void) sub_80429A0(entity); if (!enInfo->isNotTeamMember) { SetMessageArgument(gAvailablePokemonNames, entity, 0); - sub_805239C(entity, *gPtrFeralFoundItemMessage); + DisplayDungeonLoggableMessageTrue(entity, *gPtrFeralFoundItemMessage); } } } diff --git a/src/code_8042B34.c b/src/code_8042B34.c index 53f144b43..b6c239c41 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -7,6 +7,7 @@ #include "code_800DAC0.h" #include "code_800E9A8.h" #include "dungeon_util.h" +#include "dungeon_message.h" #include "bg_control.h" #include "random.h" #include "file_system.h" @@ -278,9 +279,6 @@ extern void sub_8068BDC(u8 r0); extern s16 GetTurnLimit(u8 dungeon); extern void sub_8041888(u8 param_1); extern void sub_8040150(bool8 param_1); -extern void sub_8052210(u32); -extern void sub_80526D0(u32); -extern void sub_8052740(u32); extern void sub_803D4AC(void); extern void sub_804513C(void); extern void sub_8043CD8(void); @@ -317,12 +315,10 @@ extern void sub_803E178(void); extern void sub_80848F0(void); extern void sub_8097890(void); extern void sub_806AB2C(void); -extern void sub_8052DD0(void); extern void DisplayPreFightDialogue(void); extern void sub_8071DA4(Entity *); extern void sub_803E748(void); extern void sub_8083D68(void); -extern void sub_8052F80(void); extern void sub_803E7C8(void); extern void sub_8040A84(void); extern void sub_807E5AC(void); @@ -331,12 +327,10 @@ extern void sub_807E88C(void); extern void InitDungeonPokemonSprites(void); extern void nullsub_16(void); extern void sub_80521D0(void); -extern void sub_80531A8(void); extern void sub_803F27C(u8); extern void sub_807E7FC(u8); extern void sub_80095CC(u32, u32); extern void sub_8081BF4(u8 *r0, u32 r1); -extern void PrintFieldMessage(u32, const u8 *, u32); extern bool8 IsLevelResetTo1(u8 dungeon); extern void sub_8068A84(PokemonStruct1 *pokemon); extern void sub_807EAA0(u32, u32); @@ -516,10 +510,10 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (r9) { gFormatData_202DE30 = gDungeon->unk67B; if (gFormatData_202DE30 != 0) { - PrintFieldMessage(0, gUnknown_80FEC48, 1); + DisplayDungeonMessage(0, gUnknown_80FEC48, 1); } else { - PrintFieldMessage(0, gUnknown_80FEC7C, 1); + DisplayDungeonMessage(0, gUnknown_80FEC7C, 1); } } @@ -540,10 +534,10 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) unkStruct_203B480 *mailStr = GetMailatIndex(sp); if (mailStr->rescuesAllowed) { gFormatData_202DE30 = mailStr->rescuesAllowed; - PrintFieldMessage(0, gUnknown_81002B8, 1); + DisplayDungeonMessage(0, gUnknown_81002B8, 1); } else { - PrintFieldMessage(0, gPtrFinalChanceMessage, 1); + DisplayDungeonMessage(0, gPtrFinalChanceMessage, 1); } } } @@ -552,7 +546,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) sub_8098080(); nullsub_16(); sub_80521D0(); - sub_80531A8(); + ResetMessageLog(); InitDungeonPokemonSprites(); if (!r6) { sub_804513C(); @@ -593,7 +587,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gDungeon->unkB = 1; gDungeon->unkD = 1; gDungeon->unkE = 0; - gDungeon->unk1C05E = 0; + gDungeon->unk1BDD4.unk1C05E = 0; if (!r6) { gDungeon->unk679 = 0; gDungeon->unk68C = 0; @@ -719,11 +713,11 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gDungeon->unk0 = 1; if (!r6) { - sub_8052DD0(); + TryDisplayGeneralTutorialMessage(); if (gDungeon->unk9 != 0) { gDungeon->unk9 = 0; sub_8083D68(); - sub_8052F80(); + DisplayYouReachedDestFloorStr(); } } gLeaderPointer = NULL; @@ -820,7 +814,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gDungeon->unk181e8.unk18218 = 1; if ((gDungeon->unk10 == 2 || gDungeon->unk10 == 3) && gDungeon->unk6 != 0) { leader = GetLeader(); - PrintFieldMessage(0, gPtrClientFaintedMessage, 1); + DisplayDungeonMessage(0, gPtrClientFaintedMessage, 1); gDungeon->unk6 = 0; sub_8083AB0(0x222, leader, leader); } @@ -1089,7 +1083,7 @@ bool8 sub_8043ED0(bool8 a0) if (EntityExists(leader)) { if (!a0) { strcpy(gAvailablePokemonNames, gDungeon->faintStringBuffer); - PrintFieldMessage(0, gUnknown_80F89B4, 1); + DisplayDungeonMessage(0, gUnknown_80F89B4, 1); } sub_8042B0C(leader); sub_8068FE0(leader, 0x21F, leader); @@ -1101,7 +1095,7 @@ bool8 sub_8043ED0(bool8 a0) if (EntityExists(leader)) { if (!a0) { strcpy(gAvailablePokemonNames, gDungeon->faintStringBuffer); - PrintFieldMessage(0, gUnknown_80F89D4, 1); + DisplayDungeonMessage(0, gUnknown_80F89D4, 1); } sub_8042B0C(leader); sub_8068FE0(leader, 0x222, leader); @@ -1113,7 +1107,7 @@ bool8 sub_8043ED0(bool8 a0) if (EntityExists(leader)) { if (!a0) { strcpy(gAvailablePokemonNames, gDungeon->faintStringBuffer); - PrintFieldMessage(0, gUnknown_80F89D8, 1); + DisplayDungeonMessage(0, gUnknown_80F89D8, 1); } sub_8042B0C(leader); sub_8068FE0(leader, 0x222, leader); diff --git a/src/code_8048480.c b/src/code_8048480.c index 3045ad7b8..985fc2e6e 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -1,7 +1,7 @@ #include "global.h" #include "code_803E668.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_8077274_1.h" #include "code_807CD9C.h" #include "code_808417C.h" @@ -100,22 +100,19 @@ extern void sub_8063CF0(ActionContainer *, u32); extern void sub_8063A70(ActionContainer *, u32); extern u8 sub_8062F90(Entity *, u32, u32, u32, u32); extern void sub_8044DF0(Entity *, u32, u32); -extern s32 sub_8052B8C(u32, u8 *, u32); extern void sub_803EAF0(u32, u32); extern void sub_8044C10(bool8); Entity *DrawFieldGiveItemMenu(u32, u32); -extern void PrintFieldMessage(u32, u8 *, u32); extern void sub_8044E24(Entity *, u32, u32); extern void sub_804245C(Entity *, Item *); extern u8 sub_8072938(Entity *, u16); extern void sub_8072008(Entity *pokemon, Entity *r1, u32 r2, u8 r3, u32); extern void LevelDownTarget(Entity *pokemon, Entity *r1, u32 r2); -extern void sub_80522F4(Entity *pokemon, Entity *r1, const u8[]); extern void sub_806F370(Entity *pokemon, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern s32 sub_8042520(Entity *); Entity *sub_80696FC(Entity *); extern void sub_806A7E8(EntityInfo *, s32); -extern u32 sub_8055640(struct Entity *, struct Entity *, struct Move *, u32, u32); +extern u32 HandleDamagingMove(struct Entity *, struct Entity *, struct Move *, u32, u32); void StunSeedItemAction(Entity *, Entity *); void MaxElixirAction(Entity *, Entity *); @@ -227,7 +224,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity PlaySoundEffect(0x14d); sub_8045BF8(gFormatItems,item); SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FDBB8); // $m0 caught the $i0 + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBB8); // $m0 caught the $i0 info->heldItem = *item; sub_806A6E8(target); return; @@ -240,7 +237,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity } if ((item->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatItems,item); - sub_80522F4(pokemon,target,*gItemStickyDoesntWorkText); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gItemStickyDoesntWorkText); if (param_1 != '\0') { sub_806F370(pokemon,target,gUnknown_80F4FAE,1,&uStack_24,0,0x217,0,0,0); sub_8071DA4(pokemon); @@ -263,7 +260,7 @@ _jump: } else { - sub_80522F4(pokemon,target,*gUnknown_80FE458); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE458); goto _080482B4; } } @@ -467,7 +464,7 @@ _jump: } else { - sub_80522F4(pokemon,target,*gUnknown_80FE458); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE458); } break; } @@ -488,7 +485,7 @@ void sub_80482FC(Entity *pokemon, Entity *target, u32 pp, u8 param_4) InitPokemonMove(&move, MOVE_PROJECTILE); move.PP = pp; - sub_8055640(pokemon, target, &move, 0x100, param_4); + HandleDamagingMove(pokemon, target, &move, 0x100, param_4); } void sub_8048340(Entity *pokemon, Entity *target, u32 r2) @@ -547,7 +544,7 @@ void CheriBerryItemAction(Entity *pokemon, Entity *target) SendNonVolatileEndMessage(pokemon, target); else // Pointer to "But nothing happened!" - sub_80522F4(pokemon, target, *gUnknown_80F89F4); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F89F4); } void PechaBerryItemAction(Entity *pokemon, Entity *target) @@ -556,7 +553,7 @@ void PechaBerryItemAction(Entity *pokemon, Entity *target) SendNonVolatileEndMessage(pokemon, target); else // Pointer to "But nothing happened!" - sub_80522F4(pokemon, target, *gUnknown_80F89F4); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F89F4); } void WarpSeedItemAction(Entity *pokemon, Entity *target) @@ -587,7 +584,7 @@ void StunSeedItemAction(Entity *pokemon, Entity *target) void PlainSeedItemAction(Entity *pokemon, Entity *target) { // Pointer to "But nothing happened!" - sub_80522F4(pokemon, target, *gUnknown_80F89F4); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F89F4); } void DoomSeedItemAction(Entity *pokemon, Entity *target) @@ -603,7 +600,7 @@ void RawstBerryItemAction(Entity *pokemon, Entity *target) { SetMessageArgument(gAvailablePokemonNames, target, 0); // Pointer to "But nothing happened!" - sub_80522F4(pokemon, target, *gUnknown_80FB580); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FB580); } } @@ -617,15 +614,15 @@ void HungerSeedItemAction(Entity *pokemon, Entity * target) entityInfo = target->info; SetMessageArgument(gAvailablePokemonNames, target, 0); if (IQSkillIsEnabled(target, IQ_SELF_CURER)) - sub_80522F4(pokemon, target, *gPtrSelfHealPreventedHungerMessage); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gPtrSelfHealPreventedHungerMessage); else { if (FixedPointToInt(entityInfo->belly) != 0) { entityInfo->belly = IntToFixedPoint(0); - sub_80522F4(pokemon, target, *gUnknown_80F9740); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9740); } else - sub_80522F4(pokemon, target, *gUnknown_80F9760); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9760); } } } @@ -668,17 +665,17 @@ void GinsengItemAction(Entity *pokemon, Entity * target) } if (isMoveBoosted) { - sub_80522F4(pokemon,target,*gUnknown_80FE454); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE454); if (moveBoost != 1) { sub_803E708(10,0x40); - sub_80522F4(pokemon,target,*gUnknown_80FE434); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE434); } } else - sub_80522F4(pokemon,target,*gUnknown_80FE40C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE40C); } else - sub_80522F4(pokemon,target,*gUnknown_80FE40C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE40C); } void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) @@ -694,7 +691,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) entityInfo_1 = entityInfo; if (gDungeon->unk675 != 0) { uVar1 = gUnknown_80F4FA8; - sub_80522F4(pokemon, target, *gUnknown_80FEAE8); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FEAE8); } else { uVar1 = gUnknown_80F4FA4; @@ -710,14 +707,14 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) entity = sub_80696FC(pokemon); if (entity == NULL) { - sub_80522F4(pokemon, target, *gUnknown_80FDBA0); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FDBA0); } else { entityInfo = entity->info; if (gDungeon->unk675 != 0) { uVar1 = gUnknown_80F4FAA; - sub_80522F4(pokemon, target, *gUnknown_80FEAE8); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FEAE8); } else { uVar1 = gUnknown_80F4FA6; @@ -763,7 +760,7 @@ void HandleGummiItemAction(Entity *pokemon, Entity *target, u8 gummiIndex) targetInfo->IQ = 999; } if (baseIQ == targetInfo->IQ) { - sub_80522F4(pokemon,target,*gUnknown_80FD644); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD644); } else { iVar5 = currIQ - baseIQ; @@ -776,8 +773,8 @@ void HandleGummiItemAction(Entity *pokemon, Entity *target, u8 gummiIndex) if (((iVar5 < 9) && (iVar3 = 1, iVar5 < 5)) && (iVar3 = 3, 2 < iVar5)) { iVar3 = 2; } - sub_80522F4(pokemon,target,gUnknown_80FD648[iVar4]); - sub_80522F4(pokemon,target,gUnknown_80FD6E8[iVar3]); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD648[iVar4]); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD6E8[iVar3]); LoadIQSkills(target); sub_806A7E8(targetInfo,baseIQ); } @@ -819,11 +816,11 @@ bool8 sub_8048950(Entity *param_1,Item *item) moveID = GetItemMoveID(item->id); if ((item->flags & ITEM_FLAG_STICKY)) { - PrintFieldMessage(0,*gItemStickyDoesntWorkText,1); + DisplayDungeonMessage(0,*gItemStickyDoesntWorkText,1); return FALSE; } else if (IsHMItem(item->id)) { - PrintFieldMessage(0,*gPtrCantUseInDungeonMessage,1); + DisplayDungeonMessage(0,*gPtrCantUseInDungeonMessage,1); return FALSE; } else @@ -870,13 +867,13 @@ bool8 sub_8048A68(Entity *param_1,Item *item) PokemonStruct2 *pokemon; if ((item->flags & ITEM_FLAG_STICKY)) { - PrintFieldMessage(0,*gItemStickyDoesntWorkText,1); + DisplayDungeonMessage(0,*gItemStickyDoesntWorkText,1); return FALSE; } else { if (gDungeon->unk65C == 0) { - PrintFieldMessage(0,*gUnknown_80F9BD8,1); + DisplayDungeonMessage(0,*gUnknown_80F9BD8,1); return FALSE; } else @@ -946,7 +943,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2) entityInfo = entity->info; actionPointer = &(entityInfo->action); if ((param_2->flags & ITEM_FLAG_STICKY)) { - PrintFieldMessage(0,*gItemStickyDoesntWorkText,1); + DisplayDungeonMessage(0,*gItemStickyDoesntWorkText,1); return FALSE; } else @@ -1011,7 +1008,7 @@ _clear: if (sub_8062F90(entity2,1,0,0,1) != 0) { if (bVar2) { - if (sub_8052B8C(0,*gUnknown_80FECA0,1) == 1) { + if (DisplayDungeonYesNoMessage(0,*gUnknown_80FECA0,1) == 1) { *actionPointer = actionContainer; sub_8044DF0(entity,0,0x6e); SetMonsterActionFields(actionPointer,0x2c); @@ -1039,14 +1036,14 @@ bool8 sub_8048D50(Entity * pokemon, Item *item) if ((item->flags & ITEM_FLAG_STICKY) != 0) { sub_8045BF8(gFormatItems, item); - SendMessage(pokemon,*gItemStickyDoesntWorkText); + TryDisplayDungeonLoggableMessage(pokemon,*gItemStickyDoesntWorkText); return FALSE; } else { if ((entityInfo->muzzled.muzzled == TRUE) && (IsEdibleItem(item->id))) { SetMessageArgument(gAvailablePokemonNames,pokemon,0); - SendMessage(pokemon,*gUnknown_80FDCA4); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FDCA4); return FALSE; } } @@ -1088,27 +1085,27 @@ void GrimyFoodItemAction(Entity *pokemon, Entity * target) void IcePartItemAction(Entity *pokemon, Entity *target, u8 r2) { - SendMessage(pokemon, *gPtrIcePartCrumbledMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrIcePartCrumbledMessage); } void RockPartItemAction(Entity *pokemon, Entity *target, u8 r2) { - SendMessage(pokemon, *gPtrRockPartCrumbledMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrRockPartCrumbledMessage); } void SteelPartItemAction(Entity *pokemon, Entity *target, u8 r2) { - SendMessage(pokemon, *gPtrSteelPartCrumbledMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrSteelPartCrumbledMessage); } void WishStoneItemAction(Entity *pokemon, Entity *target, u8 r2) { - SendMessage(pokemon, *gPtrWishStoneCrumbledMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrWishStoneCrumbledMessage); } void MusicBoxItemAction(Entity *pokemon, Entity *target, u8 r2) { sub_80421C0(pokemon, 0xD6); - SendMessage(pokemon, *gPtrMusicBoxPlayedCrumbledMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrMusicBoxPlayedCrumbledMessage); sub_803E708(0x3C, 0x46); } diff --git a/src/code_80521D0.c b/src/code_80521D0.c deleted file mode 100644 index 4dc39762e..000000000 --- a/src/code_80521D0.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "global.h" -#include "code_80521D0.h" - -extern void sub_80526D0(u8 r0); -extern bool8 sub_8045888(Entity *r0); -extern void sub_80523A8(Entity *r0, const char r1[], u8 r2); -extern u8 sub_8052DC0(Entity *); -extern u8 sub_803F428(Position *); - -void sub_805229C(void) -{ - return sub_80526D0(0x50); -} - -void SendMessage(Entity *pokemon, const char message[]) -{ - if (sub_8045888(pokemon)){ - sub_80523A8(pokemon, message, 1); - } -} - -void sub_80522C8(Entity *r0, const char r1[]) -{ - if (sub_8045888(r0)){ - sub_80523A8(r0, r1, 0); - } -} - -void sub_80522E8(Entity *r0, const char r1[]) -{ - sub_80523A8(r0, r1, 0); -} - -void sub_80522F4(Entity *r0, Entity *r1, const char r2[]) -{ - u8 flag; - flag = sub_8045888(r0) ? TRUE : FALSE; - if(sub_8052DC0(r1) != 0) - { - flag = TRUE; - } - if(flag) - { - sub_80523A8(r0, r2, 1); - } -} - -void sub_805232C(Entity *r0, Entity *r1, const char r2[]) -{ - u8 flag; - flag = sub_8045888(r0) ? TRUE : FALSE; - if(sub_8052DC0(r1) != 0) - { - flag = TRUE; - } - if(flag) - { - sub_80523A8(r0, r2, 0); - } -} - -void sub_8052364(Entity *r0, Position *pos, const char r2[]) -{ - u8 flag; - flag = sub_8045888(r0) ? TRUE : FALSE; - if(sub_803F428(pos) != 0) - { - flag = TRUE; - } - if(flag) - { - sub_80523A8(r0, r2, 1); - } -} - -void sub_805239C(Entity *r0, const char r1[]) -{ - sub_80523A8(r0, r1, 1); -} diff --git a/src/code_8057824_1.c b/src/code_8057824_1.c index abe9ce615..dafdbcd21 100644 --- a/src/code_8057824_1.c +++ b/src/code_8057824_1.c @@ -14,6 +14,7 @@ #include "dungeon_items.h" #include "dungeon_leader.h" #include "dungeon_map_access.h" +#include "dungeon_message.h" #include "dungeon_music.h" #include "dungeon_random.h" #include "dungeon_util_1.h" @@ -37,285 +38,285 @@ extern const s16 gUnknown_80F57D2; extern const s16 gUnknown_80F57D0; extern const s16 gUnknown_80F57CE; -extern const u8 gUnknown_8103D8C[]; -extern const u8 gUnknown_8103D98[]; -extern const u8 gUnknown_8103DD8[]; -extern const u8 gUnknown_8103E28[]; -extern const u8 gUnknown_8103BD8[]; -extern const u8 gUnknown_8103C00[]; -extern const u8 gUnknown_8103C3C[]; -extern const u8 gUnknown_8103C74[]; -extern const u8 gUnknown_8103CC4[]; -extern const u8 gUnknown_8103D0C[]; -extern const u8 gUnknown_8103D50[]; -extern const u8 gRayquazaPostStoryPreFightDialogue_6[]; -extern const u8 gRayquazaPostStoryPreFightDialogue_1[]; -extern const u8 gRayquazaPostStoryPreFightDialogue_2[]; -extern const u8 gRayquazaPostStoryPreFightDialogue_3[]; -extern const u8 gRayquazaPostStoryPreFightDialogue_4[]; -extern const u8 gRayquazaPostStoryPreFightDialogue_5[]; -extern const u8 gRayquazaPreFightDialogue_7[]; -extern const u8 gRayquazaReFightDialogue_1[]; -extern const u8 gRayquazaReFightDialogue_2[]; -extern const u8 gRayquazaReFightDialogue_3[]; -extern const u8 gRayquazaReFightDialogue_4[]; -extern const u8 gRayquazaPreFightDialogue_1[]; -extern const u8 gRayquazaPreFightDialogue_2[]; -extern const u8 gRayquazaPreFightDialogue_3[]; -extern const u8 gRayquazaPreFightDialogue_4[]; -extern const u8 gRayquazaPreFightDialogue_5[]; -extern const u8 gRayquazaPreFightDialogue_6[]; -extern const u8 gRayquazaPreFightDialogue_7[]; -extern const u8 gRayquazaPreFightDialogue_8[]; -extern const u8 gRayquazaPreFightDialogue_9[]; -extern const u8 gRayquazaPreFightDialogue_10[]; -extern const u8 gRayquazaPreFightDialogue_11[]; -extern const u8 MagmaCavernMidDialogue_5[]; -extern const u8 MagmaCavernMidDialogue_6[]; -extern const u8 MagmaCavernMidDialogue_7[]; -extern const u8 MagmaCavernMidDialogue_8[]; -extern const u8 MagmaCavernMidDialogue_9[]; -extern const u8 MagmaCavernMidDialogue_10[]; -extern const u8 MagmaCavernMidDialogue_11[]; -extern const u8 MagmaCavernMidDialogue_12[]; -extern const u8 MagmaCavernMidDialogue_13[]; -extern const u8 MagmaCavernMidDialogue_14[]; -extern const u8 MagmaCavernMidDialogue_15[]; -extern const u8 MagmaCavernMidDialogue_4[]; -extern const u8 MagmaCavernMidDialogue_3[]; -extern const u8 MagmaCavernMidDialogue_2[]; -extern const u8 MagmaCavernMidDialogue_1[]; -extern const u8 gUnknown_8103488[]; -extern const u8 gGroudonPostStoryPreFightDialogue_1[]; -extern const u8 gGroudonPostStoryPreFightDialogue_2[]; -extern const u8 gGroudonPostStoryPreFightDialogue_3[]; -extern const u8 gGroudonPostStoryPreFightDialogue_4[]; -extern const u8 gGroudonReFightDialogue_1[]; -extern const u8 gGroudonReFightDialogue_2[]; -extern const u8 gGroudonReFightDialogue_3[]; -extern const u8 gGroudonReFightDialogue_4[]; -extern const u8 GroudonPreFightDialogue_1[]; -extern const u8 GroudonPreFightDialogue_2[]; -extern const u8 GroudonPreFightDialogue_3[]; -extern const u8 GroudonPreFightDialogue_4[]; -extern const u8 GroudonPreFightDialogue_5[]; -extern const u8 GroudonPreFightDialogue_6[]; -extern const u8 GroudonPreFightDialogue_7[]; -extern const u8 GroudonPreFightDialogue_8[]; -extern const u8 GroudonPreFightDialogue_9[]; -extern const u8 GroudonPreFightDialogue_10[]; -extern const u8 GroudonPreFightDialogue_11[]; -extern const u8 GroudonPreFightDialogue_12[]; -extern const u8 GroudonPreFightDialogue_13[]; -extern const u8 GroudonPreFightDialogue_14[]; -extern const u8 gUnknown_8102B10[]; -extern const u8 gRegisteelPostFightDialogue_2[]; -extern const u8 gRegicePostFightDialogue_2[]; -extern const u8 gRegirockPostFightDialogue_2[]; -extern const u8 gRegisteelPostFightDialogue_1[]; -extern const u8 gRegicePostFightDialogue_1[]; -extern const u8 gRegirockPostFightDialogue_1[]; -extern const u8 gUnknown_810554C[]; -extern const u8 gUnknown_8105558[]; -extern const u8 gUnknown_81055F4[]; -extern const u8 gRegicePreFightDialogue_1[]; -extern const u8 gRegirockPreFightDialogue_1[]; -extern const u8 gSuicuneReFightDialogue_1[]; -extern const u8 gSuicuneReFightDialogue_2[]; -extern const u8 gSuicuneReFightDialogue_3[]; -extern const u8 gRegisteelPreFightDialogue_1[]; -extern const u8 gJirachiPreFightDialogue_1[]; -extern const u8 gJirachiPreFightDialogue_2[]; -extern const u8 gJirachiPreFightDialogue_3[]; -extern const u8 gJirachiPreFightDialogue_4[]; -extern const u8 gLatiosReFightDialogue_1[]; -extern const u8 gLatiosPreFightDialogue_2[]; -extern const u8 gLatiosPreFightDialogue_3[]; -extern const u8 gLatiosPreFightDialogue_1[]; -extern const u8 HoOhReFightDialogue_1[]; -extern const u8 HoOhReFightDialogue_2[]; -extern const u8 HoOhReFightDialogue_3[]; -extern const u8 HoOhReFightDialogue_4[]; -extern const u8 HoOhReFightDialogue_5[]; -extern const u8 gHoOhPreFightDialogue_1[]; -extern const u8 gHoOhPreFightDialogue_2[]; -extern const u8 gHoOhPreFightDialogue_3[]; -extern const u8 gHoOhPreFightDialogue_4[]; -extern const u8 gHoOhPreFightDialogue_5[]; -extern const u8 gHoOhPreFightDialogue_6[]; -extern const u8 gSuicunePostStoryPreFightDialogue_4[]; -extern const u8 gSuicunePostStoryPreFightDialogue_1[]; -extern const u8 gSuicunePostStoryPreFightDialogue_2[]; -extern const u8 gSuicunePostStoryPreFightDialogue_3[]; -extern const u8 gSuicunePreFightDialogue_1[]; -extern const u8 gSuicunePreFightDialogue_2[]; -extern const u8 gSuicunePreFightDialogue_3[]; -extern const u8 gSuicunePreFightDialogue_4[]; -extern const u8 gSuicunePreFightDialogue_5[]; -extern const u8 gSuicunePreFightDialogue_6[]; -extern const u8 gSuicunePreFightDialogue_7[]; -extern const u8 gRaikouPostStoryPreFightDialogue_3[]; -extern const u8 gRaikouPostStoryPreFightDialogue_4[]; -extern const u8 gRaikouPostStoryPreFightDialogue_1[]; -extern const u8 gRaikouPostStoryPreFightDialogue_2[]; -extern const u8 gRaikouReFightDialogue_1[]; -extern const u8 gRaikouReFightDialogue_2[]; -extern const u8 gRaikouReFightDialogue_3[]; -extern const u8 gRaikouPreFightDialogue_1[]; -extern const u8 gRaikouPreFightDialogue_2[]; -extern const u8 gRaikouPreFightDialogue_3[]; -extern const u8 gRaikouPreFightDialogue_4[]; -extern const u8 gRaikouPreFightDialogue_5[]; -extern const u8 gRaikouPreFightDialogue_6[]; -extern const u8 gEnteiPostStoryPreFightDialogue_4[]; -extern const u8 gEnteiPostStoryPreFightDialogue_1[]; -extern const u8 gEnteiPostStoryPreFightDialogue_2[]; -extern const u8 gEnteiPostStoryPreFightDialogue_3[]; -extern const u8 gEnteiReFightDialogue_1[]; -extern const u8 gEnteiReFightDialogue_2[]; -extern const u8 gEnteiReFightDialogue_3[]; -extern const u8 gUnknown_8104FC8[]; -extern const u8 gEnteiPreFightDialogue_1[]; -extern const u8 gEnteiPreFightDialogue_2[]; -extern const u8 gEnteiPreFightDialogue_3[]; -extern const u8 gMewtwoReFightDialogue_5[]; -extern const u8 gMewtwoReFightDialogue_4[]; -extern const u8 gMewtwoReFightDialogue_3[]; -extern const u8 gMewtwoReFightDialogue_2[]; -extern const u8 gMewtwoReFightDialogue_1[]; -extern const u8 gMewtwoPreFightDialogue_5[]; -extern const u8 gMewtwoPreFightDialogue_1[]; -extern const u8 gMewtwoPreFightDialogue_2[]; -extern const u8 gMewtwoPreFightDialogue_3[]; -extern const u8 gMewtwoPreFightDialogue_4[]; -extern const u8 gUnknown_8103E34[]; -extern const u8 gUnknown_8102A9C[]; -extern const u8 gArticunoPostStoryPreFightDialogue_1[]; -extern const u8 gArticunoPostStoryPreFightDialogue_2[]; -extern const u8 gArticunoPostStoryPreFightDialogue_3[]; -extern const u8 gArticunoPostStoryPreFightDialogue_4[]; -extern const u8 gArticunoPostStoryPreFightDialogue_5[]; -extern const u8 gArticunoReFightDialogue_1[]; -extern const u8 gArticunoReFightDialogue_2[]; -extern const u8 gArticunoReFightDialogue_3[]; -extern const u8 gArticunoPreFightDialogue_1[]; -extern const u8 gArticunoPreFightDialogue_2[]; -extern const u8 gArticunoPreFightDialogue_3[]; -extern const u8 gArticunoPreFightDialogue_4[]; -extern const u8 gArticunoPreFightDialogue_5[]; -extern const u8 gArticunoPreFightDialogue_6[]; -extern const u8 gArticunoPreFightDialogue_7[]; -extern const u8 gArticunoPreFightDialogue_8[]; -extern const u8 gArticunoPreFightDialogue_9[]; -extern const u8 gArticunoPreFightDialogue_10[]; -extern const u8 gArticunoPreFightDialogue_11[]; -extern const u8 gArticunoPreFightDialogue_12[]; -extern const u8 gMoltresPostStoryPreFightDialogue_1[]; -extern const u8 gMoltresPostStoryPreFightDialogue_2[]; -extern const u8 gMoltresPostStoryPreFightDialogue_3[]; -extern const u8 gMoltresPostStoryPreFightDialogue_4[]; -extern const u8 gMoltresPostStoryPreFightDialogue_5[]; -extern const u8 gUnknown_8100D3C[]; -extern const u8 gMoltresReFightDialogue_1[]; -extern const u8 gMoltresReFightDialogue_2[]; -extern const u8 gMoltresReFightDialogue_3[]; -extern const u8 gMoltresReFightDialogue_4[]; -extern const u8 gMoltresReFightDialogue_5[]; -extern const u8 gMoltresPreFightDialogue_1[]; -extern const u8 gMoltresPreFightDialogue_2[]; -extern const u8 gMoltresPreFightDialogue_3[]; -extern const u8 gMoltresPreFightDialogue_4[]; -extern const u8 gMoltresPreFightDialogue_5[]; -extern const u8 gMoltresPreFightDialogue_6[]; -extern const u8 gMoltresPreFightDialogue_7[]; -extern const u8 gMoltresPreFightDialogue_8[]; -extern const u8 gMoltresPreFightDialogue_9[]; -extern const u8 gMoltresPreFightDialogue_10[]; -extern const u8 gMoltresPreFightDialogue_11[]; -extern const u8 gMoltresPreFightDialogue_12[]; -extern const u8 gZapdosPostStoryPreFightDialogue_1[]; -extern const u8 gZapdosPostStoryPreFightDialogue_2[]; -extern const u8 gZapdosPostStoryPreFightDialogue_3[]; -extern const u8 gZapdosPostStoryPreFightDialogue_4[]; -extern const u8 gZapdosPostStoryPreFightDialogue_5[]; -extern const u8 gZapdosPostStoryPreFightDialogue_6[]; -extern const u8 gUnknown_8105668[]; -extern const u8 gUnknown_8105674[]; -extern const u8 gUnknown_81056B8[]; -extern const u8 gUnknown_81056DC[]; -extern const u8 gUnknown_810579C[]; -extern const u8 gUnknown_8105974[]; -extern const u8 gUnknown_810581C[]; +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 struct DungeonDialogueStruct GroudonPreFightDialogue_1; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_2; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_3; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_4; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_5; +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 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_1; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_2; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_3; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_4; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_5; +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 u8 gUnknown_8105BF4[]; -extern const u8 gUnknown_8105D2C[]; -extern const u8 gUnknown_8105D80[]; -extern const u8 gUnknown_8105D9C[]; -extern const u8 gUnknown_81058E0[]; -extern const u8 gUnknown_810593C[]; -extern const u8 gUnknown_8105A08[]; -extern const u8 gUnknown_8105AD4[]; -extern const u8 gUnknown_8105B20[]; -extern const u8 gUnknown_8105B68[]; -extern const u8 gUnknown_8105BA8[]; -extern const u8 *gUnknown_8105798[]; -extern const u8 gJirachiReFightDialogue_1[]; +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 u8 gKyogrePreFightDialogue_8[]; -extern const u8 gKyogrePreFightDialogue_1[]; -extern const u8 gKyogrePreFightDialogue_2[]; -extern const u8 gKyogrePreFightDialogue_3[]; -extern const u8 gKyogrePreFightDialogue_4[]; -extern const u8 gKyogrePreFightDialogue_5[]; -extern const u8 gKyogrePreFightDialogue_6[]; -extern const u8 gKyogrePreFightDialogue_7[]; -extern const u8 gUnknown_810697C[]; +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 u8 gMedichamRescueDialogue_1[]; -extern const u8 gMedichamRescueDialogue_2[]; -extern const u8 gMedichamRescueDialogue_3[]; -extern const u8 gMedichamRescueDialogue_4[]; -extern const u8 gSmeargleRescueDialogue_1[]; -extern const u8 gSmeargleRescueDialogue_2[]; -extern const u8 gSmeargleRescueDialogue_3[]; -extern const u8 gSmeargleRescueDialogue_4[]; -extern const u8 gUnknown_8106720[]; +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 u8 gCelebiJoinDialogue_10[]; -extern const u8 gCelebiJoinDialogue_1[]; -extern const u8 gCelebiJoinDialogue_2[]; -extern const u8 gCelebiJoinDialogue_3[]; -extern const u8 gCelebiJoinDialogue_4[]; -extern const u8 gCelebiJoinDialogue_5[]; -extern const u8 gCelebiJoinDialogue_6[]; -extern const u8 gCelebiJoinDialogue_7[]; -extern const u8 gCelebiJoinDialogue_8[]; -extern const u8 gCelebiJoinDialogue_9[]; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_10; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_1; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_2; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_3; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_4; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_5; +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 u8 gPurityForestAllowCelebiToJoinPrompt; +extern const struct MenuItem gPurityForestAllowCelebiToJoinPrompt[]; extern const u8 *const gPtrPurityForestRefuseCelebiConfirmText; -extern const u8 gPurityForestRefuseCelebiConfirmPrompt; -extern const u8 gDeoxysPreFightDialogue_1[]; -extern const u8 gDeoxysPreFightDialogue_2[]; -extern const u8 gDeoxysPreFightDialogue_3[]; -extern const u8 gDeoxysPreFightDialogue_4[]; -extern const u8 gDeoxysPreFightDialogue_5[]; -extern const u8 gLugiaPreFightDialogue_8[]; -extern const u8 gLugiaPreFightDialogue_1[]; -extern const u8 gLugiaPreFightDialogue_2[]; -extern const u8 gLugiaPreFightDialogue_3[]; -extern const u8 gLugiaPreFightDialogue_4[]; -extern const u8 gLugiaPreFightDialogue_5[]; -extern const u8 gLugiaPreFightDialogue_6[]; -extern const u8 gLugiaPreFightDialogue_7[]; -extern const u8 gZapdosReFightDialogue_1[]; -extern const u8 gUnknown_81015A0[]; -extern const u8 gZapdosReFightDialogue_2[]; -extern const u8 gZapdosReFightDialogue_3[]; -extern const u8 gZapdosReFightDialogue_4[]; +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 gLugiaPreFightDialogue_1; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_2; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_3; +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 gUnknown_81015A0; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_2; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_3; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_4; -extern const u8 gUnknown_81058C4[]; -extern const u8 gUnknown_81058A8[]; +extern const struct DungeonDialogueStruct gUnknown_81058C4; +extern const struct DungeonDialogueStruct gUnknown_81058A8; extern const u8 gUnknown_81074FC[]; @@ -362,7 +363,6 @@ extern void sub_806BFC0(EntityInfo *, u32); extern void sub_808BBA8(Entity * ); extern void sub_8041888(u32); -extern void DisplayDungeonDialogue(const u8 *r0); extern u32 sub_80861F8(u32, Entity *, u32); @@ -432,7 +432,6 @@ void MoltresScreenDarken(void); void ZapdosDropInEffect(Entity *param_1); void ZapdosScreenFlash(int param_1); -extern s32 sub_8052C68(u32, const u8 *, const u8 *, u32); extern void sub_8045C28(Item *, u8 , u8 *); extern void EnableJirachiWishWarpTile(void); extern void sub_808BB3C(Position *); @@ -450,18 +449,18 @@ void ZapdosReFightDialogue(void) ZapdosEntity = GetEntityFromClientType(8); sub_8086448(); sub_803E708(10,0x46); - DisplayDungeonDialogue(gZapdosReFightDialogue_1); + DisplayDungeonDialogue(&gZapdosReFightDialogue_1); sub_803E708(10,0x46); PlaySoundEffect(0x1da); - DisplayDungeonDialogue(gUnknown_81015A0); + DisplayDungeonDialogue(&gUnknown_81015A0); sub_803E708(10,0x46); ZapdosDropInEffect(ZapdosEntity); sub_803E708(10,0x46); - DisplayDungeonDialogue(gZapdosReFightDialogue_2); + DisplayDungeonDialogue(&gZapdosReFightDialogue_2); ZapdosScreenFlash(1); - DisplayDungeonDialogue(gZapdosReFightDialogue_3); + DisplayDungeonDialogue(&gZapdosReFightDialogue_3); ZapdosScreenFlash(2); - DisplayDungeonDialogue(gZapdosReFightDialogue_4); + DisplayDungeonDialogue(&gZapdosReFightDialogue_4); SetupBossFightHP(ZapdosEntity,300,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); } @@ -475,20 +474,20 @@ void ZapdosPostStoryPreFightDialogue(void) ZapdosEntity = GetEntityFromClientType(8); sub_8086448(); if (sub_8086AE4(MONSTER_ZAPDOS)) { - sub_80866C4(gZapdosPostStoryPreFightDialogue_6); + sub_80866C4(&gZapdosPostStoryPreFightDialogue_6); } else { ZapdosScreenFlash(1); PlaySoundEffect(0x1da); - DisplayDungeonDialogue(gZapdosPostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_1); ZapdosDropInEffect(ZapdosEntity); - DisplayDungeonDialogue(gZapdosPostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_2); ZapdosScreenFlash(1); - DisplayDungeonDialogue(gZapdosPostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_3); ZapdosScreenFlash(2); - DisplayDungeonDialogue(gZapdosPostStoryPreFightDialogue_4); + DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_4); ZapdosScreenFlash(2); - DisplayDungeonDialogue(gZapdosPostStoryPreFightDialogue_5); + DisplayDungeonDialogue(&gZapdosPostStoryPreFightDialogue_5); sub_803E708(10,0x46); SetupBossFightHP(ZapdosEntity,300,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -611,25 +610,25 @@ void MoltresPreFightDialogue(void) MoltresScreenFlash1(0xc,5); sub_8086500(); sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresPreFightDialogue_1); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_1); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,5); sub_803E708(4,0x46); SpriteLookAroundEffect(PartnerEntity); sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresPreFightDialogue_2); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_2); sub_803E708(10,0x46); MoltresScreenFlash1(0xc,5); MoltresScreenFlash2(9,5); - DisplayDungeonDialogue(gMoltresPreFightDialogue_3); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_3); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,2); sub_80869E4(LeaderEntity,4,2,6); - DisplayDungeonDialogue(gMoltresPreFightDialogue_4); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_4); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,2,6); sub_8086690(); - DisplayDungeonDialogue(gMoltresPreFightDialogue_5); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_5); sub_803E708(10,0x46); sub_8085930(DIRECTION_NORTHWEST); sub_803E708(4,0x46); @@ -637,32 +636,32 @@ void MoltresPreFightDialogue(void) PlaySoundEffect(0x2f2); DungeonStopBGM(); MoltresScreenDarken(); - DisplayDungeonDialogue(gMoltresPreFightDialogue_6); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_6); sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresPreFightDialogue_7); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_7); sub_803E708(10,0x46); PlaySoundEffect(0x1cf); sub_80856E0(PartnerEntity, DIRECTION_NORTH); sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresPreFightDialogue_8); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_8); sub_803E708(10,0x46); MoltresScreenFlash3(); PlaySoundEffect(0x1da); - DisplayDungeonDialogue(gMoltresPreFightDialogue_9); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_9); sub_803E708(10,0x46); MoltresScreenFlash1(9,5); MoltresScreenFlash2(0xb,5); - DisplayDungeonDialogue(gMoltresPreFightDialogue_10); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_10); sub_803E708(10,0x46); MoltresScreenFlash1(0xc,5); MoltresScreenFlash2(9,5); MoltresDropInEffect(MoltresEntity); sub_808663C(); MoltresScreenFlash3(); - DisplayDungeonDialogue(gMoltresPreFightDialogue_11); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_11); sub_803E708(10,0x46); MoltresScreenFlash2(0xb,6); - DisplayDungeonDialogue(gMoltresPreFightDialogue_12); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_12); sub_803E708(10,0x46); SetupBossFightHP(MoltresEntity,400,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -683,11 +682,11 @@ void MoltresReFightDialogue(void) sub_803E708(10,0x46); SpriteLookAroundEffect(PartnerEntity); sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresReFightDialogue_1); + DisplayDungeonDialogue(&gMoltresReFightDialogue_1); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,2); sub_80869E4(LeaderEntity,4,2,6); - DisplayDungeonDialogue(gMoltresReFightDialogue_2); + DisplayDungeonDialogue(&gMoltresReFightDialogue_2); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,2,6); sub_80869E4(LeaderEntity,4,2,6); @@ -700,12 +699,12 @@ void MoltresReFightDialogue(void) MoltresDropInEffect(MoltresEntity); sub_808663C(); MoltresScreenFlash3(); - DisplayDungeonDialogue(gMoltresReFightDialogue_3); + DisplayDungeonDialogue(&gMoltresReFightDialogue_3); sub_803E708(10,0x46); MoltresScreenFlash2(0xb,6); - DisplayDungeonDialogue(gMoltresReFightDialogue_4); + DisplayDungeonDialogue(&gMoltresReFightDialogue_4); sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresReFightDialogue_5); + DisplayDungeonDialogue(&gMoltresReFightDialogue_5); sub_803E708(10,0x46); SetupBossFightHP(MoltresEntity,400,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -726,24 +725,24 @@ void MoltresPostStoryPreFightDialogue(void) sub_8085930(DIRECTION_NORTH); sub_803E708(4,0x46); sub_803E708(10,0x46); - DisplayDungeonDialogue(gUnknown_8100D3C); + DisplayDungeonDialogue(&gUnknown_8100D3C); sub_803E708(10,0x46); gDungeon->unk2 = 1; } else { - DisplayDungeonDialogue(gMoltresPostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_1); sub_8085930(DIRECTION_NORTHWEST); sub_803E708(4,0x46); sub_8085930(DIRECTION_NORTH); MoltresDropInEffect(MoltresEntity); - DisplayDungeonDialogue(gMoltresPostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_2); MoltresScreenFlash1(0xc,5); MoltresScreenFlash2(9,5); - DisplayDungeonDialogue(gMoltresPostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_3); MoltresScreenFlash3(); - DisplayDungeonDialogue(gMoltresPostStoryPreFightDialogue_4); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_4); MoltresScreenFlash2(0xb,6); - DisplayDungeonDialogue(gMoltresPostStoryPreFightDialogue_5); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_5); sub_803E708(10,0x46); SetupBossFightHP(MoltresEntity,400,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -1027,15 +1026,15 @@ void ArticunoPreFightDialogue(void) ArticunoEntity = GetEntityFromClientType(0xd); sub_8086448(); SpriteLookAroundEffect(PartnerEntity); - DisplayDungeonDialogue(gArticunoPreFightDialogue_1); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_1); sub_803E708(10,0x46); sub_8086598(); DungeonStopBGM(); - DisplayDungeonDialogue(gArticunoPreFightDialogue_2); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_2); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,2); sub_80869E4(LeaderEntity,4,2,6); - DisplayDungeonDialogue(gArticunoPreFightDialogue_3); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_3); sub_803E708(10,0x46); SetFacingDirection(LeaderEntity, DIRECTION_WEST); sub_803E708(4,0x46); @@ -1051,9 +1050,9 @@ void ArticunoPreFightDialogue(void) sub_803E708(4,0x46); SetFacingDirection(LeaderEntity, DIRECTION_WEST); sub_803E708(10,0x46); - DisplayDungeonDialogue(gArticunoPreFightDialogue_4); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_4); sub_803E708(10,0x46); - DisplayDungeonDialogue(gArticunoPreFightDialogue_5); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_5); sub_803E708(10,0x46); sub_80869E4(LeaderEntity,4,1,4); sub_80869E4(PartnerEntity,4,2,4); @@ -1061,33 +1060,33 @@ void ArticunoPreFightDialogue(void) SpriteLookAroundEffect(PartnerEntity); PlaySoundEffect(0x1d5); SpriteLookAroundEffect(LeaderEntity); - DisplayDungeonDialogue(gArticunoPreFightDialogue_6); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_6); sub_803E708(10,0x46); - DisplayDungeonDialogue(gArticunoPreFightDialogue_7); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_7); sub_803E708(10,0x46); PlaySoundEffect(0); // snow flurry gDungeon->weather.unkE265 = WEATHER_SNOW; sub_807EAA0(0,1); PlaySoundEffect(0x1ee); // flash effect? sub_8088574(); - DisplayDungeonDialogue(gArticunoPreFightDialogue_8); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_8); sub_803E708(10,0x46); ArticunoScreenFlash(); sub_8086738(); PlaySoundEffect(0x1da); - DisplayDungeonDialogue(gArticunoPreFightDialogue_9); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_9); sub_803E708(10,0x46); PlaySoundEffect(0x1ea); sub_8088484(ArticunoEntity); sub_80865E8(); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoPreFightDialogue_10); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_10); sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoPreFightDialogue_11); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_11); sub_806CDD4(ArticunoEntity,0x10,DIRECTION_SOUTH); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoPreFightDialogue_12); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_12); sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); sub_803E708(0x10,0x46); SetupBossFightHP(ArticunoEntity,0x1c2,MUS_BOSS_BATTLE); @@ -1104,12 +1103,12 @@ void ArticunoReFightDialogue(void) gDungeon->weather.unkE265 = WEATHER_SNOW; sub_807EAA0(0,1); sub_803E708(10,0x46); - DisplayDungeonDialogue(gArticunoReFightDialogue_1); + DisplayDungeonDialogue(&gArticunoReFightDialogue_1); sub_806CDD4(ArticunoEntity,0x10,DIRECTION_SOUTH); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoReFightDialogue_2); + DisplayDungeonDialogue(&gArticunoReFightDialogue_2); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoReFightDialogue_3); + DisplayDungeonDialogue(&gArticunoReFightDialogue_3); sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); sub_803E708(0x28,0x46); SetupBossFightHP(ArticunoEntity,0x1c2,MUS_BOSS_BATTLE); @@ -1125,7 +1124,7 @@ void ArticunoPostStoryPreFightDialogue(void) ArticunoEntity = GetEntityFromClientType(0xd); sub_8086448(); if (sub_8086AE4(MONSTER_ARTICUNO)) { - sub_80866C4(gUnknown_8102A9C); + sub_80866C4(&gUnknown_8102A9C); } else { gDungeon->weather.unkE265 = WEATHER_SNOW; @@ -1133,19 +1132,19 @@ void ArticunoPostStoryPreFightDialogue(void) ArticunoScreenFlash(); sub_8086738(); PlaySoundEffect(0x1da); - DisplayDungeonDialogue(gArticunoPostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_1); sub_803E708(10,0x46); sub_8088484(ArticunoEntity); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoPostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_2); sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoPostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_3); sub_806CDD4(ArticunoEntity,0x10,DIRECTION_SOUTH); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoPostStoryPreFightDialogue_4); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_4); ArticunoScreenFlash(); - DisplayDungeonDialogue(gArticunoPostStoryPreFightDialogue_5); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_5); sub_806CDD4(ArticunoEntity,0xf,DIRECTION_SOUTH); sub_803E708(0x28,0x46); SetupBossFightHP(ArticunoEntity,0x1c2,MUS_BOSS_BATTLE); @@ -1238,7 +1237,7 @@ void sub_8088618(void) // The mountain's summit... // But there is no one here // It's time to go back - sub_80866C4(gUnknown_8102B10); + sub_80866C4(&gUnknown_8102B10); } void sub_808862C(void) @@ -1345,31 +1344,31 @@ void GroudonPreFightDialogue(void) AlakazamEntity = GetEntityFromClientType(10); GroudonEntity = GetEntityFromClientType(0xe); sub_8086448(); - DisplayDungeonDialogue(GroudonPreFightDialogue_1); + DisplayDungeonDialogue(&GroudonPreFightDialogue_1); sub_803E708(10,0x46); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_2); + DisplayDungeonDialogue(&GroudonPreFightDialogue_2); sub_803E708(10,0x46); sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); sub_808682C(); sub_803E708(0x1e,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_3); + DisplayDungeonDialogue(&GroudonPreFightDialogue_3); sub_803E708(10,0x46); sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_4); + DisplayDungeonDialogue(&GroudonPreFightDialogue_4); sub_803E708(10,0x46); GroudonScreenFlash(); - DisplayDungeonDialogue(GroudonPreFightDialogue_5); + DisplayDungeonDialogue(&GroudonPreFightDialogue_5); sub_803E708(10,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_6); + DisplayDungeonDialogue(&GroudonPreFightDialogue_6); sub_803E708(10,0x46); PlaySoundEffect(0x1d5); SpriteLookAroundEffect(PartnerEntity); - DisplayDungeonDialogue(GroudonPreFightDialogue_7); + DisplayDungeonDialogue(&GroudonPreFightDialogue_7); sub_803E708(10,0x46); sub_808682C(); sub_803E708(0x3c,0x46); @@ -1377,28 +1376,28 @@ void GroudonPreFightDialogue(void) PlaySoundEffect(0x205); sub_8086738(); sub_8068FE0(AlakazamEntity,0x21c,0); - DisplayDungeonDialogue(GroudonPreFightDialogue_8); + DisplayDungeonDialogue(&GroudonPreFightDialogue_8); sub_803E708(10,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_9); + DisplayDungeonDialogue(&GroudonPreFightDialogue_9); sub_803E708(10,0x46); sub_8085930(DIRECTION_NORTH); sub_8086764(); sub_803E708(0x28,0x46); PlaySoundEffect(0x1d5); SpriteLookAroundEffect(PartnerEntity); - DisplayDungeonDialogue(GroudonPreFightDialogue_10); + DisplayDungeonDialogue(&GroudonPreFightDialogue_10); sub_803E708(10,0x46); sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_11); + DisplayDungeonDialogue(&GroudonPreFightDialogue_11); sub_803E708(10,0x46); DungeonStopBGM(); GroudonScreenFlash2(); sub_803E708(0x1e,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_12); + DisplayDungeonDialogue(&GroudonPreFightDialogue_12); sub_803E708(10,0x46); - DisplayDungeonDialogue(GroudonPreFightDialogue_13); + DisplayDungeonDialogue(&GroudonPreFightDialogue_13); sub_803E708(10,0x46); sub_803E708(0x1e,0x46); sub_808682C(); @@ -1406,7 +1405,7 @@ void GroudonPreFightDialogue(void) PlaySoundEffect(0x1fa); sub_8086738(); sub_8085930(DIRECTION_NORTH); - DisplayDungeonDialogue(GroudonPreFightDialogue_14); + DisplayDungeonDialogue(&GroudonPreFightDialogue_14); sub_803E708(10,0x46); sub_8086A54(GroudonEntity); sub_8085930(DIRECTION_NORTH); @@ -1425,20 +1424,20 @@ void GroudonReFightDialogue(void) sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(gGroudonReFightDialogue_1); + DisplayDungeonDialogue(&gGroudonReFightDialogue_1); sub_803E708(10,0x46); GroudonScreenFlash(); sub_803E708(0x1e,0x46); - DisplayDungeonDialogue(gGroudonReFightDialogue_2); + DisplayDungeonDialogue(&gGroudonReFightDialogue_2); sub_803E708(10,0x46); - DisplayDungeonDialogue(gGroudonReFightDialogue_3); + DisplayDungeonDialogue(&gGroudonReFightDialogue_3); sub_803E708(10,0x46); sub_808682C(); sub_803E708(0x3c,0x46); DungeonStopBGM(); PlaySoundEffect(0x1fa); sub_8086738(); - DisplayDungeonDialogue(gGroudonReFightDialogue_4); + DisplayDungeonDialogue(&gGroudonReFightDialogue_4); sub_803E708(10,0x46); sub_8086A54(GroudonEntity); sub_8085930(DIRECTION_NORTH); @@ -1456,20 +1455,20 @@ void GroudonPostStoryPreFightDialogue(void) GroudonEntity = GetEntityFromClientType(0xe); sub_8086448(); if (sub_8086AE4(MONSTER_GROUDON)) { - sub_80866C4(gUnknown_8103488); + sub_80866C4(&gUnknown_8103488); } else{ - DisplayDungeonDialogue(gGroudonPostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gGroudonPostStoryPreFightDialogue_1); sub_803E708(10,0x46); SceneGroudonMovement(GroudonEntity); SceneGroudonMovement(GroudonEntity); - DisplayDungeonDialogue(gGroudonPostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gGroudonPostStoryPreFightDialogue_2); PlaySoundEffect(0x1f6); GroudonScreenFlash(); - DisplayDungeonDialogue(gGroudonPostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gGroudonPostStoryPreFightDialogue_3); PlaySoundEffect(0x1f6); GroudonScreenFlash(); - DisplayDungeonDialogue(gGroudonPostStoryPreFightDialogue_4); + DisplayDungeonDialogue(&gGroudonPostStoryPreFightDialogue_4); sub_803E708(10,0x46); SetupBossFightHP(GroudonEntity,500,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -1627,7 +1626,7 @@ void MagmaCavernMidDialogue(void) SpriteLookAroundEffect(PartnerEntity); // Let's see.. // I wonder where we are? - DisplayDungeonDialogue(MagmaCavernMidDialogue_1); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_1); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,2); sub_80869E4(LeaderEntity,4,2,6); @@ -1636,7 +1635,7 @@ void MagmaCavernMidDialogue(void) // // I'm certain we've come quite // far already.. - DisplayDungeonDialogue(MagmaCavernMidDialogue_2); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_2); sub_803E708(10,0x46); DungeonStopBGM(); sub_80855E4(sub_80868F4); @@ -1645,7 +1644,7 @@ void MagmaCavernMidDialogue(void) sub_803E708(0x28,0x46); // Waaah! // Qu-quake! - DisplayDungeonDialogue(MagmaCavernMidDialogue_3); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_3); sub_803E708(0x78,0x46); StopSoundEffect(0x1c5); sub_808682C(); @@ -1658,7 +1657,7 @@ void MagmaCavernMidDialogue(void) // // Whew // It's over. - DisplayDungeonDialogue(MagmaCavernMidDialogue_4); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_4); sub_803E708(10,0x46); PlaySoundEffect(0x1d5); SpriteLookAroundEffect(PartnerEntity); @@ -1666,7 +1665,7 @@ void MagmaCavernMidDialogue(void) sub_80856E0(PartnerEntity, DIRECTION_NORTH); // Hey! {POKEMON_0}! // Over there! - DisplayDungeonDialogue(MagmaCavernMidDialogue_5); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_5); iVar3->info->unk15E = 0; iVar4->info->unk15E =0; local_20.x = (iVar3->pixelPos.x + iVar4->pixelPos.x) / 2; @@ -1679,29 +1678,29 @@ void MagmaCavernMidDialogue(void) // // Hey! // Snap out of it! - DisplayDungeonDialogue(MagmaCavernMidDialogue_6); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_6); sub_803E708(10,0x46); // Urrrrgh... - DisplayDungeonDialogue(MagmaCavernMidDialogue_7); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_7); sub_803E708(10,0x46); sub_80869E4(LeaderEntity,4,2,5); // What happened to you? // // What happened here? - DisplayDungeonDialogue(MagmaCavernMidDialogue_8); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_8); sub_803E708(10,0x46); // We challenged.. // {POKEMON_2}... // And wiped out.. - DisplayDungeonDialogue(MagmaCavernMidDialogue_9); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_9); sub_803E708(10,0x46); - DisplayDungeonDialogue(MagmaCavernMidDialogue_10); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_10); sub_803E708(10,0x46); sub_80869E4(LeaderEntity,4,1,3); sub_80869E4(PartnerEntity,4,1,3); // Grrgh.. // We... It crushed us - DisplayDungeonDialogue(MagmaCavernMidDialogue_11); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_11); sub_803E708(10,0x46); PlaySoundEffect(0x1d5); SpriteLookAroundEffect(PartnerEntity); @@ -1712,20 +1711,20 @@ void MagmaCavernMidDialogue(void) // Wait... // What about {POKEMON_3}? // Where did {POKEMON_3} go? - DisplayDungeonDialogue(MagmaCavernMidDialogue_12); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_12); sub_803E708(0x1e,0x46); // {POKEMON_3} is... // Still battling {POKEMON_2}... - DisplayDungeonDialogue(MagmaCavernMidDialogue_13); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_13); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,2); sub_80869E4(LeaderEntity,4,2,6); // {POKEMON_0}! // We've got to hurry! - DisplayDungeonDialogue(MagmaCavernMidDialogue_14); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_14); sub_8089294(); // Be careful! - DisplayDungeonDialogue(MagmaCavernMidDialogue_15); + DisplayDungeonDialogue(&MagmaCavernMidDialogue_15); sub_803E708(10,0x46); gDungeon->unk2 = 1; } @@ -1886,33 +1885,33 @@ void RayquazaPreFightDialogue(void) PartnerEntity = GetPartnerEntity(); RayquazaEntity = GetEntityFromClientType(0xf); sub_8086448(); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_1); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_1); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_2); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_2); sub_80856E0(PartnerEntity, DIRECTION_NORTH); SpriteLookAroundEffect(PartnerEntity); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,2); sub_80869E4(LeaderEntity,4,2,6); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_3); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_3); sub_80869E4(PartnerEntity,4,2,4); sub_80869E4(LeaderEntity,4,1,4); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_4); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_4); sub_803E708(10,0x46); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_5); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_5); sub_803E708(10,0x46); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_6); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_6); RayquazaScreenFlash(); PlaySoundEffect(0x1da); // Rayquaza Cry - DisplayDungeonDialogue(gRayquazaPreFightDialogue_7); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_7); RayquazaDropInEffect(RayquazaEntity); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_8); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_8); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_9); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_9); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_10); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_10); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaPreFightDialogue_11); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_11); SetupBossFightHP(RayquazaEntity,600,MUS_BATTLE_WITH_RAYQUAZA); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); } @@ -1927,16 +1926,16 @@ void RayquazaReFightDialogue(void) sub_8086448(); RayquazaScreenFlash(); PlaySoundEffect(0x1da); // Rayquaza Cry - DisplayDungeonDialogue(gRayquazaPreFightDialogue_7); + DisplayDungeonDialogue(&gRayquazaPreFightDialogue_7); sub_803E708(10,0x46); RayquazaDropInEffect(RayquazaEntity); - DisplayDungeonDialogue(gRayquazaReFightDialogue_1); + DisplayDungeonDialogue(&gRayquazaReFightDialogue_1); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaReFightDialogue_2); + DisplayDungeonDialogue(&gRayquazaReFightDialogue_2); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaReFightDialogue_3); + DisplayDungeonDialogue(&gRayquazaReFightDialogue_3); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaReFightDialogue_4); + DisplayDungeonDialogue(&gRayquazaReFightDialogue_4); SetupBossFightHP(RayquazaEntity,600,MUS_BATTLE_WITH_RAYQUAZA); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); } @@ -1950,19 +1949,19 @@ void RayquazaPostStoryPreFightDialogue(void) RayquazaEntity = GetEntityFromClientType(0xf); sub_8086448(); if (sub_8086AE4(MONSTER_RAYQUAZA)) { - sub_80866C4(gRayquazaPostStoryPreFightDialogue_6); + sub_80866C4(&gRayquazaPostStoryPreFightDialogue_6); } else { PlaySoundEffect(0x1da); // Rayquaza Cry - DisplayDungeonDialogue(gRayquazaPostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_1); RayquazaDropInEffect(RayquazaEntity); - DisplayDungeonDialogue(gRayquazaPostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_2); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaPostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_3); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaPostStoryPreFightDialogue_4); + DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_4); RayquazaScreenFlash(); - DisplayDungeonDialogue(gRayquazaPostStoryPreFightDialogue_5); + DisplayDungeonDialogue(&gRayquazaPostStoryPreFightDialogue_5); SetupBossFightHP(RayquazaEntity,600,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); } @@ -2076,27 +2075,27 @@ void sub_80897F0(void) sub_808563C(SpriteShockEffect); sub_803E708(0x20,0x46); sub_808692C(); - DisplayDungeonDialogue(gUnknown_8103BD8); + DisplayDungeonDialogue(&gUnknown_8103BD8); // We don't like to brag or // nothing, but - DisplayDungeonDialogue(gUnknown_8103C00); + DisplayDungeonDialogue(&gUnknown_8103C00); // We get furious real easy // You know that?! - DisplayDungeonDialogue(gUnknown_8103C3C); + DisplayDungeonDialogue(&gUnknown_8103C3C); // What really irritates us is // when we see some dim witted face - DisplayDungeonDialogue(gUnknown_8103C74); + DisplayDungeonDialogue(&gUnknown_8103C74); // ......... // Wrooooooar! // That vacant expression - DisplayDungeonDialogue(gUnknown_8103CC4); + DisplayDungeonDialogue(&gUnknown_8103CC4); // Gwoooh // It's ticking me off! // I'm seeing red! - DisplayDungeonDialogue(gUnknown_8103D0C); + DisplayDungeonDialogue(&gUnknown_8103D0C); // Mukkkeeeeeh // Get 'em! It's frenzy time! - DisplayDungeonDialogue(gUnknown_8103D50); + DisplayDungeonDialogue(&gUnknown_8103D50); sub_803E708(10,0x46); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); } @@ -2113,10 +2112,10 @@ void sub_8089878(void) sub_808563C(SpriteShockEffect); sub_803E708(0x20,0x46); sub_808692C(); - DisplayDungeonDialogue(gUnknown_8103D8C); - DisplayDungeonDialogue(gUnknown_8103D98); - DisplayDungeonDialogue(gUnknown_8103DD8); - DisplayDungeonDialogue(gUnknown_8103E28); + DisplayDungeonDialogue(&gUnknown_8103D8C); + DisplayDungeonDialogue(&gUnknown_8103D98); + DisplayDungeonDialogue(&gUnknown_8103DD8); + DisplayDungeonDialogue(&gUnknown_8103E28); sub_803E708(10,0x46); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); } @@ -2124,7 +2123,7 @@ void sub_8089878(void) void sub_80898E4(void) { sub_8086448(); - sub_80866C4(gUnknown_8103E34); + sub_80866C4(&gUnknown_8103E34); } void sub_80898F8(Entity *r0) @@ -2195,20 +2194,20 @@ void MewtwoPreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); MewtwoEntity = GetEntityFromClientType(0x11); sub_8086448(); - DisplayDungeonDialogue(gMewtwoPreFightDialogue_1); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_1); sub_803E708(10,0x46); DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); sub_8086794(); sub_803E708(0x1e,0x46); MewtwoDropInEffect(MewtwoEntity); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(gMewtwoPreFightDialogue_2); - DisplayDungeonDialogue(gMewtwoPreFightDialogue_3); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_2); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_3); sub_803E708(10,0x46); MewtwoScreenFlash(); - DisplayDungeonDialogue(gMewtwoPreFightDialogue_4); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_4); MewtwoScreenFlash(); - DisplayDungeonDialogue(gMewtwoPreFightDialogue_5); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_5); sub_803E708(10,0x46); SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2223,19 +2222,19 @@ void MewtwoReFightDialogue(void) MewtwoEntity = GetEntityFromClientType(0x11); sub_8086448(); if(HasRecruitedMon(MONSTER_MEWTWO)) { - sub_80866C4(gMewtwoReFightDialogue_5); + sub_80866C4(&gMewtwoReFightDialogue_5); } else { - DisplayDungeonDialogue(gMewtwoReFightDialogue_1); + DisplayDungeonDialogue(&gMewtwoReFightDialogue_1); DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); sub_8086794(); MewtwoDropInEffect(MewtwoEntity); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(gMewtwoReFightDialogue_2); + DisplayDungeonDialogue(&gMewtwoReFightDialogue_2); MewtwoScreenFlash(); - DisplayDungeonDialogue(gMewtwoReFightDialogue_3); + DisplayDungeonDialogue(&gMewtwoReFightDialogue_3); MewtwoScreenFlash(); - DisplayDungeonDialogue(gMewtwoReFightDialogue_4); + DisplayDungeonDialogue(&gMewtwoReFightDialogue_4); SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); } @@ -2341,11 +2340,11 @@ void EnteiPreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiPreFightDialogue_1); + DisplayDungeonDialogue(&gEnteiPreFightDialogue_1); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiPreFightDialogue_2); + DisplayDungeonDialogue(&gEnteiPreFightDialogue_2); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiPreFightDialogue_3); + DisplayDungeonDialogue(&gEnteiPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2359,11 +2358,11 @@ void EnteiReFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiReFightDialogue_1); + DisplayDungeonDialogue(&gEnteiReFightDialogue_1); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiReFightDialogue_2); + DisplayDungeonDialogue(&gEnteiReFightDialogue_2); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiReFightDialogue_3); + DisplayDungeonDialogue(&gEnteiReFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2377,15 +2376,15 @@ void EnteiPostStoryPreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); EnteiEntity = GetEntityFromClientType(0x12); if (HasRecruitedMon(MONSTER_ENTEI)) { - sub_80866C4(gEnteiPostStoryPreFightDialogue_4); + sub_80866C4(&gEnteiPostStoryPreFightDialogue_4); } else { EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiPostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_1); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiPostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_2); EnteiScreenFlash(); - DisplayDungeonDialogue(gEnteiPostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2485,19 +2484,19 @@ void RaikouPreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); - DisplayDungeonDialogue(gRaikouPreFightDialogue_1); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_1); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouPreFightDialogue_2); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_2); gDungeon->weather.unkE265 = WEATHER_RAIN; sub_807EAA0(0,1); sub_803E708(10,70); - DisplayDungeonDialogue(gRaikouPreFightDialogue_3); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_3); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouPreFightDialogue_4); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_4); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouPreFightDialogue_5); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_5); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouPreFightDialogue_6); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_6); sub_803E708(10,70); SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2513,11 +2512,11 @@ void RaikouReFightDialogue(void) gDungeon->weather.unkE265 = WEATHER_RAIN; sub_807EAA0(0,1); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouReFightDialogue_1); + DisplayDungeonDialogue(&gRaikouReFightDialogue_1); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouReFightDialogue_2); + DisplayDungeonDialogue(&gRaikouReFightDialogue_2); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouReFightDialogue_3); + DisplayDungeonDialogue(&gRaikouReFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2531,16 +2530,16 @@ void RaikouPostStoryPreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); RaikouEntity = GetEntityFromClientType(0x13); if (HasRecruitedMon(MONSTER_RAIKOU)) { - sub_80866C4(gRaikouPostStoryPreFightDialogue_4); + sub_80866C4(&gRaikouPostStoryPreFightDialogue_4); } else { gDungeon->weather.unkE265 = WEATHER_RAIN; sub_807EAA0(0,1); - DisplayDungeonDialogue(gRaikouPostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_1); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouPostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_2); RaikouScreenFlash(); - DisplayDungeonDialogue(gRaikouPostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2641,21 +2640,21 @@ void SuicunePreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); sub_8086448(); - DisplayDungeonDialogue(gSuicunePreFightDialogue_1); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_1); sub_803E708(10,70); - DisplayDungeonDialogue(gSuicunePreFightDialogue_2); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_2); sub_803E708(10,70); sub_80426C8(1,2); sub_803E708(0x3c,70); - DisplayDungeonDialogue(gSuicunePreFightDialogue_3); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_3); sub_803E708(10,70); sub_808A528(SuicuneEntity); - DisplayDungeonDialogue(gSuicunePreFightDialogue_4); - DisplayDungeonDialogue(gSuicunePreFightDialogue_5); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_4); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_5); SuicuneScreenFlash(); - DisplayDungeonDialogue(gSuicunePreFightDialogue_6); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_6); SuicuneScreenFlash(); - DisplayDungeonDialogue(gSuicunePreFightDialogue_7); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_7); sub_803E708(10,70); SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2668,11 +2667,11 @@ void SuicuneReFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); - DisplayDungeonDialogue(gSuicuneReFightDialogue_1); + DisplayDungeonDialogue(&gSuicuneReFightDialogue_1); SuicuneScreenFlash(); - DisplayDungeonDialogue(gSuicuneReFightDialogue_2); + DisplayDungeonDialogue(&gSuicuneReFightDialogue_2); SuicuneScreenFlash(); - DisplayDungeonDialogue(gSuicuneReFightDialogue_3); + DisplayDungeonDialogue(&gSuicuneReFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2686,14 +2685,14 @@ void SuicunePostStoryPreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); SuicuneEntity = GetEntityFromClientType(0x14); if (HasRecruitedMon(MONSTER_SUICUNE)) { - sub_80866C4(gSuicunePostStoryPreFightDialogue_4); + sub_80866C4(&gSuicunePostStoryPreFightDialogue_4); } else { - DisplayDungeonDialogue(gSuicunePostStoryPreFightDialogue_1); + DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_1); SuicuneScreenFlash(); - DisplayDungeonDialogue(gSuicunePostStoryPreFightDialogue_2); + DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_2); SuicuneScreenFlash(); - DisplayDungeonDialogue(gSuicunePostStoryPreFightDialogue_3); + DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2814,10 +2813,10 @@ void HoOhPreFightDialogue(void) local_14.y = LeaderEntity->pixelPos.y + -0x1000; ShiftCameraToPosition(&local_14,0x88); sub_803E708(0x40,70); - DisplayDungeonDialogue(gHoOhPreFightDialogue_1); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_1); sub_803E708(10,70); HoOhScreenFlash(); - DisplayDungeonDialogue(gHoOhPreFightDialogue_2); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_2); sub_803E708(10,70); sub_80855E4(sub_80868F4); sub_808680C(); @@ -2828,14 +2827,14 @@ void HoOhPreFightDialogue(void) sub_808682C(); sub_80855E4(sub_8086910); sub_8085930(DIRECTION_NORTH); - DisplayDungeonDialogue(gHoOhPreFightDialogue_3); - DisplayDungeonDialogue(gHoOhPreFightDialogue_4); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_3); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_4); sub_803E708(0x1e,70); sub_803E708(0x1e,70); HoOhScreenFlash(); - DisplayDungeonDialogue(gHoOhPreFightDialogue_5); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_5); HoOhScreenFlash(); - DisplayDungeonDialogue(gHoOhPreFightDialogue_6); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_6); sub_803E708(10,70); SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -2855,10 +2854,10 @@ void HoOhReFightDialogue(void) ShiftCameraToPosition(&local_14,0x88); sub_803E708(0x40,70); if (HasRecruitedMon(MONSTER_HO_OH)) { - sub_80866C4(HoOhReFightDialogue_5); + sub_80866C4(&HoOhReFightDialogue_5); } else { - DisplayDungeonDialogue(HoOhReFightDialogue_1); + DisplayDungeonDialogue(&HoOhReFightDialogue_1); HoOhScreenFlash(); sub_80855E4(sub_80868F4); sub_808680C(); @@ -2867,11 +2866,11 @@ void HoOhReFightDialogue(void) sub_808682C(); sub_80855E4(sub_8086910); sub_8085930(DIRECTION_NORTH); - DisplayDungeonDialogue(HoOhReFightDialogue_2); + DisplayDungeonDialogue(&HoOhReFightDialogue_2); HoOhScreenFlash(); - DisplayDungeonDialogue(HoOhReFightDialogue_3); + DisplayDungeonDialogue(&HoOhReFightDialogue_3); HoOhScreenFlash(); - DisplayDungeonDialogue(HoOhReFightDialogue_4); + DisplayDungeonDialogue(&HoOhReFightDialogue_4); sub_803E708(10,70); SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -3005,11 +3004,11 @@ void LatiosPreFightDialogue(void) SpriteShockEffect(LatiosEntity); sub_803E708(0x20,70); sub_808692C(); - DisplayDungeonDialogue(gLatiosPreFightDialogue_1); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_1); LatiosScreenFlash(); - DisplayDungeonDialogue(gLatiosPreFightDialogue_2); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_2); LatiosScreenFlash(); - DisplayDungeonDialogue(gLatiosPreFightDialogue_3); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -3024,11 +3023,11 @@ void LatiosReFightDialogue(void) LatiosEntity = GetEntityFromClientType(0x16); sub_8086448(); sub_808692C(); - DisplayDungeonDialogue(gLatiosReFightDialogue_1); + DisplayDungeonDialogue(&gLatiosReFightDialogue_1); LatiosScreenFlash(); - DisplayDungeonDialogue(gLatiosPreFightDialogue_2); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_2); LatiosScreenFlash(); - DisplayDungeonDialogue(gLatiosPreFightDialogue_3); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); sub_803E708(10,70); SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -3038,7 +3037,7 @@ void sub_808AC3C(void) { sub_8086448(); // There appears to be no one here - sub_80866C4(gUnknown_8104FC8); + sub_80866C4(&gUnknown_8104FC8); } void LatiosScreenFlash(void) @@ -3161,7 +3160,7 @@ void sub_808AE54(char param_1,char param_2,u32 *param_3) DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); // Something fell from Regirock's body // Regirock was apparently guarding this item - DisplayDungeonDialogue(gRegirockPostFightDialogue_1); + DisplayDungeonDialogue(&gRegirockPostFightDialogue_1); } } } @@ -3184,7 +3183,7 @@ void sub_808AEC8(char param_1,char param_2,u32 *param_3) DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); // Something fell from Regice's body // Regice was apparently guarding this item - DisplayDungeonDialogue(gRegicePostFightDialogue_1); + DisplayDungeonDialogue(&gRegicePostFightDialogue_1); } } } @@ -3206,7 +3205,7 @@ void sub_808AF3C(char param_1,char param_2,u32 *param_3) DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); // Something fell from Registeel's body // Registeel was apparently guarding this item - DisplayDungeonDialogue(gRegisteelPostFightDialogue_1); + DisplayDungeonDialogue(&gRegisteelPostFightDialogue_1); } } } @@ -3222,7 +3221,7 @@ void sub_808AFB0(char param_1) sub_8097FD0(0x1d); SetMessageArgument(gAvailablePokemonNames,GetLeader(),0); // {POKEMON_0} obtained the Rock Part that Regirock was guarding - DisplayDungeonDialogue(gRegirockPostFightDialogue_2); + DisplayDungeonDialogue(&gRegirockPostFightDialogue_2); sub_80421C0(0,0xd4); sub_803E708(10,70); sub_8046D20(); @@ -3240,7 +3239,7 @@ void sub_808B030(char param_1) sub_8097FD0(0x1d); SetMessageArgument(gAvailablePokemonNames,GetLeader(),0); // {POKEMON_0} obtained the Ice Part that Regice was guarding - DisplayDungeonDialogue(gRegicePostFightDialogue_2); + DisplayDungeonDialogue(&gRegicePostFightDialogue_2); sub_80421C0(0,0xd4); sub_803E708(10,70); sub_8046D20(); @@ -3258,7 +3257,7 @@ void sub_808B0B0(char param_1) sub_8097FD0(0x1d); SetMessageArgument(gAvailablePokemonNames, GetLeader(), 0); // {POKEMON_0} obtained the Steel Part that Registeel was guarding - DisplayDungeonDialogue(gRegisteelPostFightDialogue_2); + DisplayDungeonDialogue(&gRegisteelPostFightDialogue_2); sub_80421C0(0,0xd4); sub_803E708(10,70); sub_8046D20(); @@ -3271,7 +3270,7 @@ void RegirockPreFightDialogue(void) sub_8085930(DIRECTION_NORTH); // INTRUDER ALERT // EXTERMINATE - DisplayDungeonDialogue(gRegirockPreFightDialogue_1); + DisplayDungeonDialogue(&gRegirockPreFightDialogue_1); sub_803E708(10,70); sub_808563C(SetupRegirockFightHP); } @@ -3283,7 +3282,7 @@ void RegicePreFightDialogue(void) sub_8085930(DIRECTION_NORTH); // INTRUDER ALERT // EXTERMINATE - DisplayDungeonDialogue(gRegicePreFightDialogue_1); + DisplayDungeonDialogue(&gRegicePreFightDialogue_1); sub_803E708(10,70); sub_808563C(SetupRegiceFightHP); } @@ -3295,7 +3294,7 @@ void RegisteelPreFightDialogue(void) sub_8085930(DIRECTION_NORTH); // INTRUDER ALERT // EXTERMINATE - DisplayDungeonDialogue(gRegisteelPreFightDialogue_1); + DisplayDungeonDialogue(&gRegisteelPreFightDialogue_1); sub_803E708(10,70); sub_808563C(SetupRegisteelFightHP); } @@ -3434,19 +3433,19 @@ void JirachiPreFightDialogue(void) JirachiEntity = GetEntityFromClientType(0x1a); sub_8086448(); sub_803E708(0x40,70); - DisplayDungeonDialogue(gJirachiPreFightDialogue_1); + DisplayDungeonDialogue(&gJirachiPreFightDialogue_1); sub_803E708(10,70); SpriteLookAroundEffect(LeaderEntity); sub_803E708(10,70); - DisplayDungeonDialogue(gJirachiPreFightDialogue_2); + DisplayDungeonDialogue(&gJirachiPreFightDialogue_2); sub_80861F8(0x37,JirachiEntity,1); sub_80855E4(SpriteShockEffect); sub_803E708(0x3c,70); JirachiDropInEffect(JirachiEntity); sub_803E708(0x5a,70); - DisplayDungeonDialogue(gJirachiPreFightDialogue_3); + DisplayDungeonDialogue(&gJirachiPreFightDialogue_3); sub_803E708(10,70); - DisplayDungeonDialogue(gJirachiPreFightDialogue_4); + DisplayDungeonDialogue(&gJirachiPreFightDialogue_4); sub_803E708(10,70); SetupBossFightHP(JirachiEntity,0x15e,MUS_BATTLE_WITH_RAYQUAZA); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -3467,15 +3466,15 @@ void sub_808B50C(void) DungeonFadeOutBGM(0x1e); sub_803E708(0x1e,70); // Fwaaaahhhh - DisplayDungeonDialogue(gUnknown_810554C); + DisplayDungeonDialogue(&gUnknown_810554C); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); // I think I had a dream, and I was fighting in it // Did I imagine it? // I'm sleepy so I'm going back to sleep. - DisplayDungeonDialogue(gUnknown_8105558); + DisplayDungeonDialogue(&gUnknown_8105558); sub_803E708(10,70); JirachiSpinEffect(JirachiEntity); - DisplayDungeonDialogue(gUnknown_81055F4); + DisplayDungeonDialogue(&gUnknown_81055F4); sub_803E708(10,70); gDungeon->unk2 = 1; } @@ -3509,37 +3508,37 @@ void JirachiWish(void) gDungeon->unk1356C = 1; DungeonFadeOutBGM(0x1e); sub_803E708(0x1e,0x46); - DisplayDungeonDialogue(gUnknown_8105668); + DisplayDungeonDialogue(&gUnknown_8105668); sub_803E708(10,0x46); PlaySoundEffect(0x1a7); sub_803E708(0x96,0x46); SpriteShockEffect(JirachiEntity); - DisplayDungeonDialogue(gUnknown_8105674); + DisplayDungeonDialogue(&gUnknown_8105674); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); sub_803E708(10,0x46); sub_80856E0(JirachiEntity, DIRECTION_SOUTH); PlaySoundEffect(0x16a); - DisplayDungeonDialogue(gUnknown_81056B8); + DisplayDungeonDialogue(&gUnknown_81056B8); sub_803E708(10,0x46); SpriteLookAroundEffect(JirachiEntity); - DisplayDungeonDialogue(gUnknown_81056DC); + DisplayDungeonDialogue(&gUnknown_81056DC); sub_803E708(10,0x46); while( 1 ) { while (1) { #ifndef NONMATCHING - register s32 r0 asm("r0"); + register void* r0 asm("r0"); asm("mov\t%0, #0":"=r"(r0)); #else - s32 r0 = 0; + void* r0 = 0; #endif - wishChoice = sub_8052C68(r0,*gUnknown_8105798,gUnknown_810579C,0x705); + wishChoice = DisplayDungeonMenuMessage(r0,gUnknown_8105798,gUnknown_810579C,0x705); if (wishChoice >= 1) break; } sub_803E708(10,0x46); if (wishChoice == 1) { s32 r8; // Lots of Money - DisplayDungeonDialogue(gUnknown_810581C); + DisplayDungeonDialogue(&gUnknown_810581C); sub_803E708(10,0x46); JirachiWishGrantDialogue(JirachiEntity); @@ -3562,7 +3561,7 @@ void JirachiWish(void) } if (wishChoice == 2) { // Lots of Items - DisplayDungeonDialogue(gUnknown_8105974); + DisplayDungeonDialogue(&gUnknown_8105974); sub_803E708(10,0x46); JirachiWishGrantDialogue(JirachiEntity); @@ -3594,30 +3593,30 @@ void JirachiWish(void) if (friendArea == NUM_FRIEND_AREAS) { // You want a friend area? But you already have many friend areas... - DisplayDungeonDialogue(gUnknown_8105A08); + DisplayDungeonDialogue(&gUnknown_8105A08); sub_803E708(10,0x46); continue; } else { // You want a friend area? As you wish.. - DisplayDungeonDialogue(gUnknown_8105AD4); + DisplayDungeonDialogue(&gUnknown_8105AD4); sub_803E708(10,0x46); JirachiWishGrantDialogue(JirachiEntity); JirachiEntity->info->unk15D = 0; - DisplayDungeonDialogue(gUnknown_8105B20); + DisplayDungeonDialogue(&gUnknown_8105B20); UnlockFriendArea(friendArea); PlaySoundEffect(0xd4); LeaderEntity = GetLeader(); SetMessageArgument(gAvailablePokemonNames,LeaderEntity,0); WriteFriendAreaName(gFormatItems,friendArea,FALSE); // Obtained the friend area! - DisplayDungeonDialogue(gUnknown_8105B68); + DisplayDungeonDialogue(&gUnknown_8105B68); } } if (wishChoice == 4) { // More Strength.. - DisplayDungeonDialogue(gUnknown_8105BA8); + DisplayDungeonDialogue(&gUnknown_8105BA8); sub_803E708(10,0x46); JirachiWishGrantDialogue(JirachiEntity); @@ -3639,32 +3638,32 @@ void JirachiWish(void) } } JirachiEntity->info->unk15D = 0; - DisplayDungeonDialogue(gUnknown_8105BF4); + DisplayDungeonDialogue(&gUnknown_8105BF4); sub_803E708(10,0x46); } if (wishChoice == 5) { // Something Good... - DisplayDungeonDialogue(gUnknown_8105D2C); + DisplayDungeonDialogue(&gUnknown_8105D2C); sub_803E708(10,0x46); JirachiWishGrantDialogue(JirachiEntity); JirachiEntity->info->unk15D = 0; - DisplayDungeonDialogue(gUnknown_8105D80); + DisplayDungeonDialogue(&gUnknown_8105D80); sub_803E708(10,0x46); LeaderPos = &GetLeader()->pos; direction = GetDirectionTowardsPosition(&JirachiEntity->pos,LeaderPos); SetFacingDirection(JirachiEntity,direction); sub_803E708(10,0x46); - DisplayDungeonDialogue(gUnknown_8105D9C); + DisplayDungeonDialogue(&gUnknown_8105D9C); sub_803E708(10,0x46); gDungeon->unk674 = 1; } break; } - DisplayDungeonDialogue(gUnknown_81058E0); + DisplayDungeonDialogue(&gUnknown_81058E0); JirachiSpinEffect(JirachiEntity); sub_803E708(10,0x46); - DisplayDungeonDialogue(gUnknown_810593C); + DisplayDungeonDialogue(&gUnknown_810593C); sub_803E708(10,0x46); EnableJirachiWishWarpTile(); } @@ -3674,7 +3673,7 @@ void JirachiReFightDialogue(void) if(HasRecruitedMon(MONSTER_JIRACHI)) { sub_8086448(); - sub_80866C4(gJirachiReFightDialogue_1); + sub_80866C4(&gJirachiReFightDialogue_1); } else { @@ -3778,13 +3777,13 @@ void JirachiWishGrantDialogue(Entity *jirachiEntity) jirachiEntity->info->unk15D = 1; // Nnnnnnnnnn! - DisplayDungeonDialogue(gUnknown_81058A8); + DisplayDungeonDialogue(&gUnknown_81058A8); PlaySoundEffect(0x375); sub_80861F8(0x67,jirachiEntity,1); PlaySoundEffect(0x2a8); uVar2 = sub_80861F8(0x68,jirachiEntity,0); // Taaaaaaaah! - DisplayDungeonDialogue(gUnknown_81058C4); + DisplayDungeonDialogue(&gUnknown_81058C4); if (sub_800E9A8(uVar2)) { sub_800DC14(uVar2); } @@ -3896,31 +3895,31 @@ void LugiaPreFightDialogue(void) LugiaEntity = GetEntityFromClientType(0x1b); if (HasRecruitedMon(MONSTER_LUGIA)) { sub_8086448(); - sub_80866C4(gLugiaPreFightDialogue_8); + sub_80866C4(&gLugiaPreFightDialogue_8); } else { DungeonStopBGM(); sub_8086448(); - DisplayDungeonDialogue(gLugiaPreFightDialogue_1); + DisplayDungeonDialogue(&gLugiaPreFightDialogue_1); DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c); sub_808C0CC(); - DisplayDungeonDialogue(gLugiaPreFightDialogue_2); + DisplayDungeonDialogue(&gLugiaPreFightDialogue_2); LugiaScreenFlash(); - DisplayDungeonDialogue(gLugiaPreFightDialogue_3); + DisplayDungeonDialogue(&gLugiaPreFightDialogue_3); sub_803E708(10,0x46); - DisplayDungeonDialogue(gLugiaPreFightDialogue_4); + DisplayDungeonDialogue(&gLugiaPreFightDialogue_4); PlaySoundEffect(0x1f8); sub_80861D4(LugiaEntity,0xd,DIRECTION_SOUTH); sub_803E708(0x2b,0x46); sub_80861B8(LugiaEntity,0,DIRECTION_SOUTH); - DisplayDungeonDialogue(gLugiaPreFightDialogue_5); + DisplayDungeonDialogue(&gLugiaPreFightDialogue_5); LugiaScreenFlash(); - DisplayDungeonDialogue(gLugiaPreFightDialogue_6); + DisplayDungeonDialogue(&gLugiaPreFightDialogue_6); LugiaScreenFlash2(); SetDungeonBGColorRGB(0xffffff06,0xffffff06,0xffffff06,1,0); DungeonStopBGM(); sub_80861D4(LugiaEntity,7,DIRECTION_SOUTH); - DisplayDungeonDialogue(gLugiaPreFightDialogue_7); + DisplayDungeonDialogue(&gLugiaPreFightDialogue_7); LugiaScreenFlash(); SetupBossFightHP(LugiaEntity,800,MUS_BATTLE_WITH_RAYQUAZA); DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); @@ -4042,35 +4041,35 @@ void KyogrePreFightDialogue(void) DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c); SpriteLookAroundEffect(LeaderEntity); sub_803E708(10,0x46); - DisplayDungeonDialogue(gKyogrePreFightDialogue_8); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_8); sub_803E708(10,0x46); gDungeon->unk2 = 1; } else { - DisplayDungeonDialogue(gKyogrePreFightDialogue_1); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_1); sub_803E708(10,0x46); - DisplayDungeonDialogue(gKyogrePreFightDialogue_2); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_2); sub_803E708(10,0x46); nullsub_99(); sub_803E708(10,0x46); // Gwwwwwooooooooh - DisplayDungeonDialogue(gKyogrePreFightDialogue_3); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_3); sub_803E708(10,0x46); DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c); sub_808C360(); // My duels against {POKEMON_3} (Groudon) left us both exhausted - DisplayDungeonDialogue(gKyogrePreFightDialogue_4); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_4); KyogreScreenFlash(); // I am {POKEMON_2} (Kyogre)! // The lord of the sea! - DisplayDungeonDialogue(gKyogrePreFightDialogue_5); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_5); KyogreScreenFlash(); // Witness the destructive force of my waves! - DisplayDungeonDialogue(gKyogrePreFightDialogue_6); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_6); KyogreScreenFlash(); // Marvel at my awesome // power! - DisplayDungeonDialogue(gKyogrePreFightDialogue_7); + DisplayDungeonDialogue(&gKyogrePreFightDialogue_7); sub_803E708(10,0x46); SetupBossFightHP(KyogreEntity,600,MUS_BOSS_BATTLE); DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); @@ -4152,17 +4151,17 @@ void DeoxysPreFightDialogue(void) if (HasRecruitedMon(MONSTER_DEOXYS_NORMAL)) { // There appears to be no one here. // It's impossible to go any further - sub_80866C4(gDeoxysPreFightDialogue_5); + sub_80866C4(&gDeoxysPreFightDialogue_5); } else { - DisplayDungeonDialogue(gDeoxysPreFightDialogue_1); + DisplayDungeonDialogue(&gDeoxysPreFightDialogue_1); DungeonFadeInNewBGM(MUS_RAYQUAZAS_DOMAIN, 0x3c); sub_808C550(); - DisplayDungeonDialogue(gDeoxysPreFightDialogue_2); + DisplayDungeonDialogue(&gDeoxysPreFightDialogue_2); DeoxysScreenFlash(); - DisplayDungeonDialogue(gDeoxysPreFightDialogue_3); + DisplayDungeonDialogue(&gDeoxysPreFightDialogue_3); DeoxysScreenFlash(); - DisplayDungeonDialogue(gDeoxysPreFightDialogue_4); + DisplayDungeonDialogue(&gDeoxysPreFightDialogue_4); sub_803E708(10,0x46); sub_808563C(SetupDeoxysFightHP); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); @@ -4257,7 +4256,7 @@ void CelebiJoinDialogue(void) SpriteLookAroundEffect(LeaderEntity); sub_803E708(10,0x46); // ......... - DisplayDungeonDialogue(gCelebiJoinDialogue_10); + DisplayDungeonDialogue(&gCelebiJoinDialogue_10); } else { @@ -4266,14 +4265,14 @@ void CelebiJoinDialogue(void) SpriteShockEffect(LeaderEntity); sub_803E708(10,0x46); // Oh? There's someone there. - DisplayDungeonDialogue(gCelebiJoinDialogue_1); + DisplayDungeonDialogue(&gCelebiJoinDialogue_1); sub_803E708(10,0x46); sub_8086598(); sub_8086598(); sub_8086598(); sub_8086598(); // The Time-Traveling Pokemon {POKEMON_2} (Celebi)! - DisplayDungeonDialogue(gCelebiJoinDialogue_2); + DisplayDungeonDialogue(&gCelebiJoinDialogue_2); PlaySoundEffect(0x1c7); sub_806CDD4(CelebiEntity,10,DIRECTION_SOUTH); sub_803E708(0x14,0x46); @@ -4281,7 +4280,7 @@ void CelebiJoinDialogue(void) sub_803E708(4,0x46); PlaySoundEffect(0x1c7); sub_806CDD4(CelebiEntity,10,DIRECTION_SOUTH); - DisplayDungeonDialogue(gCelebiJoinDialogue_3); + DisplayDungeonDialogue(&gCelebiJoinDialogue_3); sub_803E708(10,0x46); state = 0; @@ -4292,7 +4291,7 @@ void CelebiJoinDialogue(void) case 0: do { - menuChoice = sub_8052C68(0,gPtrPurityForestAllowCelebiToJoinText, &gPurityForestAllowCelebiToJoinPrompt,0x701); + menuChoice = DisplayDungeonMenuMessage(0,gPtrPurityForestAllowCelebiToJoinText, gPurityForestAllowCelebiToJoinPrompt,0x701); } while (menuChoice < 1); sub_803E708(10,0x46); @@ -4312,11 +4311,11 @@ void CelebiJoinDialogue(void) sub_803E708(0x1a,0x46); PlaySoundEffect(0x1d5); sub_803E708(0x1c,0x46); - DisplayDungeonDialogue(gCelebiJoinDialogue_4); + DisplayDungeonDialogue(&gCelebiJoinDialogue_4); sub_803E708(10,0x46); sub_806FDF4(LeaderEntity,CelebiEntity,&CelebiEntity); DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); - DisplayDungeonDialogue(gCelebiJoinDialogue_5); + DisplayDungeonDialogue(&gCelebiJoinDialogue_5); sub_803E708(10,0x46); PlaySoundEffect(0x1c7); sub_80861D4(CelebiEntity,0xd,DIRECTION_SOUTH); @@ -4325,7 +4324,7 @@ void CelebiJoinDialogue(void) sub_803E708(0x1a,0x46); PlaySoundEffect(0x1d5); sub_803E708(0x1b,0x46); - DisplayDungeonDialogue(gCelebiJoinDialogue_6); + DisplayDungeonDialogue(&gCelebiJoinDialogue_6); sub_803E708(10,0x46); state = 2; } @@ -4337,7 +4336,7 @@ void CelebiJoinDialogue(void) case 1: do { - menuChoice = sub_8052C68(0,gPtrPurityForestRefuseCelebiConfirmText, &gPurityForestRefuseCelebiConfirmPrompt,0x701); + menuChoice = DisplayDungeonMenuMessage(0,gPtrPurityForestRefuseCelebiConfirmText, gPurityForestRefuseCelebiConfirmPrompt,0x701); } while (menuChoice < 1); if (menuChoice == 1) { @@ -4346,15 +4345,15 @@ void CelebiJoinDialogue(void) else { sub_803E708(10,0x46); - DisplayDungeonDialogue(gCelebiJoinDialogue_7); + DisplayDungeonDialogue(&gCelebiJoinDialogue_7); sub_80861F8(0x3e,CelebiEntity,1); sub_803E708(0x18,0x46); sub_80861F8(0x3e,CelebiEntity,1); sub_803E708(0xe,0x46); - DisplayDungeonDialogue(gCelebiJoinDialogue_8); + DisplayDungeonDialogue(&gCelebiJoinDialogue_8); sub_803E708(10,0x46); sub_808C8E0(CelebiEntity); - DisplayDungeonDialogue(gCelebiJoinDialogue_9); + DisplayDungeonDialogue(&gCelebiJoinDialogue_9); sub_803E708(10,0x46); state = 2; } @@ -4414,7 +4413,7 @@ void sub_808C998(void) { // Defeat the opposing team to win // Be careful, your opponents are tough - DisplayDungeonDialogue(gUnknown_8106720); + DisplayDungeonDialogue(&gUnknown_8106720); sub_803E708(0xA, 0x46); } @@ -4450,12 +4449,12 @@ void MedichamRescueDialogue(void) SpriteLookAroundEffect(MedichamEntity); sub_803E708(0xA, 0x46); // Oh my I can't seem to find a way out... - DisplayDungeonDialogue(gMedichamRescueDialogue_1); + DisplayDungeonDialogue(&gMedichamRescueDialogue_1); sub_803E708(0xA, 0x46); sub_80869E4(MedichamEntity, 4, 2, 4); sub_803E708(0xA, 0x46); // What am I to do...? - DisplayDungeonDialogue(gMedichamRescueDialogue_2); + DisplayDungeonDialogue(&gMedichamRescueDialogue_2); sub_803E708(0xA, 0x46); sub_8086448(); sub_8086598(); @@ -4463,7 +4462,7 @@ void MedichamRescueDialogue(void) SpriteShockEffect(MedichamEntity); sub_803E708(0x20, 0x46); sub_80869E4(MedichamEntity, 4, 2, 0); - DisplayDungeonDialogue(gMedichamRescueDialogue_3); + DisplayDungeonDialogue(&gMedichamRescueDialogue_3); sub_803E708(0xA, 0x46); PlaySoundEffect(0x1c7); sub_806CDD4(MedichamEntity, 0xA, DIRECTION_SOUTH); @@ -4477,7 +4476,7 @@ void MedichamRescueDialogue(void) // I am so lucky // // There appears to be no one here - DisplayDungeonDialogue(gMedichamRescueDialogue_4); + DisplayDungeonDialogue(&gMedichamRescueDialogue_4); sub_803E708(0xA, 0x46); sub_806CDD4(MedichamEntity, 0, DIRECTION_SOUTH); for(counter = 0x17; counter >= 0; counter--) @@ -4539,14 +4538,14 @@ void SmeargleRescueDialogue(void) sub_803E708(0xA, 0x46); // Ohhh... // I've lost my bearings - DisplayDungeonDialogue(gSmeargleRescueDialogue_1); + DisplayDungeonDialogue(&gSmeargleRescueDialogue_1); sub_803E708(0xA, 0x46); sub_80869E4(SmeargleEntity, 4, 2, 4); sub_803E708(0xA, 0x46); // I can't get out... // I'm hungry... // I'm in trouble - DisplayDungeonDialogue(gSmeargleRescueDialogue_2); + DisplayDungeonDialogue(&gSmeargleRescueDialogue_2); sub_803E708(0xA, 0x46); sub_8086448(); sub_8086598(); @@ -4555,7 +4554,7 @@ void SmeargleRescueDialogue(void) sub_803E708(0x20, 0x46); sub_80869E4(SmeargleEntity, 4, 2, 0); // Oh! You are? - DisplayDungeonDialogue(gSmeargleRescueDialogue_3); + DisplayDungeonDialogue(&gSmeargleRescueDialogue_3); sub_803E708(0xA, 0x46); PlaySoundEffect(0x1c7); sub_806CDD4(SmeargleEntity, 0xA, DIRECTION_SOUTH); @@ -4567,7 +4566,7 @@ void SmeargleRescueDialogue(void) sub_803E708(0x14, 0x46); // Did you maybe come to rescue me? // Am I glad to see you - DisplayDungeonDialogue(gSmeargleRescueDialogue_4); + DisplayDungeonDialogue(&gSmeargleRescueDialogue_4); sub_803E708(0xA, 0x46); sub_806CDD4(SmeargleEntity, 0, DIRECTION_SOUTH); for(counter = 0x17; counter >= 0; counter--) @@ -4605,7 +4604,7 @@ void sub_808CD9C(u8 r0) sub_8086448(); // There appears to be no one here. // It's impossible to go any further - sub_80866C4(gUnknown_810697C); + sub_80866C4(&gUnknown_810697C); } const u64 *sub_808CDB0(u8 r0) diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index fde6e3f17..1bee838c8 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -3,7 +3,7 @@ #include "number_util.h" #include "input.h" #include "structs/map.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "dungeon_action.h" #include "dungeon_ai_targeting.h" #include "dungeon_pokemon_attributes.h" @@ -57,7 +57,6 @@ struct UnkMenuBitsStruct { u8 a0_32; }; -extern void PrintFieldMessage(u32, const u8 *, u32); extern void HandleSetItemAction(Entity *,bool8); extern void HandleUnsetItemAction(Entity *,bool8); extern bool8 sub_8048A68(Entity *param_1,Item *item); @@ -67,12 +66,10 @@ extern Item *sub_8044D90(Entity *, s32, u32); extern void sub_8083D44(void); extern void sub_8083D30(void); extern void sub_8083D08(void); -extern void sub_805239C(Entity *, const u8 *); extern void sub_806A6E8(Entity *); extern bool8 sub_8047084(s32 itemFlag); extern void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4); extern void sub_8045DB4(Position *, u32); -extern s32 sub_8052B8C(u32, const u8 *, u32); bool8 sub_807EF48(void); void sub_806A2BC(Entity *a0, u8 a1); bool8 sub_805E874(void); @@ -89,7 +86,6 @@ void sub_8094C88(void); void sub_8040A84(void); void sub_8047158(void); void sub_804AA60(void); -void sub_80532B4(void); void sub_806A914(u8 a0, u8 a1, u8 a2); void sub_8044C10(u8 a0); u16 GetLeaderActionId(void); @@ -97,7 +93,6 @@ void sub_80978C8(s16 a0); void sub_8044C50(u16 a0); static void TryCreateModeArrows(Entity *leader); bool8 sub_8094C48(void); -void sub_8052210(u8 a0); bool8 sub_805EC4C(Entity *a0, u8 a1); void sub_803E724(s32 a0); void HandleTalkFieldAction(Entity *); @@ -269,7 +264,7 @@ void DungeonHandlePlayerInput(void) } } else if (ShouldMonsterRunAwayAndShowEffect(leader, TRUE)) { - SendMessage(leader, gUnknown_80FD4B0); + TryDisplayDungeonLoggableMessage(leader, gUnknown_80FD4B0); sub_8044C50(1); gDungeon->unk673 = 1; break; @@ -284,7 +279,7 @@ void DungeonHandlePlayerInput(void) } } if (i == MAX_MON_MOVES) { - SendMessage(leader, gUnknown_80F8A28); + TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A28); break; } @@ -310,7 +305,7 @@ void DungeonHandlePlayerInput(void) } } if (!canUseMove) { - SendMessage(leader, gUnknown_80F8A4C); + TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A4C); } else { SetMonsterActionFields(&leaderInfo->action, ACTION_USE_MOVE_PLAYER); @@ -379,7 +374,7 @@ void DungeonHandlePlayerInput(void) if (gRealInputs.held & L_BUTTON) { if (gRealInputs.pressed & B_BUTTON) { - sub_80532B4(); + DisplayMessageLog(); ResetRepeatTimers(); ResetUnusedInputStruct(); } @@ -534,7 +529,7 @@ void DungeonHandlePlayerInput(void) if (!(canMoveFlags & 2)) { if (canMoveFlags & 1) { if (immobilizedMsg != NULL) { - SendMessage(leader, immobilizedMsg); + TryDisplayDungeonLoggableMessage(leader, immobilizedMsg); } sub_8044C50(1); gDungeon->unk673 = 1; @@ -1577,7 +1572,7 @@ bool8 sub_805EC4C(Entity *a0, u8 a1) if (IsChargingAnyTwoTurnMove(tileMonster, FALSE)) return FALSE; if (!sub_8070F80(a0, entityInfo->action.direction)) return FALSE; - if (a1 != 0 && sub_807049C(tileMonster, &a0->pos) && !sub_8052B8C(0, gUnknown_8100208, 0)) return FALSE; + if (a1 != 0 && sub_807049C(tileMonster, &a0->pos) && !DisplayDungeonYesNoMessage(0, gUnknown_8100208, 0)) return FALSE; SetMonsterActionFields(&entityInfo->action, ACTION_WALK); if (gRealInputs.held & B_BUTTON) { @@ -1721,13 +1716,13 @@ void sub_805F02C(void) EntityInfo *leaderInfo = leader->info; if (r8->isTeamLeader) { - sub_805239C(r7, gUnknown_80F9BD8); + DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9BD8); } else if (sub_8047084(ITEM_FLAG_IN_SHOP) || sub_807EF48()) { - sub_805239C(r7, gUnknown_80F9C08); + DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C08); } else if (gDungeon->unk66E) { - sub_805239C(r7, gUnknown_80F9C2C); + DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C2C); } else { gDungeon->unk679 = 0; @@ -1761,7 +1756,7 @@ void sub_805F02C(void) sub_8041AD0(leader); sub_8041AE0(GetLeader()); SetMessageArgument(gAvailablePokemonNames, r7, 0); - SendMessage(r7, gUnknown_80F9BB0); + TryDisplayDungeonLoggableMessage(r7, gUnknown_80F9BB0); sub_807EC28(FALSE); r8->unk64 = 0; leaderInfo->unk64 = 0; @@ -2124,7 +2119,7 @@ void ShowFieldMenu(u8 a0_, bool8 a1) } else { SetMessageArgument(gAvailablePokemonNames, GetLeader(), 0); - PrintFieldMessage(0, gUnknown_80FDE18, 1); + DisplayDungeonMessage(0, gUnknown_80FDE18, 1); } } r10 = -1; @@ -2168,7 +2163,7 @@ extern const u8 *const gUnknown_80F91E0; extern const u8 *const gUnknown_80F91A8; extern const u8 *const gUnknown_80FE954; -const u8 *sub_805317C(void); +const u8 *GetCurrentDungeonName(void); void GetWeatherName(u8 *dst, u8 weatherId); extern s32 gFormatData_202DE30[]; @@ -2232,7 +2227,7 @@ void DrawFieldMenu(u8 a0) if (a0) { u32 hours, minutes, seconds; EntityInfo *leaderInfo = GetLeader()->info; - const u8 *dungeonName = sub_805317C(); + const u8 *dungeonName = GetCurrentDungeonName(); x = (136 - sub_8008ED0(dungeonName)) / 2; sub_80073B8(1); @@ -2279,7 +2274,7 @@ bool8 sub_805FBE8(u8 *a0) do { sub_803E46C(0xE); - xxx_draw_string_80144C4(); + DrawDialogueBoxString(); r4 = sub_8016080(); } while (r4 == 0); CleanConfirmNameMenu(); @@ -2435,7 +2430,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) sUnknown_202F258 = sub_8060D64(sUnknown_202F248, var_30, var_34, var_28, a0); if (sUnknown_202F258 == 0) { - PrintFieldMessage(0, gUnknown_80F8B24, 1); + DisplayDungeonMessage(0, gUnknown_80F8B24, 1); return TRUE; } diff --git a/src/code_8066D04.c b/src/code_8066D04.c index e43758fd5..aa47d834c 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -1,6 +1,6 @@ #include "global.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_807CD9C.h" #include "dungeon_map_access.h" #include "dungeon_movement.h" @@ -58,7 +58,7 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2) if (((itemPtr->flags & ITEM_FLAG_EXISTS)) && ((itemPtr->flags & ITEM_FLAG_SET))) { if ((itemPtr->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatItems,itemPtr); - SendMessage(param_1,*gItemStickyCannotEquip); + TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotEquip); return; } itemPtr->flags &= ~(ITEM_FLAG_SET); @@ -68,22 +68,22 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2) PlaySoundEffect(0x133); if (param_2 != 0) { if ((item->flags & ITEM_FLAG_STICKY)) { - SendMessage(param_1,*gUnknown_80F8D04); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D04); } else { if (GetItemCategory(item->id) == CATEGORY_THROWN_LINE) { - SendMessage(param_1,*gUnknown_80F8CE4); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE4); } else { - SendMessage(param_1,*gUnknown_80F8CE8); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE8); } } } item->flags |= ITEM_FLAG_SET; if (((item->flags & ITEM_FLAG_STICKY)) && (param_2 != 0)) { sub_8045BF8(gFormatItems,item); - SendMessage(param_1,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); } } @@ -99,14 +99,14 @@ void HandleUnsetItemAction(Entity *entity,bool8 enableMessage) if (((item->flags & ITEM_FLAG_EXISTS)) && ((item->flags & ITEM_FLAG_SET))) { if ((item->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatItems,item); - SendMessage(entity,*gItemStickyCannotEquip); + TryDisplayDungeonLoggableMessage(entity,*gItemStickyCannotEquip); return; } item->flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatItems,item); PlaySoundEffect(0x133); if (enableMessage) { - SendMessage(entity,*gUnknown_80F8D20); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8D20); } } } @@ -136,7 +136,7 @@ void HandleGiveItemAction(Entity *param_1) if ((!bVar3) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) { sub_8045BF8(gUnknown_202DEA8,item); - SendMessage(param_1,*gItemStickyCannotMove2); + TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove2); } else { @@ -144,7 +144,7 @@ void HandleGiveItemAction(Entity *param_1) if (((info2->heldItem).flags & ITEM_FLAG_EXISTS)) { if (((info2->heldItem).flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gUnknown_202DEA8,&info2->heldItem); - SendMessage(param_1,*gItemStickyCannotMove1); + TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove1); return; } item1 = (info2->heldItem); @@ -162,9 +162,9 @@ void HandleGiveItemAction(Entity *param_1) sub_8045BF8(gFormatItems,&item2); sub_8045BF8(gFormatItems + 0x50,&item1); PlaySoundEffect(0x14d); - SendMessage(param_1,*gMonTookAndReturnedItem); + TryDisplayDungeonLoggableMessage(param_1,*gMonTookAndReturnedItem); if ((item2.flags & ITEM_FLAG_STICKY)) { - SendMessage(param_1,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); } } else { @@ -174,9 +174,9 @@ void HandleGiveItemAction(Entity *param_1) info2->heldItem = item3; sub_8045BF8(gFormatItems,&item3); PlaySoundEffect(0x14d); - SendMessage(param_1,*gUnknown_80F8D44); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D44); if ((item3.flags & ITEM_FLAG_STICKY)) { - SendMessage(param_1,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); } } sub_806A6E8(entity); @@ -204,13 +204,13 @@ void HandleTakeItemAction(Entity *param_1) info2 = entity->info; heldItem = &info->heldItem; if ((gTeamInventoryRef->teamItems[ITEM_POWER_BAND].flags & ITEM_FLAG_EXISTS)) { - SendMessage(param_1,*gUnknown_80F8D60); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D60); } else { if ((heldItem->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatItems,heldItem); - SendMessage(param_1,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); } else { @@ -223,7 +223,7 @@ void HandleTakeItemAction(Entity *param_1) heldItem->flags = 0; AddItemToInventory(&item); PlaySoundEffect(0x14d); - SendMessage(param_1,*gUnknown_80F8D7C); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D7C); sub_806A6E8(entity); if (sub_80706A4(entity,&entity->pos) != 0) { sub_807D148(param_1,entity,0,0); @@ -251,11 +251,11 @@ void sub_8066BD4(Entity *param_1) if (heldItem->flags & ITEM_FLAG_STICKY) { sub_8045BF8(gFormatItems,heldItem); - SendMessage(param_1,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); } else if ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) { sub_8045BF8(gFormatItems,item); - SendMessage(param_1,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); } else { @@ -268,7 +268,7 @@ void sub_8066BD4(Entity *param_1) info->heldItem = *item; *item = temp; PlaySoundEffect(0x14d); - SendMessage(param_1,*gUnknown_80F8DB4); + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8DB4); if (sub_80706A4(entity,&entity->pos) != 0) { sub_807D148(param_1,entity,0,0); } @@ -304,13 +304,13 @@ void HandlePlaceItemAction(Entity *param_1) item = sub_8044D90(entity,0,4); sub_8045BF8(gFormatItems,item); if (info->action.unk4[0].actionUseIndex == 0x80) { - SendMessage(entity,*gUnknown_80F8DE0); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8DE0); } else if ((info->action.unk4[0].actionUseIndex < 0x15) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) { - SendMessage(entity,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8BE0); } else if ((info->action.unk4[0].actionUseIndex == 0x81) && ((item->flags & ITEM_FLAG_STICKY))) { - SendMessage(entity,*gUnknown_80F8BE0); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8BE0); } else { tile = GetTile(entity->pos.x, entity->pos.y); @@ -322,7 +322,7 @@ void HandlePlaceItemAction(Entity *param_1) sub_8045BF8(gFormatItems,item); if (sub_80460F8(&entity->pos,item,1) == 0) { _message: - SendMessage(entity,*gUnknown_80F8E04); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E04); } else { @@ -332,7 +332,7 @@ void HandlePlaceItemAction(Entity *param_1) FillInventoryGaps(); PlaySoundEffect(0x14d); SetMessageArgument(gAvailablePokemonNames,entity,0); - SendMessage(entity,*gUnknown_80F8E28); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E28); sub_807AB38(entity,gDungeon->unk3A08); } } diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 796087c73..4e648efad 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -10,6 +10,7 @@ #include "dungeon_map_access.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" +#include "dungeon_message.h" #include "dungeon_util.h" #include "game_options.h" #include "move_effects_target.h" @@ -35,7 +36,6 @@ extern u8 *gUnknown_80FCC7C[]; extern u8 *gUnknown_80FCCAC[]; extern u8 *gUnknown_80FDCC8[]; -void sub_80522F4(Entity *r0, Entity *r1, const char r2[]); extern void sub_8042900(Entity *r0); extern void sub_8042968(Entity *r0); extern void sub_806ABAC(Entity *, Entity *); @@ -174,7 +174,7 @@ void sub_8069F9C(Entity *pokemon,Entity * target,Move *move) iVar6->abilities[abilityIndex] = local_20[randomIndex]; gDungeon->unkC = 1; SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FCC7C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC7C); sub_8042900(target); sub_806ABAC(pokemon,target); } @@ -194,7 +194,7 @@ _0806A068: SetMessageArgument(gAvailablePokemonNames,target,0); __src = GetUnformattedTypeString(iVar6->types[0]); strcpy(gFormatItems,__src); - sub_80522F4(pokemon,target,*gUnknown_80FCCAC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCAC); sub_8042968(target); } } @@ -219,7 +219,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move) SetMessageArgument(gAvailablePokemonNames,target,0); typeString = GetUnformattedTypeString(uVar2_u32); strcpy(gFormatItems,typeString); - sub_80522F4(pokemon,target,*gUnknown_80FDCC8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCC8); } } } diff --git a/src/code_806CD90.c b/src/code_806CD90.c index db46caaa5..aa1401b5b 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -34,12 +34,12 @@ #include "dungeon_pokemon_attributes.h" #include "code_8041AD0.h" #include "type_chart.h" +#include "dungeon_message.h" extern u8 gUnknown_202F221; extern u8 gUnknown_202DFE8[]; extern void sub_806BFC0(EntityInfo *, u32); -extern void sub_805239C(Entity *, const u8 *); const u8 gUnknown_8106EEF[] = {0x03, 0x04, 0x05, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 }; @@ -259,7 +259,6 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc extern void sub_807F43C(Entity *, Entity *); extern void sub_8041B18(Entity *pokemon); extern void sub_8041B90(Entity *pokemon); -extern void sub_80522F4(Entity *, Entity *, const u8 *); extern void sub_8041D00(Entity *pokemon, Entity *target); extern void DealDamageToEntity(Entity *, s32, u32, u32); extern void SetShopkeeperAggression(Entity *, Entity *); @@ -323,7 +322,7 @@ extern const u8 *const gUnknown_80F9D28[]; extern u8 gAvailablePokemonNames[]; extern u32 gFormatData_202DE30; -void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, s32 giveExp, s16 arg4, bool32 arg8, s32 argC) +void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC) { bool32 r9; // Some compiler weirdness, because it won't match without creating arg4 again @@ -383,7 +382,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * if (returnDmg) { struct DamageStruct sp; - sub_80522F4(attacker, target, gUnknown_80FCFA4); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCFA4); sp.dmg = (dmgStruct->dmg * returnDmg) / 4; sp.type = dmgStruct->type; sp.residualDmgType = 6; @@ -410,30 +409,30 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * && !HasAbility(attacker, ABILITY_LEVITATE) && DungeonRandInt(100) < gUnknown_80F4E10) { - attackerInfo->unk178 |= 1; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_ARENA_TRAP; } if (HasAbility(target, ABILITY_SHADOW_TAG) && DungeonRandInt(100) < gUnknown_80F4E12) { - attackerInfo->unk178 |= 2; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_SHADOW_TAG; } if (HasAbility(target, ABILITY_MAGNET_PULL) && MonsterIsType(attacker, TYPE_STEEL) && DungeonRandInt(100) < gUnknown_80F4E14) { - attackerInfo->unk178 |= 4; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_MAGNET_PULL; } if (HasAbility(target, ABILITY_STATIC) && isPhysical && DungeonRandInt(100) < gUnknown_80F4E16) { - attackerInfo->unk178 |= 8; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STATIC; } if (HasAbility(target, ABILITY_POISON_POINT) && DungeonRandInt(100) < gUnknown_80F4E18) { - attackerInfo->unk178 |= 0x20; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_POISON_POINT; } if (HasAbility(target, ABILITY_EFFECT_SPORE) && isPhysical @@ -441,27 +440,27 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * { s32 rnd = DungeonRandInt(3); if (rnd < 1) - attackerInfo->unk178 |= 0x40; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_PSN; else if (rnd < 2) - attackerInfo->unk178 |= 0x10; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_PRLZ; else - attackerInfo->unk178 |= 0x80; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_SLP; } if (HasAbility(target, ABILITY_FLAME_BODY) && DungeonRandInt(100) < gUnknown_80F4E1C) { - attackerInfo->unk178 |= 0x100; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_FLAME_BODY; } if (HasAbility(target, ABILITY_CUTE_CHARM) && isPhysical && DungeonRandInt(100) < gUnknown_80F4E1E) { - attackerInfo->unk178 |= 0x200; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_CUTE_CHARM; } if (HasAbility(target, ABILITY_STENCH) && DungeonRandInt(100) < gUnknown_80F4E20) { - attackerInfo->unk178 |= 0x400; + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STENCH; } } if (!EntityExists(attacker) || !EntityExists(target)) @@ -519,14 +518,14 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc if (arg4 != 0x20E && HasAbility(target, ABILITY_STURDY) && dmgStruct->dmg == 9999) { SetMessageArgument(gUnknown_202DFE8, target, 0); - sub_80522F4(attacker, target, gUnknown_80FCA90); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90); sub_8042238(attacker, target); dmgStruct->unkF = 1; return FALSE; } if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) { SetMessageArgument(gUnknown_202DFE8, target, 0); - sub_80522F4(attacker, target, gUnknown_80F9600); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); sub_8042238(attacker, target); dmgStruct->unkF = 1; return FALSE; @@ -551,17 +550,17 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc if (targetData->unk152 == 0) { if (dmgStruct->isCrit) { - sub_80522F4(attacker, target, gUnknown_80F9614); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9614); } switch (dmgStruct->typeEffectiveness) { case EFFECTIVENESS_IMMUNE: - sub_80522F4(attacker, target, gUnknown_80F9630); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9630); break; case EFFECTIVENESS_RESIST: - sub_80522F4(attacker, target, gUnknown_80F9654); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9654); break; case EFFECTIVENESS_SUPER: - sub_80522F4(attacker, target, gUnknown_80F9670); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9670); break; } } @@ -571,13 +570,13 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc if (dmgStruct->dmg == 0) { if (sub_8045888(attacker) && sub_8045888(target)) { if (targetData->unk152 == 0) { - sub_80522F4(attacker, target, gUnknown_80F9688); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); } sub_8042238(attacker, target); } else { if (targetData->unk152 == 0) { - sub_80522F4(attacker, target, gUnknown_80F9688); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); } sub_803E708(0x1E, 0x18); } @@ -592,7 +591,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_8049ED4(); } if (targetData->unk152 == 0) { - sub_80522F4(attacker, target, gUnknown_80F96A8); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F96A8); } targetData->unkA0 = 999; } @@ -602,8 +601,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc gFormatData_202DE30 = dmgStruct->dmg; str = gUnknown_80F9764[dmgStruct->residualDmgType]; - // Needed to match - the line can be safely removed - dmgStruct++;dmgStruct--; + ASM_MATCH_TRICK(dmgStruct); targetData->unkA0 += dmgStruct->dmg; if (targetData->unkA0 > 999) @@ -614,12 +612,12 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_803ED30(-dmgStruct->dmg, target, 1, -1); } if (targetData->unk152 == 0 && str != NULL) { - sub_80522F4(attacker, target, str); + TryDisplayDungeonLoggableMessage3(attacker, target, str); } } else { if (targetData->unk152 == 0 && str != NULL) { - sub_80522F4(attacker, target, str); + TryDisplayDungeonLoggableMessage3(attacker, target, str); } } } @@ -661,12 +659,12 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc if (targetData->protection.protectionStatus == STATUS_ENDURING) { if (targetData->HP == 0) { targetData->HP = 1; - sub_80522F4(attacker, target, gUnknown_8100548); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_8100548); } } else if (isFalseSwipe == TRUE && targetData->HP == 0) { targetData->HP = 1; - sub_80522F4(attacker, target, gUnknown_810056C); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_810056C); } hpChange = hpBefore - targetData->HP; @@ -718,42 +716,42 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc SetMessageArgument(gAvailablePokemonNames + 0x50, target, 0); if (dmgStruct->residualDmgType == 19 || dmgStruct->residualDmgType == 20) { if (targetData->isNotTeamMember) { - sub_80522F4(attacker, target, gUnknown_80F9E44); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9E44); } else { - sub_805239C(attacker, gUnknown_80F9E44); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9E44); } } else if (targetData->isNotTeamMember) { if (targetData->clientType == CLIENT_TYPE_CLIENT) { - sub_805239C(attacker, gUnknown_80F9DF0[r8]); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); } else { - sub_80522F4(attacker, target, gUnknown_80F9CC0[r8]); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9CC0[r8]); } } else { PokemonStruct2 *recruitedMon = &gRecruitedPokemonRef->pokemon2[targetData->teamIndex]; if (targetData->isTeamLeader || (targetData->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk65C == 0)) { - sub_805239C(attacker, gUnknown_80F9CEC[r8]); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]); } else if (IsClientOrTeamBase(targetData->joinedAt.joinedAt)) { - sub_805239C(attacker, gUnknown_80F9DAC[r8]); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]); } else if (targetData->clientType == CLIENT_TYPE_CLIENT) { - sub_805239C(attacker, gUnknown_80F9DF0[r8]); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); } else if (sub_806A58C(recruitedMon->unkA)) { if (gDungeon->unk65D != 0) { - sub_805239C(attacker, gUnknown_80F9D8C[r8]); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D8C[r8]); } else { - sub_805239C(attacker, gUnknown_80F9D84[r8]); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D84[r8]); } } else { - sub_805239C(attacker, gUnknown_80F9D28[r8]); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D28[r8]); } } @@ -791,7 +789,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); SetMessageArgument(gUnknown_202DFE8, target, 0); - sub_805239C(attacker, gUnknown_80FD46C); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); return FALSE; } @@ -849,7 +847,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc EntityUpdateStatusSprites(target); SetMessageArgument(gAvailablePokemonNames, target, 0); SetMessageArgument(gAvailablePokemonNames + 0x50, teamMember, 0); - sub_805239C(attacker, gUnknown_80FD484); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484); sub_806F63C(target); return FALSE; } @@ -902,7 +900,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); SetMessageArgument(gUnknown_202DFE8, target, 0); - sub_805239C(attacker, gUnknown_80FD46C); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); return FALSE; } diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 5d54e698c..becd63472 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -4,6 +4,7 @@ #include "dungeon_pokemon_attributes.h" #include "status_checks_1.h" #include "text_util.h" +#include "dungeon_message.h" extern u8 *gUnknown_80FEE04[]; extern u8 *gUnknown_80FEE2C[]; @@ -12,7 +13,6 @@ extern u8 *gUnknown_80FEE54[]; void sub_8042940(Entity *r0); void sub_80428B0(Entity *r0); void sub_80428C4(Entity *r0); -void sub_80522F4(Entity *r0, Entity *r1, const char r2[]); void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s32 *param_5, s32 param_6) { @@ -30,13 +30,13 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3 s32 r10; s32 sp_0x4; s32 sp_0x8; - + r7 = 1; r8 = 1; sp_0x4 = 1; sp_0x8 = 1; r10 = IsTypePhysical(param_3) == 0; - + if (HasAbility(pokemon, ABILITY_GUTS)) { entityInfo = pokemon->info; @@ -47,7 +47,7 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3 } if (visFlags_pokemon_1) { sub_80428B0(pokemon); - sub_80522F4(pokemon,target,*gUnknown_80FEE04); // Guts boosted its power + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE04); // Guts boosted its power } } @@ -64,7 +64,7 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3 } if (visFlags_pokemon_2) { sub_80428C4(pokemon); - sub_80522F4(pokemon,target,*gUnknown_80FEE2C); // It's special ability boosted Attack + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE2C); // It's special ability boosted Attack } } @@ -108,7 +108,7 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3 } if (visFlags_target) { sub_8042940(target); - sub_80522F4(pokemon,target,*gUnknown_80FEE54); // Its special ability quickened attacks! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE54); // Its special ability quickened attacks! } } diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index cdd1a6e09..d100ad0ac 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -5,7 +5,7 @@ #include "code_80118A4.h" #include "code_803E668.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "code_8097670.h" @@ -45,8 +45,6 @@ extern u8 *gUnknown_80FA090[]; void sub_8068FE0(Entity *, u32, Entity *); u8 sub_806B8CC(); bool8 sub_805FBE8(u8 *a0); -extern s32 sub_8052B8C(u32, const u8 *, u32); -extern void PrintFieldMessage(u32, const u8 *, u32); void sub_8083D88(); u8 sub_808529C(s32); extern u8 GetBodySize(s16 index); @@ -749,9 +747,9 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa sub_806CE68(entity2, direction); CopyCyanMonsterNametoBuffer(gAvailablePokemonNames,param_3->id); - if (sub_8052B8C(0,*gUnknown_80F9FE8,1) == 0) { + if (DisplayDungeonYesNoMessage(0,*gUnknown_80F9FE8,1) == 0) { if (param_3->id != MONSTER_JIRACHI) { - SendMessage(entity1,*gUnknown_80FA004); + TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA004); } return 0; } @@ -764,7 +762,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } if (pokeIndex == MAX_TEAM_MEMBERS) { - SendMessage(entity1,*gUnknown_80FA030); + TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA030); return FALSE; } else { @@ -805,25 +803,25 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa sub_8097848(); if (sub_806B8CC(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) { - SendMessage(entity1,*gUnknown_80FA058); + TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA058); pokeStruct2->unk0 = 0; } else { sub_8083D88(); sub_803E708(0xa0,0x46); - if (sub_8052B8C(0,*gUnknown_80FA090,1) == 1) { + if (DisplayDungeonYesNoMessage(0,*gUnknown_80FA090,1) == 1) { while (sub_805FBE8(pokeStruct2->name) == 0) { - PrintFieldMessage(0,*gUnknown_80FA0C8,1); + DisplayDungeonMessage(0,*gUnknown_80FA0C8,1); } } sub_808D9DC(gAvailablePokemonNames,pokeStruct2,0); - SendMessage(entity1,*gUnknown_80FA0F0); + TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA0F0); if (flag) { leader = xxx_call_GetLeader(); SetMessageArgument(gAvailablePokemonNames,leader,0); sub_8092558(gUnknown_202E628,friendArea); PlaySound(0xce); - PrintFieldMessage(0,*gUnknown_80FA120,1); + DisplayDungeonMessage(0,*gUnknown_80FA120,1); } if (param_3->id == MONSTER_MEW) { gDungeon->unk4 = 1; @@ -1072,9 +1070,9 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) pokeStruct2->unk0 = 0; } else { - if (sub_8052B8C(0,*gUnknown_80FA090,1) == 1) { + if (DisplayDungeonYesNoMessage(0,*gUnknown_80FA090,1) == 1) { while (!sub_805FBE8(buffer)) { - PrintFieldMessage(0,*gUnknown_80FA0C8,1); + DisplayDungeonMessage(0,*gUnknown_80FA0C8,1); } } if (flag) { @@ -1082,7 +1080,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) SetMessageArgument(gAvailablePokemonNames,leader,0); sub_8092558(gUnknown_202E628,friendArea); PlaySound(0xce); - PrintFieldMessage(0,*gUnknown_80FA120,1); + DisplayDungeonMessage(0,*gUnknown_80FA120,1); } sub_808D9DC(gUnknown_202E088,pokeStruct2,0); *entityPtr = local_2c; diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 7c231e42e..dd5f0f765 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -3,6 +3,7 @@ #include "dungeon_capabilities.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_leader.h" +#include "dungeon_message.h" #include "code_8045A00.h" #include "code_8077274_1.h" #include "constants/dungeon.h" @@ -55,7 +56,6 @@ extern u8 gUnknown_8107010[8]; extern u8 *gUnknown_8107018[3]; extern void sub_80421C0(Entity *pokemon, u16 r1); -void sub_80528F4(Entity *, u8 *); void sub_8083D58(void); void sub_8072778(Entity *, Entity *, u8, u8); bool8 sub_80725A4(Entity *, Entity *); @@ -64,15 +64,12 @@ bool8 sub_80723D0(Entity *, Entity *, u8, u8); void sub_807218C(Entity *); void sub_806A2BC(Entity *, u32); void sub_806A3D4(u8 *, s32, s32, s32); -extern void PrintFieldMessage(u32, u8 *, u32); extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8); -extern void sub_805239C(struct Entity *r0, const char r1[]); extern void sub_8042920(struct Entity *r0); extern s16 sub_803D970(u32); extern s32 sub_803DA20(s32 param_1); extern bool8 sub_806AA0C(s32, u32); extern bool8 sub_8083660(struct Position *param_1); -extern void sub_80522F4(Entity *pokemon, Entity *r1, const u8[]); void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); // TODO: change to s32 void sub_8071B48(void) @@ -140,7 +137,7 @@ void sub_8071B48(void) } if (entityPtr != NULL) { - sub_805239C(0,*gUnknown_80FED68); + DisplayDungeonLoggableMessageTrue(0,*gUnknown_80FED68); sub_8042920(entityPtr); } if (dungeon->unk66E != 0) { @@ -329,7 +326,7 @@ void sub_8071DA4(Entity *entity) " ldr r2, [r0]\n" " ldr r0, [sp, 0xB4]\n" " mov r1, r8\n" -" bl sub_80522F4\n" +" bl TryDisplayDungeonLoggableMessage3\n" " ldr r0, [sp, 0xB4]\n" " mov r1, r8\n" " movs r2, 0x1\n" @@ -466,7 +463,7 @@ void sub_8071DA4(Entity *entity) " ldr r2, [r0]\n" " ldr r0, [sp, 0xB4]\n" " mov r1, r8\n" -" bl sub_80522F4\n" +" bl TryDisplayDungeonLoggableMessage3\n" "_08071FC4:\n" " adds r4, 0x1\n" " cmp r4, 0xB\n" @@ -554,7 +551,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) { SetMessageArgument(gAvailablePokemonNames,target,0); CopyTacticsNameToBuffer(gFormatItems,tacticIndex); - sub_80522F4(pokemon,target,*gUnknown_80FF730); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF730); } } } @@ -562,7 +559,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para info->unk149 = 0; if ((flag == 0) && (param_4 != 0)) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80F9B74); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F9B74); } } } @@ -603,7 +600,7 @@ void sub_807218C(Entity *pokemon) { strcpy(buffer, *gUnknown_80FCF18); } - PrintFieldMessage(0, buffer, 1); + DisplayDungeonMessage(0, buffer, 1); buffer[0] = 0; @@ -642,7 +639,7 @@ void sub_807218C(Entity *pokemon) } if(buffer[0]) - PrintFieldMessage(0, buffer, 1); + DisplayDungeonMessage(0, buffer, 1); sub_806A2BC(GetLeader(), 0); } @@ -677,7 +674,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level) if(!flag) { SetMessageArgument(gAvailablePokemonNames, target, 0); - sub_80522F4(pokemon, target, *gUnknown_80F9B94); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9B94); } } } @@ -718,7 +715,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) gFormatData_202DE30[0] = level; SetMessageArgument_2(gAvailablePokemonNames, info, 0); - sub_80528F4(target, *gUnknown_80F9E80); + DisplayDungeonLoggableMessage(target, *gUnknown_80F9E80); } else { @@ -726,7 +723,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) sub_8083D58(); gFormatData_202DE30[0] = level; SetMessageArgument_2(gAvailablePokemonNames, info, 0); - sub_805239C(target, *gUnknown_80F9E80); + DisplayDungeonLoggableMessageTrue(target, *gUnknown_80F9E80); } } flag = TRUE; @@ -873,12 +870,12 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target) { gFormatData_202DE30[0] = info->level; sub_80421C0(target, 0xD3 << 1); - sub_80522F4(pokemon, target, *gUnknown_80F9EC8); // $m0 dropped to Level $d0! + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9EC8); // $m0 dropped to Level $d0! return TRUE; } else { - sub_80522F4(pokemon, target, *gUnknown_80F9EEC); // $m0's level didn't drop! + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9EEC); // $m0's level didn't drop! return FALSE; } } diff --git a/src/code_8072B78.c b/src/code_8072B78.c index bae673058..b130e80f7 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -4,6 +4,7 @@ #include "dungeon_map_access.h" #include "dungeon_movement.h" #include "dungeon_random.h" +#include "dungeon_message.h" #include "moves.h" #include "pokemon_mid.h" #include "pokemon_mid.h" @@ -31,7 +32,6 @@ struct unkStruct_806B7F8 extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8); extern void sub_806BFC0(EntityInfo *, u32); void sub_8069E0C(Entity *pokemon); -void sub_80522F4(Entity *r0, Entity *r1, const char r2[]); void sub_8042A44(Entity *r0); void sub_8083D78(void); extern bool8 sub_803D930(u32); @@ -121,7 +121,7 @@ void sub_8072B78(Entity *pokemon, Entity *target, s16 id) sub_806BFC0(entityInfo,0); sub_8069E0C(target); sub_806CCB4(target,7); - sub_80522F4(pokemon,target,*gUnknown_80FE2EC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE2EC); sub_8042A44(target); sub_8083D78(); if (id_s32 == MONSTER_NINJASK) { diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 7df93e973..cab0f537f 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -29,19 +29,17 @@ #include "constants/move_id.h" #include "constants/weather.h" #include "number_util.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_8077274_1.h" #include "dungeon_pokemon_attributes.h" extern bool8 sub_8044B28(void); extern void sub_8075708(Entity *entity); -extern void sub_80526D0(u8 r0); extern void DealDamageToEntity(Entity *, s32, u32, u32); extern void sub_8067110(Entity *); extern void sub_80671A0(Entity *); extern void sub_8073D14(Entity *); extern void sub_8045BF8(u8 *, Item *); -extern void sub_805239C(Entity *, const u8 *); extern bool8 sub_80461C8(Position *, u32); extern void sub_805229C(void); extern void sub_807E8F0(Entity *); @@ -52,7 +50,7 @@ extern void sub_80420B8(Entity *pokemon); extern void sub_8041C4C(Entity *pokemon, u32 r1); extern void sub_805E804(void); extern void sub_80838EC(u8 *a); -extern bool8 sub_8055FA0(struct Entity *, u32, u32, u32, u32, struct Move *); +extern bool8 TryUseChosenMove(struct Entity *, u32, u32, u32, u32, struct Move *); extern bool8 sub_8045888(Entity *); extern void nullsub_97(Entity *entity); extern void sub_805EE30(void); @@ -161,7 +159,7 @@ void sub_8073D14(Entity *entity) if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) { sub_8045BF8(gFormatItems, groundItem); SetMessageArgument(gAvailablePokemonNames, entity, 0); - sub_805239C(entity, gMonTerrifiedCouldntPickUpItem); + DisplayDungeonLoggableMessageTrue(entity, gMonTerrifiedCouldntPickUpItem); } else if (!_entityInfo->isNotTeamMember && GetItemCategory(groundItem->id) == CATEGORY_POKE) { // Why check the same thing again? @@ -174,7 +172,7 @@ void sub_8073D14(Entity *entity) AddToTeamMoney(GetMoneyValue(groundItem)); sub_8045BF8(gFormatItems, groundItem); sub_80461C8(&entity->pos, 1); - sub_805239C(entity, gMonPickedUpItem); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem); } else { s32 i, nItems, newInventoryId; @@ -238,9 +236,9 @@ void sub_8073D14(Entity *entity) sub_80461C8(&entity->pos, 1); PlaySoundEffect(0x14A); if (inventoryIds[newInventoryId] <= -1) - sub_805239C(entity, gMonPickedUpItem2); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); else - sub_805239C(entity, gMonPickedUpItemToolbox); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItemToolbox); return; } @@ -253,7 +251,7 @@ void sub_8073D14(Entity *entity) if (i == nItems) { sub_8045BF8(gFormatItems, groundItem); - sub_805239C(entity, gMonSteppedOnItem); + DisplayDungeonLoggableMessageTrue(entity, gMonSteppedOnItem); } else { if (_entityInfo->isNotTeamMember) { @@ -267,16 +265,16 @@ void sub_8073D14(Entity *entity) _entityInfo->heldItem = *groundItem; sub_8045BF8(gFormatItems, groundItem); sub_80461C8(&entity->pos, 1); - sub_805239C(entity, gMonPickedUpItem2); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); } else if (AddItemToInventory(groundItem)) { SetMessageArgument(gAvailablePokemonNames, entity, 0); - sub_805239C(entity, gMonCouldntPickUpItem); + DisplayDungeonLoggableMessageTrue(entity, gMonCouldntPickUpItem); } else { sub_8045BF8(gFormatItems, groundItem); sub_80461C8(&entity->pos, 1); - sub_805239C(entity, gMonPickedUpItemToolbox); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItemToolbox); } } } @@ -388,7 +386,7 @@ void sub_8074094(Entity *entity) if (str != NULL) { if (sound) PlaySoundEffect(0x153); - SendMessage(entity, str); + TryDisplayDungeonLoggableMessage(entity, str); sub_803E708(0x1E, 0x32); } } @@ -577,10 +575,10 @@ void sub_8074094(Entity *entity) if (!EntityExists(entity) || sub_8044B28()) return; SetMessageArgument(gUnknown_202DFE8, entity, 0); - SendMessage(entity, gUnknown_80FEB30); + TryDisplayDungeonLoggableMessage(entity, gUnknown_80FEB30); TrySendImmobilizeSleepEndMsg(entity, entity); if (entityInfo->protection.protectionStatus == STATUS_PROTECT) { - SendMessage(entity, gPtrProtectSavedItMessage); + TryDisplayDungeonLoggableMessage(entity, gPtrProtectSavedItMessage); } else { DealDamageToEntity(entity, 0x270F, 0xB, 0x20E); @@ -600,7 +598,7 @@ void sub_8074094(Entity *entity) UseAttack(NULL); InitPokemonMove(&bideMove, MOVE_BIDE_2); bideMove.moveFlags |= MOVE_FLAG_LAST_USED; - sub_8055FA0(entity, 0, 0, 0, 0, &bideMove); + TryUseChosenMove(entity, 0, 0, 0, 0, &bideMove); if (!EntityExists(entity) || sub_8044B28()) return; entityInfo->unkA0 = 0; @@ -617,7 +615,7 @@ void sub_8074094(Entity *entity) entityInfo->charging.chargingStatus = 0; entityInfo->unk14A = 0; SetMessageArgument(gAvailablePokemonNames, entity, 0); - SendMessage(entity, gUnknown_80FABD8); + TryDisplayDungeonLoggableMessage(entity, gUnknown_80FABD8); } } @@ -773,7 +771,7 @@ void TickStatusHeal(Entity *entity) sub_80838EC(&entityInfo->terrifiedTurns); if (entityInfo->terrifiedTurns == 0) { SetMessageArgument(gAvailablePokemonNames, entity, 0); - SendMessage(entity, gPtrStenchWavedOffMessage); + TryDisplayDungeonLoggableMessage(entity, gPtrStenchWavedOffMessage); } } @@ -797,7 +795,7 @@ void TickStatusHeal(Entity *entity) if (oldSpdStage != newSpdStage) { SetMessageArgument(gAvailablePokemonNames, entity, 0); - SendMessage(entity, gUnknown_80FA124[newSpdStage]); + TryDisplayDungeonLoggableMessage(entity, gUnknown_80FA124[newSpdStage]); } } } diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 33624775a..f1d24c608 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -1,7 +1,7 @@ #include "global.h" #include "code_803E46C.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_805D8C8.h" #include "code_806CD90.h" #include "code_8077274_1.h" @@ -169,7 +169,6 @@ extern u8 *gUnknown_80FBF84[]; extern void sub_8049ED4(); extern void sub_8040A84(); -extern void sub_80522F4(Entity *pokemon, Entity *r1, const char[]); extern void EntityUpdateStatusSprites(Entity *); extern void sub_8042A74(Entity *r0); extern void sub_807EC28(bool8); @@ -224,11 +223,11 @@ void MuzzleTarget(Entity *pokemon, Entity *target) entityInfo->muzzled.muzzled = TRUE; entityInfo->muzzled.muzzledTurns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; nullsub_86(target); - sub_80522F4(pokemon, target, *gUnknown_80FBF68); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF68); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBF84); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF84); } EntityUpdateStatusSprites(target); } @@ -251,13 +250,13 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) entityInfo = target->info; if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) - sub_80522F4(pokemon, target, *gUnknown_80FBF04); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); else { SetMessageArgument(gAvailablePokemonNames, target, 0); iVar5 = sub_803D870(auStack544, 0); if (iVar5 == 0) - sub_80522F4(pokemon, target, *gUnknown_80FBEE4); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBEE4); else { sprite = NULL; @@ -274,7 +273,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) } if (index == DUNGEON_MAX_POKEMON || sprite == NULL) - sub_80522F4(pokemon, target, *gUnknown_80FBEE4); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBEE4); else { entityInfo->apparentID = apparentID; target->sprite = sprite; @@ -284,7 +283,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) nullsub_87(target); sub_806CCB4(target, sub_806CEBC(target)); CopyCyanMonsterNametoBuffer(gUnknown_202DFE8, entityInfo->apparentID); - sub_80522F4(pokemon, target, *gUnknown_80FBEC0); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBEC0); EntityUpdateStatusSprites(target); } } @@ -309,10 +308,10 @@ void MobileStatusTarget(Entity * pokemon, Entity * target) entityInfo->transformStatus.transformStatus = STATUS_MOBILE; entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; nullsub_88(target); - sub_80522F4(pokemon,target,*gUnknown_80FBF28); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF28); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBF50); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF50); } EntityUpdateStatusSprites(target); } @@ -341,11 +340,11 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) if(flag) { sub_8041DD8(target,param_3_s16); - sub_80522F4(pokemon,target,*gUnknown_80FC000); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC000); flag2 = TRUE; } if (entityInfo->exposed) { - sub_80522F4(pokemon,target,*gUnknown_80FBFB8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBFB8); } else { @@ -353,11 +352,11 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) sub_8041DD8(target,param_3_s16_2); } if (!MonsterIsType(target, TYPE_GHOST)) { - sub_80522F4(pokemon,target,*gUnknown_80FBFD8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBFD8); } else { entityInfo->exposed = TRUE; - sub_80522F4(pokemon,target,*gUnknown_80FBF9C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF9C); } EntityUpdateStatusSprites(target); } @@ -374,11 +373,11 @@ void IdentityItemHolders(Entity *pokemon, Entity *target) nullsub_89(target); gDungeon->itemHoldersIdentified = TRUE; EntityUpdateStatusSprites(target); - sub_80522F4(pokemon,target,*gUnknown_80FC028); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC028); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC054); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC054); } } } @@ -394,14 +393,14 @@ void BlindTarget(Entity *pokemon, Entity *target) entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; sub_8041E0C(target); - sub_80522F4(pokemon,target,*gUnknown_80FB7F4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7F4); sub_803E46C(0x31); sub_8049ED4(); sub_8040A84(); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB810); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB810); } EntityUpdateStatusSprites(target); } @@ -419,7 +418,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) { sub_8041E1C(target); - sub_80522F4(pokemon,target,*gUnknown_80FB834); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834); entityInfo->eyesightStatus.eyesightStatus = STATUS_CROSS_EYED; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F0C, TRUE) + 1; sub_803F580(0x1); @@ -428,7 +427,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) } else { - sub_80522F4(pokemon,target,*gUnknown_80FB85C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB85C); } EntityUpdateStatusSprites(target); } @@ -447,14 +446,14 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; sub_8041E3C(target); - sub_80522F4(pokemon,target,*gUnknown_80FB880); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB880); sub_803E46C(0x31); sub_8049ED4(); sub_8040A84(); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB89C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB89C); } EntityUpdateStatusSprites(target); } @@ -493,10 +492,10 @@ void RestorePPTarget(Entity * pokemon,Entity * target, s32 param_3) } if (PPChanged) { sub_8041E4C(target); - sub_80522F4(pokemon,target,*gUnknown_80FDBD0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBD0); } else { - sub_80522F4(pokemon,target,*gUnknown_80FDBF0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBF0); } EntityUpdateStatusSprites(target); } @@ -523,10 +522,10 @@ void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) entityInfo->atk = newStat; if (oldStat1 < (u8)newStat) { sub_8041E60(target); - sub_80522F4(pokemon,target,*gUnknown_80FC33C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC33C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC360); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC360); } EntityUpdateStatusSprites(target); } @@ -553,10 +552,10 @@ void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) entityInfo->spAtk = newStat; if (oldStat1 < (u8)newStat) { sub_8041E74(target); - sub_80522F4(pokemon,target,*gUnknown_80FC388); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC388); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC3B4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3B4); } EntityUpdateStatusSprites(target); } @@ -583,10 +582,10 @@ void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment) entityInfo->def = newStat; if (oldStat1 < (u8)newStat) { sub_8041E84(target); - sub_80522F4(pokemon,target,*gUnknown_80FC3D8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3D8); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC3FC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3FC); } EntityUpdateStatusSprites(target); } @@ -613,10 +612,10 @@ void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment) entityInfo->spDef = newStat; if (oldStat1 < (u8)newStat) { sub_8041E94(target); - sub_80522F4(pokemon,target,*gUnknown_80FC428); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC428); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC454); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC454); } EntityUpdateStatusSprites(target); } @@ -631,10 +630,10 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) { entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS; sub_8041EA4(target); - sub_80522F4(pokemon,target,*gUnknown_80FD20C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD20C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FD22C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD22C); } EntityUpdateStatusSprites(target); } @@ -648,10 +647,10 @@ void PierceStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) { entityInfo->itemStatus.itemStatus = STATUS_PIERCE; sub_8041EB4(target); - sub_80522F4(pokemon,target,*gUnknown_80FD254); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD254); } else { - sub_80522F4(pokemon,target,*gUnknown_80FD27C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD27C); } EntityUpdateStatusSprites(target); } @@ -670,7 +669,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * entityInfo = target->info; SetMessageArgument(gAvailablePokemonNames,target,0); if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) { - sub_80522F4(pokemon,target,*gUnknown_80FC074); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); } else { entityInfo->charging.chargingStatus = newStatus; @@ -702,7 +701,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * entityInfo->charging.chargingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA0, FALSE) + 1; } sub_8041BD0(target,uVar5); - sub_80522F4(pokemon,target,message); + TryDisplayDungeonLoggableMessage3(pokemon,target,message); EntityUpdateStatusSprites(target); // TODO: this could probably be cleaner.. @@ -745,7 +744,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) entityInfo = target->info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus == newStatus) { - sub_80522F4(pokemon,target,*gUnknown_80FB10C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); } else { nullsub_57(target); @@ -753,7 +752,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E98, FALSE) + 1; } entityInfo->protection.protectionStatus = newStatus; - sub_80522F4(pokemon,target,*gUnknown_80FB0E0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB0E0); EntityUpdateStatusSprites(target); } } @@ -770,10 +769,10 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_SAFEGUARD; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; nullsub_58(target); - sub_80522F4(pokemon,target,*gUnknown_80FB048); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB048); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB074); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB074); } EntityUpdateStatusSprites(target); } @@ -790,10 +789,10 @@ void MistStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_MIST; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; nullsub_59(target); - sub_80522F4(pokemon,target,*gUnknown_80FB09C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB09C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB0C4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB0C4); } EntityUpdateStatusSprites(target); } @@ -810,10 +809,10 @@ void WishStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_WISH; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; sub_8041B34(target); - sub_80522F4(pokemon,target,*gUnknown_80FAE1C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE1C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FAE3C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE3C); } EntityUpdateStatusSprites(target); } @@ -830,10 +829,10 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; nullsub_60(target); - sub_80522F4(pokemon,target,*gUnknown_80FAF5C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF5C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FAF8C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF8C); } EntityUpdateStatusSprites(target); } @@ -850,10 +849,10 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; nullsub_61(target); - sub_80522F4(pokemon,target,*gUnknown_80FB130); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB130); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB160); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB160); } EntityUpdateStatusSprites(target); } @@ -870,10 +869,10 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_REFLECT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; nullsub_62(target); - sub_80522F4(pokemon,target,*gUnknown_80FB17C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB17C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB1A8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB1A8); } EntityUpdateStatusSprites(target); } @@ -890,11 +889,11 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_PROTECT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FB9B0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9B0); } else { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FB9D8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9D8); } EntityUpdateStatusSprites(target); } @@ -911,10 +910,10 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; nullsub_64(target); - sub_80522F4(pokemon,target,*gUnknown_80FBAC0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAC0); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBAE4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAE4); } EntityUpdateStatusSprites(target); } @@ -931,10 +930,10 @@ void EndureStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_ENDURING; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; nullsub_65(target); - sub_80522F4(pokemon,target,*gUnknown_80FBBF0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBF0); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBC14); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC14); } EntityUpdateStatusSprites(target); } @@ -951,10 +950,10 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; nullsub_66(target); - sub_80522F4(pokemon,target,*gUnknown_80FBC38); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC38); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBC5C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC5C); } EntityUpdateStatusSprites(target); } @@ -968,7 +967,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) entityInfo = target->info; if(HasAbility(target, ABILITY_FORECAST)) - sub_80522F4(pokemon,target,*gPtrForecastPreventsConversion2Message); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message); else { SetMessageArgument(gAvailablePokemonNames,target,0); @@ -976,10 +975,10 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_CONVERSION2; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; nullsub_67(target); - sub_80522F4(pokemon,target,*gUnknown_80FBC7C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC7C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBCA4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCA4); } EntityUpdateStatusSprites(target); } @@ -997,10 +996,10 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target) entityInfo->protection.protectionStatus = STATUS_VITAL_THROW; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; nullsub_68(target); - sub_80522F4(pokemon,target,*gUnknown_80FBCC8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCC8); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBCF0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCF0); } EntityUpdateStatusSprites(target); } @@ -1047,10 +1046,10 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) } SetMessageArgument(gAvailablePokemonNames,target,0); if (statChanged) { - sub_80522F4(pokemon,target,*gUnknown_80FBD18); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD18); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBD3C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD3C); } EntityUpdateStatusSprites(target); } @@ -1085,11 +1084,11 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) SendMuzzledEndMessage(pokemon,target); if (entityInfo->perishSongTurns != 0) { entityInfo->perishSongTurns = 0; - sub_80522F4(pokemon,target,*gUnknown_8100594); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_8100594); } if (entityInfo->exposed) { entityInfo->exposed = FALSE; - sub_80522F4(pokemon,target,*gPtrExposedWoreOffMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrExposedWoreOffMessage); } } @@ -1101,7 +1100,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) if (moveSpeed != CalcSpeedStage(target)) { bVar8 = TRUE; - sub_80522F4(pokemon,target,gUnknown_80FA124[entityInfo->speedStage]); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[entityInfo->speedStage]); } for(index = 0; index < MAX_MON_MOVES; index++) @@ -1119,11 +1118,11 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) sub_80420C8(target); } if (moveUnsealed) { - sub_80522F4(pokemon,target,*gPtrSealedMoveReleasedMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrSealedMoveReleasedMessage); } } else if (param_4 == 0) { - sub_80522F4(pokemon,target,*gUnknown_81004E8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_81004E8); } EntityUpdateStatusSprites(target); } @@ -1169,21 +1168,21 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 break; case STATUS_SLEEP: isAsleep = TRUE; - sub_80522F4(pokemon,target,*gUnknown_80FA6E8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA6E8); break; case STATUS_SLEEPLESS: - sub_80522F4(pokemon,target,*gUnknown_80FA708); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA708); break; case STATUS_NIGHTMARE: isAsleep = TRUE; - sub_80522F4(pokemon,target,*gUnknown_80FA70C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA70C); if (param_4) { DealDamageToEntity(target,gUnknown_80F4F78,8,0x20f); } break; case STATUS_NAPPING: isAsleep = TRUE; - sub_80522F4(pokemon,target,*gUnknown_80FA710); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA710); HealTargetHP(pokemon,target,gUnknown_80F4F7A, 0, FALSE); entityInfo->sleep.sleep = 0; sub_8079F20(pokemon,target,1,1); @@ -1194,7 +1193,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 sub_8075C58(pokemon,target,CalculateStatusTurns(target, gUnknown_80F4F2C, TRUE) + 1, TRUE); return; } - sub_80522F4(pokemon,target,*gUnknown_80FA734); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA734); break; } entityInfo->sleep.sleep = STATUS_NONE; @@ -1219,13 +1218,13 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) break; case STATUS_POISONED: case STATUS_BADLY_POISONED: - sub_80522F4(pokemon,target,*gUnknown_80FA8A8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8A8); break; case STATUS_PARALYSIS: - sub_80522F4(pokemon,target,*gUnknown_80FA868); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA868); break; case STATUS_BURN: - sub_80522F4(pokemon,target,*gUnknown_80FA888); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA888); break; } @@ -1249,23 +1248,23 @@ void SendImmobilizeEndMessage(Entity * pokemon, Entity *target) case 8: break; case STATUS_FROZEN: - sub_80522F4(pokemon,target,*gUnknown_80FA8BC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); isFrozen = TRUE; break; case STATUS_CONSTRICTION: - sub_80522F4(pokemon,target,*gUnknown_80FA820); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA820); break; case STATUS_SHADOW_HOLD: case STATUS_INGRAIN: - sub_80522F4(pokemon,target,*gUnknown_80FA824); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA824); break; case STATUS_WRAP: case STATUS_WRAPPED: - sub_80522F4(pokemon,target,*gUnknown_80FA81C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA81C); sub_8076CB4(entityInfo->unk9C); break; case STATUS_PETRIFIED: - sub_80522F4(pokemon,target, *gPtrMonNoLongerPetrifiedMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerPetrifiedMessage); break; } entityInfo->immobilize.immobilizeStatus = STATUS_NONE; @@ -1289,25 +1288,25 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) case 8: break; case STATUS_CONFUSED: - sub_80522F4(pokemon,target,*gUnknown_80FA800); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA800); break; case STATUS_COWERING: - sub_80522F4(pokemon,target,*gUnknown_80FA97C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA97C); break; case STATUS_TAUNTED: - sub_80522F4(pokemon,target,*gUnknown_80FA9DC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA9DC); break; case STATUS_PAUSED: - sub_80522F4(pokemon,target,*gUnknown_80FAC38); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAC38); break; case STATUS_INFATUATED: - sub_80522F4(pokemon,target,*gUnknown_80FAB90); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAB90); break; case STATUS_ENCORE: - sub_80522F4(pokemon,target,*gUnknown_80FAAAC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAAAC); break; case STATUS_CRINGE: - sub_80522F4(pokemon,target, *gPtrMonNoLongerCringingMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerCringingMessage); break; } entityInfo->volatileStatus.volatileStatus = STATUS_NONE; @@ -1329,44 +1328,44 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) case 0xF: break; case STATUS_REFLECT: - SendMessage(target,*gUnknown_80FA638); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA638); break; case STATUS_SAFEGUARD: - SendMessage(target,*gUnknown_80FA69C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA69C); break; case STATUS_LIGHT_SCREEN: - SendMessage(target,*gUnknown_80FA658); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA658); break; case STATUS_COUNTER: case STATUS_MINI_COUNTER: - SendMessage(target,*gUnknown_80FA67C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA67C); break; case STATUS_MAGIC_COAT: - SendMessage(target,*gUnknown_80FA6BC); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6BC); break; case STATUS_WISH: - SendMessage(target,*gUnknown_80FA6D4); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6D4); break; case STATUS_PROTECT: - SendMessage(target,*gUnknown_80FA9C0); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9C0); break; case STATUS_MIRROR_COAT: - SendMessage(target,*gUnknown_80FAA68); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA68); break; case STATUS_ENDURING: - SendMessage(target, *gPtrMonStoppedEnduringMessage); + TryDisplayDungeonLoggableMessage(target, *gPtrMonStoppedEnduringMessage); break; case STATUS_MIRROR_MOVE: - SendMessage(target,*gPtrMonMirrorMoveFadedMessage); + TryDisplayDungeonLoggableMessage(target,*gPtrMonMirrorMoveFadedMessage); break; case STATUS_CONVERSION2: - SendMessage(target, *gPtrMonConversion2FailedMessage); + TryDisplayDungeonLoggableMessage(target, *gPtrMonConversion2FailedMessage); break; case STATUS_VITAL_THROW: - SendMessage(target, *gPtrMonGaveUpVitalThrowMessage); + TryDisplayDungeonLoggableMessage(target, *gPtrMonGaveUpVitalThrowMessage); break; case STATUS_MIST: - SendMessage(target,*gUnknown_80FAB40); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB40); break; } entityInfo->protection.protectionStatus = STATUS_NONE; @@ -1387,12 +1386,12 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) break; case STATUS_CURSED: if (waitingStatus != STATUS_CURSED) { - SendMessage(target,*gUnknown_80FA7BC); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7BC); } break; case STATUS_SNATCH: if (waitingStatus != STATUS_SNATCH) { - SendMessage(target,*gUnknown_80FA7DC); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7DC); } gDungeon->snatchPokemon = NULL; gDungeon->unk17B3C = 0; @@ -1404,7 +1403,7 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) gDungeon->decoyActive = FALSE; if (waitingStatus != STATUS_DECOY) { SetMessageArgument(gAvailablePokemonNames,target,0); - SendMessage(target,*gUnknown_80FA9A0); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9A0); } break; } @@ -1425,10 +1424,10 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target) case STATUS_NONE: break; case STATUS_LEECH_SEED: - SendMessage(target,*gUnknown_80FA79C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA79C); break; case STATUS_DESTINY_BOND: - SendMessage(target,*gUnknown_80FAA8C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA8C); break; } entityInfo->linked.linkedStatus = STATUS_NONE; @@ -1451,16 +1450,16 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) case 5: break; case STATUS_SURE_SHOT: - SendMessage(target,*gUnknown_80FA8E0); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA8E0); break; case STATUS_WHIFFER: - SendMessage(target,*gUnknown_80FA90C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA90C); break; case STATUS_SET_DAMAGE: - SendMessage(target,*gUnknown_80FA934); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA934); break; case STATUS_FOCUS_ENERGY: - SendMessage(target,*gUnknown_80FA95C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA95C); break; } entityInfo->moveStatus.moveStatus = STATUS_NONE; @@ -1485,17 +1484,17 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) break; case STATUS_INVISIBLE: isInvisible = TRUE; - SendMessage(target,*gUnknown_80FA9F4); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9F4); break; case STATUS_MOBILE: - SendMessage(target,*gUnknown_80FABBC); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABBC); break; case STATUS_TRANSFORMED: entityInfo->apparentID = sub_8069F54(target, entityInfo->id); target->sprite = GetSpriteData(entityInfo->apparentID); uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); - SendMessage(target,*gUnknown_80FAB6C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB6C); break; } entityInfo->transformStatus.transformStatus = STATUS_NONE; @@ -1519,13 +1518,13 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) case 4: break; case STATUS_BLINKER: - SendMessage(target,*gUnknown_80FAA0C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA0C); break; case STATUS_CROSS_EYED: - SendMessage(target,*gUnknown_80FAA2C); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA2C); break; case STATUS_EYEDROPS: - SendMessage(target,*gUnknown_80FAA48); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA48); break; } entityInfo->eyesightStatus.eyesightStatus = STATUS_NONE; @@ -1551,7 +1550,7 @@ void SendMuzzledEndMessage(Entity * pokemon, Entity * target) case 2: break; case TRUE: - SendMessage(target,*gUnknown_80FABC0); + TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABC0); break; } entityInfo->muzzled.muzzled = FALSE; @@ -1596,7 +1595,7 @@ void SendThawedMessage(Entity *pokemon, Entity *target) entityInfo->immobilize.immobilizeStatusTurns = 0; entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out! EntityUpdateStatusSprites(target); } } diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 6d73a02dd..e2eacb392 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -3,7 +3,7 @@ #include "constants/ability.h" #include "code_803E46C.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_806CD90.h" #include "code_807CD9C.h" #include "structs/str_dungeon.h" @@ -39,7 +39,6 @@ bool8 ExposeTrap(s32 x, s32 y); void sub_8040A84(); void sub_8049ED4(); void sub_806A5B8(Entity *); -void sub_80522F4(Entity *, Entity *, u8 *); void sub_80421C0(Entity *, u32); u8 sub_8045888(Entity *); void sub_807EC28(u32); @@ -66,19 +65,19 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) sp_0x24 = 10; if (IsCurrentFixedRoomBossFight()) { - sub_80522F4(pokemon,target,*gUnknown_80FC9E8); // It couldn't be knocked flying! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC9E8); // It couldn't be knocked flying! return; } else { if (pokemon == target) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FCA10); // {POKEMON_0} couldn't be knocked flying! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA10); // {POKEMON_0} couldn't be knocked flying! return; } SetMessageArgument(gAvailablePokemonNames,target,0); if (HasAbility(target,ABILITY_SUCTION_CUPS)) { - sub_80522F4(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! return; } else @@ -86,7 +85,7 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) (target->info->action).direction = (direction + 4) & DIRECTION_MASK; sub_806CDD4(target, 6, (direction + 4) & DIRECTION_MASK); sub_80421C0(target,0x1a3); - sub_80522F4(pokemon,target,*gUnknown_80F8A0C); // {POKEMON_0} was blown away! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F8A0C); // {POKEMON_0} was blown away! flag = TRUE; sp_0x28 = NULL; @@ -230,24 +229,24 @@ void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos) SetMessageArgument(gAvailablePokemonNames,target,0); if (HasAbility(target,ABILITY_SUCTION_CUPS)) { - sub_80522F4(pokemon,target,*gUnknown_80FCAE8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAE8); return; } if (IsCurrentFixedRoomBossFight()) { - sub_80522F4(pokemon,target,*gUnknown_80FC97C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC97C); return; } if (param_3 == 1) { pos2 = gDungeon->unkE21C; if(pos2.x == target->pos.x && pos2.y == target->pos.y) { - sub_80522F4(pokemon,target,*gUnknown_80FC9A0); // It's already on the stairs! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC9A0); // It's already on the stairs! PetrifiedStatusTarget(pokemon,target); return; } } - sub_80522F4(pokemon,target,*gUnknown_80FC584); // $m0 warped! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC584); // $m0 warped! TrySendImmobilizeSleepEndMsg(target,target); sub_80421AC(pokemon,target); if (sub_8045888(target)) { @@ -312,7 +311,7 @@ void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos) target->unk1C = 0; sub_803E46C(0x22); if (flag) { - sub_80522F4(pokemon,target,*gUnknown_80FCB14); // But it dropped back at the same spot! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCB14); // But it dropped back at the same spot! } if (param_3 == 1) { PetrifiedStatusTarget(pokemon,target); @@ -360,12 +359,12 @@ void sub_807D3CC(Entity *param_1) } } if (flag) { - SendMessage(param_1,*gUnknown_80FD2F8); // All traps were exposed + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80FD2F8); // All traps were exposed sub_8040A84(); sub_8049ED4(); } else { - SendMessage(param_1,*gUnknown_80FD320); // There appears to be no hidden traps. + TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80FD320); // There appears to be no hidden traps. } } diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c index feed949e2..a2582b05e 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -2,7 +2,7 @@ #include "code_804267C.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "constants/ability.h" #include "constants/type.h" #include "dungeon_ai.h" @@ -20,7 +20,6 @@ void sub_806A2BC(Entity *pokemon, u8 param_2); extern u8 sub_8044B28(void); extern void sub_8068FE0(Entity *, u32, Entity *r2); extern void nullsub_93(Position *); -extern void sub_80522F4(Entity *, Entity *, u8 *); extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); extern void sub_80694C0(Entity *, s32, s32, u32); extern void sub_807EC28(bool8); @@ -77,12 +76,12 @@ void sub_807E254(Entity *pokemon,Entity *target) if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) { SetMessageArgument(gAvailablePokemonNames,pokemon,0); - sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places } else if(HasAbility(target, ABILITY_SUCTION_CUPS)) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places } else { @@ -137,7 +136,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - SendMessage(leader,*gUnknown_80F9C4C); + TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C4C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); gDungeon->unk67A = 1; } @@ -149,7 +148,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - SendMessage(leader,*gUnknown_80F9C70); + TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C70); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); gDungeon->unk67A = 2; } @@ -161,7 +160,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - SendMessage(leader,*gUnknown_80F9C8C); + TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C8C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); gDungeon->unk67A = 3; } @@ -172,7 +171,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - SendMessage(leader,*gUnknown_80F9CBC); + TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9CBC); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); gDungeon->unk67A = 4; sub_8068FE0(leader,0x21e,leader); diff --git a/src/code_80869E4.c b/src/code_80869E4.c index a44b50a52..e2576aafd 100644 --- a/src/code_80869E4.c +++ b/src/code_80869E4.c @@ -23,7 +23,6 @@ s8 sub_8002984(s8, u8); extern void BgColorCallNullsub4(void); extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32); extern void PlaySoundEffect(u32); -extern void DisplayDungeonDialogue(const u8 *); extern void sub_8085EB0(void); @@ -292,7 +291,7 @@ void sub_8086690(void) sub_80855E4(sub_8086404); } -void sub_80866C4(const u8 *dialogue) +void sub_80866C4(const struct DungeonDialogueStruct *dialogue) { SpriteLookAroundEffect(xxx_call_GetLeader()); sub_803E708(10, 70); diff --git a/src/code_8086A3C.c b/src/code_8086A3C.c index e5df46e07..b08a0127a 100644 --- a/src/code_8086A3C.c +++ b/src/code_8086A3C.c @@ -22,7 +22,6 @@ extern u8 sub_8044B28(void); extern u8 gUnknown_202E038[]; extern void sub_8085374(); extern void sub_8068FE0(Entity *, u32, u32); -extern void DisplayDungeonDialogue(const u8 *); extern void sub_8086448(void); extern void SkarmoryEntry(Entity *); extern void sub_8086A54(Entity *); @@ -34,33 +33,33 @@ extern const u8 gUnknown_810739C[]; extern const u8 gUnknown_81073D4[]; extern const u8 gUnknown_810740C[]; extern const s16 gUnknown_80F57CC; -extern const u8 gUnknown_8101440[]; -extern const u8 gSkarmoryPreFightDialogue_1[]; -extern const u8 gSkarmoryPreFightDialogue_2[]; -extern const u8 gSkarmoryPreFightDialogue_3[]; -extern const u8 gSkarmoryPreFightDialogue_4[]; -extern const u8 gSkarmoryPreFightDialogue_5[]; -extern const u8 gSkarmoryPreFightDialogue_6[]; -extern const u8 gSkarmoryPreFightDialogue_7[]; -extern const u8 gSkarmoryPreFightDialogue_8[]; -extern const u8 gSkarmoryPreFightDialogue_9[]; -extern const u8 gSkarmoryReFightDialogue_1[]; -extern const u8 gSkarmoryReFightDialogue_2[]; -extern const u8 gSkarmoryReFightDialogue_3[]; -extern const u8 gTeamMeaniesPreFightDialogue_1[]; -extern const u8 gTeamMeaniesPreFightDialogue_2[]; -extern const u8 gTeamMeaniesPreFightDialogue_3[]; -extern const u8 gTeamMeaniesPreFightDialogue_4[]; -extern const u8 gTeamMeaniesPreFightDialogue_5[]; -extern const u8 gTeamMeaniesPreFightDialogue_6[]; -extern const u8 gTeamMeaniesPreFightDialogue_7[]; -extern const u8 gTeamMeaniesReFightDialogue_1[]; -extern const u8 gTeamMeaniesReFightDialogue_2[]; -extern const u8 gTeamMeaniesReFightDialogue_3[]; -extern const u8 gTeamMeaniesReFightDialogue_4[]; -extern const u8 gTeamMeaniesReFightDialogue_5[]; +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 u8 gUnknown_8100D3C[]; +extern const struct DungeonDialogueStruct gUnknown_8100D3C; void sub_8086A3C(Entity *pokemon) { @@ -184,33 +183,33 @@ void SkarmoryPreFightDialogue(void) SpriteShockEffect(PartnerEntity); sub_803E708(0x20,0x46); sub_803E708(10,0x46); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_1); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_1); ShiftCameraToPosition(&pos1,0x40); sub_803E708(0x40,0x46); ShiftCameraToPosition(&pos2,0x30); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_2); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_2); sub_803E708(10,0x46); DiglettEntity->info->unk15D = 1; ShiftCameraToPosition(&pos1,0x30); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_3); // Diglett: ...I...\nI'm scared. + 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?! + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_4); // Skarmory: You!\nWhat do you think you're doing here?! sub_803E708(10,0x46); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_5); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_5); sub_803E708(10,0x46); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_6); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_6); sub_803E708(10,0x46); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_7); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_7); sub_803E708(10,0x46); sub_806CDD4(SkarmoryEntity,0xd,0); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_8); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_8); sub_803E708(10,0x46); sub_80869E4(PartnerEntity,4,1,2); sub_80869E4(LeaderEntity,4,2,6); - DisplayDungeonDialogue(gSkarmoryPreFightDialogue_9); + DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_9); sub_80869E4(PartnerEntity,4,2,4); sub_80869E4(LeaderEntity,4,1,4); sub_803E708(10,0x46); @@ -232,12 +231,12 @@ void SkarmoryReFightDialogue(void) sub_803E708(10,0x46); SkarmoryEntry(SkarmoryEntity); ShiftCameraToPosition(&pos,0x10); - DisplayDungeonDialogue(gSkarmoryReFightDialogue_1); + DisplayDungeonDialogue(&gSkarmoryReFightDialogue_1); sub_803E708(10,0x46); - DisplayDungeonDialogue(gSkarmoryReFightDialogue_2); + DisplayDungeonDialogue(&gSkarmoryReFightDialogue_2); sub_803E708(10,0x46); sub_806CDD4(SkarmoryEntity,0xd,0); - DisplayDungeonDialogue(gSkarmoryReFightDialogue_3); + DisplayDungeonDialogue(&gSkarmoryReFightDialogue_3); sub_803E708(10,0x46); ShiftCameraToPosition(&LeaderEntity->pixelPos,0x10); DungeonStartNewBGM(MUS_BOSS_BATTLE); @@ -247,7 +246,7 @@ void sub_8086E40(void) { SpriteLookAroundEffect(xxx_call_GetLeader()); sub_803E708(10,0x46); - DisplayDungeonDialogue(gUnknown_8100D3C); + DisplayDungeonDialogue(&gUnknown_8100D3C); sub_803E708(10,0x46); gDungeon->unk2 = 1; } @@ -328,21 +327,21 @@ void TeamMeaniesPreFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); sub_8086448(); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_1); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_1); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_2); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); sub_803E708(10, 0x46); sub_8087144(); DungeonStartNewBGM(MUS_THERES_TROUBLE); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_3); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_3); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_4); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_4); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_5); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_5); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_6); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_6); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_7); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_7); sub_803E708(10, 0x46); ShiftCameraToPosition(&LeaderEntity->pixelPos, 0x10); } @@ -355,15 +354,15 @@ void TeamMeaniesReFightDialogue(void) LeaderEntity = xxx_call_GetLeader(); PartnerEntity = GetPartnerEntity(); sub_8086448(); - DisplayDungeonDialogue(gTeamMeaniesReFightDialogue_1); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_1); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_2); + DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); sub_803E708(10, 0x46); sub_8087144(); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesReFightDialogue_2); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_2); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesReFightDialogue_3); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_3); sub_803E708(10, 0x46); sub_806CDD4(LeaderEntity, 6, 4); sub_806CDD4(PartnerEntity, 6, 4); @@ -371,8 +370,8 @@ void TeamMeaniesReFightDialogue(void) sub_806CDD4(LeaderEntity, 7, 4); sub_806CDD4(PartnerEntity, 7, 4); sub_803E708(10, 0x46); - DisplayDungeonDialogue(gTeamMeaniesReFightDialogue_4); - DisplayDungeonDialogue(gTeamMeaniesReFightDialogue_5); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_4); + DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_5); sub_803E708(10, 0x46); ShiftCameraToPosition(&LeaderEntity->pixelPos, 0x10); } @@ -380,7 +379,7 @@ void TeamMeaniesReFightDialogue(void) void sub_8087130(void) { sub_8086448(); - sub_80866C4(gUnknown_8101440); + sub_80866C4(&gUnknown_8101440); } void sub_8087144(void) diff --git a/src/code_8099360.c b/src/code_8099360.c index 709536fe4..c9f43c45e 100644 --- a/src/code_8099360.c +++ b/src/code_8099360.c @@ -59,10 +59,10 @@ void sub_80993E4(void) { and is very long. I didn't want to split up the file or spend time decomping so here it is in asm(); -*/ +*/ void sub_8099648(void); -NAKED void sub_80993F0(void) +NAKED void sub_80993F0(void) { asm_unified(" .text\n" " push {r4-r7,lr}\n" @@ -272,7 +272,7 @@ NAKED void sub_80993F0(void) "_080995AE:\n" " bl sub_809D25C\n" " bl sub_80A59DC\n" -" bl xxx_draw_string_80144C4\n" +" bl DrawDialogueBoxString\n" " movs r0, 0\n" " movs r1, 0\n" " bl sub_8005838\n" diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index e8831c727..62c064869 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -3,7 +3,7 @@ #include "code_803E668.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_8077274_1.h" #include "code_808417C.h" #include "constants/ability.h" @@ -57,7 +57,7 @@ void sub_8075900(Entity *pokemon, u8 r1) if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) { // It's a monster house! - SendMessage(GetLeader(), gPtrItsaMonsterHouseMessage); + TryDisplayDungeonLoggableMessage(GetLeader(), gPtrItsaMonsterHouseMessage); gDungeon->monsterHouseTriggeredEvent = TRUE; sub_807AB38(pokemon, r1); sub_8041888(0); @@ -91,7 +91,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) { pokemonInfo->useHeldItem = FALSE; SetMessageArgument(gAvailablePokemonNames, pokemon, 0); - SendMessage(pokemon, gPtrCouldntBeUsedMessage); + TryDisplayDungeonLoggableMessage(pokemon, gPtrCouldntBeUsedMessage); return; } AIDecideUseItem(pokemon); diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 88e260294..a6b32d018 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -3,7 +3,7 @@ #include "charge_move.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_806CD90.h" #include "constants/direction.h" #include "constants/dungeon_action.h" @@ -60,7 +60,7 @@ extern void sub_8057588(Entity *, u32); extern void sub_806A1B0(Entity *); extern Item *sub_8044D90(Entity *, s32, u32); extern bool8 sub_8044D40(ActionContainer *, u32); -extern bool8 sub_8055FA0(struct Entity *, u32, u32, u32, u32, struct Move *); +extern bool8 TryUseChosenMove(struct Entity *, u32, u32, u32, u32, struct Move *); extern void sub_8045BF8(u8 *, struct Item *); extern void sub_8044DF0(struct Entity *, u32, u32); extern void sub_8071DA4(struct Entity *); @@ -995,14 +995,14 @@ void HandleUseOrbAction(Entity *pokemon) if (item->flags & ITEM_FLAG_STICKY) { sub_8045BF8(gFormatItems, item); - SendMessage(pokemon, *gItemStickyDoesntWorkText); + TryDisplayDungeonLoggableMessage(pokemon, *gItemStickyDoesntWorkText); return; } act = entityInfo->action; if (IsBossFight()) { - SendMessage(pokemon, *gPtrMysteriousPowerPreventedUseMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrMysteriousPowerPreventedUseMessage); r4 = TRUE; } else { @@ -1022,20 +1022,20 @@ void HandleUseOrbAction(Entity *pokemon) if (entityInfo->volatileStatus.volatileStatus == 1) { SetMessageArgument(gAvailablePokemonNames, pokemon, 0); - SendMessage(pokemon, *gUnknown_80FC714); + TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC714); r4 = FALSE; r8 = FALSE; } else if (entityInfo->volatileStatus.volatileStatus == 7) { SetMessageArgument(gAvailablePokemonNames, pokemon, 0); - SendMessage(pokemon, *gUnknown_80FC718); + TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC718); r4 = FALSE; r8 = FALSE; } else if (entityInfo->nonVolatile.nonVolatileStatus == 4) { SetMessageArgument(gAvailablePokemonNames, pokemon, 0); - SendMessage(pokemon, *gUnknown_80FC6A8); + TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC6A8); r4 = FALSE; r8 = FALSE; } @@ -1046,11 +1046,11 @@ void HandleUseOrbAction(Entity *pokemon) move.moveFlags |= MOVE_FLAG_SET; move.moveFlags |= MOVE_FLAG_ENABLED_FOR_AI; move.PP = 10; - sub_8055FA0(pokemon, 0, IVar5.id, 0, 0, &move); + TryUseChosenMove(pokemon, 0, IVar5.id, 0, 0, &move); r4 = FALSE; } else { - r4 = sub_8055FA0(pokemon, 0, IVar5.id, 0, 0, &move); + r4 = TryUseChosenMove(pokemon, 0, IVar5.id, 0, 0, &move); } } else { diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 62c6e3beb..08294a096 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -5,7 +5,7 @@ #include "code_803E46C.h" #include "code_804267C.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_8077274_1.h" #include "code_807CD9C.h" #include "constants/dungeon_action.h" @@ -71,7 +71,6 @@ void HandleSetItemAction(Entity *,bool8); void HandleUnsetItemAction(Entity *,bool8); extern u8 sub_8044B28(void); extern u8 UseAttack(Entity *); -void sub_8052740(u32); void sub_806A1E8(Entity *pokemon); extern void sub_80694C0(Entity *, s32, s32, u32); bool8 sub_804AE08(Position *pos); @@ -226,7 +225,7 @@ bool8 sub_8072CF4(Entity *entity) break; case ACTION_STAIRS: if ((gDungeon->dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { - SendMessage(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! } else { @@ -285,7 +284,7 @@ bool8 sub_8072CF4(Entity *entity) break; } SetMessageArgument(gAvailablePokemonNames,entity,0); - SendMessage(entity,*gUnknown_80FE6D4); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE6D4); break; case ACTION_TALK_FIELD: HandleTalkFieldAction(entity); @@ -313,7 +312,7 @@ bool8 sub_8072CF4(Entity *entity) break; case ACTION_SECOND_THOUGHTS: SetMessageArgument(gAvailablePokemonNames,entity,0); - SendMessage(entity,*gUnknown_80FE478); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE478); break; default: info->action.action = ACTION_PASS_TURN; @@ -341,7 +340,7 @@ bool8 sub_8072CF4(Entity *entity) } } if (bVar4) { - SendMessage(entity,*gUnknown_80FD2CC); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FD2CC); } } sub_807360C(); diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 358920bfc..23fe2ac2e 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -20,8 +20,6 @@ extern u8 *gUnknown_8105360[]; extern u8 *gUnknown_81053A8[]; extern u8 *gUnknown_8105434[]; -extern s32 sub_8052B8C(u32, u8 *, u32); -extern void PrintFieldMessage(u32, u8 *, u32); extern void sub_80416E0(Position32 *r0, u32, bool8); extern void sub_80421C0(Entity *, u32); extern void sub_80855E4(void *); @@ -75,7 +73,7 @@ void sub_8046D20(void) cVar1 = gDungeon->unk8; gDungeon->unk8 = sub_8046D70(); if (((gDungeon->unk8 == 1) && (cVar1 == 0)) && - (sub_8052B8C(0, *gUnknown_80FA408, 1) == 1)) { + (DisplayDungeonYesNoMessage(0, *gUnknown_80FA408, 1) == 1)) { gDungeon->unk4 = 1; gDungeon->unk11 = 2; } @@ -145,18 +143,18 @@ void MusicBoxCreation(void) entity = GetLeader(); sub_80855E4(sub_80861A8); gDungeon->unk1356C = 1; - PrintFieldMessage(0,*gUnknown_810531C,1); + DisplayDungeonMessage(0,*gUnknown_810531C,1); sub_803E708(0x3c,0x41); - PrintFieldMessage(0,*gUnknown_8105360,1); + DisplayDungeonMessage(0,*gUnknown_8105360,1); sub_80869E4(entity,4,10,0); sub_80416E0(&entity->pixelPos,0x10c,FALSE); sub_80421C0(entity,0xd7); sub_803E708(0x3c,0x41); SetMessageArgument(gAvailablePokemonNames,entity,0); - PrintFieldMessage(0,*gUnknown_81053A8,1); + DisplayDungeonMessage(0,*gUnknown_81053A8,1); sub_803E708(10,0x41); PlaySoundEffect(0xd4); - PrintFieldMessage(0,*gUnknown_8105434,1); + DisplayDungeonMessage(0,*gUnknown_8105434,1); sub_803E708(10,0x41); sub_804178C(1); gDungeon->unk1356C = 0; diff --git a/src/dungeon_message.c b/src/dungeon_message.c new file mode 100644 index 000000000..24abd230c --- /dev/null +++ b/src/dungeon_message.c @@ -0,0 +1,1127 @@ +#include "global.h" +#include "dungeon_message.h" +#include "dungeon.h" +#include "structs/dungeon_entity.h" +#include "code_803E46C.h" +#include "code_80130A8.h" +#include "code_800E9E4.h" +#include "menu_input.h" +#include "code_803E668.h" +#include "bg_palette_buffer.h" +#include "input.h" +#include "text2.h" +#include "pokemon.h" +#include "file_system.h" +#include "dungeon_util_1.h" +#include "code_800D090.h" +#include "dungeon_util.h" +#include "code_8045A00.h" +#include "exclusive_pokemon.h" +#include "dungeon_leader.h" +#include "text1.h" + +void sub_80526D0(s32 r0); +static void PutStringsOnMessageLog(void); +static bool8 TryScrollLogDown(s32 a0); +static bool8 TryScrollLogUp(s32 a0); +static void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2); +static void CreateMessageLogArrow(bool8 upArrow, s32 y); +static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, u8 r2); +static bool8 sub_8052DC0(Entity *); + +extern bool8 sub_8045888(Entity *pokemon); +extern u8 sub_803F428(Position *); +extern void sub_805E804(void); +extern void sub_803EAF0(s32, s32); +extern void sub_8040238(void); +extern void sub_8083E28(void); +extern bool8 sub_8008D8C(u32 strId); +extern u32 sub_8014140(s32 a0, const void *a1); +extern void sub_8083D30(void); +extern void sub_8083D08(void); +extern void sub_8007334(s32 a0); +extern void sub_80087EC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4); +extern void sub_8083CE0(u8 param_1); + +extern u32 gUnknown_202EDD0; +extern u8 gUnknown_203B40C; +extern u8 gUnknown_202EE01; +extern u8 gUnknown_203B434; +extern void (*gUnknown_203B08C)(s32); +extern void (*gUnknown_203B084)(s32 a0); +extern void (*gUnknown_203B080)(s32 a0); +extern u8 gAvailablePokemonNames[]; +extern u8 gUnknown_202E5D8[]; +extern u8 gUnknown_202DFE8[]; +extern UnkTextStruct1 gUnknown_2027370[4]; +extern s32 gUnknown_202EDCC; +extern u8 gFontPalette[]; + +extern const u8 gUnknown_80F7AE8[]; +extern const u8 gUnknown_80F7AF8[]; +extern const u8 gUnknown_80F7AFC[]; +extern const u8 gUnknown_80F7B04[]; +extern const u16 gUnknown_80F7AEA[]; + +static EWRAM_DATA Entity *sLastLogMsgEntity = NULL; +static UNUSED EWRAM_DATA u8 sUnused = 0; +static EWRAM_DATA SpriteOAM sUnknown_202F1F0 = {0}; +static EWRAM_DATA s32 sMessageLogCursor = 0; +static EWRAM_DATA u8 sMessageLogFlags = 0; +static EWRAM_DATA SpriteOAM sMessageLogArrowSpriteOAM = {0}; + +// Used for sMessageLogFlags +#define FLAG_CAN_SCROLL_UP 0x1 +#define FLAG_CAN_SCROLL_DOWN 0x2 + +// Needed to match :shrug: +static inline void InlineStrcpy(u8 *dst, const u8 *src) +{ + strcpy(dst, src); +} + +static inline void InlineStrncpy(u8 *dst, const u8 *src, s32 n) +{ + strncpy(dst, src, n); +} + +void sub_80521D0(void) +{ + s32 i; + + for (i = 0; i < UNK_1BBD4_STR_COUNT; i++) { + gDungeon->unk1BDD4.unk1C054[i] = 0; + } + sLastLogMsgEntity = NULL; + gUnknown_203B434 = 1; + sub_8052210(FALSE); +} + +void sub_8052210(bool8 a0) +{ + s32 i; + + for (i = 0; i < UNK_1BBD4_STR_COUNT; i++) { + InlineStrcpy(gDungeon->unk1BDD4.unk0[i], gUnknown_80F7AE8); + } + gDungeon->unk1BDD4.unk1C05F = 0; + gDungeon->unk1BDD4.unk1C060 = 0; + gDungeon->unk1BDD4.unk1C062 = 0; + gDungeon->unk1BDD4.unk1C064 = 0; + gDungeon->unk1BDD4.unk1C066 = 4; + gDungeon->unk1BDD4.unk1C06C = 0; + + if (a0 && gUnknown_202EDD0 == 3) { + sub_803EAF0(0, 0); + sub_803E46C(11); + } +} + +void sub_805229C(void) +{ + return sub_80526D0(0x50); +} + +void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str) +{ + if (sub_8045888(pokemon)){ + DisplayMessageAddToLog(pokemon, str, TRUE); + } +} + +UNUSED void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str) +{ + if (sub_8045888(pokemon)){ + DisplayMessageAddToLog(pokemon, str, FALSE); + } +} + +void DisplayDungeonLoggableMessageFalse(Entity *pokemon, const u8 *str) +{ + DisplayMessageAddToLog(pokemon, str, FALSE); +} + +void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str) +{ + u8 flag; + flag = sub_8045888(attacker) ? TRUE : FALSE; + if(sub_8052DC0(target) != 0) + { + flag = TRUE; + } + if(flag) + { + DisplayMessageAddToLog(attacker, str, TRUE); + } +} + +void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str) +{ + u8 flag; + flag = sub_8045888(attacker) ? TRUE : FALSE; + if(sub_8052DC0(target) != 0) + { + flag = TRUE; + } + if(flag) + { + DisplayMessageAddToLog(attacker, str, FALSE); + } +} + +void TryDisplayDungeonLoggableMessage5(Entity *pokemon, Position *pos, const u8 *str) +{ + u8 flag; + flag = sub_8045888(pokemon) ? TRUE : FALSE; + if(sub_803F428(pos) != 0) + { + flag = TRUE; + } + if(flag) + { + DisplayMessageAddToLog(pokemon, str, TRUE); + } +} + +void DisplayDungeonLoggableMessageTrue(Entity *pokemon, const u8 *str) +{ + DisplayMessageAddToLog(pokemon, str, TRUE); +} + +static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, bool8 r2) +{ + u8 txt[64]; + u32 r7; + bool32 r8, r9; + + if (sLastLogMsgEntity != pokemon) { + r7 = 1; + } + else { + r7 = gUnknown_203B434; + } + + r8 = 1; + sLastLogMsgEntity = pokemon; + gUnknown_203B434 = 0; + r9 = FALSE; + while (1) { + while (1) { + s32 val = gDungeon->unk1BDD4.unk1C060; + if (++val == UNK_1BBD4_STR_COUNT) { + val = 0; + } + + if (val != gDungeon->unk1BDD4.unk1C062) { + break; + } + sub_803E46C(0); + } + + if (*str == '\0') + break; + + gDungeon->unk1BDD4.unk1C054[gDungeon->unk1BDD4.unk1C060] = r7; + str = xxx_format_string(str, txt, txt + 62, 128); + if (*str == '\r') str++; + if (*str == '\n') str++; + CopyStringToMessageLog(txt, r7, r8); + r7 = 0; + r8 = 0; + if (r2) { + r9 = TRUE; + InlineStrncpy(gDungeon->unk1BDD4.unk0[gDungeon->unk1BDD4.unk1C060], txt, 64); + if (++gDungeon->unk1BDD4.unk1C060 == UNK_1BBD4_STR_COUNT) { + gDungeon->unk1BDD4.unk1C060 = 0; + } + } + } + + if (r9) { + gDungeon->unk1BDD4.unk1C064 = 0xF0; + if (gDungeon->unk1BDD4.unk1C06C == 0) { + gDungeon->unk1BDD4.unk1C06C = 1; + } + sub_805E804(); + } +} + +void xxx_draw_string_80524F0(void) +{ + struct UnkStructDungeon1BDD4 *strPtr = &gDungeon->unk1BDD4; + + switch (strPtr->unk1C06C) { + case 0: + break; + case 1: + if (sub_800EC74()) + break; + sub_803EAF0(3, 0); + // fall through + case 2: { + struct UnkDrawStringStruct sp; + s32 id = strPtr->unk1C062; + if (id == strPtr->unk1C060) { + strPtr->unk1C06C = 0; + } + else { + const u8 *txtPtr = strPtr->unk0[id]; + + sp.unk0 = 4; + sp.unk2 = strPtr->unk1C066; + sp.unk10 = 7; + sub_80073B8(0); + if (strPtr->unk1C054[id] != 0 && strPtr->unk1C066 >= 8) { + sub_80078A4(0, 0, strPtr->unk1C066 - 1, 0xE0, 7); + } + + while (1) { + txtPtr = xxx_handle_format_global(txtPtr, &sp); + if (*txtPtr == '\0' || *txtPtr == '\r' || *txtPtr == '\n') + break; + txtPtr = xxx_get_next_char_from_string(txtPtr, &sp.unk34); + if (sp.unk34 == 96) { + sp.unk0 += 6; + } + else { + sp.unk0 += xxx_call_draw_char(sp.unk0, sp.unk2, sp.unk34, sp.unk10, 0); + } + } + sub_80073E0(0); + strPtr->unk1C064 = 240; + if (++id == UNK_1BBD4_STR_COUNT) { + id = 0; + } + strPtr->unk1C062 = id; + strPtr->unk1C066 += 11; + if (strPtr->unk1C066 >= 48) { + strPtr->unk1C066 = 37; + strPtr->unk1C068 = 0; + strPtr->unk1C06C = 3; + } + } + break; + } + case 3: + strPtr->unk1C068++; + gUnknown_203B08C(0); + if (strPtr->unk1C068 > 10) { + strPtr->unk1C06C = 2; + } + break; + } + + if (strPtr->unk1C05E == 0 && strPtr->unk1C064 != 0 && --strPtr->unk1C064 == 0) { + strPtr->unk1C06C = 0; + sub_803EAF0(0, 0); + sub_8052210(FALSE); + } +} + +void sub_80526D0(s32 r0) +{ + struct UnkStructDungeon1BDD4 *strPtr = &gDungeon->unk1BDD4; + while (strPtr->unk1C06C != 0 || gDungeon->unk1BDD4.unk1C060 != gDungeon->unk1BDD4.unk1C062) { + sub_803E46C(r0); + } +} + +void sub_8052740(s32 a0) +{ + s32 i; + struct UnkStructDungeon1BDD4 *strPtr = &gDungeon->unk1BDD4; + + sub_80526D0(a0); + for (i = 0; i < 240; i++) { + if (strPtr->unk1C064 < 180) + break; + if ((gRealInputs.held & AB_BUTTONS) == AB_BUTTONS) + break; + if (gRealInputs.pressed & JOY_EXCL_DPAD) + break; + sub_803E46C(a0); + } +} + +// Prints string in dialogue box and waits for A/B button press +#define PRINT_STRING_WAIT_PRESS(chosenMenuIndex) \ +{ \ + s32 unkPrintRet; \ + \ + do { \ + DrawDialogueBoxString(); \ + sub_803E46C(9); \ + unkPrintRet = sub_80144A4(chosenMenuIndex);\ + } while (unkPrintRet != 0); \ +} + +void DisplayDungeonMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8 *str, bool8 a2) +{ + struct MonPortraitMsg monPortrait, *monPortraitPtr; + s32 chosenMenuIndex; + + if (gUnknown_203B40C) { + sub_8052740(10); + } + + sub_803EAF0(2, 0); + sub_8052210(FALSE); + + monPortraitPtr = NULL; + monPortrait.faceFile = NULL; + monPortrait.faceData = NULL; + if (!gDungeon->unk181e8.blinded + && !gDungeon->unk181e8.hallucinating + && monSpriteInfo != NULL + && IsPokemonDialogueSpriteAvail(monSpriteInfo->species, monSpriteInfo->spriteId)) + { + monPortrait.faceFile = GetDialogueSpriteDataPtr(monSpriteInfo->species); + monPortrait.faceData = monPortrait.faceFile->data; + monPortrait.pos.x = 2; + monPortrait.pos.y = 9; + monPortrait.spriteId = monSpriteInfo->spriteId; + monPortrait.flip = FALSE; + monPortrait.unkE = 0; + monPortraitPtr = &monPortrait; + } + + CreateMenuDialogueBoxAndPortrait(str, 0, 0, NULL, NULL, 3, 0, monPortraitPtr, (a2 != FALSE) ? 0x701 : 0x400); + gDungeon->unk1BDD4.unk1C05F = 1; + PRINT_STRING_WAIT_PRESS(&chosenMenuIndex); + gDungeon->unk1BDD4.unk1C05F = 0; + + if (monPortrait.faceFile != NULL) { + CloseFile(monPortrait.faceFile); + } + + if (a2) { + sub_805E804(); + sub_8040238(); + if (gUnknown_202EE01) { + sub_803EAF0(0, 0); + } + else { + sub_803EAF0(1, 0); + } + } + + sub_803E708(8, 9); +} + +void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str) +{ + DisplayDungeonMessage(NULL, str, TRUE); + DisplayDungeonLoggableMessageFalse(pokemon, str); +} + +struct Struct_sub_808CDB0 +{ + Position pos; + bool8 flip; +}; + +extern const struct Struct_sub_808CDB0 *sub_808CDB0(s32 a0); + +void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) +{ + struct MonPortraitMsg monPortrait; + s32 leaderId, partnerId, dialogueMonId; + s32 chosenMenuIndex; + Entity *leader = xxx_call_GetLeader(); + Entity *partner = GetPartnerEntity(); + struct MonPortraitMsg *monPortraitPtr = NULL; + + if (leader != NULL) { + EntityInfo *leaderInfo = GetEntInfo(leader); + PokemonStruct2 *monStruct2 = &gRecruitedPokemonRef->pokemon2[leaderInfo->teamIndex]; + + sub_808DA0C(gAvailablePokemonNames, monStruct2); + leaderId = leaderInfo->apparentID; + } + else { + leaderId = MONSTER_NONE; + strcpy(gAvailablePokemonNames, gUnknown_80F7AF8); // ?? + } + + if (partner != NULL) { + EntityInfo *partnerInfo = GetEntInfo(partner); + PokemonStruct2 *monStruct2 = &gRecruitedPokemonRef->pokemon2[partnerInfo->teamIndex]; + + sub_808DA0C(gUnknown_202DFE8, monStruct2); + partnerId = partnerInfo->apparentID; + } + else { + partnerId = MONSTER_NONE; + strcpy(gUnknown_202DFE8, gUnknown_80F7AF8); // ?? + } + + switch (dialogueInfo->unk4) { + case 425: + dialogueMonId = leaderId; + sprintfStatic(gUnknown_202E5D8, gUnknown_80F7AFC, gAvailablePokemonNames); + break; + case 426: + dialogueMonId = partnerId; + sprintfStatic(gUnknown_202E5D8, gUnknown_80F7AFC, gUnknown_202DFE8); + break; + case 427: + dialogueMonId = MONSTER_NONE; + strcpy(gUnknown_202E5D8, gUnknown_80F7B04); + break; + default: + dialogueMonId = dialogueInfo->unk4; + CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, dialogueMonId); + break; + } + + if (dialogueInfo->unk0 == 2 || dialogueInfo->unk0 == 3) { + strcpy(gUnknown_202E5D8, gUnknown_80F7B04); + } + + while (1) { + if (dialogueInfo->unk6 == 0) + break; + if (dialogueInfo->unk6 == 7 && (dialogueMonId == MONSTER_SQUIRTLE || dialogueMonId == MONSTER_TOTODILE)) + break; + if (dialogueInfo->unk6 == 1 && (dialogueMonId == MONSTER_BULBASAUR || dialogueMonId == MONSTER_CYNDAQUIL || dialogueMonId == MONSTER_MUDKIP || dialogueMonId == MONSTER_PIKACHU || dialogueMonId == MONSTER_CHARMANDER || dialogueMonId == MONSTER_TREECKO)) + break; + if (dialogueInfo->unk6 == 280 && (dialogueMonId == MONSTER_TORCHIC || dialogueMonId == MONSTER_CHIKORITA)) + break; + dialogueInfo++; + } + + if (!gDungeon->unk181e8.blinded + && !gDungeon->unk181e8.hallucinating + && dialogueInfo->unk0 != 4 + && dialogueInfo->unk2 != 0x80 + && dialogueMonId != MONSTER_NONE) + { + const struct Struct_sub_808CDB0 *strPtr = sub_808CDB0(dialogueInfo->unk3); + + monPortraitPtr = &monPortrait; + monPortraitPtr->faceFile = GetDialogueSpriteDataPtr(dialogueMonId); + if (monPortraitPtr->faceFile != NULL) { + monPortraitPtr->faceData = monPortraitPtr->faceFile->data; + monPortraitPtr->unkE = 0; + monPortraitPtr->spriteId = dialogueInfo->unk2; + monPortraitPtr->flip = strPtr->flip; + monPortraitPtr->pos.x = strPtr->pos.x; + monPortraitPtr->pos.y = strPtr->pos.y; + if (monPortraitPtr->pos.y < 2) { + monPortraitPtr->pos.y = 2; + } + } + else { + monPortraitPtr = NULL; + } + } + + sub_8052740(10); + sub_803EAF0(2, 0); + sub_8052210(FALSE); + CreateDialogueBoxAndPortrait(dialogueInfo->str, 0, monPortraitPtr, gUnknown_80F7AEA[dialogueInfo->unk0]); + PRINT_STRING_WAIT_PRESS(&chosenMenuIndex); + + if (monPortraitPtr != NULL) { + CloseFile(monPortraitPtr->faceFile); + } + + if (dialogueInfo->unk0 != 1 && dialogueInfo->unk0 != 3) { + sub_8040238(); + sub_803EAF0(0, 0); + } + sub_803E708(8, 9); +} + +bool32 DisplayDungeonYesNoMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8 *str, bool32 defaultYes) +{ + struct MonPortraitMsg monPortrait, *monPortraitPtr; + s32 chosenMenuIndex; + + sub_8052740(10); + sub_803EAF0(2, 0); + sub_8052210(FALSE); + + monPortraitPtr = NULL; + monPortrait.faceFile = NULL; + monPortrait.faceData = NULL; + if (!gDungeon->unk181e8.blinded + && !gDungeon->unk181e8.hallucinating + && monSpriteInfo != NULL + && IsPokemonDialogueSpriteAvail(monSpriteInfo->species, monSpriteInfo->spriteId)) + { + monPortrait.faceFile = GetDialogueSpriteDataPtr(monSpriteInfo->species); + monPortrait.faceData = monPortrait.faceFile->data; + monPortrait.pos.x = 2; + monPortrait.pos.y = 9; + monPortrait.spriteId = monSpriteInfo->spriteId; + monPortrait.flip = FALSE; + monPortrait.unkE = 0; + monPortraitPtr = &monPortrait; + } + + if (defaultYes == TRUE) { + CreateYesNoDialogueBoxAndPortrait_DefaultYes(str, monPortraitPtr, 0x300); // Yes/No - cursor starts at Yes + } + else { + CreateYesNoDialogueBoxAndPortrait_DefaultNo(str, monPortraitPtr, 0x300); // Yes/No - cursor starts at NO + } + + PRINT_STRING_WAIT_PRESS(&chosenMenuIndex); + + if (monPortrait.faceFile != NULL) { + CloseFile(monPortrait.faceFile); + } + + sub_8040238(); + sub_803EAF0(0, 0); + + if (chosenMenuIndex == 1) + return TRUE; + else + return FALSE; +} + +s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8 *str, const MenuItem *menuItems, u16 unkArg) +{ + struct MonPortraitMsg monPortrait, *monPortraitPtr; + s32 chosenMenuIndex; + + sub_8052740(10); + sub_803EAF0(2, 0); + sub_8052210(FALSE); + + monPortraitPtr = NULL; + monPortrait.faceFile = NULL; + monPortrait.faceData = NULL; + if (!gDungeon->unk181e8.blinded + && !gDungeon->unk181e8.hallucinating + && monSpriteInfo != NULL + && IsPokemonDialogueSpriteAvail(monSpriteInfo->species, monSpriteInfo->spriteId)) + { + monPortrait.faceFile = GetDialogueSpriteDataPtr(monSpriteInfo->species); + monPortrait.faceData = monPortrait.faceFile->data; + monPortrait.pos.x = 2; + monPortrait.pos.y = 9; + monPortrait.spriteId = monSpriteInfo->spriteId; + monPortrait.flip = FALSE; + monPortrait.unkE = 0; + monPortraitPtr = &monPortrait; + } + + CreateMenuDialogueBoxAndPortrait(str, 0, -1, menuItems, NULL, 3, 0, monPortraitPtr, unkArg); + PRINT_STRING_WAIT_PRESS(&chosenMenuIndex); + + if (monPortrait.faceFile != NULL) { + CloseFile(monPortrait.faceFile); + } + + sub_8040238(); + sub_803EAF0(0, 0); + return chosenMenuIndex; +} + +void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) +{ + if (EntityExists(leader)) { + SetMessageArgument(gAvailablePokemonNames, leader, 0); + ids[0] = GetEntInfo(leader)->apparentID; + } + else { + strcpy(gAvailablePokemonNames, gUnknown_80F7AF8); + ids[0] = 0; + } + + if (EntityExists(partner)) { + SetMessageArgument(gUnknown_202DFE8, partner, 0); + ids[1] = GetEntInfo(partner)->apparentID; + } + else { + strcpy(gUnknown_202DFE8, gUnknown_80F7AF8); + ids[1] = 0; + } +} + +static bool8 sub_8052DC0(Entity *entity) +{ + return sub_8045888(entity); +} + +struct TutorialFlagMsg +{ + s32 flagId; + const u8 *str; +}; + +extern const struct TutorialFlagMsg gUnknown_80FF020; +extern const struct TutorialFlagMsg gUnknown_80FF080; +extern const struct TutorialFlagMsg gUnknown_80FF0D8; +extern const struct TutorialFlagMsg gUnknown_80FF13C; +extern const struct TutorialFlagMsg gUnknown_80FF1B4; +extern const struct TutorialFlagMsg gMovementTutorial; +extern const struct TutorialFlagMsg gHungerTutorial; +extern const struct TutorialFlagMsg gFoodTutorial; +extern const struct TutorialFlagMsg gOranTutorial; +extern const struct TutorialFlagMsg gCheriTutorial; +extern const struct TutorialFlagMsg gBlastSeedTutorial; +extern const struct TutorialFlagMsg gUnknown_80FF4A0; +extern const struct TutorialFlagMsg gPechaTutorial; +extern const struct TutorialFlagMsg gSleepSeedTutorial; +extern const struct TutorialFlagMsg gMoneyTutorial; + +extern const u8 *const gUnknown_80FF6F8; +extern const u8 *const gUnknown_80FF6A4; + +static inline bool32 DislayTutorialMsg(Entity *leader, const struct TutorialFlagMsg *tutorial, bool32 unkFunctionCall) +{ + const u8 *str; + s32 flag = tutorial->flagId; + bool8 flagDone = GetTutorialFlag(flag); + + if (!flagDone) { + SetTutorialFlag(flag); + sub_8083E28(); + str = tutorial->str; + DisplayDungeonMessage(NULL, str, TRUE); + if (unkFunctionCall) { + DisplayDungeonLoggableMessageFalse(leader, str); + } + return TRUE; + } + return FALSE; +} + +void TryDisplayGeneralTutorialMessage(void) +{ + Entity *leader = GetLeader(); + + if (DislayTutorialMsg(leader, &gUnknown_80FF020, TRUE)) return; + if (DislayTutorialMsg(leader, &gUnknown_80FF080, TRUE)) return; + if (DislayTutorialMsg(leader, &gUnknown_80FF0D8, TRUE)) return; + if (gDungeon->dungeonLocation.id == DUNGEON_THUNDERWAVE_CAVE) { + if (DislayTutorialMsg(leader, &gUnknown_80FF13C, TRUE)) return; + if (DislayTutorialMsg(leader, &gUnknown_80FF1B4, TRUE)) return; + if (DislayTutorialMsg(leader, &gMovementTutorial, TRUE)) return; + if (DislayTutorialMsg(leader, &gHungerTutorial, TRUE)) return; + } +} + +void TryDisplayItemPickupTutorialMessage(u8 itemId) +{ + u32 itemCategory = GetItemCategory(itemId); + + if (itemCategory == CATEGORY_FOOD_GUMMIES) { + DislayTutorialMsg(NULL, &gFoodTutorial, FALSE); + } + else if (itemId == ITEM_ORAN_BERRY) { + DislayTutorialMsg(NULL, &gOranTutorial, FALSE); + } + else if (itemId == ITEM_CHERI_BERRY) { + DislayTutorialMsg(NULL, &gCheriTutorial, FALSE); + } + else if (itemId == ITEM_BLAST_SEED) { + DislayTutorialMsg(NULL, &gBlastSeedTutorial, FALSE); + } + else if (itemId == ITEM_GRAVELEROCK) { + DislayTutorialMsg(NULL, &gUnknown_80FF4A0, FALSE); + } + else if (itemId == ITEM_PECHA_BERRY) { + DislayTutorialMsg(NULL, &gPechaTutorial, FALSE); + } + else if (itemId == ITEM_SLEEP_SEED) { + DislayTutorialMsg(NULL, &gSleepSeedTutorial, FALSE); + } + else if (itemId == ITEM_POKE) { + DislayTutorialMsg(NULL, &gMoneyTutorial, FALSE); + } +} + +void DisplayYouReachedDestFloorStr(void) +{ + if (gDungeon->unkA != 0) { + DisplayDungeonMessage(NULL, gUnknown_80FF6F8, 1); // But the pokemon you seek isn't here... + } + else { + DisplayDungeonMessage(NULL, gUnknown_80FF6A4, 1); + } +} + +// Used only for displaying Frosy Forest's text at floor 6 +void sub_8052FB8(const u8 *str) +{ + s32 r8 = 0, r9, j; + { + s32 i; + for (i = 1; i < 30; i++) { + gUnknown_202B038[0][0][i] = 0; + } + } + + CreateMenuDialogueBoxAndPortrait(str, 0, 0, NULL, NULL, 2, 0, NULL, 0x30); + r9 = 0; + while (1) { + if (r8 < 62) { + r8++; + for (j = 0; j < 8; j++) { + SetBGPaletteBufferColorRGB(240 + j, &gFontPalette[j * 4], r8 / 2, NULL); + } + } + else { + r9++; + if (r9 & 8) { + u32 shape, tileNum, unk6, spriteX, mask, palNum; + + sUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE1; + sUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE2; + sUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_OBJMODE; + sUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_MOSAIC; + sUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_BPP; + + sUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_SHAPE; + shape = 1; + shape <<= SPRITEOAM_SHIFT_SHAPE; + ASM_MATCH_TRICK(shape); + sUnknown_202F1F0.attrib1 |= shape; + + tileNum = 0x3F0 << SPRITEOAM_SHIFT_TILENUM; + sUnknown_202F1F0.attrib3 &= ~SPRITEOAM_MASK_TILENUM; + sUnknown_202F1F0.attrib3 |= tileNum; + + sUnknown_202F1F0.attrib3 &= ~SPRITEOAM_MASK_PRIORITY; + + mask = 0xF; + palNum = (15 & SPRITEOAM_MAX_PALETTENUM) << SPRITEOAM_SHIFT_PALETTENUM; + sUnknown_202F1F0.attrib3 &= ~SPRITEOAM_MASK_PALETTENUM; + sUnknown_202F1F0.attrib3 |= palNum; + + unk6 = 0x78 << SPRITEOAM_SHIFT_UNK6_4; + sUnknown_202F1F0.unk6 &= mask; + sUnknown_202F1F0.unk6 |= unk6; + + sUnknown_202F1F0.attrib2 &= ~SPRITEOAM_MASK_X; + sUnknown_202F1F0.attrib2 &= ~SPRITEOAM_MASK_MATRIXNUM; + + spriteX = 0x70 & SPRITEOAM_MAX_X; + sUnknown_202F1F0.attrib2 &= ~SPRITEOAM_MASK_SIZE; + sUnknown_202F1F0.attrib2 |= spriteX; + + AddSprite(&sUnknown_202F1F0, 0x100, NULL, NULL); + } + if (gRealInputs.pressed & AB_BUTTONS) + break; + } + DrawDialogueBoxString(); + sub_803E46C(9); + } + + while (r8 >= 0) { + for (j = 0; j < 8; j++) { + SetBGPaletteBufferColorRGB(240 + j, &gFontPalette[j * 4], r8 / 2, NULL); + } + DrawDialogueBoxString(); + sub_803E46C(9); + r8--; + } + + xxx_call_save_unk_text_struct_800641C(NULL, TRUE, TRUE); + sub_803E46C(9); + sub_8040238(); + for (j = 0; j < 8; j++) { + SetBGPaletteBufferColorArray(240 + j, &gFontPalette[j * 4]); + } + sub_803E708(8, 9); +} + +const u8 *GetCurrentDungeonName(void) +{ + if (gDungeon->unk678 == 1) { + return GetDungeonName1(DUNGEON_OUT_ON_RESCUE); + } + else { + return GetDungeonName1(gDungeon->dungeonLocation.id); + } +} + +void ResetMessageLog(void) +{ + s32 i; + + gDungeon->unk16 = 0; + gDungeon->unkB = 1; + for (i = 0; i < MESSAGE_LOG_STRINGS_COUNT; i++) { + gDungeon->messageLogStrings[i].str[0] = '\0'; + gDungeon->messageLogStrings[i].unk0 = 0; + gDungeon->messageLogStrings[i].unk1 = 0; + gDungeon->messageLogStrings[i].unk2 = 0; + } +} + +UNUSED void sub_8053200(void) +{ + gDungeon->unkB = 1; +} + +static void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2) +{ + u8 *dst = &gDungeon->messageLogStrings[gDungeon->unk16].str[0]; + u8 *maxDst = &gDungeon->messageLogStrings[gDungeon->unk16].str[MESSAGE_LOG_BUFFER_SIZE - 1]; + gDungeon->messageLogStrings[gDungeon->unk16].unk0 = 1; + gDungeon->messageLogStrings[gDungeon->unk16].unk1 = a1; + gDungeon->messageLogStrings[gDungeon->unk16].unk2 = a2; + + while (*src != '\0') { + if (*src == '\r') break; + if (dst < maxDst) { + *(dst++) = *src; + } + src++; + } + + *dst = '\0'; + if (++gDungeon->unk16 >= MESSAGE_LOG_STRINGS_COUNT) { + gDungeon->unk16 = 0; + } + + gDungeon->unkB = 1; +} + +#define MESSAGE_LOG_ROW_COUNT 8 // How many log messages are shown + +UNUSED static const char sPksDirMeme[] = "pksdir0"; +// Possibly something menu related? +// Unfortunately, this is passed to sub_8014140 which is a nullsub. It could be used for Blue and Nintendo DS' touch screen. +static const u8 sUnknownMessageLogData[] = +{ + 0x01, 0x00, 0x54, 0x00, 0xf0, 0xff, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x54, 0x00, + 0x6a, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 +}; + +bool32 DisplayMessageLog(void) +{ + bool8 unkRet; + MenuInputStructSub menuInput; + + sub_801317C(&menuInput); + sub_803EAF0(9, 0); + do { + sub_803E46C(13); + unkRet = sub_8008D8C(0); + } while (unkRet); + + sMessageLogCursor = 0; + sMessageLogFlags = 0; + PutStringsOnMessageLog(); + + while (1) { + s32 unkVar; + bool32 scroll = FALSE; + + sMessageLogFlags = 0; + nullsub_34(&menuInput, 0); + unkVar = sub_8014140(0, sUnknownMessageLogData); + + if (TryScrollLogUp(unkVar)) + scroll = TRUE; + if (TryScrollLogDown(unkVar)) + scroll = TRUE; + + if (!scroll) { + sub_803E46C(0xD); + } + + if (sMessageLogFlags & FLAG_CAN_SCROLL_UP) { + CreateMessageLogArrow(TRUE, -8); + } + if (sMessageLogFlags & FLAG_CAN_SCROLL_DOWN) { + CreateMessageLogArrow(FALSE, 114); + } + + if (!sub_80048C8()) { + if (gRealInputs.pressed & B_BUTTON || menuInput.b_button) { + sub_8083D30(); + break; + } + else if (gRealInputs.pressed & A_BUTTON) { + sub_8083D08(); + break; + } + } + } + + sub_803EAF0(0, 0); + return TRUE; +} + +static void PutStringsOnMessageLog(void) +{ + s32 i; + s32 arrId = gDungeon->unk16; + s32 y = 16; + + arrId -= 8; + if (arrId < 0) + arrId += MESSAGE_LOG_STRINGS_COUNT; + + sub_80073B8(0); + for (i = 0; i < MESSAGE_LOG_ROW_COUNT; i++) { + struct MessageLogString *msgLogString = &gDungeon->messageLogStrings[arrId]; + + if (msgLogString->unk0) { + if (msgLogString->unk1) { + sub_80078A4(0, 0, y, 0xE0, 7); + } + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); + y += 14; + } + if (++arrId >= MESSAGE_LOG_STRINGS_COUNT) + arrId = 0; + } + + sub_80073E0(0); + sub_8007334(0); +} + +static bool8 TryScrollLogUp(s32 a0) +{ + s32 i; + struct MessageLogString *msgLogString; + s32 y; + s32 arrId; + + while (1) + { + arrId = gDungeon->unk16 + sMessageLogCursor; + y = 2; + arrId -= 9; + while (arrId < 0) { + arrId += MESSAGE_LOG_STRINGS_COUNT; + } + while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { + arrId -= MESSAGE_LOG_STRINGS_COUNT; + } + + if (gDungeon->messageLogStrings[arrId].unk0 && sMessageLogCursor > -12) { + sMessageLogFlags |= FLAG_CAN_SCROLL_UP; + if (gRealInputs.repeated & DPAD_UP) + break; + if (a0 == 1) + break; + } + + return FALSE; + } + sub_8083CE0(0); + sub_80073B8(0); + msgLogString = &gDungeon->messageLogStrings[arrId]; + if (msgLogString->unk0) { + sub_80087EC(0, 0, 0, 0xD0, 0x10); + if (msgLogString->unk1) { + sub_80078A4(0, 0, y, 0xE0, 7); + } + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); + } + sub_80073E0(0); + sub_803E46C(0xD); + + for (i = 0; i < 7; i++) { + gUnknown_203B084(0); + sub_803E46C(0xD); + } + + sMessageLogCursor--; + return TRUE; +} + +static bool8 TryScrollLogDown(s32 a0) +{ + s32 i; + struct MessageLogString *msgLogString; + s32 y; + s32 arrId; + + while (1) + { + arrId = gDungeon->unk16 + sMessageLogCursor; + y = 128; + while (arrId < 0) { + arrId += MESSAGE_LOG_STRINGS_COUNT; + } + while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { + arrId -= MESSAGE_LOG_STRINGS_COUNT; + } + + if (sMessageLogCursor < 0) { + sMessageLogFlags |= FLAG_CAN_SCROLL_DOWN; + if (gRealInputs.repeated & DPAD_DOWN) + break; + if (a0 == 2) + break; + } + + return FALSE; + } + sub_8083CE0(0); + sub_80073B8(0); + msgLogString = &gDungeon->messageLogStrings[arrId]; + if (msgLogString->unk0) { + sub_80087EC(0, 0, y, 0x68, 0x10); + if (msgLogString->unk1) { + sub_80078A4(0, 0, y, 0xE0, 7); + } + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); + } + sub_80073E0(0); + sub_803E46C(0xD); + + for (i = 0; i < 7; i++) { + gUnknown_203B080(0); + sub_803E46C(0xD); + } + + sMessageLogCursor++; + return TRUE; +} + +static void CreateMessageLogArrow(bool8 upArrow, s32 y) +{ + struct UnkTextStruct1 *unkStr = &gUnknown_2027370[0]; + if (!(gUnknown_202EDCC & 8)) { + u32 matrixNum, xSprite, mask, ySprite, shape, yMask; + + sMessageLogArrowSpriteOAM.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE1; + sMessageLogArrowSpriteOAM.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE2; + sMessageLogArrowSpriteOAM.attrib1 &= ~SPRITEOAM_MASK_OBJMODE; + sMessageLogArrowSpriteOAM.attrib1 &= ~SPRITEOAM_MASK_MOSAIC; + sMessageLogArrowSpriteOAM.attrib1 &= ~SPRITEOAM_MASK_BPP; + + matrixNum = (upArrow != FALSE) ? (16) : 0; + // You may be thinking what is this empty loop doing here, but the better question is: Why do these unholy sprite macros exist? + do {} while (0); + matrixNum <<= 9; + sMessageLogArrowSpriteOAM.attrib2 &= ~SPRITEOAM_MASK_MATRIXNUM; + sMessageLogArrowSpriteOAM.attrib2 |= matrixNum; + + mask = 0xF; + yMask = 0xFFF; + ySprite = (yMask & (unkStr->unk2 * 8 + y)) << 4; + sMessageLogArrowSpriteOAM.unk6 &= mask; + sMessageLogArrowSpriteOAM.unk6 |= ySprite; + + xSprite = 0x1FF & ((unkStr->unk0 * 8) + 92); + sMessageLogArrowSpriteOAM.attrib2 &= ~SPRITEOAM_MASK_X; + sMessageLogArrowSpriteOAM.attrib2 |= xSprite; + + shape = 1; + shape <<= SPRITEOAM_SHIFT_SHAPE; + sMessageLogArrowSpriteOAM.attrib1 &= ~SPRITEOAM_MASK_SHAPE; + sMessageLogArrowSpriteOAM.attrib1 |= shape; + + sMessageLogArrowSpriteOAM.attrib2 &= ~SPRITEOAM_MASK_SIZE; + + sMessageLogArrowSpriteOAM.attrib3 = 0xF3F0; + + AddSprite(&sMessageLogArrowSpriteOAM, 127, NULL, NULL); + } +} + diff --git a/src/dungeon_move.c b/src/dungeon_move.c new file mode 100644 index 000000000..74744f760 --- /dev/null +++ b/src/dungeon_move.c @@ -0,0 +1,3314 @@ +#include "global.h" +#include "dungeon_pokemon_attributes.h" +#include "dungeon_util.h" +#include "dungeon_message.h" +#include "moves.h" +#include "status_checks_1.h" +#include "dungeon_ai_targeting.h" +#include "structs/str_damage.h" +#include "constants/ability.h" +#include "constants/status.h" +#include "constants/weather.h" +#include "constants/iq_skill.h" +#include "type_chart.h" +#include "position_util.h" +#include "dungeon_items.h" +#include "code_806CD90.h" +#include "move_util.h" +#include "code_808417C.h" +#include "dungeon_capabilities.h" +#include "move_effects_target.h" +#include "status.h" +#include "weather.h" +#include "code_8077274_1.h" +#include "charge_move.h" +#include "dungeon_random.h" +#include "targeting_flags.h" +#include "targeting.h" +#include "called_move_data.h" +#include "dungeon_map_access.h" +#include "math.h" +#include "code_800DAC0.h" +#include "text_util.h" +#include "dungeon_visibility.h" +#include "code_807CD9C.h" +#include "dungeon_engine.h" +#include "status_actions.h" +#include "code_8045A00.h" +#include "code_803E668.h" +#include "code_803E46C.h" + +extern void sub_80429C8(Entity *r0); +extern u8 sub_803F428(Position *); +extern bool8 sub_8045888(Entity *r0); +extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); +extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, u32, u16, u32); +extern s16 sub_8057600(Move *move, s32 itemID); +extern void sub_803ED30(s32, Entity *r0, u8, s32); +extern void sub_8042238(Entity *pokemon, Entity *target); +extern void sub_806A1E8(Entity *pokemon); +extern bool8 sub_8044B28(void); +extern void sub_804178C(u32); +extern void sub_8071DA4(Entity *); +extern void sub_80428A0(Entity *r0); +extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8); +extern void sub_8040DA0(Entity *entity, Move *move); +extern u16 sub_80412E0(u16 moveId, u8 weather, u8 a2); +extern void sub_800569C(Position *, EntitySpriteInfo *, u8); +extern u8 GetBodySize(s16 index); +extern void sub_800EF10(u16 r0); +extern s32 sub_800E710(s16 a0, u16 a1); +extern void sub_800E3AC(s32 a0, Position *pos, s32 a2); +extern void sub_8041168(Entity *entity, Entity *entity2, Move *,Position *); +extern Entity *sub_80696A8(Entity *a0); +extern Entity *sub_804AD0C(Position *pos); +extern Entity *sub_80696FC(Entity *); +extern Entity *sub_806977C(Entity *); +extern void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct); +extern void sub_806ACE8(Entity *entity, Move *move); +extern s32 sub_8057070(Move *move); +extern bool8 sub_805755C(Entity* pokemon,u16 param_2); +extern s32 sub_800ED20(u16 param_1); +extern bool32 sub_8058F04(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern void sub_8042930(Entity *r0); +extern void sub_8041B48(Entity *pokemon); +extern void sub_8041BA8(Entity *pokemon); +extern void sub_8042950(Entity *r0); +extern void sub_80421C0(Entity *pokemon, u16 r1); +extern bool8 sub_8057634(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 YawnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 NightmareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805783C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057974(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 PainSplitMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057BC4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057C88(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 WhirlpoolMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805889C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057D7C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057D9C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SmokescreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057FCC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057FF4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805805C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805816C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80581D0(Entity *pokemon, Entity *target, Move *move, u32 param_4); +extern bool8 sub_8058B3C(Entity *pokemon, Entity *target, Move *move, u32 param_4); +extern bool8 sub_8058270(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80582C4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80583D8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058430(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058478(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80584C0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058548(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058638(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80586DC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058770(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80587E8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058838(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058858(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80588B8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80588F4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058930(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058A18(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058BF0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058FBC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80590D4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059190(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80591E4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059424(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805946C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059540(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80595A0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80595EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805C138(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80598CC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059928(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059988(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059A2C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059AA8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059AB8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059AF8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059D00(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059D48(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059D98(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059DA4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059DB4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059DC4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059E0C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TriAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A120(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A210(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A258(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A2A0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A3DC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A464(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A568(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 FocusEnergyMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A688(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SecretPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AC90(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AD04(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AD34(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AD54(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AE3C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AE74(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AECC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 PresentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AFA4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B028(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B074(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B0BC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B17C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 WrapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B264(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B324(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 DestinyBondMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B388(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B3E0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B454(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 MimicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B53C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 LeechSeedMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B668(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B910(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B808(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A408(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059050(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059FC8(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5); +extern bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5); +extern void SetShopkeeperAggression(Entity *, Entity *); +extern bool8 MoveCausesPaused(Move *move); +extern void sub_8069F9C(Entity *pokemon,Entity * target,Move *move); +extern void sub_806A120(Entity *pokemon,Entity * target,Move *move); +extern bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5); +extern bool8 sub_805B3FC(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5); +extern bool8 sub_805A5E8(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5); +extern bool8 sub_8058B84(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059714(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80576F8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059080(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059D58(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B164(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059A18(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80582D4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 RageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059B94(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B3B4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059588(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A2B0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B2FC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058A7C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057F7C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057ED0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058CEC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A2C8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057C68(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SolarBeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058D38(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SafeguardMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 MistMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 LightScreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057F24(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80589D4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059AC4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A4D4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058A08(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 CounterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805836C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TrapperOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 RazorWindMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 FocusPunchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 MagicCoatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057748(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 MudWaterSportMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A4FC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058C48(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SpikesMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80578EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80588A8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057E6C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059CF0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80582AC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058A54(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 VitalThrowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 FlyMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059F38(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 DiveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 DigMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057824(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805825C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 GrudgeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A4C0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805AAD0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B314(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 ProtectMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8059004(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80597F0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058D44(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 StockpileMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 InvisifyOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 MirrorCoatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 PerishSongMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057CD0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 BellyDrumMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_80578FC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057BB4(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 TransformMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8058234(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805A85C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 ReboundOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_8057E50(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 ConversionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SnatchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 HandleColorChange(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 PsychUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 sub_805B618(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); + +s32 HandleDamagingMove(Entity *, Entity *, Move *, s32, s32); +static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct DamageStruct *dmgStruct, s16 unk); +static void TriggerTargetAbilityEffect(Entity *attacker); +static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accuracyType, bool8 selfAlwaysHits); +bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move); +bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray, bool32 itemId, bool8 arg_4, bool32 unused); +bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3); +static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *move); +void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 isLinkedMove); +static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_, Entity *attacker, Entity *target, Move *move, bool32 canHitAnyone_); +bool8 sub_8055988(Entity *r2, Entity *r4); +void sub_80559DC(Entity *entity1, Entity *entity2); +static void SortTargets(Entity **targetsArray, Entity *attacker); + +extern const s32 gUnknown_8106A50; +extern const s32 gUnknown_8106A4C; +extern const s16 gUnknown_80F5006; +extern const s32 gUnknown_80F519C; +extern const s32 gUnknown_80F51A0; +extern const s32 gUnknown_80F50F4[2][21]; +extern const s16 gUnknown_80F4E70[]; +extern const s16 gUnknown_80F4E74[]; +extern const u16 gUnknown_80F5004; +extern const u8 *const gUnknown_80FEEA4; +extern const u8 *const gUnknown_80FEEC8; +extern const u8 *const gUnknown_80FEEEC; +extern const u8 *const gUnknown_80FEF0C; +extern const u8 *const gUnknown_80FEF30; +extern const u8 *const gUnknown_80FEF4C; +extern const u8 *const gUnknown_80FEF50; +extern const u8 *const gUnknown_80FEF54; +extern const u8 *const gUnknown_80FEF74; +extern const u8 *const gUnknown_80FEF98; +extern const u8 *const gUnknown_80FEFD0; +extern const u8 *const gUnknown_80FECA4; +extern const u8 *const gUnknown_80F9158; +extern const u8 *const gUnknown_80FC72C; +extern const u8 *const gUnknown_80FC700; +extern const u8 *const gUnknown_80FC6D0; +extern const u8 *const gUnknown_80FC710; +extern const u8 *const gUnknown_80FC6FC; +extern const u8 *const gUnknown_80FECBC; +extern const u8 *const gUnknown_80FECE0; +extern const u8 *const gUnknown_80F9688; +extern const u8 *const gUnknown_80FC714; +extern const u8 *const gUnknown_80FC718; +extern const u8 *const gUnknown_80FC6A8; +extern const u8 *const gUnknown_80FD2D0; +extern const u8 *const gUnknown_80FD2DC; +extern const u8 *const gUnknown_80F93C8; +extern const u8 *const gUnknown_80FC690; +extern const u8 *const gUnknown_80FC6A4; +extern const u8 *const gUnknown_80FCD28; +extern const u8 *const gUnknown_80FCD0C; +extern const u8 *const gUnknown_80FDD88; +extern const u8 *const gUnknown_80FDD20; +extern const u8 *const gUnknown_80FDDA8; +extern const u8 *const gUnknown_80FDD48; +extern const u8 *const gUnknown_80FDDAC; +extern const u8 *const gUnknown_80FC52C; +extern const u8 *const gUnknown_80FC558; +extern const u8 *const gUnknown_80FC574; +extern const u8 *const gUnknown_8100524; +extern const u8 *const gUnknown_80F9364; +extern const u8 *const gUnknown_80F93A4; +extern const u8 *const gUnknown_80F9384; +extern const u8 *const gUnknown_80F9380; + +extern u8 gFormatItems[]; +extern u8 gAvailablePokemonNames[]; +extern u8 gUnknown_202DFE8[]; +extern Entity *gUnknown_203B438; + +EWRAM_DATA s32 gUnknown_202F208 = 0; +EWRAM_DATA s32 gUnknown_202F20C = 0; +EWRAM_DATA s32 gUnknown_202F210 = 0; +EWRAM_DATA s32 gUnknown_202F214 = 0; +EWRAM_DATA u8 gUnknown_202F218 = 0; +EWRAM_DATA u8 gUnknown_202F219 = 0; +EWRAM_DATA u8 gUnknown_202F21A = 0; +EWRAM_DATA s32 gUnknown_202F21C = 0; +EWRAM_DATA u8 gUnknown_202F220 = 0; +EWRAM_DATA u8 gUnknown_202F221 = 0; +EWRAM_DATA u8 gUnknown_202F222 = 0; +EWRAM_DATA s32 gUnknown_202F224 = 0; +EWRAM_DATA s32 gMetronomeCalledArrayId = 0; + +#define MAX_MOVE_TARGETS 64 + +static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, s32 itemId, bool32 isLinkedMove) +{ + s32 i = 0; + u16 moveId; + Entity *originalAttacker; + Entity *currTargetSaved; + Entity *currTarget; + EntityInfo *targetInfo; + bool32 moveHits; + bool32 lightRodRedirect; + bool32 moveRedirected; + + moveId = move->id; + for (i = 0; i < MAX_MOVE_TARGETS; i++) { + currTargetSaved = NULL; // Only for Pass Scarf + currTarget = targetsArray[i]; + moveHits = TRUE; + lightRodRedirect = FALSE; + moveRedirected = FALSE; + if (currTarget == NULL) + break; + if (!EntityExists(attacker)) + break; + if (EntityExists(currTarget)) { + bool32 r4; + bool8 moveHadEffect; + + originalAttacker = attacker; + targetInfo = GetEntInfo(currTarget); + targetInfo->unk15A = 0; + if (CanBeSnatched(moveId) && gDungeon->snatchPokemon != NULL) { + Entity *snatchMon = gDungeon->snatchPokemon; + if (GetEntityType(snatchMon) == ENTITY_MONSTER + && snatchMon != attacker + && GetEntInfo(snatchMon)->unk98 == gDungeon->unk17B3C + && targetInfo->unkFF == 0) + { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FCD28); // The move was snatched. + currTarget = snatchMon; + } + } + else if (GetMoveTypeForMonster(attacker, move) == TYPE_ELECTRIC && gDungeon->lightningRodPokemon != NULL) { + Entity *lightRodMon = gDungeon->lightningRodPokemon; + if (GetEntityType(lightRodMon) == ENTITY_MONSTER) { + EntityInfo *lightRodInfo = GetEntInfo(lightRodMon); + if (lightRodInfo->unk98 == gDungeon->unk17B38 + && GetTreatmentBetweenMonsters(lightRodMon, attacker, TRUE, FALSE) == 1 + && ((targetInfo->unkFF == 0 && lightRodInfo->unkFF == 0) || currTarget == lightRodMon)) + { + sub_8042930(lightRodMon); + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FCD0C); // A Lightningrod took the move + currTarget = lightRodMon; + lightRodRedirect = TRUE; + } + } + } + else if (HasHeldItem(currTarget, ITEM_PASS_SCARF)) { + if (!CannotAttack(currTarget, FALSE) + && (GetMoveTargetAndRangeForPokemon(attacker, move, FALSE) & 0xF0) == 0 + && FixedPointToInt(targetInfo->belly) >= gUnknown_80F5006 + && targetInfo->unkFF == 0) + { + s32 direction1 = targetInfo->action.direction; + s32 direction2 = targetInfo->action.direction; + if (IsBossFight()) { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FDD88); // A mysterious force prevents moves from being passed off! + } + else { + s32 j; + Entity *tileEntity; + + for (j = 0; j < 8; j++) { + direction2++; + direction2 &= DIRECTION_MASK; + tileEntity = GetTile(currTarget->pos.x + gAdjacentTileOffsets[direction2].x, currTarget->pos.y + gAdjacentTileOffsets[direction2].y)->monster; + if (EntityExists(tileEntity) && GetEntityType(tileEntity) == ENTITY_MONSTER) { + if (sub_8045888(currTarget)) { + s32 k; + for (k = 0; k < 24; k++) { + sub_806CE68(currTarget, direction1); + sub_803E708(2, 0x43); + direction1++; + direction1 &= DIRECTION_MASK; + } + while (direction1 != direction2) { + sub_806CE68(currTarget, direction1); + sub_803E708(2, 0x43); + direction1++; + direction1 &= DIRECTION_MASK; + } + sub_806CE68(currTarget, direction1); + sub_803E708(2, 0x43); + } + targetInfo->belly = FixedPoint_Subtract(targetInfo->belly, IntToFixedPoint(gUnknown_80F5006)); + if (move->id == MOVE_REGULAR_ATTACK) { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FDDA8); // Attack was passed off + } + else { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FDD20); // Move was passed off + } + currTargetSaved = currTarget; + currTarget = tileEntity; + break; + } + } + if (j == 8) { + if (move->id == MOVE_REGULAR_ATTACK) { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FDDAC); // There's no one to pass off to! + } + else { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FDD48); //There's no one to pass off to! + } + } + } + } + } + + gUnknown_202F208++; + gUnknown_202F20C++; + targetInfo = currTarget->info; // currTarget could've been changed, hence info pointers needs to be reloaded + targetInfo->unk15A = 0; + if (targetInfo->isNotTeamMember) { + targetInfo->targetPos = attacker->pos; + } + sub_806A1E8(currTarget); + TrySendImmobilizeSleepEndMsg(attacker, currTarget); + r4 = FALSE; + if (!MoveMatchesChargingStatus(attacker, move)) { + r4 = (sub_805755C(attacker, move->id) != 0); + } + + if (!lightRodRedirect) { + if (targetInfo->protection.protectionStatus == STATUS_MAGIC_COAT) { + if (IsReflectedByMagicCoat(moveId) && sub_8055988(attacker, currTarget)) { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC52C); // The target~27s Magic Coat bounced it back! + sub_8041B48(currTarget); + sub_80559DC(currTarget, attacker); + currTarget = attacker; + targetInfo = attacker->info; + targetInfo->unk15A = 0; + moveRedirected = TRUE; + } + } + else if (targetInfo->protection.protectionStatus == STATUS_MIRROR_MOVE) { + s32 target = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); + if (moveId != MOVE_REGULAR_ATTACK + && moveId != MOVE_PROJECTILE + && !r4 + && ((target & 0xF) == 0 || (target & 0xF) == 4 || (target & 0xF) == 5 || (target & 0xF) == 2) + && sub_8055988(attacker, currTarget)) + { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC558); // The target~27s Mirror Move returned it! + sub_8041BA8(currTarget); + sub_80559DC(currTarget, attacker); + currTarget = attacker; + targetInfo = attacker->info; + targetInfo->unk15A = 0; + moveRedirected = TRUE; + } + } + } + if (!lightRodRedirect) { + if (targetInfo->protection.protectionStatus == STATUS_PROTECT) { + s16 targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); + s32 targetFlagsAnd = targetFlags & 0xF; + if ((targetFlagsAnd == 0 || targetFlagsAnd == 4 || targetFlagsAnd == 5 || targetFlagsAnd == 2) && !r4) { + SetMessageArgument(gUnknown_202DFE8, currTarget, 0); + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC574); // protected itself! + moveHits = FALSE; + } + } + } + + if (sub_80571F0(currTarget, move)) { + moveHits = FALSE; + } + + if (moveHits) { + if (HasAbility(currTarget, ABILITY_SOUNDPROOF) && IsSoundMove(move)) { + SetMessageArgument(gUnknown_202DFE8, currTarget, 0); + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_8100524); // Soundproof suppressed the sound move! + moveHits = FALSE; + } + } + if (moveHits) { + bool8 selfAlwaysHits = (moveRedirected == FALSE); + if (move->id == MOVE_ENDURE || move->id == MOVE_DETECT || move->id == MOVE_PROTECT) { + selfAlwaysHits = FALSE; + } + if (!AccuracyCalc(attacker, currTarget, move, ACCURACY_1, selfAlwaysHits)) { + moveHits = FALSE; + } + } + + if (moveHits && lightRodRedirect) { + moveHits = FALSE; + } + + if (sub_8045888(currTarget)) { + sub_803E708(4, 0x4A); + sub_8041168(attacker, currTarget, move, NULL); + } + + if (!moveHits) { + if (GetEntInfo(attacker)->isTeamLeader) { + sub_80421C0(attacker, 0x156); + } + else { + sub_80421C0(attacker, 0x157); + } + SetMessageArgument_2(gUnknown_202DFE8, GetEntInfo(currTarget), 0); + // Interesting that these 3 strings are the same. Curious if that's the case in Blue/Europe versions. + if (attacker == currTarget) { + TryDisplayDungeonLoggableMessage3(attacker, attacker, gUnknown_80F9380); // The move missed + } + else if (GetTreatmentBetweenMonsters(attacker, currTarget, TRUE, FALSE) == 0) { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80F9384); // The move missed + } + else if (lightRodRedirect) { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80F93A4); // The move missed + } + else { + TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80F9364); // is unaffected! + } + + if (sub_8045888(currTarget)) { + sub_803ED30(9999, currTarget, 1, -1); + } + + switch (moveId) { + case MOVE_HI_JUMP_KICK: + sub_8059FC8(attacker, currTarget, move, itemId, 1); + break; + case MOVE_JUMP_KICK: + sub_8059E54(attacker, currTarget, move, itemId, 1); + break; + + } + + if (sub_8044B28()) + break; // breaks out of the loop + } + else { + s32 expMultiplierBeforeMove = targetInfo->expMultiplier; + if (targetInfo->isNotTeamMember) { + if (move->id != MOVE_REGULAR_ATTACK && itemId == 0 && expMultiplierBeforeMove == EXP_HALVED) { + targetInfo->expMultiplier = EXP_REGULAR; + } + if (isLinkedMove == TRUE) { + targetInfo->expMultiplier = EXP_BOOSTED; + } + } + + if (targetInfo->unk164 == 0xFF && sub_80717A4(currTarget, MOVE_SLEEP_TALK)) { + targetInfo->unk164 = GetDirectionTowardsPosition(&currTarget->pos, &attacker->pos); + } + if (targetInfo->unk165 == 0xFF && sub_80717A4(currTarget, MOVE_SNORE)) { + targetInfo->unk165 = GetDirectionTowardsPosition(&currTarget->pos, &attacker->pos); + } + + if (HasAbility(currTarget, ABILITY_PRESSURE) + && GetTreatmentBetweenMonsters(attacker, currTarget, TRUE, FALSE) == 1 + && move->id != MOVE_REGULAR_ATTACK + && move->id != MOVE_STRUGGLE + && itemId == 0 + && move->PP != 0) + { + if (!(move->moveFlags2 & MOVE_FLAG2_x10)) { + sub_8042950(attacker); + } + move->moveFlags2 |= MOVE_FLAG2_x10; + } + + if ((GetMoveTargetAndRangeForPokemon(attacker, move, FALSE) & 0xF) == 0) { + SetShopkeeperAggression(attacker, currTarget); + } + targetInfo->unk158 = 1; + + // They really must've had a soft spot for all these giant switches + switch (moveId) { + case MOVE_THRASH: + case MOVE_CUT: + case MOVE_ROCK_THROW: + case MOVE_DOUBLESLAP: + case MOVE_SHADOW_PUNCH: + case MOVE_EXTREMESPEED: + case MOVE_SKY_UPPERCUT: + case MOVE_SWIFT: + case MOVE_TACKLE: + case MOVE_WATERFALL: + case MOVE_SLAM: + case MOVE_BULLET_SEED: + case MOVE_EGG_BOMB: + case MOVE_FAINT_ATTACK: + case MOVE_BARRAGE: + case MOVE_PECK: + case MOVE_ARM_THRUST: + case MOVE_HORN_ATTACK: + case MOVE_WING_ATTACK: + case MOVE_AERIAL_ACE: + case MOVE_ICICLE_SPEAR: + case MOVE_VINE_WHIP: + case MOVE_SHOCK_WAVE: + case MOVE_QUICK_ATTACK: + case MOVE_SPIKE_CANNON: + case MOVE_DRAGON_CLAW: + case MOVE_DRILL_PECK: + case MOVE_DOUBLE_KICK: + case MOVE_HYDRO_PUMP: + case MOVE_HYPER_VOICE: + case MOVE_VICEGRIP: + case MOVE_POUND: + case MOVE_SCRATCH: + case MOVE_BONE_RUSH: + case MOVE_BONEMERANG: + case MOVE_MAGICAL_LEAF: + case MOVE_MACH_PUNCH: + case MOVE_PIN_MISSILE: + case MOVE_WATER_GUN: + case MOVE_FURY_ATTACK: + case MOVE_FURY_SWIPES: + case MOVE_MEGA_KICK: + case MOVE_MEGA_PUNCH: + case MOVE_MEGAHORN: + case MOVE_FURY_CUTTER: + case MOVE_COMET_PUNCH: + case MOVE_ROCK_BLAST: + case MOVE_AEROBLAST: + case MOVE_WIDE_SLASH: + case MOVE_SPIN_SLASH: + case MOVE_BLOOP_SLASH: + moveHadEffect = (HandleDamagingMove(attacker, currTarget, move, 0x100, itemId) != 0); + break; + case MOVE_REGULAR_ATTACK: + moveHadEffect = (HandleDamagingMove(attacker, currTarget, move, 0x80, itemId) != 0); + break; + case MOVE_NOTHING: + moveHadEffect = (HandleDamagingMove(attacker, currTarget, move, 0, itemId) != 0); + break; + case MOVE_EARTHQUAKE: + moveHadEffect = sub_8058F04(attacker, currTarget, move, itemId); + break; + case MOVE_GUST: + moveHadEffect = sub_8058270(attacker, currTarget, move, itemId); + break; + case MOVE_STRUGGLE: + moveHadEffect = sub_805B968(attacker, currTarget, move, itemId); + break; + case MOVE_FLAME_WHEEL: + moveHadEffect = sub_805816C(attacker, currTarget, move, itemId); + break; + case MOVE_FLAMETHROWER: + case MOVE_FIRE_BLAST: + case MOVE_HEAT_WAVE: + case MOVE_EMBER: + case MOVE_FIRE_PUNCH: + moveHadEffect = sub_80581D0(attacker, currTarget, move, itemId); + break; + case MOVE_POWDER_SNOW: + case MOVE_BLIZZARD: + case MOVE_ICE_PUNCH: + case MOVE_ICE_BEAM: + moveHadEffect = sub_8058B3C(attacker, currTarget, move, itemId); + break; + case MOVE_FRENZY_PLANT: + case MOVE_HYDRO_CANNON: + case MOVE_HYPER_BEAM: + moveHadEffect = sub_805A568(attacker, currTarget, move, itemId); + break; + case MOVE_FOCUS_ENERGY: + moveHadEffect = FocusEnergyMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_AIR_CUTTER: + case MOVE_KARATE_CHOP: + case MOVE_SLASH: + case MOVE_CRABHAMMER: + case MOVE_CROSS_CHOP: + case MOVE_RAZOR_LEAF: + case MOVE_LEAF_BLADE: + moveHadEffect = (HandleDamagingMove(attacker, currTarget, move, 0x100, itemId) != 0); + break; + case MOVE_FISSURE: + moveHadEffect = sub_80590D4(attacker, currTarget, move, itemId); + break; + case MOVE_SHEER_COLD: + case MOVE_GUILLOTINE: + moveHadEffect = sub_80595EC(attacker, currTarget, move, itemId); + break; + case MOVE_ONE_SHOT: + moveHadEffect = sub_805C138(attacker, currTarget, move, itemId); + break; + case MOVE_CLAMP: + case MOVE_BIND: + case MOVE_SAND_TOMB: + case MOVE_FIRE_SPIN: + moveHadEffect = sub_805B17C(attacker, currTarget, move, itemId); + break; + case MOVE_WHIRLPOOL: + moveHadEffect = WhirlpoolMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SURF: + moveHadEffect = SurfMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SPIDER_WEB: + case MOVE_MEAN_LOOK: + moveHadEffect = sub_805889C(attacker, currTarget, move, itemId); + break; + case MOVE_POISON_STING: + case MOVE_SLUDGE: + case MOVE_SLUDGE_BOMB: + moveHadEffect = sub_8059E0C(attacker, currTarget, move, itemId); + break; + case MOVE_PSYCHIC: + moveHadEffect = sub_8058C98(attacker, currTarget, move, gUnknown_8106A50, itemId); + break; + case MOVE_ACID: + moveHadEffect = sub_8058C98(attacker, currTarget, move, gUnknown_8106A4C, itemId); + break; + case MOVE_METAL_CLAW: + moveHadEffect = sub_805B3FC(attacker, currTarget, move, gUnknown_8106A4C, itemId); + break; + case MOVE_STEEL_WING: + moveHadEffect = sub_805A5E8(attacker, currTarget, move, gUnknown_8106A4C, itemId); + break; + case MOVE_POISON_TAIL: + moveHadEffect = sub_805B074(attacker, currTarget, move, itemId); + break; + case MOVE_TWISTER: + moveHadEffect = sub_8059928(attacker, currTarget, move, itemId); + break; + case MOVE_CONSTRICT: + case MOVE_BUBBLEBEAM: + moveHadEffect = sub_8058580(attacker, currTarget, move, itemId); + break; + case MOVE_SILVER_WIND: + case MOVE_ANCIENTPOWER: + moveHadEffect = sub_8058930(attacker, currTarget, move, itemId); + break; + case MOVE_PSYBEAM: + case MOVE_SIGNAL_BEAM: + case MOVE_CONFUSION: + moveHadEffect = sub_8058C00(attacker, currTarget, move, itemId); + break; + case MOVE_MIST_BALL: + moveHadEffect = sub_805B324(attacker, currTarget, move, itemId); + break; + case MOVE_LUSTER_PURGE: + moveHadEffect = sub_805B910(attacker, currTarget, move, itemId); + break; + case MOVE_CRUSH_CLAW: + moveHadEffect = sub_805AE74(attacker, currTarget, move, itemId); + break; + case MOVE_SMOG: + moveHadEffect = sub_8059540(attacker, currTarget, move, itemId); + break; + case MOVE_SACRED_FIRE: + moveHadEffect = sub_80595A0(attacker, currTarget, move, itemId); + break; + case MOVE_THUNDERSHOCK: + moveHadEffect = sub_8059D00(attacker, currTarget, move, itemId); + break; + case MOVE_LICK: + case MOVE_SPARK: + case MOVE_BODY_SLAM: + case MOVE_DRAGONBREATH: + moveHadEffect = sub_8058FBC(attacker, currTarget, move, itemId); + break; + case MOVE_EXTRASENSORY: + case MOVE_HYPER_FANG: + case MOVE_BONE_CLUB: + moveHadEffect = sub_8059190(attacker, currTarget, move, itemId); + break; + case MOVE_BITE: + case MOVE_NEEDLE_ARM: + case MOVE_STOMP: + case MOVE_ROLLING_KICK: + moveHadEffect = sub_8058430(attacker, currTarget, move, itemId); + break; + case MOVE_HEADBUTT: + moveHadEffect = sub_8059424(attacker, currTarget, move, itemId); + break; + case MOVE_ROCK_SLIDE: + case MOVE_ASTONISH: + moveHadEffect = sub_8057C88(attacker, currTarget, move, itemId); + break; + case MOVE_CRUNCH: + case MOVE_SHADOW_BALL: + moveHadEffect = sub_80583D8(attacker, currTarget, move, itemId); + break; + case MOVE_DIZZY_PUNCH: + case MOVE_WATER_PULSE: + moveHadEffect = sub_805AC90(attacker, currTarget, move, itemId); + break; + case MOVE_TRI_ATTACK: + moveHadEffect = TriAttackMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_METEOR_MASH: + moveHadEffect = sub_8058B84(attacker, currTarget, move, itemId); + break; + case MOVE_BLAZE_KICK: + moveHadEffect = sub_805AECC(attacker, currTarget, move, itemId); + break; + case MOVE_ATTRACT: + moveHadEffect = sub_805B454(attacker, currTarget, move, itemId); + break; + case MOVE_DISABLE: + moveHadEffect = sub_80582C4(attacker, currTarget, move, itemId); + break; + case MOVE_FAKE_OUT: + moveHadEffect = sub_805A408(attacker, currTarget, move, itemId); + break; + case MOVE_SONICBOOM: + moveHadEffect = sub_8059714(attacker, currTarget, move, itemId); + break; + case MOVE_DRAGON_RAGE: + moveHadEffect = sub_805B808(attacker, currTarget, move, itemId); + break; + case MOVE_STUN_SPORE: + moveHadEffect = sub_8059050(attacker, currTarget, move, itemId); + break; + case MOVE_THUNDER: + case MOVE_THUNDERPUNCH: + moveHadEffect = sub_8058478(attacker, currTarget, move, itemId); + break; + case MOVE_LOVELY_KISS: + case MOVE_SING: + case MOVE_SPORE: + case MOVE_GRASSWHISTLE: + case MOVE_HYPNOSIS: + case MOVE_SLEEP_POWDER: + moveHadEffect = sub_80576F8(attacker, currTarget, move, itemId); + break; + case MOVE_YAWN: + moveHadEffect = YawnMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_THUNDERBOLT: + moveHadEffect = sub_8059080(attacker, currTarget, move, itemId); + break; + case MOVE_BLOCK: + moveHadEffect = sub_8059D98(attacker, currTarget, move, itemId); + break; + case MOVE_HORN_DRILL: + moveHadEffect = sub_8059AF8(attacker, currTarget, move, itemId); + break; + case MOVE_CONFUSE_RAY: + case MOVE_SUPERSONIC: + case MOVE_SWEET_KISS: + case MOVE_TEETER_DANCE: + case MOVE_TOTTER: + moveHadEffect = sub_8059AA8(attacker, currTarget, move, itemId); + break; + case MOVE_POISON_GAS: + case MOVE_POISONPOWDER: + moveHadEffect = sub_8059DA4(attacker, currTarget, move, itemId); + break; + case MOVE_THUNDER_WAVE: + moveHadEffect = sub_8059D48(attacker, currTarget, move, itemId); + break; + case MOVE_GLARE: + moveHadEffect = sub_805B028(attacker, currTarget, move, itemId); + break; + case MOVE_ZAP_CANNON: + moveHadEffect = sub_8059D58(attacker, currTarget, move, itemId); + break; + case MOVE_SUPERPOWER: + moveHadEffect = TickleMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_ROCK_TOMB: + case MOVE_ICY_WIND: + case MOVE_MUD_SHOT: + moveHadEffect = sub_8058638(attacker, currTarget, move, itemId); + break; + case MOVE_DYNAMICPUNCH: + moveHadEffect = sub_805A688(attacker, currTarget, move, itemId); + break; + case MOVE_FAKE_TEARS: + moveHadEffect = sub_8057D7C(attacker, currTarget, move, itemId); + break; + case MOVE_WHIRLWIND: + case MOVE_ROAR: + case MOVE_BLOWBACK: + moveHadEffect = sub_805B0BC(attacker, currTarget, move, itemId); + break; + case MOVE_PAIN_SPLIT: + moveHadEffect = PainSplitMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_TAIL_GLOW: + moveHadEffect = sub_805B164(attacker, currTarget, move, itemId); + break; + case MOVE_MINIMIZE: + moveHadEffect = sub_8059A18(attacker, currTarget, move, itemId); + break; + case MOVE_DRAGON_DANCE: + moveHadEffect = sub_805B884(attacker, currTarget, move, itemId); + break; + case MOVE_BULK_UP: + moveHadEffect = BulkUpMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SHARPEN: + case MOVE_HOWL: + case MOVE_MEDITATE: + moveHadEffect = sub_80582D4(attacker, currTarget, move, itemId); + break; + case MOVE_RAGE: + moveHadEffect = RageMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SWORDS_DANCE: + moveHadEffect = sub_8059B94(attacker, currTarget, move, itemId); + break; + case MOVE_CALM_MIND: + moveHadEffect = sub_805B3B4(attacker, currTarget, move, itemId); + break; + case MOVE_GROWTH: + moveHadEffect = sub_8059588(attacker, currTarget, move, itemId); + break; + case MOVE_AMNESIA: + moveHadEffect = sub_805A2B0(attacker, currTarget, move, itemId); + break; + case MOVE_DEFENSE_CURL: + moveHadEffect = sub_805B2FC(attacker, currTarget, move, itemId); + break; + case MOVE_IRON_DEFENSE: + case MOVE_ACID_ARMOR: + case MOVE_BARRIER: + moveHadEffect = sub_8059CD8(attacker, currTarget, move, itemId); + break; + case MOVE_COSMIC_POWER: + moveHadEffect = sub_8058A7C(attacker, currTarget, move, itemId); + break; + case MOVE_MUDDY_WATER: + moveHadEffect = sub_80598CC(attacker, currTarget, move, itemId); + break; + case MOVE_OCTAZOOKA: + moveHadEffect = sub_8057F7C(attacker, currTarget, move, itemId); + break; + case MOVE_AURORA_BEAM: + moveHadEffect = sub_8057ED0(attacker, currTarget, move, itemId); + break; + case MOVE_PSYCHO_BOOST: + moveHadEffect = sub_8058CEC(attacker, currTarget, move, itemId); + break; + case MOVE_SCARY_FACE: + case MOVE_COTTON_SPORE: + moveHadEffect = sub_8058BF0(attacker, currTarget, move, itemId); + break; + case MOVE_GROWL: + moveHadEffect = sub_805A2C8(attacker, currTarget, move, itemId); + break; + case MOVE_FEATHERDANCE: + moveHadEffect = sub_805AD34(attacker, currTarget, move, itemId); + break; + case MOVE_SCREECH: + moveHadEffect = sub_8057C68(attacker, currTarget, move, itemId); + break; + case MOVE_SEISMIC_TOSS: + case MOVE_NIGHT_SHADE: + moveHadEffect = sub_8059A2C(attacker, currTarget, move, itemId); + break; + case MOVE_GIGA_DRAIN: + case MOVE_LEECH_LIFE: + case MOVE_MEGA_DRAIN: + moveHadEffect = sub_80586DC(attacker, currTarget, move, itemId); + break; + case MOVE_DOUBLE_EDGE: + moveHadEffect = sub_805946C(attacker, currTarget, move, itemId); + break; + case MOVE_SUBMISSION: + case MOVE_TAKE_DOWN: + case MOVE_VOLT_TACKLE: + moveHadEffect = sub_8058E5C(attacker, currTarget, move, itemId); + break; + case MOVE_ABSORB: + moveHadEffect = sub_80591E4(attacker, currTarget, move, itemId); + break; + case MOVE_SWAGGER: + moveHadEffect = sub_8057BC4(attacker, currTarget, move, itemId); + break; + case MOVE_TRIPLE_KICK: + moveHadEffect = sub_805A210(attacker, currTarget, move, itemId); + break; + case MOVE_TWINEEDLE: + moveHadEffect = sub_8059988(attacker, currTarget, move, itemId); + break; + case MOVE_SOLARBEAM: + moveHadEffect = SolarBeamMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SKY_ATTACK: + moveHadEffect = SkyAttackMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SLOW_DOWN: + moveHadEffect = sub_805BE90(attacker, currTarget, move, itemId); + break; + case MOVE_OUTRAGE: + case MOVE_PETAL_DANCE: + moveHadEffect = sub_80588B8(attacker, currTarget, move, itemId); + break; + case MOVE_WRAP: + moveHadEffect = WrapMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_UPROAR: + moveHadEffect = sub_8058D38(attacker, currTarget, move, itemId); + break; + case MOVE_POISON_FANG: + moveHadEffect = sub_8059DC4(attacker, currTarget, move, itemId); + break; + case MOVE_PRESENT: + moveHadEffect = PresentMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_REFLECT: + moveHadEffect = ReflectMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SANDSTORM: + moveHadEffect = SandstormMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SAFEGUARD: + moveHadEffect = SafeguardMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_MIST: + moveHadEffect = MistMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_LIGHT_SCREEN: + moveHadEffect = LightScreenMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_ICE_BALL: + case MOVE_ROLLOUT: + moveHadEffect = sub_805768C(attacker, currTarget, move, itemId); + break; + case MOVE_MEMENTO: + moveHadEffect = sub_8057F24(attacker, currTarget, move, itemId); + break; + case MOVE_SOFTBOILED: + case MOVE_MILK_DRINK: + moveHadEffect = sub_80599EC(attacker, currTarget, move, itemId); + break; + case MOVE_SYNTHESIS: + moveHadEffect = sub_80589D4(attacker, currTarget, move, itemId); + break; + case MOVE_MOONLIGHT: + moveHadEffect = sub_8059AC4(attacker, currTarget, move, itemId); + break; + case MOVE_REST: + moveHadEffect = sub_805A4D4(attacker, currTarget, move, itemId); + break; + case MOVE_RECOVER: + case MOVE_SLACK_OFF: + moveHadEffect = sub_8058EE0(attacker, currTarget, move, itemId); + break; + case MOVE_SCAN: + moveHadEffect = ScannerOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_TRICK: + moveHadEffect = sub_805A120(attacker, currTarget, move, itemId); + break; + case MOVE_TAKEAWAY: + moveHadEffect = sub_805BA50(attacker, currTarget, move, itemId); + break; + case MOVE_THIEF: + case MOVE_COVET: + moveHadEffect = sub_805A2A0(attacker, currTarget, move, itemId); + break; + case MOVE_AGILITY: + case MOVE_SPEED_BOOST: + moveHadEffect = sub_8058A08(attacker, currTarget, move, itemId); + break; + case MOVE_PURSUIT: + case MOVE_COUNTER: + moveHadEffect = CounterMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_BIDE: + case MOVE_REVENGE: + moveHadEffect = BideMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_BIDE_2: + moveHadEffect = sub_805836C(attacker, currTarget, move, itemId); + break; + case MOVE_TRAPPER: + moveHadEffect = TrapperOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_SLEEP_TALK: + moveHadEffect = sub_805A450(attacker, currTarget, move, itemId); + break; + case MOVE_CURSE: + moveHadEffect = CurseMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_HI_JUMP_KICK: + moveHadEffect = sub_8059FC8(attacker, currTarget, move, itemId, 0); + break; + case MOVE_BLAST_BURN: + moveHadEffect = sub_805AE3C(attacker, currTarget, move, itemId); + break; + case MOVE_HIDDEN_POWER: + moveHadEffect = sub_805B3E0(attacker, currTarget, move, itemId); + break; + case MOVE_RAZOR_WIND: + moveHadEffect = RazorWindMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_FOCUS_PUNCH: + moveHadEffect = FocusPunchMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_MAGIC_COAT: + moveHadEffect = MagicCoatMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_NIGHTMARE: + moveHadEffect = NightmareMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_MORNING_SUN: + moveHadEffect = sub_8057748(attacker, currTarget, move, itemId); + break; + case MOVE_VACUUM_CUT: + moveHadEffect = sub_805C1BC(attacker, currTarget, move, itemId); + break; + case MOVE_MUD_SPORT: + case MOVE_WATER_SPORT: + moveHadEffect = MudWaterSportMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_IRON_TAIL: + moveHadEffect = sub_8057634(attacker, currTarget, move, itemId); + break; + case MOVE_TAIL_WHIP: + case MOVE_LEER: + moveHadEffect = sub_805A3DC(attacker, currTarget, move, itemId); + break; + case MOVE_WILL_O_WISP: + moveHadEffect = sub_8057FF4(attacker, currTarget, move, itemId); + break; + case MOVE_INGRAIN: + moveHadEffect = sub_805A4FC(attacker, currTarget, move, itemId); + break; + case MOVE_PSYWAVE: + moveHadEffect = sub_8058C48(attacker, currTarget, move, itemId); + break; + case MOVE_LEECH_SEED: + moveHadEffect = LeechSeedMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SPIKES: + moveHadEffect = SpikesMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_AROMATHERAPY: + case MOVE_HEAL_BELL: + case MOVE_REFRESH: + moveHadEffect = sub_80578EC(attacker, currTarget, move, itemId); + break; + case MOVE_HAZE: + moveHadEffect = sub_80588A8(attacker, currTarget, move, itemId); + break; + case MOVE_POWER_EARS: + moveHadEffect = RadarOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_SIESTA: + moveHadEffect = sub_805BC70(attacker, currTarget, move, itemId); + break; + case MOVE_SMELLINGSALT: + moveHadEffect = sub_80587E8(attacker, currTarget, move, itemId); + break; + case MOVE_MAGNITUDE: + moveHadEffect = sub_805B264(attacker, currTarget, move, itemId); + break; + case MOVE_SKULL_BASH: + moveHadEffect = SkullBashMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_WISH: + moveHadEffect = WishMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_FLATTER: + moveHadEffect = sub_8057FCC(attacker, currTarget, move, itemId); + break; + case MOVE_MUD_SLAP: + moveHadEffect = sub_805A258(attacker, currTarget, move, itemId); + break; + case MOVE_SAND_ATTACK: + case MOVE_KINESIS: + case MOVE_FLASH: + moveHadEffect = sub_8059528(attacker, currTarget, move, itemId); + break; + case MOVE_OVERHEAT: + moveHadEffect = sub_8057E6C(attacker, currTarget, move, itemId); + break; + case MOVE_TOXIC: + moveHadEffect = sub_8059DB4(attacker, currTarget, move, itemId); + break; + case MOVE_METAL_SOUND: + moveHadEffect = sub_8058838(attacker, currTarget, move, itemId); + break; + case MOVE_TORMENT: + moveHadEffect = TormentMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SUPER_FANG: + moveHadEffect = sub_8057974(attacker, currTarget, move, itemId); + break; + case MOVE_FALSE_SWIPE: + moveHadEffect = sub_805B388(attacker, currTarget, move, itemId); + break; + case MOVE_TWO_EDGE: + moveHadEffect = sub_805BC98(attacker, currTarget, move, itemId); + break; + case MOVE_ENDEAVOR: + moveHadEffect = sub_80584C0(attacker, currTarget, move, itemId); + break; + case MOVE_BATON_PASS: + case MOVE_SWITCHER: + moveHadEffect = sub_805BB74(attacker, currTarget, move, itemId); + break; + case MOVE_DREAM_EATER: + moveHadEffect = sub_805B668(attacker, currTarget, move, itemId); + break; + case MOVE_SEARCHLIGHT: + moveHadEffect = LuminousOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_FILL_IN: + moveHadEffect = FillInOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_TELEPORT: + case MOVE_WARP: + moveHadEffect = sub_8059CF0(attacker, currTarget, move, itemId); + break; + case MOVE_DROUGHT: + moveHadEffect = sub_805BF34(attacker, currTarget, move, itemId); + break; + case MOVE_SEE_STAIRS: + moveHadEffect = StairsOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_BRICK_BREAK: + moveHadEffect = BrickBreakMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_HARDEN: + case MOVE_WITHDRAW: + moveHadEffect = sub_80582AC(attacker, currTarget, move, itemId); + break; + case MOVE_MIND_READER: + case MOVE_LOCK_ON: + moveHadEffect = sub_8058A54(attacker, currTarget, move, itemId); + break; + case MOVE_VITAL_THROW: + moveHadEffect = VitalThrowMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_FLY: + moveHadEffect = FlyMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_BOUNCE: + moveHadEffect = sub_8059F38(attacker, currTarget, move, itemId); + break; + case MOVE_DIVE: + moveHadEffect = DiveMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_DIG: + moveHadEffect = DigMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SWEET_SCENT: + moveHadEffect = sub_8057824(attacker, currTarget, move, itemId); + break; + case MOVE_DOUBLE_TEAM: + moveHadEffect = sub_805825C(attacker, currTarget, move, itemId); + break; + case MOVE_KNOCK_OFF: + moveHadEffect = KnockOffMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_TRAP_BUSTER: + moveHadEffect = TrapbustOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_LONG_TOSS: + moveHadEffect = LongtossOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_PIERCE: + moveHadEffect = PierceOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_GRUDGE: + moveHadEffect = GrudgeMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_PETRIFY: + moveHadEffect = PetrifyOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_ASSIST: + moveHadEffect = sub_805A4C0(attacker, currTarget, move, itemId); + break; + case MOVE_DOOM_DESIRE: + case MOVE_FUTURE_SIGHT: + moveHadEffect = sub_805AAD0(attacker, currTarget, move, itemId); + break; + case MOVE_SHOCKER: + moveHadEffect = ShockerOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_FOLLOW_ME: + case MOVE_SUBSTITUTE: + case MOVE_DECOY_MAKER: + moveHadEffect = sub_805B314(attacker, currTarget, move, itemId); + break; + case MOVE_JUMP_KICK: + moveHadEffect = sub_8059E54(attacker, currTarget, move, itemId, 0); + break; + case MOVE_PROTECT: + case MOVE_DETECT: + moveHadEffect = ProtectMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_TAUNT: + moveHadEffect = sub_8059AB8(attacker, currTarget, move, itemId); + break; + case MOVE_TICKLE: + moveHadEffect = sub_8058858(attacker, currTarget, move, itemId); + break; + case MOVE_REVERSAL: + case MOVE_FLAIL: + moveHadEffect = sub_8058770(attacker, currTarget, move, itemId); + break; + case MOVE_SELFDESTRUCT: + moveHadEffect = sub_8059004(attacker, currTarget, move, itemId); + break; + case MOVE_EXPLOSION: + moveHadEffect = sub_80597F0(attacker, currTarget, move, itemId); + break; + case MOVE_CHARGE: + moveHadEffect = ChargeMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_FACADE: + moveHadEffect = sub_8058548(attacker, currTarget, move, itemId); + break; + case MOVE_LOW_KICK: + moveHadEffect = sub_80588F4(attacker, currTarget, move, itemId); + break; + case MOVE_WATER_SPOUT: + moveHadEffect = sub_8058D44(attacker, currTarget, move, itemId); + break; + case MOVE_ERUPTION: + moveHadEffect = sub_805AFA4(attacker, currTarget, move, itemId); + break; + case MOVE_SMOKESCREEN: + moveHadEffect = SmokescreenMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SEE_TRAP: + moveHadEffect = sub_805BA44(attacker, currTarget, move, itemId); + break; + case MOVE_STOCKPILE: + moveHadEffect = StockpileMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SPIT_UP: + moveHadEffect = SpitUpMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SWALLOW: + moveHadEffect = SwallowMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_RAIN_DANCE: + moveHadEffect = RainDanceMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SPITE: + moveHadEffect = sub_8057D9C(attacker, currTarget, move, itemId); + break; + case MOVE_INVISIFY: + moveHadEffect = InvisifyOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_MIRROR_COAT: + moveHadEffect = MirrorCoatMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_PERISH_SONG: + moveHadEffect = PerishSongMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_RAPID_SPIN: + moveHadEffect = sub_8058A18(attacker, currTarget, move, itemId); + break; + case MOVE_DESTINY_BOND: + moveHadEffect = DestinyBondMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_ENCORE: + moveHadEffect = EncoreMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_WEATHER_BALL: + moveHadEffect = sub_8057CD0(attacker, currTarget, move, itemId); + break; + case MOVE_SUNNY_DAY: + moveHadEffect = SunnyDayMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_PAY_DAY: + moveHadEffect = sub_805A464(attacker, currTarget, move, itemId); + break; + case MOVE_ONE_ROOM: + moveHadEffect = sub_805C2A0(attacker, currTarget, move, itemId); + break; + case MOVE_ENDURE: + moveHadEffect = EndureMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_HELPING_HAND: + moveHadEffect = HelpingHandMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_BELLY_DRUM: + moveHadEffect = BellyDrumMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_FAMISH: + moveHadEffect = sub_805C288(attacker, currTarget, move, itemId); + break; + case MOVE_CHARM: + moveHadEffect = sub_805783C(attacker, currTarget, move, itemId); + break; + case MOVE_BUBBLE: + moveHadEffect = sub_80578FC(attacker, currTarget, move, itemId); + break; + case MOVE_STRING_SHOT: + moveHadEffect = sub_8057BB4(attacker, currTarget, move, itemId); + break; + case MOVE_ROCK_SMASH: + case MOVE_EXCAVATE: + moveHadEffect = RockSmashMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_TRANSFORM: + moveHadEffect = TransformMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_HAIL: + moveHadEffect = HailMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_MOBILE: + moveHadEffect = MobileOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_ODOR_SLEUTH: + case MOVE_FORESIGHT: + moveHadEffect = sub_8058234(attacker, currTarget, move, itemId); + break; + case MOVE_SPLASH: + moveHadEffect = sub_805A85C(attacker, currTarget, move, itemId); + break; + case MOVE_TRANSFER: + moveHadEffect = TransferOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_STAY_AWAY: + moveHadEffect = sub_805BB98(attacker, currTarget, move, itemId); + break; + case MOVE_BEAT_UP: + moveHadEffect = sub_805AD54(attacker, currTarget, move, itemId); + break; + case MOVE_REBOUND: + moveHadEffect = ReboundOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_IMPRISON: + case MOVE_OBSERVER: + moveHadEffect = sub_805AD04(attacker, currTarget, move, itemId); + break; + case MOVE_WILD_CALL: + moveHadEffect = sub_805C080(attacker, currTarget, move, itemId); + break; + case MOVE_REVIVER: + moveHadEffect = sub_805C1E4(attacker, currTarget, move, itemId); + break; + case MOVE_ESCAPE: + moveHadEffect = EscapeOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_SECRET_POWER: + moveHadEffect = SecretPowerMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_NATURE_POWER: + moveHadEffect = NaturePowerMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_ITEMIZE: + moveHadEffect = sub_805C3F8(attacker, currTarget, move, itemId); + break; + case MOVE_SKETCH: + moveHadEffect = SketchMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_MIRROR_MOVE: + moveHadEffect = sub_8057E50(attacker, currTarget, move, itemId); + break; + case MOVE_ROLE_PLAY: + moveHadEffect = RolePlayMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SKILL_SWAP: + moveHadEffect = SkillSwapMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_CONVERSION: + moveHadEffect = ConversionMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_CLEANSE: + moveHadEffect = CleanseOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_RETURN: + moveHadEffect = sub_805805C(attacker, currTarget, move, itemId); + break; + case MOVE_SNATCH: + moveHadEffect = SnatchMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_CAMOUFLAGE: + moveHadEffect = HandleColorChange(attacker, currTarget, move, itemId); + break; + case MOVE_FRUSTRATION: + moveHadEffect = sub_805B53C(attacker, currTarget, move, itemId); + break; + case MOVE_PSYCH_UP: + moveHadEffect = PsychUpMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_SNORE: + moveHadEffect = SnoreMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_RECYCLE: + moveHadEffect = RecycleMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_NO_MOVE: + moveHadEffect = SilenceOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_METRONOME: + moveHadEffect = sub_805B618(attacker, currTarget, move, itemId); + break; + case MOVE_HP_GAUGE: + moveHadEffect = IdentifyOrbAction(attacker, currTarget, move, itemId); + break; + case MOVE_CONVERSION_2: + moveHadEffect = Conversion2MoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_POUNCE: + moveHadEffect = sub_805BEB8(attacker, currTarget, move, itemId); + break; + case MOVE_TRAWL: + moveHadEffect = sub_805BEC8(attacker, currTarget, move, itemId); + break; + case MOVE_MIMIC: + moveHadEffect = MimicMoveAction(attacker, currTarget, move, itemId); + break; + case MOVE_STRENGTH: + case MOVE_HURL: + moveHadEffect = sub_805C45C(attacker, currTarget, move, itemId); + break; + case MOVE_ECHO: + moveHadEffect = sub_805C208(attacker, currTarget, move, itemId); + break; + default: + moveHadEffect = FALSE; + break; + } + + if (sub_8044B28()) { + break; + } + + if (EntityExists(currTargetSaved)) { + sub_806CE68(currTargetSaved, GetEntInfo(currTargetSaved)->action.direction); + } + + if (!moveHadEffect) { + if (EntityExists(attacker) && EntityExists(currTarget) && targetInfo->isNotTeamMember) { + targetInfo->expMultiplier = expMultiplierBeforeMove; + } + } + else { + if (MoveCausesPaused(move) && sub_8057308(attacker, 0)) { + gUnknown_202F222 = 1; + } + } + + if (EntityExists(currTarget)) { + targetInfo->unk158 = 1; + } + + if (moveId != MOVE_SKILL_SWAP) { + TriggerTargetAbilityEffect(attacker); + sub_8069F9C(attacker, currTarget, move); + sub_806A120(attacker, currTarget, move); + } + } + + attacker = originalAttacker; + } + } + + if (!sub_8044B28()) { + if (EntityExists(attacker) && GetEntInfo(attacker)->unk154 != 0) { + GetEntInfo(attacker)->unk154 = 0; + sub_807D148(attacker, attacker, 0, NULL); + } + if (EntityExists(attacker) && GetEntInfo(attacker)->unk155 != 0) { + GetEntInfo(attacker)->unk155 = 0; + LowerAttackStageTarget(attacker, attacker, gUnknown_8106A50, 2, 0, FALSE); + } + } +} + +bool32 HandleRegularDamagingMove(Entity *attacker, Entity *target, Move *move, s32 itemId) +{ + return (HandleDamagingMove(attacker, target, move, 0x100, itemId) != 0); +} + +s32 HandleDamagingMove(Entity *attacker, Entity *target, Move *move, s32 r9, s32 itemId) +{ + struct DamageStruct dmgStruct; + s16 unk; + s32 moveType = GetMoveTypeForMonster(attacker, move); + s32 movePower = GetMovePower(attacker, move); + s32 critChance = GetMoveCritChance(move); + + sub_806EAF4(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1); + unk = sub_8057600(move, itemId); + return TryHitTarget(attacker, target, move, &dmgStruct, unk); +} + +s32 sub_80556BC(Entity *attacker, Entity *target, u8 moveType, Move *move, s32 r9, s32 itemId) +{ + struct DamageStruct dmgStruct; + s16 unk; + s32 movePower = GetMovePower(attacker, move); + s32 critChance = GetMoveCritChance(move); + + sub_806EAF4(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1); + unk = sub_8057600(move, itemId); + return TryHitTarget(attacker, target, move, &dmgStruct, unk); +} + +static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct DamageStruct *dmgStruct, s16 unk_) +{ + s32 unk = unk_; // It's happening again... + if (AccuracyCalc(attacker, target, move, ACCURACY_2, TRUE)) { // Move hits + bool32 isFalseSwipe = (move->id == MOVE_FALSE_SWIPE); + + if (HasAbility(target, ABILITY_ILLUMINATE)) { + gDungeon->unk662 = 999; + gDungeon->unk17B34 = target; + gDungeon->unk17B40 = target->spawnGenID; + } + + HandleDealingDamage(attacker, target, dmgStruct, isFalseSwipe, TRUE, unk, TRUE, 0); + } + else { + SetMessageArgument_2(gUnknown_202DFE8, GetEntInfo(target), 0); + if (sub_8045888(attacker) && sub_8045888(target)) { + sub_803ED30(9999, target, 1, -1); + TryDisplayDungeonLoggableMessage4(attacker, target, gUnknown_80F9688); // It took no damage! + sub_8042238(attacker, target); + } + else { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); // It took no damage! + } + dmgStruct->unkF = 1; + } + + if (dmgStruct->unkF != 0) { + return 0; + } + + if (EntityExists(target)) { + GetEntInfo(target)->unk15A = 1; + } + + return dmgStruct->dmg; +} + +s32 sub_8055864(Entity *attacker, Entity *target, Move *move, s32 param_4, s32 itemId) +{ + struct DamageStruct dmgStruct; + s32 moveType = GetMoveTypeForMonster(attacker, move); + + sub_806F2BC(attacker, target, moveType, param_4, &dmgStruct); + HandleDealingDamage(attacker, target, &dmgStruct, FALSE, TRUE, sub_8057600(move, itemId), TRUE, 0); + if (dmgStruct.unkF != 0) { + return 0; + } + + if (EntityExists(target)) { + GetEntInfo(target)->unk15A = 1; + } + return dmgStruct.dmg; +} + +// This unused function returns FALSE if target's typing makes it immune to move's type. +UNUSED bool32 TargetNotImmuneTo(Move *move, Entity *target) +{ + s32 i; + s32 dmg = 1; + bool32 ghostImmunity = FALSE; + EntityInfo *targetInfo = GetEntInfo(target); + s32 moveType = GetMoveType(move); + + if (moveType == TYPE_NORMAL || moveType == TYPE_FIGHTING) { + ghostImmunity = TRUE; + } + + for (i = 0; i < 2; i++) { + s32 multiplier[4] = {0, 1, 1, 1}; // EFFECTIVENESS_IMMUNE is 0, others are 1 + s32 effectiveness; + + if (ghostImmunity && targetInfo->types[i] == TYPE_GHOST && !targetInfo->exposed) { + effectiveness = EFFECTIVENESS_IMMUNE; + } + else { + effectiveness = gTypeEffectivenessChart[moveType][targetInfo->types[i]]; + } + + dmg *= multiplier[effectiveness]; + if (dmg == 0) + break; + } + + return (dmg != 0); +} + +bool8 sub_8055988(Entity *r2, Entity *r4) +{ + if (r2 != r4 + && abs(r2->pos.x - r4->pos.x) <= 1 && abs(r2->pos.y - r4->pos.y) <= 1 + && CanAttackInDirection(r4, GetDirectionTowardsPosition(&r4->pos, &r2->pos))) + { + return TRUE; + } + + return FALSE; +} + +void sub_80559DC(Entity *entity1, Entity *entity2) +{ + EntityInfo *entInfo = GetEntInfo(entity1); + s32 direction = GetDirectionTowardsPosition(&entity1->pos, &entity2->pos); + + entInfo->action.direction = direction & DIRECTION_MASK; + sub_806CE68(entity1, direction); +} + +bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s32 arg_0) +{ + s32 i, j; + s32 moveId; + EntityInfo *attackerInfo = GetEntInfo(attacker); + bool32 isLinkedMove; + + moveId = firstMoveId; + if (firstMoveId >= MAX_MON_MOVES) + return FALSE; + + attackerInfo->abilityEffectFlags = 0; + attackerInfo->unk159 = 0; + if (attackerInfo->volatileStatus.volatileStatus == STATUS_CRINGE) { + SetMessageArgument(gAvailablePokemonNames, attacker, 0); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC714); // is cringing! + return FALSE; + } + else if (attackerInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) { + SetMessageArgument(gAvailablePokemonNames, attacker, 0); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC718); // is infatuated! + return FALSE; + } + else if (attackerInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + SetMessageArgument(gAvailablePokemonNames, attacker, 0); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6A8); // is paralyzed! + return FALSE; + } + + gUnknown_202F222 = 0; + gUnknown_202F208 = 0; + gUnknown_202F221 = 0; + for (i = 0; i < MAX_MON_MOVES; i++) { + attackerInfo->mimicMoveIDs[i] = 0; + } + + for (i = 0, j = 0; i < MAX_MON_MOVES; i++) { + j++; + if (++moveId >= MAX_MON_MOVES) + break; + if (!(attackerInfo->moves.moves[moveId].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) + break; + } + + isLinkedMove = (j > 1); + moveId = firstMoveId; + + while (1) { + Move *currMove = &attackerInfo->moves.moves[moveId]; + if (!EntityExists(attacker) || sub_8044B28()) + break; + + if (currMove->id == MOVE_SNORE || currMove->id == MOVE_SLEEP_TALK) { + if (!IsSleeping(attacker)) { + if (CannotAttack(attacker, TRUE)) + break; + } + } + else { + if (CannotAttack(attacker, FALSE)) + break; + } + + if (gUnknown_202F221 != 0) + break; + + if (MoveFlagExists(currMove)) { + bool32 moveUsable = TRUE; + bool32 var_28 = FALSE; + bool32 statusMoveMatch = MoveMatchesChargingStatus(attacker, currMove); + + if (currMove->PP != 0) { + if (!statusMoveMatch) { + var_28 = TRUE; + } + } + else { + if (!statusMoveMatch) { + sub_80928C0(gFormatItems, currMove, NULL); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80F93C8); // The move can't be used! + moveUsable = FALSE; + } + } + + if (moveUsable) { + bool32 moveWasUsed; + s32 unkBefore = gUnknown_202F208; + + attackerInfo->unk159 = statusMoveMatch; + if (currMove->id == MOVE_ASSIST) { + Move assistMove = *currMove; + + assistMove.id = sub_8057144(attacker); + sub_80928C0(gFormatItems, &assistMove, NULL); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FD2DC); // Assist: + moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, &assistMove); + } + else { + moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, currMove); + } + + if (var_28 && moveWasUsed) { + if (currMove->moveFlags2 & MOVE_FLAG2_UNK4) { + currMove->moveFlags2 &= ~(MOVE_FLAG2_UNK4); + } + else { + currMove->moveFlags2 |= MOVE_FLAG_TEMPORARY; + } + } + + if (unkBefore == gUnknown_202F208) { + if (itemId == 0) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC690); // The currMove failed! + } + else { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6A4); // The Orb failed! + } + } + } + } + + sub_804178C(1); + if (!EntityExists(attacker) || sub_8044B28()) + break; + if (++moveId >= MAX_MON_MOVES) + break; + if (!MoveFlagLinkChain(&attackerInfo->moves.moves[moveId])) + break; + } + + if (EntityExists(attacker)) { + for (i = 0; i < MAX_MON_MOVES; i++) { + if (attackerInfo->mimicMoveIDs[i] != 0) { + Move mimicMove, assistMove; + Move *movePtr; + + movePtr = &mimicMove; + sub_8092AA8(&mimicMove, attackerInfo->mimicMoveIDs[i]); + if (MoveFlagExists(&mimicMove)) { + if (mimicMove.id == MOVE_ASSIST) { + assistMove = mimicMove; + assistMove.id = sub_8057144(attacker); + movePtr = &assistMove; + sub_80928C0(gFormatItems, &assistMove, NULL); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FD2DC); // Assist: + } + TryUseChosenMove(attacker, 0, itemId, arg_0, isLinkedMove, movePtr); + } + sub_804178C(1); + } + } + } + + if (EntityExists(attacker)) { + sub_8071DA4(attacker); + if (EntityExists(attacker) && gUnknown_202F222 != 0) { + gUnknown_202F222 = 0; + if (EntityExists(attacker)) { + EntityInfo *attackerInfo = GetEntInfo(attacker); + s32 statusTurns = CalculateStatusTurns(attacker, gUnknown_80F4E70, TRUE); + PausedStatusTarget(attacker, attacker, 1, statusTurns, FALSE); + SetExpMultplier(attackerInfo); + } + } + } + + return TRUE; +} + +static void TriggerTargetAbilityEffect(Entity *attacker) +{ + if (EntityExists(attacker)) { + EntityInfo *entInfo = GetEntInfo(attacker); + + if (entInfo->abilityEffectFlags & ABILITY_FLAG_ARENA_TRAP) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEA4); // Arena Trap prevents movement! + ImmobilizedStatusTarget(attacker, attacker); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_SHADOW_TAG) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEC8); // Shadow Tag prevents movement! + ImmobilizedStatusTarget(attacker, attacker); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_MAGNET_PULL) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEEC); // Magnet Pull prevents movement! + ImmobilizedStatusTarget(attacker, attacker); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF0C); // Static caused paralysis! + ParalyzeStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PRLZ) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF30); // Effect Spore scattered spores + ParalyzeStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_POISON_POINT) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF4C); // Poison Point struck! + PoisonedStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PSN) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF50); // Effect Spore scattered spores! + PoisonedStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_SLP) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF54); // Effect Spore scattered spores! + sub_8075C58(attacker, attacker, CalculateStatusTurns(attacker, gUnknown_80F4E74, TRUE), TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_FLAME_BODY) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF74); // Flame Body caused a burn! + BurnedStatusTarget(attacker, attacker, TRUE, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_CUTE_CHARM) { + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF98); // Cute Charm caused infatuation + InfatuateStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_STENCH) { + SetMessageArgument(gAvailablePokemonNames, attacker, 0); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEFD0); // A horrid stench billowed out + sub_80428A0(attacker); + entInfo->terrifiedTurns = gUnknown_80F5004; + } + + entInfo->abilityEffectFlags = 0; + } +} + +bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move) +{ + s32 i; + Entity *targetsArray[MAX_MOVE_TARGETS + 1]; + const u8 *msg; + Move metronomeMove, naturePwrMove; + s32 var_2C; + s32 var_28; + s32 var_24; + bool8 moveUsable; + + msg = NULL; + targetsArray[0] = NULL; + + sub_804178C(1); + if (move->id == MOVE_METRONOME) { + gMetronomeCalledArrayId = DungeonRandInt(METRONOME_AVAILABLE_CALLED_MOVES); + InitPokemonMove(&metronomeMove, gMetronomeCalledMoves[gMetronomeCalledArrayId].moveID); + metronomeMove.moveFlags = move->moveFlags; + metronomeMove.moveFlags2 = move->moveFlags2; + sub_8056468(attacker, move, gUnknown_80FECBC, targetsArray, itemId, TRUE, FALSE); + sub_804178C(1); + move = &metronomeMove; + } + else if (move->id == MOVE_NATURE_POWER) + { + s32 tileset = gDungeon->tileset; + + if (tileset < 0) + tileset = 0; + if (tileset > 74) + tileset = 74; + + InitPokemonMove(&naturePwrMove, gNaturePowerCalledMoves[tileset].moveID); + naturePwrMove.moveFlags = move->moveFlags; + naturePwrMove.moveFlags2 = move->moveFlags2; + sub_8056468(attacker, move, gUnknown_80FECE0, targetsArray, itemId, TRUE, FALSE); + sub_804178C(1); + move = &naturePwrMove; + } + + var_28 = 0; + if ((GetMoveTargetAndRangeForPokemon(attacker, move, TRUE) + & (0xF0)) == TARGETING_FLAG_TARGET_LINE) + { + var_28 = 10; + } + if ((GetMoveTargetAndRangeForPokemon(attacker, move, TRUE) + & (0xF0)) == TARGETING_FLAG_CUT_CORNERS) + { + var_28 = 1; + if ((move->id != MOVE_SOLARBEAM || GetApparentWeather(attacker) != WEATHER_SUNNY) && DoesMoveCharge(move->id)) { + if (!MoveMatchesChargingStatus(attacker, move)) { + var_28 = 0; + } + } + } + + SetMessageArgument_2(gAvailablePokemonNames, GetEntInfo(attacker), 0); + sub_80928C0(gFormatItems, move, NULL); + if (MoveMatchesChargingStatus(attacker, move)) { + msg = gUnknown_80FC72C; // mon loosed move + GetEntInfo(attacker)->unkFF = 0; + moveUsable = sub_805744C(attacker, move, TRUE); + } + else { + if (itemId == 0) { + msg = GetMoveUseText(move->id); + } + else { + msg = gUnknown_80F9158; + } + moveUsable = CanMonsterUseMove(attacker, move, TRUE); + } + + if (moveUsable && r6) { + sub_806ACE8(attacker, move); + } + + if (GetEntInfo(attacker)->muzzled.muzzled == TRUE && FailsWhileMuzzled(move->id)) { + SetMessageArgument(gAvailablePokemonNames, attacker, 0); + TryDisplayDungeonLoggableMessage(attacker, msg); + sub_803E708(0xA, 0x3F); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC710); // is muzzled! + return FALSE; + } + else if (!moveUsable) { + SetMessageArgument_2(gAvailablePokemonNames, GetEntInfo(attacker), 0); + if (itemId == 0) { + sub_80928C0(gFormatItems, move, NULL); + TryDisplayDungeonLoggableMessage(attacker, msg); + sub_803E708(0xA, 0x3F); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6D0); // But the move couldn't be used! + } + else { + BufferItemName(gFormatItems, itemId, NULL); + TryDisplayDungeonLoggableMessage(attacker, msg); + sub_803E708(0xA, 0x3F); + TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6FC); // But Orbs are prevented from being used! + } + return FALSE; + } + + gUnknown_202F214 = 0; + gUnknown_202F20C = 0; + gUnknown_202F210 = 0; + gUnknown_202F218 = 0; + gUnknown_202F219 = 0; + gUnknown_202F21A = 0; + gUnknown_202F21C = 0; + gUnknown_202F220 = 0; + if (isLinkedMove && GetEntInfo(attacker)->unk153 <= 3) { + GetEntInfo(attacker)->unk153++; + } + + var_2C = sub_8057070(move); + for (i = 0; i < var_2C; i++) { + u8 r4; + EntityInfo *entInfo; + + var_24 = 1; + if (gUnknown_202F220 != 0 || gUnknown_202F221 != 0) + break; + if (!EntityExists(attacker) || sub_8044B28()) + return TRUE; + + entInfo = GetEntInfo(attacker); + if (var_30 != 0 || move->id == MOVE_SNORE || move->id == MOVE_SLEEP_TALK) { + if (!IsSleeping(attacker) && CannotAttack(attacker, TRUE)) + break; + } + else { + if (CannotAttack(attacker, FALSE)) + break; + } + entInfo->unk14A = 0; + if (move->id == MOVE_THRASH) { + GetEntInfo(attacker)->action.direction = DungeonRandInt(NUM_DIRECTIONS); + TargetTileInFront(attacker); + var_24 = 0; + } + gUnknown_203B438 = NULL; + targetsArray[0] = 0; + if (var_28 == 0 || var_28 == 1) { + SetTargetsForMove(targetsArray, attacker, move); + SortTargets(targetsArray, attacker); + if (i != 0 && var_24 != 0 && targetsArray[0] == NULL) + break; + } + r4 = sub_8056468(attacker, move, msg, targetsArray, itemId, (i == 0), var_28); + msg = NULL; + if (gUnknown_203B438 != 0) { + sub_806A1E8(gUnknown_203B438); + } + + if (GetEntInfo(attacker)->volatileStatus.volatileStatus != STATUS_CONFUSED && GetEntInfo(attacker)->volatileStatus.volatileStatus != STATUS_COWERING) { + EntityInfo *entInfo = GetEntInfo(attacker); + entInfo->targetPos.x = 0; + entInfo->targetPos.y = 0; + } + + gUnknown_202F214++; + if (var_28 != 0) { + sub_80566F8(attacker, move, var_28, r4, itemId, isLinkedMove); + } + else { + UseMoveAgainstTargets(targetsArray, attacker, move, itemId, isLinkedMove); + } + + if (!EntityExists(attacker)) + break; + + sub_806CF18(attacker); + if (GetEntInfo(attacker)->unk14A == 0) { + GetEntInfo(attacker)->unk14A = 0; // Redundant as it's already 0 + sub_8079764(attacker); + } + } + + + if (gUnknown_202F21A != 0) { + SendImmobilizeEndMessage(attacker, attacker); + SendLinkedEndMessage(attacker, attacker); + } + + if (gUnknown_202F219 != 0 && EntityExists(attacker)) { + EntityInfo *entInfo = GetEntInfo(attacker); + + ConfuseStatusTarget(attacker, attacker, FALSE); + SetExpMultplier(entInfo); + } + return TRUE; +} + +bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray, bool32 itemId, bool8 arg_4, bool32 unused) +{ + s32 i; + bool8 ret = FALSE; + bool32 r7 = (sub_8045888(entity) != FALSE); + + if (str != NULL) { + for (i = 0; i < 65; i++) { + if (unkArray[i] == NULL) { + break; + } + if (sub_8045888(unkArray[i])) { + r7 = TRUE; + break; + } + } + + if (r7) { + SetMessageArgument_2(gAvailablePokemonNames, GetEntInfo(entity), 0); + if (itemId == 0) { + sub_80928C0(gFormatItems, move, NULL); + } + else { + BufferItemName(gFormatItems, itemId, NULL); + } + } + + if (move->id != MOVE_REGULAR_ATTACK) { + DisplayDungeonLoggableMessageTrue(entity, str); + } + else { + DisplayDungeonLoggableMessageFalse(entity, str); + } + } + + if (r7) { + if (arg_4) { + ret = sub_8040BB0(entity, move, TRUE); + } + else { + ret = sub_8040BB0(entity, move, FALSE); + } + sub_8040DA0(entity, move); + } + else { + sub_806CE68(entity, GetEntInfo(entity)->action.direction); + } + + return ret; +} + +struct UnkStruct_sub_800E308_1 +{ + s16 unk0; + s16 unk2; + Position unk4; + Position unk8; + s32 unkC; + s32 unk10; +}; + +// Maybe Position? Maybe not, sub_800E308 is called only by sub_8056564, so :shrug: +struct UnkStruct_sub_800E308_2 +{ + s16 u0; + s16 u2; +}; + +extern s32 sub_800E308(struct UnkStruct_sub_800E308_1 *, struct UnkStruct_sub_800E308_2 *); + +#ifdef NONMATCHING // https://decomp.me/scratch/fTUsI +s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) +{ + struct UnkStruct_sub_800E308_1 unkSp1; + struct UnkStruct_sub_800E308_2 unkSp2; + EntityInfo *entInfo = GetEntInfo(entity); + + if (!gDungeon->unk181e8.blinded && (GetBodySize(entInfo->apparentID) < 4 || r4 == 1)) { + unkStruct_80BDBC4 *unkStruct = sub_800ECB8(sub_80412E0(move->id, GetApparentWeather(entity), 1)); + s32 unk6 = unkStruct->unk6; + // This part with unkPos doesn't match + Position32 unkPos = {pos->x * 0x1800, pos->y * 0x1800}; + + unkPos.x += 0x1000; + unkPos.y += 0xC00; + + unkSp2.u0 = unkPos.x / 256; + unkSp2.u2 = unkPos.y / 256; + + if (unk6 != 0) { + s32 someRetVal; + + sub_800EF10(sub_80412E0(move->id, GetApparentWeather(entity), 1)); + sub_803E46C(0x5E); + someRetVal = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), 1)); + if (someRetVal != -1) { + sub_800569C(&unkSp1.unk8, &entity->spriteInfo, someRetVal); + } + else { + unkSp1.unk8 = (Position) {0}; + } + unkSp1.unk0 = sub_80412E0(move->id, GetApparentWeather(entity), 1); + unkSp1.unk2 = entInfo->apparentID; + unkSp1.unk4.x = entity->pixelPos.x / 256; + unkSp1.unk4.y = entity->pixelPos.y / 256; + unkSp1.unkC = entInfo->action.direction; + unkSp1.unk10 = 0; + + return sub_800E308(&unkSp1, &unkSp2); + } + } + + return -1; +} +#else +NAKED s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) +{ + asm_unified("push {r4-r7,lr}\n" + " mov r7, r9\n" + " mov r6, r8\n" + " push {r6,r7}\n" + " sub sp, 0x18\n" + " adds r6, r0, 0\n" + " adds r5, r1, 0\n" + " adds r7, r2, 0\n" + " adds r4, r3, 0\n" + " ldr r0, [r6, 0x70]\n" + " mov r8, r0\n" + " ldr r0, _08056680\n" + " ldr r0, [r0]\n" + " ldr r1, _08056684\n" + " adds r0, r1\n" + " ldrb r0, [r0]\n" + " mov r9, r0\n" + " cmp r0, 0\n" + " beq _0805658C\n" + " b _080566E4\n" + "_0805658C:\n" + " mov r2, r8\n" + " movs r1, 0x4\n" + " ldrsh r0, [r2, r1]\n" + " bl GetBodySize\n" + " lsls r0, 24\n" + " lsrs r0, 24\n" + " cmp r0, 0x3\n" + " bls _080565A4\n" + " cmp r4, 0x1\n" + " bne _080565A4\n" + " b _080566E4\n" + "_080565A4:\n" + " ldrh r4, [r7, 0x2]\n" + " adds r0, r6, 0\n" + " bl GetApparentWeather\n" + " adds r1, r0, 0\n" + " lsls r1, 24\n" + " lsrs r1, 24\n" + " adds r0, r4, 0\n" + " movs r2, 0x1\n" + " bl sub_80412E0\n" + " lsls r0, 16\n" + " lsrs r0, 16\n" + " bl sub_800ECB8\n" + " movs r2, 0x6\n" + " ldrsh r4, [r0, r2]\n" + " movs r1, 0\n" + " ldrsh r0, [r5, r1]\n" + " lsls r1, r0, 1\n" + " adds r1, r0\n" + " lsls r1, 11\n" + " movs r0, 0x2\n" + " ldrsh r2, [r5, r0]\n" + " lsls r0, r2, 1\n" + " adds r0, r2\n" + " lsls r0, 11\n" + " movs r2, 0x80\n" + " lsls r2, 5\n" + " adds r3, r0, r2\n" + " movs r2, 0xC0\n" + " lsls r2, 4\n" + " adds r0, r1, r2\n" + " cmp r0, 0\n" + " bge _080565EC\n" + " adds r0, 0xFF\n" + "_080565EC:\n" + " lsls r0, 8\n" + " lsrs r0, 16\n" + " ldr r1, _08056688\n" + " ldr r2, [sp, 0x14]\n" + " ands r2, r1\n" + " orrs r2, r0\n" + " str r2, [sp, 0x14]\n" + " adds r0, r3, 0\n" + " cmp r0, 0\n" + " bge _08056602\n" + " adds r0, 0xFF\n" + "_08056602:\n" + " lsls r0, 8\n" + " lsrs r0, 16\n" + " lsls r0, 16\n" + " ldr r1, _0805668C\n" + " ands r2, r1\n" + " orrs r2, r0\n" + " str r2, [sp, 0x14]\n" + " cmp r4, 0\n" + " beq _080566E4\n" + " ldrh r4, [r7, 0x2]\n" + " adds r0, r6, 0\n" + " bl GetApparentWeather\n" + " adds r1, r0, 0\n" + " lsls r1, 24\n" + " lsrs r1, 24\n" + " adds r0, r4, 0\n" + " movs r2, 0x1\n" + " bl sub_80412E0\n" + " lsls r0, 16\n" + " lsrs r0, 16\n" + " bl sub_800EF10\n" + " bl sub_800EF64\n" + " movs r0, 0x5E\n" + " bl sub_803E46C\n" + " mov r0, r8\n" + " movs r1, 0x4\n" + " ldrsh r5, [r0, r1]\n" + " ldrh r4, [r7, 0x2]\n" + " adds r0, r6, 0\n" + " bl GetApparentWeather\n" + " adds r1, r0, 0\n" + " lsls r1, 24\n" + " lsrs r1, 24\n" + " adds r0, r4, 0\n" + " movs r2, 0x1\n" + " bl sub_80412E0\n" + " adds r1, r0, 0\n" + " lsls r1, 16\n" + " lsrs r1, 16\n" + " adds r0, r5, 0\n" + " bl sub_800E710\n" + " adds r2, r0, 0\n" + " movs r0, 0x1\n" + " negs r0, r0\n" + " cmp r2, r0\n" + " beq _08056690\n" + " add r0, sp, 0x8\n" + " adds r1, r6, 0\n" + " adds r1, 0x28\n" + " lsls r2, 24\n" + " lsrs r2, 24\n" + " bl sub_800569C\n" + " b _08056694\n" + " .align 2, 0\n" + "_08056680: .4byte gDungeon\n" + "_08056684: .4byte 0x0001820a\n" + "_08056688: .4byte 0xffff0000\n" + "_0805668C: .4byte 0x0000ffff\n" + "_08056690:\n" + " mov r2, r9\n" + " str r2, [sp, 0x8]\n" + "_08056694:\n" + " ldrh r4, [r7, 0x2]\n" + " adds r0, r6, 0\n" + " bl GetApparentWeather\n" + " adds r1, r0, 0\n" + " lsls r1, 24\n" + " lsrs r1, 24\n" + " adds r0, r4, 0\n" + " movs r2, 0x1\n" + " bl sub_80412E0\n" + " mov r1, sp\n" + " strh r0, [r1]\n" + " mov r2, r8\n" + " ldrh r0, [r2, 0x4]\n" + " strh r0, [r1, 0x2]\n" + " ldr r0, [r6, 0xC]\n" + " cmp r0, 0\n" + " bge _080566BC\n" + " adds r0, 0xFF\n" + "_080566BC:\n" + " asrs r0, 8\n" + " strh r0, [r1, 0x4]\n" + " mov r1, sp\n" + " ldr r0, [r6, 0x10]\n" + " cmp r0, 0\n" + " bge _080566CA\n" + " adds r0, 0xFF\n" + "_080566CA:\n" + " asrs r0, 8\n" + " strh r0, [r1, 0x6]\n" + " mov r0, r8\n" + " adds r0, 0x46\n" + " ldrb r0, [r0]\n" + " str r0, [sp, 0xC]\n" + " movs r0, 0\n" + " str r0, [sp, 0x10]\n" + " add r1, sp, 0x14\n" + " mov r0, sp\n" + " bl sub_800E308\n" + " b _080566E8\n" + "_080566E4:\n" + " movs r0, 0x1\n" + " negs r0, r0\n" + "_080566E8:\n" + " add sp, 0x18\n" + " pop {r3,r4}\n" + " mov r8, r3\n" + " mov r9, r4\n" + " pop {r4-r7}\n" + " pop {r1}\n" + " bx r1"); +} +#endif // NONMATCHING + +// This would signify a new file starts here, but it makes little sense tbh. +UNUSED static const char sPksDirMeme[] = "pksdir0"; + +static const s32 gUnknown_81069D4[NUM_DIRECTIONS] = +{ + [DIRECTION_SOUTH] = 1, + [DIRECTION_SOUTHEAST] = 1, + [DIRECTION_EAST] = 1, + [DIRECTION_NORTHEAST] = 0, + [DIRECTION_NORTH] = 0, + [DIRECTION_NORTHWEST] = 0, + [DIRECTION_WEST] = 1, + [DIRECTION_SOUTHWEST] = 1 +}; + +// This function looks important, but what does it do? +void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 isLinkedMove) +{ + Position var_68; + Position var_64; + Entity *targetsArray[2]; // Only 2 hmm + s32 var_4C, var_48; + s32 i, j; + s32 targetArrId; + s32 var_3C; + s32 var_38; + s32 var_34; + s32 var_30; + s32 var_2C; + s32 var_28, var_24; + s32 someCount; + EntityInfo *attackerInfo; + s32 unkRetVal; + s32 divResult; + s32 r9; + + targetArrId = 0; + someCount = 0; + attackerInfo = GetEntInfo(attacker); + unkRetVal = sub_800ED20(move->id); + var_30 = 2; + if (unkRetVal != 1) { + var_30 = 6; + if (unkRetVal == 2) { + var_30 = 3; + } + } + + var_68.x = attacker->pos.x; + var_68.y = attacker->pos.y; + var_4C = gAdjacentTileOffsets[attackerInfo->action.direction].x; + var_48 = gAdjacentTileOffsets[attackerInfo->action.direction].y; + for (i = 0; i < a2; i++) + { + Tile *tile; + + if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) + break; + + var_68.x += var_4C; + var_68.y += var_48; + someCount++; + tile = GetTile(var_68.x, var_68.y); + if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + break; + if (tile->monster != NULL && GetEntityType(tile->monster) == ENTITY_MONSTER) + break; + } + + if (sub_805755C(attacker, move->id) && !MoveMatchesChargingStatus(attacker, move)) { + var_34 = -1; + } + else { + var_34 = sub_8056564(attacker, &var_68, move, a2); + } + + var_68.x = attacker->pos.x; + var_68.y = attacker->pos.y; + var_4C = gAdjacentTileOffsets[attackerInfo->action.direction].x; + var_48 = gAdjacentTileOffsets[attackerInfo->action.direction].y; + divResult = someCount * (24 / var_30); + if (a2 > 1) { + var_3C = divResult + 8; + if (var_3C >= 64) { + var_3C = 64; + } + } + else { + var_3C = 32; + } + + r9 = 0; + var_2C = 0x80000 / divResult; + var_38 = gUnknown_81069D4[attackerInfo->action.direction]; + gDungeon->unk1BDD4.unk1C05E = 1; + + for (i = 0; i < a2; i++) + { + Position var_68Before; + Tile *tile; + + if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) + break; + + var_68Before = var_68; + var_68.x += var_4C; + var_68.y += var_48; + if (sub_803F428(&var_68) && !gDungeon->unk181e8.blinded) { + Position32 pos32; + pos32.x = (var_68Before.x * 0x1800) + 0xC00; + pos32.y = (var_68Before.y * 0x1800) + 0x1000; + var_28 = var_30 * (var_4C << 8); + var_24 = var_30 * (var_48 << 8); + for (j = 0; j < 24 / var_30; j++) { + if (var_34 >= 0) { + s32 r3; + s32 r2; + + if (a3 != 0) { + r3 = sin_abs_4096(r9 / 256) * var_3C; + } + else { + r3 = 0; + } + var_64.x = pos32.x / 256; + var_64.y = (pos32.y - r3) / 256; + r2 = pos32.y / 256; + r2 -= gDungeon->unk181e8.cameraPixelPos.y; + r2 /= 2; + sub_800E3AC(var_34, &var_64, r2 + var_38); + } + sub_803E46C(0x30); + pos32.x += var_28; + pos32.y += var_24; + r9 += var_2C; + } + } + else { + r9 += (24 / var_30) * var_2C; + } + + tile = GetTile(var_68.x, var_68.y); + if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + break; + if (tile->monster != NULL && GetEntityType(tile->monster) == ENTITY_MONSTER && !sub_80571F0(tile->monster, move)) { + if (targetArrId <= 0) { + bool8 canHitAnyone = FALSE; + s32 targetFlags; + EntityInfo *attackerInfo = GetEntInfo(attacker); + if (attackerInfo->volatileStatus.volatileStatus == STATUS_CONFUSED + || attackerInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER + || attackerInfo->volatileStatus.volatileStatus == STATUS_COWERING) + { + canHitAnyone = TRUE; + } + targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); + targetArrId = SetNewTarget(targetArrId, targetsArray, targetFlags, attacker, tile->monster, move, canHitAnyone); + } + break; + } + } + + if (var_34 >= 0) { + sub_800DC14(var_34); + } + sub_804178C(1); + gDungeon->unk1BDD4.unk1C05E = 0; + + if (targetArrId > 0) { + targetsArray[targetArrId] = NULL; + UseMoveAgainstTargets(targetsArray, attacker, move, itemId, isLinkedMove); + } + else if (a2 == 1 && sub_803F428(&var_68)) { + sub_803E708(1, 0x4A); + sub_8041168(attacker, NULL, move, &var_68); + } +} + +static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accuracyType, bool8 selfAlwaysHits) +{ + s32 statStageAccuracy, statStageEvasion; + s32 statStageMul; + s32 accuracy = GetMoveAccuracyOrAIChance(move, accuracyType); + s32 rand = DungeonRandInt(100); + EntityInfo *attackerInfo = GetEntInfo(attacker); + EntityInfo *targetInfo = GetEntInfo(target); + + if (selfAlwaysHits && attacker == target) + return TRUE; + if (move->id == MOVE_REGULAR_ATTACK && IQSkillIsEnabled(attacker, IQ_SURE_HIT_ATTACKER)) + return TRUE; + if (attackerInfo->moveStatus.moveStatus == STATUS_SURE_SHOT) + return TRUE; + if (attackerInfo->moveStatus.moveStatus == STATUS_WHIFFER) + return FALSE; + if (accuracy > 100) + return TRUE; + + if (HasHeldItem(target, ITEM_DETECT_BAND)) { + accuracy -= gUnknown_80F519C; + } + if (IQSkillIsEnabled(target, IQ_QUICK_DODGER)) { + accuracy -= gUnknown_80F51A0; + } + + statStageAccuracy = attackerInfo->hitChanceStages[0]; + if (HasAbility(attacker, ABILITY_COMPOUNDEYES)) { + statStageAccuracy += 2; + } + if (move->id == MOVE_THUNDER) { + s32 weather = GetApparentWeather(attacker); + if (weather == WEATHER_RAIN) { + return TRUE; + } + else if (weather == WEATHER_SUNNY) { + statStageAccuracy -= 2; + } + } + + if (statStageAccuracy < 0) statStageAccuracy = 0; + if (statStageAccuracy > 20) statStageAccuracy = 20; + + statStageMul = gUnknown_80F50F4[0][statStageAccuracy]; + if (statStageMul < 0) statStageMul = 0; + if (statStageMul > (256 * 100)) statStageMul = (256 * 100); + + accuracy *= statStageMul; + accuracy /= 256; + + statStageEvasion = targetInfo->hitChanceStages[1]; + if (targetInfo->exposed) { + statStageEvasion = 10; + } + if (GetApparentWeather(target) == WEATHER_SANDSTORM && HasAbility(target, ABILITY_SAND_VEIL)) { + statStageEvasion += 2; + } + if (HasAbility(attacker, ABILITY_HUSTLE)) { + bool32 specialMove = (IsTypePhysical(GetMoveType(move)) == FALSE); + if (!specialMove) { + statStageEvasion += 2; + } + } + + if (statStageEvasion < 0) statStageEvasion = 0; + if (statStageEvasion > 20) statStageEvasion = 20; + + statStageMul = gUnknown_80F50F4[1][statStageEvasion]; + if (statStageMul < 0) statStageMul = 0; + if (statStageMul > (256 * 100)) statStageMul = (256 * 100); + + accuracy *= statStageMul; + accuracy /= 256; + if (rand < accuracy) + return TRUE; + else + return FALSE; +} + +static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *move) +{ + s32 targetFlags; + s32 targetFlagsAnd; + s32 arrId = 0; + bool8 canHitPartner = (GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_CONFUSED + || GetEntInfo(attacker)->eyesightStatus.eyesightStatus == STATUS_BLINKER + || GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_COWERING); + bool8 canHitSelf = (GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_CONFUSED || GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_COWERING); + + if (IQSkillIsEnabled(attacker, IQ_NONTRAITOR)) { + canHitSelf = FALSE; + canHitPartner = FALSE; + } + targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); + if ((targetFlags & 0xF) == 4) { + bool32 usable = MoveMatchesChargingStatus(attacker, move); + if (move->id == MOVE_SOLARBEAM && GetApparentWeather(attacker) == WEATHER_SUNNY) { + usable = TRUE; + } + if (usable) + targetFlags = 0; + else + targetFlags = 0x73; + } + + targetFlagsAnd = targetFlags & 0xF0; + if (targetFlagsAnd == 0) { + Entity *targetEntity = sub_80696A8(attacker); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + else if (targetFlagsAnd == 0x10 || targetFlagsAnd == 0x20) { + s32 i; + s32 direction, to; + EntityInfo *entInfo = GetEntInfo(attacker); + if (targetFlagsAnd == 0x20) { + direction = entInfo->action.direction; + to = 8; + } + else { + direction = entInfo->action.direction - 1; + to = 3; + } + for (i = 0; i < to; i++, direction++) { + Entity *targetEntity; + Position unkPositon; + + direction &= DIRECTION_MASK; + unkPositon.x = attacker->pos.x + gAdjacentTileOffsets[direction].x ; + unkPositon.y = attacker->pos.y + gAdjacentTileOffsets[direction].y; + targetEntity = sub_804AD0C(&unkPositon); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + } + else if (targetFlagsAnd == 0x30) { + s32 i; + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *dungeonMon = gDungeon->allPokemon[i]; + if (EntityExists(dungeonMon) && sub_8045A70(attacker, dungeonMon)) { + if (dungeonMon == attacker) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); + } + else { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); + } + } + } + } + else if (targetFlagsAnd == 0x40) { + bool32 r4 = FALSE; + Entity *targetEntity = sub_80696FC(attacker); + if (targetEntity != NULL) { + s32 arrIdBefore = arrId; + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + r4 = (arrId != arrIdBefore); + } + if (!r4) { + targetEntity = sub_806977C(attacker); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + } + else if (targetFlagsAnd == 0x50) { + // Nothing happens here + } + else if (targetFlagsAnd == 0x80) { + Entity *targetEntity = sub_80696FC(attacker); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + else if (targetFlagsAnd == 0x60) { + s32 i; + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *dungeonMon = gDungeon->allPokemon[i]; + if (EntityExists(dungeonMon)) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); + } + } + } + else if (targetFlagsAnd == 0x70) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitPartner); + } + + targetsArray[arrId] = NULL; +} + +static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_, Entity *attacker, Entity *target, Move *move, bool32 canHitAnyone_) +{ + bool32 canHitTarget; + EntityInfo *targetInfo; + + // It's happening again, all over the codebase there are problems with s16 arguments, where the lsl/asr asm can't be matched. What is going on with that? + s32 targetFlags = (s16)targetFlags_; + bool8 canHitAnyone = canHitAnyone_; + canHitTarget = FALSE; + targetInfo = GetEntInfo(target); + + if (move->id == MOVE_BATON_PASS && attacker == target) + return targetArrId; + if (targetInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER) + return targetArrId; + if (targetInfo->clientType == CLIENT_TYPE_DONT_MOVE || targetInfo->clientType == CLIENT_TYPE_CLIENT) + return targetArrId; + + if (canHitAnyone) { + canHitTarget = TRUE; + } + else { + s32 targetFlagsAnd = targetFlags & 0xF; + if (targetFlagsAnd == 0 || targetFlagsAnd == 4) { + if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 1) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 1) { + if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 0) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 2) { + canHitTarget = TRUE; + } + else if (targetFlagsAnd == 5) { + if (attacker != target) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 6) { + if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 0 && attacker != target) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 3) { + canHitTarget = TRUE; + } + } + + if (sub_80571F0(target, move)) { + canHitTarget = FALSE; + } + + if (canHitTarget && targetArrId < MAX_MOVE_TARGETS) { + targetsArray[targetArrId] = target; + if (!GetEntInfo(target)->isNotTeamMember && gUnknown_203B438 == NULL) { + gUnknown_203B438 = target; + } + targetArrId++; + } + + return targetArrId; +} + +struct MultiTurnChargeMove +{ + u16 moveID; + u8 chargingStatus; +}; + +const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { + {MOVE_SOLARBEAM, STATUS_SOLARBEAM}, + {MOVE_SKY_ATTACK, STATUS_SKY_ATTACK}, + {MOVE_RAZOR_WIND, STATUS_RAZOR_WIND}, + {MOVE_FOCUS_PUNCH, STATUS_FOCUS_PUNCH}, + {MOVE_SKULL_BASH, STATUS_SKULL_BASH}, + {MOVE_FLY, STATUS_FLYING}, + {MOVE_BOUNCE, STATUS_BOUNCING}, + {MOVE_DIVE, STATUS_DIVING}, + {MOVE_DIG, STATUS_DIGGING}, + {MOVE_NOTHING, STATUS_NONE} +}; + +const u32 gMultiTurnChargingStatuses[10] = { + STATUS_SOLARBEAM, + STATUS_SKY_ATTACK, + STATUS_RAZOR_WIND, + STATUS_FOCUS_PUNCH, + STATUS_SKULL_BASH, + STATUS_FLYING, + STATUS_BOUNCING, + STATUS_DIVING, + STATUS_DIGGING, + STATUS_NONE +}; + +s32 sub_8057070(Move *move) +{ + s32 numberOfChainedHits = GetMoveNumberOfChainedHits(move); + if (numberOfChainedHits == 0) + return DungeonRandRange(2, 6); + else + return numberOfChainedHits; +} + +bool8 MoveCausesPaused(Move *move) +{ + if(move->id == MOVE_FRENZY_PLANT) return TRUE; + if(move->id == MOVE_HYDRO_CANNON) return TRUE; + if(move->id == MOVE_HYPER_BEAM) return TRUE; + if(move->id == MOVE_BLAST_BURN) return TRUE; + + return FALSE; +} + +bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move) +{ + if (!EntityExists(pokemon)) + { + return FALSE; + } + else + { + EntityInfo *pokemonInfo = pokemon->info; + s32 i; + for (i = 0; i < 100; i++) + { + if (gMultiTurnChargeMoves[i].moveID == MOVE_NOTHING) + { + return FALSE; + } + if (move->id == gMultiTurnChargeMoves[i].moveID && + pokemonInfo->charging.chargingStatus == gMultiTurnChargeMoves[i].chargingStatus) + { + return TRUE; + } + } + return FALSE; + } +} + +bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) +{ + if (!EntityExists(pokemon)) + { + return FALSE; + } + else + { + EntityInfo *pokemonInfo = pokemon->info; + int i = 0; + u8 *chargingStatusPointer = &pokemonInfo->charging.chargingStatus; + u8 *chargingStatusPointer2; + u8 chargeStatus = STATUS_CHARGING; + for (; i < 100; i++) + { + u8 currentStatus = gMultiTurnChargingStatuses[i]; + u8 chargingStatus; + if (currentStatus == STATUS_NONE) + { + return FALSE; + } + chargingStatus = *chargingStatusPointer; + chargingStatusPointer2 = &pokemonInfo->charging.chargingStatus; + if (chargingStatus == currentStatus) + { + return TRUE; + } + } + // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnChargingStatuses array. + if (checkCharge && *chargingStatusPointer2 == chargeStatus) + { + return TRUE; + } + return FALSE; + } +} + +u32 sub_8057144(Entity * pokemon) +{ + Move *moveStack[80]; + int i, j, nMoves; + + nMoves = 0; + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) + { + Entity *dungeonMon = gDungeon->allPokemon[i]; + if (EntityExists(dungeonMon)) { + Move *moves = dungeonMon->info->moves.moves; + for (j = 0; j < MAX_MON_MOVES; j++) + { + if (moves[j].moveFlags & MOVE_FLAG_EXISTS + && !sub_805755C(pokemon, moves[j].id) + && moves[j].id != MOVE_SKETCH + && nMoves < 80) { + moveStack[nMoves++] = &moves[j]; + } + } + } + } + + if (nMoves == 0) { + return MOVE_REGULAR_ATTACK; + } + else { + return moveStack[DungeonRandInt(nMoves)]->id; + } +} + +bool8 sub_80571F0(Entity * pokemon, Move *move) +{ + u16 moveID; + s32 tileset; + EntityInfo *entityInfo; + + entityInfo = pokemon->info; + + if (entityInfo->unkFF == 1) { + moveID = move->id; + if ((moveID == MOVE_SKY_UPPERCUT) || (moveID == MOVE_TWISTER) || (moveID == MOVE_GUST) || (moveID == MOVE_THUNDER)) + return FALSE; + else + return TRUE; + } + else if (entityInfo->unkFF == 2) { + if (entityInfo->charging.chargingStatus == STATUS_DIVING) { + if (move->id == MOVE_WHIRLPOOL || move->id == MOVE_SURF) return FALSE; + } + else if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { + moveID = move->id; + if (moveID == MOVE_EARTHQUAKE || moveID == MOVE_MAGNITUDE) return FALSE; + if (moveID == MOVE_NATURE_POWER) { + tileset = gDungeon->tileset; + if (tileset < 0) { + tileset = 0; + } + if (0x4a < tileset) { + tileset = 0x4a; + } + if (gNaturePowerCalledMoves[tileset].moveID == MOVE_EARTHQUAKE) return FALSE; + } + } + return TRUE; + } + return FALSE; +} + +bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) +{ + bool8 uVar2; + if (sub_8044B28()) + return FALSE; + if (!EntityExists(pokemon) || !EntityExists(target)) + return FALSE; + if (target->info->unk158 == 0 || target->info->HP == 0) + return FALSE; + + if (chance != 0) { + if (HasAbility(pokemon, ABILITY_SERENE_GRACE)) { + uVar2 = DungeonRandOutcome_2(chance * 2); + } + else + { + uVar2 = DungeonRandOutcome_2(chance); + } + } + else + { + uVar2 = TRUE; + } + + if (uVar2 && (pokemon != target) && HasAbility(target, ABILITY_SHIELD_DUST)) + { + sub_80429C8(target); + return FALSE; + } + + return uVar2; +} + +bool8 sub_8057308(Entity *pokemon, s32 chance) +{ + if(!EntityExists(pokemon)) + return FALSE; + if(chance == 0) + return TRUE; + if(HasAbility(pokemon, ABILITY_SERENE_GRACE)) + return DungeonRandOutcome_2(chance * 2); + else + return DungeonRandOutcome_2(chance); +} + +bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker) +{ + s32 i; + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + Move *move = &pokemonInfo->moves.moves[moveIndex]; + if (!MoveFlagExists(move)) + return FALSE; + if (MoveFlagLinkChain(move) || MoveFlagDisabled(move) || MoveFlagSealed(move)) + return FALSE; + + for (i = 0; i < MAX_MON_MOVES; i++) { + if (CanMonsterUseMove(pokemon, move, hasPPChecker)) + return TRUE; + move++; + if (move >= &pokemonInfo->moves.moves[MAX_MON_MOVES]) + break; + if (!(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) + break; + } + + return FALSE; +} + +bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker) +{ + EntityInfo *pokemonInfo = pokemon->info; + if (move->id == MOVE_REGULAR_ATTACK) + { + return TRUE; + } + if (move->moveFlags & MOVE_FLAG_DISABLED || move->moveFlags2 & MOVE_FLAG_SEALED) + { + return FALSE; + } + if (hasPPChecker) + { + if (move->PP == 0) + { + return FALSE; + } + if (pokemonInfo->volatileStatus.volatileStatus == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) + { + return FALSE; + } + if (pokemonInfo->volatileStatus.volatileStatus == STATUS_ENCORE) + { + if (move->id == MOVE_STRUGGLE) + { + if (!(pokemonInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED)) + { + return FALSE; + } + } + else if (!(move->moveFlags & MOVE_FLAG_LAST_USED)) + { + return FALSE; + } + } + } + return TRUE; +} + +bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3) +{ + EntityInfo *entityInfo; + + entityInfo = pokemon->info; + if (move->id != MOVE_REGULAR_ATTACK) { + if (((move->moveFlags & MOVE_FLAG_DISABLED)) || ((move->moveFlags2 & MOVE_FLAG_EXISTS))) { + return FALSE; + } + if (param_3 != 0) { + if ((entityInfo->volatileStatus.volatileStatus == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; + if (entityInfo->volatileStatus.volatileStatus == STATUS_ENCORE) { + if (move->id == MOVE_STRUGGLE) { + if((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; + } + else { + if((move->moveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; + } + } + } + } + return TRUE; +} + +// Attacker always goes last +static void SortTargets(Entity **targetsArray, Entity *attacker) +{ + Entity *localArray[MAX_MOVE_TARGETS + 1]; + s32 i; + s32 count = 0; + + for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { + if (targetsArray[i] == NULL) + break; + if (targetsArray[i] == attacker) + continue; + if (count >= MAX_MOVE_TARGETS) + break; + localArray[count++] = targetsArray[i]; + } + + for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { + if (targetsArray[i] == NULL) + break; + if (targetsArray[i] != attacker) + continue; + if (count >= MAX_MOVE_TARGETS) + break; + localArray[count++] = targetsArray[i]; + } + + for (; count < MAX_MOVE_TARGETS + 1; count++) { + localArray[count] = NULL; + } + + for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { + targetsArray[i] = localArray[i]; + } +} + +// TODO: This file could(should?) be merged with move_actions.c, status_actions.c and move_checks.c into one. diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 721506820..a14667eb2 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -1,6 +1,6 @@ #include "global.h" #include "dungeon_pokemon_attributes.h" - +#include "dungeon_message.h" #include "code_8045A00.h" #include "constants/ability.h" #include "constants/dungeon.h" @@ -20,18 +20,17 @@ const s16 gItemMasterMinWildLevel[] = {16}; extern u8 gAvailablePokemonNames[]; -extern u32 gUnknown_80FC31C; -extern u32 gUnknown_80FCEFC; -extern u32 gUnknown_80FC2FC; +extern const u8 *gUnknown_80FC31C; +extern const u8 * gUnknown_80FCEFC; +extern const u8 * gUnknown_80FC2FC; extern bool8 sub_805744C(Entity *, Move *, u32); -extern void sub_80522F4(Entity *r1, Entity *r2, u32); bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage) { if (target->info->protection.protectionStatus == STATUS_SAFEGUARD) { if (displayMessage) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,gUnknown_80FC2FC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); } return TRUE; } @@ -43,7 +42,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) if (target->info->protection.protectionStatus == STATUS_MIST) { if (displayMessage) { SetMessageArgument(gAvailablePokemonNames, target, 0); - sub_80522F4(pokemon, target, gUnknown_80FC31C); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); } return TRUE; } @@ -51,7 +50,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) if (HasAbility(target, ABILITY_CLEAR_BODY) || HasAbility(target, ABILITY_WHITE_SMOKE)) { if (displayMessage) { SetMessageArgument(gAvailablePokemonNames, target, 0); - sub_80522F4(pokemon, target, gUnknown_80FCEFC); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC); } return TRUE; } diff --git a/src/exclusive_pokemon.c b/src/exclusive_pokemon.c index fb517e8d5..a342b6936 100644 --- a/src/exclusive_pokemon.c +++ b/src/exclusive_pokemon.c @@ -139,70 +139,33 @@ bool8 sub_8098100(u8 param_1) } else { - return (gUnknown_203B498->unk3C[param_1 >> 0x5] & (1 << (index & 0x1f))) ? TRUE : FALSE; + return (gUnknown_203B498->unk3C[param_1 >> 0x5] & (1 << (index & 0x1f))) != 0; } } bool8 sub_8098134(s16 pokeID) { - s32 index; s32 pokeID_s32; s32 pokeID_s32_1; - struct ExclusivePokemonData *ptr; pokeID_s32 = pokeID; pokeID_s32_1 = pokeID_s32; - ptr = gUnknown_203B498; - if (pokeID < 0) { - index = pokeID_s32 + 0x1f; - } - else - { - index = pokeID_s32; - } - return ((ptr->unk4[(index >> 5)] & (1 << (s16)(pokeID_s32_1 - ((index >> 5) * 0x20)))) != 0) ? TRUE : FALSE; + return ((gUnknown_203B498->unk4[pokeID_s32 / 32] & (1 << (s16)(pokeID_s32_1 - ((pokeID_s32 / 32) * 0x20)))) != 0); } -void SetTutorialFlag(s32 param_1) +void SetTutorialFlag(s32 index) { - s32 index; - struct ExclusivePokemonData *ptr; - - ptr = gUnknown_203B498; - if (param_1 < 0) { - index = param_1 + 0x1f; - } - else - { - index = param_1; - } - ptr->unk54[(index >> 5)] |= 1 << (param_1 - ((index >> 5) * 0x20)); + gUnknown_203B498->unk54[index / 32] |= (1 << (index - ((index / 32) * 32))); } -bool32 GetTutorialFlag(s32 param_1) +bool32 GetTutorialFlag(s32 index) { - s32 index; - bool32 flag; - struct ExclusivePokemonData *ptr; - - if (param_1 > 0x1e) { - return FALSE; - } - else { - ptr = gUnknown_203B498; - if (param_1 < 0) { - index = param_1 + 0x1f; + if (index > 0x1e) { + return FALSE; } - else - { - index = param_1; + else { + return (((gUnknown_203B498->unk54[index / 32]) & (1 << (index - ((index / 32) * 32)))) != 0); } - flag = ptr->unk54[(index >> 5)] & 1 << (param_1 - ((index >> 5) * 0x20)); - if (flag != 0) { - flag = TRUE; - } - return flag; - } } bool8 IsExclusivePokemonUnlocked(s16 pokeID) diff --git a/src/felicity_bank.c b/src/felicity_bank.c index 54c84fca6..824780151 100644 --- a/src/felicity_bank.c +++ b/src/felicity_bank.c @@ -67,18 +67,18 @@ bool8 CreateFelicityBank(s32 mode) strcpy(gUnknown_202E1C8 - 80, monName); if (sFelicityBankWork->mode == FEL_MODE_ASLEEP) - sFelicityBankWork->unkA4 = NULL; + sFelicityBankWork->monPortraitPtr = NULL; else - sFelicityBankWork->unkA4 = &sFelicityBankWork->faceFile; + sFelicityBankWork->monPortraitPtr = &sFelicityBankWork->monPortrait; faceFile = GetDialogueSpriteDataPtr(MONSTER_PERSIAN); - sFelicityBankWork->faceFile = faceFile; - sFelicityBankWork->faceData = faceFile->data; - sFelicityBankWork->unkA0 = 0; - sFelicityBankWork->unkA1 = 0; - sFelicityBankWork->unkA2 = 0; - sFelicityBankWork->unk9C = 2; - sFelicityBankWork->unk9E = 8; + sFelicityBankWork->monPortrait.faceFile = faceFile; + sFelicityBankWork->monPortrait.faceData = faceFile->data; + sFelicityBankWork->monPortrait.spriteId = 0; + sFelicityBankWork->monPortrait.flip = FALSE; + sFelicityBankWork->monPortrait.unkE = 0; + sFelicityBankWork->monPortrait.pos.x = 2; + sFelicityBankWork->monPortrait.pos.y = 8; UpdateFelicityBankState(FELICITY_BANK_INIT); return TRUE; } @@ -118,7 +118,7 @@ u32 FelicityBankCallback(void) void DestroyFelicityBank(void) { if (sFelicityBankWork != NULL) { - CloseFile(sFelicityBankWork->faceFile); + CloseFile(sFelicityBankWork->monPortrait.faceFile); MemoryFree(sFelicityBankWork); sFelicityBankWork = NULL; } @@ -170,49 +170,49 @@ static void UpdateFelicityBankDialogue(void) switch (sFelicityBankWork->currState) { case FELICITY_BANK_INIT: sFelicityBankWork->fallbackState = 1; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WELCOME], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WELCOME], 0, sFelicityBankWork->monPortraitPtr, 0x10D); break; case 1: CreateFelicityBankShopMenu(); sFelicityBankWork->fallbackState = 2; if (gTeamInventoryRef->teamSavings == 0) - sub_8014248(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_HOW_MAY_I_SERVE__NO_MONEY], 0, sFelicityBankWork->menuAction, - sFelicityBankWork->unk14, sFelicityBankWork->unk54, 4, 0, sFelicityBankWork->unkA4, 0xC); + CreateMenuDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_HOW_MAY_I_SERVE__NO_MONEY], 0, sFelicityBankWork->menuAction, + sFelicityBankWork->unk14, sFelicityBankWork->unk54, 4, 0, sFelicityBankWork->monPortraitPtr, 0xC); else { gFormatData_202DE30 = gTeamInventoryRef->teamSavings; - sub_8014248(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_HOW_MAY_I_SERVE__HAS_MONEY], 0, sFelicityBankWork->menuAction, - sFelicityBankWork->unk14, sFelicityBankWork->unk54, 4, 0, sFelicityBankWork->unkA4, 0xC); + CreateMenuDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_HOW_MAY_I_SERVE__HAS_MONEY], 0, sFelicityBankWork->menuAction, + sFelicityBankWork->unk14, sFelicityBankWork->unk54, 4, 0, sFelicityBankWork->monPortraitPtr, 0xC); } break; case FELICITY_BANK_INFO: sFelicityBankWork->fallbackState = 1; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_HOW_IT_WORKS], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_HOW_IT_WORKS], 0, sFelicityBankWork->monPortraitPtr, 0x10D); break; case 4: sFelicityBankWork->fallbackState = FELICITY_BANK_EXIT; if (gTeamInventoryRef->teamSavings == 0) - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_BYE__NO_MONEY], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_BYE__NO_MONEY], 0, sFelicityBankWork->monPortraitPtr, 0x10D); else { gFormatData_202DE30 = gTeamInventoryRef->teamSavings; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_BYE__HAS_MONEY], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_BYE__HAS_MONEY], 0, sFelicityBankWork->monPortraitPtr, 0x10D); } break; case 5: sFelicityBankWork->fallbackState = 1; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_VERY_WELL], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_VERY_WELL], 0, sFelicityBankWork->monPortraitPtr, 0x10D); break; case FELICITY_BANK_STORE: if (gTeamInventoryRef->teamMoney == 0) { sFelicityBankWork->fallbackState = 1; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__NO_MONEY], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__NO_MONEY], 0, sFelicityBankWork->monPortraitPtr, 0x10D); } else if (gTeamInventoryRef->teamSavings >= MAX_TEAM_SAVINGS) { sFelicityBankWork->fallbackState = 1; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__BANK_FULL], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__BANK_FULL], 0, sFelicityBankWork->monPortraitPtr, 0x10D); } else { sFelicityBankWork->fallbackState = FELICITY_BANK_STORE_HOW_MUCH; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__HOW_MUCH], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__HOW_MUCH], 0, sFelicityBankWork->monPortraitPtr, 0x10D); } break; case FELICITY_BANK_STORE_HOW_MUCH: @@ -233,21 +233,21 @@ static void UpdateFelicityBankDialogue(void) case FELICITY_BANK_STORE_RECEIPT: sFelicityBankWork->fallbackState = 1; gFormatData_202DE30 = sFelicityBankWork->chosenAmount; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__RECEIPT], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_DEPOSIT__RECEIPT], 0, sFelicityBankWork->monPortraitPtr, 0x10D); break; case FELICITY_BANK_TAKE: if (gTeamInventoryRef->teamMoney >= MAX_TEAM_MONEY) { sFelicityBankWork->fallbackState = 1; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__WALLET_FULL], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__WALLET_FULL], 0, sFelicityBankWork->monPortraitPtr, 0x10D); } else if (gTeamInventoryRef->teamSavings == 0) { sFelicityBankWork->fallbackState = 1; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__NO_MONEY], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__NO_MONEY], 0, sFelicityBankWork->monPortraitPtr, 0x10D); } else { sFelicityBankWork->fallbackState = FELICITY_BANK_TAKE_HOW_MUCH; gFormatData_202DE30 = gTeamInventoryRef->teamSavings; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__HOW_MUCH], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__HOW_MUCH], 0, sFelicityBankWork->monPortraitPtr, 0x10D); } break; case FELICITY_BANK_TAKE_HOW_MUCH: @@ -271,7 +271,7 @@ static void UpdateFelicityBankDialogue(void) case FELICITY_BANK_TAKE_DEPOSIT: sFelicityBankWork->fallbackState = 1; gFormatData_202DE30 = sFelicityBankWork->chosenAmount; - xxx_info_box_80141B4(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__RECEIPT], 0, sFelicityBankWork->unkA4, 0x10D); + CreateDialogueBoxAndPortrait(gCommonFelicity[sFelicityBankWork->mode][FEL_DLG_WITHDRAW__RECEIPT], 0, sFelicityBankWork->monPortraitPtr, 0x10D); break; } } @@ -424,7 +424,7 @@ static void CreateFelicityMoneySavingsHeader(u32 param_1) } void DrawTeamMoneyBox(u32 param_1) -{ +{ CallPrepareTextbox_8008C54(param_1); sub_80073B8(param_1); PrintStringOnWindow(6, 0, sMoney, param_1, 0); diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index 01fd02b47..db538e9ea 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -217,11 +217,11 @@ void sub_8027274(void) break; case FRIEND_AREA_ACTION_MENU_SAY_FAREWELL_PROMPT: sub_8027794(); - sub_8014248(sSayFarewellPrompt,0,3,sUnknown_203B2BC->menuItems,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sSayFarewellPrompt,0,3,sUnknown_203B2BC->menuItems,0,4,0,0,0x101); break; case FRIEND_AREA_ACTION_MENU_SAY_FAREWELL_CONFIRM: sub_8027794(); - sub_8014248(sSayFarewellConfirm,0,3,sUnknown_203B2BC->menuItems,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sSayFarewellConfirm,0,3,sUnknown_203B2BC->menuItems,0,4,0,0,0x101); break; case 0x10: GetLinkedSequence(sUnknown_203B2BC->moveIndex,sUnknown_203B2BC->moves,sUnknown_203B2BC->moveIDs); @@ -229,11 +229,11 @@ void sub_8027274(void) break; case 6: sUnknown_203B2BC->fallbackState = FRIEND_AREA_ACTION_MENU_MAIN_2; - xxx_info_box_80141B4(sReturnedToToolbox, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sReturnedToToolbox, 0, 0, 0x101); break; case 7: sUnknown_203B2BC->fallbackState = FRIEND_AREA_ACTION_MENU_MAIN_2; - xxx_info_box_80141B4(sSentToStorage, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sSentToStorage, 0, 0, 0x101); break; } } diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index e880fdd62..824fdd9e8 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -187,7 +187,7 @@ void sub_8025518(void) { case 0: gUnknown_203B2B4->fallbackState = 1; - xxx_info_box_80141B4(sVisitWhoPrompt,0,0,0x301); + CreateDialogueBoxAndPortrait(sVisitWhoPrompt,0,0,0x301); break; case 1: uVar3 = 4; @@ -230,20 +230,20 @@ void sub_8025518(void) break; case FRIEND_LIST_MENU_STATE_ITEM_GIVEN: gUnknown_203B2B4->fallbackState = 2; - xxx_info_box_80141B4(sItemHandedOver,0,0,0x101); + CreateDialogueBoxAndPortrait(sItemHandedOver,0,0,0x101); break; case FRIEND_LIST_MENU_STATE_ITEM_EXCHANGE: gUnknown_203B2B4->fallbackState = 2; - xxx_info_box_80141B4(sItemExchanged,0,0,0x101); + CreateDialogueBoxAndPortrait(sItemExchanged,0,0,0x101); break; case FRIEND_LIST_MENU_STATE_TAKE: gUnknown_203B2B4->fallbackState = 2; - xxx_info_box_80141B4(sReturnedToToolbox,0,0,0x101); + CreateDialogueBoxAndPortrait(sReturnedToToolbox,0,0,0x101); break; case FRIEND_LIST_MENU_STATE_STANDBY: gUnknown_203B2B4->fallbackState = 1; PlaySound(0xcf); - xxx_info_box_80141B4(sLeftOnStandby,0,0,0x101); + CreateDialogueBoxAndPortrait(sLeftOnStandby,0,0,0x101); break; case FRIEND_LIST_MENU_STATE_MOVES: unk_CopyMoves4To8(gUnknown_203B2B4->moves,gUnknown_203B2B4->pokeStruct->moves); diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 29a88787d..2f629ad85 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -719,107 +719,107 @@ void sub_8032828(void) case 0x0: if (CountMailType(WONDER_MAIL_TYPE_SOS) == 0 && CountMailType(WONDER_MAIL_TYPE_THANK_YOU) == 0) { if (gUnknown_203B33C->unk52C != 0) - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2108, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2108, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20B8, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20B8, NULL, 4, 0, NULL, 0x101); } else { if (gUnknown_203B33C->unk52C != 0) - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20E0, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20E0, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2068, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2068, NULL, 4, 0, NULL, 0x101); } break; case 0x1: if (CountMailType(WONDER_MAIL_TYPE_SOS) == 0 && CountMailType(WONDER_MAIL_TYPE_THANK_YOU) == 0) { if (gUnknown_203B33C->unk52C != 0) - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2108, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2108, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20B8, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20B8, NULL, 4, 0, NULL, 0x101); } else { if (gUnknown_203B33C->unk52C != 0) - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20E0, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E20E0, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2068, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 0, gUnknown_80E2068, NULL, 4, 0, NULL, 0x101); } break; case 0x3: if (CountMailType(WONDER_MAIL_TYPE_AOK) != 0) - sub_8014248(&gUnknown_80E25F4[0], 0, 3, gUnknown_80E2130, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 3, gUnknown_80E2130, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E25F4[0], 0, 3, gUnknown_80E2190, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 3, gUnknown_80E2190, NULL, 4, 0, NULL, 0x101); break; case 0x4: if (CountMailType(WONDER_MAIL_TYPE_SOS) == 0) { if (CountMailType(WONDER_MAIL_TYPE_THANK_YOU) == 0) - sub_8014248(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E2268, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E2268, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E2218, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E2218, NULL, 4, 0, NULL, 0x101); } else { if (CountMailType(WONDER_MAIL_TYPE_THANK_YOU) == 0) - sub_8014248(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E2240, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E2240, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E21B8, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E25F4[0], 0, 17, gUnknown_80E21B8, NULL, 4, 0, NULL, 0x101); } break; case 0xE: switch(gUnknown_203B33C->unk528) { case 0x11: - sub_8014248(&gUnknown_80E2610[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2610[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); break; case 0x3: - sub_8014248(&gUnknown_80E2640[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2640[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); break; case 0x4: - sub_8014248(&gUnknown_80E2680[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2680[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); break; case 0x12: - sub_8014248(&gUnknown_80E26B0[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E26B0[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); break; case 0x13: - sub_8014248(&gUnknown_80E26F0[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E26F0[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); break; case 0x14: - sub_8014248(&gUnknown_80E2728[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2728[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); break; } break; case 0x3C: - xxx_info_box_80141B4(&gUnknown_80E276C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E276C[0], 0, 0, 0x101); break; case 0x3D: - sub_8014248(&gUnknown_80E27A4[0], 0, 6, gUnknown_80E2458, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E27A4[0], 0, 6, gUnknown_80E2458, NULL, 4, 0, NULL, 0x101); break; case 0x43: - xxx_info_box_80141B4(&gUnknown_80E2814[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2814[0], 0, 0, 0x101); break; case 0x3E: - xxx_info_box_80141B4(&gUnknown_80E2840[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2840[0], 0, 0, 0x101); break; case 0x3F: - xxx_info_box_80141B4(&gUnknown_80E2874[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2874[0], 0, 0, 0x101); break; case 0x40: switch ((u32)gUnknown_203B33C->unk524) { case 0xB: case 0xD: case 0xE: - xxx_info_box_80141B4(&gUnknown_80E2898[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2898[0], 0, 0, 0x101); break; case 0xC: break; } break; case 0x42: - xxx_info_box_80141B4(&gUnknown_80E28D8[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E28D8[0], 0, 0, 0x101); break; case 0x30: - xxx_info_box_80141B4(&gUnknown_80E2904[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2904[0], 0, 0, 0x101); break; case 0x31: - xxx_info_box_80141B4(&gUnknown_80E296C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E296C[0], 0, 0, 0x101); break; case 0x32: if (sub_8030894() == 0) { @@ -829,7 +829,7 @@ void sub_8032828(void) } break; case 0x35: - sub_8014248(&gUnknown_80E29A0[0], 0, 6, gUnknown_80E22B4, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E29A0[0], 0, 6, gUnknown_80E22B4, NULL, 4, 0, NULL, 0x101); break; case 0x37: switch ((u32)gUnknown_203B33C->unk524) { @@ -838,12 +838,12 @@ void sub_8032828(void) case 0xB: case 0xD: case 0xE: - xxx_info_box_80141B4(&gUnknown_80E29D0[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E29D0[0], 0, 0, 0x101); break; } break; case 0x38: - xxx_info_box_80141B4(&gUnknown_80E2A0C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2A0C[0], 0, 0, 0x101); break; case 0x3A: RestoreUnkTextStruct_8006518(gUnknown_203B33C->unk3BC); @@ -852,19 +852,19 @@ void sub_8032828(void) sub_8031D70(gUnknown_203B33C->unk218, 0); break; case 0x3B: - xxx_info_box_80141B4(&gUnknown_80E2A1C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2A1C[0], 0, 0, 0x101); break; case 0x39: - xxx_info_box_80141B4(&gUnknown_80E2A5C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2A5C[0], 0, 0, 0x101); break; case 0x2D: - xxx_info_box_80141B4(&gUnknown_80E2A80[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2A80[0], 0, 0, 0x101); break; case 0x2F: - xxx_info_box_80141B4(&gUnknown_80E2AA8[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2AA8[0], 0, 0, 0x101); break; case 0x2A: - xxx_info_box_80141B4(&gUnknown_80E2AE4[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2AE4[0], 0, 0, 0x101); break; case 0x2B: #ifndef NONMATCHING @@ -880,21 +880,21 @@ void sub_8032828(void) #ifndef NONMATCHING gUnknown_80E2BE0[0] = gUnknown_80E2BE0[0]; #endif //NONMATCHING - xxx_info_box_80141B4(&gUnknown_80E2B54[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2B54[0], 0, 0, 0x101); break; } break; case 0x2C: - xxx_info_box_80141B4(&gUnknown_80E2A0C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2A0C[0], 0, 0, 0x101); break; case 0x23: - xxx_info_box_80141B4(&gUnknown_80E2B90[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2B90[0], 0, 0, 0x101); break; case 0x21: - sub_8014248(&gUnknown_80E2BE0[0], 0, 15, gUnknown_80E23A8, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2BE0[0], 0, 15, gUnknown_80E23A8, NULL, 4, 0, NULL, 0x101); break; case 0x25: - xxx_info_box_80141B4(&gUnknown_80E2C48[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2C48[0], 0, 0, 0x101); break; case 0x26: if (sub_8023CE8() != 0) @@ -910,13 +910,13 @@ void sub_8032828(void) sub_8035CF4(gUnknown_203B33C->unk21C, 3, 1); break; case 0x24: - sub_8014248(&gUnknown_80E2C94[0], 0, 16, gUnknown_80E22F0, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2C94[0], 0, 16, gUnknown_80E22F0, NULL, 4, 0, NULL, 0x101); break; case 0x29: - sub_8014248(&gUnknown_80E2CD4[0], 0, 6, gUnknown_80E22D0, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2CD4[0], 0, 6, gUnknown_80E22D0, NULL, 4, 0, NULL, 0x101); break; case 0x1C: - xxx_info_box_80141B4(&gUnknown_80E2CE8[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2CE8[0], 0, 0, 0x101); break; case 0x1D: if (sub_8030894() == 0) { @@ -926,25 +926,25 @@ void sub_8032828(void) } break; case 0x20: - sub_8014248(&gUnknown_80E2D30[0], 0, 6, gUnknown_80E22B4, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2D30[0], 0, 6, gUnknown_80E22B4, NULL, 4, 0, NULL, 0x101); break; case 0x22: - xxx_info_box_80141B4(&gUnknown_80E2D60[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2D60[0], 0, 0, 0x101); break; case 0x5: - sub_8014248(&gUnknown_80E2D7C[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2D7C[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); break; case 0xA: case 0x4C: - sub_8014248(&gUnknown_80E2E20[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2E20[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); break; case 0xB: case 0x4D: - xxx_info_box_80141B4(&gUnknown_80E2E54[0], 0, NULL, 0); + CreateDialogueBoxAndPortrait(&gUnknown_80E2E54[0], 0, NULL, 0); break; case 0xC: case 0x4E: - xxx_info_box_80141B4(&gUnknown_80E2EB4[0], 0, NULL, 0); + CreateDialogueBoxAndPortrait(&gUnknown_80E2EB4[0], 0, NULL, 0); break; case 0x7: gUnknown_203B33C->status = 0; @@ -1019,10 +1019,10 @@ void sub_8032828(void) xxx_call_start_bg_music(); break; case 0x10: - xxx_info_box_80141B4(&gUnknown_80E2F14[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2F14[0], 0, 0, 0x101); break; case 0x11: - xxx_info_box_80141B4(&gUnknown_80E2F44[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2F44[0], 0, 0, 0x101); break; case 0x12: if (sub_8030894() != 0) @@ -1032,10 +1032,10 @@ void sub_8032828(void) sub_80306A8(WONDER_MAIL_TYPE_SOS, 0, NULL, 6); break; case 0x15: - sub_8014248(&gUnknown_80E2F78[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2F78[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); break; case 0xF: - xxx_info_box_80141B4(&gUnknown_80E2FA0[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2FA0[0], 0, 0, 0x101); break; case 0x16: switch ((u32)gUnknown_203B33C->unk524) { @@ -1044,15 +1044,15 @@ void sub_8032828(void) case 0xB: case 0xD: case 0xE: - xxx_info_box_80141B4(&gUnknown_80E2FEC[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E2FEC[0], 0, 0, 0x101); break; } break; case 0x18: - xxx_info_box_80141B4(&gUnknown_80E3030[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3030[0], 0, 0, 0x101); break; case 0x19: - xxx_info_box_80141B4(&gUnknown_80E3078[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3078[0], 0, 0, 0x101); break; case 0x1A: RestoreUnkTextStruct_8006518(gUnknown_203B33C->unk3BC); @@ -1061,10 +1061,10 @@ void sub_8032828(void) sub_80151C0(4, gUnknown_203B33C->passwordBuffer); break; case 0x5A: - sub_8014248(&gUnknown_80E30A4[0], 0, 6, gUnknown_80E2458, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E30A4[0], 0, 6, gUnknown_80E2458, NULL, 4, 0, NULL, 0x101); break; case 0x5B: - xxx_info_box_80141B4(gUnknown_80E30D0, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E30D0, 0, 0, 0x101); break; case 0x5D: RestoreUnkTextStruct_8006518(gUnknown_203B33C->unk35C); @@ -1117,7 +1117,7 @@ void sub_8032828(void) xxx_call_start_bg_music(); break; case 0x72: - xxx_info_box_80141B4(gUnknown_80E311C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E311C, 0, 0, 0x101); break; case 0x73: RestoreUnkTextStruct_8006518(gUnknown_203B33C->unk3BC); @@ -1126,7 +1126,7 @@ void sub_8032828(void) sub_80151C0(4, gUnknown_203B33C->passwordBuffer); break; case 0x66: - xxx_info_box_80141B4(gUnknown_80E314C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E314C, 0, 0, 0x101); break; case 0x67: case 0x2E: @@ -1136,19 +1136,19 @@ void sub_8032828(void) sub_8031D70(gUnknown_203B33C->unk218, 0); break; case 0x68: - xxx_info_box_80141B4(gUnknown_80E317C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E317C, 0, 0, 0x101); break; case 0x6F: - xxx_info_box_80141B4(gUnknown_80E319C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E319C, 0, 0, 0x101); break; case 0x70: // Yes we need duplicates in order to match :) - Kermalis - xxx_info_box_80141B4(gUnknown_80E317C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E317C, 0, 0, 0x101); break; case 0x6C: - xxx_info_box_80141B4(gUnknown_80E31D8, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E31D8, 0, 0, 0x101); break; case 0x50: - xxx_info_box_80141B4(&gUnknown_80E31FC[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E31FC[0], 0, 0, 0x101); break; case 0x6D: switch ((u32)gUnknown_203B33C->unk524) { @@ -1157,7 +1157,7 @@ void sub_8032828(void) case 0xB: case 0xD: case 0xE: - xxx_info_box_80141B4(&gUnknown_80E3220[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3220[0], 0, 0, 0x101); break; } break; @@ -1183,7 +1183,7 @@ void sub_8032828(void) case 0xD: case 0x62: nullsub_23(FALSE); - xxx_info_box_80141B4(&gUnknown_80E2DD0[0], 0, NULL, 0); + CreateDialogueBoxAndPortrait(&gUnknown_80E2DD0[0], 0, NULL, 0); break; case 0x64: switch ((u32)gUnknown_203B33C->unk524) { @@ -1192,47 +1192,47 @@ void sub_8032828(void) case 0xB: case 0xD: case 0xE: - xxx_info_box_80141B4(gUnknown_80E3248, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E3248, 0, 0, 0x101); break; } break; case 0x63: - xxx_info_box_80141B4(gUnknown_80E3288, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E3288, 0, 0, 0x101); break; case 0x69: - sub_8014248(&gUnknown_80E2D7C[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E2D7C[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); break; case 0x59: sub_80922B4(buffer, GetPlayerPokemonStruct()->name, POKEMON_NAME_LENGTH); sprintfStatic(gUnknown_203B33C->unk424, gUnknown_80E32C4, buffer); - xxx_info_box_80141B4(gUnknown_203B33C->unk424, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_203B33C->unk424, 0, 0, 0x101); break; case 0x58: - sub_8014248(&gUnknown_80E331C[0], 0, 6, gUnknown_80E24D8, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E331C[0], 0, 6, gUnknown_80E24D8, NULL, 4, 0, NULL, 0x101); break; case 0x75: - xxx_info_box_80141B4(gUnknown_80E317C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E317C, 0, 0, 0x101); break; case 0x76: - xxx_info_box_80141B4(gUnknown_80E2A0C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E2A0C, 0, 0, 0x101); break; case 0x57: - xxx_info_box_80141B4(&gUnknown_80E3378[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3378[0], 0, 0, 0x101); break; case 0x56: - sub_8014248(&gUnknown_80E339C[0], 0, 22, gUnknown_80E24B0, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E339C[0], 0, 22, gUnknown_80E24B0, NULL, 4, 0, NULL, 0x101); break; case 0x55: - sub_8014248(&gUnknown_80E33D8[0], 0, 21, gUnknown_80E2470, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E33D8[0], 0, 21, gUnknown_80E2470, NULL, 4, 0, NULL, 0x101); break; case 0x53: - xxx_info_box_80141B4(&gUnknown_80E3430[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3430[0], 0, 0, 0x101); break; case 0x54: - sub_8014248(&gUnknown_80E34B0[0], 0, 6, gUnknown_80E2440, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E34B0[0], 0, 6, gUnknown_80E2440, NULL, 4, 0, NULL, 0x101); break; case 0x46: - xxx_info_box_80141B4(&gUnknown_80E34F0[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E34F0[0], 0, 0, 0x101); break; case 0x47: case 0x5C: @@ -1252,74 +1252,74 @@ void sub_8032828(void) sub_8035CF4(gUnknown_203B33C->unk21C, 3, 1); break; case 0x4A: - sub_8014248(&gUnknown_80E352C[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E352C[0], 0, 6, gUnknown_80E2290, NULL, 4, 0, NULL, 0x101); break; case 0x44: - xxx_info_box_80141B4(&gUnknown_80E355C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E355C[0], 0, 0, 0x101); break; case 0x45: - xxx_info_box_80141B4(&gUnknown_80E35AC[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E35AC[0], 0, 0, 0x101); break; case 0x51: - xxx_info_box_80141B4(&gUnknown_80E35E8[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E35E8[0], 0, 0, 0x101); break; case 0x52: if (gUnknown_203B33C->unk40 == 6) - sub_8014248(&gUnknown_80E360C[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E360C[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); else - sub_8014248(&gUnknown_80E3644[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E3644[0], 0, 11, gUnknown_80E236C, NULL, 4, 0, NULL, 0x101); break; case 0x7C: - sub_8014248(&gUnknown_80E367C[0], 0, gUnknown_203B33C->unk564, gUnknown_80E25B4, 0, 4, 0, 0, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E367C[0], 0, gUnknown_203B33C->unk564, gUnknown_80E25B4, 0, 4, 0, 0, 0x101); break; case 0x7D: switch (gUnknown_203B33C->unk564) { case 0x23: - xxx_info_box_80141B4(&gUnknown_80E3690[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3690[0], 0, 0, 0x101); break; case 0x24: - xxx_info_box_80141B4(&gUnknown_80E3818[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3818[0], 0, 0, 0x101); break; case 0x25: - xxx_info_box_80141B4(&gUnknown_80E3998[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3998[0], 0, 0, 0x101); break; case 0x26: - xxx_info_box_80141B4(&gUnknown_80E3B1C[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3B1C[0], 0, 0, 0x101); break; } break; case 0x7A: - sub_8014248(&gUnknown_80E367C[0], 0, gUnknown_203B33C->unk564, gUnknown_80E2554, 0, 4, 0, 0, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E367C[0], 0, gUnknown_203B33C->unk564, gUnknown_80E2554, 0, 4, 0, 0, 0x101); break; case 0x7B: switch (gUnknown_203B33C->unk564) { case 0x1E: - xxx_info_box_80141B4(&gUnknown_80E3BF8[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3BF8[0], 0, 0, 0x101); break; case 0x1F: - xxx_info_box_80141B4(&gUnknown_80E3DE4[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3DE4[0], 0, 0, 0x101); break; case 0x21: - xxx_info_box_80141B4(&gUnknown_80E3E98[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E3E98[0], 0, 0, 0x101); break; case 0x20: - xxx_info_box_80141B4(&gUnknown_80E4014[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E4014[0], 0, 0, 0x101); break; case 0x22: - xxx_info_box_80141B4(&gUnknown_80E4130[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E4130[0], 0, 0, 0x101); break; } break; case 0x78: - sub_8014248(&gUnknown_80E367C[0], 0, gUnknown_203B33C->unk564, gUnknown_80E24F8, 0, 4, 0, 0, 0x101); + CreateMenuDialogueBoxAndPortrait(&gUnknown_80E367C[0], 0, gUnknown_203B33C->unk564, gUnknown_80E24F8, 0, 4, 0, 0, 0x101); break; case 0x79: switch (gUnknown_203B33C->unk564) { case 0x1D: - xxx_info_box_80141B4(&gUnknown_80E41DC[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E41DC[0], 0, 0, 0x101); break; case 0x1A: - xxx_info_box_80141B4(&gUnknown_80E4314[0], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(&gUnknown_80E4314[0], 0, 0, 0x101); break; } break; @@ -1341,48 +1341,48 @@ void PrintFriendRescueError(u32 status) case COMMS_GOOD: break; case COMMS_INCORRECT_NUM_SYSTEMS: - xxx_info_box_80141B4(gUnknown_80E44A4, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E44A4, 0, 0, 0x101); break; case COMMS_NO_RESPONSE: - xxx_info_box_80141B4(gUnknown_80E4500, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4500, 0, 0, 0x101); break; case COMMS_DIFFERENT_MODES: - xxx_info_box_80141B4(gUnknown_80E4550, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4550, 0, 0, 0x101); break; case COMMS_NO_ROOM_STORAGE: - xxx_info_box_80141B4(gUnknown_80E45B4, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E45B4, 0, 0, 0x101); break; case COMMS_DUPLICATE_MAIL: - xxx_info_box_80141B4(gUnknown_80E460C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E460C, 0, 0, 0x101); break; case COMMS_MAIL_SENT_ALREADY: - xxx_info_box_80141B4(gUnknown_80E4650, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4650, 0, 0, 0x101); break; case COMMS_NOT_ELIGIBLE_1: - xxx_info_box_80141B4(gUnknown_80E468C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E468C, 0, 0, 0x101); break; case COMMS_FRIEND_NOT_ELIGIBLE: - xxx_info_box_80141B4(gUnknown_80E46C8, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E46C8, 0, 0, 0x101); break; case COMMS_NOT_ELIGIBLE_2: - xxx_info_box_80141B4(gUnknown_80E4704, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4704, 0, 0, 0x101); break; case COMMS_FRIEND_NOT_ELIGIBLE_2: - xxx_info_box_80141B4(gUnknown_80E4744, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4744, 0, 0, 0x101); break; case 16: - xxx_info_box_80141B4(gUnknown_80E4788, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4788, 0, 0, 0x101); break; case COMMS_NO_ROOM_MAIL: - xxx_info_box_80141B4(gUnknown_80E47D8, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E47D8, 0, 0, 0x101); break; case 1: case 5: case 14: - xxx_info_box_80141B4(gUnknown_80E4480, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4480, 0, 0, 0x101); break; case COMMS_NOT_READY: - xxx_info_box_80141B4(gUnknown_80E482C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E482C, 0, 0, 0x101); break; } } @@ -1675,30 +1675,30 @@ void sub_8033DBC(void) switch(sub_8039068(mailMode, gUnknown_203B33C->passwordBuffer, &mail)) { case PASSWORD_ENTRY_INCORRECT_PASSWORD: - sub_8014248(gUnknown_80E48A8, 0, 6, gUnknown_80E2290, 0, 4, 0, 0, 0x101); + CreateMenuDialogueBoxAndPortrait(gUnknown_80E48A8, 0, 6, gUnknown_80E2290, 0, 4, 0, 0, 0x101); SetFriendRescueMenuState(0x1B); break; case PASSWORD_ENTRY_NOT_SOS_MAIL: - xxx_info_box_80141B4(gUnknown_80E48E8, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E48E8, 0, 0, 0x101); SetFriendRescueMenuState(FRIEND_RESCUE_MENU_ERROR); break; case PASSWORD_ENTRY_DUPLICATE_SOS_MAIL: - xxx_info_box_80141B4(gUnknown_80E460C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E460C, 0, 0, 0x101); SetFriendRescueMenuState(FRIEND_RESCUE_MENU_ERROR); break; case PASSWORD_ENTRY_SOS_MAIL_SUCCESS: sub_8095274(mail.unk10.unk10); mail.mailType = 2; sub_80951BC(&mail); - xxx_info_box_80141B4(gUnknown_80E4928, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4928, 0, 0, 0x101); SetFriendRescueMenuState(0x16); break; case PASSWORD_ENTRY_NOT_AOK_MAIL: - xxx_info_box_80141B4(gUnknown_80E4964, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4964, 0, 0, 0x101); SetFriendRescueMenuState(FRIEND_RESCUE_MENU_ERROR); break; case PASSWORD_ENTRY_DUPLICATE_AOK_MAIL: - xxx_info_box_80141B4(gUnknown_80E499C, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E499C, 0, 0, 0x101); SetFriendRescueMenuState(FRIEND_RESCUE_MENU_ERROR); break; case PASSWORD_ENTRY_AOK_MAIL_SUCCESS: @@ -2316,7 +2316,7 @@ void sub_80348C4(void) case 0xB: case 0xD: case 0xE: - xxx_info_box_80141B4(gUnknown_80E31FC, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E31FC, 0, 0, 0x101); SetFriendRescueMenuState(0x77); break; case 0xC: @@ -2559,15 +2559,15 @@ void sub_8034D74(void) switch(sub_8039068(PASSWORD_ENTRY_THANK_YOU_MAIL_MODE, gUnknown_203B33C->passwordBuffer, &mail)) { case PASSWORD_ENTRY_INCORRECT_PASSWORD: - sub_8014248(gUnknown_80E48A8, 0, 6, gUnknown_80E2440, 0, 4, 0, 0, 0x101); + CreateMenuDialogueBoxAndPortrait(gUnknown_80E48A8, 0, 6, gUnknown_80E2440, 0, 4, 0, 0, 0x101); SetFriendRescueMenuState(0x74); break; case PASSWORD_ENTRY_NOT_THANK_YOU_MAIL: - xxx_info_box_80141B4(gUnknown_80E49C4, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E49C4, 0, 0, 0x101); SetFriendRescueMenuState(FRIEND_RESCUE_MENU_ERROR_2); break; case PASSWORD_ENTRY_DUPLICATE_THANK_YOU_MAIL: - xxx_info_box_80141B4(gUnknown_80E4704, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E4704, 0, 0, 0x101); SetFriendRescueMenuState(FRIEND_RESCUE_MENU_ERROR_2); break; case PASSWORD_ENTRY_THANK_YOU_MAIL_SUCCESS: diff --git a/src/gulpin_shop.c b/src/gulpin_shop.c index a1f7f3bc5..9a846cd90 100644 --- a/src/gulpin_shop.c +++ b/src/gulpin_shop.c @@ -45,20 +45,20 @@ bool8 CreateGulpinShop(u32 mode, s16 pokeSpecies, Move *moves) sGulpinShopWork->unk1C = moves[4].id; // 5th move..? if (mode == GULPIN_SHOP_MODE_AWAKE) - sGulpinShopWork->unk128 = &sGulpinShopWork->faceFile; + sGulpinShopWork->monPortraitPtr = &sGulpinShopWork->monPortrait; else - sGulpinShopWork->unk128 = NULL; + sGulpinShopWork->monPortraitPtr = NULL; faceFile = GetDialogueSpriteDataPtr(MONSTER_GULPIN); - sGulpinShopWork->faceFile = faceFile; - sGulpinShopWork->faceData = faceFile->data; + sGulpinShopWork->monPortrait.faceFile = faceFile; + sGulpinShopWork->monPortrait.faceData = faceFile->data; - sGulpinShopWork->unk124 = 0; - sGulpinShopWork->unk125 = 0; - sGulpinShopWork->unk126 = 0; + sGulpinShopWork->monPortrait.spriteId = 0; + sGulpinShopWork->monPortrait.flip = FALSE; + sGulpinShopWork->monPortrait.unkE = 0; - sGulpinShopWork->unk120 = 2; - sGulpinShopWork->unk122 = 8; + sGulpinShopWork->monPortrait.pos.x = 2; + sGulpinShopWork->monPortrait.pos.y = 8; SetGulpinShopState(0); return TRUE; } @@ -97,7 +97,7 @@ bool8 GulpinIsNextMoveLinked(void) void DestroyGulpinShop(void) { if (sGulpinShopWork != NULL) { - CloseFile(sGulpinShopWork->faceFile); + CloseFile(sGulpinShopWork->monPortrait.faceFile); MemoryFree(sGulpinShopWork); sGulpinShopWork = NULL; } @@ -160,15 +160,15 @@ static void sub_801EA28(void) case GULPIN_SHOP_MODE_AWAKE: case GULPIN_SHOP_MODE_ASLEEP: if (sGulpinShopWork->isNextMoveLinked) - sub_8014248(gCommonGulpin[sGulpinShopWork->mode][GULPIN_DLG_12], 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, sGulpinShopWork->unk128, 12); + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[sGulpinShopWork->mode][GULPIN_DLG_12], 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, sGulpinShopWork->monPortraitPtr, 12); else - sub_8014248(gCommonGulpin[sGulpinShopWork->mode][GULPIN_DLG_11], 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, sGulpinShopWork->unk128, 12); + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[sGulpinShopWork->mode][GULPIN_DLG_11], 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, sGulpinShopWork->monPortraitPtr, 12); break; case GULPIN_SHOP_MODE_UNK2: if (sGulpinShopWork->isNextMoveLinked) - sub_8014248(sForgetMoveAndLinkedOnes, 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, NULL, 32); + CreateMenuDialogueBoxAndPortrait(sForgetMoveAndLinkedOnes, 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, NULL, 32); else - sub_8014248(sForgetMoveOnly, 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, NULL, 32); + CreateMenuDialogueBoxAndPortrait(sForgetMoveOnly, 0, 5, &sGulpinShopWork->unk28[0], &sGulpinShopWork->unk68, 4, 0, NULL, 32); break; } break; @@ -180,15 +180,15 @@ static void sub_801EBC4(void) s32 which; s32 i; which = 0; - + MemoryFill16(sGulpinShopWork->unk68, 0, sizeof(sGulpinShopWork->unk68)); - + sGulpinShopWork->unk28[which].text = sForget; sGulpinShopWork->unk28[which].menuAction = 2; - + if (!IsAnyMoveLinked(sGulpinShopWork->unk1E, sGulpinShopWork->moves) || (s32)sGulpinShopWork->unk20 >= 4) sGulpinShopWork->unk68[0] = 1; - + which++; sGulpinShopWork->unk28[which].text = gCommonInfo[0]; sGulpinShopWork->unk28[which].menuAction = 3; @@ -216,7 +216,7 @@ static void sub_801EC7C(void) { s32 which; which = 0; - + MemoryFill16(sGulpinShopWork->unk68, 0, sizeof(sGulpinShopWork->unk68)); sGulpinShopWork->unk28[which].text = gCommonYes[0]; sGulpinShopWork->unk28[which].menuAction = 4; @@ -314,4 +314,4 @@ static void sub_801EDC0(void) break; } } -} \ No newline at end of file +} diff --git a/src/gulpin_shop_801FB50.c b/src/gulpin_shop_801FB50.c index 3e6fff2fd..f56b7aabf 100644 --- a/src/gulpin_shop_801FB50.c +++ b/src/gulpin_shop_801FB50.c @@ -99,18 +99,18 @@ bool8 sub_801FB50(u32 mode) PrintPokeNameToBuffer(gUnknown_202E1C8 - 0xF0, GetPlayerPokemonStruct()); if (gUnknown_203B27C->mode == GULPIN_SHOP_MODE_ASLEEP) - gUnknown_203B27C->unk17C = NULL; + gUnknown_203B27C->monPortraitPtr = NULL; else - gUnknown_203B27C->unk17C = &gUnknown_203B27C->faceFile; + gUnknown_203B27C->monPortraitPtr = &gUnknown_203B27C->monPortrait; faceFile = GetDialogueSpriteDataPtr(MONSTER_GULPIN); - gUnknown_203B27C->faceFile = faceFile; - gUnknown_203B27C->faceData = faceFile->data; - gUnknown_203B27C->unk178 = 0; - gUnknown_203B27C->unk179 = 0; - gUnknown_203B27C->unk17A = 0; - gUnknown_203B27C->unk174 = 2; - gUnknown_203B27C->unk176 = 8; + gUnknown_203B27C->monPortrait.faceFile = faceFile; + gUnknown_203B27C->monPortrait.faceData = faceFile->data; + gUnknown_203B27C->monPortrait.spriteId = 0; + gUnknown_203B27C->monPortrait.flip = FALSE; + gUnknown_203B27C->monPortrait.unkE = 0; + gUnknown_203B27C->monPortrait.pos.x = 2; + gUnknown_203B27C->monPortrait.pos.y = 8; sub_801FDA8(0); return TRUE; } @@ -184,7 +184,7 @@ u32 sub_801FC40(void) void sub_801FD7C(void) { if (gUnknown_203B27C) { - CloseFile(gUnknown_203B27C->faceFile); + CloseFile(gUnknown_203B27C->monPortrait.faceFile); MemoryFree(gUnknown_203B27C); gUnknown_203B27C = NULL; } @@ -254,63 +254,63 @@ static void sub_801FF28(void) gUnknown_203B27C->menuAction1 = 2; CreateGulpinShopMenu(); gUnknown_203B27C->fallbackState = 2; - sub_8014248(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_00],0,gUnknown_203B27C->menuAction1,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0,gUnknown_203B27C->unk17C,0xc); + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_00],0,gUnknown_203B27C->menuAction1,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0,gUnknown_203B27C->monPortraitPtr,0xc); break; case 1: CreateGulpinShopMenu(); gUnknown_203B27C->fallbackState = 2; - sub_8014248(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_01],0,gUnknown_203B27C->menuAction1,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0,gUnknown_203B27C->unk17C,0xc); + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_01],0,gUnknown_203B27C->menuAction1,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0,gUnknown_203B27C->monPortraitPtr,0xc); break; case 2: DrawTeamMoneyBox(3); break; case 3: gUnknown_203B27C->fallbackState = 0x1f; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_02],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_02],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 4: gUnknown_203B27C->fallbackState = 0x1f; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_03],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_03],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 5: gUnknown_203B27C->fallbackState = 0x1f; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_04],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_04],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 6: gUnknown_203B27C->fallbackState = 0x1f; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_05],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_05],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 7: sub_8020900(); - sub_8014248(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_06],0,0x10, + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_06],0,0x10, gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0, - gUnknown_203B27C->unk17C,0xc); + gUnknown_203B27C->monPortraitPtr,0xc); break; case 8: sub_8020950(); - sub_8014248(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_21],0,0xd, + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_21],0,0xd, gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0, - gUnknown_203B27C->unk17C,0xc); + gUnknown_203B27C->monPortraitPtr,0xc); break; case 9: gUnknown_203B27C->fallbackState = 1; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_22],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_22],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 10: gUnknown_203B27C->fallbackState = 1; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_23],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_23],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0xb: gUnknown_203B27C->fallbackState = 1; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_24],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_24],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0xc: gUnknown_203B27C->fallbackState = 0xd; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_07],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_07],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0xe: gUnknown_203B27C->fallbackState = 0xf; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_08],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_08],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0xf: sub_8023868(2,0,0,10); @@ -330,7 +330,7 @@ static void sub_801FF28(void) break; case 0x14: gUnknown_203B27C->fallbackState = 0x15; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_09],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_09],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0x15: sub_801F428(gUnknown_203B27C->speciesNum,0); @@ -354,17 +354,17 @@ static void sub_801FF28(void) sub_8094060(gUnknown_203B27C->moves,gUnknown_203B27C->pokeStruct->moves); gUnknown_203B27C->fallbackState = 0x10; sub_8092C84(gAvailablePokemonNames,gUnknown_203B27C->unk1E); - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_10],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_10],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0x1a: sub_8094060(gUnknown_203B27C->moves,gUnknown_203B27C->pokeStruct->moves); gUnknown_203B27C->fallbackState = 0x10; if (gUnknown_203B27C->isNextMoveLinked) { - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_14],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_14],0,gUnknown_203B27C->monPortraitPtr,0x10d); } else { - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_13],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_13],0,gUnknown_203B27C->monPortraitPtr,0x10d); } break; case 0x1d: @@ -377,11 +377,11 @@ static void sub_801FF28(void) break; case 0x1b: gUnknown_203B27C->fallbackState = 0x10; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_15],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_15],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0x1c: gUnknown_203B27C->fallbackState = 0x10; - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_16],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_16],0,gUnknown_203B27C->monPortraitPtr,0x10d); break; case 0x1e: @@ -403,24 +403,24 @@ static void sub_801FF28(void) sub_80208B0(); sub_8092C84(gUnknown_202DFE8,gUnknown_203B27C->unk20); if (gUnknown_203B27C->isNextMoveLinked) { - sub_8014248(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_18],0,0x11,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0, - gUnknown_203B27C->unk17C,0xc); + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_18],0,0x11,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0, + gUnknown_203B27C->monPortraitPtr,0xc); } else { - sub_8014248(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_17],0,0x11,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0, - gUnknown_203B27C->unk17C,0xc); + CreateMenuDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_17],0,0x11,gUnknown_203B27C->unk7C,gUnknown_203B27C->unkBC,4,0, + gUnknown_203B27C->monPortraitPtr,0xc); } break; case 0x23: gUnknown_203B27C->fallbackState = 0x1f; sub_8092C84(gUnknown_202DFE8,gUnknown_203B27C->unk20); - if (gUnknown_203B27C->isNextMoveLinked) + if (gUnknown_203B27C->isNextMoveLinked) { - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_20],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_20],0,gUnknown_203B27C->monPortraitPtr,0x10d); } else { - xxx_info_box_80141B4(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_19],0,gUnknown_203B27C->unk17C,0x10d); + CreateDialogueBoxAndPortrait(gCommonGulpin[gUnknown_203B27C->mode][GULPIN_DLG_19],0,gUnknown_203B27C->monPortraitPtr,0x10d); } break; } @@ -546,15 +546,15 @@ static void CreateGulpinLinkMenu(void) } gUnknown_203B27C->unk7C[loopMax].menuAction = 7; } - + loopMax++; gUnknown_203B27C->unk7C[loopMax].text = gGulpinLink; gUnknown_203B27C->unk7C[loopMax].menuAction = LINK_ACTION; - + loopMax++; gUnknown_203B27C->unk7C[loopMax].text = gGulpinDelink; gUnknown_203B27C->unk7C[loopMax].menuAction = DE_LINK_ACTION; - + loopMax++; gUnknown_203B27C->unk7C[loopMax].text = gGulpinForget; gUnknown_203B27C->unk7C[loopMax].menuAction = FORGET_ACTION; @@ -978,12 +978,12 @@ static void sub_8020EB4(void) if(gTeamInventoryRef->teamMoney < 150) { PlayMenuSoundEffect(2); - sub_801FDA8(0x3); + sub_801FDA8(0x3); } else if(!sub_8093318(gUnknown_203B27C->moveIndex, gUnknown_203B27C->moves)) { PlayMenuSoundEffect(2); - sub_801FDA8(0x4); + sub_801FDA8(0x4); } else { @@ -1004,7 +1004,7 @@ static void sub_8020EB4(void) if(!sub_809333C(gUnknown_203B27C->moveIndex, gUnknown_203B27C->moves)) { PlayMenuSoundEffect(2); - sub_801FDA8(0x5); + sub_801FDA8(0x5); } else { diff --git a/src/kangaskhan_storage1.c b/src/kangaskhan_storage1.c index 5647d6361..ec2b6029d 100644 --- a/src/kangaskhan_storage1.c +++ b/src/kangaskhan_storage1.c @@ -63,18 +63,18 @@ bool8 CreateKangaskhanStorage(u32 mode) strcpy(gUnknown_202E1C8 - 0x50, monName); if (gKangaskhanStorageWork->mode == KANG_MODE_ASLEEP) - gKangaskhanStorageWork->unkE8 = NULL; + gKangaskhanStorageWork->monPortraitPtr = NULL; else - gKangaskhanStorageWork->unkE8 = &gKangaskhanStorageWork->faceFile; + gKangaskhanStorageWork->monPortraitPtr = &gKangaskhanStorageWork->monPortrait; faceFile = GetDialogueSpriteDataPtr(MONSTER_KANGASKHAN); - gKangaskhanStorageWork->faceFile = faceFile; - gKangaskhanStorageWork->faceData = faceFile->data; - gKangaskhanStorageWork->unkE4 = FALSE; - gKangaskhanStorageWork->unkE5 = 0; - gKangaskhanStorageWork->unkE6 = 0; - gKangaskhanStorageWork->unkE0 = 2; - gKangaskhanStorageWork->unkE2 = 8; + gKangaskhanStorageWork->monPortrait.faceFile = faceFile; + gKangaskhanStorageWork->monPortrait.faceData = faceFile->data; + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + gKangaskhanStorageWork->monPortrait.flip = FALSE; + gKangaskhanStorageWork->monPortrait.unkE = 0; + gKangaskhanStorageWork->monPortrait.pos.x = 2; + gKangaskhanStorageWork->monPortrait.pos.y = 8; UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_INIT); return TRUE; } @@ -133,7 +133,7 @@ u32 KangaskhanStorageCallback(void) void DeleteKangaskhanStorage(void) { if (gKangaskhanStorageWork != NULL) { - CloseFile(gKangaskhanStorageWork->faceFile); + CloseFile(gKangaskhanStorageWork->monPortrait.faceFile); MemoryFree(gKangaskhanStorageWork); gKangaskhanStorageWork = NULL; } @@ -189,66 +189,66 @@ static void sub_8016FF8(void) switch (gKangaskhanStorageWork->currState) { case KANGASKHAN_STORAGE_INIT: BuildKangaskhanMainMenu(); - gKangaskhanStorageWork->unkE4 = TRUE; - sub_8014248(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WELCOME], 0, gKangaskhanStorageWork->menuAction1, gKangaskhanStorageWork->unk24, - gKangaskhanStorageWork->unk4C, 4, 0, gKangaskhanStorageWork->unkE8, 12); + gKangaskhanStorageWork->monPortrait.spriteId = TRUE; + CreateMenuDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WELCOME], 0, gKangaskhanStorageWork->menuAction1, gKangaskhanStorageWork->unk24, + gKangaskhanStorageWork->unk4C, 4, 0, gKangaskhanStorageWork->monPortraitPtr, 12); break; case KANGASKHAN_STORAGE_MAIN_MENU: BuildKangaskhanMainMenu(); - gKangaskhanStorageWork->unkE4 = FALSE; - sub_8014248(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_ANYTHING_ELSE], 0, gKangaskhanStorageWork->menuAction1, gKangaskhanStorageWork->unk24, - gKangaskhanStorageWork->unk4C, 4, 0, gKangaskhanStorageWork->unkE8, 12); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateMenuDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_ANYTHING_ELSE], 0, gKangaskhanStorageWork->menuAction1, gKangaskhanStorageWork->unk24, + gKangaskhanStorageWork->unk4C, 4, 0, gKangaskhanStorageWork->monPortraitPtr, 12); break; case 2: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_MAIN_MENU; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_HOW_IT_WORKS], 0, gKangaskhanStorageWork->unkE8, 0x10D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_HOW_IT_WORKS], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; case 3: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_EXIT; - gKangaskhanStorageWork->unkE4 = TRUE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_BYE], 0, gKangaskhanStorageWork->unkE8, 0x30D); + gKangaskhanStorageWork->monPortrait.spriteId = TRUE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_BYE], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case KANGASKHAN_STORAGE_NO_INV_ITEMS: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_MAIN_MENU; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_YOU_HAVE_NOTHING], 0, gKangaskhanStorageWork->unkE8, 0x10D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_YOU_HAVE_NOTHING], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; case KANGASKHAN_STORAGE_TOO_MANY_ITEMS: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_MAIN_MENU; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_YOU_ARE_FULL], 0, gKangaskhanStorageWork->unkE8, 0x10D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_YOU_ARE_FULL], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; case 7: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_MAIN_MENU; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORAGE_HAS_NOTHING], 0, gKangaskhanStorageWork->unkE8, 0x10D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORAGE_HAS_NOTHING], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; case 8: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_MAIN_MENU; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORAGE_FULL], 0, gKangaskhanStorageWork->unkE8, 0x10D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORAGE_FULL], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; case KANGASKHAN_STORAGE_IS_MONEY_USED_TM: sub_8090E14(gFormatItems, &gKangaskhanStorageWork->storedItem, 0); gKangaskhanStorageWork->fallbackState = 14; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT__INVALID_ITEM], 0, gKangaskhanStorageWork->unkE8, 0x30D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT__INVALID_ITEM], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 10: gKangaskhanStorageWork->fallbackState = 14; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM], 0, gKangaskhanStorageWork->unkE8, 0x30D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 11: gKangaskhanStorageWork->fallbackState = 13; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORE_WHAT], 0, gKangaskhanStorageWork->unkE8, 0x30D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORE_WHAT], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 12: gKangaskhanStorageWork->fallbackState = 14; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORE_MORE], 0, gKangaskhanStorageWork->unkE8, 0x30D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORE_MORE], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 13: sub_801A5D8(3, 3, NULL, 10); @@ -264,15 +264,15 @@ static void sub_8016FF8(void) case 17: sub_80177F8(); sub_8090E14(gFormatItems, &gKangaskhanStorageWork->storedItem, 0); - gKangaskhanStorageWork->unkE4 = FALSE; - sub_8014248(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_ONE_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, - gKangaskhanStorageWork->unkE8, 12); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateMenuDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_ONE_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, + gKangaskhanStorageWork->monPortraitPtr, 12); break; case 18: sub_80177F8(); - gKangaskhanStorageWork->unkE4 = FALSE; - sub_8014248(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_MANY_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, - gKangaskhanStorageWork->unkE8, 12); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateMenuDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_MANY_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, + gKangaskhanStorageWork->monPortraitPtr, 12); break; case 19: if (GetNumberOfFilledInventorySlots() == 0) { @@ -282,18 +282,18 @@ static void sub_8016FF8(void) else gKangaskhanStorageWork->fallbackState = 12; - gKangaskhanStorageWork->unkE4 = TRUE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_CONFIRMATION], 0, gKangaskhanStorageWork->unkE8, 0x10D); + gKangaskhanStorageWork->monPortrait.spriteId = TRUE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_CONFIRMATION], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; case 20: gKangaskhanStorageWork->fallbackState = 22; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_TAKE_WHAT], 0, gKangaskhanStorageWork->unkE8, 0x30D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_TAKE_WHAT], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 21: gKangaskhanStorageWork->fallbackState = 23; - gKangaskhanStorageWork->unkE4 = FALSE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_TAKE_MORE], 0, gKangaskhanStorageWork->unkE8, 0x30D); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_TAKE_MORE], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 22: sub_801C8C4(1, 3, 0, 10); @@ -333,15 +333,15 @@ static void sub_8016FF8(void) case 27: sub_80177F8(); sub_8090E14(gFormatItems, &gKangaskhanStorageWork->storedItem, 0); - gKangaskhanStorageWork->unkE4 = FALSE; - sub_8014248(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WITHDRAW_ONE_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, - gKangaskhanStorageWork->unkE8, 12); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateMenuDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WITHDRAW_ONE_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, + gKangaskhanStorageWork->monPortraitPtr, 12); break; case 28: sub_80177F8(); - gKangaskhanStorageWork->unkE4 = FALSE; - sub_8014248(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WITHDRAW_MANY_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, - gKangaskhanStorageWork->unkE8, 12); + gKangaskhanStorageWork->monPortrait.spriteId = FALSE; + CreateMenuDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WITHDRAW_MANY_PROMPT], 0, 4, gKangaskhanStorageWork->unk24, NULL, 4, 0, + gKangaskhanStorageWork->monPortraitPtr, 12); break; case 29: if (sub_801CF14(1) || GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE) { @@ -351,8 +351,8 @@ static void sub_8016FF8(void) else gKangaskhanStorageWork->fallbackState = 21; - gKangaskhanStorageWork->unkE4 = TRUE; - xxx_info_box_80141B4(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WITHDRAW_CONFIRMATION], 0, gKangaskhanStorageWork->unkE8, 0x10D); + gKangaskhanStorageWork->monPortrait.spriteId = TRUE; + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_WITHDRAW_CONFIRMATION], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; } } diff --git a/src/kecleon_bros1.c b/src/kecleon_bros1.c index 1c9a13ede..7da66fa3b 100644 --- a/src/kecleon_bros1.c +++ b/src/kecleon_bros1.c @@ -48,7 +48,7 @@ static void sub_8019D30(void); static void sub_8019D4C(void); static void ProceedToKecleonBros1FallbackState(void); static void KecleonCalcSellPriceForAllItems(void); -static void sub_8019E04(bool32); +static void SetKecleonPortraitSpriteId(bool32 angrySprite); enum MenuActions { CANCEL_ACTION = 1, @@ -74,7 +74,7 @@ bool8 CreateKecleonBros(u32 mode) switch (mode) { case KECLEON_BROS_MODE_ITEMS_AWAKE: sKecleonBrosWork1->isKecleonItemShop = TRUE; - sKecleonBrosWork1->unkE4 = &sKecleonBrosWork1->faceFile; + sKecleonBrosWork1->monPortraitPtr = &sKecleonBrosWork1->monPortrait; CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON); CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON); monName = GetMonSpecies(MONSTER_KECLEON); @@ -82,7 +82,7 @@ bool8 CreateKecleonBros(u32 mode) break; case KECLEON_BROS_MODE_ITEMS_ASLEEP: sKecleonBrosWork1->isKecleonItemShop = TRUE; - sKecleonBrosWork1->unkE4 = NULL; + sKecleonBrosWork1->monPortraitPtr = NULL; CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON); CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON); monName = GetMonSpecies(MONSTER_KECLEON); @@ -90,7 +90,7 @@ bool8 CreateKecleonBros(u32 mode) break; case KECLEON_BROS_MODE_WARES_AWAKE: sKecleonBrosWork1->isKecleonItemShop = FALSE; - sKecleonBrosWork1->unkE4 = &sKecleonBrosWork1->faceFile; + sKecleonBrosWork1->monPortraitPtr = &sKecleonBrosWork1->monPortrait; CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON); CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON); monName = GetMonSpecies(MONSTER_KECLEON); @@ -98,7 +98,7 @@ bool8 CreateKecleonBros(u32 mode) break; case KECLEON_BROS_MODE_WARES_ASLEEP: sKecleonBrosWork1->isKecleonItemShop = FALSE; - sKecleonBrosWork1->unkE4 = NULL; + sKecleonBrosWork1->monPortraitPtr = NULL; CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_KECLEON); CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_KECLEON); monName = GetMonSpecies(MONSTER_KECLEON); @@ -109,13 +109,13 @@ bool8 CreateKecleonBros(u32 mode) } faceFile = GetDialogueSpriteDataPtr(MONSTER_KECLEON); - sKecleonBrosWork1->faceFile = faceFile; - sKecleonBrosWork1->faceData = faceFile->data; - sKecleonBrosWork1->unkE0 = 0; - sKecleonBrosWork1->unkE1 = 0; - sKecleonBrosWork1->unkE2 = 0; - sKecleonBrosWork1->unkDC = 2; - sKecleonBrosWork1->unkDE = 8; + sKecleonBrosWork1->monPortrait.faceFile = faceFile; + sKecleonBrosWork1->monPortrait.faceData = faceFile->data; + sKecleonBrosWork1->monPortrait.spriteId = 0; + sKecleonBrosWork1->monPortrait.flip = FALSE; + sKecleonBrosWork1->monPortrait.unkE = 0; + sKecleonBrosWork1->monPortrait.pos.x = 2; + sKecleonBrosWork1->monPortrait.pos.y = 8; SetKecleonBrosState(KECLEON_STORE_INIT); return TRUE; } @@ -168,7 +168,7 @@ u32 KecleonBrosCallback(void) void DeleteKecleonBros(void) { if (sKecleonBrosWork1 != NULL) { - CloseFile(sKecleonBrosWork1->faceFile); + CloseFile(sKecleonBrosWork1->monPortrait.faceFile); MemoryFree(sKecleonBrosWork1); sKecleonBrosWork1 = NULL; } @@ -227,87 +227,87 @@ static void UpdateKecleonStoreDialogue(void) case KECLEON_STORE_INIT: KecleonCalcSellPriceForAllItems(); BuildKecleonBrosMainMenu(); - sub_8019E04(FALSE); - sub_8014248(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_00], 0, sKecleonBrosWork1->menuAction1, - sKecleonBrosWork1->menuItems, sKecleonBrosWork1->unk74, 4, 0, sKecleonBrosWork1->unkE4, 12); + SetKecleonPortraitSpriteId(FALSE); + CreateMenuDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_00], 0, sKecleonBrosWork1->menuAction1, + sKecleonBrosWork1->menuItems, sKecleonBrosWork1->unk74, 4, 0, sKecleonBrosWork1->monPortraitPtr, 12); break; case KECLEON_STORE_MAIN_MENU: KecleonCalcSellPriceForAllItems(); BuildKecleonBrosMainMenu(); - sub_8019E04(FALSE); - sub_8014248(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_01], 0, sKecleonBrosWork1->menuAction1, - sKecleonBrosWork1->menuItems, sKecleonBrosWork1->unk74, 4, 0, sKecleonBrosWork1->unkE4, 12); + SetKecleonPortraitSpriteId(FALSE); + CreateMenuDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_01], 0, sKecleonBrosWork1->menuAction1, + sKecleonBrosWork1->menuItems, sKecleonBrosWork1->unk74, 4, 0, sKecleonBrosWork1->monPortraitPtr, 12); break; case KECLEON_STORE_INFO: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_22], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_22], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; - case 3: + case 3: sKecleonBrosWork1->fallbackState = KECLEON_STORE_EXIT; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_02], 0, sKecleonBrosWork1->unkE4, 0x30D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_02], 0, sKecleonBrosWork1->monPortraitPtr, 0x30D); break; case KECLEON_STORE_NO_STORE_ITEMS: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_12], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_12], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_NO_MONEY: sKecleonBrosWork1->fallbackState = KECLEON_STORE_BUY_ITEM_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_13], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_13], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_TOO_MUCH_MONEY: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_14], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_14], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_NO_ITEMS_TO_SELL: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_15], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_15], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_NO_ITEMS: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_16], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_16], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_TOO_MANY_ITEMS: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_17], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_17], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case 11: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_18], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_18], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_NOT_ENOUGH_MONEY: sKecleonBrosWork1->fallbackState = KECLEON_STORE_BUY_ITEM_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_19], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_19], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_CANT_SELL_ITEM: sub_8090E14(gFormatItems, &sKecleonBrosWork1->soldItem, NULL); sKecleonBrosWork1->fallbackState = KECLEON_STORE_SELL_ITEM_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_20], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_20], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_SELL_ITEM_TOO_MUCH_MONEY: sKecleonBrosWork1->fallbackState = KECLEON_STORE_SELL_ITEM_MENU; - sub_8019E04(TRUE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_21], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(TRUE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_21], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case 15: sKecleonBrosWork1->fallbackState = 18; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_03], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_03], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_BUY_ITEM_MENU: sKecleonBrosWork1->fallbackState = 19; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_04], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_04], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case 18: if (sKecleonBrosWork1->isKecleonItemShop) @@ -342,8 +342,8 @@ static void UpdateKecleonStoreDialogue(void) BuildKecleonBrosYesNoMenu(); sub_8090E14(gFormatItems, &sKecleonBrosWork1->soldItem, 0); gFormatData_202DE30 = sKecleonBrosWork1->itemSellPrice; - sub_8019E04(FALSE); - sub_8014248(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_05], 0, 5,sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->unkE4, 12); + SetKecleonPortraitSpriteId(FALSE); + CreateMenuDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_05], 0, 5,sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->monPortraitPtr, 12); break; case KECLEON_STORE_BUY_ITEM_RECEIPT: if (CountKecleonItems() == 0) { @@ -364,18 +364,18 @@ static void UpdateKecleonStoreDialogue(void) else sKecleonBrosWork1->fallbackState = KECLEON_STORE_BUY_ITEM_MENU; } - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_06], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_06], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case 23: sKecleonBrosWork1->fallbackState = 26; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_07], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_07], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_SELL_ITEM_MENU: sKecleonBrosWork1->fallbackState = 27; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_08], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_08], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case 26: sub_801A5D8(4, 3, NULL, 10); @@ -395,8 +395,8 @@ static void UpdateKecleonStoreDialogue(void) BuildKecleonBrosYesNoMenu(); sub_8090E14(gFormatItems, &sKecleonBrosWork1->soldItem, NULL); gFormatData_202DE30 = sKecleonBrosWork1->itemSellPrice; - sub_8019E04(FALSE); - sub_8014248(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_09], 0, 5, sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->unkE4, 12); + SetKecleonPortraitSpriteId(FALSE); + CreateMenuDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_09], 0, 5, sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->monPortraitPtr, 12); break; case KECLEON_STORE_BUY_ITEM_INFO: case KECLEON_STORE_SELL_ITEM_INFO: @@ -410,19 +410,19 @@ static void UpdateKecleonStoreDialogue(void) else sKecleonBrosWork1->fallbackState = KECLEON_STORE_SELL_ITEM_MENU; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_11], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_11], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; case KECLEON_STORE_SELL_ALL_ITEMS: BuildKecleonBrosYesNoMenu(); gFormatData_202DE30 = sKecleonBrosWork1->inventoryItemSellPrice; - sub_8019E04(FALSE); - sub_8014248(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_10], 0, 5, sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->unkE4, 12); + SetKecleonPortraitSpriteId(FALSE); + CreateMenuDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_10], 0, 5, sKecleonBrosWork1->menuItems, NULL, 4, 0, sKecleonBrosWork1->monPortraitPtr, 12); break; case KECLEON_STORE_SELL_ALL_ITEMS_RECEIPT: sKecleonBrosWork1->fallbackState = KECLEON_STORE_MAIN_MENU; - sub_8019E04(FALSE); - xxx_info_box_80141B4(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_11], 0, sKecleonBrosWork1->unkE4, 0x10D); + SetKecleonPortraitSpriteId(FALSE); + CreateDialogueBoxAndPortrait(gCommonKecleonBros[sKecleonBrosWork1->mode][KECLEON_DLG_11], 0, sKecleonBrosWork1->monPortraitPtr, 0x10D); break; } } @@ -895,18 +895,18 @@ static void KecleonCalcSellPriceForAllItems(void) } } -static void sub_8019E04(bool32 a0) +static void SetKecleonPortraitSpriteId(bool32 angrySprite) { if (sKecleonBrosWork1->isKecleonItemShop) { - if (a0 == TRUE) - sKecleonBrosWork1->unkE0 = 1; + if (angrySprite == TRUE) + sKecleonBrosWork1->monPortrait.spriteId = 1; else - sKecleonBrosWork1->unkE0 = 0; + sKecleonBrosWork1->monPortrait.spriteId = 0; } else { - if (a0 == TRUE) - sKecleonBrosWork1->unkE0 = 7; + if (angrySprite == TRUE) + sKecleonBrosWork1->monPortrait.spriteId = 7; else - sKecleonBrosWork1->unkE0 = 6; + sKecleonBrosWork1->monPortrait.spriteId = 6; } } diff --git a/src/luminous_cave.c b/src/luminous_cave.c index 1bbf9ae87..73063091e 100644 --- a/src/luminous_cave.c +++ b/src/luminous_cave.c @@ -225,24 +225,24 @@ static void UpdateLuminousCaveDialogue(void) sLuminousCaveWork->menuAction1 = LUMINOUS_CAVE_CANCEL; sub_8024CFC(); - sub_8014248(sSeekEvolutionIntro,0,sLuminousCaveWork->menuAction1,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); + CreateMenuDialogueBoxAndPortrait(sSeekEvolutionIntro,0,sLuminousCaveWork->menuAction1,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); break; case LUMINOUS_CAVE_ASK_EVOLVE: sub_8024CFC(); - sub_8014248(sSeekEvolutionPrompt,0,sLuminousCaveWork->menuAction1,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); + CreateMenuDialogueBoxAndPortrait(sSeekEvolutionPrompt,0,sLuminousCaveWork->menuAction1,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); break; case LUMINOUS_CAVE_EVOLVE_INFO: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_ASK_EVOLVE; - xxx_info_box_80141B4(sEvolveInfo,0,0,0x105); + CreateDialogueBoxAndPortrait(sEvolveInfo,0,0,0x105); break; case LUMINOUS_CAVE_SHALL_RETURN: sLuminousCaveWork->fallbackState = 4; xxx_call_fade_in_new_bgm(MUS_FILE_SELECT,0x3c); - xxx_info_box_80141B4(sYeShallReturn,0,0,0x305); + CreateDialogueBoxAndPortrait(sYeShallReturn,0,0,0x305); break; case LUMINOUS_CAVE_GIVE_ITEM_1: sub_8024D48(); - sub_8014248(sGiveItemPrompt,0,sLuminousCaveWork->menuAction2,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); + CreateMenuDialogueBoxAndPortrait(sGiveItemPrompt,0,sLuminousCaveWork->menuAction2,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); break; case 6: sub_801A5D8(2,3,NULL,10); @@ -252,7 +252,7 @@ static void UpdateLuminousCaveDialogue(void) break; case LUMINOUS_CAVE_GIVE_ITEM_2: sub_8024DBC(); - sub_8014248(sGiveAnotherItemPrompt,0,sLuminousCaveWork->menuAction2,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); + CreateMenuDialogueBoxAndPortrait(sGiveAnotherItemPrompt,0,sLuminousCaveWork->menuAction2,sLuminousCaveWork->unk34,sLuminousCaveWork->unk74,4,0,0,5); break; case 11: sub_801A5D8(2,3,NULL,10); @@ -277,11 +277,11 @@ static void UpdateLuminousCaveDialogue(void) break; case LUMINOUS_CAVE_LACK_WHAT_NEEDED: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_GIVE_ITEM_1; - xxx_info_box_80141B4(sLackWhatIsNeeded,0,0,0x105); + CreateDialogueBoxAndPortrait(sLackWhatIsNeeded,0,0,0x105); break; case LUMINOUS_CAVE_ONLY_ONE_ITEM: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_GIVE_ITEM_2; - xxx_info_box_80141B4(sOnlyOneItem,0,0,0x105); + CreateDialogueBoxAndPortrait(sOnlyOneItem,0,0,0x105); break; case LUMINOUS_CAVE_LET_US_BEGIN: sub_8025254(); @@ -303,13 +303,13 @@ static void UpdateLuminousCaveDialogue(void) else sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_CANT_EVOLVE_YET; xxx_call_fade_out_bgm(0x3c); - xxx_info_box_80141B4(sLetUsBegin,0,0,0x105); + CreateDialogueBoxAndPortrait(sLetUsBegin,0,0,0x105); break; case LUMINOUS_CAVE_CHANGED_APPEARANCE: PrintColoredPokeNameToBuffer(gPlayerName,sLuminousCaveWork->pokeStruct, COLOR_CYAN); PlaySound(0x1ff); sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_EVOLVED; - xxx_info_box_80141B4(sFmtChangedAppearance,0,0,0x105); + CreateDialogueBoxAndPortrait(sFmtChangedAppearance,0,0,0x105); break; case LUMINOUS_CAVE_EVOLVED: monName = GetMonSpecies(sLuminousCaveWork->pokeStruct->speciesNum); @@ -334,44 +334,44 @@ static void UpdateLuminousCaveDialogue(void) BoundedCopyStringtoBuffer(sLuminousCaveWork->pokeStruct->name,GetMonSpecies(sLuminousCaveWork->pokeStruct->speciesNum),POKEMON_NAME_LENGTH); } sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sFmtEvolved,0,0,0x105); + CreateDialogueBoxAndPortrait(sFmtEvolved,0,0,0x105); break; case LUMINOUS_CAVE_COME_ALONE: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sComeAlone,0,0,0x105); + CreateDialogueBoxAndPortrait(sComeAlone,0,0,0x105); break; case LUMINOUS_CAVE_LACK_LEVEL: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sLackLevel,0,0,0x105); + CreateDialogueBoxAndPortrait(sLackLevel,0,0,0x105); break; case LUMINOUS_CAVE_CANT_EVOLVE_ANYMORE: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sNoMoreEvolutions,0,0,0x105); + CreateDialogueBoxAndPortrait(sNoMoreEvolutions,0,0,0x105); break; case LUMINOUS_CAVE_LACK_FRIEND_AREA: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sLackFriendArea,0,0,0x105); + CreateDialogueBoxAndPortrait(sLackFriendArea,0,0,0x105); break; case LUMINOUS_CAVE_LACK_ROOM: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sLackFriendAreaRoom,0,0,0x105); + CreateDialogueBoxAndPortrait(sLackFriendAreaRoom,0,0,0x105); break; case LUMINOUS_CAVE_LACK_IQ: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sLackIQ,0,0,0x105); + CreateDialogueBoxAndPortrait(sLackIQ,0,0,0x105); break; case LUMINOUS_CAVE_LACK_ITEM: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sLackItem,0,0,0x105); + CreateDialogueBoxAndPortrait(sLackItem,0,0,0x105); break; case LUMINOUS_CAVE_CANT_EVOLVE_YET: sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_SHALL_RETURN; - xxx_info_box_80141B4(sCannotEvolveYet,0,0,0x105); + CreateDialogueBoxAndPortrait(sCannotEvolveYet,0,0,0x105); break; case LUMINOUS_CAVE_PROMPT_NAME: xxx_call_fade_in_new_bgm(8,0x3c); sLuminousCaveWork->fallbackState = LUMINOUS_CAVE_FINISH_NAME; - xxx_info_box_80141B4(sMustGiveName,0,0,0x105); + CreateDialogueBoxAndPortrait(sMustGiveName,0,0,0x105); break; case LUMINOUS_CAVE_FINISH_NAME: if (sLuminousCaveWork->pokeRenamed) { diff --git a/src/makuhita_dojo1.c b/src/makuhita_dojo1.c index b444678f4..4ca964159 100644 --- a/src/makuhita_dojo1.c +++ b/src/makuhita_dojo1.c @@ -90,9 +90,9 @@ bool8 MakuhitaDojo_New(u32 mode) } if (sMakuhitaDojoWork1->dlgMode == MAKUHITA_DOJO_MODE_ASLEEP) - sMakuhitaDojoWork1->unk68 = NULL; + sMakuhitaDojoWork1->monPortraitPtr = NULL; else - sMakuhitaDojoWork1->unk68 = &sMakuhitaDojoWork1->faceFile; + sMakuhitaDojoWork1->monPortraitPtr = &sMakuhitaDojoWork1->monPortrait; CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_MAKUHITA); CopyYellowMonsterNametoBuffer(gUnknown_202E1C8, MONSTER_MAKUHITA); @@ -100,13 +100,13 @@ bool8 MakuhitaDojo_New(u32 mode) strcpy(gUnknown_202E1C8 - 0x50, monName); faceFile = GetDialogueSpriteDataPtr(MONSTER_MAKUHITA); - sMakuhitaDojoWork1->faceFile = faceFile; - sMakuhitaDojoWork1->faceData = faceFile->data; - sMakuhitaDojoWork1->unk64 = 0; - sMakuhitaDojoWork1->unk65 = 0; - sMakuhitaDojoWork1->unk66 = 0; - sMakuhitaDojoWork1->unk60 = 2; - sMakuhitaDojoWork1->unk62 = 8; + sMakuhitaDojoWork1->monPortrait.faceFile = faceFile; + sMakuhitaDojoWork1->monPortrait.faceData = faceFile->data; + sMakuhitaDojoWork1->monPortrait.spriteId = 0; + sMakuhitaDojoWork1->monPortrait.flip = FALSE; + sMakuhitaDojoWork1->monPortrait.unkE = 0; + sMakuhitaDojoWork1->monPortrait.pos.x = 2; + sMakuhitaDojoWork1->monPortrait.pos.y = 8; MakuhitaDojo_SetState(initialState); return TRUE; } @@ -141,7 +141,7 @@ s16 sub_802FED0(void) void MakuhitaDojo_Delete(void) { if (sMakuhitaDojoWork1 != NULL) { - CloseFile(sMakuhitaDojoWork1->faceFile); + CloseFile(sMakuhitaDojoWork1->monPortrait.faceFile); MemoryFree(sMakuhitaDojoWork1); sMakuhitaDojoWork1 = NULL; } @@ -182,18 +182,18 @@ static void MakuhitaDojo_UpdateDialogue(void) switch (sMakuhitaDojoWork1->state) { case 0: MakuhitaDojo_DrawMainMenu(); - sub_8014248(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_0], 0, sMakuhitaDojoWork1->menuAction, sMakuhitaDojoWork1->unk18, NULL, 4, 0, sMakuhitaDojoWork1->unk68, 12); + CreateMenuDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_0], 0, sMakuhitaDojoWork1->menuAction, sMakuhitaDojoWork1->unk18, NULL, 4, 0, sMakuhitaDojoWork1->monPortraitPtr, 12); break; case 1: - sub_8014248(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_1], 0, sMakuhitaDojoWork1->menuAction, sMakuhitaDojoWork1->unk18, NULL, 4, 0, sMakuhitaDojoWork1->unk68, 12); + CreateMenuDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_1], 0, sMakuhitaDojoWork1->menuAction, sMakuhitaDojoWork1->unk18, NULL, 4, 0, sMakuhitaDojoWork1->monPortraitPtr, 12); break; case 2: sMakuhitaDojoWork1->fallbackState = 13; - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_2], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_2], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 3: sMakuhitaDojoWork1->fallbackState = 4; - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_3], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_3], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 4: sub_80302E8(3, NULL, 10); @@ -203,36 +203,36 @@ static void MakuhitaDojo_UpdateDialogue(void) dLoc.id = sub_80A2740(sMakuhitaDojoWork1->unk10); dLoc.floor = 1; PrintYellowDungeonNametoBuffer(gAvailablePokemonNames, &dLoc); - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_4], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_4], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 7: sMakuhitaDojoWork1->fallbackState = 13; - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_6], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_6], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 6: sMakuhitaDojoWork1->fallbackState = 13; - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_5], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_5], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 8: sMakuhitaDojoWork1->fallbackState = 9; - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_7], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_7], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 9: PrintColoredPokeNameToBuffer(gPlayerName, GetPlayerPokemonStruct(), COLOR_YELLOW); sMakuhitaDojoWork1->fallbackState = 11; PlaySound(203); - xxx_info_box_80141B4(sReceivedBonslyDoll, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sReceivedBonslyDoll, 0, 0, 0x101); break; case 10: sMakuhitaDojoWork1->fallbackState = 13; - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_8], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_8], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 11: sub_801B60C(1, ITEM_GINSENG, 1); break; case 12: sMakuhitaDojoWork1->fallbackState = 1; - xxx_info_box_80141B4(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_9], 0, sMakuhitaDojoWork1->unk68, 0x10D); + CreateDialogueBoxAndPortrait(gCommonMakuhita[sMakuhitaDojoWork1->dlgMode][MAKUHITA_DLG_9], 0, sMakuhitaDojoWork1->monPortraitPtr, 0x10D); break; case 13: return; @@ -291,7 +291,7 @@ static void sub_8030258(void) sMakuhitaDojoWork1->unk10 = sub_8030418(); sub_8030480(); MakuhitaDojo_SetState(5); - break; + break; case 2: sub_8030480(); sMakuhitaDojoWork1->unk10 = -1; diff --git a/src/menu_input.c b/src/menu_input.c index 397d9b541..5b8333d39 100644 --- a/src/menu_input.c +++ b/src/menu_input.c @@ -77,7 +77,7 @@ u32 sub_8012A64(MenuInputStructSub *r0, s32 r1) return sub_8012AE8(); if (r1 != -1) - nullsub_34(r0); + nullsub_34(r0, r1); if (r0->a_button != 0) { r0->a_button = 0; @@ -712,7 +712,7 @@ void AddMenuCursorSprite_(MenuInputStruct *a0, u8 *a1) a0->unk24++; } -void nullsub_34(MenuInputStructSub *a0) +void nullsub_34(MenuInputStructSub *a0, s32 a1) { } diff --git a/src/mission_reward.c b/src/mission_reward.c index 24d8c7810..7f63abeaf 100644 --- a/src/mission_reward.c +++ b/src/mission_reward.c @@ -23,13 +23,7 @@ struct unkStruct_203B310 /* 0x9 */ u8 currTeamRank; // team rank /* 0xC */ s32 itemRewardIndex; unkStruct_802F204 *unk10; - /* 0x14 */ OpenedFile *faceFile; - /* 0x18 */ u8 *faceData; - s16 unk1C; - s16 unk1E; - u8 unk20; - u8 unk21; - u8 unk22; + /* 0x14 */ struct MonPortraitMsg monPortrait; UnkTextStruct2 unk24[4]; }; @@ -138,18 +132,18 @@ u32 sub_802F204(unkStruct_802F204 *r0, bool8 displayClientSprite) strcpy(gUnknown_202E5D8, preload->unk10->clientName); PrintPokeNameToBuffer(gAvailablePokemonNames, GetPlayerPokemonStruct()); - gUnknown_203B310->faceFile = GetDialogueSpriteDataPtr(gUnknown_203B310->unk10->clientSpecies); - gUnknown_203B310->faceData = NULL; + gUnknown_203B310->monPortrait.faceFile = GetDialogueSpriteDataPtr(gUnknown_203B310->unk10->clientSpecies); + gUnknown_203B310->monPortrait.faceData = NULL; - gUnknown_203B310->unk20 = 0; - gUnknown_203B310->unk21 = 0; - gUnknown_203B310->unk22 = 0; - gUnknown_203B310->unk1C = 2; - gUnknown_203B310->unk1E = 8; + gUnknown_203B310->monPortrait.spriteId = 0; + gUnknown_203B310->monPortrait.flip = FALSE; + gUnknown_203B310->monPortrait.unkE = 0; + gUnknown_203B310->monPortrait.pos.x = 2; + gUnknown_203B310->monPortrait.pos.y = 8; - if(gUnknown_203B310->faceFile != NULL) + if(gUnknown_203B310->monPortrait.faceFile != NULL) { - gUnknown_203B310->faceData = gUnknown_203B310->faceFile->data; + gUnknown_203B310->monPortrait.faceData = gUnknown_203B310->monPortrait.faceFile->data; } SetRewardSceneState(PREP_MONEY_REWARD); @@ -175,8 +169,8 @@ void sub_802F2C0(void) { if(gUnknown_203B310 != NULL) { - if(gUnknown_203B310->faceFile != 0) - CloseFile(gUnknown_203B310->faceFile); + if(gUnknown_203B310->monPortrait.faceFile != 0) + CloseFile(gUnknown_203B310->monPortrait.faceFile); MemoryFree(gUnknown_203B310); gUnknown_203B310 = NULL; } @@ -214,7 +208,7 @@ void HandleMissionReward(void) u8 itemID; struct unkStruct_8090F58 local_20; Item item; - + switch(gUnknown_203B310->state) { case PREP_MONEY_REWARD: moneyReward = gUnknown_203B310->unk10->moneyReward; @@ -224,7 +218,7 @@ void HandleMissionReward(void) else { gFormatData_202DE30 = moneyReward; if (gUnknown_203B310->displayClientDialogueSprite) { - xxx_info_box_80141B4(gUnknown_80E0434,0,&gUnknown_203B310->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80E0434,0,&gUnknown_203B310->monPortrait,0x10d); gUnknown_203B310->nextState = MONEY_REWARD; } else { @@ -236,10 +230,10 @@ void HandleMissionReward(void) PlaySound(0xcb); AddToTeamMoney(gUnknown_203B310->unk10->moneyReward); if (GetUnitSum_808D544(0) < 2) { - xxx_info_box_80141B4(gUnknown_80E045C,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E045C,0,0,0x101); } else { - xxx_info_box_80141B4(gUnknown_80E0484,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E0484,0,0,0x101); } gUnknown_203B310->nextState = PREP_FRIEND_AREA_REWARD; break; @@ -250,7 +244,7 @@ void HandleMissionReward(void) else { WriteFriendAreaName(gUnknown_202E628,gUnknown_203B310->unk10->friendAreaReward,FALSE); if (gUnknown_203B310->displayClientDialogueSprite) { - xxx_info_box_80141B4(gUnknown_80E04B4,0,&gUnknown_203B310->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80E04B4,0,&gUnknown_203B310->monPortrait,0x10d); gUnknown_203B310->nextState = UNLOCK_FRIEND_AREA; } else { @@ -262,27 +256,27 @@ void HandleMissionReward(void) if (GetFriendAreaStatus(gUnknown_203B310->unk10->friendAreaReward)) { // We already have the friend area AddToTeamMoney(1000); - xxx_info_box_80141B4(gUnknown_80E04F4,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E04F4,0,0,0x101); } else { if (GetUnitSum_808D544(0) < 2) { UnlockFriendArea(gUnknown_203B310->unk10->friendAreaReward); PlaySound(0xce); - xxx_info_box_80141B4(gUnknown_80E05C0,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E05C0,0,0,0x101); } else { UnlockFriendArea(gUnknown_203B310->unk10->friendAreaReward); PlaySound(0xce); - xxx_info_box_80141B4(gUnknown_80E05FC,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E05FC,0,0,0x101); } } gUnknown_203B310->nextState = PREP_ITEM_REWARD; break; case PREP_ITEM_REWARD: itemID = gUnknown_203B310->unk10->itemRewards[0]; - if (itemID != ITEM_NOTHING) + if (itemID != ITEM_NOTHING) { if (gUnknown_203B310->unk10->moneyReward == 0) { item.id = itemID; @@ -298,7 +292,7 @@ void HandleMissionReward(void) local_20.unk8 = 1; sub_8090E14(gUnknown_202DEA8,&item,&local_20); if (gUnknown_203B310->displayClientDialogueSprite) { - xxx_info_box_80141B4(gUnknown_80E0640,0,&gUnknown_203B310->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80E0640,0,&gUnknown_203B310->monPortrait,0x10d); gUnknown_203B310->nextState = GIVE_ITEM_REWARD; } else @@ -349,7 +343,7 @@ void HandleMissionReward(void) gUnknown_203B310->nextState = REWARD_EXIT; } gFormatData_202DE30 = gUnknown_203B310->unk10->teamRankPtsReward; - xxx_info_box_80141B4(gUnknown_80E0670,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E0670,0,0,0x101); } break; case NEW_TEAM_RANK: @@ -359,7 +353,7 @@ void HandleMissionReward(void) strcpy(gUnknown_202E038,rankString); rankString = GetTeamRankString(GetRescueTeamRank()); strcpy(gUnknown_202E038 + 0x50,rankString); - xxx_info_box_80141B4(gUnknown_80E06A8,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E06A8,0,0,0x101); break; case REWARD_EXIT: break; diff --git a/src/move_actions.c b/src/move_actions.c index f2ddcc38e..f5824575a 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -14,6 +14,7 @@ #include "dungeon_ai_targeting.h" #include "dungeon_items.h" #include "dungeon_map_access.h" +#include "dungeon_message.h" #include "dungeon_movement.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" @@ -30,17 +31,7 @@ #include "structs/str_dungeon.h" #include "tile_types.h" #include "weather.h" - -typedef bool8 (*MoveCallback)(Entity *pokemon, Entity *target, Move *move, s32 param_4); -struct NaturePowerMove -{ - u16 moveID; - u16 unk2; - MoveCallback move; -}; - -extern struct NaturePowerMove gNaturePowerMoveTable[10]; - +#include "called_move_data.h" extern u8 gFormatItems[]; extern u8 gAvailablePokemonNames[]; @@ -212,7 +203,6 @@ extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 extern void nullsub_92(Entity *); extern u32 sub_8055864(Entity *pokemon, Entity *target, Move *param_3, s32 param_4, s32 param_5); extern u8 sub_807EAA0(u32, u32); -extern void sub_80522F4(Entity *r1, Entity *r2, const char[]); extern s32 sub_80556BC(Entity *, Entity *, u8, Move *, u32, u32); // move_util.h @@ -221,7 +211,7 @@ bool8 sub_8057308(Entity *pokemon, s32 chance); bool8 sub_80571F0(Entity * pokemon, Move *move); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); -extern u32 sub_8055640(Entity *, Entity *, Move *, u32, u32); +extern u32 HandleDamagingMove(Entity *, Entity *, Move *, u32, u32); u8 sub_8057620(u32 param_1); extern s16 sub_8094828(u16, u8); extern void DealDamageToEntity(Entity *, s32, u32, u32); @@ -229,65 +219,6 @@ extern void DealDamageToEntity(Entity *, s32, u32, u32); extern s16 gUnknown_80F4DB4; extern u32 gUnknown_8106A4C; -// TODO: WTF are these loops? https://decomp.me/scratch/svYTQ -void sub_80574C4(s32 *a0, s32 a1) -{ - s32 r2; - s32 r3; - s32 temp; - s32 buffer[0x41]; - - r3 = 0; - r2 = 0; - if (a0[0] != 0) { - if (a0[0] == a1) - goto continue1; -itsmol1: - buffer[r3] = a0[r2]; - r3++; -continue1: - r2++; - if (r2 >= 0x41) - goto break1; - if (a0[r2] == 0) - goto break1; - if (a0[r2] == a1) - goto continue1; - if (r3 < 0x40) - goto itsmol1; - } -break1: - - r2 = 0; - temp = a0[r2]; - goto for2; -itsmol2: - buffer[r3] = a0[r2]; - r3++; -continue2: - r2++; - if (r2 > 0x40) - goto break2; - temp = a0[r2]; -for2: - if (temp == 0) - goto break2; - if (temp != a1) - goto continue2; - if (r3 < 0x40) - goto itsmol2; -break2: - - while (r3 < 0x41) { - buffer[r3] = 0; - r3++; - } - - for (r2 = 0; r2 < 0x41; r2++) { - a0[r2] = buffer[r2]; - } -} - bool8 sub_805755C(Entity* pokemon, u16 moveID) { if ((moveID == MOVE_SOLARBEAM) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { @@ -352,7 +283,7 @@ bool8 sub_8057634(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon, target, gUnknown_80F4DB4)) { LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, FALSE); @@ -368,7 +299,7 @@ bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4) flag = FALSE; gUnknown_202F21C++; - if (sub_8055640(pokemon, target, move, gUnknown_8106A54[gUnknown_202F21C], param_4) == 0) + if (HandleDamagingMove(pokemon, target, move, gUnknown_8106A54[gUnknown_202F21C], param_4) == 0) gUnknown_202F220 = 1; else flag = TRUE; @@ -413,11 +344,11 @@ bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) flag = FALSE; tile = GetTileAtEntitySafe(pokemon); if ((!IsTileGround(tile)) || ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != 1)) { - sub_80522F4(pokemon,target,*gUnknown_80FD14C); // It can only be used on land! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD14C); // It can only be used on land! } else { if (MoveMatchesChargingStatus(pokemon,move)) { - sub_8055640(pokemon,target,move,gUnknown_80F4F68,param_4); + HandleDamagingMove(pokemon,target,move,gUnknown_80F4F68,param_4); sub_8079764(pokemon); } else { @@ -445,7 +376,7 @@ bool32 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para gDungeon->weather.unkE267[WEATHER_RAIN] = gUnknown_80F4F42; if (sub_807EAA0(1,0) == 0) { // The weather remains unchanged - sub_80522F4(pokemon,target,*gUnknown_80FCF74); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCF74); } return TRUE; } @@ -455,7 +386,7 @@ bool32 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) gDungeon->weather.unkE267[WEATHER_HAIL]= gUnknown_80F4F42; if (sub_807EAA0(1,0) == 0) { // The weather remains unchanged - sub_80522F4(pokemon,target,*gUnknown_80FCF80); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCF80); } return TRUE; } @@ -471,7 +402,7 @@ bool32 sub_80578FC(Entity *pokemon, Entity *target, Move * move, u32 param_4) bool32 flag; flag = FALSE; - if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target, gUnknown_80F4DB6)) { LowerMovementSpeedTarget(pokemon, target, 1, FALSE); @@ -507,7 +438,7 @@ bool32 sub_8057974(Entity *pokemon, Entity *target, Move *move, u32 param_4) else { // The target's HP can't be halved anymore - sub_80522F4(pokemon,target,*gUnknown_80FD018); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD018); } return local_24; } @@ -531,7 +462,7 @@ bool8 PainSplitMoveAction(Entity *attacker, Entity *target, Move *move, s32 para SetExpMultplier(attackerInfo); // $m0 and $m1 shared their HP - sub_80522F4(attacker,target,*gUnknown_80FC7EC); + TryDisplayDungeonLoggableMessage3(attacker,target,*gUnknown_80FC7EC); return TRUE; } @@ -554,7 +485,7 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 if ((movePtr->moveFlags & MOVE_FLAG_LAST_USED) != 0) { sub_80928C0(gFormatItems,movePtr,0); // $i0 was tormented - sub_80522F4(pokemon,target,*gUnknown_80FCFBC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCFBC); movePtr->moveFlags |= MOVE_FLAG_DISABLED; isTormented = TRUE; } @@ -572,7 +503,7 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 isTormented = TRUE; sub_80928C0(gFormatItems,&struggleMove,0); // $i0 was tormented - sub_80522F4(pokemon,target,*gUnknown_80FCFBC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCFBC); } } else if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) { @@ -587,7 +518,7 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 else { // The target couldn't be tormented - sub_80522F4(pokemon,target,*gUnknown_80FCFE4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCFE4); } return isTormented; } @@ -611,7 +542,7 @@ bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) flag = FALSE; if (IsSleeping(pokemon)) { - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4E0A)) { CringeStatusTarget(pokemon,target,FALSE); @@ -619,7 +550,7 @@ bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) } } else { - sub_80522F4(pokemon,target,*gUnknown_80FC734); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC734); } return flag; } @@ -635,7 +566,7 @@ bool8 sub_8057C88(Entity *pokemon, Entity *target, Move * move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4DF6)) { CringeStatusTarget(pokemon,target,FALSE); @@ -670,7 +601,7 @@ bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa if (chargeStatus == STATUS_DIVING) { uVar3 = 0x200; } - if (sub_8055640(pokemon,target,move,uVar3,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,uVar3,param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4E08)) { SqueezedStatusTarget(pokemon,target,0x3b,FALSE); @@ -701,10 +632,10 @@ bool8 sub_8057D9C(Entity * pokemon, Entity * target, Move *move, s32 param_4) SetMessageArgument(gUnknown_202DFE8, target, 0); if (flag) { - sub_80522F4(pokemon, target, gUnknown_80FD350); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD350); } else { - sub_80522F4(pokemon, target, gUnknown_80FD370); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD370); } return flag; @@ -737,7 +668,7 @@ bool8 sub_8057E6C(Entity *pokemon, Entity *target, Move *move, u32 param_4) flag = FALSE; entityInfo = pokemon->info; SendThawedMessage(pokemon,target); - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if (sub_8057308(pokemon, 0)) { entityInfo->unk155 = 1; @@ -751,7 +682,7 @@ bool8 sub_8057ED0(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4E04)) { @@ -778,7 +709,7 @@ bool8 sub_8057F7C(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4E02)) { @@ -805,10 +736,10 @@ bool8 sub_8057FF4(Entity *pokemon, Entity *target, Move *move, s32 param_4) target->info->unk152 = 1; SetMessageArgument(gUnknown_202DFE8,target,0); if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { - sub_80522F4(pokemon,target,*gUnknown_80FAE00); // Fire moves won't become stronger + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE00); // Fire moves won't become stronger } else { - sub_80522F4(pokemon,target,*gUnknown_80FADD8); // $m0 used flash fire to absorb fire + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FADD8); // $m0 used flash fire to absorb fire } } } @@ -857,12 +788,12 @@ bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4 entityInfo = target->info; SetMessageArgument(gUnknown_202DFE8,target,0); if (entityInfo->grudge) { - sub_80522F4(pokemon,target,*gUnknown_80FD2B4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD2B4); } else { entityInfo->grudge = TRUE; hasGrudge = TRUE; - sub_80522F4(pokemon,target,*gUnknown_80FD294); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD294); } return hasGrudge; } @@ -879,7 +810,7 @@ bool8 sub_805816C(Entity *pokemon, Entity *target, Move *move, u32 param_4) flag = FALSE; SendThawedMessage(pokemon, target); - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DB8)) { @@ -895,7 +826,7 @@ bool8 sub_80581D0(Entity *pokemon, Entity *target, Move *move, u32 param_4) flag = FALSE; SendThawedMessage(pokemon, target); - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DBA)) { @@ -927,7 +858,7 @@ bool8 sub_8058270(Entity *pokemon, Entity *target, Move *move, u32 param_4) r3 = 1; if((u8)(target->info->charging.chargingStatus - 7) <= 1) r3 = 2; - flag = sub_8055640(pokemon,target,move,r3 << 8,param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,r3 << 8,param_4) ? TRUE : FALSE; return flag; } @@ -954,7 +885,7 @@ bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa bool8 flag; if (MoveMatchesChargingStatus(pokemon,move)) { - flag = sub_8055640(pokemon,target,move,gUnknown_80F4F50,param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F50,param_4) ? TRUE : FALSE; sub_8079764(pokemon); } else { @@ -991,7 +922,7 @@ bool8 sub_80583D8(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DC2)) { @@ -1006,7 +937,7 @@ bool8 sub_8058430(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DEE)) { @@ -1021,7 +952,7 @@ bool8 sub_8058478(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DE6)) { @@ -1060,7 +991,7 @@ bool8 sub_8058548(Entity *pokemon, Entity *target, Move *move, u32 param_4) r5 = 0x80 << 1; if((pokemon->info->nonVolatile.nonVolatileStatus) != STATUS_NONE) r5 = gUnknown_80F4F6C; - flag = sub_8055640(pokemon,target,move,r5,param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,r5,param_4) ? TRUE : FALSE; return flag; } @@ -1069,7 +1000,7 @@ bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DD4)) { @@ -1085,12 +1016,12 @@ bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para flag = FALSE; if ((target->info->protection.protectionStatus == STATUS_REFLECT) || (target->info->protection.protectionStatus == STATUS_LIGHT_SCREEN)) { - sub_80522F4(pokemon,target,*gUnknown_80FD104); // The barrier was shattered + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD104); // The barrier was shattered SendProtectionEndMessage(pokemon,target); flag = TRUE; } - flag |= (sub_8055640(pokemon,target,move,0x100,param_4) != 0); + flag |= (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0); return flag; } @@ -1099,7 +1030,7 @@ bool8 sub_8058638(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, 0)) { @@ -1114,7 +1045,7 @@ bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 p bool8 flag; if (MoveMatchesChargingStatus(pokemon,move)) { - flag = sub_8055640(pokemon,target,move,gUnknown_80F4F54,param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F54,param_4) ? TRUE : FALSE; sub_8079764(pokemon); } else { @@ -1133,7 +1064,7 @@ bool8 sub_80586DC(Entity * pokemon, Entity * target, Move * move, u32 param_4) EntityInfo *entityInfo; hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE); - uVar3 = sub_8055640(pokemon,target,move,0x100,param_4); + uVar3 = HandleDamagingMove(pokemon,target,move,0x100,param_4); flag = uVar3 != 0 ? TRUE : FALSE; if (flag && sub_8057308(pokemon, 0)) { newHP = uVar3 / 2; @@ -1174,7 +1105,7 @@ bool8 sub_8058770(Entity * pokemon, Entity * target, Move * move, u32 param_4) index = 3; } - flag = sub_8055640(pokemon,target,move,gUnknown_80F51A4[index],param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F51A4[index],param_4) ? TRUE : FALSE; return flag; } @@ -1183,11 +1114,11 @@ bool8 sub_80587E8(Entity * pokemon, Entity * target, Move * move, u32 param_4) bool8 flag; if (target->info->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { - flag = sub_8055640(pokemon,target,move,0x80 << 2,param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,0x80 << 2,param_4) ? TRUE : FALSE; SendNonVolatileEndMessage(pokemon, target); } else { - flag = sub_8055640(pokemon,target,move,0x80 << 1,param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,0x80 << 1,param_4) ? TRUE : FALSE; } return flag; } @@ -1221,7 +1152,7 @@ bool8 sub_80588A8(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 sub_80588B8(Entity *pokemon, Entity *target, Move *move, u32 param_4) { bool8 flag = FALSE; - if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0) + if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; if(sub_8057308(pokemon, 0)) @@ -1237,7 +1168,7 @@ bool8 sub_80588F4(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; EntityInfo *entityInfo = target->info; - flag = sub_8055640(pokemon, target, move, GetWeight(entityInfo->apparentID), param_4) != 0 ? TRUE: FALSE; + flag = HandleDamagingMove(pokemon, target, move, GetWeight(entityInfo->apparentID), param_4) != 0 ? TRUE: FALSE; return flag; } @@ -1248,7 +1179,7 @@ bool8 sub_8058930(Entity *pokemon, Entity *target, Move *move, u32 param_4) EntityInfo *entityInfo; s32 index1; s32 index2; - if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0) + if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; if(sub_8057308(pokemon, gUnknown_80F4DD6)) @@ -1282,7 +1213,7 @@ bool8 sub_8058A08(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 sub_8058A18(Entity *pokemon, Entity *target, Move *move, u32 param_4) { bool8 flag = FALSE; - if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0) + if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; if(sub_8057308(pokemon, 0)) @@ -1312,7 +1243,7 @@ bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param if(MoveMatchesChargingStatus(pokemon, move)) { - if (sub_8055640(pokemon, target, move, gUnknown_80F4F4C, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, gUnknown_80F4F4C, param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DF4)) CringeStatusTarget(pokemon, target, FALSE); @@ -1331,7 +1262,7 @@ bool8 sub_8058B3C(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DBC)) { @@ -1347,7 +1278,7 @@ bool8 sub_8058B84(Entity *pokemon, Entity *target, Move *move, u32 param_4) EntityInfo *entityInfo; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, pokemon, gUnknown_80F4DD0)) { @@ -1376,7 +1307,7 @@ bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DF8)) { @@ -1408,7 +1339,7 @@ bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_5) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_5) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DC0)) { @@ -1421,7 +1352,7 @@ bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 bool8 sub_8058CEC(Entity *pokemon, Entity *target, Move *move, u32 param_4) { bool8 flag = FALSE; - if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0) + if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; if(sub_8057308(pokemon, 0)) @@ -1459,7 +1390,7 @@ bool8 sub_8058D44(Entity * pokemon, Entity * target, Move * move, u32 param_4) index = 3; } - flag = sub_8055640(pokemon,target,move,gUnknown_80F51B4[index],param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F51B4[index],param_4) ? TRUE : FALSE; return flag; } @@ -1483,7 +1414,7 @@ bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 para iVar4->defensiveMultipliers[index] = iVar3->defensiveMultipliers[index]; } SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FBD58); // It psyched itself up! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD58); // It psyched itself up! SetExpMultplier(iVar4); return TRUE; } @@ -1495,7 +1426,7 @@ bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 flag; flag = FALSE; - if ((sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0) && (EntityExists(pokemon))) { + if ((HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) && (EntityExists(pokemon))) { iVar2 = pokemon->info->maxHPStat; if (iVar2 < 0) { iVar2 = iVar2 + 7; @@ -1531,7 +1462,7 @@ bool32 sub_8058F04(Entity *pokemon, Entity *target, Move *move, s32 param_4) if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { iVar3 = 2; } - flag = sub_8055640(pokemon,target,move,iVar3 << 8,param_4); + flag = HandleDamagingMove(pokemon,target,move,iVar3 << 8,param_4); if (flag != 0) { flag = TRUE; } @@ -1551,8 +1482,8 @@ bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 par if (0x4a < tileset) { tileset = 0x4a; } - InitPokemonMove(&natureMove, gNaturePowerMoveTable[tileset].moveID); - flag = gNaturePowerMoveTable[tileset].move(pokemon,target,&natureMove,param_4); + InitPokemonMove(&natureMove, gNaturePowerCalledMoves[tileset].moveID); + flag = gNaturePowerCalledMoves[tileset].callback(pokemon,target,&natureMove,param_4); return flag; } @@ -1561,7 +1492,7 @@ bool8 sub_8058FBC(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DE4)) { @@ -1594,7 +1525,7 @@ bool8 sub_8059080(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DE8)) { @@ -1625,7 +1556,7 @@ bool8 sub_80590D4(Entity *pokemon, Entity *target, Move *move, s32 param_4) uVar5 = FALSE; } if (!uVar5) { - sub_80522F4(pokemon,target,*gUnknown_80FEB88); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB88); } else { sub_806F370(pokemon,target,9999,1,&flag,GetMoveType(move),sub_8057600(move,param_4),0,1,1); @@ -1639,7 +1570,7 @@ bool8 sub_8059190(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DEA)) { @@ -1664,7 +1595,7 @@ bool8 sub_80591E4(Entity *pokemon, Entity *target, Move *move, s32 param_4) flag = FALSE; hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE); - iVar3 = sub_8055640(pokemon,target,move,0x100,param_4); + iVar3 = HandleDamagingMove(pokemon,target,move,0x100,param_4); if (iVar3 != 0) { iVar4 = iVar3 / 2; if (iVar4 < 1) { @@ -1694,7 +1625,7 @@ bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param EntityInfo *pokeEntityData = GetEntInfo(pokemon); EntityInfo *targetEntityInfo = GetEntInfo(target); if ((HasAbility(target, ABILITY_WONDER_GUARD)) || (HasAbility(pokemon, ABILITY_WONDER_GUARD))) { - sub_80522F4(pokemon,target,*gUnknown_80FC8C0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC8C0); flag = FALSE; } else @@ -1706,7 +1637,7 @@ bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param pokeEntityData->abilities[0] = ability1; pokeEntityData->abilities[1] = ability2; gDungeon->unkC = 1; - sub_80522F4(pokemon,target,*gUnknown_80FC888); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC888); // Weirdly enough SetExpMultplier inline doesn't work here... if (pokeEntityData->expMultiplier == EXP_HALVED) { pokeEntityData->expMultiplier = EXP_REGULAR; @@ -1736,19 +1667,19 @@ bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 } if (!moveFound) { - sub_80522F4(pokemon, target, *gUnknown_80FE3BC); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FE3BC); return FALSE; } if (moveId == MOVE_NOTHING) { - sub_80522F4(pokemon, target, *gUnknown_80FE3BC); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FE3BC); } else { InitPokemonMove(move, moveId); sub_80928C0(gFormatItems, move, 0); move->moveFlags2 |= MOVE_FLAG2_UNK4; move->moveFlags2 |= MOVE_FLAG_REPLACE; - sub_80522F4(pokemon, target, *gUnknown_80FE38C); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FE38C); ASM_MATCH_TRICK(pokeInfo); SetExpMultplier(pokeInfo); ret = TRUE; @@ -1762,7 +1693,7 @@ bool8 sub_8059424(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DF0)) { @@ -1778,7 +1709,7 @@ bool8 sub_805946C(Entity * pokemon,Entity * target,Move * move,u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && (sub_8057308(pokemon,0) != 0)) { HP = pokemon->info->maxHPStat; @@ -1801,7 +1732,7 @@ bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param gDungeon->weather.unkE267[WEATHER_SANDSTORM] = gUnknown_80F4F42; if(sub_807EAA0(1, 0) == 0) { - sub_80522F4(pokemon, target, *gUnknown_80FCF78); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FCF78); } return TRUE; } @@ -1817,7 +1748,7 @@ bool8 sub_8059540(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DC4)) { @@ -1838,7 +1769,7 @@ bool8 sub_80595A0(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DE0)) { @@ -1855,7 +1786,7 @@ bool8 sub_80595EC(Entity * pokemon,Entity * target,Move * move,u32 param_4) local_20 = 0; if (sub_806F4A4(target,GetMoveType(move)) == 0) { - sub_80522F4(pokemon,target,*gUnknown_80FEB8C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB8C); return FALSE; } else { @@ -1878,7 +1809,7 @@ bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param if (((weather == WEATHER_SANDSTORM) || (weather == WEATHER_RAIN)) || weather == WEATHER_HAIL) { movePower /= 2; } - weather = sub_8055640(pokemon,target,move,movePower,param_4) != 0 ? TRUE : FALSE; + weather = HandleDamagingMove(pokemon,target,move,movePower,param_4) != 0 ? TRUE : FALSE; sub_8079764(pokemon); } else { @@ -1904,7 +1835,7 @@ bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) flag = FALSE; if (MoveMatchesChargingStatus(pokemon,move)) { - flag = sub_8055640(pokemon,target,move,gUnknown_80F4F5C,param_4) != 0 ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F5C,param_4) != 0 ? TRUE : FALSE; sub_8079764(pokemon); } else { @@ -1926,10 +1857,10 @@ bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4 flag = FALSE; if (IsTileGround(GetTileAtEntitySafe(pokemon))) { - sub_80522F4(pokemon,target,*gUnknown_80FD128); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD128); } else if (MoveMatchesChargingStatus(pokemon,move)) { - flag = sub_8055640(pokemon,target,move,gUnknown_80F4F64,param_4) != 0 ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F64,param_4) != 0 ? TRUE : FALSE; sub_8079764(pokemon); } else { @@ -1944,7 +1875,7 @@ bool8 sub_80598CC(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4E00)) { @@ -1970,7 +1901,7 @@ bool8 sub_8059928(Entity * pokemon,Entity * target,Move * move,u32 param_4) if ((u8)(target->info->charging.chargingStatus - 7) <= 1){ iVar2 = 2; } - if (sub_8055640(pokemon,target,move,iVar2 << 8,param_4) != 0) + if (HandleDamagingMove(pokemon,target,move,iVar2 << 8,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon,target,gUnknown_80F4DEC) != 0) { @@ -1985,7 +1916,7 @@ bool8 sub_8059988(Entity * pokemon,Entity * target,Move * move,u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; gUnknown_202F218 = 1; } @@ -2049,7 +1980,7 @@ bool8 sub_8059AF8(Entity * pokemon,Entity * target,Move * move,u32 param_4) local_20 = 0; if (sub_806F4A4(target,GetMoveType(move)) == 0) { - sub_80522F4(pokemon,target,*gUnknown_80FEB90); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB90); return FALSE; } else { @@ -2078,7 +2009,7 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para counter = 0; info = target->info; if (HasAbility(target, ABILITY_FORECAST)) { - sub_80522F4(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); return FALSE; } else @@ -2092,7 +2023,7 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para } } if (counter == 0) { - sub_80522F4(pokemon,target,*gUnknown_80FE36C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE36C); return FALSE; } else @@ -2103,7 +2034,7 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para info->types[1] = TYPE_NONE; info->isColorChanged = TRUE; sub_80928C0(gFormatItems, moveStack[newIndex], NULL); - sub_80522F4(pokemon,target,*gUnknown_80FE330); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE330); return TRUE; } } @@ -2121,7 +2052,7 @@ bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, u32 par flag = FALSE; if(pokemon == target) { - sub_80522F4(target, target, *gUnknown_80FEB60); + TryDisplayDungeonLoggableMessage3(target, target, *gUnknown_80FEB60); } else { RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1); @@ -2148,7 +2079,7 @@ bool8 sub_8059D00(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DE2)) { @@ -2169,7 +2100,7 @@ bool8 sub_8059D58(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, 0)) { @@ -2202,7 +2133,7 @@ bool8 sub_8059DC4(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DCA)) { @@ -2217,7 +2148,7 @@ bool8 sub_8059E0C(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DBE)) { @@ -2238,7 +2169,7 @@ bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa flag = FALSE; if (param_5 == 0) { - flag = sub_8055640(pokemon,target,move,0x100,param_4) != 0 ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0 ? TRUE : FALSE; } if (!flag) { moveType = GetMoveTypeForMonster(pokemon,move); @@ -2246,7 +2177,7 @@ bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa moveCritChance = GetMoveCritChance(move); sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0); SetMessageArgument_2(gAvailablePokemonNames,pokemon->info,0); - sub_80522F4(pokemon,target,*gUnknown_80FC7C8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8); local_30[0] = local_30[0] / 2; if (local_30[0] == 0) { local_30[0] = 1; @@ -2262,7 +2193,7 @@ bool8 sub_8059F38(Entity * pokemon,Entity * target,Move * move,u32 param_4) flag = FALSE; if (MoveMatchesChargingStatus(pokemon, move)) { - if (sub_8055640(pokemon, target, move, gUnknown_80F4F60, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, gUnknown_80F4F60, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon, target, gUnknown_80F4DCC) != 0) { ParalyzeStatusTarget(pokemon, target, FALSE); @@ -2288,7 +2219,7 @@ bool8 sub_8059FC8(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa flag = FALSE; if (param_5 == 0) { - flag = sub_8055640(pokemon,target,move,0x200,param_4) != 0 ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,0x200,param_4) != 0 ? TRUE : FALSE; } if (!flag) { moveType = GetMoveTypeForMonster(pokemon,move); @@ -2296,7 +2227,7 @@ bool8 sub_8059FC8(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa moveCritChance = GetMoveCritChance(move); sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0); SetMessageArgument_2(gAvailablePokemonNames,pokemon->info,0); - sub_80522F4(pokemon,target,*gUnknown_80FC7C8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8); local_30[0] = local_30[0] / 2; if (local_30[0] == 0) { local_30[0] = 1; @@ -2311,7 +2242,7 @@ bool8 TriAttackMoveAction(Entity * pokemon, Entity * target, Move *move, u32 par bool8 flag; flag = FALSE; - if(sub_8055640(pokemon, target, move, 0x100, param_4)) + if(HandleDamagingMove(pokemon, target, move, 0x100, param_4)) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DFC)) @@ -2354,11 +2285,11 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4) SetMessageArgument(gAvailablePokemonNames,pokemon,0); SetMessageArgument(gAvailablePokemonNames + 0x50,target,0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { - sub_80522F4(pokemon,target,*gUnknown_80FCCE4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE4); return FALSE; } else if (HasHeldItem(target, ITEM_ALERT_SPECS)) { - sub_80522F4(pokemon,target,*gUnknown_80FD578); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD578); return FALSE; } else @@ -2373,7 +2304,7 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4) if (flag) { - sub_80522F4(pokemon,target,*gUnknown_80FC7AC); // The item trade failed + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7AC); // The item trade failed return FALSE; } else @@ -2384,7 +2315,7 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4) sub_806A6E8(pokemon); sub_806A6E8(target); SetExpMultplier(r7); - sub_80522F4(pokemon,target,*gUnknown_80FC790); // Traded items + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC790); // Traded items return TRUE; } } @@ -2395,7 +2326,7 @@ bool8 sub_805A210(Entity * pokemon, Entity * target, Move *move, u32 param_4) bool8 flag; gUnknown_202F210++; - flag = sub_8055640(pokemon, target, move, gUnknown_202F210 << 8, param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon, target, move, gUnknown_202F210 << 8, param_4) ? TRUE : FALSE; return flag; } @@ -2418,7 +2349,7 @@ bool8 sub_805A258(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, 0)) { @@ -2458,7 +2389,7 @@ bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) { uVar2 = 0x100; } - if(sub_8055640(pokemon,target,move,uVar2,param_4) != 0) + if(HandleDamagingMove(pokemon,target,move,uVar2,param_4) != 0) flag = TRUE; return flag; } @@ -2471,7 +2402,7 @@ bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ entityInfo = pokemon->info; targetEntityInfo = target->info; if (HasAbility(target, ABILITY_WONDER_GUARD)) { - sub_80522F4(pokemon,target,*gUnknown_80FC854); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC854); return FALSE; } else @@ -2480,7 +2411,7 @@ bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ entityInfo->abilities[1] = targetEntityInfo->abilities[1]; gDungeon->unkC = 1; SetExpMultplier(entityInfo); - sub_80522F4(pokemon,target,*gUnknown_80FC81C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC81C); sub_806ABAC(pokemon, pokemon); return TRUE; } @@ -2490,7 +2421,7 @@ bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ { gDungeon->weather.unkE267[WEATHER_SUNNY] = gUnknown_80F4F42; if (sub_807EAA0(1,0) == 0) { - sub_80522F4(pokemon,target,*gUnknown_80FCF7C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCF7C); } return TRUE; } @@ -2512,7 +2443,7 @@ bool8 sub_805A408(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DF2)) { @@ -2524,7 +2455,7 @@ bool8 sub_805A408(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, u32 param_4) { - sub_80522F4(pokemon,target,*gUnknown_80FC730); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC730); return FALSE; } @@ -2535,7 +2466,7 @@ bool8 sub_805A464(Entity *pokemon, Entity *target, Move *move, u32 param_4) Position pos; flag = FALSE; - if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_8057308(pokemon, 0) != 0) { if (!EntityExists(target)) { @@ -2551,7 +2482,7 @@ bool8 sub_805A464(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 sub_805A4C0(Entity *pokemon, Entity *target, Move *move, u32 param_4) { - sub_80522F4(pokemon,target,*gUnknown_80FC74C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC74C); return FALSE; } @@ -2577,7 +2508,7 @@ bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 *stockpileStage = 0; } else { - sub_80522F4(pokemon,target,*gUnknown_80FC770); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC770); } return TRUE; } @@ -2592,7 +2523,7 @@ bool8 sub_805A568(Entity * pokemon, Entity * target, Move *move, u32 param_4) { bool8 flag; - flag = sub_8055640(pokemon, target, move, 0x100, param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon, target, move, 0x100, param_4) ? TRUE : FALSE; return flag; } @@ -2602,7 +2533,7 @@ bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool32 flag; flag = FALSE; - if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,pokemon,0) != 0) { stat = gUnknown_8106A4C; @@ -2619,7 +2550,7 @@ bool8 sub_805A5E8(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 par bool32 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_5) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_5) != 0) { flag = TRUE; if (sub_805727C(pokemon,pokemon,gUnknown_80F4DD2) != 0) { entityInfo = pokemon->info; @@ -2636,11 +2567,11 @@ bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) stockpileStage = &pokemon->info->stockpileStage; if (*stockpileStage != 0) { - sub_8055640(pokemon,target,move,*stockpileStage << 8,param_4); + HandleDamagingMove(pokemon,target,move,*stockpileStage << 8,param_4); *stockpileStage = 0; } else { - sub_80522F4(pokemon,target,*gUnknown_80FCA3C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA3C); } return TRUE; } @@ -2650,7 +2581,7 @@ bool8 sub_805A688(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, 0)) { @@ -2673,12 +2604,12 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ SetMessageArgument(gAvailablePokemonNames + 0x50, target, 0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { - sub_80522F4(pokemon,target,*gUnknown_80FCCE8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE8); return FALSE; } else if (HasHeldItem(target, ITEM_ALERT_SPECS)) { - sub_80522F4(pokemon,target,*gUnknown_80FD57C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD57C); return FALSE; } else @@ -2686,13 +2617,13 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ heldItem = targetEntityInfo->heldItem; if (!ItemExists(&heldItem)) { - sub_80522F4(pokemon,target,*gUnknown_80FD18C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD18C); return FALSE; } else { ZeroOutItem(&targetEntityInfo->heldItem); - sub_80522F4(pokemon,target,*gUnknown_80FD170); // $m1's item was swatted down! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD170); // $m1's item was swatted down! pos.x = gAdjacentTileOffsets[entityInfo->action.direction].x; pos.y = gAdjacentTileOffsets[entityInfo->action.direction].y; sub_805A7D4(pokemon,target,&heldItem,&pos); @@ -2756,7 +2687,7 @@ bool8 sub_805A85C(Entity * pokemon, Entity * target, Move *move, u32 param_4) } _0805A8C2: if (counter == 0x28) { - sub_80522F4(pokemon,target,*gUnknown_80FEBDC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEBDC); return FALSE; } temp = pos1.x * 0x1800; @@ -2848,7 +2779,7 @@ bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 para } else { SetMessageArgument(gAvailablePokemonNames,pokemon,0); - sub_80522F4(pokemon,target,*gUnknown_80FC5CC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5CC); } return flag; } @@ -2864,7 +2795,7 @@ bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, u32 p bool8 flag; flag = FALSE; - if ( sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if ( HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4E06) != 0) { switch(gSecretPowerTable[gDungeon->tileset]) { @@ -2907,7 +2838,7 @@ bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if ( sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if ( HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4DFA) != 0) { ConfuseStatusTarget(pokemon, target, FALSE); @@ -2969,7 +2900,7 @@ bool32 sub_805AD54(Entity * pokemon, Entity * target, Move *move, u32 param_4) } if (!flag) { - sub_80522F4(pokemon,target,*gUnknown_81004EC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_81004EC); } return flag; } @@ -2979,7 +2910,7 @@ bool8 sub_805AE3C(Entity *pokemon, Entity *target, Move *move, u32 param_4) bool8 flag; SendThawedMessage(pokemon, target); - flag = sub_8055640(pokemon,target,move,0x80 << 2,param_4) != 0 ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,0x80 << 2,param_4) != 0 ? TRUE : FALSE; return flag; } @@ -2988,7 +2919,7 @@ bool8 sub_805AE74(Entity * pokemon, Entity * target, Move *move, u32 param_4) bool8 flag; flag = FALSE; - if ( sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if ( HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4DDA) != 0) { LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, FALSE); @@ -3003,7 +2934,7 @@ bool8 sub_805AECC(Entity * pokemon, Entity * target, Move *move, u32 param_4) flag = FALSE; SendThawedMessage(pokemon, target); - if ( sub_8055640(pokemon, target, move, 0x100, param_4) != 0) { + if ( HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4DFE) != 0) { BurnedStatusTarget(pokemon, target, 0, FALSE); diff --git a/src/move_effects_target.c b/src/move_effects_target.c index fc7ec50b9..5c3986cb0 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -2,7 +2,7 @@ #include "move_effects_target.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "code_808417C.h" @@ -142,7 +142,6 @@ extern void sub_8041EC8(Entity *); extern void sub_8041ED8(Entity *); extern void EntityUpdateStatusSprites(Entity *); extern void sub_8041AF4(Entity *); -extern void sub_80522F4(Entity *r1, Entity *r2, u8 *); extern void nullsub_91(Entity *); extern void nullsub_90(Entity *); extern void nullsub_72(Entity *); @@ -206,11 +205,11 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage sleep = target->info->sleep.sleep; if (sleep == STATUS_SLEEPLESS) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FB380); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB380); } else if (sleep == STATUS_NAPPING) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FB384); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB384); } else { sub_8041AF4(target); @@ -218,11 +217,11 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage sub_806CE68(target,8); if (cVar2 == 1) - sub_80522F4(pokemon,target,*gUnknown_80FB338); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB338); else if (cVar2 == 2) - sub_80522F4(pokemon,target,*gUnknown_80FB35C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB35C); else - sub_80522F4(pokemon,target,*gUnknown_80FB318); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB318); } } } @@ -236,25 +235,25 @@ bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMe } else if (IQSkillIsEnabled(target, IQ_NONSLEEPER)) { if (displayMessage) { - sub_80522F4(pokemon,target,*gUnknown_80FCD54); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD54); } return TRUE; } else if (HasAbility(target, ABILITY_INSOMNIA)) { if (displayMessage) { - sub_80522F4(pokemon,target,*gUnknown_80FCD58); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD58); } return TRUE; } else if (HasAbility(target, ABILITY_VITAL_SPIRIT)) { if (displayMessage) { - sub_80522F4(pokemon,target,*gUnknown_80FCD88); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD88); } return TRUE; } else if (HasHeldItem(target, ITEM_INSOMNISCOPE)) { if (displayMessage) { - sub_80522F4(pokemon,target,*gUnknown_80FD548); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD548); } return TRUE; } @@ -284,15 +283,15 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns) entityInfo->sleep.sleep = STATUS_NIGHTMARE; sub_806CE68(target,8); if (hasNightmare) { - sub_80522F4(pokemon,target,*gUnknown_80FB3CC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3CC); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB3A4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3A4); } } else { - sub_80522F4(pokemon,target,*gUnknown_80FB3D0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3D0); } EntityUpdateStatusSprites(target); } @@ -321,15 +320,15 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns) entityInfo->sleep.sleep = STATUS_NAPPING; sub_806CE68(target, 8); if (isSleeping) { - sub_80522F4(pokemon,target,*gUnknown_80FB360); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB360); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB31C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB31C); } } else { - sub_80522F4(pokemon,target,*gUnknown_80FB388); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB388); } EntityUpdateStatusSprites(target); } @@ -348,19 +347,19 @@ void YawnedStatusTarget(Entity * pokemon, Entity * target, s32 turns) entityInfo->sleep.sleepTurns = turns; nullsub_91(target); sub_806CE68(target, 8); - sub_80522F4(pokemon,target,*gUnknown_80FB3E0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); } else if (((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) || (entityInfo->sleep.sleep == STATUS_NAPPING)) { - sub_80522F4(pokemon,target,*gUnknown_80FB418); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB418); } else if (entityInfo->sleep.sleep == STATUS_SLEEPLESS) { - sub_80522F4(pokemon,target,*gUnknown_80FB3F8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3F8); } else { if (entityInfo->sleep.sleep == STATUS_YAWNING) - sub_80522F4(pokemon,target,*gUnknown_80FB414); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB414); else - sub_80522F4(pokemon,target,*gUnknown_80FB3E0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); } EntityUpdateStatusSprites(target); } @@ -390,12 +389,12 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target) sub_8041EE8(target); sub_806CE68(target,8); if(isAsleep) - sub_80522F4(pokemon,target,*gUnknown_80FB41C); - sub_80522F4(pokemon,target,*gUnknown_80FB458); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB41C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB458); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB43C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB43C); } EntityUpdateStatusSprites(target); } @@ -417,19 +416,19 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns entityInfo->volatileStatus.volatileStatusTurns = turns + 1; nullsub_72(target); if (turns == 1) { - sub_80522F4(pokemon,target,*gUnknown_80FB480); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB480); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB4D4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB4D4); } } else { if (turns == 1) { - sub_80522F4(pokemon,target,*gUnknown_80FB4B0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB4B0); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB4F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB4F0); } } EntityUpdateStatusSprites(target); @@ -446,7 +445,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa if (HasAbility(target,ABILITY_OBLIVIOUS)) { SetMessageArgument(gAvailablePokemonNames,target,0); if (displayMessage) { - sub_80522F4(pokemon,target,*gUnknown_80FCC4C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC4C); } } else @@ -456,10 +455,10 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa entityInfo->volatileStatus.volatileStatus = STATUS_INFATUATED; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F00,TRUE) + 1; sub_8041EF8(target); - sub_80522F4(pokemon,target,*gUnknown_80FB50C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB50C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB52C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB52C); } EntityUpdateStatusSprites(target); } @@ -486,13 +485,13 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); if (HasAbility(target, ABILITY_WATER_VEIL)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCE5C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE5C); } else { if (MonsterIsType(target, TYPE_FIRE)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCE84); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE84); } else { @@ -500,7 +499,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis if (((tile_1->terrainType & (TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) == TERRAIN_TYPE_SECONDARY) && (gDungeonWaterType[gDungeon->tileset] != DUNGEON_WATER_TYPE_LAVA)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FEBBC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEBBC); } else { @@ -514,10 +513,10 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis if (param_3 != 0) { sub_8041C34(target); } - sub_80522F4(pokemon,target,*gUnknown_80FB548); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB548); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB564); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB564); } EntityUpdateStatusSprites(target); @@ -541,7 +540,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis if (!hasSynchronized) { hasSynchronized = TRUE; SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); - sub_80522F4(pokemon,target,*gUnknown_80FF01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); } if (sub_807167C(target,entity) == TREATMENT_TREAT_AS_ENEMY) { // Recurse with the new target @@ -573,19 +572,19 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); if (HasHeldItem(target, ITEM_PECHA_SCARF)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FD524); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD524); } else { if (HasAbility(target, ABILITY_IMMUNITY)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCEB0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEB0); } else { if(MonsterIsType(target, TYPE_POISON) || MonsterIsType(target, TYPE_STEEL)){ if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCEDC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEDC); } else { @@ -601,17 +600,17 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag entityInfo->nonVolatile.unk4 = 0; isNotPoisoned = FALSE; sub_8041C6C(target); - sub_80522F4(pokemon,target,*gUnknown_80FB598); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB598); sub_806CE94(target, 8); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB5D4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5D4); } } else { - sub_80522F4(pokemon,target,*gUnknown_80FB5F8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5F8); } if ((HasAbility(target, ABILITY_SYNCHRONIZE)) && !isNotPoisoned) @@ -628,7 +627,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag if (!hasSynchronized) { hasSynchronized = TRUE; SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); - sub_80522F4(pokemon,target,*gUnknown_80FF01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); } if (sub_807167C(target,entity) == TREATMENT_TREAT_AS_ENEMY) { // Recurse with the new target @@ -662,19 +661,19 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); if (HasHeldItem(target, ITEM_PECHA_SCARF)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FD524); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD524); } else { if (HasAbility(target, ABILITY_IMMUNITY)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCEB0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEB0); } else { if(MonsterIsType(target, TYPE_POISON) || MonsterIsType(target, TYPE_STEEL)){ if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCEDC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEDC); } else { @@ -688,12 +687,12 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM entityInfo->nonVolatile.unk4 = 0; isNotBadlyPoisoned = FALSE; sub_8041C7C(target); - sub_80522F4(pokemon,target,*gUnknown_80FB5B4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5B4); sub_806CE94(target, 8); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB5F8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5F8); } if ((HasAbility(target, ABILITY_SYNCHRONIZE)) && !isNotBadlyPoisoned) @@ -710,7 +709,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM if (!hasSynchronized) { hasSynchronized = TRUE; SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); - sub_80522F4(pokemon,target,*gUnknown_80FF01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); } if (sub_807167C(target,entity) == TREATMENT_TREAT_AS_ENEMY) { // Recurse with the new target @@ -741,13 +740,13 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) if ((entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { if (HasAbility(target, ABILITY_MAGMA_ARMOR)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCDE0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDE0); } else { if (MonsterIsType(target, TYPE_ICE)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCE00); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE00); } else { @@ -755,7 +754,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) if (((tile->terrainType & (TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) == TERRAIN_TYPE_SECONDARY) && (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCE34); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE34); } else { @@ -766,7 +765,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->immobilize.immobilizeStatus = STATUS_FROZEN; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E2C,TRUE) + 1; entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; - sub_80522F4(pokemon,target,*gUnknown_80FB610); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB610); EntityUpdateStatusSprites(target); } } @@ -787,7 +786,7 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 } else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FA844); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_CONSTRICTION) { @@ -796,11 +795,11 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; entityInfo->immobilize.unk4 = param_3_s32; nullsub_71(target); - sub_80522F4(pokemon,target,*gUnknown_80FB628); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB628); sub_806CE94(target,8); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB64C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB64C); } EntityUpdateStatusSprites(target); } @@ -817,7 +816,7 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) } else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FA844); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_SHADOW_HOLD) { @@ -825,11 +824,11 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; nullsub_70(target); - sub_80522F4(pokemon,target,*gUnknown_80FB668); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB668); sub_806CE94(target,8); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB688); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB688); } EntityUpdateStatusSprites(target); } @@ -850,10 +849,10 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target) entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; nullsub_90(target); - sub_80522F4(pokemon,target,*gUnknown_80FB6A4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6A4); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB6C0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6C0); } EntityUpdateStatusSprites(target); } @@ -892,7 +891,7 @@ void WrapTarget(Entity * pokemon, Entity * target) *piVar3 +=1; nullsub_69(pokemon, target); SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FB6D8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6D8); sub_806CE94(target,8); goto _08076C98; } @@ -900,19 +899,19 @@ void WrapTarget(Entity * pokemon, Entity * target) } if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAP) { SetMessageArgument(gAvailablePokemonNames,pokemon,0); - sub_80522F4(pokemon,target,*gUnknown_80FB6FC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAP) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FB6FC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAPPED) { SetMessageArgument(gAvailablePokemonNames,pokemon,0); - sub_80522F4(pokemon,target,*gUnknown_80FB718); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FB718); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } _08076C98: EntityUpdateStatusSprites(target); @@ -963,11 +962,11 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) targetEntityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EC0,TRUE) + 1; } targetEntityInfo->immobilize.immobilizeStatusDamageCountdown = 0; - sub_80522F4(pokemon,target,*gUnknown_80FB7BC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7BC); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB7DC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7DC); } if (targetEntityInfo->isNotTeamMember) { for(index = 0; index < MAX_TEAM_MEMBERS; index++) @@ -1008,12 +1007,12 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de } if (HasHeldItem(target, ITEM_TWIST_BAND)) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FD550); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); } else { if ((!HasAbility(target, ABILITY_HYPER_CUTTER)) || (index != STAT_STAGE_ATK)) goto _08076EE4; SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FCA60); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); } } else { @@ -1034,10 +1033,10 @@ _08076EE4: } if (entityInfo->offensiveStages[index] != attackStage) { entityInfo->offensiveStages[index] = attackStage; - sub_80522F4(pokemon,target,*gUnknown_80FC15C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC15C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC274); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC274); } EntityUpdateStatusSprites(target); } @@ -1074,10 +1073,10 @@ void LowerDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 d } if (entityInfo->defensiveStages[index] != defenseStage) { entityInfo->defensiveStages[index] = defenseStage; - sub_80522F4(pokemon,target,*gUnknown_80FC158); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC158); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC248); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC248); } EntityUpdateStatusSprites(target); } @@ -1115,10 +1114,10 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in } if (entityInfo->offensiveStages[index] != attackStage) { entityInfo->offensiveStages[index] = attackStage; - sub_80522F4(pokemon,target,*gUnknown_80FC13C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC13C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC270); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC270); } EntityUpdateStatusSprites(target); } @@ -1155,10 +1154,10 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i } if (entityInfo->defensiveStages[index] != defenseStage) { entityInfo->defensiveStages[index] = defenseStage; - sub_80522F4(pokemon,target,*gUnknown_80FC138); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC138); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC21C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC21C); } EntityUpdateStatusSprites(target); } diff --git a/src/move_util.c b/src/move_util.c deleted file mode 100644 index c1773a279..000000000 --- a/src/move_util.c +++ /dev/null @@ -1,226 +0,0 @@ -#include "global.h" -#include "move_util.h" - -#include "constants/ability.h" -#include "constants/move_id.h" -#include "constants/status.h" -#include "moves.h" -#include "dungeon_util.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_random.h" -#include "structs/str_dungeon.h" - - -extern bool8 sub_8044B28(void); -extern void sub_80429C8(Entity *r0); - -typedef bool8 (*MoveCallback)(Entity *pokemon, Entity *target, Move *move, s32 param_4); -struct NaturePowerMove -{ - u16 moveID; - u16 unk2; - MoveCallback move; -}; - -extern struct NaturePowerMove gNaturePowerMoveTable[76]; -bool8 sub_805755C(Entity* pokemon,u16 param_2); - -u32 sub_8057144(Entity * pokemon) -{ - Move *moveStack[80]; - int i, j, nMoves; - - nMoves = 0; - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) - { - Entity *dungeonMon = gDungeon->allPokemon[i]; - if (EntityExists(dungeonMon)) { - Move *moves = dungeonMon->info->moves.moves; - for (j = 0; j < MAX_MON_MOVES; j++) - { - if (moves[j].moveFlags & MOVE_FLAG_EXISTS - && !sub_805755C(pokemon, moves[j].id) - && moves[j].id != MOVE_SKETCH - && nMoves < 80) { - moveStack[nMoves++] = &moves[j]; - } - } - } - } - - if (nMoves == 0) { - return MOVE_REGULAR_ATTACK; - } - else { - return moveStack[DungeonRandInt(nMoves)]->id; - } -} - -bool8 sub_80571F0(Entity * pokemon, Move *move) -{ - u16 moveID; - s32 tileset; - EntityInfo *entityInfo; - - entityInfo = pokemon->info; - - if (entityInfo->unkFF == 1) { - moveID = move->id; - if ((moveID == MOVE_SKY_UPPERCUT) || (moveID == MOVE_TWISTER) || (moveID == MOVE_GUST) || (moveID == MOVE_THUNDER)) - return FALSE; - else - return TRUE; - } - else if (entityInfo->unkFF == 2) { - if (entityInfo->charging.chargingStatus == STATUS_DIVING) { - if (move->id == MOVE_WHIRLPOOL || move->id == MOVE_SURF) return FALSE; - } - else if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { - moveID = move->id; - if (moveID == MOVE_EARTHQUAKE || moveID == MOVE_MAGNITUDE) return FALSE; - if (moveID == MOVE_NATURE_POWER) { - tileset = gDungeon->tileset; - if (tileset < 0) { - tileset = 0; - } - if (0x4a < tileset) { - tileset = 0x4a; - } - if (gNaturePowerMoveTable[tileset].moveID == MOVE_EARTHQUAKE) return FALSE; - } - } - return TRUE; - } - return FALSE; -} - -bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) -{ - bool8 uVar2; - if (sub_8044B28()) - return FALSE; - if (!EntityExists(pokemon) || !EntityExists(target)) - return FALSE; - if (target->info->unk158 == 0 || target->info->HP == 0) - return FALSE; - - if (chance != 0) { - if (HasAbility(pokemon, ABILITY_SERENE_GRACE)) { - uVar2 = DungeonRandOutcome_2(chance * 2); - } - else - { - uVar2 = DungeonRandOutcome_2(chance); - } - } - else - { - uVar2 = TRUE; - } - - if (uVar2 && (pokemon != target) && HasAbility(target, ABILITY_SHIELD_DUST)) - { - sub_80429C8(target); - return FALSE; - } - - return uVar2; -} - -bool8 sub_8057308(Entity *pokemon, s32 chance) -{ - if(!EntityExists(pokemon)) - return FALSE; - if(chance == 0) - return TRUE; - if(HasAbility(pokemon, ABILITY_SERENE_GRACE)) - return DungeonRandOutcome_2(chance * 2); - else - return DungeonRandOutcome_2(chance); -} - -bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker) -{ - s32 i; - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - Move *move = &pokemonInfo->moves.moves[moveIndex]; - if (!MoveFlagExists(move)) - return FALSE; - if (MoveFlagLinkChain(move) || MoveFlagDisabled(move) || MoveFlagSealed(move)) - return FALSE; - - for (i = 0; i < MAX_MON_MOVES; i++) { - if (CanMonsterUseMove(pokemon, move, hasPPChecker)) - return TRUE; - move++; - if (move >= &pokemonInfo->moves.moves[MAX_MON_MOVES]) - break; - if (!(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) - break; - } - - return FALSE; -} - -bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker) -{ - EntityInfo *pokemonInfo = pokemon->info; - if (move->id == MOVE_REGULAR_ATTACK) - { - return TRUE; - } - if (move->moveFlags & MOVE_FLAG_DISABLED || move->moveFlags2 & MOVE_FLAG_SEALED) - { - return FALSE; - } - if (hasPPChecker) - { - if (move->PP == 0) - { - return FALSE; - } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) - { - return FALSE; - } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_ENCORE) - { - if (move->id == MOVE_STRUGGLE) - { - if (!(pokemonInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED)) - { - return FALSE; - } - } - else if (!(move->moveFlags & MOVE_FLAG_LAST_USED)) - { - return FALSE; - } - } - } - return TRUE; -} - -bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3) -{ - EntityInfo *entityInfo; - - entityInfo = pokemon->info; - if (move->id != MOVE_REGULAR_ATTACK) { - if (((move->moveFlags & MOVE_FLAG_DISABLED)) || ((move->moveFlags2 & MOVE_FLAG_EXISTS))) { - return FALSE; - } - if (param_3 != 0) { - if ((entityInfo->volatileStatus.volatileStatus == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_ENCORE) { - if (move->id == MOVE_STRUGGLE) { - if((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; - } - else { - if((move->moveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; - } - } - } - } - return TRUE; -} diff --git a/src/options_menu1.c b/src/options_menu1.c index caf29d18c..ba3710013 100644 --- a/src/options_menu1.c +++ b/src/options_menu1.c @@ -169,7 +169,7 @@ static void sub_801DED0(void) break; case OPTIONS_MENU_CONFIRM_NEW_OPTIONS: CreateChangeSettingsConfirmMenu(); - sub_8014248(sChangeSettingsPrompt, 0, 4, sUnknown_203B25C->menuItems, 0, 4, 0, 0, 32); + CreateMenuDialogueBoxAndPortrait(sChangeSettingsPrompt, 0, 4, sUnknown_203B25C->menuItems, 0, 4, 0, 0, 32); break; } } diff --git a/src/other_menus1.c b/src/other_menus1.c index a7e3046d5..3a17868ba 100644 --- a/src/other_menus1.c +++ b/src/other_menus1.c @@ -418,7 +418,7 @@ static void sub_8037748(void) if ((sUnknown_203B35C->unk14 & 8) != 0) AddSprite(&sUnknown_203B35C->unkC, 0x100, NULL, NULL); - xxx_draw_string_80144C4(); + DrawDialogueBoxString(); sUnknown_203B35C->unk14++; } diff --git a/src/party_list_menu.c b/src/party_list_menu.c index 3aefe9f1d..59af76d3b 100644 --- a/src/party_list_menu.c +++ b/src/party_list_menu.c @@ -247,11 +247,11 @@ void HandlePartyListMenuCallback(void) break; case PARTY_LIST_STATE_SAY_FAREWELL: PartyListMenu_BuildYesNoMenu(); - sub_8014248(sUnknown_80DD388,0,3,sUnknown_203B2B8->unk1BC,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sUnknown_80DD388,0,3,sUnknown_203B2B8->unk1BC,0,4,0,0,0x101); break; case PARTY_LIST_STATE_CONFIRM_SAY_FAREWELL: PartyListMenu_BuildYesNoMenu(); - sub_8014248(sUnknown_80DD420,0,3,sUnknown_203B2B8->unk1BC,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sUnknown_80DD420,0,3,sUnknown_203B2B8->unk1BC,0,4,0,0,0x101); break; case 0x18: GetLinkedSequence(sUnknown_203B2B8->moveIndex, sUnknown_203B2B8->moves,sUnknown_203B2B8->moveIDs); @@ -260,22 +260,22 @@ void HandlePartyListMenuCallback(void) case PARTY_LIST_STATE_JOIN_TEAM: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_EXIT; PlaySound(0xcf); - xxx_info_box_80141B4(sUnknown_80DD4C4,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD4C4,0,0,0x101); break; case PARTY_LIST_STATE_STANDBY: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_EXIT; PlaySound(0xcf); - xxx_info_box_80141B4(sUnknown_80DD4F4,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD4F4,0,0,0x101); break; case PARTY_LIST_STATE_MAKE_LEADER: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_EXIT; PlaySound(0xcc); - xxx_info_box_80141B4(sBecameLeader,0,0,0x101); + CreateDialogueBoxAndPortrait(sBecameLeader,0,0,0x101); break; case PARTY_LIST_STATE_POKEMON_FAREWELL: sUnknown_203B2B8->fallbackState = 9; PlaySound(0xca); - xxx_info_box_80141B4(sUnknown_80DD564,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD564,0,0,0x101); break; case 9: sub_8026FA4(); @@ -284,23 +284,23 @@ void HandlePartyListMenuCallback(void) break; case PARTY_LIST_STATE_GIVEN_ITEM: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_MAIN_MENU_1; - xxx_info_box_80141B4(sUnknown_80DD594,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD594,0,0,0x101); break; case PARTY_LIST_STATE_GIVEN_ITEM_HELD_ITEM: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_MAIN_MENU_1; - xxx_info_box_80141B4(sUnknown_80DD5B8,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD5B8,0,0,0x101); break; case PARTY_LIST_STATE_TAKE_ITEM: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_MAIN_MENU_1; - xxx_info_box_80141B4(sUnknown_80DD60C,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD60C,0,0,0x101); break; case 10: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_EXIT; - xxx_info_box_80141B4(sUnknown_80DD60C,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD60C,0,0,0x101); break; case 0xb: sUnknown_203B2B8->fallbackState = PARTY_LIST_STATE_EXIT; - xxx_info_box_80141B4(sUnknown_80DD63C,0,0,0x101); + CreateDialogueBoxAndPortrait(sUnknown_80DD63C,0,0,0x101); break; case PARTY_LIST_STATE_INIT: case PARTY_LIST_STATE_EXIT: diff --git a/src/personality_test1.c b/src/personality_test1.c index 92193b81c..4cfbb3a1a 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -183,7 +183,7 @@ static void GenerateNewQuestionOrGender(void) sPersonalityTestTracker->QuestionCounter++; if (sPersonalityTestTracker->QuestionCounter > MAX_ASKED_QUESTIONS) { - sub_8014248(gGenderText, 0, 0, gGenderMenu, 0, 3, 0, 0, 257); + CreateMenuDialogueBoxAndPortrait(gGenderText, 0, 0, gGenderMenu, 0, 3, 0, 0, 257); sPersonalityTestTracker->TestState = PERSONALITY_PLAYER_GENDER; } else { @@ -285,7 +285,7 @@ static void RevealStarter(void) s32 temp; if (sub_80144A4(&temp) == 0) { - xxx_info_box_80141B4(gStarterReveal, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gStarterReveal, 0, 0, 0x101); PersonalityTest_DisplayStarterSprite(); sPersonalityTestTracker->TestState = PERSONALITY_ADVANCE_TO_PARTNER_SELECTION_1; } @@ -301,7 +301,7 @@ static void AdvanceToPickPartnerPrompt(void) static void PromptPickPartner(void) { - xxx_info_box_80141B4(gPartnerPrompt, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(gPartnerPrompt, 0, 0, 0x301); sPersonalityTestTracker->TestState = PERSONALITY_ADVANCE_TO_PARTNER_SELECTION_3; } @@ -329,7 +329,7 @@ static void PromptForPartnerNickname(void) if (selectedPartner != 0xFFFE) { sub_803CE6C(); sPersonalityTestTracker->PartnerID = selectedPartner; - xxx_info_box_80141B4(gPartnerNickPrompt, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(gPartnerNickPrompt, 0, 0, 0x301); sPersonalityTestTracker->TestState = PERSONALITY_ADVANCE_TO_PARTNER_NICKNAME_2; } } @@ -354,7 +354,7 @@ static void PrintEndIntroText(void) { if (sub_8016080()) { CleanConfirmNameMenu(); - xxx_info_box_80141B4(gEndIntroText, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(gEndIntroText, 0, 0, 0x301); sPersonalityTestTracker->TestState = PERSONALITY_ADVANCE_TO_TEST_END; } } @@ -369,7 +369,7 @@ static void AdvanceToTestEnd(void) static void PromptNewQuestion(void) { - sub_8014248(gPersonalityQuestionPointerTable[sPersonalityTestTracker->currQuestionIndex]->question, + CreateMenuDialogueBoxAndPortrait(gPersonalityQuestionPointerTable[sPersonalityTestTracker->currQuestionIndex]->question, 0, 0, gPersonalityQuestionPointerTable[sPersonalityTestTracker->currQuestionIndex]->answers, 0, 3, 0, 0, 0x101); @@ -378,7 +378,7 @@ static void PromptNewQuestion(void) static void PrintPersonalityTypeDescription(void) { CopyMonsterNametoBuffer(gAvailablePokemonNames, sPersonalityTestTracker->StarterID); - xxx_info_box_80141B4(sPersonalityTypeDescriptionTable[sPersonalityTestTracker->playerNature], 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sPersonalityTypeDescriptionTable[sPersonalityTestTracker->playerNature], 0, 0, 0x101); } static void PersonalityTest_DisplayStarterSprite(void) diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c index 81b84a49a..0a72c8b94 100644 --- a/src/pokemon_mid.c +++ b/src/pokemon_mid.c @@ -508,16 +508,14 @@ s16 GetPokemonEvolveConditions(s16 index, unkEvolve *r1) u8 GetPokemonOverworldPalette(s16 index, u32 r1) { - // Had to have this cast to match - u32 temp; - temp = index; + s32 id = SpeciesId(index); if (r1 != 0) { return 10; } else { - return gMonsterParameters[temp].overworldPalette; + return gMonsterParameters[id].overworldPalette; } } @@ -534,23 +532,24 @@ OpenedFile *OpenPokemonDialogueSpriteFile(s16 index) return OpenFile(buffer, &gMonsterFileArchive); } -OpenedFile *GetDialogueSpriteDataPtr(s16 index) +OpenedFile *GetDialogueSpriteDataPtr(s32 index) { // Looks like this loads the dialogue sprite for the pokemon - char buffer[0xC]; - if(gMonsterParameters[index].dialogueSprites == 0) + s16 id = SpeciesId(index); + + if(gMonsterParameters[id].dialogueSprites == 0) { return NULL; } - sprintf(buffer, gUnknown_8107684, index); // "kao%03d" + sprintf(buffer, gUnknown_8107684, id); // "kao%03d" return OpenFileAndGetFileDataPtr(buffer, &gMonsterFileArchive); } -bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 r1) +bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 spriteId) { // checking to see if dialogue sprite is available?? - return (gMonsterParameters[index].dialogueSprites >> r1) & 1; + return (gMonsterParameters[index].dialogueSprites >> spriteId) & 1; } void xxx_pokemonstruct_index_to_pokemon2_808DE30(void* r0, u32 r1) diff --git a/src/post_office_guide1.c b/src/post_office_guide1.c index b6fc590e7..70539ac12 100644 --- a/src/post_office_guide1.c +++ b/src/post_office_guide1.c @@ -53,20 +53,20 @@ bool8 CreateHelperPelipperMenu(s16 speciesID) CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, species_32); monName = GetMonSpecies(species_32); strcpy(gAvailablePokemonNames, monName); - sPostOfficeHelper->faceFile = NULL; - sPostOfficeHelper->faceData = NULL; + sPostOfficeHelper->monPortrait.faceFile = NULL; + sPostOfficeHelper->monPortrait.faceData = NULL; if (species_32 != MONSTER_NONE) { faceFile = GetDialogueSpriteDataPtr(species_32); - sPostOfficeHelper->faceFile = faceFile; - sPostOfficeHelper->unk14 = 0; - sPostOfficeHelper->unk15 = 0; - sPostOfficeHelper->unk16 = 0; - sPostOfficeHelper->unk10 = 2; - sPostOfficeHelper->unk12 = 8; + sPostOfficeHelper->monPortrait.faceFile = faceFile; + sPostOfficeHelper->monPortrait.spriteId = 0; + sPostOfficeHelper->monPortrait.flip = FALSE; + sPostOfficeHelper->monPortrait.unkE = 0; + sPostOfficeHelper->monPortrait.pos.x = 2; + sPostOfficeHelper->monPortrait.pos.y = 8; - if (sPostOfficeHelper->faceFile != NULL) - sPostOfficeHelper->faceData = sPostOfficeHelper->faceFile->data; + if (sPostOfficeHelper->monPortrait.faceFile != NULL) + sPostOfficeHelper->monPortrait.faceData = sPostOfficeHelper->monPortrait.faceFile->data; } sPostOfficeHelper->currMenuChoice = 0; @@ -111,8 +111,8 @@ u32 HelperPelipperCallback(void) void CleanHelperPelipper(void) { if (sPostOfficeHelper != NULL) { - if (sPostOfficeHelper->faceFile != NULL) - CloseFile(sPostOfficeHelper->faceFile); + if (sPostOfficeHelper->monPortrait.faceFile != NULL) + CloseFile(sPostOfficeHelper->monPortrait.faceFile); MemoryFree(sPostOfficeHelper); sPostOfficeHelper = NULL; } @@ -124,89 +124,89 @@ static void nullsub_39(void) static void UpdateHelperPelipperText(void) { - OpenedFile **faceFile; - faceFile = NULL; + struct MonPortraitMsg *monPortraitPtr; + monPortraitPtr = NULL; - if (sPostOfficeHelper->faceFile != NULL) - faceFile = &sPostOfficeHelper->faceFile; + if (sPostOfficeHelper->monPortrait.faceFile != NULL) + monPortraitPtr = &sPostOfficeHelper->monPortrait; switch (sPostOfficeHelper->state) { case DISPLAY_GET_HELP_MENU: - sub_8014248(sWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpGetHelpMenu, 0, 4, 0, faceFile, 12); + CreateMenuDialogueBoxAndPortrait(sWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpGetHelpMenu, 0, 4, 0, monPortraitPtr, 12); break; case RETURN_TO_GET_HELP: switch (sPostOfficeHelper->currMenuChoice) { case GETTING_HELP: - xxx_info_box_80141B4(sGettingHelpExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sGettingHelpExplanation, 0, monPortraitPtr, 0x10d); break; case SEND_SOS_MAIL: - xxx_info_box_80141B4(sSendSOSMailExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sSendSOSMailExplanation, 0, monPortraitPtr, 0x10d); break; case RECEIVE_AOK_MAIL: - xxx_info_box_80141B4(sReceiveAOKMailExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sReceiveAOKMailExplanation, 0, monPortraitPtr, 0x10d); break; case SEND_THANK_YOU_MAIL: - xxx_info_box_80141B4(sSendThankYouMailExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sSendThankYouMailExplanation, 0, monPortraitPtr, 0x10d); break; default: break; } break; case DISPLAY_GO_RESCUE_MENU: - sub_8014248(sWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpGoRescueMenu, 0, 4, 0, faceFile, 12); + CreateMenuDialogueBoxAndPortrait(sWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpGoRescueMenu, 0, 4, 0, monPortraitPtr, 12); break; case RETURN_TO_GO_RESCUE: switch (sPostOfficeHelper->currMenuChoice) { case RESCUE_PROCEDURES: - xxx_info_box_80141B4(sRescueProceduresExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sRescueProceduresExplanation, 0, monPortraitPtr, 0x10d); break; case RECEIVE_SOS_MAIL: - xxx_info_box_80141B4(sReceiveSOSMailExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sReceiveSOSMailExplanation, 0, monPortraitPtr, 0x10d); break; case SEND_AOK_MAIL: - xxx_info_box_80141B4(sSendAOKMailExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sSendAOKMailExplanation, 0, monPortraitPtr, 0x10d); break; case LEAVE_FOR_RESCUE: - xxx_info_box_80141B4(sLeaveForRescueExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sLeaveForRescueExplanation, 0, monPortraitPtr, 0x10d); break; case GET_THANK_YOU_MAIL: - xxx_info_box_80141B4(sGetThankYouMailExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sGetThankYouMailExplanation, 0, monPortraitPtr, 0x10d); break; default: break; } break; case IM_GUIDE_START_MENU: - sub_8014248(sImYourGuide, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpStartMenu, 0, 4, 0, faceFile, 12); + CreateMenuDialogueBoxAndPortrait(sImYourGuide, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpStartMenu, 0, 4, 0, monPortraitPtr, 12); break; case ANYTHING_ELSE_START_MENU: - sub_8014248(sAnythingElse, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpStartMenu, 0, 4, 0, faceFile, 12); + CreateMenuDialogueBoxAndPortrait(sAnythingElse, 0, sPostOfficeHelper->currMenuChoice, sPostOfficeHelpStartMenu, 0, 4, 0, monPortraitPtr, 12); break; case RETURN_TO_START_MENU: switch (sPostOfficeHelper->currMenuChoice) { case POST_OFFICE: - xxx_info_box_80141B4(sPostOfficeExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sPostOfficeExplanation, 0, monPortraitPtr, 0x10d); break; case BULLETIN_BOARD: - xxx_info_box_80141B4(sBulletinBoardExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sBulletinBoardExplanation, 0, monPortraitPtr, 0x10d); break; case DELIVERY: - xxx_info_box_80141B4(sDeliveryExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sDeliveryExplanation, 0, monPortraitPtr, 0x10d); break; default: break; } break; case DISPLAY_FRIEND_RESCUE_MENU: - sub_8014248(sWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, gPostOfficeHelpFriendRescueMenu, 0, 4, 0, faceFile, 12); + CreateMenuDialogueBoxAndPortrait(sWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, gPostOfficeHelpFriendRescueMenu, 0, 4, 0, monPortraitPtr, 12); break; case RETURN_TO_FRIEND_RESCUE: switch (sPostOfficeHelper->currMenuChoice) { case FRIEND_RESCUE_INFO: - xxx_info_box_80141B4(sFriendRescueExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sFriendRescueExplanation, 0, monPortraitPtr, 0x10d); break; case DELETING_MAIL: - xxx_info_box_80141B4(sDeletingMailExplanation, 0, faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sDeletingMailExplanation, 0, monPortraitPtr, 0x10d); break; default: break; diff --git a/src/quick_save_read.c b/src/quick_save_read.c index 5cc9b4020..c6f864abc 100644 --- a/src/quick_save_read.c +++ b/src/quick_save_read.c @@ -35,7 +35,7 @@ bool8 ReadQuickSave(void) sQuickSaveRead->state = 3; } else { - xxx_info_box_80141B4(sSaveFailedExplanation, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sSaveFailedExplanation, 0, 0, 0x301); sQuickSaveRead->state = 2; } break; diff --git a/src/quick_save_write.c b/src/quick_save_write.c index 9f6863adf..a77fa1392 100644 --- a/src/quick_save_write.c +++ b/src/quick_save_write.c @@ -18,9 +18,9 @@ void PrepareQuickSaveWrite(u8 *r0, u32 r1, u8 r2) sQuickSaveWrite->state = 0; if (sQuickSaveWrite->unkC != 0) - xxx_info_box_80141B4(sUnknown_80D45AC, 0, 0, 0x20); + CreateDialogueBoxAndPortrait(sUnknown_80D45AC, 0, 0, 0x20); else - xxx_info_box_80141B4(sUnknown_80D45AC, 0, 0, 0x20); + CreateDialogueBoxAndPortrait(sUnknown_80D45AC, 0, 0, 0x20); } u32 WriteQuickSave(void) @@ -49,19 +49,19 @@ u32 WriteQuickSave(void) sub_80121E0(987655); if (sQuickSaveWrite->unkC != 0) - xxx_info_box_80141B4(sUnknown_80D45F4, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sUnknown_80D45F4, 0, 0, 0x301); else - xxx_info_box_80141B4(sUnknown_80D4668, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sUnknown_80D4668, 0, 0, 0x301); sQuickSaveWrite->state = 3; break; case SAVE_NOT_WRTTEN: - xxx_info_box_80141B4(sSaveNotWritten, 0, 0, 0); + CreateDialogueBoxAndPortrait(sSaveNotWritten, 0, 0, 0); sQuickSaveWrite->state = 4; break; default: sub_80121E0(987657); - xxx_info_box_80141B4(sSaveFailed, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sSaveFailed, 0, 0, 0x301); sQuickSaveWrite->state = 3; break; } diff --git a/src/rescue_password_menu.c b/src/rescue_password_menu.c index aa47b06ad..b290d0cf8 100644 --- a/src/rescue_password_menu.c +++ b/src/rescue_password_menu.c @@ -742,6 +742,6 @@ void sub_80391F8(void) if (gRescuePasswordMenu->unk210 & 8) AddSprite(spr, 0x100, NULL, NULL); - xxx_draw_string_80144C4(); + DrawDialogueBoxString(); gRescuePasswordMenu->unk210++; } diff --git a/src/save_menu.c b/src/save_menu.c index 2abbf40ee..ec56bfed7 100644 --- a/src/save_menu.c +++ b/src/save_menu.c @@ -204,7 +204,7 @@ s32 UpdateSaveMenu(void) sUnknown_203B364->unk4 = 1; break; case SAVE_NOT_WRTTEN: - xxx_info_box_80141B4(gUnknown_80E7178,0,0,0); + CreateDialogueBoxAndPortrait(gUnknown_80E7178,0,0,0); sUnknown_203B364->unk4 = 5; break; default: diff --git a/src/save_read.c b/src/save_read.c index 7e91fb843..06bdfb303 100644 --- a/src/save_read.c +++ b/src/save_read.c @@ -32,7 +32,7 @@ u8 ReadSavePak(void) case 2: if (gSavePakRead->readStatus != READ_SAVE_VALID) { if (IsSaveCorrupted()) { - xxx_info_box_80141B4(sSaveCorrupted, 0, 0, 0x301); + CreateDialogueBoxAndPortrait(sSaveCorrupted, 0, 0, 0x301); gSavePakRead->state = 3; } else diff --git a/src/save_write.c b/src/save_write.c index 469e8daf3..1333ec941 100644 --- a/src/save_write.c +++ b/src/save_write.c @@ -14,46 +14,45 @@ void PrepareSavePakWrite(s16 pokemonID) { OpenedFile *file; s32 id_s32; - OpenedFile **preload_face; id_s32 = pokemonID; // had to cast for asr shift sub_80993D8(); sSavePakWrite = MemoryAlloc(sizeof(SavePakWrite), 5); sSavePakWrite->pokeID = id_s32; - sSavePakWrite->faceFile = NULL; - sSavePakWrite->faceData = NULL; + sSavePakWrite->monPortrait.faceFile = NULL; + sSavePakWrite->monPortrait.faceData = NULL; if (pokemonID != MONSTER_NONE) { file = GetDialogueSpriteDataPtr(pokemonID); - sSavePakWrite->faceFile = file; - sSavePakWrite->faceData = file->data; - sSavePakWrite->unk18 = 0; - sSavePakWrite->unk19 = 0; - sSavePakWrite->unk1A = 0; - sSavePakWrite->unk14 = 2; - sSavePakWrite->unk16 = 8; + sSavePakWrite->monPortrait.faceFile = file; + sSavePakWrite->monPortrait.faceData = file->data; + sSavePakWrite->monPortrait.spriteId = 0; + sSavePakWrite->monPortrait.flip = FALSE; + sSavePakWrite->monPortrait.unkE = 0; + sSavePakWrite->monPortrait.pos.x = 2; + sSavePakWrite->monPortrait.pos.y = 8; } - if (sSavePakWrite->faceFile != 0) { - preload_face = &sSavePakWrite->faceFile; - xxx_info_box_80141B4(sSavingAdventure, 0, preload_face, 0x20); + if (sSavePakWrite->monPortrait.faceFile != 0) { + struct MonPortraitMsg *monPortraitPtr = &sSavePakWrite->monPortrait; + CreateDialogueBoxAndPortrait(sSavingAdventure, 0, monPortraitPtr, 0x20); } else - xxx_info_box_80141B4(sSavingAdventure, 0, NULL, 0x20); + CreateDialogueBoxAndPortrait(sSavingAdventure, 0, NULL, 0x20); sSavePakWrite->state = 3; } bool8 WriteSavePak(void) { - OpenedFile **faceFile; + struct MonPortraitMsg *monPortraitPtr; u32 local_14; u32 other_stack; - faceFile = NULL; - if (sSavePakWrite->faceFile != NULL) - faceFile = &sSavePakWrite->faceFile; + monPortraitPtr = NULL; + if (sSavePakWrite->monPortrait.faceFile != NULL) + monPortraitPtr = &sSavePakWrite->monPortrait; switch (sSavePakWrite->state) { case 0: @@ -62,7 +61,7 @@ bool8 WriteSavePak(void) case 1: sSavePakWrite->unk4++; if (sSavePakWrite->unk4 > 8) { - xxx_info_box_80141B4(sWriteGamePak, 0, 0, 0x20); + CreateDialogueBoxAndPortrait(sWriteGamePak, 0, 0, 0x20); sSavePakWrite->state = 3; } break; @@ -78,22 +77,22 @@ bool8 WriteSavePak(void) switch (sSavePakWrite->saveStatus) { case SAVE_COMPLETED: - if (sSavePakWrite->faceFile != NULL) - xxx_info_box_80141B4(sSaveCompleted, 0, faceFile, 0x101); + if (sSavePakWrite->monPortrait.faceFile != NULL) + CreateDialogueBoxAndPortrait(sSaveCompleted, 0, monPortraitPtr, 0x101); else - xxx_info_box_80141B4(sSaveCompleted, 0, faceFile, 0x101); + CreateDialogueBoxAndPortrait(sSaveCompleted, 0, monPortraitPtr, 0x101); sSavePakWrite->state = 5; break; case SAVE_NOT_WRTTEN: - xxx_info_box_80141B4(sSaveNotWritten, 0, 0, 0); + CreateDialogueBoxAndPortrait(sSaveNotWritten, 0, 0, 0); sSavePakWrite->state = 6; break; default: - if (sSavePakWrite->faceFile != NULL) - xxx_info_box_80141B4(sSaveFailed, 0, faceFile, 0x101); + if (sSavePakWrite->monPortrait.faceFile != NULL) + CreateDialogueBoxAndPortrait(sSaveFailed, 0, monPortraitPtr, 0x101); else - xxx_info_box_80141B4(sSaveFailed, 0, faceFile, 0x101); + CreateDialogueBoxAndPortrait(sSaveFailed, 0, monPortraitPtr, 0x101); sSavePakWrite->state = 5; break; @@ -120,10 +119,10 @@ u32 GetSavePakStatus(void) void FinishWriteSavePak(void) { if (sSavePakWrite != NULL) { - if (sSavePakWrite->faceFile != NULL) - CloseFile(sSavePakWrite->faceFile); + if (sSavePakWrite->monPortrait.faceFile != NULL) + CloseFile(sSavePakWrite->monPortrait.faceFile); MemoryFree(sSavePakWrite); sSavePakWrite = NULL; } sub_80993E4(); -} \ No newline at end of file +} diff --git a/src/status.c b/src/status.c index 76e0ed85b..a30306549 100644 --- a/src/status.c +++ b/src/status.c @@ -13,6 +13,7 @@ #include "dungeon_ai_targeting.h" #include "dungeon_items.h" #include "dungeon_map_access.h" +#include "dungeon_message.h" #include "dungeon_movement.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_util.h" @@ -176,7 +177,6 @@ extern void sub_8041C1C(Entity *r0); extern void sub_8042060(Entity *, s32); extern void sub_8041FB4(Entity *r0, u32 r1); extern void sub_8041FD8(Entity *r0, u32 r1); -extern void sub_80522F4(Entity *r1, Entity *r2, u8 *); extern void sub_804201C(Entity *r0, u32 r1); extern void sub_8041FFC(Entity *r0, u32 r1); extern void sub_8041C58(Entity *r0); @@ -249,14 +249,14 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage if ((HasHeldItem(target,ITEM_TWIST_BAND)) && (param_4 < 0x100)) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FD550); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); return; } if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && (param_4 < 0x100)) { if (displayMessage) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FCA60); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); } return; } @@ -281,14 +281,14 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage entityInfo->offensiveMultipliers[statStage] = 0x63fd; // 25597 } if (oldMulti > entityInfo->offensiveMultipliers[statStage]) { - sub_80522F4(pokemon,target,*gUnknown_80FC11C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC11C); } else if (oldMulti < entityInfo->offensiveMultipliers[statStage]) { - sub_80522F4(pokemon,target,*gUnknown_80FC118); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC118); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC184); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC184); } EntityUpdateStatusSprites(target); } @@ -332,14 +332,14 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag entityInfo->defensiveMultipliers[statStage] = 0x63fd; // 25597 } if (oldMulti > entityInfo->defensiveMultipliers[statStage]) { - sub_80522F4(pokemon,target,*gUnknown_80FC114); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC114); } else if (oldMulti < entityInfo->defensiveMultipliers[statStage]) { - sub_80522F4(pokemon,target,*gUnknown_80FC0FC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC0FC); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC180); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC180); } EntityUpdateStatusSprites(target); } @@ -360,10 +360,10 @@ void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage) } if (entityInfo->hitChanceStages[statStage] < MAX_STAT_STAGE) { entityInfo->hitChanceStages[statStage]++; - sub_80522F4(pokemon,target,*gUnknown_80FC1C4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC1C4); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC218); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC218); } EntityUpdateStatusSprites(target); } @@ -385,7 +385,7 @@ void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, if(displayMessage) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FCA64); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA64); } } else { @@ -394,10 +394,10 @@ void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, sub_8042060(target,statStage); if (entityInfo->hitChanceStages[statStage] != 0) { entityInfo->hitChanceStages[statStage]--; - sub_80522F4(pokemon,target,*gUnknown_80FC1A4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC1A4); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC1F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC1F0); } EntityUpdateStatusSprites(target); } @@ -414,7 +414,7 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) if (HasAbility(target, ABILITY_INNER_FOCUS)){ SetMessageArgument(gAvailablePokemonNames,target,0); if(displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCC18); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18); } else { entityInfo = target->info; @@ -424,11 +424,11 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) entityInfo->volatileStatus.volatileStatus = STATUS_CRINGE; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E3C, TRUE) + 1; sub_80420A0(target); - sub_80522F4(pokemon,target,*gUnknown_80FB2E0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2E0); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB300); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB300); } EntityUpdateStatusSprites(target); } @@ -449,7 +449,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag if (HasAbility(target, ABILITY_LIMBER)) { SetMessageArgument(gAvailablePokemonNames,target,0); if (displayMessage) { - sub_80522F4(pokemon,target,*gUnknown_80FCBF8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBF8); } } else @@ -463,12 +463,12 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; entityInfo->nonVolatile.unk4 = 0; bVar6 = FALSE; - sub_80522F4(pokemon,target,*gUnknown_80FB2AC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2AC); sub_8041C1C(target); CalcSpeedStage(target); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB2CC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2CC); } if ((HasAbility(target, ABILITY_SYNCHRONIZE)) && (!bVar6)) { bVar7 = FALSE; @@ -481,7 +481,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag if (!bVar7) { bVar7 = TRUE; SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); - sub_80522F4(pokemon,target,*gUnknown_80FF01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); } if (sub_807167C(target,mapPokemonEntity) == 1) { ParalyzeStatusTarget(pokemon, mapPokemonEntity, displayMessage); @@ -512,7 +512,7 @@ void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool movSpeed = CalcSpeedStage(target); if (movSpeed == MAX_SPEED_STAGE) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FC2B8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC2B8); } else { for(index = 0; index < NUM_SPEED_COUNTERS; index++) @@ -525,12 +525,12 @@ void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool } movSpeed_1 = CalcSpeedStage(target); if (movSpeed == movSpeed_1) { - sub_80522F4(pokemon,target,*gUnknown_80FC298); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC298); } else { sub_8041CB8(target); - sub_80522F4(pokemon,target,gUnknown_80FA124[movSpeed_1]); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); entityInfo->speedStageChanged = TRUE; entityInfo->attacking = FALSE; } @@ -557,7 +557,7 @@ void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, boo movSpeed = CalcSpeedStage(target); if (movSpeed == 0) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FC2D8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC2D8); } else { for(counter = 0; counter < levels; counter++) @@ -573,12 +573,12 @@ void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, boo movSpeed_1 = CalcSpeedStage(target); if (movSpeed == movSpeed_1) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FC298); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC298); } else { sub_8041CCC(target); - sub_80522F4(pokemon,target,gUnknown_80FA124[movSpeed_1]); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); } } EntityUpdateStatusSprites(target); @@ -599,13 +599,13 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage SetMessageArgument(gAvailablePokemonNames,target,0); if (HasHeldItem(target,ITEM_PERSIM_BAND)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FD500); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD500); } else { if (HasAbility(target, ABILITY_OWN_TEMPO)) { if (displayMessage) - sub_80522F4(pokemon,target,*gUnknown_80FCDB4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDB4); } else { @@ -614,10 +614,10 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage if (entityInfo->volatileStatus.volatileStatus != STATUS_CONFUSED) { entityInfo->volatileStatus.volatileStatus = STATUS_CONFUSED; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E4C,TRUE) + 1; - sub_80522F4(pokemon,target,*gUnknown_80FB25C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB25C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB27C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB27C); } EntityUpdateStatusSprites(target); } @@ -635,10 +635,10 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->volatileStatus.volatileStatus = STATUS_COWERING; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; sub_8041BF8(target); - sub_80522F4(pokemon,target,*gUnknown_80FB940); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB940); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB960); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB960); } EntityUpdateStatusSprites(target); } @@ -690,12 +690,12 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo SetMessageArgument(gAvailablePokemonNames,target,0); if ((HP == 0) && (maxHPStat == 0)) { if (displayMessage_u8) - sub_80522F4(pokemon,target,*gUnknown_80FB204); // $m0's HP remained unchanged + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB204); // $m0's HP remained unchanged } else if ((param_4 == 0) && (HP == 0)) { if (displayMessage_u8) - sub_80522F4(pokemon,target,*gUnknown_80FB21C); // $m0 has full HP + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB21C); // $m0 has full HP } else { @@ -704,7 +704,7 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo if (sub_8045888(target)) { r8 = maxHPStat; } - sub_80522F4(pokemon,target,*gUnknown_80FB240); // m0$'s max HP rose by {VALUE_1} + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB240); // m0$'s max HP rose by {VALUE_1} } if (HP != 0) { if (sub_8045888(target)) { @@ -712,10 +712,10 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo } if (param_3 != 0) { if (entityInfo->maxHPStat == entityInfo->HP) { - sub_80522F4(pokemon,target,*gUnknown_80FB1E0); // $m0 was fully healed + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB1E0); // $m0 was fully healed } else { - sub_80522F4(pokemon,target,*gUnknown_80FB1C4); // $m0 recovered {VALUE_0} HP + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB1C4); // $m0 recovered {VALUE_0} HP } } } @@ -728,14 +728,14 @@ void HandleScannerOrb(Entity* pokemon, Entity* target) { if (EntityExists(target)) { if (target->info->scanning) { - sub_80522F4(pokemon,target,*gUnknown_80FAEF0); // Item locations are already known + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEF0); // Item locations are already known } else { target->info->scanning = TRUE; nullsub_75(target); SetMessageArgument(gAvailablePokemonNames, target, 0); - sub_80522F4(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident sub_803F580(0); sub_8040A84(); EntityUpdateStatusSprites(target); @@ -748,19 +748,19 @@ void HandleStairsOrb(Entity* pokemon, Entity* target) if (EntityExists(target)) { if(sub_8043D10()) { - sub_80522F4(pokemon,target,*gUnknown_80FAF3C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF3C); } else { if (target->info->stairSpotter) { - sub_80522F4(pokemon,target,*gUnknown_80FAF1C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF1C); } else { target->info->stairSpotter = TRUE; nullsub_76(target); SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FAEC8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8); sub_803F580(0); sub_8040A84(); EntityUpdateStatusSprites(target); @@ -773,14 +773,14 @@ void HandleRadarOrb(Entity* pokemon, Entity* target) { if (EntityExists(target)) { if (target->info->powerEars != 0) { - sub_80522F4(pokemon,target,*gUnknown_80FAFD0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFD0); } else { target->info->powerEars = TRUE; nullsub_77(target); SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FAFAC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC); sub_803F580(0); sub_8040A84(); EntityUpdateStatusSprites(target); @@ -799,7 +799,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) if (pokemon == target) { pokemon = target; if (displayMessage) - sub_80522F4(pokemon,target,*gPtrCantLeechSeedSelfMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedSelfMessage); } else { if (HasSafeguardStatus(pokemon,target,displayMessage)) { @@ -808,14 +808,14 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) SetMessageArgument(gAvailablePokemonNames,target,0); if (MonsterIsType(target, TYPE_GRASS)) { if (displayMessage) - sub_80522F4(pokemon,target,*gPtrCantLeechSeedMonMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedMonMessage); } else { switch(entityInfo->linked.linkedStatus) { case STATUS_DESTINY_BOND: - sub_80522F4(pokemon,target,*gUnknown_80FAA8C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAA8C); default: entityInfo->linked.linkedStatus = STATUS_LEECH_SEED; entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB0, TRUE) + 1; @@ -824,7 +824,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->linked.unkD8 = 0xff; break; case STATUS_LEECH_SEED: - sub_80522F4(pokemon,target,*gUnknown_80FAE7C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE7C); return; } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) @@ -835,7 +835,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->linked.unkD4 = entityInfo2->unk98; } } - sub_80522F4(pokemon,target,*gUnknown_80FAE58); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE58); EntityUpdateStatusSprites(target); } } @@ -883,7 +883,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND) { if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) - sub_80522F4(pokemon,target,*gUnknown_80FA79C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA79C); zero = 0; *linkedStatus = STATUS_DESTINY_BOND; entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF0,TRUE) + 1; @@ -893,7 +893,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) } else { - sub_80522F4(pokemon,target,*gUnknown_80FBB78); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB78); return; } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) @@ -904,7 +904,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) entityInfo->linked.unkD4 = entityInfo2->unk98; } } - sub_80522F4(pokemon,target,*gUnknown_80FBB4C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB4C); EntityUpdateStatusSprites(target); } } @@ -920,10 +920,10 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT; entityInfo->moveStatus.moveStatusTurns = turns + 1; sub_8041CDC(target); - sub_80522F4(pokemon,target,*gUnknown_80FB73C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB73C); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB764); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB764); } EntityUpdateStatusSprites(target); } @@ -940,10 +940,10 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) entityInfo->moveStatus.moveStatus = STATUS_WHIFFER; entityInfo->moveStatus.moveStatusTurns = turns + 1; sub_8041CEC(target); - sub_80522F4(pokemon,target,*gUnknown_80FB780); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB780); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB7A0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7A0); } EntityUpdateStatusSprites(target); } @@ -960,10 +960,10 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE; entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; nullsub_79(target); - sub_80522F4(pokemon,target,*gUnknown_80FB8BC); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB8BC); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB8E4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB8E4); } EntityUpdateStatusSprites(target); } @@ -980,10 +980,10 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY; entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; nullsub_80(target); - sub_80522F4(pokemon,target,*gUnknown_80FB900); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB900); } else { - sub_80522F4(pokemon,target,*gUnknown_80FB924); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB924); } EntityUpdateStatusSprites(target); } @@ -1002,7 +1002,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) targetEntityInfo = target->info; SetMessageArgument(gAvailablePokemonNames,target,0); if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { - sub_80522F4(pokemon,target,*gUnknown_80FB994); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); } else { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) @@ -1026,7 +1026,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) targetEntityInfo->waitingStruct.curseDamageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); gDungeon->decoyActive = TRUE; - sub_80522F4(pokemon,target,*gUnknown_80FB978); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { @@ -1076,7 +1076,7 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) targetEntityInfo->waitingStruct.curseDamageCountdown = 0; } SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FB004); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004); } else { statStage = gUnknown_8106A4C; @@ -1116,7 +1116,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) gDungeon->snatchPokemon = target; gDungeon->unk17B3C = targetEntityInfo->unk98; SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FB01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB01C); EntityUpdateStatusSprites(target); } } @@ -1132,10 +1132,10 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; nullsub_73(target); - sub_80522F4(pokemon,target,*gUnknown_80FB9F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9F0); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBA14); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA14); } EntityUpdateStatusSprites(target); } @@ -1153,10 +1153,10 @@ void HandleStockpile(Entity * pokemon, Entity * target) sub_804178C(1); sub_8041D5C(target); gFormatData_202DE30[0] = entityInfo->stockpileStage; - sub_80522F4(pokemon,target,*gUnknown_80FBA38); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA38); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBA60); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA60); } EntityUpdateStatusSprites(target); } @@ -1178,10 +1178,10 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) targetEntityInfo_1->transformStatus.transformStatus = STATUS_INVISIBLE; targetEntityInfo_1->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; sub_8041D84(target); - sub_80522F4(pokemon,target,*gUnknown_80FBA80); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA80); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBAA0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAA0); } EntityUpdateStatusSprites(target); } @@ -1197,10 +1197,10 @@ void PerishSongTarget(Entity * pokemon, Entity * target) SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->perishSongTurns == 0) { entityInfo->perishSongTurns = CalculateStatusTurns(target,gUnknown_80F4EEC,FALSE) + 1; - sub_80522F4(pokemon,target,*gUnknown_80FBB04); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB04); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBB28); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB28); } EntityUpdateStatusSprites(target); } @@ -1221,7 +1221,7 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) } if ((index == MAX_MON_MOVES) && ((EntityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0)) { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FBBD4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBD4); } else { SetMessageArgument(gAvailablePokemonNames,target,0); @@ -1229,10 +1229,10 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) EntityInfo->volatileStatus.volatileStatus = STATUS_ENCORE; EntityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; nullsub_83(target); - sub_80522F4(pokemon,target,*gUnknown_80FBB94); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB94); } else { - sub_80522F4(pokemon,target,*gUnknown_80FBBB8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBB8); } EntityUpdateStatusSprites(target); } @@ -1258,10 +1258,10 @@ void sub_8078A58(struct Entity *pokemon, struct Entity *target, s32 param_3, s32 if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->maxBelly)) { sub_8041D9C(target); - sub_80522F4(pokemon, target, *gUnknown_80FBD9C); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBD9C); } else - sub_80522F4(pokemon, target, *gUnknown_80FBE3C); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBE3C); } else { FixedPoint sp8 = IntToFixedPoint(param_3); @@ -1272,10 +1272,10 @@ void sub_8078A58(struct Entity *pokemon, struct Entity *target, s32 param_3, s32 if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->belly)) { nullsub_84(target); - sub_80522F4(pokemon, target, *gUnknown_80FBD78); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBD78); } else - sub_80522F4(pokemon, target, *gUnknown_80FBE40); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBE40); } EntityUpdateStatusSprites(target); @@ -1302,7 +1302,7 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel } targetInfo = target->info; if ((!targetInfo->isTeamLeader) && (HasHeldItem(target,0x1b))) { - if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBEA0); + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBEA0); return; } bellySizeIncreased = FALSE; @@ -1327,16 +1327,16 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel *bellyPtr = FixedPoint_Min(sp_0x4,sp_0x8); targetInfo->belly = *bellyPtr; if ((!bellySame) && (displayMessage)) { - sub_80522F4(pokemon,target,*gUnknown_80FBE64); // $m0's belly filled up full! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE64); // $m0's belly filled up full! } if (FixedPointToInt(sp_0x20) == FixedPointToInt(targetInfo->maxBelly)) { SetMessageArgument(gAvailablePokemonNames,target,0); - if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBDF0); // $m0's belly won't get any bigger! + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDF0); // $m0's belly won't get any bigger! } else { sub_8041DB0(target); SetMessageArgument(gAvailablePokemonNames,target,0); - if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBDC4); // m0's max belly size increased! + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDC4); // m0's max belly size increased! } } else { @@ -1354,15 +1354,15 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel nullsub_85(target); SetMessageArgument(gAvailablePokemonNames,target,0); if (FixedPointToInt(oldBelly) == FixedPointToInt(*bellyPtr)) { - if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBE14); // $m0's belly didn't change! + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE14); // $m0's belly didn't change! } else { if (FixedPointToInt(*bellyPtr) >= FixedPointToInt(*puVar8)) { - if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBE64); // $m0's belly filled up full! + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE64); // $m0's belly filled up full! } else { - if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBE84); // $m0's belly was filled! + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE84); // $m0's belly was filled! } } } diff --git a/src/status_actions.c b/src/status_actions.c index e0a5238fb..98e4ae869 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -3,7 +3,7 @@ #include "charge_move.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "code_807CD9C.h" @@ -33,6 +33,7 @@ #include "tile_types.h" #include "trap.h" #include "weather.h" +#include "called_move_data.h" extern void sub_807F43C(Entity *, Entity *); extern void sub_807DC68(Entity *, Entity *); @@ -40,7 +41,6 @@ extern u32 sub_803D73C(u32); extern void sub_8045C28(Item *, u8 , u8); extern void sub_80464C8(Entity *, Position *, Item *); extern void sub_8068FE0(Entity *, u32, Entity *r2); -extern void sub_80522F4(Entity *r1, Entity *r2, const char []); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern void sub_807FC3C(Position *, u32, u32); extern void sub_8042A64(Position *); @@ -59,7 +59,7 @@ extern s16 sub_803D970(u32); extern bool8 sub_806AA0C(s32, u32); extern void sub_806BB6C(Entity *, s32); extern void sub_807E254(Entity *, Entity *, u32); -extern u32 sub_8055640(Entity *, Entity *, Move *, u32, u32); +extern u32 HandleDamagingMove(Entity *, Entity *, Move *, u32, u32); extern void sub_806A6E8(Entity *); extern u8 sub_8069D18(Position *); extern u8 sub_804AD34(Position *); @@ -140,23 +140,13 @@ extern u8 *gUnknown_80FEB08[]; extern u8 gFormatItems[]; extern s16 gUnknown_80F4E08; extern u8 gDungeonCamouflageTypes[76]; -extern u32 gUnknown_202F228; +extern u32 gMetronomeCalledArrayId; extern s16 gUnknown_80F4DC6; extern u8 *gUnknown_80FEFF4[]; extern u32 gUnknown_80F51C4[]; -typedef bool8 (*MoveCallback)(Entity *pokemon, Entity *target, Move *move, s32 param_4); - -struct NaturePowerMove -{ - u16 moveID; - u16 unk2; - MoveCallback move; -}; -extern struct NaturePowerMove gUnknown_80F59C8[10]; - bool8 sub_805AFA4(Entity * pokemon, Entity * target, Move *move, u32 param_4) { EntityInfo *entityInfo; @@ -180,7 +170,7 @@ bool8 sub_805AFA4(Entity * pokemon, Entity * target, Move *move, u32 param_4) index = 3; } - flag = sub_8055640(pokemon,target,move,gUnknown_80F51C4[index],param_4) ? TRUE : FALSE; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F51C4[index],param_4) ? TRUE : FALSE; return flag; } @@ -193,7 +183,7 @@ bool8 sub_805B028(Entity * pokemon,Entity * target,Move *move) bool8 TransformMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { if (IsBossFight()) { - sub_80522F4(pokemon,target,*gUnknown_80FEFF4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEFF4); return FALSE; } else { @@ -208,7 +198,7 @@ bool8 sub_805B074(Entity * pokemon, Entity * target, Move *move, s32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4DC6) != 0) { PoisonedStatusTarget(pokemon,target,FALSE); @@ -232,7 +222,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target) entityInfo = target->info; newType = gDungeonCamouflageTypes[gDungeon->tileset]; if (HasAbility(target, ABILITY_FORECAST)) { - sub_80522F4(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); return FALSE; } else { @@ -242,7 +232,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target) SetMessageArgument(gUnknown_202DFE8,target,0); typeString = GetUnformattedTypeString(newType); strcpy(gFormatItems, typeString); - sub_80522F4(pokemon,target,*gUnknown_80FEB08); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB08); return TRUE; } } @@ -269,7 +259,7 @@ bool8 sub_805B17C(Entity * pokemon, Entity * target, Move *move, s32 param_4) uVar4 = 0x7e; } } - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4E08) != 0) { SqueezedStatusTarget(pokemon,target,uVar4,0); @@ -308,7 +298,7 @@ bool8 SpikesMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_ } else { - sub_80522F4(pokemon,target,*gUnknown_80FC5A8); // A trap can't be laid here! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5A8); // A trap can't be laid here! } sub_8049ED4(); return trapLaid; @@ -364,7 +354,7 @@ bool8 sub_805B324(Entity * pokemon,Entity * target,Move *move, s32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gUnknown_80F4DD8) != 0) { LowerAttackStageTarget(pokemon,target,gUnknown_8106A50,1,1,0); @@ -381,7 +371,7 @@ bool8 DestinyBondMoveAction(Entity * pokemon,Entity * target,Move *move, s32 par bool8 sub_805B388(Entity * pokemon,Entity * target,Move *move, s32 param_4) { - return (sub_8055640(pokemon,target,move,0x100,param_4)) ? TRUE : FALSE; + return (HandleDamagingMove(pokemon,target,move,0x100,param_4)) ? TRUE : FALSE; } bool8 MirrorCoatMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) @@ -400,7 +390,7 @@ bool8 sub_805B3B4(Entity * pokemon,Entity * target,Move *move, s32 param_4) bool8 sub_805B3E0(Entity * pokemon,Entity * target,Move *move, s32 param_4) { - sub_8055640(pokemon,target,move,0x100,param_4); + HandleDamagingMove(pokemon,target,move,0x100,param_4); return TRUE; } @@ -410,7 +400,7 @@ bool8 sub_805B3FC(Entity * pokemon,Entity * target,Move *move, s32 param_4, s32 bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_5) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_5) != 0) { flag = TRUE; if (sub_805727C(pokemon,pokemon,gUnknown_80F4DCE) != 0) { entityInfo = pokemon->info; @@ -455,11 +445,11 @@ bool8 MimicMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4 SetMessageArgument(gAvailablePokemonNames,pokemon,0); if (moveCounter != 0) { SetExpMultplier(entityInfo); - sub_80522F4(pokemon,target,*gUnknown_80FDCE4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCE4); mimicSuccess = TRUE; } else { - sub_80522F4(pokemon,target,*gUnknown_80FDD00); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDD00); } return mimicSuccess; } @@ -506,10 +496,10 @@ bool8 sub_805B618(Entity * pokemon, Entity * target, Move *move, s32 param_4) Move natureMove; u32 index; - index = gUnknown_202F228; + index = gMetronomeCalledArrayId; - InitPokemonMove(&natureMove, gUnknown_80F59C8[index].moveID); - flag = gUnknown_80F59C8[index].move(pokemon, target, &natureMove, param_4); + InitPokemonMove(&natureMove, gMetronomeCalledMoves[index].moveID); + flag = gMetronomeCalledMoves[index].callback(pokemon, target, &natureMove, param_4); return flag; } @@ -523,7 +513,7 @@ bool8 sub_805B668(Entity * pokemon, Entity * target, Move *move, s32 param_4) flag = FALSE; hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE); if (IsSleeping(target)) { - iVar3 = sub_8055640(pokemon,target,move,0x100,param_4); + iVar3 = HandleDamagingMove(pokemon,target,move,0x100,param_4); if (iVar3 != 0) { flag = TRUE; newHP = iVar3 / 2; @@ -544,7 +534,7 @@ bool8 sub_805B668(Entity * pokemon, Entity * target, Move *move, s32 param_4) } } else { - sub_80522F4(pokemon,target,*gPtrSleepingTargetOnlyMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrSleepingTargetOnlyMessage); } return flag; } @@ -580,10 +570,10 @@ bool8 RecycleMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param } if (isTMRecycled) { - sub_80522F4(pokemon,target,*gUnknown_80FDC9C); // The Used TM was recharged! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC9C); // The Used TM was recharged! } else { - sub_80522F4(pokemon,target,*gUnknown_80FDCA0); // But nothing happened! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCA0); // But nothing happened! } return isTMRecycled; } @@ -616,7 +606,7 @@ bool8 SkullBashMoveAction(Entity * pokemon, Entity * target, Move * move, s32 pa bool8 flag; if (MoveMatchesChargingStatus(pokemon,move)) { - flag = sub_8055640(pokemon,target,move,gUnknown_80F4F58,param_4) != 0 ? 1 : 0; + flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F58,param_4) != 0 ? 1 : 0; sub_8079764(pokemon); } else { @@ -631,7 +621,7 @@ bool8 sub_805B910(Entity * pokemon, Entity * target, Move * move, s32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4DDC)) { @@ -648,7 +638,7 @@ bool8 sub_805B968(Entity * pokemon, Entity * target, Move * move, s32 param_4) bool8 flag; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if (sub_8057308(pokemon,0) != 0) { entityHP = pokemon->info->maxHPStat; @@ -671,16 +661,16 @@ bool8 RockSmashMoveAction(Entity * pokemon, Entity * target, Move *move, s32 par bool8 flag = FALSE; if (sub_8069D18(&pos) != 0) { - sub_80522F4(pokemon,target,*gUnknown_80FD430); // Can't use that diagonally! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD430); // Can't use that diagonally! } else { ASM_MATCH_TRICK(target); flag = sub_804AD34(&pos); if (flag) { - sub_80522F4(pokemon,target,*gUnknown_80FD3F0); // It dug the wall in front! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD3F0); // It dug the wall in front! } else { - sub_80522F4(pokemon,target,*gUnknown_80FD40C); // Can't use that here! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD40C); // Can't use that here! } } return flag; @@ -703,7 +693,7 @@ bool8 sub_805BA50(Entity * pokemon, Entity * target, Move *move, s32 param_4) Item *targetItem; flag = FALSE; - if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) { + if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target, 0) != 0) { iVar2 = pokemon->info; @@ -716,18 +706,18 @@ bool8 sub_805BA50(Entity * pokemon, Entity * target, Move *move, s32 param_4) return TRUE; } else if (HasHeldItem(target, ITEM_ALERT_SPECS)) { - sub_80522F4(pokemon,target,*gUnknown_80FD574); // $m1 was protected by its Specs! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD574); // $m1 was protected by its Specs! return TRUE; } else { pokeItem = &iVar2->heldItem; targetItem = &iVar5->heldItem; if ((pokeItem->flags & ITEM_FLAG_EXISTS) != 0) { - sub_80522F4(pokemon,target,*gUnknown_80FC654); // $m0 has an item already! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC654); // $m0 has an item already! return TRUE; } else if ((targetItem->flags & ITEM_FLAG_EXISTS) == 0) { - sub_80522F4(pokemon,target,*gUnknown_80FC678); // $m1 doesn't have anything + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC678); // $m1 doesn't have anything return TRUE; } else { @@ -736,7 +726,7 @@ bool8 sub_805BA50(Entity * pokemon, Entity * target, Move *move, s32 param_4) sub_806A6E8(pokemon); sub_806A6E8(target); SetExpMultplier(iVar3); - sub_80522F4(pokemon,target,*gUnknown_80FC614); // Got $m1's item! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC614); // Got $m1's item! } } } @@ -793,10 +783,10 @@ bool8 CleanseOrbAction(Entity * pokemon, Entity * target, Move *move, s32 param_ } if (isItemCleaned) { - sub_80522F4(pokemon,target,*gUnknown_80FC8F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC8F0); } else { - sub_80522F4(pokemon,target,*gUnknown_80FC920); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC920); } return isItemCleaned; } @@ -873,7 +863,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ oldID = entityInfo->id; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->clientType != CLIENT_TYPE_NONE) { - sub_80522F4(pokemon,target,*gUnknown_80FD450); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); return FALSE; } else @@ -885,11 +875,11 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ } } if ((r6 == 0x1e) || (entityInfo->id == targetID)) { - sub_80522F4(pokemon,target,*gUnknown_80FD450); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); } else { CopyCyanMonsterNametoBuffer(gUnknown_202DFE8, targetID); - sub_80522F4(pokemon,target,*gUnknown_80FD434); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD434); sub_806BB6C(target, targetID); didTransfer = TRUE; } @@ -897,7 +887,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ } else { SetMessageArgument(gAvailablePokemonNames,target,0); - sub_80522F4(pokemon,target,*gUnknown_80FD450); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); } return didTransfer; } @@ -936,10 +926,10 @@ bool8 EscapeOrbAction(Entity * pokemon, Entity * target, Move *move, s32 param_4 { SetMessageArgument(gAvailablePokemonNames,pokemon,0); if (gDungeon->unk66E != 0) { - sub_80522F4(pokemon,target,*gUnknown_80FD4DC); // $m0 can't escape! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4DC); // $m0 can't escape! } else { - sub_80522F4(pokemon,target,*gUnknown_80FD4C4); // $m0 escaped! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4C4); // $m0 escaped! gDungeon->unk4 = 1; gDungeon->unk11 = 1; } @@ -965,7 +955,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ bool8 foundTrap = FALSE; tile = GetTileAtEntitySafe(target); if (IsBossFight()) { - SendMessage(pokemon,*gUnknown_80FD1EC); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD1EC); return FALSE; } else @@ -997,12 +987,12 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ } } if (foundTrap) { - sub_80522F4(pokemon, target, *gUnknown_80FD1B0); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD1B0); sub_8040A84(); sub_8049ED4(); } else { - sub_80522F4(pokemon, target, *gUnknown_80FD1CC); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD1CC); } } return foundTrap; @@ -1034,7 +1024,7 @@ bool8 sub_805C080(Entity * pokemon, Entity *target, Move *move, s32 param_4) } } if (!foundTarget) { - sub_80522F4(pokemon,target,*gUnknown_81004F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_81004F0); } return foundTarget; } @@ -1071,7 +1061,7 @@ bool8 sub_805C1BC(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 sub_805C1E4(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - sub_80522F4(pokemon, target, *gUnknown_80FD454); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD454); return FALSE; } @@ -1118,7 +1108,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) filledInTile = FALSE; targetInfo = target->info; if (IsBossFight()) { - SendMessage(pokemon,*gUnknown_80FD0B8); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD0B8); return FALSE; } else @@ -1145,10 +1135,10 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) if (filledInTile) { sub_8042A64(&tileCoords); - sub_80522F4(pokemon,target,*gUnknown_80FD0B4); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD0B4); } else { - sub_80522F4(pokemon,target,*gUnknown_80FD0B8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD0B8); } sub_8040A84(); sub_8049ED4(); @@ -1171,7 +1161,7 @@ bool8 sub_805C3F8(Entity *pokemon, Entity *target, Move *move, s32 param_4) if(target->info->clientType != CLIENT_TYPE_NONE) { - sub_80522F4(pokemon, target, *gUnknown_80FF678); + TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678); return FALSE; } else diff --git a/src/status_checks.c b/src/status_checks.c index c97bfc2d4..0b9d490e3 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -3,7 +3,7 @@ #include "charge_move.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_8077274_1.h" #include "constants/direction.h" #include "constants/dungeon_action.h" @@ -40,13 +40,13 @@ bool8 HasStatusAffectingActions(Entity *pokemon) switch (pokemonInfo->immobilize.immobilizeStatus) { case STATUS_FROZEN: - SendMessage(pokemon, *gPtrFrozenMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrFrozenMessage); return TRUE; case STATUS_WRAP: - SendMessage(pokemon, *gPtrWrappedAroundMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedAroundMessage); return TRUE; case STATUS_WRAPPED: - SendMessage(pokemon, *gPtrWrappedByMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedByMessage); return TRUE; case STATUS_PETRIFIED: return TRUE; @@ -54,15 +54,15 @@ bool8 HasStatusAffectingActions(Entity *pokemon) switch (pokemonInfo->volatileStatus.volatileStatus) { case STATUS_PAUSED: - SendMessage(pokemon, *gPtrPausedMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrPausedMessage); return TRUE; case STATUS_INFATUATED: - SendMessage(pokemon, *gPtrInfatuatedMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrInfatuatedMessage); return TRUE; } if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { - SendMessage(pokemon, *gPtrBideMessage); + TryDisplayDungeonLoggableMessage(pokemon, *gPtrBideMessage); return TRUE; } if (pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY) @@ -125,20 +125,20 @@ bool8 sub_80701A4(Entity *pokemon) case STATUS_SLEEP: case STATUS_NIGHTMARE: case STATUS_NAPPING: - SendMessage(pokemon,*gUnknown_80F95EC); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F95EC); return TRUE; } switch(pokemonInfo->immobilize.immobilizeStatus) { case STATUS_FROZEN: - SendMessage(pokemon,*gPtrFrozenMessage); + TryDisplayDungeonLoggableMessage(pokemon,*gPtrFrozenMessage); return TRUE; case STATUS_WRAP: - SendMessage(pokemon,*gPtrWrappedAroundMessage); + TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedAroundMessage); return TRUE; case STATUS_WRAPPED: - SendMessage(pokemon,*gPtrWrappedByMessage); + TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedByMessage); return TRUE; case STATUS_PETRIFIED: return TRUE; @@ -149,10 +149,10 @@ bool8 sub_80701A4(Entity *pokemon) flag = TRUE; goto _0807026C; case STATUS_PAUSED: - SendMessage(pokemon,*gPtrPausedMessage); + TryDisplayDungeonLoggableMessage(pokemon,*gPtrPausedMessage); return TRUE; case STATUS_INFATUATED: - SendMessage(pokemon,*gPtrInfatuatedMessage); + TryDisplayDungeonLoggableMessage(pokemon,*gPtrInfatuatedMessage); return TRUE; default: case STATUS_NONE: @@ -160,12 +160,12 @@ bool8 sub_80701A4(Entity *pokemon) case 8: _0807026C: if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { - SendMessage(pokemon,*gPtrBideMessage); + TryDisplayDungeonLoggableMessage(pokemon,*gPtrBideMessage); return TRUE; } else if (((pokemonInfo->charging.chargingStatus != STATUS_NONE) && (pokemonInfo->charging.chargingStatus != STATUS_CHARGING)) && (pokemonInfo->charging.chargingStatus != STATUS_ENRAGED)) { if (flag) { - SendMessage(pokemon,*gPtrMoveInterruptedMessage); + TryDisplayDungeonLoggableMessage(pokemon,*gPtrMoveInterruptedMessage); } else { for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) { diff --git a/src/status_checks_1.c b/src/status_checks_1.c index a7c03d556..e76528ec1 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -2,7 +2,7 @@ #include "status_checks_1.h" #include "code_800D090.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "constants/ability.h" #include "constants/iq_skill.h" #include "constants/status.h" @@ -44,7 +44,7 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage) } if (displayMessage && SetVisualFlags(pokemon->info, 0x40, flag)) { sub_80429B4(pokemon); - SendMessage(pokemon, *gUnknown_80FEE80); + TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FEE80); } if (flag) { return 2; diff --git a/src/text2.c b/src/text2.c index 07606e044..f2e827229 100644 --- a/src/text2.c +++ b/src/text2.c @@ -3327,38 +3327,6 @@ UNUSED void sub_8008FF0(s32 x, u32 y, const u8 *str, u32 windowId, u32 a4) UNUSED void nullsub_171(void) {} -struct UnkDrawStringStruct; - -struct UnkDrawStringStruct -{ - s16 unk0; - s16 unk2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; - s32 unkC; - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; - u8 unk20; - u8 unk21; - u8 fill22; - u8 fill23; - const u8* (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct*); - u8 fill28; - u8 fill29; - u8 fill2A; - u8 fill2B; - u32 unk2C; - u8 fill30; - u8 fill31; - u8 fill32; - u8 fill33; - u32 unk34; -}; - const u8 *HandleTextFormat(UnkTextStruct1 *strArr, const u8 *str, struct UnkDrawStringStruct *sp); void xxx_draw_string(UnkTextStruct1 *strArr, s32 x, s32 y, const u8 *str, u32 windowId, s32 a5, s32 a6, s32 a7) diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index e7c9a9312..ae2f716bd 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -252,13 +252,13 @@ u32 CreateThankYouMailPelipper(void) strcpy(gAvailablePokemonNames, monName); faceFile = GetDialogueSpriteDataPtr(MONSTER_PELIPPER); - sUnknown_203B2C4->faceFile = faceFile; - sUnknown_203B2C4->faceData = faceFile->data; - sUnknown_203B2C4->unk42C = 0; - sUnknown_203B2C4->unk42D = 0; - sUnknown_203B2C4->unk42E = 0; - sUnknown_203B2C4->unk428 = 2; - sUnknown_203B2C4->unk42A = 8; + sUnknown_203B2C4->monPortrait.faceFile = faceFile; + sUnknown_203B2C4->monPortrait.faceData = faceFile->data; + sUnknown_203B2C4->monPortrait.spriteId = 0; + sUnknown_203B2C4->monPortrait.flip = FALSE; + sUnknown_203B2C4->monPortrait.unkE = 0; + sUnknown_203B2C4->monPortrait.pos.x = 2; + sUnknown_203B2C4->monPortrait.pos.y = 8; for(counter = 0; counter < PASSWORD_BUFFER_SIZE; counter++){ sUnknown_203B2C4->passwordBuffer[counter] = 0; @@ -419,7 +419,7 @@ void CleanThankYouMailPelipper(void) { if(sUnknown_203B2C4 != NULL) { - CloseFile(sUnknown_203B2C4->faceFile); + CloseFile(sUnknown_203B2C4->monPortrait.faceFile); MemoryFree(sUnknown_203B2C4); sUnknown_203B2C4 = NULL; sub_8030DE4(); @@ -445,34 +445,34 @@ void PrintThankYouMailLinkError(u32 errorCode) { switch(errorCode) { case COMMS_INCORRECT_NUM_SYSTEMS: - xxx_info_box_80141B4(gUnknown_80DEF28, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DEF28, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_DIFFERENT_MODES: - xxx_info_box_80141B4(gUnknown_80DEF80, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DEF80, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_NO_ROOM_STORAGE: - xxx_info_box_80141B4(gUnknown_80DEFDC, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DEFDC, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_DUPLICATE_MAIL: - xxx_info_box_80141B4(gUnknown_80DF044, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF044, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_NOT_ELIGIBLE_1: - xxx_info_box_80141B4(gUnknown_80DF0A0, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF0A0, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_NOT_ELIGIBLE_2: - xxx_info_box_80141B4(gUnknown_80DF0A0, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF0A0, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_NO_ROOM_MAIL: - xxx_info_box_80141B4(gUnknown_80DF0E0, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF0E0, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case 1: case COMMS_NO_RESPONSE: case 5: case 14: - xxx_info_box_80141B4(gUnknown_80DEF04, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DEF04, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_NOT_READY: - xxx_info_box_80141B4(gUnknown_80DF138, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF138, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case COMMS_GOOD: default: @@ -501,7 +501,7 @@ void DisplayThankYouMailCommsOutcome(void) case WONDER_MAIL_PASSWORD: case 6: // "Thank-You Mail has been sent" - xxx_info_box_80141B4(gUnknown_80DF194, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF194, 0, &sUnknown_203B2C4->monPortrait, 0x10d); break; case 4: default: @@ -810,15 +810,15 @@ void HandleThankYouMailPasswordMenu(void) switch(sub_8039068(PASSWORD_ENTRY_THANK_YOU_MAIL_MODE,sUnknown_203B2C4->passwordBuffer,&mail1)) { case PASSWORD_ENTRY_INCORRECT_PASSWORD: - sub_8014248(gUnknown_80DF1C0, 0, 7, gUnknown_80DEE44, 0, 4, 0, &sUnknown_203B2C4->faceFile, 0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF1C0, 0, 7, gUnknown_80DEE44, 0, 4, 0, &sUnknown_203B2C4->monPortrait, 0xc); SetThankYouMailMenuState(THANK_YOU_PASSWORD_WRONG); break; case PASSWORD_ENTRY_NOT_THANK_YOU_MAIL: - xxx_info_box_80141B4(gUnknown_80DF208, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF208, 0, &sUnknown_203B2C4->monPortrait, 0x10d); SetThankYouMailMenuState(PRINT_THANK_YOU_ERROR); break; case PASSWORD_ENTRY_DUPLICATE_THANK_YOU_MAIL: - xxx_info_box_80141B4(gUnknown_80DF0A0, 0, &sUnknown_203B2C4->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF0A0, 0, &sUnknown_203B2C4->monPortrait, 0x10d); SetThankYouMailMenuState(PRINT_THANK_YOU_ERROR); break; case PASSWORD_ENTRY_THANK_YOU_MAIL_SUCCESS: @@ -1261,15 +1261,15 @@ void UpdateThankYouMailText(void) pokeStruct = GetPlayerPokemonStruct(); sub_80922B4(buffer1,pokeStruct->name, POKEMON_NAME_LENGTH); sprintfStatic(sUnknown_203B2C4->formattedString,gUnknown_80DF250,buffer1); - xxx_info_box_80141B4(sUnknown_203B2C4->formattedString,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(sUnknown_203B2C4->formattedString,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case 0xe: // Is it OK to send this Thank-You Mail? - sub_8014248(gUnknown_80DF304,0,7,gUnknown_80DEE60,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF304,0,7,gUnknown_80DEE60,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case PROMPT_THANK_YOU_TO_SEND: // Please choose the Thank-You Mail that you want to send to your friend - xxx_info_box_80141B4(gUnknown_80DF330,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF330,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case 0x10: if (sub_8030894() != 0) @@ -1339,7 +1339,7 @@ void UpdateThankYouMailText(void) break; case PROMPT_THANK_YOU_PASSWORD: // OK. Please enter the Thank-You Mail Password - xxx_info_box_80141B4(gUnknown_80DF380,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF380,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case PROCESS_THANK_YOU_PASSWORD: RestoreUnkTextStruct_8006518(sUnknown_203B2C4->unk3BC); @@ -1355,19 +1355,19 @@ void UpdateThankYouMailText(void) break; case 0x1b: // Please give this password to the friend that rescued your team. I also must save your adventure - xxx_info_box_80141B4(gUnknown_80DF3B4,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF3B4,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case DISPLAY_THANK_YOU_PASSWORD: // Ok. Here is your Thank You Mail Password - xxx_info_box_80141B4(gUnknown_80DF418,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF418,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case 0x24: // I need to save your adventure - xxx_info_box_80141B4(gUnknown_80DF44C,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF44C,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case 0x20: // There we go. I'm all done. - xxx_info_box_80141B4(gUnknown_80DF46C,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF46C,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case THANK_YOU_PASSWORD_SUCCESS: switch(sUnknown_203B2C4->wonderMailMethod) @@ -1376,7 +1376,7 @@ void UpdateThankYouMailText(void) case WONDER_MAIL_PASSWORD: case 6: // A Thank You Mail has arrived from your friend - xxx_info_box_80141B4(gUnknown_80DF4F4,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF4F4,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case 4: break; @@ -1405,79 +1405,79 @@ void UpdateThankYouMailText(void) case COMMUNICATING_THANK_YOU_MAIL: // Communicating.. nullsub_23(FALSE); - xxx_info_box_80141B4(gUnknown_80DF544,0,0,0); + CreateDialogueBoxAndPortrait(gUnknown_80DF544,0,0,0); break; case 0x17: // There. I've sent your thank-you mail. I need to save your adventure. - xxx_info_box_80141B4(gUnknown_80DF594,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF594,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case PROMPT_CONNECT_GAME_LINK: // Please connect the GBA systems with a Game Link Cable - sub_8014248(gUnknown_80DF5E4,0,7,gUnknown_80DEE44,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF5E4,0,7,gUnknown_80DEE44,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case THANK_YOU_MAIL_COMMS_CLEANUP: pokeStruct2 = GetPlayerPokemonStruct(); sub_80922B4(buffer2, pokeStruct2->name, POKEMON_NAME_LENGTH); sprintfStatic(sUnknown_203B2C4->formattedString,gUnknown_80DF63C,buffer2); - xxx_info_box_80141B4(sUnknown_203B2C4->formattedString,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(sUnknown_203B2C4->formattedString,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case CONFIRM_ITEM_TO_SEND: // The item you've chosen can't be exchanged later. Is that OK? - sub_8014248(gUnknown_80DF694,0,7,gUnknown_80DEEE4,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF694,0,7,gUnknown_80DEEE4,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case 0x29: // I need to save your adventure - xxx_info_box_80141B4(gUnknown_80DF44C,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF44C,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case 0x2a: // I've saved your adventure - xxx_info_box_80141B4(gUnknown_80DF6F0,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF6F0,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case PROMPT_ITEM_TO_SEND: // Ok, please choose the item to be sent - xxx_info_box_80141B4(gUnknown_80DF710,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF710,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case THANK_YOU_MAIL_STORAGE_EMPTY: // Oh? Your storage space is empty - sub_8014248(gUnknown_80DF73C,0,0,gUnknown_80DEEBC,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF73C,0,0,gUnknown_80DEEBC,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case PROMPT_REWARD_ITEM_TO_SEND: // Would you like to choose a reward item from storage and send it with your mail? - sub_8014248(gUnknown_80DF77C,0,0,gUnknown_80DEE7C,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF77C,0,0,gUnknown_80DEE7C,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case ITEM_EXISTS_ON_THANK_YOU_MAIL: // Oh? You've already attached a reward item on this mail. - xxx_info_box_80141B4(gUnknown_80DF7D4,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF7D4,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case PROMPT_RESEND_WITH_ATTACHED_ITEM: // Would you like to send it again with the item you chose before? - sub_8014248(gUnknown_80DF870,0,7,gUnknown_80DEE44,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF870,0,7,gUnknown_80DEE44,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case NO_THANK_YOU_MAIL: // You don't seem to have a Thank-You Mail - xxx_info_box_80141B4(gUnknown_80DF8B4,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF8B4,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case THANK_YOU_MAIL_MAIN_MENU: // Hello. I handle Thank You Mail. How may I help You? - sub_8014248(gUnknown_80DF8EC,0,1,gThankYouMailMainMenuItems,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF8EC,0,1,gThankYouMailMainMenuItems,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case ANYTHING_ELSE_THANK_YOU_MAIN_MENU: // May I help you with anything else? - sub_8014248(gUnknown_80DF928,0,1,gThankYouMailMainMenuItems,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF928,0,1,gThankYouMailMainMenuItems,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case EXIT_THANK_YOU_MAIL_PRE: // Please come see me anytime - xxx_info_box_80141B4(gUnknown_80DF94C,0,&sUnknown_203B2C4->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DF94C,0,&sUnknown_203B2C4->monPortrait,0x10d); break; case SELECT_THANK_YOU_MAIL_COMMS: switch(sUnknown_203B2C4->wonderMailMode){ case WONDER_MAIL_MODE_SEND: // How would you like to send your thank you mail? - sub_8014248(gUnknown_80DF96C,0,3,gUnknown_80DEE08,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF96C,0,3,gUnknown_80DEE08,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; case WONDER_MAIL_MODE_RECEIVE: // How would you like to recieve your friend's thank you mail? - sub_8014248(gUnknown_80DF9A4,0,3,gUnknown_80DEE08,0,4,0,&sUnknown_203B2C4->faceFile,0xc); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DF9A4,0,3,gUnknown_80DEE08,0,4,0,&sUnknown_203B2C4->monPortrait,0xc); break; } break; diff --git a/src/trade_items_menu.c b/src/trade_items_menu.c index c87827123..246e264e7 100644 --- a/src/trade_items_menu.c +++ b/src/trade_items_menu.c @@ -499,14 +499,14 @@ void sub_8036B28(void) switch(sTradeItemsMenu->currMenu) { case TRADE_ITEMS_MAIN_MENU: if (sub_801CF14(0)) { - sub_8014248(sWhatDoPrompt,0,1,sUnknown_80E60D4,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sWhatDoPrompt,0,1,sUnknown_80E60D4,0,4,0,0,0x101); } else { - sub_8014248(sWhatDoPrompt,0,1,sUnknown_80E60A0,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sWhatDoPrompt,0,1,sUnknown_80E60A0,0,4,0,0,0x101); } break; case TRADE_ITEMS_SEND_ITEM: - xxx_info_box_80141B4(sPleaseChooseItem,0,0,0x101); + CreateDialogueBoxAndPortrait(sPleaseChooseItem,0,0,0x101); break; case TRADE_ITEMS_SEND_ITEM_SELECTION: if (sub_801D008() == NULL) { @@ -531,17 +531,17 @@ void sub_8036B28(void) case TRADE_ITEMS_SEND_ITEM_CONFIRM: gFormatData_202DE30 = sTradeItemsMenu->unk14.unk0; BufferItemName(gFormatItems,sTradeItemsMenu->itemToSend.id,NULL); - sub_8014248(sFmtWillBeSentPrompt,0,5, sUnknown_80E6154,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sFmtWillBeSentPrompt,0,5, sUnknown_80E6154,0,4,0,0,0x101); break; case TRADE_ITEMS_RECEIVE_ITEM: - sub_8014248(sFriendWillSendAnItem,0,5,sUnknown_80E618C,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sFriendWillSendAnItem,0,5,sUnknown_80E618C,0,4,0,0,0x101); break; case 8: - sub_8014248(sPreparingToSendItem,0,5,sUnknown_80E618C,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(sPreparingToSendItem,0,5,sUnknown_80E618C,0,4,0,0,0x101); break; case TRADE_ITEMS_IN_COMMUNICATION: nullsub_23(FALSE); - xxx_info_box_80141B4(sInCommunication,0,0,0); + CreateDialogueBoxAndPortrait(sInCommunication,0,0,0); break; case 10: sTradeItemsMenu->linkStatus = COMMS_GOOD; @@ -595,12 +595,12 @@ void sub_8036B28(void) gFormatData_202DE30 = sTradeItemsMenu->unk24C.quantity; BufferItemName(gFormatItems,sTradeItemsMenu->unk24C.itemIdx.id,NULL); } - xxx_info_box_80141B4(sFmtYouReceived,0,0,0x101); + CreateDialogueBoxAndPortrait(sFmtYouReceived,0,0,0x101); break; case 0xd: gFormatData_202DE30 = sTradeItemsMenu->unk14.unk0; BufferItemName(gFormatItems,sTradeItemsMenu->itemToSend.id,NULL); - xxx_info_box_80141B4(sFmtYouSent,0,0,0x101); + CreateDialogueBoxAndPortrait(sFmtYouSent,0,0,0x101); break; case 0xB: case 0xC: @@ -619,28 +619,28 @@ void PrintTradeItemsLinkError(u32 errorNum) case COMMS_GOOD: break; case 1: - xxx_info_box_80141B4(sCommunicationError, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sCommunicationError, 0, 0, 0x101); break; case COMMS_INCORRECT_NUM_SYSTEMS: - xxx_info_box_80141B4(sInvalidGBACount, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sInvalidGBACount, 0, 0, 0x101); break; case COMMS_NO_RESPONSE: - xxx_info_box_80141B4(sNoResponseSoRedo, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sNoResponseSoRedo, 0, 0, 0x101); break; case COMMS_DIFFERENT_MODES: - xxx_info_box_80141B4(sUnequalModes, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sUnequalModes, 0, 0, 0x101); break; case 5: - xxx_info_box_80141B4(sCommunicationError, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sCommunicationError, 0, 0, 0x101); break; case 0xe: - xxx_info_box_80141B4(sCommunicationError, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sCommunicationError, 0, 0, 0x101); break; case COMMS_NOT_READY: - xxx_info_box_80141B4(sNoResponseCheckSenderReceiver, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sNoResponseCheckSenderReceiver, 0, 0, 0x101); break; default: - xxx_info_box_80141B4(sCommunicationError, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(sCommunicationError, 0, 0, 0x101); break; } } diff --git a/src/trap.c b/src/trap.c index a2c44e550..3f1b27dcd 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3,7 +3,7 @@ #include "code_803E668.h" #include "code_8045A00.h" -#include "code_80521D0.h" +#include "dungeon_message.h" #include "code_8077274_1.h" #include "code_807CD9C.h" #include "code_808417C.h" @@ -78,7 +78,6 @@ void sub_80421EC(Position *, u32); bool8 sub_8045888(Entity *); u8 sub_8043D10(void); void sub_8068FE0(Entity *, u32, Entity *); -void sub_805239C(Entity *, u8 *); void sub_8045C28(Item *, u8 , u8); void sub_8045BF8(u8 *, Item *); void DealDamageToEntity(Entity *,s16,u32,u32); @@ -88,9 +87,7 @@ void sub_804225C(Entity *, Position *, u8); void sub_8071DA4(Entity *); extern u8 sub_803F428(Position *pos); void sub_806A1E8(Entity *pokemon); -void sub_8052364(Entity *, Position *, u8 *); void sub_8049ED4(void); -void sub_80522F4(Entity *pokemon, Entity *target, const char r2[]); u8 sub_803D6FC(void); Entity *sub_8045684(u8, Position *, u8); extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 moveType, s16); @@ -180,10 +177,10 @@ bool8 sub_807FD84(Entity *entity) gDungeon->unk13570 = 0; flag = LayTrap(&gDungeon->trapPos,gDungeon->trapID,gDungeon->unk13579); if (flag) { - sub_8052364(entity,&gDungeon->trapPos,*gUnknown_80FC5F8); // A trap was laid! + TryDisplayDungeonLoggableMessage5(entity,&gDungeon->trapPos,*gUnknown_80FC5F8); // A trap was laid! } else { - sub_8052364(entity,&gDungeon->trapPos,*gUnknown_80FC5FC); // A trap can't be laid here. + TryDisplayDungeonLoggableMessage5(entity,&gDungeon->trapPos,*gUnknown_80FC5FC); // A trap can't be laid here. } sub_8049ED4(); } @@ -275,7 +272,7 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4) if (sub_803F428(pos) != '\0') { sub_8049ED4(); } - sub_80522F4(pokemon,target,text); + TryDisplayDungeonLoggableMessage3(pokemon,target,text); if (param_3 == 0) { return; } @@ -286,10 +283,10 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4) sub_8049ED4(); sub_804225C(pokemon,pos,trapData->id); if (gDungeon->unk181e8.blinded) { - SendMessage(pokemon,*gUnknown_80FD7F4); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD7F4); } else { - SendMessage(pokemon,(gUnknown_80FD7F8)[trapData->id]); + TryDisplayDungeonLoggableMessage(pokemon,(gUnknown_80FD7F8)[trapData->id]); } } if (target != NULL) { @@ -409,7 +406,7 @@ void HandleStickyTrap(Entity *pokemon,Entity *target) info = GetEntInfo(target); if (HasHeldItem(target,0xe)) { - sub_80522F4(pokemon,target,*gUnknown_80FDC7C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC7C); } else { @@ -431,14 +428,14 @@ void HandleStickyTrap(Entity *pokemon,Entity *target) } if (itemCount == 0) { - sub_80522F4(pokemon,target,*gUnknown_80FDC40); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC40); } else { newIndex = DungeonRandInt(itemCount); sub_8045BF8(gFormatItems, itemStack[newIndex]); itemStack[newIndex]->flags |= ITEM_FLAG_STICKY; sub_80421C0(target, 0x192); - sub_80522F4(pokemon,target,*gUnknown_80FDC18); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC18); } } } @@ -525,14 +522,14 @@ void HandleGrimyTrap(Entity *pokemon, Entity *target) } } if (badFoodCount == 1) { - sub_80522F4(pokemon,target,*gUnknown_80FD788); // A food item went bad. + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD788); // A food item went bad. } else if (badFoodCount == 0) { - sub_80522F4(pokemon,target,*gUnknown_80FD7D4); // Nothing particularly bad happened. + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD7D4); // Nothing particularly bad happened. } else { - sub_80522F4(pokemon,target,*gUnknown_80FD7AC); // Several food items went bad + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD7AC); // Several food items went bad } } } @@ -545,7 +542,7 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) flag = FALSE; if (target != NULL) { if (IsBossFight()) { - SendMessage(pokemon,*gUnknown_80FED0C); // But nothing happened... + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED0C); // But nothing happened... } else { @@ -565,16 +562,16 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) gDungeon->unk2 = 2; return; } - SendMessage(pokemon,*gUnknown_80F9728); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F9728); } else { SetMessageArgument(gAvailablePokemonNames,target,0); if (info->isNotTeamMember) { - sub_80522F4(pokemon,target,*gUnknown_80F970C); // $m0 fell into the pitfall! + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F970C); // $m0 fell into the pitfall! } else { - sub_805239C(pokemon,*gUnknown_80F970C); // $m0 fell into the pitfall! + DisplayDungeonLoggableMessageTrue(pokemon,*gUnknown_80F970C); // $m0 fell into the pitfall! } sub_8068FE0(target,0x215,pokemon); } @@ -626,11 +623,11 @@ void HandleSummonTrap(Entity *pokemon,Position *pos) sub_80421EC(pos,0x194); if (pokemonSummonCount == 0) { _ret: - SendMessage(pokemon,*gUnknown_80FED04); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED04); } else { - SendMessage(pokemon,*gUnknown_80FED00); + TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED00); } } } @@ -667,9 +664,9 @@ void HandlePPZeroTrap(Entity *param_1,Entity *param_2) flag = TRUE; } if(flag) - sub_80522F4(param_1,param_2,*gUnknown_80FDA80); + TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDA80); else - sub_80522F4(param_1,param_2,*gUnknown_80FDAA0); + TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDAA0); } } @@ -707,9 +704,9 @@ void HandleSealTrap(Entity *param_1,Entity *param_2) flag = TRUE; } if(flag) - sub_80522F4(param_1,param_2,*gUnknown_80FDB04); + TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDB04); else - sub_80522F4(param_1,param_2,*gUnknown_80FDB2C); + TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDB2C); } } diff --git a/src/trap_1.c b/src/trap_1.c index a13bcccae..c4f35d0db 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -469,7 +469,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) sub_8083060(param_1,info->turnsSinceWarpScarfActivation); SavePosition(param_1,&(info->targetPos)); sub_80830A0(param_1,info->unk174); - sub_8083030(param_1,info->unk178); + sub_8083030(param_1,info->abilityEffectFlags); sub_8083048(param_1,info->unk1F8); sub_8083048(param_1,info->mobileTurnTimer); sub_8083078(param_1,info->expGainedInTurn); diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index c22ee5118..d581e09e2 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -5,6 +5,7 @@ #include "constants/status.h" #include "constants/weather.h" #include "structs/str_dungeon.h" +#include "dungeon_message.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_util.h" #include "status.h" @@ -25,7 +26,7 @@ u8 gUnknown_8106F44[] = {0x00, 0x00, 0x00, 0x00, 0x66, 0xe6, 0x00, 0x00}; u8 gUnknown_8106F4C[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00}; -struct dumb_struct +struct dumb_struct { u8 *unk0[NUM_EFFECTIVENESS]; }; @@ -42,7 +43,7 @@ u32 gTypeEffectivenessMultipliers[] = {0, 1, 2, 4}; struct unkStruct_806D010 -{ +{ s32 unk0; u32 unk4; u32 effectiveness; @@ -57,9 +58,8 @@ extern u8 *gUnknown_80FEDC8[]; extern u8 *gUnknown_80FEDA8[]; extern u8 *gUnknown_80FED88[]; -extern s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; +extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; -void sub_80522F4(Entity *, Entity *, u8 *); void sub_80428D8(Entity *); void sub_8042978(Entity *); void sub_804298C(Entity *); @@ -117,7 +117,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct gDungeon->unk134.pokemonExposed = TRUE; } else { - effectiveness = gTypeEffectivenessChart[type][targetInfo->types[index]]; + effectiveness = gTypeEffectivenessChart[type][targetInfo->types[index]]; } if (effectiveness != EFFECTIVENESS_NEUTRAL) { sub_800A34C(param_1,param_1,local_48.unk0[effectiveness]); @@ -133,7 +133,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct param_1[0] = gUnknown_8106EFC[0]; param_1[1] = temp; } - + if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (HasAbility(target,ABILITY_THICK_FAT))) { gDungeon->unk134.unk16D = TRUE; sub_800A34C(param_1,param_1,gUnknown_8106F1C); @@ -163,7 +163,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct } if (torrentVisualFlag) { sub_80428EC(pokemon); - sub_80522F4(pokemon,target,*gUnknown_80FEDA8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDA8); } } if ((type == TYPE_GRASS) && (HasAbility(pokemon, ABILITY_OVERGROW))) { @@ -175,7 +175,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct } if (overgrowVisualFlag) { sub_80428D8(pokemon); - sub_80522F4(pokemon,target,*gUnknown_80FED88); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FED88); } } if ((type == TYPE_BUG) && (HasAbility(pokemon, ABILITY_SWARM))) { @@ -187,7 +187,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct } if (swarmVisualFlag) { sub_8042978(pokemon); - sub_80522F4(pokemon,target,*gUnknown_80FEDC8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDC8); } } if ((type == TYPE_FIRE) && (HasAbility(pokemon, ABILITY_BLAZE))) { @@ -199,14 +199,14 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct } if (blazeVisualFlag) { sub_804298C(pokemon); - sub_80522F4(pokemon,target,*gUnknown_80FEDE8); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDE8); } } if (!(sub_800A2A0(param_1)) && (MonsterIsType(pokemon, type))) { gDungeon->unk134.fill16E[6] = TRUE; sub_800A34C(param_1,param_1,gUnknown_8106F14); } - weather = GetApparentWeather(pokemon); + weather = GetApparentWeather(pokemon); if (weather == WEATHER_SUNNY) { if (type == TYPE_FIRE) { gDungeon->unk134.unk16C = TRUE; diff --git a/src/wigglytuff_shop3.c b/src/wigglytuff_shop3.c index 637d27119..567209ca7 100644 --- a/src/wigglytuff_shop3.c +++ b/src/wigglytuff_shop3.c @@ -72,18 +72,18 @@ bool8 CreateWigglytuffShop(u32 mode) strcpy(gUnknown_202E1C8 - 80, str); if (sWigglytuffShop3Work->mode == 1) - sWigglytuffShop3Work->unkCC = NULL; + sWigglytuffShop3Work->monPortraitPtr = NULL; else - sWigglytuffShop3Work->unkCC = &sWigglytuffShop3Work->faceFile; + sWigglytuffShop3Work->monPortraitPtr = &sWigglytuffShop3Work->monPortrait; file = GetDialogueSpriteDataPtr(MONSTER_WIGGLYTUFF); - sWigglytuffShop3Work->faceFile = file; - sWigglytuffShop3Work->faceData = file->data; - sWigglytuffShop3Work->unkC8 = 0; - sWigglytuffShop3Work->unkC9 = 0; - sWigglytuffShop3Work->unkCA = 0; - sWigglytuffShop3Work->unkC4 = 2; - sWigglytuffShop3Work->unkC6 = 8; + sWigglytuffShop3Work->monPortrait.faceFile = file; + sWigglytuffShop3Work->monPortrait.faceData = file->data; + sWigglytuffShop3Work->monPortrait.spriteId = 0; + sWigglytuffShop3Work->monPortrait.flip = FALSE; + sWigglytuffShop3Work->monPortrait.unkE = 0; + sWigglytuffShop3Work->monPortrait.pos.x = 2; + sWigglytuffShop3Work->monPortrait.pos.y = 8; SetWigglytuffState(WIGGLYTUFF_INIT); return TRUE; } @@ -130,7 +130,7 @@ u32 sub_8021C5C(void) void CleanWigglytuffShop(void) { if (sWigglytuffShop3Work) { - CloseFile(sWigglytuffShop3Work->faceFile); + CloseFile(sWigglytuffShop3Work->monPortrait.faceFile); MemoryFree(sWigglytuffShop3Work); sWigglytuffShop3Work = NULL; } @@ -177,45 +177,45 @@ static void UpdateWigglytuffDialogue(void) switch (sWigglytuffShop3Work->state) { case WIGGLYTUFF_INIT: BuildWigglytuffMainMenu(); - sub_8014248(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_00], 0, sWigglytuffShop3Work->menuAction1, sWigglytuffShop3Work->unk1C, sWigglytuffShop3Work->unk5C, 4, 0, sWigglytuffShop3Work->unkCC, 12); + CreateMenuDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_00], 0, sWigglytuffShop3Work->menuAction1, sWigglytuffShop3Work->unk1C, sWigglytuffShop3Work->unk5C, 4, 0, sWigglytuffShop3Work->monPortraitPtr, 12); break; case WIGGLYTUFF_MAIN_MENU: BuildWigglytuffMainMenu(); - sub_8014248(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_01], 0, sWigglytuffShop3Work->menuAction1, sWigglytuffShop3Work->unk1C, sWigglytuffShop3Work->unk5C, 4, 0, sWigglytuffShop3Work->unkCC, 12); + CreateMenuDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_01], 0, sWigglytuffShop3Work->menuAction1, sWigglytuffShop3Work->unk1C, sWigglytuffShop3Work->unk5C, 4, 0, sWigglytuffShop3Work->monPortraitPtr, 12); break; case FRIEND_AREA_SELECT_BUY: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNK9; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_03], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_03], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case FRIEND_AREA_SELECT_BUY_AGAIN: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNKA; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_04], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_04], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_INFO: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_MAIN_MENU; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_19], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_19], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_PRE_EXIT: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_EXIT; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_02], 0, sWigglytuffShop3Work->unkCC, 0x30d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_02], 0, sWigglytuffShop3Work->monPortraitPtr, 0x30d); break; default: break; case WIGGLYTUFF_CANT_ADD_FRIEND_AREA: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_PRE_EXIT; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_08], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_08], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case NO_MONEY: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNKA; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_09], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_09], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case NO_FRIEND_AREAS: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_PRE_EXIT; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_10], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_10], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case NOT_ENOUGH_MONEY: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNKA; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_11], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_11], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_UNK9: sub_80211AC(2, 3); @@ -235,7 +235,7 @@ static void UpdateWigglytuffDialogue(void) CreateWigglytuffConfirmFriendAreaMenu(); WriteFriendAreaName(gUnknown_202E628, sWigglytuffShop3Work->chosenFriendArea, FALSE); gFormatData_202DE30[0] = sWigglytuffShop3Work->friendAreaPrice; - sub_8014248(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_05], 0, 5, sWigglytuffShop3Work->unk1C, 0, 4, 0, sWigglytuffShop3Work->unkCC, 12); + CreateMenuDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_05], 0, 5, sWigglytuffShop3Work->unk1C, 0, 4, 0, sWigglytuffShop3Work->monPortraitPtr, 12); break; case FRIEND_AREA_INFO: CreateWigglytuffShopFriendAreaMenu(sWigglytuffShop3Work->chosenFriendArea, FALSE, 2); @@ -243,7 +243,7 @@ static void UpdateWigglytuffDialogue(void) case CONFIRM_BUY_FRIEND_AREA: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNKD; WriteFriendAreaName(gUnknown_202E628, sWigglytuffShop3Work->chosenFriendArea, FALSE); - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_06], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_06], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_UNKD: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNKE; @@ -263,15 +263,15 @@ static void UpdateWigglytuffDialogue(void) sWigglytuffShop3Work->fallbackState = FRIEND_AREA_SELECT_BUY_AGAIN; PlaySound(206); - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_07], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_07], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_CHECK: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNK16; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_12], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_12], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_CHECK_AGAIN: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_UNK17; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_13], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_13], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_UNK16: sub_8023144(0, 3, 0, 10); @@ -307,23 +307,23 @@ static void UpdateWigglytuffDialogue(void) string = GetMonSpecies(sWigglytuffShop3Work->chosenSpecies); strcpy(gAvailablePokemonNames, string); WriteFriendAreaName(gUnknown_202E628, sWigglytuffShop3Work->chosenFriendArea, FALSE); - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_14], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_14], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_CHECK_HAS_FRIEND_AREA: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_CHECK_AGAIN; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_15], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_15], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_CHECK_POST_GAME: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_CHECK_AGAIN; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_16], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_16], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_CHECK_WONDER_MAIL: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_CHECK_AGAIN; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_17], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_17], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; case WIGGLYTUFF_CHECK_LEGENDARY: sWigglytuffShop3Work->fallbackState = WIGGLYTUFF_CHECK_AGAIN; - xxx_info_box_80141B4(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_18], 0, sWigglytuffShop3Work->unkCC, 0x10d); + CreateDialogueBoxAndPortrait(gCommonWigglytuff[sWigglytuffShop3Work->mode][WIGGLY_DLG_18], 0, sWigglytuffShop3Work->monPortraitPtr, 0x10d); break; } } diff --git a/src/wonder_mail.c b/src/wonder_mail.c index 11a76ffdf..e984ca404 100644 --- a/src/wonder_mail.c +++ b/src/wonder_mail.c @@ -203,13 +203,13 @@ u32 sub_8027F88(void) monName = GetMonSpecies(MONSTER_PELIPPER); strcpy(gAvailablePokemonNames, monName); faceFile = GetDialogueSpriteDataPtr(MONSTER_PELIPPER); - sUnknown_203B2C0->faceFile = faceFile; - sUnknown_203B2C0->faceData = faceFile->data; - sUnknown_203B2C0->unk42C = 0; - sUnknown_203B2C0->unk42D = 0; - sUnknown_203B2C0->unk42E = 0; - sUnknown_203B2C0->unk428 = 2; - sUnknown_203B2C0->unk42A = 8; + sUnknown_203B2C0->monPortrait.faceFile = faceFile; + sUnknown_203B2C0->monPortrait.faceData = faceFile->data; + sUnknown_203B2C0->monPortrait.spriteId = 0; + sUnknown_203B2C0->monPortrait.flip = FALSE; + sUnknown_203B2C0->monPortrait.unkE = 0; + sUnknown_203B2C0->monPortrait.pos.x = 2; + sUnknown_203B2C0->monPortrait.pos.y = 8; for(counter = 0; counter < PASSWORD_BUFFER_SIZE; counter++){ sUnknown_203B2C0->passwordBuffer[counter] = 0; } @@ -220,7 +220,7 @@ u32 sub_8027F88(void) u32 sub_8028078(void) { - + switch(sUnknown_203B2C0->state) { case 0x3c: sub_8029B34(); @@ -403,7 +403,7 @@ s32 sub_80282DC(u8 *r0) void sub_80282FC(void) { if (sUnknown_203B2C0 != NULL) { - CloseFile(sUnknown_203B2C0->faceFile); + CloseFile(sUnknown_203B2C0->monPortrait.faceFile); MemoryFree(sUnknown_203B2C0); sUnknown_203B2C0 = NULL; sub_8031E10(); @@ -432,13 +432,13 @@ void sub_8028348(void) sub_8031D70(sUnknown_203B2C0->mailIndex, 0); break; case 0x3C: - xxx_info_box_80141B4(gUnknown_80DDBA8, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDBA8, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case AOK_PASSWORD_DISPLAY: - xxx_info_box_80141B4(gUnknown_80DDBFC, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDBFC, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x38: - xxx_info_box_80141B4(gUnknown_80DDC30, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDC30, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case SENT_AOK_MAIL: switch(sUnknown_203B2C0->unk534) @@ -447,17 +447,17 @@ void sub_8028348(void) case 0x10: case 0xF: case 0xD: - xxx_info_box_80141B4(gUnknown_80DDC70, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDC70, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0xE: break; } break; case SENT_AOK_MAIL_SAVE_COMPLETE: - xxx_info_box_80141B4(gUnknown_80DDC30, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDC30, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case PROMPT_SELECT_HELPER_POKEMON: - xxx_info_box_80141B4(gUnknown_80DDCBC, 0, 0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80DDCBC, 0, 0,0x101); break; case SELECT_HELPER_POKEMON: if(sub_8023CE8() == 0) @@ -474,16 +474,16 @@ void sub_8028348(void) sub_8035CF4(sUnknown_203B2C0->unk21C, 3, TRUE); break; case NO_POKEMON_IN_FRIEND_AREA: - sub_8014248(gUnknown_80DDD2C, 0, 0xA, gUnknown_80DDAA0, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DDD2C, 0, 0xA, gUnknown_80DDAA0, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case CONFIRM_SEND_HELPER_POKEMON: - sub_8014248(gUnknown_80DDD88, 0, 8, gUnknown_80DDA80, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DDD88, 0, 8, gUnknown_80DDA80, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case 0x2D: - sub_8014248(gUnknown_80DDDBC, 0, 8, gUnknown_80DDA64, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DDDBC, 0, 8, gUnknown_80DDA64, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case PROMPT_CHOOSE_AOK_MAIL: - xxx_info_box_80141B4(gUnknown_80DDDD8, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDDD8, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x2A: if(sub_8030894() == 0) @@ -494,23 +494,23 @@ void sub_8028348(void) } break; case NO_AOK_MAIL_TO_SEND: - xxx_info_box_80141B4(gUnknown_80DDE20, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDE20, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x30: - xxx_info_box_80141B4(gUnknown_80DDE58, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDE58, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x2E: - sub_8014248(gUnknown_80DDEC0, 0, 0x11, gUnknown_80DDB60, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DDEC0, 0, 0x11, gUnknown_80DDB60, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case NO_MAIL_ROOM: - xxx_info_box_80141B4(gUnknown_80DDF2C, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DDF2C, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 4: - sub_8014248(gUnknown_80DDFB8, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DDFB8, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case FRIEND_RESCUE_COMMUNICATING_PRE: nullsub_23(FALSE); - xxx_info_box_80141B4(gUnknown_80DE01C, 0 , 0, 0); + CreateDialogueBoxAndPortrait(gUnknown_80DE01C, 0 , 0, 0); break; case FRIEND_RESCUE_COMMUNICATING: sUnknown_203B2C0->linkError = COMMS_GOOD; @@ -540,7 +540,7 @@ void sub_8028348(void) break; } if(sUnknown_203B2C0->linkError == COMMS_GOOD) - { + { switch(sUnknown_203B2C0->unk40) { case 3: @@ -565,17 +565,17 @@ void sub_8028348(void) case 0x10: case 0xF: case 0xD: - xxx_info_box_80141B4(gUnknown_80DE06C, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE06C, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0xE: break; } break; case RECEIVED_FRIEND_SOS_MAIL_SAVE_COMPLETE: - xxx_info_box_80141B4(gUnknown_80DE0C0, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE0C0, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case PROMPT_SOS_MAIL_PASSWORD: - xxx_info_box_80141B4(gUnknown_80DE124, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE124, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x27: RestoreUnkTextStruct_8006518(sUnknown_203B2C0->unk3BC); @@ -587,30 +587,30 @@ void sub_8028348(void) switch(sUnknown_203B2C0->unk538) { case 0: - sub_8014248(gUnknown_80DE178, 0, 0xD, gUnknown_80DDB24, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE178, 0, 0xD, gUnknown_80DDB24, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case 2: - sub_8014248(gUnknown_80DE1B4, 0, 0xD, gUnknown_80DDB24, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE1B4, 0, 0xD, gUnknown_80DDB24, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; } break; case NO_SOS_MAIL_TO_SEND: - xxx_info_box_80141B4(gUnknown_80DE1E4, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE1E4, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x1B: - xxx_info_box_80141B4(gUnknown_80DE280, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE280, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case CANT_GO_TO_DUNGEON: - xxx_info_box_80141B4(gUnknown_80DE2B0, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE2B0, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case FRIEND_RESCUE_FAILED: - xxx_info_box_80141B4(gUnknown_80DE368, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE368, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x22: - sub_8014248(gUnknown_80DDDBC, 0, 8, gUnknown_80DDA64, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DDDBC, 0, 8, gUnknown_80DDA64, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case PROMPT_CHOOSE_SOS_MAIL: - xxx_info_box_80141B4(gUnknown_80DE430, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE430, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x1F: if(sub_8030894() == 0) @@ -644,58 +644,58 @@ void sub_8028348(void) } break; case 0xB: - sub_8014248(gUnknown_80DE48C, 0, 5, gUnknown_80DD9EC, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE48C, 0, 5, gUnknown_80DD9EC, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case CHOOSE_DELETE_SOS_MAIL: - xxx_info_box_80141B4(gUnknown_80DE4B8, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE4B8, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case NO_SOS_MAIL: - xxx_info_box_80141B4(gUnknown_80DE4F0, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE4F0, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case CHOOSE_DELETE_AOK_MAIL: - xxx_info_box_80141B4(gUnknown_80DE524, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE524, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case NO_AOK_MAIL: - xxx_info_box_80141B4(gUnknown_80DE614, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE614, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case CHOOSE_DELETE_ALL_MAIL: - xxx_info_box_80141B4(gUnknown_80DE648, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE648, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case NO_MAIL: - xxx_info_box_80141B4(gUnknown_80DE694, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE694, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case PROMPT_DELETE_ALL_MAIL: - sub_8014248(gUnknown_80DE6D4, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE6D4, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case CONFIRM_DELETE_ALL_MAIL_1: - sub_8014248(gUnknown_80DE754, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE754, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case SAVING_ADVENTURE: - xxx_info_box_80141B4(gUnknown_80DE7B8, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE7B8, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case FINISH_SAVING_ADVENTURE: - xxx_info_box_80141B4(gUnknown_80DE7E8, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE7E8, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case PROMPT_DELETE_ANY_OTHER_MAIL: - sub_8014248(gUnknown_80DE808, 0, 8, gUnknown_80DDA64, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE808, 0, 8, gUnknown_80DDA64, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case CONFIRM_DELETE_ALL_MAIL_2: - xxx_info_box_80141B4(gUnknown_80DE830, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE830, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case DELETE_ALL_MAIL_SAVE_PRE: - xxx_info_box_80141B4(gUnknown_80DE864, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE864, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case 0x16: - xxx_info_box_80141B4(gUnknown_80DE7E8, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE7E8, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case INITIALIZE_FRIEND_RESCUE: - sub_8014248(gUnknown_80DE8B4, 0, 0, gUnknown_80DD970, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE8B4, 0, 0, gUnknown_80DD970, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case FRIEND_RESCUE_MAIN: - sub_8014248(gUnknown_80DE918, 0, 0, gUnknown_80DD970, 0, 4, 0, &sUnknown_203B2C0->faceFile,0xC); + CreateMenuDialogueBoxAndPortrait(gUnknown_80DE918, 0, 0, gUnknown_80DD970, 0, 4, 0, &sUnknown_203B2C0->monPortrait,0xC); break; case 2: - xxx_info_box_80141B4(gUnknown_80DE93C, 0, &sUnknown_203B2C0->faceFile,0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DE93C, 0, &sUnknown_203B2C0->monPortrait,0x10d); break; case FRIEND_RESCUE_COUNTER_EXIT: break; @@ -719,37 +719,37 @@ void PrintFriendRescueCounterError(u32 errorCode) break; case 1: case COMMS_NO_RESPONSE: - xxx_info_box_80141B4(gWonderMailErrorText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailErrorText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_INCORRECT_NUM_SYSTEMS: - xxx_info_box_80141B4(gWonderMailNumGBAsText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailNumGBAsText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_DIFFERENT_MODES: - xxx_info_box_80141B4(gWonderMailWrongModeText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailWrongModeText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case 5: - xxx_info_box_80141B4(gWonderMailErrorText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailErrorText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_NO_ROOM_STORAGE: - xxx_info_box_80141B4(gWonderMailStorageFullText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailStorageFullText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_DUPLICATE_MAIL: - xxx_info_box_80141B4(gWonderMailDuplicateText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailDuplicateText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_NOT_ELIGIBLE_1: - xxx_info_box_80141B4(gWonderMailNotEligibleReceiveText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailNotEligibleReceiveText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_NOT_ELIGIBLE_2: - xxx_info_box_80141B4(gWonderMailNotEligibleReceiveText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailNotEligibleReceiveText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_NO_ROOM_MAIL: - xxx_info_box_80141B4(gWonderMailNoRoomText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailNoRoomText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case 14: - xxx_info_box_80141B4(gWonderMailErrorText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailErrorText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; case COMMS_NOT_READY: - xxx_info_box_80141B4(gWonderMailFriendErrorText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailFriendErrorText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); break; default: break; @@ -1370,22 +1370,22 @@ void sub_80293F4(void) switch(sub_8039068(PASSWORD_ENTRY_SOS_MAIL_MODE, (sUnknown_203B2C0->passwordBuffer), &mail)) { case PASSWORD_ENTRY_INCORRECT_PASSWORD: - sub_8014248(gWonderMailPasswordIncorrectText, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->faceFile, 0xC); + CreateMenuDialogueBoxAndPortrait(gWonderMailPasswordIncorrectText, 0, 8, gUnknown_80DDA48, 0, 4, 0, &sUnknown_203B2C0->monPortrait, 0xC); SetFriendRescueCounterState(0x28); break; case PASSWORD_ENTRY_NOT_SOS_MAIL: - xxx_info_box_80141B4(gWonderMailSOSPasswordIncorrectText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailSOSPasswordIncorrectText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); SetFriendRescueCounterState(FRIEND_RESCUE_ERROR); break; case PASSWORD_ENTRY_DUPLICATE_SOS_MAIL: - xxx_info_box_80141B4(gWonderMailDuplicateText, 0, &sUnknown_203B2C0->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gWonderMailDuplicateText, 0, &sUnknown_203B2C0->monPortrait, 0x10d); SetFriendRescueCounterState(FRIEND_RESCUE_ERROR); break; case PASSWORD_ENTRY_SOS_MAIL_SUCCESS: sub_8095274(mail.unk10.unk10); mail.mailType = 2; sub_80951BC(&mail); - xxx_info_box_80141B4(gWonderMailAOKMailReceivedText, 0, &sUnknown_203B2C0->faceFile, 0x101); + CreateDialogueBoxAndPortrait(gWonderMailAOKMailReceivedText, 0, &sUnknown_203B2C0->monPortrait, 0x101); SetFriendRescueCounterState(RECEIVED_FRIEND_SOS_MAIL); break; case 23: diff --git a/src/wonder_mail_2.c b/src/wonder_mail_2.c index 3e190e999..5c9ae138f 100644 --- a/src/wonder_mail_2.c +++ b/src/wonder_mail_2.c @@ -24,14 +24,7 @@ struct unkStruct_203B2C8 // size: 0x140 /* 0x0 */ u8 currState; /* 0x1 */ u8 unk1; - /* 0x4 */ OpenedFile *faceFile; - /* 0x8 */ u8 *faceData; - /* 0xC */ u16 unkC; - /* 0xE */ u16 unkE; - /* 0x10 */ u8 unk10; - /* 0x11 */ u8 unk11; - /* 0x12 */ u8 unk12; - /* 0x13 */ u8 unk13; + /* 0x4 */ struct MonPortraitMsg monPortrait; /* 0x14 */ u8 teamName[4]; // Figure out size of this buffer u8 fill18[0x114 - 0x18]; unkStruct_802F204 unk114; @@ -94,13 +87,13 @@ s32 sub_802B2D4(void) sUnknown_203B2C8->unk1 = -1; CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, MONSTER_PELIPPER); faceFile = GetDialogueSpriteDataPtr(MONSTER_PELIPPER); - sUnknown_203B2C8->faceFile = faceFile; - sUnknown_203B2C8->faceData = faceFile->data; - sUnknown_203B2C8->unk10 = 0; - sUnknown_203B2C8->unk11 = 0; - sUnknown_203B2C8->unk12 = 0; - sUnknown_203B2C8->unkC = 2; - sUnknown_203B2C8->unkE = 8; + sUnknown_203B2C8->monPortrait.faceFile = faceFile; + sUnknown_203B2C8->monPortrait.faceData = faceFile->data; + sUnknown_203B2C8->monPortrait.spriteId = 0; + sUnknown_203B2C8->monPortrait.flip = FALSE; + sUnknown_203B2C8->monPortrait.unkE = 0; + sUnknown_203B2C8->monPortrait.pos.x = 2; + sUnknown_203B2C8->monPortrait.pos.y = 8; if (sub_8099394(&sUnknown_203B2C8->unk1) != 1) { return 0; } @@ -139,7 +132,7 @@ void sub_802B3B8(void) { if(sUnknown_203B2C8 != NULL) { - CloseFile(sUnknown_203B2C8->faceFile); + CloseFile(sUnknown_203B2C8->monPortrait.faceFile); MemoryFree(sUnknown_203B2C8); sUnknown_203B2C8 = NULL; } @@ -168,7 +161,7 @@ void sub_802B3E0(void) // Print and expand placeholders? sprintfStatic(sUnknown_203B2C8->teamName,gUnknown_80DF9F8,teamNameBuffer); // Display to screen with Pelipper face - xxx_info_box_80141B4(sUnknown_203B2C8->teamName, 0, &sUnknown_203B2C8->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(sUnknown_203B2C8->teamName, 0, &sUnknown_203B2C8->monPortrait, 0x10d); break; case 1: monName = GetMonSpecies(MONSTER_PELIPPER); @@ -189,12 +182,12 @@ void sub_802B3E0(void) case 2: // I hope you will keep on rescuing your friends // I must save your adventure - xxx_info_box_80141B4(gUnknown_80DFAA8, 0, &sUnknown_203B2C8->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DFAA8, 0, &sUnknown_203B2C8->monPortrait, 0x10d); break; case 4: // Oh yes, that's right. Please don't forget to send an A-OK Mail // to the friend you just rescued - xxx_info_box_80141B4(gUnknown_80DFB14, 0, &sUnknown_203B2C8->faceFile, 0x10d); + CreateDialogueBoxAndPortrait(gUnknown_80DFB14, 0, &sUnknown_203B2C8->monPortrait, 0x10d); case 3: case 5: break; diff --git a/src/wonder_mail_6.c b/src/wonder_mail_6.c index 580d9c063..3079b1862 100644 --- a/src/wonder_mail_6.c +++ b/src/wonder_mail_6.c @@ -19,13 +19,7 @@ struct unkStruct_203B328 MenuStruct unk8; MenuStruct unk58; UnkTextStruct2 unkA8[4]; - /* 0x108 */ OpenedFile *faceFile; - /* 0x10C */ u8 *faceData; - u16 unk110; - u16 unk112; - /* 0x114 */ u8 unk114; - /* 0x115 */ u8 unk115; - /* 0x116 */ u8 unk116; + /* 0x108 */ struct MonPortraitMsg monPortrait; u32 wonderMailType; }; static EWRAM_DATA_2 struct unkStruct_203B328 *gUnknown_203B328 = {0}; @@ -41,14 +35,14 @@ enum MenuActions { DELETE_ALL_MAIL_ACTION, // Unused }; -const MenuItem gUnknown_80E0948[] = +const MenuItem gUnknown_80E0948[] = { {"Yes", YES_ACTION}, {"No", NO_ACTION}, {NULL, CANCEL_ACTION} }; -const MenuItem gUnknown_80E0968[] = +const MenuItem gUnknown_80E0968[] = { {"Delete", DELETE_ACTION}, {"Info", INFO_ACTION}, @@ -106,7 +100,7 @@ enum States { bool8 sub_8030F58(u32 wonderMailType) { OpenedFile *file; - + ResetUnusedInputStruct(); xxx_call_save_unk_text_struct_800641C(NULL, TRUE, TRUE); if (gUnknown_203B328 == NULL) { @@ -115,24 +109,24 @@ bool8 sub_8030F58(u32 wonderMailType) } gUnknown_203B328->wonderMailType = wonderMailType; file = GetDialogueSpriteDataPtr(MONSTER_PELIPPER); - gUnknown_203B328->faceFile = file; - gUnknown_203B328->faceData = file->data; - gUnknown_203B328->unk114 = 0; - gUnknown_203B328->unk115 = 0; - gUnknown_203B328->unk116 = 0; - gUnknown_203B328->unk110 = 2; - gUnknown_203B328->unk112 = 8; + gUnknown_203B328->monPortrait.faceFile = file; + gUnknown_203B328->monPortrait.faceData = file->data; + gUnknown_203B328->monPortrait.spriteId = 0; + gUnknown_203B328->monPortrait.flip = FALSE; + gUnknown_203B328->monPortrait.unkE = 0; + gUnknown_203B328->monPortrait.pos.x = 2; + gUnknown_203B328->monPortrait.pos.y = 8; if (HasNoWonderMailType(wonderMailType)) { switch(wonderMailType) { case WONDER_MAIL_TYPE_SOS_1: // "You don't have any {COLOR CYAN_G}SOS Mail{RESET}.\0" - xxx_info_box_80141B4(gUnknown_80E09D8,0,&gUnknown_203B328->faceFile,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E09D8,0,&gUnknown_203B328->monPortrait,0x101); break; case WONDER_MAIL_TYPE_AOK: // "You don't have any {COLOR CYAN_G}A-OK Mail{RESET}.\0" - xxx_info_box_80141B4(gUnknown_80E0A0C,0,&gUnknown_203B328->faceFile,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E0A0C,0,&gUnknown_203B328->monPortrait,0x101); break; } gUnknown_203B328->state = 5; @@ -172,7 +166,7 @@ void sub_80310B4(void) { sub_803084C(); if (gUnknown_203B328 != NULL) { - CloseFile(gUnknown_203B328->faceFile); + CloseFile(gUnknown_203B328->monPortrait.faceFile); MemoryFree(gUnknown_203B328); gUnknown_203B328 = NULL; } @@ -274,7 +268,7 @@ static void sub_8031300(void) static void HandleWonderMail6MainMenu(void) { s32 menuAction; - + menuAction = 0; sub_8030768(0); if (!sub_8012FD8(&gUnknown_203B328->unk8)) { @@ -304,7 +298,7 @@ static void HandleWonderMail6DeleteMailMenu(u32 state) s32 index; s32 menuAction; unkStruct_203B480 *unused; - + menuAction = 0; sub_8030768(0); sub_8012FD8(&gUnknown_203B328->unk8); diff --git a/src/wonder_mail_802D098.c b/src/wonder_mail_802D098.c index 9fe110281..28b1a3b0f 100644 --- a/src/wonder_mail_802D098.c +++ b/src/wonder_mail_802D098.c @@ -193,27 +193,27 @@ static void sub_802D2A8(void) break; case 1: sub_802D73C(); - sub_8014248(sReplaceOldMailPrompt, 0, sUnknown_203B2F8->menuAction2, sUnknown_203B2F8->unk158, 0, 4, 0, NULL, 0); + CreateMenuDialogueBoxAndPortrait(sReplaceOldMailPrompt, 0, sUnknown_203B2F8->menuAction2, sUnknown_203B2F8->unk158, 0, 4, 0, NULL, 0); break; case DUPLICATE_WONDER_MAIL: sUnknown_203B2F8->fallbackState = WONDER_MAIL_EXIT; - xxx_info_box_80141B4(sMailAlreadyReceived, 0, NULL, 0x101); + CreateDialogueBoxAndPortrait(sMailAlreadyReceived, 0, NULL, 0x101); break; case DUPLICATE_WONDER_MAIL_1: sUnknown_203B2F8->fallbackState = WONDER_MAIL_EXIT; - xxx_info_box_80141B4(sMailAlreadyReceivedMayNotReceiveAgain, 0, NULL, 0x101); + CreateDialogueBoxAndPortrait(sMailAlreadyReceivedMayNotReceiveAgain, 0, NULL, 0x101); break; case 5: sUnknown_203B2F8->fallbackState = WONDER_MAIL_EXIT; - xxx_info_box_80141B4(sOnlyOneMailCanBeHeldPleaseCompleteFirst, 0, NULL, 0x101); + CreateDialogueBoxAndPortrait(sOnlyOneMailCanBeHeldPleaseCompleteFirst, 0, NULL, 0x101); break; case 6: sUnknown_203B2F8->fallbackState = WONDER_MAIL_EXIT; - xxx_info_box_80141B4(sTeamQuicksavedCompleteFirst, 0, NULL, 0x101); + CreateDialogueBoxAndPortrait(sTeamQuicksavedCompleteFirst, 0, NULL, 0x101); break; case 7: sUnknown_203B2F8->fallbackState = DRAW_JOB_LIST_1; - xxx_info_box_80141B4(sTeamQuicksavedCannotDelete, 0, NULL, 0x101); + CreateDialogueBoxAndPortrait(sTeamQuicksavedCannotDelete, 0, NULL, 0x101); break; case RECEIVE_WONDER_MAIL: sUnknown_203B2F8->wonderMailAccepted = TRUE; @@ -242,15 +242,15 @@ static void sub_802D2A8(void) } sUnknown_203B2F8->fallbackState = WONDER_MAIL_EXIT; - xxx_info_box_80141B4(sReceivedWonderMail, 0, NULL, 0x101); + CreateDialogueBoxAndPortrait(sReceivedWonderMail, 0, NULL, 0x101); break; case 9: sub_802D690(); - sub_8014248(sOnlyOneMailCanBeHeldSoReplacePrompt,0,sUnknown_203B2F8->menuAction3,sUnknown_203B2F8->unk158,0,4,0,0,0); + CreateMenuDialogueBoxAndPortrait(sOnlyOneMailCanBeHeldSoReplacePrompt,0,sUnknown_203B2F8->menuAction3,sUnknown_203B2F8->unk158,0,4,0,0,0); break; case JOB_LIST_FULL: sUnknown_203B2F8->fallbackState = DRAW_JOB_LIST; - xxx_info_box_80141B4(sJobListFullPleaseDelete, 0, NULL, 0x101); + CreateDialogueBoxAndPortrait(sJobListFullPleaseDelete, 0, NULL, 0x101); break; case DRAW_JOB_LIST: sub_802C4C8(0, NULL, 4); diff --git a/src/wonder_mail_main_menu.c b/src/wonder_mail_main_menu.c index 09f27b39a..e64fcedef 100644 --- a/src/wonder_mail_main_menu.c +++ b/src/wonder_mail_main_menu.c @@ -282,30 +282,30 @@ void PrintWonderMailMainMenuError(u32 status) break; case 1: // "Communication Error" - xxx_info_box_80141B4(gUnknown_80E7914, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7914, 0, 0, 0x101); break; case COMMS_INCORRECT_NUM_SYSTEMS: // Incorrect number of GBA Systems - xxx_info_box_80141B4(gUnknown_80E7938, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7938, 0, 0, 0x101); break; case COMMS_NO_RESPONSE: // No response from friend. Redo from start - xxx_info_box_80141B4(gUnknown_80E7994, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7994, 0, 0, 0x101); break; case COMMS_DIFFERENT_MODES: // Sender and receiver in different modes - xxx_info_box_80141B4(gUnknown_80E79E4, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E79E4, 0, 0, 0x101); break; case 5: // "Communication Error" - xxx_info_box_80141B4(gUnknown_80E7914, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7914, 0, 0, 0x101); break; case 14: // "Communication Error" - xxx_info_box_80141B4(gUnknown_80E7914, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7914, 0, 0, 0x101); break; case COMMS_NOT_READY: // "No response from your friend. Make sure sender and receiver are ready" - xxx_info_box_80141B4(gUnknown_80E7A48, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7A48, 0, 0, 0x101); break; case COMMS_NO_ROOM_STORAGE: case COMMS_DUPLICATE_MAIL: @@ -317,7 +317,7 @@ void PrintWonderMailMainMenuError(u32 status) case COMMS_NO_ROOM_MAIL: default: // "Communication Error" - xxx_info_box_80141B4(gUnknown_80E7914, 0, 0, 0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7914, 0, 0, 0x101); break; } @@ -451,10 +451,10 @@ void WonderMailMainMenuCallback(void) switch(gUnknown_203B3E8->state) { case SELECT_WONDER_MAIL_MODE_MAIN_SCREEN: - sub_8014248(gUnknown_80E7AC4,0,1,gSelectWonderMailModeMainMenuItems,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(gUnknown_80E7AC4,0,1,gSelectWonderMailModeMainMenuItems,0,4,0,0,0x101); break; case SEND_WONDER_MAIL_MAIN_SCREEN: - sub_8014248(gUnknown_80E7AE0,0,3,gSendWonderMailMainMenuItems,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(gUnknown_80E7AE0,0,3,gSendWonderMailMainMenuItems,0,4,0,0,0x101); break; case 3: ResetUnusedInputStruct(); @@ -462,7 +462,7 @@ void WonderMailMainMenuCallback(void) sub_802EF48(); break; case RECEIVE_WONDER_MAIL_MAIN_SCREEN: - sub_8014248(gUnknown_80E7B14,0,3,gReceiveWonderMailMainMenuItems,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(gUnknown_80E7B14,0,3,gReceiveWonderMailMainMenuItems,0,4,0,0,0x101); break; case PASSWORD_SUCCESS: gUnknown_203B3E8->unk474 = gUnknown_203B3E8->unk3C0.mail; @@ -485,33 +485,33 @@ void WonderMailMainMenuCallback(void) { case WONDER_MAIL_GAME_LINK: case WONDER_MAIL_PASSWORD: - xxx_info_box_80141B4(gUnknown_80E7B48,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7B48,0,0,0x101); break; case 4: break; } } else - xxx_info_box_80141B4(gUnknown_80E7B48,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7B48,0,0,0x101); break; case WONDER_MAIL_SENT: - xxx_info_box_80141B4(gUnknown_80E7B68,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7B68,0,0,0x101); break; case WONDER_MAIL_ADDED: if (gUnknown_203B3E8->wonderMailAccepted) { - xxx_info_box_80141B4(gUnknown_80E7B88,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7B88,0,0,0x101); } else { // Wonder Mail was refused - xxx_info_box_80141B4(gUnknown_80E7BC8,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7BC8,0,0,0x101); } break; case GAME_LINK_CABLE_MENU: - sub_8014248(gUnknown_80E7BEC,0,6,gUnknown_80E78F8,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(gUnknown_80E7BEC,0,6,gUnknown_80E78F8,0,4,0,0,0x101); break; case 6: nullsub_23(FALSE); - xxx_info_box_80141B4(gUnknown_80E7C48,0,0,0); + CreateDialogueBoxAndPortrait(gUnknown_80E7C48,0,0,0); break; case 9: gUnknown_203B3E8->wonderMailStatus = COMMS_GOOD; @@ -557,7 +557,7 @@ void WonderMailMainMenuCallback(void) xxx_call_start_bg_music(); break; case PROMPT_PASSWORD_ENTRY: - xxx_info_box_80141B4(gUnknown_80E7C98,0,0,0x101); + CreateDialogueBoxAndPortrait(gUnknown_80E7C98,0,0,0x101); break; case PASSWORD_ENTRY_SCREEN: RestoreUnkTextStruct_8006518(gUnknown_203B3E8->unk1EC); @@ -566,7 +566,7 @@ void WonderMailMainMenuCallback(void) sub_80151C0(5,gUnknown_203B3E8->PasswordEntryBuffer); break; case PASSWORD_INVALID: - sub_8014248(gUnknown_80E7CC4,0,6,gUnknown_80E78F8,0,4,0,0,0x101); + CreateMenuDialogueBoxAndPortrait(gUnknown_80E7CC4,0,6,gUnknown_80E78F8,0,4,0,0,0x101); break; } } diff --git a/sym_ewram.txt b/sym_ewram.txt index ed2d88649..43bdad363 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -392,47 +392,8 @@ gUnknown_202F1E0: /* 202F1E0 (sub_80511F0) */ gUnknown_202F1E1: /* 202F1E1 (sub_80511F0 - sub_8051438) */ .space 0x7 -gUnknown_202F1E8: /* 202F1E8 (sub_80521D0 - sub_80523A8) */ - .space 0x8 - -gUnknown_202F1F0: /* 202F1F0 (sub_8052FB8) */ - .space 0x8 - -gUnknown_202F1F8: /* 202F1F8 (sub_80532B4 - sub_8053540) */ - .space 0x4 -gUnknown_202F1FC: /* 202F1FC (sub_80532B4 - sub_8053540) */ - .space 0x4 - -gUnknown_202F200: /* 202F200 (sub_805363C) */ - .space 0x8 - -gUnknown_202F208: /* 202F208 (sub_8053704 - sub_8067904) */ - .space 0x4 -gUnknown_202F20C: /* 202F20C (sub_8053704 - sub_8055FA0) */ - .space 0x4 -gUnknown_202F210: /* 202F210 (sub_8055FA0 - sub_805A210) */ - .space 0x4 -gUnknown_202F214: /* 202F214 (sub_8055FA0 - sub_8059988) */ - .space 0x4 -gUnknown_202F218: /* 202F218 (sub_8055FA0 - sub_8059988) */ - .space 0x1 -gUnknown_202F219: /* 202F219 (sub_8055FA0 - sub_80588B8) */ - .space 0x1 -gUnknown_202F21A: /* 202F21A (sub_8055FA0 - sub_8058A18) */ - .space 0x2 -gUnknown_202F21C: /* 202F21C (sub_8055FA0 - sub_805768C) */ - .space 0x4 -gUnknown_202F220: /* 202F220 (sub_8055FA0 - sub_805768C) */ - .space 0x1 -gUnknown_202F221: /* 202F221 (sub_8055A00 - sub_8072CF4) */ - .space 0x1 -gUnknown_202F222: /* 202F222 (sub_8053704 - sub_8072CF4) */ - .space 0x2 -gUnknown_202F224: /* 202F224 (sub_8040DA0 - sub_805B264) */ - .space 0x4 -gUnknown_202F228: /* 202F228 (sub_8055FA0 - sub_805B618) */ - .space 0x4 - + .include "src/dungeon_message.o" + .include "src/dungeon_move.o" .include "src/code_805D8C8_1.o" gUnknown_202F268: /* 202F268 (sub_8062500) */