From 519c9ebb6ae04ba68a42a322e9b617cab0a09040 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Fri, 22 Apr 2022 19:02:28 -0700 Subject: [PATCH] lazy day so more decomp away --- asm/code_8057824.s | 805 ---------------------------------- asm/code_807E5AC.s | 35 -- include/dungeon_global_data.h | 9 +- include/pokemon.h | 2 +- ld_script.txt | 1 + src/code_8057824.c | 282 ++++++++++-- src/code_807E5AC.c | 11 + src/pokemon_mid.c | 2 +- src/status_checker.c | 157 +++++++ 9 files changed, 427 insertions(+), 877 deletions(-) create mode 100644 src/code_807E5AC.c diff --git a/asm/code_8057824.s b/asm/code_8057824.s index 3e4d09757..3fd73d05b 100644 --- a/asm/code_8057824.s +++ b/asm/code_8057824.s @@ -5,482 +5,6 @@ .text - thumb_func_start sub_8057A0C -sub_8057A0C: - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r2, [r5, 0x70] - mov r8, r2 - ldr r0, [r6, 0x70] - adds r3, r0, 0 - movs r1, 0xE - ldrsh r0, [r2, r1] - movs r4, 0xE - ldrsh r1, [r3, r4] - adds r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r2, 0xE] - strh r0, [r3, 0xE] - movs r7, 0xE - ldrsh r1, [r2, r7] - ldrh r4, [r2, 0x10] - movs r7, 0x10 - ldrsh r0, [r2, r7] - cmp r1, r0 - ble _08057A42 - strh r4, [r2, 0xE] -_08057A42: - movs r0, 0xE - ldrsh r1, [r3, r0] - ldrh r2, [r3, 0x10] - movs r4, 0x10 - ldrsh r0, [r3, r4] - cmp r1, r0 - ble _08057A52 - strh r2, [r3, 0xE] -_08057A52: - ldr r4, _08057A90 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument - adds r4, 0x50 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - bl SetMessageArgument - mov r1, r8 - adds r1, 0xFB - ldrb r0, [r1] - cmp r0, 0 - bne _08057A78 - movs r0, 0x1 - strb r0, [r1] -_08057A78: - ldr r0, _08057A94 - ldr r2, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_80522F4 - movs r0, 0x1 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08057A90: .4byte gAvailablePokemonNames -_08057A94: .4byte gUnknown_80FC7EC - thumb_func_end sub_8057A0C - - thumb_func_start TormentMoveAction -TormentMoveAction: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r10, r0 - mov r8, r1 - ldr r0, [r1, 0x70] - str r0, [sp, 0x8] - movs r1, 0 - str r1, [sp, 0xC] - movs r1, 0x8C - lsls r1, 1 - adds r4, r0, r1 - adds r5, r4, 0 - movs r0, 0x10 - mov r9, r0 - movs r7, 0x3 -_08057ABE: - ldrb r1, [r4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08057B12 - movs r6, 0x20 - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08057B04 - mov r0, r9 - ands r0, r1 - cmp r0, 0 - beq _08057B12 - ldr r0, _08057AFC - adds r1, r5, 0 - movs r2, 0 - bl sub_80928C0 - ldr r0, _08057B00 - ldr r2, [r0] - mov r0, r10 - mov r1, r8 - bl sub_80522F4 - ldrb r0, [r4] - orrs r0, r6 - strb r0, [r4] - movs r1, 0x1 - str r1, [sp, 0xC] - b _08057B12 - .align 2, 0 -_08057AFC: .4byte gUnknown_202DE58 -_08057B00: .4byte gUnknown_80FCFBC -_08057B04: - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _08057B12 - movs r0, 0xDF - ands r0, r1 - strb r0, [r4] -_08057B12: - adds r4, 0x8 - adds r5, 0x8 - subs r7, 0x1 - cmp r7, 0 - bge _08057ABE - ldr r0, [sp, 0x8] - movs r1, 0x9C - lsls r1, 1 - adds r4, r0, r1 - ldrb r1, [r4] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08057B6C - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08057B7A - movs r1, 0xB0 - lsls r1, 1 - mov r0, sp - bl InitPokemonMove - ldrb r1, [r4] - movs r0, 0x20 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x1 - str r0, [sp, 0xC] - ldr r0, _08057B64 - mov r1, sp - movs r2, 0 - bl sub_80928C0 - ldr r0, _08057B68 - ldr r2, [r0] - mov r0, r10 - mov r1, r8 - bl sub_80522F4 - b _08057B7A - .align 2, 0 -_08057B64: .4byte gUnknown_202DE58 -_08057B68: .4byte gUnknown_80FCFBC -_08057B6C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08057B7A - movs r0, 0xDF - ands r0, r1 - strb r0, [r4] -_08057B7A: - ldr r1, [sp, 0xC] - cmp r1, 0 - beq _08057B90 - ldr r1, [sp, 0x8] - adds r1, 0xC0 - ldrb r0, [r1] - cmp r0, 0x1 - bne _08057B9C - movs r0, 0 - strb r0, [r1] - b _08057B9C -_08057B90: - ldr r0, _08057BB0 - ldr r2, [r0] - mov r0, r10 - mov r1, r8 - bl sub_80522F4 -_08057B9C: - ldr r0, [sp, 0xC] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08057BB0: .4byte gUnknown_80FCFE4 - thumb_func_end TormentMoveAction - - thumb_func_start sub_8057BB4 -sub_8057BB4: - push {lr} - movs r2, 0x1 - movs r3, 0x1 - bl sub_80779F0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8057BB4 - - thumb_func_start sub_8057BC4 -sub_8057BC4: - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - bl sub_8077AE4 - ldr r0, _08057BE8 - ldr r2, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - movs r3, 0x2 - bl sub_8077084 - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .align 2, 0 -_08057BE8: .4byte gUnknown_8106A4C - thumb_func_end sub_8057BC4 - - thumb_func_start sub_8057BEC -sub_8057BEC: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - adds r6, r3, 0 - movs r0, 0 - mov r8, r0 - adds r0, r4, 0 - bl IsSleeping - lsls r0, 24 - cmp r0, 0 - beq _08057C48 - movs r3, 0x80 - lsls r3, 1 - str r6, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r7, 0 - bl sub_8055640 - cmp r0, 0 - beq _08057C54 - movs r1, 0x1 - mov r8, r1 - ldr r0, _08057C44 - movs r1, 0 - ldrsh r2, [r0, r1] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_805727C - lsls r0, 24 - cmp r0, 0 - beq _08057C54 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_80776C0 - b _08057C54 - .align 2, 0 -_08057C44: .4byte gUnknown_80F4E0A -_08057C48: - ldr r0, _08057C64 - ldr r2, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80522F4 -_08057C54: - mov r0, r8 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08057C64: .4byte gUnknown_80FC734 - thumb_func_end sub_8057BEC - - thumb_func_start sub_8057C68 -sub_8057C68: - push {lr} - sub sp, 0x4 - ldr r2, _08057C84 - ldr r2, [r2] - movs r3, 0x1 - str r3, [sp] - movs r3, 0x40 - bl sub_8077434 - movs r0, 0x1 - add sp, 0x4 - pop {r1} - bx r1 - .align 2, 0 -_08057C84: .4byte gUnknown_8106A4C - thumb_func_end sub_8057C68 - - thumb_func_start sub_8057C88 -sub_8057C88: - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - movs r7, 0 - movs r4, 0x80 - lsls r4, 1 - str r3, [sp] - adds r3, r4, 0 - bl sub_8055640 - cmp r0, 0 - beq _08057CC2 - movs r7, 0x1 - ldr r0, _08057CCC - movs r1, 0 - ldrsh r2, [r0, r1] - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_805727C - lsls r0, 24 - cmp r0, 0 - beq _08057CC2 - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0 - bl sub_80776C0 -_08057CC2: - adds r0, r7, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08057CCC: .4byte gUnknown_80F4DF6 - thumb_func_end sub_8057C88 - - thumb_func_start sub_8057CD0 -sub_8057CD0: - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - adds r4, r0, 0 - adds r6, r1, 0 - mov r8, r2 - adds r5, r3, 0 - bl GetWeather - lsls r0, 24 - lsrs r0, 24 - ldr r1, _08057D18 - adds r1, r0, r1 - ldrb r2, [r1] - ldr r1, _08057D1C - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp] - str r5, [sp, 0x4] - adds r0, r4, 0 - adds r1, r6, 0 - mov r3, r8 - bl sub_80556BC - cmp r0, 0 - beq _08057D0A - movs r0, 0x1 -_08057D0A: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .align 2, 0 -_08057D18: .4byte gUnknown_80F51E4 -_08057D1C: .4byte gUnknown_80F51EC - thumb_func_end sub_8057CD0 - - thumb_func_start sub_8057D20 -sub_8057D20: - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r1, 0 - movs r7, 0 - ldr r0, [r4, 0x70] - adds r0, 0xC0 - ldrb r0, [r0] - movs r6, 0x80 - lsls r6, 1 - cmp r0, 0x9 - bne _08057D3C - movs r6, 0x80 - lsls r6, 2 -_08057D3C: - str r3, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - adds r3, r6, 0 - bl sub_8055640 - cmp r0, 0 - beq _08057D6E - movs r7, 0x1 - ldr r0, _08057D78 - movs r1, 0 - ldrsh r2, [r0, r1] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_805727C - lsls r0, 24 - cmp r0, 0 - beq _08057D6E - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x3B - movs r3, 0 - bl sub_80768DC -_08057D6E: - adds r0, r7, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08057D78: .4byte gUnknown_80F4E08 - thumb_func_end sub_8057D20 - - thumb_func_start sub_8057D7C -sub_8057D7C: - push {lr} - sub sp, 0x8 - ldr r2, _08057D98 - ldr r2, [r2] - movs r3, 0x1 - str r3, [sp] - str r3, [sp, 0x4] - movs r3, 0x2 - bl sub_8076F80 - movs r0, 0x1 - add sp, 0x8 - pop {r1} - bx r1 - .align 2, 0 -_08057D98: .4byte gUnknown_8106A50 - thumb_func_end sub_8057D7C - thumb_func_start sub_8057D9C sub_8057D9C: push {r4-r7,lr} @@ -9599,333 +9123,4 @@ sub_805C1BC: _0805C1E0: .4byte gUnknown_80F4F80 thumb_func_end sub_805C1BC - thumb_func_start sub_805C1E4 -sub_805C1E4: - push {lr} - ldr r2, _0805C1F4 - ldr r2, [r2] - bl sub_80522F4 - movs r0, 0 - pop {r1} - bx r1 - .align 2, 0 -_0805C1F4: .4byte gUnknown_80FD454 - thumb_func_end sub_805C1E4 - - thumb_func_start sub_805C1F8 -sub_805C1F8: - push {lr} - movs r2, 0x1 - bl sub_8077BB4 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_805C1F8 - - thumb_func_start sub_805C208 -sub_805C208: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r7, r0, 0 - mov r9, r1 - adds r6, r2, 0 - mov r8, r3 - movs r5, 0 - add r0, sp, 0x18 - strb r5, [r0] - ldr r0, [r1, 0x70] - movs r1, 0x4 - ldrsh r0, [r0, r1] - bl GetSizeOrbDmg - mov r10, r0 - adds r0, r6, 0 - bl GetMoveType - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - mov r1, r8 - bl sub_8057600 - lsls r0, 16 - asrs r0, 16 - add r1, sp, 0x18 - str r1, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - str r5, [sp, 0xC] - movs r0, 0x1 - str r0, [sp, 0x10] - str r5, [sp, 0x14] - adds r0, r7, 0 - mov r1, r9 - mov r2, r10 - movs r3, 0x1 - bl sub_806F370 - add r1, sp, 0x18 - movs r2, 0 - adds r0, r1, 0 - ldrb r0, [r0] - cmp r0, 0 - bne _0805C270 - movs r2, 0x1 -_0805C270: - strb r2, [r1] - add r0, sp, 0x18 - ldrb r0, [r0] - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_805C208 - - thumb_func_start sub_805C288 -sub_805C288: - push {lr} - ldr r2, _0805C29C - movs r3, 0 - ldrsh r2, [r2, r3] - movs r3, 0 - bl sub_8078A58 - movs r0, 0x1 - pop {r1} - bx r1 - .align 2, 0 -_0805C29C: .4byte gUnknown_80F4FC6 - thumb_func_end sub_805C288 - - thumb_func_start sub_805C2A0 -sub_805C2A0: - push {lr} - bl sub_807DC68 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_805C2A0 - - thumb_func_start FillInOrbAction -FillInOrbAction: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - mov r8, r0 - adds r7, r1, 0 - movs r0, 0 - mov r9, r0 - ldr r5, [r7, 0x70] - bl IsBossBattle - lsls r0, 24 - cmp r0, 0 - beq _0805C2DC - ldr r0, _0805C2D8 - ldr r1, [r0] - mov r0, r8 - bl SendMessage - movs r0, 0 - b _0805C3CA - .align 2, 0 -_0805C2D8: .4byte gUnknown_80FD0B8 -_0805C2DC: - ldr r4, _0805C3A0 - adds r3, r5, 0 - adds r3, 0x46 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0] - ldrh r1, [r7, 0x4] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - ldr r2, _0805C3A4 - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - ldrb r0, [r3] - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x2] - ldrh r2, [r7, 0x6] - adds r0, r2 - lsls r0, 16 - ldr r2, _0805C3A8 - ands r1, r2 - orrs r1, r0 - str r1, [sp] - mov r4, sp - mov r0, sp - bl sub_8042A54 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl GetMapTile_2 - adds r2, r0, 0 - ldrh r1, [r2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _0805C36C - ldr r0, _0805C3AC - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - movs r5, 0x1 - negs r5, r5 - mov r6, sp -_0805C344: - movs r4, 0x1 - negs r4, r4 -_0805C348: - movs r1, 0 - ldrsh r0, [r6, r1] - adds r0, r4 - movs r2, 0x2 - ldrsh r1, [r6, r2] - adds r1, r5 - bl sub_80498A8 - adds r4, 0x1 - cmp r4, 0x1 - ble _0805C348 - adds r5, 0x1 - cmp r5, 0x1 - ble _0805C344 - movs r0, 0x1 - mov r9, r0 - bl sub_806CF60 -_0805C36C: - movs r5, 0 -_0805C36E: - movs r4, 0 - adds r6, r5, 0x1 -_0805C372: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8049BB0 - adds r4, 0x1 - cmp r4, 0x37 - ble _0805C372 - adds r5, r6, 0 - cmp r5, 0x1F - ble _0805C36E - mov r1, r9 - cmp r1, 0 - beq _0805C3B4 - mov r0, sp - bl sub_8042A64 - ldr r0, _0805C3B0 - ldr r2, [r0] - mov r0, r8 - adds r1, r7, 0 - bl sub_80522F4 - b _0805C3C0 - .align 2, 0 -_0805C3A0: .4byte gAdjacentTileOffsets -_0805C3A4: .4byte 0xffff0000 -_0805C3A8: .4byte 0x0000ffff -_0805C3AC: .4byte 0x0000fffc -_0805C3B0: .4byte gUnknown_80FD0B4 -_0805C3B4: - ldr r0, _0805C3D8 - ldr r2, [r0] - mov r0, r8 - adds r1, r7, 0 - bl sub_80522F4 -_0805C3C0: - bl sub_8040A84 - bl sub_8049ED4 - mov r0, r9 -_0805C3CA: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_0805C3D8: .4byte gUnknown_80FD0B8 - thumb_func_end FillInOrbAction - - thumb_func_start sub_805C3DC -sub_805C3DC: - push {lr} - ldr r0, [r1, 0x70] - ldrb r0, [r0, 0x6] - movs r2, 0x1 - cmp r0, 0 - beq _0805C3EA - movs r2, 0x2 -_0805C3EA: - adds r0, r1, 0x4 - movs r1, 0x14 - bl sub_807FC3C - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_805C3DC - - thumb_func_start sub_805C3F8 -sub_805C3F8: - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, [r4, 0x4] - str r0, [sp, 0x4] - ldr r0, [r4, 0x70] - adds r0, 0xA4 - ldrb r1, [r0] - cmp r1, 0 - bne _0805C442 - adds r0, r4, 0 - adds r0, 0x20 - strb r1, [r0] - movs r0, 0 - bl sub_803D73C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - bl sub_8045C28 - add r1, sp, 0x4 - adds r0, r5, 0 - mov r2, sp - bl sub_80464C8 - movs r1, 0x86 - lsls r1, 2 - adds r0, r4, 0 - adds r2, r5, 0 - bl sub_8068FE0 - movs r0, 0x1 - b _0805C450 -_0805C442: - ldr r0, _0805C458 - ldr r2, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80522F4 - movs r0, 0 -_0805C450: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .align 2, 0 -_0805C458: .4byte gUnknown_80FF678 - thumb_func_end sub_805C3F8 - .align 2, 0 diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index 9af837b8e..56979bb93 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -2737,39 +2737,4 @@ _0807FC34: .4byte 0x000001ff _0807FC38: .4byte 0x000181ea thumb_func_end sub_807FA9C - thumb_func_start sub_807FC3C -sub_807FC3C: - push {r4-r7,lr} - ldr r6, _0807FC70 - ldr r4, [r6] - ldrh r5, [r0] - ldr r7, _0807FC74 - adds r3, r4, r7 - strh r5, [r3] - ldrh r3, [r0, 0x2] - ldr r5, _0807FC78 - adds r0, r4, r5 - strh r3, [r0] - adds r7, 0x4 - adds r4, r7 - strb r1, [r4] - ldr r0, [r6] - ldr r1, _0807FC7C - adds r0, r1 - strb r2, [r0] - ldr r0, [r6] - subs r5, 0x6 - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_0807FC70: .4byte gDungeonGlobalData -_0807FC74: .4byte 0x00013574 -_0807FC78: .4byte 0x00013576 -_0807FC7C: .4byte 0x00013579 - thumb_func_end sub_807FC3C - .align 2, 0 diff --git a/include/dungeon_global_data.h b/include/dungeon_global_data.h index d5222af5b..3a6c2b6c7 100644 --- a/include/dungeon_global_data.h +++ b/include/dungeon_global_data.h @@ -88,7 +88,14 @@ struct DungeonGlobalData /* 0x10884 */ struct Position roomExits[MAX_ROOM_COUNT][32]; // Arrays of room exits for each room. u8 fill11444[0x1356C - 0x11484]; u8 unk1356C; - u8 fill1356D[0x1357C - 0x1356D]; + u8 fill1356D[0x13570 - 0x1356D]; + /* 0x13570 */ u8 unk13570; + u8 fill13571[0x13574 - 0x13571]; + /* 0x13574 */ u16 unk13574; + /* 0x13576 */ u16 unk13576; + /* 0x13578 */ u8 unk13578; + /* 0x13579 */ u8 unk13579; + u8 fill1357A[0x1357C - 0x1357A]; /* 0x1357C */ struct DungeonEntity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1358C */ struct DungeonEntity *wildPokemon[DUNGEON_MAX_WILD_POKEMON]; /* 0x135CC */ struct DungeonEntity *allPokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon diff --git a/include/pokemon.h b/include/pokemon.h index 6b514c829..193229c5f 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -204,7 +204,7 @@ u8 GetUnk1B(s16 index); bool8 GetIsMoving(s16 index); u8 GetUnk1D(s16 index); u16 GetLowKickDmg(s16 index); -u16 GetSizeOrbDmg(s16 index); +u32 GetSizeOrbDmg(s16 index); u8 GetFriendArea(s16 index); u16 GetBaseHP(s16 index); bool8 IsToolboxEnabled(s16 index); diff --git a/ld_script.txt b/ld_script.txt index 38dbb38bd..c84db68b6 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -252,6 +252,7 @@ SECTIONS { asm/code_807CD9C.o(.text); src/weather.o(.text); asm/code_807E5AC.o(.text); + src/code_807E5AC.o(.text); src/trap.o(.text); asm/code_807FCD4.o(.text); src/code_8083288.o(.text); diff --git a/src/code_8057824.c b/src/code_8057824.c index e43cef5b2..a8d6ef2f3 100644 --- a/src/code_8057824.c +++ b/src/code_8057824.c @@ -1,66 +1,97 @@ #include "global.h" +#include "constants/status.h" #include "dungeon_global_data.h" #include "dungeon_entity.h" #include "moves.h" +#include "status_checks_1.h" +#include "weather.h" -extern u32 gUnknown_80FCF74; -extern u32 gUnknown_80FCF80; -extern u16 gUnknown_80F4F42; +extern u8 gUnknown_202DE58[]; +extern u8 gAvailablePokemonNames[]; -extern u32 gUnknown_8106A50; -extern u32 gUnknown_8106A4C; extern s16 gUnknown_80F4DB6; +extern u16 gUnknown_80F4F42; extern u32 gUnknown_80FAC88; +extern u8 *gUnknown_80FD018[]; +extern u8 *gUnknown_80FCFBC[]; +extern u8 *gUnknown_80FCFE4[]; +extern u32 gUnknown_8106A4C; +extern s16 gUnknown_80F4DF6; +extern s16 gUnknown_80F4E0A; +extern u8 gUnknown_80F51E4[]; +extern u32 gUnknown_80F51EC[]; +extern u8 *gUnknown_80FC734[]; +extern u8 *gUnknown_80FC7EC[]; +extern u8 *gUnknown_80FCF74[]; +extern u8 *gUnknown_80FCF80[]; +extern u32 gUnknown_8106A50; +extern s16 gUnknown_80F4E08; + +struct unkStruct_80928C0 +{ + u32 unk0; + s32 unk4; + u8 unk8; + u8 unk9; +}; + +void sub_80928C0(u8 *buffer, struct PokemonMove *move, struct unkStruct_80928C0 *param_3); extern void sub_80775DC(struct DungeonEntity *r0, struct DungeonEntity *r1, u32, u32); +extern void sub_80768DC(struct DungeonEntity *, struct DungeonEntity *, u32, u32); extern void sub_80772C0(struct DungeonEntity *r0, struct DungeonEntity *r1, u32, u32, u32); extern u8 sub_807EAA0(u32, u32); -extern void sub_80522F4(struct DungeonEntity *r1, struct DungeonEntity *r2, u32); +extern void sub_80522F4(struct DungeonEntity *r1, struct DungeonEntity *r2, const char[]); extern void sub_8079F20(struct DungeonEntity *r0, struct DungeonEntity *r1, u32, u32); - +extern void sub_8077434(struct DungeonEntity *r0, struct DungeonEntity *r1, u32 , u32, u32); +extern s32 sub_80556BC(struct DungeonEntity *, struct DungeonEntity *, u8, u32, u32, u32); extern u8 sub_805727C(struct DungeonEntity *, struct DungeonEntity *, s16); extern u32 sub_8055640(struct DungeonEntity *, struct DungeonEntity *, u32, u32, u32); extern void sub_80779F0(struct DungeonEntity *, struct DungeonEntity *, u32, u32); extern void sub_8078968(struct DungeonEntity *r0, struct DungeonEntity *r1); extern void sub_8079618(struct DungeonEntity *r0, struct DungeonEntity *r1, u32, u32, u32); +extern void sub_8077AE4(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32); +extern void sub_8077084(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32, u32); +extern u8 sub_80776C0(struct DungeonEntity *, struct DungeonEntity *, u8); + +extern void sub_8076F80(struct DungeonEntity *, struct DungeonEntity *, u32, u32, u32, u32); extern void sub_806F370(struct DungeonEntity *r0, struct DungeonEntity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void SetMessageArgument(char[], struct DungeonEntity*, u32); - -extern u32 gUnknown_80FD018; extern s16 sub_8057600(void*, u32); -bool32 sub_8057824(struct DungeonEntity *param_1, struct DungeonEntity *param_2) +bool32 sub_8057824(struct DungeonEntity *pokemon, struct DungeonEntity *target) { // Lower evasion? - sub_80775DC(param_1,param_2,gUnknown_8106A50,1); + sub_80775DC(pokemon,target,gUnknown_8106A50,1); return TRUE; } -bool32 sub_805783C(struct DungeonEntity *param_1, struct DungeonEntity *param_2) +bool32 sub_805783C(struct DungeonEntity *pokemon, struct DungeonEntity *target) { // Lower attack? - sub_80772C0(param_1,param_2,gUnknown_8106A4C,0x80,1); + sub_80772C0(pokemon,target,gUnknown_8106A4C,0x80,1); return TRUE; } -bool32 sub_805785C(struct DungeonEntity *param_1, struct DungeonEntity *param_2) +bool32 sub_805785C(struct DungeonEntity *pokemon, struct DungeonEntity *target) { gDungeonGlobalData->unkE26B = gUnknown_80F4F42; - if (sub_807EAA0(1,0) == '\0') { + if (sub_807EAA0(1,0) == 0) { // The weather remains unchanged - sub_80522F4(param_1,param_2,gUnknown_80FCF74); + sub_80522F4(pokemon,target,*gUnknown_80FCF74); } return TRUE; } -bool32 sub_80578A4(struct DungeonEntity *param_1, struct DungeonEntity *param_2) +bool32 sub_80578A4(struct DungeonEntity *pokemon, struct DungeonEntity *target) { gDungeonGlobalData->weatherTurnsLeft = gUnknown_80F4F42; - if (sub_807EAA0(1,0) == '\0') { + if (sub_807EAA0(1,0) == 0) { // The weather remains unchanged - sub_80522F4(param_1,param_2,gUnknown_80FCF80); + sub_80522F4(pokemon,target,*gUnknown_80FCF80); } return TRUE; } @@ -71,48 +102,231 @@ bool32 sub_80578EC(struct DungeonEntity *r0, struct DungeonEntity *r1) return TRUE; } -bool32 sub_80578FC(struct DungeonEntity *param_1, struct DungeonEntity *param_2, u32 param_3, u32 param_4) +bool32 sub_80578FC(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 param_3, u32 param_4) { bool32 uVar3; - uVar3 = 0; - if (sub_8055640(param_1, param_2, param_3, 0x80 << 1, param_4) != 0) { + uVar3 = FALSE; + if (sub_8055640(pokemon, target, param_3, 0x100, param_4) != 0) { uVar3 = TRUE; - if (sub_805727C(param_1,param_2, gUnknown_80F4DB6) != '\0') { - sub_80779F0(param_1, param_2, 1, 0); + if (sub_805727C(pokemon,target, gUnknown_80F4DB6) != 0) { + sub_80779F0(pokemon, target, 1, 0); } } return uVar3; } -bool32 sub_8057948(struct DungeonEntity *param_1, struct DungeonEntity *param_2) +bool32 sub_8057948(struct DungeonEntity *pokemon, struct DungeonEntity *target) { - sub_8078968(param_1, param_2); + sub_8078968(pokemon, target); return TRUE; } -bool32 sub_8057954(struct DungeonEntity *param_1, struct DungeonEntity *param_2, u32 param_3) +bool32 sub_8057954(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 param_3) { // {ARG_POKEMON_0} is enraged - sub_8079618(param_1,param_2,0xc,param_3,gUnknown_80FAC88); + sub_8079618(pokemon,target,0xc,param_3,gUnknown_80FAC88); return TRUE; } -bool32 sub_8057974(struct DungeonEntity *param_1, struct DungeonEntity *param_2, struct PokemonMove *param_3, u32 param_4) +bool32 sub_8057974(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *param_3, u32 param_4) { s32 newHP; - u8 local_24; + bool8 local_24; - newHP = param_2->entityData->HP / 2; - local_24 = 0; + newHP = target->entityData->HP / 2; + local_24 = FALSE; if (newHP != 0) { - sub_806F370(param_1,param_2,newHP,1,&local_24,GetMoveType(param_3),sub_8057600(param_3,param_4),0,1,0); + sub_806F370(pokemon,target,newHP,1,&local_24,GetMoveType(param_3),sub_8057600(param_3,param_4),0,1,0); local_24 = local_24 == 0; } else { // The target's HP can't be halved anymore - sub_80522F4(param_1,param_2,gUnknown_80FD018); + sub_80522F4(pokemon,target,*gUnknown_80FD018); } return local_24; } + +bool8 sub_8057A0C(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + s32 newHP; + struct DungeonEntityData *iVar2; + struct DungeonEntityData *iVar3; + struct DungeonEntityData *iVar4; + struct DungeonEntityData *iVar5; + + // Need copies for some reason to match.. + iVar3 = (pokemon->entityData); + iVar4 = iVar3; + iVar2 = (target->entityData); + iVar5 = iVar2; + + newHP = ((iVar3->HP + iVar2->HP) / 2); + iVar3->HP = newHP; + iVar5->HP = newHP; + if (iVar3->HP > iVar3->maxHP) { + iVar3->HP = iVar3->maxHP; + } + if (iVar5->HP > iVar5->maxHP) { + iVar5->HP = iVar5->maxHP; + } + SetMessageArgument(gAvailablePokemonNames,pokemon,0); + SetMessageArgument(gAvailablePokemonNames + 0x50,target,0); + if (iVar4->unkFB == 0) { + iVar4->unkFB = 1; + } + // $m0 and $m1 shared their HP + sub_80522F4(pokemon,target,*gUnknown_80FC7EC); + return TRUE; +} + +bool8 TormentMoveAction(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + struct PokemonMove *movePtr; + s32 iVar4; + struct PokemonMove struggleMove; + struct DungeonEntityData *entityData; + bool8 isTormented; + + entityData = target->entityData; + isTormented = FALSE; + + for(iVar4 = 0; iVar4 < MAX_MON_MOVES; iVar4++) + { + movePtr = &entityData->moves[iVar4]; + if ((movePtr->moveFlags & MOVE_FLAG_EXISTS) != 0) { + if ((movePtr->moveFlags & MOVE_FLAG_DISABLED) == 0) { + if ((movePtr->moveFlags & MOVE_FLAG_LAST_USED) != 0) { + sub_80928C0(gUnknown_202DE58,movePtr,0); + // $i0 was tormented + sub_80522F4(pokemon,target,*gUnknown_80FCFBC); + movePtr->moveFlags |= MOVE_FLAG_DISABLED; + isTormented = TRUE; + } + } + else if ((movePtr->moveFlags & MOVE_FLAG_LAST_USED) == 0) { + movePtr->moveFlags &= ~(MOVE_FLAG_DISABLED); + } + } + }; + + if ((entityData->struggleMoveFlags & MOVE_FLAG_DISABLED) == 0) { + if ((entityData->struggleMoveFlags & MOVE_FLAG_LAST_USED) != 0) { + InitPokemonMove(&struggleMove, MOVE_STRUGGLE); + entityData->struggleMoveFlags |= MOVE_FLAG_DISABLED; + isTormented = TRUE; + sub_80928C0(gUnknown_202DE58,&struggleMove,0); + // $i0 was tormented + sub_80522F4(pokemon,target,*gUnknown_80FCFBC); + } + } + else if ((entityData->struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) { + entityData->struggleMoveFlags &= ~(MOVE_FLAG_DISABLED); + } + if (isTormented) + { + if(entityData->chargingStatus == CHARGING_STATUS_BIDE) { + entityData->chargingStatus = CHARGING_STATUS_NONE; + } + } + else + { + // The target couldn't be tormented + sub_80522F4(pokemon,target,*gUnknown_80FCFE4); + } + return isTormented; +} + +bool8 sub_8057BB4(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + sub_80779F0(pokemon, target, 1, 1); + return TRUE; +} + +bool8 sub_8057BC4(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + sub_8077AE4(pokemon, target, 1); + sub_8077084(pokemon, target, gUnknown_8106A4C, 2); + return TRUE; +} + +bool8 sub_8057BEC(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 param_3, u32 param_4) +{ + bool8 uVar3; + + uVar3 = FALSE; + if (IsSleeping(pokemon)) { + if (sub_8055640(pokemon,target,param_3,0x100,param_4) != 0) { + uVar3 = TRUE; + if (sub_805727C(pokemon,target,gUnknown_80F4E0A) != 0) { + sub_80776C0(pokemon,target,0); + } + } + } + else { + sub_80522F4(pokemon,target,*gUnknown_80FC734); + } + return uVar3; +} + +bool8 sub_8057C68(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + sub_8077434(pokemon, target, gUnknown_8106A4C, 0x40, 1); + return TRUE; +} + +bool8 sub_8057C88(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 param_3, u32 param_4) +{ + u8 uVar3; + + uVar3 = FALSE; + if (sub_8055640(pokemon, target, param_3, 0x100, param_4) != 0) { + uVar3 = TRUE; + if (sub_805727C(pokemon,target,gUnknown_80F4DF6) != 0) { + sub_80776C0(pokemon,target,0); + } + } + return uVar3; +} + +s32 sub_8057CD0(struct DungeonEntity * pokemon, struct DungeonEntity * target, u32 param_3, u32 param_4) +{ + u32 uVar1; + s32 iVar2; + + uVar1 = GetWeather(pokemon); + iVar2 = sub_80556BC(pokemon,target,gUnknown_80F51E4[uVar1],param_3, + gUnknown_80F51EC[uVar1],param_4); + if (iVar2 != 0) { + iVar2 = 1; + } + return iVar2; +} + +bool8 sub_8057D20(struct DungeonEntity * pokemon, struct DungeonEntity * target, u32 param_3, u32 param_4) +{ + u32 uVar3; + bool8 uVar4; + u8 chargeStatus; + + uVar4 = FALSE; + chargeStatus = target->entityData->chargingStatus; + uVar3 = 0x100; + if (chargeStatus == CHARGING_STATUS_DIVE) { + uVar3 = 0x200; + } + if (sub_8055640(pokemon,target,param_3,uVar3,param_4) != 0) { + uVar4 = TRUE; + if (sub_805727C(pokemon,target,gUnknown_80F4E08) != 0) { + sub_80768DC(pokemon,target,0x3b,0); + } + } + return uVar4; +} + +bool8 sub_8057D7C(struct DungeonEntity * param_1, struct DungeonEntity * param_2) +{ + sub_8076F80(param_1, param_2, gUnknown_8106A50, 2, 1, 1); + return TRUE; +} diff --git a/src/code_807E5AC.c b/src/code_807E5AC.c new file mode 100644 index 000000000..c244bc0c7 --- /dev/null +++ b/src/code_807E5AC.c @@ -0,0 +1,11 @@ +#include "global.h" +#include "dungeon_global_data.h" + +void sub_807FC3C(struct Position *param_1, u32 param_2, u32 param_3) +{ + gDungeonGlobalData->unk13574 = param_1->x; + gDungeonGlobalData->unk13576 = param_1->y; + gDungeonGlobalData->unk13578 = param_2; + gDungeonGlobalData->unk13579 = param_3; + gDungeonGlobalData->unk13570 = 1; +} diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c index 11e387ed4..bc4004c54 100644 --- a/src/pokemon_mid.c +++ b/src/pokemon_mid.c @@ -373,7 +373,7 @@ u16 GetLowKickDmg(s16 index) return gMonsterParameters[index].lowkick_dmg; } -u16 GetSizeOrbDmg(s16 index) +u32 GetSizeOrbDmg(s16 index) { return gMonsterParameters[index].sizeorb_dmg; } diff --git a/src/status_checker.c b/src/status_checker.c index 833e1879d..9f2908434 100644 --- a/src/status_checker.c +++ b/src/status_checker.c @@ -1,18 +1,21 @@ #include "global.h" #include "status_checker.h" +#include "code_80521D0.h" #include "constants/move_id.h" #include "constants/status.h" #include "constants/type.h" #include "constants/weather.h" #include "dungeon_engine.h" #include "dungeon_global_data.h" +#include "dungeon_map_access.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_util.h" #include "dungeon_visibility.h" #include "map.h" #include "moves.h" #include "number_util.h" +#include "pokemon.h" #include "status_checks_1.h" #include "tile_types.h" #include "trap.h" @@ -23,6 +26,40 @@ extern void sub_8078F50(struct DungeonEntity *, struct DungeonEntity *); extern void sub_8077E4C(struct DungeonEntity *, struct DungeonEntity *); extern void sub_8079570(struct DungeonEntity *, struct DungeonEntity *); extern void sub_80795C4(struct DungeonEntity *, struct DungeonEntity *); +extern void sub_807DC68(struct DungeonEntity *, struct DungeonEntity *); +extern void sub_8077BB4(struct DungeonEntity *, struct DungeonEntity *, u8); +extern void sub_8078A58(struct DungeonEntity *, struct DungeonEntity *, s16, u32); + +extern u32 sub_803D73C(u32); +extern void sub_8045C28(struct ItemSlot *, u8 , u8 *); +extern void sub_80464C8(struct DungeonEntity *, struct Position *, struct ItemSlot *); +extern void sub_8068FE0(struct DungeonEntity *, u32, struct DungeonEntity *r2); +extern void sub_80522F4(struct DungeonEntity *r1, struct DungeonEntity *r2, const char []); +extern void sub_806F370(struct DungeonEntity *r0, struct DungeonEntity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void sub_807FC3C(struct Position *, u32, u32); +extern void sub_8042A64(struct Position *); +extern void sub_8040A84(void); +extern void sub_8049ED4(void); +extern void sub_80498A8(s32, s32); +extern void sub_806CF60(); +extern void sub_8042A54(struct Position *); +extern void sub_8049BB0(s32, s32); +extern s16 sub_8057600(void*, u32); + +extern u8 *gUnknown_80FF678[]; +extern u8 *gUnknown_80FD0B8[]; +extern u8 *gUnknown_80FD0B4[]; +extern u8 *gUnknown_80FD454[]; +extern s16 gUnknown_80F4FC6; + +struct Position_Alt +{ + union PositionAlt + { + struct Position norm; + u32 full_bits; + } temp; +}; // Array indices correspond to the current dungeon tileset. const u8 gDungeonCamouflageTypes[76] = { @@ -104,6 +141,126 @@ const u8 gDungeonCamouflageTypes[76] = { TYPE_ROCK }; +bool8 sub_805C1E4(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + sub_80522F4(pokemon, target, *gUnknown_80FD454); + return FALSE; +} + +bool8 sub_805C1F8(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + sub_8077BB4(pokemon, target, 1); + return TRUE; +} + +bool8 sub_805C208(struct DungeonEntity *param_1,struct DungeonEntity *param_2,struct PokemonMove *param_3,u32 param_4) +{ + u32 uVar3; + u8 local_24; + + local_24 = 0; + uVar3 = GetSizeOrbDmg(param_2->entityData->transformSpecies); + sub_806F370(param_1,param_2,uVar3,1,&local_24,GetMoveType(param_3),sub_8057600(param_3,param_4),0,1,0); + + local_24 = local_24 == 0; + return local_24; +} + +bool8 sub_805C288(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + sub_8078A58(pokemon, target, gUnknown_80F4FC6, 0); + return TRUE; +} + +bool8 sub_805C2A0(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + sub_807DC68(pokemon, target); + return TRUE; +} + +bool8 FillInOrbAction(struct DungeonEntity *pokemon,struct DungeonEntity *target) +{ + struct MapTile *tileToFill; + struct DungeonEntityData *iVar5; + int y; + bool8 didWork; // TODO better name for this... signifies that orb worked + int x; + u16 cast_x; + u32 cast_y; + struct Position_Alt tileCoords; + + didWork = FALSE; + iVar5 = target->entityData; + if (IsBossBattle()) { + SendMessage(pokemon,*gUnknown_80FD0B8); + return FALSE; + } + else + { + // Calcuate the coordinates of the tile in front of the user + cast_x = target->posWorld.x + gAdjacentTileOffsets[iVar5->action.facingDir].x; + tileCoords.temp.full_bits = (tileCoords.temp.full_bits & 0xffff0000) | cast_x; + + cast_y = ((u16)(target->posWorld.y + gAdjacentTileOffsets[iVar5->action.facingDir].y)) << 0x10; + tileCoords.temp.full_bits = (tileCoords.temp.full_bits & 0x0000ffff) | cast_y; + + sub_8042A54((struct Position *)&tileCoords); + tileToFill = GetMapTile_2(tileCoords.temp.norm.x,tileCoords.temp.norm.y); + if ((tileToFill->tileType & (TILE_TYPE_FLOOR | TILE_TYPE_LIQUID)) == TILE_TYPE_LIQUID) { + tileToFill->tileType = (tileToFill->tileType & ~(TILE_TYPE_FLOOR | TILE_TYPE_LIQUID)) | TILE_TYPE_FLOOR; + + for(y = -1; y < 2; y++) + for(x = -1; x < 2; x++) + sub_80498A8(tileCoords.temp.norm.x + x, tileCoords.temp.norm.y + y); + didWork = TRUE; + sub_806CF60(); + } + + for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) + for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) + sub_8049BB0(x,y); + + if (didWork) { + sub_8042A64((struct Position *)&tileCoords); + sub_80522F4(pokemon,target,*gUnknown_80FD0B4); + } + else { + sub_80522F4(pokemon,target,*gUnknown_80FD0B8); + } + sub_8040A84(); + sub_8049ED4(); + return didWork; + } +} + +bool8 sub_805C3DC(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + u32 var; + var = (target->entityData->isEnemy ? 2 : 1); + sub_807FC3C(&target->posWorld, 0x14, var); + return TRUE; +} + +bool8 sub_805C3F8(struct DungeonEntity *pokemon, struct DungeonEntity *target) +{ + struct ItemSlot stack; + struct Position posStruct = target->posWorld; + + if(target->entityData->clientType != CLIENT_TYPE_NONE) + { + sub_80522F4(pokemon, target, *gUnknown_80FF678); + return FALSE; + } + else + { + target->visible = FALSE; + sub_8045C28(&stack, sub_803D73C(0), 0); + sub_80464C8(pokemon, &posStruct, &stack); + sub_8068FE0(target, 0x218, pokemon); + return TRUE; + } +} + bool8 sub_805C45C(struct DungeonEntity *pokemon, struct DungeonEntity *target) { sub_807F43C(pokemon, target);