From c6a0dd2d0fa82944a98771675b6d550aaa1cc973 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 22 Oct 2024 11:09:42 +0200 Subject: [PATCH] document some of the message log --- asm/code_8040094.s | 2 +- asm/code_8045A00.s | 22 +-- asm/code_8046CE4.s | 14 +- asm/code_804FD30.s | 6 +- asm/code_80521D0.s | 164 ++++------------ asm/code_805D8C8.s | 10 +- asm/code_805D8C8_1.s | 2 +- asm/code_8066D04.s | 20 +- asm/code_8069E0C.s | 6 +- asm/code_806E8B0.s | 4 +- asm/code_8072CF4.s | 4 +- asm/code_807CD9C.s | 22 +-- asm/code_807E5AC.s | 16 +- asm/code_807FCD4.s | 4 +- include/code_80521D0.h | 2 +- include/structs/str_dungeon.h | 10 +- src/code_8040094.c | 2 +- src/code_8048480.c | 58 +++--- src/code_80521D0.c | 308 +++++++++++++++---------------- src/code_805D8C8_1.c | 14 +- src/code_8066D04.c | 48 ++--- src/code_8069E0C.c | 8 +- src/code_806CD90.c | 34 ++-- src/code_806E8B0.c | 8 +- src/code_806FDF4.c | 8 +- src/code_80718D8.c | 16 +- src/code_8072B78.c | 4 +- src/code_8073CF0.c | 12 +- src/code_8077274_1.c | 242 ++++++++++++------------ src/code_807CD9C.c | 24 +-- src/code_807E1A0.c | 14 +- src/dungeon_ai.c | 4 +- src/dungeon_ai_attack.c | 10 +- src/dungeon_ai_leader.c | 8 +- src/dungeon_pokemon_attributes.c | 8 +- src/move_actions.c | 104 +++++------ src/move_effects_target.c | 158 ++++++++-------- src/status.c | 174 ++++++++--------- src/status_actions.c | 68 +++---- src/status_checks.c | 28 +-- src/status_checks_1.c | 2 +- src/trap.c | 44 ++--- src/type_effectiveness.c | 10 +- 43 files changed, 817 insertions(+), 909 deletions(-) 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..c1db30ad5 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,7 +288,7 @@ _08045FE8: ldr r0, _08045FFC ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08045FF2: ldrb r0, [r5, 0x2] bl HandleOnPickupTutorial @@ -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,7 +394,7 @@ _080460C0: ldr r0, _080460F4 ldr r1, [r0] adds r0, r7, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _080460DA: ldrb r0, [r5, 0x2] bl HandleOnPickupTutorial @@ -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..b27bd156b 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} diff --git a/asm/code_80521D0.s b/asm/code_80521D0.s index c821376e1..56260ff8d 100644 --- a/asm/code_80521D0.s +++ b/asm/code_80521D0.s @@ -6,96 +6,6 @@ .text - 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: @@ -175,7 +85,7 @@ _08053792: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 adds r5, r4, 0 b _08053A1C .align 2, 0 @@ -250,7 +160,7 @@ _08053828: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 adds r5, r4, 0 movs r3, 0x1 str r3, [sp, 0x2C] @@ -427,7 +337,7 @@ _0805397C: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _080539D0 .align 2, 0 _080539B4: .4byte gAdjacentTileOffsets @@ -439,7 +349,7 @@ _080539C4: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 _080539D0: str r5, [sp, 0x20] ldr r5, [sp, 0x38] @@ -467,7 +377,7 @@ _080539FA: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _08053A1C .align 2, 0 _08053A08: .4byte 0x00000163 @@ -477,7 +387,7 @@ _08053A10: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 _08053A1C: ldr r1, _08053ADC ldr r0, [r1] @@ -551,7 +461,7 @@ _08053A86: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 adds r0, r5, 0 bl sub_8041B48 adds r0, r5, 0 @@ -611,7 +521,7 @@ _08053B20: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 adds r0, r5, 0 bl sub_8041BA8 adds r0, r5, 0 @@ -664,7 +574,7 @@ _08053B90: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 movs r3, 0 str r3, [sp, 0x28] _08053BAE: @@ -699,7 +609,7 @@ _08053BC0: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 movs r2, 0 str r2, [sp, 0x28] _08053BFA: @@ -797,7 +707,7 @@ _08053CA8: ldr r2, [r0] adds r0, r7, 0 adds r1, r7, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _08053D10 .align 2, 0 _08053CC4: .4byte 0x00000157 @@ -825,7 +735,7 @@ _08053CF4: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 b _08053D10 .align 2, 0 _08053D00: .4byte gUnknown_80F93A4 @@ -834,7 +744,7 @@ _08053D04: ldr r2, [r0] adds r0, r7, 0 adds r1, r5, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 _08053D10: adds r0, r5, 0 bl sub_8045888 @@ -3732,7 +3642,7 @@ _080557C0: ldr r2, [r0] adds r0, r6, 0 adds r1, r4, 0 - bl sub_805232C + bl TryDisplayDungeonLoggableMessage4 adds r0, r6, 0 adds r1, r4, 0 bl sub_8042238 @@ -3746,7 +3656,7 @@ _08055814: ldr r2, [r0] adds r0, r6, 0 adds r1, r4, 0 - bl sub_80522F4 + bl TryDisplayDungeonLoggableMessage3 _08055820: movs r0, 0x1 mov r2, r8 @@ -4077,7 +3987,7 @@ _08055A74: _08055A8A: ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0 b _08055DB4 .align 2, 0 @@ -4226,7 +4136,7 @@ _08055BA0: ldr r0, _08055C0C ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r2, 0 _08055BBA: cmp r2, 0 @@ -4259,7 +4169,7 @@ _08055BBA: ldr r0, _08055C1C ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage ldr r0, [sp, 0x28] str r0, [sp] add r1, sp, 0x8 @@ -4313,7 +4223,7 @@ _08055C56: ldr r0, _08055C74 ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08055C82 .align 2, 0 _08055C70: .4byte gUnknown_202F208 @@ -4322,7 +4232,7 @@ _08055C78: ldr r0, _08055DC4 ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08055C82: movs r0, 0x1 bl sub_804178C @@ -4406,7 +4316,7 @@ _08055CDC: ldr r0, _08055DD0 ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08055D36: ldr r1, [sp, 0x28] str r1, [sp] @@ -4507,7 +4417,7 @@ _08055DEC: ldr r0, _08055F68 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 bl ImmobilizedStatusTarget @@ -4520,7 +4430,7 @@ _08055E10: ldr r0, _08055F6C ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 bl ImmobilizedStatusTarget @@ -4533,7 +4443,7 @@ _08055E2C: ldr r0, _08055F70 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 bl ImmobilizedStatusTarget @@ -4546,7 +4456,7 @@ _08055E48: ldr r0, _08055F74 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x1 @@ -4560,7 +4470,7 @@ _08055E66: ldr r0, _08055F78 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x1 @@ -4574,7 +4484,7 @@ _08055E84: ldr r0, _08055F7C ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x1 @@ -4588,7 +4498,7 @@ _08055EA2: ldr r0, _08055F80 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x1 @@ -4602,7 +4512,7 @@ _08055EC0: ldr r0, _08055F84 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage ldr r1, _08055F88 adds r0, r4, 0 movs r2, 0x1 @@ -4622,7 +4532,7 @@ _08055EEA: ldr r0, _08055F8C ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x1 @@ -4638,7 +4548,7 @@ _08055F0C: ldr r0, _08055F90 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x1 @@ -4658,7 +4568,7 @@ _08055F2C: ldr r0, _08055F98 ldr r1, [r0] adds r0, r4, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage adds r0, r4, 0 bl sub_80428A0 ldr r0, _08055F9C @@ -4913,7 +4823,7 @@ _08056156: bl SetMessageArgument adds r0, r5, 0 mov r1, r8 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0xA movs r1, 0x3F bl sub_803E708 @@ -4921,7 +4831,7 @@ _08056156: _08056188: ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage _08056190: movs r0, 0 b _08056446 @@ -4945,7 +4855,7 @@ _080561A0: bl sub_80928C0 adds r0, r5, 0 mov r1, r8 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0xA movs r1, 0x3F bl sub_803E708 @@ -4964,14 +4874,14 @@ _080561E0: bl BufferItemName adds r0, r5, 0 mov r1, r8 - bl SendMessage + bl TryDisplayDungeonLoggableMessage movs r0, 0xA movs r1, 0x3F bl sub_803E708 ldr r0, _08056210 ldr r1, [r0] adds r0, r5, 0 - bl SendMessage + bl TryDisplayDungeonLoggableMessage b _08056190 .align 2, 0 _0805620C: .4byte gFormatItems diff --git a/asm/code_805D8C8.s b/asm/code_805D8C8.s index fa18aaea7..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 @@ -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 diff --git a/asm/code_805D8C8_1.s b/asm/code_805D8C8_1.s index cd5774095..9f519fcca 100644 --- a/asm/code_805D8C8_1.s +++ b/asm/code_805D8C8_1.s @@ -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] diff --git a/asm/code_8066D04.s b/asm/code_8066D04.s index 0033ad2ce..e26894dad 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] @@ -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 @@ -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 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index 2a76b35cc..7c6440eca 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} @@ -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_8072CF4.s b/asm/code_8072CF4.s index eb6f4b4f7..c9e84e055 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 @@ -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 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 c91b8eee1..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 @@ -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/include/code_80521D0.h b/include/code_80521D0.h index bc98b6563..241014353 100644 --- a/include/code_80521D0.h +++ b/include/code_80521D0.h @@ -3,6 +3,6 @@ #include "structs/dungeon_entity.h" -void SendMessage(Entity *pokemon, const char message[]); +void TryDisplayDungeonLoggableMessage(Entity *pokemon, const char message[]); #endif // GUARD_CODE_80521D0_H \ No newline at end of file diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index d02748372..5f6cec483 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -227,15 +227,15 @@ struct UnkStructDungeon1BDD4 u32 unk1C06C; // 0x298 }; -#define UNK_1C070_ARR_COUNT 20 -#define UNK_1C070_BUFFER_SIZE 60 +#define MESSAGE_LOG_STRINGS_COUNT 20 +#define MESSAGE_LOG_BUFFER_SIZE 60 -struct UnkDungeonStruct1C070 +struct MessageLogString { u8 unk0; u8 unk1; u8 unk2; - u8 unk3[UNK_1C070_BUFFER_SIZE]; + u8 str[MESSAGE_LOG_BUFFER_SIZE]; }; // size: 0x1CEDC @@ -409,7 +409,7 @@ typedef struct Dungeon /* 0x181E8 */ UnkDungeonGlobal_unk181E8_sub unk181e8; u8 fill18220[0x1BDD4 - 0x1822C]; struct UnkStructDungeon1BDD4 unk1BDD4; - struct UnkDungeonStruct1C070 unk1C070[UNK_1C070_ARR_COUNT]; + struct MessageLogString messageLogStrings[MESSAGE_LOG_STRINGS_COUNT]; /* 0x1C570 */ DungeonLocation unk1C570; /* 0x1C574 */ UnkDungeonGlobal_unk1C574 unk1C574; /* 0x1C590 */ UnkDungeonGlobal_unk1C590 unk1C590[4]; diff --git a/src/code_8040094.c b/src/code_8040094.c index aeb697ad5..050d4c653 100644 --- a/src/code_8040094.c +++ b/src/code_8040094.c @@ -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_8048480.c b/src/code_8048480.c index 1d6ab3612..45bd69a99 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -110,7 +110,7 @@ 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 TryDisplayDungeonLoggableMessage3(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 *); @@ -227,7 +227,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 +240,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 +263,7 @@ _jump: } else { - sub_80522F4(pokemon,target,*gUnknown_80FE458); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE458); goto _080482B4; } } @@ -467,7 +467,7 @@ _jump: } else { - sub_80522F4(pokemon,target,*gUnknown_80FE458); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE458); } break; } @@ -547,7 +547,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 +556,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 +587,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 +603,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 +617,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 +668,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 +694,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 +710,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 +763,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 +776,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); } @@ -1039,14 +1039,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 +1088,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 index 8493fa40d..72d1c760d 100644 --- a/src/code_80521D0.c +++ b/src/code_80521D0.c @@ -21,36 +21,81 @@ #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 *r0, const char *str, u8 r2); + extern bool8 sub_8045888(Entity *r0); -void sub_80523A8(Entity *r0, const char *str, u8 r2); extern u8 sub_8052DC0(Entity *); extern u8 sub_803F428(Position *); +extern void sub_805E804(void); +extern void sub_803EAF0(s32, s32); +extern void sub_8052210(u32); +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 u8 gUnknown_203B40C; +extern u8 gUnknown_202EE01; +extern Entity *gUnknown_202F1E8; +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 SpriteOAM gUnknown_202F1F0; +extern SpriteOAM gUnknown_202F200; +extern s32 gUnknown_202F1F8; +extern u8 gUnknown_202F1FC; +extern UnkTextStruct1 gUnknown_2027370[4]; +extern s32 gUnknown_202EDCC; +extern u8 gFontPalette[]; + +extern const u8 gUnknown_80F7AF8[]; +extern const u8 gUnknown_80F7AFC[]; +extern const u8 gUnknown_80F7B04[]; +extern const u16 gUnknown_80F7AEA[]; + +// Used for gUnknown_202F1FC +#define FLAG_CAN_SCROLL_UP 0x1 +#define FLAG_CAN_SCROLL_DOWN 0x2 void sub_805229C(void) { return sub_80526D0(0x50); } -void SendMessage(Entity *pokemon, const char *str) +void TryDisplayDungeonLoggableMessage(Entity *pokemon, const char *str) { if (sub_8045888(pokemon)){ - sub_80523A8(pokemon, str, TRUE); + DisplayMessageAddToLog(pokemon, str, TRUE); } } -void sub_80522C8(Entity *r0, const char *str) +UNUSED void TryDisplayDungeonLoggableMessage2(Entity *r0, const char *str) { if (sub_8045888(r0)){ - sub_80523A8(r0, str, FALSE); + DisplayMessageAddToLog(r0, str, FALSE); } } void sub_80522E8(Entity *r0, const char *str) { - sub_80523A8(r0, str, FALSE); + DisplayMessageAddToLog(r0, str, FALSE); } -void sub_80522F4(Entity *r0, Entity *r1, const char *str) +void TryDisplayDungeonLoggableMessage3(Entity *r0, Entity *r1, const char *str) { u8 flag; flag = sub_8045888(r0) ? TRUE : FALSE; @@ -60,11 +105,11 @@ void sub_80522F4(Entity *r0, Entity *r1, const char *str) } if(flag) { - sub_80523A8(r0, str, TRUE); + DisplayMessageAddToLog(r0, str, TRUE); } } -void sub_805232C(Entity *r0, Entity *r1, const char *str) +void TryDisplayDungeonLoggableMessage4(Entity *r0, Entity *r1, const char *str) { u8 flag; flag = sub_8045888(r0) ? TRUE : FALSE; @@ -74,11 +119,11 @@ void sub_805232C(Entity *r0, Entity *r1, const char *str) } if(flag) { - sub_80523A8(r0, str, FALSE); + DisplayMessageAddToLog(r0, str, FALSE); } } -void sub_8052364(Entity *r0, Position *pos, const char *str) +void TryDisplayDungeonLoggableMessage5(Entity *r0, Position *pos, const char *str) { u8 flag; flag = sub_8045888(r0) ? TRUE : FALSE; @@ -88,23 +133,16 @@ void sub_8052364(Entity *r0, Position *pos, const char *str) } if(flag) { - sub_80523A8(r0, str, TRUE); + DisplayMessageAddToLog(r0, str, TRUE); } } void sub_805239C(Entity *r0, const char *str) { - sub_80523A8(r0, str, TRUE); + DisplayMessageAddToLog(r0, str, TRUE); } -void sub_8053210(u8 *txt, u32 a1, u32 a2); - -extern Entity *gUnknown_202F1E8; -extern u8 gUnknown_203B434; - -extern void sub_805E804(void); - -void sub_80523A8(Entity *r0, const char *str, bool8 r2) +static void DisplayMessageAddToLog(Entity *r0, const char *str, bool8 r2) { u8 txt[64]; u32 r7; @@ -141,7 +179,7 @@ void sub_80523A8(Entity *r0, const char *str, bool8 r2) str = xxx_format_string(str, txt, txt + 62, 128); if (*str == '\r') str++; if (*str == '\n') str++; - sub_8053210(txt, r7, r8); + CopyStringToMessageLog(txt, r7, r8); r7 = 0; r8 = 0; if (r2) { @@ -166,11 +204,6 @@ void sub_80523A8(Entity *r0, const char *str, bool8 r2) } } -extern void (*gUnknown_203B08C)(s32); - -extern void sub_803EAF0(s32, s32); -extern void sub_8052210(u32); - void xxx_draw_string_80524F0(void) { struct UnkStructDungeon1BDD4 *strPtr = &gDungeon->unk1BDD4; @@ -268,17 +301,12 @@ void sub_8052740(s32 a0) } } -extern u8 gUnknown_203B40C; -extern u8 gUnknown_202EE01; - struct MonDialogueSpriteInfo { s16 species; u8 spriteId; }; -extern void sub_8040238(void); - // Prints string in dialogue box and waits for A/B button press #define PRINT_STRING_WAIT_PRESS(chosenMenuIndex) \ { \ @@ -350,10 +378,6 @@ void sub_80528F4(Entity *a0, const u8 *str) sub_80522E8(a0, str); } -extern const u8 gUnknown_80F7AF8[]; -extern const u8 gUnknown_80F7AFC[]; -extern const u8 gUnknown_80F7B04[]; - struct DungeonDialogueStruct { u16 unk0; @@ -371,11 +395,6 @@ struct Struct_sub_808CDB0 }; extern const struct Struct_sub_808CDB0 *sub_808CDB0(s32 a0); -extern const u16 gUnknown_80F7AEA[]; - -extern u8 gAvailablePokemonNames[]; -extern u8 gUnknown_202E5D8[]; -extern u8 gUnknown_202DFE8[]; void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) { @@ -624,7 +643,9 @@ extern const struct TutorialFlagMsg gPechaTutorial; extern const struct TutorialFlagMsg gSleepSeedTutorial; extern const struct TutorialFlagMsg gMoneyTutorial; -extern void sub_8083E28(void); +extern const u8 *const gUnknown_80FF6F8; +extern const u8 *const gUnknown_80FF6A4; +extern const u8 gUnknown_8106990[]; // Possibly something menu related? static inline bool32 DislayTutorialMsg(Entity *leader, const struct TutorialFlagMsg *tutorial, bool32 unkFunctionCall) { @@ -690,9 +711,6 @@ void HandleOnPickupTutorial(u8 itemId) } } -extern const u8 *const gUnknown_80FF6F8; -extern const u8 *const gUnknown_80FF6A4; - void DisplayYouReachedDestFloorStr(void) { if (gDungeon->unkA != 0) { @@ -703,10 +721,6 @@ void DisplayYouReachedDestFloorStr(void) } } -extern SpriteOAM gUnknown_202F1F0; - -extern u8 gFontPalette[]; - // Used only for displaying Frosy Forest's text at floor 6 void sub_8052FB8(const u8 *str) { @@ -809,11 +823,11 @@ void sub_80531A8(void) gDungeon->unk16 = 0; gDungeon->unkB = 1; - for (i = 0; i < UNK_1C070_ARR_COUNT; i++) { - gDungeon->unk1C070[i].unk3[0] = 0; - gDungeon->unk1C070[i].unk0 = 0; - gDungeon->unk1C070[i].unk1 = 0; - gDungeon->unk1C070[i].unk2 = 0; + 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; } } @@ -822,47 +836,33 @@ UNUSED void sub_8053200(void) gDungeon->unkB = 1; } -void sub_8053210(u8 *txt, u32 a1, u32 a2) +static void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2) { - u8 *dst = &gDungeon->unk1C070[gDungeon->unk16].unk3[0]; - u8 *maxDst = &gDungeon->unk1C070[gDungeon->unk16].unk3[UNK_1C070_BUFFER_SIZE - 1]; - gDungeon->unk1C070[gDungeon->unk16].unk0 = 1; - gDungeon->unk1C070[gDungeon->unk16].unk1 = a1; - gDungeon->unk1C070[gDungeon->unk16].unk2 = 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 (*txt != '\0') { - if (*txt == '\r') break; + while (*src != '\0') { + if (*src == '\r') break; if (dst < maxDst) { - *(dst++) = *txt; + *(dst++) = *src; } - txt++; + src++; } *dst = '\0'; - if (++gDungeon->unk16 >= UNK_1C070_ARR_COUNT) { + if (++gDungeon->unk16 >= MESSAGE_LOG_STRINGS_COUNT) { gDungeon->unk16 = 0; } gDungeon->unkB = 1; } -extern const u8 gUnknown_8106990[]; // Possibly something menu related? +#define MESSAGE_LOG_ROW_COUNT 8 // How many log messages are shown -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 s32 gUnknown_202F1F8; -extern u8 gUnknown_202F1FC; - -void sub_80533A4(void); -bool8 sub_8053540(s32 a0); -bool8 sub_8053430(s32 a0); -void sub_805363C(s32 a0, s32 a1); - -bool32 sub_80532B4(void) +bool32 DisplayMessageLog(void) { bool8 unkRet; MenuInputStructSub menuInput; @@ -876,32 +876,30 @@ bool32 sub_80532B4(void) gUnknown_202F1F8 = 0; gUnknown_202F1FC = 0; - sub_80533A4(); + PutStringsOnMessageLog(); while (1) { s32 unkVar; - bool8 unkBool = FALSE; + bool32 scroll = FALSE; gUnknown_202F1FC = 0; nullsub_34(&menuInput, 0); unkVar = sub_8014140(0, gUnknown_8106990); - if (sub_8053430(unkVar)) - unkBool = TRUE; - else - unkBool = FALSE; - if (sub_8053540(unkVar)) - unkBool = TRUE; + if (TryScrollLogUp(unkVar)) + scroll = TRUE; + if (TryScrollLogDown(unkVar)) + scroll = TRUE; - if (!unkBool) { + if (!scroll) { sub_803E46C(0xD); } - if (gUnknown_202F1FC & 1) { - sub_805363C(1, -8); + if (gUnknown_202F1FC & FLAG_CAN_SCROLL_UP) { + CreateMessageLogArrow(TRUE, -8); } - if (gUnknown_202F1FC & 2) { - sub_805363C(0, 114); + if (gUnknown_202F1FC & FLAG_CAN_SCROLL_DOWN) { + CreateMessageLogArrow(FALSE, 114); } if (!sub_80048C8()) { @@ -920,7 +918,7 @@ bool32 sub_80532B4(void) return TRUE; } -void sub_80533A4(void) +static void PutStringsOnMessageLog(void) { s32 i; s32 arrId = gDungeon->unk16; @@ -928,20 +926,20 @@ void sub_80533A4(void) arrId -= 8; if (arrId < 0) - arrId += UNK_1C070_ARR_COUNT; + arrId += MESSAGE_LOG_STRINGS_COUNT; sub_80073B8(0); - for (i = 0; i < 8; i++) { - struct UnkDungeonStruct1C070 *strPtr = &gDungeon->unk1C070[arrId]; + for (i = 0; i < MESSAGE_LOG_ROW_COUNT; i++) { + struct MessageLogString *msgLogString = &gDungeon->messageLogStrings[arrId]; - if (strPtr->unk0) { - if (strPtr->unk1) { + if (msgLogString->unk0) { + if (msgLogString->unk1) { sub_80078A4(0, 0, y, 0xE0, 7); } - PrintStringOnWindow(8, y + 3, strPtr->unk3, 0, 0xD); + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); y += 14; } - if (++arrId >= UNK_1C070_ARR_COUNT) + if (++arrId >= MESSAGE_LOG_STRINGS_COUNT) arrId = 0; } @@ -949,15 +947,10 @@ void sub_80533A4(void) sub_8007334(0); } -extern void sub_80087EC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4); -extern void (*gUnknown_203B084)(s32 a0); -extern void (*gUnknown_203B080)(s32 a0); -extern void sub_8083CE0(u8 param_1); - -bool8 sub_8053430(s32 a0) +static bool8 TryScrollLogUp(s32 a0) { s32 i; - struct UnkDungeonStruct1C070 *strPtr; + struct MessageLogString *msgLogString; s32 y; s32 arrId; @@ -967,14 +960,14 @@ bool8 sub_8053430(s32 a0) y = 2; arrId -= 9; while (arrId < 0) { - arrId += UNK_1C070_ARR_COUNT; + arrId += MESSAGE_LOG_STRINGS_COUNT; } - while (arrId >= UNK_1C070_ARR_COUNT) { - arrId -= UNK_1C070_ARR_COUNT; + while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { + arrId -= MESSAGE_LOG_STRINGS_COUNT; } - if (gDungeon->unk1C070[arrId].unk0 && gUnknown_202F1F8 > -12) { - gUnknown_202F1FC |= 1; + if (gDungeon->messageLogStrings[arrId].unk0 && gUnknown_202F1F8 > -12) { + gUnknown_202F1FC |= FLAG_CAN_SCROLL_UP; if (gRealInputs.repeated & DPAD_UP) break; if (a0 == 1) @@ -985,13 +978,13 @@ bool8 sub_8053430(s32 a0) } sub_8083CE0(0); sub_80073B8(0); - strPtr = &gDungeon->unk1C070[arrId]; - if (strPtr->unk0) { + msgLogString = &gDungeon->messageLogStrings[arrId]; + if (msgLogString->unk0) { sub_80087EC(0, 0, 0, 0xD0, 0x10); - if (strPtr->unk1) { + if (msgLogString->unk1) { sub_80078A4(0, 0, y, 0xE0, 7); } - PrintStringOnWindow(8, y + 3, strPtr->unk3, 0, 0xD); + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); } sub_80073E0(0); sub_803E46C(0xD); @@ -1005,10 +998,10 @@ bool8 sub_8053430(s32 a0) return TRUE; } -bool8 sub_8053540(s32 a0) +static bool8 TryScrollLogDown(s32 a0) { s32 i; - struct UnkDungeonStruct1C070 *strPtr; + struct MessageLogString *msgLogString; s32 y; s32 arrId; @@ -1017,14 +1010,14 @@ bool8 sub_8053540(s32 a0) arrId = gDungeon->unk16 + gUnknown_202F1F8; y = 128; while (arrId < 0) { - arrId += UNK_1C070_ARR_COUNT; + arrId += MESSAGE_LOG_STRINGS_COUNT; } - while (arrId >= UNK_1C070_ARR_COUNT) { - arrId -= UNK_1C070_ARR_COUNT; + while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { + arrId -= MESSAGE_LOG_STRINGS_COUNT; } if (gUnknown_202F1F8 < 0) { - gUnknown_202F1FC |= 2; + gUnknown_202F1FC |= FLAG_CAN_SCROLL_DOWN; if (gRealInputs.repeated & DPAD_DOWN) break; if (a0 == 2) @@ -1035,13 +1028,13 @@ bool8 sub_8053540(s32 a0) } sub_8083CE0(0); sub_80073B8(0); - strPtr = &gDungeon->unk1C070[arrId]; - if (strPtr->unk0) { + msgLogString = &gDungeon->messageLogStrings[arrId]; + if (msgLogString->unk0) { sub_80087EC(0, 0, y, 0x68, 0x10); - if (strPtr->unk1) { + if (msgLogString->unk1) { sub_80078A4(0, 0, y, 0xE0, 7); } - PrintStringOnWindow(8, y + 3, strPtr->unk3, 0, 0xD); + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); } sub_80073E0(0); sub_803E46C(0xD); @@ -1055,39 +1048,44 @@ bool8 sub_8053540(s32 a0) return TRUE; } -extern s16 gUnknown_2027370[]; - -/* -void sub_805363C(u8 a0, s32 a1) +static void CreateMessageLogArrow(bool8 upArrow, s32 y) { - s16 *unkArr = gUnknown_2027370; - if (gUnknown_202EDCC & 8) { - u32 shape, size, xSprite; + struct UnkTextStruct1 *unkStr = &gUnknown_2027370[0]; + if (!(gUnknown_202EDCC & 8)) { + u32 matrixNum, xSprite, mask, ySprite, shape, yMask; - gUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE1; - gUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE2; - gUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_OBJMODE; - gUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_MOSAIC; - gUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_BPP; + gUnknown_202F200.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE1; + gUnknown_202F200.attrib1 &= ~SPRITEOAM_MASK_AFFINEMODE2; + gUnknown_202F200.attrib1 &= ~SPRITEOAM_MASK_OBJMODE; + gUnknown_202F200.attrib1 &= ~SPRITEOAM_MASK_MOSAIC; + gUnknown_202F200.attrib1 &= ~SPRITEOAM_MASK_BPP; - gUnknown_202F1F0.attrib1 &= ~SPRITEOAM_MASK_SHAPE; - shape = (a0 == 1) ? 2 : 0; + 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; + gUnknown_202F200.attrib2 &= ~SPRITEOAM_MASK_MATRIXNUM; + gUnknown_202F200.attrib2 |= matrixNum; + + mask = 0xF; + yMask = 0xFFF; + ySprite = (yMask & (unkStr->unk2 * 8 + y)) << 4; + gUnknown_202F200.unk6 &= mask; + gUnknown_202F200.unk6 |= ySprite; + + xSprite = 0x1FF & ((unkStr->unk0 * 8) + 92); + gUnknown_202F200.attrib2 &= ~SPRITEOAM_MASK_X; + gUnknown_202F200.attrib2 |= xSprite; + + shape = 1; shape <<= SPRITEOAM_SHIFT_SHAPE; - gUnknown_202F1F0.attrib1 |= shape; + gUnknown_202F200.attrib1 &= ~SPRITEOAM_MASK_SHAPE; + gUnknown_202F200.attrib1 |= shape; - gUnknown_202F1F0.attrib2 &= ~SPRITEOAM_MASK_MATRIXNUM; + gUnknown_202F200.attrib2 &= ~SPRITEOAM_MASK_SIZE; - xSprite = (unkArr[0] * 8) + 92; - gUnknown_202F1F0.attrib2 &= ~SPRITEOAM_MASK_X; - gUnknown_202F1F0.attrib2 |= xSprite; + gUnknown_202F200.attrib3 = 0xF3F0; - size = 2 << SPRITEOAM_SHIFT_SIZE; - gUnknown_202F1F0.attrib2 &= ~SPRITEOAM_MASK_SIZE; - gUnknown_202F1F0.attrib2 |= size; - - gUnknown_202F1F0.attrib3 = 0xF3F0; - - AddSprite(&gUnknown_202F1F0, 127, NULL, NULL); + AddSprite(&gUnknown_202F200, 127, NULL, NULL); } } -*/ diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index eb85a0568..c7f10065c 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -89,7 +89,7 @@ void sub_8094C88(void); void sub_8040A84(void); void sub_8047158(void); void sub_804AA60(void); -void sub_80532B4(void); +void DisplayMessageLog(void); void sub_806A914(u8 a0, u8 a1, u8 a2); void sub_8044C10(u8 a0); u16 GetLeaderActionId(void); @@ -269,7 +269,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 +284,7 @@ void DungeonHandlePlayerInput(void) } } if (i == MAX_MON_MOVES) { - SendMessage(leader, gUnknown_80F8A28); + TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A28); break; } @@ -310,7 +310,7 @@ void DungeonHandlePlayerInput(void) } } if (!canUseMove) { - SendMessage(leader, gUnknown_80F8A4C); + TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A4C); } else { SetMonsterActionFields(&leaderInfo->action, ACTION_USE_MOVE_PLAYER); @@ -379,7 +379,7 @@ void DungeonHandlePlayerInput(void) if (gRealInputs.held & L_BUTTON) { if (gRealInputs.pressed & B_BUTTON) { - sub_80532B4(); + DisplayMessageLog(); ResetRepeatTimers(); ResetUnusedInputStruct(); } @@ -534,7 +534,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; @@ -1761,7 +1761,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; diff --git a/src/code_8066D04.c b/src/code_8066D04.c index e43758fd5..3ee81a692 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -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..56883e9de 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -35,7 +35,7 @@ extern u8 *gUnknown_80FCC7C[]; extern u8 *gUnknown_80FCCAC[]; extern u8 *gUnknown_80FDCC8[]; -void sub_80522F4(Entity *r0, Entity *r1, const char r2[]); +void TryDisplayDungeonLoggableMessage3(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..248533637 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -259,7 +259,7 @@ 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 TryDisplayDungeonLoggableMessage3(Entity *, Entity *, const u8 *); extern void sub_8041D00(Entity *pokemon, Entity *target); extern void DealDamageToEntity(Entity *, s32, u32, u32); extern void SetShopkeeperAggression(Entity *, Entity *); @@ -383,7 +383,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; @@ -519,14 +519,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 +551,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 +571,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 +592,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; } @@ -614,12 +614,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 +661,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,7 +718,7 @@ 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); @@ -730,7 +730,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_805239C(attacker, gUnknown_80F9DF0[r8]); } else { - sub_80522F4(attacker, target, gUnknown_80F9CC0[r8]); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9CC0[r8]); } } else { diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 5d54e698c..97732788f 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -12,7 +12,7 @@ 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 TryDisplayDungeonLoggableMessage3(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) { @@ -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 ab4d1a571..b9d9d6d4d 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -751,7 +751,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa 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 +764,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,7 +805,7 @@ 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 { @@ -817,7 +817,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } } sub_808D9DC(gAvailablePokemonNames,pokeStruct2,0); - SendMessage(entity1,*gUnknown_80FA0F0); + TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA0F0); if (flag) { leader = xxx_call_GetLeader(); SetMessageArgument(gAvailablePokemonNames,leader,0); diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 9279ae148..b5947d4ee 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -72,7 +72,7 @@ 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[]); +extern void TryDisplayDungeonLoggableMessage3(Entity *pokemon, Entity *r1, const u8[]); void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); // TODO: change to s32 void sub_8071B48(void) @@ -329,7 +329,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 +466,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 +554,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 +562,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); } } } @@ -677,7 +677,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); } } } @@ -873,12 +873,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..52b99a847 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -31,7 +31,7 @@ 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 TryDisplayDungeonLoggableMessage3(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..2eb0eb55f 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -388,7 +388,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 +577,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); @@ -617,7 +617,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 +773,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 +797,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..051294092 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -169,7 +169,7 @@ extern u8 *gUnknown_80FBF84[]; extern void sub_8049ED4(); extern void sub_8040A84(); -extern void sub_80522F4(Entity *pokemon, Entity *r1, const char[]); +extern void TryDisplayDungeonLoggableMessage3(Entity *pokemon, Entity *r1, const char[]); extern void EntityUpdateStatusSprites(Entity *); extern void sub_8042A74(Entity *r0); extern void sub_807EC28(bool8); @@ -224,11 +224,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 +251,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 +274,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 +284,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 +309,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 +341,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 +353,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 +374,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 +394,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 +419,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 +428,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) } else { - sub_80522F4(pokemon,target,*gUnknown_80FB85C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB85C); } EntityUpdateStatusSprites(target); } @@ -447,14 +447,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 +493,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 +523,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 +553,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 +583,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 +613,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 +631,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 +648,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 +670,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 +702,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 +745,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 +753,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 +770,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 +790,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 +810,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 +830,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 +850,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 +870,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 +890,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 +911,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 +931,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 +951,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 +968,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 +976,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 +997,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 +1047,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 +1085,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 +1101,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 +1119,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 +1169,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 +1194,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 +1219,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 +1249,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 +1289,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 +1329,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 +1387,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 +1404,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 +1425,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 +1451,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 +1485,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 +1519,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 +1551,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 +1596,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..14bea4fdc 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -39,7 +39,7 @@ bool8 ExposeTrap(s32 x, s32 y); void sub_8040A84(); void sub_8049ED4(); void sub_806A5B8(Entity *); -void sub_80522F4(Entity *, Entity *, u8 *); +void TryDisplayDungeonLoggableMessage3(Entity *, Entity *, u8 *); void sub_80421C0(Entity *, u32); u8 sub_8045888(Entity *); void sub_807EC28(u32); @@ -66,19 +66,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 +86,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 +230,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 +312,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 +360,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..ec42ef3ce 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -20,7 +20,7 @@ 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 TryDisplayDungeonLoggableMessage3(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 +77,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 +137,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 +149,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 +161,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 +172,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/dungeon_ai.c b/src/dungeon_ai.c index e8831c727..ade02f3b8 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -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..acc767669 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -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; } diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 62c6e3beb..ee36b170c 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -226,7 +226,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 +285,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 +313,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 +341,7 @@ bool8 sub_8072CF4(Entity *entity) } } if (bVar4) { - SendMessage(entity,*gUnknown_80FD2CC); + TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FD2CC); } } sub_807360C(); diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 721506820..779345c83 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -24,14 +24,14 @@ extern u32 gUnknown_80FC31C; extern u32 gUnknown_80FCEFC; extern u32 gUnknown_80FC2FC; extern bool8 sub_805744C(Entity *, Move *, u32); -extern void sub_80522F4(Entity *r1, Entity *r2, u32); +extern void TryDisplayDungeonLoggableMessage3(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 +43,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 +51,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/move_actions.c b/src/move_actions.c index f2ddcc38e..5d69c6e36 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -212,7 +212,7 @@ 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 void TryDisplayDungeonLoggableMessage3(Entity *r1, Entity *r2, const char[]); extern s32 sub_80556BC(Entity *, Entity *, u8, Move *, u32, u32); // move_util.h @@ -413,7 +413,7 @@ 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)) { @@ -445,7 +445,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 +455,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; } @@ -507,7 +507,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 +531,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 +554,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 +572,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 +587,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; } @@ -619,7 +619,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; } @@ -701,10 +701,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; @@ -805,10 +805,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 +857,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; } @@ -1085,7 +1085,7 @@ 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; } @@ -1483,7 +1483,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; } @@ -1625,7 +1625,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); @@ -1694,7 +1694,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 +1706,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 +1736,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; @@ -1801,7 +1801,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; } @@ -1855,7 +1855,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 { @@ -1926,7 +1926,7 @@ 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; @@ -2049,7 +2049,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 +2078,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 +2092,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 +2103,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 +2121,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); @@ -2246,7 +2246,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; @@ -2296,7 +2296,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; @@ -2354,11 +2354,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 +2373,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 +2384,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; } } @@ -2471,7 +2471,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 +2480,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 +2490,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; } @@ -2524,7 +2524,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; } @@ -2551,7 +2551,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 +2577,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; } @@ -2640,7 +2640,7 @@ bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) *stockpileStage = 0; } else { - sub_80522F4(pokemon,target,*gUnknown_80FCA3C); + TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA3C); } return TRUE; } @@ -2673,12 +2673,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 +2686,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 +2756,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 +2848,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; } @@ -2969,7 +2969,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; } diff --git a/src/move_effects_target.c b/src/move_effects_target.c index fc7ec50b9..10f327ca4 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -142,7 +142,7 @@ 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 TryDisplayDungeonLoggableMessage3(Entity *r1, Entity *r2, u8 *); extern void nullsub_91(Entity *); extern void nullsub_90(Entity *); extern void nullsub_72(Entity *); @@ -206,11 +206,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 +218,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 +236,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 +284,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 +321,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 +348,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 +390,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 +417,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 +446,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 +456,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 +486,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 +500,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 +514,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 +541,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 +573,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 +601,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 +628,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 +662,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 +688,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 +710,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 +741,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 +755,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 +766,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 +787,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 +796,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 +817,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 +825,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 +850,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 +892,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 +900,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 +963,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 +1008,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 +1034,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 +1074,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 +1115,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 +1155,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/status.c b/src/status.c index 76e0ed85b..7f66297bc 100644 --- a/src/status.c +++ b/src/status.c @@ -176,7 +176,7 @@ 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 TryDisplayDungeonLoggableMessage3(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..870aedd2c 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -40,7 +40,7 @@ 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 TryDisplayDungeonLoggableMessage3(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 *); @@ -193,7 +193,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 { @@ -232,7 +232,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 +242,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; } } @@ -308,7 +308,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; @@ -455,11 +455,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; } @@ -544,7 +544,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 +580,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; } @@ -671,16 +671,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; @@ -716,18 +716,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 +736,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 +793,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 +873,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 +885,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 +897,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 +936,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 +965,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 +997,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 +1034,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 +1071,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 +1118,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 +1145,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 +1171,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..387f48fd7 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -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..45b4d8a72 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -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/trap.c b/src/trap.c index a2c44e550..ce2105c49 100644 --- a/src/trap.c +++ b/src/trap.c @@ -88,9 +88,9 @@ 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 TryDisplayDungeonLoggableMessage5(Entity *, Position *, u8 *); void sub_8049ED4(void); -void sub_80522F4(Entity *pokemon, Entity *target, const char r2[]); +void TryDisplayDungeonLoggableMessage3(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 +180,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 +275,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 +286,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 +409,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 +431,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 +525,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 +545,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,13 +565,13 @@ 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! @@ -626,11 +626,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 +667,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 +707,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/type_effectiveness.c b/src/type_effectiveness.c index c22ee5118..994f22071 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -59,7 +59,7 @@ extern u8 *gUnknown_80FED88[]; extern s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; -void sub_80522F4(Entity *, Entity *, u8 *); +void TryDisplayDungeonLoggableMessage3(Entity *, Entity *, u8 *); void sub_80428D8(Entity *); void sub_8042978(Entity *); void sub_804298C(Entity *); @@ -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,7 +199,7 @@ 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))) {