diff --git a/asm/code_8044210.s b/asm/code_8044210.s deleted file mode 100644 index cbe1f205e..000000000 --- a/asm/code_8044210.s +++ /dev/null @@ -1,339 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_8044574 -sub_8044574: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - bl GetLeader - mov r10, r0 - movs r7, 0 - mov r0, sp - adds r0, 0x4 - str r0, [sp, 0x40] - ldr r1, _08044634 - mov r9, r1 -_08044592: - mov r2, r9 - ldr r0, [r2] - lsls r1, r7, 2 - ldr r3, _08044638 - adds r0, r3 - adds r0, r1 - ldr r5, [r0] - adds r0, r5, 0 - bl EntityIsValid - lsls r0, 24 - cmp r0, 0 - beq _080446A4 - ldr r6, [r5, 0x70] - mov r8, r6 - ldrb r0, [r6, 0x7] - cmp r0, 0 - bne _080446A4 - bl sub_8044B28 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080446AC - mov r1, r9 - ldr r0, [r1] - adds r0, 0xB8 - str r5, [r0] - bl TriggerWeatherAbilities - movs r2, 0xA2 - lsls r2, 1 - adds r0, r6, r2 - strb r4, [r0] - adds r0, r5, 0 - bl CalcSpeedStage - mov r3, r9 - ldr r1, [r3] - movs r2, 0xCC - lsls r2, 3 - adds r1, r2 - movs r3, 0 - ldrsh r1, [r1, r3] - lsls r1, 1 - movs r2, 0x32 - muls r0, r2 - adds r1, r0 - ldr r0, _0804463C - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080446A4 - movs r3, 0xA4 - lsls r3, 1 - adds r0, r6, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080446A4 - ldrh r1, [r6] - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _080446A4 - movs r3, 0x80 - lsls r3, 7 - adds r0, r3, 0 - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _08044644 - ldr r2, _08044640 - adds r0, r2, 0 - ands r0, r1 - strh r0, [r6] - b _080446A4 - .align 2, 0 -_08044634: .4byte gDungeon -_08044638: .4byte 0x0001357c -_0804463C: .4byte gSpeedTurns -_08044640: .4byte 0x0000bfff -_08044644: - ldr r1, _08044668 - add r1, r8 - strb r0, [r1] - adds r0, r5, 0 - bl TickStatusHeal - adds r0, r5, 0 - bl EntityIsValid - lsls r0, 24 - cmp r0, 0 - beq _080446A4 - adds r0, r5, 0 - bl sub_8071DA4 - movs r4, 0 - b _0804466E - .align 2, 0 -_08044668: .4byte 0x00000145 -_0804466C: - adds r4, 0x1 -_0804466E: - cmp r4, 0x2 - bgt _080446A4 - adds r0, r5, 0 - movs r1, 0 - bl RunMonsterAI - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - bne _080446A4 - adds r0, r5, 0 - bl sub_8072CF4 - lsls r0, 24 - cmp r0, 0 - beq _080446A4 - bl sub_8086AC0 - movs r0, 0 - bl sub_8043ED0 - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - beq _0804466C -_080446A4: - adds r7, 0x1 - cmp r7, 0x3 - bgt _080446AC - b _08044592 -_080446AC: - movs r0, 0 - mov r8, r0 -_080446B0: - adds r0, 0x1 - mov r9, r0 - add r2, sp, 0x8 - ldr r1, [sp, 0x40] - mov r0, sp - movs r7, 0x2 -_080446BC: - mov r3, r8 - str r3, [r0] - str r2, [r1] - adds r2, 0x8 - adds r1, 0x8 - adds r0, 0x8 - subs r7, 0x1 - cmp r7, 0 - bge _080446BC - str r3, [sp, 0x18] - str r3, [sp, 0x1C] - movs r7, 0 -_080446D4: - ldr r0, _08044710 - ldr r0, [r0] - lsls r1, r7, 2 - ldr r2, _08044714 - adds r0, r2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityIsValid - lsls r0, 24 - cmp r0, 0 - beq _08044760 - ldr r1, [r4, 0x70] - movs r3, 0xA2 - lsls r3, 1 - adds r2, r1, r3 - ldrb r0, [r2] - cmp r0, 0 - beq _08044760 - ldrb r0, [r1, 0x7] - cmp r0, 0 - beq _08044718 - adds r3, 0x1 - adds r0, r1, r3 - mov r1, r8 - strb r1, [r0] - strb r1, [r2] - b _08044760 - .align 2, 0 -_08044710: .4byte gDungeon -_08044714: .4byte 0x0001357c -_08044718: - mov r2, r10 - movs r3, 0x4 - ldrsh r1, [r2, r3] - movs r2, 0x4 - ldrsh r0, [r4, r2] - subs r2, r1, r0 - cmp r2, 0 - bge _0804472A - negs r2, r2 -_0804472A: - mov r3, r10 - movs r0, 0x6 - ldrsh r1, [r3, r0] - movs r3, 0x6 - ldrsh r0, [r4, r3] - subs r1, r0 - cmp r1, 0 - bge _0804473C - negs r1, r1 -_0804473C: - cmp r1, r2 - bge _08044742 - adds r1, r2, 0 -_08044742: - cmp r1, 0x2 - ble _08044748 - movs r1, 0x2 -_08044748: - add r3, sp, 0x20 - lsls r0, r7, 3 - adds r3, r0 - str r4, [r3] - add r2, sp, 0x24 - adds r2, r0 - lsls r1, 3 - ldr r0, [sp, 0x40] - adds r1, r0, r1 - ldr r0, [r1] - str r0, [r2] - str r3, [r1] -_08044760: - adds r7, 0x1 - cmp r7, 0x3 - ble _080446D4 - mov r5, sp - movs r6, 0 -_0804476A: - ldr r4, [r5] - cmp r4, 0 - beq _080447A0 - ldr r1, [r4, 0x70] - ldr r3, _08044814 - adds r2, r1, r3 - movs r0, 0x1 - strb r0, [r2] - movs r2, 0xA2 - lsls r2, 1 - adds r0, r1, r2 - strb r6, [r0] - adds r0, r4, 0 - movs r1, 0x1 - bl RunMonsterAI - adds r0, r4, 0 - bl sub_8072CF4 - bl sub_8086AC0 - movs r0, 0 - bl sub_8043ED0 - adds r0, r4, 0 - bl EntityIsValid -_080447A0: - ldr r5, [r5, 0x4] - cmp r5, 0 - bne _0804476A - mov r0, r9 - cmp r0, 0x2 - ble _080446B0 - bl sub_8044B28 - lsls r0, 24 - cmp r0, 0 - bne _08044802 - movs r7, 0 -_080447B8: - ldr r0, _08044818 - ldr r0, [r0] - lsls r1, r7, 2 - ldr r3, _0804481C - adds r0, r3 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityIsValid - lsls r0, 24 - cmp r0, 0 - beq _080447FC - ldr r0, [r4, 0x70] - movs r1, 0xA2 - lsls r1, 1 - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0 - beq _080447FC - adds r0, r4, 0 - bl sub_8074094 - adds r0, r4, 0 - bl EntityIsValid - lsls r0, 24 - cmp r0, 0 - beq _080447FC - adds r0, r4, 0 - bl sub_8071DA4 - movs r0, 0 - strb r0, [r5] -_080447FC: - adds r7, 0x1 - cmp r7, 0x3 - ble _080447B8 -_08044802: - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08044814: .4byte 0x00000145 -_08044818: .4byte gDungeon -_0804481C: .4byte 0x0001357c - thumb_func_end sub_8044574 - - .align 2, 0 diff --git a/asm/code_80718D8.s b/asm/code_80718D8.s deleted file mode 100644 index a00d4bda9..000000000 --- a/asm/code_80718D8.s +++ /dev/null @@ -1,441 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_8072778 -sub_8072778: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xD0 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0xC4] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC8] - ldr r0, [r1, 0x70] - mov r8, r0 - movs r1, 0 - str r1, [sp, 0xCC] - ldrb r0, [r0, 0x6] - cmp r0, 0 - beq _080727A8 - movs r2, 0 - str r2, [sp, 0xC8] - movs r4, 0 - str r4, [sp, 0xC4] -_080727A8: - mov r0, r8 - movs r2, 0x2 - ldrsh r1, [r0, r2] - ldrb r2, [r0, 0x9] - movs r4, 0xC - ldrsh r3, [r0, r4] - mov r0, sp - bl GetMovesLearnedAtLevel - adds r7, r0, 0 - add r4, sp, 0x20 - movs r1, 0x8C - lsls r1, 1 - add r1, r8 - adds r0, r4, 0 - bl unk_CopyMoves4To8AndClearFlag2Unk4 - mov r10, r4 - cmp r7, 0 - beq _08072810 - adds r0, r7, 0 - bl DungeonRandInt - movs r2, 0 - lsls r0, 1 - mov r1, sp - adds r6, r1, r0 - mov r5, sp - adds r5, 0x21 - mov r3, r10 -_080727E4: - lsls r0, r2, 3 - add r0, sp - adds r0, 0x20 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08072806 - ldrh r1, [r6] - adds r0, r3, 0 - bl InitPokemonMove - ldrb r1, [r5] - movs r0, 0x4 - orrs r0, r1 - strb r0, [r5] - b _08072810 -_08072806: - adds r5, 0x8 - adds r3, 0x8 - adds r2, 0x1 - cmp r2, 0x7 - ble _080727E4 -_08072810: - movs r5, 0 - movs r4, 0x1 -_08072814: - movs r7, 0 - movs r2, 0 -_08072818: - lsls r0, r2, 3 - add r0, sp - adds r0, 0x20 - ldrb r1, [r0] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0807282A - adds r7, 0x1 -_0807282A: - adds r2, 0x1 - cmp r2, 0x7 - ble _08072818 - cmp r7, 0x4 - bgt _080728D4 - movs r3, 0 - movs r5, 0 - cmp r3, r7 - bge _0807287C - movs r4, 0x8C - lsls r4, 1 - add r4, r8 - mov r6, r10 -_08072844: - lsls r0, r5, 3 - movs r2, 0x8C - lsls r2, 1 - add r2, r8 - adds r2, r0 - ldr r0, [r6] - ldr r1, [r6, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08072872 - movs r0, 0xFB - ands r0, r1 - strb r0, [r4, 0x1] - add r0, sp, 0x60 - adds r1, r4, 0 - movs r2, 0 - bl BufferMoveName - movs r3, 0x1 -_08072872: - adds r4, 0x8 - adds r6, 0x8 - adds r5, 0x1 - cmp r5, r7 - blt _08072844 -_0807287C: - cmp r5, 0x3 - bgt _08072894 - movs r2, 0x8C - lsls r2, 1 - movs r1, 0 -_08072886: - lsls r0, r5, 3 - add r0, r8 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x3 - ble _08072886 -_08072894: - cmp r3, 0 - beq _08072928 - ldr r2, [sp, 0xC4] - cmp r2, 0 - beq _08072928 - ldr r0, _080728C8 - mov r1, r8 - movs r2, 0 - bl SetMessageArgument_2 - ldr r0, _080728CC - add r1, sp, 0x60 - bl strcpy - mov r0, r9 - movs r1, 0x9C - lsls r1, 1 - bl sub_80421C0 - ldr r0, _080728D0 - ldr r1, [r0] - mov r0, r9 - bl DisplayDungeonLoggableMessage - b _08072928 - .align 2, 0 -_080728C8: .4byte gFormatBuffer_Monsters -_080728CC: .4byte gFormatBuffer_Items -_080728D0: .4byte gUnknown_80F9F04 -_080728D4: - mov r1, r8 - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _08072918 - ldr r2, [sp, 0xC8] - cmp r2, 0 - beq _08072918 - ldr r0, [sp, 0xCC] - cmp r0, 0 - bne _08072902 - ldr r1, [sp, 0xC4] - cmp r1, 0 - beq _08072902 - movs r0, 0xA - movs r1, 0x6 - bl sub_803E708 - ldr r0, _08072914 - ldr r1, [r0] - movs r0, 0 - movs r2, 0x1 - bl DisplayDungeonMessage -_08072902: - movs r2, 0x1 - str r2, [sp, 0xCC] - mov r0, r9 - mov r1, r10 - movs r3, 0 - bl sub_8063E70 - b _08072920 - .align 2, 0 -_08072914: .4byte gUnknown_80F9FA4 -_08072918: - mov r0, r9 - mov r1, r10 - bl sub_8072B24 -_08072920: - adds r5, 0x1 - cmp r5, 0x1D - bgt _08072928 - b _08072814 -_08072928: - add sp, 0xD0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8072778 - - thumb_func_start sub_8072938 -sub_8072938: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xA4 - mov r9, r0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, [r0, 0x70] - mov r8, r0 - movs r1, 0 - mov r10, r1 - movs r1, 0x8C - lsls r1, 1 - add r1, r8 - mov r0, sp - bl unk_CopyMoves4To8AndClearFlag2Unk4 - movs r3, 0 - mov r4, sp - mov r2, sp -_08072964: - ldrb r1, [r4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08072980 - adds r0, r2, 0 - adds r1, r5, 0 - bl InitPokemonMove - ldrb r1, [r4, 0x1] - movs r0, 0x4 - orrs r0, r1 - strb r0, [r4, 0x1] - b _0807298A -_08072980: - adds r4, 0x8 - adds r2, 0x8 - adds r3, 0x1 - cmp r3, 0x7 - ble _08072964 -_0807298A: - movs r4, 0 - movs r5, 0x1 -_0807298E: - movs r7, 0 - mov r2, sp - movs r3, 0x7 -_08072994: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080729A0 - adds r7, 0x1 -_080729A0: - adds r2, 0x8 - subs r3, 0x1 - cmp r3, 0 - bge _08072994 - cmp r7, 0x4 - bgt _08072A50 - movs r5, 0 - cmp r5, r7 - bge _080729F4 - movs r4, 0x8C - lsls r4, 1 - add r4, r8 - mov r6, sp -_080729BA: - lsls r0, r5, 3 - movs r2, 0x8C - lsls r2, 1 - add r2, r8 - adds r2, r0 - ldr r0, [r6] - ldr r1, [r6, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080729EA - movs r0, 0xFB - ands r0, r1 - strb r0, [r4, 0x1] - add r0, sp, 0x40 - adds r1, r4, 0 - movs r2, 0 - bl BufferMoveName - movs r0, 0x1 - mov r10, r0 -_080729EA: - adds r4, 0x8 - adds r6, 0x8 - adds r5, 0x1 - cmp r5, r7 - blt _080729BA -_080729F4: - cmp r5, 0x3 - bgt _08072A0C - movs r2, 0x8C - lsls r2, 1 - movs r1, 0 -_080729FE: - lsls r0, r5, 3 - add r0, r8 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x3 - ble _080729FE -_08072A0C: - mov r1, r10 - cmp r1, 0 - beq _08072A92 - mov r1, r8 - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _08072A8C - ldr r0, _08072A44 - mov r1, r9 - movs r2, 0 - bl SubstitutePlaceholderStringTags - ldr r0, _08072A48 - add r1, sp, 0x40 - bl strcpy - mov r0, r9 - movs r1, 0x9C - lsls r1, 1 - bl sub_80421C0 - ldr r0, _08072A4C - ldr r1, [r0] - mov r0, r9 - bl DisplayDungeonLoggableMessage - b _08072A8C - .align 2, 0 -_08072A44: .4byte gFormatBuffer_Monsters -_08072A48: .4byte gFormatBuffer_Items -_08072A4C: .4byte gUnknown_80F9F04 -_08072A50: - movs r0, 0 - mov r10, r0 - mov r1, r8 - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _08072A84 - ldr r0, _08072A80 - ldr r1, [r0] - movs r0, 0 - movs r2, 0x1 - bl DisplayDungeonMessage - mov r0, r9 - mov r1, sp - movs r2, 0x1 - movs r3, 0x1 - bl sub_8063E70 - lsls r0, 24 - cmp r0, 0 - bne _08072A84 - movs r0, 0 - b _08072AB0 - .align 2, 0 -_08072A80: .4byte gUnknown_80FDF40 -_08072A84: - adds r4, 0x1 - cmp r4, 0x1D - bgt _08072A8C - b _0807298E -_08072A8C: - mov r0, r10 - cmp r0, 0 - bne _08072AAE -_08072A92: - mov r1, r8 - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _08072AAE - ldr r0, _08072AC0 - mov r1, r9 - movs r2, 0 - bl SubstitutePlaceholderStringTags - ldr r0, _08072AC4 - ldr r1, [r0] - mov r0, r9 - bl DisplayDungeonLoggableMessage -_08072AAE: - movs r0, 0x1 -_08072AB0: - add sp, 0xA4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08072AC0: .4byte gFormatBuffer_Monsters -_08072AC4: .4byte gUnknown_80F9F2C - thumb_func_end sub_8072938 - - .align 2, 0 diff --git a/charmap.txt b/charmap.txt index c97711df1..bcf1ce1fb 100644 --- a/charmap.txt +++ b/charmap.txt @@ -529,7 +529,11 @@ UNK_MACRO_3E = 23 3E @ #> (Seems to be an alignment operator) EXTRA_MSG = 23 50 @ #P WAIT_PRESS = 23 57 @ #W NEW_LINE = 23 6E @ #n - +UNK_MACRO_5F_1 = 23 5F 01 2E @ #_. (related to gUnknown_202749A) +UNK_MACRO_5F_2 = 23 5F 02 2E +UNK_MACRO_5F_3 = 23 5F 03 2E +UNK_MACRO_5F_4 = 23 5F 04 2E +UNK_MACRO_5F_5 = 23 5F 05 2E @ COLOR FORMATTING MACROS @ diff --git a/data/data_80F4468.s b/data/data_80F4468.s deleted file mode 100644 index 71072e5da..000000000 --- a/data/data_80F4468.s +++ /dev/null @@ -1,112 +0,0 @@ - .section .rodata - - .global gUnknown_80F4468 -gUnknown_80F4468: @ 80F4468 - @ Position[76] - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00 - .byte 0x01, 0x00, 0x01, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0xff, 0xff - .byte 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00 - .byte 0x02, 0x00, 0x02, 0x00, 0x63, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff - .byte 0xff, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xff - .byte 0xff, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x01, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x02, 0x00 - .byte 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0x03, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0x02, 0x00, 0xfd, 0xff, 0xff, 0xff - .byte 0xfd, 0xff, 0x01, 0x00, 0x01, 0x00, 0xfd, 0xff, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0xfe, 0xff, 0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00, 0x01, 0x00, 0xfe, 0xff, 0xfd, 0xff - .byte 0xfe, 0xff, 0x03, 0x00, 0xfd, 0xff, 0xfe, 0xff, 0xfd, 0xff, 0x02, 0x00, 0x02, 0x00, 0xfd, 0xff, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x02, 0x00, 0xfd, 0xff, 0xfd, 0xff - .byte 0xfd, 0xff, 0x03, 0x00, 0x03, 0x00, 0xfd, 0xff, 0x03, 0x00, 0x03, 0x00, 0x63, 0x00, 0x63, 0x00 - - .global gUnknown_80F4598 -gUnknown_80F4598: @ 80F4598 - @ Position[158] - .byte 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x00, 0x00 - .byte 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xff, 0xff - .byte 0xfe, 0xff, 0x01, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x01, 0x00 - .byte 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0x03, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0x02, 0x00, 0xfd, 0xff, 0xff, 0xff, 0xfd, 0xff, 0x01, 0x00, 0x01, 0x00, 0xfd, 0xff - .byte 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0xfe, 0xff, 0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00, 0x01, 0x00, 0xfe, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0x03, 0x00, 0xfd, 0xff, 0xfe, 0xff - .byte 0xfd, 0xff, 0x02, 0x00, 0x02, 0x00, 0xfd, 0xff, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x02, 0x00, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0x03, 0x00, 0x03, 0x00, 0xfd, 0xff - .byte 0x03, 0x00, 0x03, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x04, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0xff, 0xff, 0xfc, 0xff - .byte 0xff, 0xff, 0x04, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0xff, 0xff, 0x01, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x04, 0x00, 0xfc, 0xff, 0x02, 0x00, 0x04, 0x00, 0x02, 0x00, 0xfe, 0xff, 0xfc, 0xff - .byte 0xfe, 0xff, 0x04, 0x00, 0xfc, 0xff, 0xfe, 0xff, 0x04, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xfc, 0xff, 0x02, 0x00, 0x04, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0xfd, 0xff, 0xfc, 0xff - .byte 0xfd, 0xff, 0x04, 0x00, 0xfc, 0xff, 0xfd, 0xff, 0x04, 0x00, 0xfd, 0xff, 0x03, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x04, 0x00, 0xfc, 0xff, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0xfc, 0xff, 0xfc, 0xff - .byte 0xfc, 0xff, 0x04, 0x00, 0xfb, 0xff, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0xff, 0x00, 0x00, 0x05, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x05, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff - .byte 0xff, 0xff, 0x05, 0x00, 0xfb, 0xff, 0x01, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0xfb, 0xff, 0x01, 0x00, 0x05, 0x00, 0xfb, 0xff, 0xfe, 0xff, 0x05, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xfb, 0xff - .byte 0xfe, 0xff, 0x05, 0x00, 0xfb, 0xff, 0x02, 0x00, 0x05, 0x00, 0x02, 0x00, 0x02, 0x00, 0xfb, 0xff, 0x02, 0x00, 0x05, 0x00, 0xfb, 0xff, 0xfd, 0xff, 0x05, 0x00, 0xfd, 0xff, 0xfd, 0xff, 0xfb, 0xff - .byte 0xfd, 0xff, 0x05, 0x00, 0xfb, 0xff, 0x03, 0x00, 0x05, 0x00, 0x03, 0x00, 0x03, 0x00, 0xfb, 0xff, 0x03, 0x00, 0x05, 0x00, 0xfb, 0xff, 0xfc, 0xff, 0x05, 0x00, 0xfc, 0xff, 0xfc, 0xff, 0xfb, 0xff - .byte 0xfc, 0xff, 0x05, 0x00, 0xfb, 0xff, 0x04, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0xfb, 0xff, 0x04, 0x00, 0x05, 0x00, 0xfb, 0xff, 0xfb, 0xff, 0x05, 0x00, 0xfb, 0xff, 0xfb, 0xff, 0xfb, 0xff - .byte 0xfb, 0xff, 0x05, 0x00, 0x63, 0x00, 0x63, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff - .byte 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff - .byte 0x02, 0x00, 0xff, 0xff, 0xfe, 0xff, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00 - .byte 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - .byte 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x63, 0x00, 0x63, 0x00 - - .global gUnknown_80F4810 -gUnknown_80F4810: - @ Position[99] - .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00 - .byte 0x01, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00, 0x02, 0x00, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00 - .byte 0x01, 0x00, 0x04, 0x00, 0xff, 0xff, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0xfe, 0xff, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0xfd, 0xff, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x05, 0x00 - .byte 0xff, 0xff, 0x05, 0x00, 0x02, 0x00, 0x05, 0x00, 0xfe, 0xff, 0x05, 0x00, 0x03, 0x00, 0x05, 0x00, 0xfd, 0xff, 0x05, 0x00, 0x04, 0x00, 0x05, 0x00, 0xfc, 0xff, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00 - .byte 0x01, 0x00, 0x06, 0x00, 0xff, 0xff, 0x06, 0x00, 0x02, 0x00, 0x06, 0x00, 0xfe, 0xff, 0x06, 0x00, 0x03, 0x00, 0x06, 0x00, 0xfd, 0xff, 0x06, 0x00, 0x04, 0x00, 0x06, 0x00, 0xfc, 0xff, 0x06, 0x00 - .byte 0x05, 0x00, 0x06, 0x00, 0xfb, 0xff, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0x02, 0x00, 0x07, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x03, 0x00, 0x07, 0x00 - .byte 0xfd, 0xff, 0x07, 0x00, 0x04, 0x00, 0x07, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x05, 0x00, 0x07, 0x00, 0xfb, 0xff, 0x07, 0x00, 0x06, 0x00, 0x07, 0x00, 0xfa, 0xff, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00 - .byte 0x01, 0x00, 0x08, 0x00, 0xff, 0xff, 0x08, 0x00, 0x02, 0x00, 0x08, 0x00, 0xfe, 0xff, 0x08, 0x00, 0x03, 0x00, 0x08, 0x00, 0xfd, 0xff, 0x08, 0x00, 0x04, 0x00, 0x08, 0x00, 0xfc, 0xff, 0x08, 0x00 - .byte 0x05, 0x00, 0x08, 0x00, 0xfb, 0xff, 0x08, 0x00, 0x06, 0x00, 0x08, 0x00, 0xfa, 0xff, 0x08, 0x00, 0x07, 0x00, 0x08, 0x00, 0xf9, 0xff, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x00, 0x09, 0x00 - .byte 0xff, 0xff, 0x09, 0x00, 0x02, 0x00, 0x09, 0x00, 0xfe, 0xff, 0x09, 0x00, 0x03, 0x00, 0x09, 0x00, 0xfd, 0xff, 0x09, 0x00, 0x04, 0x00, 0x09, 0x00, 0xfc, 0xff, 0x09, 0x00, 0x05, 0x00, 0x09, 0x00 - .byte 0xfb, 0xff, 0x09, 0x00, 0x06, 0x00, 0x09, 0x00, 0xfa, 0xff, 0x09, 0x00, 0x07, 0x00, 0x09, 0x00, 0xf9, 0xff, 0x09, 0x00, 0x08, 0x00, 0x09, 0x00, 0xf8, 0xff, 0x09, 0x00, 0x00, 0x00, 0x0a, 0x00 - .byte 0x01, 0x00, 0x0a, 0x00, 0xff, 0xff, 0x0a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0xfe, 0xff, 0x0a, 0x00, 0x03, 0x00, 0x0a, 0x00, 0xfd, 0xff, 0x0a, 0x00, 0x04, 0x00, 0x0a, 0x00, 0xfc, 0xff, 0x0a, 0x00 - .byte 0x05, 0x00, 0x0a, 0x00, 0xfb, 0xff, 0x0a, 0x00, 0x06, 0x00, 0x0a, 0x00, 0xfa, 0xff, 0x0a, 0x00, 0x07, 0x00, 0x0a, 0x00, 0xf9, 0xff, 0x0a, 0x00, 0x08, 0x00, 0x0a, 0x00, 0xf8, 0xff, 0x0a, 0x00 - .byte 0x63, 0x00, 0x63, 0x00 - - .global gUnknown_80F499C -gUnknown_80F499C: - @ Position[101] - .byte 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00, 0x01, 0x00 - .byte 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0xff, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0xfe, 0xff, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0xfd, 0xff - .byte 0x04, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0xff, 0xff, 0x05, 0x00, 0x01, 0x00, 0x05, 0x00, 0xfe, 0xff, 0x05, 0x00, 0x02, 0x00, 0x05, 0x00, 0xfd, 0xff, 0x05, 0x00, 0x03, 0x00 - .byte 0x05, 0x00, 0xfc, 0xff, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0xff, 0xff, 0x06, 0x00, 0x01, 0x00, 0x06, 0x00, 0xfe, 0xff, 0x06, 0x00, 0x02, 0x00, 0x06, 0x00, 0xfd, 0xff - .byte 0x06, 0x00, 0x03, 0x00, 0x06, 0x00, 0xfc, 0xff, 0x06, 0x00, 0x04, 0x00, 0x06, 0x00, 0xfb, 0xff, 0x06, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0x01, 0x00 - .byte 0x07, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x02, 0x00, 0x07, 0x00, 0xfd, 0xff, 0x07, 0x00, 0x03, 0x00, 0x07, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x04, 0x00, 0x07, 0x00, 0xfb, 0xff, 0x07, 0x00, 0x05, 0x00 - .byte 0x07, 0x00, 0xfa, 0xff, 0x07, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0xff, 0xff, 0x08, 0x00, 0x01, 0x00, 0x08, 0x00, 0xfe, 0xff, 0x08, 0x00, 0x02, 0x00, 0x08, 0x00, 0xfd, 0xff - .byte 0x08, 0x00, 0x03, 0x00, 0x08, 0x00, 0xfc, 0xff, 0x08, 0x00, 0x04, 0x00, 0x08, 0x00, 0xfb, 0xff, 0x08, 0x00, 0x05, 0x00, 0x08, 0x00, 0xfa, 0xff, 0x08, 0x00, 0x06, 0x00, 0x08, 0x00, 0xf9, 0xff - .byte 0x08, 0x00, 0x07, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0xff, 0xff, 0x09, 0x00, 0x01, 0x00, 0x09, 0x00, 0xfe, 0xff, 0x09, 0x00, 0x02, 0x00, 0x09, 0x00, 0xfd, 0xff, 0x09, 0x00, 0x03, 0x00 - .byte 0x09, 0x00, 0xfc, 0xff, 0x09, 0x00, 0x04, 0x00, 0x09, 0x00, 0xfb, 0xff, 0x09, 0x00, 0x05, 0x00, 0x09, 0x00, 0xfa, 0xff, 0x09, 0x00, 0x06, 0x00, 0x09, 0x00, 0xf9, 0xff, 0x09, 0x00, 0x07, 0x00 - .byte 0x09, 0x00, 0xf8, 0xff, 0x09, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, 0x0a, 0x00, 0x01, 0x00, 0x0a, 0x00, 0xfe, 0xff, 0x0a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0xfd, 0xff - .byte 0x0a, 0x00, 0x03, 0x00, 0x0a, 0x00, 0xfc, 0xff, 0x0a, 0x00, 0x04, 0x00, 0x0a, 0x00, 0xfb, 0xff, 0x0a, 0x00, 0x05, 0x00, 0x0a, 0x00, 0xfa, 0xff, 0x0a, 0x00, 0x06, 0x00, 0x0a, 0x00, 0xf9, 0xff - .byte 0x0a, 0x00, 0x07, 0x00, 0x0a, 0x00, 0xf8, 0xff, 0x0a, 0x00, 0x08, 0x00, 0x0a, 0x00, 0xf7, 0xff, 0x0a, 0x00, 0x09, 0x00, 0x63, 0x00, 0x63, 0x00 - - .global gUnknown_80F4B30 -gUnknown_80F4B30: - @ Position[101] - .byte 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00 - .byte 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00 - .byte 0x04, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x04, 0x00 - .byte 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x05, 0x00, 0x02, 0x00, 0x02, 0x00, 0x05, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, 0x00, 0x06, 0x00, 0x06, 0x00 - .byte 0x06, 0x00, 0x05, 0x00, 0x05, 0x00, 0x06, 0x00, 0x06, 0x00, 0x04, 0x00, 0x04, 0x00, 0x06, 0x00, 0x06, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x06, 0x00 - .byte 0x06, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x05, 0x00, 0x05, 0x00, 0x07, 0x00, 0x07, 0x00, 0x04, 0x00 - .byte 0x04, 0x00, 0x07, 0x00, 0x07, 0x00, 0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x07, 0x00, 0x02, 0x00, 0x02, 0x00, 0x07, 0x00, 0x07, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00 - .byte 0x08, 0x00, 0x07, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x06, 0x00, 0x06, 0x00, 0x08, 0x00, 0x08, 0x00, 0x05, 0x00, 0x05, 0x00, 0x08, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00, 0x08, 0x00 - .byte 0x08, 0x00, 0x03, 0x00, 0x03, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x02, 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x08, 0x00 - .byte 0x08, 0x00, 0x09, 0x00, 0x09, 0x00, 0x07, 0x00, 0x07, 0x00, 0x09, 0x00, 0x09, 0x00, 0x06, 0x00, 0x06, 0x00, 0x09, 0x00, 0x09, 0x00, 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x09, 0x00, 0x04, 0x00 - .byte 0x04, 0x00, 0x09, 0x00, 0x09, 0x00, 0x03, 0x00, 0x03, 0x00, 0x09, 0x00, 0x09, 0x00, 0x02, 0x00, 0x02, 0x00, 0x09, 0x00, 0x09, 0x00, 0x01, 0x00, 0x01, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0a, 0x00 - .byte 0x0a, 0x00, 0x09, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x07, 0x00, 0x07, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x06, 0x00, 0x06, 0x00, 0x0a, 0x00 - .byte 0x0a, 0x00, 0x05, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x02, 0x00, 0x0a, 0x00 - .byte 0x0a, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x63, 0x00 - - .global gUnknown_80F4CC4 -gUnknown_80F4CC4: @ 80F4CC4 - @ replacing .incbin "baserom.gba", 0x000f4cc4, 0x40 - .4byte gUnknown_80F4810 - .byte 0x01, 0x00, 0x01, 0x00 - .4byte gUnknown_80F4B30 - .byte 0x01, 0x00, 0x01, 0x00 - .4byte gUnknown_80F499C - .byte 0x01, 0x00, 0x01, 0x00 - .4byte gUnknown_80F4B30 - .byte 0x01, 0x00, 0xff, 0xff - .4byte gUnknown_80F4810 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80F4B30 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80F499C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80F4B30 - .byte 0xff, 0xff, 0x01, 0x00 diff --git a/data/data_80F4D44.s b/data/data_80F4D44.s index 2ea765fd9..dae085b27 100644 --- a/data/data_80F4D44.s +++ b/data/data_80F4D44.s @@ -1,14 +1,6 @@ .section .rodata - .global gUnknown_80F4D44 -gUnknown_80F4D44: @ 80F4D44 - @ replacing .incbin "baserom.gba", 0x000f4d44, 0x20 - .byte 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01 - - .global gUnknown_80F4D64 -gUnknown_80F4D64: @ 80F4D64 - @ replacing .incbin "baserom.gba", 0x000f4d64, 0x28 - .byte 0x02, 0x06, 0x04, 0x00, 0x02, 0x00, 0x04, 0x06, 0x04, 0x00, 0x06, 0x02, 0x04, 0x02, 0x06, 0x00, 0x06, 0x02, 0x00, 0x04, 0x06, 0x04, 0x02, 0x00, 0x00, 0x04, 0x02, 0x06, 0x00, 0x06, 0x02, 0x04 +.align 2,0 .string "pksdir0\0" .align 2,0 diff --git a/data/data_80F59C8.s b/data/data_80F59C8.s deleted file mode 100644 index e9c5a95e5..000000000 --- a/data/data_80F59C8.s +++ /dev/null @@ -1,13737 +0,0 @@ -#include "constants/status.h" -.section .rodata - -.align 2,0 -.string "pksdir0" -.align 2,0 -.string "pksdir0" -.align 2,0 -.string "pksdir0" -.align 2,0 -.string "pksdir0" - -.align 2,0 -.global gOtherOobTile -gOtherOobTile: @ 80F69D4 -@ replacing .incbin "baserom.gba", 0xF69D4, 0x18 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gWaterOobTile -gWaterOobTile: @ 80F69EC -@ replacing .incbin "baserom.gba", 0xF69EC, 0x18 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_80F6A04 -gUnknown_80F6A04: @ 80F6A04 -.string "b%02dfon\0" -.align 2,0 - -.global gUnknown_80F6A10 -gUnknown_80F6A10: @ 80F6A10 -.string "b%02dpal\0" -.align 2,0 - -.global gUnknown_80F6A1C -gUnknown_80F6A1C: @ 80F6A1C -.string "b%02dcel\0" -.align 2,0 - -.global gUnknown_80F6A28 -gUnknown_80F6A28: @ 80F6A28 -.string "b%02dcex\0" -.align 2,0 - -.global gUnknown_80F6A34 -gUnknown_80F6A34: @ 80F6A34 -.string "b%02demap0\0" -.align 2,0 - -.global gUnknown_80F6A40 -gUnknown_80F6A40: @ 80F6A40 -.string "b%02dcanm\0" - -.global gUnknown_80F6A4A -gUnknown_80F6A4A: @ 80F6A4A -@ replacing .incbin "baserom.gba", 0xF6A4A, 0x1BC -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00 - -.global gUnknown_80F6C06 -gUnknown_80F6C06: @ 80F6C06 -@ replacing .incbin "baserom.gba", 0xF6C06, 0x11A -.byte 0xf7, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf8, 0xff, 0xf8, 0xff -.byte 0xf8, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xf9, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfb, 0xff -.byte 0xfb, 0xff, 0xfb, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfd, 0xff -.byte 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x03, 0x00 -.byte 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00 -.byte 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00 -.byte 0x08, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0b, 0x00 -.byte 0x0b, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0d, 0x00, 0x0d, 0x00 -.byte 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x10, 0x00, 0x10, 0x00 -.byte 0x10, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00, 0x13, 0x00 -.byte 0x13, 0x00, 0x13, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x15, 0x00, 0x15, 0x00, 0x15, 0x00 -.byte 0x16, 0x00, 0x16, 0x00, 0x16, 0x00, 0x17, 0x00, 0x17, 0x00, 0x17, 0x00, 0x18, 0x00, 0x18, 0x00 -.byte 0x18, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1a, 0x00, 0x1a, 0x00, 0x1b, 0x00 -.byte 0x1b, 0x00, 0x1b, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1d, 0x00, 0x1d, 0x00, 0x1d, 0x00 -.byte 0x1e, 0x00, 0x1e, 0x00, 0x1e, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x20, 0x00, 0x20, 0x00 -.byte 0x20, 0x00, 0x21, 0x00, 0x21, 0x00, 0x21, 0x00, 0x22, 0x00, 0x22, 0x00, 0x22, 0x00, 0x23, 0x00 -.byte 0x23, 0x00, 0x23, 0x00, 0x24, 0x00, 0x24, 0x00, 0x24, 0x00 - -.global gUnknown_80F6D20 -gUnknown_80F6D20: @ 80F6D20 -@ replacing .incbin "baserom.gba", 0xF6D20, 0xAC -.byte 0x25, 0x00, 0x25, 0x00, 0x25, 0x00, 0x26, 0x00, 0x26, 0x00, 0x26, 0x00, 0x27, 0x00, 0x27, 0x00 -.byte 0x27, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x29, 0x00, 0x29, 0x00, 0x29, 0x00, 0x2a, 0x00 -.byte 0x2a, 0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2b, 0x00, 0x2b, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0x2c, 0x00 -.byte 0x2d, 0x00, 0x2d, 0x00, 0x2d, 0x00, 0x2e, 0x00, 0x2e, 0x00, 0x2e, 0x00, 0x2f, 0x00, 0x2f, 0x00 -.byte 0x2f, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, 0x31, 0x00, 0x31, 0x00, 0x32, 0x00 -.byte 0x32, 0x00, 0x32, 0x00, 0x33, 0x00, 0x33, 0x00, 0x33, 0x00, 0x34, 0x00, 0x34, 0x00, 0x34, 0x00 -.byte 0x35, 0x00, 0x35, 0x00, 0x35, 0x00, 0x36, 0x00, 0x36, 0x00, 0x36, 0x00, 0x37, 0x00, 0x37, 0x00 -.byte 0x37, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x39, 0x00, 0x39, 0x00, 0x39, 0x00, 0x3a, 0x00 -.byte 0x3a, 0x00, 0x3a, 0x00, 0x3b, 0x00, 0x3b, 0x00, 0x3b, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00 -.byte 0x3d, 0x00, 0x3d, 0x00, 0x3d, 0x00, 0x3e, 0x00, 0x3e, 0x00, 0x3e, 0x00, 0x3f, 0x00, 0x3f, 0x00 -.byte 0x3f, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 - -.global gUnknown_80F6DCC -gUnknown_80F6DCC: @ 80F6DCC -.string "fixedmap\0" - -.global gUnknown_80F6DD5 -gUnknown_80F6DD5: @ 80F6DD5 -@ replacing .incbin "baserom.gba", 0xF6DD5, 0x23 -.byte 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00 - -.global gUnknown_80F6DF8 -gUnknown_80F6DF8: @ 80F6DF8 -@ replacing .incbin "baserom.gba", 0xF6DF8, 0xCF0 -.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xfc, 0x00, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x32, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x5e, 0x00, 0x05, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x06, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x4d, 0x01, 0x07, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x91, 0x00, 0x08, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x92, 0x00, 0x09, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x41, 0x00, 0x0a, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x11, 0x01, 0x0b, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x06, 0x00, 0x0c, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x90, 0x00, 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x9b, 0x01, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x9c, 0x01, 0x0f, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x38, 0x00, 0x10, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x96, 0x00, 0x11, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x0d, 0x01, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x0c, 0x01, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x0e, 0x01, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x13, 0x01, 0x15, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x99, 0x01, 0x16, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x95, 0x01, 0x17, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x96, 0x01, 0x18, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x97, 0x01, 0x19, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x9d, 0x01, 0x1a, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x12, 0x01, 0x1b, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x9a, 0x01, 0x1c, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x9e, 0x01, 0x1d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xa1, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xa2, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xa3, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x18, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x1b, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x04, 0x01, 0x1f, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x14, 0x01, 0x1e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x20, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xa2, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x53, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x14, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x4d, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xf3, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x09, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x3c, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x66, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xbf, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x36, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x64, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x4e, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x64, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xf5, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xf6, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x85, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x4c, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x05, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x6a, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x32, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x54, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x53, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x10, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xe3, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x1d, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x20, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x7f, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x0f, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x10, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xb9, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x4a, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x5c, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8f, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x90, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x1e, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xc6, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x49, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x92, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xf9, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x49, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x73, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x09, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xa0, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x1d, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x4c, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x4b, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x1b, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x2c, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x2b, 0x01, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x3c, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x3c, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x3c, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x3c, 0x00, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 - -.global gUnknown_80F7AE8 -gUnknown_80F7AE8: @ 80F7AE8 -.byte 0x00, 0x00 - -.global gUnknown_80F7AEA -gUnknown_80F7AEA: @ 80F7AEA -.byte 0x0d, 0x03, 0x0d, 0x01, 0x0d, 0x03, 0x0d, 0x01, 0x01, 0x03, 0x01, 0x00, 0x11, 0x00 - -.global gUnknown_80F7AF8 -gUnknown_80F7AF8: @ 80F7AF8 -.byte 0x3f, 0x3f, 0x00, 0x00 - -.global gUnknown_80F7AFC -gUnknown_80F7AFC: @ 80F7AFC -.string "{COLOR YELLOW}%s{RESET}\0" -.align 2,0 - -.global gUnknown_80F7B04 -gUnknown_80F7B04: @ 80F7B04 -.string "{COLOR YELLOW}" -.byte 0x87, 0x45 -.string "{RESET}\0" -.align 2,0 -.string "pksdir0\0" -.align 2,0 - -.global gActions -gActions: @ 80F7B14 -.4byte gUseDescription -.4byte gUseText -.4byte gThrowDescription -.4byte gThrowText -.4byte gThrowDescription -.4byte gThrowText -.4byte gEquipDescription -.4byte gEquipText -.4byte gEatDescription -.4byte gEatText -.4byte gIngestDescription -.4byte gIngestText -.4byte gPeelDescription -.4byte gPeelText -.4byte gUseDescription -.4byte gUseText -.4byte gUseDescription -.4byte gUseText -.4byte gUseDescription -.4byte gUseText -.4byte gUseDescription -.4byte gUseText -.4byte gEquipPutOnDescription -.4byte gEquipText -.4byte gEquipPutOnDescription -.4byte gEquipText -.4byte gUseDescription -.4byte gUseText -.4byte gUseDescription -.4byte gUseText -.4byte gUseDescription -.4byte gUseText - -.global gEquipPutOnDescription -gEquipPutOnDescription: @ 80F7B94 -.string "{POKEMON_0} put on\n" -.string "the {MOVE_ITEM_0}.\0" - -.global gPeelText -gPeelText: @ 80F7BA8 -.string "Peel\0" -.align 2,0 - -.global gPeelDescription -gPeelDescription: @ 80F7BB0 -.string "{POKEMON_0} peeled\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2,0 - -.global gIngestText -gIngestText: @ 80F7BC4 -.string "Ingest\0" -.align 2,0 - -.global gIngestDescription -gIngestDescription: @ 80F7BCC -.string "{POKEMON_0} swallowed\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2,0 - -.global gEatText -gEatText: @ 80F7BE4 -.string "Eat\0" -.align 2,0 - -.global gEatDescription -gEatDescription: @ 80F7BE8 -.string "{POKEMON_0} ate\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2,0 - -.global gEquipText -gEquipText: @ 80F7BFC -.string "Equip\0" -.align 2,0 - -.global gEquipDescription -gEquipDescription: @ 80F7C04 -.string "{POKEMON_0} equipped\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2,0 - -.global gThrowText -gThrowText: @ 80F7C1C -.string "Throw\0" -.align 2,0 - -.global gThrowDescription -gThrowDescription: @ 80F7C24 -.string "{POKEMON_0} threw\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2,0 - -.global gUseText -gUseText: @ 80F7C38 -.string "Use\0" -.align 2,0 - -.global gUseDescription -gUseDescription: @ 80F7C3C - -.global gUnknown_80F7C3C -gUnknown_80F7C3C: @ 80F7C3C -.string "{POKEMON_0} used\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2,0 - -.global gUnknown_80F7C50 -gUnknown_80F7C50: @ 80F7C50 -.4byte gMenuQuestionMarks - -.global gUnknown_80F7C54 -gUnknown_80F7C54: @ 80F7C54 -.4byte 0x0000000A -.4byte gMenuWaitText -.4byte 0x0000000A -.4byte gMenuMoveText -.4byte 0x0000000A -.4byte gMenuMoveText -.4byte 0x0000000A -.4byte gMenuWaitText -.4byte 0x0000000A -.4byte gMenuWaitText -.4byte 0x0000000A -.4byte gMenuNextText -.4byte 0x0000000A -.4byte gMenuPrevText -.4byte 0x0000000A -.4byte gMenuPlaceText -.4byte 0x0000000A -.4byte gMenuGetText -.4byte 0x0000000A -.4byte gMenuSwitchText -.4byte 0x0000000A -.4byte gThrowText -.4byte 0x0000000A -.4byte gMenuInfoText -.4byte 0x0000005A -.4byte gMenuXText -.4byte 0x0000000A -.4byte gMenuXText -.4byte 0x0000000A -.4byte gMenuXText -.4byte 0x0000000A -.4byte gMenuXText -.4byte 0x0000000A -.4byte gMenuXText -.4byte 0x0000000A -.4byte gMenuXText -.4byte 0x0000000A -.4byte gMenuTalkText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gMenuEmpty -.4byte 0x0000000A -.4byte gMenuStruggleText -.4byte 0x0000000A -.4byte gMenuMoneySymbols -.4byte 0x000003E7 -.4byte gMenuMovesText -.4byte 0x0000000A -.4byte gMenuTacticsText -.4byte 0x0000000A -.4byte gMenuSummaryText -.4byte 0x0000000A -.4byte gMenuTalkText -.4byte 0x0000000A -.4byte gMenuInfoText -.4byte 0x0000005A -.4byte gMenuSetText -.4byte 0x0000000A -.4byte gMenuSwitchText -.4byte 0x0000000A -.4byte gMenuLinkText -.4byte 0x0000000A -.4byte gMenuDelinkText -.4byte 0x0000000A -.4byte gMenuForgetText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gThrowText -.4byte 0x0000000A -.4byte gMenuTriggerText -.4byte 0x0000000A -.4byte gMenuProceedText -.4byte 0x0000000A -.4byte gThrowText -.4byte 0x00000005 -.4byte gMenuSwitchText -.4byte 0x0000000A -.4byte gMenuFarewellText -.4byte 0x0000000A -.4byte gMenuCancelText -.4byte 0x0000000A -.4byte gMenuQuicksaveText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gMenuTalkText -.4byte 0x0000000A -.4byte gMenuGiveUpText -.4byte 0x0000000A -.4byte gMenuSwitchText -.4byte 0x0000000A -.4byte gMenuCheckIQText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gMenuDeselectText -.4byte 0x0000000A -.4byte gMenuFarewellText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gMenuGiveText -.4byte 0x0000000A -.4byte gMenuTakeText -.4byte 0x0000000A -.4byte gUseText -.4byte 0x0000000A -.4byte gMenuEmpty -.4byte 0x0000000A -.4byte gMenuSwapText -.4byte 0x0000000A -.4byte gMenuLeaderText -.4byte 0x0000000A -.4byte gMenuSetText -.4byte 0x0000000A -.4byte gMenuDeselectText -.4byte 0x0000000A -.4byte gMenuSwapText -.4byte 0x0000000A -.4byte gMenuPickUpText -.4byte 0x0000000A -.4byte gMenuSummaryText -.4byte 0x0000000A -.4byte gThrowText -.4byte 0x00000005 - -.global gMenuPickUpText -gMenuPickUpText: @ 80F7E60 -.string "Pick Up\0" -.align 2,0 - -.global gMenuLeaderText -gMenuLeaderText: @ 80F7E68 -.string "Leader\0" -.align 2,0 - -.global gMenuSwapText -gMenuSwapText: @ 80F7E70 -.string "Swap\0" -.align 2,0 - -.global gMenuTakeText -gMenuTakeText: @ 80F7E78 -.string "Take\0" -.align 2,0 - -.global gMenuGiveText -gMenuGiveText: @ 80F7E80 -.string "Give\0" -.align 2,0 - -.global gMenuDeselectText -gMenuDeselectText: @ 80F7E88 -.string "Deselect\0" -.align 2,0 - -.global gMenuCheckIQText -gMenuCheckIQText: @ 80F7E94 -.string "Check IQ\0" -.align 2,0 - -.global gMenuGiveUpText -gMenuGiveUpText: @ 80F7EA0 -.string "Give Up\0" -.align 2,0 - -.global gMenuQuicksaveText -gMenuQuicksaveText: @ 80F7EA8 - -.global gUnknown_80F7EA8 -gUnknown_80F7EA8: @ 80F7EA8 -.string "Quicksave\0" -.align 2,0 - -.global gMenuCancelText -gMenuCancelText: @ 80F7EB0 -.string "Cancel\0" -.align 2,0 - -.global gMenuFarewellText -gMenuFarewellText: @ 80F7EBC -.string "Farewell\0" -.align 2,0 - -.global gMenuProceedText -gMenuProceedText: @ 80F7EC8 -.string "Proceed\0" -.align 2,0 - -.global gMenuTriggerText -gMenuTriggerText: @ 80F7ED0 -.string "Trigger\0" -.align 2,0 - -.global gMenuForgetText -gMenuForgetText: @ 80F7ED8 -.string "Forget\0" -.align 2,0 - -.global gMenuDelinkText -gMenuDelinkText: @ 80F7EE0 -.string "Delink\0" -.align 2,0 - -.global gMenuLinkText -gMenuLinkText: @ 80F7EE8 -.string "Link\0" -.align 2,0 - -.global gMenuSetText -gMenuSetText: @ 80F7EF0 -.string "Set\0" -.align 2,0 - -.global gMenuSummaryText -gMenuSummaryText: @ 80F7EF4 -.string "Summary\0" -.align 2,0 - -.global gMenuTacticsText -gMenuTacticsText: @ 80F7EFC -.string "Tactics\0" -.align 2,0 - -.global gMenuMovesText -gMenuMovesText: @ 80F7F04 - -.global gUnknown_80F7F04 -gUnknown_80F7F04: @ 80F7F04 -.string "Moves\0" -.align 2,0 - -.global gMenuMoneySymbols -gMenuMoneySymbols: @ 80F7F0C -.string "$$$$\0" -.align 2,0 - -.global gMenuStruggleText -gMenuStruggleText: @ 80F7F14 -.string "Struggle\0" -.align 2,0 - -.global gMenuEmpty -gMenuEmpty: @ 80F7F20 - -.global gUnknown_80F7F20 -gUnknown_80F7F20: @ 80F7F20 -.byte 0x00 -.align 2,0 - -.global gMenuTalkText -gMenuTalkText: @ 80F7F24 -.string "Talk\0" -.align 2,0 - -.global gMenuXText -gMenuXText: @ 80F7F2C -.string "X\0" -.align 2,0 - -.global gMenuInfoText -gMenuInfoText: @ 80F7F30 -.string "Info\0" -.align 2,0 - -.global gMenuSwitchText -gMenuSwitchText: @ 80F7F38 -.string "Switch\0" -.align 2,0 - -.global gMenuGetText -gMenuGetText: @ 80F7F40 -.string "Get\0" -.align 2,0 - -.global gMenuPlaceText -gMenuPlaceText: @ 80F7F44 -.string "Place\0" -.align 2,0 - -.global gMenuPrevText -gMenuPrevText: @ 80F7F4C -.string "Prev.\0" -.align 2,0 - -.global gMenuNextText -gMenuNextText: @ 80F7F54 -.string "Next\0" -.align 2,0 - -.global gMenuMoveText -gMenuMoveText: @ 80F7F5C -.string "Move\0" -.align 2,0 - -.global gMenuWaitText -gMenuWaitText: @ 80F7F64 -.string "Wait\0" -.align 2,0 - -.global gMenuQuestionMarks -gMenuQuestionMarks: @ 80F7F6C -.string "???\0" -.align 2,0 - -.global gUnknown_80F7F70 -gUnknown_80F7F70: @ 80F7F70 -.4byte gDungeonStairsDescription -.4byte gWarpZoneDescription -.4byte gRescueSpotDescription - -.global gRescueSpotDescription -gRescueSpotDescription: @ 80F7F7C -.string "You reached the rescue spot where your\n" -.string "friend's team went down!\n" -.string "Send an {color RED}A-OK Mail{reset} from the Pelipper Post\n" -.string "Office to let your friend know you've\n" -.string "rescued the defeated team.\0" -.align 2,0 - -.global gWarpZoneDescription -gWarpZoneDescription: @ 80F8030 -.string "The warp zone leading to the next floor.\n" -.string "If you are on the final floor, you will\n" -.string "escape from the dungeon.\0" -.align 2,0 - -.global gDungeonStairsDescription -gDungeonStairsDescription: @ 80F809C -.string "Stairs leading to the next floor.\n" -.string "If you are on the final floor, you will\n" -.string "escape from the dungeon.\0" -.align 2,0 - -.global gUnknown_80F8104 -gUnknown_80F8104: @ 80F8104 -.4byte gDungeonStairsText -.4byte gWarpZoneText -.4byte gRescueSpotText - -.global gRescueSpotText -gRescueSpotText: @ 80F7F7C -.string "Rescue Spot\0" -.align 2,0 - -.global gWarpZoneText -gWarpZoneText: @ 80F8030 - -.global gUnknown_80F811C -gUnknown_80F811C: @ 80F811C -.string "Warp Zone\0" -.align 2,0 - -.global gDungeonStairsText -gDungeonStairsText: @ 80F809C - -.global gUnknown_80F8128 -gUnknown_80F8128: @ 80F8128 -.string "Stairs\0" -.align 2,0 - -.global gTrapDescriptions -gTrapDescriptions: @ 80F8130 -@ replacing .incbin "baserom.gba", 0xF8130, 0x838 -.4byte TripTrapDescription -.4byte MudTrapDescription -.4byte StickyTrapDescription -.4byte SludgeTrapDescription -.4byte SweetScentTrapDescription -.4byte PitfallTrapDescription -.4byte WarpTrapDescription -.4byte GustTrapDescription -.4byte ConfuseTrapDescription -.4byte SleepTrapDescription -.4byte SlowTrapDescription -.4byte SealTrapDescription -.4byte PoisonTrapDescription -.4byte SelfdestructTrapDescription -.4byte ExplosionTrapDescription -.4byte PPZeroTrapDescription -.4byte ChestnutTrapDescription -.4byte WonderTileDescription -.4byte PokemonTrapDescription -.4byte SpikeTrapDescription - -.global SpikeTrapDescription -SpikeTrapDescription: @ 80F8180 -.string "Stepping on this trap inflicts damage.\n" -.string "It can be made using the move {color YELLOW}Spikes{reset}.\0" -.align 2, 0 - -.global PokemonTrapDescription -PokemonTrapDescription: @ 80F81D4 -.string "Stepping on this trap transforms all\n" -.string "items in the room into hostile Pokémon.\0" -.align 2, 0 - -.global WonderTileDescription -WonderTileDescription: @ 80F8224 -.string "An odd floor tile seen in many dungeons.\n" -.string "Stepping on it resets the Pokémon's\n" -.string "{color YELLOW}Attack{reset}, {color YELLOW}Defense{reset}, and so on, if\n" -.string "they are boosted or reduced.\0" -.align 2, 0 - -.global ChestnutTrapDescription -ChestnutTrapDescription: @ 80F82C0 -.string "Stepping on this trap makes a spiky,\n" -.string "unshelled Chestnut drop, inflicting\n" -.string "damage.\0" -.align 2, 0 - -.global PPZeroTrapDescription -PPZeroTrapDescription: @ 80F8318 -.string "Stepping on this trap completely drains\n" -.string "the {color YELLOW}PP{reset} of a random move.\0" -.align 2, 0 - -.global ExplosionTrapDescription -ExplosionTrapDescription: @ 80F8360 -.string "Stepping on this trap triggers a\n" -.string "{color CYAN}huge explosion{reset}.\n" -.string "Its damage extends to other Pokémon,\n" -.string "items, and walls. It has a bigger\n" -.string "range than a Selfdestruct Trap.\0" -.align 2, 0 - -.global SelfdestructTrapDescription -SelfdestructTrapDescription: @ 80F8404 -.string "Stepping on this trap makes it {color CYAN}explode{reset}.\n" -.string "Its damage extends to other Pokémon,\n" -.string "items, and walls around the trap.\0" -.align 2, 0 - -.global PoisonTrapDescription -PoisonTrapDescription: @ 80F847C -.string "Stepping on this trap looses poison\n" -.string "spikes that leave the Pokémon {color CYAN}poisoned{reset}.\0" -.align 2, 0 - -.global SealTrapDescription -SealTrapDescription: @ 80F84D0 -.string "Stepping on this trap disables one\n" -.string "of the Pokémon's moves as long\n" -.string "as it remains on the same floor.\0" -.align 2, 0 - -.global SlowTrapDescription -SlowTrapDescription: @ 80F8538 -.string "Stepping on this trap lowers the\n" -.string "Pokémon's {color YELLOW}Movement Speed{reset} by one level.\0" -.align 2, 0 - -.global SleepTrapDescription -SleepTrapDescription: @ 80F8588 -.string "Stepping on this trap releases a sleeping\n" -.string "gas that puts the Pokémon to\n" -.string "{color CYAN}sleep{reset}.\0" -.align 2, 0 - -.global ConfuseTrapDescription -ConfuseTrapDescription: @ 80F85DC -.string "Stepping on this trap spins the Pokémon\n" -.string "around dizzyingly, making it \n" -.string "{color CYAN}confused{reset}.\0" -.align 2, 0 - -.global GustTrapDescription -GustTrapDescription: @ 80F8634 -.string "Stepping on this trap triggers a blast\n" -.string "of some sort that sends the Pokémon\n" -.string "flying.\0" -.align 2, 0 - -.global WarpTrapDescription -WarpTrapDescription: @ 80F8688 -.string "Stepping on this trap instantly warps\n" -.string "the Pokémon to another spot on the floor.\0" -.align 2, 0 - -.global PitfallTrapDescription -PitfallTrapDescription: @ 80F86D8 -.string "Stepping on this trap drops the Pokémon\n" -.string "to the next floor, inflicting damage.\n" -.string "If it's not the team leader, the Pokémon\n" -.string "faints. If that happens, even a Reviver\n" -.string "Seed can't help the fainted Pokémon.\0" -.align 2, 0 - -.global SweetScentTrapDescription -SweetScentTrapDescription: @ 80F87A8 -.string "Stepping on this trap releases a sweet\n" -.string "aroma that attracts Pokémon from afar.\0" -.align 2, 0 - -.global SludgeTrapDescription -SludgeTrapDescription: @ 80F87F8 -.string "Stepping on this trap makes it spew\n" -.string "muck that gums up food.\0" -.align 2, 0 - -.global StickyTrapDescription -StickyTrapDescription: @ 80F8834 -.string "Stepping on this trap makes a random\n" -.string "item become sticky and unusable.\0" -.align 2, 0 - -.global MudTrapDescription -MudTrapDescription: @ 80F887C -.string "Stepping on this trap makes it blow\n" -.string "mud that lowers the Pokémon's {color YELLOW}Attack{reset},\n" -.string "{color YELLOW}Defense{reset}, {color YELLOW}Special Attack{reset}, or\n" -.string "{color YELLOW}Special Defense{reset} by one level.\0" -.align 2, 0 -@ This trap is unused in the game. - -.global TripTrapDescription -TripTrapDescription: @ 80F891C -.string "Stepping on this trap makes the Pokémon\n" -.string "trip and drop an item.\0" -.align 2, 0 - -.global gUnknown_80F895C -gUnknown_80F895C: @ 80F895C -.string "{color YELLOW}Decoy{reset}\0" -.align 2, 0 - -.global gUnknown_80F8968 -gUnknown_80F8968: @ 80F8968 -.4byte gUnknown_80F895C - -.global gUnknown_80F896C -gUnknown_80F896C: @ 80F896C -.string "Decoy\0" -.align 2,0 - -.global gUnknown_80F8974 -gUnknown_80F8974: @ 80F8974 -@ replacing .incbin "baserom.gba", 0xF8974, 0x14 -.4byte gUnknown_80F896C - -.global gUnknown_80F8978 -gUnknown_80F8978: @ 80F8978 -.string "{color YELLOW}Pokémon{reset}\0" -.align 2, 0 - -.global gUnknown_80F8988 -gUnknown_80F8988: @ 80F8988 -@ replacing .incbin "baserom.gba", 0xF8988, 0xC -.4byte gUnknown_80F8978 - -.global gUnknown_80F898C -gUnknown_80F898C: @ 80F898C -.string "Pokémon\0" -.align 2, 0 - -.global gUnknown_80F8994 -gUnknown_80F8994: @ 80F8994 -.4byte gUnknown_80F898C - -.global PartnerFainted_80F8998 -PartnerFainted_80F8998: @ 80F8998 -.string "Your partner {POKEMON_0} fainted!\0" -.align 2,0 - -.global gUnknown_80F89B4 -gUnknown_80F89B4: @ 80F89B4 -.4byte PartnerFainted_80F8998 - -.global ClientFainted_80F89B8 -ClientFainted_80F89B8: @ 80F89B8 -.string "Your client {POKEMON_0} fainted!\0" -.align 2,0 - -.global gUnknown_80F89D4 -gUnknown_80F89D4: @ 80F89D4 -.4byte ClientFainted_80F89B8 - -.global gUnknown_80F89D8 -gUnknown_80F89D8: @ 80F89D8 -.4byte ClientFainted_80F89B8 - -.global NothingHappened_80F89DC -NothingHappened_80F89DC: @ 80F89DC - -.global gUnknown_80F89DC -gUnknown_80F89DC: @ 80F89DC -.string "But nothing happened!\0" -.align 2,0 - -.global gUnknown_80F89F4 -gUnknown_80F89F4: @ 80F89F4 -.4byte NothingHappened_80F89DC - -.global BlownAway_80F89F8 -BlownAway_80F89F8: @ 80F89F8 -.string "{POKEMON_0} was blown away!\0" -.align 2,0 - -.global gUnknown_80F8A0C -gUnknown_80F8A0C: @ 80F8A0C -.4byte BlownAway_80F89F8 - -.global NoToggleSetMove_80F8A10 -NoToggleSetMove_80F8A10: @ 80F8A10 -.string "No move has been set.\0" -.align 2,0 - -.global gUnknown_80F8A28 -gUnknown_80F8A28: @ 80F8A28 -.4byte NoToggleSetMove_80F8A10 - -.global ToggleSetMoveCantUse_80F8A2C -ToggleSetMoveCantUse_80F8A2C: @ 80F8A2C -.string "The set move can't be used.\0" -.align 2,0 - -.global gUnknown_80F8A4C -gUnknown_80F8A4C: @ 80F8A4C -.4byte ToggleSetMoveCantUse_80F8A2C - -.global BeingConstricted_80F8A50 -BeingConstricted_80F8A50: @ 80F8A50 -.string "You're being constricted!\0" -.align 2,0 - -.global gUnknown_80F8A6C -gUnknown_80F8A6C: @ 80F8A6C -.4byte BeingConstricted_80F8A50 - -.global CantMove_80F8A70 -CantMove_80F8A70: @ 80F8A70 -.string "You can't move!\0" -.align 2,0 - -.global gUnknown_80F8A84 -gUnknown_80F8A84: @ 80F8A84 -.4byte CantMove_80F8A70 - -.global gUnknown_80F8A88 -gUnknown_80F8A88: @ 80F8A88 -.string "You can't move while you're rooted!\0" -.align 2,0 - -.global gUnknown_80F8AB0 -gUnknown_80F8AB0: @ 80F8AB0 -.4byte gUnknown_80F8A88 - -.global gUnknown_80F8AB4 -gUnknown_80F8AB4: @ 80F8AB4 -.string "You can't move while wrapping a foe!\0" -.align 2,0 - -.global gUnknown_80F8ADC -gUnknown_80F8ADC: @ 80F8ADC -.4byte gUnknown_80F8AB4 - -.global gUnknown_80F8AE0 -gUnknown_80F8AE0: @ 80F8AE0 -.string "The foe has you wrapped! You can't move!\0" -.align 2,0 - -.global gUnknown_80F8B0C -gUnknown_80F8B0C: @ 80F8B0C -.4byte gUnknown_80F8AE0 - -.global gUnknown_80F8B10 -gUnknown_80F8B10: @ 80F8B10 -.string "There are no items.\0" - -.global gUnknown_80F8B24 -gUnknown_80F8B24: @ 80F8B24 -.4byte gUnknown_80F8B10 - -.global gUnknown_80F8B28 -gUnknown_80F8B28: @ 80F8B28 -.string "The move {MOVE_ITEM_0} was set.\0" -.align 2,0 - -.global gUnknown_80F8B40 -gUnknown_80F8B40: @ 80F8B40 -.4byte gUnknown_80F8B28 - -.global gUnknown_80F8B44 -gUnknown_80F8B44: @ 80F8B44 -.string "The move {MOVE_ITEM_0} was deselected.\0" -.align 2,0 - -.global gUnknown_80F8B64 -gUnknown_80F8B64: @ 80F8B64 -.4byte gUnknown_80F8B44 -.4byte gMenuEmpty - -.global gUnknown_80F8B6C -gUnknown_80F8B6C: @ 80F8B6C -.string "The move {MOVE_ITEM_0} was delinked.\0" -.align 2,0 - -.global gUnknown_80F8B88 -gUnknown_80F8B88: @ 80F8B88 -.4byte gUnknown_80F8B6C - -.global gUnknown_80F8B8C -gUnknown_80F8B8C: @ 80F8B8C -.string "The linked moves were left unchanged.\0" -.align 2,0 - -.global gUnknown_80F8BB4 -gUnknown_80F8BB4: @ 80F8BB4 -.4byte gUnknown_80F8B8C - -.global gUnknown_80F8BB8 -gUnknown_80F8BB8: @ 80F8BB8 -.string "It's all sticky and doesn't work!\0" -.align 2,0 - -.global gUnknown_80F8BE0 -gUnknown_80F8BE0: @ 80F8BE0 -@ replacing .incbin "baserom.gba", 0xF8BE0, 0x60 -.4byte gUnknown_80F8BB8 - -.global gUnknown_80F8BE4 -gUnknown_80F8BE4: @ 80F8BE4 -.string "The {MOVE_ITEM_1} is all sticky!\n" -.string "It doesn't work!\0" -.align 2, 0 -.4byte gUnknown_80F8BE4 - -.global gUnknown_80F8C14 -gUnknown_80F8C14: @ 80F8C14 -.string "The {MOVE_ITEM_1} is all sticky!\n" -.string "It can't be moved.\0" -.align 2, 0 - -.global gItemStickyCannotMove1 -gItemStickyCannotMove1: @ 80F8C40 -.4byte gUnknown_80F8C14 - -.global gItemStickyCannotMove2 -gItemStickyCannotMove2: @ 80F8C44 -.4byte gUnknown_80F8C14 - -.global gItemStickyCannotMove3 -gItemStickyCannotMove3: @ 80F8C48 -.4byte gUnknown_80F8C14 - -.global gUnknown_80F8C4C -gUnknown_80F8C4C: @ 80F8C4C -.string "The {MOVE_ITEM_0} is all sticky!\n" -.string "It can't be equipped.\0" -.align 2,0 - -.global gItemStickyCannotEquip -gItemStickyCannotEquip: @ 80F8C7C -.4byte gUnknown_80F8C4C - -.global gUnknown_80F8C80 -gUnknown_80F8C80: @ 80F8C80 -.string "{POKEMON_1} took the {MOVE_ITEM_0}\n" -.string "and returned the {MOVE_ITEM_1}.\0" -.align 2,0 - -.global gMonTookAndReturnedItem -gMonTookAndReturnedItem: @ 80F8CA8 -@ replacing .incbin "baserom.gba", 0xF8CA8, 0x3C -.4byte gUnknown_80F8C80 - -.global gUnknown_80F8CAC -gUnknown_80F8CAC: @ 80F8CAC -.string "The {MOVE_ITEM_0} was set.\n" -.string "Hold {L_BUTTON} then press {R_BUTTON} to throw one.\0" -.align 2, 0 - -.global gUnknown_80F8CE4 -gUnknown_80F8CE4: @ 80F8CE4 -.4byte gUnknown_80F8CAC - -.global gUnknown_80F8CE8 -gUnknown_80F8CE8: @ 80F8CE8 -.4byte gUnknown_80F8CAC - -.global gUnknown_80F8CEC -gUnknown_80F8CEC: @ 80F8CEC -.string "Equipped the item {MOVE_ITEM_0}.\0" -.align 2,0 - -.global gUnknown_80F8D04 -gUnknown_80F8D04: @ 80F8D04 -.4byte gUnknown_80F8CEC - -.global gUnknown_80F8D08 -gUnknown_80F8D08: @ 80F8D08 -.string "The {MOVE_ITEM_0} was deselected.\0" - -.global gUnknown_80F8D20 -gUnknown_80F8D20: @ 80F8D20 -.4byte gUnknown_80F8D08 - -.global gUnknown_80F8D24 -gUnknown_80F8D24: @ 80F8D24 -.string "The item {MOVE_ITEM_0} was given\n" -.string "to {POKEMON_1}.\0" -.align 2,0 - -.global gUnknown_80F8D44 -gUnknown_80F8D44: @ 80F8D44 -.4byte gUnknown_80F8D24 - -.global gUnknown_80F8D48 -gUnknown_80F8D48: @ 80F8D48 -.string "The Toolbox is full.\0" -.align 2,0 - -.global gUnknown_80F8D60 -gUnknown_80F8D60: @ 80F8D60 -@ replacing .incbin "baserom.gba", 0xF8D60, 0x1C -.4byte gUnknown_80F8D48 - -.global gUnknown_80F8D64 -gUnknown_80F8D64: @ 80F8D64 -.string "{POKEMON_0} returned\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2, 0 - -.global gUnknown_80F8D7C -gUnknown_80F8D7C: @ 80F8D7C -@ replacing .incbin "baserom.gba", 0xF8D7C, 0x38 -.4byte gUnknown_80F8D64 - -.global gUnknown_80F8D80 -gUnknown_80F8D80: @ 80F8D80 -.string "The {MOVE_ITEM_0} was exchanged for\n" -.string "the {MOVE_ITEM_1} in the Toolbox.\0" -.align 2, 0 - -.global gUnknown_80F8DB4 -gUnknown_80F8DB4: @ 80F8DB4 -@ replacing .incbin "baserom.gba", 0xF8DB4, 0x2C -.4byte gUnknown_80F8D80 - -.global gUnknown_80F8DB8 -gUnknown_80F8DB8: @ 80F8DB8 -.string "{POKEMON_1} used the {MOVE_ITEM_0}\n" -.string "it was holding!\0" -.align 2, 0 -.4byte gUnknown_80F8DB8 - -.global gUnknown_80F8DE0 -gUnknown_80F8DE0: @ 80F8DE0 -@ replacing .incbin "baserom.gba", 0xF8DE0, 0x24 -.4byte gUnknown_80F7F20 - -.global gUnknown_80F8DE4 -gUnknown_80F8DE4: @ 80F8DE4 -.string "It can't be put down here.\0" -.align 2, 0 - -.global gUnknown_80F8E04 -gUnknown_80F8E04: @ 80F8E04 -@ replacing .incbin "baserom.gba", 0xF8E04, 0x24 -.4byte gUnknown_80F8DE4 - -.global gUnknown_80F8E08 -gUnknown_80F8E08: @ 80F8E08 -.string "{POKEMON_0} put the {MOVE_ITEM_0}\n" -.string "on the ground.\0" -.align 2, 0 - -.global gUnknown_80F8E28 -gUnknown_80F8E28: @ 80F8E28 -@ replacing .incbin "baserom.gba", 0xF8E28, 0x4 -.4byte gUnknown_80F8E08 - -.global gUnknown_80F8E2C -gUnknown_80F8E2C: @ 80F8E2C -@ replacing .incbin "baserom.gba", 0xF8E2C, 0x28 -.4byte gUnknown_80F7F20 - -.global gUnknown_80F8E30 -gUnknown_80F8E30: @ 80F8E30 -.string "Items can't be exchanged here.\0" -.align 2, 0 - -.global gNoExchangesHere -gNoExchangesHere: @ 80F8E54 -@ replacing .incbin "baserom.gba", 0xF8E54, 0x24 -.4byte gUnknown_80F8E30 - -.global gUnknown_80F8E58 -gUnknown_80F8E58: @ 80F8E58 -.string "Nothing can be put down here.\0" -.align 2, 0 - -.global gNothingCanBePutDownHere -gNothingCanBePutDownHere: @ 80F8E78 -@ replacing .incbin "baserom.gba", 0xF8E78, 0x34 -.4byte gUnknown_80F8E58 - -.global gUnknown_80F8E7C -gUnknown_80F8E7C: @ 80F8E7C -.string "Exchanged the {MOVE_ITEM_1} on the\n" -.string "ground with the {MOVE_ITEM_0}.\0" -.align 2, 0 - -.global gSwappedGroundItem -gSwappedGroundItem: @ 80F8EAC -@ replacing .incbin "baserom.gba", 0xF8EAC, 0x18 -.4byte gUnknown_80F8E7C - -.global gUnknown_80F8EB0 -gUnknown_80F8EB0: @ 80F8EB0 -.string "{POKEMON_0} threw the {MOVE_ITEM_0}!\0" -.align 2, 0 - -.global gMonThrewItem1 -gMonThrewItem1: @ 80F8EC4 -@ replacing .incbin "baserom.gba", 0xF8EC4, 0x4 -.4byte gUnknown_80F8EB0 - -.global gMonThrewItem2 -gMonThrewItem2: @ 80F8EC8 -@ replacing .incbin "baserom.gba", 0xF8EC8, 0x1C -.4byte gUnknown_80F8EB0 - -.global gUnknown_80F8ECC -gUnknown_80F8ECC: @ 80F8ECC -.string "You can't talk now.\0" -.align 2, 0 - -.global gCannotTalk -gCannotTalk: @ 80F8EE4 -@ replacing .incbin "baserom.gba", 0xF8EE4, 0x24 -.4byte gUnknown_80F8ECC - -.global gUnknown_80F8EE8 -gUnknown_80F8EE8: @ 80F8EE8 -.string "You can't say farewell now.\0" -.align 2, 0 - -.global gCannotFarewell -gCannotFarewell: @ 80F8F08 -@ replacing .incbin "baserom.gba", 0xF8F08, 0x18 -.4byte gUnknown_80F8EE8 - -.global gUnknown_80F8F0C -gUnknown_80F8F0C: @ 80F8F0C -.string "{POKEMON_0} is cringing!\0" -.align 2, 0 - -.global gMonCringing -gMonCringing: @ 80F8F20 -@ replacing .incbin "baserom.gba", 0xF8F20, 0x18 -.4byte gUnknown_80F8F0C - -.global gUnknown_80F8F24 -gUnknown_80F8F24: @ 80F8F24 -.string "{POKEMON_0} is paralyzed!\0" -.align 2, 0 - -.global gMonParalyzed -gMonParalyzed: @ 80F8F38 -@ replacing .incbin "baserom.gba", 0xF8F38, 0x1C -.4byte gUnknown_80F8F24 - -.global gUnknown_80F8F3C -gUnknown_80F8F3C: @ 80F8F3C -.string "{POKEMON_0} stepped on\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2, 0 - -.global gMonSteppedOnItem -gMonSteppedOnItem: @ 80F8F54 -@ replacing .incbin "baserom.gba", 0xF8F54, 0x34 -.4byte gUnknown_80F8F3C - -.global gUnknown_80F8F58 -gUnknown_80F8F58: @ 80F8F58 -.string "{POKEMON_0} is terrified.\n" -.string "It didn't pick up the {MOVE_ITEM_0}.\0" -.align 2, 0 - -.global gMonTerrifiedCouldntPickUpItem -gMonTerrifiedCouldntPickUpItem: @ 80F8F88 -@ replacing .incbin "baserom.gba", 0xF8F88, 0x24 -.4byte gUnknown_80F8F58 - -.global gUnknown_80F8F8C -gUnknown_80F8F8C: @ 80F8F8C -.string "{POKEMON_0} couldn't pick up\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2, 0 - -.global gMonCouldntPickUpItem -gMonCouldntPickUpItem: @ 80F8FAC -@ replacing .incbin "baserom.gba", 0xF8FAC, 0x18 -.4byte gUnknown_80F8F8C - -.global gUnknown_80F8FB0 -gUnknown_80F8FB0: @ 80F8FB0 -.string "Picked up the {MOVE_ITEM_0}.\0" -.align 2, 0 - -.global gPickedUpItem2 -gPickedUpItem2: @ 80F8FC4 -@ replacing .incbin "baserom.gba", 0xF8FC4, 0x34 -.4byte gUnknown_80F8FB0 - -.global gUnknown_80F8FC8 -gUnknown_80F8FC8: @ 80F8FC8 -.string "Picked up the {MOVE_ITEM_0} and\n" -.string "put it in the Toolbox.\0" -.align 2, 0 - -.global gPickedUpItemToolbox -gPickedUpItemToolbox: @ 80F8FF8 -@ replacing .incbin "baserom.gba", 0xF8FF8, 0x4 -.4byte gUnknown_80F8FC8 - -.global gPickedUpItem -gPickedUpItem: @ 80F8FFC -@ replacing .incbin "baserom.gba", 0xF8FFC, 0x1C -.4byte gUnknown_80F8FB0 - -.global gUnknown_80F9000 -gUnknown_80F9000: @ 80F9000 -.string "{POKEMON_0} picked up\n" -.string "the {MOVE_ITEM_0}.\0" -.align 2, 0 - -.global gMonPickedUpItem2 -gMonPickedUpItem2: @ 80F9018 -@ replacing .incbin "baserom.gba", 0xF9018, 0x38 -.4byte gUnknown_80F9000 - -.global gUnknown_80F901C -gUnknown_80F901C: @ 80F901C -.string "{POKEMON_0} picked up the\n" -.string "{MOVE_ITEM_0} and put it in the Toolbox.\0" -.align 2, 0 - -.global gMonPickedUpItemToolbox -gMonPickedUpItemToolbox: @ 80F9050 -@ replacing .incbin "baserom.gba", 0xF9050, 0x4 -.4byte gUnknown_80F901C - -.global gMonPickedUpItem -gMonPickedUpItem: @ 80F9054 -@ replacing .incbin "baserom.gba", 0xF9054, 0x40 -.4byte gUnknown_80F9000 - -.global gUnknown_80F9058 -gUnknown_80F9058: @ 80F9058 -.string "Say farewell to {POKEMON_0}?\n" -.string "It will be gone from the team forever.\0" -.align 2, 0 - -.global gSayFarewellQ -gSayFarewellQ: @ 80F9094 -@ replacing .incbin "baserom.gba", 0xF9094, 0x34 -.4byte gUnknown_80F9058 - -.global gUnknown_80F9098 -gUnknown_80F9098: @ 80F9098 -.string "Send {POKEMON_0} back?\n" -.string "{POKEMON_0}'s hold item will be lost.\0" -.align 2, 0 - -.global gSendMonBackWithItemQ -gSendMonBackWithItemQ: @ 80F90C8 -@ replacing .incbin "baserom.gba", 0xF90C8, 0x14 -.4byte gUnknown_80F9098 - -.global gUnknown_80F90CC -gUnknown_80F90CC: @ 80F90CC -.string "Send {POKEMON_0} back?\0" -.align 2, 0 - -.global gSendMonBackQ -gSendMonBackQ: @ 80F90DC -@ replacing .incbin "baserom.gba", 0xF90DC, 0x38 -.4byte gUnknown_80F90CC - -.global gUnknown_80F90E0 -gUnknown_80F90E0: @ 80F90E0 -.string "Say farewell to {POKEMON_0} and dismiss\n" -.string "it from the team?\0" -.align 2, 0 - -.global gUnknown_80F9114 -gUnknown_80F9114: @ 80F9114 -@ replacing .incbin "baserom.gba", 0xF9114, 0x28 -.4byte gUnknown_80F90E0 - -.global gUnknown_80F9118 -gUnknown_80F9118: @ 80F9118 -.string "{POKEMON_0} seemed disappointed and left.\0" -.align 2, 0 - -.global gUnknown_80F913C -gUnknown_80F913C: @ 80F913C -@ replacing .incbin "baserom.gba", 0xF913C, 0x14 -.4byte gUnknown_80F9118 - -.global gUnknown_80F9140 -gUnknown_80F9140: @ 80F9140 -.string "{POKEMON_0} went back.\0" -.align 2, 0 - -.global gMonWentBack -gMonWentBack: @ 80F9150 -@ replacing .incbin "baserom.gba", 0xF9150, 0x4 -.4byte gUnknown_80F9140 - -.global gMonDisappointedAndLeft -gMonDisappointedAndLeft: @ 80F9154 -@ replacing .incbin "baserom.gba", 0xF9154, 0x4 -.4byte gUnknown_80F9118 - -.global gUnknown_80F9158 -gUnknown_80F9158: @ 80F9158 -@ replacing .incbin "baserom.gba", 0xF9158, 0x1C -.4byte gUnknown_80F7C3C - -.global gUnknown_80F915C -gUnknown_80F915C: @ 80F915C -.string "$-Belly:{UNK_MACRO_3E M3E_147}{VALUE_0}/{VALUE_1}\0" -.align 2, 0 - -.global gUnknown_80F9174 -gUnknown_80F9174: @ 80F9174 -@ replacing .incbin "baserom.gba", 0xF9174, 0x1C -.4byte gUnknown_80F915C - -.global gUnknown_80F9178 -gUnknown_80F9178: @ 80F9178 -.string "Money:{UNK_MACRO_3E M3E_147}{VALUE_0} {POKE}\0" -.align 2, 0 - -.global gUnknown_80F9190 -gUnknown_80F9190: @ 80F9190 -@ replacing .incbin "baserom.gba", 0xF9190, 0x18 -.4byte gUnknown_80F9178 - -.global gUnknown_80F9194 -gUnknown_80F9194: @ 80F9194 -.string "Weather:{UNK_MACRO_3E M3E_159}{POKEMON_0}\0" -.align 2, 0 - -.global gUnknown_80F91A8 -gUnknown_80F91A8: @ 80F91A8 -@ replacing .incbin "baserom.gba", 0xF91A8, 0x20 -.4byte gUnknown_80F9194 - -.global gUnknown_80F91AC -gUnknown_80F91AC: @ 80F91AC -.string "Play:{UNK_MACRO_3E M3E_147}{VALUE_0}:$V12:$V22\0" -.align 2, 0 - -.global gUnknown_80F91C8 -gUnknown_80F91C8: @ 80F91C8 -@ replacing .incbin "baserom.gba", 0xF91C8, 0x18 -.4byte gUnknown_80F91AC - -.global gUnknown_80F91CC -gUnknown_80F91CC: @ 80F91CC -.string "{POKEMON_0}{UNK_MACRO_3E M3E_66}$v03/$v13\0" -.align 2, 0 - -.global gUnknown_80F91E0 -gUnknown_80F91E0: @ 80F91E0 -@ replacing .incbin "baserom.gba", 0xF91E0, 0xC -.4byte gUnknown_80F91CC - -.global gUnknown_80F91E4 -gUnknown_80F91E4: @ 80F91E4 -.string "Rescue\0" -.align 2, 0 - -.global gUnknown_80F91EC -gUnknown_80F91EC: @ 80F91EC -@ replacing .incbin "baserom.gba", 0xF91EC, 0x4 -.4byte gUnknown_80F91E4 - -.global gTrapNames -gTrapNames: @ 80F91F0 -@ replacing .incbin "baserom.gba", 0xF91F0, 0x174 -.4byte gUnknown_80F9344 -.4byte gUnknown_80F9338 -.4byte gUnknown_80F932C -.4byte gUnknown_80F9320 -.4byte gUnknown_80F9314 -.4byte gUnknown_80F9304 -.4byte gUnknown_80F92F8 -.4byte gUnknown_80F92EC -.4byte gUnknown_80F92E0 -.4byte gUnknown_80F92D0 -.4byte gUnknown_80F92C4 -.4byte gUnknown_80F92B8 -.4byte gUnknown_80F92AC -.4byte gUnknown_80F9298 -.4byte gUnknown_80F9288 -.4byte gUnknown_80F9278 -.4byte gUnknown_80F9268 -.4byte gUnknown_80F925C -.4byte gUnknown_80F924C -.4byte gUnknown_80F9240 - -.global gUnknown_80F9240 -gUnknown_80F9240: @ 80F9240 -.string "Spiked Tile\0" -.align 2, 0 - -.global gUnknown_80F924C -gUnknown_80F924C: @ 80F924C -.string "Pokémon Trap\0" -.align 2, 0 - -.global gUnknown_80F925C -gUnknown_80F925C: @ 80F925C -.string "Wonder Tile\0" -.align 2, 0 - -.global gUnknown_80F9268 -gUnknown_80F9268: @ 80F9268 -.string "Chestnut Trap\0" -.align 2, 0 - -.global gUnknown_80F9278 -gUnknown_80F9278: @ 80F9278 -.string "PP-Zero Trap\0" -.align 2, 0 - -.global gUnknown_80F9288 -gUnknown_80F9288: @ 80F9288 -.string "Explosion Trap\0" -.align 2, 0 - -.global gUnknown_80F9298 -gUnknown_80F9298: @ 80F9298 -.string "Selfdestruct Trap\0" -.align 2, 0 - -.global gUnknown_80F92AC -gUnknown_80F92AC: @ 80F92AC -.string "Poison Trap\0" -.align 2, 0 - -.global gUnknown_80F92B8 -gUnknown_80F92B8: @ 80F92B8 -.string "Seal Trap\0" -.align 2, 0 - -.global gUnknown_80F92C4 -gUnknown_80F92C4: @ 80F92C4 -.string "Slow Trap\0" -.align 2, 0 - -.global gUnknown_80F92D0 -gUnknown_80F92D0: @ 80F92D0 -.string "Slumber Trap\0" -.align 2, 0 - -.global gUnknown_80F92E0 -gUnknown_80F92E0: @ 80F92E0 -.string "Spin Trap\0" -.align 2, 0 - -.global gUnknown_80F92EC -gUnknown_80F92EC: @ 80F92EC -.string "Gust Trap\0" -.align 2, 0 - -.global gUnknown_80F92F8 -gUnknown_80F92F8: @ 80F92F8 -.string "Warp Trap\0" -.align 2, 0 - -.global gUnknown_80F9304 -gUnknown_80F9304: @ 80F9304 -.string "Pitfall Trap\0" -.align 2, 0 - -.global gUnknown_80F9314 -gUnknown_80F9314: @ 80F9314 -.string "Summon Trap\0" -.align 2, 0 - -.global gUnknown_80F9320 -gUnknown_80F9320: @ 80F9320 -.string "Grimy Trap\0" -.align 2, 0 - -.global gUnknown_80F932C -gUnknown_80F932C: @ 80F932C -.string "Sticky Trap\0" -.align 2, 0 - -.global gUnknown_80F9338 -gUnknown_80F9338: @ 80F9338 -.string "Mud Trap\0" -.align 2, 0 - -.global gUnknown_80F9344 -gUnknown_80F9344: @ 80F9344 -.string "Trip Trap\0" -.align 2, 0 - -.global gUnknown_80F9350 -gUnknown_80F9350: @ 80F9350 -.string "{POKEMON_1} is unaffected!\0" -.align 2, 0 - -.global gUnknown_80F9364 -gUnknown_80F9364: @ 80F9364 -@ replacing .incbin "baserom.gba", 0xF9364, 0x1C -.4byte gUnknown_80F9350 - -.global gUnknown_80F9368 -gUnknown_80F9368: @ 80F9368 -.string "The move missed {POKEMON_1}!\0" -.align 2, 0 - -.global gUnknown_80F9380 -gUnknown_80F9380: @ 80F9380 -@ replacing .incbin "baserom.gba", 0xF9380, 0x4 -.4byte gUnknown_80F9368 - -.global gUnknown_80F9384 -gUnknown_80F9384: @ 80F9384 -@ replacing .incbin "baserom.gba", 0xF9384, 0x20 -.4byte gUnknown_80F9368 - -.global gUnknown_80F9388 -gUnknown_80F9388: @ 80F9388 -.string "It had no effect on {POKEMON_1}!\0" -.align 2, 0 - -.global gUnknown_80F93A4 -gUnknown_80F93A4: @ 80F93A4 -@ replacing .incbin "baserom.gba", 0xF93A4, 0x24 -.4byte gUnknown_80F9388 - -.global gUnknown_80F93A8 -gUnknown_80F93A8: @ 80F93A8 -.string "The move {MOVE_ITEM_0} can't be used!\0" -.align 2, 0 - -.global gUnknown_80F93C8 -gUnknown_80F93C8: @ 80F93C8 -@ replacing .incbin "baserom.gba", 0xF93C8, 0x20 -.4byte gUnknown_80F93A8 - -.global gUnknown_80F93CC -gUnknown_80F93CC: @ 80F93CC -.string "The {MOVE_ITEM_0} fell on the ground.\0" -.align 2, 0 - -.global gItemFellOnGround -gItemFellOnGround: @ 80F93E8 -@ replacing .incbin "baserom.gba", 0xF93E8, 0x20 -.4byte gUnknown_80F93CC - -.global gUnknown_80F93EC -gUnknown_80F93EC: @ 80F93EC -.string "The {MOVE_ITEM_0} fell in the water.\0" -.align 2, 0 - -.global gItemFellInWater -gItemFellInWater: @ 80F9408 -@ replacing .incbin "baserom.gba", 0xF9408, 0x1C -.4byte gUnknown_80F93EC - -.global gUnknown_80F940C -gUnknown_80F940C: @ 80F940C -.string "The {MOVE_ITEM_0} became buried.\0" -.align 2, 0 - -.global gItemBuried -gItemBuried: @ 80F9424 -@ replacing .incbin "baserom.gba", 0xF9424, 0x18 -.4byte gUnknown_80F940C - -.global gUnknown_80F9428 -gUnknown_80F9428: @ 80F9428 -.string "The {MOVE_ITEM_0} was lost!\0" -.align 2, 0 - -.global gItemLost -gItemLost: @ 80F943C -@ replacing .incbin "baserom.gba", 0xF943C, 0x20 -.4byte gUnknown_80F9428 - -.global gUnknown_80F9440 -gUnknown_80F9440: @ 80F9440 -.string "All the items were lost!\0" -.align 2, 0 - -.global gAllItemsLost -gAllItemsLost: @ 80F945C -@ replacing .incbin "baserom.gba", 0xF945C, 0x20 -.4byte gUnknown_80F9440 - -.global gUnknown_80F9460 -gUnknown_80F9460: @ 80F9460 -.string "Several items were lost!\0" -.align 2, 0 - -.global gSeveralItemsLost -gSeveralItemsLost: @ 80F947C -@ replacing .incbin "baserom.gba", 0xF947C, 0x20 -.4byte gUnknown_80F9460 - -.global gUnknown_80F9480 -gUnknown_80F9480: @ 80F9480 -.string "The {MOVE_ITEM_0} fell out of sight!\0" -.align 2, 0 - -.global gItemFellOutOfSight -gItemFellOutOfSight: @ 80F949C -@ replacing .incbin "baserom.gba", 0xF949C, 0x28 -.4byte gUnknown_80F9480 - -.global gUnknown_80F94A0 -gUnknown_80F94A0: @ 80F94A0 -.string "The {MOVE_ITEM_0} went flying\n" -.string "towards {POKEMON_0}!\0" -.align 2, 0 - -.global gUnknown_80F94C4 -gUnknown_80F94C4: @ 80F94C4 -@ replacing .incbin "baserom.gba", 0xF94C4, 0x14 -.4byte gUnknown_80F94A0 - -.global gUnknown_80F94C8 -gUnknown_80F94C8: @ 80F94C8 -.string "It missed {POKEMON_0}!\0" -.align 2, 0 - -.global gUnknown_80F94D8 -gUnknown_80F94D8: @ 80F94D8 -@ replacing .incbin "baserom.gba", 0xF94D8, 0x18 -.4byte gUnknown_80F94C8 - -.global gUnknown_80F94DC -gUnknown_80F94DC: @ 80F94DC -.string "{POKEMON_0} dodged the {MOVE_ITEM_0}!\0" -.align 2, 0 - -.global gUnknown_80F94F0 -gUnknown_80F94F0: @ 80F94F0 -@ replacing .incbin "baserom.gba", 0xF94F0, 0x20 -.4byte gUnknown_80F94DC - -.global gUnknown_80F94F4 -gUnknown_80F94F4: @ 80F94F4 -.string "The {MOVE_ITEM_0} bounced off\n" -.string "{POKEMON_0}!\0" -.align 2, 0 - -.global gUnknown_80F9510 -gUnknown_80F9510: @ 80F9510 -@ replacing .incbin "baserom.gba", 0xF9510, 0x20 -.4byte gUnknown_80F94F4 - -.global gUnknown_80F9514 -gUnknown_80F9514: @ 80F9514 -.string "The {MOVE_ITEM_0} flew out of sight!\0" -.align 2, 0 - -.global gUnknown_80F9530 -gUnknown_80F9530: @ 80F9530 -@ replacing .incbin "baserom.gba", 0xF9530, 0x4 -.4byte gUnknown_80F9514 - -.global gFrozenMessage -gFrozenMessage: @ 80F9534 -.string "{POKEMON_0} is frozen solid!\0" -.align 2, 0 - -.global gPtrFrozenMessage -gPtrFrozenMessage: @ 80F954C -.4byte gFrozenMessage - -.global gWrappedAroundMessage -gWrappedAroundMessage: @ 80F9550 -.string "{POKEMON_0} has its foe wrapped!\0" -.align 2, 0 - -.global gPtrWrappedAroundMessage -gPtrWrappedAroundMessage: @ 80F956C -.4byte gWrappedAroundMessage - -.global gWrappedByMessage -gWrappedByMessage: @ 80F9570 -.string "{POKEMON_0} is wrapped by its foe!\0" -.align 2, 0 - -.global gPtrWrappedByMessage -gPtrWrappedByMessage: @ 80F958C -.4byte gWrappedByMessage - -.global gPausedMessage -gPausedMessage: @ 80F9590 -.string "{POKEMON_0} can't move!\0" -.align 2, 0 - -.global gPtrPausedMessage -gPtrPausedMessage: @ 80F95A4 -.4byte gPausedMessage - -.global gInfatuatedMessage -gInfatuatedMessage: @ 80F95A8 - -.global gUnknown_80F95A8 -gUnknown_80F95A8: @ 80F95A8 -.string "{POKEMON_0} is infatuated!\0" -.align 2, 0 - -.global gPtrInfatuatedMessage -gPtrInfatuatedMessage: @ 80F95BC -.4byte gInfatuatedMessage - -.global gBideMessage -gBideMessage: @ 80F95C0 -.string "{POKEMON_0} is storing energy!\0" -.align 2, 0 - -.global gPtrBideMessage -gPtrBideMessage: @ 80F95D8 -.4byte gBideMessage - -.global gUnknown_80F95DC -gUnknown_80F95DC: @ 80F95DC -@ replacing .incbin "baserom.gba", 0xF95DC, 0x10 - -.global gUnknown_80F95DC -gUnknown_80F95DC: @ 80F95DC -.string "{POKEMON_0} is asleep!\0" -.align 2, 0 - -.global gUnknown_80F95EC -gUnknown_80F95EC: @ 80F95EC -@ replacing .incbin "baserom.gba", 0xF95EC, 0x14 -.4byte gUnknown_80F95DC - -.global gUnknown_80F95F0 -gUnknown_80F95F0: @ 80F95F0 -.string "{POKEMON_1} is frozen!\0" -.align 2, 0 - -.global gUnknown_80F9600 -gUnknown_80F9600: @ 80F9600 -@ replacing .incbin "baserom.gba", 0xF9600, 0x14 -.4byte gUnknown_80F95F0 - -.global gUnknown_80F9604 -gUnknown_80F9604: @ 80F9604 -.string "A critical hit!\0" -.align 2, 0 - -.global gUnknown_80F9614 -gUnknown_80F9614: @ 80F9614 -@ replacing .incbin "baserom.gba", 0xF9614, 0x1C -.4byte gUnknown_80F9604 - -.global gUnknown_80F9618 -gUnknown_80F9618: @ 80F9618 -.string "It has little effect...\0" -.align 2, 0 - -.global gUnknown_80F9630 -gUnknown_80F9630: @ 80F9630 -@ replacing .incbin "baserom.gba", 0xF9630, 0x24 -.4byte gUnknown_80F9618 - -.global gUnknown_80F9634 -gUnknown_80F9634: @ 80F9634 -.string "It's not very effective...\0" -.align 2, 0 - -.global gUnknown_80F9654 -gUnknown_80F9654: @ 80F9654 -@ replacing .incbin "baserom.gba", 0xF9654, 0x1C -.4byte gUnknown_80F9634 - -.global gUnknown_80F9658 -gUnknown_80F9658: @ 80F9658 -.string "It's super effective!\0" -.align 2, 0 - -.global gUnknown_80F9670 -gUnknown_80F9670: @ 80F9670 -@ replacing .incbin "baserom.gba", 0xF9670, 0x18 -.4byte gUnknown_80F9658 - -.global gUnknown_80F9674 -gUnknown_80F9674: @ 80F9674 -.string "{POKEMON_1} took no damage!\0" -.align 2, 0 - -.global gUnknown_80F9688 -gUnknown_80F9688: @ 80F9688 -@ replacing .incbin "baserom.gba", 0xF9688, 0x20 -.4byte gUnknown_80F9674 - -.global gUnknown_80F968C -gUnknown_80F968C: @ 80F968C -.string "{POKEMON_1} took calamitous damage!\0" -.align 2, 0 - -.global gUnknown_80F96A8 -gUnknown_80F96A8: @ 80F96A8 -@ replacing .incbin "baserom.gba", 0xF96A8, 0x14 -.4byte gUnknown_80F968C - -.global gUnknown_80F96AC -gUnknown_80F96AC: @ 80F96AC -.string "{POKEMON_0} exploded!\0" -.align 2, 0 - -.global gUnknown_80F96BC -gUnknown_80F96BC: @ 80F96BC -@ replacing .incbin "baserom.gba", 0xF96BC, 0x30 -.4byte gUnknown_80F96AC - -.global gUnknown_80F96C0 -gUnknown_80F96C0: @ 80F96C0 -.string "The damp conditions prevented\n" -.string "an explosion!\0" -.align 2, 0 - -.global gUnknown_80F96EC -gUnknown_80F96EC: @ 80F96EC -@ replacing .incbin "baserom.gba", 0xF96EC, 0x20 -.4byte gUnknown_80F96C0 - -.global gUnknown_80F96F0 -gUnknown_80F96F0: @ 80F96F0 -.string "{POKEMON_0} fell into the pitfall!\0" -.align 2, 0 - -.global gUnknown_80F970C -gUnknown_80F970C: @ 80F970C -@ replacing .incbin "baserom.gba", 0xF970C, 0x1C -.4byte gUnknown_80F96F0 - -.global gUnknown_80F9710 -gUnknown_80F9710: @ 80F9710 -.string "Avoided the pitfall!\0" -.align 2, 0 - -.global gUnknown_80F9728 -gUnknown_80F9728: @ 80F9728 -@ replacing .incbin "baserom.gba", 0xF9728, 0x18 -.4byte gUnknown_80F9710 - -.global gUnknown_80F972C -gUnknown_80F972C: @ 80F972C -.string "{POKEMON_0} is famished.\0" -.align 2, 0 - -.global gUnknown_80F9740 -gUnknown_80F9740: @ 80F9740 -@ replacing .incbin "baserom.gba", 0xF9740, 0x20 -.4byte gUnknown_80F972C - -.global gUnknown_80F9744 -gUnknown_80F9744: @ 80F9744 -.string "{POKEMON_0} is already famished.\0" -.align 2, 0 - -.global gUnknown_80F9760 -gUnknown_80F9760: @ 80F9760 -@ replacing .incbin "baserom.gba", 0xF9760, 0x4 -.4byte gUnknown_80F9744 - -.global gUnknown_80F9764 -gUnknown_80F9764: @ 80F9764 -@ replacing .incbin "baserom.gba", 0xF9764, 0x2F0 -.4byte gUnknown_80F9A3C -.4byte gUnknown_80F9A18 -.4byte gUnknown_80F99F4 -.4byte gUnknown_80F99D0 -.4byte gUnknown_80F9A3C -.4byte gUnknown_80F99B0 -.4byte gUnknown_80F9984 -.4byte gUnknown_80F9964 -.4byte gUnknown_80F9930 -.4byte gUnknown_80F9908 -.4byte gUnknown_80F98E0 -.4byte gUnknown_80F98B8 -.4byte gUnknown_80F9890 -.4byte gUnknown_80F9860 -.string "\0" -.align 2, 0 -.4byte gUnknown_80F9834 -.4byte gUnknown_80F9834 -.4byte gUnknown_80F9A3C -.4byte gUnknown_80F9804 -.4byte gUnknown_80F97DC -.4byte gUnknown_80F97B8 - -.global gUnknown_80F97B8 -gUnknown_80F97B8: @ 80F97B8 -.string "The recoil hit {POKEMON_1} for\n" -.string "{VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F97DC -gUnknown_80F97DC: @ 80F97DC -.string "The move failed!\n" -.string "{POKEMON_1} took {VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9804 -gUnknown_80F9804: @ 80F9804 -.string "The bad weather inflicted {VALUE_0} damage\n" -.string "on {POKEMON_1}!\0" -.align 2, 0 - -.global gUnknown_80F9834 -gUnknown_80F9834: @ 80F9834 -.string "The Chestnut Trap hit {POKEMON_1}\n" -.string "for {VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9860 -gUnknown_80F9860: @ 80F9860 -.string "{POKEMON_1} was showered with sludge\n" -.string "for {VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9890 -gUnknown_80F9890: @ 80F9890 -.string "{POKEMON_1} took {VALUE_0} damage\n" -.string "from Destiny Bond!\0" -.align 2, 0 - -.global gUnknown_80F98B8 -gUnknown_80F98B8: @ 80F98B8 -.string "{POKEMON_1} took {VALUE_0} damage\n" -.string "from Perish Song!\0" -.align 2, 0 - -.global gUnknown_80F98E0 -gUnknown_80F98E0: @ 80F98E0 -.string "{POKEMON_1} stepped on spikes for\n" -.string "{VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9908 -gUnknown_80F9908: @ 80F9908 -.string "{POKEMON_1} took {VALUE_0} damage\n" -.string "from Leech Seed!\0" -.align 2, 0 - -.global gUnknown_80F9930 -gUnknown_80F9930: @ 80F9930 -.string "{POKEMON_1} awoke from its nightmare\n" -.string "and took {VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9964 -gUnknown_80F9964: @ 80F9964 -.string "{POKEMON_1} was cursed for\n" -.string "{VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9984 -gUnknown_80F9984: @ 80F9984 -.string "{POKEMON_1} took {VALUE_0} damage\n" -.string "from the counterattack!\0" -.align 2, 0 - -.global gUnknown_80F99B0 -gUnknown_80F99B0: @ 80F99B0 -.string "{POKEMON_1} was wrapped for\n" -.string "{VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F99D0 -gUnknown_80F99D0: @ 80F99D0 -.string "{POKEMON_1} took {VALUE_0} damage\n" -.string "from poison!\0" -.align 2, 0 - -.global gUnknown_80F99F4 -gUnknown_80F99F4: @ 80F99F4 -.string "{POKEMON_1} was squeezed for\n" -.string "{VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9A18 -gUnknown_80F9A18: @ 80F9A18 -.string "{POKEMON_1}'s burn inflicted\n" -.string "{VALUE_0} damage!\0" -.align 2, 0 - -.global gUnknown_80F9A3C -gUnknown_80F9A3C: @ 80F9A3C -.string "{POKEMON_1} took {VALUE_0} damage!\0" -.align 2, 0 - -.global gWeatherNames -gWeatherNames: @ 80F9A54 -@ replacing .incbin "baserom.gba", 0xF9A54, 0x78 -.4byte gUnknown_80F9AAC -.4byte gUnknown_80F9AA4 -.4byte gUnknown_80F9A98 -.4byte gUnknown_80F9A90 -.4byte gUnknown_80F9A88 -.4byte gUnknown_80F9A80 -.4byte gUnknown_80F9A7C -.4byte gUnknown_80F9A74 - -.global gUnknown_80F9A74 -gUnknown_80F9A74: @ 80F9A74 -.string "Snow\0" -.align 2, 0 - -.global gUnknown_80F9A7C -gUnknown_80F9A7C: @ 80F9A7C -.string "Fog\0" -.align 2, 0 - -.global gUnknown_80F9A80 -gUnknown_80F9A80: @ 80F9A80 -.string "Hail\0" -.align 2, 0 - -.global gUnknown_80F9A88 -gUnknown_80F9A88: @ 80F9A88 -.string "Rain\0" -.align 2, 0 - -.global gUnknown_80F9A90 -gUnknown_80F9A90: @ 80F9A90 -.string "Cloudy\0" -.align 2, 0 - -.global gUnknown_80F9A98 -gUnknown_80F9A98: @ 80F9A98 -.string "Sandstorm\0" -.align 2, 0 - -.global gUnknown_80F9AA4 -gUnknown_80F9AA4: @ 80F9AA4 -.string "Sunny\0" -.align 2, 0 - -.global gUnknown_80F9AAC -gUnknown_80F9AAC: @ 80F9AAC -.string "Clear\0" -.align 2, 0 - -.global gUnknown_80F9AB4 -gUnknown_80F9AB4: @ 80F9AB4 -.string "{POKEMON_0}'s HP went up {VALUE_0}!\0" -.align 2, 0 - -.global gUnknown_80F9ACC -gUnknown_80F9ACC: @ 80F9ACC -@ replacing .incbin "baserom.gba", 0xF9ACC, 0x20 -.4byte gUnknown_80F9AB4 - -.global gUnknown_80F9AD0 -gUnknown_80F9AD0: @ 80F9AD0 -.string "{POKEMON_0}'s Attack went up {VALUE_1}!\0" -.align 2, 0 - -.global gUnknown_80F9AEC -gUnknown_80F9AEC: @ 80F9AEC -@ replacing .incbin "baserom.gba", 0xF9AEC, 0x24 -.4byte gUnknown_80F9AD0 - -.global gUnknown_80F9AF0 -gUnknown_80F9AF0: @ 80F9AF0 -.string "{POKEMON_0}'s Defense went up {VALUE_2}!\0" -.align 2, 0 - -.global gUnknown_80F9B10 -gUnknown_80F9B10: @ 80F9B10 -@ replacing .incbin "baserom.gba", 0xF9B10, 0x24 -.4byte gUnknown_80F9AF0 - -.global gUnknown_80F9B14 -gUnknown_80F9B14: @ 80F9B14 -.string "{POKEMON_0}'s Sp. Atk. went up {VALUE_3}!\0" -.align 2, 0 - -.global gUnknown_80F9B34 -gUnknown_80F9B34: @ 80F9B34 -@ replacing .incbin "baserom.gba", 0xF9B34, 0x24 -.4byte gUnknown_80F9B14 - -.global gUnknown_80F9B38 -gUnknown_80F9B38: @ 80F9B38 -.string "{POKEMON_0}'s Sp. Def. went up $d4!\0" -.align 2, 0 - -.global gUnknown_80F9B58 -gUnknown_80F9B58: @ 80F9B58 -@ replacing .incbin "baserom.gba", 0xF9B58, 0x1C -.4byte gUnknown_80F9B38 - -.global gUnknown_80F9B5C -gUnknown_80F9B5C: @ 80F9B5C -.string "{POKEMON_0} didn't level up.\0" -.align 2, 0 - -.global gUnknown_80F9B74 -gUnknown_80F9B74: @ 80F9B74 -@ replacing .incbin "baserom.gba", 0xF9B74, 0x20 -.4byte gUnknown_80F9B5C - -.global gUnknown_80F9B78 -gUnknown_80F9B78: @ 80F9B78 -.string "{POKEMON_0} didn't level down.\0" -.align 2, 0 - -.global gUnknown_80F9B94 -gUnknown_80F9B94: @ 80F9B94 -@ replacing .incbin "baserom.gba", 0xF9B94, 0x1C -.4byte gUnknown_80F9B78 - -.global gUnknown_80F9B98 -gUnknown_80F9B98: @ 80F9B98 -.string "{POKEMON_0} became the leader!\0" -.align 2, 0 - -.global gUnknown_80F9BB0 -gUnknown_80F9BB0: @ 80F9BB0 -@ replacing .incbin "baserom.gba", 0xF9BB0, 0x28 -.4byte gUnknown_80F9B98 - -.global gUnknown_80F9BB4 -gUnknown_80F9BB4: @ 80F9BB4 -.string "The leader couldn't be switched!\0" -.align 2, 0 - -.global gUnknown_80F9BD8 -gUnknown_80F9BD8: @ 80F9BD8 -@ replacing .incbin "baserom.gba", 0xF9BD8, 0x30 -.4byte gUnknown_80F9BB4 - -.global gUnknown_80F9BDC -gUnknown_80F9BDC: @ 80F9BDC -.string "You haven't paid for the merchandise yet!\0" -.align 2, 0 - -.global gUnknown_80F9C08 -gUnknown_80F9C08: @ 80F9C08 -@ replacing .incbin "baserom.gba", 0xF9C08, 0x24 -.4byte gUnknown_80F9BDC - -.global gUnknown_80F9C0C -gUnknown_80F9C0C: @ 80F9C0C -.string "A thief can't switch leaders!\0" -.align 2, 0 - -.global gUnknown_80F9C2C -gUnknown_80F9C2C: @ 80F9C2C -@ replacing .incbin "baserom.gba", 0xF9C2C, 0x20 -.4byte gUnknown_80F9C0C - -.global gUnknown_80F9C30 -gUnknown_80F9C30: @ 80F9C30 -.string "...Something's stirring.\0" -.align 2, 0 - -.global gUnknown_80F9C4C -gUnknown_80F9C4C: @ 80F9C4C -@ replacing .incbin "baserom.gba", 0xF9C4C, 0x24 -.4byte gUnknown_80F9C30 - -.global gUnknown_80F9C50 -gUnknown_80F9C50: @ 80F9C50 -.string "...Something's approaching.\0" -.align 2, 0 - -.global gUnknown_80F9C70 -gUnknown_80F9C70: @ 80F9C70 -@ replacing .incbin "baserom.gba", 0xF9C70, 0x1C -.4byte gUnknown_80F9C50 - -.global gUnknown_80F9C74 -gUnknown_80F9C74: @ 80F9C74 -.string "It's getting closer!\0" -.align 2, 0 - -.global gUnknown_80F9C8C -gUnknown_80F9C8C: @ 80F9C8C -@ replacing .incbin "baserom.gba", 0xF9C8C, 0x30 -.4byte gUnknown_80F9C74 - -.global gUnknown_80F9C90 -gUnknown_80F9C90: @ 80F9C90 -.string "It's right nearby! It's gusting hard!\0" -.align 2, 0 - -.global gUnknown_80F9CBC -gUnknown_80F9CBC: @ 80F9CBC -@ replacing .incbin "baserom.gba", 0xF9CBC, 0x4 -.4byte gUnknown_80F9C90 - -.global gUnknown_80F9CC0 -gUnknown_80F9CC0: @ 80F9CC0 -@ replacing .incbin "baserom.gba", 0xF9CC0, 0x2C -.4byte gUnknown_80F9CD8 -.4byte gUnknown_80F9CC8 - -.global gUnknown_80F9CC8 -gUnknown_80F9CC8: @ 80F9CC8 -.string "{POKEMON_1} fainted!\0" -.align 2, 0 - -.global gUnknown_80F9CD8 -gUnknown_80F9CD8: @ 80F9CD8 -.string "{POKEMON_1} was defeated!\0" -.align 2, 0 - -.global gUnknown_80F9CEC -gUnknown_80F9CEC: @ 80F9CEC -@ replacing .incbin "baserom.gba", 0xF9CEC, 0x3C -.4byte gUnknown_80F9D0C -.4byte gUnknown_80F9CF4 - -.global gUnknown_80F9CF4 -gUnknown_80F9CF4: @ 80F9CF4 -.string "Oh, no! {POKEMON_1} fainted!\0" -.align 2, 0 - -.global gUnknown_80F9D0C -gUnknown_80F9D0C: @ 80F9D0C -.string "Oh, no! {POKEMON_1} was defeated!\0" -.align 2, 0 - -.global gUnknown_80F9D28 -gUnknown_80F9D28: @ 80F9D28 -@ replacing .incbin "baserom.gba", 0xF9D28, 0x5C -.4byte gUnknown_80F9D58 -.4byte gUnknown_80F9D30 - -.global gUnknown_80F9D30 -gUnknown_80F9D30: @ 80F9D30 -.string "{POKEMON_1} fainted!\n" -.string "It left the rescue team!\0" -.align 2, 0 - -.global gUnknown_80F9D58 -gUnknown_80F9D58: @ 80F9D58 -.string "{POKEMON_1} was defeated!\n" -.string "It left the rescue team!\0" -.align 2, 0 - -.global gUnknown_80F9D84 -gUnknown_80F9D84: @ 80F9D84 -@ replacing .incbin "baserom.gba", 0xF9D84, 0x8 -.4byte gUnknown_80F9D0C -.4byte gUnknown_80F9CF4 - -.global gUnknown_80F9D8C -gUnknown_80F9D8C: @ 80F9D8C -@ replacing .incbin "baserom.gba", 0xF9D8C, 0x20 -.4byte gUnknown_80F9D94 -.4byte gUnknown_80F9CF4 - -.global gUnknown_80F9D94 -gUnknown_80F9D94: @ 80F9D94 -.string "{POKEMON_1} went back for now!\0" -.align 2, 0 - -.global gUnknown_80F9DAC -gUnknown_80F9DAC: @ 80F9DAC -@ replacing .incbin "baserom.gba", 0xF9DAC, 0x44 -.4byte gUnknown_80F9DD0 -.4byte gUnknown_80F9DB4 - -.global gUnknown_80F9DB4 -gUnknown_80F9DB4: @ 80F9DB4 -.string "Your client {POKEMON_1} fainted!\0" -.align 2, 0 - -.global gUnknown_80F9DD0 -gUnknown_80F9DD0: @ 80F9DD0 -.string "Your client {POKEMON_1} was defeated!\0" -.align 2, 0 - -.global gUnknown_80F9DF0 -gUnknown_80F9DF0: @ 80F9DF0 -@ replacing .incbin "baserom.gba", 0xF9DF0, 0x54 -.4byte gUnknown_80F9E1C -.4byte gUnknown_80F9DF8 - -.global gUnknown_80F9DF8 -gUnknown_80F9DF8: @ 80F9DF8 -.string "{POKEMON_1} fainted while awaiting\n" -.string "rescue!\0" -.align 2, 0 - -.global gUnknown_80F9E1C -gUnknown_80F9E1C: @ 80F9E1C -.string "{POKEMON_1} was defeated while awaiting\n" -.string "rescue!\0" -.align 2, 0 - -.global gUnknown_80F9E44 -gUnknown_80F9E44: @ 80F9E44 -@ replacing .incbin "baserom.gba", 0xF9E44, 0x20 -.4byte gUnknown_80F9CC8 - -.global gUnknown_80F9E48 -gUnknown_80F9E48: @ 80F9E48 -.string "{POKEMON_0} gained {VALUE_0} Exp. Points!\0" -.align 2, 0 - -.global gUnknown_80F9E64 -gUnknown_80F9E64: @ 80F9E64 -@ replacing .incbin "baserom.gba", 0xF9E64, 0x1C -.4byte gUnknown_80F9E48 - -.global gUnknown_80F9E68 -gUnknown_80F9E68: @ 80F9E68 -.string "{POKEMON_0} grew to Level {VALUE_0}!\0" -.align 2, 0 - -.global gUnknown_80F9E80 -gUnknown_80F9E80: @ 80F9E80 -@ replacing .incbin "baserom.gba", 0xF9E80, 0x48 -.4byte gUnknown_80F9E68 - -.global gUnknown_80F9E84 -gUnknown_80F9E84: @ 80F9E84 -.string "{POKEMON_0}'s level remained unchanged.\0" -.align 2, 0 -.4byte gUnknown_80F9E84 - -.global gUnknown_80F9EAC -gUnknown_80F9EAC: @ 80F9EAC -.string "{POKEMON_0} dropped to Level {VALUE_0}!\0" -.align 2, 0 - -.global gUnknown_80F9EC8 -gUnknown_80F9EC8: @ 80F9EC8 -@ replacing .incbin "baserom.gba", 0xF9EC8, 0x24 -.4byte gUnknown_80F9EAC - -.global gUnknown_80F9ECC -gUnknown_80F9ECC: @ 80F9ECC -.string "{POKEMON_0}'s level didn't go down.\0" -.align 2, 0 - -.global gUnknown_80F9EEC -gUnknown_80F9EEC: @ 80F9EEC -@ replacing .incbin "baserom.gba", 0xF9EEC, 0x18 -.4byte gUnknown_80F9ECC - -.global gUnknown_80F9EF0 -gUnknown_80F9EF0: @ 80F9EF0 -.string "{POKEMON_0} learned {MOVE_ITEM_0}!\0" -.align 2, 0 - -.global gUnknown_80F9F04 -gUnknown_80F9F04: @ 80F9F04 -@ replacing .incbin "baserom.gba", 0xF9F04, 0x28 -.4byte gUnknown_80F9EF0 - -.global gUnknown_80F9F08 -gUnknown_80F9F08: @ 80F9F08 -.string "{POKEMON_0} didn't learn the new move.\0" -.align 2, 0 - -.global gUnknown_80F9F2C -gUnknown_80F9F2C: @ 80F9F2C -@ replacing .incbin "baserom.gba", 0xF9F2C, 0x78 -.4byte gUnknown_80F9F08 - -.global gUnknown_80F9F30 -gUnknown_80F9F30: @ 80F9F30 -.string "This Pokémon learned a new move,\n" -.string "so it must forget an old one. Moves can\n" -.string "be relearned at the Gulpin Link Shop.\0" -.align 2, 0 - -.global gUnknown_80F9FA4 -gUnknown_80F9FA4: @ 80F9FA4 -@ replacing .incbin "baserom.gba", 0xF9FA4, 0x44 -.4byte gUnknown_80F9F30 - -.global gUnknown_80F9FA8 -gUnknown_80F9FA8: @ 80F9FA8 -.string "Yes! {POKEMON_0} wants to join the team!\n" -.string "Accept {POKEMON_0} as a team member?\0" -.align 2, 0 - -.global gUnknown_80F9FE8 -gUnknown_80F9FE8: @ 80F9FE8 -@ replacing .incbin "baserom.gba", 0xF9FE8, 0x1C -.4byte gUnknown_80F9FA8 -.4byte gUnknown_80F7F20 - -.global gUnknown_80F9FF0 -gUnknown_80F9FF0: @ 80F9FF0 -.string "{POKEMON_0} went away...\0" -.align 2, 0 - -.global gUnknown_80FA004 -gUnknown_80FA004: @ 80FA004 -@ replacing .incbin "baserom.gba", 0xFA004, 0x2C -.4byte gUnknown_80F9FF0 - -.global gUnknown_80FA008 -gUnknown_80FA008: @ 80FA008 -.string "The Pokémon couldn't join the team...\0" -.align 2, 0 - -.global gUnknown_80FA030 -gUnknown_80FA030: @ 80FA030 -@ replacing .incbin "baserom.gba", 0xFA030, 0x28 -.4byte gUnknown_80FA008 - -.global gUnknown_80FA034 -gUnknown_80FA034: @ 80FA034 -.string "But it couldn't join the team.\0" -.align 2, 0 - -.global gUnknown_80FA058 -gUnknown_80FA058: @ 80FA058 -@ replacing .incbin "baserom.gba", 0xFA058, 0x38 -.4byte gUnknown_80FA034 - -.global gUnknown_80FA05C -gUnknown_80FA05C: @ 80FA05C -.string "A new member joined the team!\n" -.string "Give it a nickname?\0" -.align 2, 0 - -.global gUnknown_80FA090 -gUnknown_80FA090: @ 80FA090 -@ replacing .incbin "baserom.gba", 0xFA090, 0x38 -.4byte gUnknown_80FA05C - -.global gUnknown_80FA094 -gUnknown_80FA094: @ 80FA094 -.string "Please give your new team member\n" -.string "a proper nickname!\0" -.align 2, 0 - -.global gUnknown_80FA0C8 -gUnknown_80FA0C8: @ 80FA0C8 -@ replacing .incbin "baserom.gba", 0xFA0C8, 0x28 -.4byte gUnknown_80FA094 - -.global gUnknown_80FA0CC -gUnknown_80FA0CC: @ 80FA0CC -.string "{POKEMON_0} joined $t to\n" -.string "go on adventures!\0" -.align 2, 0 - -.global gUnknown_80FA0F0 -gUnknown_80FA0F0: @ 80FA0F0 -@ replacing .incbin "baserom.gba", 0xFA0F0, 0x30 -.4byte gUnknown_80FA0CC - -.global gUnknown_80FA0F4 -gUnknown_80FA0F4: @ 80FA0F4 -.string "{POKEMON_0} gained access to\n" -.string "the Friend Area {FRIEND_AREA}.\0" -.align 2, 0 - -.global gUnknown_80FA120 -gUnknown_80FA120: @ 80FA120 -@ replacing .incbin "baserom.gba", 0xFA120, 0x4 -.4byte gUnknown_80FA0F4 - -.global gUnknown_80FA124 -gUnknown_80FA124: @ 80FA124 -@ replacing .incbin "baserom.gba", 0xFA124, 0x13C -.4byte gUnknown_80FA1AC -.4byte gUnknown_80FA18C -.4byte gUnknown_80FA170 -.4byte gUnknown_80FA154 -.4byte gUnknown_80FA138 - -.global gUnknown_80FA138 -gUnknown_80FA138: @ 80FA138 -.string "{POKEMON_0}'s at quadruple speed!\0" -.align 2, 0 - -.global gUnknown_80FA154 -gUnknown_80FA154: @ 80FA154 -.string "{POKEMON_0}'s at triple speed!\0" -.align 2, 0 - -.global gUnknown_80FA170 -gUnknown_80FA170: @ 80FA170 -.string "{POKEMON_0}'s at double speed!\0" -.align 2, 0 - -.global gUnknown_80FA18C -gUnknown_80FA18C: @ 80FA18C -.string "{POKEMON_0} returned to normal speed!\0" -.align 2, 0 - -.global gUnknown_80FA1AC -gUnknown_80FA1AC: @ 80FA1AC -.string "{POKEMON_0} was slowed!\0" -.align 2, 0 - -.global gUnknown_80FA1BC -gUnknown_80FA1BC: @ 80FA1BC -.string "The Rescue Team Badge\n" -.string "shone on {POKEMON_1}!\n" -.string "{POKEMON_1} gained a magical power!\n" -.string "{POKEMON_1}: Thank you!\n" -.string "Please come see me at the Pelipper\n" -.string "Post Office later.\n" -.string "{POKEMON_1} escaped from the dungeon!\0" -.align 2, 0 - -.global gUnknown_80FA260 -gUnknown_80FA260: @ 80FA260 -@ replacing .incbin "baserom.gba", 0xFA260, 0x50 -.4byte gUnknown_80FA1BC - -.global gUnknown_80FA264 -gUnknown_80FA264: @ 80FA264 -.string "{POKEMON_1} happily accepted the item!\n" -.string "\n\n" -.string "{POKEMON_1}: Thank you!\n" -.string "\n\n" -.string "{POKEMON_1} left the dungeon!\n" -.string "\n\0" -.align 2, 0 - -.global gUnknown_80FA2B0 -gUnknown_80FA2B0: @ 80FA2B0 -@ replacing .incbin "baserom.gba", 0xFA2B0, 0x40 -.4byte gUnknown_80FA264 - -.global gUnknown_80FA2B4 -gUnknown_80FA2B4: @ 80FA2B4 -.string "Yes! {POKEMON_1} was found!\n" -.string "Use the Rescue Team Badge to save\n" -.string "{POKEMON_1}?\0" -.align 2, 0 - -.global gUnknown_80FA2F0 -gUnknown_80FA2F0: @ 80FA2F0 -@ replacing .incbin "baserom.gba", 0xFA2F0, 0x3C -.4byte gUnknown_80FA2B4 - -.global gUnknown_80FA2F4 -gUnknown_80FA2F4: @ 80FA2F4 -.string "Yes! {POKEMON_1} was found!\n" -.string "Deliver the requested item to\n" -.string "{POKEMON_1}?\0" -.align 2, 0 - -.global gUnknown_80FA32C -gUnknown_80FA32C: @ 80FA32C -@ replacing .incbin "baserom.gba", 0xFA32C, 0x40 -.4byte gUnknown_80FA2F4 - -.global gUnknown_80FA330 -gUnknown_80FA330: @ 80FA330 -.string "A mission has been completed!\n" -.string "Would you like to leave now?\0" -.align 2, 0 - -.global gUnknown_80FA36C -gUnknown_80FA36C: @ 80FA36C -@ replacing .incbin "baserom.gba", 0xFA36C, 0x4 -.4byte gUnknown_80FA330 - -.global gUnknown_80FA370 -gUnknown_80FA370: @ 80FA370 -@ replacing .incbin "baserom.gba", 0xFA370, 0x24 -.4byte gUnknown_80FA330 - -.global gUnknown_80FA374 -gUnknown_80FA374: @ 80FA374 -.string "Do you really want to leave?\0" -.align 2, 0 - -.global gUnknown_80FA394 -gUnknown_80FA394: @ 80FA394 -@ replacing .incbin "baserom.gba", 0xFA394, 0x24 -.4byte gUnknown_80FA374 - -.global gUnknown_80FA398 -gUnknown_80FA398: @ 80FA398 -.string "Continue with your adventure?\0" -.align 2, 0 - -.global gUnknown_80FA3B8 -gUnknown_80FA3B8: @ 80FA3B8 -@ replacing .incbin "baserom.gba", 0xFA3B8, 0x50 -.4byte gUnknown_80FA398 - -.global gUnknown_80FA3BC -gUnknown_80FA3BC: @ 80FA3BC -.string "You're holding a delivery item.\n" -.string "Return to the base without continuing?\0" -.align 2, 0 - -.global gUnknown_80FA408 -gUnknown_80FA408: @ 80FA408 -@ replacing .incbin "baserom.gba", 0xFA408, 0x40 -.4byte gUnknown_80FA3BC - -.global gUnknown_80FA40C -gUnknown_80FA40C: @ 80FA40C -.string "The {MOVE_ITEM_0} isn't in the Toolbox.\n" -.string "It couldn't be delivered.\0" -.align 2, 0 - -.global gUnknown_80FA448 -gUnknown_80FA448: @ 80FA448 -@ replacing .incbin "baserom.gba", 0xFA448, 0x1C -.4byte gUnknown_80FA40C - -.global gUnknown_80FA44C -gUnknown_80FA44C: @ 80FA44C -.string "{POKEMON_1} can't talk now.\0" -.align 2, 0 - -.global gUnknown_80FA464 -gUnknown_80FA464: @ 80FA464 -@ replacing .incbin "baserom.gba", 0xFA464, 0x70 -.4byte gUnknown_80FA44C - -.global gUnknown_80FA468 -gUnknown_80FA468: @ 80FA468 -.string "Yes! {POKEMON_2} was successfully\n" -.string "escorted!\n" -.string "{POKEMON_2} is delighted!\n" -.string "{POKEMON_2}: Thank you!\n" -.string "\n\n" -.string "{POKEMON_2}'s twosome left the dungeon!\n" -.string "\n\0" -.align 2, 0 - -.global gUnknown_80FA4D4 -gUnknown_80FA4D4: @ 80FA4D4 -@ replacing .incbin "baserom.gba", 0xFA4D4, 0x4 -.4byte gUnknown_80FA468 - -.global gUnknown_80FA4D8 -gUnknown_80FA4D8: @ 80FA4D8 -@ replacing .incbin "baserom.gba", 0xFA4D8, 0x28 -.4byte gUnknown_80FA330 - -.global gUnknown_80FA4DC -gUnknown_80FA4DC: @ 80FA4DC -.string "{POKEMON_2} doesn't seem to be around.\0" -.align 2, 0 - -.global gUnknown_80FA500 -gUnknown_80FA500: @ 80FA500 -@ replacing .incbin "baserom.gba", 0xFA500, 0x2C -.4byte gUnknown_80FA4DC - -.global gUnknown_80FA504 -gUnknown_80FA504: @ 80FA504 -.string "The mission can no longer be completed!\0" -.align 2, 0 - -.global gUnknown_80FA52C -gUnknown_80FA52C: @ 80FA52C -@ replacing .incbin "baserom.gba", 0xFA52C, 0x4 -.4byte gUnknown_80FA504 - -.global gUnknown_80FA530 -gUnknown_80FA530: @ 80FA530 -@ replacing .incbin "baserom.gba", 0xFA530, 0x1C -.4byte gUnknown_80FA44C - -.global gUnknown_80FA534 -gUnknown_80FA534: @ 80FA534 -.string "{POKEMON_2} can't talk now.\0" -.align 2, 0 - -.global gUnknown_80FA54C -gUnknown_80FA54C: @ 80FA54C -@ replacing .incbin "baserom.gba", 0xFA54C, 0x34 -.4byte gUnknown_80FA534 - -.global gUnknown_80FA550 -gUnknown_80FA550: @ 80FA550 -.string "Deoxys was a mirage!\n" -.string "A set of stairs appeared!\0" -.align 2, 0 - -.global gUnknown_80FA580 -gUnknown_80FA580: @ 80FA580 -@ replacing .incbin "baserom.gba", 0xFA580, 0x34 -.4byte gUnknown_80FA550 - -.global gUnknown_80FA584 -gUnknown_80FA584: @ 80FA584 -.string "It's impossible to go down the stairs\n" -.string "now!\0" -.align 2, 0 - -.global gUnknown_80FA5B4 -gUnknown_80FA5B4: @ 80FA5B4 -@ replacing .incbin "baserom.gba", 0xFA5B4, 0x40 -.4byte gUnknown_80FA584 -.4byte gUnknown_80F7F20 - -.global gUnknown_80FA5BC -gUnknown_80FA5BC: @ 80FA5BC -.string "No Pokémon will join the rescue team\n" -.string "in this dungeon.\0" -.align 2, 0 - -.global gUnknown_80FA5F4 -gUnknown_80FA5F4: @ 80FA5F4 -.4byte gUnknown_80FA5BC - -.global gUnknown_80FA5F8 -gUnknown_80FA5F8: @ 80FA5F8 -.string "There are no potential recruits.\0" -.align 2,0 - -.global gUnknown_80FA61C -gUnknown_80FA61C: @ 80FA61C -@ replacing .incbin "baserom.gba", 0xFA61C, 0x1C -.4byte gUnknown_80FA5F8 - -.global gUnknown_80FA620 -gUnknown_80FA620: @ 80FA620 -.string "{POKEMON_0}'s Reflect faded.\0" -.align 2, 0 - -.global gUnknown_80FA638 -gUnknown_80FA638: @ 80FA638 -@ replacing .incbin "baserom.gba", 0xFA638, 0x20 -.4byte gUnknown_80FA620 - -.global gUnknown_80FA63C -gUnknown_80FA63C: @ 80FA63C -.string "{POKEMON_0}'s Light Screen faded.\0" -.align 2, 0 - -.global gUnknown_80FA658 -gUnknown_80FA658: @ 80FA658 -@ replacing .incbin "baserom.gba", 0xFA658, 0x24 -.4byte gUnknown_80FA63C - -.global gUnknown_80FA65C -gUnknown_80FA65C: @ 80FA65C -.string "{POKEMON_0}'s Counter effect faded.\0" -.align 2, 0 - -.global gUnknown_80FA67C -gUnknown_80FA67C: @ 80FA67C -@ replacing .incbin "baserom.gba", 0xFA67C, 0x20 -.4byte gUnknown_80FA65C - -.global gUnknown_80FA680 -gUnknown_80FA680: @ 80FA680 -.string "{POKEMON_0}'s Safeguard faded.\0" -.align 2, 0 - -.global gUnknown_80FA69C -gUnknown_80FA69C: @ 80FA69C -@ replacing .incbin "baserom.gba", 0xFA69C, 0x20 -.4byte gUnknown_80FA680 - -.global gUnknown_80FA6A0 -gUnknown_80FA6A0: @ 80FA6A0 -.string "{POKEMON_0}'s Magic Coat faded.\0" -.align 2, 0 - -.global gUnknown_80FA6BC -gUnknown_80FA6BC: @ 80FA6BC -@ replacing .incbin "baserom.gba", 0xFA6BC, 0x18 -.4byte gUnknown_80FA6A0 - -.global gUnknown_80FA6C0 -gUnknown_80FA6C0: @ 80FA6C0 -.string "{POKEMON_0}'s Wish faded.\0" -.align 2, 0 - -.global gUnknown_80FA6D4 -gUnknown_80FA6D4: @ 80FA6D4 -@ replacing .incbin "baserom.gba", 0xFA6D4, 0x14 -.4byte gUnknown_80FA6C0 - -.global gUnknown_80FA6D8 -gUnknown_80FA6D8: @ 80FA6D8 -.string "{POKEMON_0} woke up!\0" -.align 2, 0 - -.global gUnknown_80FA6E8 -gUnknown_80FA6E8: @ 80FA6E8 -@ replacing .incbin "baserom.gba", 0xFA6E8, 0x20 -.4byte gUnknown_80FA6D8 - -.global gUnknown_80FA6EC -gUnknown_80FA6EC: @ 80FA6EC -.string "{POKEMON_0} is no longer sleepless!\0" -.align 2, 0 - -.global gUnknown_80FA708 -gUnknown_80FA708: @ 80FA708 -@ replacing .incbin "baserom.gba", 0xFA708, 0x4 -.4byte gUnknown_80FA6EC - -.global gUnknown_80FA70C -gUnknown_80FA70C: @ 80FA70C -@ replacing .incbin "baserom.gba", 0xFA70C, 0x4 -.4byte gUnknown_80FA6D8 - -.global gUnknown_80FA710 -gUnknown_80FA710: @ 80FA710 -@ replacing .incbin "baserom.gba", 0xFA710, 0x24 -.4byte gUnknown_80FA6D8 - -.global gUnknown_80FA714 -gUnknown_80FA714: @ 80FA714 -.string "{POKEMON_0} got over its drowsiness!\0" -.align 2, 0 - -.global gUnknown_80FA734 -gUnknown_80FA734: @ 80FA734 -@ replacing .incbin "baserom.gba", 0xFA734, 0x24 -.4byte gUnknown_80FA714 - -.global gUnknown_80FA738 -gUnknown_80FA738: @ 80FA738 -.string "Water Sport's effect faded.\0" -.align 2, 0 - -.global gUnknown_80FA758 -gUnknown_80FA758: @ 80FA758 -@ replacing .incbin "baserom.gba", 0xFA758, 0x20 -.4byte gUnknown_80FA738 - -.global gUnknown_80FA75C -gUnknown_80FA75C: @ 80FA75C -.string "Mud Sport's effect faded.\0" -.align 2, 0 - -.global gUnknown_80FA778 -gUnknown_80FA778: @ 80FA778 -@ replacing .incbin "baserom.gba", 0xFA778, 0x24 -.4byte gUnknown_80FA75C - -.global gUnknown_80FA77C -gUnknown_80FA77C: @ 80FA77C -.string "{POKEMON_0}'s Leech Seed wore off.\0" -.align 2, 0 - -.global gUnknown_80FA79C -gUnknown_80FA79C: @ 80FA79C -@ replacing .incbin "baserom.gba", 0xFA79C, 0x20 -.4byte gUnknown_80FA77C - -.global gUnknown_80FA7A0 -gUnknown_80FA7A0: @ 80FA7A0 -.string "{POKEMON_0} is no longer cursed!\0" -.align 2, 0 - -.global gUnknown_80FA7BC -gUnknown_80FA7BC: @ 80FA7BC -@ replacing .incbin "baserom.gba", 0xFA7BC, 0x20 -.4byte gUnknown_80FA7A0 - -.global gUnknown_80FA7C0 -gUnknown_80FA7C0: @ 80FA7C0 -.string "{POKEMON_0}'s Snatch wore off!\0" -.align 2, 0 - -.global gUnknown_80FA7DC -gUnknown_80FA7DC: @ 80FA7DC -@ replacing .incbin "baserom.gba", 0xFA7DC, 0x24 -.4byte gUnknown_80FA7C0 - -.global gUnknown_80FA7E0 -gUnknown_80FA7E0: @ 80FA7E0 -.string "{POKEMON_0} recovered from confusion!\0" -.align 2, 0 - -.global gUnknown_80FA800 -gUnknown_80FA800: @ 80FA800 -@ replacing .incbin "baserom.gba", 0xFA800, 0x1C -.4byte gUnknown_80FA7E0 - -.global gUnknown_80FA804 -gUnknown_80FA804: @ 80FA804 -.string "{POKEMON_0} regained mobility!\0" -.align 2, 0 - -.global gUnknown_80FA81C -gUnknown_80FA81C: @ 80FA81C -@ replacing .incbin "baserom.gba", 0xFA81C, 0x4 -.4byte gUnknown_80FA804 - -.global gUnknown_80FA820 -gUnknown_80FA820: @ 80FA820 -@ replacing .incbin "baserom.gba", 0xFA820, 0x4 -.4byte gUnknown_80FA804 - -.global gUnknown_80FA824 -gUnknown_80FA824: @ 80FA824 -@ replacing .incbin "baserom.gba", 0xFA824, 0x20 -.4byte gUnknown_80FA804 - -.global gUnknown_80FA828 -gUnknown_80FA828: @ 80FA828 -.string "{POKEMON_0}'s Ingrain wore off!\0" -.align 2, 0 - -.global gUnknown_80FA844 -gUnknown_80FA844: @ 80FA844 -@ replacing .incbin "baserom.gba", 0xFA844, 0x24 -.4byte gUnknown_80FA828 - -.global gUnknown_80FA848 -gUnknown_80FA848: @ 80FA848 -.string "{POKEMON_0} recovered from paralysis!\0" -.align 2, 0 - -.global gUnknown_80FA868 -gUnknown_80FA868: @ 80FA868 -@ replacing .incbin "baserom.gba", 0xFA868, 0x20 -.4byte gUnknown_80FA848 - -.global gUnknown_80FA86C -gUnknown_80FA86C: @ 80FA86C -.string "{POKEMON_0} recovered from a burn!\0" -.align 2, 0 - -.global gUnknown_80FA888 -gUnknown_80FA888: @ 80FA888 -@ replacing .incbin "baserom.gba", 0xFA888, 0x20 -.4byte gUnknown_80FA86C - -.global gUnknown_80FA88C -gUnknown_80FA88C: @ 80FA88C -.string "{POKEMON_0} recovered from poison!\0" -.align 2, 0 - -.global gUnknown_80FA8A8 -gUnknown_80FA8A8: @ 80FA8A8 -@ replacing .incbin "baserom.gba", 0xFA8A8, 0x14 -.4byte gUnknown_80FA88C - -.global gUnknown_80FA8AC -gUnknown_80FA8AC: @ 80FA8AC -.string "{POKEMON_0} thawed out!\0" -.align 2, 0 - -.global gUnknown_80FA8BC -gUnknown_80FA8BC: @ 80FA8BC -@ replacing .incbin "baserom.gba", 0xFA8BC, 0x24 -.4byte gUnknown_80FA8AC - -.global gUnknown_80FA8C0 -gUnknown_80FA8C0: @ 80FA8C0 -.string "{POKEMON_0} lost its Sure Shot status!\0" -.align 2, 0 - -.global gUnknown_80FA8E0 -gUnknown_80FA8E0: @ 80FA8E0 -@ replacing .incbin "baserom.gba", 0xFA8E0, 0x2C -.4byte gUnknown_80FA8C0 - -.global gUnknown_80FA8E4 -gUnknown_80FA8E4: @ 80FA8E4 -.string "{POKEMON_0} recovered from its\n" -.string "Whiffer status!\0" -.align 2, 0 - -.global gUnknown_80FA90C -gUnknown_80FA90C: @ 80FA90C -@ replacing .incbin "baserom.gba", 0xFA90C, 0x28 -.4byte gUnknown_80FA8E4 - -.global gUnknown_80FA910 -gUnknown_80FA910: @ 80FA910 -.string "{POKEMON_0}'s damage returned to normal!\0" -.align 2, 0 - -.global gUnknown_80FA934 -gUnknown_80FA934: @ 80FA934 -@ replacing .incbin "baserom.gba", 0xFA934, 0x28 -.4byte gUnknown_80FA910 - -.global gUnknown_80FA938 -gUnknown_80FA938: @ 80FA938 -.string "{POKEMON_0} lost its Focus Energy status!\0" -.align 2, 0 - -.global gUnknown_80FA95C -gUnknown_80FA95C: @ 80FA95C -@ replacing .incbin "baserom.gba", 0xFA95C, 0x20 -.4byte gUnknown_80FA938 - -.global gUnknown_80FA960 -gUnknown_80FA960: @ 80FA960 -.string "{POKEMON_0} is no longer cowering!\0" -.align 2, 0 - -.global gUnknown_80FA97C -gUnknown_80FA97C: @ 80FA97C -@ replacing .incbin "baserom.gba", 0xFA97C, 0x24 -.4byte gUnknown_80FA960 - -.global gUnknown_80FA980 -gUnknown_80FA980: @ 80FA980 -.string "The decoy Pokémon went away!\0" -.align 2, 0 - -.global gUnknown_80FA9A0 -gUnknown_80FA9A0: @ 80FA9A0 -@ replacing .incbin "baserom.gba", 0xFA9A0, 0x20 -.4byte gUnknown_80FA980 - -.global gUnknown_80FA9A4 -gUnknown_80FA9A4: @ 80FA9A4 -.string "{POKEMON_0}'s Protect wore off!\0" -.align 2, 0 - -.global gUnknown_80FA9C0 -gUnknown_80FA9C0: @ 80FA9C0 -@ replacing .incbin "baserom.gba", 0xFA9C0, 0x1C -.4byte gUnknown_80FA9A4 - -.global gUnknown_80FA9C4 -gUnknown_80FA9C4: @ 80FA9C4 -.string "{POKEMON_0}'s Taunt wore off!\0" -.align 2, 0 - -.global gUnknown_80FA9DC -gUnknown_80FA9DC: @ 80FA9DC -@ replacing .incbin "baserom.gba", 0xFA9DC, 0x18 -.4byte gUnknown_80FA9C4 - -.global gUnknown_80FA9E0 -gUnknown_80FA9E0: @ 80FA9E0 -.string "{POKEMON_0} became visible!\0" -.align 2, 0 - -.global gUnknown_80FA9F4 -gUnknown_80FA9F4: @ 80FA9F4 -@ replacing .incbin "baserom.gba", 0xFA9F4, 0x18 -.4byte gUnknown_80FA9E0 - -.global gUnknown_80FA9F8 -gUnknown_80FA9F8: @ 80FA9F8 -.string "{POKEMON_0} regained sight!\0" -.align 2, 0 - -.global gUnknown_80FAA0C -gUnknown_80FAA0C: @ 80FAA0C -@ replacing .incbin "baserom.gba", 0xFAA0C, 0x20 -.4byte gUnknown_80FA9F8 - -.global gUnknown_80FAA10 -gUnknown_80FAA10: @ 80FAA10 -.string "{POKEMON_0} can see normally again!\0" -.align 2, 0 - -.global gUnknown_80FAA2C -gUnknown_80FAA2C: @ 80FAA2C -@ replacing .incbin "baserom.gba", 0xFAA2C, 0x1C -.4byte gUnknown_80FAA10 - -.global gUnknown_80FAA30 -gUnknown_80FAA30: @ 80FAA30 -.string "{POKEMON_0} returned to normal!\0" -.align 2, 0 - -.global gUnknown_80FAA48 -gUnknown_80FAA48: @ 80FAA48 -@ replacing .incbin "baserom.gba", 0xFAA48, 0x20 -.4byte gUnknown_80FAA30 - -.global gUnknown_80FAA4C -gUnknown_80FAA4C: @ 80FAA4C -.string "{POKEMON_0}'s Mirror Coat faded!\0" -.align 2, 0 - -.global gUnknown_80FAA68 -gUnknown_80FAA68: @ 80FAA68 -@ replacing .incbin "baserom.gba", 0xFAA68, 0x24 -.4byte gUnknown_80FAA4C - -.global gUnknown_80FAA6C -gUnknown_80FAA6C: @ 80FAA6C -.string "{POKEMON_0} gave up on Destiny Bond!\0" -.align 2, 0 - -.global gUnknown_80FAA8C -gUnknown_80FAA8C: @ 80FAA8C -@ replacing .incbin "baserom.gba", 0xFAA8C, 0x20 -.4byte gUnknown_80FAA6C - -.global gUnknown_80FAA90 -gUnknown_80FAA90: @ 80FAA90 -.string "{POKEMON_0} recovered from Encore!\0" -.align 2, 0 - -.global gUnknown_80FAAAC -gUnknown_80FAAAC: @ 80FAAAC -@ replacing .incbin "baserom.gba", 0xFAAAC, 0x1C -.4byte gUnknown_80FAA90 - -.global gMonStoppedEnduringMessage -gMonStoppedEnduringMessage: @ 80FAAB0 -.string "{POKEMON_0} stopped enduring!\0" -.align 2, 0 - -.global gPtrMonStoppedEnduringMessage -gPtrMonStoppedEnduringMessage: @ 80FAAC8 -.4byte gMonStoppedEnduringMessage - -.global gMonMirrorMoveFadedMessage -gMonMirrorMoveFadedMessage: @ 80FAACC -.string "{POKEMON_0}'s Mirror Move faded!\0" -.align 2, 0 - -.global gPtrMonMirrorMoveFadedMessage -gPtrMonMirrorMoveFadedMessage: @ 80FAAE8 -.4byte gMonMirrorMoveFadedMessage - -.global gMonConversion2FailedMessage -gMonConversion2FailedMessage: @ 80FAAEC -.string "{POKEMON_0}'s Conversion 2 faded!\0" -.align 2, 0 - -.global gPtrMonConversion2FailedMessage -gPtrMonConversion2FailedMessage: @ 80FAB08 -.4byte gMonConversion2FailedMessage - -.global gMonGaveUpVitalThrowMessage -gMonGaveUpVitalThrowMessage: @ 80FAB0C -.string "{POKEMON_0} gave up on Vital Throw!\0" -.align 2, 0 - -.global gPtrMonGaveUpVitalThrowMessage -gPtrMonGaveUpVitalThrowMessage: @ 80FAB28 -.4byte gMonGaveUpVitalThrowMessage - -.global gUnknown_80FAB2C -gUnknown_80FAB2C: @ 80FAB2C -.string "{POKEMON_0}'s Mist faded!\0" -.align 2, 0 - -.global gUnknown_80FAB40 -gUnknown_80FAB40: @ 80FAB40 -@ replacing .incbin "baserom.gba", 0xFAB40, 0x2C -.4byte gUnknown_80FAB2C - -.global gUnknown_80FAB44 -gUnknown_80FAB44: @ 80FAB44 -.string "{POKEMON_0}'s appearance returned to\n" -.string "normal!\0" -.align 2, 0 - -.global gUnknown_80FAB6C -gUnknown_80FAB6C: @ 80FAB6C -@ replacing .incbin "baserom.gba", 0xFAB6C, 0x24 -.4byte gUnknown_80FAB44 - -.global gUnknown_80FAB70 -gUnknown_80FAB70: @ 80FAB70 -.string "{POKEMON_0} got over its infatuation!\0" -.align 2, 0 - -.global gUnknown_80FAB90 -gUnknown_80FAB90: @ 80FAB90 -@ replacing .incbin "baserom.gba", 0xFAB90, 0x2C -.4byte gUnknown_80FAB70 - -.global gUnknown_80FAB94 -gUnknown_80FAB94: @ 80FAB94 -.string "{POKEMON_0} can't go through walls\n" -.string "anymore!\0" -.align 2, 0 - -.global gUnknown_80FABBC -gUnknown_80FABBC: @ 80FABBC -@ replacing .incbin "baserom.gba", 0xFABBC, 0x4 -.4byte gUnknown_80FAB94 - -.global gUnknown_80FABC0 -gUnknown_80FABC0: @ 80FABC0 -@ replacing .incbin "baserom.gba", 0xFABC0, 0x18 -.4byte gUnknown_80FAA30 - -.global gUnknown_80FABC4 -gUnknown_80FABC4: @ 80FABC4 -.string "{POKEMON_0}'s rage faded!\0" -.align 2, 0 - -.global gUnknown_80FABD8 -gUnknown_80FABD8: @ 80FABD8 -@ replacing .incbin "baserom.gba", 0xFABD8, 0x20 -.4byte gUnknown_80FABC4 - -.global gMonNoLongerPetrifiedMessage -gMonNoLongerPetrifiedMessage: @ 80FABDC -.string "{POKEMON_0} is no longer petrified!\0" -.align 2, 0 - -.global gPtrMonNoLongerPetrifiedMessage -gPtrMonNoLongerPetrifiedMessage: @ 80FABF8 -.4byte gMonNoLongerPetrifiedMessage - -.global gMonNoLongerCringingMessage -gMonNoLongerCringingMessage: @ 80FABFC -.string "{POKEMON_0} is no longer cringing!\0" -.align 2, 0 - -.global gPtrMonNoLongerCringingMessage -gPtrMonNoLongerCringingMessage: @ 80FAC18 -.4byte gMonNoLongerCringingMessage - -.global gUnknown_80FAC1C -gUnknown_80FAC1C: @ 80FAC1C -.string "{POKEMON_0} is no longer paused!\0" -.align 2, 0 - -.global gUnknown_80FAC38 -gUnknown_80FAC38: @ 80FAC38 -@ replacing .incbin "baserom.gba", 0xFAC38, 0x1C -.4byte gUnknown_80FAC1C - -.global gUnknown_80FAC3C -gUnknown_80FAC3C: @ 80FAC3C -.string "{POKEMON_0} readies Razor Wind!\0" -.align 2, 0 - -.global gUnknown_80FAC54 -gUnknown_80FAC54: @ 80FAC54 -@ replacing .incbin "baserom.gba", 0xFAC54, 0x20 -.4byte gUnknown_80FAC3C - -.global gUnknown_80FAC58 -gUnknown_80FAC58: @ 80FAC58 -.string "{POKEMON_0} began storing energy!\0" -.align 2, 0 - -.global gUnknown_80FAC74 -gUnknown_80FAC74: @ 80FAC74 -@ replacing .incbin "baserom.gba", 0xFAC74, 0x14 -.4byte gUnknown_80FAC58 - -.global gUnknown_80FAC78 -gUnknown_80FAC78: @ 80FAC78 -.string "{POKEMON_0} is enraged!\0" -.align 2, 0 - -.global gUnknown_80FAC88 -gUnknown_80FAC88: @ 80FAC88 -@ replacing .incbin "baserom.gba", 0xFAC88, 0x1C -.4byte gUnknown_80FAC78 - -.global gUnknown_80FAC8C -gUnknown_80FAC8C: @ 80FAC8C -.string "{POKEMON_0} is focusing energy!\0" -.align 2, 0 - -.global gUnknown_80FACA4 -gUnknown_80FACA4: @ 80FACA4 -@ replacing .incbin "baserom.gba", 0xFACA4, 0x20 -.4byte gUnknown_80FAC8C - -.global gUnknown_80FACA8 -gUnknown_80FACA8: @ 80FACA8 -.string "{POKEMON_0} is readying Sky Attack!\0" -.align 2, 0 - -.global gUnknown_80FACC4 -gUnknown_80FACC4: @ 80FACC4 -@ replacing .incbin "baserom.gba", 0xFACC4, 0x20 -.4byte gUnknown_80FACA8 - -.global gUnknown_80FACC8 -gUnknown_80FACC8: @ 80FACC8 -.string "{POKEMON_0} is readying Solarbeam!\0" -.align 2, 0 - -.global gUnknown_80FACE4 -gUnknown_80FACE4: @ 80FACE4 -@ replacing .incbin "baserom.gba", 0xFACE4, 0x18 -.4byte gUnknown_80FACC8 - -.global gUnknown_80FACE8 -gUnknown_80FACE8: @ 80FACE8 -.string "{POKEMON_0} flew up high!\0" -.align 2, 0 - -.global gUnknown_80FACFC -gUnknown_80FACFC: @ 80FACFC -@ replacing .incbin "baserom.gba", 0xFACFC, 0x14 -.4byte gUnknown_80FACE8 - -.global gUnknown_80FAD00 -gUnknown_80FAD00: @ 80FAD00 -.string "{POKEMON_0} bounced up!\0" -.align 2, 0 - -.global gUnknown_80FAD10 -gUnknown_80FAD10: @ 80FAD10 -@ replacing .incbin "baserom.gba", 0xFAD10, 0x1C -.4byte gUnknown_80FAD00 - -.global gUnknown_80FAD14 -gUnknown_80FAD14: @ 80FAD14 -.string "{POKEMON_0} dove underwater!\0" -.align 2, 0 - -.global gUnknown_80FAD2C -gUnknown_80FAD2C: @ 80FAD2C -@ replacing .incbin "baserom.gba", 0xFAD2C, 0x20 -.4byte gUnknown_80FAD14 - -.global gUnknown_80FAD30 -gUnknown_80FAD30: @ 80FAD30 -.string "{POKEMON_0} burrowed underground!\0" -.align 2, 0 - -.global gUnknown_80FAD4C -gUnknown_80FAD4C: @ 80FAD4C -@ replacing .incbin "baserom.gba", 0xFAD4C, 0x20 -.4byte gUnknown_80FAD30 - -.global gUnknown_80FAD50 -gUnknown_80FAD50: @ 80FAD50 -.string "{POKEMON_0} began charging power!\0" -.align 2, 0 - -.global gUnknown_80FAD6C -gUnknown_80FAD6C: @ 80FAD6C -@ replacing .incbin "baserom.gba", 0xFAD6C, 0x20 -.4byte gUnknown_80FAD50 - -.global gUnknown_80FAD70 -gUnknown_80FAD70: @ 80FAD70 -.string "Mud Sport came into effect!\0" -.align 2, 0 - -.global gUnknown_80FAD8C -gUnknown_80FAD8C: @ 80FAD8C -@ replacing .incbin "baserom.gba", 0xFAD8C, 0x24 -.4byte gUnknown_80FAD70 - -.global gUnknown_80FAD90 -gUnknown_80FAD90: @ 80FAD90 -.string "Water Sport came into effect!\0" -.align 2, 0 - -.global gUnknown_80FADB0 -gUnknown_80FADB0: @ 80FADB0 -@ replacing .incbin "baserom.gba", 0xFADB0, 0x28 -.4byte gUnknown_80FAD90 - -.global gUnknown_80FADB4 -gUnknown_80FADB4: @ 80FADB4 -.string "{POKEMON_1} used Flash Fire to absorb\n" -.string "fire!\0" -.align 2, 0 - -.global gUnknown_80FADD8 -gUnknown_80FADD8: @ 80FADD8 -@ replacing .incbin "baserom.gba", 0xFADD8, 0x28 -.4byte gUnknown_80FADB4 - -.global gUnknown_80FADDC -gUnknown_80FADDC: @ 80FADDC -.string "Fire moves won't become stronger!\0" -.align 2, 0 - -.global gUnknown_80FAE00 -gUnknown_80FAE00: @ 80FAE00 -@ replacing .incbin "baserom.gba", 0xFAE00, 0x1C -.4byte gUnknown_80FADDC - -.global gUnknown_80FAE04 -gUnknown_80FAE04: @ 80FAE04 -.string "{POKEMON_0} began using Wish!\0" -.align 2, 0 - -.global gUnknown_80FAE1C -gUnknown_80FAE1C: @ 80FAE1C -@ replacing .incbin "baserom.gba", 0xFAE1C, 0x20 -.4byte gUnknown_80FAE04 - -.global gUnknown_80FAE20 -gUnknown_80FAE20: @ 80FAE20 -.string "{POKEMON_0} is already using Wish.\0" -.align 2, 0 - -.global gUnknown_80FAE3C -gUnknown_80FAE3C: @ 80FAE3C -@ replacing .incbin "baserom.gba", 0xFAE3C, 0x1C -.4byte gUnknown_80FAE20 - -.global gUnknown_80FAE40 -gUnknown_80FAE40: @ 80FAE40 -.string "{POKEMON_0} took a leech seed!\0" -.align 2, 0 - -.global gUnknown_80FAE58 -gUnknown_80FAE58: @ 80FAE58 -@ replacing .incbin "baserom.gba", 0xFAE58, 0x24 -.4byte gUnknown_80FAE40 - -.global gUnknown_80FAE5C -gUnknown_80FAE5C: @ 80FAE5C -.string "{POKEMON_0} already has a leech seed!\0" -.align 2, 0 - -.global gUnknown_80FAE7C -gUnknown_80FAE7C: @ 80FAE7C -@ replacing .incbin "baserom.gba", 0xFAE7C, 0x24 -.4byte gUnknown_80FAE5C - -.global gUnknown_80FAE80 -gUnknown_80FAE80: @ 80FAE80 -.string "Item locations became evident!\0" -.align 2, 0 - -.global gUnknown_80FAEA0 -gUnknown_80FAEA0: @ 80FAEA0 -@ replacing .incbin "baserom.gba", 0xFAEA0, 0x28 -.4byte gUnknown_80FAE80 - -.global gUnknown_80FAEA4 -gUnknown_80FAEA4: @ 80FAEA4 -.string "The stair location became clear!\0" -.align 2, 0 - -.global gUnknown_80FAEC8 -gUnknown_80FAEC8: @ 80FAEC8 -@ replacing .incbin "baserom.gba", 0xFAEC8, 0x28 -.4byte gUnknown_80FAEA4 - -.global gUnknown_80FAECC -gUnknown_80FAECC: @ 80FAECC -.string "Item locations are already known.\0" -.align 2, 0 - -.global gUnknown_80FAEF0 -gUnknown_80FAEF0: @ 80FAEF0 -@ replacing .incbin "baserom.gba", 0xFAEF0, 0x2C -.4byte gUnknown_80FAECC - -.global gUnknown_80FAEF4 -gUnknown_80FAEF4: @ 80FAEF4 -.string "The stair location is already known.\0" -.align 2, 0 - -.global gUnknown_80FAF1C -gUnknown_80FAF1C: @ 80FAF1C -@ replacing .incbin "baserom.gba", 0xFAF1C, 0x20 -.4byte gUnknown_80FAEF4 - -.global gUnknown_80FAF20 -gUnknown_80FAF20: @ 80FAF20 -.string "There are no stairs here.\0" -.align 2, 0 - -.global gUnknown_80FAF3C -gUnknown_80FAF3C: @ 80FAF3C -@ replacing .incbin "baserom.gba", 0xFAF3C, 0x20 -.4byte gUnknown_80FAF20 - -.global gUnknown_80FAF40 -gUnknown_80FAF40: @ 80FAF40 -.string "{POKEMON_0} put up its magic coat!\0" -.align 2, 0 - -.global gUnknown_80FAF5C -gUnknown_80FAF5C: @ 80FAF5C -@ replacing .incbin "baserom.gba", 0xFAF5C, 0x30 -.4byte gUnknown_80FAF40 - -.global gUnknown_80FAF60 -gUnknown_80FAF60: @ 80FAF60 -.string "{POKEMON_0} is already cloaked in its\n" -.string "magic coat!\0" -.align 2, 0 - -.global gUnknown_80FAF8C -gUnknown_80FAF8C: @ 80FAF8C -@ replacing .incbin "baserom.gba", 0xFAF8C, 0x20 -.4byte gUnknown_80FAF60 - -.global gUnknown_80FAF90 -gUnknown_80FAF90: @ 80FAF90 -.string "{POKEMON_0} can locate foes now!\0" -.align 2, 0 - -.global gUnknown_80FAFAC -gUnknown_80FAFAC: @ 80FAFAC -@ replacing .incbin "baserom.gba", 0xFAFAC, 0x24 -.4byte gUnknown_80FAF90 - -.global gUnknown_80FAFB0 -gUnknown_80FAFB0: @ 80FAFB0 -.string "Foes can already be located!\0" -.align 2, 0 - -.global gUnknown_80FAFD0 -gUnknown_80FAFD0: @ 80FAFD0 -@ replacing .incbin "baserom.gba", 0xFAFD0, 0x20 -.4byte gUnknown_80FAFB0 - -.global gUnknown_80FAFD4 -gUnknown_80FAFD4: @ 80FAFD4 -.string "{POKEMON_0} readies its Skull Bash!\0" -.align 2, 0 - -.global gUnknown_80FAFF0 -gUnknown_80FAFF0: @ 80FAFF0 -@ replacing .incbin "baserom.gba", 0xFAFF0, 0x14 -.4byte gUnknown_80FAFD4 - -.global gUnknown_80FAFF4 -gUnknown_80FAFF4: @ 80FAFF4 -.string "{POKEMON_0} was cursed!\0" -.align 2, 0 - -.global gUnknown_80FB004 -gUnknown_80FB004: @ 80FB004 -@ replacing .incbin "baserom.gba", 0xFB004, 0x18 -.4byte gUnknown_80FAFF4 - -.global gUnknown_80FB008 -gUnknown_80FB008: @ 80FB008 -.string "{POKEMON_0} readied Snatch!\0" -.align 2, 0 - -.global gUnknown_80FB01C -gUnknown_80FB01C: @ 80FB01C -@ replacing .incbin "baserom.gba", 0xFB01C, 0x2C -.4byte gUnknown_80FB008 - -.global gUnknown_80FB020 -gUnknown_80FB020: @ 80FB020 -.string "{POKEMON_0} gained the protection\n" -.string "of Safeguard!\0" -.align 2, 0 - -.global gUnknown_80FB048 -gUnknown_80FB048: @ 80FB048 -@ replacing .incbin "baserom.gba", 0xFB048, 0x2C -.4byte gUnknown_80FB020 - -.global gUnknown_80FB04C -gUnknown_80FB04C: @ 80FB04C -.string "{POKEMON_0} is already protected\n" -.string "by Safeguard.\0" -.align 2, 0 - -.global gUnknown_80FB074 -gUnknown_80FB074: @ 80FB074 -@ replacing .incbin "baserom.gba", 0xFB074, 0x28 -.4byte gUnknown_80FB04C - -.global gUnknown_80FB078 -gUnknown_80FB078: @ 80FB078 -.string "{POKEMON_0} gained the protection\n" -.string "of Mist!\0" -.align 2, 0 - -.global gUnknown_80FB09C -gUnknown_80FB09C: @ 80FB09C -@ replacing .incbin "baserom.gba", 0xFB09C, 0x28 -.4byte gUnknown_80FB078 - -.global gUnknown_80FB0A0 -gUnknown_80FB0A0: @ 80FB0A0 -.string "{POKEMON_0} is already protected\n" -.string "by Mist.\0" -.align 2, 0 - -.global gUnknown_80FB0C4 -gUnknown_80FB0C4: @ 80FB0C4 -@ replacing .incbin "baserom.gba", 0xFB0C4, 0x1C -.4byte gUnknown_80FB0A0 - -.global gUnknown_80FB0C8 -gUnknown_80FB0C8: @ 80FB0C8 -.string "{POKEMON_0} is set to counter!\0" -.align 2, 0 - -.global gUnknown_80FB0E0 -gUnknown_80FB0E0: @ 80FB0E0 -@ replacing .incbin "baserom.gba", 0xFB0E0, 0x2C -.4byte gUnknown_80FB0C8 - -.global gUnknown_80FB0E4 -gUnknown_80FB0E4: @ 80FB0E4 -.string "{POKEMON_0} has been waiting to\n" -.string "counterattack!\0" -.align 2, 0 - -.global gUnknown_80FB10C -gUnknown_80FB10C: @ 80FB10C -@ replacing .incbin "baserom.gba", 0xFB10C, 0x24 -.4byte gUnknown_80FB0E4 - -.global gUnknown_80FB110 -gUnknown_80FB110: @ 80FB110 -.string "{POKEMON_0} put up its light screen!\0" -.align 2, 0 - -.global gUnknown_80FB130 -gUnknown_80FB130: @ 80FB130 -@ replacing .incbin "baserom.gba", 0xFB130, 0x30 -.4byte gUnknown_80FB110 - -.global gUnknown_80FB134 -gUnknown_80FB134: @ 80FB134 -.string "{POKEMON_0} is already protected\n" -.string "by Light Screen.\0" -.align 2, 0 - -.global gUnknown_80FB160 -gUnknown_80FB160: @ 80FB160 -@ replacing .incbin "baserom.gba", 0xFB160, 0x1C -.4byte gUnknown_80FB134 - -.global gUnknown_80FB164 -gUnknown_80FB164: @ 80FB164 -.string "{POKEMON_0} put up its reflect!\0" -.align 2, 0 - -.global gUnknown_80FB17C -gUnknown_80FB17C: @ 80FB17C -@ replacing .incbin "baserom.gba", 0xFB17C, 0x2C -.4byte gUnknown_80FB164 - -.global gUnknown_80FB180 -gUnknown_80FB180: @ 80FB180 -.string "{POKEMON_0} is already protected by\n" -.string "Reflect.\0" -.align 2, 0 - -.global gUnknown_80FB1A8 -gUnknown_80FB1A8: @ 80FB1A8 -@ replacing .incbin "baserom.gba", 0xFB1A8, 0x1C -.4byte gUnknown_80FB180 - -.global gUnknown_80FB1AC -gUnknown_80FB1AC: @ 80FB1AC -.string "{POKEMON_0} recovered {VALUE_0} HP!\0" -.align 2, 0 - -.global gUnknown_80FB1C4 -gUnknown_80FB1C4: @ 80FB1C4 -@ replacing .incbin "baserom.gba", 0xFB1C4, 0x1C -.4byte gUnknown_80FB1AC - -.global gUnknown_80FB1C8 -gUnknown_80FB1C8: @ 80FB1C8 -.string "{POKEMON_0} was fully healed!\0" -.align 2, 0 - -.global gUnknown_80FB1E0 -gUnknown_80FB1E0: @ 80FB1E0 -@ replacing .incbin "baserom.gba", 0xFB1E0, 0x24 -.4byte gUnknown_80FB1C8 - -.global gUnknown_80FB1E4 -gUnknown_80FB1E4: @ 80FB1E4 -.string "{POKEMON_0}'s HP remained unchanged.\0" -.align 2, 0 - -.global gUnknown_80FB204 -gUnknown_80FB204: @ 80FB204 -@ replacing .incbin "baserom.gba", 0xFB204, 0x18 -.4byte gUnknown_80FB1E4 - -.global gUnknown_80FB208 -gUnknown_80FB208: @ 80FB208 -.string "{POKEMON_0} has full HP.\0" -.align 2, 0 - -.global gUnknown_80FB21C -gUnknown_80FB21C: @ 80FB21C -@ replacing .incbin "baserom.gba", 0xFB21C, 0x24 -.4byte gUnknown_80FB208 - -.global gUnknown_80FB220 -gUnknown_80FB220: @ 80FB220 -.string "{POKEMON_0}'s max. HP rose by {VALUE_1}.\0" -.align 2, 0 - -.global gUnknown_80FB240 -gUnknown_80FB240: @ 80FB240 -@ replacing .incbin "baserom.gba", 0xFB240, 0x1C -.4byte gUnknown_80FB220 - -.global gUnknown_80FB244 -gUnknown_80FB244: @ 80FB244 -.string "{POKEMON_0} became confused!\0" -.align 2, 0 - -.global gUnknown_80FB25C -gUnknown_80FB25C: @ 80FB25C -@ replacing .incbin "baserom.gba", 0xFB25C, 0x20 -.4byte gUnknown_80FB244 - -.global gUnknown_80FB260 -gUnknown_80FB260: @ 80FB260 -.string "{POKEMON_0} is already confused!\0" -.align 2, 0 - -.global gUnknown_80FB27C -gUnknown_80FB27C: @ 80FB27C -@ replacing .incbin "baserom.gba", 0xFB27C, 0x30 -.4byte gUnknown_80FB260 - -.global gUnknown_80FB280 -gUnknown_80FB280: @ 80FB280 -.string "{POKEMON_0} became paralyzed!\n" -.string "It can't attack!\0" -.align 2, 0 - -.global gUnknown_80FB2AC -gUnknown_80FB2AC: @ 80FB2AC -@ replacing .incbin "baserom.gba", 0xFB2AC, 0x20 -.4byte gUnknown_80FB280 - -.global gUnknown_80FB2B0 -gUnknown_80FB2B0: @ 80FB2B0 -.string "{POKEMON_0} is already paralyzed!\0" -.align 2, 0 - -.global gUnknown_80FB2CC -gUnknown_80FB2CC: @ 80FB2CC -@ replacing .incbin "baserom.gba", 0xFB2CC, 0x14 -.4byte gUnknown_80FB2B0 - -.global gUnknown_80FB2D0 -gUnknown_80FB2D0: @ 80FB2D0 -.string "{POKEMON_0} cringed!\0" -.align 2, 0 - -.global gUnknown_80FB2E0 -gUnknown_80FB2E0: @ 80FB2E0 -@ replacing .incbin "baserom.gba", 0xFB2E0, 0x20 -.4byte gUnknown_80FB2D0 - -.global gUnknown_80FB2E4 -gUnknown_80FB2E4: @ 80FB2E4 -.string "{POKEMON_0} is already cringing!\0" -.align 2, 0 - -.global gUnknown_80FB300 -gUnknown_80FB300: @ 80FB300 -@ replacing .incbin "baserom.gba", 0xFB300, 0x18 -.4byte gUnknown_80FB2E4 - -.global gUnknown_80FB304 -gUnknown_80FB304: @ 80FB304 -.string "{POKEMON_0} fell asleep!\0" -.align 2, 0 - -.global gUnknown_80FB318 -gUnknown_80FB318: @ 80FB318 -@ replacing .incbin "baserom.gba", 0xFB318, 0x4 -.4byte gUnknown_80FB304 - -.global gUnknown_80FB31C -gUnknown_80FB31C: @ 80FB31C -@ replacing .incbin "baserom.gba", 0xFB31C, 0x1C -.4byte gUnknown_80FB304 - -.global gUnknown_80FB320 -gUnknown_80FB320: @ 80FB320 -.string "{POKEMON_0} is already asleep!\0" -.align 2, 0 - -.global gUnknown_80FB338 -gUnknown_80FB338: @ 80FB338 -@ replacing .incbin "baserom.gba", 0xFB338, 0x24 -.4byte gUnknown_80FB320 - -.global gUnknown_80FB33C -gUnknown_80FB33C: @ 80FB33C -.string "{POKEMON_0} is locked in a nightmare!\0" -.align 2, 0 - -.global gUnknown_80FB35C -gUnknown_80FB35C: @ 80FB35C -@ replacing .incbin "baserom.gba", 0xFB35C, 0x4 -.4byte gUnknown_80FB33C - -.global gUnknown_80FB360 -gUnknown_80FB360: @ 80FB360 -@ replacing .incbin "baserom.gba", 0xFB360, 0x20 -.4byte gUnknown_80FB320 - -.global gUnknown_80FB364 -gUnknown_80FB364: @ 80FB364 -.string "{POKEMON_0} didn't become drowsy!\0" -.align 2, 0 - -.global gUnknown_80FB380 -gUnknown_80FB380: @ 80FB380 -@ replacing .incbin "baserom.gba", 0xFB380, 0x4 -.4byte gUnknown_80FB364 - -.global gUnknown_80FB384 -gUnknown_80FB384: @ 80FB384 -@ replacing .incbin "baserom.gba", 0xFB384, 0x4 -.4byte gUnknown_80FB320 - -.global gUnknown_80FB388 -gUnknown_80FB388: @ 80FB388 -@ replacing .incbin "baserom.gba", 0xFB388, 0x1C -.4byte gUnknown_80FB364 - -.global gUnknown_80FB38C -gUnknown_80FB38C: @ 80FB38C -.string "{POKEMON_0} had a nightmare!\0" -.align 2, 0 - -.global gUnknown_80FB3A4 -gUnknown_80FB3A4: @ 80FB3A4 -@ replacing .incbin "baserom.gba", 0xFB3A4, 0x28 -.4byte gUnknown_80FB38C - -.global gUnknown_80FB3A8 -gUnknown_80FB3A8: @ 80FB3A8 -.string "{POKEMON_0} is already having\n" -.string "a nightmare!\0" -.align 2, 0 - -.global gUnknown_80FB3CC -gUnknown_80FB3CC: @ 80FB3CC -@ replacing .incbin "baserom.gba", 0xFB3CC, 0x4 -.4byte gUnknown_80FB3A8 - -.global gUnknown_80FB3D0 -gUnknown_80FB3D0: @ 80FB3D0 -@ replacing .incbin "baserom.gba", 0xFB3D0, 0x10 -.4byte gUnknown_80FB364 - -.global gUnknown_80FB3D4 -gUnknown_80FB3D4: @ 80FB3D4 -.string "{POKEMON_0} yawned!\0" -.align 2, 0 - -.global gUnknown_80FB3E0 -gUnknown_80FB3E0: @ 80FB3E0 -@ replacing .incbin "baserom.gba", 0xFB3E0, 0x18 -.4byte gUnknown_80FB3D4 - -.global gUnknown_80FB3E4 -gUnknown_80FB3E4: @ 80FB3E4 -.string "{POKEMON_0} didn't yawn!\0" -.align 2, 0 - -.global gUnknown_80FB3F8 -gUnknown_80FB3F8: @ 80FB3F8 -@ replacing .incbin "baserom.gba", 0xFB3F8, 0x1C -.4byte gUnknown_80FB3E4 - -.global gUnknown_80FB3FC -gUnknown_80FB3FC: @ 80FB3FC -.string "{POKEMON_0} is already yawning!\0" -.align 2, 0 - -.global gUnknown_80FB414 -gUnknown_80FB414: @ 80FB414 -@ replacing .incbin "baserom.gba", 0xFB414, 0x4 -.4byte gUnknown_80FB3FC - -.global gUnknown_80FB418 -gUnknown_80FB418: @ 80FB418 -@ replacing .incbin "baserom.gba", 0xFB418, 0x4 -.4byte gUnknown_80FB320 - -.global gUnknown_80FB41C -gUnknown_80FB41C: @ 80FB41C -@ replacing .incbin "baserom.gba", 0xFB41C, 0x20 -.4byte gUnknown_80FA6D8 - -.global gUnknown_80FB420 -gUnknown_80FB420: @ 80FB420 -.string "{POKEMON_0} is already sleepless!\0" -.align 2, 0 - -.global gUnknown_80FB43C -gUnknown_80FB43C: @ 80FB43C -@ replacing .incbin "baserom.gba", 0xFB43C, 0x1C -.4byte gUnknown_80FB420 - -.global gUnknown_80FB440 -gUnknown_80FB440: @ 80FB440 -.string "{POKEMON_0} became sleepless!\0" -.align 2, 0 - -.global gUnknown_80FB458 -gUnknown_80FB458: @ 80FB458 -@ replacing .incbin "baserom.gba", 0xFB458, 0x28 -.4byte gUnknown_80FB440 - -.global gUnknown_80FB45C -gUnknown_80FB45C: @ 80FB45C -.string "{POKEMON_0} can't move on the next turn!\0" -.align 2, 0 - -.global gUnknown_80FB480 -gUnknown_80FB480: @ 80FB480 -@ replacing .incbin "baserom.gba", 0xFB480, 0x30 -.4byte gUnknown_80FB45C - -.global gUnknown_80FB484 -gUnknown_80FB484: @ 80FB484 -.string "{POKEMON_0} already can't move on\n" -.string "the next turn!\0" -.align 2, 0 - -.global gUnknown_80FB4B0 -gUnknown_80FB4B0: @ 80FB4B0 -@ replacing .incbin "baserom.gba", 0xFB4B0, 0x24 -.4byte gUnknown_80FB484 - -.global gUnknown_80FB4B4 -gUnknown_80FB4B4: @ 80FB4B4 -.string "{POKEMON_0} can't move for a while!\0" -.align 2, 0 - -.global gUnknown_80FB4D4 -gUnknown_80FB4D4: @ 80FB4D4 -@ replacing .incbin "baserom.gba", 0xFB4D4, 0x1C -.4byte gUnknown_80FB4B4 - -.global gUnknown_80FB4D8 -gUnknown_80FB4D8: @ 80FB4D8 -.string "{POKEMON_0} is already paused!\0" -.align 2, 0 - -.global gUnknown_80FB4F0 -gUnknown_80FB4F0: @ 80FB4F0 -@ replacing .incbin "baserom.gba", 0xFB4F0, 0x1C -.4byte gUnknown_80FB4D8 - -.global gUnknown_80FB4F4 -gUnknown_80FB4F4: @ 80FB4F4 -.string "{POKEMON_0} became infatuated!\0" -.align 2, 0 - -.global gUnknown_80FB50C -gUnknown_80FB50C: @ 80FB50C -@ replacing .incbin "baserom.gba", 0xFB50C, 0x20 -.4byte gUnknown_80FB4F4 - -.global gUnknown_80FB510 -gUnknown_80FB510: @ 80FB510 -.string "{POKEMON_0} is already infatuated!\0" -.align 2, 0 - -.global gUnknown_80FB52C -gUnknown_80FB52C: @ 80FB52C -@ replacing .incbin "baserom.gba", 0xFB52C, 0x1C -.4byte gUnknown_80FB510 - -.global gUnknown_80FB530 -gUnknown_80FB530: @ 80FB530 -.string "{POKEMON_0} sustained a burn!\0" -.align 2, 0 - -.global gUnknown_80FB548 -gUnknown_80FB548: @ 80FB548 -@ replacing .incbin "baserom.gba", 0xFB548, 0x1C -.4byte gUnknown_80FB530 - -.global gUnknown_80FB54C -gUnknown_80FB54C: @ 80FB54C -.string "{POKEMON_0} already has a burn!\0" -.align 2, 0 - -.global gUnknown_80FB564 -gUnknown_80FB564: @ 80FB564 -@ replacing .incbin "baserom.gba", 0xFB564, 0x1C -.4byte gUnknown_80FB54C - -.global gUnknown_80FB568 -gUnknown_80FB568: @ 80FB568 -.string "But nothing happened.\0" -.align 2, 0 - -.global gUnknown_80FB580 -gUnknown_80FB580: @ 80FB580 -@ replacing .incbin "baserom.gba", 0xFB580, 0x18 -.4byte gUnknown_80FB568 - -.global gUnknown_80FB584 -gUnknown_80FB584: @ 80FB584 -.string "{POKEMON_0} was poisoned!\0" -.align 2, 0 - -.global gUnknown_80FB598 -gUnknown_80FB598: @ 80FB598 -@ replacing .incbin "baserom.gba", 0xFB598, 0x1C -.4byte gUnknown_80FB584 - -.global gUnknown_80FB59C -gUnknown_80FB59C: @ 80FB59C -.string "{POKEMON_0} was badly poisoned!\0" -.align 2, 0 - -.global gUnknown_80FB5B4 -gUnknown_80FB5B4: @ 80FB5B4 -@ replacing .incbin "baserom.gba", 0xFB5B4, 0x20 -.4byte gUnknown_80FB59C - -.global gUnknown_80FB5B8 -gUnknown_80FB5B8: @ 80FB5B8 -.string "{POKEMON_0} is already poisoned!\0" -.align 2, 0 - -.global gUnknown_80FB5D4 -gUnknown_80FB5D4: @ 80FB5D4 -@ replacing .incbin "baserom.gba", 0xFB5D4, 0x24 -.4byte gUnknown_80FB5B8 - -.global gUnknown_80FB5D8 -gUnknown_80FB5D8: @ 80FB5D8 -.string "{POKEMON_0} is already badly poisoned!\0" -.align 2, 0 - -.global gUnknown_80FB5F8 -gUnknown_80FB5F8: @ 80FB5F8 -@ replacing .incbin "baserom.gba", 0xFB5F8, 0x18 -.4byte gUnknown_80FB5D8 - -.global gUnknown_80FB5FC -gUnknown_80FB5FC: @ 80FB5FC -.string "{POKEMON_0} became frozen!\0" -.align 2, 0 - -.global gUnknown_80FB610 -gUnknown_80FB610: @ 80FB610 -@ replacing .incbin "baserom.gba", 0xFB610, 0x18 -.4byte gUnknown_80FB5FC - -.global gUnknown_80FB614 -gUnknown_80FB614: @ 80FB614 -.string "{POKEMON_0} was squeezed!\0" -.align 2, 0 - -.global gUnknown_80FB628 -gUnknown_80FB628: @ 80FB628 -@ replacing .incbin "baserom.gba", 0xFB628, 0x24 -.4byte gUnknown_80FB614 - -.global gUnknown_80FB62C -gUnknown_80FB62C: @ 80FB62C -.string "{POKEMON_0} is already being squeezed!\0" -.align 2, 0 - -.global gUnknown_80FB64C -gUnknown_80FB64C: @ 80FB64C -@ replacing .incbin "baserom.gba", 0xFB64C, 0x1C -.4byte gUnknown_80FB62C - -.global gUnknown_80FB650 -gUnknown_80FB650: @ 80FB650 -.string "{POKEMON_0} became immobilized!\0" -.align 2, 0 - -.global gUnknown_80FB668 -gUnknown_80FB668: @ 80FB668 -@ replacing .incbin "baserom.gba", 0xFB668, 0x20 -.4byte gUnknown_80FB650 - -.global gUnknown_80FB66C -gUnknown_80FB66C: @ 80FB66C -.string "{POKEMON_0} is already immobilized!\0" -.align 2, 0 - -.global gUnknown_80FB688 -gUnknown_80FB688: @ 80FB688 -@ replacing .incbin "baserom.gba", 0xFB688, 0x1C -.4byte gUnknown_80FB66C - -.global gUnknown_80FB68C -gUnknown_80FB68C: @ 80FB68C -.string "{POKEMON_0} put down its roots!\0" -.align 2, 0 - -.global gUnknown_80FB6A4 -gUnknown_80FB6A4: @ 80FB6A4 -@ replacing .incbin "baserom.gba", 0xFB6A4, 0x1C -.4byte gUnknown_80FB68C - -.global gUnknown_80FB6A8 -gUnknown_80FB6A8: @ 80FB6A8 -.string "{POKEMON_0} is already rooted!\0" -.align 2, 0 - -.global gUnknown_80FB6C0 -gUnknown_80FB6C0: @ 80FB6C0 -@ replacing .incbin "baserom.gba", 0xFB6C0, 0x18 -.4byte gUnknown_80FB6A8 - -.global gUnknown_80FB6C4 -gUnknown_80FB6C4: @ 80FB6C4 -.string "{POKEMON_0} became wrapped!\0" -.align 2, 0 - -.global gUnknown_80FB6D8 -gUnknown_80FB6D8: @ 80FB6D8 -@ replacing .incbin "baserom.gba", 0xFB6D8, 0x24 -.4byte gUnknown_80FB6C4 - -.global gUnknown_80FB6DC -gUnknown_80FB6DC: @ 80FB6DC -.string "{POKEMON_0} has a foe wrapped already!\0" -.align 2, 0 - -.global gUnknown_80FB6FC -gUnknown_80FB6FC: @ 80FB6FC -@ replacing .incbin "baserom.gba", 0xFB6FC, 0x1C -.4byte gUnknown_80FB6DC - -.global gUnknown_80FB700 -gUnknown_80FB700: @ 80FB700 -.string "{POKEMON_0} is already wrapped!\0" -.align 2, 0 - -.global gUnknown_80FB718 -gUnknown_80FB718: @ 80FB718 -@ replacing .incbin "baserom.gba", 0xFB718, 0x24 -.4byte gUnknown_80FB700 - -.global gUnknown_80FB71C -gUnknown_80FB71C: @ 80FB71C -.string "{POKEMON_0} attained Sure Shot status!\0" -.align 2, 0 - -.global gUnknown_80FB73C -gUnknown_80FB73C: @ 80FB73C -@ replacing .incbin "baserom.gba", 0xFB73C, 0x28 -.4byte gUnknown_80FB71C - -.global gUnknown_80FB740 -gUnknown_80FB740: @ 80FB740 -.string "{POKEMON_0} already has Sure Shot\n" -.string "status!\0" -.align 2, 0 - -.global gUnknown_80FB764 -gUnknown_80FB764: @ 80FB764 -@ replacing .incbin "baserom.gba", 0xFB764, 0x1C -.4byte gUnknown_80FB740 - -.global gUnknown_80FB768 -gUnknown_80FB768: @ 80FB768 -.string "{POKEMON_0} became a whiffer!\0" -.align 2, 0 - -.global gUnknown_80FB780 -gUnknown_80FB780: @ 80FB780 -@ replacing .incbin "baserom.gba", 0xFB780, 0x20 -.4byte gUnknown_80FB768 - -.global gUnknown_80FB784 -gUnknown_80FB784: @ 80FB784 -.string "{POKEMON_0} is already a whiffer!\0" -.align 2, 0 - -.global gUnknown_80FB7A0 -gUnknown_80FB7A0: @ 80FB7A0 -@ replacing .incbin "baserom.gba", 0xFB7A0, 0x1C -.4byte gUnknown_80FB784 - -.global gUnknown_80FB7A4 -gUnknown_80FB7A4: @ 80FB7A4 -.string "{POKEMON_0} became petrified!\0" -.align 2, 0 - -.global gUnknown_80FB7BC -gUnknown_80FB7BC: @ 80FB7BC -@ replacing .incbin "baserom.gba", 0xFB7BC, 0x20 -.4byte gUnknown_80FB7A4 - -.global gUnknown_80FB7C0 -gUnknown_80FB7C0: @ 80FB7C0 -.string "{POKEMON_0} is already petrified!\0" -.align 2, 0 - -.global gUnknown_80FB7DC -gUnknown_80FB7DC: @ 80FB7DC -@ replacing .incbin "baserom.gba", 0xFB7DC, 0x18 -.4byte gUnknown_80FB7C0 - -.global gUnknown_80FB7E0 -gUnknown_80FB7E0: @ 80FB7E0 -.string "{POKEMON_0} was blinded!\0" -.align 2, 0 - -.global gUnknown_80FB7F4 -gUnknown_80FB7F4: @ 80FB7F4 -@ replacing .incbin "baserom.gba", 0xFB7F4, 0x1C -.4byte gUnknown_80FB7E0 - -.global gUnknown_80FB7F8 -gUnknown_80FB7F8: @ 80FB7F8 -.string "{POKEMON_0} is already blinded!\0" -.align 2, 0 - -.global gUnknown_80FB810 -gUnknown_80FB810: @ 80FB810 -@ replacing .incbin "baserom.gba", 0xFB810, 0x24 -.4byte gUnknown_80FB7F8 - -.global gUnknown_80FB814 -gUnknown_80FB814: @ 80FB814 -.string "{POKEMON_0}'s vision turned weird!\0" -.align 2, 0 - -.global gUnknown_80FB834 -gUnknown_80FB834: @ 80FB834 -@ replacing .incbin "baserom.gba", 0xFB834, 0x28 -.4byte gUnknown_80FB814 - -.global gUnknown_80FB838 -gUnknown_80FB838: @ 80FB838 -.string "{POKEMON_0}'s vision is already weird!\0" -.align 2, 0 - -.global gUnknown_80FB85C -gUnknown_80FB85C: @ 80FB85C -@ replacing .incbin "baserom.gba", 0xFB85C, 0x24 -.4byte gUnknown_80FB838 - -.global gUnknown_80FB860 -gUnknown_80FB860: @ 80FB860 -.string "{POKEMON_0}'s vision was restored!\0" -.align 2, 0 - -.global gUnknown_80FB880 -gUnknown_80FB880: @ 80FB880 -@ replacing .incbin "baserom.gba", 0xFB880, 0x1C -.4byte gUnknown_80FB860 - -.global gUnknown_80FB884 -gUnknown_80FB884: @ 80FB884 -.string "{POKEMON_0}'s vision is fine!\0" -.align 2, 0 - -.global gUnknown_80FB89C -gUnknown_80FB89C: @ 80FB89C -@ replacing .incbin "baserom.gba", 0xFB89C, 0x20 -.4byte gUnknown_80FB884 - -.global gUnknown_80FB8A0 -gUnknown_80FB8A0: @ 80FB8A0 -.string "{POKEMON_0}'s damage was fixed!\0" -.align 2, 0 - -.global gUnknown_80FB8BC -gUnknown_80FB8BC: @ 80FB8BC -@ replacing .incbin "baserom.gba", 0xFB8BC, 0x28 -.4byte gUnknown_80FB8A0 - -.global gUnknown_80FB8C0 -gUnknown_80FB8C0: @ 80FB8C0 -.string "{POKEMON_0}'s damage is already fixed!\0" -.align 2, 0 - -.global gUnknown_80FB8E4 -gUnknown_80FB8E4: @ 80FB8E4 -@ replacing .incbin "baserom.gba", 0xFB8E4, 0x1C -.4byte gUnknown_80FB8C0 - -.global gUnknown_80FB8E8 -gUnknown_80FB8E8: @ 80FB8E8 -.string "{POKEMON_0} is getting pumped!\0" -.align 2, 0 - -.global gUnknown_80FB900 -gUnknown_80FB900: @ 80FB900 -@ replacing .incbin "baserom.gba", 0xFB900, 0x24 -.4byte gUnknown_80FB8E8 - -.global gUnknown_80FB904 -gUnknown_80FB904: @ 80FB904 -.string "{POKEMON_0} is already getting pumped!\0" -.align 2, 0 - -.global gUnknown_80FB924 -gUnknown_80FB924: @ 80FB924 -@ replacing .incbin "baserom.gba", 0xFB924, 0x1C -.4byte gUnknown_80FB904 - -.global gUnknown_80FB928 -gUnknown_80FB928: @ 80FB928 -.string "{POKEMON_0} cowered in fear!\0" -.align 2, 0 - -.global gUnknown_80FB940 -gUnknown_80FB940: @ 80FB940 -@ replacing .incbin "baserom.gba", 0xFB940, 0x20 -.4byte gUnknown_80FB928 - -.global gUnknown_80FB944 -gUnknown_80FB944: @ 80FB944 -.string "{POKEMON_0} is already cowering!\0" -.align 2, 0 - -.global gUnknown_80FB960 -gUnknown_80FB960: @ 80FB960 -@ replacing .incbin "baserom.gba", 0xFB960, 0x18 -.4byte gUnknown_80FB944 - -.global gUnknown_80FB964 -gUnknown_80FB964: @ 80FB964 -.string "{POKEMON_0} became a decoy!\0" -.align 2, 0 - -.global gUnknown_80FB978 -gUnknown_80FB978: @ 80FB978 -@ replacing .incbin "baserom.gba", 0xFB978, 0x1C -.4byte gUnknown_80FB964 - -.global gUnknown_80FB97C -gUnknown_80FB97C: @ 80FB97C -.string "{POKEMON_0} is already a decoy!\0" -.align 2, 0 - -.global gUnknown_80FB994 -gUnknown_80FB994: @ 80FB994 -@ replacing .incbin "baserom.gba", 0xFB994, 0x1C -.4byte gUnknown_80FB97C - -.global gUnknown_80FB998 -gUnknown_80FB998: @ 80FB998 -.string "{POKEMON_0} protected itself!\0" -.align 2, 0 - -.global gUnknown_80FB9B0 -gUnknown_80FB9B0: @ 80FB9B0 -@ replacing .incbin "baserom.gba", 0xFB9B0, 0x28 -.4byte gUnknown_80FB998 - -.global gUnknown_80FB9B4 -gUnknown_80FB9B4: @ 80FB9B4 -.string "{POKEMON_0} is already protecting itself!\0" -.align 2, 0 - -.global gUnknown_80FB9D8 -gUnknown_80FB9D8: @ 80FB9D8 -@ replacing .incbin "baserom.gba", 0xFB9D8, 0x18 -.4byte gUnknown_80FB9B4 - -.global gUnknown_80FB9DC -gUnknown_80FB9DC: @ 80FB9DC -.string "{POKEMON_0} was taunted!\0" -.align 2, 0 - -.global gUnknown_80FB9F0 -gUnknown_80FB9F0: @ 80FB9F0 -@ replacing .incbin "baserom.gba", 0xFB9F0, 0x24 -.4byte gUnknown_80FB9DC - -.global gUnknown_80FB9F4 -gUnknown_80FB9F4: @ 80FB9F4 -.string "{POKEMON_0} has been taunted already!\0" -.align 2, 0 - -.global gUnknown_80FBA14 -gUnknown_80FBA14: @ 80FBA14 -@ replacing .incbin "baserom.gba", 0xFBA14, 0x24 -.4byte gUnknown_80FB9F4 - -.global gUnknown_80FBA18 -gUnknown_80FBA18: @ 80FBA18 -.string "{POKEMON_0} stored power {VALUE_0} time(s)!\0" -.align 2, 0 - -.global gUnknown_80FBA38 -gUnknown_80FBA38: @ 80FBA38 -@ replacing .incbin "baserom.gba", 0xFBA38, 0x28 -.4byte gUnknown_80FBA18 - -.global gUnknown_80FBA3C -gUnknown_80FBA3C: @ 80FBA3C -.string "{POKEMON_0} can't store any more power!\0" -.align 2, 0 - -.global gUnknown_80FBA60 -gUnknown_80FBA60: @ 80FBA60 -@ replacing .incbin "baserom.gba", 0xFBA60, 0x20 -.4byte gUnknown_80FBA3C - -.global gUnknown_80FBA64 -gUnknown_80FBA64: @ 80FBA64 -.string "{POKEMON_0} disappeared from view!\0" -.align 2, 0 - -.global gUnknown_80FBA80 -gUnknown_80FBA80: @ 80FBA80 -@ replacing .incbin "baserom.gba", 0xFBA80, 0x20 -.4byte gUnknown_80FBA64 - -.global gUnknown_80FBA84 -gUnknown_80FBA84: @ 80FBA84 -.string "{POKEMON_0} is invisible already!\0" -.align 2, 0 - -.global gUnknown_80FBAA0 -gUnknown_80FBAA0: @ 80FBAA0 -@ replacing .incbin "baserom.gba", 0xFBAA0, 0x20 -.4byte gUnknown_80FBA84 - -.global gUnknown_80FBAA4 -gUnknown_80FBAA4: @ 80FBAA4 -.string "{POKEMON_0} put up its mirror coat!\0" -.align 2, 0 - -.global gUnknown_80FBAC0 -gUnknown_80FBAC0: @ 80FBAC0 -@ replacing .incbin "baserom.gba", 0xFBAC0, 0x24 -.4byte gUnknown_80FBAA4 - -.global gUnknown_80FBAC4 -gUnknown_80FBAC4: @ 80FBAC4 -.string "{POKEMON_0} already has a mirror coat!\0" -.align 2, 0 - -.global gUnknown_80FBAE4 -gUnknown_80FBAE4: @ 80FBAE4 -@ replacing .incbin "baserom.gba", 0xFBAE4, 0x20 -.4byte gUnknown_80FBAC4 - -.global gUnknown_80FBAE8 -gUnknown_80FBAE8: @ 80FBAE8 -.string "{POKEMON_0} heard the perish song!\0" -.align 2, 0 - -.global gUnknown_80FBB04 -gUnknown_80FBB04: @ 80FBB04 -@ replacing .incbin "baserom.gba", 0xFBB04, 0x24 -.4byte gUnknown_80FBAE8 - -.global gUnknown_80FBB08 -gUnknown_80FBB08: @ 80FBB08 -.string "{POKEMON_0} already heard that song!\0" -.align 2, 0 - -.global gUnknown_80FBB28 -gUnknown_80FBB28: @ 80FBB28 -@ replacing .incbin "baserom.gba", 0xFBB28, 0x24 -.4byte gUnknown_80FBB08 - -.global gUnknown_80FBB2C -gUnknown_80FBB2C: @ 80FBB2C -.string "{POKEMON_0} readied its Destiny Bond!\0" -.align 2, 0 - -.global gUnknown_80FBB4C -gUnknown_80FBB4C: @ 80FBB4C -@ replacing .incbin "baserom.gba", 0xFBB4C, 0x2C -.4byte gUnknown_80FBB2C - -.global gUnknown_80FBB50 -gUnknown_80FBB50: @ 80FBB50 -.string "{POKEMON_0} already has Destiny Bond\n" -.string "readied!\0" -.align 2, 0 - -.global gUnknown_80FBB78 -gUnknown_80FBB78: @ 80FBB78 -@ replacing .incbin "baserom.gba", 0xFBB78, 0x1C -.4byte gUnknown_80FBB50 - -.global gUnknown_80FBB7C -gUnknown_80FBB7C: @ 80FBB7C -.string "{POKEMON_0} earned an encore!\0" -.align 2, 0 - -.global gUnknown_80FBB94 -gUnknown_80FBB94: @ 80FBB94 -@ replacing .incbin "baserom.gba", 0xFBB94, 0x24 -.4byte gUnknown_80FBB7C - -.global gUnknown_80FBB98 -gUnknown_80FBB98: @ 80FBB98 -.string "{POKEMON_0} is already doing encores!\0" -.align 2, 0 - -.global gUnknown_80FBBB8 -gUnknown_80FBBB8: @ 80FBBB8 -@ replacing .incbin "baserom.gba", 0xFBBB8, 0x1C -.4byte gUnknown_80FBB98 - -.global gUnknown_80FBBBC -gUnknown_80FBBBC: @ 80FBBBC -.string "{POKEMON_0} won't do encores!\0" -.align 2, 0 - -.global gUnknown_80FBBD4 -gUnknown_80FBBD4: @ 80FBBD4 -@ replacing .incbin "baserom.gba", 0xFBBD4, 0x1C -.4byte gUnknown_80FBBBC - -.global gUnknown_80FBBD8 -gUnknown_80FBBD8: @ 80FBBD8 -.string "{POKEMON_0} is set to endure!\0" -.align 2, 0 - -.global gUnknown_80FBBF0 -gUnknown_80FBBF0: @ 80FBBF0 -@ replacing .incbin "baserom.gba", 0xFBBF0, 0x24 -.4byte gUnknown_80FBBD8 - -.global gUnknown_80FBBF4 -gUnknown_80FBBF4: @ 80FBBF4 -.string "{POKEMON_0} is already set to endure!\0" -.align 2, 0 - -.global gUnknown_80FBC14 -gUnknown_80FBC14: @ 80FBC14 -@ replacing .incbin "baserom.gba", 0xFBC14, 0x24 -.4byte gUnknown_80FBBF4 - -.global gUnknown_80FBC18 -gUnknown_80FBC18: @ 80FBC18 -.string "{POKEMON_0} readied its Mirror Move!\0" -.align 2, 0 - -.global gUnknown_80FBC38 -gUnknown_80FBC38: @ 80FBC38 -@ replacing .incbin "baserom.gba", 0xFBC38, 0x24 -.4byte gUnknown_80FBC18 - -.global gUnknown_80FBC3C -gUnknown_80FBC3C: @ 80FBC3C -.string "{POKEMON_0} already used Mirror Move!\0" -.align 2, 0 - -.global gUnknown_80FBC5C -gUnknown_80FBC5C: @ 80FBC5C -@ replacing .incbin "baserom.gba", 0xFBC5C, 0x20 -.4byte gUnknown_80FBC3C - -.global gUnknown_80FBC60 -gUnknown_80FBC60: @ 80FBC60 -.string "{POKEMON_0} has Conversion 2 up!\0" -.align 2, 0 - -.global gUnknown_80FBC7C -gUnknown_80FBC7C: @ 80FBC7C -@ replacing .incbin "baserom.gba", 0xFBC7C, 0x28 -.4byte gUnknown_80FBC60 - -.global gUnknown_80FBC80 -gUnknown_80FBC80: @ 80FBC80 -.string "{POKEMON_0} already has Conversion 2 up!\0" -.align 2, 0 - -.global gUnknown_80FBCA4 -gUnknown_80FBCA4: @ 80FBCA4 -@ replacing .incbin "baserom.gba", 0xFBCA4, 0x24 -.4byte gUnknown_80FBC80 - -.global gUnknown_80FBCA8 -gUnknown_80FBCA8: @ 80FBCA8 -.string "{POKEMON_0} readied its Vital Throw!\0" -.align 2, 0 - -.global gUnknown_80FBCC8 -gUnknown_80FBCC8: @ 80FBCC8 -@ replacing .incbin "baserom.gba", 0xFBCC8, 0x28 -.4byte gUnknown_80FBCA8 - -.global gUnknown_80FBCCC -gUnknown_80FBCCC: @ 80FBCCC -.string "{POKEMON_0} is already set for\n" -.string "Vital Throw!\0" -.align 2, 0 - -.global gUnknown_80FBCF0 -gUnknown_80FBCF0: @ 80FBCF0 -@ replacing .incbin "baserom.gba", 0xFBCF0, 0x28 -.4byte gUnknown_80FBCCC - -.global gUnknown_80FBCF4 -gUnknown_80FBCF4: @ 80FBCF4 -.string "{POKEMON_0}'s stats returned to normal.\0" -.align 2, 0 - -.global gUnknown_80FBD18 -gUnknown_80FBD18: @ 80FBD18 -@ replacing .incbin "baserom.gba", 0xFBD18, 0x24 -.4byte gUnknown_80FBCF4 - -.global gUnknown_80FBD1C -gUnknown_80FBD1C: @ 80FBD1C -.string "{POKEMON_0}'s stats appear unchanged.\0" -.align 2, 0 - -.global gUnknown_80FBD3C -gUnknown_80FBD3C: @ 80FBD3C -@ replacing .incbin "baserom.gba", 0xFBD3C, 0x1C -.4byte gUnknown_80FBD1C - -.global gUnknown_80FBD40 -gUnknown_80FBD40: @ 80FBD40 -.string "It psyched itself up!\0" -.align 2, 0 - -.global gUnknown_80FBD58 -gUnknown_80FBD58: @ 80FBD58 -@ replacing .incbin "baserom.gba", 0xFBD58, 0x20 -.4byte gUnknown_80FBD40 - -.global gUnknown_80FBD5C -gUnknown_80FBD5C: @ 80FBD5C -.string "{POKEMON_0}'s Belly went down.\0" -.align 2, 0 - -.global gUnknown_80FBD78 -gUnknown_80FBD78: @ 80FBD78 -@ replacing .incbin "baserom.gba", 0xFBD78, 0x24 -.4byte gUnknown_80FBD5C - -.global gUnknown_80FBD7C -gUnknown_80FBD7C: @ 80FBD7C -.string "{POKEMON_0}'s max. Belly size shrank!\0" -.align 2, 0 - -.global gUnknown_80FBD9C -gUnknown_80FBD9C: @ 80FBD9C -@ replacing .incbin "baserom.gba", 0xFBD9C, 0x28 -.4byte gUnknown_80FBD7C - -.global gUnknown_80FBDA0 -gUnknown_80FBDA0: @ 80FBDA0 -.string "{POKEMON_0}'s max. Belly size increased!\0" -.align 2, 0 - -.global gUnknown_80FBDC4 -gUnknown_80FBDC4: @ 80FBDC4 -@ replacing .incbin "baserom.gba", 0xFBDC4, 0x2C -.4byte gUnknown_80FBDA0 - -.global gUnknown_80FBDC8 -gUnknown_80FBDC8: @ 80FBDC8 -.string "{POKEMON_0}'s Belly won't get any bigger!\0" -.align 2, 0 - -.global gUnknown_80FBDF0 -gUnknown_80FBDF0: @ 80FBDF0 -@ replacing .incbin "baserom.gba", 0xFBDF0, 0x24 -.4byte gUnknown_80FBDC8 - -.global gUnknown_80FBDF4 -gUnknown_80FBDF4: @ 80FBDF4 -.string "{POKEMON_0}'s Belly didn't change!\0" -.align 2, 0 - -.global gUnknown_80FBE14 -gUnknown_80FBE14: @ 80FBE14 -@ replacing .incbin "baserom.gba", 0xFBE14, 0x28 -.4byte gUnknown_80FBDF4 - -.global gUnknown_80FBE18 -gUnknown_80FBE18: @ 80FBE18 -.string "{POKEMON_0}'s Belly size didn't change!\0" -.align 2, 0 - -.global gUnknown_80FBE3C -gUnknown_80FBE3C: @ 80FBE3C -@ replacing .incbin "baserom.gba", 0xFBE3C, 0x4 -.4byte gUnknown_80FBE18 - -.global gUnknown_80FBE40 -gUnknown_80FBE40: @ 80FBE40 -@ replacing .incbin "baserom.gba", 0xFBE40, 0x24 -.4byte gUnknown_80FBDF4 - -.global gUnknown_80FBE44 -gUnknown_80FBE44: @ 80FBE44 -.string "{POKEMON_0}'s Belly filled up full!\0" -.align 2, 0 - -.global gUnknown_80FBE64 -gUnknown_80FBE64: @ 80FBE64 -@ replacing .incbin "baserom.gba", 0xFBE64, 0x20 -.4byte gUnknown_80FBE44 - -.global gUnknown_80FBE68 -gUnknown_80FBE68: @ 80FBE68 -.string "{POKEMON_0}'s Belly was filled!\0" -.align 2, 0 - -.global gUnknown_80FBE84 -gUnknown_80FBE84: @ 80FBE84 -@ replacing .incbin "baserom.gba", 0xFBE84, 0x1C -.4byte gUnknown_80FBE68 - -.global gUnknown_80FBE88 -gUnknown_80FBE88: @ 80FBE88 -.string "{POKEMON_0}'s Belly dropped!\0" -.align 2, 0 - -.global gUnknown_80FBEA0 -gUnknown_80FBEA0: @ 80FBEA0 -@ replacing .incbin "baserom.gba", 0xFBEA0, 0x20 -.4byte gUnknown_80FBE88 - -.global gUnknown_80FBEA4 -gUnknown_80FBEA4: @ 80FBEA4 -.string "{POKEMON_0} transformed into\n" -.string "{POKEMON_1}!\0" -.align 2, 0 - -.global gUnknown_80FBEC0 -gUnknown_80FBEC0: @ 80FBEC0 -@ replacing .incbin "baserom.gba", 0xFBEC0, 0x24 -.4byte gUnknown_80FBEA4 - -.global gUnknown_80FBEC4 -gUnknown_80FBEC4: @ 80FBEC4 -.string "{POKEMON_0}'s transformation failed!\0" -.align 2, 0 - -.global gUnknown_80FBEE4 -gUnknown_80FBEE4: @ 80FBEE4 -@ replacing .incbin "baserom.gba", 0xFBEE4, 0x20 -.4byte gUnknown_80FBEC4 - -.global gUnknown_80FBEE8 -gUnknown_80FBEE8: @ 80FBEE8 -.string "{POKEMON_0} is already transformed.\0" -.align 2, 0 - -.global gUnknown_80FBF04 -gUnknown_80FBF04: @ 80FBF04 -@ replacing .incbin "baserom.gba", 0xFBF04, 0x24 -.4byte gUnknown_80FBEE8 - -.global gUnknown_80FBF08 -gUnknown_80FBF08: @ 80FBF08 -.string "{POKEMON_0} can go through walls now!\0" -.align 2, 0 - -.global gUnknown_80FBF28 -gUnknown_80FBF28: @ 80FBF28 -@ replacing .incbin "baserom.gba", 0xFBF28, 0x28 -.4byte gUnknown_80FBF08 - -.global gUnknown_80FBF2C -gUnknown_80FBF2C: @ 80FBF2C -.string "{POKEMON_0} can already go through walls!\0" -.align 2, 0 - -.global gUnknown_80FBF50 -gUnknown_80FBF50: @ 80FBF50 -@ replacing .incbin "baserom.gba", 0xFBF50, 0x18 -.4byte gUnknown_80FBF2C - -.global gUnknown_80FBF54 -gUnknown_80FBF54: @ 80FBF54 -.string "{POKEMON_0} became muzzled!\0" -.align 2, 0 - -.global gUnknown_80FBF68 -gUnknown_80FBF68: @ 80FBF68 -@ replacing .incbin "baserom.gba", 0xFBF68, 0x1C -.4byte gUnknown_80FBF54 - -.global gUnknown_80FBF6C -gUnknown_80FBF6C: @ 80FBF6C -.string "{POKEMON_0} is already muzzled!\0" -.align 2, 0 - -.global gUnknown_80FBF84 -gUnknown_80FBF84: @ 80FBF84 -@ replacing .incbin "baserom.gba", 0xFBF84, 0x18 -.4byte gUnknown_80FBF6C - -.global gUnknown_80FBF88 -gUnknown_80FBF88: @ 80FBF88 -.string "{POKEMON_0} was exposed!\0" -.align 2, 0 - -.global gUnknown_80FBF9C -gUnknown_80FBF9C: @ 80FBF9C -@ replacing .incbin "baserom.gba", 0xFBF9C, 0x1C -.4byte gUnknown_80FBF88 - -.global gUnknown_80FBFA0 -gUnknown_80FBFA0: @ 80FBFA0 -.string "{POKEMON_0} is already exposed!\0" -.align 2, 0 - -.global gUnknown_80FBFB8 -gUnknown_80FBFB8: @ 80FBFB8 -@ replacing .incbin "baserom.gba", 0xFBFB8, 0x20 -.4byte gUnknown_80FBFA0 - -.global gUnknown_80FBFBC -gUnknown_80FBFBC: @ 80FBFBC -.string "{POKEMON_0} isn't a Ghost type!\0" -.align 2, 0 - -.global gUnknown_80FBFD8 -gUnknown_80FBFD8: @ 80FBFD8 -@ replacing .incbin "baserom.gba", 0xFBFD8, 0x28 -.4byte gUnknown_80FBFBC - -.global gUnknown_80FBFDC -gUnknown_80FBFDC: @ 80FBFDC -.string "{POKEMON_0}'s Evasion returned to normal!\0" -.align 2, 0 - -.global gUnknown_80FC000 -gUnknown_80FC000: @ 80FC000 -@ replacing .incbin "baserom.gba", 0xFC000, 0x28 -.4byte gUnknown_80FBFDC - -.global gUnknown_80FC004 -gUnknown_80FC004: @ 80FC004 -.string "Item holders are now identified!\0" -.align 2, 0 - -.global gUnknown_80FC028 -gUnknown_80FC028: @ 80FC028 -@ replacing .incbin "baserom.gba", 0xFC028, 0x2C -.4byte gUnknown_80FC004 - -.global gUnknown_80FC02C -gUnknown_80FC02C: @ 80FC02C -.string "It can already identify item holders.\0" -.align 2, 0 - -.global gUnknown_80FC054 -gUnknown_80FC054: @ 80FC054 -@ replacing .incbin "baserom.gba", 0xFC054, 0x20 -.4byte gUnknown_80FC02C - -.global gUnknown_80FC058 -gUnknown_80FC058: @ 80FC058 -.string "{POKEMON_0} is already in a rage!\0" -.align 2, 0 - -.global gUnknown_80FC074 -gUnknown_80FC074: @ 80FC074 -@ replacing .incbin "baserom.gba", 0xFC074, 0x10 -.4byte gUnknown_80FC058 - -.global gUnknown_80FC078 -gUnknown_80FC078: @ 80FC078 -.string "Accuracy\0" -.align 2, 0 - -.global gUnknown_80FC084 -gUnknown_80FC084: @ 80FC084 -@ replacing .incbin "baserom.gba", 0xFC084, 0xC -.4byte gUnknown_80FC078 - -.global gUnknown_80FC088 -gUnknown_80FC088: @ 80FC088 -.string "Evasion\0" -.align 2, 0 - -.global gUnknown_80FC090 -gUnknown_80FC090: @ 80FC090 -@ replacing .incbin "baserom.gba", 0xFC090, 0xC -.4byte gUnknown_80FC088 - -.global gUnknown_80FC094 -gUnknown_80FC094: @ 80FC094 -.string "Defense\0" -.align 2, 0 - -.global gUnknown_80FC09C -gUnknown_80FC09C: @ 80FC09C -@ replacing .incbin "baserom.gba", 0xFC09C, 0x10 -.4byte gUnknown_80FC094 - -.global gUnknown_80FC0A0 -gUnknown_80FC0A0: @ 80FC0A0 -.string "Sp. Def.\0" -.align 2, 0 - -.global gUnknown_80FC0AC -gUnknown_80FC0AC: @ 80FC0AC -@ replacing .incbin "baserom.gba", 0xFC0AC, 0xC -.4byte gUnknown_80FC0A0 - -.global gUnknown_80FC0B0 -gUnknown_80FC0B0: @ 80FC0B0 -.string "Attack\0" -.align 2, 0 - -.global gUnknown_80FC0B8 -gUnknown_80FC0B8: @ 80FC0B8 -@ replacing .incbin "baserom.gba", 0xFC0B8, 0x10 -.4byte gUnknown_80FC0B0 - -.global gUnknown_80FC0BC -gUnknown_80FC0BC: @ 80FC0BC -.string "Sp. Atk.\0" -.align 2, 0 - -.global gUnknown_80FC0C8 -gUnknown_80FC0C8: @ 80FC0C8 -@ replacing .incbin "baserom.gba", 0xFC0C8, 0xC -.4byte gUnknown_80FC0BC - -.global gUnknown_80FC0CC -gUnknown_80FC0CC: @ 80FC0CC -.string "sharply\0" -.align 2, 0 - -.global gUnknown_80FC0D4 -gUnknown_80FC0D4: @ 80FC0D4 -@ replacing .incbin "baserom.gba", 0xFC0D4, 0x10 -.4byte gUnknown_80FC0CC - -.global gUnknown_80FC0D8 -gUnknown_80FC0D8: @ 80FC0D8 -.string "slightly\0" -.align 2, 0 - -.global gUnknown_80FC0E4 -gUnknown_80FC0E4: @ 80FC0E4 -@ replacing .incbin "baserom.gba", 0xFC0E4, 0x18 -.4byte gUnknown_80FC0D8 - -.global gUnknown_80FC0E8 -gUnknown_80FC0E8: @ 80FC0E8 -.string "{POKEMON_0}'s {MOVE_ITEM_0} rose!\0" -.align 2, 0 - -.global gUnknown_80FC0FC -gUnknown_80FC0FC: @ 80FC0FC -@ replacing .incbin "baserom.gba", 0xFC0FC, 0x18 -.4byte gUnknown_80FC0E8 - -.global gUnknown_80FC100 -gUnknown_80FC100: @ 80FC100 -.string "{POKEMON_0}'s {MOVE_ITEM_0} fell!\0" -.align 2, 0 - -.global gUnknown_80FC114 -gUnknown_80FC114: @ 80FC114 -@ replacing .incbin "baserom.gba", 0xFC114, 0x4 -.4byte gUnknown_80FC100 - -.global gUnknown_80FC118 -gUnknown_80FC118: @ 80FC118 -@ replacing .incbin "baserom.gba", 0xFC118, 0x4 -.4byte gUnknown_80FC0E8 - -.global gUnknown_80FC11C -gUnknown_80FC11C: @ 80FC11C -@ replacing .incbin "baserom.gba", 0xFC11C, 0x1C -.4byte gUnknown_80FC100 - -.global gUnknown_80FC120 -gUnknown_80FC120: @ 80FC120 -.string "{POKEMON_0}'s {MOVE_ITEM_0} rose\n" -.string "{MOVE_ITEM_1}!\0" -.align 2, 0 - -.global gUnknown_80FC138 -gUnknown_80FC138: @ 80FC138 -@ replacing .incbin "baserom.gba", 0xFC138, 0x4 -.4byte gUnknown_80FC120 - -.global gUnknown_80FC13C -gUnknown_80FC13C: @ 80FC13C -@ replacing .incbin "baserom.gba", 0xFC13C, 0x1C -.4byte gUnknown_80FC120 - -.global gUnknown_80FC140 -gUnknown_80FC140: @ 80FC140 -.string "{POKEMON_0}'s {MOVE_ITEM_0} fell\n" -.string "{MOVE_ITEM_1}!\0" -.align 2, 0 - -.global gUnknown_80FC158 -gUnknown_80FC158: @ 80FC158 -@ replacing .incbin "baserom.gba", 0xFC158, 0x4 -.4byte gUnknown_80FC140 - -.global gUnknown_80FC15C -gUnknown_80FC15C: @ 80FC15C -@ replacing .incbin "baserom.gba", 0xFC15C, 0x24 -.4byte gUnknown_80FC140 - -.global gUnknown_80FC160 -gUnknown_80FC160: @ 80FC160 -.string "{POKEMON_0}'s {MOVE_ITEM_0} remained\n" -.string "unchanged!\0" -.align 2, 0 - -.global gUnknown_80FC180 -gUnknown_80FC180: @ 80FC180 -@ replacing .incbin "baserom.gba", 0xFC180, 0x4 -.4byte gUnknown_80FC160 - -.global gUnknown_80FC184 -gUnknown_80FC184: @ 80FC184 -@ replacing .incbin "baserom.gba", 0xFC184, 0x20 -.4byte gUnknown_80FC160 - -.global gUnknown_80FC188 -gUnknown_80FC188: @ 80FC188 -.string "{POKEMON_0}'s {MOVE_ITEM_0} fell\n" -.string "slightly!\0" -.align 2, 0 - -.global gUnknown_80FC1A4 -gUnknown_80FC1A4: @ 80FC1A4 -@ replacing .incbin "baserom.gba", 0xFC1A4, 0x20 -.4byte gUnknown_80FC188 - -.global gUnknown_80FC1A8 -gUnknown_80FC1A8: @ 80FC1A8 -.string "{POKEMON_0}'s {MOVE_ITEM_0} rose\n" -.string "slightly!\0" -.align 2, 0 - -.global gUnknown_80FC1C4 -gUnknown_80FC1C4: @ 80FC1C4 -@ replacing .incbin "baserom.gba", 0xFC1C4, 0x2C -.4byte gUnknown_80FC1A8 - -.global gUnknown_80FC1C8 -gUnknown_80FC1C8: @ 80FC1C8 -.string "{POKEMON_0}'s {MOVE_ITEM_0} won't\n" -.string "go down any more!\0" -.align 2, 0 - -.global gUnknown_80FC1F0 -gUnknown_80FC1F0: @ 80FC1F0 -@ replacing .incbin "baserom.gba", 0xFC1F0, 0x28 -.4byte gUnknown_80FC1C8 - -.global gUnknown_80FC1F4 -gUnknown_80FC1F4: @ 80FC1F4 -.string "{POKEMON_0}'s {MOVE_ITEM_0} won't\n" -.string "go up any more!\0" -.align 2, 0 - -.global gUnknown_80FC218 -gUnknown_80FC218: @ 80FC218 -@ replacing .incbin "baserom.gba", 0xFC218, 0x4 -.4byte gUnknown_80FC1F4 - -.global gUnknown_80FC21C -gUnknown_80FC21C: @ 80FC21C -@ replacing .incbin "baserom.gba", 0xFC21C, 0x2C -.4byte gUnknown_80FC1F4 - -.global gUnknown_80FC220 -gUnknown_80FC220: @ 80FC220 -.string "{POKEMON_0}'s {MOVE_ITEM_0} won't\n" -.string "go down any more.\0" -.align 2, 0 - -.global gUnknown_80FC248 -gUnknown_80FC248: @ 80FC248 -@ replacing .incbin "baserom.gba", 0xFC248, 0x28 -.4byte gUnknown_80FC220 - -.global gUnknown_80FC24C -gUnknown_80FC24C: @ 80FC24C -.string "{POKEMON_0}'s {MOVE_ITEM_0} won't\n" -.string "go up any more.\0" -.align 2, 0 - -.global gUnknown_80FC270 -gUnknown_80FC270: @ 80FC270 -@ replacing .incbin "baserom.gba", 0xFC270, 0x4 -.4byte gUnknown_80FC24C - -.global gUnknown_80FC274 -gUnknown_80FC274: @ 80FC274 -@ replacing .incbin "baserom.gba", 0xFC274, 0x24 -.4byte gUnknown_80FC220 - -.global gUnknown_80FC278 -gUnknown_80FC278: @ 80FC278 -.string "{POKEMON_0}'s speed didn't change!\0" -.align 2, 0 - -.global gUnknown_80FC298 -gUnknown_80FC298: @ 80FC298 -@ replacing .incbin "baserom.gba", 0xFC298, 0x20 -.4byte gUnknown_80FC278 - -.global gUnknown_80FC29C -gUnknown_80FC29C: @ 80FC29C -.string "{POKEMON_0} can't go any faster!\0" -.align 2, 0 - -.global gUnknown_80FC2B8 -gUnknown_80FC2B8: @ 80FC2B8 -@ replacing .incbin "baserom.gba", 0xFC2B8, 0x20 -.4byte gUnknown_80FC29C - -.global gUnknown_80FC2BC -gUnknown_80FC2BC: @ 80FC2BC -.string "{POKEMON_0} can't go any slower!\0" -.align 2, 0 - -.global gUnknown_80FC2D8 -gUnknown_80FC2D8: @ 80FC2D8 -@ replacing .incbin "baserom.gba", 0xFC2D8, 0x24 -.4byte gUnknown_80FC2BC - -.global gUnknown_80FC2DC -gUnknown_80FC2DC: @ 80FC2DC -.string "{POKEMON_0} is protected by Safeguard!\0" -.align 2, 0 - -.global gUnknown_80FC2FC -gUnknown_80FC2FC: @ 80FC2FC -@ replacing .incbin "baserom.gba", 0xFC2FC, 0x20 -.4byte gUnknown_80FC2DC - -.global gUnknown_80FC300 -gUnknown_80FC300: @ 80FC300 -.string "{POKEMON_0} is protected by Mist!\0" -.align 2, 0 - -.global gUnknown_80FC31C -gUnknown_80FC31C: @ 80FC31C -@ replacing .incbin "baserom.gba", 0xFC31C, 0x20 -.4byte gUnknown_80FC300 - -.global gUnknown_80FC320 -gUnknown_80FC320: @ 80FC320 -.string "{POKEMON_0}'s Attack was boosted.\0" -.align 2, 0 - -.global gUnknown_80FC33C -gUnknown_80FC33C: @ 80FC33C -@ replacing .incbin "baserom.gba", 0xFC33C, 0x24 -.4byte gUnknown_80FC320 - -.global gUnknown_80FC340 -gUnknown_80FC340: @ 80FC340 -.string "{POKEMON_0}'s Attack didn't go up.\0" -.align 2, 0 - -.global gUnknown_80FC360 -gUnknown_80FC360: @ 80FC360 -@ replacing .incbin "baserom.gba", 0xFC360, 0x28 -.4byte gUnknown_80FC340 - -.global gUnknown_80FC364 -gUnknown_80FC364: @ 80FC364 -.string "{POKEMON_0}'s Special Attack was boosted.\0" -.align 2, 0 - -.global gUnknown_80FC388 -gUnknown_80FC388: @ 80FC388 -@ replacing .incbin "baserom.gba", 0xFC388, 0x2C -.4byte gUnknown_80FC364 - -.global gUnknown_80FC38C -gUnknown_80FC38C: @ 80FC38C -.string "{POKEMON_0}'s Special Attack didn't go up.\0" -.align 2, 0 - -.global gUnknown_80FC3B4 -gUnknown_80FC3B4: @ 80FC3B4 -@ replacing .incbin "baserom.gba", 0xFC3B4, 0x24 -.4byte gUnknown_80FC38C - -.global gUnknown_80FC3B8 -gUnknown_80FC3B8: @ 80FC3B8 -.string "{POKEMON_0}'s Defense was boosted.\0" -.align 2, 0 - -.global gUnknown_80FC3D8 -gUnknown_80FC3D8: @ 80FC3D8 -@ replacing .incbin "baserom.gba", 0xFC3D8, 0x24 -.4byte gUnknown_80FC3B8 - -.global gUnknown_80FC3DC -gUnknown_80FC3DC: @ 80FC3DC -.string "{POKEMON_0}'s Defense didn't go up.\0" -.align 2, 0 - -.global gUnknown_80FC3FC -gUnknown_80FC3FC: @ 80FC3FC -@ replacing .incbin "baserom.gba", 0xFC3FC, 0x2C -.4byte gUnknown_80FC3DC - -.global gUnknown_80FC400 -gUnknown_80FC400: @ 80FC400 -.string "{POKEMON_0}'s Special Defense was\n" -.string "boosted.\0" -.align 2, 0 - -.global gUnknown_80FC428 -gUnknown_80FC428: @ 80FC428 -@ replacing .incbin "baserom.gba", 0xFC428, 0x2C -.4byte gUnknown_80FC400 - -.global gUnknown_80FC42C -gUnknown_80FC42C: @ 80FC42C -.string "{POKEMON_0}'s Special Defense didn't\n" -.string "go up.\0" -.align 2, 0 - -.global gUnknown_80FC454 -gUnknown_80FC454: @ 80FC454 -@ replacing .incbin "baserom.gba", 0xFC454, 0xD8 -.4byte gUnknown_80FC42C - -.global gUnknown_80FC458 -gUnknown_80FC458: @ 80FC458 -.string "{POKEMON_0}'s Attack was weakened.\0" -.align 2, 0 -.4byte gUnknown_80FC458 - -.global gUnknown_80FC47C -gUnknown_80FC47C: @ 80FC47C -.string "{POKEMON_0}'s Attack didn't go down.\0" -.align 2, 0 -.4byte gUnknown_80FC47C - -.global gUnknown_80FC4A4 -gUnknown_80FC4A4: @ 80FC4A4 -.string "{POKEMON_0}'s Special Attack was\n" -.string "weakened.\0" -.align 2, 0 -.4byte gUnknown_80FC4A4 - -.global gUnknown_80FC4D0 -gUnknown_80FC4D0: @ 80FC4D0 -.string "{POKEMON_0}'s Special Attack didn't go\n" -.string "down.\0" -.align 2, 0 -.4byte gUnknown_80FC4D0 - -.global gUnknown_80FC500 -gUnknown_80FC500: @ 80FC500 -.string "The target's Magic Coat bounced it back!\0" -.align 2, 0 - -.global gUnknown_80FC52C -gUnknown_80FC52C: @ 80FC52C -@ replacing .incbin "baserom.gba", 0xFC52C, 0x2C -.4byte gUnknown_80FC500 - -.global gUnknown_80FC530 -gUnknown_80FC530: @ 80FC530 -.string "The target's Mirror Move returned it!\0" -.align 2, 0 - -.global gUnknown_80FC558 -gUnknown_80FC558: @ 80FC558 -@ replacing .incbin "baserom.gba", 0xFC558, 0x1C -.4byte gUnknown_80FC530 - -.global gUnknown_80FC55C -gUnknown_80FC55C: @ 80FC55C -.string "{POKEMON_1} protected itself!\0" -.align 2, 0 - -.global gUnknown_80FC574 -gUnknown_80FC574: @ 80FC574 -@ replacing .incbin "baserom.gba", 0xFC574, 0x10 -.4byte gUnknown_80FC55C - -.global gUnknown_80FC578 -gUnknown_80FC578: @ 80FC578 -.string "{POKEMON_0} warped!\0" -.align 2, 0 - -.global gUnknown_80FC584 -gUnknown_80FC584: @ 80FC584 -@ replacing .incbin "baserom.gba", 0xFC584, 0x24 -.4byte gUnknown_80FC578 - -.global gUnknown_80FC588 -gUnknown_80FC588: @ 80FC588 -.string "A trap can't be laid here.\0" -.align 2, 0 - -.global gUnknown_80FC5A8 -gUnknown_80FC5A8: @ 80FC5A8 -@ replacing .incbin "baserom.gba", 0xFC5A8, 0x24 -.4byte gUnknown_80FC588 - -.global gUnknown_80FC5AC -gUnknown_80FC5AC: @ 80FC5AC -.string "{POKEMON_0} was too hungry to use it!\0" -.align 2, 0 - -.global gUnknown_80FC5CC -gUnknown_80FC5CC: @ 80FC5CC -@ replacing .incbin "baserom.gba", 0xFC5CC, 0x14 -.4byte gUnknown_80FC5AC - -.global gUnknown_80FC5D0 -gUnknown_80FC5D0: @ 80FC5D0 -.string "Weather: {POKEMON_0}\0" -.align 2, 0 - -.global gUnknown_80FC5E0 -gUnknown_80FC5E0: @ 80FC5E0 -@ replacing .incbin "baserom.gba", 0xFC5E0, 0x18 -.4byte gUnknown_80FC5D0 - -.global gUnknown_80FC5E4 -gUnknown_80FC5E4: @ 80FC5E4 -.string "A trap was laid!\0" -.align 2, 0 - -.global gUnknown_80FC5F8 -gUnknown_80FC5F8: @ 80FC5F8 -@ replacing .incbin "baserom.gba", 0xFC5F8, 0x4 -.4byte gUnknown_80FC5E4 - -.global gUnknown_80FC5FC -gUnknown_80FC5FC: @ 80FC5FC -@ replacing .incbin "baserom.gba", 0xFC5FC, 0x18 -.4byte gUnknown_80FC588 - -.global gUnknown_80FC600 -gUnknown_80FC600: @ 80FC600 -.string "Got {POKEMON_1}'s item!\0" -.align 2, 0 - -.global gUnknown_80FC614 -gUnknown_80FC614: @ 80FC614 -@ replacing .incbin "baserom.gba", 0xFC614, 0x40 -.4byte gUnknown_80FC600 - -.global gUnknown_80FC618 -gUnknown_80FC618: @ 80FC618 -.string "{POKEMON_0} has an item already.\n" -.string "It couldn't get another item.\0" -.align 2, 0 - -.global gUnknown_80FC654 -gUnknown_80FC654: @ 80FC654 -@ replacing .incbin "baserom.gba", 0xFC654, 0x24 -.4byte gUnknown_80FC618 - -.global gUnknown_80FC658 -gUnknown_80FC658: @ 80FC658 -.string "{POKEMON_1} doesn't have anything!\0" -.align 2, 0 - -.global gUnknown_80FC678 -gUnknown_80FC678: @ 80FC678 -@ replacing .incbin "baserom.gba", 0xFC678, 0x18 -.4byte gUnknown_80FC658 - -.global gUnknown_80FC67C -gUnknown_80FC67C: @ 80FC67C -.string "The move failed!\0" -.align 2, 0 - -.global gUnknown_80FC690 -gUnknown_80FC690: @ 80FC690 -@ replacing .incbin "baserom.gba", 0xFC690, 0x14 -.4byte gUnknown_80FC67C - -.global gUnknown_80FC694 -gUnknown_80FC694: @ 80FC694 -.string "The Orb failed!\0" -.align 2, 0 - -.global gUnknown_80FC6A4 -gUnknown_80FC6A4: @ 80FC6A4 -@ replacing .incbin "baserom.gba", 0xFC6A4, 0x4 -.4byte gUnknown_80FC694 - -.global gUnknown_80FC6A8 -gUnknown_80FC6A8: @ 80FC6A8 -@ replacing .incbin "baserom.gba", 0xFC6A8, 0x28 -.4byte gUnknown_80F8F24 - -.global gUnknown_80FC6AC -gUnknown_80FC6AC: @ 80FC6AC -.string "But the move couldn't be used!\0" -.align 2, 0 - -.global gUnknown_80FC6D0 -gUnknown_80FC6D0: @ 80FC6D0 -@ replacing .incbin "baserom.gba", 0xFC6D0, 0x2C -.4byte gUnknown_80FC6AC - -.global gUnknown_80FC6D4 -gUnknown_80FC6D4: @ 80FC6D4 -.string "But Orbs are prevented from being used!\0" -.align 2, 0 - -.global gUnknown_80FC6FC -gUnknown_80FC6FC: @ 80FC6FC -@ replacing .incbin "baserom.gba", 0xFC6FC, 0x14 -.4byte gUnknown_80FC6D4 - -.global gUnknown_80FC700 -gUnknown_80FC700: @ 80FC700 -.string "{POKEMON_0} is muzzled!\0" -.align 2, 0 - -.global gUnknown_80FC710 -gUnknown_80FC710: @ 80FC710 -@ replacing .incbin "baserom.gba", 0xFC710, 0x4 -.4byte gUnknown_80FC700 - -.global gUnknown_80FC714 -gUnknown_80FC714: @ 80FC714 -@ replacing .incbin "baserom.gba", 0xFC714, 0x4 -.4byte gUnknown_80F8F0C - -.global gUnknown_80FC718 -gUnknown_80FC718: @ 80FC718 -@ replacing .incbin "baserom.gba", 0xFC718, 0x14 -.4byte gUnknown_80F95A8 - -.global gUnknown_80FC71C -gUnknown_80FC71C: @ 80FC71C -.string "{POKEMON_0} loosed {MOVE_ITEM_0}!\0" -.align 2, 0 - -.global gUnknown_80FC72C -gUnknown_80FC72C: @ 80FC72C -@ replacing .incbin "baserom.gba", 0xFC72C, 0x4 -.4byte gUnknown_80FC71C - -.global gUnknown_80FC730 -gUnknown_80FC730: @ 80FC730 -@ replacing .incbin "baserom.gba", 0xFC730, 0x4 -.4byte gUnknown_80FB568 - -.global gUnknown_80FC734 -gUnknown_80FC734: @ 80FC734 -@ replacing .incbin "baserom.gba", 0xFC734, 0x18 -.4byte gUnknown_80FB568 - -.global gUnknown_80FC738 -gUnknown_80FC738: @ 80FC738 -.string "Nothing happened.\0" -.align 2, 0 - -.global gUnknown_80FC74C -gUnknown_80FC74C: @ 80FC74C -@ replacing .incbin "baserom.gba", 0xFC74C, 0x24 -.4byte gUnknown_80FC738 - -.global gUnknown_80FC750 -gUnknown_80FC750: @ 80FC750 -.string "But no power had been stored!\0" -.align 2, 0 - -.global gUnknown_80FC770 -gUnknown_80FC770: @ 80FC770 -@ replacing .incbin "baserom.gba", 0xFC770, 0x20 -.4byte gUnknown_80FC750 - -.global gUnknown_80FC774 -gUnknown_80FC774: @ 80FC774 -.string "{POKEMON_0} traded items with\n" -.string "{POKEMON_1}!\0" -.align 2, 0 - -.global gUnknown_80FC790 -gUnknown_80FC790: @ 80FC790 -@ replacing .incbin "baserom.gba", 0xFC790, 0x1C -.4byte gUnknown_80FC774 - -.global gUnknown_80FC794 -gUnknown_80FC794: @ 80FC794 -.string "The item trade failed!\0" -.align 2, 0 - -.global gUnknown_80FC7AC -gUnknown_80FC7AC: @ 80FC7AC -@ replacing .incbin "baserom.gba", 0xFC7AC, 0x1C -.4byte gUnknown_80FC794 - -.global gUnknown_80FC7B0 -gUnknown_80FC7B0: @ 80FC7B0 -.string "{POKEMON_0}'s move missed!\0" -.align 2, 0 - -.global gUnknown_80FC7C8 -gUnknown_80FC7C8: @ 80FC7C8 -@ replacing .incbin "baserom.gba", 0xFC7C8, 0x24 -.4byte gUnknown_80FC7B0 - -.global gUnknown_80FC7CC -gUnknown_80FC7CC: @ 80FC7CC -.string "{POKEMON_0} and {POKEMON_1} shared\n" -.string "their HP!\0" -.align 2, 0 - -.global gUnknown_80FC7EC -gUnknown_80FC7EC: @ 80FC7EC -@ replacing .incbin "baserom.gba", 0xFC7EC, 0x30 -.4byte gUnknown_80FC7CC - -.global gUnknown_80FC7F0 -gUnknown_80FC7F0: @ 80FC7F0 -.string "{POKEMON_0} copied the target's\n" -.string "special ability!\0" -.align 2, 0 - -.global gUnknown_80FC81C -gUnknown_80FC81C: @ 80FC81C -@ replacing .incbin "baserom.gba", 0xFC81C, 0x38 -.4byte gUnknown_80FC7F0 - -.global gUnknown_80FC820 -gUnknown_80FC820: @ 80FC820 -.string "{POKEMON_0} couldn't copy the target's\n" -.string "Wonder Guard!\0" -.align 2, 0 - -.global gUnknown_80FC854 -gUnknown_80FC854: @ 80FC854 -@ replacing .incbin "baserom.gba", 0xFC854, 0x34 -.4byte gUnknown_80FC820 - -.global gUnknown_80FC858 -gUnknown_80FC858: @ 80FC858 -.string "{POKEMON_0} swapped special abilities\n" -.string "with the target!\0" -.align 2, 0 - -.global gUnknown_80FC888 -gUnknown_80FC888: @ 80FC888 -@ replacing .incbin "baserom.gba", 0xFC888, 0x38 -.4byte gUnknown_80FC858 - -.global gUnknown_80FC88C -gUnknown_80FC88C: @ 80FC88C -.string "{POKEMON_0} couldn't swap the target's\n" -.string "Wonder Guard!\0" -.align 2, 0 - -.global gUnknown_80FC8C0 -gUnknown_80FC8C0: @ 80FC8C0 -@ replacing .incbin "baserom.gba", 0xFC8C0, 0x30 -.4byte gUnknown_80FC88C - -.global gUnknown_80FC8C4 -gUnknown_80FC8C4: @ 80FC8C4 -.string "All sticky, gummed-up items were cleaned!\0" -.align 2, 0 - -.global gUnknown_80FC8F0 -gUnknown_80FC8F0: @ 80FC8F0 -@ replacing .incbin "baserom.gba", 0xFC8F0, 0x30 -.4byte gUnknown_80FC8C4 - -.global gUnknown_80FC8F4 -gUnknown_80FC8F4: @ 80FC8F4 -.string "There were no sticky, gummed-up items.\0" -.align 2, 0 - -.global gUnknown_80FC920 -gUnknown_80FC920: @ 80FC920 -@ replacing .incbin "baserom.gba", 0xFC920, 0x5C -.4byte gUnknown_80FC8F4 - -.global gUnknown_80FC924 -gUnknown_80FC924: @ 80FC924 -.string "The target is a Ground type!\n" -.string "Mud-Slap didn't work!\0" -.align 2, 0 -.4byte gUnknown_80FC924 - -.global gUnknown_80FC960 -gUnknown_80FC960: @ 80FC960 -.string "There's nowhere to warp!\0" -.align 2, 0 - -.global gUnknown_80FC97C -gUnknown_80FC97C: @ 80FC97C -@ replacing .incbin "baserom.gba", 0xFC97C, 0x24 -.4byte gUnknown_80FC960 - -.global gUnknown_80FC980 -gUnknown_80FC980: @ 80FC980 -.string "It's already on the stairs.\0" -.align 2, 0 - -.global gUnknown_80FC9A0 -gUnknown_80FC9A0: @ 80FC9A0 -@ replacing .incbin "baserom.gba", 0xFC9A0, 0x20 -.4byte gUnknown_80FC980 - -.global gUnknown_80FC9A4 -gUnknown_80FC9A4: @ 80FC9A4 -.string "It couldn't make a leap!\0" -.align 2, 0 - -.global gUnknown_80FC9C0 -gUnknown_80FC9C0: @ 80FC9C0 -@ replacing .incbin "baserom.gba", 0xFC9C0, 0x28 -.4byte gUnknown_80FC9A4 - -.global gUnknown_80FC9C4 -gUnknown_80FC9C4: @ 80FC9C4 -.string "It couldn't be knocked flying!\0" -.align 2, 0 - -.global gUnknown_80FC9E8 -gUnknown_80FC9E8: @ 80FC9E8 -@ replacing .incbin "baserom.gba", 0xFC9E8, 0x28 -.4byte gUnknown_80FC9C4 - -.global gUnknown_80FC9EC -gUnknown_80FC9EC: @ 80FC9EC -.string "{POKEMON_0} couldn't be knocked flying!\0" -.align 2, 0 - -.global gUnknown_80FCA10 -gUnknown_80FCA10: @ 80FCA10 -@ replacing .incbin "baserom.gba", 0xFCA10, 0x2C -.4byte gUnknown_80FC9EC - -.global gUnknown_80FCA14 -gUnknown_80FCA14: @ 80FCA14 -.string "It had no power stockpiled to spit up!\0" -.align 2, 0 - -.global gUnknown_80FCA3C -gUnknown_80FCA3C: @ 80FCA3C -@ replacing .incbin "baserom.gba", 0xFCA3C, 0x24 -.4byte gUnknown_80FCA14 - -.global gUnknown_80FCA40 -gUnknown_80FCA40: @ 80FCA40 -.string "{POKEMON_0}'s {MOVE_ITEM_0} didn't\n" -.string "go down!\0" -.align 2, 0 - -.global gUnknown_80FCA60 -gUnknown_80FCA60: @ 80FCA60 -@ replacing .incbin "baserom.gba", 0xFCA60, 0x4 -.4byte gUnknown_80FCA40 - -.global gUnknown_80FCA64 -gUnknown_80FCA64: @ 80FCA64 -@ replacing .incbin "baserom.gba", 0xFCA64, 0x2C -.4byte gUnknown_80FCA40 - -.global gUnknown_80FCA68 -gUnknown_80FCA68: @ 80FCA68 -.string "{POKEMON_1} is sturdy!\n" -.string "It withstood the move!\0" -.align 2, 0 - -.global gUnknown_80FCA90 -gUnknown_80FCA90: @ 80FCA90 -@ replacing .incbin "baserom.gba", 0xFCA90, 0x30 -.4byte gUnknown_80FCA68 - -.global gUnknown_80FCA94 -gUnknown_80FCA94: @ 80FCA94 -.string "{POKEMON_0} is anchored!\n" -.string "It won't switch places!\0" -.align 2, 0 - -.global gUnknown_80FCAC0 -gUnknown_80FCAC0: @ 80FCAC0 -@ replacing .incbin "baserom.gba", 0xFCAC0, 0x28 -.4byte gUnknown_80FCA94 - -.global gUnknown_80FCAC4 -gUnknown_80FCAC4: @ 80FCAC4 -.string "{POKEMON_0} is anchored!\n" -.string "It won't warp!\0" -.align 2, 0 - -.global gUnknown_80FCAE8 -gUnknown_80FCAE8: @ 80FCAE8 -@ replacing .incbin "baserom.gba", 0xFCAE8, 0x2C -.4byte gUnknown_80FCAC4 - -.global gUnknown_80FCAEC -gUnknown_80FCAEC: @ 80FCAEC -.string "But it dropped back at the same spot!\0" -.align 2, 0 - -.global gUnknown_80FCB14 -gUnknown_80FCB14: @ 80FCB14 -@ replacing .incbin "baserom.gba", 0xFCB14, 0x2C -.4byte gUnknown_80FCAEC - -.global gUnknown_80FCB18 -gUnknown_80FCB18: @ 80FCB18 -.string "{POKEMON_0} is anchored!\n" -.string "It can't be thrown!\0" -.align 2, 0 - -.global gUnknown_80FCB40 -gUnknown_80FCB40: @ 80FCB40 -@ replacing .incbin "baserom.gba", 0xFCB40, 0x30 -.4byte gUnknown_80FCB18 - -.global gUnknown_80FCB44 -gUnknown_80FCB44: @ 80FCB44 -.string "{POKEMON_0} couldn't be thrown for\n" -.string "some reason!\0" -.align 2, 0 - -.global gUnknown_80FCB70 -gUnknown_80FCB70: @ 80FCB70 -@ replacing .incbin "baserom.gba", 0xFCB70, 0x28 -.4byte gUnknown_80FCB44 - -.global gUnknown_80FCB74 -gUnknown_80FCB74: @ 80FCB74 -.string "{POKEMON_0} is anchored!\n" -.string "It can't leap!\0" -.align 2, 0 - -.global gUnknown_80FCB98 -gUnknown_80FCB98: @ 80FCB98 -@ replacing .incbin "baserom.gba", 0xFCB98, 0x34 -.4byte gUnknown_80FCB74 - -.global gUnknown_80FCB9C -gUnknown_80FCB9C: @ 80FCB9C -.string "{POKEMON_0} is anchored!\n" -.string "It can't be knocked flying!\0" -.align 2, 0 - -.global gUnknown_80FCBCC -gUnknown_80FCBCC: @ 80FCBCC -@ replacing .incbin "baserom.gba", 0xFCBCC, 0x2C -.4byte gUnknown_80FCB9C - -.global gUnknown_80FCBD0 -gUnknown_80FCBD0: @ 80FCBD0 -.string "{POKEMON_0} is limber!\n" -.string "It can't be paralyzed!\0" -.align 2, 0 - -.global gUnknown_80FCBF8 -gUnknown_80FCBF8: @ 80FCBF8 -@ replacing .incbin "baserom.gba", 0xFCBF8, 0x20 -.4byte gUnknown_80FCBD0 - -.global gUnknown_80FCBFC -gUnknown_80FCBFC: @ 80FCBFC -.string "But {POKEMON_0} didn't cringe!\0" -.align 2, 0 - -.global gUnknown_80FCC18 -gUnknown_80FCC18: @ 80FCC18 -@ replacing .incbin "baserom.gba", 0xFCC18, 0x34 -.4byte gUnknown_80FCBFC - -.global gUnknown_80FCC1C -gUnknown_80FCC1C: @ 80FCC1C -.string "{POKEMON_0} is oblivious!\n" -.string "It doesn't get infatuated!\0" -.align 2, 0 - -.global gUnknown_80FCC4C -gUnknown_80FCC4C: @ 80FCC4C -@ replacing .incbin "baserom.gba", 0xFCC4C, 0x30 -.4byte gUnknown_80FCC1C - -.global gUnknown_80FCC50 -gUnknown_80FCC50: @ 80FCC50 -.string "{POKEMON_0} traced the target's\n" -.string "special ability!\0" -.align 2, 0 - -.global gUnknown_80FCC7C -gUnknown_80FCC7C: @ 80FCC7C -@ replacing .incbin "baserom.gba", 0xFCC7C, 0x30 -.4byte gUnknown_80FCC50 - -.global gUnknown_80FCC80 -gUnknown_80FCC80: @ 80FCC80 -.string "{POKEMON_0}'s Color Change made it\n" -.string "the {MOVE_ITEM_0} type!\0" -.align 2, 0 - -.global gUnknown_80FCCAC -gUnknown_80FCCAC: @ 80FCCAC -@ replacing .incbin "baserom.gba", 0xFCCAC, 0x38 -.4byte gUnknown_80FCC80 -.4byte gUnknown_80F7F20 - -.global gUnknown_80FCCB4 -gUnknown_80FCCB4: @ 80FCCB4 -.string "But the target's item couldn't be taken!\0" -.align 2, 0 - -.global gUnknown_80FCCE4 -gUnknown_80FCCE4: @ 80FCCE4 -@ replacing .incbin "baserom.gba", 0xFCCE4, 0x4 -.4byte gUnknown_80FCCB4 - -.global gUnknown_80FCCE8 -gUnknown_80FCCE8: @ 80FCCE8 -@ replacing .incbin "baserom.gba", 0xFCCE8, 0x24 -.4byte gUnknown_80FCCB4 - -.global gUnknown_80FCCEC -gUnknown_80FCCEC: @ 80FCCEC -.string "A Lightningrod took the move!\0" -.align 2, 0 - -.global gUnknown_80FCD0C -gUnknown_80FCD0C: @ 80FCD0C -@ replacing .incbin "baserom.gba", 0xFCD0C, 0x1C -.4byte gUnknown_80FCCEC - -.global gUnknown_80FCD10 -gUnknown_80FCD10: @ 80FCD10 -.string "The move was snatched!\0" -.align 2, 0 - -.global gUnknown_80FCD28 -gUnknown_80FCD28: @ 80FCD28 -@ replacing .incbin "baserom.gba", 0xFCD28, 0x2C -.4byte gUnknown_80FCD10 - -.global gUnknown_80FCD2C -gUnknown_80FCD2C: @ 80FCD2C -.string "{POKEMON_0}'s Insomnia prevents\n" -.string "drowsiness!\0" -.align 2, 0 - -.global gUnknown_80FCD54 -gUnknown_80FCD54: @ 80FCD54 -@ replacing .incbin "baserom.gba", 0xFCD54, 0x4 -.4byte gUnknown_80FCD2C - -.global gUnknown_80FCD58 -gUnknown_80FCD58: @ 80FCD58 -@ replacing .incbin "baserom.gba", 0xFCD58, 0x30 -.4byte gUnknown_80FCD2C - -.global gUnknown_80FCD5C -gUnknown_80FCD5C: @ 80FCD5C -.string "{POKEMON_0}'s Vital Spirit prevents\n" -.string "drowsiness!\0" -.align 2, 0 - -.global gUnknown_80FCD88 -gUnknown_80FCD88: @ 80FCD88 -@ replacing .incbin "baserom.gba", 0xFCD88, 0x2C -.4byte gUnknown_80FCD5C - -.global gUnknown_80FCD8C -gUnknown_80FCD8C: @ 80FCD8C -.string "{POKEMON_0}'s Own Tempo prevents\n" -.string "confusion!\0" -.align 2, 0 - -.global gUnknown_80FCDB4 -gUnknown_80FCDB4: @ 80FCDB4 -@ replacing .incbin "baserom.gba", 0xFCDB4, 0x2C -.4byte gUnknown_80FCD8C - -.global gUnknown_80FCDB8 -gUnknown_80FCDB8: @ 80FCDB8 -.string "{POKEMON_0}'s Magma Armor prevents\n" -.string "freezing!\0" -.align 2, 0 - -.global gUnknown_80FCDE0 -gUnknown_80FCDE0: @ 80FCDE0 -@ replacing .incbin "baserom.gba", 0xFCDE0, 0x20 -.4byte gUnknown_80FCDB8 - -.global gUnknown_80FCDE4 -gUnknown_80FCDE4: @ 80FCDE4 -.string "{POKEMON_0} is an unfreezable type!\0" -.align 2, 0 - -.global gUnknown_80FCE00 -gUnknown_80FCE00: @ 80FCE00 -@ replacing .incbin "baserom.gba", 0xFCE00, 0x34 -.4byte gUnknown_80FCDE4 - -.global gUnknown_80FCE04 -gUnknown_80FCE04: @ 80FCE04 -.string "The magma's heat prevents {POKEMON_0}\n" -.string "from freezing!\0" -.align 2, 0 - -.global gUnknown_80FCE34 -gUnknown_80FCE34: @ 80FCE34 -@ replacing .incbin "baserom.gba", 0xFCE34, 0x28 -.4byte gUnknown_80FCE04 - -.global gUnknown_80FCE38 -gUnknown_80FCE38: @ 80FCE38 -.string "{POKEMON_0}'s Water Veil prevents burns!\0" -.align 2, 0 - -.global gUnknown_80FCE5C -gUnknown_80FCE5C: @ 80FCE5C -@ replacing .incbin "baserom.gba", 0xFCE5C, 0x28 -.4byte gUnknown_80FCE38 - -.global gUnknown_80FCE60 -gUnknown_80FCE60: @ 80FCE60 -.string "{POKEMON_0}'s type doesn't get burns!\0" -.align 2, 0 - -.global gUnknown_80FCE84 -gUnknown_80FCE84: @ 80FCE84 -@ replacing .incbin "baserom.gba", 0xFCE84, 0x2C -.4byte gUnknown_80FCE60 - -.global gUnknown_80FCE88 -gUnknown_80FCE88: @ 80FCE88 -.string "{POKEMON_0}'s Immunity prevents\n" -.string "poisoning!\0" -.align 2, 0 - -.global gUnknown_80FCEB0 -gUnknown_80FCEB0: @ 80FCEB0 -@ replacing .incbin "baserom.gba", 0xFCEB0, 0x2C -.4byte gUnknown_80FCE88 - -.global gUnknown_80FCEB4 -gUnknown_80FCEB4: @ 80FCEB4 -.string "{POKEMON_0}'s type doesn't get poisoned!\0" -.align 2, 0 - -.global gUnknown_80FCEDC -gUnknown_80FCEDC: @ 80FCEDC -@ replacing .incbin "baserom.gba", 0xFCEDC, 0x20 -.4byte gUnknown_80FCEB4 - -.global gUnknown_80FCEE0 -gUnknown_80FCEE0: @ 80FCEE0 -.string "It had no effect on {POKEMON_0}!\0" -.align 2, 0 - -.global gUnknown_80FCEFC -gUnknown_80FCEFC: @ 80FCEFC -@ replacing .incbin "baserom.gba", 0xFCEFC, 0x1C -.4byte gUnknown_80FCEE0 - -.global gUnknown_80FCF00 -gUnknown_80FCF00: @ 80FCF00 -.string "Yes! {POKEMON_0} leveled up!\0" -.align 2, 0 - -.global gUnknown_80FCF18 -gUnknown_80FCF18: @ 80FCF18 -@ replacing .incbin "baserom.gba", 0xFCF18, 0x20 -.4byte gUnknown_80FCF00 - -.global gUnknown_80FCF1C -gUnknown_80FCF1C: @ 80FCF1C -.string "{POKEMON_0} uttered its sleep talk!\0" -.align 2, 0 - -.global gUnknown_80FCF38 -gUnknown_80FCF38: @ 80FCF38 -@ replacing .incbin "baserom.gba", 0xFCF38, 0x18 -.4byte gUnknown_80FCF1C - -.global gUnknown_80FCF3C -gUnknown_80FCF3C: @ 80FCF3C -.string "{POKEMON_0} loosed a snore!\0" -.align 2, 0 - -.global gUnknown_80FCF50 -gUnknown_80FCF50: @ 80FCF50 -@ replacing .incbin "baserom.gba", 0xFCF50, 0x24 -.4byte gUnknown_80FCF3C - -.global gUnknown_80FCF54 -gUnknown_80FCF54: @ 80FCF54 -.string "The weather remained unchanged!\0" -.align 2, 0 - -.global gUnknown_80FCF74 -gUnknown_80FCF74: @ 80FCF74 -@ replacing .incbin "baserom.gba", 0xFCF74, 0x4 -.4byte gUnknown_80FCF54 - -.global gUnknown_80FCF78 -gUnknown_80FCF78: @ 80FCF78 -@ replacing .incbin "baserom.gba", 0xFCF78, 0x4 -.4byte gUnknown_80FCF54 - -.global gUnknown_80FCF7C -gUnknown_80FCF7C: @ 80FCF7C -@ replacing .incbin "baserom.gba", 0xFCF7C, 0x4 -.4byte gUnknown_80FCF54 - -.global gUnknown_80FCF80 -gUnknown_80FCF80: @ 80FCF80 -@ replacing .incbin "baserom.gba", 0xFCF80, 0x24 -.4byte gUnknown_80FCF54 - -.global gUnknown_80FCF84 -gUnknown_80FCF84: @ 80FCF84 -.string "Its power was rebounded back!\0" -.align 2, 0 - -.global gUnknown_80FCFA4 -gUnknown_80FCFA4: @ 80FCFA4 -@ replacing .incbin "baserom.gba", 0xFCFA4, 0x18 -.4byte gUnknown_80FCF84 - -.global gUnknown_80FCFA8 -gUnknown_80FCFA8: @ 80FCFA8 -.string "{MOVE_ITEM_0} was tormented!\0" -.align 2, 0 - -.global gUnknown_80FCFBC -gUnknown_80FCFBC: @ 80FCFBC -@ replacing .incbin "baserom.gba", 0xFCFBC, 0x28 -.4byte gUnknown_80FCFA8 - -.global gUnknown_80FCFC0 -gUnknown_80FCFC0: @ 80FCFC0 -.string "The target couldn't be tormented!\0" -.align 2, 0 - -.global gUnknown_80FCFE4 -gUnknown_80FCFE4: @ 80FCFE4 -@ replacing .incbin "baserom.gba", 0xFCFE4, 0x34 -.4byte gUnknown_80FCFC0 - -.global gUnknown_80FCFE8 -gUnknown_80FCFE8: @ 80FCFE8 -.string "The target's HP can't be halved anymore!\0" -.align 2, 0 - -.global gUnknown_80FD018 -gUnknown_80FD018: @ 80FD018 -@ replacing .incbin "baserom.gba", 0xFD018, 0x28 -.4byte gUnknown_80FCFE8 - -.global gUnknown_80FD01C -gUnknown_80FD01C: @ 80FD01C -.string "It became brighter on the floor!\0" -.align 2, 0 - -.global gUnknown_80FD040 -gUnknown_80FD040: @ 80FD040 -@ replacing .incbin "baserom.gba", 0xFD040, 0x1C -.4byte gUnknown_80FD01C - -.global gUnknown_80FD044 -gUnknown_80FD044: @ 80FD044 -.string "The floor was drained!\0" -.align 2, 0 - -.global gUnknown_80FD05C -gUnknown_80FD05C: @ 80FD05C -@ replacing .incbin "baserom.gba", 0xFD05C, 0x4 -.4byte gUnknown_80FD044 - -.global gUnknown_80FD060 -gUnknown_80FD060: @ 80FD060 -@ replacing .incbin "baserom.gba", 0xFD060, 0x2C -.4byte gUnknown_80FB568 - -.global gUnknown_80FD064 -gUnknown_80FD064: @ 80FD064 -.string "There is too much water to be drained!\0" -.align 2, 0 - -.global gUnknown_80FD08C -gUnknown_80FD08C: @ 80FD08C -@ replacing .incbin "baserom.gba", 0xFD08C, 0x28 -.4byte gUnknown_80FD064 - -.global gUnknown_80FD090 -gUnknown_80FD090: @ 80FD090 -.string "It filled in the ground in front!\0" -.align 2, 0 - -.global gUnknown_80FD0B4 -gUnknown_80FD0B4: @ 80FD0B4 -@ replacing .incbin "baserom.gba", 0xFD0B4, 0x4 -.4byte gUnknown_80FD090 - -.global gUnknown_80FD0B8 -gUnknown_80FD0B8: @ 80FD0B8 -@ replacing .incbin "baserom.gba", 0xFD0B8, 0x4C -.4byte gUnknown_80FB568 - -.global gUnknown_80FD0BC -gUnknown_80FD0BC: @ 80FD0BC -.string "The stairs were located!\0" -.align 2, 0 -.4byte gUnknown_80FD0BC -.4byte gUnknown_80F7F20 -.4byte gUnknown_80F7F20 -.4byte gUnknown_80F7F20 - -.global gUnknown_80FD0E8 -gUnknown_80FD0E8: @ 80FD0E8 -.string "The barrier was shattered!\0" -.align 2, 0 - -.global gUnknown_80FD104 -gUnknown_80FD104: @ 80FD104 -@ replacing .incbin "baserom.gba", 0xFD104, 0x24 -.4byte gUnknown_80FD0E8 - -.global gUnknown_80FD108 -gUnknown_80FD108: @ 80FD108 -.string "It can only be used on water!\0" -.align 2, 0 - -.global gUnknown_80FD128 -gUnknown_80FD128: @ 80FD128 -@ replacing .incbin "baserom.gba", 0xFD128, 0x24 -.4byte gUnknown_80FD108 - -.global gUnknown_80FD12C -gUnknown_80FD12C: @ 80FD12C -.string "It can only be used on land!\0" -.align 2, 0 - -.global gUnknown_80FD14C -gUnknown_80FD14C: @ 80FD14C -@ replacing .incbin "baserom.gba", 0xFD14C, 0x24 -.4byte gUnknown_80FD12C - -.global gUnknown_80FD150 -gUnknown_80FD150: @ 80FD150 -.string "{POKEMON_1}'s item was swatted down!\0" -.align 2, 0 - -.global gUnknown_80FD170 -gUnknown_80FD170: @ 80FD170 -@ replacing .incbin "baserom.gba", 0xFD170, 0x1C -.4byte gUnknown_80FD150 - -.global gUnknown_80FD174 -gUnknown_80FD174: @ 80FD174 -.string "The target has no item!\0" -.align 2, 0 - -.global gUnknown_80FD18C -gUnknown_80FD18C: @ 80FD18C -@ replacing .incbin "baserom.gba", 0xFD18C, 0x24 -.4byte gUnknown_80FD174 - -.global gUnknown_80FD190 -gUnknown_80FD190: @ 80FD190 -.string "Nearby traps were destroyed!\0" -.align 2, 0 - -.global gUnknown_80FD1B0 -gUnknown_80FD1B0: @ 80FD1B0 -@ replacing .incbin "baserom.gba", 0xFD1B0, 0x1C -.4byte gUnknown_80FD190 - -.global gUnknown_80FD1B4 -gUnknown_80FD1B4: @ 80FD1B4 -.string "There were no traps.\0" -.align 2, 0 - -.global gUnknown_80FD1CC -gUnknown_80FD1CC: @ 80FD1CC -@ replacing .incbin "baserom.gba", 0xFD1CC, 0x20 -.4byte gUnknown_80FD1B4 - -.global gUnknown_80FD1D0 -gUnknown_80FD1D0: @ 80FD1D0 -.string "It can't be used here.\0" -.align 2, 0 - -.global gUnknown_80FD1EC -gUnknown_80FD1EC: @ 80FD1EC -@ replacing .incbin "baserom.gba", 0xFD1EC, 0x20 -.4byte gUnknown_80FD1D0 - -.global gUnknown_80FD1F0 -gUnknown_80FD1F0: @ 80FD1F0 -.string "{POKEMON_1} can throw a long way!\0" -.align 2, 0 - -.global gUnknown_80FD20C -gUnknown_80FD20C: @ 80FD20C -@ replacing .incbin "baserom.gba", 0xFD20C, 0x20 -.4byte gUnknown_80FD1F0 - -.global gUnknown_80FD210 -gUnknown_80FD210: @ 80FD210 -.string "{POKEMON_1} can throw far already!\0" -.align 2, 0 - -.global gUnknown_80FD22C -gUnknown_80FD22C: @ 80FD22C -@ replacing .incbin "baserom.gba", 0xFD22C, 0x28 -.4byte gUnknown_80FD210 - -.global gUnknown_80FD230 -gUnknown_80FD230: @ 80FD230 -.string "{POKEMON_1}'s throws can pierce things!\0" -.align 2, 0 - -.global gUnknown_80FD254 -gUnknown_80FD254: @ 80FD254 -@ replacing .incbin "baserom.gba", 0xFD254, 0x28 -.4byte gUnknown_80FD230 - -.global gUnknown_80FD258 -gUnknown_80FD258: @ 80FD258 -.string "{POKEMON_1}'s throws can pierce already!\0" -.align 2, 0 - -.global gUnknown_80FD27C -gUnknown_80FD27C: @ 80FD27C -@ replacing .incbin "baserom.gba", 0xFD27C, 0x18 -.4byte gUnknown_80FD258 - -.global gUnknown_80FD280 -gUnknown_80FD280: @ 80FD280 -.string "{POKEMON_1} bears a grudge!\0" -.align 2, 0 - -.global gUnknown_80FD294 -gUnknown_80FD294: @ 80FD294 -@ replacing .incbin "baserom.gba", 0xFD294, 0x20 -.4byte gUnknown_80FD280 - -.global gUnknown_80FD298 -gUnknown_80FD298: @ 80FD298 -.string "{POKEMON_1} already bears a grudge!\0" -.align 2, 0 - -.global gUnknown_80FD2B4 -gUnknown_80FD2B4: @ 80FD2B4 -@ replacing .incbin "baserom.gba", 0xFD2B4, 0x18 -.4byte gUnknown_80FD298 - -.global gUnknown_80FD2B8 -gUnknown_80FD2B8: @ 80FD2B8 -.string "It's a grudge!\0" -.align 2, 0 - -.global gUnknown_80FD2CC -gUnknown_80FD2CC: @ 80FD2CC -@ replacing .incbin "baserom.gba", 0xFD2CC, 0x10 -.4byte gUnknown_80FD2B8 - -.global gUnknown_80FD2D0 -gUnknown_80FD2D0: @ 80FD2D0 -.string "Assist: {MOVE_ITEM_0}\0" -.align 2, 0 - -.global gUnknown_80FD2DC -gUnknown_80FD2DC: @ 80FD2DC -@ replacing .incbin "baserom.gba", 0xFD2DC, 0x1C -.4byte gUnknown_80FD2D0 - -.global gUnknown_80FD2E0 -gUnknown_80FD2E0: @ 80FD2E0 -.string "All traps were exposed!\0" -.align 2, 0 - -.global gUnknown_80FD2F8 -gUnknown_80FD2F8: @ 80FD2F8 -@ replacing .incbin "baserom.gba", 0xFD2F8, 0x28 -.4byte gUnknown_80FD2E0 - -.global gUnknown_80FD2FC -gUnknown_80FD2FC: @ 80FD2FC -.string "There appear to be no hidden traps.\0" -.align 2, 0 - -.global gUnknown_80FD320 -gUnknown_80FD320: @ 80FD320 -@ replacing .incbin "baserom.gba", 0xFD320, 0x30 -.4byte gUnknown_80FD2FC - -.global gUnknown_80FD324 -gUnknown_80FD324: @ 80FD324 -.string "The last move used by {POKEMON_1} lost\n" -.string "all its PP!\0" -.align 2, 0 - -.global gUnknown_80FD350 -gUnknown_80FD350: @ 80FD350 -@ replacing .incbin "baserom.gba", 0xFD350, 0x20 -.4byte gUnknown_80FD324 - -.global gUnknown_80FD354 -gUnknown_80FD354: @ 80FD354 -.string "Nothing happened to {POKEMON_1}.\0" -.align 2, 0 - -.global gUnknown_80FD370 -gUnknown_80FD370: @ 80FD370 -@ replacing .incbin "baserom.gba", 0xFD370, 0x30 -.4byte gUnknown_80FD354 - -.global gUnknown_80FD374 -gUnknown_80FD374: @ 80FD374 -.string "The walls crumbled, making one big room!\0" -.align 2, 0 - -.global gUnknown_80FD3A0 -gUnknown_80FD3A0: @ 80FD3A0 -@ replacing .incbin "baserom.gba", 0xFD3A0, 0x28 -.4byte gUnknown_80FD374 - -.global gUnknown_80FD3A4 -gUnknown_80FD3A4: @ 80FD3A4 -.string "This floor is already one big room!\0" -.align 2, 0 - -.global gUnknown_80FD3C8 -gUnknown_80FD3C8: @ 80FD3C8 -@ replacing .incbin "baserom.gba", 0xFD3C8, 0x4 -.4byte gUnknown_80FD3A4 - -.global gUnknown_80FD3CC -gUnknown_80FD3CC: @ 80FD3CC -@ replacing .incbin "baserom.gba", 0xFD3CC, 0x4 -.4byte gUnknown_80FD1D0 - -.global gUnknown_80FD3D0 -gUnknown_80FD3D0: @ 80FD3D0 -@ replacing .incbin "baserom.gba", 0xFD3D0, 0x20 -.4byte gUnknown_80FD1D0 - -.global gUnknown_80FD3D4 -gUnknown_80FD3D4: @ 80FD3D4 -.string "It dug the wall in front!\0" -.align 2, 0 - -.global gUnknown_80FD3F0 -gUnknown_80FD3F0: @ 80FD3F0 -@ replacing .incbin "baserom.gba", 0xFD3F0, 0x1C -.4byte gUnknown_80FD3D4 - -.global gUnknown_80FD3F4 -gUnknown_80FD3F4: @ 80FD3F4 -.string "Can't use that here!\0" -.align 2, 0 - -.global gUnknown_80FD40C -gUnknown_80FD40C: @ 80FD40C -@ replacing .incbin "baserom.gba", 0xFD40C, 0x24 -.4byte gUnknown_80FD3F4 - -.global gUnknown_80FD410 -gUnknown_80FD410: @ 80FD410 -.string "Can't use that diagonally!\0" -.align 2, 0 - -.global gUnknown_80FD430 -gUnknown_80FD430: @ 80FD430 -@ replacing .incbin "baserom.gba", 0xFD430, 0x4 -.4byte gUnknown_80FD410 - -.global gUnknown_80FD434 -gUnknown_80FD434: @ 80FD434 -@ replacing .incbin "baserom.gba", 0xFD434, 0x1C -.4byte gUnknown_80FBEA4 - -.global gUnknown_80FD438 -gUnknown_80FD438: @ 80FD438 -.string "{POKEMON_0} can't transform!\0" -.align 2, 0 - -.global gUnknown_80FD450 -gUnknown_80FD450: @ 80FD450 -@ replacing .incbin "baserom.gba", 0xFD450, 0x4 -.4byte gUnknown_80FD438 - -.global gUnknown_80FD454 -gUnknown_80FD454: @ 80FD454 -@ replacing .incbin "baserom.gba", 0xFD454, 0x18 -.4byte gUnknown_80FB568 - -.global gUnknown_80FD458 -gUnknown_80FD458: @ 80FD458 -.string "{POKEMON_1} was revived!\0" -.align 2, 0 - -.global gUnknown_80FD46C -gUnknown_80FD46C: @ 80FD46C -@ replacing .incbin "baserom.gba", 0xFD46C, 0x18 -.4byte gUnknown_80FD458 - -.global gUnknown_80FD470 -gUnknown_80FD470: @ 80FD470 -.string "{POKEMON_0} possessed {POKEMON_1}!\0" -.align 2, 0 - -.global gUnknown_80FD484 -gUnknown_80FD484: @ 80FD484 -@ replacing .incbin "baserom.gba", 0xFD484, 0x2C -.4byte gUnknown_80FD470 - -.global gUnknown_80FD488 -gUnknown_80FD488: @ 80FD488 -.string "The target's stench is overwhelming!\0" -.align 2, 0 - -.global gUnknown_80FD4B0 -gUnknown_80FD4B0: @ 80FD4B0 -@ replacing .incbin "baserom.gba", 0xFD4B0, 0x14 -.4byte gUnknown_80FD488 - -.global gUnknown_80FD4B4 -gUnknown_80FD4B4: @ 80FD4B4 -.string "{POKEMON_0} escaped!\0" -.align 2, 0 - -.global gUnknown_80FD4C4 -gUnknown_80FD4C4: @ 80FD4C4 -@ replacing .incbin "baserom.gba", 0xFD4C4, 0x18 -.4byte gUnknown_80FD4B4 - -.global gUnknown_80FD4C8 -gUnknown_80FD4C8: @ 80FD4C8 -.string "{POKEMON_0} can't escape!\0" -.align 2, 0 - -.global gUnknown_80FD4DC -gUnknown_80FD4DC: @ 80FD4DC -@ replacing .incbin "baserom.gba", 0xFD4DC, 0x24 -.4byte gUnknown_80FD4C8 - -.global gUnknown_80FD4E0 -gUnknown_80FD4E0: @ 80FD4E0 -.string "{POKEMON_0} was protected by its Band!\0" -.align 2, 0 - -.global gUnknown_80FD500 -gUnknown_80FD500: @ 80FD500 -@ replacing .incbin "baserom.gba", 0xFD500, 0x24 -.4byte gUnknown_80FD4E0 - -.global gUnknown_80FD504 -gUnknown_80FD504: @ 80FD504 -.string "{POKEMON_0} was protected by its Scarf!\0" -.align 2, 0 - -.global gUnknown_80FD524 -gUnknown_80FD524: @ 80FD524 -@ replacing .incbin "baserom.gba", 0xFD524, 0x24 -.4byte gUnknown_80FD504 - -.global gUnknown_80FD528 -gUnknown_80FD528: @ 80FD528 -.string "{POKEMON_0} was protected by its Scope!\0" -.align 2, 0 - -.global gUnknown_80FD548 -gUnknown_80FD548: @ 80FD548 -@ replacing .incbin "baserom.gba", 0xFD548, 0x8 -.4byte gUnknown_80FD528 -.4byte gUnknown_80FD528 - -.global gUnknown_80FD550 -gUnknown_80FD550: @ 80FD550 -@ replacing .incbin "baserom.gba", 0xFD550, 0x24 -.4byte gUnknown_80FD4E0 - -.global gUnknown_80FD554 -gUnknown_80FD554: @ 80FD554 -.string "{POKEMON_1} was protected by its Specs!\0" -.align 2, 0 - -.global gUnknown_80FD574 -gUnknown_80FD574: @ 80FD574 -@ replacing .incbin "baserom.gba", 0xFD574, 0x4 -.4byte gUnknown_80FD554 - -.global gUnknown_80FD578 -gUnknown_80FD578: @ 80FD578 -@ replacing .incbin "baserom.gba", 0xFD578, 0x4 -.4byte gUnknown_80FD554 - -.global gUnknown_80FD57C -gUnknown_80FD57C: @ 80FD57C -@ replacing .incbin "baserom.gba", 0xFD57C, 0x18 -.4byte gUnknown_80FD554 - -.global gUnknown_80FD580 -gUnknown_80FD580: @ 80FD580 -.string "Getting hungry...\0" -.align 2, 0 - -.global gUnknown_80FD594 -gUnknown_80FD594: @ 80FD594 -@ replacing .incbin "baserom.gba", 0xFD594, 0x24 -.4byte gUnknown_80FD580 - -.global gUnknown_80FD598 -gUnknown_80FD598: @ 80FD598 -.string "Getting dizzy from hunger...\0" -.align 2, 0 - -.global gUnknown_80FD5B8 -gUnknown_80FD5B8: @ 80FD5B8 -@ replacing .incbin "baserom.gba", 0xFD5B8, 0x24 -.4byte gUnknown_80FD598 - -.global gUnknown_80FD5BC -gUnknown_80FD5BC: @ 80FD5BC -.string "Oh, no! Your Belly's empty!\0" -.align 2, 0 - -.global gUnknown_80FD5DC -gUnknown_80FD5DC: @ 80FD5DC -@ replacing .incbin "baserom.gba", 0xFD5DC, 0x2C -.4byte gUnknown_80FD5BC - -.global gUnknown_80FD5E0 -gUnknown_80FD5E0: @ 80FD5E0 -.string "Hurry! You've got to eat something!\0" -.align 2, 0 - -.global gUnknown_80FD608 -gUnknown_80FD608: @ 80FD608 -@ replacing .incbin "baserom.gba", 0xFD608, 0x20 -.4byte gUnknown_80FD5E0 - -.global gUnknown_80FD60C -gUnknown_80FD60C: @ 80FD60C -.string "You'll faint from hunger!\0" -.align 2, 0 - -.global gUnknown_80FD628 -gUnknown_80FD628: @ 80FD628 -@ replacing .incbin "baserom.gba", 0xFD628, 0x1C -.4byte gUnknown_80FD60C - -.global gUnknown_80FD62C -gUnknown_80FD62C: @ 80FD62C -.string "Its IQ didn't change.\0" -.align 2, 0 - -.global gUnknown_80FD644 -gUnknown_80FD644: @ 80FD644 -@ replacing .incbin "baserom.gba", 0xFD644, 0x4 -.4byte gUnknown_80FD62C - -.global gUnknown_80FD648 -gUnknown_80FD648: @ 80FD648 -@ replacing .incbin "baserom.gba", 0xFD648, 0xA0 -.4byte gUnknown_80FD6C8 -.4byte gUnknown_80FD6A8 -.4byte gUnknown_80FD67C -.4byte gUnknown_80FD658 - -.global gUnknown_80FD658 -gUnknown_80FD658: @ 80FD658 -.string "It seemed to be somewhat satisfied.\0" -.align 2, 0 - -.global gUnknown_80FD67C -gUnknown_80FD67C: @ 80FD67C -.string "It doesn't seem to dislike this Gummi.\0" -.align 2, 0 - -.global gUnknown_80FD6A8 -gUnknown_80FD6A8: @ 80FD6A8 -.string "It seems to like this Gummi!\0" -.align 2, 0 - -.global gUnknown_80FD6C8 -gUnknown_80FD6C8: @ 80FD6C8 -.string "It seems to love this Gummi!\0" -.align 2, 0 - -.global gUnknown_80FD6E8 -gUnknown_80FD6E8: @ 80FD6E8 -@ replacing .incbin "baserom.gba", 0xFD6E8, 0xA0 -.4byte gUnknown_80FD75C -.4byte gUnknown_80FD740 -.4byte gUnknown_80FD728 -.4byte gUnknown_80FD710 -.4byte gUnknown_80FD6FC - -.global gUnknown_80FD6FC -gUnknown_80FD6FC: @ 80FD6FC -.string "IQ didn't change.\0" -.align 2, 0 - -.global gUnknown_80FD710 -gUnknown_80FD710: @ 80FD710 -.string "IQ went up slightly!\0" -.align 2, 0 - -.global gUnknown_80FD728 -gUnknown_80FD728: @ 80FD728 -.string "IQ went up somewhat!\0" -.align 2, 0 - -.global gUnknown_80FD740 -gUnknown_80FD740: @ 80FD740 -.string "IQ went up significantly!\0" -.align 2, 0 - -.global gUnknown_80FD75C -gUnknown_80FD75C: @ 80FD75C -.string "IQ rose sharply!\0" -.align 2, 0 - -.global gUnknown_80FD770 -gUnknown_80FD770: @ 80FD770 -.string "A food item went bad.\0" -.align 2, 0 - -.global gUnknown_80FD788 -gUnknown_80FD788: @ 80FD788 -@ replacing .incbin "baserom.gba", 0xFD788, 0x24 -.4byte gUnknown_80FD770 - -.global gUnknown_80FD78C -gUnknown_80FD78C: @ 80FD78C -.string "Several food items went bad.\0" -.align 2, 0 - -.global gUnknown_80FD7AC -gUnknown_80FD7AC: @ 80FD7AC -@ replacing .incbin "baserom.gba", 0xFD7AC, 0x28 -.4byte gUnknown_80FD78C - -.global gUnknown_80FD7B0 -gUnknown_80FD7B0: @ 80FD7B0 -.string "Nothing particularly bad happened.\0" -.align 2, 0 - -.global gUnknown_80FD7D4 -gUnknown_80FD7D4: @ 80FD7D4 -@ replacing .incbin "baserom.gba", 0xFD7D4, 0x20 -.4byte gUnknown_80FD7B0 - -.global gUnknown_80FD7D8 -gUnknown_80FD7D8: @ 80FD7D8 -.string "Stepped on something weird!\0" -.align 2, 0 - -.global gUnknown_80FD7F4 -gUnknown_80FD7F4: @ 80FD7F4 -@ replacing .incbin "baserom.gba", 0xFD7F4, 0x4 -.4byte gUnknown_80FD7D8 - -.global gUnknown_80FD7F8 -gUnknown_80FD7F8: @ 80FD7F8 -@ replacing .incbin "baserom.gba", 0xFD7F8, 0x288 -.4byte gUnknown_80FDA48 -.4byte gUnknown_80FDA28 -.4byte gUnknown_80FDA0C -.4byte gUnknown_80FD9E8 -.4byte gUnknown_80FD9BC -.4byte gUnknown_80FD9B4 -.4byte gUnknown_80FD9A0 -.4byte gUnknown_80FD98C -.4byte gUnknown_80FD974 -.4byte gUnknown_80FD95C -.4byte gUnknown_80FD944 -.4byte gUnknown_80FD92C -.4byte gUnknown_80FD914 -.4byte gUnknown_80FD8F4 -.4byte gUnknown_80FD8D4 -.4byte gUnknown_80FD8B8 -.4byte gUnknown_80FD89C -.4byte gUnknown_80FD880 -.4byte gUnknown_80FD864 -.4byte gUnknown_80FD848 - -.global gUnknown_80FD848 -gUnknown_80FD848: @ 80FD848 -.string "Stepped on a Spiked Tile!\0" -.align 2, 0 - -.global gUnknown_80FD864 -gUnknown_80FD864: @ 80FD864 -.string "Stepped on a Pokémon Trap!\0" -.align 2, 0 - -.global gUnknown_80FD880 -gUnknown_80FD880: @ 80FD880 -.string "Stepped on a Wonder Tile!\0" -.align 2, 0 - -.global gUnknown_80FD89C -gUnknown_80FD89C: @ 80FD89C -.string "Stepped on a Chestnut Trap!\0" -.align 2, 0 - -.global gUnknown_80FD8B8 -gUnknown_80FD8B8: @ 80FD8B8 -.string "Stepped on a PP-Zero Trap!\0" -.align 2, 0 - -.global gUnknown_80FD8D4 -gUnknown_80FD8D4: @ 80FD8D4 -.string "Stepped on an Explosion Trap!\0" -.align 2, 0 - -.global gUnknown_80FD8F4 -gUnknown_80FD8F4: @ 80FD8F4 -.string "Stepped on a Selfdestruct Trap!\0" -.align 2, 0 - -.global gUnknown_80FD914 -gUnknown_80FD914: @ 80FD914 -.string "Poison spikes shot out!\0" -.align 2, 0 - -.global gUnknown_80FD92C -gUnknown_80FD92C: @ 80FD92C -.string "Stepped on a Seal Trap!\0" -.align 2, 0 - -.global gUnknown_80FD944 -gUnknown_80FD944: @ 80FD944 -.string "Stepped on a Slow Trap!\0" -.align 2, 0 - -.global gUnknown_80FD95C -gUnknown_80FD95C: @ 80FD95C -.string "Sleeping gas erupted!\0" -.align 2, 0 - -.global gUnknown_80FD974 -gUnknown_80FD974: @ 80FD974 -.string "The trap spun around!\0" -.align 2, 0 - -.global gUnknown_80FD98C -gUnknown_80FD98C: @ 80FD98C -.string "A sudden gust blew!\0" -.align 2, 0 - -.global gUnknown_80FD9A0 -gUnknown_80FD9A0: @ 80FD9A0 -.string "Stepped on a {POKEMON_0}!\0" -.align 2, 0 - -.global gUnknown_80FD9B4 -gUnknown_80FD9B4: @ 80FD9B4 -.string "{POKEMON_0}!\0" -.align 2, 0 - -.global gUnknown_80FD9BC -gUnknown_80FD9BC: @ 80FD9BC -.string "A sweet, Pokémon-attracting aroma\n" -.string "spread!\0" -.align 2, 0 - -.global gUnknown_80FD9E8 -gUnknown_80FD9E8: @ 80FD9E8 -.string "Sludge splashed up from the ground!\0" -.align 2, 0 - -.global gUnknown_80FDA0C -gUnknown_80FDA0C: @ 80FDA0C -.string "Stepped on a Sticky Trap!\0" -.align 2, 0 - -.global gUnknown_80FDA28 -gUnknown_80FDA28: @ 80FDA28 -.string "Mud splashed up from the {POKEMON_0}!\0" -.align 2, 0 - -.global gUnknown_80FDA48 -gUnknown_80FDA48: @ 80FDA48 -.string "There was a {POKEMON_0} underfoot!\0" -.align 2, 0 - -.global gUnknown_80FDA64 -gUnknown_80FDA64: @ 80FDA64 -.string "The move {MOVE_ITEM_0} lost its PP!\0" -.align 2, 0 - -.global gUnknown_80FDA80 -gUnknown_80FDA80: @ 80FDA80 -@ replacing .incbin "baserom.gba", 0xFDA80, 0x20 -.4byte gUnknown_80FDA64 - -.global gUnknown_80FDA84 -gUnknown_80FDA84: @ 80FDA84 -.string "All PP are already gone!\0" -.align 2, 0 - -.global gUnknown_80FDAA0 -gUnknown_80FDAA0: @ 80FDAA0 -@ replacing .incbin "baserom.gba", 0xFDAA0, 0x2C -.4byte gUnknown_80FDA84 - -.global gUnknown_80FDAA4 -gUnknown_80FDAA4: @ 80FDAA4 -.string "Unclaimed items turned into Pokémon!\0" -.align 2, 0 - -.global gUnknown_80FDACC -gUnknown_80FDACC: @ 80FDACC -@ replacing .incbin "baserom.gba", 0xFDACC, 0x18 -.4byte gUnknown_80FDAA4 - -.global gUnknown_80FDAD0 -gUnknown_80FDAD0: @ 80FDAD0 -.string "Nothing happened!\0" -.align 2, 0 - -.global gUnknown_80FDAE4 -gUnknown_80FDAE4: @ 80FDAE4 -@ replacing .incbin "baserom.gba", 0xFDAE4, 0x20 -.4byte gUnknown_80FDAD0 - -.global gUnknown_80FDAE8 -gUnknown_80FDAE8: @ 80FDAE8 -.string "The move {MOVE_ITEM_0} was sealed!\0" -.align 2, 0 - -.global gUnknown_80FDB04 -gUnknown_80FDB04: @ 80FDB04 -@ replacing .incbin "baserom.gba", 0xFDB04, 0x28 -.4byte gUnknown_80FDAE8 - -.global gUnknown_80FDB08 -gUnknown_80FDB08: @ 80FDB08 -.string "All the moves are sealed already!\0" -.align 2, 0 - -.global gUnknown_80FDB2C -gUnknown_80FDB2C: @ 80FDB2C -@ replacing .incbin "baserom.gba", 0xFDB2C, 0x30 -.4byte gUnknown_80FDB08 - -.global gUnknown_80FDB30 -gUnknown_80FDB30: @ 80FDB30 -.string "Its Scarf stopped the trap from\n" -.string "springing!\0" -.align 2, 0 - -.global gUnknown_80FDB5C -gUnknown_80FDB5C: @ 80FDB5C -@ replacing .incbin "baserom.gba", 0xFDB5C, 0x20 -.4byte gUnknown_80FDB30 - -.global gUnknown_80FDB60 -gUnknown_80FDB60: @ 80FDB60 -.string "The trap failed to work!\0" -.align 2, 0 - -.global gUnknown_80FDB7C -gUnknown_80FDB7C: @ 80FDB7C -@ replacing .incbin "baserom.gba", 0xFDB7C, 0x24 -.4byte gUnknown_80FDB60 - -.global gUnknown_80FDB80 -gUnknown_80FDB80: @ 80FDB80 -.string "But there is no one in the way!\0" -.align 2, 0 - -.global gUnknown_80FDBA0 -gUnknown_80FDBA0: @ 80FDBA0 -@ replacing .incbin "baserom.gba", 0xFDBA0, 0x18 -.4byte gUnknown_80FDB80 - -.global gUnknown_80FDBA4 -gUnknown_80FDBA4: @ 80FDBA4 -.string "{POKEMON_0} caught the {MOVE_ITEM_0}!\0" -.align 2, 0 - -.global gUnknown_80FDBB8 -gUnknown_80FDBB8: @ 80FDBB8 -@ replacing .incbin "baserom.gba", 0xFDBB8, 0x18 -.4byte gUnknown_80FDBA4 - -.global gUnknown_80FDBBC -gUnknown_80FDBBC: @ 80FDBBC -.string "{POKEMON_0} regained PP.\0" -.align 2, 0 - -.global gUnknown_80FDBD0 -gUnknown_80FDBD0: @ 80FDBD0 -@ replacing .incbin "baserom.gba", 0xFDBD0, 0x20 -.4byte gUnknown_80FDBBC - -.global gUnknown_80FDBD4 -gUnknown_80FDBD4: @ 80FDBD4 -.string "{POKEMON_0} has full PP already!\0" -.align 2, 0 - -.global gUnknown_80FDBF0 -gUnknown_80FDBF0: @ 80FDBF0 -@ replacing .incbin "baserom.gba", 0xFDBF0, 0x28 -.4byte gUnknown_80FDBD4 - -.global gUnknown_80FDBF4 -gUnknown_80FDBF4: @ 80FDBF4 -.string "The {MOVE_ITEM_0} became sticky and\n" -.string "unusable!\0" -.align 2, 0 - -.global gUnknown_80FDC18 -gUnknown_80FDC18: @ 80FDC18 -@ replacing .incbin "baserom.gba", 0xFDC18, 0x28 -.4byte gUnknown_80FDBF4 - -.global gUnknown_80FDC1C -gUnknown_80FDC1C: @ 80FDC1C -.string "But nothing happened in particular.\0" -.align 2, 0 - -.global gUnknown_80FDC40 -gUnknown_80FDC40: @ 80FDC40 -@ replacing .incbin "baserom.gba", 0xFDC40, 0x3C -.4byte gUnknown_80FDC1C - -.global gUnknown_80FDC44 -gUnknown_80FDC44: @ 80FDC44 -.string "The No-Stick Cap prevented items from\n" -.string "getting sticky!\0" -.align 2, 0 - -.global gUnknown_80FDC7C -gUnknown_80FDC7C: @ 80FDC7C -@ replacing .incbin "baserom.gba", 0xFDC7C, 0x20 -.4byte gUnknown_80FDC44 - -.global gUnknown_80FDC80 -gUnknown_80FDC80: @ 80FDC80 -.string "The used TM was recharged!\0" -.align 2, 0 - -.global gUnknown_80FDC9C -gUnknown_80FDC9C: @ 80FDC9C -@ replacing .incbin "baserom.gba", 0xFDC9C, 0x4 -.4byte gUnknown_80FDC80 - -.global gUnknown_80FDCA0 -gUnknown_80FDCA0: @ 80FDCA0 -@ replacing .incbin "baserom.gba", 0xFDCA0, 0x4 -.4byte gUnknown_80FB568 - -.global gUnknown_80FDCA4 -gUnknown_80FDCA4: @ 80FDCA4 -@ replacing .incbin "baserom.gba", 0xFDCA4, 0x24 -.4byte gUnknown_80FC700 - -.global gUnknown_80FDCA8 -gUnknown_80FDCA8: @ 80FDCA8 -.string "{POKEMON_0} converted to\n" -.string "the {MOVE_ITEM_0} type!\0" -.align 2, 0 - -.global gUnknown_80FDCC8 -gUnknown_80FDCC8: @ 80FDCC8 -@ replacing .incbin "baserom.gba", 0xFDCC8, 0x1C -.4byte gUnknown_80FDCA8 - -.global gUnknown_80FDCCC -gUnknown_80FDCCC: @ 80FDCCC -.string "{POKEMON_0} mimicked its foe!\0" -.align 2, 0 - -.global gUnknown_80FDCE4 -gUnknown_80FDCE4: @ 80FDCE4 -@ replacing .incbin "baserom.gba", 0xFDCE4, 0x1C -.4byte gUnknown_80FDCCC - -.global gUnknown_80FDCE8 -gUnknown_80FDCE8: @ 80FDCE8 -.string "{POKEMON_0}'s Mimic failed!\0" -.align 2, 0 - -.global gUnknown_80FDD00 -gUnknown_80FDD00: @ 80FDD00 -@ replacing .incbin "baserom.gba", 0xFDD00, 0x20 -.4byte gUnknown_80FDCE8 - -.global gUnknown_80FDD04 -gUnknown_80FDD04: @ 80FDD04 -.string "The move was passed off!\0" -.align 2, 0 - -.global gUnknown_80FDD20 -gUnknown_80FDD20: @ 80FDD20 -@ replacing .incbin "baserom.gba", 0xFDD20, 0x28 -.4byte gUnknown_80FDD04 - -.global gUnknown_80FDD24 -gUnknown_80FDD24: @ 80FDD24 -.string "There's no one to pass off to!\0" -.align 2, 0 - -.global gUnknown_80FDD48 -gUnknown_80FDD48: @ 80FDD48 -@ replacing .incbin "baserom.gba", 0xFDD48, 0x40 -.4byte gUnknown_80FDD24 - -.global gUnknown_80FDD4C -gUnknown_80FDD4C: @ 80FDD4C -.string "A mysterious force prevents moves\n" -.string "from being passed off!\0" -.align 2, 0 - -.global gUnknown_80FDD88 -gUnknown_80FDD88: @ 80FDD88 -@ replacing .incbin "baserom.gba", 0xFDD88, 0x20 -.4byte gUnknown_80FDD4C - -.global gUnknown_80FDD8C -gUnknown_80FDD8C: @ 80FDD8C -.string "The attack was passed off!\0" -.align 2, 0 - -.global gUnknown_80FDDA8 -gUnknown_80FDDA8: @ 80FDDA8 -@ replacing .incbin "baserom.gba", 0xFDDA8, 0x4 -.4byte gUnknown_80FDD8C - -.global gUnknown_80FDDAC -gUnknown_80FDDAC: @ 80FDDAC -@ replacing .incbin "baserom.gba", 0xFDDAC, 0x24 -.4byte gUnknown_80FDD24 - -.global gUnknown_80FDDB0 -gUnknown_80FDDB0: @ 80FDDB0 -.string "The closed corridor was opened!\0" -.align 2, 0 - -.global gUnknown_80FDDD0 -gUnknown_80FDDD0: @ 80FDDD0 -@ replacing .incbin "baserom.gba", 0xFDDD0, 0x20 -.4byte gUnknown_80FDDB0 - -.global gUnknown_80FDDD4 -gUnknown_80FDDD4: @ 80FDDD4 -.string "It can't be used here!\0" -.align 2, 0 - -.global gUnknown_80FDDF0 -gUnknown_80FDDF0: @ 80FDDF0 -@ replacing .incbin "baserom.gba", 0xFDDF0, 0x28 -.4byte gUnknown_80FDDD4 - -.global gUnknown_80FDDF4 -gUnknown_80FDDF4: @ 80FDDF4 -.string "There is nothing at {POKEMON_0}'s feet.\0" -.align 2, 0 - -.global gUnknown_80FDE18 -gUnknown_80FDE18: @ 80FDE18 -@ replacing .incbin "baserom.gba", 0xFDE18, 0x54 -.4byte gUnknown_80FDDF4 - -.global gUnknown_80FDE1C -gUnknown_80FDE1C: @ 80FDE1C -.string "Your adventure to this point will be saved\n" -.string "in preparation for shutting down.\0" -.align 2, 0 - -.global gUnknown_80FDE6C -gUnknown_80FDE6C: @ 80FDE6C -@ replacing .incbin "baserom.gba", 0xFDE6C, 0x4C -.4byte gUnknown_80FDE1C - -.global gUnknown_80FDE70 -gUnknown_80FDE70: @ 80FDE70 -.string "Give up on this adventure?\n" -.string "If you do, it will be treated as a defeat.\0" -.align 2, 0 - -.global gUnknown_80FDEB8 -gUnknown_80FDEB8: @ 80FDEB8 -@ replacing .incbin "baserom.gba", 0xFDEB8, 0x48 -.4byte gUnknown_80FDE70 - -.global gUnknown_80FDEBC -gUnknown_80FDEBC: @ 80FDEBC -.string "Will the linked moves be forgotten,\n" -.string "including the selected {MOVE_ITEM_0}?\0" -.align 2, 0 - -.global gUnknown_80FDF00 -gUnknown_80FDF00: @ 80FDF00 -@ replacing .incbin "baserom.gba", 0xFDF00, 0x40 -.4byte gUnknown_80FDEBC - -.global gUnknown_80FDF04 -gUnknown_80FDF04: @ 80FDF04 -.string "Only four moves may be learned!\n" -.string "Will a move be forgotten?\0" -.align 2, 0 - -.global gUnknown_80FDF40 -gUnknown_80FDF40: @ 80FDF40 -@ replacing .incbin "baserom.gba", 0xFDF40, 0x30 -.4byte gUnknown_80FDF04 - -.global gUnknown_80FDF44 -gUnknown_80FDF44: @ 80FDF44 -.string "The move {MOVE_ITEM_0} will be\n" -.string "forgotten.\n" -.string "Is that OK?\0" -.align 2, 0 - -.global gUnknown_80FDF70 -gUnknown_80FDF70: @ 80FDF70 -@ replacing .incbin "baserom.gba", 0xFDF70, 0x48 -.4byte gUnknown_80FDF44 - -.global gUnknown_80FDF74 -gUnknown_80FDF74: @ 80FDF74 -.string "The chosen Pokémon will leave the Friend\n" -.string "Area forever.\n" -.string "Is that OK?\0" -.align 2, 0 - -.global gUnknown_80FDFB8 -gUnknown_80FDFB8: @ 80FDFB8 -@ replacing .incbin "baserom.gba", 0xFDFB8, 0x30 -.4byte gUnknown_80FDF74 - -.global gUnknown_80FDFBC -gUnknown_80FDFBC: @ 80FDFBC -.string "{R_BUTTON} + {DPAD}: Shift moves\n" -.string "{SELECT_BUTTON}: Switch set moves\0" -.align 2, 0 - -.global gUnknown_80FDFE8 -gUnknown_80FDFE8: @ 80FDFE8 -@ replacing .incbin "baserom.gba", 0xFDFE8, 0x20 -.4byte gUnknown_80FDFBC - -.global gUnknown_80FDFEC -gUnknown_80FDFEC: @ 80FDFEC -.string "{POKEMON_0} can't talk just now.\0" -.align 2, 0 - -.global gUnknown_80FE008 -gUnknown_80FE008: @ 80FE008 -@ replacing .incbin "baserom.gba", 0xFE008, 0x2C -.4byte gUnknown_80FDFEC - -.global gUnknown_80FE00C -gUnknown_80FE00C: @ 80FE00C -.string "There are no items that can be trawled!\0" -.align 2, 0 - -.global gUnknown_80FE034 -gUnknown_80FE034: @ 80FE034 -@ replacing .incbin "baserom.gba", 0xFE034, 0x2C -.4byte gUnknown_80FE00C - -.global gUnknown_80FE038 -gUnknown_80FE038: @ 80FE038 -.string "All unclaimed items were drawn close!\0" -.align 2, 0 - -.global gUnknown_80FE060 -gUnknown_80FE060: @ 80FE060 -@ replacing .incbin "baserom.gba", 0xFE060, 0x4C -.4byte gUnknown_80FE038 - -.global gUnknown_80FE064 -gUnknown_80FE064: @ 80FE064 -.string "There is no room on your team to accept\n" -.string "the guest rescue team's {POKEMON_0}.\0" -.align 2, 0 - -.global gUnknown_80FE0AC -gUnknown_80FE0AC: @ 80FE0AC -@ replacing .incbin "baserom.gba", 0xFE0AC, 0x48 -.4byte gUnknown_80FE064 - -.global gUnknown_80FE0B0 -gUnknown_80FE0B0: @ 80FE0B0 -.string "There is no room on your team to fit\n" -.string "the {POKEMON_0} that needs your help.\0" -.align 2, 0 - -.global gUnknown_80FE0F4 -gUnknown_80FE0F4: @ 80FE0F4 -@ replacing .incbin "baserom.gba", 0xFE0F4, 0x4 -.4byte gUnknown_80FE0B0 - -.global gUnknown_80FE0F8 -gUnknown_80FE0F8: @ 80FE0F8 -@ replacing .incbin "baserom.gba", 0xFE0F8, 0x3C -.4byte gUnknown_80FE0B0 - -.global gUnknown_80FE0FC -gUnknown_80FE0FC: @ 80FE0FC -.string "The guest rescue team's {POKEMON_0}\n" -.string "joined your rescue team!\0" -.align 2, 0 - -.global gUnknown_80FE134 -gUnknown_80FE134: @ 80FE134 -@ replacing .incbin "baserom.gba", 0xFE134, 0x34 -.4byte gUnknown_80FE0FC - -.global gUnknown_80FE138 -gUnknown_80FE138: @ 80FE138 -.string "Your client, {POKEMON_0}, joined\n" -.string "your rescue team!\0" -.align 2, 0 - -.global gUnknown_80FE168 -gUnknown_80FE168: @ 80FE168 -@ replacing .incbin "baserom.gba", 0xFE168, 0x3C -.4byte gUnknown_80FE138 - -.global gUnknown_80FE16C -gUnknown_80FE16C: @ 80FE16C -.string "The Friend Area {MOVE_ITEM_0} is\n" -.string "full.\n" -.string "A friend must be released.\0" -.align 2, 0 - -.global gUnknown_80FE1A4 -gUnknown_80FE1A4: @ 80FE1A4 -@ replacing .incbin "baserom.gba", 0xFE1A4, 0x68 -.4byte gUnknown_80FE16C - -.global gUnknown_80FE1A8 -gUnknown_80FE1A8: @ 80FE1A8 -.string "If you dismiss this Pokémon,\n" -.string "it may never again join your rescue team.\n" -.string "Bid farewell to it anyway?\0" -.align 2, 0 - -.global gUnknown_80FE20C -gUnknown_80FE20C: @ 80FE20C -@ replacing .incbin "baserom.gba", 0xFE20C, 0x5C -.4byte gUnknown_80FE1A8 - -.global gUnknown_80FE210 -gUnknown_80FE210: @ 80FE210 -.string "Would you like to get help using a distress\n" -.string "call or get the password for getting\n" -.string "help?\0" -.align 2, 0 - -.global gUnknown_80FE268 -gUnknown_80FE268: @ 80FE268 -@ replacing .incbin "baserom.gba", 0xFE268, 0x24 -.4byte gUnknown_80FE210 - -.global gUnknown_80FE26C -gUnknown_80FE26C: @ 80FE26C -.string "A call for help will be issued.\0" -.align 2, 0 - -.global gUnknown_80FE28C -gUnknown_80FE28C: @ 80FE28C -@ replacing .incbin "baserom.gba", 0xFE28C, 0x44 -.4byte gUnknown_80FE26C - -.global gUnknown_80FE290 -gUnknown_80FE290: @ 80FE290 -.string "Your rescue team is not eligible to\n" -.string "receive any more rescues.\0" -.align 2, 0 - -.global gUnknown_80FE2D0 -gUnknown_80FE2D0: @ 80FE2D0 -@ replacing .incbin "baserom.gba", 0xFE2D0, 0x1C -.4byte gUnknown_80FE290 - -.global gUnknown_80FE2D4 -gUnknown_80FE2D4: @ 80FE2D4 -.string "{POKEMON_0} evolved into {POKEMON_1}!\0" -.align 2, 0 - -.global gUnknown_80FE2EC -gUnknown_80FE2EC: @ 80FE2EC -@ replacing .incbin "baserom.gba", 0xFE2EC, 0x1C -.4byte gUnknown_80FE2D4 - -.global gUnknown_80FE2F0 -gUnknown_80FE2F0: @ 80FE2F0 -.string "It's a monster house!\0" -.align 2, 0 - -.global gPtrItsaMonsterHouseMessage -gPtrItsaMonsterHouseMessage: @ 80FE308 -@ replacing .incbin "baserom.gba", 0xFE308, 0x28 -.4byte gUnknown_80FE2F0 - -.global gUnknown_80FE30C -gUnknown_80FE30C: @ 80FE30C -.string "It became the move {MOVE_ITEM_0}'s type!\0" -.align 2, 0 - -.global gUnknown_80FE330 -gUnknown_80FE330: @ 80FE330 -@ replacing .incbin "baserom.gba", 0xFE330, 0x3C -.4byte gUnknown_80FE30C - -.global gUnknown_80FE334 -gUnknown_80FE334: @ 80FE334 -.string "There were no moves that could be used\n" -.string "for Conversion!\0" -.align 2, 0 - -.global gUnknown_80FE36C -gUnknown_80FE36C: @ 80FE36C -@ replacing .incbin "baserom.gba", 0xFE36C, 0x20 -.4byte gUnknown_80FE334 - -.global gUnknown_80FE370 -gUnknown_80FE370: @ 80FE370 -.string "The move {MOVE_ITEM_0} was sketched!\0" -.align 2, 0 - -.global gUnknown_80FE38C -gUnknown_80FE38C: @ 80FE38C -@ replacing .incbin "baserom.gba", 0xFE38C, 0x30 -.4byte gUnknown_80FE370 - -.global gUnknown_80FE390 -gUnknown_80FE390: @ 80FE390 -.string "There were no moves that could be\n" -.string "sketched!\0" -.align 2, 0 - -.global gUnknown_80FE3BC -gUnknown_80FE3BC: @ 80FE3BC -@ replacing .incbin "baserom.gba", 0xFE3BC, 0x2C -.4byte gUnknown_80FE390 - -.global gUnknown_80FE3C0 -gUnknown_80FE3C0: @ 80FE3C0 -.string "{MOVE_ITEM_0} is all sticky!\n" -.string "It doesn't work!\0" -.align 2, 0 - -.global gItemStickyDoesntWorkText -gItemStickyDoesntWorkText: @ 80FE3E8 -@ replacing .incbin "baserom.gba", 0xFE3E8, 0x24 -.4byte gUnknown_80FE3C0 - -.global gUnknown_80FE3EC -gUnknown_80FE3EC: @ 80FE3EC -.string "{POKEMON_0} learned the move\n" -.string "{MOVE_ITEM_0}.\0" -.align 2, 0 -.4byte gUnknown_80FE3EC - -.global gUnknown_80FE40C -gUnknown_80FE40C: @ 80FE40C -@ replacing .incbin "baserom.gba", 0xFE40C, 0x28 -.4byte gUnknown_80FB568 - -.global gUnknown_80FE410 -gUnknown_80FE410: @ 80FE410 -.string "Lucky! The move got a lot stronger!\0" -.align 2, 0 - -.global gUnknown_80FE434 -gUnknown_80FE434: @ 80FE434 -@ replacing .incbin "baserom.gba", 0xFE434, 0x20 -.4byte gUnknown_80FE410 - -.global gUnknown_80FE438 -gUnknown_80FE438: @ 80FE438 -.string "The set move got stronger!\0" -.align 2, 0 - -.global gUnknown_80FE454 -gUnknown_80FE454: @ 80FE454 -@ replacing .incbin "baserom.gba", 0xFE454, 0x4 -.4byte gUnknown_80FE438 - -.global gUnknown_80FE458 -gUnknown_80FE458: @ 80FE458 -@ replacing .incbin "baserom.gba", 0xFE458, 0x20 -.4byte gUnknown_80FB568 - -.global gUnknown_80FE45C -gUnknown_80FE45C: @ 80FE45C -.string "{POKEMON_0} had second thoughts!\0" -.align 2, 0 - -.global gUnknown_80FE478 -gUnknown_80FE478: @ 80FE478 -@ replacing .incbin "baserom.gba", 0xFE478, 0x40 -.4byte gUnknown_80FE45C - -.global gUnknown_80FE47C -gUnknown_80FE47C: @ 80FE47C -.string "Help! Thief! I've been robbed!\n" -.string "Help me catch the thief!\0" -.align 2, 0 - -.global gUnknown_80FE4B8 -gUnknown_80FE4B8: @ 80FE4B8 -@ replacing .incbin "baserom.gba", 0xFE4B8, 0x1C -.4byte gUnknown_80FE47C - -.global gUnknown_80FE4BC -gUnknown_80FE4BC: @ 80FE4BC -.string "Thank you so very much.\0" -.align 2, 0 - -.global gUnknown_80FE4D4 -gUnknown_80FE4D4: @ 80FE4D4 -@ replacing .incbin "baserom.gba", 0xFE4D4, 0x20 -.4byte gUnknown_80FE4BC - -.global gUnknown_80FE4D8 -gUnknown_80FE4D8: @ 80FE4D8 -.string "Your patronage is valued.\0" -.align 2, 0 - -.global gUnknown_80FE4F4 -gUnknown_80FE4F4: @ 80FE4F4 -@ replacing .incbin "baserom.gba", 0xFE4F4, 0x2C -.4byte gUnknown_80FE4D8 - -.global gUnknown_80FE4F8 -gUnknown_80FE4F8: @ 80FE4F8 -.string "You don't seem to have enough money.\0" -.align 2, 0 - -.global gUnknown_80FE520 -gUnknown_80FE520: @ 80FE520 -@ replacing .incbin "baserom.gba", 0xFE520, 0x48 -.4byte gUnknown_80FE4F8 - -.global gUnknown_80FE524 -gUnknown_80FE524: @ 80FE524 -.string "The merchandise you have chosen\n" -.string "costs {VALUE_0} {POKE}.\n" -.string "Is that acceptable?\0" -.align 2, 0 - -.global gUnknown_80FE568 -gUnknown_80FE568: @ 80FE568 -@ replacing .incbin "baserom.gba", 0xFE568, 0x58 -.4byte gUnknown_80FE524 - -.global gUnknown_80FE56C -gUnknown_80FE56C: @ 80FE56C -.string "For the merchandise you have left me,\n" -.string "I shall pay {VALUE_0} {POKE}.\n" -.string "Is that acceptable?\0" -.align 2, 0 - -.global gUnknown_80FE5C0 -gUnknown_80FE5C0: @ 80FE5C0 -@ replacing .incbin "baserom.gba", 0xFE5C0, 0x30 -.4byte gUnknown_80FE56C - -.global gUnknown_80FE5C4 -gUnknown_80FE5C4: @ 80FE5C4 -.string "I'm looking forward to serving you again!\0" -.align 2, 0 - -.global gUnknown_80FE5F0 -gUnknown_80FE5F0: @ 80FE5F0 -@ replacing .incbin "baserom.gba", 0xFE5F0, 0x4C -.4byte gUnknown_80FE5C4 - -.global gUnknown_80FE5F4 -gUnknown_80FE5F4: @ 80FE5F4 -.string "That is very disappointing.\n" -.string "Please return any items\n" -.string "before you leave...\0" -.align 2, 0 - -.global gUnknown_80FE63C -gUnknown_80FE63C: @ 80FE63C -@ replacing .incbin "baserom.gba", 0xFE63C, 0x20 -.4byte gUnknown_80FE5F4 - -.global gUnknown_80FE640 -gUnknown_80FE640: @ 80FE640 -.string "I await your next visit.\0" -.align 2, 0 - -.global gUnknown_80FE65C -gUnknown_80FE65C: @ 80FE65C -@ replacing .incbin "baserom.gba", 0xFE65C, 0x18 -.4byte gUnknown_80FE640 - -.global gUnknown_80FE660 -gUnknown_80FE660: @ 80FE660 -.string "Ah, welcome〜♪\0" -.align 2, 0 - -.global gUnknown_80FE674 -gUnknown_80FE674: @ 80FE674 -@ replacing .incbin "baserom.gba", 0xFE674, 0x1C -.4byte gUnknown_80FE660 - -.global gUnknown_80FE678 -gUnknown_80FE678: @ 80FE678 -.string "{POKEMON_0} was sent flying!\0" -.align 2, 0 - -.global gUnknown_80FE690 -gUnknown_80FE690: @ 80FE690 -@ replacing .incbin "baserom.gba", 0xFE690, 0x24 -.4byte gUnknown_80FE678 - -.global gUnknown_80FE694 -gUnknown_80FE694: @ 80FE694 -.string "But it didn't go anywhere.\0" -.align 2, 0 - -.global gUnknown_80FE6B4 -gUnknown_80FE6B4: @ 80FE6B4 -@ replacing .incbin "baserom.gba", 0xFE6B4, 0x20 -.4byte gUnknown_80FE694 - -.global gUnknown_80FE6B8 -gUnknown_80FE6B8: @ 80FE6B8 -.string "{POKEMON_0} can't throw items!\0" -.align 2, 0 - -.global gUnknown_80FE6D4 -gUnknown_80FE6D4: @ 80FE6D4 -@ replacing .incbin "baserom.gba", 0xFE6D4, 0x14 -.4byte gUnknown_80FE6B8 - -.global gUnknown_80FE6D8 -gUnknown_80FE6D8: @ 80FE6D8 -.string "The Last Outing\0" -.align 2, 0 - -.global gUnknown_80FE6E8 -gUnknown_80FE6E8: @ 80FE6E8 -@ replacing .incbin "baserom.gba", 0xFE6E8, 0xC -.4byte gUnknown_80FE6D8 - -.global gUnknown_80FE6EC -gUnknown_80FE6EC: @ 80FE6EC -.string "Someone\0" -.align 2, 0 - -.global gUnknown_80FE6F4 -gUnknown_80FE6F4: @ 80FE6F4 -@ replacing .incbin "baserom.gba", 0xFE6F4, 0x14 -.4byte gUnknown_80FE6EC - -.global gUnknown_80FE6F8 -gUnknown_80FE6F8: @ 80FE6F8 -.string "Tile underfoot\0" -.align 2, 0 - -.global gUnknown_80FE708 -gUnknown_80FE708: @ 80FE708 -.4byte gUnknown_80FE6F8 - -.global gUnknown_80FE70C -gUnknown_80FE70C: @ 80FE70C -.4byte gUnknown_80F8128 - -.global gUnknown_80FE710 -gUnknown_80FE710: @ 80FE710 -.string "Rescue Point\0" -.align 2,0 - -.global gUnknown_80FE720 -gUnknown_80FE720: @ 80FE720 -.4byte gUnknown_80FE710 -@ In Dungeon Game Options Menu - -.global gUnknown_80FE724 -gUnknown_80FE724: @ 80FE724 -.4byte gUnknown_80F811C - -.global OptionsDungeonText -OptionsDungeonText: -.string "Dungeon\0" -.align 2,0 - -.global gOptionsDungeonTextPtr -gOptionsDungeonTextPtr: @ 80FE730 -.4byte OptionsDungeonText - -.global OptionsOthersText -OptionsOthersText: - -.global gUnknown_80FE734 -gUnknown_80FE734: @ 80FE734 -.string "Others\0" -.align 2,0 - -.global gOptionsOthersTextPtr -gOptionsOthersTextPtr: @ 80FE73C -.4byte OptionsOthersText - -.global OptionsDefaultText -OptionsDefaultText: -.string "Default\0" -.align 2,0 - -.global gUnknown_80FE748 -gUnknown_80FE748: @ 80FE748 -.4byte OptionsDefaultText -@ Dungeon Game Options Menu - -.global OptionsSpeed -OptionsSpeed: -.string "Speed{UNK_MACRO_3D M3D_80}Slow{UNK_MACRO_3D M3D_136}Fast\0" -.align 2,0 - -.global gUnknown_80FE764 -gUnknown_80FE764: @ 80FE764 -.4byte OptionsSpeed - -.global OptionsFarOffPals -OptionsFarOffPals: -.string "Far-off pals{UNK_MACRO_3D M3D_80}Self{UNK_MACRO_3D M3D_136}Look\0" -.align 2,0 - -.global gUnknown_80FE788 -gUnknown_80FE788: @ 80FE788 -.4byte OptionsFarOffPals - -.global OptionsDamageTurn -OptionsDamageTurn: -.string "Damage turn{UNK_MACRO_3D M3D_80}No{UNK_MACRO_3D M3D_136}Yes\0" -.align 2,0 - -.global gUnknown_80FE7A8 -gUnknown_80FE7A8: @ 80FE7A8 -.4byte OptionsDamageTurn - -.global OptionsGrid -OptionsGrid: -.string "Grids{UNK_MACRO_3D M3D_80}Off{UNK_MACRO_3D M3D_136}On\0" -.align 2,0 - -.global gUnknown_80FE7C0 -gUnknown_80FE7C0: @ 80FE7C0 -.4byte OptionsGrid - -.global OptionsMap -OptionsMap: -.string "Map{UNK_MACRO_3D M3D_80}Off{UNK_MACRO_3D M3D_120}Clear{UNK_MACRO_3D M3D_160}Shade\0" -.align 2,0 - -.global gUnknown_80FE7E4 -gUnknown_80FE7E4: @ 80FE7E4 -.4byte OptionsMap -@ Field Others Menu - -.global OptionsWindowColor -OptionsWindowColor: -.string "Windows{UNK_MACRO_3D M3D_80}Blue{UNK_MACRO_3D M3D_120}Red{UNK_MACRO_3D M3D_160}Green\0" -.align 2,0 - -.global gOptionsWindowColorPtr -gOptionsWindowColorPtr: @ 80FE808 -.4byte OptionsWindowColor -.4byte TopScreenMapData -.4byte TopScreenMapData -.4byte TopScreenMapData -.4byte TopScreenMessageLog -.4byte TopScreenMessageLog -.4byte TopScreenMessageLog -.4byte TopScreenMapAndTeam - -.global TopScreenMapAndTeam -TopScreenMapAndTeam: -.string "Top screen: Map and team\0" -.align 2,0 - -.global TopScreenMessageLog -TopScreenMessageLog: -.string "Top screen: Message log\0" -.align 2,0 - -.global TopScreenMapData -TopScreenMapData: -.string "Top screen: Team data\0" -.align 2,0 -.4byte BottomScreenNoMap -.4byte BottomScreenClearMap -.4byte BottomScreenShadedMap -.4byte BottomScreenNoMap -.4byte BottomScreenClearMap -.4byte BottomScreenShadedMap -.4byte BottomScreenNoMap - -.global BottomScreenShadedMap -BottomScreenShadedMap: -.string "Bottom screen: Shaded map\0" -.align 2,0 - -.global BottomScreenClearMap -BottomScreenClearMap: -.string "Bottom screen: Clear map\0" -.align 2,0 - -.global BottomScreenNoMap -BottomScreenNoMap: -.string "Bottom screen: No map\0" -.align 2,0 - -.global GameOptionsText -GameOptionsText: - -.global gUnknown_80FE8E0 -gUnknown_80FE8E0: @ 80FE8E0 -.string "Game Options\0" -.align 2,0 - -.global gGameOptionsTextPtr -gGameOptionsTextPtr: @ 80FE8F0 -.4byte GameOptionsText - -.global gUnknown_80FE8F4 -gUnknown_80FE8F4: @ 80FE8F4 -.4byte gUnknown_80F7EA8 - -.global gUnknown_80FE8F8 -gUnknown_80FE8F8: @ 80FE8F8 -.4byte gUnknown_80FE734 - -.global TeamToolboxAText -TeamToolboxAText: -.string "Team Toolbox A" -.align 2,0 - -.global gTeamToolboxAPtr -gTeamToolboxAPtr: @ 80FE90C -.4byte TeamToolboxAText - -.global TeamToolboxBText -TeamToolboxBText: -.string "Team Toolbox B" -.align 2,0 - -.global gTeamToolboxBPtr -gTeamToolboxBPtr: @ 80FE920 -.4byte TeamToolboxBText - -.global FieldItemMenuGroundText -FieldItemMenuGroundText: -.string "Ground\0" -.align 2,0 - -.global gFieldItemMenuGroundTextPtr -gFieldItemMenuGroundTextPtr: @ 80FE92C -.4byte FieldItemMenuGroundText - -.global ItemText_80FE930 -ItemText_80FE930: @ 80FE930 -.string "{POKEMON_0}'s item\0" -.align 2,0 - -.global gUnknown_80FE940 -gUnknown_80FE940: @ 80FE940 -.4byte ItemText_80FE930 - -.global WhichText -WhichText: -.string "Which?\0" -.align 2,0 - -.global gWhichTextPtr1 -gWhichTextPtr1: @ 80FE94C -.4byte WhichText - -.global gWhichTextPtr2 -gWhichTextPtr2: @ 80FE950 -.4byte WhichText - -.global gUnknown_80FE954 -gUnknown_80FE954: @ 80FE954 -.4byte gMenuTacticsText - -.global ItemText_80FE958 -ItemText_80FE958: @ 80FE958 -.string "{MOVE_ITEM_0}\0" -.align 2,0 - -.global gUnknown_80FE95C -gUnknown_80FE95C: @ 80FE95C -.4byte ItemText_80FE958 - -.global gUnknown_80FE960 -gUnknown_80FE960: @ 80FE960 -.4byte ItemText_80FE958 - -.global gUnknown_80FE964 -gUnknown_80FE964: @ 80FE964 -.4byte ItemText_80FE958 - -.global PokeMove_80FE968 -PokeMove_80FE968: @ 80FE968 -.string "{POKEMON_0}'s moves\0" -.align 2,0 - -.global gUnknown_80FE978 -gUnknown_80FE978: @ 80FE978 -.4byte PokeMove_80FE968 - -.global FieldMenuMovesEntry -FieldMenuMovesEntry: -.byte 0x23, 0x5f, 0x01, 0x2e -.string "Moves\0" -.align 2,0 - -.global gFieldMenuMovesPtr -gFieldMenuMovesPtr: @ 80FE988 -.4byte FieldMenuMovesEntry - -.global FieldMenuItemsEntry -FieldMenuItemsEntry: -.byte 0x23, 0x5f, 0x02, 0x2e -.string "Items\0" -.align 2,0 - -.global gFieldMenuItemsPtr -gFieldMenuItemsPtr: @ 80FE998 -.4byte FieldMenuItemsEntry - -.global FieldMenuTeamEntry -FieldMenuTeamEntry: -.byte 0x23, 0x5f, 0x03, 0x2e -.string "Team\0" -.align 2,0 - -.global gFieldMenuTeamPtr -gFieldMenuTeamPtr: @ 80FE9A8 -.4byte FieldMenuTeamEntry - -.global FieldMenuOthersEntry -FieldMenuOthersEntry: -.byte 0x23, 0x5f, 0x04, 0x2e -.string "Others\0" -.align 2,0 - -.global gFieldMenuOthersPtr -gFieldMenuOthersPtr: @ 80FE9B8 -.4byte FieldMenuOthersEntry - -.global FieldMenuGroundEntry -FieldMenuGroundEntry: -.byte 0x23, 0x5f, 0x05, 0x2e -.string "Ground\0" -.align 2,0 - -.global gFieldMenuGroundPtr -gFieldMenuGroundPtr: @ 80FE9C8 -.4byte FieldMenuGroundEntry - -.global gUnknown_80FE9CC -gUnknown_80FE9CC: @ 80FE9CC -@ replacing .incbin "baserom.gba", 0xFE9CC, 0x1C -.4byte gUnknown_80FE8E0 - -.global gUnknown_80FE9D0 -gUnknown_80FE9D0: @ 80FE9D0 -.string "Quicksave or Give Up\0" -.align 2, 0 - -.global gUnknown_80FE9E8 -gUnknown_80FE9E8: @ 80FE9E8 -@ replacing .incbin "baserom.gba", 0xFE9E8, 0x10 -.4byte gUnknown_80FE9D0 - -.global gUnknown_80FE9EC -gUnknown_80FE9EC: @ 80FE9EC -.string "Message log\0" -.align 2, 0 - -.global gUnknown_80FE9F8 -gUnknown_80FE9F8: @ 80FE9F8 -@ replacing .incbin "baserom.gba", 0xFE9F8, 0x18 -.4byte gUnknown_80FE9EC - -.global gUnknown_80FE9FC -gUnknown_80FE9FC: @ 80FE9FC -.string "Mission objectives\0" -.align 2, 0 - -.global gUnknown_80FEA10 -gUnknown_80FEA10: @ 80FEA10 -@ replacing .incbin "baserom.gba", 0xFEA10, 0x18 -.4byte gUnknown_80FE9FC - -.global gUnknown_80FEA14 -gUnknown_80FEA14: @ 80FEA14 -.string "Recruitment search\0" -.align 2, 0 - -.global gUnknown_80FEA28 -gUnknown_80FEA28: @ 80FEA28 -@ replacing .incbin "baserom.gba", 0xFEA28, 0x1C -.4byte gUnknown_80FEA14 - -.global gUnknown_80FEA2C -gUnknown_80FEA2C: @ 80FEA2C -.string "{COLOR RED}Recruitment search{RESET}\0" -.align 2, 0 - -.global gUnknown_80FEA44 -gUnknown_80FEA44: @ 80FEA44 -@ replacing .incbin "baserom.gba", 0xFEA44, 0xC -.4byte gUnknown_80FEA2C - -.global gUnknown_80FEA48 -gUnknown_80FEA48: @ 80FEA48 -.string "Hints\0" -.align 2, 0 - -.global gUnknown_80FEA50 -gUnknown_80FEA50: @ 80FEA50 -@ replacing .incbin "baserom.gba", 0xFEA50, 0x18 -.4byte gUnknown_80FEA48 - -.global gUnknown_80FEA54 -gUnknown_80FEA54: @ 80FEA54 -.string "Potential recruits\0" -.align 2, 0 - -.global gUnknown_80FEA68 -gUnknown_80FEA68: @ 80FEA68 -.4byte gUnknown_80FEA54 - -.global RecruitedPokemon_80FEA6C -RecruitedPokemon_80FEA6C: @ 80FEA6C -.string "Recruited Pokémon\0" -.align 2,0 - -.global gUnknown_80FEA80 -gUnknown_80FEA80: @ 80FEA80 -.4byte RecruitedPokemon_80FEA6C - -.global gUnknown_80FEA84 -gUnknown_80FEA84: @ 80FEA84 -.string "None\0" -.align 2,0 - -.global gUnknown_80FEA8C -gUnknown_80FEA8C: @ 80FEA8C -@ replacing .incbin "baserom.gba", 0xFEA8C, 0x38 -.4byte gUnknown_80FEA84 - -.global gUnknown_80FEA90 -gUnknown_80FEA90: @ 80FEA90 -.string "{POKEMON_0}'s IQ rose!\n" -.string "It learned the IQ skill\n" -.string "“{MOVE_ITEM_0}”!\0" -.align 2, 0 - -.global gUnknown_80FEAC4 -gUnknown_80FEAC4: @ 80FEAC4 -@ replacing .incbin "baserom.gba", 0xFEAC4, 0x24 -.4byte gUnknown_80FEA90 - -.global gUnknown_80FEAC8 -gUnknown_80FEAC8: @ 80FEAC8 -.string "It appears to be weak here...\0" -.align 2, 0 - -.global gUnknown_80FEAE8 -gUnknown_80FEAE8: @ 80FEAE8 -@ replacing .incbin "baserom.gba", 0xFEAE8, 0x20 -.4byte gUnknown_80FEAC8 - -.global gUnknown_80FEAEC -gUnknown_80FEAEC: @ 80FEAEC -.string "{POKEMON_1} became the {MOVE_ITEM_0} type.\0" -.align 2, 0 - -.global gUnknown_80FEB08 -gUnknown_80FEB08: @ 80FEB08 -@ replacing .incbin "baserom.gba", 0xFEB08, 0x28 -.4byte gUnknown_80FEAEC - -.global gUnknown_80FEB0C -gUnknown_80FEB0C: @ 80FEB0C -.string "{POKEMON_1} took Perish Song's effect!\0" -.align 2, 0 - -.global gUnknown_80FEB30 -gUnknown_80FEB30: @ 80FEB30 -@ replacing .incbin "baserom.gba", 0xFEB30, 0x30 -.4byte gUnknown_80FEB0C - -.global gUnknown_80FEB34 -gUnknown_80FEB34: @ 80FEB34 -.string "It can't lend a helping hand to itself!\0" -.align 2, 0 - -.global gUnknown_80FEB60 -gUnknown_80FEB60: @ 80FEB60 -@ replacing .incbin "baserom.gba", 0xFEB60, 0x28 -.4byte gUnknown_80FEB34 - -.global gUnknown_80FEB64 -gUnknown_80FEB64: @ 80FEB64 -.string "Poor type match! It has no effect!\0" -.align 2, 0 - -.global gUnknown_80FEB88 -gUnknown_80FEB88: @ 80FEB88 -@ replacing .incbin "baserom.gba", 0xFEB88, 0x4 -.4byte gUnknown_80FEB64 - -.global gUnknown_80FEB8C -gUnknown_80FEB8C: @ 80FEB8C -@ replacing .incbin "baserom.gba", 0xFEB8C, 0x4 -.4byte gUnknown_80FEB64 - -.global gUnknown_80FEB90 -gUnknown_80FEB90: @ 80FEB90 -@ replacing .incbin "baserom.gba", 0xFEB90, 0x2C -.4byte gUnknown_80FEB64 - -.global gUnknown_80FEB94 -gUnknown_80FEB94: @ 80FEB94 -.string "It avoided a burn by being on water!\0" -.align 2, 0 - -.global gUnknown_80FEBBC -gUnknown_80FEBBC: @ 80FEBBC -@ replacing .incbin "baserom.gba", 0xFEBBC, 0x20 -.4byte gUnknown_80FEB94 - -.global gUnknown_80FEBC0 -gUnknown_80FEBC0: @ 80FEBC0 -.string "It couldn't flop around!\0" -.align 2, 0 - -.global gUnknown_80FEBDC -gUnknown_80FEBDC: @ 80FEBDC -@ replacing .incbin "baserom.gba", 0xFEBDC, 0x1C -.4byte gUnknown_80FEBC0 - -.global gUnknown_80FEBE0 -gUnknown_80FEBE0: @ 80FEBE0 -.string "Change the settings?\0" -.align 2, 0 - -.global gUnknown_80FEBF8 -gUnknown_80FEBF8: @ 80FEBF8 -@ replacing .incbin "baserom.gba", 0xFEBF8, 0x30 -.4byte gUnknown_80FEBE0 - -.global gUnknown_80FEBFC -gUnknown_80FEBFC: @ 80FEBFC -.string "Reset the options to their default setting?\0" -.align 2, 0 - -.global gUnknown_80FEC28 -gUnknown_80FEC28: @ 80FEC28 -@ replacing .incbin "baserom.gba", 0xFEC28, 0x20 -.4byte gUnknown_80FEBFC - -.global gUnknown_80FEC2C -gUnknown_80FEC2C: @ 80FEC2C -.string "Rescue chances left: {VALUE_0}\0" -.align 2, 0 - -.global gUnknown_80FEC48 -gUnknown_80FEC48: @ 80FEC48 -@ replacing .incbin "baserom.gba", 0xFEC48, 0x34 -.4byte gUnknown_80FEC2C - -.global gUnknown_80FEC4C -gUnknown_80FEC4C: @ 80FEC4C -.string "This team can't send out for help anymore!\0" -.align 2, 0 - -.global gUnknown_80FEC7C -gUnknown_80FEC7C: @ 80FEC7C -@ replacing .incbin "baserom.gba", 0xFEC7C, 0x24 -.4byte gUnknown_80FEC4C - -.global gUnknown_80FEC80 -gUnknown_80FEC80: @ 80FEC80 -.string "Are you done with the Link Box?\0" -.align 2, 0 - -.global gUnknown_80FECA0 -gUnknown_80FECA0: @ 80FECA0 -@ replacing .incbin "baserom.gba", 0xFECA0, 0x1C -.4byte gUnknown_80FEC80 - -.global gUnknown_80FECA4 -gUnknown_80FECA4: @ 80FECA4 -.string "{POKEMON_0} waggled its finger!\0" -.align 2, 0 - -.global gUnknown_80FECBC -gUnknown_80FECBC: @ 80FECBC -@ replacing .incbin "baserom.gba", 0xFECBC, 0x24 -.4byte gUnknown_80FECA4 - -.global gUnknown_80FECC0 -gUnknown_80FECC0: @ 80FECC0 -.string "{POKEMON_0} drew out nature's power!\0" -.align 2, 0 - -.global gUnknown_80FECE0 -gUnknown_80FECE0: @ 80FECE0 -@ replacing .incbin "baserom.gba", 0xFECE0, 0x20 -.4byte gUnknown_80FECC0 - -.global gUnknown_80FECE4 -gUnknown_80FECE4: @ 80FECE4 -.string "Pokémon were drawn close!\0" -.align 2, 0 - -.global gUnknown_80FED00 -gUnknown_80FED00: @ 80FED00 -@ replacing .incbin "baserom.gba", 0x000fed00, 0x4 -.4byte gUnknown_80FECE4 - -.global gUnknown_80FED04 -gUnknown_80FED04: @ 80FED04 -@ replacing .incbin "baserom.gba", 0x000fed04, 0x4 -.4byte gUnknown_80F89DC - -.global gUnknown_80FED08 -gUnknown_80FED08: @ 80FED08 -@ replacing .incbin "baserom.gba", 0x000fed08, 0x4 -.4byte gUnknown_80F89DC - -.global gUnknown_80FED0C -gUnknown_80FED0C: @ 80FED0C -@ replacing .incbin "baserom.gba", 0xFED0C, 0x24 -.4byte gUnknown_80F89DC - -.global gUnknown_80FED10 -gUnknown_80FED10: @ 80FED10 -.string "It bounced off the trick tile!\0" -.align 2, 0 - -.global gUnknown_80FED30 -gUnknown_80FED30: @ 80FED30 -@ replacing .incbin "baserom.gba", 0xFED30, 0x38 -.4byte gUnknown_80FED10 - -.global gUnknown_80FED34 -gUnknown_80FED34: @ 80FED34 -.string "{POKEMON_0} disappeared in the blast!\0" -.align 2, 0 -.4byte gUnknown_80FED34 - -.global gUnknown_80FED58 -gUnknown_80FED58: @ 80FED58 -.string "{POKEMON_0} blinked.\0" -.align 2, 0 - -.global gUnknown_80FED68 -gUnknown_80FED68: @ 80FED68 -@ replacing .incbin "baserom.gba", 0xFED68, 0x20 -.4byte gUnknown_80FED58 - -.global gUnknown_80FED6C -gUnknown_80FED6C: @ 80FED6C -.string "Overgrow boosted its power!\0" -.align 2, 0 - -.global gUnknown_80FED88 -gUnknown_80FED88: @ 80FED88 -@ replacing .incbin "baserom.gba", 0xFED88, 0x20 -.4byte gUnknown_80FED6C - -.global gUnknown_80FED8C -gUnknown_80FED8C: @ 80FED8C -.string "Torrent boosted its power!\0" -.align 2, 0 - -.global gUnknown_80FEDA8 -gUnknown_80FEDA8: @ 80FEDA8 -@ replacing .incbin "baserom.gba", 0xFEDA8, 0x20 -.4byte gUnknown_80FED8C - -.global gUnknown_80FEDAC -gUnknown_80FEDAC: @ 80FEDAC -.string "Swarm boosted its power!\0" -.align 2, 0 - -.global gUnknown_80FEDC8 -gUnknown_80FEDC8: @ 80FEDC8 -@ replacing .incbin "baserom.gba", 0xFEDC8, 0x20 -.4byte gUnknown_80FEDAC - -.global gUnknown_80FEDCC -gUnknown_80FEDCC: @ 80FEDCC -.string "Blaze boosted its power!\0" -.align 2, 0 - -.global gUnknown_80FEDE8 -gUnknown_80FEDE8: @ 80FEDE8 -@ replacing .incbin "baserom.gba", 0xFEDE8, 0x1C -.4byte gUnknown_80FEDCC - -.global gUnknown_80FEDEC -gUnknown_80FEDEC: @ 80FEDEC -.string "Guts boosted its power!\0" -.align 2, 0 - -.global gUnknown_80FEE04 -gUnknown_80FEE04: @ 80FEE04 -@ replacing .incbin "baserom.gba", 0xFEE04, 0x28 -.4byte gUnknown_80FEDEC - -.global gUnknown_80FEE08 -gUnknown_80FEE08: @ 80FEE08 -.string "Its special ability boosted Attack!\0" -.align 2, 0 - -.global gUnknown_80FEE2C -gUnknown_80FEE2C: @ 80FEE2C -@ replacing .incbin "baserom.gba", 0xFEE2C, 0x28 -.4byte gUnknown_80FEE08 - -.global gUnknown_80FEE30 -gUnknown_80FEE30: @ 80FEE30 -.string "Marvel Scale boosted its Defense!\0" -.align 2, 0 - -.global gUnknown_80FEE54 -gUnknown_80FEE54: @ 80FEE54 -@ replacing .incbin "baserom.gba", 0xFEE54, 0x2C -.4byte gUnknown_80FEE30 - -.global gUnknown_80FEE58 -gUnknown_80FEE58: @ 80FEE58 -.string "Its special ability quickened attacks!\0" -.align 2, 0 - -.global gUnknown_80FEE80 -gUnknown_80FEE80: @ 80FEE80 -@ replacing .incbin "baserom.gba", 0xFEE80, 0x24 -.4byte gUnknown_80FEE58 - -.global gUnknown_80FEE84 -gUnknown_80FEE84: @ 80FEE84 -.string "Arena Trap prevents movement!\0" -.align 2, 0 - -.global gUnknown_80FEEA4 -gUnknown_80FEEA4: @ 80FEEA4 -@ replacing .incbin "baserom.gba", 0xFEEA4, 0x24 -.4byte gUnknown_80FEE84 - -.global gUnknown_80FEEA8 -gUnknown_80FEEA8: @ 80FEEA8 -.string "Shadow Tag prevents movement!\0" -.align 2, 0 - -.global gUnknown_80FEEC8 -gUnknown_80FEEC8: @ 80FEEC8 -@ replacing .incbin "baserom.gba", 0xFEEC8, 0x24 -.4byte gUnknown_80FEEA8 - -.global gUnknown_80FEECC -gUnknown_80FEECC: @ 80FEECC -.string "Magnet Pull prevents movement!\0" -.align 2, 0 - -.global gUnknown_80FEEEC -gUnknown_80FEEEC: @ 80FEEEC -@ replacing .incbin "baserom.gba", 0xFEEEC, 0x20 -.4byte gUnknown_80FEECC - -.global gUnknown_80FEEF0 -gUnknown_80FEEF0: @ 80FEEF0 -.string "Static caused paralysis!\0" -.align 2, 0 - -.global gUnknown_80FEF0C -gUnknown_80FEF0C: @ 80FEF0C -@ replacing .incbin "baserom.gba", 0xFEF0C, 0x24 -.4byte gUnknown_80FEEF0 - -.global gUnknown_80FEF10 -gUnknown_80FEF10: @ 80FEF10 -.string "Effect Spore scattered spores!\0" -.align 2, 0 - -.global gUnknown_80FEF30 -gUnknown_80FEF30: @ 80FEF30 -@ replacing .incbin "baserom.gba", 0xFEF30, 0x1C -.4byte gUnknown_80FEF10 - -.global gUnknown_80FEF34 -gUnknown_80FEF34: @ 80FEF34 -.string "Poison Point struck!\0" -.align 2, 0 - -.global gUnknown_80FEF4C -gUnknown_80FEF4C: @ 80FEF4C -@ replacing .incbin "baserom.gba", 0x000fef4c, 0x4 -.4byte gUnknown_80FEF34 - -.global gUnknown_80FEF50 -gUnknown_80FEF50: @ 80FEF50 -@ replacing .incbin "baserom.gba", 0x000fef50, 0x4 -.4byte gUnknown_80FEF10 - -.global gUnknown_80FEF54 -gUnknown_80FEF54: @ 80FEF54 -@ replacing .incbin "baserom.gba", 0xFEF54, 0x20 -.4byte gUnknown_80FEF10 - -.global gUnknown_80FEF58 -gUnknown_80FEF58: @ 80FEF58 -.string "Flame Body caused a burn!\0" -.align 2, 0 - -.global gUnknown_80FEF74 -gUnknown_80FEF74: @ 80FEF74 -@ replacing .incbin "baserom.gba", 0xFEF74, 0x24 -.4byte gUnknown_80FEF58 - -.global gUnknown_80FEF78 -gUnknown_80FEF78: @ 80FEF78 -.string "Cute Charm caused infatuation!\0" -.align 2, 0 - -.global gUnknown_80FEF98 -gUnknown_80FEF98: @ 80FEF98 -@ replacing .incbin "baserom.gba", 0xFEF98, 0x38 -.4byte gUnknown_80FEF78 - -.global gUnknown_80FEF9C -gUnknown_80FEF9C: @ 80FEF9C -.string "A horrid stench billowed out!\n" -.string "{POKEMON_0} became terrified!\0" -.align 2, 0 - -.global gUnknown_80FEFD0 -gUnknown_80FEFD0: @ 80FEFD0 -@ replacing .incbin "baserom.gba", 0xFEFD0, 0x24 -.4byte gUnknown_80FEF9C - -.global gUnknown_80FEFD4 -gUnknown_80FEFD4: @ 80FEFD4 -.string "Transform can't be used here!\0" -.align 2, 0 - -.global gUnknown_80FEFF4 -gUnknown_80FEFF4: @ 80FEFF4 -@ replacing .incbin "baserom.gba", 0xFEFF4, 0x28 -.4byte gUnknown_80FEFD4 - -.global gUnknown_80FEFF8 -gUnknown_80FEFF8: @ 80FEFF8 -.string "{POKEMON_0}'s Synchronize took effect!\0" -.align 2, 0 - -.global gUnknown_80FF01C -gUnknown_80FF01C: @ 80FF01C -@ replacing .incbin "baserom.gba", 0xFF01C, 0x4 -.4byte gUnknown_80FEFF8 - -.global gUnknown_80FF020 -gUnknown_80FF020: @ 80FF020 -@ replacing .incbin "baserom.gba", 0xFF020, 0x60 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF028 - -.global gUnknown_80FF028 -gUnknown_80FF028: @ 80FF028 -.string "Head for the destination while attacking\n" -.string "foes with {A_BUTTON}.\n" -.string "Try not to let a partner faint!\0" -.align 2, 0 - -.global gUnknown_80FF080 -gUnknown_80FF080: @ 80FF080 -@ replacing .incbin "baserom.gba", 0xFF080, 0x58 -.byte 0x01, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF088 - -.global gUnknown_80FF088 -gUnknown_80FF088: @ 80FF088 -.string "Foes won't move until you do.\n" -.string "Open the menu with {B_BUTTON} and\n" -.string "think before you act!\0" -.align 2, 0 - -.global gUnknown_80FF0D8 -gUnknown_80FF0D8: @ 80FF0D8 -@ replacing .incbin "baserom.gba", 0xFF0D8, 0x64 -.byte 0x02, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF0E0 - -.global gUnknown_80FF0E0 -gUnknown_80FF0E0: @ 80FF0E0 -.string "Your team regains HP as it moves.\n" -.string "Hold {B_BUTTON} then press {A_BUTTON} to recover\n" -.string "HP quickly on the spot.\0" -.align 2, 0 - -.global gUnknown_80FF13C -gUnknown_80FF13C: @ 80FF13C -@ replacing .incbin "baserom.gba", 0xFF13C, 0x78 -.byte 0x0c, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF144 - -.global gUnknown_80FF144 -gUnknown_80FF144: @ 80FF144 -.string "Defeat foes using moves instead of\n" -.string "{A_BUTTON} attacks for more Exp. Points.\n" -.string "Choose and set the move you want to use.\0" -.align 2, 0 - -.global gUnknown_80FF1B4 -gUnknown_80FF1B4: @ 80FF1B4 -@ replacing .incbin "baserom.gba", 0xFF1B4, 0x78 -.byte 0x0d, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF1BC - -.global gUnknown_80FF1BC -gUnknown_80FF1BC: @ 80FF1BC -.string "Choose a partner with the Team command\n" -.string "and set its tactics and IQ skills.\n" -.string "Cooperation with partners is the key!\0" -.align 2, 0 - -.global gMovementTutorial -gMovementTutorial: @ 80FF22C -@ replacing .incbin "baserom.gba", 0xFF22C, 0x64 -.byte 0x0e, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF234 - -.global gUnknown_80FF234 -gUnknown_80FF234: @ 80FF234 -.string "Hold {B_BUTTON} then press {DPAD} to speed up\n" -.string "movement. Hold {R_BUTTON} then press {DPAD}\n" -.string "to move only diagonally.\0" -.align 2, 0 - -.global gHungerTutorial -gHungerTutorial: @ 80FF290 -@ replacing .incbin "baserom.gba", 0xFF290, 0x80 -.byte 0x0f, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF298 - -.global gUnknown_80FF298 -gUnknown_80FF298: @ 80FF298 -.string "Eat an Apple or Gummi when your Belly\n" -.string "goes down. Being famished can cause\n" -.string "fainting, so check your Belly in the menu.\0" -.align 2, 0 - -.global gFoodTutorial -gFoodTutorial: @ 80FF310 -@ replacing .incbin "baserom.gba", 0xFF310, 0x84 -.byte 0x03, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF318 - -.global gUnknown_80FF318 -gUnknown_80FF318: @ 80FF318 -.string "Eating an Apple or Gummi fills your Belly.\n" -.string "Choose them under Items in the menu\n" -.string "and eat one before your Belly gets empty.\0" -.align 2, 0 - -.global gOranTutorial -gOranTutorial: @ 80FF394 -@ replacing .incbin "baserom.gba", 0xFF394, 0x54 -.byte 0x04, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF39C - -.global gUnknown_80FF39C -gUnknown_80FF39C: @ 80FF39C -.string "An Oran Berry restores HP.\n" -.string "Open the menu with {B_BUTTON} and\n" -.string "select it under Items.\0" -.align 2, 0 - -.global gCheriTutorial -gCheriTutorial: @ 80FF3E8 -@ replacing .incbin "baserom.gba", 0xFF3E8, 0x58 -.byte 0x05, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF3F0 - -.global gUnknown_80FF3F0 -gUnknown_80FF3F0: @ 80FF3F0 -.string "A Cheri Berry heals paralysis.\n" -.string "Open the menu with {B_BUTTON} and\n" -.string "select it under Items.\0" -.align 2, 0 - -.global gBlastSeedTutorial -gBlastSeedTutorial: @ 80FF440 -@ replacing .incbin "baserom.gba", 0xFF440, 0x60 -.byte 0x06, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF448 - -.global gUnknown_80FF448 -gUnknown_80FF448: @ 80FF448 -.string "A Blast Seed flames the foe you\n" -.string "are facing.\n" -.string "Turn to face the foe, then use the item.\0" -.align 2, 0 - -.global gUnknown_80FF4A0 -gUnknown_80FF4A0: @ 80FF4A0 -@ replacing .incbin "baserom.gba", 0xFF4A0, 0x78 -.byte 0x07, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF4A8 - -.global gUnknown_80FF4A8 -gUnknown_80FF4A8: @ 80FF4A8 -.string "Gravelerocks can be lobbed at distant foes.\n" -.string "Set them for use under Items.\n" -.string "Hold {L_BUTTON} then press {R_BUTTON} to throw them.\0" -.align 2, 0 - -.global gPechaTutorial -gPechaTutorial: @ 80FF518 -@ replacing .incbin "baserom.gba", 0xFF518, 0x64 -.byte 0x09, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF520 - -.global gUnknown_80FF520 -gUnknown_80FF520: @ 80FF520 -.string "A Pecha Berry heals any kind of poisoning.\n" -.string "Open the menu with {B_BUTTON} and\n" -.string "select it under Items.\0" -.align 2, 0 - -.global gSleepSeedTutorial -gSleepSeedTutorial: @ 80FF57C -@ replacing .incbin "baserom.gba", 0xFF57C, 0x6C -.byte 0x0a, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF584 - -.global gUnknown_80FF584 -gUnknown_80FF584: @ 80FF584 -.string "Throw a Sleep Seed at a foe to put it\n" -.string "to sleep for a little while.\n" -.string "Eating it will put you to sleep!\0" -.align 2, 0 - -.global gMoneyTutorial -gMoneyTutorial: @ 80FF5E8 -@ replacing .incbin "baserom.gba", 0xFF5E8, 0x8C -.byte 0x0b, 0x00, 0x00, 0x00 -.4byte gUnknown_80FF5F0 - -.global gUnknown_80FF5F0 -gUnknown_80FF5F0: @ 80FF5F0 -.string "{POKE} is the money in this world.\n" -.string "Collect and save it to buy useful\n" -.string "items.\0" -.align 2, 0 - -.global gUnknown_80FF63C -gUnknown_80FF63C: @ 80FF63C -.string "You're a thief!\n" -.string "You're not recognized as a rescuer!\0" -.align 2, 0 - -.global gUnknown_80FF674 -gUnknown_80FF674: @ 80FF674 -@ replacing .incbin "baserom.gba", 0xFF674, 0x4 -.4byte gUnknown_80FF63C - -.global gUnknown_80FF678 -gUnknown_80FF678: @ 80FF678 -@ replacing .incbin "baserom.gba", 0xFF678, 0x2C -.4byte gUnknown_80FB568 - -.global gUnknown_80FF67C -gUnknown_80FF67C: @ 80FF67C -.string "You've reached a destination floor!\0" -.align 2, 0 - -.global gUnknown_80FF6A4 -gUnknown_80FF6A4: @ 80FF6A4 -@ replacing .incbin "baserom.gba", 0xFF6A4, 0x54 -.4byte gUnknown_80FF67C - -.global gUnknown_80FF6A8 -gUnknown_80FF6A8: @ 80FF6A8 -.string "You've reached a destination floor!\n" -.string "But the Pokémon you seek isn't here...\0" -.align 2, 0 - -.global gUnknown_80FF6F8 -gUnknown_80FF6F8: @ 80FF6F8 -@ replacing .incbin "baserom.gba", 0xFF6F8, 0x38 -.4byte gUnknown_80FF6A8 - -.global gUnknown_80FF6FC -gUnknown_80FF6FC: @ 80FF6FC -.string "{MOVE_ITEM_0} was added to\n" -.string "{POKEMON_0}'s list of usable tactics.\0" -.align 2, 0 - -.global gUnknown_80FF730 -gUnknown_80FF730: @ 80FF730 -@ replacing .incbin "baserom.gba", 0xFF730, 0x3C -.4byte gUnknown_80FF6FC - -.global gUnknown_80FF734 -gUnknown_80FF734: @ 80FF734 -.string "Items can't be thrown when a Pokémon's\n" -.string "terrified!\0" -.align 2, 0 - -.global gUnknown_80FF76C -gUnknown_80FF76C: @ 80FF76C -@ replacing .incbin "baserom.gba", 0xFF76C, 0x4 -.4byte gUnknown_80FF734 - -.global gUnknown_80FF770 -gUnknown_80FF770: @ 80FF770 -.4byte gUnknown_80FEA48 - -.global gUnknown_80FF774 -gUnknown_80FF774: @ 80FF774 -@ replacing .incbin "baserom.gba", 0xFF774, 0x78 -.4byte gUnknown_80FF7E0 -.4byte gUnknown_80FF7D4 -.4byte gUnknown_80FF7CC -.4byte gUnknown_80F7F04 -.4byte gUnknown_80FF7C4 -.4byte gUnknown_80FF7B4 -.4byte gUnknown_80FF7A4 -.4byte gUnknown_80FF794 - -.global gUnknown_80FF794 -gUnknown_80FF794: @ 80FF794 -.string "Touch Screen\0" -.align 2, 0 - -.global gUnknown_80FF7A4 -gUnknown_80FF7A4: @ 80FF7A4 -.string "Pokémon types\0" -.align 2, 0 - -.global gUnknown_80FF7B4 -gUnknown_80FF7B4: @ 80FF7B4 -.string "Linking moves\0" -.align 2, 0 - -.global gUnknown_80FF7C4 -gUnknown_80FF7C4: @ 80FF7C4 -.string "Range\0" -.align 2, 0 - -.global gUnknown_80FF7CC -gUnknown_80FF7CC: @ 80FF7CC -.string "Seeds\0" -.align 2, 0 - -.global gUnknown_80FF7D4 -gUnknown_80FF7D4: @ 80FF7D4 -.string "Orientation\0" -.align 2, 0 - -.global gUnknown_80FF7E0 -gUnknown_80FF7E0: @ 80FF7E0 -.string "Controls\0" -.align 2, 0 - -.global gUnknown_80FF7EC -gUnknown_80FF7EC: @ 80FF7EC -@ replacing .incbin "baserom.gba", 0xFF7EC, 0xA1C -.4byte gUnknown_810011C -.4byte gUnknown_8100060 -.4byte gUnknown_80FFF60 -.4byte gUnknown_80FFE54 -.4byte gUnknown_80FFD54 -.4byte gUnknown_80FFC60 -.4byte gUnknown_80FFB3C -.4byte gUnknown_80FFA78 -.4byte gUnknown_80FF9D4 -.4byte gUnknown_80FF914 -.4byte gUnknown_80FFF60 -.4byte gUnknown_80FFE54 -.4byte gUnknown_80FFD54 -.4byte gUnknown_80FFC60 -.4byte gUnknown_80FFB3C -.4byte gUnknown_80FF82C - -.global gUnknown_80FF82C -gUnknown_80FF82C: @ 80FF82C -.string "Touch once to attack a foe, walk,\n" -.string "advance text, cancel, or pick up \n" -.string "an item off the ground.\n" -.string "Touch twice to use the set move.\n" -.string "Touch the leader twice to move fast.\n" -.string "Touch and hold to change directions\n" -.string "without taking a step.\0" -.align 2, 0 - -.global gUnknown_80FF914 -gUnknown_80FF914: @ 80FF914 -.string "Avoid attacks by moving diagonally.\n" -.string "Keeping {R_BUTTON} pressed, press\n" -.string "{DPAD} to move only diagonally.\n" -.string "It's crucial to change the direction\n" -.string "you're facing without taking a step.\n" -.string "Hold {NDS_Y_BUTTON} to do so.\n\0" -.align 2, 0 - -.global gUnknown_80FF9D4 -gUnknown_80FF9D4: @ 80FF9D4 -.string "{L_BUTTON}+{A_BUTTON}: Use set move\n" -.string "{L_BUTTON}+{B_BUTTON}: Display message log\n" -.string "{L_BUTTON}+{R_BUTTON}: Throw set item\n" -.string "{R_BUTTON}+{DPAD}: Move diagonally\n" -.string "{NDS_Y_BUTTON}: Rotate mode\n" -.string "{SELECT_BUTTON}: Floor map\n" -.string "Select item/move + {START_BUTTON}: Description\0" -.align 2, 0 - -.global gUnknown_80FFA78 -gUnknown_80FFA78: @ 80FFA78 -.string "Press once: Push a foe to attack.\n" -.string "Touch the floor to move. Advance text.\n" -.string "Cancel.\n" -.string "Press twice: Use the set move.\n" -.string "Press your Pokémon to move fast.\n" -.string "Keep pressed to change directions\n" -.string "without moving.\0" -.align 2, 0 - -.global gUnknown_80FFB3C -gUnknown_80FFB3C: @ 80FFB3C -.string "There are seventeen types of Pokémon\n" -.string "and moves: Normal, Fire, Water, Grass,\n" -.string "Electric, Ice, Fighting, Poison, Ground,\n" -.string "Flying, Psychic, Bug, Rock, Ghost,\n" -.string "Dragon, Dark, and Steel. All Pokémon\n" -.string "have one or two types that determine\n" -.string "the damage they take and give.\0" -.align 2, 0 - -.global gUnknown_80FFC60 -gUnknown_80FFC60: @ 80FFC60 -.string "Moves can be linked at the Gulpin Link\n" -.string "Shop or by using a Link Box.\n" -.string "Two moves can be linked and used\n" -.string "simultaneously.\n" -.string "If they're used even once in defeating\n" -.string "a foe, you will earn more Exp. Points,\n" -.string "but your Belly will go down faster, too.\0" -.align 2, 0 - -.global gUnknown_80FFD54 -gUnknown_80FFD54: @ 80FFD54 -.string "All moves have a range of effect.\n" -.string "A move that affects a room, such as\n" -.string "Growl, reaches 2 tiles when in a\n" -.string "corridor. However, if the visibility is\n" -.string "limited to only 1 tile, the move's\n" -.string "range will be likewise restricted.\n" -.string "Check the descriptions of moves!\0" -.align 2, 0 - -.global gUnknown_80FFE54 -gUnknown_80FFE54: @ 80FFE54 -.string "Normal-, Steel-, Poison-, Ground-,\n" -.string "Flying-, Bug-, Rock-, Ghost-, and\n" -.string "Fighting-type moves are based on\n" -.string "Attack and Defense. Fire-, Dark-,\n" -.string "Water-, Grass-, Electric-, Ice-,\n" -.string "Psychic-, and Dragon-type moves\n" -.string "are based on Sp. Atk. and Sp. Def.\0" -.align 2, 0 - -.global gUnknown_80FFF60 -gUnknown_80FFF60: @ 80FFF60 -.string "Seeds can be thrown.\n" -.string "They are usually for eating, but throw\n" -.string "them at foes to get the same effect.\n" -.string "If you have any Seeds you don't want\n" -.string "to eat, try throwing them at foes.\n" -.string "You can also throw them at partners.\n" -.string "If they hit, their effects will be felt.\0" -.align 2, 0 - -.global gUnknown_8100060 -gUnknown_8100060: @ 8100060 -.string "Avoid attacks by moving diagonally.\n" -.string "Keeping {R_BUTTON} pressed, press\n" -.string "{DPAD} to move only diagonally.\n" -.string "It's also crucial to change the direction\n" -.string "you're facing without taking a step.\n" -.string "Just tap {R_BUTTON}!\0" -.align 2, 0 - -.global gUnknown_810011C -gUnknown_810011C: @ 810011C -.string "{L_BUTTON}+{A_BUTTON}: Use set move\n" -.string "{L_BUTTON}+{B_BUTTON}: Display message log\n" -.string "{L_BUTTON}+{R_BUTTON}: Throw set item\n" -.string "{R_BUTTON}+{DPAD}: Move diagonally\n" -.string "{SELECT_BUTTON}: Floor map\n" -.string "{START_BUTTON}: Rotate mode\n" -.string "Select item/move + {START_BUTTON}: Description\0" -.align 2, 0 - -.global gUnknown_81001C0 -gUnknown_81001C0: @ 81001C0 -.string "Switch places with your teammate?\n" -.string "This will cause the teammate to warp.\0" -.align 2, 0 - -.global gUnknown_8100208 -gUnknown_8100208: @ 8100208 -.4byte gUnknown_81001C0 - -.global gMagnitudeMessage -gMagnitudeMessage: @ 810020C -.string "It's Magnitude {VALUE_0}!\0" -.align 2, 0 - -.global gPtrMagnitudeMessage -gPtrMagnitudeMessage: @ 8100224 -.4byte gMagnitudeMessage - -.global gSleepingTargetOnlyMessage -gSleepingTargetOnlyMessage: @ 8100228 -.string "It only works on a sleeping target!\0" -.align 2, 0 - -.global gPtrSleepingTargetOnlyMessage -gPtrSleepingTargetOnlyMessage: @ 810024C -.4byte gSleepingTargetOnlyMessage - -.global gFeralFoundItemMessage -gFeralFoundItemMessage: @ 8100250 -.string "{POKEMON_0} found an item somewhere.\0" -.align 2, 0 - -.global gPtrFeralFoundItemMessage -gPtrFeralFoundItemMessage: @ 8100270 -.4byte gFeralFoundItemMessage - -.global gSelfHealPreventedHungerMessage -gSelfHealPreventedHungerMessage: @ 8100274 -.string "Its self-healing prevented hunger!\0" -.align 2, 0 - -.global gPtrSelfHealPreventedHungerMessage -gPtrSelfHealPreventedHungerMessage: @ 8100298 -.4byte gSelfHealPreventedHungerMessage - -.global gUnknown_810029C -gUnknown_810029C: @ 810029C -.string "Rescue challenges left: {VALUE_0}\0" -.align 2, 0 - -.global gUnknown_81002B8 -gUnknown_81002B8: @ 81002B8 -.4byte gUnknown_810029C - -.global gFinalChanceMessage -gFinalChanceMessage: @ 81002BC -.string "This is your final chance!\0" -.align 2, 0 - -.global gPtrFinalChanceMessage -gPtrFinalChanceMessage: @ 81002D8 -.4byte gFinalChanceMessage - -.global gLinkedMovesComeApartMessage -gLinkedMovesComeApartMessage: @ 81002DC -.string "The linked moves came apart!\0" -.align 2, 0 - -.global gPtrLinkedMovesComeApartMessage -gPtrLinkedMovesComeApartMessage: @ 81002FC -.4byte gLinkedMovesComeApartMessage - -.global gLinkMoveOneUseWarningMessage -gLinkMoveOneUseWarningMessage: @ 8100300 -.string "{color YELLOW}The linked moves are almost out of PP!{reset}\n" -.string "{color YELLOW}Use them again and they will come apart!{reset}\0" -.align 2, 0 - -.global gPtrLinkMoveOneUseWarningMessage -gPtrLinkMoveOneUseWarningMessage: @ 810035C -.4byte gLinkMoveOneUseWarningMessage - -.global gLinkMoveTwoUsesWarningMessage -gLinkMoveTwoUsesWarningMessage: @ 8100360 -.string "{color YELLOW}The linked moves are almost out of PP!{reset}\n" -.string "{color YELLOW}Use them twice and they will come apart!{reset}\0" -.align 2, 0 - -.global gPtrLinkMoveTwoUsesWarningMessage -gPtrLinkMoveTwoUsesWarningMessage: @ 81003BC -.4byte gLinkMoveTwoUsesWarningMessage - -.global gIcePartCrumbledMessage -gIcePartCrumbledMessage: @ 81003C0 -.string "The Ice Part crumbled away...\0" -.align 2, 0 - -.global gPtrIcePartCrumbledMessage -gPtrIcePartCrumbledMessage: @ 81003E0 -.4byte gIcePartCrumbledMessage - -.global gRockPartCrumbledMessage -gRockPartCrumbledMessage: @ 81003E4 -.string "The Rock Part crumbled away...\0" -.align 2, 0 - -.global gPtrRockPartCrumbledMessage -gPtrRockPartCrumbledMessage: @ 8100404 -.4byte gRockPartCrumbledMessage - -.global gSteelPartCrumbledMessage -gSteelPartCrumbledMessage: @ 8100408 -.string "The Steel Part crumbled away...\0" -.align 2, 0 - -.global gPtrSteelPartCrumbledMessage -gPtrSteelPartCrumbledMessage: @ 8100428 -.4byte gSteelPartCrumbledMessage - -.global gWishStoneCrumbledMessage -gWishStoneCrumbledMessage: @ 810042C -.string "The Wish Stone crumbled away...\0" -.align 2, 0 - -.global gPtrWishStoneCrumbledMessage -gPtrWishStoneCrumbledMessage: @ 810044C -.4byte gWishStoneCrumbledMessage - -.global gMusicBoxPlayedCrumbledMessage -gMusicBoxPlayedCrumbledMessage: @ 8100450 -.string "The Music Box played a beautiful melody,\n" -.string "then crumbled away...\0" -.align 2, 0 - -.global gPtrMusicBoxPlayedCrumbledMessage -gPtrMusicBoxPlayedCrumbledMessage: @ 8100494 -.4byte gMusicBoxPlayedCrumbledMessage - -.global gMysteriousPowerPreventedUseMessage -gMysteriousPowerPreventedUseMessage: @ 8100498 -.string "But a mysterious power prevented its use!\0" -.align 2, 0 - -.global gPtrMysteriousPowerPreventedUseMessage -gPtrMysteriousPowerPreventedUseMessage: @ 81004C4 -.4byte gMysteriousPowerPreventedUseMessage - -.global gCouldntBeUsedMessage -gCouldntBeUsedMessage: @ 81004C8 -.string "But it couldn't be used!\0" -.align 2, 0 - -.global gPtrCouldntBeUsedMessage -gPtrCouldntBeUsedMessage: @ 81004E4 -.4byte gCouldntBeUsedMessage - -.global gUnknown_81004E8 -gUnknown_81004E8: @ 81004E8 -.4byte gUnknown_80FB568 - -.global gUnknown_81004EC -gUnknown_81004EC: @ 81004EC -.4byte gUnknown_80FB568 - -.global gUnknown_81004F0 -gUnknown_81004F0: @ 81004F0 -.4byte gUnknown_80FB568 - -.global gUnknown_81004F4 -gUnknown_81004F4: @ 81004F4 -.string "{POKEMON_1}'s Soundproof suppressed\n" -.string "the sound move!\0" -.align 2, 0 - -.global gUnknown_8100524 -gUnknown_8100524: @ 8100524 -.4byte gUnknown_81004F4 - -.global gUnknown_8100528 -gUnknown_8100528: @ 8100528 -.string "The attack was barely endured!\0" -.align 2, 0 - -.global gUnknown_8100548 -gUnknown_8100548: @ 8100548 -.4byte gUnknown_8100528 - -.global gUnknown_810054C -gUnknown_810054C: @ 810054C -.string "False Swipe prevented fainting!\0" -.align 2, 0 - -.global gUnknown_810056C -gUnknown_810056C: @ 810056C -.4byte gUnknown_810054C - -.global gUnknown_8100570 -gUnknown_8100570: @ 8100570 -.string "Perish Song's effect wore off!\0" -.align 2, 0 - -.global gUnknown_8100594 -gUnknown_8100594: @ 8100594 -.4byte gUnknown_8100570 - -.global gExposedWoreOffMessage -gExposedWoreOffMessage: @ 8100598 -.string "The Exposed status wore off!\0" -.align 2, 0 - -.global gPtrExposedWoreOffMessage -gPtrExposedWoreOffMessage: @ 81005B8 -.4byte gExposedWoreOffMessage - -.global gSealedMoveReleasedMessage -gSealedMoveReleasedMessage: @ 81005BC -.string "The sealed move was released!\0" -.align 2, 0 - -.global gPtrSealedMoveReleasedMessage -gPtrSealedMoveReleasedMessage: @ 81005DC -.4byte gSealedMoveReleasedMessage - -.global gCantLeechSeedSelfMessage -gCantLeechSeedSelfMessage: @ 81005E0 -.string "A leech seed can't be planted on the user!\0" -.align 2, 0 - -.global gPtrCantLeechSeedSelfMessage -gPtrCantLeechSeedSelfMessage: @ 8100610 -.4byte gCantLeechSeedSelfMessage - -.global gCantLeechSeedMonMessage -gCantLeechSeedMonMessage: @ 8100614 -.string "A leech seed couldn't be planted on\n" -.string "{POKEMON_0}!\0" -.align 2, 0 - -.global gPtrCantLeechSeedMonMessage -gPtrCantLeechSeedMonMessage: @ 8100640 -.4byte gCantLeechSeedMonMessage - -.global gMoveInterruptedMessage -gMoveInterruptedMessage: @ 8100644 -.string "The move was interrupted!\0" -.align 2, 0 - -.global gPtrMoveInterruptedMessage -gPtrMoveInterruptedMessage: @ 8100660 -.4byte gMoveInterruptedMessage - -.global gClientFaintedMessage -gClientFaintedMessage: @ 8100664 -.string "Your client Pokémon has fainted!\n" -.string "A rescue call can't be made!\0" -.align 2, 0 - -.global gPtrClientFaintedMessage -gPtrClientFaintedMessage: @ 81006A4 -.4byte gClientFaintedMessage - -.global gCantUseInDungeonMessage -gCantUseInDungeonMessage: @ 81006A8 -.string "It can't be used in a dungeon!\0" -.align 2, 0 - -.global gPtrCantUseInDungeonMessage -gPtrCantUseInDungeonMessage: @ 81006CC -.4byte gCantUseInDungeonMessage - -.global gForecastPreventsTypeSwitchMessage -gForecastPreventsTypeSwitchMessage: @ 81006D0 -.string "Its Forecast prevents type switching!\0" -.align 2, 0 - -.global gPtrForecastPreventsTypeSwitchMessage -gPtrForecastPreventsTypeSwitchMessage: @ 81006F8 -.4byte gForecastPreventsTypeSwitchMessage - -.global gForecastPreventsConversion2Message -gForecastPreventsConversion2Message: @ 81006FC -.string "Its Forecast prevents Conversion 2!\0" -.align 2, 0 - -.global gPtrForecastPreventsConversion2Message -gPtrForecastPreventsConversion2Message: @ 8100720 -.4byte gForecastPreventsConversion2Message - -.global gStenchWavedOffMessage -gStenchWavedOffMessage: @ 8100724 -.string "The stench was waved off!\0" -.align 2, 0 - -.global gPtrStenchWavedOffMessage -gPtrStenchWavedOffMessage: @ 8100740 -.4byte gStenchWavedOffMessage - -.global gProtectSavedItMessage -gProtectSavedItMessage: @ 8100744 -.string "Its Protect saved it!\0" -.align 2, 0 - -.global gPtrProtectSavedItMessage -gPtrProtectSavedItMessage: @ 810075C -.4byte gProtectSavedItMessage -.string "pksdir0\0" -.align 2, 0 -@ Start of Boss Fight Dialogues? - -.global gSkarmoryPreFightDialogue_1 -gSkarmoryPreFightDialogue_1: @ 8100768 -.byte 0x00, 0x00, 0x0C, 0x02, 0xAA, 0x01, 0x00, 0x00 -.4byte gUnknown_8100774 - -.global gUnknown_8100774 -gUnknown_8100774: @ 8100774 -.string " Look, {POKEMON_0}!\n" -.string "{POKEMON_2}'s over there!\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_2 -gSkarmoryPreFightDialogue_2: @ 8100798 -.byte 0x00, 0x00, 0x04, 0x02, 0xAA, 0x01, 0x07, 0x00 -.4byte gUnknown_81007E8 -.byte 0x00, 0x00, 0x04, 0x02, 0xAA, 0x01, 0x00, 0x00 -.4byte gUnknown_81007B0 - -.global gUnknown_81007B0 -gUnknown_81007B0: @ 81007B0 -.string " Hey! Are you all right?\n" -.string "We've come to rescue you!\0" -.align 2, 0 - -.global gUnknown_81007E8 -gUnknown_81007E8: @ 81007E8 -.string " Hey! Are you all right?\n" -.string "We're here to rescue you!\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_3 -gSkarmoryPreFightDialogue_3: @ 8100820 -.byte 0x00, 0x00, 0x01, 0x0D, 0x32, 0x00, 0x00, 0x00 -.4byte gUnknown_810082C - -.global gUnknown_810082C -gUnknown_810082C: @ 810082C -.string " ...I...\n" -.string "I'm scared.\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_4 -gSkarmoryPreFightDialogue_4: @ 8100844 -@ replacing .incbin "baserom.gba", 0x100844, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0xfc, 0x00, 0x00, 0x00 -.4byte gUnknown_8100850 - -.global gUnknown_8100850 -gUnknown_8100850: @ 8100850 -.string " You!\n" -.string "What do you think you're doing here?!\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_5 -gSkarmoryPreFightDialogue_5: @ 8100880 -@ replacing .incbin "baserom.gba", 0x100880, 0xA8 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81008DC -.byte 0x00, 0x00, 0x03, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8100898 - -.global gUnknown_8100898 -gUnknown_8100898: @ 8100898 -.string " We're here to rescue\n" -.string "{POKEMON_2}!{EXTRA_MSG}" -.string " {POKEMON_3}!\n" -.string "Don't do this! Release {POKEMON_2}!\0" -.align 2, 0 - -.global gUnknown_81008DC -gUnknown_81008DC: @ 81008DC -.string " We came to rescue\n" -.string "{POKEMON_2}!{EXTRA_MSG}" -.string " Hey, {POKEMON_3}!\n" -.string "Quit doing this, and release {POKEMON_2}!\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_6 -gSkarmoryPreFightDialogue_6: @ 8100928 -.byte 0x00, 0x00, 0x00, 0x0D, 0xFC, 0x00, 0x00, 0x00 -.4byte gUnknown_8100934 - -.global gUnknown_8100934 -gUnknown_8100934: @ 8100934 -.string " How dare you!{WAIT_PRESS}\n" -.string "It's their fault!{EXTRA_MSG}" -.string " I haven't slept in days\n" -.string "because the earthquakes frighten me so!\n" -.string "Every night we had them!{EXTRA_MSG}" -.string " Those earthquakes are\n" -.string "caused by this brat's ilk running wild\n" -.string "underground!\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_7 -gSkarmoryPreFightDialogue_7: @ 8100A04 -@ replacing .incbin "baserom.gba", 0x100A04, 0x17C -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8100AD4 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8100A1C - -.global gUnknown_8100A1C -gUnknown_8100A1C: @ 8100A1C -.string " That's not true.{EXTRA_MSG}" -.string "Well, it's true there have\n" -.string "been many earthquakes lately, but...{EXTRA_MSG}" -.string " It would take more than\n" -.string "{POKEMON_2}'s family going wild under\n" -.string "the ground to cause earthquakes.\0" -.align 2, 0 - -.global gUnknown_8100AD4 -gUnknown_8100AD4: @ 8100AD4 -.string " Whoa, that's not true.{EXTRA_MSG}" -.string " Sure there've been quakes\n" -.string "galore lately...{EXTRA_MSG}" -.string " But it would take more than\n" -.string "{POKEMON_2}'s family running wild under\n" -.string "the ground to set off a quake.\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_8 -gSkarmoryPreFightDialogue_8: @ 8100B80 -@ replacing .incbin "baserom.gba", 0x100B80, 0x40 -.byte 0x00, 0x00, 0x00, 0x0d, 0xfc, 0x00, 0x00, 0x00 -.4byte gUnknown_8100B8C - -.global gUnknown_8100B8C -gUnknown_8100B8C: @ 8100B8C -.string " You be quiet!{EXTRA_MSG}" -.string "We'll fight if you keep that up!\0" -.align 2, 0 - -.global gSkarmoryPreFightDialogue_9 -gSkarmoryPreFightDialogue_9: @ 8100BC0 -@ replacing .incbin "baserom.gba", 0x100BC0, 0xD0 -.byte 0x00, 0x00, 0x04, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8100C34 -.byte 0x00, 0x00, 0x04, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8100BD8 - -.global gUnknown_8100BD8 -gUnknown_8100BD8: @ 8100BD8 -.string " It's no good.\n" -.string "{POKEMON_3} is too agitated to listen to\n" -.string "reason.{EXTRA_MSG}" -.string " We'll have to fight it out!\0" -.align 2, 0 - -.global gUnknown_8100C34 -gUnknown_8100C34: @ 8100C34 -.string " It's useless.\n" -.string "{POKEMON_3} is too steamed to talk\n" -.string "reasonably.{EXTRA_MSG}" -.string " We're going to have to\n" -.string "fight!\0" -.align 2, 0 -@ Skarmory Re-Fight? - -.global gSkarmoryReFightDialogue_1 -gSkarmoryReFightDialogue_1: @ 8100C90 -.byte 0x00, 0x00, 0x00, 0x0D -.byte 0xFC, 0x00, 0x00, 0x00 -.4byte _08100C9C - -.global _08100C9C -_08100C9C: @ 08100C9C -.string " You again?!\n" -.asciz "Persistent pests!\0" -.align 2,0 - -.global gSkarmoryReFightDialogue_2 -gSkarmoryReFightDialogue_2: @ 8100CBC -@ replacing .incbin "baserom.gba", 0x100CBC, 0x20 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8100CC8 - -.global gUnknown_8100CC8 -gUnknown_8100CC8: @ 8100CC8 -.string " Let {POKEMON_2} go!\n" -.string "{POKEMON_3}!\0" -.align 2, 0 - -.global gSkarmoryReFightDialogue_3 -gSkarmoryReFightDialogue_3: @ 8100CDC -@ replacing .incbin "baserom.gba", 0x100CDC, 0x60 -.byte 0x00, 0x00, 0x00, 0x0d, 0xfc, 0x00, 0x00, 0x00 -.4byte gUnknown_8100CE8 - -.global gUnknown_8100CE8 -gUnknown_8100CE8: @ 8100CE8 -.string " I absolutely refuse!{EXTRA_MSG}" -.string " If you want to complain so\n" -.string "much, I'll give you a fight!\0" -.align 2, 0 - -.global gUnknown_8100D3C -gUnknown_8100D3C: @ 8100D3C -@ replacing .incbin "baserom.gba", 0x100D3C, 0x74 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8100D48 - -.global gUnknown_8100D48 -gUnknown_8100D48: @ 8100D48 -.string "{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's impossible to go any farther.{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 - -.global gTeamMeaniesPreFightDialogue_1 -gTeamMeaniesPreFightDialogue_1: @ 8100DB0 -@ replacing .incbin "baserom.gba", 0x100DB0, 0xB4 -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8100E18 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8100DC8 - -.global gUnknown_8100DC8 -gUnknown_8100DC8: @ 8100DC8 -.string " Wow, we came quite a ways\n" -.string "into this forest.{EXTRA_MSG}" -.string " I wonder if {POKEMON_2} is\n" -.string "ahead...\0" -.align 2, 0 - -.global gUnknown_8100E18 -gUnknown_8100E18: @ 8100E18 -.string " We've come pretty far\n" -.string "into this forest.{EXTRA_MSG}" -.string " I wonder if {POKEMON_2} is\n" -.string "ahead...\0" -.align 2, 0 - -.global gTeamMeaniesPreFightDialogue_2 -gTeamMeaniesPreFightDialogue_2: @ 8100E64 -@ replacing .incbin "baserom.gba", 0x100E64, 0x24 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8100E70 - -.global gUnknown_8100E70 -gUnknown_8100E70: @ 8100E70 -.string " Hold it right there!\0" -.align 2, 0 - -.global gTeamMeaniesPreFightDialogue_3 -gTeamMeaniesPreFightDialogue_3: @ 8100E88 -@ replacing .incbin "baserom.gba", 0x100E88, 0x8C -.byte 0x00, 0x00, 0x00, 0x0d, 0x5e, 0x00, 0x00, 0x00 -.4byte gUnknown_8100E94 - -.global gUnknown_8100E94 -gUnknown_8100E94: @ 8100E94 -.string " Keke!\n" -.string "You know who's going to get to\n" -.string "{POKEMON_2} first? We are!{EXTRA_MSG}" -.string " So, for you to go ahead...{WAIT_PRESS}\n" -.string "Well, we can't let that happen.\0" -.align 2, 0 - -.global gTeamMeaniesPreFightDialogue_4 -gTeamMeaniesPreFightDialogue_4: @ 8100F14 -@ replacing .incbin "baserom.gba", 0x100F14, 0xF0 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8100FC0 -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_8100F84 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8100F38 - -.global gUnknown_8100F38 -gUnknown_8100F38: @ 8100F38 -.string " Wh-what?!{EXTRA_MSG}" -.string " Now, hold on, {POKEMON_3}!{WAIT_PRESS}\n" -.string "Why do you always interfere with us?\0" -.align 2, 0 - -.global gUnknown_8100F84 -gUnknown_8100F84: @ 8100F84 -.string " Wh-what!{EXTRA_MSG}" -.string " Hey, {POKEMON_3}!{WAIT_PRESS}\n" -.string "Why do you always mess with us?\0" -.align 2, 0 - -.global gUnknown_8100FC0 -gUnknown_8100FC0: @ 8100FC0 -.string " Wh-what...?{EXTRA_MSG}" -.string " Hey, {POKEMON_3}!{WAIT_PRESS}\n" -.string "Why do you always try to mess with us?\0" -.align 2, 0 - -.global gTeamMeaniesPreFightDialogue_5 -gTeamMeaniesPreFightDialogue_5: @ 8101004 -@ replacing .incbin "baserom.gba", 0x101004, 0x4C -.byte 0x00, 0x00, 0x03, 0x0c, 0x4d, 0x01, 0x00, 0x00 -.4byte gUnknown_8101010 - -.global gUnknown_8101010 -gUnknown_8101010: @ 8101010 -.string " Oh? Didn't we tell you?{WAIT_PRESS}\n" -.string "Our aim is world domination〜♪ \0" -.align 2, 0 - -.global gTeamMeaniesPreFightDialogue_6 -gTeamMeaniesPreFightDialogue_6: @ 8101050 -@ replacing .incbin "baserom.gba", 0x101050, 0x80 -.byte 0x00, 0x00, 0x02, 0x0d, 0x17, 0x00, 0x00, 0x00 -.4byte gUnknown_810105C - -.global gUnknown_810105C -gUnknown_810105C: @ 810105C -.string " {POKEMON_4}'s mama will\n" -.string "give us a generous reward...{EXTRA_MSG}" -.string " And {POKEMON_4} will join\n" -.string "us too...{WAIT_PRESS}\n" -.string "That brings us closer to our goal.\0" -.align 2, 0 - -.global gTeamMeaniesPreFightDialogue_7 -gTeamMeaniesPreFightDialogue_7: @ 81010D0 -@ replacing .incbin "baserom.gba", 0x1010D0, 0x94 -.byte 0x00, 0x00, 0x00, 0x0d, 0x5e, 0x00, 0x00, 0x00 -.4byte gUnknown_81010DC - -.global gUnknown_81010DC -gUnknown_81010DC: @ 81010DC -.string " Keke!\n" -.string "And for that, your lot is in the way!{EXTRA_MSG}" -.string " So sorry to say, but your\n" -.string "party's over right here and now!{EXTRA_MSG}" -.string " Say good-bye, {POKEMON_1}!\0" -.align 2, 0 - -.global gTeamMeaniesReFightDialogue_1 -gTeamMeaniesReFightDialogue_1: @ 8101164 -@ replacing .incbin "baserom.gba", 0x101164, 0xDC -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81011E4 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_810117C - -.global gUnknown_810117C -gUnknown_810117C: @ 810117C -.string " This is where the {COLOR CYAN}Meanies{RESET}\n" -.string "showed up last time.{EXTRA_MSG}" -.string " I wonder if {POKEMON_3}'s\n" -.string "bunch already found {POKEMON_2}...\0" -.align 2, 0 - -.global gUnknown_81011E4 -gUnknown_81011E4: @ 81011E4 -.string " Last time, this is where\n" -.string "{POKEMON_3}'s gang appeared.{EXTRA_MSG}" -.string " Did they find {POKEMON_2}\n" -.string "already, I wonder?\0" -.align 2, 0 - -.global gTeamMeaniesReFightDialogue_2 -gTeamMeaniesReFightDialogue_2: @ 8101240 -@ replacing .incbin "baserom.gba", 0x101240, 0xD0 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81012D4 -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_810129C -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101264 - -.global gUnknown_8101264 -gUnknown_8101264: @ 8101264 -.string " Huh? It's {POKEMON_3}!{EXTRA_MSG}" -.string " Why is {POKEMON_3}'s gang\n" -.string "following us?\0" -.align 2, 0 - -.global gUnknown_810129C -gUnknown_810129C: @ 810129C -.string " Huh? It's {POKEMON_3}!{EXTRA_MSG}" -.string " Why is the {POKEMON_3}\n" -.string "gang following us?\0" -.align 2, 0 - -.global gUnknown_81012D4 -gUnknown_81012D4: @ 81012D4 -.string " Hah? It's {POKEMON_3}!{EXTRA_MSG}" -.string " Why is {POKEMON_3}'s\n" -.string "crew coming after us?\0" -.align 2, 0 - -.global gTeamMeaniesReFightDialogue_3 -gTeamMeaniesReFightDialogue_3: @ 8101310 -@ replacing .incbin "baserom.gba", 0x101310, 0x6C -.byte 0x00, 0x00, 0x03, 0x0d, 0x5e, 0x00, 0x00, 0x00 -.4byte gUnknown_810131C - -.global gUnknown_810131C -gUnknown_810131C: @ 810131C -.string " Y-you be quiet!{EXTRA_MSG}" -.string " Right after we beat you last\n" -.string "time...{EXTRA_MSG}" -.string " We got careless and wiped\n" -.string "out too!\0" -.align 2, 0 - -.global gTeamMeaniesReFightDialogue_4 -gTeamMeaniesReFightDialogue_4: @ 810137C -@ replacing .incbin "baserom.gba", 0x10137C, 0x8C -.byte 0x01, 0x00, 0x03, 0x0d, 0x5e, 0x00, 0x00, 0x00 -.4byte gUnknown_8101388 - -.global gUnknown_8101388 -gUnknown_8101388: @ 8101388 -.string " Don't you laugh at me!{WAIT_PRESS}\n" -.string "What makes you so high-and-mighty?{EXTRA_MSG}" -.string " Whatever happens, we're\n" -.string "not going to lose to you amateurs!\0" -.align 2, 0 - -.global gTeamMeaniesReFightDialogue_5 -gTeamMeaniesReFightDialogue_5: @ 8101408 -@ replacing .incbin "baserom.gba", 0x101408, 0x38 -.byte 0x00, 0x00, 0x02, 0x0d, 0x5e, 0x00, 0x00, 0x00 -.4byte gUnknown_8101414 - -.global gUnknown_8101414 -gUnknown_8101414: @ 8101414 -.string " This is it, {POKEMON_1}!\n" -.string "You're going down!\0" -.align 2, 0 - -.global gUnknown_8101440 -gUnknown_8101440: @ 8101440 -@ replacing .incbin "baserom.gba", 0x101440, 0x70 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810144C - -.global gUnknown_810144C -gUnknown_810144C: @ 810144C -.string "{CENTER_ALIGN}It's impossible to go any farther...{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}But there is nothing here.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 - -.global gUnknown_81014B0 -gUnknown_81014B0: @ 81014B0 -@ replacing .incbin "baserom.gba", 0x1014B0, 0x54 -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81014E0 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_81014C8 - -.global gUnknown_81014C8 -gUnknown_81014C8: @ 81014C8 -.string " This is the summit...\0" -.align 2, 0 - -.global gUnknown_81014E0 -gUnknown_81014E0: @ 81014E0 -.string " This is the mountain's peak...\0" -.align 2, 0 - -.global gUnknown_8101504 -gUnknown_8101504: @ 8101504 -@ replacing .incbin "baserom.gba", 0x101504, 0x9C -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_810155C -.byte 0x00, 0x00, 0x03, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_810151C - -.global gUnknown_810151C -gUnknown_810151C: @ 810151C -.string " Hey! {POKEMON_3}!\n" -.string "Where are you?!{EXTRA_MSG}" -.string " We came to rescue\n" -.string "{POKEMON_2}!\n" -.string "Come out!\0" -.align 2, 0 - -.global gUnknown_810155C -gUnknown_810155C: @ 810155C -.string " Hey! {POKEMON_3}!\n" -.string "Where are you?!{EXTRA_MSG}" -.string " We came to rescue\n" -.string "{POKEMON_2}!\n" -.string "Show yourself!\0" -.align 2, 0 - -.global gUnknown_81015A0 -gUnknown_81015A0: @ 81015A0 -@ replacing .incbin "baserom.gba", 0x1015A0, 0x34 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81015AC - -.global gUnknown_81015AC -gUnknown_81015AC: @ 81015AC -.string "Gyaoooooooooh!\n" -.string " \0" -.align 2, 0 - -.global gUnknown_81015D4 -gUnknown_81015D4: @ 81015D4 -@ replacing .incbin "baserom.gba", 0x1015D4, 0x14 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_81015E0 - -.global gUnknown_81015E0 -gUnknown_81015E0: @ 81015E0 -.string " Waah!\0" -.align 2, 0 - -.global gUnknown_81015E8 -gUnknown_81015E8: @ 81015E8 -@ replacing .incbin "baserom.gba", 0x1015E8, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_81015F4 - -.global gUnknown_81015F4 -gUnknown_81015F4: @ 81015F4 -.string " I warned you!\n" -.string "I have no mercy for meddlers!\0" -.align 2, 0 - -.global gUnknown_8101624 -gUnknown_8101624: @ 8101624 -@ replacing .incbin "baserom.gba", 0x101624, 0x38 -.byte 0x00, 0x00, 0x02, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101630 - -.global gUnknown_8101630 -gUnknown_8101630: @ 8101630 -.string " Not scared...{WAIT_PRESS}\n" -.string "You don't frighten me!\0" -.align 2, 0 - -.global gUnknown_810165C -gUnknown_810165C: @ 810165C -@ replacing .incbin "baserom.gba", 0x10165C, 0xF4 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8101708 -.byte 0x00, 0x00, 0x03, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_81016CC -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101680 - -.global gUnknown_8101680 -gUnknown_8101680: @ 8101680 -.string " Hey, {POKEMON_3}!\n" -.string "We demand you release {POKEMON_2}!{EXTRA_MSG}" -.string " We're a Pokémon rescue\n" -.string "team!\0" -.align 2, 0 - -.global gUnknown_81016CC -gUnknown_81016CC: @ 81016CC -.string " Hey, {POKEMON_3}!\n" -.string "Release {POKEMON_2}!{EXTRA_MSG}" -.string " We're a Pokémon rescue\n" -.string "team!\0" -.align 2, 0 - -.global gUnknown_8101708 -gUnknown_8101708: @ 8101708 -.string " Hey, {POKEMON_3}!\n" -.string "Let {POKEMON_2} go!{EXTRA_MSG}" -.string " A Pokémon rescue team!\n" -.string "That's what we are!\0" -.align 2, 0 - -.global gUnknown_8101750 -gUnknown_8101750: @ 8101750 -@ replacing .incbin "baserom.gba", 0x101750, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_810175C - -.global gUnknown_810175C -gUnknown_810175C: @ 810175C -.string " You must be determined,\n" -.string "to utter such words.\0" -.align 2, 0 - -.global gUnknown_810178C -gUnknown_810178C: @ 810178C -@ replacing .incbin "baserom.gba", 0x10178C, 0x28 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_8101798 - -.global gUnknown_8101798 -gUnknown_8101798: @ 8101798 -.string " Then you shall answer...\0" -.align 2, 0 - -.global gUnknown_81017B4 -gUnknown_81017B4: @ 81017B4 -@ replacing .incbin "baserom.gba", 0x1017B4, 0x30 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_81017C0 - -.global gUnknown_81017C0 -gUnknown_81017C0: @ 81017C0 -.string " To my great and righteous\n" -.string "fury!\0" -.align 2, 0 - -.global gZapdosReFightDialogue_1 -gZapdosReFightDialogue_1: @ 81017E4 -@ replacing .incbin "baserom.gba", 0x1017E4, 0xB4 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8101864 -.byte 0x00, 0x00, 0x03, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_810183C -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101808 - -.global gUnknown_8101808 -gUnknown_8101808: @ 8101808 -.string " Hey, {POKEMON_3}!\n" -.string "We're here again!{EXTRA_MSG}" -.string " Show yourself!\0" -.align 2, 0 - -.global gUnknown_810183C -gUnknown_810183C: @ 810183C -.string " Hey, {POKEMON_3}!\n" -.string "We're back!{EXTRA_MSG}" -.string " Come out!\0" -.align 2, 0 - -.global gUnknown_8101864 -gUnknown_8101864: @ 8101864 -.string " Hey, {POKEMON_3}!\n" -.string "Guess who's back?!{EXTRA_MSG}" -.string " Show yourself!\0" -.align 2, 0 - -.global gZapdosReFightDialogue_2 -gZapdosReFightDialogue_2: @ 8101898 -@ replacing .incbin "baserom.gba", 0x101898, 0x54 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_81018A4 - -.global gUnknown_81018A4 -gUnknown_81018A4: @ 81018A4 -.string " However often you may\n" -.string "return...\n" -.string "The result will always be the same!\0" -.align 2, 0 - -.global gZapdosReFightDialogue_3 -gZapdosReFightDialogue_3: @ 81018EC -@ replacing .incbin "baserom.gba", 0x1018EC, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_81018F8 - -.global gUnknown_81018F8 -gUnknown_81018F8: @ 81018F8 -.string " You have no hope of\n" -.string "winning!\0" -.align 2, 0 - -.global gZapdosReFightDialogue_4 -gZapdosReFightDialogue_4: @ 8101918 -@ replacing .incbin "baserom.gba", 0x101918, 0x24 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_8101924 - -.global gUnknown_8101924 -gUnknown_8101924: @ 8101924 -.string " Prepare yourselves!\0" -.align 2, 0 - -.global gZapdosPostStoryPreFightDialogue_1 -gZapdosPostStoryPreFightDialogue_1: @ 810193C -@ replacing .incbin "baserom.gba", 0x10193C, 0x34 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8101948 - -.global gUnknown_8101948 -gUnknown_8101948: @ 8101948 -.string "Gyaoooooooooooh!\n" -.string " \0" -.align 2, 0 - -.global gZapdosPostStoryPreFightDialogue_2 -gZapdosPostStoryPreFightDialogue_2: @ 8101970 -@ replacing .incbin "baserom.gba", 0x101970, 0x24 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_810197C - -.global gUnknown_810197C -gUnknown_810197C: @ 810197C -.string " So, you're back!\0" -.align 2, 0 - -.global gZapdosPostStoryPreFightDialogue_3 -gZapdosPostStoryPreFightDialogue_3: @ 8101994 -@ replacing .incbin "baserom.gba", 0x101994, 0x50 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_81019A0 - -.global gUnknown_81019A0 -gUnknown_81019A0: @ 81019A0 -.string " Since we last met, how\n" -.string "much more have you furthered your team?\0" -.align 2, 0 - -.global gZapdosPostStoryPreFightDialogue_4 -gZapdosPostStoryPreFightDialogue_4: @ 81019E4 -@ replacing .incbin "baserom.gba", 0x1019E4, 0x20 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_81019F0 - -.global gUnknown_81019F0 -gUnknown_81019F0: @ 81019F0 -.string " How much stronger?\0" -.align 2, 0 - -.global gZapdosPostStoryPreFightDialogue_5 -gZapdosPostStoryPreFightDialogue_5: @ 8101A04 -@ replacing .incbin "baserom.gba", 0x101A04, 0x34 -.byte 0x00, 0x00, 0x00, 0x0d, 0x91, 0x00, 0x00, 0x00 -.4byte gUnknown_8101A10 - -.global gUnknown_8101A10 -gUnknown_8101A10: @ 8101A10 -.string " Your power...{WAIT_PRESS}\n" -.string "Demonstrate it for me!\0" -.align 2, 0 - -.global gZapdosPostStoryPreFightDialogue_6 -gZapdosPostStoryPreFightDialogue_6: @ 8101A38 -@ replacing .incbin "baserom.gba", 0x101A38, 0x64 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8101A44 - -.global gUnknown_8101A44 -gUnknown_8101A44: @ 8101A44 -.string "{CENTER_ALIGN}The mountain's summit...{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}But there is no one here.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_1 -gMoltresPreFightDialogue_1: @ 8101A9C -@ replacing .incbin "baserom.gba", 0x101A9C, 0x38 -.byte 0x00, 0x00, 0x00, 0x0d, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101AA8 - -.global gUnknown_8101AA8 -gUnknown_8101AA8: @ 8101AA8 -.string " Is this it?\n" -.string "Is this Mt. Blaze's summit?\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_2 -gMoltresPreFightDialogue_2: @ 8101AD4 -@ replacing .incbin "baserom.gba", 0x101AD4, 0x15C -.byte 0x00, 0x00, 0x02, 0x0d, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8101B8C -.byte 0x00, 0x00, 0x02, 0x0d -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101AEC - -.global gUnknown_8101AEC -gUnknown_8101AEC: @ 8101AEC -.string " Wow. This is incredible.{WAIT_PRESS}\n" -.string "I know it's a volcano, but the lava flow\n" -.string "is much higher than normal.{EXTRA_MSG}" -.string " This might also have a link\n" -.string "to the natural calamities...\0" -.align 2, 0 - -.global gUnknown_8101B8C -gUnknown_8101B8C: @ 8101B8C -.string " This is one incredible place.{WAIT_PRESS}\n" -.string "I know this is a volcano, but the amount\n" -.string "of lava is way more than usual.{EXTRA_MSG}" -.string " This might also be a part of\n" -.string "the natural disasters...\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_3 -gMoltresPreFightDialogue_3: @ 8101C30 -@ replacing .incbin "baserom.gba", 0x101C30, 0x8C -.byte 0x00, 0x00, 0x0c, 0x0d, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8101C80 -.byte 0x00, 0x00, 0x0c, 0x0d -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101C48 - -.global gUnknown_8101C48 -gUnknown_8101C48: @ 8101C48 -.string " Oogh! It's like a furnace!{WAIT_PRESS}\n" -.string "I'm getting roasted!\0" -.align 2, 0 - -.global gUnknown_8101C80 -gUnknown_8101C80: @ 8101C80 -.string " Yowch! It's wicked hot!{WAIT_PRESS}\n" -.string "I feel like I'm burning up.\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_4 -gMoltresPreFightDialogue_4: @ 8101CBC -@ replacing .incbin "baserom.gba", 0x101CBC, 0xD0 -.byte 0x00, 0x00, 0x04, 0x12, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8101D34 -.byte 0x00, 0x00, 0x04, 0x12 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101CD4 - -.global gUnknown_8101CD4 -gUnknown_8101CD4: @ 8101CD4 -.string " I don't want to spend any\n" -.string "time in a place this dangerous.{EXTRA_MSG}" -.string " Let's get through this quick.\0" -.align 2, 0 - -.global gUnknown_8101D34 -gUnknown_8101D34: @ 8101D34 -.string " I don't want to be in a place\n" -.string "this wickedly bad.{EXTRA_MSG}" -.string " Let's get through here quick.\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_5 -gMoltresPreFightDialogue_5: @ 8101D8C -@ replacing .incbin "baserom.gba", 0x101D8C, 0x14 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8101D98 - -.global gUnknown_8101D98 -gUnknown_8101D98: @ 8101D98 -.string " Halt!\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_6 -gMoltresPreFightDialogue_6: @ 8101DA0 -@ replacing .incbin "baserom.gba", 0x101DA0, 0x7C -.byte 0x00, 0x00, 0x04, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8101DE4 -.byte 0x00, 0x00, 0x04, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101DB8 - -.global gUnknown_8101DB8 -gUnknown_8101DB8: @ 8101DB8 -.string " Huh, what?!{EXTRA_MSG}" -.string " It suddenly turned dark!\0" -.align 2, 0 - -.global gUnknown_8101DE4 -gUnknown_8101DE4: @ 8101DE4 -.string " Wh-what the...?!{EXTRA_MSG}" -.string " Why did it turn dark like\n" -.string "that?!\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_7 -gMoltresPreFightDialogue_7: @ 8101E1C -@ replacing .incbin "baserom.gba", 0x101E1C, 0x90 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8101E28 - -.global gUnknown_8101E28 -gUnknown_8101E28: @ 8101E28 -.string " I can hear the mountain's screams...{EXTRA_MSG}" -.string " It is shrieking in pain...{EXTRA_MSG}" -.string " Someone is causing Mt. Blaze to\n" -.string "writhe in agony!\n" -.string "Is it you?!\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_8 -gMoltresPreFightDialogue_8: @ 8101EAC -@ replacing .incbin "baserom.gba", 0x101EAC, 0x1C4 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8101FD4 -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_8101F48 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8101ED0 - -.global gUnknown_8101ED0 -gUnknown_8101ED0: @ 8101ED0 -.string " Huh?!{WAIT_PRESS}\n" -.string "That's wrong!\n" -.string "We're innocent!{EXTRA_MSG}" -.string " We were just passing\n" -.string "through!{EXTRA_MSG}" -.string " Who are you, anyway?{WAIT_PRESS}\n" -.string "Show yourself!\0" -.align 2, 0 - -.global gUnknown_8101F48 -gUnknown_8101F48: @ 8101F48 -.string " Huh?!{WAIT_PRESS}\n" -.string "You've got it wrong!\n" -.string "It's not us!{EXTRA_MSG}" -.string " We just happened to be\n" -.string "passing through here!{EXTRA_MSG}" -.string " Who are you, anyway?{WAIT_PRESS}\n" -.string "Show yourself!\n" -.string " \0" -.align 2, 0 - -.global gUnknown_8101FD4 -gUnknown_8101FD4: @ 8101FD4 -.string " Hah?!{WAIT_PRESS}\n" -.string "We don't know what you mean!\n" -.string "We're not doing anything!{EXTRA_MSG}" -.string " We just happened to be\n" -.string "traveling through here!{EXTRA_MSG}" -.string " Who are you, anyway?{WAIT_PRESS}\n" -.string "Come out!\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_9 -gMoltresPreFightDialogue_9: @ 8102070 -@ replacing .incbin "baserom.gba", 0x102070, 0x34 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810207C - -.global gUnknown_810207C -gUnknown_810207C: @ 810207C -.string "Gyaaaaaaaaaaaa!\n" -.string " \0" -.align 2, 0 - -.global gMoltresPreFightDialogue_10 -gMoltresPreFightDialogue_10: @ 81020A4 -@ replacing .incbin "baserom.gba", 0x1020A4, 0x30 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_81020B0 - -.global gUnknown_81020B0 -gUnknown_81020B0: @ 81020B0 -.string " The mountain's rage is my rage!\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_11 -gMoltresPreFightDialogue_11: @ 81020D4 -@ replacing .incbin "baserom.gba", 0x1020D4, 0x34 -.byte 0x02, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_81020E0 - -.global gUnknown_81020E0 -gUnknown_81020E0: @ 81020E0 -.string " I am {POKEMON_2}!\n" -.string "The warrior of fire am I!\0" -.align 2, 0 - -.global gMoltresPreFightDialogue_12 -gMoltresPreFightDialogue_12: @ 8102108 -@ replacing .incbin "baserom.gba", 0x102108, 0x50 -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_8102114 - -.global gUnknown_8102114 -gUnknown_8102114: @ 8102114 -.string " There is no forgiving \n" -.string "those who befoul the mountain!\n" -.string "En garde!\0" -.align 2, 0 - -.global gMoltresReFightDialogue_1 -gMoltresReFightDialogue_1: @ 8102158 -@ replacing .incbin "baserom.gba", 0x102158, 0x38 -.byte 0x00, 0x00, 0x00, 0x0d, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102164 - -.global gUnknown_8102164 -gUnknown_8102164: @ 8102164 -.string " ............{WAIT_PRESS}\n" -.string "Maybe {POKEMON_2} isn't around...\0" -.align 2, 0 - -.global gMoltresReFightDialogue_2 -gMoltresReFightDialogue_2: @ 8102190 -@ replacing .incbin "baserom.gba", 0x102190, 0x70 -.byte 0x00, 0x00, 0x01, 0x12, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81021D8 -.byte 0x00, 0x00, 0x01, 0x12 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_81021A8 - -.global gUnknown_81021A8 -gUnknown_81021A8: @ 81021A8 -.string " Let's slip by here while\n" -.string "we have the chance.\0" -.align 2, 0 - -.global gUnknown_81021D8 -gUnknown_81021D8: @ 81021D8 -.string " Let's sneak through while\n" -.string "we can.\0" -.align 2, 0 - -.global gMoltresReFightDialogue_3 -gMoltresReFightDialogue_3: @ 8102200 -@ replacing .incbin "baserom.gba", 0x102200, 0x54 -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_810220C - -.global gUnknown_810220C -gUnknown_810220C: @ 810220C -.string " You again!{EXTRA_MSG}" -.string " There is no forgiving \n" -.string "those who torment the mountain!\0" -.align 2, 0 - -.global gMoltresReFightDialogue_4 -gMoltresReFightDialogue_4: @ 8102254 -@ replacing .incbin "baserom.gba", 0x102254, 0xA4 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81022CC -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_81022A0 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102278 - -.global gUnknown_8102278 -gUnknown_8102278: @ 8102278 -.string " Won't you listen?!{WAIT_PRESS}\n" -.string "We're only...\0" -.align 2, 0 - -.global gUnknown_81022A0 -gUnknown_81022A0: @ 81022A0 -.string " You don't understand!{WAIT_PRESS}\n" -.string "We're only...\0" -.align 2, 0 - -.global gUnknown_81022CC -gUnknown_81022CC: @ 81022CC -.string " You've got us wrong!{WAIT_PRESS}\n" -.string "We're just...\0" -.align 2, 0 - -.global gMoltresReFightDialogue_5 -gMoltresReFightDialogue_5: @ 81022F8 -@ replacing .incbin "baserom.gba", 0x1022F8, 0x34 -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_8102304 - -.global gUnknown_8102304 -gUnknown_8102304: @ 8102304 -.string " Your words are\n" -.string "meaningless!\n" -.string "En garde!\0" -.align 2, 0 - -.global gMoltresPostStoryPreFightDialogue_1 -gMoltresPostStoryPreFightDialogue_1: @ 810232C -@ replacing .incbin "baserom.gba", 0x10232C, 0x6C -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_8102338 - -.global gUnknown_8102338 -gUnknown_8102338: @ 8102338 -.string " Halt!{EXTRA_MSG}" -.string " This is Mt. Blaze!{EXTRA_MSG}" -.string " For you to venture to its\n" -.string "peak, there can be but one reason!\0" -.align 2, 0 - -.global gMoltresPostStoryPreFightDialogue_2 -gMoltresPostStoryPreFightDialogue_2: @ 8102398 -@ replacing .incbin "baserom.gba", 0x102398, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_81023A4 - -.global gUnknown_81023A4 -gUnknown_81023A4: @ 81023A4 -.string " You've come to challenge\n" -.string "me!\0" -.align 2, 0 - -.global gMoltresPostStoryPreFightDialogue_3 -gMoltresPostStoryPreFightDialogue_3: @ 81023C4 -@ replacing .incbin "baserom.gba", 0x1023C4, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_81023D0 - -.global gUnknown_81023D0 -gUnknown_81023D0: @ 81023D0 -.string " So be it!{WAIT_PRESS}\n" -.string "I am the warrior of fire, {POKEMON_2}!\0" -.align 2, 0 - -.global gMoltresPostStoryPreFightDialogue_4 -gMoltresPostStoryPreFightDialogue_4: @ 8102400 -@ replacing .incbin "baserom.gba", 0x102400, 0x54 -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_810240C - -.global gUnknown_810240C -gUnknown_810240C: @ 810240C -.string " Have you what it takes to\n" -.string "defeat me when I am holding back nothing?\0" -.align 2, 0 - -.global gMoltresPostStoryPreFightDialogue_5 -gMoltresPostStoryPreFightDialogue_5: @ 8102454 -@ replacing .incbin "baserom.gba", 0x102454, 0x24 -.byte 0x00, 0x00, 0x00, 0x0d, 0x92, 0x00, 0x00, 0x00 -.4byte gUnknown_8102460 - -.global gUnknown_8102460 -gUnknown_8102460: @ 8102460 -.string " Show me!\0" -.align 2, 0 - -.global gUnknown_810246C -gUnknown_810246C: @ 810246C -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8101A44 - -.global gArticunoPreFightDialogue_1 -gArticunoPreFightDialogue_1: @ 8102478 -@ replacing .incbin "baserom.gba", 0x102478, 0x13C -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102524 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102490 - -.global gUnknown_8102490 -gUnknown_8102490: @ 8102490 -.string " We sure have traveled far\n" -.string "into this forest.{EXTRA_MSG}" -.string " I think we'll be out if we\n" -.string "can get through this part.{WAIT_PRESS}\n" -.string "It shouldn't be far. Let's keep going.\0" -.align 2, 0 - -.global gUnknown_8102524 -gUnknown_8102524: @ 8102524 -.string " We've come pretty far into\n" -.string "the forest.{EXTRA_MSG}" -.string " I think we'll be out if we\n" -.string "can get through this part.{WAIT_PRESS}\n" -.string "It shouldn't be long. Hang in there.\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_2 -gArticunoPreFightDialogue_2: @ 81025B4 -@ replacing .incbin "baserom.gba", 0x1025B4, 0x20 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_81025C0 - -.global gUnknown_81025C0 -gUnknown_81025C0: @ 81025C0 -.string " ...............\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_3 -gArticunoPreFightDialogue_3: @ 81025D4 -@ replacing .incbin "baserom.gba", 0x1025D4, 0x3C -.byte 0x00, 0x00, 0x04, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_81025E0 - -.global gUnknown_81025E0 -gUnknown_81025E0: @ 81025E0 -.string " ...Huh?{WAIT_PRESS}\n" -.string "{POKEMON_0}, did you just say something?\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_4 -gArticunoPreFightDialogue_4: @ 8102610 -@ replacing .incbin "baserom.gba", 0x102610, 0xB4 -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102680 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102628 - -.global gUnknown_8102628 -gUnknown_8102628: @ 8102628 -.string " ...I didn't think so...{EXTRA_MSG}" -.string " I thought I heard a voice...{WAIT_PRESS}\n" -.string "I must have imagined it.\0" -.align 2, 0 - -.global gUnknown_8102680 -gUnknown_8102680: @ 8102680 -.string " ...I didn't think so.{EXTRA_MSG}" -.string " A voice...?{WAIT_PRESS}\n" -.string "I must've imagined it.\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_5 -gArticunoPreFightDialogue_5: @ 81026C4 -@ replacing .incbin "baserom.gba", 0x1026C4, 0x48 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_81026D0 - -.global gUnknown_81026D0 -gUnknown_81026D0: @ 81026D0 -.string " ..................{EXTRA_MSG}" -.string " ...Turn back.{EXTRA_MSG}" -.string "You may not pass...\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_6 -gArticunoPreFightDialogue_6: @ 810270C -@ replacing .incbin "baserom.gba", 0x10270C, 0x20 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102718 - -.global gUnknown_8102718 -gUnknown_8102718: @ 8102718 -.string " Who's there?!\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_7 -gArticunoPreFightDialogue_7: @ 810272C -@ replacing .incbin "baserom.gba", 0x10272C, 0x90 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8102738 - -.global gUnknown_8102738 -gUnknown_8102738: @ 8102738 -.string " You are forbidden to pass...{EXTRA_MSG}" -.string " ...If you persist in trying to pass...{EXTRA_MSG}" -.string " Then, so be it...{EXTRA_MSG}" -.string " But only after you have defeated me!\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_8 -gArticunoPreFightDialogue_8: @ 81027BC -@ replacing .incbin "baserom.gba", 0x1027BC, 0x54 -.byte 0x00, 0x00, 0x02, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_81027C8 - -.global gUnknown_81027C8 -gUnknown_81027C8: @ 81027C8 -.string " Ow! It's too bright!{EXTRA_MSG}" -.string " The ice around us is\n" -.string "reflecting this light!\0" -.align 2, 0 - -.global gArticunoPreFightDialogue_9 -gArticunoPreFightDialogue_9: @ 8102810 -@ replacing .incbin "baserom.gba", 0x102810, 0x30 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810281C - -.global gUnknown_810281C -gUnknown_810281C: @ 810281C -.string "Gyaaaaaaaaah!\n" -.string " \0" -.align 2, 0 - -.global gArticunoPreFightDialogue_10 -gArticunoPreFightDialogue_10: @ 8102840 -.4byte 0x0d000000 -.4byte 0x000001ab -.4byte gUnknown_810284C - -.global gUnknown_810284C -gUnknown_810284C: @ 810284C - -.global gUnknown_810284C -gUnknown_810284C: @ 810284C -.string " I am {POKEMON_2}!{WAIT_PRESS}\n" -.string "The warder of ice!\0" - -.global gArticunoPreFightDialogue_11 -gArticunoPreFightDialogue_11: @ 810286C -@ replacing .incbin "baserom.gba", 0x0010286c, 0x4c -.4byte 0x0d000000 -.4byte 0x00000090 -.4byte gUnknown_8102878 - -.global gUnknown_8102878 -gUnknown_8102878: @ 8102878 -.string " Those that enter the forest\n" -.string "I shall destroy with all my might!\0" - -.global gArticunoPreFightDialogue_12 -gArticunoPreFightDialogue_12: @ 81028B8 -.4byte 0x0d000000 -.4byte 0x00000090 -.4byte gUnknown_81028C4 - -.global gUnknown_81028C4 -gUnknown_81028C4: @ 81028C4 -.string " Let us begin!\0" -.align 2, 0 - -.global gArticunoReFightDialogue_1 -gArticunoReFightDialogue_1: @ 81028D4 -@ replacing .incbin "baserom.gba", 0x1028D4, 0x44 -.byte 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x00 -.4byte gUnknown_81028E0 - -.global gUnknown_81028E0 -gUnknown_81028E0: @ 81028E0 -.string " You may try all you like.\n" -.string "But you shall never pass!\0" -.align 2, 0 - -.global gArticunoReFightDialogue_2 -gArticunoReFightDialogue_2: @ 8102918 -@ replacing .incbin "baserom.gba", 0x102918, 0x30 -.byte 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x00 -.4byte gUnknown_8102924 - -.global gUnknown_8102924 -gUnknown_8102924: @ 8102924 -.string " If you so badly hope to\n" -.string "pass...\0" -.align 2, 0 - -.global gArticunoReFightDialogue_3 -gArticunoReFightDialogue_3: @ 8102948 -@ replacing .incbin "baserom.gba", 0x102948, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x00 -.4byte gUnknown_8102954 - -.global gUnknown_8102954 -gUnknown_8102954: @ 8102954 -.string " Do so only if you can snatch\n" -.string "victory from me!\0" -.align 2, 0 - -.global gArticunoPostStoryPreFightDialogue_1 -gArticunoPostStoryPreFightDialogue_1: @ 8102984 -@ replacing .incbin "baserom.gba", 0x102984, 0x30 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8102990 - -.global gUnknown_8102990 -gUnknown_8102990: @ 8102990 -.string "Gyaaaaaah!\n" -.string " \0" -.align 2, 0 - -.global gArticunoPostStoryPreFightDialogue_2 -gArticunoPostStoryPreFightDialogue_2: @ 81029B4 -@ replacing .incbin "baserom.gba", 0x001029b4, 0x64 -.4byte 0x0d000000 -.4byte 0x00000090 -.4byte gUnknown_81029C0 - -.global gUnknown_81029C0 -gUnknown_81029C0: @ 81029C0 -.string " Your arrival in this frozen\n" -.string "forest means only one thing...{EXTRA_MSG}" -.string " You mean to challenge me!\0" - -.global gArticunoPostStoryPreFightDialogue_3 -gArticunoPostStoryPreFightDialogue_3: @ 8102A18 -@ replacing .incbin "baserom.gba", 0x102A18, 0xC -.byte 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x00 -.4byte gUnknown_810284C - -.global gArticunoPostStoryPreFightDialogue_4 -gArticunoPostStoryPreFightDialogue_4: @ 8102A24 -@ replacing .incbin "baserom.gba", 0x102A24, 0x50 -.byte 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x00 -.4byte gUnknown_8102A30 - -.global gUnknown_8102A30 -gUnknown_8102A30: @ 8102A30 -.string " Those that enter\n" -.string "the forest...\n" -.string "I shall destroy with all my might!\0" -.align 2, 0 - -.global gArticunoPostStoryPreFightDialogue_5 -gArticunoPostStoryPreFightDialogue_5: @ 8102A74 -@ replacing .incbin "baserom.gba", 0x102A74, 0x28 -.byte 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x00 -.4byte gUnknown_8102A80 - -.global gUnknown_8102A80 -gUnknown_8102A80: @ 8102A80 -.string " No matter who it may be!\0" -.align 2, 0 - -.global gUnknown_8102A9C -gUnknown_8102A9C: @ 8102A9C -@ replacing .incbin "baserom.gba", 0x102A9C, 0x74 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8102AA8 - -.global gUnknown_8102AA8 -gUnknown_8102AA8: @ 8102AA8 -.string "{CENTER_ALIGN}This is the deepest part of the forest...{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}But there is no one here.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 - -.global gUnknown_8102B10 -gUnknown_8102B10: @ 8102B10 -@ replacing .incbin "baserom.gba", 0x102B10, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8101A44 - -.global MagmaCavernMidDialogue_1 -MagmaCavernMidDialogue_1: @ 8102B1C -@ replacing .incbin "baserom.gba", 0x00102b1c, 0x38 -.4byte 0x02040000 -.4byte 0x000001aa -.4byte gUnknown_8102B28 - -.global gUnknown_8102B28 -gUnknown_8102B28: @ 8102B28 -.string " Let's see...{WAIT_PRESS}\n" -.string "...I wonder where we are?\0" - -.global MagmaCavernMidDialogue_2 -MagmaCavernMidDialogue_2: @ 8102B54 -@ replacing .incbin "baserom.gba", 0x102B54, 0x70 -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102BA0 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102B6C - -.global gUnknown_8102B6C -gUnknown_8102B6C: @ 8102B6C -.string " I'm certain we've come quite\n" -.string "far already...\0" -.align 2, 0 - -.global gUnknown_8102BA0 -gUnknown_8102BA0: @ 8102BA0 -.string " I know we've come pretty\n" -.string "far...\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_3 -MagmaCavernMidDialogue_3: @ 8102BC4 -@ replacing .incbin "baserom.gba", 0x102BC4, 0x20 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102BD0 - -.global gUnknown_8102BD0 -gUnknown_8102BD0: @ 8102BD0 -.string " Waaah!\n" -.string "Qu-quake!\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_4 -MagmaCavernMidDialogue_4: @ 8102BE4 -@ replacing .incbin "baserom.gba", 0x102BE4, 0x4C -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102C14 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102BFC - -.global gUnknown_8102BFC -gUnknown_8102BFC: @ 8102BFC -.string " ...Whew!\n" -.string "It's over.\0" -.align 2, 0 - -.global gUnknown_8102C14 -gUnknown_8102C14: @ 8102C14 -.string " ...Whew!\n" -.string "It settled down.\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_5 -MagmaCavernMidDialogue_5: @ 8102C30 -@ replacing .incbin "baserom.gba", 0x102C30, 0x24 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102C3C - -.global gUnknown_8102C3C -gUnknown_8102C3C: @ 8102C3C -.string " Hey! {POKEMON_0}!\n" -.string "Over there!\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_6 -MagmaCavernMidDialogue_6: @ 8102C54 -@ replacing .incbin "baserom.gba", 0x102C54, 0x44 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102C80 -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102C6C - -.global gUnknown_8102C6C -gUnknown_8102C6C: @ 8102C6C -.string " Hey!\n" -.string "Are you OK?!\0" -.align 2, 0 - -.global gUnknown_8102C80 -gUnknown_8102C80: @ 8102C80 -.string " Hey!\n" -.string "Snap out of it!\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_7 -MagmaCavernMidDialogue_7: @ 8102C98 -@ replacing .incbin "baserom.gba", 0x00102c98, 0x18 -.4byte 0x0e030000 -.4byte 0x00000006 -.4byte gUnknown_8102CA4 - -.global gUnknown_8102CA4 -gUnknown_8102CA4: @ 8102CA4 -.string " Urrrrgh...\0" - -.global MagmaCavernMidDialogue_8 -MagmaCavernMidDialogue_8: @ 8102CB0 -@ replacing .incbin "baserom.gba", 0x102CB0, 0x48 -.byte 0x00, 0x00, 0x05, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102CE0 -.byte 0x00, 0x00, 0x05, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102CC8 - -.global gUnknown_8102CC8 -gUnknown_8102CC8: @ 8102CC8 -.string " What happened to you?\0" -.align 2, 0 - -.global gUnknown_8102CE0 -gUnknown_8102CE0: @ 8102CE0 -.string " What happened here?\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_9 -MagmaCavernMidDialogue_9: @ 8102CF8 -@ replacing .incbin "baserom.gba", 0x102CF8, 0x3C -.byte 0x00, 0x00, 0x03, 0x0e, 0x06, 0x00, 0x00, 0x00 -.4byte gUnknown_8102D04 - -.global gUnknown_8102D04 -gUnknown_8102D04: @ 8102D04 -.string " We challenged...\n" -.string "{POKEMON_2}...{WAIT_PRESS}\n" -.string "And wiped out...\n\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_10 -MagmaCavernMidDialogue_10: @ 8102D34 -@ replacing .incbin "baserom.gba", 0x102D34, 0x18 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102D40 - -.global gUnknown_8102D40 -gUnknown_8102D40: @ 8102D40 -.string " G-{POKEMON_2}?!\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_11 -MagmaCavernMidDialogue_11: @ 8102D4C -@ replacing .incbin "baserom.gba", 0x102D4C, 0x30 -.byte 0x00, 0x00, 0x00, 0x0f, 0x11, 0x01, 0x00, 0x00 -.4byte gUnknown_8102D58 - -.global gUnknown_8102D58 -gUnknown_8102D58: @ 8102D58 -.string " Grrgh...{WAIT_PRESS}\n" -.string "We... It crushed us...\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_12 -MagmaCavernMidDialogue_12: @ 8102D7C -@ replacing .incbin "baserom.gba", 0x102D7C, 0x80 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102DCC -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102D94 - -.global gUnknown_8102D94 -gUnknown_8102D94: @ 8102D94 -.string " That's right.{WAIT_PRESS}\n" -.string "What happened to {POKEMON_3}?\n" -.string "Where is {POKEMON_3}?\0" -.align 2, 0 - -.global gUnknown_8102DCC -gUnknown_8102DCC: @ 8102DCC -.string " Wait...{WAIT_PRESS}\n" -.string "What about {POKEMON_3}?\n" -.string "Where did {POKEMON_3} go?\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_13 -MagmaCavernMidDialogue_13: @ 8102DFC -@ replacing .incbin "baserom.gba", 0x102DFC, 0x30 -.byte 0x00, 0x00, 0x00, 0x0f, 0x11, 0x01, 0x00, 0x00 -.4byte gUnknown_8102E08 - -.global gUnknown_8102E08 -gUnknown_8102E08: @ 8102E08 -.string " {POKEMON_3} is...{WAIT_PRESS}\n" -.string "Still battling {POKEMON_2}...\0" -.align 2, 0 - -.global MagmaCavernMidDialogue_14 -MagmaCavernMidDialogue_14: @ 8102E2C -@ replacing .incbin "baserom.gba", 0x00102e2c, 0x28 -.4byte 0x020c0000 -.4byte 0x000001aa -.4byte gUnknown_8102E38 - -.global gUnknown_8102E38 -gUnknown_8102E38: @ 8102E38 -.string " {POKEMON_0}!\n" -.string "We've got to hurry!\0" - -.global MagmaCavernMidDialogue_15 -MagmaCavernMidDialogue_15: @ 8102E54 -@ replacing .incbin "baserom.gba", 0x00102e54, 0x1c -.4byte 0x0e030000 -.4byte 0x00000006 -.4byte gUnknown_8102E60 - -.global gUnknown_8102E60 -gUnknown_8102E60: @ 8102E60 -.string " ...Be careful!\0" - -.global GroudonPreFightDialogue_1 -GroudonPreFightDialogue_1: @ 8102E70 -@ replacing .incbin "baserom.gba", 0x102E70, 0x4C -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8102EA4 -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102E88 - -.global gUnknown_8102E88 -gUnknown_8102E88: @ 8102E88 -.string " It's {POKEMON_3}!\n" -.string "Are you OK?!\0" -.align 2, 0 - -.global gUnknown_8102EA4 -gUnknown_8102EA4: @ 8102EA4 -.string " Oh! {POKEMON_3}!\n" -.string "Are you OK?!\0" -.align 2, 0 - -.global GroudonPreFightDialogue_2 -GroudonPreFightDialogue_2: @ 8102EBC -@ replacing .incbin "baserom.gba", 0x102EBC, 0x24 -.byte 0x00, 0x00, 0x00, 0x0f, 0x41, 0x00, 0x00, 0x00 -.4byte gUnknown_8102EC8 - -.global gUnknown_8102EC8 -gUnknown_8102EC8: @ 8102EC8 -.string " Hm!{WAIT_PRESS}\n" -.string "So it's you!\0" -.align 2, 0 - -.global GroudonPreFightDialogue_3 -GroudonPreFightDialogue_3: @ 8102EE0 -@ replacing .incbin "baserom.gba", 0x00102ee0, 0x18 -.4byte 0x0f000000 -.4byte 0x00000041 -.4byte gUnknown_8102EEC - -.global gUnknown_8102EEC -gUnknown_8102EEC: @ 8102EEC -.string " Stay back!\0" - -.global GroudonPreFightDialogue_4 -GroudonPreFightDialogue_4: @ 8102EF8 -@ replacing .incbin "baserom.gba", 0x102EF8, 0x38 -.byte 0x00, 0x00, 0x00, 0x0f, 0x41, 0x00, 0x00, 0x00 -.4byte gUnknown_8102F04 - -.global gUnknown_8102F04 -gUnknown_8102F04: @ 8102F04 -.string " This opponent...{WAIT_PRESS}\n" -.string "is no laughing matter!\0" -.align 2, 0 - -.global GroudonPreFightDialogue_5 -GroudonPreFightDialogue_5: @ 8102F30 -@ replacing .incbin "baserom.gba", 0x102F30, 0x34 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8102F3C - -.global gUnknown_8102F3C -gUnknown_8102F3C: @ 8102F3C -.string "Grgaaaaaaaaah!\n" -.string " \0" -.align 2, 0 - -.global GroudonPreFightDialogue_6 -GroudonPreFightDialogue_6: @ 8102F64 -@ replacing .incbin "baserom.gba", 0x102F64, 0x20 -.byte 0x00, 0x00, 0x00, 0x0f, 0x41, 0x00, 0x00, 0x00 -.4byte gUnknown_8102F70 - -.global gUnknown_8102F70 -gUnknown_8102F70: @ 8102F70 -.string " H-here it comes!\0" -.align 2, 0 - -.global GroudonPreFightDialogue_7 -GroudonPreFightDialogue_7: @ 8102F84 -@ replacing .incbin "baserom.gba", 0x102F84, 0x28 -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102F90 - -.global gUnknown_8102F90 -gUnknown_8102F90: @ 8102F90 -.string " Coming...?{WAIT_PRESS}\n" -.string "Wh-where?!\0" -.align 2, 0 - -.global GroudonPreFightDialogue_8 -GroudonPreFightDialogue_8: @ 8102FAC -@ replacing .incbin "baserom.gba", 0x00102fac, 0x18 -.4byte 0x0f010000 -.4byte 0x00000041 -.4byte gUnknown_8102FB8 - -.global gUnknown_8102FB8 -gUnknown_8102FB8: @ 8102FB8 -.string " Wraaaaaah!\0" - -.global GroudonPreFightDialogue_9 -GroudonPreFightDialogue_9: @ 8102FC4 -@ replacing .incbin "baserom.gba", 0x00102fc4, 0x14 -.4byte 0x020c0000 -.4byte 0x000001aa -.4byte gUnknown_8102FD0 - -.global gUnknown_8102FD0 -gUnknown_8102FD0: @ 8102FD0 -@ The "A-" only makes sense when POKEMON_3 is "Alakazam" (which it is when this is used). Kinda funny. -.string " A-{POKEMON_3}!\0" - -.global GroudonPreFightDialogue_10 -GroudonPreFightDialogue_10: @ 8102FD8 -@ replacing .incbin "baserom.gba", 0x102FD8, 0x7C -.byte 0x00, 0x00, 0x0c, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8103020 -.byte 0x00, 0x00, 0x0c, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8102FF0 - -.global gUnknown_8102FF0 -gUnknown_8102FF0: @ 8102FF0 -.string " {POKEMON_3} is gone!{EXTRA_MSG}" -.string " Maybe...{WAIT_PRESS}\n" -.string "Was he defeated?!\0" -.align 2, 0 - -.global gUnknown_8103020 -gUnknown_8103020: @ 8103020 -.string " {POKEMON_3}'s gone!{EXTRA_MSG}" -.string " Was he maybe...{WAIT_PRESS}\n" -.string "knocked out?!\0" -.align 2, 0 - -.global GroudonPreFightDialogue_11 -GroudonPreFightDialogue_11: @ 8103054 -@ replacing .incbin "baserom.gba", 0x00103054, 0x84 -.byte 0x00, 0x00, 0x02, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81030B8 -.byte 0x00, 0x00, 0x02, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_8103098 -.byte 0x00, 0x00, 0x02, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8103078 - -.global gUnknown_8103078 -gUnknown_8103078: @ 8103078 -.string " Ohh...\n" -.string "It's our turn next.\0" -.align 2, 0 - -.global gUnknown_8103098 -gUnknown_8103098: @ 8103098 -.string " Urgh...\n" -.string "It's our turn next.\0" -.align 2, 0 - -.global gUnknown_81030B8 -gUnknown_81030B8: @ 81030B8 -.string " Darn it!\n" -.string "It's our turn next.\0" -.align 2, 0 - -.global GroudonPreFightDialogue_12 -GroudonPreFightDialogue_12: @ 81030D8 -@ replacing .incbin "baserom.gba", 0x1030D8, 0x38 -.byte 0x00, 0x00, 0x02, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_81030E4 - -.global gUnknown_81030E4 -gUnknown_81030E4: @ 81030E4 -.string " But I'm not going down\n" -.string "without a fight!\0" -.align 2, 0 - -.global GroudonPreFightDialogue_13 -GroudonPreFightDialogue_13: @ 8103110 -@ replacing .incbin "baserom.gba", 0x103110, 0x30 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810311C - -.global gUnknown_810311C -gUnknown_810311C: @ 810311C -.string "Grgaaaaaaah!\n" -.string " \0" -.align 2, 0 - -.global GroudonPreFightDialogue_14 -GroudonPreFightDialogue_14: @ 8103140 -@ replacing .incbin "baserom.gba", 0x103140, 0x48 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8103174 -.byte 0x00, 0x00, 0x03, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8103158 - -.global gUnknown_8103158 -gUnknown_8103158: @ 8103158 -.string " {POKEMON_0}!\n" -.string "Let's do our best!\0" -.align 2, 0 - -.global gUnknown_8103174 -gUnknown_8103174: @ 8103174 -.string " {POKEMON_0}!\n" -.string "Hang tough!\0" -.align 2, 0 - -.global gGroudonReFightDialogue_1 -gGroudonReFightDialogue_1: @ 8103188 -@ replacing .incbin "baserom.gba", 0x103188, 0xA0 -.byte 0x00, 0x00, 0x02, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81031E4 -.byte 0x00, 0x00, 0x02, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_81031A0 - -.global gUnknown_81031A0 -gUnknown_81031A0: @ 81031A0 -.string " Here it comes!\n" -.string "{POKEMON_0}!{EXTRA_MSG}" -.string " Let's make sure we subdue\n" -.string "{POKEMON_2} this time!\0" -.align 2, 0 - -.global gUnknown_81031E4 -gUnknown_81031E4: @ 81031E4 -.string " Here it comes!\n" -.string "{POKEMON_0}!{EXTRA_MSG}" -.string " We've got to settle\n" -.string "{POKEMON_2} down this time!\0" -.align 2, 0 - -.global gGroudonReFightDialogue_2 -gGroudonReFightDialogue_2: @ 8103228 -@ replacing .incbin "baserom.gba", 0x00103228, 0xe8 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81032D8 -.byte 0x00, 0x00, 0x03, 0x02 -.byte 0xaa, 0x01, 0x01, 0x00 -.4byte gUnknown_8103294 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_810324C - -.global gUnknown_810324C -gUnknown_810324C: @ 810324C -.string " Don't be intimidated!{EXTRA_MSG}" -.string " We have to fight it with\n" -.string "all our courage!\0" -.align 2, 0 - -.global gUnknown_8103294 -gUnknown_8103294: @ 8103294 -.string " Don't be intimidated!{EXTRA_MSG}" -.string " We need to be brave to\n" -.string "face this thing!\0" -.align 2, 0 - -.global gUnknown_81032D8 -gUnknown_81032D8: @ 81032D8 -.string " Don't get psyched out!{EXTRA_MSG}" -.string " Be brave and keep slugging!\0" -.align 2, 0 - -.global gGroudonReFightDialogue_3 -gGroudonReFightDialogue_3: @ 8103310 -@ replacing .incbin "baserom.gba", 0x00103310, 0x30 -.4byte 0x00000005 -.4byte 0x00000000 -.4byte gUnknown_810331C - -.global gUnknown_810331C -gUnknown_810331C: @ 810331C -.string "Grgaaaaaaaah!\n" -.string " \0" - -.global gGroudonReFightDialogue_4 -gGroudonReFightDialogue_4: @ 8103340 -@ replacing .incbin "baserom.gba", 0x00103340, 0x60 -.byte 0x00, 0x00, 0x03, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_8103378 -.byte 0x00, 0x00, 0x03, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8103358 - -.global gUnknown_8103358 -gUnknown_8103358: @ 8103358 -.string " {POKEMON_0}!\n" -.string "Let's give it our all!\0" -.align 2, 0 - -.global gUnknown_8103378 -gUnknown_8103378: @ 8103378 -.string " {POKEMON_0}!\n" -.string "Let's give it what we've got!\0" -.align 2, 0 - -.global gGroudonPostStoryPreFightDialogue_1 -gGroudonPostStoryPreFightDialogue_1: @ 81033A0 -@ replacing .incbin "baserom.gba", 0x1033A0, 0xC -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810311C - -.global gGroudonPostStoryPreFightDialogue_2 -gGroudonPostStoryPreFightDialogue_2: @ 81033AC -@ replacing .incbin "baserom.gba", 0x1033AC, 0x90 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9b, 0x01, 0x00, 0x00 -.4byte gUnknown_81033B8 - -.global gUnknown_81033B8 -gUnknown_81033B8: @ 81033B8 -.string " Why have you returned?!{WAIT_PRESS}\n" -.string "How dare you disturb me in my sleep?!{EXTRA_MSG}" -.string " I let rage run wild before...{WAIT_PRESS}\n" -.string "But I won't allow that again!\0" -.align 2, 0 - -.global gGroudonPostStoryPreFightDialogue_3 -gGroudonPostStoryPreFightDialogue_3: @ 810343C -@ replacing .incbin "baserom.gba", 0x0010343c, 0x40 -.4byte 0x0d000000 -.4byte 0x0000019b -.4byte gUnknown_8103448 - -.global gUnknown_8103448 -gUnknown_8103448: @ 8103448 -.string " Those that disturb my\n" -.string "sleep...{WAIT_PRESS}\n" -.string "Shall be crushed!\0" - -.global gGroudonPostStoryPreFightDialogue_4 -gGroudonPostStoryPreFightDialogue_4: @ 810347C -@ replacing .incbin "baserom.gba", 0x10347C, 0xC -.byte 0x00, 0x00, 0x00, 0x0d, 0x9b, 0x01, 0x00, 0x00 -.4byte gUnknown_8102A80 - -.global gUnknown_8103488 -gUnknown_8103488: @ 8103488 -@ replacing .incbin "baserom.gba", 0x00103488, 0x78 -.4byte 0x00000004 -.4byte 0x00000000 -.4byte gUnknown_8103494 - -.global gUnknown_8103494 -gUnknown_8103494: @ 8103494 -.string "{CENTER_ALIGN}This appears to be the deepest level.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's impossible to go any farther.{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}It's time to go back.\0" - -.global gRayquazaPreFightDialogue_1 -gRayquazaPreFightDialogue_1: @ 8103500 -@ replacing .incbin "baserom.gba", 0x103500, 0x2C -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_810350C - -.global gUnknown_810350C -gUnknown_810350C: @ 810350C -.string " Is this...{WAIT_PRESS}\n" -.string "The top floor?\0" -.align 2, 0 - -.global gRayquazaPreFightDialogue_2 -gRayquazaPreFightDialogue_2: @ 810352C -@ replacing .incbin "baserom.gba", 0x10352C, 0x4C -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8103538 - -.global gUnknown_8103538 -gUnknown_8103538: @ 8103538 -.string " Who goes there?!{WAIT_PRESS}\n" -.string "Who dares to trespass upon my\n" -.string "airspace?!\0" -.align 2, 0 - -.global gRayquazaPreFightDialogue_3 -gRayquazaPreFightDialogue_3: @ 8103578 -@ replacing .incbin "baserom.gba", 0x103578, 0x5C -.byte 0x00, 0x00, 0x00, 0x02, 0xaa, 0x01, 0x07, 0x00 -.4byte gUnknown_81035B4 -.byte 0x00, 0x00, 0x00, 0x02 -.byte 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8103590 - -.global gUnknown_8103590 -gUnknown_8103590: @ 8103590 -.string " That voice...{WAIT_PRESS}\n" -.string "Could it be {POKEMON_2}?\0" -.align 2, 0 - -.global gUnknown_81035B4 -gUnknown_81035B4: @ 81035B4 -.string " That voice...{WAIT_PRESS}\n" -.string "Is that {POKEMON_2}?\0" -.align 2, 0 - -.global gRayquazaPreFightDialogue_4 -gRayquazaPreFightDialogue_4: @ 81035D4 -@ replacing .incbin "baserom.gba", 0x001035d4, 0x44 -.4byte 0x0d800000 -.4byte 0x0000019c -.4byte gUnknown_81035E0 - -.global gUnknown_81035E0 -gUnknown_81035E0: @ 81035E0 -.string " Indeed I am.{WAIT_PRESS}\n" -.string "The sky is my domain.{EXTRA_MSG}" -.string " Depart at once!\0" -.align 2,0 - -.global gRayquazaPreFightDialogue_5 -gRayquazaPreFightDialogue_5: @ 8103618 -@ replacing .incbin "baserom.gba", 0x103618, 0x64 -.byte 0x00, 0x00, 0x04, 0x02, 0xaa, 0x01, 0x00, 0x00 -.4byte gUnknown_8103624 - -.global gUnknown_8103624 -gUnknown_8103624: @ 8103624 -.string " But...\n" -.string "We don't have the time to argue.{EXTRA_MSG}" -.string " We came here because we\n" -.string "need your help...\0" -.align 2, 0 - -.global gRayquazaPreFightDialogue_6 -gRayquazaPreFightDialogue_6: @ 810367C -@ replacing .incbin "baserom.gba", 0x0010367c, 0x14 -.4byte 0x0d800000 -.4byte 0x0000019c -.4byte gUnknown_8103688 - -.global gUnknown_8103688 -gUnknown_8103688: @ 8103688 -.string " Never!\0" -.align 2,0 - -.global gRayquazaPreFightDialogue_7 -gRayquazaPreFightDialogue_7: @ 8103690 -@ replacing .incbin "baserom.gba", 0x103690, 0x38 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810369C - -.global gUnknown_810369C -gUnknown_810369C: @ 810369C -.string "Gyaaaaaaaaaaaaaaah!\n" -.string " \0" -.align 2, 0 - -.global gRayquazaPreFightDialogue_8 -gRayquazaPreFightDialogue_8: @ 81036C8 -@ replacing .incbin "baserom.gba", 0x1036C8, 0xD8 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_81036D4 - -.global gUnknown_81036D4 -gUnknown_81036D4: @ 81036D4 -.string " I am a being of the sky,\n" -.string "and you are but denizens of the ground.{EXTRA_MSG}" -.string " To each, there is a world\n" -.string "destined as their own!{EXTRA_MSG}" -.string " For hundreds of millions of\n" -.string "years, never once have I descended to\n" -.string "the ground!\0" -.align 2, 0 - -.global gRayquazaPreFightDialogue_9 -gRayquazaPreFightDialogue_9: @ 81037A0 -@ replacing .incbin "baserom.gba", 0x001037a0, 0x34 -.4byte 0x0d000000 -.4byte 0x0000019c -.4byte gUnknown_81037AC - -.global gUnknown_81037AC -gUnknown_81037AC: @ 81037AC -.string " And the opposite shall also\n" -.string "hold true!\0" -.align 2,0 - -.global gRayquazaPreFightDialogue_10 -gRayquazaPreFightDialogue_10: @ 81037D4 -@ replacing .incbin "baserom.gba", 0x1037D4, 0x4C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_81037E0 - -.global gUnknown_81037E0 -gUnknown_81037E0: @ 81037E0 -.string " Let there be no mercy for\n" -.string "those that defy the laws of nature!\0" -.align 2, 0 - -.global gRayquazaPreFightDialogue_11 -gRayquazaPreFightDialogue_11: @ 8103820 -@ replacing .incbin "baserom.gba", 0x103820, 0x24 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_810382C - -.global gUnknown_810382C -gUnknown_810382C: @ 810382C -.string " Prepare for the end!\0" -.align 2, 0 - -.global gRayquazaReFightDialogue_1 -gRayquazaReFightDialogue_1: @ 8103844 -@ replacing .incbin "baserom.gba", 0x103844, 0x30 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_8103850 - -.global gUnknown_8103850 -gUnknown_8103850: @ 8103850 -.string " You return, but for no\n" -.string "purpose!\0" -.align 2, 0 - -.global gRayquazaReFightDialogue_2 -gRayquazaReFightDialogue_2: @ 8103874 -@ replacing .incbin "baserom.gba", 0x00103874, 0x34 -.4byte 0x0d000000 -.4byte 0x0000019c -.4byte gUnknown_8103880 - -.global gUnknown_8103880 -gUnknown_8103880: @ 8103880 -.string " This is no place for the\n" -.string "likes of you!\0" -.align 2,0 - -.global gRayquazaReFightDialogue_3 -gRayquazaReFightDialogue_3: @ 81038A8 -@ replacing .incbin "baserom.gba", 0x1038A8, 0x50 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_81038B4 - -.global gUnknown_81038B4 -gUnknown_81038B4: @ 81038B4 -.string " Let there be no mercy for\n" -.string "those that trespass upon my airspace!\0" -.align 2, 0 - -.global gRayquazaReFightDialogue_4 -gRayquazaReFightDialogue_4: @ 81038F8 -@ replacing .incbin "baserom.gba", 0x1038F8, 0xC -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_810382C - -.global gRayquazaPostStoryPreFightDialogue_1 -gRayquazaPostStoryPreFightDialogue_1: @ 8103904 -@ replacing .incbin "baserom.gba", 0x103904, 0x34 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8103910 - -.global gUnknown_8103910 -gUnknown_8103910: @ 8103910 -.string "Gyaaaaaaaaaaaah!\n" -.string " \0" -.align 2, 0 - -.global gRayquazaPostStoryPreFightDialogue_2 -gRayquazaPostStoryPreFightDialogue_2: @ 8103938 -@ replacing .incbin "baserom.gba", 0x103938, 0x16C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_8103944 - -.global gUnknown_8103944 -gUnknown_8103944: @ 8103944 -.string " So it is you who dares to\n" -.string "trespass upon my airspace!{EXTRA_MSG}" -.string " You scaled the Sky Tower...{EXTRA_MSG}" -.string " Now, you wish to challenge\n" -.string "me to a battle?!{EXTRA_MSG}" -.string " ............{WAIT_PRESS}\n" -.string "In destroying the falling star, I sustained\n" -.string "injuries upon my body and my pride...{EXTRA_MSG}" -.string " To better protect my\n" -.string "domain, I have made myself stronger.{EXTRA_MSG}" -.string " And so that I may draw\n" -.string "out my newly gained power...\0" -.align 2, 0 - -.global gRayquazaPostStoryPreFightDialogue_3 -gRayquazaPostStoryPreFightDialogue_3: @ 8103AA4 -@ replacing .incbin "baserom.gba", 0x103AA4, 0x40 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_8103AB0 - -.global gUnknown_8103AB0 -gUnknown_8103AB0: @ 8103AB0 -.string " I am now...{WAIT_PRESS}\n" -.string "Unleashing every bit of my might!\0" -.align 2, 0 - -.global gRayquazaPostStoryPreFightDialogue_4 -gRayquazaPostStoryPreFightDialogue_4: @ 8103AE4 -@ replacing .incbin "baserom.gba", 0x103AE4, 0x4C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_8103AF0 - -.global gUnknown_8103AF0 -gUnknown_8103AF0: @ 8103AF0 -.string " My power shall overwhelm...{WAIT_PRESS}\n" -.string "But you dare to stand up to it?\0" -.align 2, 0 - -.global gRayquazaPostStoryPreFightDialogue_5 -gRayquazaPostStoryPreFightDialogue_5: @ 8103B30 -@ replacing .incbin "baserom.gba", 0x103B30, 0x28 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9c, 0x01, 0x00, 0x00 -.4byte gUnknown_8103B3C - -.global gUnknown_8103B3C -gUnknown_8103B3C: @ 8103B3C -.string " I commend your courage!\0" -.align 2, 0 - -.global gRayquazaPostStoryPreFightDialogue_6 -gRayquazaPostStoryPreFightDialogue_6: @ 8103B58 -@ replacing .incbin "baserom.gba", 0x103B58, 0x80 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8103B64 - -.global gUnknown_8103B64 -gUnknown_8103B64: @ 8103B64 -.string "{CENTER_ALIGN}This appears to be\n" -.string "{CENTER_ALIGN}the top of the Sky Tower...{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 - -.global gUnknown_8103BD8 -gUnknown_8103BD8: @ 8103BD8 -@ replacing .incbin "baserom.gba", 0x103BD8, 0x28 -.byte 0x01, 0x00, 0x00, 0x0d, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103BE4 - -.global gUnknown_8103BE4 -gUnknown_8103BE4: @ 8103BE4 -.string " Hunh? What is it, you?\0" -.align 2, 0 - -.global gUnknown_8103C00 -gUnknown_8103C00: @ 8103C00 -@ replacing .incbin "baserom.gba", 0x103C00, 0x3C -.byte 0x01, 0x00, 0x00, 0x0c, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103C0C - -.global gUnknown_8103C0C -gUnknown_8103C0C: @ 8103C0C -.string " We don't like to brag or\n" -.string "nothing, but...\0" -.align 2, 0 - -.global gUnknown_8103C3C -gUnknown_8103C3C: @ 8103C3C -@ replacing .incbin "baserom.gba", 0x103C3C, 0x38 -.byte 0x01, 0x00, 0x00, 0x0d, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103C48 - -.global gUnknown_8103C48 -gUnknown_8103C48: @ 8103C48 -.string " We get furious real easy.\n" -.string "You know that?!\0" -.align 2, 0 - -.global gUnknown_8103C74 -gUnknown_8103C74: @ 8103C74 -@ replacing .incbin "baserom.gba", 0x103C74, 0x50 -.byte 0x01, 0x00, 0x00, 0x0c, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103C80 - -.global gUnknown_8103C80 -gUnknown_8103C80: @ 8103C80 -.string " What really irritates us is\n" -.string "when we see some dim-witted face...\0" -.align 2, 0 - -.global gUnknown_8103CC4 -gUnknown_8103CC4: @ 8103CC4 -@ replacing .incbin "baserom.gba", 0x103CC4, 0x48 -.byte 0x01, 0x00, 0x00, 0x0d, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103CD0 - -.global gUnknown_8103CD0 -gUnknown_8103CD0: @ 8103CD0 -.string " ............{WAIT_PRESS}\n" -.string "Wroooooooar!{WAIT_PRESS}\n" -.string "That vacant expression...\0" -.align 2, 0 - -.global gUnknown_8103D0C -gUnknown_8103D0C: @ 8103D0C -@ replacing .incbin "baserom.gba", 0x103D0C, 0x44 -.byte 0x01, 0x00, 0x00, 0x0c, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103D18 - -.global gUnknown_8103D18 -gUnknown_8103D18: @ 8103D18 -.string " Gwooooh!\n" -.string "It's ticking me off!{WAIT_PRESS}\n" -.string "I'm seeing red!\0" -.align 2, 0 - -.global gUnknown_8103D50 -gUnknown_8103D50: @ 8103D50 -@ replacing .incbin "baserom.gba", 0x103D50, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103D5C - -.global gUnknown_8103D5C -gUnknown_8103D5C: @ 8103D5C -.string " Mukkkeeeeeh!\n" -.string "Get 'em! It's frenzy time!\0" -.align 2, 0 - -.global gUnknown_8103D8C -gUnknown_8103D8C: @ 8103D8C -@ replacing .incbin "baserom.gba", 0x103D8C, 0xC -.byte 0x01, 0x00, 0x00, 0x0d, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103BE4 - -.global gUnknown_8103D98 -gUnknown_8103D98: @ 8103D98 -@ replacing .incbin "baserom.gba", 0x103D98, 0x40 -.byte 0x01, 0x00, 0x00, 0x0c, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103DA4 - -.global gUnknown_8103DA4 -gUnknown_8103DA4: @ 8103DA4 -.string " Are you looking at me...?{WAIT_PRESS}\n" -.string "Are you mocking me?\0" -.align 2, 0 - -.global gUnknown_8103DD8 -gUnknown_8103DD8: @ 8103DD8 -@ replacing .incbin "baserom.gba", 0x103DD8, 0x50 -.byte 0x01, 0x00, 0x00, 0x0d, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103DE4 - -.global gUnknown_8103DE4 -gUnknown_8103DE4: @ 8103DE4 -.string " Gwoooooh!\n" -.string "It's ticking me off!{WAIT_PRESS}\n" -.string "I'm about to blow my fuse!\0" -.align 2, 0 - -.global gUnknown_8103E28 -gUnknown_8103E28: @ 8103E28 -@ replacing .incbin "baserom.gba", 0x103E28, 0xC -.byte 0x00, 0x00, 0x00, 0x0c, 0x38, 0x00, 0x00, 0x00 -.4byte gUnknown_8103D5C - -.global gUnknown_8103E34 -gUnknown_8103E34: @ 8103E34 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8103E40 - -.global gUnknown_8103E40 -gUnknown_8103E40: @ 8103E40 - -.global gUnknown_8103E40 -gUnknown_8103E40: @ 8103E40 -.string "{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 - -.global gMewtwoPreFightDialogue_1 -gMewtwoPreFightDialogue_1: @ 8103EA4 -@ replacing .incbin "baserom.gba", 0x103EA4, 0x68 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8103EB0 - -.global gUnknown_8103EB0 -gUnknown_8103EB0: @ 8103EB0 -.string " ............{WAIT_PRESS}\n" -.string "Was it you...?{EXTRA_MSG}" -.string " ...Who...disturbed...me...in my...\n" -.string "sleep...?{WAIT_PRESS}\n" -.string "Was it you?\0" -.align 2, 0 - -.global gMewtwoPreFightDialogue_2 -gMewtwoPreFightDialogue_2: @ 8103F0C -@ replacing .incbin "baserom.gba", 0x103F0C, 0x40 -.byte 0x03, 0x00, 0x00, 0x0d, 0x96, 0x00, 0x00, 0x00 -.4byte gUnknown_8103F18 - -.global gUnknown_8103F18 -gUnknown_8103F18: @ 8103F18 -.string " My name is {POKEMON_2}.{WAIT_PRESS}\n" -.string "I came into being only to fight.\0" -.align 2, 0 - -.global gMewtwoPreFightDialogue_3 -gMewtwoPreFightDialogue_3: @ 8103F4C -@ replacing .incbin "baserom.gba", 0x103F4C, 0x80 -.byte 0x00, 0x00, 0x00, 0x0d, 0x96, 0x00, 0x00, 0x00 -.4byte gUnknown_8103F58 - -.global gUnknown_8103F58 -gUnknown_8103F58: @ 8103F58 -.string " I...{WAIT_PRESS}\n" -.string "have secluded myself here in suspended\n" -.string "animation.{EXTRA_MSG}" -.string " Would you like to know\n" -.string "why?{WAIT_PRESS}\n" -.string "It's quite simple...\0" -.align 2, 0 - -.global gMewtwoPreFightDialogue_4 -gMewtwoPreFightDialogue_4: @ 8103FCC -@ replacing .incbin "baserom.gba", 0x103FCC, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x96, 0x00, 0x00, 0x00 -.4byte gUnknown_8103FD8 - -.global gUnknown_8103FD8 -gUnknown_8103FD8: @ 8103FD8 -.string " If anyone--such as you--\n" -.string "were to come along...\0" -.align 2, 0 - -.global gMewtwoPreFightDialogue_5 -gMewtwoPreFightDialogue_5: @ 8104008 -@ replacing .incbin "baserom.gba", 0x104008, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x96, 0x00, 0x00, 0x00 -.4byte gUnknown_8104014 - -.global gUnknown_8104014 -gUnknown_8104014: @ 8104014 -.string " I could defeat them at full\n" -.string "power!\n" -.string "Come on!\0" -.align 2, 0 - -.global gMewtwoReFightDialogue_1 -gMewtwoReFightDialogue_1: @ 8104044 -@ replacing .incbin "baserom.gba", 0x104044, 0xC -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8103EB0 - -.global gMewtwoReFightDialogue_2 -gMewtwoReFightDialogue_2: @ 8104050 -@ replacing .incbin "baserom.gba", 0x104050, 0x7C -.byte 0x00, 0x00, 0x00, 0x0d, 0x96, 0x00, 0x00, 0x00 -.4byte gUnknown_810405C - -.global gUnknown_810405C -gUnknown_810405C: @ 810405C -.string " I...{WAIT_PRESS}\n" -.string "have secluded myself here in suspended\n" -.string "animation...{EXTRA_MSG}" -.string " Lying in wait...{WAIT_PRESS}\n" -.string "For someone like you to come.\0" -.align 2, 0 - -.global gMewtwoReFightDialogue_3 -gMewtwoReFightDialogue_3: @ 81040CC -@ replacing .incbin "baserom.gba", 0x1040CC, 0x48 -.byte 0x00, 0x00, 0x00, 0x0d, 0x96, 0x00, 0x00, 0x00 -.4byte gUnknown_81040D8 - -.global gUnknown_81040D8 -gUnknown_81040D8: @ 81040D8 -.string " I am {POKEMON_2}.{WAIT_PRESS}\n" -.string "A Pokémon created only to fight...{WAIT_PRESS}\n" -.string "And...\0" -.align 2, 0 - -.global gMewtwoReFightDialogue_4 -gMewtwoReFightDialogue_4: @ 8104114 -@ replacing .incbin "baserom.gba", 0x104114, 0x30 -.byte 0x00, 0x00, 0x00, 0x0d, 0x96, 0x00, 0x00, 0x00 -.4byte gUnknown_8104120 - -.global gUnknown_8104120 -gUnknown_8104120: @ 8104120 -.string " The most powerful Pokémon\n" -.string "of all!\0" -.align 2, 0 - -.global gMewtwoReFightDialogue_5 -gMewtwoReFightDialogue_5: @ 8104144 -@ replacing .incbin "baserom.gba", 0x104144, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8103E40 - -.global gEnteiPreFightDialogue_1 -gEnteiPreFightDialogue_1: @ 8104150 -@ replacing .incbin "baserom.gba", 0x104150, 0x5C -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_810415C - -.global gUnknown_810415C -gUnknown_810415C: @ 810415C -.string " What compelled you to come?{EXTRA_MSG}" -.string " The likes of you have no business\n" -.string "being here!\0" -.align 2, 0 - -.global gEnteiPreFightDialogue_2 -gEnteiPreFightDialogue_2: @ 81041AC -@ replacing .incbin "baserom.gba", 0x1041AC, 0x4C -.byte 0x02, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_81041B8 - -.global gUnknown_81041B8 -gUnknown_81041B8: @ 81041B8 -.string " I am {POKEMON_2}!{WAIT_PRESS}\n" -.string "I live surrounded by the fiery lava of\n" -.string "volcanoes!\0" -.align 2, 0 - -.global gEnteiPreFightDialogue_3 -gEnteiPreFightDialogue_3: @ 81041F8 -@ replacing .incbin "baserom.gba", 0x1041F8, 0x48 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_8104204 - -.global gUnknown_8104204 -gUnknown_8104204: @ 8104204 -.string " If you refuse to leave...{WAIT_PRESS}\n" -.string "I shall forcefully expel you!\0" -.align 2, 0 - -.global gEnteiReFightDialogue_1 -gEnteiReFightDialogue_1: @ 8104240 -@ replacing .incbin "baserom.gba", 0x104240, 0x6C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_810424C - -.global gUnknown_810424C -gUnknown_810424C: @ 810424C -.string " Did I not say to never\n" -.string "return?{EXTRA_MSG}" -.string " This is the {COLOR YELLOW_D}Fiery Field{RESET}!{WAIT_PRESS}\n" -.string "It is no place for your kind!\0" -.align 2, 0 - -.global gEnteiReFightDialogue_2 -gEnteiReFightDialogue_2: @ 81042AC -@ replacing .incbin "baserom.gba", 0x1042AC, 0xC -.byte 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_81041B8 - -.global gEnteiReFightDialogue_3 -gEnteiReFightDialogue_3: @ 81042B8 -@ replacing .incbin "baserom.gba", 0x1042B8, 0x58 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_81042C4 - -.global gUnknown_81042C4 -gUnknown_81042C4: @ 81042C4 -.string " Since you fail to heed my\n" -.string "words...{WAIT_PRESS}\n" -.string "I've no choice but to defeat you!\0" -.align 2, 0 - -.global gEnteiPostStoryPreFightDialogue_1 -gEnteiPostStoryPreFightDialogue_1: @ 8104310 -@ replacing .incbin "baserom.gba", 0x104310, 0x8C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_810431C - -.global gUnknown_810431C -gUnknown_810431C: @ 810431C -.string " This is the {COLOR YELLOW_D}Fiery Field{RESET}!{WAIT_PRESS}\n" -.string "It is no place for your kind!{EXTRA_MSG}" -.string " I am {POKEMON_2}!{WAIT_PRESS}\n" -.string "I live surrounded by the fiery lava of\n" -.string "volcanoes!\0" -.align 2, 0 - -.global gEnteiPostStoryPreFightDialogue_2 -gEnteiPostStoryPreFightDialogue_2: @ 810439C -@ replacing .incbin "baserom.gba", 0x10439C, 0x24 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_81043A8 - -.global gUnknown_81043A8 -gUnknown_81043A8: @ 81043A8 -.string " Depart from here...\0" -.align 2, 0 - -.global gEnteiPostStoryPreFightDialogue_3 -gEnteiPostStoryPreFightDialogue_3: @ 81043C0 -@ replacing .incbin "baserom.gba", 0x1043C0, 0x1C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x01, 0x00, 0x00 -.4byte gUnknown_81043CC - -.global gUnknown_81043CC -gUnknown_81043CC: @ 81043CC -.string " Immediately!\0" -.align 2, 0 - -.global gEnteiPostStoryPreFightDialogue_4 -gEnteiPostStoryPreFightDialogue_4: @ 81043DC -@ replacing .incbin "baserom.gba", 0x1043DC, 0x74 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81043E8 - -.global gUnknown_81043E8 -gUnknown_81043E8: @ 81043E8 -.string "{CENTER_ALIGN}The lord of this area isn't here.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 - -.global gRaikouPreFightDialogue_1 -gRaikouPreFightDialogue_1: @ 8104450 -@ replacing .incbin "baserom.gba", 0x104450, 0x64 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_810445C - -.global gUnknown_810445C -gUnknown_810445C: @ 810445C -.string " Why...{WAIT_PRESS}\n" -.string "Why have you come...?{EXTRA_MSG}" -.string " This is {COLOR YELLOW_D}Lightning Field{RESET}.{WAIT_PRESS}\n" -.string "It is my...{WAIT_PRESS}" -.string "domain!\0" -.align 2, 0 - -.global gRaikouPreFightDialogue_2 -gRaikouPreFightDialogue_2: @ 81044B4 -@ replacing .incbin "baserom.gba", 0x1044B4, 0x5C -.byte 0x02, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_81044C0 - -.global gUnknown_81044C0 -gUnknown_81044C0: @ 81044C0 -.string " I am {POKEMON_2}!{WAIT_PRESS}\n" -.string "One who races with lightning!{EXTRA_MSG}" -.string " A body like roiling rain\n" -.string "clouds!\0" -.align 2, 0 - -.global gRaikouPreFightDialogue_3 -gRaikouPreFightDialogue_3: @ 8104510 -@ replacing .incbin "baserom.gba", 0x104510, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_810451C - -.global gUnknown_810451C -gUnknown_810451C: @ 810451C -.string " A roar that echoes thunder!\0" -.align 2, 0 - -.global gRaikouPreFightDialogue_4 -gRaikouPreFightDialogue_4: @ 810453C -@ replacing .incbin "baserom.gba", 0x10453C, 0x34 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_8104548 - -.global gUnknown_8104548 -gUnknown_8104548: @ 8104548 -.string " Many have trespassed upon\n" -.string "my domain...\0" -.align 2, 0 - -.global gRaikouPreFightDialogue_5 -gRaikouPreFightDialogue_5: @ 8104570 -@ replacing .incbin "baserom.gba", 0x104570, 0x40 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_810457C - -.global gUnknown_810457C -gUnknown_810457C: @ 810457C -.string " But what became of them?{WAIT_PRESS}\n" -.string "Let me demonstrate...\0" -.align 2, 0 - -.global gRaikouPreFightDialogue_6 -gRaikouPreFightDialogue_6: @ 81045B0 -@ replacing .incbin "baserom.gba", 0x1045B0, 0x48 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_81045BC - -.global gUnknown_81045BC -gUnknown_81045BC: @ 81045BC -.string " And you, too, shall\n" -.string "experience the pain they suffered!\0" -.align 2, 0 - -.global gRaikouReFightDialogue_1 -gRaikouReFightDialogue_1: @ 81045F8 -@ replacing .incbin "baserom.gba", 0x1045F8, 0x7C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_8104604 - -.global gUnknown_8104604 -gUnknown_8104604: @ 8104604 -.string " Snicker... You again.{WAIT_PRESS}\n" -.string "You don't give up easily.{EXTRA_MSG}" -.string " If you so wish to taste\n" -.string "defeat again, I shall oblige!\0" -.align 2, 0 - -.global gRaikouReFightDialogue_2 -gRaikouReFightDialogue_2: @ 8104674 -@ replacing .incbin "baserom.gba", 0x104674, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_8104680 - -.global gUnknown_8104680 -gUnknown_8104680: @ 8104680 -.string " With my electric bolts...{WAIT_PRESS}\0" -.align 2, 0 - -.global gRaikouReFightDialogue_3 -gRaikouReFightDialogue_3: @ 81046A0 -@ replacing .incbin "baserom.gba", 0x1046A0, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_81046AC - -.global gUnknown_81046AC -gUnknown_81046AC: @ 81046AC -.string " I will devastate you again!\0" -.align 2, 0 - -.global gRaikouPostStoryPreFightDialogue_1 -gRaikouPostStoryPreFightDialogue_1: @ 81046CC -@ replacing .incbin "baserom.gba", 0x1046CC, 0x78 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_81046D8 - -.global gUnknown_81046D8 -gUnknown_81046D8: @ 81046D8 -.string " This is {COLOR YELLOW_D}Lightning Field{RESET}!{WAIT_PRESS}\n" -.string "My domain!{EXTRA_MSG}" -.string " All those who enter...{WAIT_PRESS}\n" -.string "I show no mercy, no matter what!\0" -.align 2, 0 - -.global gRaikouPostStoryPreFightDialogue_2 -gRaikouPostStoryPreFightDialogue_2: @ 8104744 -@ replacing .incbin "baserom.gba", 0x104744, 0x28 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_8104750 - -.global gUnknown_8104750 -gUnknown_8104750: @ 8104750 -.string " With my electric bolts...\0" -.align 2, 0 - -.global gRaikouPostStoryPreFightDialogue_3 -gRaikouPostStoryPreFightDialogue_3: @ 810476C -@ replacing .incbin "baserom.gba", 0x10476C, 0xC -.byte 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x01, 0x00, 0x00 -.4byte gUnknown_81046AC - -.global gRaikouPostStoryPreFightDialogue_4 -gRaikouPostStoryPreFightDialogue_4: @ 8104778 -@ replacing .incbin "baserom.gba", 0x104778, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81043E8 - -.global gSuicunePreFightDialogue_1 -gSuicunePreFightDialogue_1: @ 8104784 -@ replacing .incbin "baserom.gba", 0x104784, 0xC -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8101D98 - -.global gSuicunePreFightDialogue_2 -gSuicunePreFightDialogue_2: @ 8104790 -@ replacing .incbin "baserom.gba", 0x104790, 0x20 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_810479C - -.global gUnknown_810479C -gUnknown_810479C: @ 810479C -.string " Why are you here?!\0" -.align 2, 0 - -.global gSuicunePreFightDialogue_3 -gSuicunePreFightDialogue_3: @ 81047B0 -@ replacing .incbin "baserom.gba", 0x1047B0, 0x9C -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_81047BC - -.global gUnknown_81047BC -gUnknown_81047BC: @ 81047BC -.string " Clear and bracing air...{WAIT_PRESS}\n" -.string "Crystalline, pure water...{EXTRA_MSG}" -.string " To stand guard over this beautiful and\n" -.string "untainted land...{WAIT_PRESS}\n" -.string "That is why I am here.\0" -.align 2, 0 - -.global gSuicunePreFightDialogue_4 -gSuicunePreFightDialogue_4: @ 810484C -@ replacing .incbin "baserom.gba", 0x10484C, 0x3C -.byte 0x03, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_8104858 - -.global gUnknown_8104858 -gUnknown_8104858: @ 8104858 -.string " I am {POKEMON_2}!{WAIT_PRESS}\n" -.string "One who runs with the north wind!\0" -.align 2, 0 - -.global gSuicunePreFightDialogue_5 -gSuicunePreFightDialogue_5: @ 8104888 -@ replacing .incbin "baserom.gba", 0x104888, 0x40 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_8104894 - -.global gUnknown_8104894 -gUnknown_8104894: @ 8104894 -.string " Intruders foul the air\n" -.string "with their outside ills.\0" -.align 2, 0 - -.global gSuicunePreFightDialogue_6 -gSuicunePreFightDialogue_6: @ 81048C8 -@ replacing .incbin "baserom.gba", 0x1048C8, 0x4C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_81048D4 - -.global gUnknown_81048D4 -gUnknown_81048D4: @ 81048D4 -.string " There is but one solution\n" -.string "for invaders: expulsion by force!\0" -.align 2, 0 - -.global gSuicunePreFightDialogue_7 -gSuicunePreFightDialogue_7: @ 8104914 -@ replacing .incbin "baserom.gba", 0x104914, 0x1C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_8104920 - -.global gUnknown_8104920 -gUnknown_8104920: @ 8104920 -.string " Here I come!\0" -.align 2, 0 - -.global gSuicuneReFightDialogue_1 -gSuicuneReFightDialogue_1: @ 8104930 -@ replacing .incbin "baserom.gba", 0x104930, 0x50 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_810493C - -.global gUnknown_810493C -gUnknown_810493C: @ 810493C -.string " This is no place for you!{EXTRA_MSG}" -.string " Leave immediately!{EXTRA_MSG}" -.string " If you refuse...\0" -.align 2, 0 - -.global gSuicuneReFightDialogue_2 -gSuicuneReFightDialogue_2: @ 8104980 -@ replacing .incbin "baserom.gba", 0x104980, 0x18 -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_810498C - -.global gUnknown_810498C -gUnknown_810498C: @ 810498C -.string " I will...\0" -.align 2, 0 - -.global gSuicuneReFightDialogue_3 -gSuicuneReFightDialogue_3: @ 8104998 -@ replacing .incbin "baserom.gba", 0x104998, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_81049A4 - -.global gUnknown_81049A4 -gUnknown_81049A4: @ 81049A4 -.string " With all my furious power...{WAIT_PRESS}\n" -.string "Destroy you!\0" -.align 2, 0 - -.global gSuicunePostStoryPreFightDialogue_1 -gSuicunePostStoryPreFightDialogue_1: @ 81049D4 -@ replacing .incbin "baserom.gba", 0x1049D4, 0xAC -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_81049E0 - -.global gUnknown_81049E0 -gUnknown_81049E0: @ 81049E0 -.string " You mean to challenge me?{EXTRA_MSG}" -.string " I find little satisfaction in\n" -.string "fighting...{WAIT_PRESS}\n" -.string "However!{EXTRA_MSG}" -.string " If you refuse my\n" -.string "demands that you leave...{EXTRA_MSG}" -.string " I will accept your challenge.\0" -.align 2, 0 - -.global gSuicunePostStoryPreFightDialogue_2 -gSuicunePostStoryPreFightDialogue_2: @ 8104A80 -@ replacing .incbin "baserom.gba", 0x104A80, 0x1C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_8104A8C - -.global gUnknown_8104A8C -gUnknown_8104A8C: @ 8104A8C -.string " Experience it.\0" -.align 2, 0 - -.global gSuicunePostStoryPreFightDialogue_3 -gSuicunePostStoryPreFightDialogue_3: @ 8104A9C -@ replacing .incbin "baserom.gba", 0x104A9C, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x0e, 0x01, 0x00, 0x00 -.4byte gUnknown_8104AA8 - -.global gUnknown_8104AA8 -gUnknown_8104AA8: @ 8104AA8 -.string " My true power...{WAIT_PRESS}\n" -.string "Unleashed!\0" -.align 2, 0 - -.global gSuicunePostStoryPreFightDialogue_4 -gSuicunePostStoryPreFightDialogue_4: @ 8104AC8 -@ replacing .incbin "baserom.gba", 0x104AC8, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81043E8 - -.global gHoOhPreFightDialogue_1 -gHoOhPreFightDialogue_1: @ 8104AD4 -@ replacing .incbin "baserom.gba", 0x104AD4, 0x118 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8104AE0 - -.global gUnknown_8104AE0 -gUnknown_8104AE0: @ 8104AE0 -.string " Excellent!{EXTRA_MSG}" -.string " You have done well to come this far.{EXTRA_MSG}" -.string " You have overcome countless\n" -.string "challenges...{EXTRA_MSG}" -.string " Fought through many dangerous\n" -.string "situations...{EXTRA_MSG}" -.string " and finally ascended to the very peak\n" -.string "of {COLOR YELLOW_D}Mt. Faraway{RESET}!{EXTRA_MSG}" -.string " Truly, only the chosen have reached\n" -.string "the summit.{EXTRA_MSG}" -.string " However!\0" -.align 2, 0 - -.global gHoOhPreFightDialogue_2 -gHoOhPreFightDialogue_2: @ 8104BEC -@ replacing .incbin "baserom.gba", 0x104BEC, 0x24 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8104BF8 - -.global gUnknown_8104BF8 -gUnknown_8104BF8: @ 8104BF8 -.string " This is not the end!\0" -.align 2, 0 - -.global gHoOhPreFightDialogue_3 -gHoOhPreFightDialogue_3: @ 8104C10 -@ replacing .incbin "baserom.gba", 0x104C10, 0x44 -.byte 0x03, 0x00, 0x00, 0x0d, 0x13, 0x01, 0x00, 0x00 -.4byte gUnknown_8104C1C - -.global gUnknown_8104C1C -gUnknown_8104C1C: @ 8104C1C -.string " I am {POKEMON_2}!{WAIT_PRESS}\n" -.string "The builder of rainbows across the sky!\0" -.align 2, 0 - -.global gHoOhPreFightDialogue_4 -gHoOhPreFightDialogue_4: @ 8104C54 -@ replacing .incbin "baserom.gba", 0x104C54, 0x60 -.byte 0x00, 0x00, 0x00, 0x0d, 0x13, 0x01, 0x00, 0x00 -.4byte gUnknown_8104C60 - -.global gUnknown_8104C60 -gUnknown_8104C60: @ 8104C60 -.string " Only when you overcome\n" -.string "me in battle...{WAIT_PRESS}\n" -.string "That is when this mountain is conquered!\0" -.align 2, 0 - -.global gHoOhPreFightDialogue_5 -gHoOhPreFightDialogue_5: @ 8104CB4 -@ replacing .incbin "baserom.gba", 0x104CB4, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x13, 0x01, 0x00, 0x00 -.4byte gUnknown_8104CC0 - -.global gUnknown_8104CC0 -gUnknown_8104CC0: @ 8104CC0 -.string " This is the final challenge!\0" -.align 2, 0 - -.global gHoOhPreFightDialogue_6 -gHoOhPreFightDialogue_6: @ 8104CE0 -@ replacing .incbin "baserom.gba", 0x104CE0, 0xC -.byte 0x00, 0x00, 0x00, 0x0d, 0x13, 0x01, 0x00, 0x00 -.4byte gUnknown_8104920 - -.global HoOhReFightDialogue_1 -HoOhReFightDialogue_1: @ 8104CEC -@ replacing .incbin "baserom.gba", 0x104CEC, 0x74 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8104CF8 - -.global gUnknown_8104CF8 -gUnknown_8104CF8: @ 8104CF8 -.string " Very good!{EXTRA_MSG}" -.string " You have done well to come this far.{EXTRA_MSG}" -.string " Truly, only the chosen have reached\n" -.string "the summit.\0" -.align 2, 0 - -.global HoOhReFightDialogue_2 -HoOhReFightDialogue_2: @ 8104D60 -@ replacing .incbin "baserom.gba", 0x104D60, 0x7C -.byte 0x00, 0x00, 0x00, 0x0d, 0x13, 0x01, 0x00, 0x00 -.4byte gUnknown_8104D6C - -.global gUnknown_8104D6C -gUnknown_8104D6C: @ 8104D6C -.string " Your very arrival is\n" -.string "evidence of a truly powerful warrior!{WAIT_PRESS}\n" -.string "And...{EXTRA_MSG}" -.string " It is also your right to\n" -.string "challenge me!\0" -.align 2, 0 - -.global HoOhReFightDialogue_3 -HoOhReFightDialogue_3: @ 8104DDC -@ replacing .incbin "baserom.gba", 0x104DDC, 0x30 -.byte 0x00, 0x00, 0x00, 0x0d, 0x13, 0x01, 0x00, 0x00 -.4byte gUnknown_8104DE8 - -.global gUnknown_8104DE8 -gUnknown_8104DE8: @ 8104DE8 -.string " Surpass your own\n" -.string "limitations...\0" -.align 2, 0 - -.global HoOhReFightDialogue_4 -HoOhReFightDialogue_4: @ 8104E0C -@ replacing .incbin "baserom.gba", 0x104E0C, 0x48 -.byte 0x00, 0x00, 0x00, 0x0d, 0x13, 0x01, 0x00, 0x00 -.4byte gUnknown_8104E18 - -.global gUnknown_8104E18 -gUnknown_8104E18: @ 8104E18 -.string " And show me your power in\n" -.string "its unbridled entirety!\n" -.string "Come on!\0" -.align 2, 0 - -.global HoOhReFightDialogue_5 -HoOhReFightDialogue_5: @ 8104E54 -@ replacing .incbin "baserom.gba", 0x104E54, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81043E8 - -.global gLatiosPreFightDialogue_1 -gLatiosPreFightDialogue_1: @ 8104E60 -@ replacing .incbin "baserom.gba", 0x104E60, 0x9C -.byte 0x02, 0x00, 0x00, 0x0d, 0x99, 0x01, 0x00, 0x00 -.4byte gUnknown_8104E6C - -.global gUnknown_8104E6C -gUnknown_8104E6C: @ 8104E6C -.string " Oh!{WAIT_PRESS}\n" -.string "Who are you?!{EXTRA_MSG}" -.string " ............{WAIT_PRESS}\n" -.string "I see. You're trying to get your TMs back.{EXTRA_MSG}" -.string " But!{EXTRA_MSG}" -.string " Nobody can stop me!{EXTRA_MSG}" -.string " I'm the Eon Pokémon {POKEMON_2}!\0" -.align 2, 0 - -.global gLatiosPreFightDialogue_2 -gLatiosPreFightDialogue_2: @ 8104EFC -@ replacing .incbin "baserom.gba", 0x104EFC, 0x34 -.byte 0x00, 0x00, 0x00, 0x0d, 0x99, 0x01, 0x00, 0x00 -.4byte gUnknown_8104F08 - -.global gUnknown_8104F08 -gUnknown_8104F08: @ 8104F08 -.string " If you really want your\n" -.string "TMs back...\0" -.align 2, 0 - -.global gLatiosPreFightDialogue_3 -gLatiosPreFightDialogue_3: @ 8104F30 -@ replacing .incbin "baserom.gba", 0x104F30, 0x34 -.byte 0x00, 0x00, 0x00, 0x0d, 0x99, 0x01, 0x00, 0x00 -.4byte gUnknown_8104F3C - -.global gUnknown_8104F3C -gUnknown_8104F3C: @ 8104F3C -.string " You'll have to take them\n" -.string "from me!\0" -.align 2, 0 - -.global gLatiosReFightDialogue_1 -gLatiosReFightDialogue_1: @ 8104F64 -@ replacing .incbin "baserom.gba", 0x104F64, 0x64 -.byte 0x00, 0x00, 0x00, 0x0d, 0x99, 0x01, 0x00, 0x00 -.4byte gUnknown_8104F70 - -.global gUnknown_8104F70 -gUnknown_8104F70: @ 8104F70 -.string " You're back?{EXTRA_MSG}" -.string " But!{EXTRA_MSG}" -.string " It doesn't matter how often\n" -.string "you come!{WAIT_PRESS}\n" -.string "Nobody can stop me!\0" -.align 2, 0 - -.global gUnknown_8104FC8 -gUnknown_8104FC8: @ 8104FC8 -@ replacing .incbin "baserom.gba", 0x104FC8, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8100D48 - -.global gRegirockPreFightDialogue_1 -gRegirockPreFightDialogue_1: @ 8104FD4 -@ replacing .incbin "baserom.gba", 0x104FD4, 0x54 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8104FE0 - -.global gUnknown_8104FE0 -gUnknown_8104FE0: @ 8104FE0 -.string "{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}" -.string "{CENTER_ALIGN}EXTERMINATE!{EXTRA_MSG}" -.string "{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}" -.string "{CENTER_ALIGN}EXTERMINATE!\0" -.align 2, 0 - -.global gRegicePreFightDialogue_1 -gRegicePreFightDialogue_1: @ 8105028 -@ replacing .incbin "baserom.gba", 0x105028, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8104FE0 - -.global gRegisteelPreFightDialogue_1 -gRegisteelPreFightDialogue_1: @ 8105034 -@ replacing .incbin "baserom.gba", 0x105034, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8104FE0 - -.global gRegirockPostFightDialogue_1 -gRegirockPostFightDialogue_1: @ 8105040 -@ replacing .incbin "baserom.gba", 0x105040, 0x74 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810504C - -.global gUnknown_810504C -gUnknown_810504C: @ 810504C -.string "{CENTER_ALIGN}Something fell from\n" -.string "{CENTER_ALIGN}{COLOR CYAN_M}Regirock{RESET}'s body.{EXTRA_MSG}" -.string "{CENTER_ALIGN}{COLOR CYAN_M}Regirock{RESET} was apparently\n" -.string "{CENTER_ALIGN}guarding this item.\0" -.align 2, 0 - -.global gRegirockPostFightDialogue_2 -gRegirockPostFightDialogue_2: @ 81050B4 -@ replacing .incbin "baserom.gba", 0x1050B4, 0x58 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81050C0 - -.global gUnknown_81050C0 -gUnknown_81050C0: @ 81050C0 -.string "{CENTER_ALIGN}{POKEMON_0} obtained\n" -.string "{CENTER_ALIGN}the {COLOR GREEN_I}Rock Part{RESET}...{EXTRA_MSG}" -.string "{CENTER_ALIGN}that {COLOR CYAN_M}Regirock{RESET} was guarding!\0" -.align 2, 0 - -.global gRegicePostFightDialogue_1 -gRegicePostFightDialogue_1: @ 810510C -@ replacing .incbin "baserom.gba", 0x10510C, 0x70 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8105118 - -.global gUnknown_8105118 -gUnknown_8105118: @ 8105118 -.string "{CENTER_ALIGN}Something fell from\n" -.string "{CENTER_ALIGN}{COLOR CYAN_M}Regice{RESET}'s body.{EXTRA_MSG}" -.string "{CENTER_ALIGN}{COLOR CYAN_M}Regice{RESET} was apparently\n" -.string "{CENTER_ALIGN}guarding this item.\0" -.align 2, 0 - -.global gRegicePostFightDialogue_2 -gRegicePostFightDialogue_2: @ 810517C -@ replacing .incbin "baserom.gba", 0x10517C, 0x54 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8105188 - -.global gUnknown_8105188 -gUnknown_8105188: @ 8105188 -.string "{CENTER_ALIGN}{POKEMON_0} obtained\n" -.string "{CENTER_ALIGN}the {COLOR GREEN_I}Ice Part{RESET}...{EXTRA_MSG}" -.string "{CENTER_ALIGN}that {COLOR CYAN_M}Regice{RESET} was guarding!\0" -.align 2, 0 - -.global gRegisteelPostFightDialogue_1 -gRegisteelPostFightDialogue_1: @ 81051D0 -@ replacing .incbin "baserom.gba", 0x1051D0, 0x74 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81051DC - -.global gUnknown_81051DC -gUnknown_81051DC: @ 81051DC -.string "{CENTER_ALIGN}Something fell from\n" -.string "{CENTER_ALIGN}{COLOR CYAN_M}Registeel{RESET}'s body.{EXTRA_MSG}" -.string "{CENTER_ALIGN}{COLOR CYAN_M}Registeel{RESET} was apparently\n" -.string "{CENTER_ALIGN}guarding this item.\0" -.align 2, 0 - -.global gRegisteelPostFightDialogue_2 -gRegisteelPostFightDialogue_2: @ 8105244 -@ replacing .incbin "baserom.gba", 0x105244, 0xD8 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8105250 - -.global gUnknown_8105250 -gUnknown_8105250: @ 8105250 -.string "{CENTER_ALIGN}{POKEMON_0} obtained\n" -.string "{CENTER_ALIGN}the {COLOR GREEN_I}Steel Part{RESET}...{EXTRA_MSG}" -.string "{CENTER_ALIGN}that {COLOR CYAN_M}Registeel{RESET} was guarding!\0" -.align 2, 0 - -.global gUnknown_81052A0 -gUnknown_81052A0: @ 81052A0 -.string "{CENTER_ALIGN}That means...{EXTRA_MSG}" -.string "{CENTER_ALIGN}By finding the {COLOR GREEN_I}Rock Part{RESET},\n" -.string "{CENTER_ALIGN}{COLOR GREEN_I}Ice Part{RESET}, and {COLOR GREEN_I}Steel Part{RESET}...{EXTRA_MSG}" -.string "{CENTER_ALIGN}All three parts are yours!\0" -.align 2, 0 - -.global gUnknown_810531C -gUnknown_810531C: @ 810531C -@ replacing .incbin "baserom.gba", 0x10531C, 0x44 -.4byte gUnknown_81052A0 - -.global gUnknown_8105320 -gUnknown_8105320: @ 8105320 -.string "{CENTER_ALIGN}Oh? The three parts...{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}They're reacting to each other?\0" -.align 2, 0 - -.global gUnknown_8105360 -gUnknown_8105360: @ 8105360 -@ replacing .incbin "baserom.gba", 0x105360, 0x48 -.4byte gUnknown_8105320 - -.global gUnknown_8105364 -gUnknown_8105364: @ 8105364 -.string "{CENTER_ALIGN}The three parts\n" -.string "{CENTER_ALIGN}fit together...{EXTRA_MSG}" -.string "{CENTER_ALIGN}and became a {COLOR GREEN_I}Music Box{RESET}!\0" -.align 2, 0 - -.global gUnknown_81053A8 -gUnknown_81053A8: @ 81053A8 -@ replacing .incbin "baserom.gba", 0x1053A8, 0x8C -.4byte gUnknown_8105364 - -.global gUnknown_81053AC -gUnknown_81053AC: @ 81053AC -.string "{CENTER_ALIGN}{POKEMON_0} obtained\n" -.string "{CENTER_ALIGN}the {COLOR GREEN_I}Music Box{RESET}!{EXTRA_MSG}" -.string "{CENTER_ALIGN}The {COLOR GREEN_I}Music Box{RESET} only needs\n" -.string "{CENTER_ALIGN}to be in the Toolbox for it to\n" -.string "{CENTER_ALIGN}attract a special something!\0" -.align 2, 0 - -.global gUnknown_8105434 -gUnknown_8105434: @ 8105434 -@ replacing .incbin "baserom.gba", 0x105434, 0x4 -.4byte gUnknown_81053AC - -.global gJirachiPreFightDialogue_1 -gJirachiPreFightDialogue_1: @ 8105438 -@ replacing .incbin "baserom.gba", 0x105438, 0x68 -.byte 0x00, 0x00, 0x01, 0x0d, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8105444 - -.global gUnknown_8105444 -gUnknown_8105444: @ 8105444 -.string " ........................{EXTRA_MSG}" -.string " ......Fwaaaaaaaahhh......{EXTRA_MSG}" -.string " I'm still sleepy...\n" -.string "Fnyumnyum...\0" -.align 2, 0 - -.global gJirachiPreFightDialogue_2 -gJirachiPreFightDialogue_2: @ 81054A0 -@ replacing .incbin "baserom.gba", 0x1054A0, 0x44 -.byte 0x00, 0x00, 0x01, 0x0d, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_81054AC - -.global gUnknown_81054AC -gUnknown_81054AC: @ 81054AC -.string " ...Who is it?{EXTRA_MSG}" -.string " Who is that over there?\n" -.string "Fnyumnyum...\0" -.align 2, 0 - -.global gJirachiPreFightDialogue_3 -gJirachiPreFightDialogue_3: @ 81054E4 -@ replacing .incbin "baserom.gba", 0x1054E4, 0x28 -.byte 0x02, 0x00, 0x01, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_81054F0 - -.global gUnknown_81054F0 -gUnknown_81054F0: @ 81054F0 -.string " I'm {POKEMON_2}.\n" -.string "Who are you?\0" -.align 2, 0 - -.global gJirachiPreFightDialogue_4 -gJirachiPreFightDialogue_4: @ 810550C -@ replacing .incbin "baserom.gba", 0x10550C, 0x40 -.byte 0x00, 0x00, 0x01, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105518 - -.global gUnknown_8105518 -gUnknown_8105518: @ 8105518 -.string " ......Fwaaaaahhhh......\n" -.string "I'm still...sleepy...\0" -.align 2, 0 - -.global gUnknown_810554C -gUnknown_810554C: @ 810554C -@ replacing .incbin "baserom.gba", 0x10554C, 0xC -.byte 0x01, 0x00, 0x01, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105518 - -.global gUnknown_8105558 -gUnknown_8105558: @ 8105558 -@ replacing .incbin "baserom.gba", 0x105558, 0x9C -.byte 0x00, 0x00, 0x01, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105564 - -.global gUnknown_8105564 -gUnknown_8105564: @ 8105564 -.string " ...I think I had a dream,\n" -.string "and I was fighting in it...{WAIT_PRESS}\n" -.string "Did I imagine it?{EXTRA_MSG}" -.string " ...I'm sleepy, so I'm going\n" -.string "back to sleep...\n" -.string "Good night...\0" -.align 2, 0 - -.global gUnknown_81055F4 -gUnknown_81055F4: @ 81055F4 -@ replacing .incbin "baserom.gba", 0x1055F4, 0x74 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8105600 - -.global gUnknown_8105600 -gUnknown_8105600: @ 8105600 -.string "{CENTER_ALIGN}{COLOR CYAN_M}{POKEMON_2}{RESET} fell\n" -.string "{CENTER_ALIGN}back into a deep sleep...{EXTRA_MSG}" -.string "{CENTER_ALIGN}Apparently, {COLOR CYAN_M}{POKEMON_2}{RESET}\n" -.string "{CENTER_ALIGN}was fighting in its sleep...\0" -.align 2, 0 - -.global gUnknown_8105668 -gUnknown_8105668: @ 8105668 -@ replacing .incbin "baserom.gba", 0x105668, 0xC -.byte 0x00, 0x00, 0x01, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105518 - -.global gUnknown_8105674 -gUnknown_8105674: @ 8105674 -@ replacing .incbin "baserom.gba", 0x105674, 0x44 -.byte 0x00, 0x00, 0x01, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105680 - -.global gUnknown_8105680 -gUnknown_8105680: @ 8105680 -.string " ...Oh, oh?!\n" -.string "I hear singing...{EXTRA_MSG}" -.string " A song of purity...\0" -.align 2, 0 - -.global gUnknown_81056B8 -gUnknown_81056B8: @ 81056B8 -@ replacing .incbin "baserom.gba", 0x1056B8, 0x24 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_81056C4 - -.global gUnknown_81056C4 -gUnknown_81056C4: @ 81056C4 -.string " Ha!{WAIT_PRESS}\n" -.string "Eyes wide open!\0" -.align 2, 0 - -.global gUnknown_81056DC -gUnknown_81056DC: @ 81056DC -@ replacing .incbin "baserom.gba", 0x1056DC, 0xBC -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_81056E8 - -.global gUnknown_81056E8 -gUnknown_81056E8: @ 81056E8 -.string " I don't know why, but I'm\n" -.string "wide awake!{EXTRA_MSG}" -.string " I'm {POKEMON_2}.{EXTRA_MSG}" -.string " When I awaken, I grant\n" -.string "a wish.\n" -.string "I have to.{EXTRA_MSG}" -.string " Er-hem...{WAIT_PRESS}\n" -.string "Then...{WAIT_PRESS}" -.string " I ask you this.\0" -.align 2, 0 - -.global gUnknown_8105778 -gUnknown_8105778: @ 8105778 -.string "{COLOR YELLOW_N}{POKEMON_2}{RESET}: What is your \n" -.string "wish?\0" -.align 2, 0 - -.global gUnknown_8105798 -gUnknown_8105798: @ 8105798 -@ replacing .incbin "baserom.gba", 0x105798, 0x4 -.4byte gUnknown_8105778 - -.global gUnknown_810579C -gUnknown_810579C: @ 810579C -@ replacing .incbin "baserom.gba", 0x10579C, 0x80 -.4byte gUnknown_810580C -.byte 0x01, 0x00, 0x00, 0x00 -.4byte gUnknown_81057FC -.byte 0x02, 0x00, 0x00, 0x00 -.4byte gUnknown_81057EC -.byte 0x03, 0x00, 0x00, 0x00 -.4byte gUnknown_81057DC -.byte 0x04, 0x00, 0x00, 0x00 -.4byte gUnknown_81057CC -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff - -.global gUnknown_81057CC -gUnknown_81057CC: @ 81057CC -.string "Something good!\0" -.align 2, 0 - -.global gUnknown_81057DC -gUnknown_81057DC: @ 81057DC -.string "More strength.\0" -.align 2, 0 - -.global gUnknown_81057EC -gUnknown_81057EC: @ 81057EC -.string "A Friend Area.\0" -.align 2, 0 - -.global gUnknown_81057FC -gUnknown_81057FC: @ 81057FC -.string "Lots of items.\0" -.align 2, 0 - -.global gUnknown_810580C -gUnknown_810580C: @ 810580C -.string "Lots of money.\0" -.align 2, 0 - -.global gUnknown_810581C -gUnknown_810581C: @ 810581C -@ replacing .incbin "baserom.gba", 0x10581C, 0x8C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105828 - -.global gUnknown_8105828 -gUnknown_8105828: @ 8105828 -.string " You want lots of money?{EXTRA_MSG}" -.string " As you wish.{WAIT_PRESS}\n" -.string "I'll gather all the money in the dungeon and\n" -.string "bring it here.{EXTRA_MSG}" -.string " Now...{WAIT_PRESS}\n" -.string "Here goes!\0" -.align 2, 0 - -.global gUnknown_81058A8 -gUnknown_81058A8: @ 81058A8 -@ replacing .incbin "baserom.gba", 0x1058A8, 0x1C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_81058B4 - -.global gUnknown_81058B4 -gUnknown_81058B4: @ 81058B4 -.string " Nnnnnnnnnn!\0" -.align 2, 0 - -.global gUnknown_81058C4 -gUnknown_81058C4: @ 81058C4 -@ replacing .incbin "baserom.gba", 0x1058C4, 0x1C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_81058D0 - -.global gUnknown_81058D0 -gUnknown_81058D0: @ 81058D0 -.string " Taaaaaaaah!\0" -.align 2, 0 - -.global gUnknown_81058E0 -gUnknown_81058E0: @ 81058E0 -@ replacing .incbin "baserom.gba", 0x1058E0, 0x5C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_81058EC - -.global gUnknown_81058EC -gUnknown_81058EC: @ 81058EC -.string " ...Fwaaaaaaaahhh...{EXTRA_MSG}" -.string " Using that power...\n" -.string "Made me sleepy...{WAIT_PRESS}\n" -.string "Good night...\0" -.align 2, 0 - -.global gUnknown_810593C -gUnknown_810593C: @ 810593C -@ replacing .incbin "baserom.gba", 0x10593C, 0x38 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8105948 - -.global gUnknown_8105948 -gUnknown_8105948: @ 8105948 -.string "{CENTER_ALIGN}{COLOR CYAN_M}{POKEMON_2}{RESET} fell\n" -.string "{CENTER_ALIGN}back into a deep sleep...\0" -.align 2, 0 - -.global gUnknown_8105974 -gUnknown_8105974: @ 8105974 -@ replacing .incbin "baserom.gba", 0x105974, 0x94 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105980 - -.global gUnknown_8105980 -gUnknown_8105980: @ 8105980 -.string " You want lots of items?{EXTRA_MSG}" -.string " As you wish.{WAIT_PRESS}\n" -.string "I'll gather all the good items in the dungeon\n" -.string "and bring them here.{EXTRA_MSG}" -.string " Now...{WAIT_PRESS}\n" -.string "Here goes!\0" -.align 2, 0 - -.global gUnknown_8105A08 -gUnknown_8105A08: @ 8105A08 -@ replacing .incbin "baserom.gba", 0x105A08, 0xCC -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105A14 - -.global gUnknown_8105A14 -gUnknown_8105A14: @ 8105A14 -.string " You want a Friend Area?{EXTRA_MSG}" -.string " ...But...{WAIT_PRESS}\n" -.string "Don't you already have many Friend\n" -.string "Areas?{EXTRA_MSG}" -.string " I can't grant you that wish,\n" -.string "so can you choose another one?{EXTRA_MSG}" -.string " Er-hem...{WAIT_PRESS}\n" -.string "Then...{WAIT_PRESS}" -.string " I ask you again.\0" -.align 2, 0 - -.global gUnknown_8105AD4 -gUnknown_8105AD4: @ 8105AD4 -@ replacing .incbin "baserom.gba", 0x105AD4, 0x4C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105AE0 - -.global gUnknown_8105AE0 -gUnknown_8105AE0: @ 8105AE0 -.string " You want a Friend Area?{EXTRA_MSG}" -.string " As you wish.{WAIT_PRESS}\n" -.string "Now...{WAIT_PRESS}\n" -.string "Here goes!\0" -.align 2, 0 - -.global gUnknown_8105B20 -gUnknown_8105B20: @ 8105B20 -@ replacing .incbin "baserom.gba", 0x105B20, 0x48 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105B2C - -.global gUnknown_8105B2C -gUnknown_8105B2C: @ 8105B2C -.string " I opened a new Friend Area\n" -.string "for you. It's yours to use!\0" -.align 2, 0 - -.global gUnknown_8105B68 -gUnknown_8105B68: @ 8105B68 -@ replacing .incbin "baserom.gba", 0x105B68, 0x40 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8105B74 - -.global gUnknown_8105B74 -gUnknown_8105B74: @ 8105B74 -.string "{CENTER_ALIGN}{COLOR CYAN_M}{POKEMON_0}{RESET} obtained\n" -.string "{CENTER_ALIGN}the Friend Area\n" -.string "{CENTER_ALIGN}{COLOR GREEN_H}{MOVE_ITEM_0}{RESET}!\0" -.align 2, 0 - -.global gUnknown_8105BA8 -gUnknown_8105BA8: @ 8105BA8 -@ replacing .incbin "baserom.gba", 0x105BA8, 0x4C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105BB4 - -.global gUnknown_8105BB4 -gUnknown_8105BB4: @ 8105BB4 -.string " You want to be stronger?{EXTRA_MSG}" -.string " As you wish.{WAIT_PRESS}\n" -.string "Now...{WAIT_PRESS}\n" -.string "Here goes!\0" -.align 2, 0 - -.global gUnknown_8105BF4 -gUnknown_8105BF4: @ 8105BF4 -@ replacing .incbin "baserom.gba", 0x105BF4, 0x138 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105C00 - -.global gUnknown_8105C00 -gUnknown_8105C00: @ 8105C00 -.string " I gathered up items from\n" -.string "all over the dungeon that may make you \n" -.string "stronger.{EXTRA_MSG}" -.string " But don't use them now.{WAIT_PRESS}\n" -.string "When you leave the {COLOR YELLOW_D}Wish Cave{RESET}, your\n" -.string "powers go back to their original state.{EXTRA_MSG}" -.string " So, you should only use\n" -.string "those items after you take them back.{EXTRA_MSG}" -.string " I hope you keep working to\n" -.string "become stronger!\0" -.align 2, 0 - -.global gUnknown_8105D2C -gUnknown_8105D2C: @ 8105D2C -@ replacing .incbin "baserom.gba", 0x105D2C, 0x54 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105D38 - -.global gUnknown_8105D38 -gUnknown_8105D38: @ 8105D38 -.string " Something good?{WAIT_PRESS}\n" -.string "That's not very easy...{EXTRA_MSG}" -.string " But I'll do my best!\0" -.align 2, 0 - -.global gUnknown_8105D80 -gUnknown_8105D80: @ 8105D80 -@ replacing .incbin "baserom.gba", 0x105D80, 0x1C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105D8C - -.global gUnknown_8105D8C -gUnknown_8105D8C: @ 8105D8C -.string " It's done...\0" -.align 2, 0 - -.global gUnknown_8105D9C -gUnknown_8105D9C: @ 8105D9C -@ replacing .incbin "baserom.gba", 0x105D9C, 0x78 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9d, 0x01, 0x00, 0x00 -.4byte gUnknown_8105DA8 - -.global gUnknown_8105DA8 -gUnknown_8105DA8: @ 8105DA8 -.string " If you can get home safely,\n" -.string "I think there will be something good\n" -.string "waiting for you.{WAIT_PRESS}" -.string " Maybe.{WAIT_PRESS}" -.string " Definitely.\0" -.align 2, 0 - -.global gJirachiReFightDialogue_1 -gJirachiReFightDialogue_1: @ 8105E14 -@ replacing .incbin "baserom.gba", 0x105E14, 0x74 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8105E20 - -.global gUnknown_8105E20 -gUnknown_8105E20: @ 8105E20 -.string "{CENTER_ALIGN}The master of this area isn't here.{EXTRA_MSG}" -.string "{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}It's time to go back.\0" -.align 2, 0 -@ Lugia Fight Dialogue - -.global gLugiaPreFightDialogue_1 -gLugiaPreFightDialogue_1: @ 8105E88 -@ replacing .incbin "baserom.gba", 0x105E88, 0x70 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_8105E94 - -.global gUnknown_8105E94 -gUnknown_8105E94: @ 8105E94 -.string " Why...{WAIT_PRESS}\n" -.string "Why have you come here...?{EXTRA_MSG}" -.string " This is...{WAIT_PRESS}" -.string "the {COLOR YELLOW_D}Silver Trench{RESET}.{WAIT_PRESS}\n" -.string "This is my territory!\0" -.align 2, 0 - -.global gLugiaPreFightDialogue_2 -gLugiaPreFightDialogue_2: @ 8105EF8 -@ replacing .incbin "baserom.gba", 0x105EF8, 0x40 -.byte 0x02, 0x00, 0x00, 0x0d, 0x12, 0x01, 0x00, 0x00 -.4byte gUnknown_8105F04 - -.global gUnknown_8105F04 -gUnknown_8105F04: @ 8105F04 -.string " My name is {POKEMON_2}!{WAIT_PRESS}\n" -.string "I am the guardian of the seas!\0" -.align 2, 0 - -.global gLugiaPreFightDialogue_3 -gLugiaPreFightDialogue_3: @ 8105F38 -@ replacing .incbin "baserom.gba", 0x105F38, 0x3C -.byte 0x00, 0x00, 0x00, 0x0d, 0x12, 0x01, 0x00, 0x00 -.4byte gUnknown_8105F44 - -.global gUnknown_8105F44 -gUnknown_8105F44: @ 8105F44 -.string " To protect this sea,\n" -.string "I have settled here...\0" -.align 2, 0 - -.global gLugiaPreFightDialogue_4 -gLugiaPreFightDialogue_4: @ 8105F74 -@ replacing .incbin "baserom.gba", 0x105F74, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x12, 0x01, 0x00, 0x00 -.4byte gUnknown_8105F80 - -.global gUnknown_8105F80 -gUnknown_8105F80: @ 8105F80 -.string " If you dare to challenge\n" -.string "me...\0" -.align 2, 0 - -.global gLugiaPreFightDialogue_5 -gLugiaPreFightDialogue_5: @ 8105FA0 -@ replacing .incbin "baserom.gba", 0x105FA0, 0x38 -.byte 0x00, 0x00, 0x00, 0x0d, 0x12, 0x01, 0x00, 0x00 -.4byte gUnknown_8105FAC - -.global gUnknown_8105FAC -gUnknown_8105FAC: @ 8105FAC -.string " So be it!\n" -.string "I will rise to your challenge!\0" -.align 2, 0 - -.global gLugiaPreFightDialogue_6 -gLugiaPreFightDialogue_6: @ 8105FD8 -@ replacing .incbin "baserom.gba", 0x105FD8, 0x4C -.byte 0x00, 0x00, 0x00, 0x0d, 0x12, 0x01, 0x00, 0x00 -.4byte gUnknown_8105FE4 - -.global gUnknown_8105FE4 -gUnknown_8105FE4: @ 8105FE4 -.string " Cast aside all thoughts!{WAIT_PRESS}\n" -.string "Unleash every bit of your power!\0" -.align 2, 0 - -.global gLugiaPreFightDialogue_7 -gLugiaPreFightDialogue_7: @ 8106024 -@ replacing .incbin "baserom.gba", 0x106024, 0x44 -.byte 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8106030 - -.global gUnknown_8106030 -gUnknown_8106030: @ 8106030 -.string "{CENTER_ALIGN}With your life at stake...{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}Bring it on!{WAIT_PRESS}\n" -.string "{CENTER_ALIGN} {WAIT_PRESS}" -.string " \0" -.align 2, 0 - -.global gLugiaPreFightDialogue_8 -gLugiaPreFightDialogue_8: @ 8106068 -@ replacing .incbin "baserom.gba", 0x106068, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81043E8 -@ Kyogre Fight Dialogue - -.global gKyogrePreFightDialogue_1 -gKyogrePreFightDialogue_1: @ 8106074 -@ replacing .incbin "baserom.gba", 0x106074, 0x48 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8106080 - -.global gUnknown_8106080 -gUnknown_8106080: @ 8106080 -.string "Gwoooooooooooh..................\n" -.string " \0" -.align 2, 0 - -.global gKyogrePreFightDialogue_2 -gKyogrePreFightDialogue_2: @ 81060BC -@ replacing .incbin "baserom.gba", 0x1060BC, 0x48 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_81060C8 - -.global gUnknown_81060C8 -gUnknown_81060C8: @ 81060C8 -.string " ...My power...{WAIT_PRESS}\n" -.string "is bursting...{EXTRA_MSG}" -.string " My infinite...{WAIT_PRESS}\n" -.string "power!\0" -.align 2, 0 - -.global gKyogrePreFightDialogue_3 -gKyogrePreFightDialogue_3: @ 8106104 -@ replacing .incbin "baserom.gba", 0x106104, 0x3C -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8106110 - -.global gUnknown_8106110 -gUnknown_8106110: @ 8106110 -.string "Gwwwwwoooooooooooh!\n" -.string " \0" -.align 2, 0 - -.global gKyogrePreFightDialogue_4 -gKyogrePreFightDialogue_4: @ 8106140 -@ replacing .incbin "baserom.gba", 0x106140, 0xD4 -.byte 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_810614C - -.global gUnknown_810614C -gUnknown_810614C: @ 810614C -.string " My duels against {POKEMON_3} left\n" -.string "us both exhausted...{WAIT_PRESS}\n" -.string "I took to a long and deep sleep...{EXTRA_MSG}" -.string " All the time, I waited.\n" -.string "Waited for my power to recover.{EXTRA_MSG}" -.string " And now!{WAIT_PRESS}\n" -.string "I am on the verge of regaining my power!\0" -.align 2, 0 - -.global gKyogrePreFightDialogue_5 -gKyogrePreFightDialogue_5: @ 8106214 -@ replacing .incbin "baserom.gba", 0x106214, 0x30 -.byte 0x02, 0x00, 0x00, 0x0d, 0x9a, 0x01, 0x00, 0x00 -.4byte gUnknown_8106220 - -.global gUnknown_8106220 -gUnknown_8106220: @ 8106220 -.string " I am {POKEMON_2}!{WAIT_PRESS}\n" -.string "The lord of the sea!\0" -.align 2, 0 - -.global gKyogrePreFightDialogue_6 -gKyogrePreFightDialogue_6: @ 8106244 -@ replacing .incbin "baserom.gba", 0x106244, 0x38 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9a, 0x01, 0x00, 0x00 -.4byte gUnknown_8106250 - -.global gUnknown_8106250 -gUnknown_8106250: @ 8106250 -.string " Witness the destructive\n" -.string "force of my waves!\0" -.align 2, 0 - -.global gKyogrePreFightDialogue_7 -gKyogrePreFightDialogue_7: @ 810627C -@ replacing .incbin "baserom.gba", 0x10627C, 0x2C -.byte 0x00, 0x00, 0x00, 0x0d, 0x9a, 0x01, 0x00, 0x00 -.4byte gUnknown_8106288 - -.global gUnknown_8106288 -gUnknown_8106288: @ 8106288 -.string " Marvel at my awesome\n" -.string "power!\0" -.align 2, 0 - -.global gKyogrePreFightDialogue_8 -gKyogrePreFightDialogue_8: @ 81062A8 -@ replacing .incbin "baserom.gba", 0x1062A8, 0xC -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_81043E8 - -.global gDeoxysPreFightDialogue_1 -gDeoxysPreFightDialogue_1: @ 81062B4 -@ replacing .incbin "baserom.gba", 0x1062B4, 0x34 -.byte 0x02, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00 -.4byte gUnknown_81062C0 - -.global gUnknown_81062C0 -gUnknown_81062C0: @ 81062C0 -.string " ............{EXTRA_MSG}" -.string " Where...{WAIT_PRESS}\n" -.string "Where am I?\0" -.align 2, 0 - -.global gDeoxysPreFightDialogue_2 -gDeoxysPreFightDialogue_2: @ 81062E8 -@ replacing .incbin "baserom.gba", 0x1062E8, 0x80 -.byte 0x02, 0x00, 0x00, 0x0d, 0x9e, 0x01, 0x00, 0x00 -.4byte gUnknown_81062F4 - -.global gUnknown_81062F4 -gUnknown_81062F4: @ 81062F4 -.string " There was a sudden explosion...{WAIT_PRESS}\n" -.string "And I awakened to this...{EXTRA_MSG}" -.string " What is this place?{EXTRA_MSG}" -.string " I am {POKEMON_2}.{WAIT_PRESS}\n" -.string "I came from space.\0" -.align 2, 0 - -.global gDeoxysPreFightDialogue_3 -gDeoxysPreFightDialogue_3: @ 8106368 -@ replacing .incbin "baserom.gba", 0x106368, 0x28 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9e, 0x01, 0x00, 0x00 -.4byte gUnknown_8106374 - -.global gUnknown_8106374 -gUnknown_8106374: @ 8106374 -.string " If you know, tell me.\0" -.align 2, 0 - -.global gDeoxysPreFightDialogue_4 -gDeoxysPreFightDialogue_4: @ 8106390 -@ replacing .incbin "baserom.gba", 0x106390, 0x34 -.byte 0x00, 0x00, 0x00, 0x0d, 0x9e, 0x01, 0x00, 0x00 -.4byte gUnknown_810639C - -.global gUnknown_810639C -gUnknown_810639C: @ 810639C -.string " I must know...{WAIT_PRESS}\n" -.string "what happened here!\0" -.align 2, 0 - -.global gDeoxysPreFightDialogue_5 -gDeoxysPreFightDialogue_5: @ 81063C4 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8103E40 -@ Dialogue for Purity Forest - -.global gCelebiJoinDialogue_1 -gCelebiJoinDialogue_1: @ 81063D0 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestSomeoneThereText - -.global gPurityForestSomeoneThereText -gPurityForestSomeoneThereText: @ 81063DC -.string "{CENTER_ALIGN}Oh?{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}There's someone there.\0" -.align 2, 0 - -.global gCelebiJoinDialogue_2 -gCelebiJoinDialogue_2: @ 8106400 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestCelebiIntroText - -.global gPurityForestCelebiIntroText -gPurityForestCelebiIntroText: @ 810640C -.string "{CENTER_ALIGN}It's...{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}The Time Travel Pokémon {POKEMON_2}!\0" -.align 2, 0 - -.global gCelebiJoinDialogue_3 -gCelebiJoinDialogue_3: @ 810643C -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestCelebiWantsToJoinText - -.global gPurityForestCelebiWantsToJoinText -gPurityForestCelebiWantsToJoinText: @ 8106448 -.string "{CENTER_ALIGN}{POKEMON_2} wants to join the team.\0" -.align 2, 0 - -.global gCelebiJoinDialogue_4 -gCelebiJoinDialogue_4: @ 8106468 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestCelebiJoinedText - -.global gPurityForestCelebiJoinedText -gPurityForestCelebiJoinedText: @ 8106474 -.string "{CENTER_ALIGN}{POKEMON_2} joined the team! \0" -.align 2, 0 - -.global gCelebiJoinDialogue_5 -gCelebiJoinDialogue_5: @ 810648C -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestCelebiVeryHappyText - -.global gPurityForestCelebiVeryHappyText -gPurityForestCelebiVeryHappyText: @ 8106498 -.string "{CENTER_ALIGN}{POKEMON_3} appears to\n" -.string "{CENTER_ALIGN}be very happy!\0" -.align 2, 0 - -.global gCelebiJoinDialogue_6 -gCelebiJoinDialogue_6: @ 81064BC -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestCelebiDelightedToJoinText - -.global gPurityForestCelebiDelightedToJoinText -gPurityForestCelebiDelightedToJoinText: @ 81064C8 -.string "{CENTER_ALIGN}It's delighted to have\n" -.string "{CENTER_ALIGN}joined the rescue team!\0" -.align 2, 0 - -.global gCelebiJoinDialogue_7 -gCelebiJoinDialogue_7: @ 8106500 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestTurnedDownOfferText - -.global gPurityForestTurnedDownOfferText -gPurityForestTurnedDownOfferText: @ 810650C -.string "{CENTER_ALIGN}{POKEMON_0} turned down\n" -.string "{CENTER_ALIGN}the offer to join.\0" -.align 2, 0 - -.global gCelebiJoinDialogue_8 -gCelebiJoinDialogue_8: @ 8106534 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestCelebiDisappointedText - -.global gPurityForestCelebiDisappointedText -gPurityForestCelebiDisappointedText: @ 8106540 -.string "{CENTER_ALIGN}Celebi is very disappointed.\0" -.align 2, 0 - -.global gCelebiJoinDialogue_9 -gCelebiJoinDialogue_9: @ 8106560 -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gPurityForestCelebiLeftDejectedlyText - -.global gPurityForestCelebiLeftDejectedlyText -gPurityForestCelebiLeftDejectedlyText: @ 810656C -.string "{CENTER_ALIGN}{POKEMON_2} left\n" -.string "{CENTER_ALIGN}dejectedly...\0" -.align 2, 0 - -.global gPurityForestAllowCelebiToJoinText -gPurityForestAllowCelebiToJoinText: @ 8106588 -.string "{CENTER_ALIGN}Allow {POKEMON_2}\n" -.string "{CENTER_ALIGN}to join the team?\0" -.align 2, 0 - -.global gPtrPurityForestAllowCelebiToJoinText -gPtrPurityForestAllowCelebiToJoinText: @ 81065A8 -.4byte gPurityForestAllowCelebiToJoinText - -.global gPurityForestAllowCelebiToJoinPrompt -gPurityForestAllowCelebiToJoinPrompt: @ 81065AC -.4byte gPurityForestAllowCelebiToJoinYesText -.4byte 0x00000001 -.4byte gPurityForestAllowCelebiToJoinNoText -.4byte 0x00000002 -.4byte 0x00000000 -.4byte 0xFFFFFFFF - -.global gPurityForestAllowCelebiToJoinNoText -gPurityForestAllowCelebiToJoinNoText: @ 81065C4 -.string "No.\0" -.align 2, 0 - -.global gPurityForestAllowCelebiToJoinYesText -gPurityForestAllowCelebiToJoinYesText: @ 81065C8 -.string "Yes.\0" -.align 2, 0 - -.global gPurityForestRefuseCelebiConfirmText -gPurityForestRefuseCelebiConfirmText: @ 81065D0 -.string "{CENTER_ALIGN}Are you sure?{WAIT_PRESS}\n" -.string "{CENTER_ALIGN}You're sure you won't accept it?\0" -.align 2, 0 - -.global gPtrPurityForestRefuseCelebiConfirmText -gPtrPurityForestRefuseCelebiConfirmText: @ 810660C -.4byte gPurityForestRefuseCelebiConfirmText - -.global gPurityForestRefuseCelebiConfirmPrompt -gPurityForestRefuseCelebiConfirmPrompt: @ 8106610 -.4byte gPurityForestRefuseCelebiReconsiderText -.4byte 0x00000001 -.4byte gPurityForestRefuseCelebiRefuseText -.4byte 0x00000002 -.4byte 0x00000000 -.4byte 0xFFFFFFFF - -.global gPurityForestRefuseCelebiRefuseText -gPurityForestRefuseCelebiRefuseText: @ 8106628 -.string "Refuse.\0" -.align 2, 0 - -.global gPurityForestRefuseCelebiReconsiderText -gPurityForestRefuseCelebiReconsiderText: @ 8106630 -.string "Reconsider.\0" -.align 2, 0 - -.global gCelebiJoinDialogue_10 -gCelebiJoinDialogue_10: @ 810663C -@ replacing .incbin "baserom.gba", 0x10663C, 0x20 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8103E40 - -.global gUnknown_8106648 -gUnknown_8106648: @ 8106648 -.string "{CENTER_ALIGN}...............\0" -.align 2, 0 - -.global gUnknown_810665C -gUnknown_810665C: @ 810665C -@ replacing .incbin "baserom.gba", 0x10665C, 0x30 -.4byte gUnknown_8106648 - -.global gUnknown_8106660 -gUnknown_8106660: @ 8106660 -.string "{CENTER_ALIGN}Someone has intruded\n" -.string "{CENTER_ALIGN}upon the forest...\0" -.align 2, 0 - -.global gUnknown_810668C -gUnknown_810668C: @ 810668C -@ replacing .incbin "baserom.gba", 0x10668C, 0x48 -.4byte gUnknown_8106660 - -.global gUnknown_8106690 -gUnknown_8106690: @ 8106690 -.string "{CENTER_ALIGN}The enfeebled flow of icy winds...\n" -.string "{CENTER_ALIGN}Is the intrusion to blame?\0" -.align 2, 0 - -.global gUnknown_81066D4 -gUnknown_81066D4: @ 81066D4 -@ replacing .incbin "baserom.gba", 0x1066D4, 0x1C -.4byte gUnknown_8106690 - -.global gUnknown_81066D8 -gUnknown_81066D8: @ 81066D8 -.string "{CENTER_ALIGN}It must be stopped.\0" -.align 2, 0 - -.global gUnknown_81066F0 -gUnknown_81066F0: @ 81066F0 -@ replacing .incbin "baserom.gba", 0x1066F0, 0x2C -.4byte gUnknown_81066D8 - -.global gUnknown_81066F4 -gUnknown_81066F4: @ 81066F4 -.string "{CENTER_ALIGN}For it is to protect the forest...\0" -.align 2, 0 - -.global gUnknown_810671C -gUnknown_810671C: @ 810671C -@ replacing .incbin "baserom.gba", 0x10671C, 0x4 -.4byte gUnknown_81066F4 - -.global gUnknown_8106720 -gUnknown_8106720: @ 8106720 -@ replacing .incbin "baserom.gba", 0x106720, 0x58 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_810672C - -.global gUnknown_810672C -gUnknown_810672C: @ 810672C -.string "{CENTER_ALIGN}Defeat the opposing team to win!\n" -.string "{CENTER_ALIGN}Be careful--your opponents are tough!\0" -.align 2, 0 - -.global gMedichamRescueDialogue_1 -gMedichamRescueDialogue_1: @ 8106778 -@ replacing .incbin "baserom.gba", 0x106778, 0x44 -.byte 0x00, 0x00, 0x04, 0x0d, 0x4d, 0x01, 0x00, 0x00 -.4byte gUnknown_8106784 - -.global gUnknown_8106784 -gUnknown_8106784: @ 8106784 -.string " Oh, my, my...\n" -.string "I can't seem to find a way out...\0" -.align 2, 0 - -.global gMedichamRescueDialogue_2 -gMedichamRescueDialogue_2: @ 81067BC -@ replacing .incbin "baserom.gba", 0x1067BC, 0x24 -.byte 0x00, 0x00, 0x04, 0x0d, 0x4d, 0x01, 0x00, 0x00 -.4byte gUnknown_81067C8 - -.global gUnknown_81067C8 -gUnknown_81067C8: @ 81067C8 -.string " What am I to do...?\0" -.align 2, 0 - -.global gMedichamRescueDialogue_3 -gMedichamRescueDialogue_3: @ 81067E0 -@ replacing .incbin "baserom.gba", 0x1067E0, 0x54 -.byte 0x00, 0x00, 0x02, 0x0d, 0x4d, 0x01, 0x00, 0x00 -.4byte gUnknown_81067EC - -.global gUnknown_81067EC -gUnknown_81067EC: @ 81067EC -.string " Oh!\n" -.string "You?!{EXTRA_MSG}" -.string " ............{WAIT_PRESS}\n" -.string "Perhaps...{EXTRA_MSG}" -.string " You have come to rescue\n" -.string "me?\0" -.align 2, 0 - -.global gMedichamRescueDialogue_4 -gMedichamRescueDialogue_4: @ 8106834 -@ replacing .incbin "baserom.gba", 0x106834, 0x58 -.byte 0x00, 0x00, 0x01, 0x0d, 0x4d, 0x01, 0x00, 0x00 -.4byte gUnknown_8106840 - -.global gUnknown_8106840 -gUnknown_8106840: @ 8106840 -.string " Yes, yes!\n" -.string "I am so lucky!\0" -.align 2, 0 - -.global gUnknown_810685C -gUnknown_810685C: @ 810685C -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8106868 - -.global gUnknown_8106868 -gUnknown_8106868: @ 8106868 -.string "{CENTER_ALIGN}There appears to be no one here.\0" -.align 2, 0 - -.global gSmeargleRescueDialogue_1 -gSmeargleRescueDialogue_1: @ 810688C -@ replacing .incbin "baserom.gba", 0x10688C, 0x44 -.byte 0x00, 0x00, 0x00, 0x0d, 0x04, 0x01, 0x00, 0x00 -.4byte gUnknown_8106898 - -.global gUnknown_8106898 -gUnknown_8106898: @ 8106898 -.string " Ohhh...\n" -.string "I've lost my bearings...{WAIT_PRESS}\n" -.string "Where is this?\0" -.align 2, 0 - -.global gSmeargleRescueDialogue_2 -gSmeargleRescueDialogue_2: @ 81068D0 -@ replacing .incbin "baserom.gba", 0x1068D0, 0x48 -.byte 0x00, 0x00, 0x00, 0x0d, 0x04, 0x01, 0x00, 0x00 -.4byte gUnknown_81068DC - -.global gUnknown_81068DC -gUnknown_81068DC: @ 81068DC -.string " I can't get out...\n" -.string "I'm hungry...{WAIT_PRESS}\n" -.string "I'm in trouble...\0" -.align 2, 0 - -.global gSmeargleRescueDialogue_3 -gSmeargleRescueDialogue_3: @ 8106918 -@ replacing .incbin "baserom.gba", 0x106918, 0x1C -.byte 0x00, 0x00, 0x00, 0x0d, 0x04, 0x01, 0x00, 0x00 -.4byte gUnknown_8106924 - -.global gUnknown_8106924 -gUnknown_8106924: @ 8106924 -.string " Oh!\n" -.string "You are?!\0" -.align 2, 0 - -.global gSmeargleRescueDialogue_4 -gSmeargleRescueDialogue_4: @ 8106934 -@ replacing .incbin "baserom.gba", 0x106934, 0x48 -.byte 0x00, 0x00, 0x00, 0x0d, 0x04, 0x01, 0x00, 0x00 -.4byte gUnknown_8106940 - -.global gUnknown_8106940 -gUnknown_8106940: @ 8106940 -.string " Did you maybe come to\n" -.string "rescue me?{WAIT_PRESS}\n" -.string "Am I glad to see you!\0" -.align 2, 0 - -.global gUnknown_810697C -gUnknown_810697C: @ 810697C -.byte 0x04, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00 -.4byte gUnknown_8103E40 diff --git a/data/data_80F59C8_1.s b/data/data_80F59C8_1.s index fb53fe435..053c8390e 100644 --- a/data/data_80F59C8_1.s +++ b/data/data_80F59C8_1.s @@ -3,44 +3,13 @@ #.incbin "baserom.gba", 0xF59C4, 0x4 +.align 2 -.global gUnknown_80F5F70 -gUnknown_80F5F70: @ 80F5F70 -@ replacing .incbin "baserom.gba", 0xF5F70, 0x3C -.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00 -.byte 0x0d, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00 -.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x00, 0x00 - -.global gUnknown_80F5FAC -gUnknown_80F5FAC: @ 80F5FAC -@ replacing .incbin "baserom.gba", 0xF5FAC, 0x130 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - -.global gUnknown_80F60DC -gUnknown_80F60DC: @ 80F60DC -@ replacing .incbin "baserom.gba", 0xF60DC, 0x1C -.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 +.global PKSDIRCHECK +PKSDIRCHECK: +.string "pksdir0\0" +.align 2 .global gUnknown_80F60F8 gUnknown_80F60F8: @ 80F60F8 @ replacing .incbin "baserom.gba", 0x000f60f8, 0x8 diff --git a/data/data_80F59C8_5.s b/data/data_80F59C8_5.s deleted file mode 100644 index e0600f28f..000000000 --- a/data/data_80F59C8_5.s +++ /dev/null @@ -1,211 +0,0 @@ -#include "constants/status.h" -.section .rodata -#.incbin "baserom.gba", 0xF59C4, 0x4 - -.string "pksdir0\0" -.string "pksdir0\0" - -.global gUnknown_80F6624 -gUnknown_80F6624: @ 80F6624 -@ replacing .incbin "baserom.gba", 0xF6624, 0x78 -.byte 0x78, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x7b, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.byte 0x7d, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0xb9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0xbb, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 - -.global gStatusSpriteMasks_SleepClassStatus -gStatusSpriteMasks_SleepClassStatus: @ 80F669C -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_SLEEP @ STATUS_SLEEP -.4byte STATUS_SPRITE_SLEEPLESS @ STATUS_SLEEPLESS -.4byte STATUS_SPRITE_SLEEP @ STATUS_NIGHTMARE -.4byte 0 @ STATUS_YAWNING -.4byte STATUS_SPRITE_SLEEP @ STATUS_NAPPING - -.global gStatusSpriteMasks_BurnClassStatus -gStatusSpriteMasks_BurnClassStatus: @ 80F66B4 -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_BURNED @ STATUS_BURN -.4byte STATUS_SPRITE_POISONED @ STATUS_POISONED -.4byte STATUS_SPRITE_BADLY_POISONED @ STATUS_BADLY_POISONED -.4byte 0 @ STATUS_PARALYSIS - -.global gStatusSpriteMasks_FrozenClassStatus -gStatusSpriteMasks_FrozenClassStatus: @ 80F66C8 -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_FROZEN @ STATUS_FROZEN -.4byte 0 @ STATUS_SHADOW_HOLD -.4byte 0 @ STATUS_WRAP -.4byte 0 @ STATUS_WRAPPED -.4byte 0 @ STATUS_INGRAIN -.4byte 0 @ STATUS_PETRIFIED -.4byte 0 @ STATUS_CONSTRICTION - -.global gStatusSpriteMasks_CringeClassStatus -gStatusSpriteMasks_CringeClassStatus: @ 80F66E8 -.4byte 0 @ STATUS_NONE -.4byte 0 @ STATUS_CRINGE -.4byte STATUS_SPRITE_CONFUSED @ STATUS_CONFUSED -.4byte 0 @ STATUS_PAUSED -.4byte STATUS_SPRITE_COWERING @ STATUS_COWERING -.4byte STATUS_SPRITE_TAUNTED @ STATUS_TAUNTED -.4byte STATUS_SPRITE_ENCORE @ STATUS_ENCORE -.4byte 0 @ STATUS_INFATUATED - -.global gStatusSpriteMasks_BideClassStatus -gStatusSpriteMasks_BideClassStatus: @ 80F6708 -.4byte 0 @ STATUS_NONE -.4byte 0 @ STATUS_BIDE -.4byte 0 @ STATUS_SOLARBEAM -.4byte 0 @ STATUS_SKY_ATTACK -.4byte 0 @ STATUS_RAZOR_WIND -.4byte 0 @ STATUS_FOCUS_PUNCH -.4byte 0 @ STATUS_SKULL_BASH -.4byte 0 @ STATUS_FLYING -.4byte 0 @ STATUS_BOUNCING -.4byte 0 @ STATUS_DIVING -.4byte 0 @ STATUS_DIGGING -.4byte 0 @ STATUS_CHARGING -.4byte 0 @ STATUS_ENRAGED - -.global gStatusSpriteMasks_ReflectClassStatus -gStatusSpriteMasks_ReflectClassStatus: @ 80F673C -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_REFLECT -.4byte STATUS_SPRITE_SHIELD_RED @ STATUS_SAFEGUARD -.4byte STATUS_SPRITE_SHIELD_YELLOW @ STATUS_LIGHT_SCREEN -.4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_COUNTER -.4byte STATUS_SPRITE_SHIELD_YELLOW @ STATUS_MAGIC_COAT -.4byte 0 @ STATUS_WISH -.4byte STATUS_SPRITE_SHIELD_GREEN @ STATUS_PROTECT -.4byte STATUS_SPRITE_SHIELD_RED @ STATUS_MIRROR_COAT -.4byte STATUS_SPRITE_ENDURE @ STATUS_ENDURING -.4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_MINI_COUNTER -.4byte STATUS_SPRITE_SHIELD_GREEN @ STATUS_MIRROR_MOVE -.4byte 0 @ STATUS_CONVERSION2 -.4byte STATUS_SPRITE_SHIELD_GREEN @ STATUS_VITAL_THROW -.4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_MIST - -.global gStatusSpriteMasks_CurseClassStatus -gStatusSpriteMasks_CurseClassStatus: @ 80F6778 -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_CURSED @ STATUS_CURSED -.4byte 0 @ STATUS_DECOY -.4byte STATUS_SPRITE_SNATCH @ STATUS_SNATCH - -.global gStatusSpriteMasks_LeechSeedClassStatus -gStatusSpriteMasks_LeechSeedClassStatus: @ 80F6788 -.4byte 0 @ STATUS_NONE -.4byte 0 @ STATUS_LEECH_SEED -.4byte 0 @ STATUS_DESTINY_BOND - -.global gStatusSpriteMasks_SureShotClassStatus -gStatusSpriteMasks_SureShotClassStatus: @ 80F6794 -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_SURE_SHOT @ STATUS_SURE_SHOT -.4byte STATUS_SPRITE_WHIFFER @ STATUS_WHIFFER -.4byte STATUS_SPRITE_SET_DAMAGE @ STATUS_SET_DAMAGE -.4byte STATUS_SPRITE_FOCUS_ENERGY @ STATUS_FOCUS_ENERGY - -.global gStatusSpriteMasks_LongTossClassStatus -gStatusSpriteMasks_LongTossClassStatus: @ 80F67A8 -.4byte 0 @ STATUS_NONE -.4byte 0 @ STATUS_LONG_TOSS -.4byte 0 @ STATUS_PIERCE - -.global gStatusSpriteMasks_InvisibleClassStatus -gStatusSpriteMasks_InvisibleClassStatus: @ 80F67B4 -.4byte 0 @ STATUS_NONE -.4byte 0 @ STATUS_INVISIBLE -.4byte 0 @ STATUS_TRANSFORMED -.4byte 0 @ STATUS_MOBILE - -.global gStatusSpriteMasks_BlinkerClassStatus -gStatusSpriteMasks_BlinkerClassStatus: @ 80F67C4 -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_BLINKER @ STATUS_BLINKER -.4byte STATUS_SPRITE_CROSS_EYED @ STATUS_CROSS_EYED -.4byte STATUS_SPRITE_EYEDROPS @ STATUS_EYEDROPS - -.global gStatusSpriteMasks_MuzzledStatus -gStatusSpriteMasks_MuzzledStatus: @ 80F67D4 -.4byte 0 @ STATUS_NONE -.4byte STATUS_SPRITE_MUZZLED @ STATUS_MUZZLED - -.global gUnknown_80F67DC -gUnknown_80F67DC: @ 80F67DC -@ u16[4]. They are sound effect IDs -.byte 0xD8, 0x00, 0xD9, 0x00 -.byte 0xD9, 0x00, 0x73, 0x01 - -.global gUnknown_80F67E4 -gUnknown_80F67E4: @ 80F67E4 -@ u16[4]. They are sound effect IDs -.byte 0xDA, 0x00, 0xDB, 0x00 -.byte 0xDB, 0x00, 0x74, 0x01 - -.global gUnknown_80F67EC -gUnknown_80F67EC: @ 80F67EC -@ s32[8] -.byte 0xff, 0xff, 0xff, 0xff, 0x4b, 0x01, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x00, 0x00, 0x00 - -.global gUnknown_80F680C -gUnknown_80F680C: @ 80F680C -@ u32[8] -.byte 0xff, 0xff, 0xff, 0xff, 0x4b, 0x01, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff -.byte 0xb8, 0x01, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x00, 0x00, 0x00 - -.global gUnknown_80F682C -gUnknown_80F682C: @ 80F682C -@ u16[8] -.byte 0xe5, 0x03, 0xe5, 0x03, 0xe5, 0x03, 0xa9, 0x01, 0xe5, 0x03, 0xe5, 0x03, 0xaa, 0x01, 0xe5, 0x03 - -.global gUnknown_80F683C -gUnknown_80F683C: @ 80F683C -@ replacing .incbin "baserom.gba", 0xF683C, 0x14 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64 -.byte 0x69, 0x72, 0x30, 0x00 - -.global gUnknown_80F6850 -gUnknown_80F6850: @ 80F6850 -@ replacing .incbin "baserom.gba", 0xF6850, 0x10 -.byte 0x9e, 0x01, 0xa1, 0x01, 0xa2, 0x01, 0xa3, 0x01 -.byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 - -.global gSpeedTurns -gSpeedTurns: @ 80F6860 -@ replacing .incbin "baserom.gba", 0xF6860, 0x104 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00 -.byte 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00 -.byte 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00 -.byte 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x17, 0x00, 0x18, 0x00, 0x00, 0x00 -.byte 0x19, 0x00, 0x1a, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1d, 0x00, 0x1e, 0x00, 0x00, 0x00 -.byte 0x1f, 0x00, 0x20, 0x00, 0x21, 0x00, 0x00, 0x00, 0x22, 0x00, 0x23, 0x00, 0x24, 0x00, 0x00, 0x00 -.byte 0x25, 0x00, 0x26, 0x00, 0x27, 0x00, 0x00, 0x00, 0x28, 0x00, 0x29, 0x00, 0x2a, 0x00, 0x2b, 0x00 -.byte 0x2c, 0x00, 0x2d, 0x00, 0x2e, 0x00, 0x2f, 0x00, 0x30, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00 -.byte 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x37, 0x00, 0x38, 0x00, 0x39, 0x00, 0x3a, 0x00, 0x3b, 0x00 -.byte 0x3c, 0x00, 0x3d, 0x00, 0x3e, 0x00, 0x3f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64 -.byte 0x69, 0x72, 0x30, 0x00 - -.global gUnknown_80F6964 -gUnknown_80F6964: @ 80F6964 -@ replacing .incbin "baserom.gba", 0xF6964, 0x18 -.byte 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x00 -.byte 0x12, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x12, 0x00 - -.global gUnknown_80F697C -gUnknown_80F697C: @ 80F697C -.byte 0x58, 0x00, 0x00, 0x00 -.string "pksdir0" -.align 2,0 diff --git a/data/data_8106A4C.s b/data/data_8106A4C.s deleted file mode 100644 index 050c8543c..000000000 --- a/data/data_8106A4C.s +++ /dev/null @@ -1,8 +0,0 @@ - .section .rodata - - .align 2,0 - - -@ ??? - .align 2,0 - .string "pksdir0\0" diff --git a/data/data_8106A4C_0.s b/data/data_8106A4C_0.s deleted file mode 100644 index fba5034bd..000000000 --- a/data/data_8106A4C_0.s +++ /dev/null @@ -1,44 +0,0 @@ - .section .rodata - -@ sub_8048E04 - sub_805FC30 - .align 2,0 - .string "pksdir0\0" - - - .global gUnknown_8106A4C -gUnknown_8106A4C: @ 8106A4C - .4byte 0 - - .global gUnknown_8106A50 -gUnknown_8106A50: @ 8106A50 - .4byte 1 - - .global gUnknown_8106A54 -gUnknown_8106A54: @ 8106A54 -.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x80, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 -.byte 0x80, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00 - -.align 2,0 -.string "pksdir0\0" -.align 2,0 - -.align 2,0 -.string "pksdir0\0" -.align 2,0 - - .global gUnknown_8106A8C -gUnknown_8106A8C: @ 8106A8C -.byte 0x06, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 -.byte 0x18, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64 -.byte 0x69, 0x72, 0x30, 0x00 - -.align 2,0 -.string "pksdir0\0" -.align 2,0 - -.align 2,0 -.string "pksdir0\0" -.align 2,0 - - diff --git a/data/data_8106A4C_2.s b/data/data_8106A4C_2.s deleted file mode 100644 index 8482c6ab4..000000000 --- a/data/data_8106A4C_2.s +++ /dev/null @@ -1,20 +0,0 @@ - .section .rodata - -.align 2,0 - - - -@ ??? - .align 2,0 - .string "pksdir0\0" - -@ sub_806C51C - sub_806E100 - .align 2,0 - .string "pksdir0\0" - .align 2,0 - - .global gUnknown_8106EC8 -gUnknown_8106EC8: @ 8106EC8 -.byte 0x00, 0x01, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x05, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05 -.byte 0x06, 0x07, 0x07, 0x07, 0x07, 0x0b, 0x07 diff --git a/data/data_8106F7C.s b/data/data_8106F7C.s deleted file mode 100644 index 16f151564..000000000 --- a/data/data_8106F7C.s +++ /dev/null @@ -1,13 +0,0 @@ - .section .rodata - - .global gUnknown_8106F7C -gUnknown_8106F7C: @ 8106F7C - .int 0, 0, 0, 1 - - .string "pksdir0\0" - .string "pksdir0\0" - .string "pksdir0\0" - - .global gUnknown_8106FA4 -gUnknown_8106FA4: @ 8106FA4 - .string "{color}%c%s{reset}\0" diff --git a/data/data_8107010.s b/data/data_8107010.s deleted file mode 100644 index a129b8916..000000000 --- a/data/data_8107010.s +++ /dev/null @@ -1,93 +0,0 @@ -.section .rodata - -@ ??? -.string "pksdir0\0" -@ sub_807218C -.string "pksdir0\0" - -.global gUnknown_8107010 -gUnknown_8107010: @ 8107010 -.byte 0, 1, 1, 2, 1, 1, 0, 0 - -.global gUnknown_8107018 -gUnknown_8107018: @ 8107018 -.4byte gUnknown_810702C -.4byte gUnknown_8107028 -.4byte gUnknown_8107024 - -.global gUnknown_8107024 -gUnknown_8107024: @ 8107024 -.byte 0x0a, 0x00, 0x00, 0x00 - -.global gUnknown_8107028 -gUnknown_8107028: @ 8107028 -.byte 0x23, 0x57, 0x0a, 0x00 - -.global gUnknown_810702C -gUnknown_810702C: @ 810702C -.byte 0x00, 0x00, 0x00, 0x00 -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -@ HandleExplosion -.string "pksdir0\0" - -.global gUnknown_81070E8 -gUnknown_81070E8: @ 81070E8 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 -.byte 0xff, 0xff, 0x01, 0x00, 0x63, 0x00, 0x63, 0x00 - -.global gUnknown_8107110 -gUnknown_8107110: @ 8107110 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 -.byte 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00 -.byte 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0xfe, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff -.byte 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x00, 0x00 -.byte 0xfe, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x02, 0x00, 0xff, 0xff, 0x02, 0x00, 0x63, 0x00, 0x63, 0x00 - -.global gUnknown_8107178 -gUnknown_8107178: @ 8107178 -.4byte gUnknown_81070E8 -.4byte gUnknown_81070E8 -.4byte gUnknown_8107110 -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -.align 2,0 \ No newline at end of file diff --git a/data/data_810AC60.s b/data/data_810AC60.s deleted file mode 100644 index bf01dd647..000000000 --- a/data/data_810AC60.s +++ /dev/null @@ -1,94 +0,0 @@ - .section .rodata - - .global gUnknown_810AC60 -gUnknown_810AC60: @ 810AC60 - .byte 0x0C, 0x00 - - .global gUnknown_810AC62 -gUnknown_810AC62: @ 810AC62 - .byte 0x0C, 0x00 - - .global gUnknown_810AC64 -gUnknown_810AC64: @ 810AC64 - .byte 0x08, 0x00 - - .global gUnknown_810AC66 -gUnknown_810AC66: @ 810AC66 - .byte 0x08, 0x00 - - .global gUnknown_810AC68 -gUnknown_810AC68: @ 810AC68 - .byte 0x08, 0x00 - - .global gUnknown_810AC6A -gUnknown_810AC6A: @ 810AC6A - .byte 0x00 - .byte 0x0E - .byte 0x03 - .byte 0x04 - .byte 0x0C - .byte 0x09 - .byte 0x02 - .byte 0x0E - .byte 0x11 - .byte 0x0A - .byte 0x0D - .byte 0x10 - .byte 0x08 - .byte 0x07 - .byte 0x01 - .byte 0x11 - .byte 0x10 - .byte 0x05 - - .global gIsTypePhysicalTable -gIsTypePhysicalTable: @ 810AC7C - .byte 0x01 - .byte 0x01 - .byte 0x00 - .byte 0x00 - .byte 0x00 - .byte 0x00 - .byte 0x00 - .byte 0x01 - .byte 0x01 - .byte 0x01 - .byte 0x01 - .byte 0x00 - .byte 0x01 - .byte 0x01 - .byte 0x01 - .byte 0x00 - .byte 0x00 - .byte 0x01 - .byte 0x00 - .byte 0x00 - - .global gUnknown_810AC90 -gUnknown_810AC90: @ R=810AC90 | B=020C3498 - .byte 0x02, 0x00, 0x00, 0x00 - .byte 0x04, 0x00, 0x00, 0x00 - .byte 0x06, 0x00, 0x00, 0x00 - .byte 0x07, 0x00, 0x00, 0x00 - .byte 0x08, 0x00, 0x00, 0x00 - .byte 0x09, 0x00, 0x00, 0x00 - .byte 0x0A, 0x00, 0x00, 0x00 - .byte 0x0D, 0x00, 0x00, 0x00 - .byte 0x0F, 0x00, 0x00, 0x00 - .byte 0x11, 0x00, 0x00, 0x00 - - .global gFrenzyPlantIQReq -gFrenzyPlantIQReq: @ 810ACB8 - .2byte 333 - - .global gHydroCannonIQReq -gHydroCannonIQReq: @ 810ACBA - .2byte 333 - - .global gBlastBurnIQReq -gBlastBurnIQReq: @ 810ACBC - .2byte 333 - - .global gVoltTackleIQReq -gVoltTackleIQReq: @ 810ACBE - .2byte 333 diff --git a/data/pksdir_0.s b/data/pksdir_0.s new file mode 100644 index 000000000..43dacf9e3 --- /dev/null +++ b/data/pksdir_0.s @@ -0,0 +1,4 @@ +.section .rodata + +.align 2 +.string "pksdir0\0" diff --git a/data/pksdir_1.s b/data/pksdir_1.s new file mode 100644 index 000000000..43dacf9e3 --- /dev/null +++ b/data/pksdir_1.s @@ -0,0 +1,4 @@ +.section .rodata + +.align 2 +.string "pksdir0\0" diff --git a/data/pksdir_2.s b/data/pksdir_2.s new file mode 100644 index 000000000..43dacf9e3 --- /dev/null +++ b/data/pksdir_2.s @@ -0,0 +1,4 @@ +.section .rodata + +.align 2 +.string "pksdir0\0" diff --git a/data/pksdir_3.s b/data/pksdir_3.s new file mode 100644 index 000000000..9ccc2af69 --- /dev/null +++ b/data/pksdir_3.s @@ -0,0 +1,7 @@ +.section .rodata + +.align 2 + +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" \ No newline at end of file diff --git a/include/charge_move.h b/include/charge_move.h deleted file mode 100644 index 56c9bb8e0..000000000 --- a/include/charge_move.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GUARD_CHARGE_MOVE_H -#define GUARD_CHARGE_MOVE_H - -#include "structs/dungeon_entity.h" - -bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move); -// checkCharge = Check for the move named Charge. -bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge); - -#endif diff --git a/include/code_8042B34.h b/include/code_8042B34.h deleted file mode 100644 index 0ade61727..000000000 --- a/include/code_8042B34.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef GUARD_CODE_8042B34_H -#define GUARD_CODE_8042B34_H - -bool8 sub_8043CE4(s32 dungeonId); -void sub_8043D50(s32 *a0, s32 *a1); - -#endif // GUARD_CODE_8042B34_H diff --git a/include/code_80450F8.h b/include/code_80450F8.h deleted file mode 100644 index e3bfc4be2..000000000 --- a/include/code_80450F8.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GUARD_CODE_80227B8_H -#define GUARD_CODE_80227B8_H - -#include "structs/dungeon_entity.h" - -Entity *SpawnTrap(u8 trapID, DungeonPos *pos, u8 c); -Entity *sub_8045708(DungeonPos *pos); -void sub_80457DC(Entity* ent); - -#endif // GUARD_CODE_80227B8_H diff --git a/include/code_8045A00.h b/include/code_8045A00.h deleted file mode 100644 index 8e476339f..000000000 --- a/include/code_8045A00.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GUARD_CODE_8045A00_H -#define GUARD_CODE_8045A00_H - -#include "structs/dungeon_entity.h" - -void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3); - -void sub_8045ACC(void); - -#endif // GUARD_CODE_8045A00_H \ No newline at end of file diff --git a/include/code_8077274_1.h b/include/code_8077274_1.h index 92c1882ac..7c42f0ad8 100644 --- a/include/code_8077274_1.h +++ b/include/code_8077274_1.h @@ -18,7 +18,7 @@ void RaiseDefStatTarget(Entity * pokemon,Entity * target, s32 increment); void RaiseSpDefStatTarget(Entity * pokemon,Entity * target, s32 increment); void LongTossStatusTarget(Entity * pokemon,Entity * target); void PierceStatusTarget(Entity * pokemon,Entity * target); -void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *move, u8 *message); +void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *move, const u8 *message); void sub_8079764(Entity * pokemon); void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus); void SafeguardStatusTarget(Entity * pokemon, Entity * target); diff --git a/include/constants/item.h b/include/constants/item.h index a8c1edc0a..59f426756 100644 --- a/include/constants/item.h +++ b/include/constants/item.h @@ -16,6 +16,7 @@ #define CATEGORY_HELD_ITEMS 4 #define CATEGORY_TMS_HMS 5 #define CATEGORY_POKE 6 +#define CATEGORY_7 7 #define CATEGORY_OTHER 8 #define CATEGORY_ORBS 9 #define CATEGORY_LINK_BOX 10 diff --git a/include/constants/monster.h b/include/constants/monster.h index 34f4cc617..be843c196 100644 --- a/include/constants/monster.h +++ b/include/constants/monster.h @@ -433,4 +433,9 @@ #define IS_CASTFORM_FORM_MONSTER(id)((id == MONSTER_CASTFORM_SNOWY || id == MONSTER_CASTFORM_SUNNY || id == MONSTER_CASTFORM_RAINY)) #define IS_DEOXYS_FORM_MONSTER(id)((id == MONSTER_DEOXYS_ATTACK || id == MONSTER_DEOXYS_DEFENSE || id == MONSTER_DEOXYS_SPEED)) +// For dialogue strings +#define DIALOGUE_MONSTER_PLAYER MONSTER_MAX + 1 +#define DIALOGUE_MONSTER_PARTNER MONSTER_MAX + 2 +#define DIALOGUE_MONSTER_NONE MONSTER_MAX + 3 + #endif // GUARD_CONSTANTS_MONSTER_H diff --git a/include/dungeon.h b/include/dungeon.h index 6446bc398..e57af204a 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -3,31 +3,6 @@ #include "structs/str_dungeon.h" -// size: 0x10 -typedef struct DungeonDataEntry -{ - /* 0x0 */ bool8 stairDirectionUp; - // If enabled, enemies will evolve when a team member is KOed (and doesn't revive) if their evolution spawns on the floor. - // False for all dungeons, but the code still works if this flag is enabled. - /* 0x1 */ bool8 enemiesEvolveWhenKOed; - /* 0x2 */ bool8 recruitingEnabled; - /* 0x3 */ s8 rescuesAllowed; - /* 0x4 */ u8 maxItemsAllowed; - /* 0x5 */ u8 maxPartyMembers; - /* 0x6 */ bool8 levelResetTo1; - /* 0x7 */ bool8 keepMoney; - /* 0x8 */ bool8 leaderCanSwitch; - /* 0x9 */ bool8 hasCheckpoint; - /* 0xA */ bool8 enterWithoutGameSave; // If false, the dungeon will force a quicksave before entering. - /* 0xB */ u8 HMMask; // HM mask for dungeon entry requirements (Fly, Dive, Waterfall, Surf, Water). - /* 0xC */ s16 turnLimit; - // The chance that a wild Pokémon's moveRandomly flag will be set when spawning, - // causing them to move randomly inside a room instead of exploring rooms. - /* 0xE */ s16 randomMovementChance; -} DungeonDataEntry; - -extern const DungeonDataEntry gDungeons[]; - s32 GetDungeonFloorCount(u8 dungeon); const u8 *GetDungeonName1(u8 dungeon); bool8 IsStairDirectionUp(u8 dungeon); diff --git a/include/dungeon_ai_targeting.h b/include/dungeon_ai_targeting.h deleted file mode 100644 index e63b4b4e7..000000000 --- a/include/dungeon_ai_targeting.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef GUARD_DUNGEON_AI_TARGETING_H -#define GUARD_DUNGEON_AI_TARGETING_H - -#include "structs/dungeon_entity.h" - -bool8 CanAttackInDirection(Entity *pokemon, s32 direction); -bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemonInFront); -bool8 IsAtJunction(Entity *pokemon); -bool8 ShouldAvoidFirstHit(Entity *pokemon, bool8 forceAvoid); -bool8 ShouldMonsterRunAway(Entity *pokemon); -bool8 ShouldMonsterRunAwayAndShowEffect(Entity *pokemon, bool8 showRunAwayEffect); -void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect); -u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified); -u8 sub_807167C(Entity * pokemon, Entity * target); - -#endif diff --git a/include/dungeon_boss_dialogue.h b/include/dungeon_boss_dialogue.h new file mode 100644 index 000000000..802295e4e --- /dev/null +++ b/include/dungeon_boss_dialogue.h @@ -0,0 +1,325 @@ +#ifndef GUARD_DUNGEON_BOSS_DIALOGUE_H +#define GUARD_DUNGEON_BOSS_DIALOGUE_H + +#include "dungeon_message.h" + +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_2[]; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_5[]; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_6; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_7[]; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_8; +extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_9[]; +extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_1; +extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_2; +extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_3; +extern const struct DungeonDialogueStruct gUnknown_8100D3C; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_1[]; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_2; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_3; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_4[]; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_5; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_6; +extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_7; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_1[]; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_2[]; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_3; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_4; +extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_5; +extern const struct DungeonDialogueStruct gUnknown_8101440; +extern const struct DungeonDialogueStruct gUnknown_81014B0[]; +extern const struct DungeonDialogueStruct gUnknown_8101504[]; +extern const struct DungeonDialogueStruct gUnknown_81015A0; +extern const struct DungeonDialogueStruct gUnknown_81015D4; +extern const struct DungeonDialogueStruct gUnknown_81015E8; +extern const struct DungeonDialogueStruct gUnknown_8101624; +extern const struct DungeonDialogueStruct gUnknown_810165C[]; +extern const struct DungeonDialogueStruct gUnknown_8101750; +extern const struct DungeonDialogueStruct gUnknown_810178C; +extern const struct DungeonDialogueStruct gUnknown_81017B4; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_1[]; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_2; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_3; +extern const struct DungeonDialogueStruct gZapdosReFightDialogue_4; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_6; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_1; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_2[]; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_3[]; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_4[]; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_5; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_6[]; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_7; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_8[]; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_9; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_10; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_11; +extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_12; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_1; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_2[]; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_3; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_4[]; +extern const struct DungeonDialogueStruct gMoltresReFightDialogue_5; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gUnknown_810246C; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_1[]; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_2; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_3; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_4[]; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_5; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_6; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_7; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_8; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_9; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_10; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_11; +extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_12; +extern const struct DungeonDialogueStruct gArticunoReFightDialogue_1; +extern const struct DungeonDialogueStruct gArticunoReFightDialogue_2; +extern const struct DungeonDialogueStruct gArticunoReFightDialogue_3; +extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gUnknown_8102A9C; +extern const struct DungeonDialogueStruct gUnknown_8102B10; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_1; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_2[]; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_3; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_4[]; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_5; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_6[]; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_7; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_8[]; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_9; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_10; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_11; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_12[]; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_13; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_14; +extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_15; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_1[]; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_2; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_3; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_4; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_5; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_6; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_7; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_8; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_9; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_10[]; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_11[]; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_12; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_13; +extern const struct DungeonDialogueStruct GroudonPreFightDialogue_14[]; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_1[]; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_2[]; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_3; +extern const struct DungeonDialogueStruct gGroudonReFightDialogue_4[]; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gUnknown_8103488; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_3[]; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_5; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_6; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_8; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_9; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_10; +extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_11; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_1; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_2; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_3; +extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_4; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_5; +extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_6; +extern const struct DungeonDialogueStruct gUnknown_8103BD8; +extern const struct DungeonDialogueStruct gUnknown_8103C00; +extern const struct DungeonDialogueStruct gUnknown_8103C3C; +extern const struct DungeonDialogueStruct gUnknown_8103C74; +extern const struct DungeonDialogueStruct gUnknown_8103CC4; +extern const struct DungeonDialogueStruct gUnknown_8103D0C; +extern const struct DungeonDialogueStruct gUnknown_8103D50; +extern const struct DungeonDialogueStruct gUnknown_8103D8C; +extern const struct DungeonDialogueStruct gUnknown_8103D98; +extern const struct DungeonDialogueStruct gUnknown_8103DD8; +extern const struct DungeonDialogueStruct gUnknown_8103E28; +extern const struct DungeonDialogueStruct gUnknown_8103E34; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_1; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_2; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_3; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_4; +extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_5; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_1; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_2; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_3; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_4; +extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_5; +extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_1; +extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_2; +extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_3; +extern const struct DungeonDialogueStruct gEnteiReFightDialogue_1; +extern const struct DungeonDialogueStruct gEnteiReFightDialogue_2; +extern const struct DungeonDialogueStruct gEnteiReFightDialogue_3; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_3; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_4; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_5; +extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_6; +extern const struct DungeonDialogueStruct gRaikouReFightDialogue_1; +extern const struct DungeonDialogueStruct gRaikouReFightDialogue_2; +extern const struct DungeonDialogueStruct gRaikouReFightDialogue_3; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_1; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_2; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_3; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_4; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_5; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_6; +extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_7; +extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_1; +extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_2; +extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_3; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_1; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_2; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_3; +extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_4; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_1; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_2; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_3; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_4; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_5; +extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_6; +extern const struct DungeonDialogueStruct HoOhReFightDialogue_1; +extern const struct DungeonDialogueStruct HoOhReFightDialogue_2; +extern const struct DungeonDialogueStruct HoOhReFightDialogue_3; +extern const struct DungeonDialogueStruct HoOhReFightDialogue_4; +extern const struct DungeonDialogueStruct HoOhReFightDialogue_5; +extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_1; +extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_2; +extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_3; +extern const struct DungeonDialogueStruct gLatiosReFightDialogue_1; +extern const struct DungeonDialogueStruct gUnknown_8104FC8; +extern const struct DungeonDialogueStruct gRegirockPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRegicePreFightDialogue_1; +extern const struct DungeonDialogueStruct gRegisteelPreFightDialogue_1; +extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_1; +extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_2; +extern const struct DungeonDialogueStruct gRegicePostFightDialogue_1; +extern const struct DungeonDialogueStruct gRegicePostFightDialogue_2; +extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_1; +extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_2; +extern const u8 *const gUnknown_810531C; +extern const u8 *const gUnknown_8105360; +extern const u8 *const gUnknown_81053A8; +extern const u8 *const gUnknown_8105434; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_1; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_2; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_3; +extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_4; +extern const struct DungeonDialogueStruct gUnknown_810554C; +extern const struct DungeonDialogueStruct gUnknown_8105558; +extern const struct DungeonDialogueStruct gUnknown_81055F4; +extern const struct DungeonDialogueStruct gUnknown_8105668; +extern const struct DungeonDialogueStruct gUnknown_8105674; +extern const struct DungeonDialogueStruct gUnknown_81056B8; +extern const struct DungeonDialogueStruct gUnknown_81056DC; +extern const u8 *const gUnknown_8105798; +extern const MenuItem gUnknown_810579C[]; +extern const struct DungeonDialogueStruct gUnknown_810581C; +extern const struct DungeonDialogueStruct gUnknown_81058A8; +extern const struct DungeonDialogueStruct gUnknown_81058C4; +extern const struct DungeonDialogueStruct gUnknown_81058E0; +extern const struct DungeonDialogueStruct gUnknown_810593C; +extern const struct DungeonDialogueStruct gUnknown_8105974; +extern const struct DungeonDialogueStruct gUnknown_8105A08; +extern const struct DungeonDialogueStruct gUnknown_8105AD4; +extern const struct DungeonDialogueStruct gUnknown_8105B20; +extern const struct DungeonDialogueStruct gUnknown_8105B68; +extern const struct DungeonDialogueStruct gUnknown_8105BA8; +extern const struct DungeonDialogueStruct gUnknown_8105BF4; +extern const struct DungeonDialogueStruct gUnknown_8105D2C; +extern const struct DungeonDialogueStruct gUnknown_8105D80; +extern const struct DungeonDialogueStruct gUnknown_8105D9C; +extern const struct DungeonDialogueStruct gJirachiReFightDialogue_1; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_1; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_2; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_3; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_4; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_5; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_6; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_7; +extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_8; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_1; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_2; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_3; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_4; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_5; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_6; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_7; +extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_8; +extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_1; +extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_2; +extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_3; +extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_4; +extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_5; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_1; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_2; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_3; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_4; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_5; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_6; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_7; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_8; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_9; +extern const u8 *const gPtrPurityForestAllowCelebiToJoinText; +extern const MenuItem gPurityForestAllowCelebiToJoinPrompt[]; +extern const u8 *const gPtrPurityForestRefuseCelebiConfirmText; +extern const MenuItem gPurityForestRefuseCelebiConfirmPrompt[]; +extern const struct DungeonDialogueStruct gCelebiJoinDialogue_10; +extern const u8 *const gUnknown_810665C; +extern const u8 *const gUnknown_810668C; +extern const u8 *const gUnknown_81066D4; +extern const u8 *const gUnknown_81066F0; +extern const u8 *const gUnknown_810671C; +extern const struct DungeonDialogueStruct gUnknown_8106720; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_1; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_2; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_3; +extern const struct DungeonDialogueStruct gMedichamRescueDialogue_4; +extern const struct DungeonDialogueStruct gUnknown_810685C; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_1; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_2; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_3; +extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_4; +extern const struct DungeonDialogueStruct gUnknown_810697C; + +#endif // GUARD_DUNGEON_BOSS_DIALOGUE_H diff --git a/include/dungeon_capabilities.h b/include/dungeon_capabilities.h deleted file mode 100644 index a8376dda5..000000000 --- a/include/dungeon_capabilities.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef GUARD_DUNGEON_CAPABILITIES_H -#define GUARD_DUNGEON_CAPABILITIES_H - -#include "structs/dungeon_entity.h" - -bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker); -bool8 sub_8070BC0(Entity* entity); -bool8 CheckVariousConditions(Entity *pokemon); -bool8 CheckVariousStatuses(Entity *pokemon); -bool8 CannotAttack(Entity *pokemon, bool8 skipSleep); -bool8 CanMoveInDirection(Entity *pokemon, u32 direction); - -#endif diff --git a/include/dungeon_config.h b/include/dungeon_config.h index 461c49caf..99b14b15f 100644 --- a/include/dungeon_config.h +++ b/include/dungeon_config.h @@ -5,6 +5,7 @@ #include "constants/weather.h" #include "constants/type.h" #include "constants/dungeon_action.h" +#include "structs/str_dungeon.h" #include "structs/dungeon_entity.h" #include "structs/str_moves.h" @@ -288,4 +289,8 @@ struct CalledMove extern const struct CalledMove gMetronomeCalledMoves[METRONOME_AVAILABLE_CALLED_MOVES]; extern const struct CalledMove gNaturePowerCalledMoves[]; +extern const u16 gUnknown_80F5F70[UNK12A18_ARR_COUNT]; +extern const s32 gUnknown_80F5FAC[76]; +extern const s32 gUnknown_80F60DC[5]; + #endif diff --git a/include/dungeon_data.h b/include/dungeon_data.h new file mode 100644 index 000000000..a9b9c744b --- /dev/null +++ b/include/dungeon_data.h @@ -0,0 +1,61 @@ +#ifndef GUARD_DUNGEON_DATA_H +#define GUARD_DUNGEON_DATA_H + +#include "exclusive_pokemon.h" +#include "friend_area.h" +#include "constants/type.h" +#include "constants/friend_area.h" +#include "constants/iq_skill.h" +#include "constants/tactic.h" +#include "constants/dungeon.h" +#include "constants/item.h" + +// size: 0x10 +typedef struct DungeonDataEntry +{ + /* 0x0 */ bool8 stairDirectionUp; + // If enabled, enemies will evolve when a team member is KOed (and doesn't revive) if their evolution spawns on the floor. + // False for all dungeons, but the code still works if this flag is enabled. + /* 0x1 */ bool8 enemiesEvolveWhenKOed; + /* 0x2 */ bool8 recruitingEnabled; + /* 0x3 */ s8 rescuesAllowed; + /* 0x4 */ u8 maxItemsAllowed; + /* 0x5 */ u8 maxPartyMembers; + /* 0x6 */ bool8 levelResetTo1; + /* 0x7 */ bool8 keepMoney; + /* 0x8 */ bool8 leaderCanSwitch; + /* 0x9 */ bool8 hasCheckpoint; + /* 0xA */ bool8 enterWithoutGameSave; // If false, the dungeon will force a quicksave before entering. + /* 0xB */ u8 HMMask; // HM mask for dungeon entry requirements (Fly, Dive, Waterfall, Surf, Water). + /* 0xC */ s16 turnLimit; + // The chance that a wild Pokmon's moveRandomly flag will be set when spawning, + // causing them to move randomly inside a room instead of exploring rooms. + /* 0xE */ s16 randomMovementChance; +} DungeonDataEntry; + +extern const DungeonDataEntry gDungeons[]; +extern const u8 gInvalidDungeonIDs[11]; +extern const u8 gInvalidItemIDs[16]; +extern const bool8 gTacticsTargetLeader[NUM_TACTICS]; +extern const s16 gReqTacticLvls[NUM_TACTICS]; +extern const s32 gReqIQSkillPts[NUM_IQ_SKILLS]; +extern const s32 gUnknown_810A3F0[100]; +extern const s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS]; +extern const s16 gUnknown_810A808[NUM_TYPES][NUMBER_OF_GUMMIS]; +extern const FriendAreaSettings gFriendAreaSettings[NUM_FRIEND_AREAS]; +extern const s16 gUnknown_810AC60; +extern const s16 gUnknown_810AC62; +extern const s16 gUnknown_810AC64; +extern const s16 gUnknown_810AC66; +extern const s16 gUnknown_810AC68; +extern const u8 gBestResistTypeTable[NUM_TYPES]; +extern const bool8 gIsTypePhysicalTable[NUM_TYPES]; +extern const s32 gUnknown_810AC90[10]; +extern const s16 gFrenzyPlantIQReq; +extern const s16 gHydroCannonIQReq; +extern const s16 gBlastBurnIQReq; +extern const s16 gVoltTackleIQReq; +extern const u8 gDungeonWaterType[76]; +extern const struct ExclusivePokemon gExclusivePokemon[NUM_EXCLUSIVE_POKEMON]; + +#endif // GUARD_DUNGEON_DATA_H diff --git a/include/dungeon_engine.h b/include/dungeon_engine.h index e66f91245..b324adcbb 100644 --- a/include/dungeon_engine.h +++ b/include/dungeon_engine.h @@ -1,9 +1,10 @@ #ifndef GUARD_DUNGEON_ENGINE_H #define GUARD_DUNGEON_ENGINE_H -bool8 IsBossFight(void); -bool8 IsCurrentFixedRoomBossFight(void); -bool8 IsMakuhitaTrainingMaze(void); +#include "structs/dungeon_entity.h" + +extern const s16 gSpeedTurns[NUM_SPEED_COUNTERS][25]; + void RunFractionalTurn(bool8 param_1); #endif diff --git a/include/dungeon_generation.h b/include/dungeon_generation.h index 9e37dd96a..fc744f09d 100644 --- a/include/dungeon_generation.h +++ b/include/dungeon_generation.h @@ -51,13 +51,10 @@ enum SecondaryStructureType { SECONDARY_STRUCTURE_DIVIDER, // A "divider" of secondary terrain will split the room in half randomly either horizontally or vertically. }; +extern bool8 gUnknown_202F1A8; + void GenerateFloor(void); bool8 StairsAlwaysReachable(s32 stairsX, s32 stairsY, bool8 markUnreachable); void sub_804EB30(void); -void sub_8051E3C(void); - -#include "structs/dungeon_entity.h" - -void sub_8051E7C(Entity *pokemon); #endif diff --git a/include/dungeon_generation_fixed.h b/include/dungeon_generation_fixed.h new file mode 100644 index 000000000..fefa4cee7 --- /dev/null +++ b/include/dungeon_generation_fixed.h @@ -0,0 +1,11 @@ +#ifndef GUARD_DUNGEON_GENERATION_FIXED_H +#define GUARD_DUNGEON_GENERATION_FIXED_H + +#include "structs/dungeon_entity.h" +#include "structs/map.h" + +bool8 PlaceFixedRoomTile(Tile *tile, u8 fixedRoomActionId, s32 x, s32 y, bool8 spawnTrapOrItem); +void sub_8051E3C(void); +void sub_8051E7C(Entity *pokemon); + +#endif diff --git a/include/dungeon_logic.h b/include/dungeon_logic.h new file mode 100644 index 000000000..5d4ca3e0b --- /dev/null +++ b/include/dungeon_logic.h @@ -0,0 +1,59 @@ +#ifndef GUARD_DUNGEON_LOGIC_H +#define GUARD_DUNGEON_LOGIC_H + +#include "structs/map.h" +#include "structs/dungeon_entity.h" + +extern u8 gWalkableTileToCrossableTerrain[8]; + +u8 GetCrossableTerrain(s16 species); +u8 sub_807034C(s32 id, const Tile *tile); +u8 sub_80703A0(Entity *pokemon, DungeonPos *pos); +bool8 CanCrossWalls(Entity *pokemon); +bool8 sub_807049C(Entity *pokemon, DungeonPos *pos); +bool8 sub_8070564(Entity *pokemon, DungeonPos *pos); +bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos); +bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos); +s32 CalcSpeedStage(Entity *pokemon); +s32 sub_8070828(Entity *pokemon, bool8 displayMessage); +void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum); +void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum); +void sub_80709C8(u8 *buffer, EntityInfo *entityInfo); +bool8 HasNegativeStatus(Entity *pokemon); +bool8 IsSleeping(Entity *pokemon); +bool8 HasLowHealth(Entity *pokemon); +bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker); +bool8 sub_8070BC0(Entity* entity); +bool8 CheckVariousConditions(Entity *pokemon); +bool8 CheckVariousStatuses(Entity *pokemon); +bool8 CannotAttack(Entity *pokemon, bool8 skipSleep); +bool8 CanMoveInDirection(Entity *pokemon, u32 direction); +bool8 sub_8070F3C(Entity * pokemon, DungeonPos *pos, s32 direction); +bool8 sub_8070F14(Entity * pokemon, s32 direction); +bool8 sub_8070F80(Entity * pokemon, s32 direction); +bool8 CanAttackInDirection(Entity *pokemon, s32 direction); +bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemonInFront); +bool8 IsAtJunction(Entity *pokemon); +bool8 ShouldAvoidFirstHit(Entity *pokemon, bool8 forceAvoid); +bool8 ShouldMonsterRunAway(Entity *pokemon); +bool8 ShouldMonsterRunAwayAndShowEffect(Entity *pokemon, bool8 showRunAwayEffect); +void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect); +u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified); +u8 sub_807167C(Entity * pokemon, Entity * target); +bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage); +bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage); +bool8 sub_80717A4(Entity *pokemon, u16 moveID); +bool8 AbilityIsActive(Entity *pokemon, u8 ability); +bool8 MonsterIsType(Entity *pokemon, u8 type); +bool8 CanSeeInvisibleMonsters(Entity *pokemon); +bool8 IsTacticSet(Entity *pokemon, u8 tactic); +bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill); +void LoadIQSkills(Entity *pokemon); +bool8 CanSeeTeammate(Entity * pokemon); +u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove); +s32 GetMovePower(Entity *pokemon, Move *pokeMove); +bool8 MonsterCanThrowItems(EntityInfo *pokemon); +bool8 sub_8071A8C(Entity *pokemon); +bool8 SetVisualFlags(EntityInfo *entityInfo, u16 newFlag, bool8 param_3); + +#endif diff --git a/include/dungeon_map.h b/include/dungeon_map.h index ad9a5519b..464d5cccd 100644 --- a/include/dungeon_map.h +++ b/include/dungeon_map.h @@ -1,8 +1,11 @@ #ifndef GUARD_DUNGEON_MAP_H #define GUARD_DUNGEON_MAP_H +#include "structs/str_position.h" + extern bool8 gShowMonsterDotsInDungeonMap; extern bool8 gShowDungeonMap; +extern DungeonPos gPlayerDotMapPosition; void SetDungeonMapToNotShown(void); void OpenDungeonMapFile(void); diff --git a/include/dungeon_map_access.h b/include/dungeon_map_access.h index 36fc0440e..7a5cdf39f 100644 --- a/include/dungeon_map_access.h +++ b/include/dungeon_map_access.h @@ -24,4 +24,15 @@ void sub_804AA60(void); void sub_804AAAC(void); void sub_804AAD4(void); +#define DUNGEON_WATER_TYPE_NONE 0 +#define DUNGEON_WATER_TYPE_LAVA 1 +#define DUNGEON_WATER_TYPE_WATER 2 + +extern const u8 gDungeonWaterType[76]; + +bool8 sub_804AD34(DungeonPos *pos); +void sub_804AE84(DungeonPos *pos); +bool8 IsTileGround(Tile *tile); +bool8 IsWaterTileset(void); + #endif // GUARD_DUNGEON_MAP_ACCESS_H diff --git a/include/dungeon_message.h b/include/dungeon_message.h index ea4fe1788..c55ba19b6 100644 --- a/include/dungeon_message.h +++ b/include/dungeon_message.h @@ -4,23 +4,25 @@ #include "structs/dungeon_entity.h" #include "string_format.h" -// These flags are used in dungeon message and dungeon menu recruitment file. It's possible these are general scroll flags and should be put elsewhere, like text.h, assuming more files actually use it. -#define FLAG_CAN_SCROLL_UP 0x1 -#define FLAG_CAN_SCROLL_DOWN 0x2 - struct MonDialogueSpriteInfo { s16 species; u8 spriteId; }; +// Depending on partner's pokemon species, the dialogue may be slightly different. +#define DIALOGUE_ALLOW_ALL 0 +#define DIALOGUE_ALLOW_MOST 1 // Bulbasaur, Cyndaquil, Mudkip, Pikachu, Charmander, Treecko +#define DIALOGUE_ONLY_SQUIRTLE_TOTODILE 7 +#define DIALOGUE_ONLY_TORCHIC_CHICORITA 280 + struct DungeonDialogueStruct { - u16 unk0; - u8 unk2; - u8 unk3; - s16 unk4; - s16 unk6; + u16 type; + u8 spriteId; + u8 spritePlacementId; // Information on mon's portrait x/y and flip + s16 speciesId; + s16 allowType; const u8 *str; }; @@ -52,7 +54,5 @@ void TryDisplayItemPickupTutorialMessage(u8 itemId); void DisplayYouReachedDestFloorStr(void); void sub_8052FB8(const u8 *str); const u8 *GetCurrentDungeonName(void); -void ResetMessageLog(void); -bool32 DisplayMessageLog(void); #endif // GUARD_DUNGEON_MESSAGE_H diff --git a/include/dungeon_message_log.h b/include/dungeon_message_log.h new file mode 100644 index 000000000..3b41df18c --- /dev/null +++ b/include/dungeon_message_log.h @@ -0,0 +1,12 @@ +#ifndef GUARD_DUNGEON_MESSAGE_LOG_H +#define GUARD_DUNGEON_MESSAGE_LOG_H + +// These flags are used in dungeon message log and dungeon menu recruitment file. It's possible these are general scroll flags and should be put elsewhere, like text.h, assuming more files actually use it. +#define FLAG_CAN_SCROLL_UP 0x1 +#define FLAG_CAN_SCROLL_DOWN 0x2 + +void ResetMessageLog(void); +void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2); +bool32 DisplayMessageLog(void); + +#endif diff --git a/include/dungeon_move.h b/include/dungeon_move.h index 5613f2aa9..fc68e057e 100644 --- a/include/dungeon_move.h +++ b/include/dungeon_move.h @@ -1,12 +1,32 @@ #ifndef GUARD_DUNGEON_MOVE_H #define GUARD_DUNGEON_MOVE_H -#include "structs/str_pokemon.h" +#define MAX_MOVE_TARGETS 64 + +#include "number_util.h" #include "structs/str_moves.h" +#include "structs/dungeon_entity.h" extern s32 gUnknown_202F208; +extern s32 gUnknown_202F20C; +extern s32 gUnknown_202F210; +extern s32 gUnknown_202F214; +extern u8 gUnknown_202F218; +extern u8 gUnknown_202F219; +extern u8 gUnknown_202F21A; +extern s32 gUnknown_202F21C; +extern u8 gUnknown_202F220; +extern u8 gUnknown_202F221; +extern u8 gUnknown_202F222; extern s32 gUnknown_202F224; +extern s32 gMetronomeCalledArrayId; -bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move); +void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, s32 itemId, bool32 isLinkedMove); +bool32 HandleRegularDamagingMove(Entity *attacker, Entity *target, Move *move, s32 itemId); +s32 HandleDamagingMove(Entity *attacker, Entity *target, Move *move, s24_8 modifier, s32 itemId); +s32 sub_80556BC(Entity *attacker, Entity *target, u8 moveType, Move *move, s24_8 modifier, s32 itemId); +s32 sub_8055864(Entity *attacker, Entity *target, Move *move, s32 param_4, s32 itemId); +bool8 sub_8055988(Entity *r2, Entity *r4); +void sub_80559DC(Entity *entity1, Entity *entity2); #endif // GUARD_DUNGEON_MOVE_H diff --git a/include/dungeon_move_util.h b/include/dungeon_move_util.h new file mode 100644 index 000000000..b9df1fba4 --- /dev/null +++ b/include/dungeon_move_util.h @@ -0,0 +1,32 @@ +#ifndef GUARD_DUNGEON_MOVE_UTIL_H +#define GUARD_DUNGEON_MOVE_UTIL_H + +#include "structs/str_moves.h" +#include "structs/dungeon_entity.h" + +bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s32 arg_0); +void TriggerTargetAbilityEffect(Entity *attacker); +bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move); +bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray, bool32 itemId, bool8 arg_4, bool32 unused); +s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4); +void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 isLinkedMove); +bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accuracyType, bool8 selfAlwaysHits); +void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *move); +s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_, Entity *attacker, Entity *target, Move *move, bool32 canHitAnyone_); +s32 sub_8057070(Move *move); +bool8 MoveCausesPaused(Move *move); +bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move); +bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge); +u32 sub_8057144(Entity * pokemon); +bool8 sub_80571F0(Entity * pokemon, Move *move); +bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance); +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); +bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker); +bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker); +bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3); +void SortTargets(Entity **targetsArray, Entity *attacker); +bool8 MoveRequiresCharging(Entity* pokemon, u16 moveID); +void sub_8057588(Entity * pokemon, u8 param_2); +s16 sub_8057600(Move *move, s32 itemID); + +#endif diff --git a/include/dungeon_movement.h b/include/dungeon_movement.h deleted file mode 100644 index b98e5e2a8..000000000 --- a/include/dungeon_movement.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef GUARD_DUNGEON_MOVEMENT -#define GUARD_DUNGEON_MOVEMENT - -#include "structs/dungeon_entity.h" -#include "structs/map.h" - -extern u8 gWalkableTileToCrossableTerrain[8]; - -u8 GetCrossableTerrain(s16 species); -u8 sub_807034C(s32 id, const Tile *tile); -u8 sub_80703A0(Entity *pokemon, DungeonPos *pos); -bool8 CanCrossWalls(Entity *pokemon); -bool8 sub_807049C(Entity *pokemon, DungeonPos *pos); -bool8 sub_8070564(Entity *pokemon, DungeonPos *pos); -bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos); -bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos); -s32 CalcSpeedStage(Entity *pokemon); - -#endif diff --git a/include/dungeon_pokemon_attributes.h b/include/dungeon_pokemon_attributes.h deleted file mode 100644 index 018d2201c..000000000 --- a/include/dungeon_pokemon_attributes.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef GUARD_DUNGEON_POKEMON_ATTRIBUTES_H -#define GUARD_DUNGEON_POKEMON_ATTRIBUTES_H - -#include "structs/dungeon_entity.h" - -bool8 HasSafeguardStatus(Entity * param_1, Entity * param_2, bool8 displayMessage); -bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage); -bool8 sub_80717A4(Entity *pokemon, u16 moveID); -bool8 AbilityIsActive(Entity *pokemon, u8 ability); -bool8 MonsterIsType(Entity *pokemon, u8 type); -bool8 CanSeeInvisibleMonsters(Entity *pokemon); -bool8 IsTacticSet(Entity *pokemon, u8 tactic); -bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill); -void LoadIQSkills(Entity *pokemon); -bool8 CanSeeTeammate(Entity * pokemon); -u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove); -s32 GetMovePower(Entity *pokemon, Move *pokeMove); -bool8 MonsterCanThrowItems(EntityInfo *pokemon); -bool8 SetVisualFlags(EntityInfo *entityInfo, u16 newFlag, bool8 param_3); - -#endif diff --git a/include/dungeon_strings.h b/include/dungeon_strings.h new file mode 100644 index 000000000..1e0224caf --- /dev/null +++ b/include/dungeon_strings.h @@ -0,0 +1,857 @@ +#ifndef GUARD_DUNGEON_STRINGS_H +#define GUARD_DUNGEON_STRINGS_H + +#include "structs/str_item_text.h" +#include "constants/trap.h" +#include "constants/weather.h" + +struct Struct_80F7C50 +{ + const u8 *str; + s32 val; +}; + +struct TutorialFlagMsg +{ + s32 flagId; + const u8 *str; +}; + +extern const ItemText gActions[]; +extern const struct Struct_80F7C50 gUnknown_80F7C50[]; +extern const u8 *const gUnknown_80F7F70[]; +extern const u8 *const gUnknown_80F8104[]; +extern const u8 *const gTrapDescriptions[NUM_TRAPS]; +extern const u8 *const gUnknown_80F8968; +extern const u8 *const gUnknown_80F8974; +extern const u8 *const gUnknown_80F8988; +extern const u8 *const gUnknown_80F8994; +extern const u8 *const gUnknown_80F89B4; +extern const u8 *const gUnknown_80F89D4; +extern const u8 *const gUnknown_80F89D8; +extern const u8 *const gUnknown_80F89F4; +extern const u8 *const gUnknown_80F8A0C; +extern const u8 *const gUnknown_80F8A28; +extern const u8 *const gUnknown_80F8A4C; +extern const u8 *const gUnknown_80F8A6C; +extern const u8 *const gUnknown_80F8A84; +extern const u8 *const gUnknown_80F8AB0; +extern const u8 *const gUnknown_80F8ADC; +extern const u8 *const gUnknown_80F8B0C; +extern const u8 *const gUnknown_80F8B24; +extern const u8 *const gUnknown_80F8B40; +extern const u8 *const gUnknown_80F8B64; +extern const u8 *const gUnknown_80F8B68; +extern const u8 *const gUnknown_80F8B88; +extern const u8 *const gUnknown_80F8BB4; +extern const u8 *const gUnknown_80F8BE0; +extern const u8 *const gUnknown_80F8BE4; +extern const u8 *const gItemStickyCannotMove1; +extern const u8 *const gItemStickyCannotMove2; +extern const u8 *const gItemStickyCannotMove3; +extern const u8 *const gItemStickyCannotEquip; +extern const u8 *const gMonTookAndReturnedItem; +extern const u8 *const gUnknown_80F8CE4; +extern const u8 *const gUnknown_80F8CE8; +extern const u8 *const gUnknown_80F8D04; +extern const u8 *const gUnknown_80F8D20; +extern const u8 *const gUnknown_80F8D44; +extern const u8 *const gUnknown_80F8D60; +extern const u8 *const gUnknown_80F8D7C; +extern const u8 *const gUnknown_80F8DB4; +extern const u8 *const gUnknown_80F8DB8; +extern const u8 *const gUnknown_80F8DE0; +extern const u8 *const gUnknown_80F8E04; +extern const u8 *const gUnknown_80F8E28; +extern const u8 *const gUnknown_80F8E2C; +extern const u8 *const gNoExchangesHere; +extern const u8 *const gNothingCanBePutDownHere; +extern const u8 *const gSwappedGroundItem; +extern const u8 *const gMonThrewItem1; +extern const u8 *const gMonThrewItem2; +extern const u8 *const gCannotTalk; +extern const u8 *const gCannotFarewell; +extern const u8 *const gMonCringing; +extern const u8 *const gMonParalyzed; +extern const u8 *const gMonSteppedOnItem; +extern const u8 *const gMonTerrifiedCouldntPickUpItem; +extern const u8 *const gMonCouldntPickUpItem; +extern const u8 *const gPickedUpItem2; +extern const u8 *const gPickedUpItemToolbox; +extern const u8 *const gPickedUpItem; +extern const u8 *const gMonPickedUpItem2; +extern const u8 *const gMonPickedUpItemToolbox; +extern const u8 *const gMonPickedUpItem; +extern const u8 *const gSayFarewellQ; +extern const u8 *const gSendMonBackWithItemQ; +extern const u8 *const gSendMonBackQ; +extern const u8 *const gUnknown_80F9114; +extern const u8 *const gUnknown_80F913C; +extern const u8 *const gMonWentBack; +extern const u8 *const gMonDisappointedAndLeft; +extern const u8 *const gUnknown_80F9158; +extern const u8 *const gUnknown_80F9174; +extern const u8 *const gUnknown_80F9190; +extern const u8 *const gUnknown_80F91A8; +extern const u8 *const gUnknown_80F91C8; +extern const u8 *const gUnknown_80F91E0; +extern const u8 *const gUnknown_80F91EC; +extern const u8 *const gTrapNames[NUM_TRAPS]; +extern const u8 *const gUnknown_80F9364; +extern const u8 *const gUnknown_80F9380; +extern const u8 *const gUnknown_80F9384; +extern const u8 *const gUnknown_80F93A4; +extern const u8 *const gUnknown_80F93C8; +extern const u8 *const gItemFellOnGround; +extern const u8 *const gItemFellInWater; +extern const u8 *const gItemBuried; +extern const u8 *const gItemLost; +extern const u8 *const gAllItemsLost; +extern const u8 *const gSeveralItemsLost; +extern const u8 *const gItemFellOutOfSight; +extern const u8 *const gUnknown_80F94C4; +extern const u8 *const gUnknown_80F94D8; +extern const u8 *const gUnknown_80F94F0; +extern const u8 *const gUnknown_80F9510; +extern const u8 *const gUnknown_80F9530; +extern const u8 *const gPtrFrozenMessage; +extern const u8 *const gPtrWrappedAroundMessage; +extern const u8 *const gPtrWrappedByMessage; +extern const u8 *const gPtrPausedMessage; +extern const u8 *const gPtrInfatuatedMessage; +extern const u8 *const gPtrBideMessage; +extern const u8 *const gUnknown_80F95EC; +extern const u8 *const gUnknown_80F9600; +extern const u8 *const gUnknown_80F9614; +extern const u8 *const gUnknown_80F9630; +extern const u8 *const gUnknown_80F9654; +extern const u8 *const gUnknown_80F9670; +extern const u8 *const gUnknown_80F9688; +extern const u8 *const gUnknown_80F96A8; +extern const u8 *const gUnknown_80F96BC; +extern const u8 *const gUnknown_80F96EC; +extern const u8 *const gUnknown_80F970C; +extern const u8 *const gUnknown_80F9728; +extern const u8 *const gUnknown_80F9740; +extern const u8 *const gUnknown_80F9760; +extern const u8 *const gUnknown_80F9764[]; +extern const u8 *const gWeatherNames[WEATHER_COUNT]; +extern const u8 *const gUnknown_80F9ACC; +extern const u8 *const gUnknown_80F9AEC; +extern const u8 *const gUnknown_80F9B10; +extern const u8 *const gUnknown_80F9B34; +extern const u8 *const gUnknown_80F9B58; +extern const u8 *const gUnknown_80F9B74; +extern const u8 *const gUnknown_80F9B94; +extern const u8 *const gUnknown_80F9BB0; +extern const u8 *const gUnknown_80F9BD8; +extern const u8 *const gUnknown_80F9C08; +extern const u8 *const gUnknown_80F9C2C; +extern const u8 *const gUnknown_80F9C4C; +extern const u8 *const gUnknown_80F9C70; +extern const u8 *const gUnknown_80F9C8C; +extern const u8 *const gUnknown_80F9CBC; +extern const u8 *const gUnknown_80F9CC0[]; +extern const u8 *const gUnknown_80F9CEC[]; +extern const u8 *const gUnknown_80F9D28[]; +extern const u8 *const gUnknown_80F9D84[]; +extern const u8 *const gUnknown_80F9D8C[]; +extern const u8 *const gUnknown_80F9DAC[]; +extern const u8 *const gUnknown_80F9DF0[]; +extern const u8 *const gUnknown_80F9E44; +extern const u8 *const gUnknown_80F9E64; +extern const u8 *const gUnknown_80F9E80; +extern const u8 *const gUnknown_80F9E84; +extern const u8 *const gUnknown_80F9EC8; +extern const u8 *const gUnknown_80F9EEC; +extern const u8 *const gUnknown_80F9F04; +extern const u8 *const gUnknown_80F9F2C; +extern const u8 *const gUnknown_80F9FA4; +extern const u8 *const gUnknown_80F9FE8; +extern const u8 *const gUnknown_80F9FEC; +extern const u8 *const gUnknown_80FA004; +extern const u8 *const gUnknown_80FA030; +extern const u8 *const gUnknown_80FA058; +extern const u8 *const gUnknown_80FA090; +extern const u8 *const gUnknown_80FA0C8; +extern const u8 *const gUnknown_80FA0F0; +extern const u8 *const gUnknown_80FA120; +extern const u8 *const gUnknown_80FA124[]; +extern const u8 *const gUnknown_80FA260; +extern const u8 *const gUnknown_80FA2B0; +extern const u8 *const gUnknown_80FA2F0; +extern const u8 *const gUnknown_80FA32C; +extern const u8 *const gUnknown_80FA36C; +extern const u8 *const gUnknown_80FA370; +extern const u8 *const gUnknown_80FA394; +extern const u8 *const gUnknown_80FA3B8; +extern const u8 *const gUnknown_80FA408; +extern const u8 *const gUnknown_80FA448; +extern const u8 *const gUnknown_80FA464; +extern const u8 *const gUnknown_80FA4D4; +extern const u8 *const gUnknown_80FA4D8; +extern const u8 *const gUnknown_80FA500; +extern const u8 *const gUnknown_80FA52C; +extern const u8 *const gUnknown_80FA530; +extern const u8 *const gUnknown_80FA54C; +extern const u8 *const gUnknown_80FA580; +extern const u8 *const gUnknown_80FA5B4; +extern const u8 *const gUnknown_80FA5B8; +extern const u8 *const gUnknown_80FA5F4; +extern const u8 *const gUnknown_80FA61C; +extern const u8 *const gUnknown_80FA638; +extern const u8 *const gUnknown_80FA658; +extern const u8 *const gUnknown_80FA67C; +extern const u8 *const gUnknown_80FA69C; +extern const u8 *const gUnknown_80FA6BC; +extern const u8 *const gUnknown_80FA6D4; +extern const u8 *const gUnknown_80FA6E8; +extern const u8 *const gUnknown_80FA708; +extern const u8 *const gUnknown_80FA70C; +extern const u8 *const gUnknown_80FA710; +extern const u8 *const gUnknown_80FA734; +extern const u8 *const gUnknown_80FA758; +extern const u8 *const gUnknown_80FA778; +extern const u8 *const gUnknown_80FA79C; +extern const u8 *const gUnknown_80FA7BC; +extern const u8 *const gUnknown_80FA7DC; +extern const u8 *const gUnknown_80FA800; +extern const u8 *const gUnknown_80FA81C; +extern const u8 *const gUnknown_80FA820; +extern const u8 *const gUnknown_80FA824; +extern const u8 *const gUnknown_80FA844; +extern const u8 *const gUnknown_80FA868; +extern const u8 *const gUnknown_80FA888; +extern const u8 *const gUnknown_80FA8A8; +extern const u8 *const gUnknown_80FA8BC; +extern const u8 *const gUnknown_80FA8E0; +extern const u8 *const gUnknown_80FA90C; +extern const u8 *const gUnknown_80FA934; +extern const u8 *const gUnknown_80FA95C; +extern const u8 *const gUnknown_80FA97C; +extern const u8 *const gUnknown_80FA9A0; +extern const u8 *const gUnknown_80FA9C0; +extern const u8 *const gUnknown_80FA9DC; +extern const u8 *const gUnknown_80FA9F4; +extern const u8 *const gUnknown_80FAA0C; +extern const u8 *const gUnknown_80FAA2C; +extern const u8 *const gUnknown_80FAA48; +extern const u8 *const gUnknown_80FAA68; +extern const u8 *const gUnknown_80FAA8C; +extern const u8 *const gUnknown_80FAAAC; +extern const u8 *const gPtrMonStoppedEnduringMessage; +extern const u8 *const gPtrMonMirrorMoveFadedMessage; +extern const u8 *const gPtrMonConversion2FailedMessage; +extern const u8 *const gPtrMonGaveUpVitalThrowMessage; +extern const u8 *const gUnknown_80FAB40; +extern const u8 *const gUnknown_80FAB6C; +extern const u8 *const gUnknown_80FAB90; +extern const u8 *const gUnknown_80FABBC; +extern const u8 *const gUnknown_80FABC0; +extern const u8 *const gUnknown_80FABD8; +extern const u8 *const gPtrMonNoLongerPetrifiedMessage; +extern const u8 *const gPtrMonNoLongerCringingMessage; +extern const u8 *const gUnknown_80FAC38; +extern const u8 *const gUnknown_80FAC54; +extern const u8 *const gUnknown_80FAC74; +extern const u8 *const gUnknown_80FAC88; +extern const u8 *const gUnknown_80FACA4; +extern const u8 *const gUnknown_80FACC4; +extern const u8 *const gUnknown_80FACE4; +extern const u8 *const gUnknown_80FACFC; +extern const u8 *const gUnknown_80FAD10; +extern const u8 *const gUnknown_80FAD2C; +extern const u8 *const gUnknown_80FAD4C; +extern const u8 *const gUnknown_80FAD6C; +extern const u8 *const gUnknown_80FAD8C; +extern const u8 *const gUnknown_80FADB0; +extern const u8 *const gUnknown_80FADD8; +extern const u8 *const gUnknown_80FAE00; +extern const u8 *const gUnknown_80FAE1C; +extern const u8 *const gUnknown_80FAE3C; +extern const u8 *const gUnknown_80FAE58; +extern const u8 *const gUnknown_80FAE7C; +extern const u8 *const gUnknown_80FAEA0; +extern const u8 *const gUnknown_80FAEC8; +extern const u8 *const gUnknown_80FAEF0; +extern const u8 *const gUnknown_80FAF1C; +extern const u8 *const gUnknown_80FAF3C; +extern const u8 *const gUnknown_80FAF5C; +extern const u8 *const gUnknown_80FAF8C; +extern const u8 *const gUnknown_80FAFAC; +extern const u8 *const gUnknown_80FAFD0; +extern const u8 *const gUnknown_80FAFF0; +extern const u8 *const gUnknown_80FB004; +extern const u8 *const gUnknown_80FB01C; +extern const u8 *const gUnknown_80FB048; +extern const u8 *const gUnknown_80FB074; +extern const u8 *const gUnknown_80FB09C; +extern const u8 *const gUnknown_80FB0C4; +extern const u8 *const gUnknown_80FB0E0; +extern const u8 *const gUnknown_80FB10C; +extern const u8 *const gUnknown_80FB130; +extern const u8 *const gUnknown_80FB160; +extern const u8 *const gUnknown_80FB17C; +extern const u8 *const gUnknown_80FB1A8; +extern const u8 *const gUnknown_80FB1C4; +extern const u8 *const gUnknown_80FB1E0; +extern const u8 *const gUnknown_80FB204; +extern const u8 *const gUnknown_80FB21C; +extern const u8 *const gUnknown_80FB240; +extern const u8 *const gUnknown_80FB25C; +extern const u8 *const gUnknown_80FB27C; +extern const u8 *const gUnknown_80FB2AC; +extern const u8 *const gUnknown_80FB2CC; +extern const u8 *const gUnknown_80FB2E0; +extern const u8 *const gUnknown_80FB300; +extern const u8 *const gUnknown_80FB318; +extern const u8 *const gUnknown_80FB31C; +extern const u8 *const gUnknown_80FB338; +extern const u8 *const gUnknown_80FB35C; +extern const u8 *const gUnknown_80FB360; +extern const u8 *const gUnknown_80FB380; +extern const u8 *const gUnknown_80FB384; +extern const u8 *const gUnknown_80FB388; +extern const u8 *const gUnknown_80FB3A4; +extern const u8 *const gUnknown_80FB3CC; +extern const u8 *const gUnknown_80FB3D0; +extern const u8 *const gUnknown_80FB3E0; +extern const u8 *const gUnknown_80FB3F8; +extern const u8 *const gUnknown_80FB414; +extern const u8 *const gUnknown_80FB418; +extern const u8 *const gUnknown_80FB41C; +extern const u8 *const gUnknown_80FB43C; +extern const u8 *const gUnknown_80FB458; +extern const u8 *const gUnknown_80FB480; +extern const u8 *const gUnknown_80FB4B0; +extern const u8 *const gUnknown_80FB4D4; +extern const u8 *const gUnknown_80FB4F0; +extern const u8 *const gUnknown_80FB50C; +extern const u8 *const gUnknown_80FB52C; +extern const u8 *const gUnknown_80FB548; +extern const u8 *const gUnknown_80FB564; +extern const u8 *const gUnknown_80FB580; +extern const u8 *const gUnknown_80FB598; +extern const u8 *const gUnknown_80FB5B4; +extern const u8 *const gUnknown_80FB5D4; +extern const u8 *const gUnknown_80FB5F8; +extern const u8 *const gUnknown_80FB610; +extern const u8 *const gUnknown_80FB628; +extern const u8 *const gUnknown_80FB64C; +extern const u8 *const gUnknown_80FB668; +extern const u8 *const gUnknown_80FB688; +extern const u8 *const gUnknown_80FB6A4; +extern const u8 *const gUnknown_80FB6C0; +extern const u8 *const gUnknown_80FB6D8; +extern const u8 *const gUnknown_80FB6FC; +extern const u8 *const gUnknown_80FB718; +extern const u8 *const gUnknown_80FB73C; +extern const u8 *const gUnknown_80FB764; +extern const u8 *const gUnknown_80FB780; +extern const u8 *const gUnknown_80FB7A0; +extern const u8 *const gUnknown_80FB7BC; +extern const u8 *const gUnknown_80FB7DC; +extern const u8 *const gUnknown_80FB7F4; +extern const u8 *const gUnknown_80FB810; +extern const u8 *const gUnknown_80FB834; +extern const u8 *const gUnknown_80FB85C; +extern const u8 *const gUnknown_80FB880; +extern const u8 *const gUnknown_80FB89C; +extern const u8 *const gUnknown_80FB8BC; +extern const u8 *const gUnknown_80FB8E4; +extern const u8 *const gUnknown_80FB900; +extern const u8 *const gUnknown_80FB924; +extern const u8 *const gUnknown_80FB940; +extern const u8 *const gUnknown_80FB960; +extern const u8 *const gUnknown_80FB978; +extern const u8 *const gUnknown_80FB994; +extern const u8 *const gUnknown_80FB9B0; +extern const u8 *const gUnknown_80FB9D8; +extern const u8 *const gUnknown_80FB9F0; +extern const u8 *const gUnknown_80FBA14; +extern const u8 *const gUnknown_80FBA38; +extern const u8 *const gUnknown_80FBA60; +extern const u8 *const gUnknown_80FBA80; +extern const u8 *const gUnknown_80FBAA0; +extern const u8 *const gUnknown_80FBAC0; +extern const u8 *const gUnknown_80FBAE4; +extern const u8 *const gUnknown_80FBB04; +extern const u8 *const gUnknown_80FBB28; +extern const u8 *const gUnknown_80FBB4C; +extern const u8 *const gUnknown_80FBB78; +extern const u8 *const gUnknown_80FBB94; +extern const u8 *const gUnknown_80FBBB8; +extern const u8 *const gUnknown_80FBBD4; +extern const u8 *const gUnknown_80FBBF0; +extern const u8 *const gUnknown_80FBC14; +extern const u8 *const gUnknown_80FBC38; +extern const u8 *const gUnknown_80FBC5C; +extern const u8 *const gUnknown_80FBC7C; +extern const u8 *const gUnknown_80FBCA4; +extern const u8 *const gUnknown_80FBCC8; +extern const u8 *const gUnknown_80FBCF0; +extern const u8 *const gUnknown_80FBD18; +extern const u8 *const gUnknown_80FBD3C; +extern const u8 *const gUnknown_80FBD58; +extern const u8 *const gUnknown_80FBD78; +extern const u8 *const gUnknown_80FBD9C; +extern const u8 *const gUnknown_80FBDC4; +extern const u8 *const gUnknown_80FBDF0; +extern const u8 *const gUnknown_80FBE14; +extern const u8 *const gUnknown_80FBE3C; +extern const u8 *const gUnknown_80FBE40; +extern const u8 *const gUnknown_80FBE64; +extern const u8 *const gUnknown_80FBE84; +extern const u8 *const gUnknown_80FBEA0; +extern const u8 *const gUnknown_80FBEC0; +extern const u8 *const gUnknown_80FBEE4; +extern const u8 *const gUnknown_80FBF04; +extern const u8 *const gUnknown_80FBF28; +extern const u8 *const gUnknown_80FBF50; +extern const u8 *const gUnknown_80FBF68; +extern const u8 *const gUnknown_80FBF84; +extern const u8 *const gUnknown_80FBF9C; +extern const u8 *const gUnknown_80FBFB8; +extern const u8 *const gUnknown_80FBFD8; +extern const u8 *const gUnknown_80FC000; +extern const u8 *const gUnknown_80FC028; +extern const u8 *const gUnknown_80FC054; +extern const u8 *const gUnknown_80FC074; +extern const u8 *const gUnknown_80FC084; +extern const u8 *const gUnknown_80FC090; +extern const u8 *const gUnknown_80FC09C; +extern const u8 *const gUnknown_80FC0AC; +extern const u8 *const gUnknown_80FC0B8; +extern const u8 *const gUnknown_80FC0C8; +extern const u8 *const gUnknown_80FC0D4; +extern const u8 *const gUnknown_80FC0E4; +extern const u8 *const gUnknown_80FC0FC; +extern const u8 *const gUnknown_80FC114; +extern const u8 *const gUnknown_80FC118; +extern const u8 *const gUnknown_80FC11C; +extern const u8 *const gUnknown_80FC138; +extern const u8 *const gUnknown_80FC13C; +extern const u8 *const gUnknown_80FC158; +extern const u8 *const gUnknown_80FC15C; +extern const u8 *const gUnknown_80FC180; +extern const u8 *const gUnknown_80FC184; +extern const u8 *const gUnknown_80FC1A4; +extern const u8 *const gUnknown_80FC1C4; +extern const u8 *const gUnknown_80FC1F0; +extern const u8 *const gUnknown_80FC218; +extern const u8 *const gUnknown_80FC21C; +extern const u8 *const gUnknown_80FC248; +extern const u8 *const gUnknown_80FC270; +extern const u8 *const gUnknown_80FC274; +extern const u8 *const gUnknown_80FC298; +extern const u8 *const gUnknown_80FC2B8; +extern const u8 *const gUnknown_80FC2D8; +extern const u8 *const gUnknown_80FC2FC; +extern const u8 *const gUnknown_80FC31C; +extern const u8 *const gUnknown_80FC33C; +extern const u8 *const gUnknown_80FC360; +extern const u8 *const gUnknown_80FC388; +extern const u8 *const gUnknown_80FC3B4; +extern const u8 *const gUnknown_80FC3D8; +extern const u8 *const gUnknown_80FC3FC; +extern const u8 *const gUnknown_80FC428; +extern const u8 *const gUnknown_80FC454; +extern const u8 *const gUnknown_80FC458; +extern const u8 *const gUnknown_80FC47C; +extern const u8 *const gUnknown_80FC4A4; +extern const u8 *const gUnknown_80FC4D0; +extern const u8 *const gUnknown_80FC52C; +extern const u8 *const gUnknown_80FC558; +extern const u8 *const gUnknown_80FC574; +extern const u8 *const gUnknown_80FC584; +extern const u8 *const gUnknown_80FC5A8; +extern const u8 *const gUnknown_80FC5CC; +extern const u8 *const gUnknown_80FC5E0; +extern const u8 *const gUnknown_80FC5F8; +extern const u8 *const gUnknown_80FC5FC; +extern const u8 *const gUnknown_80FC614; +extern const u8 *const gUnknown_80FC654; +extern const u8 *const gUnknown_80FC678; +extern const u8 *const gUnknown_80FC690; +extern const u8 *const gUnknown_80FC6A4; +extern const u8 *const gUnknown_80FC6A8; +extern const u8 *const gUnknown_80FC6D0; +extern const u8 *const gUnknown_80FC6FC; +extern const u8 *const gUnknown_80FC710; +extern const u8 *const gUnknown_80FC714; +extern const u8 *const gUnknown_80FC718; +extern const u8 *const gUnknown_80FC72C; +extern const u8 *const gUnknown_80FC730; +extern const u8 *const gUnknown_80FC734; +extern const u8 *const gUnknown_80FC74C; +extern const u8 *const gUnknown_80FC770; +extern const u8 *const gUnknown_80FC790; +extern const u8 *const gUnknown_80FC7AC; +extern const u8 *const gUnknown_80FC7C8; +extern const u8 *const gUnknown_80FC7EC; +extern const u8 *const gUnknown_80FC81C; +extern const u8 *const gUnknown_80FC854; +extern const u8 *const gUnknown_80FC888; +extern const u8 *const gUnknown_80FC8C0; +extern const u8 *const gUnknown_80FC8F0; +extern const u8 *const gUnknown_80FC920; +extern const u8 *const gUnknown_80FC924; +extern const u8 *const gUnknown_80FC97C; +extern const u8 *const gUnknown_80FC9A0; +extern const u8 *const gUnknown_80FC9C0; +extern const u8 *const gUnknown_80FC9E8; +extern const u8 *const gUnknown_80FCA10; +extern const u8 *const gUnknown_80FCA3C; +extern const u8 *const gUnknown_80FCA60; +extern const u8 *const gUnknown_80FCA64; +extern const u8 *const gUnknown_80FCA90; +extern const u8 *const gUnknown_80FCAC0; +extern const u8 *const gUnknown_80FCAE8; +extern const u8 *const gUnknown_80FCB14; +extern const u8 *const gUnknown_80FCB40; +extern const u8 *const gUnknown_80FCB70; +extern const u8 *const gUnknown_80FCB98; +extern const u8 *const gUnknown_80FCBCC; +extern const u8 *const gUnknown_80FCBF8; +extern const u8 *const gUnknown_80FCC18; +extern const u8 *const gUnknown_80FCC4C; +extern const u8 *const gUnknown_80FCC7C; +extern const u8 *const gUnknown_80FCCAC; +extern const u8 *const gUnknown_80FCCB0; +extern const u8 *const gUnknown_80FCCE4; +extern const u8 *const gUnknown_80FCCE8; +extern const u8 *const gUnknown_80FCD0C; +extern const u8 *const gUnknown_80FCD28; +extern const u8 *const gUnknown_80FCD54; +extern const u8 *const gUnknown_80FCD58; +extern const u8 *const gUnknown_80FCD88; +extern const u8 *const gUnknown_80FCDB4; +extern const u8 *const gUnknown_80FCDE0; +extern const u8 *const gUnknown_80FCE00; +extern const u8 *const gUnknown_80FCE34; +extern const u8 *const gUnknown_80FCE5C; +extern const u8 *const gUnknown_80FCE84; +extern const u8 *const gUnknown_80FCEB0; +extern const u8 *const gUnknown_80FCEDC; +extern const u8 *const gUnknown_80FCEFC; +extern const u8 *const gUnknown_80FCF18; +extern const u8 *const gUnknown_80FCF38; +extern const u8 *const gUnknown_80FCF50; +extern const u8 *const gUnknown_80FCF74; +extern const u8 *const gUnknown_80FCF78; +extern const u8 *const gUnknown_80FCF7C; +extern const u8 *const gUnknown_80FCF80; +extern const u8 *const gUnknown_80FCFA4; +extern const u8 *const gUnknown_80FCFBC; +extern const u8 *const gUnknown_80FCFE4; +extern const u8 *const gUnknown_80FD018; +extern const u8 *const gUnknown_80FD040; +extern const u8 *const gUnknown_80FD05C; +extern const u8 *const gUnknown_80FD060; +extern const u8 *const gUnknown_80FD08C; +extern const u8 *const gUnknown_80FD0B4; +extern const u8 *const gUnknown_80FD0B8; +extern const u8 *const gUnknown_80FD0BC; +extern const u8 *const gUnknown_80FD0DC; +extern const u8 *const gUnknown_80FD0E0; +extern const u8 *const gUnknown_80FD0E4; +extern const u8 *const gUnknown_80FD104; +extern const u8 *const gUnknown_80FD128; +extern const u8 *const gUnknown_80FD14C; +extern const u8 *const gUnknown_80FD170; +extern const u8 *const gUnknown_80FD18C; +extern const u8 *const gUnknown_80FD1B0; +extern const u8 *const gUnknown_80FD1CC; +extern const u8 *const gUnknown_80FD1EC; +extern const u8 *const gUnknown_80FD20C; +extern const u8 *const gUnknown_80FD22C; +extern const u8 *const gUnknown_80FD254; +extern const u8 *const gUnknown_80FD27C; +extern const u8 *const gUnknown_80FD294; +extern const u8 *const gUnknown_80FD2B4; +extern const u8 *const gUnknown_80FD2CC; +extern const u8 *const gUnknown_80FD2DC; +extern const u8 *const gUnknown_80FD2F8; +extern const u8 *const gUnknown_80FD320; +extern const u8 *const gUnknown_80FD350; +extern const u8 *const gUnknown_80FD370; +extern const u8 *const gUnknown_80FD3A0; +extern const u8 *const gUnknown_80FD3C8; +extern const u8 *const gUnknown_80FD3CC; +extern const u8 *const gUnknown_80FD3D0; +extern const u8 *const gUnknown_80FD3F0; +extern const u8 *const gUnknown_80FD40C; +extern const u8 *const gUnknown_80FD430; +extern const u8 *const gUnknown_80FD434; +extern const u8 *const gUnknown_80FD450; +extern const u8 *const gUnknown_80FD454; +extern const u8 *const gUnknown_80FD46C; +extern const u8 *const gUnknown_80FD484; +extern const u8 *const gUnknown_80FD4B0; +extern const u8 *const gUnknown_80FD4C4; +extern const u8 *const gUnknown_80FD4DC; +extern const u8 *const gUnknown_80FD500; +extern const u8 *const gUnknown_80FD524; +extern const u8 *const gUnknown_80FD548; +extern const u8 *const gUnknown_80FD54C; +extern const u8 *const gUnknown_80FD550; +extern const u8 *const gUnknown_80FD574; +extern const u8 *const gUnknown_80FD578; +extern const u8 *const gUnknown_80FD57C; +extern const u8 *const gUnknown_80FD594; +extern const u8 *const gUnknown_80FD5B8; +extern const u8 *const gUnknown_80FD5DC; +extern const u8 *const gUnknown_80FD608; +extern const u8 *const gUnknown_80FD628; +extern const u8 *const gUnknown_80FD644; +extern const u8 *const gUnknown_80FD648[]; +extern const u8 *const gUnknown_80FD6E8[]; +extern const u8 *const gUnknown_80FD788; +extern const u8 *const gUnknown_80FD7AC; +extern const u8 *const gUnknown_80FD7D4; +extern const u8 *const gUnknown_80FD7F4; +extern const u8 *const gSteppedOnTrapStrings[NUM_TRAPS]; +extern const u8 *const gUnknown_80FDA80; +extern const u8 *const gUnknown_80FDAA0; +extern const u8 *const gUnknown_80FDACC; +extern const u8 *const gUnknown_80FDAE4; +extern const u8 *const gUnknown_80FDB04; +extern const u8 *const gUnknown_80FDB2C; +extern const u8 *const gUnknown_80FDB5C; +extern const u8 *const gUnknown_80FDB7C; +extern const u8 *const gUnknown_80FDBA0; +extern const u8 *const gUnknown_80FDBB8; +extern const u8 *const gUnknown_80FDBD0; +extern const u8 *const gUnknown_80FDBF0; +extern const u8 *const gUnknown_80FDC18; +extern const u8 *const gUnknown_80FDC40; +extern const u8 *const gUnknown_80FDC7C; +extern const u8 *const gUnknown_80FDC9C; +extern const u8 *const gUnknown_80FDCA0; +extern const u8 *const gUnknown_80FDCA4; +extern const u8 *const gUnknown_80FDCC8; +extern const u8 *const gUnknown_80FDCE4; +extern const u8 *const gUnknown_80FDD00; +extern const u8 *const gUnknown_80FDD20; +extern const u8 *const gUnknown_80FDD48; +extern const u8 *const gUnknown_80FDD88; +extern const u8 *const gUnknown_80FDDA8; +extern const u8 *const gUnknown_80FDDAC; +extern const u8 *const gUnknown_80FDDD0; +extern const u8 *const gUnknown_80FDDF0; +extern const u8 *const gUnknown_80FDE18; +extern const u8 *const gUnknown_80FDE6C; +extern const u8 *const gUnknown_80FDEB8; +extern const u8 *const gUnknown_80FDF00; +extern const u8 *const gUnknown_80FDF40; +extern const u8 *const gUnknown_80FDF70; +extern const u8 *const gUnknown_80FDFB8; +extern const u8 *const gUnknown_80FDFE8; +extern const u8 *const gUnknown_80FE008; +extern const u8 *const gUnknown_80FE034; +extern const u8 *const gUnknown_80FE060; +extern const u8 *const gUnknown_80FE0AC; +extern const u8 *const gUnknown_80FE0F4; +extern const u8 *const gUnknown_80FE0F8; +extern const u8 *const gUnknown_80FE134; +extern const u8 *const gUnknown_80FE168; +extern const u8 *const gUnknown_80FE1A4; +extern const u8 *const gUnknown_80FE20C; +extern const u8 *const gUnknown_80FE268; +extern const u8 *const gUnknown_80FE28C; +extern const u8 *const gUnknown_80FE2D0; +extern const u8 *const gUnknown_80FE2EC; +extern const u8 *const gPtrItsaMonsterHouseMessage; +extern const u8 *const gUnknown_80FE330; +extern const u8 *const gUnknown_80FE36C; +extern const u8 *const gUnknown_80FE38C; +extern const u8 *const gUnknown_80FE3BC; +extern const u8 *const gItemStickyDoesntWorkText; +extern const u8 *const gUnknown_80FE3EC; +extern const u8 *const gUnknown_80FE40C; +extern const u8 *const gUnknown_80FE434; +extern const u8 *const gUnknown_80FE454; +extern const u8 *const gUnknown_80FE458; +extern const u8 *const gUnknown_80FE478; +extern const u8 *const gUnknown_80FE4B8; +extern const u8 *const gUnknown_80FE4D4; +extern const u8 *const gUnknown_80FE4F4; +extern const u8 *const gUnknown_80FE520; +extern const u8 *const gUnknown_80FE568; +extern const u8 *const gUnknown_80FE5C0; +extern const u8 *const gUnknown_80FE5F0; +extern const u8 *const gUnknown_80FE63C; +extern const u8 *const gUnknown_80FE65C; +extern const u8 *const gUnknown_80FE674; +extern const u8 *const gUnknown_80FE690; +extern const u8 *const gUnknown_80FE6B4; +extern const u8 *const gUnknown_80FE6D4; +extern const u8 *const gUnknown_80FE6E8; +extern const u8 *const gUnknown_80FE6F4; +extern const u8 *const gUnknown_80FE708; +extern const u8 *const gUnknown_80FE70C; +extern const u8 *const gUnknown_80FE720; +extern const u8 *const gUnknown_80FE724; +extern const u8 *const gOptionsDungeonTextPtr; +extern const u8 *const gOptionsOthersTextPtr; +extern const u8 *const gUnknown_80FE748; +extern const u8 *const gUnknown_80FE764; +extern const u8 *const gUnknown_80FE788; +extern const u8 *const gUnknown_80FE7A8; +extern const u8 *const gUnknown_80FE7C0; +extern const u8 *const gUnknown_80FE7E4; +extern const u8 *const gOptionsWindowColorPtr; +extern const u8 *const gDsTopScreenOptions[]; +extern const u8 *const gDsBottomScreenOptions[]; +extern const u8 *const gGameOptionsTextPtr; +extern const u8 *const gUnknown_80FE8F4; +extern const u8 *const gUnknown_80FE8F8; +extern const u8 *const gTeamToolboxAPtr; +extern const u8 *const gTeamToolboxBPtr; +extern const u8 *const gFieldItemMenuGroundTextPtr; +extern const u8 *const gUnknown_80FE940; +extern const u8 *const gWhichTextPtr1; +extern const u8 *const gWhichTextPtr2; +extern const u8 *const gUnknown_80FE954; +extern const u8 *const gUnknown_80FE95C; +extern const u8 *const gUnknown_80FE960; +extern const u8 *const gUnknown_80FE964; +extern const u8 *const gUnknown_80FE978; +extern const u8 *const gFieldMenuMovesPtr; +extern const u8 *const gFieldMenuItemsPtr; +extern const u8 *const gFieldMenuTeamPtr; +extern const u8 *const gFieldMenuOthersPtr; +extern const u8 *const gFieldMenuGroundPtr; +extern const u8 *const gUnknown_80FE9CC; +extern const u8 *const gUnknown_80FE9E8; +extern const u8 *const gUnknown_80FE9F8; +extern const u8 *const gUnknown_80FEA10; +extern const u8 *const gUnknown_80FEA28; +extern const u8 *const gUnknown_80FEA44; +extern const u8 *const gUnknown_80FEA50; +extern const u8 *const gUnknown_80FEA68; +extern const u8 *const gUnknown_80FEA80; +extern const u8 *const gUnknown_80FEA8C; +extern const u8 *const gUnknown_80FEAC4; +extern const u8 *const gUnknown_80FEAE8; +extern const u8 *const gUnknown_80FEB08; +extern const u8 *const gUnknown_80FEB30; +extern const u8 *const gUnknown_80FEB60; +extern const u8 *const gUnknown_80FEB88; +extern const u8 *const gUnknown_80FEB8C; +extern const u8 *const gUnknown_80FEB90; +extern const u8 *const gUnknown_80FEBBC; +extern const u8 *const gUnknown_80FEBDC; +extern const u8 *const gUnknown_80FEBF8; +extern const u8 *const gUnknown_80FEC28; +extern const u8 *const gUnknown_80FEC48; +extern const u8 *const gUnknown_80FEC7C; +extern const u8 *const gUnknown_80FECA0; +extern const u8 *const gUnknown_80FECBC; +extern const u8 *const gUnknown_80FECE0; +extern const u8 *const gUnknown_80FED00; +extern const u8 *const gUnknown_80FED04; +extern const u8 *const gUnknown_80FED08; +extern const u8 *const gUnknown_80FED0C; +extern const u8 *const gUnknown_80FED30; +extern const u8 *const gUnknown_80FED34; +extern const u8 *const gUnknown_80FED68; +extern const u8 *const gUnknown_80FED88; +extern const u8 *const gUnknown_80FEDA8; +extern const u8 *const gUnknown_80FEDC8; +extern const u8 *const gUnknown_80FEDE8; +extern const u8 *const gUnknown_80FEE04; +extern const u8 *const gUnknown_80FEE2C; +extern const u8 *const gUnknown_80FEE54; +extern const u8 *const gUnknown_80FEE80; +extern const u8 *const gUnknown_80FEEA4; +extern const u8 *const gUnknown_80FEEC8; +extern const u8 *const gUnknown_80FEEEC; +extern const u8 *const gUnknown_80FEF0C; +extern const u8 *const gUnknown_80FEF30; +extern const u8 *const gUnknown_80FEF4C; +extern const u8 *const gUnknown_80FEF50; +extern const u8 *const gUnknown_80FEF54; +extern const u8 *const gUnknown_80FEF74; +extern const u8 *const gUnknown_80FEF98; +extern const u8 *const gUnknown_80FEFD0; +extern const u8 *const gUnknown_80FEFF4; +extern const u8 *const gUnknown_80FF01C; +extern const struct TutorialFlagMsg gUnknown_80FF020; +extern const struct TutorialFlagMsg gUnknown_80FF080; +extern const struct TutorialFlagMsg gUnknown_80FF0D8; +extern const struct TutorialFlagMsg gUnknown_80FF13C; +extern const struct TutorialFlagMsg gUnknown_80FF1B4; +extern const struct TutorialFlagMsg gMovementTutorial; +extern const struct TutorialFlagMsg gHungerTutorial; +extern const struct TutorialFlagMsg gFoodTutorial; +extern const struct TutorialFlagMsg gOranTutorial; +extern const struct TutorialFlagMsg gCheriTutorial; +extern const struct TutorialFlagMsg gBlastSeedTutorial; +extern const struct TutorialFlagMsg gUnknown_80FF4A0; +extern const struct TutorialFlagMsg gPechaTutorial; +extern const struct TutorialFlagMsg gSleepSeedTutorial; +extern const struct TutorialFlagMsg gMoneyTutorial; +extern const u8 *const gUnknown_80FF674; +extern const u8 *const gUnknown_80FF678; +extern const u8 *const gUnknown_80FF6A4; +extern const u8 *const gUnknown_80FF6F8; +extern const u8 *const gUnknown_80FF730; +extern const u8 *const gUnknown_80FF76C; +extern const u8 *const gText_Hints; +extern const u8 *const gHintsNames[]; + +enum +{ + HINTS_CONTROLS, + HINTS_ORIENTATION, + HINTS_SEEDS, + HINTS_MOVES, + HINTS_RANGE, + HINTS_LINKING_MOVES, + HINTS_POKEMON_TYPES, + HINTS_TOUCH_SCREEN, + HINTS_COUNT, +}; + +#define HINTS_COUNT_RED_VERSION HINTS_COUNT - 1 // No Touch Screen Hints in Red + +extern const u8 *const gHintsDescriptions[2][HINTS_COUNT]; + +extern const u8 *const gUnknown_8100208; +extern const u8 *const gPtrMagnitudeMessage; +extern const u8 *const gPtrSleepingTargetOnlyMessage; +extern const u8 *const gPtrFeralFoundItemMessage; +extern const u8 *const gPtrSelfHealPreventedHungerMessage; +extern const u8 *const gUnknown_81002B8; +extern const u8 *const gPtrFinalChanceMessage; +extern const u8 *const gPtrLinkedMovesComeApartMessage; +extern const u8 *const gPtrLinkMoveOneUseWarningMessage; +extern const u8 *const gPtrLinkMoveTwoUsesWarningMessage; +extern const u8 *const gPtrIcePartCrumbledMessage; +extern const u8 *const gPtrRockPartCrumbledMessage; +extern const u8 *const gPtrSteelPartCrumbledMessage; +extern const u8 *const gPtrWishStoneCrumbledMessage; +extern const u8 *const gPtrMusicBoxPlayedCrumbledMessage; +extern const u8 *const gPtrMysteriousPowerPreventedUseMessage; +extern const u8 *const gPtrCouldntBeUsedMessage; +extern const u8 *const gUnknown_81004E8; +extern const u8 *const gUnknown_81004EC; +extern const u8 *const gUnknown_81004F0; +extern const u8 *const gUnknown_8100524; +extern const u8 *const gUnknown_8100548; +extern const u8 *const gUnknown_810056C; +extern const u8 *const gUnknown_8100594; +extern const u8 *const gPtrExposedWoreOffMessage; +extern const u8 *const gPtrSealedMoveReleasedMessage; +extern const u8 *const gPtrCantLeechSeedSelfMessage; +extern const u8 *const gPtrCantLeechSeedMonMessage; +extern const u8 *const gPtrMoveInterruptedMessage; +extern const u8 *const gPtrClientFaintedMessage; +extern const u8 *const gPtrCantUseInDungeonMessage; +extern const u8 *const gPtrForecastPreventsTypeSwitchMessage; +extern const u8 *const gPtrForecastPreventsConversion2Message; +extern const u8 *const gPtrStenchWavedOffMessage; +extern const u8 *const gPtrProtectSavedItMessage; + +#endif diff --git a/include/dungeon_util.h b/include/dungeon_util.h index 9d8e7fe91..60c7f0174 100644 --- a/include/dungeon_util.h +++ b/include/dungeon_util.h @@ -9,6 +9,11 @@ extern const DungeonPos gAdjacentTileOffsets[NUM_DIRECTIONS]; +static inline EntityInfo *GetEntInfo(Entity *entity) +{ + return entity->axObj.info.monster; +} + bool8 EntityIsValid(Entity *pokemon); u32 GetEntityType(Entity *entity); u8 GetEntityRoom(Entity *entity); @@ -16,14 +21,19 @@ Tile *GetTileAtEntitySafe(Entity *entity); void sub_804535C(Entity *entity, PixelPos *pos); void SetEntityPixelPos(Entity *entity, s32 x, s32 y); void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y); - -static inline EntityInfo *GetEntInfo(Entity *entity) -{ - return entity->axObj.info.monster; -} Item *GetItemData(Entity *entity); Item *GetItemData_1(Entity *entity); Trap *GetTrapData(Entity *entity); Trap* GetTrapData_1(Entity *entity); +Entity *SpawnTrap(u8 trapID, DungeonPos *pos, u8 c); +Entity *sub_8045708(DungeonPos *pos); +void sub_80457DC(Entity* ent); +bool8 CanSeeTarget(Entity *entity, Entity *targetEntity); +bool8 CanTargetEntity(Entity *entity, Entity *targetEntity); +bool8 sub_8045A70(Entity *entity, Entity *targetEntity); +bool8 sub_8045AAC(Entity *entity, DungeonPos *pos); +bool8 CanTargetPosition(Entity *entity, DungeonPos *pos); +void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3); +void sub_8045ACC(void); #endif // GUARD_DUNGEON_UTIL_H diff --git a/include/dungeon_visibility.h b/include/dungeon_visibility.h deleted file mode 100644 index 0485e2080..000000000 --- a/include/dungeon_visibility.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef GUARD_DUNGEON_VISIBILITY_H -#define GUARD_DUNGEON_VISIBILITY_H - -#include "structs/dungeon_entity.h" - -bool8 CanSeeTarget(Entity *entity, Entity *targetEntity); -bool8 CanTargetEntity(Entity *entity, Entity *targetEntity); -bool8 sub_8045A70(Entity *entity, Entity *targetEntity); -bool8 sub_8045AAC(Entity *entity, DungeonPos *pos); -bool8 CanTargetPosition(Entity *entity, DungeonPos *pos); - -#endif diff --git a/include/math.h b/include/math.h index fd88f0767..b682372bb 100644 --- a/include/math.h +++ b/include/math.h @@ -47,7 +47,7 @@ s24_8 FP24_8_Hypot(s24_8 x, s24_8 y); void FP48_16_FromS32(s48_16 *dst, s32 src); u32 FP48_16_ToS32(s48_16 *a); void FP48_16_FromF248(s48_16 *a, s24_8 b); -bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b); +bool8 FP48_16_SLessThan(const s48_16 *a, const s48_16 *b); void FP48_16_Add(s48_16 *dst, s48_16 *a, s48_16 *b); void FP48_16_Subtract(s48_16 *dst, s48_16 *a, s48_16 *b); diff --git a/include/move_effects_target.h b/include/move_effects_target.h index e2b6d0544..5b90b6f7a 100644 --- a/include/move_effects_target.h +++ b/include/move_effects_target.h @@ -16,7 +16,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage); void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage); void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage); -void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 displayMessage); +void SqueezedStatusTarget(Entity * pokemon, Entity * target, s32 param_3, bool32 displayMessage); void ImmobilizedStatusTarget(Entity * pokemon, Entity * target); void IngrainedStatusTarget(Entity * pokemon, Entity * target); void WrapTarget(Entity * pokemon, Entity * target); diff --git a/include/moves.h b/include/moves.h index c995b2884..fd46650c4 100644 --- a/include/moves.h +++ b/include/moves.h @@ -89,6 +89,11 @@ void sub_8094060(Move *srcMoves, Move *destMoves); void WritePoke2MovesBits(DataSerializer *, struct Moves *); void ReadPoke2MovesBits(DataSerializer *, struct Moves *); +static inline void ResetMoveFlags(Move *move) +{ + move->moveFlags = 0; +} + static inline bool8 MoveFlagExists(Move *move) { return (move->moveFlags & MOVE_FLAG_EXISTS) != 0; diff --git a/include/run_dungeon.h b/include/run_dungeon.h new file mode 100644 index 000000000..85e904cbd --- /dev/null +++ b/include/run_dungeon.h @@ -0,0 +1,30 @@ +#ifndef GUARD_RUN_DUNGEON_H +#define GUARD_RUN_DUNGEON_H + +#include "structs/str_dungeon_8042F6C.h" + +struct UnkStruct_203B414 +{ + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC[16]; + s32 unk4C[16]; + struct DungeonPos unk8C[16]; +}; + +extern struct UnkStruct_203B414 *gUnknown_203B414; + +void RunDungeon_Async(UnkStruct_RunDungeon *r8); +void sub_8043CD8(void); +bool8 sub_8043CE4(s32 dungeonId); +u8 GetFloorType(void); +void sub_8043D50(s32 *a0, s32 *a1); +void sub_8043D60(void); +bool8 sub_8043ED0(bool8 a0); +void EnforceMaxItemsAndMoney(void); +bool8 IsBossFight(void); +bool8 IsCurrentFixedRoomBossFight(void); +bool8 IsMakuhitaTrainingMaze(void); + +#endif diff --git a/include/status_checks_1.h b/include/status_checks_1.h deleted file mode 100644 index 572d67d2a..000000000 --- a/include/status_checks_1.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef GUARD_STATUS_CHECKS_1_H -#define GUARD_STATUS_CHECKS_1_H - -#include "structs/dungeon_entity.h" - -void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum); -bool8 HasNegativeStatus(Entity *pokemon); -bool8 IsSleeping(Entity *pokemon); -bool8 HasLowHealth(Entity *pokemon); -s32 sub_8070828(Entity *pokemon, bool8 displayMessage); -void sub_80709C8(u8 *buffer, EntityInfo *entityInfo); - -#endif // GUARD_STATUS_CHECKS_1_H diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 3b02d0c8c..016c693bb 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -424,8 +424,8 @@ enum MonsterBehavior BEHAVIOR_ALLY, BEHAVIOR_SKARMORY, BEHAVIOR_DIGLETT, // Used for Diglett in the Skarmory boss fight. - BEHAVIOR_5, // 5 and 6 are probably Gengar and Ekans, but not sure which is which. - BEHAVIOR_6, + BEHAVIOR_GENGAR, + BEHAVIOR_EKANS, BEHAVIOR_MEDICHAM, BEHAVIOR_ZAPDOS, BEHAVIOR_MOLTRES, @@ -435,7 +435,7 @@ enum MonsterBehavior BEHAVIOR_ARTICUNO, BEHAVIOR_GROUDON_2, BEHAVIOR_RAYQUAZA, - BEHAVIOR_16, + BEHAVIOR_MANKEY, BEHAVIOR_MEWTWO, BEHAVIOR_ENTEI, BEHAVIOR_RAIKOU, @@ -455,7 +455,7 @@ enum MonsterBehavior BEHAVIOR_33, BEHAVIOR_34, BEHAVIOR_35, - BEHAVIOR_36, + BEHAVIOR_MAZE_BOSS, }; enum VisualFlag diff --git a/include/structs/str_dungeon_8042F6C.h b/include/structs/str_dungeon_8042F6C.h index ef2042fca..43846b3cc 100644 --- a/include/structs/str_dungeon_8042F6C.h +++ b/include/structs/str_dungeon_8042F6C.h @@ -30,7 +30,4 @@ typedef struct UnkStruct_RunDungeon WonderMailSub unk84; } UnkStruct_RunDungeon; -// TODO: This func should not be in a structs include file -void RunDungeon_Async(UnkStruct_RunDungeon *r8); - #endif // GUARD_STR_DUNGEON_8042F6C_H diff --git a/include/tile_types.h b/include/tile_types.h deleted file mode 100644 index fda2acf81..000000000 --- a/include/tile_types.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef GUARD_TILE_TYPES_H -#define GUARD_TILE_TYPES_H - -#include "structs/map.h" - -#define DUNGEON_WATER_TYPE_NONE 0 -#define DUNGEON_WATER_TYPE_LAVA 1 -#define DUNGEON_WATER_TYPE_WATER 2 - -extern const u8 gDungeonWaterType[76]; - -bool8 sub_804AD34(DungeonPos *pos); -void sub_804AE84(DungeonPos *pos); -bool8 IsTileGround(Tile *tile); -bool8 IsWaterTileset(); - -#endif // GUARD_TILE_TYPES_H diff --git a/ld_script.txt b/ld_script.txt index f923d3e50..11dc91560 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -203,27 +203,27 @@ SECTIONS { src/dungeon_map.o(.text); src/code_8040094_1.o(.text); src/code_8041AD0.o(.text); - src/code_804267C.o(.text); - src/code_8042B34.o(.text); + src/run_dungeon.o(.text); src/dungeon_engine.o(.text); - asm/code_8044210.o(.text); src/dungeon_action.o(.text); - src/code_8044CC8.o(.text); src/dungeon_util.o(.text); - src/code_80450F8.o(.text); - src/dungeon_visibility.o(.text); - src/code_8045A00.o(.text); src/dungeon_items.o(.text); asm/code_8046CE4.o(.text); - src/code_8048480.o(.text); + src/code_8046CE4.o(.text); + src/dungeon_item_action.o(.text); src/dungeon_ai_item_weight.o(.text); src/dungeon_map_access.o(.text); - src/tile_types.o(.text); src/dungeon_generation.o(.text); + src/dungeon_generation_fixed.o(.text); src/dungeon_message.o(.text); + src/dungeon_message_log.o(.text); src/dungeon_move.o(.text); - src/move_actions.o(.text); - src/status_actions.o(.text); + src/dungeon_move_util.o(.text); + src/move_orb_actions_1.o(.text); + src/move_orb_actions_2.o(.text); + src/move_orb_actions_3.o(.text); + src/move_orb_actions_4.o(.text); + src/move_orb_actions_5.o(.text); src/move_checks.o(.text); src/dungeon_main.o(.text); src/dungeon_submenu.o(.text); @@ -235,36 +235,43 @@ SECTIONS { src/dungeon_menu_others.o(.text); src/dungeon_menu_recruitment.o(.text); src/code_8066D04.o(.text); + src/dungeon_8067A80.o(.text); src/dungeon_misc.o(.text); src/code_8069E0C.o(.text); src/code_806CD90.o(.text); - src/type_effectiveness.o(.text); - src/code_806E8B0.o(.text); + src/dungeon_damage.o(.text); src/code_806FDF4.o(.text); src/status_checks.o(.text); - src/dungeon_movement.o(.text); - src/status_checks_1.o(.text); - src/dungeon_capabilities.o(.text); - src/dungeon_ai_targeting.o(.text); - src/dungeon_pokemon_attributes.o(.text); + src/dungeon_logic.o(.text); + src/dungeon_8071B48.o(.text); src/code_80718D8.o(.text); - asm/code_80718D8.o(.text); - src/code_8072B78.o(.text); src/dungeon_ai_leader.o(.text); + src/dungeon_8072CF4.o(.text); src/dungeon_ai_items.o(.text); src/code_8073CF0.o(.text); src/code_8075708.o(.text); src/dungeon_ai.o(.text); - src/move_effects_target.o(.text); - src/status.o(.text); + src/move_orb_effects_1.o(.text); + src/move_orb_effects_2.o(.text); + src/move_orb_effects_3.o(.text); + src/move_orb_effects_4.o(.text); + src/move_orb_effects_5.o(.text); src/code_8077274_1.o(.text); src/dungeon_ai_movement.o(.text); src/dungeon_ai_attack.o(.text); - src/targeting_flags.o(.text); - src/code_807CD9C.o(.text); - src/code_807E1A0.o(.text); + src/blow_away.o(.text); + src/warp_target.o(.text); + src/expose_trap.o(.text); + src/trawl_orb.o(.text); + src/pounce_orb.o(.text); + src/drought_orb.o(.text); + src/one_room_orb.o(.text); + src/explosion.o(.text); + src/switcher_orb.o(.text); + src/dungeon_wind.o(.text); src/weather.o(.text); - src/code_807E5AC.o(.text); + src/dungeon_kecleon_shop.o(.text); + src/hurl_orb.o(.text); src/trap.o(.text); src/dungeon_serializer.o(.text); src/dungeon_range.o(.text); @@ -527,9 +534,7 @@ SECTIONS { src/personality_test1.o(.rodata); src/personality_test2.o(.rodata); src/code_803D0D8.o(.rodata); - src/dungeon_util.o(.rodata); - data/data_80F4468.o(.rodata); - src/dungeon_ai_movement.o(.rodata); + src/dungeon_pos_data.o(.rodata); data/data_80F4D44.o(.rodata); src/dungeon_config.o(.rodata); data/data_80F59C8_1.o(.rodata); @@ -539,12 +544,32 @@ SECTIONS { data/data_80F59C8_0.o(.rodata); src/dungeon_map.o(.rodata); src/code_8040094_1.o(.rodata); - data/data_80F59C8_5.o(.rodata); + data/pksdir_0.o(.rodata); + src/code_8041AD0.o(.rodata); + src/run_dungeon.o(.rodata); + src/dungeon_engine.o(.rodata); + src/dungeon_action.o(.rodata); + data/pksdir_1.o(.rodata); + src/dungeon_util.o(.text); src/dungeon_items.o(.rodata); - data/data_80F59C8.o(.rodata); + src/code_8046CE4.o(.rodata); + src/dungeon_item_action.o(.rodata); + src/dungeon_ai_item_weight.o(.rodata); + src/dungeon_map_access.o(.rodata); + src/dungeon_generation.o(.rodata); + src/dungeon_generation_fixed.o(.rodata); src/dungeon_message.o(.rodata); + src/dungeon_strings.o(.rodata); + src/dungeon_boss_dialogue.o(.rodata); + src/dungeon_message_log.o(.rodata); src/dungeon_move.o(.rodata); - data/data_8106A4C_0.o(.rodata); + src/dungeon_move_util.o(.rodata); + src/move_orb_actions_1.o(.rodata); + src/move_orb_actions_2.o(.rodata); + src/move_orb_actions_3.o(.rodata); + src/move_orb_actions_4.o(.rodata); + src/move_orb_actions_5.o(.rodata); + src/move_checks.o(.rodata); src/dungeon_main.o(.rodata); src/dungeon_submenu.o(.rodata); src/dungeon_menu_items.o(.rodata); @@ -554,16 +579,47 @@ SECTIONS { src/dungeon_menu_stairs.o(.rodata); src/dungeon_menu_others.o(.rodata); src/dungeon_menu_recruitment.o(.rodata); - data/data_8106A4C.o(.rodata); src/code_8066D04.o(.rodata); + src/dungeon_8067A80.o(.rodata); src/dungeon_misc.o(.rodata); - data/data_8106A4C_2.o(.rodata); + src/code_8069E0C.o(.rodata); src/code_806CD90.o(.rodata); - src/type_effectiveness.o(.data); - data/data_8106F7C.o(.rodata); - src/dungeon_capabilities.o(.rodata); - src/dungeon_ai_targeting.o(.rodata); - data/data_8107010.o(.rodata); + src/dungeon_damage.o(.rodata); + src/code_806FDF4.o(.rodata); + src/status_checks.o(.rodata); + src/dungeon_logic.o(.rodata); + src/dungeon_8071B48.o(.rodata); + src/code_80718D8.o(.rodata); + src/dungeon_ai_leader.o(.rodata); + src/dungeon_8072CF4.o(.rodata); + src/dungeon_ai_items.o(.rodata); + src/code_8073CF0.o(.rodata); + src/code_8075708.o(.rodata); + src/dungeon_ai.o(.rodata); + src/move_orb_effects_1.o(.rodata); + src/move_orb_effects_2.o(.rodata); + src/move_orb_effects_3.o(.rodata); + src/move_orb_effects_4.o(.rodata); + src/move_orb_effects_5.o(.rodata); + src/code_8077274_1.o(.rodata); + src/dungeon_ai_movement.o(.rodata); + src/dungeon_ai_attack.o(.rodata); + src/blow_away.o(.rodata); + src/warp_target.o(.rodata); + src/expose_trap.o(.rodata); + src/trawl_orb.o(.rodata); + src/pounce_orb.o(.rodata); + src/drought_orb.o(.rodata); + src/one_room_orb.o(.rodata); + data/pksdir_2.o(.rodata); + src/explosion.o(.rodata); + src/switcher_orb.o(.rodata); + src/dungeon_wind.o(.rodata); + src/weather.o(.rodata); + src/dungeon_kecleon_shop.o(.rodata); + src/hurl_orb.o(.rodata); + src/trap.o(.rodata); + data/pksdir_3.o(.rodata); src/dungeon_serializer.o(.rodata); data/data_8107224.o(.rodata); src/pokemon.o(.rodata); @@ -576,12 +632,7 @@ SECTIONS { src/code_80972F4.o(.rodata); src/code_8097504.o(.rodata); data/data_8109D10.o(.rodata); - src/pokemon_3.o(.rodata); - src/items.o(.rodata); - src/code_8048480.o(.rodata); - src/friend_area.o(.rodata); - data/data_810AC60.o(.rodata); - src/tile_types.o(.rodata); + src/dungeon_data.o(.rodata); src/exclusive_pokemon.o(.rodata); src/rescue_team_info.o(.rodata); src/strings.o(.rodata); diff --git a/src/blow_away.c b/src/blow_away.c new file mode 100644 index 000000000..0ddb16246 --- /dev/null +++ b/src/blow_away.c @@ -0,0 +1,211 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +void sub_804EB30(); +bool8 ExposeTrap(s32 x, s32 y); +void ShowWholeRevealedDungeonMap(); +void sub_8049ED4(); +void sub_806A5B8(Entity *); +u8 sub_8045888(Entity *); +void sub_807EC28(u32); +u8 sub_8044B28(void); +extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); +void sub_80421AC(Entity * pokemon, Entity * target); +void sub_807BB78(Entity *pokemon); +extern void sub_803F580(u32); +bool8 sub_808384C(DungeonPos *, DungeonPos *); +u8 sub_8083660(DungeonPos *); + +extern u32 gDungeonFramesCounter; + +void sub_807D068(Entity *pokemon, DungeonPos *pos); + +void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction) +{ + const Tile *tile; + int iVar8; + bool8 flag; + DungeonPos pos; + Move move; + int counter; + Entity *entity; + PixelPos pos32; + + counter = 10; + if (IsCurrentFixedRoomBossFight()) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC9E8); // It couldn't be knocked flying! + return; + } + else + { + if (pokemon == target) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCA10); // {POKEMON_0} couldn't be knocked flying! + return; + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (AbilityIsActive(target,ABILITY_SUCTION_CUPS)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! + return; + } + else + { + (GetEntInfo(target)->action).direction = (direction + 4) & DIRECTION_MASK; + sub_806CDD4(target, 6, (direction + 4) & DIRECTION_MASK); + sub_80421C0(target,0x1a3); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80F8A0C); // {POKEMON_0} was blown away! + flag = TRUE; + entity = NULL; + + for(; counter > 0; counter--) + { + pos = target->pos; + pos.x += gAdjacentTileOffsets[direction].x; + pos.y += gAdjacentTileOffsets[direction].y; + if ((((pos.x < 0) || (pos.y < 0)) || (DUNGEON_MAX_SIZE_X <= pos.x)) || + (DUNGEON_MAX_SIZE_Y <= pos.y)) goto _0807CF20; + pos32.x = gAdjacentTileOffsets[direction].x << 0xA; + pos32.y = gAdjacentTileOffsets[direction].y << 0xA; + + for(iVar8 = 0; iVar8 < 6; iVar8++) + { + IncreaseEntityPixelPos(target,pos32.x,pos32.y); + if (sub_8045888(target) != 0) { + DungeonRunFrameActions(0x19); + } + } + tile = GetTile(pos.x, pos.y); + if (tile->monster != NULL) { + entity = tile->monster; + goto _0807CF26; + } + if (sub_80705F0(target,&pos)){ + flag = (GetTerrainType(tile) != TERRAIN_TYPE_WALL); + goto _0807CF20; + } + sub_80694C0(target,pos.x,pos.y,1); + } + + + flag = TRUE; + _0807CF20: + if (!flag) { + _0807CF26: + + sub_807D068(target,&target->pos); + sub_806F370(pokemon,target,gBlowAwayDmgValue,0,0,0,0x219,0,0,0); + } + if (sub_8044B28()) { + return; + } + if (entity != NULL) { + InitPokemonMove(&move,0x163); + if (!sub_80571F0(entity,&move)) { + TrySendImmobilizeSleepEndMsg(pokemon,entity); + sub_806F370(pokemon,entity,gBlowAwayDmgValue,0,0,0,0x21a,0,0,0); + } + } + if (sub_8044B28()) { + return; + } + if (!EntityIsValid(target)) { + return; + } + sub_806A5B8(target); + if (sub_80706A4(target,&target->pos)) { + WarpTarget(target,target,0,0); + } + if (!EntityIsValid(target)) { + return; + } + sub_806CE68(target,8); + if (GetEntInfo(target)->isTeamLeader) { + gDungeon->unk1 = 0; + gDungeon->unk5C0 = -1; + sub_804AC20(&target->pos); + sub_807EC28(FALSE); + } + sub_806A5B8(target); + sub_8075900(target,gDungeon->forceMonsterHouse); + } + } +} + +void sub_807D068(Entity *pokemon, DungeonPos *pos) +{ + int pixelX; + int posY; + int pixelY; + int posX; + int counter; + int iVar8; + s32 diff; + PixelPos local_34; + int incrementX; + int incrementY; + + posX = X_POS_TO_PIXELPOS(pos->x); + posY = Y_POS_TO_PIXELPOS(pos->y); + diff = (pokemon->pixelPos).x - posX; + if (diff < 0) { + diff = -diff; + } + if (diff < 0xc) { + diff = (pokemon->pixelPos).y - posY; + if (diff < 0) { + diff = -diff; + } + if (diff < 0xc) goto _0807D11E; + } + iVar8 = 0; + pixelX = (pokemon->pixelPos).x; + pixelY = (pokemon->pixelPos).y; + incrementX = (posX - pixelX) / 0xc; + incrementY = (posY - pixelY) / 0xc; + + for(counter = 0; counter < 0xC; counter++) + { + pixelX += incrementX; + pixelY += incrementY; + local_34.x = pixelX; + local_34.y = pixelY; + pokemon->unk1C.raw = sin_4096(iVar8) * 0xc; + sub_804535C(pokemon, &local_34); + if (sub_8045888(pokemon)) { + DungeonRunFrameActions(0x1a); + } + iVar8 = iVar8 + 0xaa; + } +_0807D11E: + local_34.x = posX; + local_34.y = posY; + pokemon->unk1C = IntToF248(0); + sub_804535C(pokemon,&local_34); + DungeonRunFrameActions(0x1a); +} diff --git a/src/code_800F034.c b/src/code_800F034.c index 559fa596f..61c6b3761 100644 --- a/src/code_800F034.c +++ b/src/code_800F034.c @@ -18,10 +18,8 @@ struct unkStruct_203B0D4 extern struct unkStruct_203B0D4 *gUnknown_203B0D4; -ALIGNED(4) static const u8 gUnknown_80CE77C[] = "efob%03d"; -ALIGNED(4) static const u8 gUnknown_80CE788[] = "efbg%03d"; - -void sub_800F034(void) { +void sub_800F034(void) +{ s32 index; if(gUnknown_203B0D4 == NULL) { @@ -121,10 +119,10 @@ OpenedFile * sub_800F1C0(u32 animType, s32 effectID) case 1: case 2: case 3: - sprintf(fileName,gUnknown_80CE77C,effectID); // efob + sprintf(fileName,"efob%03d",effectID); break; case 4: - sprintf(fileName,gUnknown_80CE788,effectID); // efbg + sprintf(fileName,"efbg%03d",effectID); break; } diff --git a/src/code_803D110.c b/src/code_803D110.c index 294c6d256..38fb12372 100644 --- a/src/code_803D110.c +++ b/src/code_803D110.c @@ -17,6 +17,7 @@ #include "pokemon_3.h" #include "text_1.h" #include "text_3.h" +#include "dungeon_config.h" extern s32 sub_80902C8(u8 dungeon); extern void sub_808E9C4(UnkDungeonGlobal_unk1CD98 *r0, s16 r1); @@ -32,7 +33,6 @@ extern const char gUnknown_80F610C[]; extern const char gUnknown_80F6110[]; extern const char gUnknown_80F6118[]; extern const u32 gUnknown_80F6120[]; -extern const u16 gUnknown_80F5F70[]; extern RGB gUnknown_202ECA4[]; extern OpenedFile *gDungeonNameBannerPalette; diff --git a/src/code_803E724.c b/src/code_803E724.c index fa8883ac3..90fad0fbb 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -18,7 +18,7 @@ #include "dungeon_map_access.h" #include "dungeon_message.h" #include "dungeon_music.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_range.h" #include "dungeon_util.h" #include "game_options.h" diff --git a/src/code_8040094_1.c b/src/code_8040094_1.c index 0b5f33dc7..ee8017efd 100644 --- a/src/code_8040094_1.c +++ b/src/code_8040094_1.c @@ -18,8 +18,8 @@ #include "dungeon_random.h" #include "dungeon_util.h" #include "sprite.h" -#include "tile_types.h" #include "weather.h" +#include "dungeon_map_access.h" struct UnkStruct_8040094 { diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index d6e398968..7241971f4 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "constants/direction.h" #include "constants/status.h" #include "constants/type.h" @@ -15,25 +16,26 @@ #include "code_804267C.h" #include "code_806CD90.h" #include "dungeon_config.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_util.h" #include "items.h" #include "math.h" #include "sprite.h" +#include "code_803E668.h" +#include "dungeon.h" +#include "run_dungeon.h" +#include "dungeon_leader.h" +#include "dungeon_map.h" +#include "dungeon_message.h" +#include "dungeon_music.h" +#include "memory.h" +#include "random.h" +#include "dungeon_util_1.h" +#include "code_800E9E4.h" -extern u32 gStatusSpriteMasks_SleepClassStatus[]; -extern u32 gStatusSpriteMasks_BurnClassStatus[]; -extern u32 gStatusSpriteMasks_FrozenClassStatus[]; -extern u32 gStatusSpriteMasks_CringeClassStatus[]; -extern u32 gStatusSpriteMasks_BideClassStatus[]; -extern u32 gStatusSpriteMasks_ReflectClassStatus[]; -extern u32 gStatusSpriteMasks_CurseClassStatus[]; -extern u32 gStatusSpriteMasks_LeechSeedClassStatus[]; -extern u32 gStatusSpriteMasks_SureShotClassStatus[]; -extern u32 gStatusSpriteMasks_LongTossClassStatus[]; -extern u32 gStatusSpriteMasks_InvisibleClassStatus[]; -extern u32 gStatusSpriteMasks_BlinkerClassStatus[]; -extern u32 gStatusSpriteMasks_MuzzledStatus[]; +// Unknown dungeon file. File split is correct. + +extern const u8 *gPtrFeralFoundItemMessage[]; extern void sub_803ED30(u8, Entity *pokemon, u8, u8); extern u32 sub_806F62C(u32); @@ -47,11 +49,160 @@ extern s32 gDungeonBrightness; extern void sub_800DBBC(void); extern void sub_803EA10(void); extern void sub_8042E98(void); +extern void sub_800EF28(u8); +extern u32 sub_800E448(u8, DungeonPos *); +extern void sub_80429A0(Entity *); +void sub_8042B34(s32 a0, s32 a1, s32 a2); +extern bool8 sub_8042CC0(void); +extern void sub_8042D7C(void); +extern u8 GetFloorType(void); +extern bool8 sub_8045888(Entity *); +extern s32 sub_80416E0(PixelPos*, u32, bool8); +extern u32 sub_8041764(unkStruct_80416E0 *, bool8); +extern u32 sub_800E49C(); +extern void sub_800F15C(s32); +extern void sub_800EF40(u8 r0, u8 r1); +extern s32 sub_800E6D8(s32); +extern void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, s32 param_4, s32 param_5); -void sub_804178C(u8 param_1); u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2); s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3); s32 sub_8041550(Entity *entity, s32 a1, u8 a2, u8 a3, s32 a4, u8 a5); +s32 sub_804151C(Entity *entity, s32 r1, u8 r2); +void sub_804178C(u8 param_1); + +struct UnkStruct_80F6624 +{ + s16 unk0; + s32 unk4; +}; + +static const struct UnkStruct_80F6624 gUnknown_80F6624[][3] = { + {{0x178, 3}, {0x179, 1}, {0, 0}}, + {{0x17A, 1}, {0x17B, 2}, {0x17C, 3}}, + {{0x17D, 1}, {0x17E, 2}, {0, 0}}, + {{0x17F, 2}, {0, 0}, {0, 0}}, + {{0x1B9, 1}, {0x1BA, 2}, {0x1BB, 3}}, +}; + +static const u32 sStatusSpriteMasks_SleepClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_SLEEP] = STATUS_SPRITE_SLEEP, + [STATUS_SLEEPLESS] = STATUS_SPRITE_SLEEPLESS, + [STATUS_NIGHTMARE] = STATUS_SPRITE_SLEEP, + [STATUS_YAWNING] = 0, + [STATUS_NAPPING] = STATUS_SPRITE_SLEEP, +}; + +static const u32 sStatusSpriteMasks_BurnClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_BURN] = STATUS_SPRITE_BURNED, + [STATUS_POISONED] = STATUS_SPRITE_POISONED, + [STATUS_BADLY_POISONED] = STATUS_SPRITE_BADLY_POISONED, + [STATUS_PARALYSIS] = 0, +}; + +static const u32 sStatusSpriteMasks_FrozenClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_FROZEN] = STATUS_SPRITE_FROZEN, + [STATUS_SHADOW_HOLD] = 0, + [STATUS_WRAP] = 0, + [STATUS_WRAPPED] = 0, + [STATUS_INGRAIN] = 0, + [STATUS_PETRIFIED] = 0, + [STATUS_CONSTRICTION] = 0, +}; + +static const u32 sStatusSpriteMasks_CringeClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_CRINGE] = 0, + [STATUS_CONFUSED] = STATUS_SPRITE_CONFUSED, + [STATUS_PAUSED] = 0, + [STATUS_COWERING] = STATUS_SPRITE_COWERING, + [STATUS_TAUNTED] = STATUS_SPRITE_TAUNTED, + [STATUS_ENCORE] = STATUS_SPRITE_ENCORE, + [STATUS_INFATUATED] = 0, +}; + +static const u32 sStatusSpriteMasks_BideClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_BIDE] = 0, + [STATUS_SOLARBEAM] = 0, + [STATUS_SKY_ATTACK] = 0, + [STATUS_RAZOR_WIND] = 0, + [STATUS_FOCUS_PUNCH] = 0, + [STATUS_SKULL_BASH] = 0, + [STATUS_FLYING] = 0, + [STATUS_BOUNCING] = 0, + [STATUS_DIVING] = 0, + [STATUS_DIGGING] = 0, + [STATUS_CHARGING] = 0, + [STATUS_ENRAGED] = 0, +}; + +static const u32 sStatusSpriteMasks_ReflectClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_REFLECT] = STATUS_SPRITE_SHIELD_BLUE, + [STATUS_SAFEGUARD] = STATUS_SPRITE_SHIELD_RED, + [STATUS_LIGHT_SCREEN] = STATUS_SPRITE_SHIELD_YELLOW, + [STATUS_COUNTER] = STATUS_SPRITE_SHIELD_BLUE, + [STATUS_MAGIC_COAT] = STATUS_SPRITE_SHIELD_YELLOW, + [STATUS_WISH] = 0, + [STATUS_PROTECT] = STATUS_SPRITE_SHIELD_GREEN, + [STATUS_MIRROR_COAT] = STATUS_SPRITE_SHIELD_RED, + [STATUS_ENDURING] = STATUS_SPRITE_ENDURE, + [STATUS_MINI_COUNTER] = STATUS_SPRITE_SHIELD_BLUE, + [STATUS_MIRROR_MOVE] = STATUS_SPRITE_SHIELD_GREEN, + [STATUS_CONVERSION2] = 0, + [STATUS_VITAL_THROW] = STATUS_SPRITE_SHIELD_GREEN, + [STATUS_MIST] = STATUS_SPRITE_SHIELD_BLUE, +}; + +static const u32 sStatusSpriteMasks_CurseClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_CURSED] = STATUS_SPRITE_CURSED, + [STATUS_DECOY] = 0, + [STATUS_SNATCH] = STATUS_SPRITE_SNATCH, +}; + +static const u32 sStatusSpriteMasks_LeechSeedClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_LEECH_SEED] = 0, + [STATUS_DESTINY_BOND] = 0, +}; + +static const u32 sStatusSpriteMasks_SureShotClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_SURE_SHOT] = STATUS_SPRITE_SURE_SHOT, + [STATUS_WHIFFER] = STATUS_SPRITE_WHIFFER, + [STATUS_SET_DAMAGE] = STATUS_SPRITE_SET_DAMAGE, + [STATUS_FOCUS_ENERGY] = STATUS_SPRITE_FOCUS_ENERGY, +}; + +static const u32 sStatusSpriteMasks_LongTossClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_LONG_TOSS] = 0, + [STATUS_PIERCE] = 0, +}; + +static const u32 sStatusSpriteMasks_InvisibleClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_INVISIBLE] = 0, + [STATUS_TRANSFORMED] = 0, + [STATUS_MOBILE] = 0, +}; + +static const u32 sStatusSpriteMasks_BlinkerClassStatus[] = { + [STATUS_NONE] = 0, + [STATUS_BLINKER] = STATUS_SPRITE_BLINKER, + [STATUS_CROSS_EYED] = STATUS_SPRITE_CROSS_EYED, + [STATUS_EYEDROPS] = STATUS_SPRITE_EYEDROPS, +}; + +static const u32 sStatusSpriteMasks_MuzzledStatus[] = { + [STATUS_NONE] = 0, + /*STATUS_MUZZLED not defined*/[1] = STATUS_SPRITE_MUZZLED, +}; s32 sub_804151C(Entity *entity, s32 r1, u8 r2) { @@ -258,21 +409,21 @@ void EntityUpdateStatusSprites(Entity *entity) flag = (temp) != 0; } if (flag) { - spriteStatus = gStatusSpriteMasks_SleepClassStatus[entityInfo->sleepClassStatus.status]; + spriteStatus = sStatusSpriteMasks_SleepClassStatus[entityInfo->sleepClassStatus.status]; } spriteStatus = spriteStatus | - gStatusSpriteMasks_BurnClassStatus[entityInfo->burnClassStatus.status] | - gStatusSpriteMasks_FrozenClassStatus[entityInfo->frozenClassStatus.status] | - gStatusSpriteMasks_CringeClassStatus[entityInfo->cringeClassStatus.status] | - gStatusSpriteMasks_BideClassStatus[entityInfo->bideClassStatus.status] | - gStatusSpriteMasks_ReflectClassStatus[entityInfo->reflectClassStatus.status] | - gStatusSpriteMasks_CurseClassStatus[entityInfo->curseClassStatus.status] | - gStatusSpriteMasks_LeechSeedClassStatus[entityInfo->leechSeedClassStatus.status] | - gStatusSpriteMasks_SureShotClassStatus[entityInfo->sureShotClassStatus.status] | - gStatusSpriteMasks_LongTossClassStatus[entityInfo->longTossClassStatus.status] | - gStatusSpriteMasks_InvisibleClassStatus[entityInfo->invisibleClassStatus.status] | - gStatusSpriteMasks_BlinkerClassStatus[entityInfo->blinkerClassStatus.status] | - gStatusSpriteMasks_MuzzledStatus[entityInfo->muzzled.muzzled]; + sStatusSpriteMasks_BurnClassStatus[entityInfo->burnClassStatus.status] | + sStatusSpriteMasks_FrozenClassStatus[entityInfo->frozenClassStatus.status] | + sStatusSpriteMasks_CringeClassStatus[entityInfo->cringeClassStatus.status] | + sStatusSpriteMasks_BideClassStatus[entityInfo->bideClassStatus.status] | + sStatusSpriteMasks_ReflectClassStatus[entityInfo->reflectClassStatus.status] | + sStatusSpriteMasks_CurseClassStatus[entityInfo->curseClassStatus.status] | + sStatusSpriteMasks_LeechSeedClassStatus[entityInfo->leechSeedClassStatus.status] | + sStatusSpriteMasks_SureShotClassStatus[entityInfo->sureShotClassStatus.status] | + sStatusSpriteMasks_LongTossClassStatus[entityInfo->longTossClassStatus.status] | + sStatusSpriteMasks_InvisibleClassStatus[entityInfo->invisibleClassStatus.status] | + sStatusSpriteMasks_BlinkerClassStatus[entityInfo->blinkerClassStatus.status] | + sStatusSpriteMasks_MuzzledStatus[entityInfo->muzzled.muzzled]; if (entityInfo->grudge) { spriteStatus = spriteStatus | STATUS_SPRITE_GRUDGE; @@ -961,10 +1112,6 @@ void sub_8042238(Entity *pokemon, Entity *target) PlaySoundEffect(0x156); } -extern void sub_800EF28(u8); -extern void sub_803E708(u32, u32); -extern u32 sub_800E448(u8, DungeonPos *); - void sub_804225C(Entity *entity, DungeonPos *pos, u8 trapId) { s32 uVar6; @@ -1014,3 +1161,575 @@ void sub_804225C(Entity *entity, DungeonPos *pos, u8 trapId) break; } } + +void sub_8042390(Entity *entity, Item *item) +{ + s32 sVar1; + s32 counter; + u8 id; + u32 uVar6; + DungeonPos asStack_24[4]; + DungeonPos local_14; + + if (sub_8042768(entity)) { + id = !ItemSticky(item) ? item->id : ITEM_NOTHING; + sub_800EF40(id, 0); + sub_800EF64(); + sub_803E708(4,0x42); + local_14.x = (entity->pixelPos).x / 256; + local_14.y = (entity->pixelPos).y / 256; + + sVar1 = (local_14.y - gDungeon->unk181e8.cameraPixelPos.y) / 2 + 1; + sub_8005700(asStack_24,&entity->axObj); + uVar6 = sub_800E49C(id,&local_14,asStack_24,0,sVar1); + for (counter = 0; counter < 1000; counter++) { + DungeonRunFrameActions(0x42); + if (!sub_800E9A8(uVar6)) { + break; + } + } + } +} + +void sub_804245C(Entity *entity, Item *item) +{ + s32 sVar1; + s32 counter; + u8 id; + u32 uVar6; + DungeonPos asStack_24[4]; + DungeonPos local_14; + + if (sub_8042768(entity)) { + id = !ItemSticky(item) ? item->id : ITEM_NOTHING; + sub_800EF64(); + sub_803E708(4,0x42); + local_14.x = (entity->pixelPos).x / 256; + local_14.y = (entity->pixelPos).y / 256; + + sVar1 = (local_14.y - gDungeon->unk181e8.cameraPixelPos.y) / 2 + 1; + sub_8005700(asStack_24,&entity->axObj); + uVar6 = sub_800E49C(id,&local_14,asStack_24,1,sVar1); + for (counter = 0; counter < 1000; counter++) { + DungeonRunFrameActions(0x42); + if (!sub_800E9A8(uVar6)) { + break; + } + } + } +} + +s32 sub_8042520(Entity *a0) +{ + s32 i; + s32 uVar4; + DungeonPos pos; + u32 dir; + s32 iVar8; + unkStruct_80416E0 local_58; + unkStruct_2039DB0 u203; // Unused + PixelPos local_2c; + + if (sub_8045888(a0)) { + dir = GetEntInfo(a0)->action.direction; + pos.x = a0->pixelPos.x / 0x100; + pos.y = a0->pixelPos.y / 0x100; + + iVar8 = (pos.y - gDungeon->unk181e8.cameraPixelPos.y) / 2; + local_58.unk0 = 357; + local_58.unk4 = 0; + local_58.dir = dir; + local_58.x = pos.x; + local_58.y = pos.y; + local_58.unk10 = 0; + local_58.unk12 = 0; + local_58.unk14 = -1; + local_58.unk18 = iVar8; + sub_8004E8C(&u203); + uVar4 = sub_8041764(&local_58, 0); + + for (i = 0; i < 6; i++) { + sub_800E8AC(uVar4, &pos, 0, iVar8, 0); + DungeonRunFrameActions(66); + pos.x += gAdjacentTileOffsets[dir].x * 4; + pos.y += gAdjacentTileOffsets[dir].y * 4; + iVar8 = (pos.y - gDungeon->unk181e8.cameraPixelPos.y) / 2; + } + + sub_800DBBC(); + local_2c.x = pos.x * 0x100; + local_2c.y = pos.y * 0x100; + uVar4 = sub_80416E0(&local_2c, 416, TRUE); + } + else + { + uVar4 = -1; + } + return uVar4; +} + +// This func plays the appropriate ascend/descend SFX for stairs depending on the direction +void PlayStairsSound(void) +{ + u32 songIndex; + + songIndex = 997; + + switch (GetFloorType()) { + case 0: + default: + songIndex = IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id) ? 340 : 341; + break; + case 1: + case 2: + break; + } + + PlaySoundEffect(songIndex); +} + +static const u16 gUnknown_80F67DC[4] = { + 0xD8, 0xD9, 0xD9, 0x173 +}; +static const u16 gUnknown_80F67E4[4] = { + 0xDA, 0xDB, 0xDB, 0x174 +}; + +void sub_80426C8(u32 a0, u32 a1) +{ + if (a1 == 3) + DungeonStartNewBGM(0); + + if (a0 != 4) + PlaySoundEffect(gUnknown_80F67DC[a1]); + else + PlaySoundEffect(gUnknown_80F67E4[a1]); + + sub_8042B34(a0, a1, 0x80); + + while (sub_8042CC0()) + DungeonRunFrameActions(0x46); + + sub_8042D7C(); + LoadDungeonMapPalette(); + sub_8052210(1); +} + +void sub_8042730(Entity *a0, void *unused) +{ + s32 i; + + sub_806CDD4(a0, 8, 8); + for (i = 0; i < 100; i++) { + DungeonRunFrameActions(0x51); + if ((a0->axObj.axdata.sub1.unk10 & 3) != 0 || a0->axObj.unk43_animId2 != 8) + break; + } +} + +bool8 sub_8042768(Entity* pokemon) +{ + if (!pokemon->isVisible) + return FALSE; + if (gDungeon->unk181e8.blinded) { + if (gDungeon->unk181e8.cameraTarget == pokemon) + return TRUE; + else + return FALSE; + } + return sub_8045888(pokemon); +} + +void sub_80427AC(void) +{ + Entity *entity; + EntityInfo *enInfo; + s32 i; + + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + entity = gDungeon->activePokemon[i]; + if (EntityIsValid(entity)) { + enInfo = GetEntInfo(entity); + if (enInfo->unkF3) { + enInfo->unkF3 = FALSE; + sub_80429A0(entity); + if (!enInfo->isNotTeamMember) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + DisplayDungeonLoggableMessageTrue(entity, *gPtrFeralFoundItemMessage); + } + } + } + } +} + +static const s32 gUnknown_80F67EC[8] = { + -1, 331, 239, -1, 16, 20, -1, 223 +}; +static const s32 gUnknown_80F680C[8] = { + -1, 331, 239, -1, 440, 20, -1, 223 +}; +static const u16 gUnknown_80F682C[8] = { + 997, 997, 997, 425, 997, 997, 426, 997 +}; + +void sub_8042818(u8 a0, bool8 a1) +{ + Entity *en; + + en = gDungeon->unk181e8.cameraTarget; + if (en == NULL) + en = GetLeader(); + + if (gUnknown_80F682C[a0] != 997) + sub_80421C0(en, gUnknown_80F682C[a0]); + + if (gUnknown_80F67EC[a0] < 0) + return; + + if (a1 && !IsBossFight()) + sub_804151C(en, gUnknown_80F67EC[a0], 0); + else + sub_804151C(en, gUnknown_80F680C[a0], 0); +} + +void sub_80428A0(Entity *r0) +{ + sub_804151C(r0, 0x29, 1); +} + +void sub_80428B0(Entity *r0) +{ + sub_804151C(r0, 0x1a9, 0); +} + +void sub_80428C4(Entity *r0) +{ + sub_804151C(r0, 0x1a9, 0); +} + +void sub_80428D8(Entity *r0) +{ + sub_804151C(r0, 0x1a9, 0); +} + +void sub_80428EC(Entity *r0) +{ + sub_804151C(r0, 0x1a9, 0); +} + +void sub_8042900(Entity *r0) +{ + sub_804151C(r0, 0xD4 << 1, 0); +} + +void ShowVisualFlags(Entity *r0) +{ + sub_804151C(r0, 0x29, 0); +} + +void sub_8042920(Entity *r0) +{ + sub_804151C(r0, 0x48, 0); +} + +void sub_8042930(Entity *r0) +{ + sub_804151C(r0, 0xD3 << 1, 1); +} + +void sub_8042940(Entity *r0) +{ + sub_804151C(r0, 0xC7 << 1, 0); +} + +void sub_8042950(Entity *r0) +{ + sub_804151C(r0, 0xD8 << 1, 1); + sub_803E708(0xA, 0x42); +} + +void sub_8042968(Entity *r0) +{ + sub_804151C(r0, 0xD4 << 1, 0); +} + +void sub_8042978(Entity *r0) +{ + sub_804151C(r0, 0x1a9, 0); +} + +void sub_804298C(Entity *r0) +{ + sub_804151C(r0, 0x1a9, 0); +} + +void sub_80429A0(Entity *r0) +{ + sub_804151C(r0, 0x199, 0); +} + +void sub_80429B4(Entity *r0) +{ + sub_804151C(r0, 0x1ab, 0); +} + +void sub_80429C8(Entity *r0) +{ + sub_804151C(r0, 0x4, 1); +} + +void sub_80429D8(Entity *r0) +{ + sub_804151C(r0, 0x8F << 1, 1); +} + +void sub_80429E8(Entity *r0) +{ + sub_804151C(r0, 0x11d, 1); +} + +void sub_80429FC(DungeonPos *r0) +{ + sub_80416A4(r0, 0x19E, TRUE); + sub_80421C0(NULL, 0xD4); +} + +void sub_8042A14(DungeonPos *r0) +{ + sub_80416A4(r0, 0x36, TRUE); +} + +void sub_8042A24(Entity *r0) +{ + sub_804151C(r0, 0x15, 1); +} + +void sub_8042A34(DungeonPos *r0) +{ + sub_80416A4(r0, 0x13E, FALSE); +} + +void sub_8042A44(Entity *r0) +{ + sub_804151C(r0, 0xDA << 1, 1); +} + +void sub_8042A54(DungeonPos *r0) +{ + sub_80416A4(r0, 0x37, TRUE); +} + +void sub_8042A64(DungeonPos *r0) +{ + sub_80416A4(r0, 0x29, TRUE); +} + +void sub_8042A74(Entity *r0) +{ + sub_804151C(r0, 0x18, 1); +} + +void sub_8042A84(s16 param_1, Entity *entity, u32 param_3) +{ + s32 iVar3; + s32 r6; + s32 param_1_s16; + + param_1_s16 = param_1; + + r6 = IntToF248_2(2).raw; + if (sub_8042768(entity)) { + sub_804151C(entity,param_1_s16,0); + sub_803E708(param_3,0x42); + do { + if (entity->unk1C.raw > IntToF248_2(199.999).raw) break; + DungeonRunFrameActions(0x42); + entity->unk1C.raw += + r6; + r6 += IntToF248_2(1).raw; + iVar3 = (entity->pixelPos.y - entity->unk1C.raw) / 256; + } while (-8 <= iVar3 - gDungeon->unk181e8.cameraPixelPos.y); + entity->isVisible = 0; + sub_804178C(0); + } +} + +void sub_8042B0C(Entity *entity) +{ + sub_8042A84(0x13e, entity, 5); +} + +void sub_8042B20(Entity *entity) +{ + sub_8042A84(0x1BC, entity, 0xE); +} + +static const unkStruct_2039DB0 gUnknown_80F683C = {0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0}; + +void sub_8042B34(s32 a0, s32 a1, s32 a2) +{ + unkStruct_80416E0 spStruct; + unkStruct_2039DB0 stack1C; + s32 i; + s32 r8 = 0; + Entity *leader = xxx_call_GetLeader(); + gUnknown_203B414 = MemoryAlloc(sizeof(*gUnknown_203B414), 7); + + gUnknown_203B414->unk0 = a0; + gUnknown_203B414->unk8 = (a1 + 1) * 4; + sub_800EE5C(gUnknown_80F6624[a0][0].unk0); + sub_800EF64(); + DungeonRunFrameActions(0x46); + gUnknown_203B414->unk4 = a2; + for (i = 0; i < gUnknown_203B414->unk8; i++) { + s32 rnd; + + spStruct.unk0 = gUnknown_80F6624[gUnknown_203B414->unk0][r8].unk0; + spStruct.unk4 = i; + spStruct.dir = 0; + spStruct.x = leader->pixelPos.x / 256; + spStruct.y = leader->pixelPos.y / 256; + + rnd = RandInt(2); + gUnknown_203B414->unk4C[i] = (gUnknown_80F6624[gUnknown_203B414->unk0][r8].unk4 * 2) + rnd; + gUnknown_203B414->unk8C[i].x = RandInt(240) + 152; + gUnknown_203B414->unk8C[i].y = RandInt(8 + (i * 2)) - (((i - (i / 4 * 4)) * 40) - 24); + + spStruct.unk10 = gUnknown_203B414->unk8C[i].x; + spStruct.unk12 = gUnknown_203B414->unk8C[i].y; + spStruct.unk14 = 4; + spStruct.unk18 = 0xFFFF; + stack1C = gUnknown_80F683C; + gUnknown_203B414->unkC[i] = sub_800E890(&spStruct); + + r8++; + if (r8 >= 3 || gUnknown_80F6624[gUnknown_203B414->unk0][r8].unk0 == 0) { + r8 = 0; + } + + sub_800F15C(sub_800ECA4(spStruct.unk0)->effectId); + } +} + +bool8 sub_8042CC0(void) +{ + s32 i; + bool8 ret = FALSE; + + if (gUnknown_203B414->unk4 != 0) { + ret = TRUE; + gUnknown_203B414->unk4--; + } + + for (i = 0; i < gUnknown_203B414->unk8; i++) { + gUnknown_203B414->unk8C[i].x -= gUnknown_203B414->unk4C[i]; + if (gUnknown_203B414->unk8C[i].x <= -152) { + if (gUnknown_203B414->unk4 > 0) { + gUnknown_203B414->unk8C[i].x = 152; + } + else { + gUnknown_203B414->unk8C[i].x = -152; + } + } + else { + ret = TRUE; + } + sub_800E8AC(gUnknown_203B414->unkC[i], NULL, &gUnknown_203B414->unk8C[i], 0, NULL); + } + + sub_800E90C(&gDungeon->unk181e8.cameraPixelPos); + return ret; +} + +void sub_8042D7C(void) +{ + s32 i; + + if (gUnknown_203B414 == NULL) + return; + + for (i = 0; i < gUnknown_203B414->unk8; i++) { + if (sub_800E9A8(gUnknown_203B414->unkC[i])) { + sub_800DC14(gUnknown_203B414->unkC[i]); + } + } + sub_800DBBC(); + MemoryFree(gUnknown_203B414); + gUnknown_203B414 = NULL; +} + +void sub_8042DD4(s32 a0, Entity *a1, s32 a2) +{ + s32 i; + + for (i = 0; i < 3; i++) { + struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; + if (strPtr->unk0 == -1) { + strPtr->unk0 = a0; + strPtr->unkC = a1; + strPtr->unk4 = a2; + strPtr->unk8 = sub_800E6D8(a0); + return; + } + } +} + +static UNUSED bool32 sub_8042E1C(void) +{ + s32 i; + + for (i = 0; i < 3; i++) { + struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; + if (strPtr->unk0 != -1 && sub_800E9A8(strPtr->unk0)) { + return TRUE; + } + } + + return FALSE; +} + +void sub_8042E5C(void) +{ + s32 i; + + for (i = 0; i < 3; i++) { + struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; + if (strPtr->unk0 >= 0 && !sub_800E9A8(strPtr->unk0)) { + strPtr->unk0 = -1; + strPtr->unkC = NULL; + } + } +} + +void sub_8042E98(void) +{ + s32 i; + + for (i = 0; i < 3; i++) { + struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; + strPtr->unk0 = -1; + strPtr->unk4 = 0; + strPtr->unkC = NULL; + } +} + +void sub_8042EC8(Entity *a0, s32 a1) +{ + s32 i; + + for (i = 0; i < 3; i++) { + struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; + if (strPtr->unk0 >= 0 && strPtr->unkC == a0) { + DungeonPos sp8 = {a0->pixelPos.x / 256, a0->pixelPos.y / 256}; + DungeonPos sp4 = {0}; + EntityInfo *entInfo = GetEntInfo(a0); + + if (strPtr->unk8 != -1) { + sub_800569C(&sp4, + &a0->axObj, + strPtr->unk8); + } + + sub_800EB24(strPtr->unk0, &sp8, &sp4,a1, entInfo->action.direction); + } + } +} diff --git a/src/code_804267C.c b/src/code_804267C.c deleted file mode 100644 index d32435619..000000000 --- a/src/code_804267C.c +++ /dev/null @@ -1,427 +0,0 @@ -#include "global.h" -#include "structs/str_dungeon.h" -#include "code_800DAC0.h" -#include "code_800ED38.h" -#include "code_803E46C.h" -#include "code_803E668.h" -#include "code_8041AD0.h" -#include "code_804267C.h" -#include "code_8045A00.h" -#include "code_806CD90.h" -#include "dungeon.h" -#include "dungeon_engine.h" -#include "dungeon_leader.h" -#include "dungeon_map.h" -#include "dungeon_message.h" -#include "dungeon_music.h" -#include "dungeon_util.h" -#include "items.h" -#include "sprite.h" - -extern const u16 gUnknown_80F67DC[4]; -extern const u16 gUnknown_80F67E4[4]; -extern const s32 gUnknown_80F67EC[8]; -extern const u32 gUnknown_80F680C[8]; -extern const u16 gUnknown_80F682C[8]; -extern const u8 *gPtrFeralFoundItemMessage[]; - -extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2); -extern void sub_804178C(u32); -extern void sub_80416A4(DungeonPos *r0, u32 r1, bool8 r2); -extern void sub_80429A0(Entity *); -extern void sub_8042B34(u32, u32, u32); -extern bool8 sub_8042CC0(void); -extern void sub_8042D7C(void); -extern u8 GetFloorType(void); -extern bool8 sub_8045888(Entity *); -extern s32 sub_80416E0(PixelPos*, u32, bool8); -extern u32 sub_8041764(unkStruct_80416E0 *, bool8); -extern u32 sub_800E49C(); -extern void sub_800EF40(u8 r0, u8 r1); - -void sub_8042390(Entity *entity, Item *item) -{ - s32 sVar1; - s32 counter; - u8 id; - u32 uVar6; - DungeonPos asStack_24[4]; - DungeonPos local_14; - - if (sub_8042768(entity)) { - id = !ItemSticky(item) ? item->id : ITEM_NOTHING; - sub_800EF40(id, 0); - sub_800EF64(); - sub_803E708(4,0x42); - local_14.x = (entity->pixelPos).x / 256; - local_14.y = (entity->pixelPos).y / 256; - - sVar1 = (local_14.y - gDungeon->unk181e8.cameraPixelPos.y) / 2 + 1; - sub_8005700(asStack_24,&entity->axObj); - uVar6 = sub_800E49C(id,&local_14,asStack_24,0,sVar1); - for (counter = 0; counter < 1000; counter++) { - DungeonRunFrameActions(0x42); - if (!sub_800E9A8(uVar6)) { - break; - } - } - } -} - -void sub_804245C(Entity *entity, Item *item) -{ - s32 sVar1; - s32 counter; - u8 id; - u32 uVar6; - DungeonPos asStack_24[4]; - DungeonPos local_14; - - if (sub_8042768(entity)) { - id = !ItemSticky(item) ? item->id : ITEM_NOTHING; - sub_800EF64(); - sub_803E708(4,0x42); - local_14.x = (entity->pixelPos).x / 256; - local_14.y = (entity->pixelPos).y / 256; - - sVar1 = (local_14.y - gDungeon->unk181e8.cameraPixelPos.y) / 2 + 1; - sub_8005700(asStack_24,&entity->axObj); - uVar6 = sub_800E49C(id,&local_14,asStack_24,1,sVar1); - for (counter = 0; counter < 1000; counter++) { - DungeonRunFrameActions(0x42); - if (!sub_800E9A8(uVar6)) { - break; - } - } - } -} - - -s32 sub_8042520(Entity *a0) -{ - s32 i; - s32 uVar4; - DungeonPos pos; - u32 dir; - s32 iVar8; - unkStruct_80416E0 local_58; - unkStruct_2039DB0 u203; // Unused - PixelPos local_2c; - - if (sub_8045888(a0)) { - dir = GetEntInfo(a0)->action.direction; - pos.x = a0->pixelPos.x / 0x100; - pos.y = a0->pixelPos.y / 0x100; - - iVar8 = (pos.y - gDungeon->unk181e8.cameraPixelPos.y) / 2; - local_58.unk0 = 357; - local_58.unk4 = 0; - local_58.dir = dir; - local_58.x = pos.x; - local_58.y = pos.y; - local_58.unk10 = 0; - local_58.unk12 = 0; - local_58.unk14 = -1; - local_58.unk18 = iVar8; - sub_8004E8C(&u203); - uVar4 = sub_8041764(&local_58, 0); - - for (i = 0; i < 6; i++) { - sub_800E8AC(uVar4, &pos, 0, iVar8, 0); - DungeonRunFrameActions(66); - pos.x += gAdjacentTileOffsets[dir].x * 4; - pos.y += gAdjacentTileOffsets[dir].y * 4; - iVar8 = (pos.y - gDungeon->unk181e8.cameraPixelPos.y) / 2; - } - - sub_800DBBC(); - local_2c.x = pos.x * 0x100; - local_2c.y = pos.y * 0x100; - uVar4 = sub_80416E0(&local_2c, 416, TRUE); - } - else - { - uVar4 = -1; - } - return uVar4; -} - -// This func plays the appropriate ascend/descend SFX for stairs depending on the direction -void PlayStairsSound(void) -{ - u32 songIndex; - - songIndex = 997; - - switch (GetFloorType()) { - case 0: - default: - songIndex = IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id) ? 340 : 341; - break; - case 1: - case 2: - break; - } - - PlaySoundEffect(songIndex); -} - -void sub_80426C8(u32 a0, u32 a1) -{ - if (a1 == 3) - DungeonStartNewBGM(0); - - if (a0 != 4) - PlaySoundEffect(gUnknown_80F67DC[a1]); - else - PlaySoundEffect(gUnknown_80F67E4[a1]); - - sub_8042B34(a0, a1, 0x80); - - while (sub_8042CC0()) - DungeonRunFrameActions(0x46); - - sub_8042D7C(); - LoadDungeonMapPalette(); - sub_8052210(1); -} - -void sub_8042730(Entity *a0, void *unused) -{ - s32 i; - - sub_806CDD4(a0, 8, 8); - for (i = 0; i < 100; i++) { - DungeonRunFrameActions(0x51); - if ((a0->axObj.axdata.sub1.unk10 & 3) != 0 || a0->axObj.unk43_animId2 != 8) - break; - } -} - -bool8 sub_8042768(Entity* pokemon) -{ - if (!pokemon->isVisible) - return FALSE; - if (gDungeon->unk181e8.blinded) { - if (gDungeon->unk181e8.cameraTarget == pokemon) - return TRUE; - else - return FALSE; - } - return sub_8045888(pokemon); -} - -void sub_80427AC(void) -{ - Entity *entity; - EntityInfo *enInfo; - s32 i; - - for (i = 0; i < 20; i++) { - entity = gDungeon->activePokemon[i]; - if (EntityIsValid(entity)) { - enInfo = GetEntInfo(entity); - if (enInfo->unkF3) { - enInfo->unkF3 = FALSE; - sub_80429A0(entity); - if (!enInfo->isNotTeamMember) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); - DisplayDungeonLoggableMessageTrue(entity, *gPtrFeralFoundItemMessage); - } - } - } - } -} - -void sub_8042818(u8 a0, bool8 a1) -{ - Entity *en; - - en = gDungeon->unk181e8.cameraTarget; - if (en == NULL) - en = GetLeader(); - - if (gUnknown_80F682C[a0] != 997) - sub_80421C0(en, gUnknown_80F682C[a0]); - - if (gUnknown_80F67EC[a0] < 0) - return; - - if (a1 && !IsBossFight()) - sub_804151C(en, gUnknown_80F67EC[a0], 0); - else - sub_804151C(en, gUnknown_80F680C[a0], 0); -} - -void sub_80428A0(Entity *r0) -{ - sub_804151C(r0, 0x29, 1); -} - -void sub_80428B0(Entity *r0) -{ - sub_804151C(r0, 0x1a9, 0); -} - - -void sub_80428C4(Entity *r0) -{ - sub_804151C(r0, 0x1a9, 0); -} - - -void sub_80428D8(Entity *r0) -{ - sub_804151C(r0, 0x1a9, 0); -} - -void sub_80428EC(Entity *r0) -{ - sub_804151C(r0, 0x1a9, 0); -} - -void sub_8042900(Entity *r0) -{ - sub_804151C(r0, 0xD4 << 1, 0); -} - -void ShowVisualFlags(Entity *r0) -{ - sub_804151C(r0, 0x29, 0); -} - -void sub_8042920(Entity *r0) -{ - sub_804151C(r0, 0x48, 0); -} - -void sub_8042930(Entity *r0) -{ - sub_804151C(r0, 0xD3 << 1, 1); -} - -void sub_8042940(Entity *r0) -{ - sub_804151C(r0, 0xC7 << 1, 0); -} - -void sub_8042950(Entity *r0) -{ - sub_804151C(r0, 0xD8 << 1, 1); - sub_803E708(0xA, 0x42); -} - -void sub_8042968(Entity *r0) -{ - sub_804151C(r0, 0xD4 << 1, 0); -} - -void sub_8042978(Entity *r0) -{ - sub_804151C(r0, 0x1a9, 0); -} - -void sub_804298C(Entity *r0) -{ - sub_804151C(r0, 0x1a9, 0); -} - -void sub_80429A0(Entity *r0) -{ - sub_804151C(r0, 0x199, 0); -} - -void sub_80429B4(Entity *r0) -{ - sub_804151C(r0, 0x1ab, 0); -} - -void sub_80429C8(Entity *r0) -{ - sub_804151C(r0, 0x4, 1); -} - -void sub_80429D8(Entity *r0) -{ - sub_804151C(r0, 0x8F << 1, 1); -} - -void sub_80429E8(Entity *r0) -{ - sub_804151C(r0, 0x11d, 1); -} - -void sub_80429FC(DungeonPos *r0) -{ - sub_80416A4(r0, 0x19E, TRUE); - sub_80421C0(NULL, 0xD4); -} - -void sub_8042A14(DungeonPos *r0) -{ - sub_80416A4(r0, 0x36, TRUE); -} - -void sub_8042A24(Entity *r0) -{ - sub_804151C(r0, 0x15, 1); -} - -void sub_8042A34(DungeonPos *r0) -{ - sub_80416A4(r0, 0x13E, FALSE); -} - -void sub_8042A44(Entity *r0) -{ - sub_804151C(r0, 0xDA << 1, 1); -} - -void sub_8042A54(DungeonPos *r0) -{ - sub_80416A4(r0, 0x37, TRUE); -} - -void sub_8042A64(DungeonPos *r0) -{ - sub_80416A4(r0, 0x29, TRUE); -} - -void sub_8042A74(Entity *r0) -{ - sub_804151C(r0, 0x18, 1); -} - -void sub_8042A84(s16 param_1, Entity *entity, u32 param_3) -{ - s32 iVar3; - s32 r6; - s32 param_1_s16; - - param_1_s16 = param_1; - - r6 = IntToF248_2(2).raw; - if (sub_8042768(entity)) { - sub_804151C(entity,param_1_s16,0); - sub_803E708(param_3,0x42); - do { - if (entity->unk1C.raw > IntToF248_2(199.999).raw) break; - DungeonRunFrameActions(0x42); - entity->unk1C.raw += + r6; - r6 += IntToF248_2(1).raw; - iVar3 = (entity->pixelPos.y - entity->unk1C.raw) / 256; - } while (-8 <= iVar3 - gDungeon->unk181e8.cameraPixelPos.y); - entity->isVisible = 0; - sub_804178C(0); - } -} - -void sub_8042B0C(Entity *entity) -{ - sub_8042A84(0x13e, entity, 5); -} - -void sub_8042B20(Entity *entity) -{ - sub_8042A84(0x1BC, entity, 0xE); -} diff --git a/src/code_8044CC8.c b/src/code_8044CC8.c deleted file mode 100644 index 82db49574..000000000 --- a/src/code_8044CC8.c +++ /dev/null @@ -1,261 +0,0 @@ -#include "global.h" -#include "constants/dungeon_action.h" -#include "structs/str_item_text.h" -#include "code_8044CC8.h" -#include "dungeon_generation.h" -#include "dungeon_items.h" -#include "dungeon_map_access.h" -#include "dungeon_util.h" -#include "items.h" - -// size: 0x8 -typedef struct unkStr_80F7C54 -{ - s32 unk0; - u8 *text; -} unkStr_80F7C54; - -EWRAM_DATA unkStruct_202EE44 gDungeonSubMenu[10] = {0}; - -extern s32 gDungeonSubMenuItemsCount; - -extern u16 gUnknown_80F6964[NUM_ITEM_CATEGORIES]; -extern u8 gUnknown_80F697C[]; -extern u8 *gUnknown_80F7C50[10]; -extern const unkStr_80F7C54 gUnknown_80F7C54[65]; -extern u8 *gUnknown_80F91EC[]; -extern bool8 sub_8045888(Entity *); -extern u8 GetFloorType(void); - -Item * sub_8044CC8(Entity *param_1, ActionParameter *param_2, UNUSED s32 a3) -{ - const Tile *tile; - Item *item; - EntityInfo *info; - - if ((u8)(param_2->actionUseIndex - 1) < INVENTORY_SIZE) { - item = &gTeamInventoryRef->teamItems[param_2->actionUseIndex - 1]; - } - else if (param_2->actionUseIndex == 0x80) { - tile = GetTile((param_2->itemPos).x,(param_2->itemPos).y); - item = GetItemData(tile->object); - } - else { - if (param_2->actionUseIndex == 0x81) { - info = GetEntInfo(param_1); - } - else { - u8 id = param_2->actionUseIndex - 0x90; - if (3 < id) { - return NULL; - } - info = GetEntInfo(gDungeon->teamPokemon[param_2->actionUseIndex - 0x90]); - } - item = &info->heldItem; - } - return item; -} - -bool8 sub_8044D40(ActionContainer *param_1,s32 index) -{ - Item *item; - ActionParameter *puVar1; - - puVar1 = ¶m_1->actionParameters[index]; - if ((u8)(puVar1->actionUseIndex - 1) < INVENTORY_SIZE) { - item = &gTeamInventoryRef->teamItems[puVar1->actionUseIndex - 1]; - item->id = ITEM_NOTHING; - item->quantity = 0; - item->flags = 0; - FillInventoryGaps(); - } - else { - if (puVar1->actionUseIndex != 0x80) { - return FALSE; - } - RemoveItemFromDungeonAt(&puVar1->itemPos,1); - } - return TRUE; -} - -Item *sub_8044D90(Entity *entity, s32 index, s32 unused) -{ - EntityInfo *info = GetEntInfo(entity); - return sub_8044CC8(entity, &info->action.actionParameters[index], unused); -} - -Entity *sub_8044DA4(Entity *entity, s32 index) -{ - EntityInfo *info = GetEntInfo(entity); - return gDungeon->teamPokemon[info->action.actionParameters[index].actionUseIndex]; -} - -u16 sub_8044DC8(Item *param_1) -{ - if (param_1->id == ITEM_SWITCH_BOX) { - return 0x35; - } - else { - return gUnknown_80F6964[GetItemCategory(param_1->id)]; - } -} - -void sub_8044DF0(Entity *entity, s32 index, u32 unused) -{ - Item *item; - EntityInfo *info; - - info = GetEntInfo(entity); - item = sub_8044D90(entity,index,unused); - if ((info->action).actionParameters[0].actionUseIndex == 0x80) { - RemoveItemFromDungeonAt(&(info->action).actionParameters[0].itemPos,1); - } - else { - item->id = ITEM_NOTHING; - item->quantity = 0; - item->flags = 0; - FillInventoryGaps(); - } -} - - -void sub_8044E24(Entity *entity,int index,u32 unused) -{ - Item *itemPtr; - EntityInfo *info; - DungeonPos *pos; - Item item; - - itemPtr = sub_8044D90(entity,index,unused); - info = GetEntInfo(entity); - if (!IsHMItem(itemPtr->id)) { - if (GetItemCategory(itemPtr->id) == CATEGORY_TMS_HMS) { - if (info->action.actionParameters[index].actionUseIndex == 0x80) { - item = *itemPtr; - pos = &info->action.actionParameters[index].itemPos; - RemoveItemFromDungeonAt(pos,1); - item.quantity = itemPtr->id - 125; - item.id = ITEM_TM_USED_TM; - AddItemToDungeonAt(pos,&item,1); - } - else { - itemPtr->quantity = itemPtr->id - 125; - itemPtr->id = ITEM_TM_USED_TM; - } - } - else { - sub_8044DF0(entity,index,unused); - } - } -} - -// Similar to sub_8044BA8 -const u8 *GetDungeonSubMenuItemString(s32 param_1) -{ - u16 actionId = gDungeonSubMenu[param_1].actionId; - - if (actionId == ACTION_STAIRS && GetFloorType() == FLOOR_TYPE_RESCUE) { - return *gUnknown_80F91EC; - } - else { - if (!AreStringsDifferent(gUnknown_80F7C50[actionId << 1], gUnknown_80F697C)) { - return gActions[GetItemActionType(gDungeonSubMenu[param_1].unk2)].useText; - } - else { - return gUnknown_80F7C50[actionId << 1]; - } - } -} - -bool8 CanSubMenuItemBeChosen(s32 itemId) -{ - if (itemId < 0) - return FALSE; - else - return gDungeonSubMenu[itemId].canBeChosen; -} - -void AddActionToDungeonSubMenu(u16 actionId, u8 param_2) -{ - int index; - - if (gDungeonSubMenuItemsCount < 10) { - for(index = 0; index < gDungeonSubMenuItemsCount; index++) - { - if (gDungeonSubMenu[index].actionId == actionId) { - return; - } - } - gDungeonSubMenu[gDungeonSubMenuItemsCount].actionId = actionId; - gDungeonSubMenu[gDungeonSubMenuItemsCount].unk2 = param_2; - gDungeonSubMenu[gDungeonSubMenuItemsCount].canBeChosen = TRUE; - gDungeonSubMenuItemsCount++; - } -} - -s32 ActionToDungeonSubMenuId(u16 actionId) -{ - int index; - - for(index = 0; index < gDungeonSubMenuItemsCount; index++) - { - if (gDungeonSubMenu[index].actionId == actionId) { - return index; - } - } - return -1; -} - -void SetActionUnusableInDungeonSubMenu(u16 actionId) -{ - int index; - - for(index = 0; index < gDungeonSubMenuItemsCount; index++) - { - if (gDungeonSubMenu[index].actionId == actionId) { - gDungeonSubMenu[index].canBeChosen = FALSE; - return; - } - } -} - -bool8 IsNotAttacking(Entity *param_1, bool8 param_2) -{ - EntityInfo *info; - u16 *action; - - info = GetEntInfo(param_1); - action = &(info->action).action; - if ((param_2 == 0) || (sub_8045888(param_1))) - { - if(*action == ACTION_NOTHING) - return TRUE; - if (*action == ACTION_WALK) - return TRUE; - if (*action == ACTION_PASS_TURN) - return TRUE; - if (*action == ACTION_UNK5) - return TRUE; - return FALSE; - } - else { - return TRUE; - } -} - -void sub_8045064(void) -{ - s32 i, j; - - for (i = 0; i < gDungeonSubMenuItemsCount; i++) { - for (j = i + 1; j < gDungeonSubMenuItemsCount; j++) { - unkStruct_202EE44 temp; - unkStruct_202EE44 *iPtr = &gDungeonSubMenu[i]; - unkStruct_202EE44 *jPtr = &gDungeonSubMenu[j]; - - if (gUnknown_80F7C54[iPtr->actionId].unk0 > gUnknown_80F7C54[jPtr->actionId].unk0) { - SWAP(*iPtr, *jPtr, temp); - } - } - } -} diff --git a/src/code_80450F8.c b/src/code_80450F8.c deleted file mode 100644 index 6428ade4a..000000000 --- a/src/code_80450F8.c +++ /dev/null @@ -1,291 +0,0 @@ -#include "global.h" -#include "structs/str_dungeon.h" -#include "code_803E724.h" -#include "code_80450F8.h" -#include "dungeon_map_access.h" -#include "dungeon_range.h" -#include "dungeon_util.h" -#include "tile_types.h" -#include "pokemon.h" -#include "code_805D8C8.h" - -extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE]; -extern u8 gUnknown_202EE76[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE]; -extern void sub_8045ACC(void); -extern s32 GetMonsterApparentID(Entity *pokemon, s32 id); - -Entity *sub_80453AC(s32 _species) -{ - s32 i; - s32 species = (s16) _species; - s32 validId = -1; - s32 bodySize = GetBodySize(species); - - for (i = 0; i <= MAX_TEAM_BODY_SIZE - bodySize; i++) { - s32 j; - for (j = 0; j < bodySize; j++) { - if (gUnknown_202EE70[i + j] != 0) - break; - } - - if (j == bodySize) { - validId = i; - break; - } - } - - if (validId != -1) { - for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - s32 apparentId; - s32 j; - Entity *entity = gDungeon->teamPokemon[i]; - - if (!EntityIsValid(entity)) { - entity->type = ENTITY_MONSTER; - entity->unk24 = i; - entity->axObj.info.monster = &gDungeon->unk69C[i]; - entity->axObj.info.monster->id = species; - apparentId = (s16) GetMonsterApparentID(NULL, species); - entity->axObj.info.monster->apparentID = apparentId; - entity->axObj.info.monster->isNotTeamMember = FALSE; - - entity->axObj.spriteFile = GetSpriteData((s16)GetMonsterApparentID(NULL, species)); - entity->axObj.unk40_maybeAnimTimer = (validId * 16) + 0x40; - entity->axObj.unk42_animId1 = 7; - entity->axObj.unk44_direction1 = 0; - entity->axObj.unk43_animId2 = 0xFF; - entity->axObj.unk45_orientation = 1; - entity->axObj.unk47 = 1; - - entity->unk1C = IntToF248(0); - sub_8045ACC(); - entity->axObj.info.monster->unk167 = validId; - entity->axObj.info.monster->unk168 = bodySize; - - for (j = 0; j < bodySize; j++) { - gUnknown_202EE70[validId] = 1; - validId++; - } - - entity->spawnGenID = gDungeon->unk644.unk24++; - return entity; - } - } - } - - return NULL; -} - -Entity *sub_804550C(s32 _species) -{ - s32 i; - s32 species = (s16) _species; - s32 validId = -1; - s32 bodySize = GetBodySize(species); - - for (i = 0; i <= DUNGEON_MAX_WILD_POKEMON_BODY_SIZE - bodySize; i++) { - s32 j; - for (j = 0; j < bodySize; j++) { - if (gUnknown_202EE76[i + j] != 0) - break; - } - - if (j == bodySize) { - validId = i; - break; - } - } - - if (validId != -1) { - for (i = 0; i < DUNGEON_MAX_WILD_POKEMON_BODY_SIZE; i++) { - s32 j; - Entity *entity = gDungeon->wildPokemon[i]; - - if (!EntityIsValid(entity)) { - entity->type = ENTITY_MONSTER; - entity->unk24 = i; - entity->unk22 = 0; - entity->axObj.info.monster = &gDungeon->unkEBC[i]; - entity->axObj.info.monster->id = species; - entity->axObj.info.monster->apparentID = GetMonsterApparentID(NULL, species); - entity->axObj.info.monster->isNotTeamMember = TRUE; - - entity->axObj.spriteFile = GetSpriteData((s16)GetMonsterApparentID(NULL, species)); - entity->axObj.unk40_maybeAnimTimer = ((validId + 6) * 16) + 0x40; - entity->axObj.unk42_animId1 = 7; - entity->axObj.unk44_direction1 = 0; - entity->axObj.unk43_animId2 = 0xFF; - entity->axObj.unk45_orientation = 1; - entity->axObj.unk47 = 1; - - entity->unk1C = IntToF248(0); - - entity->axObj.info.monster->unk167 = validId; - entity->axObj.info.monster->unk168 = bodySize; - - for (j = 0; j < bodySize; j++) { - gUnknown_202EE76[validId] = 1; - validId++; - } - - sub_8045ACC(); - - entity->spawnGenID = gDungeon->unk644.unk24++; - return entity; - } - } - } - - return NULL; -} - -Entity *SpawnTrap(u8 trapID, DungeonPos *pos, u8 c) -{ - Entity *entity; - s32 i; - - for (i = 0; i < DUNGEON_MAX_TRAPS; i++) { - entity = gDungeon->traps[i]; - if (!EntityIsValid(entity)) { - entity->type = ENTITY_TRAP; - entity->axObj.info.trap = &gDungeon->unk3908[i]; - entity->axObj.info.trap->id = trapID; - entity->axObj.info.trap->unk1 = c; - - entity->unk1C = IntToF248(0); - entity->unk22 = 0; - entity->pos = *pos; - entity->spawnGenID = 0; - return entity; - } - } - - return NULL; -} - -Entity *sub_8045708(DungeonPos *pos) -{ - s32 i; - Entity *ent; - - if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA - && (GetTileMut(pos->x, pos->y)->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { - return NULL; - } - - for (i = 0; i < DUNGEON_MAX_ITEMS; i++) { - ent = gDungeon->items[i]; - if (!EntityIsValid(ent)) { - ent->type = ENTITY_ITEM; - ent->axObj.info.item = &gDungeon->unk3804[i]; - - ent->pos = *pos; - SetEntityPixelPos(ent, ((pos->x * 24) + 4) * 0x100, ((pos->y * 24) + 4) * 0x100); - ent->spawnGenID = 0; - ent->unk22 = 0; - ent->unk1C = IntToF248(0); - return ent; - } - } - - return NULL; -} - -void sub_80457DC(Entity* ent) -{ - ent->type = ENTITY_UNK_5; - ent->pos.x = 0; - ent->pos.y = 0; - SetEntityPixelPos(ent, 0, 0); - ent->spawnGenID = 0; - ent->unk22 = 0; -} - -bool8 sub_8045804(Entity *ent) -{ - UnkDungeonGlobal_unk181E8_sub* saveTyping; - Entity* camTarget; - EntityInfo *monInfo; - - switch (GetEntityType(ent)) { - case ENTITY_MONSTER: { - if (ent->isVisible) { - saveTyping = &gDungeon->unk181e8; - camTarget = saveTyping->cameraTarget; - monInfo = GetEntInfo(ent); - - if (!monInfo->isNotTeamMember) - return TRUE; - - if (!saveTyping->showInvisibleTrapsMonsters && monInfo->invisibleClassStatus.status == STATUS_INVISIBLE) - return FALSE; - - if (saveTyping->allTilesRevealed || saveTyping->unk1820D) - return TRUE; - - if (camTarget != NULL) - return IsPositionActuallyInSight(&saveTyping->cameraPos, &ent->pos); - } - return FALSE; - } - /*case ENTITY_TRAP: - case ENTITY_ITEM: - case ENTITY_UNK_4:*/ - default: { - return TRUE; - } - case ENTITY_NOTHING: - case ENTITY_UNK_5: { - return FALSE; - } - } -} - -bool8 sub_8045888(Entity *ent) -{ - if (ent->isVisible) { - s32 x = (ent->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x; - s32 y = (ent->pixelPos.y / 256) - gDungeon->unk181e8.cameraPixelPos.y; - - if (x >= -32 && y >= -32 && x <= 272 && y <= 192) { - UnkDungeonGlobal_unk181E8_sub *saveTyping = &gDungeon->unk181e8; - - switch (GetEntityType(ent)) { - case ENTITY_ITEM: { - if (!saveTyping->showAllFloorItems && !sub_803F428(&ent->pos)) - return FALSE; - break; - } - case ENTITY_MONSTER: { - EntityInfo *monInfo = GetEntInfo(ent); - - if (monInfo->isNotTeamMember) { - if (!gDungeon->unk181e8.showInvisibleTrapsMonsters && monInfo->invisibleClassStatus.status == STATUS_INVISIBLE) - return FALSE; - - if (!saveTyping->unk1820D && !sub_803F428(&ent->pos)) - return FALSE; - } - break; - } - case ENTITY_TRAP: { - if (!gDungeon->unk181e8.showInvisibleTrapsMonsters && !ent->isVisible) - return FALSE; - break; - } - case ENTITY_NOTHING: - case ENTITY_UNK_5: { - return FALSE; - } - case ENTITY_UNK_4: - default: { - break; - } - } - - return TRUE; - } - } - - return FALSE; -} diff --git a/src/code_8045A00.c b/src/code_8045A00.c deleted file mode 100644 index a4ffb2d67..000000000 --- a/src/code_8045A00.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "global.h" -#include "code_8045A00.h" -#include "constants/item.h" -#include "dungeon_items.h" -#include "dungeon_map_access.h" -#include "dungeon_random.h" -#include "dungeon_util.h" -#include "dungeon_leader.h" -#include "dungeon_message.h" -#include "dungeon_music.h" -#include "dungeon_map.h" -#include "dungeon_ai_targeting.h" -#include "string_format.h" -#include "items.h" -#include "trap.h" -#include "status_checks_1.h" -#include "structs/map.h" -#include "structs/str_dungeon.h" - -void sub_8045BF8(u8 *, Item *); - -extern u8 *gUnknown_80FE6F4[]; - -void sub_8045ACC(void) -{ - Entity *entity; - s32 index; - s32 pokeCount; - - pokeCount = 0; - - for(index = 0; index < MAX_TEAM_MEMBERS; index++) - { - entity = gDungeon->teamPokemon[index]; - if (EntityIsValid(entity)) { - gDungeon->activePokemon[pokeCount] = entity; - pokeCount++; - } - } - - for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) - { - entity = gDungeon->wildPokemon[index]; - if (EntityIsValid(entity)) { - gDungeon->activePokemon[pokeCount] = entity; - pokeCount++; - } - } - for (; pokeCount < DUNGEON_MAX_POKEMON; pokeCount++) { - gDungeon->activePokemon[pokeCount] = NULL; - } -} - -s32 GetTeamMemberEntityIndex(Entity *pokemon) -{ - Entity *entity; - s32 index; - - for(index = 0; index < MAX_TEAM_MEMBERS; index++) - { - entity = gDungeon->teamPokemon[index]; - if (pokemon == entity) - return index; - } - return -1; -} - -void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3) -{ - switch(GetEntityType(entity)) - { - case ENTITY_MONSTER: - SetMessageArgument_2(buffer, GetEntInfo(entity), param_3); - break; - case ENTITY_ITEM: - sub_8045BF8(buffer, GetItemData_1(entity)); - break; - case ENTITY_TRAP: - GetTrapName(buffer, GetTrapData_1(entity)->id); - break; - default: - strcpy(buffer, *gUnknown_80FE6F4); - break; - } -} diff --git a/src/code_8046CE4.c b/src/code_8046CE4.c new file mode 100644 index 000000000..b855cede3 --- /dev/null +++ b/src/code_8046CE4.c @@ -0,0 +1,39 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "dungeon_items.h" +#include "dungeon_config.h" +#include "structs/dungeon_entity.h" + +// Decompile code_8046CE4.s from bottom instead of top and put functions before sub_8047930 + +bool8 sub_8047930(Entity *pokemon, Entity *target) +{ + bool8 flag; + + if (((GetEntInfo(target)->shopkeeper == TRUE) || + (GetEntInfo(target)->monsterBehavior == BEHAVIOR_DIGLETT)) || (GetEntInfo(target)->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { + return FALSE; + } + else { + if(DungeonRandInt(100) < gUnknownDungeonChance) + flag = TRUE; + else + flag = FALSE; + if (GetEntityType(pokemon) == ENTITY_MONSTER) { + if (HasHeldItem(pokemon, ITEM_WHIFF_SPECS)) { + flag = FALSE; + } + else { + if (HasHeldItem(pokemon, ITEM_LOCKON_SPECS)) { + flag = TRUE; + } + } + } + if ((GetEntityType(target) == ENTITY_MONSTER) && (HasHeldItem(target, ITEM_DODGE_SCARF))) { + flag = FALSE; + } + } + return flag; +} diff --git a/src/code_8066D04.c b/src/code_8066D04.c index 7a6a0b22b..b70ae2035 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -7,24 +7,23 @@ #include "code_803E724.h" #include "code_8041AD0.h" #include "code_8044CC8.h" -#include "code_8045A00.h" #include "code_8066D04.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "code_807CD9C.h" #include "code_8084778.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" -#include "dungeon_engine.h" +#include "run_dungeon.h" #include "dungeon_items.h" #include "dungeon_leader.h" #include "dungeon_map_access.h" #include "dungeon_message.h" #include "dungeon_misc.h" #include "dungeon_move.h" -#include "dungeon_movement.h" +#include "dungeon_move_util.h" +#include "dungeon_logic.h" #include "dungeon_music.h" #include "dungeon_random.h" +#include "dungeon_strings.h" #include "dungeon_util.h" #include "friend_area.h" #include "input.h" @@ -35,54 +34,10 @@ #include "pokemon_3.h" #include "position_util.h" #include "sprite.h" -#include "status_checks_1.h" #include "string_format.h" #include "text_1.h" #include "trap.h" -extern u8 *gUnknown_80F8BE0[]; -extern u8 *gUnknown_80FF76C[]; -extern u8 *gItemStickyCannotMove1[]; -extern u8 *gItemStickyCannotMove2[]; -extern u8 *gItemStickyCannotEquip[]; -extern u8 *gMonTookAndReturnedItem[]; -extern u8 *gUnknown_80F8CE4[]; -extern u8 *gUnknown_80F8CE8[]; -extern u8 *gUnknown_80F8D04[]; -extern u8 *gUnknown_80F8D20[]; -extern u8 *gUnknown_80F8D44[]; -extern u8 *gUnknown_80F8D60[]; -extern u8 *gUnknown_80F8D7C[]; -extern u8 *gUnknown_80F8DB4[]; -extern u8 *gUnknown_80F8DE0[]; -extern u8 *gUnknown_80F8E04[]; -extern u8 *gUnknown_80F8E28[]; -extern u8 *gItemStickyCannotMove3[]; -extern u8 *gNothingCanBePutDownHere[]; -extern u8 *gUnknown_80F8E2C[]; -extern u8 *gNoExchangesHere[]; -extern u8 *gSwappedGroundItem[]; -extern const u8 *const gMonThrewItem2; -extern const u8 *const gMonThrewItem1; -extern const u8 *const gCannotFarewell; -extern const u8 *const gSayFarewellQ; -extern const u8 *const gUnknown_80FDFB8; -extern const u8 *const gUnknown_80F913C; -extern const u8 *const gCannotTalk; -extern const u8 *const gUnknown_80FE008; -extern const u8 *const gUnknown_80FDF74; -extern const u8 *const gUnknown_80FF674; -extern const u8 *const gUnknown_80F9114; -extern const u8 *const gMonDisappointedAndLeft; -extern const u8 *const gSendMonBackQ; -extern const u8 *const gSendMonBackWithItemQ; -extern const u8 *const gMonWentBack; -extern const u8 *const gMonCringing; -extern const u8 *const gMonParalyzed; -extern const u8 *const gUnknown_80FC690; - -extern s32 gDungeonSubMenuItemsCount; - extern void sub_8071DA4(Entity *); extern void sub_806A1B0(Entity *); extern void sub_8057588(Entity * pokemon, u8 param_2); @@ -131,7 +86,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(gFormatBuffer_Items[0],itemPtr); - LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotEquip); + LogMessageByIdWithPopupCheckUser(param_1,gItemStickyCannotEquip); return; } itemPtr->flags &= ~(ITEM_FLAG_SET); @@ -141,22 +96,22 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2) PlaySoundEffect(0x133); if (param_2 != 0) { if ((item->flags & ITEM_FLAG_STICKY)) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D04); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8D04); } else { if (GetItemCategory(item->id) == CATEGORY_THROWN_LINE) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE4); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8CE4); } else { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE8); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8CE8); } } } item->flags |= ITEM_FLAG_SET; if (((item->flags & ITEM_FLAG_STICKY)) && (param_2 != 0)) { sub_8045BF8(gFormatBuffer_Items[0],item); - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8BE0); } } @@ -171,14 +126,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(gFormatBuffer_Items[0],item); - LogMessageByIdWithPopupCheckUser(entity,*gItemStickyCannotEquip); + LogMessageByIdWithPopupCheckUser(entity,gItemStickyCannotEquip); return; } item->flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],item); PlaySoundEffect(0x133); if (enableMessage) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8D20); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8D20); } } } @@ -207,7 +162,7 @@ void HandleGiveItemAction(Entity *param_1) if ((!bVar3) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) { sub_8045BF8(gFormatBuffer_Items[1],item); - LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove2); + LogMessageByIdWithPopupCheckUser(param_1,gItemStickyCannotMove2); } else { @@ -215,7 +170,7 @@ void HandleGiveItemAction(Entity *param_1) if (((info2->heldItem).flags & ITEM_FLAG_EXISTS)) { if (((info2->heldItem).flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[1],&info2->heldItem); - LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove1); + LogMessageByIdWithPopupCheckUser(param_1,gItemStickyCannotMove1); return; } item1 = (info2->heldItem); @@ -233,9 +188,9 @@ void HandleGiveItemAction(Entity *param_1) sub_8045BF8(gFormatBuffer_Items[0],&item2); sub_8045BF8(gFormatBuffer_Items[1],&item1); PlaySoundEffect(0x14d); - LogMessageByIdWithPopupCheckUser(param_1,*gMonTookAndReturnedItem); + LogMessageByIdWithPopupCheckUser(param_1,gMonTookAndReturnedItem); if ((item2.flags & ITEM_FLAG_STICKY)) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8BE0); } } else { @@ -245,9 +200,9 @@ void HandleGiveItemAction(Entity *param_1) info2->heldItem = item3; sub_8045BF8(gFormatBuffer_Items[0],&item3); PlaySoundEffect(0x14d); - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D44); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8D44); if ((item3.flags & ITEM_FLAG_STICKY)) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8BE0); } } sub_806A6E8(entity); @@ -272,13 +227,13 @@ void HandleTakeItemAction(Entity *param_1) info = GetEntInfo(entity); heldItem = &info->heldItem; if (ItemExists(&gTeamInventoryRef->teamItems[ITEM_POWER_BAND])) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D60); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8D60); } else { if (ItemSticky(heldItem)) { sub_8045BF8(gFormatBuffer_Items[0],heldItem); - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8BE0); } else { @@ -289,7 +244,7 @@ void HandleTakeItemAction(Entity *param_1) ZeroOutItem(heldItem); AddItemToInventory(&item); PlaySoundEffect(0x14d); - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D7C); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8D7C); sub_806A6E8(entity); if (sub_80706A4(entity,&entity->pos) != 0) { WarpTarget(param_1,entity,0,0); @@ -317,11 +272,11 @@ void sub_8066BD4(Entity *param_1) if (heldItem->flags & ITEM_FLAG_STICKY) { sub_8045BF8(gFormatBuffer_Items[0],heldItem); - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8BE0); } else if ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) { sub_8045BF8(gFormatBuffer_Items[0],item); - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8BE0); } else { @@ -334,7 +289,7 @@ void sub_8066BD4(Entity *param_1) info->heldItem = *item; *item = temp; PlaySoundEffect(0x14d); - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8DB4); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80F8DB4); if (sub_80706A4(entity,&entity->pos) != 0) { WarpTarget(param_1,entity,0,0); } @@ -360,37 +315,37 @@ void HandlePlaceItemAction(Entity *entity) sub_8045BF8(gFormatBuffer_Items[0],item); if (info->action.actionParameters[0].actionUseIndex == 0x80) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8DE0); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8DE0); } else if (info->action.actionParameters[0].actionUseIndex < 0x15 && (item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8BE0); } else if (info->action.actionParameters[0].actionUseIndex == 0x81 && (item->flags & ITEM_FLAG_STICKY)) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8BE0); } else { const Tile *tile = GetTile(entity->pos.x, entity->pos.y); if ((tile->terrainType & TERRAIN_TYPE_STAIRS)) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E04); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8E04); } else if (GetTerrainType(tile) != TERRAIN_TYPE_NORMAL) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E04); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8E04); } else if (tile->object != NULL) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E04); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8E04); } else { item->flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],item); if (AddItemToDungeonAt(&entity->pos,item,1) == 0) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E04); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8E04); } else { ZeroOutItem(item); FillInventoryGaps(); PlaySoundEffect(0x14d); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E28); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8E28); sub_807AB38(entity,gDungeon->forceMonsterHouse); } } @@ -405,20 +360,20 @@ void sub_8066E14(Entity *entity) item[1] = sub_8044D90(entity,1,6); if (info->action.actionParameters[0].actionUseIndex != 0x80) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E2C); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8E2C); } else if (info->action.actionParameters[1].actionUseIndex < 0x15 && (item[1]->flags & ITEM_FLAG_SET) && (item[1]->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[0],item[1]); - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8BE0); } else if (info->action.actionParameters[1].actionUseIndex == 0x81 && ItemSticky(item[1])) { sub_8045BF8(gFormatBuffer_Items[1],item[1]); - LogMessageByIdWithPopupCheckUser(entity,*gItemStickyCannotMove3); + LogMessageByIdWithPopupCheckUser(entity,gItemStickyCannotMove3); } else { const Tile *tile = GetTile((entity->pos).x,(entity->pos).y); if (tile->object != NULL && GetEntityType(tile->object) != ENTITY_ITEM) { - LogMessageByIdWithPopupCheckUser(entity,*gNoExchangesHere); + LogMessageByIdWithPopupCheckUser(entity,gNoExchangesHere); } else { Item newItems[2]; @@ -431,7 +386,7 @@ void sub_8066E14(Entity *entity) RemoveItemFromDungeonAt(&info->action.actionParameters[0].itemPos,1); ZeroOutItem(item[1]); if (!AddItemToDungeonAt(&info->action.actionParameters[0].itemPos,&newItems[1],1)) { - LogMessageByIdWithPopupCheckUser(entity,*gNothingCanBePutDownHere); + LogMessageByIdWithPopupCheckUser(entity,gNothingCanBePutDownHere); } else { if (info->action.actionParameters[1].actionUseIndex == 0x81) { @@ -445,7 +400,7 @@ void sub_8066E14(Entity *entity) sub_8045BF8(gFormatBuffer_Items[0],&newItems[1]); sub_8045BF8(gFormatBuffer_Items[1],&newItems[0]); PlaySoundEffect(0x14d); - LogMessageByIdWithPopupCheckUser(entity,*gSwappedGroundItem); + LogMessageByIdWithPopupCheckUser(entity,gSwappedGroundItem); sub_807AB38(entity,gDungeon->forceMonsterHouse); } } @@ -462,13 +417,13 @@ void sub_8066FA4(Entity *entity) sub_8045BF8(gFormatBuffer_Items[0],item[0]); if (info->action.actionParameters[0].actionUseIndex < 0x15 && (item[0]->flags & ITEM_FLAG_SET) && (item[0]->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[1],item[0]); - LogMessageByIdWithPopupCheckUser(entity,*gItemStickyCannotMove3); + LogMessageByIdWithPopupCheckUser(entity,gItemStickyCannotMove3); } else if (info->action.actionParameters[0].actionUseIndex == 0x81 && ItemSticky(item[0])) { - LogMessageByIdWithPopupCheckUser(entity,*gItemStickyCannotMove2); + LogMessageByIdWithPopupCheckUser(entity,gItemStickyCannotMove2); } else if (tile->object != NULL && GetEntityType(tile->object) != ENTITY_ITEM) { - LogMessageByIdWithPopupCheckUser(entity,*gNoExchangesHere); + LogMessageByIdWithPopupCheckUser(entity,gNoExchangesHere); } else { Item newItems[2]; @@ -483,7 +438,7 @@ void sub_8066FA4(Entity *entity) RemoveItemFromDungeonAt(&entity->pos,1); ZeroOutItem(item[0]); if (!AddItemToDungeonAt(&entity->pos, &newItems[0],1)) { - LogMessageByIdWithPopupCheckUser(entity,*gNothingCanBePutDownHere); + LogMessageByIdWithPopupCheckUser(entity,gNothingCanBePutDownHere); } else { if (info->action.actionParameters[0].actionUseIndex == 0x81) { @@ -494,7 +449,7 @@ void sub_8066FA4(Entity *entity) } FillInventoryGaps(); PlaySoundEffect(0x14d); - LogMessageByIdWithPopupCheckUser(entity,*gSwappedGroundItem); + LogMessageByIdWithPopupCheckUser(entity,gSwappedGroundItem); sub_807AB38(entity,gDungeon->forceMonsterHouse); } } @@ -537,16 +492,16 @@ void sub_80671A0(Entity *entity) if (info->action.actionParameters[0].actionUseIndex == 0x81 && ItemSticky(item)) { sub_8045BF8(gFormatBuffer_Items[0], item); - LogMessageByIdWithPopupCheckUser(entity, *gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80F8BE0); sub_803E708(0x14, 0x4C); } else if ((GetItemCategory(item->id) == CATEGORY_THROWN_LINE || GetItemCategory(item->id) == CATEGORY_THROWN_ARC) && ItemSticky(item)) { sub_8045BF8(gFormatBuffer_Items[0], item); - LogMessageByIdWithPopupCheckUser(entity, *gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80F8BE0); sub_803E708(0x14, 0x4C); } else if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) { - LogMessageByIdWithPopupCheckUser(entity, *gUnknown_80FF76C); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FF76C); sub_803E708(0x14, 0x4C); } else { @@ -892,543 +847,3 @@ void sub_8067904(Entity *entity, u16 moveId) } } } - -extern void sub_80684C4(void); -void sub_8045064(void); -extern void sub_8068344(void); -bool8 CanSubMenuItemBeChosen(s32 param_1); -void sub_8068310(s32 n, PokemonStruct1 **monPtrs); -void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2, s32 a3, s32 a4); -extern void DungeonShowWindows(WindowTemplates *a0, u8 a1); -u32 sub_8014140(s32 a0, const void *a1); -void sub_8083D1C(void); -void PlayDungeonConfirmationSE(void); -void PlayDungeonCancelSE(void); -void sub_806806C(PokemonStruct1 *a0); -void CreateDungeonMenuSubWindow(WindowTemplates *a0, s32 a1); - -extern const s32 gUnknown_8106E80[]; -extern MenuInputStruct gDungeonMenu; -extern u32 gDungeonFramesCounter; - -static EWRAM_DATA WindowHeader gUnknown_202F308 = {0}; -static EWRAM_DATA s32 gUnknown_202F30C = 0; -static EWRAM_DATA s32 gUnknown_202F310 = 0; - -// It's likely a struct only used in Blue version. Touchpad maybe? -static const u8 gUnknown_8106DA4[] = { - 0x01, 0, 0x38, 0, 0, 0, 0x18, 0, 0x18, 0, 0, 0, 0x02, 0, 0x38, 0, 0x68, 0, 0x18, 0, 0x18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static const WindowTemplates gUnknown_8106DC8 = { - .id = { - [0] = - { - .unk0 = 0, - .type = WINDOW_TYPE_WITH_HEADER, - .pos = {0x02, 0x02}, - .width = 0x11, - .height = 0x0E, - .unk10 = 0x12, - .unk12 = 0x02, - .header = &gUnknown_202F308 - }, - [1] = - { - .unk0 = 0, - .type = WINDOW_TYPE_NORMAL, - .pos = {0x15, 0x04}, - .width = 0x07, - .height = 0x04, - .unk10 = 0x04, - .unk12 = 0, - .header = NULL - }, - [2] = WIN_TEMPLATE_DUMMY, - [3] = WIN_TEMPLATE_DUMMY, - } -}; - -void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) -{ - s32 i; - s32 r10; - WindowTemplates spTxtStruct = gUnknown_8106DC8; - - gUnknown_202F30C = 0; - r10 = 0; - for (i = 0; i < a2; i++) { - a3[i]->unk0 &= ~(0x8000); - } - - while (1) { - sub_8068310(a2, a3); - if (gUnknown_202F310 >= a1) - break; - while (1) { - s32 r7 = 0, r5 = 0; - - gUnknown_202F308.count = 1; - gUnknown_202F308.currId = 0; - gUnknown_202F308.width = 0xE; - gUnknown_202F308.f3 = 0; - - ASM_MATCH_TRICK(r7); - - DungeonShowWindows(&spTxtStruct, 1); - sub_8067F00(a0, a3, gUnknown_202F30C, a2, a1); - gDungeonMenu.unk1A = min(a2, 8); - gDungeonMenu.menuIndex = r10; - gDungeonMenu.unk1C = 8; - gDungeonMenu.unk1E = 0; - gDungeonMenu.unk20 = 0; - gDungeonMenu.unk4 = 0; - gDungeonMenu.firstEntryY = 18; - gDungeonMenu.unkC = 0; - gDungeonMenu.unkE = 0; - gDungeonMenu.unk14.x = 0; - gDungeonMenu.unk0 = 0; - sub_801317C(&gDungeonMenu.unk28); - sub_80137B0(&gDungeonMenu, 0); - while (1) { - s32 r4; - - AddMenuCursorSprite(&gDungeonMenu); - r5 = 0; - r7 = 0; - if (a2 - gUnknown_202F30C > 8) { - r5 = 1; - sub_80684C4(); - } - if (gUnknown_202F30C != 0) { - r7 = 1; - sub_8068344(); - } - - r4 = sub_8014140(0, gUnknown_8106DA4); - DungeonRunFrameActions(0x37); - if (r4 == 2 && r5) { - if (a2 - gUnknown_202F30C > 8) { - s32 i; - for (i = 0; i < 6; i++) { - ScrollDownWindowFunc(0); - DungeonRunFrameActions(0x37); - } - gUnknown_202F30C++; - } - r7 = 0; - r10 = 7; - break; - } - if (gRealInputs.repeated & DPAD_DOWN) { - PlayDungeonCursorSE(1); - if (gDungeonMenu.menuIndex == 7) { - if (a2 - gUnknown_202F30C > 8) { - s32 i; - for (i = 0; i < 6; i++) { - ScrollDownWindowFunc(0); - DungeonRunFrameActions(0x37); - } - gUnknown_202F30C++; - } - r7 = 0; - r10 = 7; - break; - } - MoveMenuCursorDownWrapAround(&gDungeonMenu, 0); - } - - if (r4 == 1 && r7 != 0) { - if (gUnknown_202F30C != 0) { - s32 i; - for (i = 0; i < 6; i++) { - ScrollUpWindowFunc(0); - DungeonRunFrameActions(0x37); - } - gUnknown_202F30C--; - } - r7 = 0; - r10 = 0; - break; - } - if (gRealInputs.repeated & DPAD_UP) { - PlayDungeonCursorSE(1); - if (gDungeonMenu.menuIndex == 0) { - if (gUnknown_202F30C != 0) { - s32 i; - for (i = 0; i < 6; i++) { - ScrollUpWindowFunc(0); - DungeonRunFrameActions(0x37); - } - gUnknown_202F30C--; - } - r7 = 0; - r10 = 0; - break; - } - MoveMenuCursorUpWrapAround(&gDungeonMenu, 0); - } - - if (sub_80048C8()) { - continue; - } - - if (gRealInputs.pressed & START_BUTTON) { - sub_8083D1C(); - r7 = 3; - break; - } - if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) { - PlayDungeonConfirmationSE(); - r7 = 1; - break; - } - if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) { - PlayDungeonCancelSE(); - r7 = 2; - break; - } - } - - AddMenuCursorSprite(&gDungeonMenu); - DungeonRunFrameActions(0x37); - if (r7 == 0) { - continue; - } - else if (r7 == 2) { - r10 = gDungeonMenu.menuIndex; - if (gUnknown_202F310 < a1) { - continue; - } - - if (DisplayDungeonYesNoMessage(NULL, gUnknown_80FDFB8, TRUE) == 1) { - break; - } - else { - continue; - } - } - else if (r7 == 3) { - r10 = gDungeonMenu.menuIndex; - sub_806806C(a3[gUnknown_202F30C + r10]); - continue; - } - else { - s32 arrId; - u8 locIdIsPartner; - - r10 = gDungeonMenu.menuIndex; - arrId = gUnknown_202F30C + r10; - gDungeonSubMenuItemsCount = 0; - AddActionToDungeonSubMenu(0x29, 0); - AddActionToDungeonSubMenu(0x2A, 0); - AddActionToDungeonSubMenu(0x40, 0); - if (a3[arrId]->unk0 & 0x8000) { - SetActionUnusableInDungeonSubMenu(0x29); - } - else { - SetActionUnusableInDungeonSubMenu(0x2A); - } - - // This unnecessary variable is required to match. - locIdIsPartner = DUNGEON_JOIN_LOCATION_PARTNER; - if (a3[arrId]->isTeamLeader || (a3[arrId]->dungeonLocation.id == DUNGEON_JOIN_LOCATION_LEADER || a3[arrId]->dungeonLocation.id == locIdIsPartner)) { - SetActionUnusableInDungeonSubMenu(0x29); - } - - sub_8045064(); - CreateDungeonMenuSubWindow(&spTxtStruct, 0x15); - - while (1) { - AddMenuCursorSprite(&gDungeonMenu); - DungeonRunFrameActions(0x37); - - if (gRealInputs.repeated & DPAD_DOWN) { - PlayDungeonCursorSE(1); - MoveMenuCursorDownWrapAround(&gDungeonMenu, 1); - } - if (gRealInputs.repeated & DPAD_UP) { - PlayDungeonCursorSE(1); - MoveMenuCursorUpWrapAround(&gDungeonMenu, 1); - } - - if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) { - if (CanSubMenuItemBeChosen(gDungeonMenu.menuIndex)) { - PlayDungeonConfirmationSE(); - r7 = 1; - break; - } - PlayDungeonCancelSE(); - } - if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) { - PlayDungeonCancelSE(); - r7 = 0; - break; - } - } - - AddMenuCursorSprite(&gDungeonMenu); - DungeonRunFrameActions(0x37); - if (r7 != 0) { - if (gDungeonMenu.menuIndex == 0) { - a3[arrId]->unk0 |= 0x8000; - sub_8068310(a2, a3); - } - else if (gDungeonMenu.menuIndex == 1) { - a3[arrId]->unk0 &= ~(0x8000); - sub_8068310(a2, a3); - } - else { - sub_806806C(a3[arrId]); - } - } - continue; - } - } - } -} - -void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2_, s32 a3, s32 a4) -{ - s32 i, y; - s32 a2; - - a2 = a2_ - 1; - y = 0x16; - - sub_80073B8(0); - WriteFriendAreaName(gFormatBuffer_Monsters[0], a0, FALSE); - PrintFormattedStringOnWindow(12, 0, _("{POKEMON_0}"), 0, '\0'); - i = 0; - while (i < 10) { - if (a2 >= 0) { - if (a2 >= a3) { - break; - } - - PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0], a1[a2], 0); - sub_808D930(gFormatBuffer_Monsters[1], a1[a2]->speciesNum); - gFormatArgs[0] = a2 + 1; - if (a1[a2]->unk0 & 0x8000) { - InlineStrcpy(gFormatBuffer_Items[0], _("{STAR_BULLET}")); - } - else { - InlineStrcpy(gFormatBuffer_Items[0], _("{ICON_BLANK}")); - } - - if (a1[a2]->unk0 & 0x4000) { - PrintFormattedStringOnWindow(7, y, _("{MOVE_ITEM_0}{color CYAN}$v02:{POKEMON_0}{reset}"), 0, '\0'); - } - else { - PrintFormattedStringOnWindow(7, y, _("{MOVE_ITEM_0}{color YELLOW}$v02:{POKEMON_0}{reset}"), 0, '\0'); - } - } - - i++; - y += 12; - a2++; - } - - sub_80073E0(0); - sub_80073B8(1); - if (gUnknown_202F310 >= a4) { - PrintFormattedStringOnWindow(8, 2, _("Press {B_BUTTON}\nif OK."), 1, '\0'); - } - else { - gFormatArgs[0] = a4 - gUnknown_202F310; - PrintFormattedStringOnWindow(8, 2, _("Say bye to\n{VALUE_0} more"), 1, '\0'); - } - - sub_80073E0(1); -} - -void sub_806806C(PokemonStruct1 *a0) -{ - struct unkStruct_808FF20 unkStruct; - struct UnkInfoTabStruct var_C8; - WindowTemplates spTxtStruct = {0}; - s32 r7; - - spTxtStruct.id[0].type = WINDOW_TYPE_WITH_HEADER; - spTxtStruct.id[0].pos.x = 2; - spTxtStruct.id[0].pos.y = 2; - spTxtStruct.id[0].width = 0x12; - spTxtStruct.id[0].height = 0xE; - spTxtStruct.id[0].unk10 = 0x12; - spTxtStruct.id[0].unk12 = 2; - spTxtStruct.id[0].header = &gUnknown_202F308; - spTxtStruct.id[1].type = WINDOW_TYPE_NORMAL; - spTxtStruct.id[2].type = WINDOW_TYPE_NORMAL; - spTxtStruct.id[3].type = WINDOW_TYPE_NORMAL; - - r7 = 0; - unkStruct.unk40 = 0; - unkStruct.unk56 = 0; - gDungeonMenu.menuIndex = 0; - - while (1) { - bool32 loopBreak = FALSE; - s32 spF8[4] = {2, 3, 4, 5}; - - gUnknown_202F308.count = 4; - gUnknown_202F308.currId = r7; - gUnknown_202F308.width = 10; - gUnknown_202F308.f3 = 0; - - gDungeonMenu.unk1E = r7; - gDungeonMenu.unk20 = 4; - gDungeonMenu.unk1A = 0; - gDungeonMenu.menuIndex = 0; - gDungeonMenu.unk1C = 0; - gDungeonMenu.unk4 = 0; - gDungeonMenu.firstEntryY = 16; - gDungeonMenu.unk14.x = 0; - gDungeonMenu.unk0 = 0; - - sub_801317C(&gDungeonMenu.unk28); - DungeonShowWindows(&spTxtStruct, 1); - sub_808FF20(&unkStruct, a0, gDungeon->unk644.unk16); - CreatePokemonInfoTabScreen(spF8[r7], r7, &unkStruct, &var_C8, 0); - - gDungeonMenu.unkC = (gWindows[0].x + 15) * 8; - gDungeonMenu.unkE = ((gWindows[0].y + 1) * 8) - 2; - - while (1) { - s32 r5; - - AddMenuCursorSprite(&gDungeonMenu); - if (spF8[r7] == 4) { - if (var_C8.unk0[8] != 0) { - sub_80684C4(); - } - if (unkStruct.unk40 != 0) { - sub_8068344(); - } - } - - r5 = sub_8014140(0, gUnknown_8106DA4); - DungeonRunFrameActions(0x1C); - if ((gRealInputs.pressed & DPAD_RIGHT) || gDungeonMenu.unk28.dpad_right) { - PlayDungeonCursorSE(0); - if (++r7 == 4) { - r7 = 0; - } - break; - } - if ((gRealInputs.pressed & DPAD_LEFT) || gDungeonMenu.unk28.dpad_left) { - PlayDungeonCursorSE(0); - if (--r7 == -1) { - r7 = 3; - } - break; - } - - if (spF8[r7] == 4) { - if (((gRealInputs.repeated & DPAD_DOWN) || r5 == 2) && var_C8.unk0[8] != 0) { - s32 i; - - PlayDungeonCursorSE(0); - for (i = 0; i < 6; i++) { - ScrollDownWindowFunc(0); - DungeonRunFrameActions(0x1C); - } - unkStruct.unk40++; - break; - } - if (((gRealInputs.repeated & DPAD_UP) || r5 == 1) && unkStruct.unk40 != 0) { - s32 i; - - PlayDungeonCursorSE(0); - for (i = 0; i < 6; i++) { - ScrollUpWindowFunc(0); - DungeonRunFrameActions(0x1C); - } - unkStruct.unk40--; - break; - } - } - - if (sub_80048C8()) { - continue; - } - - if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) { - PlayDungeonConfirmationSE(); - loopBreak = TRUE; - break; - } - if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) { - PlayDungeonCancelSE(); - loopBreak = TRUE; - break; - } - } - - DungeonRunFrameActions(0x37); - if (loopBreak) { - break; - } - } - - sub_803EAF0(0, NULL); -} - -void sub_8068310(s32 n, PokemonStruct1 **monPtrs) -{ - s32 i; - s32 counter = 0; - - for (i = 0; i < n; i++) { - if ((monPtrs[i]->unk0 & 0x8000) != 0) { - counter++; - } - } - gUnknown_202F310 = counter; -} - -void sub_8068344(void) -{ - if ((gDungeonFramesCounter & 8) != 0) { - Window *window = &gWindows[0]; - SpriteOAM sprite = {0}; - - SpriteSetAffine1(&sprite, 0); - SpriteSetAffine2(&sprite, 0); - SpriteSetObjMode(&sprite, 0); - SpriteSetMosaic(&sprite, 0); - SpriteSetBpp(&sprite, 0); - SpriteSetShape(&sprite, 1); - SpriteSetMatrixNum(&sprite, 16); - SpriteSetSize(&sprite, 0); - SpriteSetTileNum(&sprite, 0x3F0); - SpriteSetPriority(&sprite, 0); - SpriteSetPalNum(&sprite, 15); - SpriteSetY(&sprite, (window->y * 8) + 0x8); - SpriteSetX(&sprite, (window->x * 8) + 0x40); - AddSprite(&sprite,0x100,NULL,NULL); - } -} - -// The same as sub_80623B0 -void sub_80684C4(void) -{ - if ((gDungeonFramesCounter & 8) != 0) { - Window *window = &gWindows[0]; - SpriteOAM sprite = {0}; - - SpriteSetAffine1(&sprite, 0); - SpriteSetAffine2(&sprite, 0); - SpriteSetObjMode(&sprite, 0); - SpriteSetMosaic(&sprite, 0); - SpriteSetBpp(&sprite, 0); - SpriteSetShape(&sprite, 1); - SpriteSetMatrixNum(&sprite, 0); - SpriteSetSize(&sprite, 0); - SpriteSetTileNum(&sprite, 0x3F0); - SpriteSetPriority(&sprite, 0); - SpriteSetPalNum(&sprite, 15); - SpriteSetY(&sprite, (window->y * 8) + 0x70); - SpriteSetX(&sprite, (window->x * 8) + 0x40); - AddSprite(&sprite,0x100,NULL,NULL); - } -} diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 1ba1ab694..89e9395fa 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "constants/ability.h" #include "constants/iq_skill.h" #include "constants/move_id.h" @@ -6,25 +7,20 @@ #include "constants/type.h" #include "constants/weather.h" #include "structs/dungeon_entity.h" -#include "structs/str_202ED28.h" #include "structs/str_806B7F8.h" #include "structs/str_dungeon.h" #include "code_800F958.h" #include "code_803E46C.h" #include "code_803E668.h" -#include "code_8041AD0.h" -#include "code_804267C.h" -#include "code_8045A00.h" #include "code_805D8C8.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "dungeon_config.h" -#include "dungeon_engine.h" +#include "run_dungeon.h" #include "dungeon_leader.h" #include "dungeon_map_access.h" #include "dungeon_misc.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_message.h" #include "dungeon_util.h" @@ -36,10 +32,6 @@ #include "pokemon.h" #include "pokemon_3.h" #include "position_util.h" -#include "random.h" -#include "sprite.h" -#include "status_checks_1.h" -#include "tile_types.h" #include "weather.h" extern void sub_8042900(Entity *r0); @@ -65,9 +57,6 @@ extern u8 GetRandomFloorItem(s32 a0); extern void DeletePokemonDungeonSprite(s32 id); extern void sub_80429E8(Entity *r0); extern s32 sub_803DA20(s32 param_1); -extern s32 gDungeonFramesCounter; -extern void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos, DungeonPos *statusOffsets, u32 a3); -extern void sub_8042EC8(Entity *a0, s32 a1); extern Entity *sub_804550C(s16 a); extern Entity *sub_80453AC(s16 id); extern void sub_803F580(s32); @@ -1107,275 +1096,3 @@ s32 sub_806C4D4(s32 _species, s32 level, s32 categoryIndex) return defensiveCount; } - -extern const u8 gUnknown_8106EC8[][13]; - -static inline u16 GetUnkFlag(Entity *entity) -{ - if ((entity->axObj.axdata.flags & 0x2000)) - return 0; - else - return entity->axObj.axdata.flags >> 15; -} - -void sub_806C51C(Entity *entity) -{ - s32 x, y, y2; - bool8 var_3C; - bool8 decoySprite; - s32 var_34; - DungeonPos pos1; - DungeonPos posArray[4]; - u32 statusSprites; - bool8 r4; - u8 r7; - unkStruct_2039DB0 spriteMasks; - s32 xSprite, ySprite; - - EntityInfo *entInfo = GetEntInfo(entity); - if (gDungeon->unk181e8.cameraTarget == entity) { - decoySprite = FALSE; - } - else { - decoySprite = gDungeon->unk181e8.hallucinating; - } - - if (entInfo->curseClassStatus.status == STATUS_DECOY) { - decoySprite = TRUE; - } - - if (entity->axObj.unk43_animId2 == entity->axObj.unk42_animId1 && entity->axObj.unk45_orientation == entity->axObj.unk44_direction1 && entity->axObj.unk47 == 0) { - bool8 r2 = FALSE; - - if (!GetUnkFlag(entity)) - r2 = TRUE; - - if (r2) { - s32 r0; - s32 r3 = sub_806CEBC(entity); - entity->unk21 = 1; - if (entInfo->unkFE == 99) { - if (entity->axObj.unk43_animId2 <= 12) { - s32 r2; - if (entInfo->bideClassStatus.status == STATUS_BIDE) { - r2 = 2; - } - else if (entity->unk23 < 3) { - r2 = 0; - } - else { - r2 = 1; - } - - r0 = gUnknown_8106EC8[r2][entity->axObj.unk43_animId2]; - if (r0 == 7) { - r0 = r3; - } - } - else { - r0 = 99; - } - } - else { - r0 = entInfo->unkFE; - } - - if (r0 != 99) { - entity->axObj.unk42_animId1 = r0; - entity->axObj.unk44_direction1 = entity->axObj.unk45_orientation & DIRECTION_MASK; - entity->axObj.unk47 = 1; - if (entity->axObj.unk42_animId1 == 6 && ++entity->axObj.unk46 == 16) { - entity->axObj.unk42_animId1 = r3; - } - } - } - } - - if (entity->axObj.unk43_animId2 != entity->axObj.unk42_animId1 || entity->axObj.unk45_orientation != entity->axObj.unk44_direction1 || entity->axObj.unk47 != 0) { - s32 r7; - - entity->axObj.unk43_animId2 = entity->axObj.unk42_animId1; - entity->axObj.unk45_orientation = entity->axObj.unk44_direction1; - entity->axObj.unk47 = 0; - r7 = entity->axObj.unk40_maybeAnimTimer; - if (sub_808DA44(entInfo->apparentID, entity->axObj.unk42_animId1)) { - r7 = 0; - } - - if (!decoySprite) { - s32 rnd = Rand32Bit() & 3; - AxResInitFile(&entity->axObj.axdata, entity->axObj.spriteFile, entity->axObj.unk42_animId1, entity->axObj.unk44_direction1, r7, rnd, FALSE); - } - else { - OpenedFile *spriteData = GetSpriteData(MONSTER_DECOY); - s32 rnd = Rand32Bit() & 3; - AxResInitFile(&entity->axObj.axdata, spriteData, entity->axObj.unk42_animId1, entity->axObj.unk44_direction1, r7, rnd, FALSE); - } - - if (entity->axObj.unk42_animId1 != 6) { - entity->axObj.unk46 = 0; - } - } - - if (gDungeon->unk1356C) { - if (entity->axObj.unk43_animId2 != 7 || GetMovementType(entInfo->apparentID) == 2) { - if (entInfo->unk15C != 0) { - if (entInfo->unk160 == 0) { - if (entInfo->unk15F != 0) { - RunAxAnimationFrame(&entity->axObj.axdata); - RunAxAnimationFrame(&entity->axObj.axdata); - RunAxAnimationFrame(&entity->axObj.axdata); - } - else { - RunAxAnimationFrame(&entity->axObj.axdata); - } - } - } - else { - RunAxAnimationFrame(&entity->axObj.axdata); - } - } - } - else { - if (entInfo->frozenClassStatus.status != STATUS_FROZEN && entInfo->frozenClassStatus.status != STATUS_PETRIFIED) { - if (gDungeon->unk644.unk28 != 0 && gDungeon->unk1BDD4.unk1C05F == 0) { - RunAxAnimationFrame(&entity->axObj.axdata); - RunAxAnimationFrame(&entity->axObj.axdata); - } - else if ((entity->axObj.unk43_animId2 == 0 || entity->axObj.unk43_animId2 == 7) && GetEntInfo(entity)->speedStage > 1) { - RunAxAnimationFrame(&entity->axObj.axdata); - } - RunAxAnimationFrame(&entity->axObj.axdata); - } - } - - if (entity->pixelPos.x == entity->prevPixelPos.x && entity->pixelPos.y == entity->prevPixelPos.y) { - if (entity->unk23 < 10) { - entity->unk23++; - } - } - else { - entity->unk23 = 0; - } - - entity->prevPixelPos.x = entity->pixelPos.x; - entity->prevPixelPos.y = entity->pixelPos.y; - - x = (entity->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x; - y = (((entity->pixelPos.y - entity->unk1C.raw) - entInfo->unk174.raw) / 256) - gDungeon->unk181e8.cameraPixelPos.y; - y2 = (entity->pixelPos.y / 256) - gDungeon->unk181e8.cameraPixelPos.y; - y2 /= 2; - if (entInfo->unk156 == 0) { - y2--; - } - - if (entInfo->unk15C == 0) { - var_3C = sub_8042768(entity); - } - else { - if (entInfo->unk15D != 0) { - if (gDungeonFramesCounter & 4) { - x++; - } - else { - x--; - } - } - var_3C = (entInfo->unk15E == 0); - } - - pos1.x = entity->pixelPos.x / 256; - pos1.y = ((entity->pixelPos.y - entity->unk1C.raw) - entInfo->unk174.raw) / 256; - - sub_8005700(posArray, &entity->axObj); - sub_800F958(entInfo->unk98, &pos1, posArray, gDungeon->unk181e8.priority); - - statusSprites = EntityGetStatusSprites(entity); - UpdateDungeonPokemonSprite(entInfo->unk98, entInfo->apparentID, statusSprites, (var_3C && entInfo->unk14C)); - - sub_8042EC8(entity, y2); - if (entInfo->unk15C == 0) { - if (entInfo->unkFF == 1) { - if (entInfo->unk174.raw <= IntToF248_2(199.999).raw) { - entInfo->unk174.raw += IntToF248_2(8).raw; - if (entInfo->unk174.raw > IntToF248_2(200).raw) { - entInfo->unk174.raw = IntToF248_2(200).raw; - } - } - } - else { - entInfo->unk174.raw -= IntToF248_2(12).raw; - if (entInfo->unk174.raw < IntToF248_2(0).raw) { - entInfo->unk174.raw = IntToF248_2(0).raw; - } - } - } - - if (!var_3C) - return; - - r4 = FALSE; - r7 = sub_806CF54(entity); - - spriteMasks.unk0 = 0xF3FF; - spriteMasks.unk2 = 0xFFFF; - spriteMasks.unk4 = 0xF3FF; - spriteMasks.unk6 = 0; - spriteMasks.unk8 = 0; - spriteMasks.unkA = gDungeon->unk181e8.priority << 10; - - if (entInfo->isNotTeamMember && (entInfo->apparentID == MONSTER_DEOXYS_ATTACK || entInfo->apparentID == MONSTER_DEOXYS_DEFENSE || entInfo->apparentID == MONSTER_DEOXYS_SPEED)) { - r4 = TRUE; - } - if (entInfo->invisibleClassStatus.status == STATUS_INVISIBLE && !gDungeon->unk181e8.showInvisibleTrapsMonsters) { - r4 = TRUE; - } - if (r4) { - spriteMasks.unk6 |= 0x400; - } - - var_34 = 0; - if (!entInfo->isNotTeamMember || entInfo->curseClassStatus.status == STATUS_DECOY) { - var_34 = 1; - } - if (IsExperienceLocked(entInfo->joinedAt.id) || entInfo->monsterBehavior == 1) { - var_34 = 1; - } - - if (entInfo->unkFF != 2) { - s32 overworldPal; - - if (entInfo->frozenClassStatus.status == STATUS_PETRIFIED || entInfo->burnClassStatus.status == STATUS_PARALYSIS || entInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) { - x += gDungeonFramesCounter & 2; - } - - if (decoySprite) { - overworldPal = GetPokemonOverworldPalette(MONSTER_DECOY, FALSE); - } - else { - overworldPal = GetPokemonOverworldPalette(entInfo->apparentID, FALSE); - } - - if (entity->unk22 == 0) { - DoAxFrame_800558C(&entity->axObj.axdata, x, y, y2, overworldPal, &spriteMasks); - } - else if (entity->unk22 == 1 && (gDungeonFramesCounter & 1)) { - DoAxFrame_800558C(&entity->axObj.axdata, x, y, y2, overworldPal, &spriteMasks); - } - } - - entInfo->pixelPos.x = (entity->pixelPos.x / 256) + entity->axObj.axdata.sub1.shadow.x; - entInfo->pixelPos.y = (entity->pixelPos.y / 256) + entity->axObj.axdata.sub1.shadow.y; - - xSprite = entInfo->pixelPos.x - gDungeon->unk181e8.cameraPixelPos.x; - ySprite = entInfo->pixelPos.y - gDungeon->unk181e8.cameraPixelPos.y; - if (xSprite >= -32 && ySprite >= -32 && xSprite <= 271 && ySprite <= 191 && r7 != 6 && entity->unk22 == 0) { - struct unkStruct_202ED28 *spriteStructPtr = &gUnknown_202ED28[var_34][r7]; - if (entInfo->unk156 != 0) { - SpriteSetX(&spriteStructPtr->sprite, xSprite + spriteStructPtr->pos.x); - SpriteSetY(&spriteStructPtr->sprite, ySprite + spriteStructPtr->pos.y); - - AddSprite(&spriteStructPtr->sprite, 0, NULL, NULL); - } - } -} diff --git a/src/code_806CD90.c b/src/code_806CD90.c index 4a47fb793..4db335dab 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "constants/direction.h" #include "constants/status.h" #include "constants/ability.h" @@ -10,22 +11,17 @@ #include "code_803E668.h" #include "code_8041AD0.h" #include "code_804267C.h" -#include "code_8045A00.h" #include "code_805D8C8.h" #include "code_806CD90.h" -#include "code_8077274_1.h" -#include "dungeon_capabilities.h" #include "dungeon_config.h" #include "dungeon_items.h" #include "dungeon_map_access.h" #include "dungeon_message.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_misc.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "exclusive_pokemon.h" -#include "game_options.h" #include "move_effects_target.h" #include "pokemon.h" #include "position_util.h" @@ -33,14 +29,294 @@ #include "sprite.h" #include "status.h" #include "text_util.h" -#include "tile_types.h" +#include "sprite.h" +#include "random.h" +#include "code_800F958.h" +#include "structs/str_202ED28.h" -extern u8 gUnknown_202F221; - -extern void ResetMonEntityData(EntityInfo *, u32); +const u8 gUnknown_8106EC8[][13] = { + {0, 1, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7, 5, 6, 7, 7, 7, 7, 11, 7}, +}; const u8 gUnknown_8106EEF[] = {0x03, 0x04, 0x05, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 }; +extern s32 gDungeonFramesCounter; + +extern void sub_8042EC8(Entity *a0, s32 a1); +extern void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos, DungeonPos *statusOffsets, u32 a3); + +static inline u16 GetUnkFlag(Entity *entity) +{ + if ((entity->axObj.axdata.flags & 0x2000)) + return 0; + else + return entity->axObj.axdata.flags >> 15; +} + +void sub_806C51C(Entity *entity) +{ + s32 x, y, y2; + bool8 var_3C; + bool8 decoySprite; + s32 var_34; + DungeonPos pos1; + DungeonPos posArray[4]; + u32 statusSprites; + bool8 r4; + u8 r7; + unkStruct_2039DB0 spriteMasks; + s32 xSprite, ySprite; + + EntityInfo *entInfo = GetEntInfo(entity); + if (gDungeon->unk181e8.cameraTarget == entity) { + decoySprite = FALSE; + } + else { + decoySprite = gDungeon->unk181e8.hallucinating; + } + + if (entInfo->curseClassStatus.status == STATUS_DECOY) { + decoySprite = TRUE; + } + + if (entity->axObj.unk43_animId2 == entity->axObj.unk42_animId1 && entity->axObj.unk45_orientation == entity->axObj.unk44_direction1 && entity->axObj.unk47 == 0) { + bool8 r2 = FALSE; + + if (!GetUnkFlag(entity)) + r2 = TRUE; + + if (r2) { + s32 r0; + s32 r3 = sub_806CEBC(entity); + entity->unk21 = 1; + if (entInfo->unkFE == 99) { + if (entity->axObj.unk43_animId2 <= 12) { + s32 r2; + if (entInfo->bideClassStatus.status == STATUS_BIDE) { + r2 = 2; + } + else if (entity->unk23 < 3) { + r2 = 0; + } + else { + r2 = 1; + } + + r0 = gUnknown_8106EC8[r2][entity->axObj.unk43_animId2]; + if (r0 == 7) { + r0 = r3; + } + } + else { + r0 = 99; + } + } + else { + r0 = entInfo->unkFE; + } + + if (r0 != 99) { + entity->axObj.unk42_animId1 = r0; + entity->axObj.unk44_direction1 = entity->axObj.unk45_orientation & DIRECTION_MASK; + entity->axObj.unk47 = 1; + if (entity->axObj.unk42_animId1 == 6 && ++entity->axObj.unk46 == 16) { + entity->axObj.unk42_animId1 = r3; + } + } + } + } + + if (entity->axObj.unk43_animId2 != entity->axObj.unk42_animId1 || entity->axObj.unk45_orientation != entity->axObj.unk44_direction1 || entity->axObj.unk47 != 0) { + s32 r7; + + entity->axObj.unk43_animId2 = entity->axObj.unk42_animId1; + entity->axObj.unk45_orientation = entity->axObj.unk44_direction1; + entity->axObj.unk47 = 0; + r7 = entity->axObj.unk40_maybeAnimTimer; + if (sub_808DA44(entInfo->apparentID, entity->axObj.unk42_animId1)) { + r7 = 0; + } + + if (!decoySprite) { + s32 rnd = Rand32Bit() & 3; + AxResInitFile(&entity->axObj.axdata, entity->axObj.spriteFile, entity->axObj.unk42_animId1, entity->axObj.unk44_direction1, r7, rnd, FALSE); + } + else { + OpenedFile *spriteData = GetSpriteData(MONSTER_DECOY); + s32 rnd = Rand32Bit() & 3; + AxResInitFile(&entity->axObj.axdata, spriteData, entity->axObj.unk42_animId1, entity->axObj.unk44_direction1, r7, rnd, FALSE); + } + + if (entity->axObj.unk42_animId1 != 6) { + entity->axObj.unk46 = 0; + } + } + + if (gDungeon->unk1356C) { + if (entity->axObj.unk43_animId2 != 7 || GetMovementType(entInfo->apparentID) == 2) { + if (entInfo->unk15C != 0) { + if (entInfo->unk160 == 0) { + if (entInfo->unk15F != 0) { + RunAxAnimationFrame(&entity->axObj.axdata); + RunAxAnimationFrame(&entity->axObj.axdata); + RunAxAnimationFrame(&entity->axObj.axdata); + } + else { + RunAxAnimationFrame(&entity->axObj.axdata); + } + } + } + else { + RunAxAnimationFrame(&entity->axObj.axdata); + } + } + } + else { + if (entInfo->frozenClassStatus.status != STATUS_FROZEN && entInfo->frozenClassStatus.status != STATUS_PETRIFIED) { + if (gDungeon->unk644.unk28 != 0 && gDungeon->unk1BDD4.unk1C05F == 0) { + RunAxAnimationFrame(&entity->axObj.axdata); + RunAxAnimationFrame(&entity->axObj.axdata); + } + else if ((entity->axObj.unk43_animId2 == 0 || entity->axObj.unk43_animId2 == 7) && GetEntInfo(entity)->speedStage > 1) { + RunAxAnimationFrame(&entity->axObj.axdata); + } + RunAxAnimationFrame(&entity->axObj.axdata); + } + } + + if (entity->pixelPos.x == entity->prevPixelPos.x && entity->pixelPos.y == entity->prevPixelPos.y) { + if (entity->unk23 < 10) { + entity->unk23++; + } + } + else { + entity->unk23 = 0; + } + + entity->prevPixelPos.x = entity->pixelPos.x; + entity->prevPixelPos.y = entity->pixelPos.y; + + x = (entity->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x; + y = (((entity->pixelPos.y - entity->unk1C.raw) - entInfo->unk174.raw) / 256) - gDungeon->unk181e8.cameraPixelPos.y; + y2 = (entity->pixelPos.y / 256) - gDungeon->unk181e8.cameraPixelPos.y; + y2 /= 2; + if (entInfo->unk156 == 0) { + y2--; + } + + if (entInfo->unk15C == 0) { + var_3C = sub_8042768(entity); + } + else { + if (entInfo->unk15D != 0) { + if (gDungeonFramesCounter & 4) { + x++; + } + else { + x--; + } + } + var_3C = (entInfo->unk15E == 0); + } + + pos1.x = entity->pixelPos.x / 256; + pos1.y = ((entity->pixelPos.y - entity->unk1C.raw) - entInfo->unk174.raw) / 256; + + sub_8005700(posArray, &entity->axObj); + sub_800F958(entInfo->unk98, &pos1, posArray, gDungeon->unk181e8.priority); + + statusSprites = EntityGetStatusSprites(entity); + UpdateDungeonPokemonSprite(entInfo->unk98, entInfo->apparentID, statusSprites, (var_3C && entInfo->unk14C)); + + sub_8042EC8(entity, y2); + if (entInfo->unk15C == 0) { + if (entInfo->unkFF == 1) { + if (entInfo->unk174.raw <= IntToF248_2(199.999).raw) { + entInfo->unk174.raw += IntToF248_2(8).raw; + if (entInfo->unk174.raw > IntToF248_2(200).raw) { + entInfo->unk174.raw = IntToF248_2(200).raw; + } + } + } + else { + entInfo->unk174.raw -= IntToF248_2(12).raw; + if (entInfo->unk174.raw < IntToF248_2(0).raw) { + entInfo->unk174.raw = IntToF248_2(0).raw; + } + } + } + + if (!var_3C) + return; + + r4 = FALSE; + r7 = sub_806CF54(entity); + + spriteMasks.unk0 = 0xF3FF; + spriteMasks.unk2 = 0xFFFF; + spriteMasks.unk4 = 0xF3FF; + spriteMasks.unk6 = 0; + spriteMasks.unk8 = 0; + spriteMasks.unkA = gDungeon->unk181e8.priority << 10; + + if (entInfo->isNotTeamMember && (entInfo->apparentID == MONSTER_DEOXYS_ATTACK || entInfo->apparentID == MONSTER_DEOXYS_DEFENSE || entInfo->apparentID == MONSTER_DEOXYS_SPEED)) { + r4 = TRUE; + } + if (entInfo->invisibleClassStatus.status == STATUS_INVISIBLE && !gDungeon->unk181e8.showInvisibleTrapsMonsters) { + r4 = TRUE; + } + if (r4) { + spriteMasks.unk6 |= 0x400; + } + + var_34 = 0; + if (!entInfo->isNotTeamMember || entInfo->curseClassStatus.status == STATUS_DECOY) { + var_34 = 1; + } + if (IsExperienceLocked(entInfo->joinedAt.id) || entInfo->monsterBehavior == 1) { + var_34 = 1; + } + + if (entInfo->unkFF != 2) { + s32 overworldPal; + + if (entInfo->frozenClassStatus.status == STATUS_PETRIFIED || entInfo->burnClassStatus.status == STATUS_PARALYSIS || entInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) { + x += gDungeonFramesCounter & 2; + } + + if (decoySprite) { + overworldPal = GetPokemonOverworldPalette(MONSTER_DECOY, FALSE); + } + else { + overworldPal = GetPokemonOverworldPalette(entInfo->apparentID, FALSE); + } + + if (entity->unk22 == 0) { + DoAxFrame_800558C(&entity->axObj.axdata, x, y, y2, overworldPal, &spriteMasks); + } + else if (entity->unk22 == 1 && (gDungeonFramesCounter & 1)) { + DoAxFrame_800558C(&entity->axObj.axdata, x, y, y2, overworldPal, &spriteMasks); + } + } + + entInfo->pixelPos.x = (entity->pixelPos.x / 256) + entity->axObj.axdata.sub1.shadow.x; + entInfo->pixelPos.y = (entity->pixelPos.y / 256) + entity->axObj.axdata.sub1.shadow.y; + + xSprite = entInfo->pixelPos.x - gDungeon->unk181e8.cameraPixelPos.x; + ySprite = entInfo->pixelPos.y - gDungeon->unk181e8.cameraPixelPos.y; + if (xSprite >= -32 && ySprite >= -32 && xSprite <= 271 && ySprite <= 191 && r7 != 6 && entity->unk22 == 0) { + struct unkStruct_202ED28 *spriteStructPtr = &gUnknown_202ED28[var_34][r7]; + if (entInfo->unk156 != 0) { + SpriteSetX(&spriteStructPtr->sprite, xSprite + spriteStructPtr->pos.x); + SpriteSetY(&spriteStructPtr->sprite, ySprite + spriteStructPtr->pos.y); + + AddSprite(&spriteStructPtr->sprite, 0, NULL, NULL); + } + } +} + void sub_806CC10(void) { EntityInfo *entityInfo; @@ -258,719 +534,3 @@ u32 sub_806CF98(Entity *entity) entityInfo->unk204 = shadowSize; return shadowSize; } - -static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struct DamageStruct *r5, bool32 isFalseSwipe, bool32 giveExp, s16 arg4_, s32 arg8); - -extern void sub_807F43C(Entity *, Entity *); -extern void sub_8041B18(Entity *pokemon); -extern void sub_8041B90(Entity *pokemon); -extern void sub_8041D00(Entity *pokemon, Entity *target); -extern void DealDamageToEntity(Entity *, s32, u32, u32); -extern void SetShopkeeperAggression(Entity *, Entity *); -extern void sub_8042238(Entity *pokemon, Entity *target); -extern void sub_803ED30(s32, Entity *r0, u8, s32); -extern bool8 sub_806A458(Entity *); -extern bool8 sub_806F660(Entity *, Entity *); -extern bool8 sub_806A58C(s16 a0); -extern void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp); -extern void sub_8042148(Entity *pokemon); -extern void sub_8042A24(Entity *r0); -extern void sub_806A390(Entity *r0); -extern void sub_806F63C(Entity *r0); -extern void sub_8078084(Entity * pokemon); -extern void sub_800DBBC(void); -extern void sub_80464C8(Entity *, DungeonPos *, Item *); -extern bool8 DoEnemiesEvolveWhenKOed(u8 dungeon); -extern bool8 sub_806FA5C(Entity *, Entity *, struct unkStruct_8069D4C *); -extern void EntityUpdateStatusSprites(Entity *); -extern bool8 sub_8045888(Entity *r0); - -extern const s32 gUnknown_8106A4C; -extern const u8 *const gUnknown_80FCFA4; -extern const u8 *const gUnknown_80FCA90; -extern const u8 *const gUnknown_80F9600; -extern const u8 *const gUnknown_80F9614; -extern const u8 *const gUnknown_80F9630; -extern const u8 *const gUnknown_80F9654; -extern const u8 *const gUnknown_80F9670; -extern const u8 *const gUnknown_80F9614; -extern const u8 *const gUnknown_80F9688; -extern const u8 *const gUnknown_80FD484; -extern const u8 *const gUnknown_80F96A8; -extern const u8 *const gUnknown_8100548; -extern const u8 *const gUnknown_80FD46C; -extern const u8 *const gUnknown_810056C; -extern const u8 *const gUnknown_80F9E44; -extern const u8 *const gUnknown_80F9764[]; -extern const u8 *const gUnknown_80F9CC0[]; -extern const u8 *const gUnknown_80F9CEC[]; -extern const u8 *const gUnknown_80F9DAC[]; -extern const u8 *const gUnknown_80F9DF0[]; -extern const u8 *const gUnknown_80F9D8C[]; -extern const u8 *const gUnknown_80F9D84[]; -extern const u8 *const gUnknown_80F9D28[]; - -void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC) -{ - bool32 r9; - // Some compiler weirdness, because it won't match without creating arg4 again - s32 r10 = arg4; - s32 returnDmg = 0; - - if (HandleDealingDamageInternal(attacker, target, dmgStruct, isFalseSwipe, giveExp, r10, argC)) - return; - if (dmgStruct->tookNoDamage) - return; - if (!EntityIsValid(attacker) || !EntityIsValid(target)) - return; - if (GetEntityType(attacker) != ENTITY_MONSTER || GetEntityType(target) != ENTITY_MONSTER) - return; - - r9 = arg8; - if (CheckVariousStatuses(target) || GetEntInfo(target)->bideClassStatus.status != 0) - r9 = FALSE; - if (r9 - && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1 - && attacker != target - && IsTypePhysical(dmgStruct->type) - && GetEntInfo(target)->reflectClassStatus.status == STATUS_VITAL_THROW) - { - sub_8042730(target, attacker); - sub_807F43C(target, attacker); - } - - if (GetEntInfo(target)->bideClassStatus.status == STATUS_ENRAGED) { - RaiseAttackStageTarget(attacker, target, gUnknown_8106A4C, 1); - } - - if (!EntityIsValid(attacker) || !EntityIsValid(target)) - return; - - if (r9 - && attacker != target - && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1) - { - bool32 isPhysical = IsTypePhysical(dmgStruct->type); - if (GetEntInfo(target)->reflectClassStatus.status == STATUS_COUNTER && isPhysical) { - sub_8041B18(target); - returnDmg += 4; - } - if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MINI_COUNTER && isPhysical) { - sub_8041B18(target); - returnDmg += 1; - } - if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIRROR_COAT && !isPhysical) { - sub_8041B90(target); - returnDmg += 4; - } - - if (AbilityIsActive(target, ABILITY_ROUGH_SKIN)) - returnDmg += 2; - - if (returnDmg) { - struct DamageStruct sp; - - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCFA4); - sp.dmg = (dmgStruct->dmg * returnDmg) / 4; - sp.type = dmgStruct->type; - sp.residualDmgType = 6; - sp.typeEffectiveness = 2; - sp.isCrit = FALSE; - sp.unkE = 0; - sp.tookNoDamage = FALSE; - HandleDealingDamageInternal(target, attacker, &sp, FALSE, giveExp, r10, argC); - } - } - if (!EntityIsValid(attacker) || !EntityIsValid(target)) - return; - - // Check trapping / contact abilities - if (r9 - && attacker != target - && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1) - { - bool32 isPhysical = IsTypePhysical(dmgStruct->type); - EntityInfo *attackerInfo = GetEntInfo(attacker); - - if (AbilityIsActive(target, ABILITY_ARENA_TRAP) - && !MonsterIsType(attacker, TYPE_FLYING) - && !AbilityIsActive(attacker, ABILITY_LEVITATE) - && DungeonRandInt(100) < gArenaTrapActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_ARENA_TRAP; - } - if (AbilityIsActive(target, ABILITY_SHADOW_TAG) - && DungeonRandInt(100) < gShadowTagActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_SHADOW_TAG; - } - if (AbilityIsActive(target, ABILITY_MAGNET_PULL) - && MonsterIsType(attacker, TYPE_STEEL) - && DungeonRandInt(100) < gMagnetPullActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_MAGNET_PULL; - } - - if (AbilityIsActive(target, ABILITY_STATIC) - && isPhysical - && DungeonRandInt(100) < gStaticActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STATIC; - } - if (AbilityIsActive(target, ABILITY_POISON_POINT) - && DungeonRandInt(100) < gPoisonPointActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_POISON_POINT; - } - if (AbilityIsActive(target, ABILITY_EFFECT_SPORE) - && isPhysical - && DungeonRandInt(100) < gEffectSproreActivateChance) - { - s32 rnd = DungeonRandInt(3); - if (rnd < 1) - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_PSN; - else if (rnd < 2) - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_PRLZ; - else - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_SLP; - } - if (AbilityIsActive(target, ABILITY_FLAME_BODY) - && DungeonRandInt(100) < gFlameBodyActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_FLAME_BODY; - } - if (AbilityIsActive(target, ABILITY_CUTE_CHARM) - && isPhysical - && DungeonRandInt(100) < gCuteCharmActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_CUTE_CHARM; - } - if (AbilityIsActive(target, ABILITY_STENCH) - && DungeonRandInt(100) < gStenchActivateChance) - { - attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STENCH; - } - } - if (!EntityIsValid(attacker) || !EntityIsValid(target)) - return; - - // Destiny Bond - if (r9) { - EntityInfo *targetInfo = GetEntInfo(target); - if (targetInfo->leechSeedClassStatus.status == STATUS_DESTINY_BOND) { - Entity *destBondTarget = gDungeon->activePokemon[targetInfo->leechSeedClassStatus.unk8]; - if (destBondTarget == NULL) { - targetInfo->leechSeedClassStatus.status = 0; - } - else if (GetEntInfo(destBondTarget)->unk98 != targetInfo->leechSeedClassStatus.unk4) { - targetInfo->leechSeedClassStatus.status = 0; - } - else { - sub_8041D00(destBondTarget, target); - DealDamageToEntity(destBondTarget, dmgStruct->dmg, 0xC, 0x1F9); - } - } - } -} - -static inline u8 ItemId(Item *item) -{ - return item->id; -} - -static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4_, s32 arg8) -{ - s32 hpBefore, hpChange; - EntityInfo *targetData; - s32 arg4 = arg4_; - bool32 var_24 = FALSE; - bool32 r10 = FALSE; - s32 r8 = 0; - Tile *unkTile = NULL; - - dmgStruct->tookNoDamage = FALSE; - if (GetEntityType(target) != ENTITY_MONSTER) { - dmgStruct->tookNoDamage = TRUE; - return FALSE; - } - - targetData = GetEntInfo(target); - TrySendImmobilizeSleepEndMsg(attacker, target); - SetShopkeeperAggression(attacker, target); - if (GetEntityType(attacker) == ENTITY_MONSTER - && GetEntInfo(attacker)->sureShotClassStatus.status == STATUS_SET_DAMAGE - && dmgStruct->unkE == 0) - { - dmgStruct->dmg = gSetDamageDmgValue; - } - - if (arg4 != 0x20E && AbilityIsActive(target, ABILITY_STURDY) && dmgStruct->dmg == 9999) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90); - sub_8042238(attacker, target); - dmgStruct->tookNoDamage = TRUE; - return FALSE; - } - if (targetData->frozenClassStatus.status == STATUS_FROZEN) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); - sub_8042238(attacker, target); - dmgStruct->tookNoDamage = TRUE; - return FALSE; - } - - if ((targetData->sleepClassStatus.status == STATUS_SLEEP || targetData->sleepClassStatus.status == STATUS_NAPPING || targetData->sleepClassStatus.status == STATUS_NIGHTMARE) - && targetData->sleepClassStatus.turns == 0x7F) - { - WakeUpPokemon(target); - } - - if ((AbilityIsActive(target, ABILITY_VOLT_ABSORB) && dmgStruct->type == TYPE_ELECTRIC)) { - HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); - dmgStruct->tookNoDamage = TRUE; - return FALSE; - } - else if (AbilityIsActive(target, ABILITY_WATER_ABSORB) && dmgStruct->type == TYPE_WATER) { - HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); - dmgStruct->tookNoDamage = TRUE; - return FALSE; - } - - if (targetData->unk152 == 0) { - if (dmgStruct->isCrit) { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9614); - } - switch (dmgStruct->typeEffectiveness) { - case EFFECTIVENESS_IMMUNE: - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9630); - break; - case EFFECTIVENESS_RESIST: - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9654); - break; - case EFFECTIVENESS_SUPER: - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9670); - break; - } - } - - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - if (dmgStruct->dmg == 0) { - if (sub_8045888(attacker) && sub_8045888(target)) { - if (targetData->unk152 == 0) { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); - } - sub_8042238(attacker, target); - } - else { - if (targetData->unk152 == 0) { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); - } - sub_803E708(0x1E, 0x18); - } - dmgStruct->tookNoDamage = TRUE; - return FALSE; - } - else if (dmgStruct->dmg == 9999) { - if (arg8 != 0 && sub_8045888(target)) { - unkTile = GetTileAtEntitySafe(target); - sub_803E708(0x14, 0x18); - unkTile->spawnOrVisibilityFlags |= 4; - sub_8049ED4(); - } - if (targetData->unk152 == 0) { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F96A8); - } - targetData->unkA0 = 999; - } - else { - const u8 *str; - - gFormatArgs[0] = dmgStruct->dmg; - str = gUnknown_80F9764[dmgStruct->residualDmgType]; - - ASM_MATCH_TRICK(dmgStruct); - - targetData->unkA0 += dmgStruct->dmg; - if (targetData->unkA0 > 999) - targetData->unkA0 = 999; - - if (sub_8045888(target)) { - if (dmgStruct->residualDmgType != 14) { - sub_803ED30(-dmgStruct->dmg, target, 1, -1); - } - if (targetData->unk152 == 0 && str != NULL) { - TryDisplayDungeonLoggableMessage3(attacker, target, str); - } - } - else { - if (targetData->unk152 == 0 && str != NULL) { - TryDisplayDungeonLoggableMessage3(attacker, target, str); - } - } - } - - if ((dmgStruct->residualDmgType != 14 || targetData->HP <= 1) && unkTile == NULL && sub_8045888(target)) { - if ((attacker->pos.x != target->pos.x || attacker->pos.y != target->pos.y) && GetEntityType(attacker) == ENTITY_MONSTER) { - bool32 unkBool = FALSE; - if (targetData->isTeamLeader) { - if (gGameOptionsRef->damageTurn != 0 && !sub_806A458(target)) { - if (CanSeeTarget(target, attacker)) - unkBool = TRUE; - else - unkBool = FALSE; - } - } - else { - unkBool = FALSE; - } - if (targetData->blinkerClassStatus.status == STATUS_BLINKER || targetData->blinkerClassStatus.status == STATUS_CROSS_EYED) - unkBool = FALSE; - if (unkBool) { - EntityInfo *info = GetEntInfo(target); - info->action.direction = (GetDirectionTowardsPosition(&target->pos, &attacker->pos) & DIRECTION_MASK); - } - TargetTileInFront(target); - } - sub_806CDD4(target, 6, GetEntInfo(target)->action.direction); - sub_80420E8(target, dmgStruct); - var_24 = TRUE; - } - - // HP goes down - hpBefore = targetData->HP; - if (targetData->HP > dmgStruct->dmg) - targetData->HP -= dmgStruct->dmg; - else - targetData->HP = 0; - - if (targetData->reflectClassStatus.status == STATUS_ENDURING) { - if (targetData->HP == 0) { - targetData->HP = 1; - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_8100548); - } - } - else if (isFalseSwipe == TRUE && targetData->HP == 0) { - targetData->HP = 1; - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_810056C); - } - - hpChange = hpBefore - targetData->HP; - if (hpChange < 0) - hpChange = 0; - - if (var_24 || unkTile != NULL) - sub_803E708(0xA, 0x18); - - if (targetData->HP != 0) { - if (var_24) { - sub_806CE68(target, 8); - } - if (HasHeldItem(target, ITEM_JOY_RIBBON) && hpChange > 0 && dmgStruct->dmg != 9999) { - sub_8071D4C(attacker, target, hpChange); - } - - if (unkTile != NULL) - { - unkTile->spawnOrVisibilityFlags &= ~(0x4); - sub_8049ED4(); - } - return FALSE; - } - - // 0 HP - if (targetData->invisibleClassStatus.status == STATUS_TRANSFORMED) { - SendTransformEndMessage(attacker, target); - } - - if (unkTile != NULL) { - sub_803E708(0x14, 0x18); - target->unk22 = 2; - sub_803E708(0xA, 0x18); - unkTile->spawnOrVisibilityFlags &= ~(0x4); - sub_8049ED4(); - } - else if (var_24) { - target->unk22 = 1; - sub_803E708(0x1E, 0x18); - } - - r8 = 1; - if (EntityIsValid(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && attacker != target) - r8 = 0; - - targetData->unk14C = 0; - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - if (dmgStruct->residualDmgType == 19 || dmgStruct->residualDmgType == 20) { - if (targetData->isNotTeamMember) { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9E44); - } - else { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9E44); - } - } - else if (targetData->isNotTeamMember) - { - if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); - } - else { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9CC0[r8]); - } - } - else { - PokemonStruct2 *recruitedMon = &gRecruitedPokemonRef->pokemon2[targetData->teamIndex]; - if (targetData->isTeamLeader || (targetData->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]); - } - else if (IsExperienceLocked(targetData->joinedAt.id)) { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]); - } - else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); - } - else if (sub_806A58C(recruitedMon->unkA)) { - if (gDungeon->unk644.unk19 != 0) { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D8C[r8]); - } - else { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D84[r8]); - } - } - else { - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D28[r8]); - } - } - - if (targetData->frozenClassStatus.status == STATUS_WRAP || targetData->frozenClassStatus.status == STATUS_WRAPPED) { - sub_8076CB4(targetData->unk9C); - } - - // Try revive items - if (targetData->heldItem.flags & ITEM_FLAG_EXISTS) { - // This do/while 0 loop has no effect other than matching asm, and can be removed. - do - { - if (!(ItemSticky(&targetData->heldItem)) && !(ItemInShop(&targetData->heldItem)) && ItemId(&targetData->heldItem) == ITEM_REVIVER_ORB) { - sub_8042148(target); - target->unk22 = 0; - targetData->HP = targetData->maxHPStat; - targetData->unk158 = 0; - targetData->unk14C = 1; - targetData->belly = targetData->maxBelly; - if (targetData->isTeamLeader) { - gDungeon->unk644.unk35 = 0; - gDungeon->unk644.itemHoldersIdentified = 0; - } - ZeroOutItem(&targetData->heldItem); - if (targetData->curseClassStatus.status == STATUS_SNATCH) { - EndCurseClassStatus(attacker, target, STATUS_SNATCH); - } - else if (targetData->curseClassStatus.status == STATUS_DECOY) { - EndCurseClassStatus(attacker, target, STATUS_DECOY); - } - sub_8078084(target); - ResetMonEntityData(targetData, 0); - sub_800DBBC(); - sub_806A390(target); - sub_806CCB4(target, sub_806CEBC(target)); - EntityUpdateStatusSprites(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); - sub_806F63C(target); - return FALSE; - } - } while(0); - } - - if (targetData->isTeamLeader) - { - Item *heldItem = &targetData->heldItem; - if (ItemExists(heldItem) && !(ItemSticky(heldItem)) && ItemId(heldItem) == ITEM_POSSESS_ORB ) { - s32 i; - Entity *teamMember; - - for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - teamMember = gDungeon->teamPokemon[i]; - if (EntityIsValid(teamMember) - && teamMember != target - && CanSeeTarget(target, teamMember) - && abs(teamMember->pos.x - target->pos.x) <= 1 && abs(teamMember->pos.y - target->pos.y) <= 1) - { - break; - } - } - if (i != MAX_TEAM_MEMBERS) { - DungeonPos monPos; // r4 - - sub_8042148(target); - - monPos = teamMember->pos; - sub_8068FE0(teamMember, 0x221, target); - sub_80694C0(target, monPos.x, monPos.y, 1); - sub_804535C(target, NULL); - target->unk22 = 0; - targetData->HP = targetData->maxHPStat; - sub_8042A24(target); - targetData->unk158 = 0; - targetData->unk14C = 1; - targetData->belly = targetData->maxBelly; - if (targetData->isTeamLeader) { - gDungeon->unk644.unk35 = 0; - gDungeon->unk644.itemHoldersIdentified = 0; - } - ZeroOutItem(heldItem); - if (targetData->curseClassStatus.status == STATUS_SNATCH) { - EndCurseClassStatus(attacker, target, STATUS_SNATCH); - } - else if (targetData->curseClassStatus.status == STATUS_DECOY) { - EndCurseClassStatus(attacker, target, STATUS_DECOY); - } - sub_8078084(target); - ResetMonEntityData(targetData, 0); - sub_800DBBC(); - sub_806A390(target); - sub_806CCB4(target, sub_806CEBC(target)); - EntityUpdateStatusSprites(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], teamMember, 0); - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484); - sub_806F63C(target); - return FALSE; - } - - } - - } - - if (IQSkillIsEnabled(target, IQ_ITEM_MASTER)) { - s32 i; // r3 - Item *reviverSeed = NULL; // r4 - if (ItemExists(&targetData->heldItem) && !ItemSticky(&targetData->heldItem) && ItemId(&targetData->heldItem) == ITEM_REVIVER_SEED) - reviverSeed = &targetData->heldItem; - if (reviverSeed == NULL && !targetData->isNotTeamMember) { - for (i = 0; i < INVENTORY_SIZE; i++) { - Item *bagItem = &gTeamInventoryRef->teamItems[i]; - if (!(bagItem->flags & ITEM_FLAG_EXISTS)) - continue; - if (bagItem->flags & ITEM_FLAG_STICKY) - continue; - if (bagItem->id == ITEM_REVIVER_SEED) { - reviverSeed = bagItem; - break; - } - } - } - - if (reviverSeed != NULL) { - sub_8042148(target); - CreateItemWithStickyChance(reviverSeed, ITEM_PLAIN_SEED, FORCE_STICKY_NEVER); - target->unk22 = 0; - targetData->HP = targetData->maxHPStat; - targetData->unk158 = 0; - targetData->unk14C = 1; - targetData->belly = targetData->maxBelly; - if (targetData->isTeamLeader) { - gDungeon->unk644.unk35 = 0; - gDungeon->unk644.itemHoldersIdentified = 0; - } - if (targetData->curseClassStatus.status == STATUS_SNATCH) { - EndCurseClassStatus(attacker, target, STATUS_SNATCH); - } - else if (targetData->curseClassStatus.status == STATUS_DECOY) { - EndCurseClassStatus(attacker, target, STATUS_DECOY); - } - sub_8078084(target); - ResetMonEntityData(targetData, 0); - sub_800DBBC(); - sub_806A390(target); - sub_806CCB4(target, sub_806CEBC(target)); - EntityUpdateStatusSprites(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); - sub_806F63C(target); - return FALSE; - } - } - - if (!targetData->isTeamLeader && ItemExists(&targetData->heldItem)) { - sub_80464C8(target, &target->pos, &targetData->heldItem); - ZeroOutItem(&targetData->heldItem); - } - if (targetData->bossFlag) { - gDungeon->unk644.bossSongIndex = 999; - } - - // Give exp - r10 = FALSE; - if (GetEntityType(attacker) == ENTITY_MONSTER) { - EntityInfo *attackerData = GetEntInfo(attacker); - s32 exp = CalculateEXPGain(targetData->id, targetData->level); - switch (targetData->expMultiplier) { - case EXP_BOOSTED: - exp *= 3; - exp /= 2; - break; - case EXP_HALVED: - exp /= 2; - break; - } - if (exp == 0) - exp = 1; - if (attackerData->isTeamLeader) { - sub_80980B4(targetData->id); - } - if (targetData->grudge) { - attackerData->unk14B = 1; - } - - if (giveExp == TRUE) { - if (!attackerData->isNotTeamMember) { - if (targetData->isNotTeamMember) { - s32 i; - - sub_8071D4C(attacker, attacker, exp); - for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - Entity *teamMember = gDungeon->teamPokemon[i]; - if (EntityIsValid(teamMember) && teamMember != attacker) { - sub_8071D4C(attacker, teamMember, exp); - } - } - r10 = TRUE; - } - } - else { - if (DoEnemiesEvolveWhenKOed(gDungeon->unk644.dungeonLocation.id)) { - attackerData->unk149 = 1; - gDungeon->unkD = 1; - } - } - } - } - - if (EntityIsValid(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && !GetEntInfo(attacker)->isTeamLeader) - r10 = FALSE; - - if (r10) { - struct unkStruct_8069D4C sp; - - sub_8069D4C(&sp, target); - if (sub_806F660(attacker, target)) { - if (!sub_806FA5C(attacker, target, &sp)) { - sub_8068FE0(target, 0x1F5, attacker); - } - else { - gUnknown_202F221 = 1; - } - } - else { - sub_8068FE0(target, arg4, attacker); - } - } - else { - sub_8068FE0(target, arg4, attacker); - } - - return TRUE; -} diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c deleted file mode 100644 index 6a309738e..000000000 --- a/src/code_806E8B0.c +++ /dev/null @@ -1,488 +0,0 @@ -#include "global.h" -#include "constants/ability.h" -#include "structs/str_dungeon.h" -#include "dungeon_pokemon_attributes.h" -#include "status_checks_1.h" -#include "text_util.h" -#include "dungeon_message.h" -#include "string_format.h" -#include "type_effectiveness.h" -#include "constants/move_id.h" -#include "constants/monster.h" -#include "constants/status.h" -#include "constants/type.h" -#include "constants/iq_skill.h" -#include "math.h" -#include "number_util.h" -#include "status.h" -#include "dungeon_random.h" -#include "code_80450F8.h" -#include "code_8045A00.h" -#include "dungeon_items.h" -#include "structs/str_damage.h" -#include "dungeon_util.h" -#include "dungeon_config.h" - -void sub_8042940(Entity *r0); -void sub_80428B0(Entity *r0); -void sub_80428C4(Entity *r0); - -extern void sub_806F500(void); -extern bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct); -extern void sub_8041B74(Entity *pokemon); -extern void sub_8041B5C(Entity *pokemon); -extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); - -extern const s16 gUnknown_810AC60; -extern const s16 gUnknown_810AC68; -extern const s16 gUnknown_810AC64; -extern const s16 gUnknown_810AC66; -extern const s16 gUnknown_810AC68; -extern const s16 gUnknown_810AC62; -extern s48_16 gUnknown_8106F24; -extern s48_16 gUnknown_8106F04; -extern s48_16 gUnknown_8106F1C; -extern s48_16 gUnknown_8106F14; -extern const u8 *const gUnknown_80FAE00; -extern const u8 *const gUnknown_80FADD8; -extern const u8 *const gUnknown_80FEE04; -extern const u8 *const gUnknown_80FEE2C; -extern const u8 *const gUnknown_80FEE54; - -static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, s32 *atkStat, s32 *defStat, s32 rand) -{ - bool32 isNotEnemy; - s32 atkMultiplier = 1; - s32 atkDivisor = 1; - s32 defMultiplier = 1; - s32 defDivisor = 1; - s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0; - - if (AbilityIsActive(attacker, ABILITY_GUTS)) { - EntityInfo *entInfo = GetEntInfo(attacker); - bool8 gutsBoost = HasNegativeStatus(attacker); - bool8 visFlags_attacker_1 = SetVisualFlags(entInfo,1,gutsBoost); - - if (gutsBoost) { - atkMultiplier = 2; - } - if (visFlags_attacker_1) { - sub_80428B0(attacker); - TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE04); // Guts boosted its power - } - } - - if ((AbilityIsActive(attacker, ABILITY_HUGE_POWER)) || (AbilityIsActive(attacker, ABILITY_PURE_POWER))) { - EntityInfo *entInfo = GetEntInfo(attacker); - bool32 hugePowerBoost = (rand < 33 && splitIndex == 0); - bool8 visFlags_attacker_2 = SetVisualFlags(entInfo,0x100,hugePowerBoost); - - if (hugePowerBoost) { - atkMultiplier *= 3; - atkDivisor *= 2; - } - if (visFlags_attacker_2) { - sub_80428C4(attacker); - TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE2C); // It's special ability boosted Attack - } - } - - if ((AbilityIsActive(attacker, ABILITY_HUSTLE)) && (splitIndex == 0)) { - atkMultiplier *= 3; - atkDivisor *= 2; - } - - if (GetEntInfo(attacker)->isNotTeamMember) { - isNotEnemy = FALSE; - } - else { - isNotEnemy = TRUE; - } - - if ((AbilityIsActive(attacker, ABILITY_PLUS)) && (splitIndex == 1) && gDungeon->minusIsActive[isNotEnemy]) { - atkMultiplier *= 15; - atkDivisor *= 10; - } - if ((AbilityIsActive(attacker, ABILITY_MINUS)) && (splitIndex == 1) && gDungeon->plusIsActive[isNotEnemy]) { - atkMultiplier *= 15; - atkDivisor *= 10; - } - - if (AbilityIsActive(target, ABILITY_INTIMIDATE) && (splitIndex == 0)) { - atkMultiplier *= 4; - atkDivisor *= 5; - } - - if ((AbilityIsActive(target, ABILITY_MARVEL_SCALE)) && (splitIndex == 0)) { - EntityInfo *targetInfo = GetEntInfo(target); - bool8 hasNegStatus_target = HasNegativeStatus(target); - bool8 visFlags_target = SetVisualFlags(targetInfo, 8, hasNegStatus_target); - - if (hasNegStatus_target) { - defMultiplier *= 3; - defDivisor *= 2; - } - if (visFlags_target) { - sub_8042940(target); - TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE54); // Its special ability quickened attacks! - } - } - - *atkStat *= atkMultiplier; - *defStat *= defMultiplier; - if (atkDivisor != 1) { - *atkStat = *atkStat / atkDivisor; - } - if (defDivisor != 1) { - *defStat = *defStat / defDivisor; - } -} - -static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType) -{ - dmgStruct->dmg = 1; - dmgStruct->residualDmgType = 0; - dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; - dmgStruct->type = moveType; - dmgStruct->isCrit = FALSE; - dmgStruct->unkE = 0; - dmgStruct->tookNoDamage = FALSE; -} - -void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s24_8 arg8, u16 moveId, bool8 arg_10) -{ - EntityInfo *attackerInfo = GetEntInfo(attacker); - EntityInfo *targetInfo = GetEntInfo(target); - s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0; - - sub_806F500(); - if (!attackerInfo->isTeamLeader && FixedPointToInt(attackerInfo->belly) == 0) { - SetDamageOne(dmgStruct, moveType); - } - else if (moveId == MOVE_REGULAR_ATTACK && AbilityIsActive(target, ABILITY_WONDER_GUARD)) { - SetDamageOne(dmgStruct, moveType); - } - else { - s32 atkStatStage, defStatStage; - s24_8 statCalc; - s32 atkStat, defStat; - s32 rand; - s32 r6; - s48_16 unkSp1; - s48_16 unkSp2; - s48_16 unkSp3; - s48_16 unkSp4; - s48_16 unkSp5; - s48_16 unkSp6; - s48_16 unkSp7; - s48_16 unkSp8; - s48_16 unkSp9; - s48_16 unkSp10; - s48_16 unkSp11; - bool8 r5; - - dmgStruct->type = moveType; - gDungeon->unk134.unk134 = moveType; - gDungeon->unk134.unk138 = splitIndex; - - atkStatStage = attackerInfo->offensiveStages[splitIndex]; - if (arg_10 && moveType == TYPE_FIRE) { - atkStatStage += attackerInfo->flashFireBoost; - gDungeon->unk134.unk140[2] = attackerInfo->flashFireBoost; - } - if (attackerInfo->apparentID == MONSTER_DEOXYS_ATTACK) { - atkStatStage += 2; - } - if (attackerInfo->apparentID == MONSTER_DEOXYS_DEFENSE) { - atkStatStage -= 2; - } - if (attackerInfo->apparentID == MONSTER_DEOXYS_SPEED) { - atkStatStage -= 2; - } - - if (atkStatStage < 0) atkStatStage = 0; - if (atkStatStage > 20) atkStatStage = 20; - - gDungeon->unk134.unk13E[0] = atkStatStage; - gDungeon->unk134.unk140[0] = attackerInfo->atk[splitIndex] + movePower; - statCalc = s24_8_mul(IntToF248(attackerInfo->atk[splitIndex] + movePower), gAtkStatStageMultipliers[atkStatStage]); - statCalc = s24_8_mul(statCalc, attackerInfo->offensiveMultipliers[splitIndex]); - atkStat = F248ToInt(statCalc); - - defStatStage = targetInfo->defensiveStages[splitIndex]; - if (splitIndex == 0 && targetInfo->bideClassStatus.status == STATUS_SKULL_BASH) { - gDungeon->unk134.unk17A = 1; - defStatStage++; - } - if (targetInfo->apparentID == MONSTER_DEOXYS_ATTACK) { - defStatStage -= 2; - } - if (targetInfo->apparentID == MONSTER_DEOXYS_DEFENSE) { - defStatStage += 2; - } - if (targetInfo->apparentID == MONSTER_DEOXYS_SPEED) { - defStatStage -= 2; - } - - if (defStatStage < 0) defStatStage = 0; - if (defStatStage > 20) defStatStage = 20; - - gDungeon->unk134.unk13E[1] = defStatStage; - gDungeon->unk134.unk140[1] = targetInfo->def[splitIndex]; - statCalc = s24_8_mul(IntToF248(targetInfo->def[splitIndex]), gDefStatStageMultipliers[defStatStage]); - statCalc = s24_8_mul(statCalc, targetInfo->defensiveMultipliers[splitIndex]); - defStat = F248ToInt(statCalc); - - rand = DungeonRandInt(100); - if (splitIndex == 0) { - if (HasHeldItem(attacker, ITEM_POWER_BAND)) { - atkStat += gUnknown_810AC60; - gDungeon->unk134.unk160 += gUnknown_810AC60; - } - if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { - atkStat += gUnknown_810AC68; - gDungeon->unk134.unk160 += gUnknown_810AC68; - } - if (arg_10 && HasHeldItem(target, ITEM_DEF_SCARF)) { - defStat += gUnknown_810AC64; - gDungeon->unk134.unk162 += gUnknown_810AC64; - } - } - else { - if (arg_10 && HasHeldItem(target, ITEM_ZINC_BAND)) { - defStat += gUnknown_810AC66; - gDungeon->unk134.unk163 += gUnknown_810AC66; - } - if (HasHeldItem(attacker, ITEM_SPECIAL_BAND)) { - atkStat += gUnknown_810AC62; - gDungeon->unk134.unk161 += gUnknown_810AC62; - } - if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { - atkStat += gUnknown_810AC68; - gDungeon->unk134.unk161 += gUnknown_810AC68; - } - } - - gDungeon->unk134.unk140[3] = atkStat; - gDungeon->unk134.unk140[4] = defStat; - if (atkStat < 0) atkStat = 0; - if (atkStat >= 999) atkStat = 999; - - attackerInfo->previousVisualFlags &= ~(0x100); - attackerInfo->visualFlags &= ~(0x100); - ApplyAtkDefStatBoosts(attacker, target, moveType, &atkStat, &defStat, rand); - FP48_16_FromS32(&unkSp1, atkStat - defStat); - FP48_16_FromS32(&unkSp2, 8); - F48_16_SDiv(&unkSp1, &unkSp1, &unkSp2); - if (!attackerInfo->isNotTeamMember) { - FP48_16_FromS32(&unkSp2, attackerInfo->level); - unkSp3.hi = 0; - unkSp3.lo = 0xAAAA; - F48_16_SMul(&unkSp2, &unkSp2, &unkSp3); - r6 = (attackerInfo->level * 2) / 3; - } - else { - s32 unkAtkStat2 = attackerInfo->atk[splitIndex]; - s32 unkDefStat2 = 1; - ApplyAtkDefStatBoosts(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); - FP48_16_FromS32(&unkSp2, unkAtkStat2); - FP48_16_FromS32(&unkSp3, 3); - F48_16_SDiv(&unkSp2, &unkSp2, &unkSp3); - r6 = unkAtkStat2 / 3; - } - FP48_16_Add(&unkSp4, &unkSp1, &unkSp2); - gDungeon->unk134.unk140[5] = r6; - gDungeon->unk134.unk140[6] = FP48_16_ToS32(&unkSp4); - unkSp5 = unkSp4; - unkSp7 = unkSp4; - F48_16_SMul(&unkSp5, &unkSp5, &unkSp5); - unkSp6.hi = 0; - unkSp6.lo = 0xCCC; - F48_16_SMul(&unkSp5, &unkSp5, &unkSp6); - FP48_16_FromS32(&unkSp6, 2); - F48_16_SMul(&unkSp7, &unkSp7, &unkSp6); - FP48_16_FromS32(&unkSp6, defStat); - FP48_16_Subtract(&unkSp7, &unkSp7, &unkSp6); - FP48_16_FromS32(&unkSp6, 10); - FP48_16_Add(&unkSp7, &unkSp7, &unkSp6); - FP48_16_Add(&unkSp8, &unkSp5, &unkSp7); - if (FP48_16_SLessThan(&gUnknown_8106F24, &unkSp8)) { - unkSp8 = gUnknown_8106F24; - } - if (FP48_16_SLessThan(&unkSp8, &gUnknown_8106F04)) { - unkSp8 = gUnknown_8106F04; - } - r5 = sub_806E100(&unkSp9, attacker, target, moveType, dmgStruct); - - if (moveType == TYPE_FIRE) { - s32 flashFireStatus = GetFlashFireStatus(target); - if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) { - targetInfo->unk152 = 1; - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger! - } - else { - TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FADD8); // m1 used Flash Fire to absorb fire! - } - } - } - if (arg_10) { - if (splitIndex == 0 && targetInfo->reflectClassStatus.status == STATUS_REFLECT) { - sub_8041B74(target); - F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); - gDungeon->unk134.unk166 = 1; - } - if (splitIndex == 1 && targetInfo->reflectClassStatus.status == STATUS_LIGHT_SCREEN) { - sub_8041B5C(target); - F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); - gDungeon->unk134.unk167 = 1; - } - } - - // Check crit - if (!AbilityIsActive(target, ABILITY_BATTLE_ARMOR) && !AbilityIsActive(target, ABILITY_SHELL_ARMOR)) { - s32 critOdds; - - if (attackerInfo->isNotTeamMember) { - critOdds = 0; - } - else { - critOdds = critChance; - } - - if (attackerInfo->sureShotClassStatus.status == STATUS_FOCUS_ENERGY) { - critOdds = 999; - gDungeon->unk134.unk168 = 1; - } - else { - if (HasHeldItem(attacker, ITEM_SCOPE_LENS)) { - critOdds += gCritOddsScopeLensPatsyBand; - gDungeon->unk134.unk164 = 1; - } - if (HasHeldItem(target, ITEM_PATSY_BAND)) { - critOdds += gCritOddsScopeLensPatsyBand; - gDungeon->unk134.unk165 = 1; - } - if (r5 && IQSkillIsEnabled(attacker, IQ_TYPE_ADVANTAGE_MASTER)) { - critOdds = gCritOddsIqAdvantageMaster; - gDungeon->unk134.unk169 = 1; - } - } - if (DungeonRandInt(100) < critOdds) { - F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F14); - dmgStruct->isCrit = TRUE; - } - } - - gDungeon->unk134.unk154 = FP48_16_ToS32(&unkSp8); - F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); - { - // Ugly hack needed to match - #ifdef NONMATCHING - s24_8 arg8_Match; - #else - register s24_8 arg8_Match asm("r2"); - #endif // NONMATCHING - - gDungeon->unk134.unk15C = arg8_Match = arg8; - FP48_16_FromF248(&unkSp10, arg8_Match); - F48_16_SMul(&unkSp8, &unkSp8, &unkSp10); - } - - // ALSO needed to match. unk694 chosen randomly and it worked with matching. - ASM_MATCH_TRICK(gDungeon->unk644.unk50); - gDungeon->unk134.unk150 = FP48_16_ToS32(&unkSp8); - { - s32 rnd = DungeonRandInt(0x4000); - unkSp9.hi = 0; - unkSp9.lo = 0xE000 + rnd; - } - F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); - FP48_16_FromS32(&unkSp11, 100); - - F48_16_SMul(&unkSp9, &unkSp11, &unkSp9); - gDungeon->unk134.unk158 = FP48_16_ToS32(&unkSp9); - - dmgStruct->dmg = FP48_16_ToS32(&unkSp8); - dmgStruct->residualDmgType = 0; - if (dmgStruct->dmg == 0) { - dmgStruct->isCrit = FALSE; - } - } -} - -void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct) -{ - s48_16 unkSp1; - s48_16 unkSp2; - s32 a2New = a2; - - if (a2New <= 0) a2New = 1; - if (a2New > 999) a2New = 999; - - dmgStruct->type = moveType; - sub_806E100(&unkSp1, attacker, target, moveType, dmgStruct); - FP48_16_FromS32(&unkSp2, a2New); - F48_16_SMul(&unkSp2, &unkSp2, &unkSp1); - dmgStruct->dmg = FP48_16_ToS32(&unkSp2); - dmgStruct->residualDmgType = 0; -} - -void DealDamageToEntity(Entity *entity, s32 dmg, s32 r6, s16 r4) -{ - Entity spEntity; - struct DamageStruct dmgStruct; - s32 r4_ = r4; - - sub_80457DC(&spEntity); - dmgStruct.dmg = dmg; - dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL; - dmgStruct.type = TYPE_NONE; - dmgStruct.residualDmgType = r6; - dmgStruct.isCrit = FALSE; - dmgStruct.unkE = 0; - dmgStruct.tookNoDamage = FALSE; - HandleDealingDamage(&spEntity, entity, &dmgStruct, FALSE, FALSE, r4_, FALSE, 0); -} - -void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 giveExp, bool8 *tookNoDamage, u8 moveType, s16 arg_8, s32 residualDmgType, s32 arg_10, s32 arg_14) -{ - s32 i; - struct DamageStruct dmgStruct; - s32 arg_8_ = arg_8; - s32 dmgNew = dmg; - - dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL; - dmgStruct.residualDmgType = residualDmgType; - dmgStruct.type = moveType; - dmgStruct.isCrit = FALSE; - dmgStruct.unkE = 0; - - if (moveType != TYPE_NONE) { - s32 typeEffectiveness[2]; - EntityInfo *targetInfo = GetEntInfo(target); - for (i = 0; i < 2; i++) { - s32 effectiv = gTypeEffectivenessChart[moveType][targetInfo->types[i]]; - typeEffectiveness[i] = effectiv; - } - if (AbilityIsActive(target, ABILITY_WONDER_GUARD)) { - if (gEffectivenessChart[typeEffectiveness[0]][typeEffectiveness[1]] != EFFECTIVENESS_SUPER) { - dmgNew = 0; - } - } - } - - dmgStruct.dmg = dmgNew; - if (dmgNew == 0) { - dmgStruct.tookNoDamage = TRUE; - } - else { - dmgStruct.tookNoDamage = FALSE; - } - - HandleDealingDamage(pokemon, target, &dmgStruct, FALSE, giveExp, arg_8_, arg_10, arg_14); - if (tookNoDamage != NULL) { - *tookNoDamage = dmgStruct.tookNoDamage; - } -} diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index 5c55d96ec..4ef8de5b9 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -1,21 +1,20 @@ #include "global.h" +#include "globaldata.h" #include "constants/type.h" #include "structs/str_pokemon.h" #include "dungeon_main.h" #include "dungeon_misc.h" #include "code_80118A4.h" #include "code_803E668.h" -#include "code_8045A00.h" #include "dungeon_message.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "code_8097670.h" #include "dungeon.h" #include "dungeon_items.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "friend_area.h" #include "pokemon.h" #include "pokemon_3.h" @@ -25,19 +24,10 @@ #include "dungeon_util_1.h" #include "math.h" #include "dungeon_config.h" +#include "dungeon_strings.h" #include "string_format.h" extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE]; -extern s32 gUnknown_8106F7C[]; - -extern u8 *gUnknown_80FA0F0[]; -extern u8 *gUnknown_80FA058[]; -extern u8 *gUnknown_80FA030[]; -extern u8 *gUnknown_80F9FE8[]; -extern u8 *gUnknown_80FA004[]; -extern u8 *gUnknown_80FA0C8[]; -extern u8 *gUnknown_80FA120[]; -extern u8 *gUnknown_80FA090[]; u8 sub_806B8CC(); void sub_8083D88(); @@ -46,134 +36,6 @@ void nullsub_96(Entity *pokemon,Entity *target); u8 sub_8097900(s16); void sub_806F910(void); u8 sub_806F9BC(s16); -extern void sub_803F508(Entity *); - -void SetShopkeeperAggression(Entity *pokemon, Entity *target) -{ - EntityInfo *info; - - info = GetEntInfo(target); - - if(info->shopkeeper != SHOPKEEPER_MODE_NORMAL) - { - if(GetEntityType(pokemon) == ENTITY_MONSTER) - { - if(GetEntInfo(pokemon)->isNotTeamMember) - { - info->shopkeeper = SHOPKEEPER_MODE_ATTACK_ENEMIES; - } - else - { - info->shopkeeper = SHOPKEEPER_MODE_ATTACK_TEAM; - } - } - } -} - -void sub_806F480(Entity *pokemon, u8 r1) -{ - EntityInfo *info; - - info = GetEntInfo(pokemon); - - if(info->shopkeeper != SHOPKEEPER_MODE_NORMAL) - { - if(r1) - { - info->shopkeeper = SHOPKEEPER_MODE_ATTACK_ENEMIES; - } - else - { - info->shopkeeper = SHOPKEEPER_MODE_ATTACK_TEAM; - } - } -} - -u8 sub_806F4A4(Entity *pokemon, u8 type) { - - EntityInfo *info = GetEntInfo(pokemon); - s32 index; - - if(MonsterIsType(pokemon, TYPE_GHOST)) - { - if(type == TYPE_NORMAL || type == TYPE_FIGHTING) - if(!info->exposed) - return FALSE; - } - for(index = 0; index < 2; index++) - { - if(gTypeEffectivenessChart[type][info->types[index]] == EFFECTIVENESS_IMMUNE) - return FALSE; - } - return TRUE; -} - -void sub_806F500(void) -{ - struct unkStruct_Dungeon134_sub *temp; - - temp = &gDungeon->unk134; - - temp->unk134 = 0; - temp->unk138 = 0; - temp->unk13C[0] = 0; - temp->unk13C[1] = 0; - temp->unk13E[0] = 0xA; - temp->unk13E[1] = 0xA; - temp->unk140[0] = 1; - temp->unk140[1] = 1; - temp->unk140[2] = 0; - temp->unk140[4] = 0; - temp->unk140[3] = 0; - temp->unk140[5] = 0; - temp->unk140[6] = 0; - temp->unk150 = 0; - temp->unk158 = 0; - temp->unk15C = F248_ZERO; - temp->unk160 = 0; - temp->unk161 = 0; - temp->unk162 = 0; - temp->unk163 = 0; - temp->unk164 = 0; - temp->unk165 = 0; - temp->unk166 = 0; - temp->unk167 = 0; - temp->unk168 = 0; - temp->unk169 = 0; - temp->unk16A = 0; - temp->unk16C = 0; - temp->unk16B = 0; - temp->unk16D = 0; - temp->fill16E[0] = 0; - temp->fill16E[1] = 0; - temp->fill16E[2] = 0; - temp->fill16E[3] = 0; - temp->fill16E[4] = 0; - temp->fill16E[5] = 0; - temp->fill16E[6] = 0; - temp->fill16E[7] = 0; - temp->fill16E[8] = 0; - temp->fill16E[9] = 0; - temp->fill16E[10] = 0; - temp->pokemonExposed = FALSE; - temp->unk17A = 0; -} - -s32 sub_806F62C(int param_1) -{ - return gUnknown_8106F7C[param_1]; -} - -void sub_806F63C(Entity *param_1) -{ - UnkDungeonGlobal_unk181E8_sub *temp; - - temp = &gDungeon->unk181e8; - - if (temp->cameraTarget == param_1) { - sub_803F508(temp->cameraTarget); - } -} bool8 sub_806F660(Entity *pokemon, Entity *target) { @@ -286,7 +148,6 @@ bool8 sub_806F660(Entity *pokemon, Entity *target) return TRUE; } - void nullsub_96(Entity *pokemon,Entity *target) {} @@ -391,9 +252,9 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa sub_806CE68(entity2, direction); CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[0],param_3->id); - if (DisplayDungeonYesNoMessage(0,*gUnknown_80F9FE8,1) == 0) { + if (DisplayDungeonYesNoMessage(0,gUnknown_80F9FE8,1) == 0) { if (param_3->id != MONSTER_JIRACHI) { - LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA004); + LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA004); } return 0; } @@ -406,7 +267,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } if (pokeIndex == MAX_TEAM_MEMBERS) { - LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA030); + LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA030); return FALSE; } else { @@ -447,25 +308,25 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa IncrementAdventureNumJoined(); if (sub_806B8CC(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) { - LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA058); + LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA058); pokeStruct2->unk0 = 0; } else { sub_8083D88(); sub_803E708(0xa0,0x46); - if (DisplayDungeonYesNoMessage(0,*gUnknown_80FA090,1) == 1) { + if (DisplayDungeonYesNoMessage(0,gUnknown_80FA090,1) == 1) { while (DungeonGiveNameToRecruitedMon(pokeStruct2->name) == 0) { - DisplayDungeonMessage(0,*gUnknown_80FA0C8,1); + DisplayDungeonMessage(0,gUnknown_80FA0C8,1); } } sub_808D9DC(gFormatBuffer_Monsters[0],pokeStruct2,0); - LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA0F0); + LogMessageByIdWithPopupCheckUser(entity1,gUnknown_80FA0F0); if (flag) { leader = xxx_call_GetLeader(); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); sub_8092558(gFormatBuffer_FriendArea,friendArea); PlaySound(0xce); - DisplayDungeonMessage(0,*gUnknown_80FA120,1); + DisplayDungeonMessage(0,gUnknown_80FA120,1); } if (param_3->id == MONSTER_MEW) { gDungeon->unk4 = 1; @@ -586,9 +447,9 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) pokeStruct2->unk0 = 0; } else { - if (DisplayDungeonYesNoMessage(0,*gUnknown_80FA090,1) == 1) { + if (DisplayDungeonYesNoMessage(0,gUnknown_80FA090,1) == 1) { while (!DungeonGiveNameToRecruitedMon(buffer)) { - DisplayDungeonMessage(0,*gUnknown_80FA0C8,1); + DisplayDungeonMessage(0,gUnknown_80FA0C8,1); } } if (flag) { @@ -596,7 +457,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); sub_8092558(gFormatBuffer_FriendArea,friendArea); PlaySound(0xce); - DisplayDungeonMessage(0,*gUnknown_80FA120,1); + DisplayDungeonMessage(0,gUnknown_80FA120,1); } sub_808D9DC(gFormatBuffer_Monsters[3],pokeStruct2,0); *entityPtr = local_2c; diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 3c04e2937..0a90e9544 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -1,13 +1,10 @@ #include "global.h" +#include "globaldata.h" #include "constants/tactic.h" -#include "dungeon_capabilities.h" #include "dungeon_config.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_leader.h" #include "dungeon_message.h" #include "code_8041AD0.h" -#include "code_80450F8.h" -#include "code_8045A00.h" #include "code_8077274_1.h" #include "constants/dungeon.h" #include "dungeon_map_access.h" @@ -15,30 +12,28 @@ #include "dungeon_util.h" #include "dungeon.h" #include "pokemon_3.h" -#include "status_checks_1.h" #include "code_805D8C8.h" #include "structs/str_806B7F8.h" +#include "dungeon_logic.h" +#include "dungeon_strings.h" +#include "dungeon_menu_moves.h" +#include "code_803E668.h" +#include "code_806CD90.h" +#include "moves.h" +#include "pokemon_mid.h" +#include "structs/dungeon_entity.h" +#include "structs/map.h" +#include "structs/str_pokemon.h" +#include "structs/str_806B7F8.h" EWRAM_DATA s32 gUnknown_202F31C[2] = {0, 0}; EWRAM_DATA s32 gUnknown_202F324[2] = {0, 0}; -extern u8 *gUnknown_80F9ACC[]; -extern u8 *gUnknown_80F9AEC[]; -extern u8 *gUnknown_80F9B10[]; -extern u8 *gUnknown_80F9B34[]; -extern u8 *gUnknown_80F9B58[]; -extern u8 *gUnknown_80F9B74[]; -extern u8 *gUnknown_80F9B94[]; -extern u8 *gUnknown_80F9E64[]; -extern u8 *gUnknown_80F9E80[]; -extern u8 *gUnknown_80F9EC8[]; -extern u8 *gUnknown_80F9EEC[]; -extern u8 *gUnknown_80FCF18[]; -extern u8 *gUnknown_80FED68[]; -extern u8 *gUnknown_80FF730[]; -extern u8 gUnknown_8107010[8]; -extern u8 *gUnknown_8107018[3]; - +extern void ResetMonEntityData(EntityInfo *, u32); +void sub_8069E0C(Entity *pokemon); +void sub_8042A44(Entity *r0); +void sub_8083D78(void); +extern bool8 sub_803D930(u32); void sub_8083D58(void); void sub_8072778(Entity *, Entity *, u8, u8); bool8 sub_80725A4(Entity *, Entity *); @@ -47,110 +42,19 @@ bool8 sub_80723D0(Entity *, Entity *, u8, u8); void sub_807218C(Entity *); void sub_806A2BC(Entity *, u32); void sub_806A3D4(u8 *, s32, s32, s32); -extern void sub_8042920(struct Entity *r0); -extern s16 sub_803D970(u32); -extern s32 sub_803DA20(s32 param_1); -extern bool8 sub_806AA0C(s32, u32); -extern bool8 sub_8083660(DungeonPos *param_1); + extern bool8 sub_803D930(u32); extern void sub_8072B78(Entity *pokemon, Entity *target, s16 id); +extern s32 GetMovesLearnedAtLevel(u16* dst, s16 species, s32 level, s32 IQPoints); -void sub_8071B48(void) -{ - const Tile *tile; - struct Entity *entity2; - struct Entity *entity; - int index; - int index1; - int counter; - struct Entity *entityPtr; - s32 level; - struct Dungeon *dungeon; // feels like a hack - struct unkStruct_806B7F8 local_2c; +void sub_8072B24(Entity *entity, Move *moves); - entityPtr = NULL; - dungeon = gDungeon; - if ((dungeon->unk644.unk20 != 0) && - ((dungeon->unk644.dungeonLocation.id != DUNGEON_METEOR_CAVE || (dungeon->unk37FD == 0)))) { - dungeon->unk644.unk1E++; - if (dungeon->unk644.unk2A == 0) { - if ( dungeon->unk644.unk1E < gUnknown_80F4DAA) { - return; - } - } - else { - if ( dungeon->unk644.unk1E < gUnknown_80F4DAC) { - return; - } - } - - if (dungeon->unk644.unk1E > 900) { - entity2 = dungeon->unk17B34; - if ((EntityIsValid(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity2,0); - entityPtr = entity2; - } - } - - dungeon->unk644.unk1E = 0; - dungeon->unk17B34 = NULL; - - counter = 0; - for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) - { - entity = dungeon->wildPokemon[index]; - if ((EntityIsValid(entity)) && - (tile = GetTile((entity->pos).x, (entity->pos).y), - (tile->terrainType & 0x100) == 0)) { - counter++; - } - } - if (dungeon->unk644.unk2A == 0) { - if (gDungeon->monsterHouseRoom == 0xff) { - if (counter >= gUnknown_80F4DA6) { - return; - } - } - else - { - if (counter >= gUnknown_80F4DA8) { - return; - } - } - - } - if (entityPtr != NULL) { - DisplayDungeonLoggableMessageTrue(0,*gUnknown_80FED68); - sub_8042920(entityPtr); - } - if (dungeon->unk644.unk2A != 0) { - index1 = 0x17c; - } - else { - index1 = sub_803D970(0); - } - - level = sub_803DA20(index1); - if (level == 0) { - level = 1; - } - if ((sub_806AA0C(index1, 0)) && (sub_8083660(&local_2c.pos))) { - local_2c.species = index1; - local_2c.level = level; - local_2c.unk2 = 0; - if(DungeonRandInt(100) < GetRandomMovementChance(gDungeon->unk644.dungeonLocation.id)) - { - local_2c.unk4 = 1; - } - else - { - local_2c.unk4 = 0; - } - local_2c.unk10 = 0; - sub_806B7F8(&local_2c, FALSE); - } - } -} +static const u8 gUnknown_8107010[8] = {0, 1, 1, 2, 1, 1, 0, 0}; +static const u8 * const gUnknown_8107018[3] = { + _(""), + _("{WAIT_PRESS}\n"), + _("\n"), +}; void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp) { @@ -226,7 +130,7 @@ void sub_8071DA4(Entity *entity) info->exp += expGained; gFormatArgs[0] = expGained; SetMessageArgument_2(gFormatBuffer_Monsters[0],info,0); - TryDisplayDungeonLoggableMessage3(entityPtr,target,*gUnknown_80F9E64); // $m0 gained $d0 Exp Points + TryDisplayDungeonLoggableMessage3(entityPtr,target,gUnknown_80F9E64); // $m0 gained $d0 Exp Points flag = sub_80723D0(entityPtr,target,1,1); } } @@ -266,7 +170,7 @@ void sub_8071DA4(Entity *entity) if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); CopyTacticsNameToBuffer(gFormatBuffer_Items[0],tacticIndex); - TryDisplayDungeonLoggableMessage3(entityPtr,target,*gUnknown_80FF730); // $i0 was added to $m0's list of usable tactics + TryDisplayDungeonLoggableMessage3(entityPtr,target,gUnknown_80FF730); // $i0 was added to $m0's list of usable tactics } } } @@ -331,7 +235,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); CopyTacticsNameToBuffer(gFormatBuffer_Items[0],tacticIndex); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF730); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FF730); } } } @@ -339,7 +243,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para info->unk149 = 0; if ((flag == 0) && (param_4 != 0)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F9B74); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80F9B74); } } } @@ -378,7 +282,7 @@ void sub_807218C(Entity *pokemon) } else { - strcpy(buffer, *gUnknown_80FCF18); + strcpy(buffer, gUnknown_80FCF18); } DisplayDungeonMessage(0, buffer, 1); buffer[0] = 0; @@ -386,7 +290,7 @@ void sub_807218C(Entity *pokemon) if(gFormatArgs[0]> 0) { - strcat(buffer, *gUnknown_80F9ACC); + strcat(buffer, gUnknown_80F9ACC); r6++; } @@ -394,28 +298,28 @@ void sub_807218C(Entity *pokemon) { if(gUnknown_8107010[r6] != 0) strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); - strcat(buffer, *gUnknown_80F9AEC); + strcat(buffer, gUnknown_80F9AEC); r6++; } if(gFormatArgs[2]> 0) { if(gUnknown_8107010[r6] != 0) strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); - strcat(buffer, *gUnknown_80F9B10); + strcat(buffer, gUnknown_80F9B10); r6++; } if(gFormatArgs[3]> 0) { if(gUnknown_8107010[r6] != 0) strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); - strcat(buffer, *gUnknown_80F9B34); + strcat(buffer, gUnknown_80F9B34); r6++; } if(gFormatArgs[4]> 0) { if(gUnknown_8107010[r6] != 0) strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); - strcat(buffer, *gUnknown_80F9B58); + strcat(buffer, gUnknown_80F9B58); } if(buffer[0]) @@ -454,7 +358,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level) if(!flag) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9B94); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80F9B94); } } } @@ -495,7 +399,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) gFormatArgs[0] = level; SetMessageArgument_2(gFormatBuffer_Monsters[0], info, 0); - DisplayDungeonLoggableMessage(target, *gUnknown_80F9E80); + DisplayDungeonLoggableMessage(target, gUnknown_80F9E80); } else { @@ -503,7 +407,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) sub_8083D58(); gFormatArgs[0] = level; SetMessageArgument_2(gFormatBuffer_Monsters[0], info, 0); - DisplayDungeonLoggableMessageTrue(target, *gUnknown_80F9E80); + DisplayDungeonLoggableMessageTrue(target, gUnknown_80F9E80); } } flag = TRUE; @@ -650,12 +554,267 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target) { gFormatArgs[0] = info->level; sub_80421C0(target, 0xD3 << 1); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9EC8); // $m0 dropped to Level $d0! + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80F9EC8); // $m0 dropped to Level $d0! return TRUE; } else { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9EEC); // $m0's level didn't drop! + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80F9EEC); // $m0's level didn't drop! return FALSE; } } + +void sub_8072778(Entity *pokemon, Entity *target, u8 param_2, u8 param_3) +{ + s32 i, j; + u16 learnedMoves[16]; + Move localMoves[8]; + u8 text[0x64]; + s32 count; + EntityInfo *info = GetEntInfo(target); + bool8 sp_0xCC = FALSE; + + if (info->isNotTeamMember) { + param_3 = 0; + param_2 = 0; + } + + count = GetMovesLearnedAtLevel(learnedMoves, info->id, info->level, info->IQ); + unk_CopyMoves4To8AndClearFlag2Unk4(localMoves, info->moves.moves); + + if (count != 0) { + s32 randIndex = DungeonRandInt(count); + for (j = 0; j < 8; j++) { + if(!MoveFlagExists(&localMoves[j])) { + InitPokemonMove(&localMoves[j], learnedMoves[randIndex]); + localMoves[j].moveFlags2 |= 4; + break; + } + } + } + + for (i = 0; i < 0x1E; i++) { + count = 0; + for (j = 0; j < 8; j++) { + if (MoveFlagExists(&localMoves[j])) { + count++; + } + } + + if (count <= MAX_MON_MOVES) { + s32 i; + bool8 r3 = FALSE; + + for (i = 0; i < count; i++) { + info->moves.moves[i] = localMoves[i]; + if((info->moves.moves[i].moveFlags2 & 4)) + { + info->moves.moves[i].moveFlags2 &= 0xFB; + BufferMoveName(text, &info->moves.moves[i], 0); + r3 = TRUE; + } + } + for (; i < MAX_MON_MOVES; i++) { + ResetMoveFlags(&info->moves.moves[i]); + } + + if (r3 && param_2) { + SetMessageArgument_2(gFormatBuffer_Monsters[0], info, 0); + strcpy(gFormatBuffer_Items[0], text); + sub_80421C0(target, 312); + DisplayDungeonLoggableMessage(target, gUnknown_80F9F04); + } + + return; + } + + if (!info->isNotTeamMember && param_3) { + if (!sp_0xCC && param_2) { + sub_803E708(0xA, 0x6); + DisplayDungeonMessage(0, gUnknown_80F9FA4, 1); + } + sp_0xCC = 1; + sub_8063E70(target, localMoves, 1, 0); + } + else { + sub_8072B24(target, localMoves); + } + } +} + +bool8 sub_8072938(Entity *target, u16 moveId) +{ + s32 i, j; + Move localMoves[8]; + u8 text[0x64]; + s32 count; + EntityInfo *info = GetEntInfo(target); + bool8 r10 = FALSE; + + unk_CopyMoves4To8AndClearFlag2Unk4(localMoves, info->moves.moves); + for (j = 0; j < 8; j++) { + if(!(MoveFlagExists(&localMoves[j]))) { + InitPokemonMove(&localMoves[j], moveId); + localMoves[j].moveFlags2 |= 4; + break; + } + } + + for (i = 0; i < 0x1E; i++) { + count = 0; + for (j = 0; j < 8; j++) { + if (MoveFlagExists(&localMoves[j])) { + count++; + } + } + + if (count <= MAX_MON_MOVES) { + s32 i; + + for (i = 0; i < count; i++) { + info->moves.moves[i] = localMoves[i]; + if((info->moves.moves[i].moveFlags2 & 4)) + { + info->moves.moves[i].moveFlags2 &= 0xFB; + BufferMoveName(text, &info->moves.moves[i], 0); + r10 = TRUE; + } + } + for (; i < MAX_MON_MOVES; i++) { + ResetMoveFlags(&info->moves.moves[i]); + } + + if (r10) { + if (!info->isNotTeamMember) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + strcpy(gFormatBuffer_Items[0], text); + sub_80421C0(target, 312); + DisplayDungeonLoggableMessage(target, gUnknown_80F9F04); + } + } + + break; + } + + r10 = FALSE; + + if (!info->isNotTeamMember) { + DisplayDungeonMessage(0, gUnknown_80FDF40, 1); + if (!sub_8063E70(target, localMoves, TRUE, TRUE)) { + return FALSE; + } + } + } + + if (!r10 && !info->isNotTeamMember) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + DisplayDungeonLoggableMessage(target, gUnknown_80F9F2C); + } + return TRUE; +} + +void sub_8072AC8(s16 *param_1, s16 species, s32 param_3) +{ + const u8 *levelUpMoves; + s32 arrIndex; + s32 counter; + u16 moveIDs [2]; + s32 species_s32; + s32 index; + + species_s32 = species; + + for(index = 0; index < MAX_MON_MOVES; index++) { + param_1[index] = MOVE_NOTHING; + } + + counter = 0; + levelUpMoves = GetLevelUpMoves(species_s32); + + while( 1 ) { + if (*levelUpMoves == 0) { + return; + } + levelUpMoves = DecompressMoveID(levelUpMoves,moveIDs); + if (*levelUpMoves++ > param_3) break; + if (counter == MAX_MON_MOVES) { + arrIndex = DungeonRandInt(MAX_MON_MOVES); + counter = MAX_MON_MOVES; + } + else { + arrIndex = counter; + counter++; + } + param_1[arrIndex] = moveIDs[0]; + } +} + +void sub_8072B24(Entity *entity, Move *moves) +{ + int index; + int count; + + count = 0; + for(index = 0; index < 8; index++) + { + if (moves[index].moveFlags & MOVE_FLAG_EXISTS) { + moves[index].moveFlags &= 0xfd; + count++; + } + } + index = DungeonRandInt(count); + for (; index < 7; index++) { + moves[index] = moves[index + 1]; + } + moves[7].moveFlags = 0; +} + +static inline void fu(EntityInfo *entityInfo, s16 id) +{ + ++id; --id; + entityInfo->apparentID = id; + entityInfo->id = id; +} + +void sub_8072B78(Entity *pokemon, Entity *target, s16 id) +{ + OpenedFile *file; + const Tile *tile; + int index; + s32 id_s32; + EntityInfo *entityInfo; + LevelData levelData; + struct unkStruct_806B7F8 local_2c; + + id_s32 = id; + entityInfo = GetEntInfo(target); + SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); + CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1],id_s32); + file = GetSpriteData(id_s32); + fu(entityInfo, id_s32); + GetPokemonLevelData(&levelData,id_s32,entityInfo->level); + entityInfo->exp = levelData.expRequired; + target->axObj.spriteFile = file; + ResetMonEntityData(entityInfo,0); + sub_8069E0C(target); + sub_806CCB4(target,7); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FE2EC); + sub_8042A44(target); + sub_8083D78(); + if (id_s32 == MONSTER_NINJASK) { + for (index = 0; index < 8; index++) { + tile = GetTile(gAdjacentTileOffsets[index].x + target->pos.x,gAdjacentTileOffsets[index].y + target->pos.y); + if (sub_807034C(MONSTER_SHEDINJA,tile) == 0) break; + } + if (sub_803D930(MONSTER_SHEDINJA)) { + local_2c.species = MONSTER_SHEDINJA; + local_2c.level = entityInfo->level; + local_2c.unk2 = 0; + local_2c.pos.x = gAdjacentTileOffsets[index].x + target->pos.x; + local_2c.pos.y = gAdjacentTileOffsets[index].y + target->pos.y; + local_2c.unk4 = 0; + local_2c.unk10 = 0; + sub_806B7F8(&local_2c, TRUE); + } + } +} diff --git a/src/code_8072B78.c b/src/code_8072B78.c deleted file mode 100644 index b0227f48d..000000000 --- a/src/code_8072B78.c +++ /dev/null @@ -1,129 +0,0 @@ -#include "global.h" -#include "code_805D8C8.h" -#include "code_806CD90.h" -#include "dungeon_map_access.h" -#include "dungeon_message.h" -#include "dungeon_movement.h" -#include "dungeon_random.h" -#include "dungeon_util.h" -#include "moves.h" -#include "pokemon_mid.h" -#include "status_checks_1.h" -#include "structs/dungeon_entity.h" -#include "structs/map.h" -#include "structs/str_pokemon.h" -#include "structs/str_806B7F8.h" - -extern u8 *gUnknown_80FE2EC[]; - -extern void ResetMonEntityData(EntityInfo *, u32); -void sub_8069E0C(Entity *pokemon); -void sub_8042A44(Entity *r0); -void sub_8083D78(void); -extern bool8 sub_803D930(u32); - -void sub_8072AC8(s16 *param_1, s16 species, s32 param_3) -{ - const u8 *levelUpMoves; - s32 arrIndex; - s32 counter; - u16 moveIDs [2]; - s32 species_s32; - s32 index; - - species_s32 = species; - - for(index = 0; index < MAX_MON_MOVES; index++) { - param_1[index] = MOVE_NOTHING; - } - - counter = 0; - levelUpMoves = GetLevelUpMoves(species_s32); - - while( 1 ) { - if (*levelUpMoves == 0) { - return; - } - levelUpMoves = DecompressMoveID(levelUpMoves,moveIDs); - if (*levelUpMoves++ > param_3) break; - if (counter == MAX_MON_MOVES) { - arrIndex = DungeonRandInt(MAX_MON_MOVES); - counter = MAX_MON_MOVES; - } - else { - arrIndex = counter; - counter++; - } - param_1[arrIndex] = moveIDs[0]; - } -} - -void sub_8072B24(Entity *entity, Move *moves) -{ - int index; - int count; - - count = 0; - for(index = 0; index < 8; index++) - { - if (moves[index].moveFlags & MOVE_FLAG_EXISTS) { - moves[index].moveFlags &= 0xfd; - count++; - } - } - index = DungeonRandInt(count); - for (; index < 7; index++) { - moves[index] = moves[index + 1]; - } - moves[7].moveFlags = 0; -} - -static inline void fu(EntityInfo *entityInfo, s16 id) -{ - ++id; --id; - entityInfo->apparentID = id; - entityInfo->id = id; -} - -void sub_8072B78(Entity *pokemon, Entity *target, s16 id) -{ - OpenedFile *file; - const Tile *tile; - int index; - s32 id_s32; - EntityInfo *entityInfo; - LevelData levelData; - struct unkStruct_806B7F8 local_2c; - - id_s32 = id; - entityInfo = GetEntInfo(target); - SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1],id_s32); - file = GetSpriteData(id_s32); - fu(entityInfo, id_s32); - GetPokemonLevelData(&levelData,id_s32,entityInfo->level); - entityInfo->exp = levelData.expRequired; - target->axObj.spriteFile = file; - ResetMonEntityData(entityInfo,0); - sub_8069E0C(target); - sub_806CCB4(target,7); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE2EC); - sub_8042A44(target); - sub_8083D78(); - if (id_s32 == MONSTER_NINJASK) { - for (index = 0; index < 8; index++) { - tile = GetTile(gAdjacentTileOffsets[index].x + target->pos.x,gAdjacentTileOffsets[index].y + target->pos.y); - if (sub_807034C(MONSTER_SHEDINJA,tile) == 0) break; - } - if (sub_803D930(MONSTER_SHEDINJA)) { - local_2c.species = MONSTER_SHEDINJA; - local_2c.level = entityInfo->level; - local_2c.unk2 = 0; - local_2c.pos.x = gAdjacentTileOffsets[index].x + target->pos.x; - local_2c.pos.y = gAdjacentTileOffsets[index].y + target->pos.y; - local_2c.unk4 = 0; - local_2c.unk10 = 0; - sub_806B7F8(&local_2c, TRUE); - } - } -} diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 5cfe39d41..9acd21354 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -1,11 +1,9 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_util.h" #include "items.h" #include "status.h" #include "weather.h" -#include "dungeon_ai_targeting.h" -#include "code_8045A00.h" -#include "dungeon_capabilities.h" #include "structs/dungeon_entity.h" #include "structs/map.h" #include "structs/str_moves.h" @@ -14,12 +12,10 @@ #include "dungeon_map_access.h" #include "code_803E46C.h" #include "code_806CD90.h" -#include "dungeon_movement.h" #include "game_options.h" #include "dungeon_items.h" #include "moves.h" #include "dungeon_random.h" -#include "status_checks_1.h" #include "code_803E668.h" #include "constants/dungeon.h" #include "constants/iq_skill.h" @@ -31,17 +27,14 @@ #include "number_util.h" #include "dungeon_message.h" #include "code_8077274_1.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "math.h" #include "dungeon_config.h" +#include "dungeon_strings.h" extern bool8 sub_8044B28(void); extern void sub_8075708(Entity *entity); extern void DealDamageToEntity(Entity *, s32, u32, u32); -extern void sub_8067110(Entity *); -extern void sub_80671A0(Entity *); -extern void sub_8073D14(Entity *); -extern void sub_8045BF8(u8 *, Item *); extern void sub_805229C(void); extern void sub_807E8F0(Entity *); extern void sub_80444F4(Entity *pokemon); @@ -63,197 +56,7 @@ extern void sub_8075900(Entity *pokemon, u8 r1); extern void sub_806A5B8(Entity *); extern void sub_807EC28(bool8); -extern u8 gUnknown_202F32D; - -extern const u8 *gMonTerrifiedCouldntPickUpItem; -extern const u8 *gMonPickedUpItem; -extern const u8 *gMonPickedUpItem2; -extern const u8 *gMonPickedUpItemToolbox; -extern const u8 *gMonSteppedOnItem; -extern const u8 *gMonCouldntPickUpItem; -extern const u8 *gUnknown_80FD594; -extern const u8 *gUnknown_80FD5B8; -extern const u8 *gUnknown_80FD5DC; -extern const u8 *gUnknown_80FD608; -extern const u8 *gUnknown_80FD628; -extern const u8 *gUnknown_80FEB30; -extern const u8 *gUnknown_80FABD8; -extern const u8 *gPtrProtectSavedItMessage; -extern const u8 *gPtrStenchWavedOffMessage; -extern const u8 *gUnknown_80FA124[]; - -extern const s32 gUnknown_80F60DC[]; - -extern const DungeonPos gUnknown_80F4D44[]; - bool8 UseAttack(Entity *a0); -void sub_8075050(EntityInfo *info, Unk_Entity_x184 *strPtr); - -static EWRAM_DATA s32 gUnknown_202F378 = 0; - -void HandleEatAIAction(Entity *pokemon) -{ - sub_8067110(pokemon); -} - -void HandleThrowItemAIAction(Entity *pokemon) -{ - sub_80671A0(pokemon); -} - -void HandlePickUpAIAction(Entity *pokemon) -{ - sub_8073D14(pokemon); -} - -void sub_8073D14(Entity *entity) -{ - Item *groundItem; - EntityInfo *_entityInfo; - EntityInfo *entityInfo = GetEntInfo(entity); - Entity *tileObject = GetTileAtEntitySafe(entity)->object; - if (tileObject == NULL) - return; - if (sub_8044B28()) - return; - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); - if (entityInfo->isTeamLeader) - return; - if (entityInfo->shopkeeper == 1) - return; - if (IsExperienceLocked(entityInfo->joinedAt.id)) - return; - if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) - return; - - _entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason. - groundItem = GetItemData(tileObject); - if (groundItem->flags & ITEM_FLAG_IN_SHOP) - return; - - if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) { - sub_8045BF8(gFormatBuffer_Items[0], groundItem); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); - DisplayDungeonLoggableMessageTrue(entity, gMonTerrifiedCouldntPickUpItem); - } - else if (!_entityInfo->isNotTeamMember && GetItemCategory(groundItem->id) == CATEGORY_POKE) { - // Why check the same thing again? - if (_entityInfo->isNotTeamMember) { - PlaySoundEffect(0x14B); - } - else { - PlaySoundEffect(0x14C); - } - AddToTeamMoney(GetMoneyValue(groundItem)); - sub_8045BF8(gFormatBuffer_Items[0], groundItem); - RemoveItemFromDungeonAt(&entity->pos, 1); - DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem); - } - else { - s32 i, nItems, newInventoryId; - s32 inventoryIds[INVENTORY_SIZE + 1]; // plus held - Item *carriedItems[INVENTORY_SIZE + 1]; // plus held - s32 newQuantity; - - if (gDungeon->unk644.hasInventory && !_entityInfo->isNotTeamMember) { - for (i = 0; i < INVENTORY_SIZE; i++) { - carriedItems[i] = &gTeamInventoryRef->teamItems[i]; - inventoryIds[i] = i; - } - carriedItems[INVENTORY_SIZE] = &_entityInfo->heldItem; - inventoryIds[INVENTORY_SIZE] = -1; - nItems = INVENTORY_SIZE + 1; - } - else { - carriedItems[0] = &_entityInfo->heldItem; - inventoryIds[0] = -1; - nItems = 1; - } - - if ((groundItem->id < 9) && !(groundItem->flags & ITEM_FLAG_IN_SHOP)) { - newInventoryId = -1; - newQuantity = -1; - for (i = 0; i < nItems; i++) { - if (carriedItems[i]->flags & ITEM_FLAG_EXISTS - && !(carriedItems[i]->flags & ITEM_FLAG_IN_SHOP) - && ((groundItem->id == carriedItems[i]->id) && (groundItem->flags & ITEM_FLAG_STICKY) == (carriedItems[i]->flags & ITEM_FLAG_STICKY)) - && carriedItems[i]->quantity != 99 && newQuantity < carriedItems[i]->quantity) - { - newQuantity = carriedItems[i]->quantity; - newInventoryId = i; - } - } - - if (newInventoryId == -1) { - newQuantity = -1; - for (i = 0; i < nItems; i++) { - if (carriedItems[i]->flags & ITEM_FLAG_EXISTS - && !(carriedItems[i]->flags & ITEM_FLAG_IN_SHOP) - && groundItem->id == carriedItems[i]->id - && carriedItems[i]->quantity != 99 - && newQuantity < carriedItems[i]->quantity) - { - newQuantity = carriedItems[i]->quantity; - newInventoryId = i; - } - } - } - - if (newInventoryId != -1) { - s32 quantity = carriedItems[newInventoryId]->quantity + groundItem->quantity; - if (quantity >= 99) - quantity = 99; - carriedItems[newInventoryId]->quantity = quantity; - if (groundItem->flags & ITEM_FLAG_STICKY) - carriedItems[newInventoryId]->flags |= ITEM_FLAG_STICKY; - - sub_8045BF8(gFormatBuffer_Items[0], groundItem); - RemoveItemFromDungeonAt(&entity->pos, 1); - PlaySoundEffect(0x14A); - if (inventoryIds[newInventoryId] <= -1) - DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); - else - DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItemToolbox); - - return; - } - } - - for (i = 0; i < nItems; i++) { - if (!(carriedItems[i]->flags & ITEM_FLAG_EXISTS)) - break; - } - - if (i == nItems) { - sub_8045BF8(gFormatBuffer_Items[0], groundItem); - DisplayDungeonLoggableMessageTrue(entity, gMonSteppedOnItem); - } - else { - if (_entityInfo->isNotTeamMember) { - PlaySoundEffect(0x14B); - } - else { - PlaySoundEffect(0x14A); - } - - if (inventoryIds[i] <= -1) { - _entityInfo->heldItem = *groundItem; - sub_8045BF8(gFormatBuffer_Items[0], groundItem); - RemoveItemFromDungeonAt(&entity->pos, 1); - DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); - } - else if (AddItemToInventory(groundItem)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); - DisplayDungeonLoggableMessageTrue(entity, gMonCouldntPickUpItem); - } - else { - sub_8045BF8(gFormatBuffer_Items[0], groundItem); - RemoveItemFromDungeonAt(&entity->pos, 1); - DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItemToolbox); - } - } - } -} void sub_8074094(Entity *entity) { @@ -775,254 +578,3 @@ void TickStatusHeal(Entity *entity) } } -void sub_8074FB0(Entity *entity, s32 a1, DungeonPos *pos) -{ - Unk_Entity_x184 *strPtr; - EntityInfo *entityInfo = GetEntInfo(entity); - - if (entityInfo->numMoveTiles > 3) { - entityInfo->action.action = 0; - return; - } - - if (gGameOptionsRef->dungeonSpeed != 0) - gUnknown_202F378 = 2; - else - gUnknown_202F378 = 1; - - strPtr = &entityInfo->unk184[entityInfo->numMoveTiles]; - strPtr->unk1A = 0; - strPtr->lastMoveDirection = a1; - strPtr->previousTargetMovePosition1.x = entity->pos.x; - strPtr->previousTargetMovePosition1.y = entity->pos.y; - strPtr->previousTargetMovePosition2.x = pos->x; - strPtr->previousTargetMovePosition2.y = pos->y; - strPtr->lastMoveIncrement.x = gUnknown_80F4D44[a1].x * gUnknown_202F378; - strPtr->lastMoveIncrement.y = gUnknown_80F4D44[a1].y * gUnknown_202F378; - sub_8075050(entityInfo, strPtr); -} - -void sub_8075050(EntityInfo *info, Unk_Entity_x184 *strPtr) -{ - s32 savedX, savedY; - - if (gGameOptionsRef->dungeonSpeed != 0) - gUnknown_202F378 = 2; - else - gUnknown_202F378 = 1; - - info->numMoveTiles++; - if (info->numMoveTiles == 2) { - info->unk184[0].walkAnimFramesLeft = 24 / (gUnknown_202F378 * 2); - info->unk184[0].lastMoveIncrement.x *= 2; - info->unk184[0].lastMoveIncrement.y *= 2; - strPtr->walkAnimFramesLeft = 24 / (gUnknown_202F378 * 2); - strPtr->lastMoveIncrement.x *= 2; - strPtr->lastMoveIncrement.y *= 2; - } - else if (info->numMoveTiles == 3) { - s32 i; - - savedX = strPtr->lastMoveIncrement.x; - savedY = strPtr->lastMoveIncrement.y; - for (i = 0; i < 2; i++) { - info->unk184[i].walkAnimFramesLeft = 24 / (gUnknown_202F378 * 3); - info->unk184[i].lastMoveIncrement.x *= 3; - info->unk184[i].lastMoveIncrement.y *= 3; - info->unk184[i].lastMoveIncrement.x /= 2; - info->unk184[i].lastMoveIncrement.y /= 2; - } - strPtr->walkAnimFramesLeft = 24 / (gUnknown_202F378 * 3); - strPtr->lastMoveIncrement.x = savedX * 3; - strPtr->lastMoveIncrement.y = savedY * 3; - } - else if (info->numMoveTiles == 4) { - s32 i; - - savedX = strPtr->lastMoveIncrement.x; - savedY = strPtr->lastMoveIncrement.y; - for (i = 0; i < 3; i++) { - info->unk184[i].walkAnimFramesLeft = 24 / (gUnknown_202F378 * 4); - info->unk184[i].lastMoveIncrement.x *= 4; - info->unk184[i].lastMoveIncrement.y *= 4; - info->unk184[i].lastMoveIncrement.x /= 3; - info->unk184[i].lastMoveIncrement.y /= 3; - } - strPtr->walkAnimFramesLeft = 24 / (gUnknown_202F378 * 4); - strPtr->lastMoveIncrement.x = savedX * 4; - strPtr->lastMoveIncrement.y = savedY * 4; - } - else { - strPtr->walkAnimFramesLeft = 24 / gUnknown_202F378; - } -} - -bool8 UseAttack(Entity *a0) -{ - s32 i, j, loop; - Entity *savedEntityPtr; - bool32 r7 = FALSE; - bool32 r9 = FALSE; - - gUnknown_202F32D = 0; - if (gGameOptionsRef->dungeonSpeed != 0) - gUnknown_202F378 = 2; - else - gUnknown_202F378 = 1; - - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activePokemon[i]; - if (EntityIsValid(mon)) { - EntityInfo *monInfo = GetEntInfo(mon); - if (monInfo->numMoveTiles == 0) { - if (monInfo->waiting) { - monInfo->waiting = FALSE; - if ((monInfo->targetPos.x != 0 || monInfo->targetPos.y != 0) - && (monInfo->targetPos.x != mon->pos.x || monInfo->targetPos.y != mon->pos.y) - && (!CheckVariousStatuses2(mon, TRUE) || !CheckVariousStatuses(mon))) - { - s32 direction = GetDirectionTowardsPosition(&mon->pos, &monInfo->targetPos); - if (direction != monInfo->action.direction) - sub_806CE68(mon, direction); - } - } - } - else { - PixelPos pos; - - monInfo->flags |= 0x2000; - pos.x = X_POS_TO_PIXELPOS(monInfo->unk184[0].previousTargetMovePosition2.x); - pos.y = Y_POS_TO_PIXELPOS(monInfo->unk184[0].previousTargetMovePosition2.y); - sub_804535C(mon, &pos); - sub_806CDFC(mon, 0, monInfo->unk184[0].lastMoveDirection); - monInfo->notMoving = 0; - r7 = TRUE; - if (sub_8045888(mon)) - r9 = TRUE; - } - } - } - - if (!r7) - return FALSE; - - savedEntityPtr = gDungeon->unkB8; - gDungeon->unkB8 = a0; - if (gDungeon->unk644.unk28 == 0 && r9) { - sub_80526D0(0x35); - for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { - DungeonRunFrameActions(7); - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activePokemon[i]; - if (EntityIsValid(mon)) { - EntityInfo *monInfo = GetEntInfo(mon); - Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving]; - - ASM_MATCH_TRICK(i); - if (monInfo->numMoveTiles != 0) { - IncreaseEntityPixelPos(mon, strPtr->lastMoveIncrement.x, strPtr->lastMoveIncrement.y); - if (--strPtr->walkAnimFramesLeft == 0) { - if (++monInfo->notMoving == monInfo->numMoveTiles) { - monInfo->numMoveTiles = 0; - } - else { - PixelPos pos; - - pos.x = X_POS_TO_PIXELPOS(monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.x); - pos.y = Y_POS_TO_PIXELPOS(monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.y); - sub_804535C(mon, &pos); - sub_806CDFC(mon, 0, monInfo->unk184[monInfo->notMoving].lastMoveDirection); - } - } - } - } - } - } - } - - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activePokemon[i]; - if (EntityIsValid(mon)) { - EntityInfo *monInfo = GetEntInfo(mon); - monInfo->numMoveTiles = 0; - nullsub_97(mon); - if (monInfo->flags & 0x2000) { - sub_804535C(mon, NULL); - } - } - } - - sub_807AA30(); - for (j = 0; j < 2; j++) { - for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { - DungeonPos monPosBefore; - EntityInfo *monInfo; - Entity *mon = gDungeon->activePokemon[loop]; - - if (!EntityIsValid(mon)) - continue; - if (sub_8044B28()) - break; - - monInfo = GetEntInfo(mon); - if ((j == 0 && !monInfo->isTeamLeader) || (j != 0 && monInfo->isTeamLeader)) - continue; - - monPosBefore = mon->pos; - - // Statement with no effect needed to match. - GetEntInfo(mon)->isTeamLeader = GetEntInfo(mon)->isTeamLeader; - - if (monInfo->flags & 0x2000) { - monInfo->flags &= ~(0x2000); - if (monInfo->isTeamLeader) { - sub_804AC20(&mon->pos); - sub_807EC28(FALSE); - sub_805EE30(); - } - else { - sub_8075708(mon); - } - if (!EntityIsValid(mon)) - continue; - if (sub_8044B28()) - break; - - sub_8043ED0(0); - sub_8074094(mon); - if (!EntityIsValid(mon)) - continue; - if (sub_8044B28()) - break; - - sub_8071DA4(mon); - sub_8046D20(); - sub_8075900(mon, gDungeon->forceMonsterHouse); - } - if (!EntityIsValid(mon)) - continue; - if (sub_8044B28()) - break; - - if (monPosBefore.x != mon->pos.x || monPosBefore.y != mon->pos.y) - gUnknown_202F32D = 1; - - sub_806A5B8(mon); - if (sub_80706A4(mon, &mon->pos)) { - WarpTarget(mon, mon, 0, NULL); - } - } - } - - sub_8086AC0(); - if (!sub_8044B28()) { - sub_8085140(); - gDungeon->unkB8 = savedEntityPtr; - } - else { - gDungeon->unkB8 = savedEntityPtr; - } - - return TRUE; -} - diff --git a/src/code_8075708.c b/src/code_8075708.c index c3371fb58..1fe0db762 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -1,23 +1,331 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_ai.h" - #include "constants/iq_skill.h" #include "constants/item.h" #include "constants/status.h" #include "constants/type.h" #include "code_806CD90.h" -#include "dungeon_capabilities.h" #include "dungeon_items.h" +#include "dungeon_leader.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "structs/str_dungeon.h" -#include "tile_types.h" #include "position_util.h" #include "trap.h" +#include "items.h" +#include "status.h" +#include "weather.h" +#include "structs/dungeon_entity.h" +#include "structs/map.h" +#include "structs/str_moves.h" +#include "position_util.h" +#include "dungeon_music.h" +#include "dungeon_map_access.h" +#include "code_803E46C.h" +#include "code_806CD90.h" +#include "game_options.h" +#include "dungeon_items.h" +#include "moves.h" +#include "dungeon_random.h" +#include "code_803E668.h" +#include "constants/dungeon.h" +#include "constants/iq_skill.h" +#include "constants/ability.h" +#include "constants/type.h" +#include "constants/move_id.h" +#include "constants/weather.h" +#include "number_util.h" +#include "dungeon_message.h" +#include "code_8077274_1.h" +#include "math.h" +#include "dungeon_config.h" extern void sub_8073D14(Entity *); +extern bool8 sub_8044B28(void); +extern void sub_8075708(Entity *entity); +extern void DealDamageToEntity(Entity *, s32, u32, u32); +extern void sub_805229C(void); +extern void sub_807E8F0(Entity *); +extern void sub_80444F4(Entity *pokemon); +extern void WarpTarget(Entity *pokemon, Entity *r1, u32 r2, DungeonPos *r3); +extern void sub_80420B8(Entity *pokemon); +extern void sub_8041C4C(Entity *pokemon, u32 r1); +extern void sub_805E804(void); +extern void sub_80838EC(u8 *a); +extern bool8 TryUseChosenMove(struct Entity *, u32, u32, u32, u32, struct Move *); +extern bool8 sub_8045888(Entity *); +extern void nullsub_97(Entity *entity); +extern void sub_805EE30(void); +extern void sub_8086AC0(void); +extern void sub_8085140(void); +extern void sub_8075708(Entity *entity); +extern void sub_8043ED0(u32); +extern void sub_8071DA4(Entity *); +extern void sub_8075900(Entity *pokemon, u8 r1); +extern void sub_806A5B8(Entity *); +extern void sub_807EC28(bool8); +extern void sub_8075050(EntityInfo *info, Unk_Entity_x184 *strPtr); +extern void sub_8074094(Entity *entity); +extern bool8 sub_803F428(DungeonPos *pos); + +extern u8 gUnknown_202F32D; + +extern const DungeonPos gUnknown_80F4D44[]; + +static EWRAM_DATA s32 gUnknown_202F378 = 0; + +void sub_8074FB0(Entity *entity, s32 a1, DungeonPos *pos) +{ + Unk_Entity_x184 *strPtr; + EntityInfo *entityInfo = GetEntInfo(entity); + + if (entityInfo->numMoveTiles > 3) { + entityInfo->action.action = 0; + return; + } + + if (gGameOptionsRef->dungeonSpeed != 0) + gUnknown_202F378 = 2; + else + gUnknown_202F378 = 1; + + strPtr = &entityInfo->unk184[entityInfo->numMoveTiles]; + strPtr->unk1A = 0; + strPtr->lastMoveDirection = a1; + strPtr->previousTargetMovePosition1.x = entity->pos.x; + strPtr->previousTargetMovePosition1.y = entity->pos.y; + strPtr->previousTargetMovePosition2.x = pos->x; + strPtr->previousTargetMovePosition2.y = pos->y; + strPtr->lastMoveIncrement.x = gUnknown_80F4D44[a1].x * gUnknown_202F378; + strPtr->lastMoveIncrement.y = gUnknown_80F4D44[a1].y * gUnknown_202F378; + sub_8075050(entityInfo, strPtr); +} + +void sub_8075050(EntityInfo *info, Unk_Entity_x184 *strPtr) +{ + s32 savedX, savedY; + + if (gGameOptionsRef->dungeonSpeed != 0) + gUnknown_202F378 = 2; + else + gUnknown_202F378 = 1; + + info->numMoveTiles++; + if (info->numMoveTiles == 2) { + info->unk184[0].walkAnimFramesLeft = 24 / (gUnknown_202F378 * 2); + info->unk184[0].lastMoveIncrement.x *= 2; + info->unk184[0].lastMoveIncrement.y *= 2; + strPtr->walkAnimFramesLeft = 24 / (gUnknown_202F378 * 2); + strPtr->lastMoveIncrement.x *= 2; + strPtr->lastMoveIncrement.y *= 2; + } + else if (info->numMoveTiles == 3) { + s32 i; + + savedX = strPtr->lastMoveIncrement.x; + savedY = strPtr->lastMoveIncrement.y; + for (i = 0; i < 2; i++) { + info->unk184[i].walkAnimFramesLeft = 24 / (gUnknown_202F378 * 3); + info->unk184[i].lastMoveIncrement.x *= 3; + info->unk184[i].lastMoveIncrement.y *= 3; + info->unk184[i].lastMoveIncrement.x /= 2; + info->unk184[i].lastMoveIncrement.y /= 2; + } + strPtr->walkAnimFramesLeft = 24 / (gUnknown_202F378 * 3); + strPtr->lastMoveIncrement.x = savedX * 3; + strPtr->lastMoveIncrement.y = savedY * 3; + } + else if (info->numMoveTiles == 4) { + s32 i; + + savedX = strPtr->lastMoveIncrement.x; + savedY = strPtr->lastMoveIncrement.y; + for (i = 0; i < 3; i++) { + info->unk184[i].walkAnimFramesLeft = 24 / (gUnknown_202F378 * 4); + info->unk184[i].lastMoveIncrement.x *= 4; + info->unk184[i].lastMoveIncrement.y *= 4; + info->unk184[i].lastMoveIncrement.x /= 3; + info->unk184[i].lastMoveIncrement.y /= 3; + } + strPtr->walkAnimFramesLeft = 24 / (gUnknown_202F378 * 4); + strPtr->lastMoveIncrement.x = savedX * 4; + strPtr->lastMoveIncrement.y = savedY * 4; + } + else { + strPtr->walkAnimFramesLeft = 24 / gUnknown_202F378; + } +} + +bool8 UseAttack(Entity *a0) +{ + s32 i, j, loop; + Entity *savedEntityPtr; + bool32 r7 = FALSE; + bool32 r9 = FALSE; + + gUnknown_202F32D = 0; + if (gGameOptionsRef->dungeonSpeed != 0) + gUnknown_202F378 = 2; + else + gUnknown_202F378 = 1; + + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *mon = gDungeon->activePokemon[i]; + if (EntityIsValid(mon)) { + EntityInfo *monInfo = GetEntInfo(mon); + if (monInfo->numMoveTiles == 0) { + if (monInfo->waiting) { + monInfo->waiting = FALSE; + if ((monInfo->targetPos.x != 0 || monInfo->targetPos.y != 0) + && (monInfo->targetPos.x != mon->pos.x || monInfo->targetPos.y != mon->pos.y) + && (!CheckVariousStatuses2(mon, TRUE) || !CheckVariousStatuses(mon))) + { + s32 direction = GetDirectionTowardsPosition(&mon->pos, &monInfo->targetPos); + if (direction != monInfo->action.direction) + sub_806CE68(mon, direction); + } + } + } + else { + PixelPos pos; + + monInfo->flags |= 0x2000; + pos.x = X_POS_TO_PIXELPOS(monInfo->unk184[0].previousTargetMovePosition2.x); + pos.y = Y_POS_TO_PIXELPOS(monInfo->unk184[0].previousTargetMovePosition2.y); + sub_804535C(mon, &pos); + sub_806CDFC(mon, 0, monInfo->unk184[0].lastMoveDirection); + monInfo->notMoving = 0; + r7 = TRUE; + if (sub_8045888(mon)) + r9 = TRUE; + } + } + } + + if (!r7) + return FALSE; + + savedEntityPtr = gDungeon->unkB8; + gDungeon->unkB8 = a0; + if (gDungeon->unk644.unk28 == 0 && r9) { + sub_80526D0(0x35); + for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { + DungeonRunFrameActions(7); + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *mon = gDungeon->activePokemon[i]; + if (EntityIsValid(mon)) { + EntityInfo *monInfo = GetEntInfo(mon); + Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving]; + + ASM_MATCH_TRICK(i); + if (monInfo->numMoveTiles != 0) { + IncreaseEntityPixelPos(mon, strPtr->lastMoveIncrement.x, strPtr->lastMoveIncrement.y); + if (--strPtr->walkAnimFramesLeft == 0) { + if (++monInfo->notMoving == monInfo->numMoveTiles) { + monInfo->numMoveTiles = 0; + } + else { + PixelPos pos; + + pos.x = X_POS_TO_PIXELPOS(monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.x); + pos.y = Y_POS_TO_PIXELPOS(monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.y); + sub_804535C(mon, &pos); + sub_806CDFC(mon, 0, monInfo->unk184[monInfo->notMoving].lastMoveDirection); + } + } + } + } + } + } + } + + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *mon = gDungeon->activePokemon[i]; + if (EntityIsValid(mon)) { + EntityInfo *monInfo = GetEntInfo(mon); + monInfo->numMoveTiles = 0; + nullsub_97(mon); + if (monInfo->flags & 0x2000) { + sub_804535C(mon, NULL); + } + } + } + + sub_807AA30(); + for (j = 0; j < 2; j++) { + for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { + DungeonPos monPosBefore; + EntityInfo *monInfo; + Entity *mon = gDungeon->activePokemon[loop]; + + if (!EntityIsValid(mon)) + continue; + if (sub_8044B28()) + break; + + monInfo = GetEntInfo(mon); + if ((j == 0 && !monInfo->isTeamLeader) || (j != 0 && monInfo->isTeamLeader)) + continue; + + monPosBefore = mon->pos; + + // Statement with no effect needed to match. + GetEntInfo(mon)->isTeamLeader = GetEntInfo(mon)->isTeamLeader; + + if (monInfo->flags & 0x2000) { + monInfo->flags &= ~(0x2000); + if (monInfo->isTeamLeader) { + sub_804AC20(&mon->pos); + sub_807EC28(FALSE); + sub_805EE30(); + } + else { + sub_8075708(mon); + } + if (!EntityIsValid(mon)) + continue; + if (sub_8044B28()) + break; + + sub_8043ED0(0); + sub_8074094(mon); + if (!EntityIsValid(mon)) + continue; + if (sub_8044B28()) + break; + + sub_8071DA4(mon); + sub_8046D20(); + sub_8075900(mon, gDungeon->forceMonsterHouse); + } + if (!EntityIsValid(mon)) + continue; + if (sub_8044B28()) + break; + + if (monPosBefore.x != mon->pos.x || monPosBefore.y != mon->pos.y) + gUnknown_202F32D = 1; + + sub_806A5B8(mon); + if (sub_80706A4(mon, &mon->pos)) { + WarpTarget(mon, mon, 0, NULL); + } + } + } + + sub_8086AC0(); + if (!sub_8044B28()) { + sub_8085140(); + gDungeon->unkB8 = savedEntityPtr; + } + else { + gDungeon->unkB8 = savedEntityPtr; + } + + return TRUE; +} void sub_8075680(void) { @@ -125,7 +433,7 @@ u32 sub_8075818(Entity *entity) EntityInfo *entityInfo; Entity *subEntity; Item *item; - Trap *trapData; // TODO: turn into struct when more research is done.. + Trap *trapData; u8 r1; entityInfo = GetEntInfo(entity); @@ -208,3 +516,34 @@ error: return 0; } +extern char *gPtrItsaMonsterHouseMessage; + +extern u8 sub_8044B28(void); +extern void sub_807AB38(Entity *, u32); +extern void sub_8041888(u32); + +void sub_8075900(Entity *pokemon, u8 r1) +{ + if(EntityIsValid(pokemon)) + { + if(!GetEntInfo(pokemon)->isNotTeamMember) + { + if(!sub_8044B28()) + { + if(!gDungeon->unk644.monsterHouseTriggered) + { + if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) + { + // It's a monster house! + LogMessageByIdWithPopupCheckUser(GetLeader(), gPtrItsaMonsterHouseMessage); + gDungeon->unk644.monsterHouseTriggeredEvent = TRUE; + sub_807AB38(pokemon, r1); + sub_8041888(0); + if(sub_803F428(&pokemon->pos)) + sub_803E708(0x78, 0x39); + } + } + } + } + } +} diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index c53c54c31..94d2cd4b0 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -1,6 +1,6 @@ #include "global.h" +#include "globaldata.h" #include "code_803E46C.h" -#include "code_8045A00.h" #include "dungeon_map_access.h" #include "dungeon_message.h" #include "code_805D8C8.h" @@ -12,8 +12,6 @@ #include "constants/status.h" #include "constants/type.h" #include "dungeon_items.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" #include "dungeon_util.h" #include "move_effects_target.h" @@ -22,1560 +20,17 @@ #include "pokemon.h" #include "pokemon_3.h" #include "pokemon_mid.h" -#include "status_checks_1.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" #include "dungeon_map_access.h" #include "structs/str_806B7F8.h" #include "dungeon_config.h" +#include "dungeon_logic.h" +#include "dungeon_strings.h" -extern u8 *gUnknown_80FA8BC[]; -extern u8 *gUnknown_80FA824[]; -extern u8 *gUnknown_80FA81C[]; -extern u8 *gPtrMonNoLongerPetrifiedMessage[]; -extern u8 *gUnknown_80FA820[]; -extern u8 *gUnknown_80FA800[]; -extern u8 *gUnknown_80FAC38[]; -extern u8 *gUnknown_80FA97C[]; -extern u8 *gUnknown_80FA9DC[]; -extern u8 *gUnknown_80FAAAC[]; -extern u8 *gUnknown_80FAB90[]; -extern u8 *gPtrMonNoLongerCringingMessage[]; -extern u8 *gUnknown_80FA638[]; -extern u8 *gUnknown_80FA69C[]; -extern u8 *gUnknown_80FA658[]; -extern u8 *gUnknown_80FA67C[]; -extern u8 *gUnknown_80FA6BC[]; -extern u8 *gUnknown_80FA6D4[]; -extern u8 *gUnknown_80FA9C0[]; -extern u8 *gUnknown_80FAA68[]; -extern u8 *gPtrMonStoppedEnduringMessage[]; -extern u8 *gPtrMonMirrorMoveFadedMessage[]; -extern u8 *gPtrMonConversion2FailedMessage[]; -extern u8 *gPtrMonGaveUpVitalThrowMessage[]; -extern u8 *gUnknown_80FAB40[]; -extern u8 *gUnknown_80FA7BC[]; -extern u8 *gUnknown_80FA9A0[]; -extern u8 *gUnknown_80FA7DC[]; -extern u8 *gUnknown_80FA79C[]; -extern u8 *gUnknown_80FAA8C[]; -extern u8 *gUnknown_80FA8E0[]; -extern u8 *gUnknown_80FA90C[]; -extern u8 *gUnknown_80FA934[]; -extern u8 *gUnknown_80FA95C[]; -extern u8 *gUnknown_80FABBC[]; -extern u8 *gUnknown_80FAB6C[]; -extern u8 *gUnknown_80FA9F4[]; -extern u8 *gUnknown_80FAA0C[]; -extern u8 *gUnknown_80FAA2C[]; -extern u8 *gUnknown_80FAA48[]; -extern u8 *gUnknown_80FABC0[]; -extern u8 *gUnknown_80FA888[]; -extern u8 *gUnknown_80FA8A8[]; -extern u8 *gUnknown_80FA868[]; -extern u8 *gUnknown_80FA6E8[]; -extern u8 *gUnknown_80FA708[]; -extern u8 *gUnknown_80FA70C[]; -extern u8 *gUnknown_80FA734[]; -extern u8 *gUnknown_80FA710[]; -extern u8 *gUnknown_80FA124[]; -extern u8 *gPtrSealedMoveReleasedMessage[]; -extern u8 *gUnknown_81004E8[]; -extern u8 *gPtrExposedWoreOffMessage[]; -extern u8 *gUnknown_8100594[]; -extern u8 *gUnknown_80FBD18[]; -extern u8 *gUnknown_80FBD3C[]; -extern u8 *gUnknown_80FBCF0[]; -extern u8 *gUnknown_80FBCC8[]; -extern u8 *gUnknown_80FBCA4[]; -extern u8 *gUnknown_80FBC7C[]; -extern u8 *gPtrForecastPreventsConversion2Message[]; -extern u8 *gUnknown_80FBC5C[]; -extern u8 *gUnknown_80FBC38[]; -extern u8 *gUnknown_80FBC14[]; -extern u8 *gUnknown_80FBBF0[]; -extern u8 *gUnknown_80FBAE4[]; -extern u8 *gUnknown_80FBAC0[]; -extern u8 *gUnknown_80FB9B0[]; -extern u8 *gUnknown_80FB9D8[]; -extern u8 *gUnknown_80FB17C[]; -extern u8 *gUnknown_80FB1A8[]; -extern u8 *gUnknown_80FB130[]; -extern u8 *gUnknown_80FB160[]; -extern u8 *gUnknown_80FAF5C[]; -extern u8 *gUnknown_80FAF8C[]; -extern u8 *gUnknown_80FAE1C[]; -extern u8 *gUnknown_80FAE3C[]; -extern u8 *gUnknown_80FB09C[]; -extern u8 *gUnknown_80FB0C4[]; -extern u8 *gUnknown_80FB048[]; -extern u8 *gUnknown_80FB074[]; -extern u8 *gUnknown_80FB10C[]; -extern u8 *gUnknown_80FB0E0[]; -extern u8 *gUnknown_80FC074[]; -extern u8 *gUnknown_80FD254[]; -extern u8 *gUnknown_80FD27C[]; -extern u8 *gUnknown_80FD22C[]; -extern u8 *gUnknown_80FD20C[]; -extern u8 *gUnknown_80FC428[]; -extern u8 *gUnknown_80FC454[]; -extern u8 *gUnknown_80FC3D8[]; -extern u8 *gUnknown_80FC3FC[]; -extern u8 *gUnknown_80FC388[]; -extern u8 *gUnknown_80FC3B4[]; -extern u8 *gUnknown_80FC33C[]; -extern u8 *gUnknown_80FC360[]; -extern u8 *gUnknown_80FDBD0[]; -extern u8 *gUnknown_80FDBF0[]; -extern u8 *gUnknown_80FB880[]; -extern u8 *gUnknown_80FB89C[]; -extern u8 *gUnknown_80FB834[]; -extern u8 *gUnknown_80FB85C[]; -extern u8 *gUnknown_80FB810[]; -extern u8 *gUnknown_80FB7F4[]; -extern u8 *gUnknown_80FC028[]; -extern u8 *gUnknown_80FC054[]; -extern u8 *gUnknown_80FC000[]; -extern u8 *gUnknown_80FBFD8[]; -extern u8 *gUnknown_80FBF9C[]; -extern u8 *gUnknown_80FBFB8[]; -extern u8 *gUnknown_80FBF04[]; -extern u8 *gUnknown_80FBEC0[]; -extern u8 *gUnknown_80FBEE4[]; -extern u8 *gUnknown_80FBF50[]; -extern u8 *gUnknown_80FBF28[]; -extern u8 *gUnknown_80FBF68[]; -extern u8 *gUnknown_80FBF84[]; - -extern void ShowWholeRevealedDungeonMap(); -extern void EntityUpdateStatusSprites(Entity *); -extern void sub_8042A74(Entity *r0); -extern void sub_807EC28(bool8); -extern s32 GetMonsterApparentID(Entity *param_1, s16 param_2); -extern void sub_806A898(Entity *, u32, u32); -extern void HealTargetHP(Entity *pokemon, Entity *r1, s16, s16, u32); -extern void DealDamageToEntity(Entity *, s16, u32, u32); -extern void ResetMonEntityData(EntityInfo *, u32); -extern void sub_80420C8(Entity *r0); -extern void nullsub_68(Entity *); -extern void nullsub_67(Entity *); -extern void nullsub_66(Entity *); -extern void nullsub_65(Entity *); -extern void nullsub_64(Entity *); -extern void nullsub_63(Entity *); -extern void nullsub_62(Entity *); -extern void nullsub_61(Entity *); -extern void nullsub_60(Entity *); -extern void nullsub_59(Entity *); -extern void nullsub_58(Entity *); -extern void nullsub_57(Entity *); -extern void sub_8041B34(Entity *); -void sub_8041BD0(Entity *r0, u8 r1); -void sub_8041EB4(Entity *); -void sub_8041EA4(Entity *); -extern void sub_8041E84(Entity *); -extern void sub_8041E94(Entity *); -extern void sub_8041E74(Entity *); -extern void sub_8041E60(Entity *); -extern void sub_8041E4C(Entity *); -extern void sub_8041E3C(Entity *); -extern void sub_803F580(u32); -extern void sub_8041E1C(Entity *); -extern void nullsub_89(Entity *); -extern void nullsub_88(Entity *); -extern void nullsub_87(Entity *); -extern void nullsub_86(Entity *); -extern void sub_8041E0C(Entity *); -extern void sub_8041DD8(Entity *r0, s32 r1); // NOTE: is s16 in another file -extern s32 sub_803D870(UnkDungeonGlobal_unk1CD98 *strPtr, s32 id); extern bool8 sub_806AA0C(s32, u32); - -void MuzzleTarget(Entity *pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->muzzled.muzzled != TRUE) { - entityInfo->muzzled.muzzled = TRUE; - entityInfo->muzzled.turns = CalculateStatusTurns(target,gMuzzledTurnRange, TRUE) + 1; - nullsub_86(target); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF68); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF84); - } - EntityUpdateStatusSprites(target); - } -} - -void TransformStatusTarget(Entity * pokemon, Entity * target) -{ - s16 species; - s32 iVar5; - s32 apparentID; - s16 apparentID_s16; - s32 index; - EntityInfo *entityInfo; - OpenedFile *sprite; - UnkDungeonGlobal_unk1CD98 auStack544[64]; - - if (!EntityIsValid(target)) - return; - - entityInfo = GetEntInfo(target); - - if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); - else { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - iVar5 = sub_803D870(auStack544, 0); - - if (iVar5 == 0) - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBEE4); - else { - sprite = NULL; - - for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { - species = ExtractSpeciesIndex(&auStack544[DungeonRandInt(iVar5)]); - apparentID_s16 = GetMonsterApparentID(target, species); - apparentID = apparentID_s16; - - if (apparentID != entityInfo->apparentID && sub_806AA0C(apparentID, 1)) { - sprite = GetSpriteData(apparentID); - if (sprite != NULL) - break; - } - } - - if (index == DUNGEON_MAX_POKEMON || sprite == NULL) - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBEE4); - else { - entityInfo->apparentID = apparentID; - target->axObj.spriteFile = sprite; - entityInfo->invisibleClassStatus.status = STATUS_TRANSFORMED; - entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target, gTransformedTurnRange, TRUE) + 1; - sub_806CF98(target); - nullsub_87(target); - sub_806CCB4(target, sub_806CEBC(target)); - CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1], entityInfo->apparentID); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBEC0); - EntityUpdateStatusSprites(target); - } - } - } -} - -void MobileStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - - if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { - SendTransformEndMessage(pokemon,target); - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->invisibleClassStatus.status != STATUS_MOBILE) { - entityInfo->invisibleClassStatus.status = STATUS_MOBILE; - entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target,gMobileTurnRange, FALSE) + 1; - nullsub_88(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF28); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF50); - } - EntityUpdateStatusSprites(target); - } -} - -void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) -{ - EntityInfo *entityInfo; - s32 param_3_s16; - s32 param_3_s16_2; - bool32 flag; - bool32 flag2; - - param_3_s16 = param_3; - param_3_s16_2 = param_3_s16; - flag = FALSE; - flag2 = FALSE; - - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->hitChanceStages[1] > 10) { - entityInfo->hitChanceStages[1] = 10; - flag = TRUE; - } - if(flag) - { - sub_8041DD8(target,param_3_s16); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC000); - flag2 = TRUE; - } - if (entityInfo->exposed) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBFB8); - } - else - { - if (!flag2) { - sub_8041DD8(target,param_3_s16_2); - } - if (!MonsterIsType(target, TYPE_GHOST)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBFD8); - } - else { - entityInfo->exposed = TRUE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF9C); - } - EntityUpdateStatusSprites(target); - } - } -} - -void IdentityItemHolders(Entity *pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { - entityInfo = GetEntInfo(target); - if (!gDungeon->unk644.itemHoldersIdentified) { - nullsub_89(target); - gDungeon->unk644.itemHoldersIdentified = TRUE; - EntityUpdateStatusSprites(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC028); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC054); - } - } -} - -void BlindTarget(Entity *pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->blinkerClassStatus.status != STATUS_BLINKER) { - entityInfo->blinkerClassStatus.status = STATUS_BLINKER; - entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gBlinkerTurnRange, TRUE) + 1; - sub_8041E0C(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7F4); - DungeonRunFrameActions(0x31); - sub_8049ED4(); - ShowWholeRevealedDungeonMap(); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB810); - } - EntityUpdateStatusSprites(target); - } -} - -void CrossEyeVisionTarget(Entity *pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - - if (EntityIsValid(target)) { - if(!HasSafeguardStatus(pokemon, target, TRUE)) - { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->blinkerClassStatus.status != STATUS_CROSS_EYED) { - sub_8041E1C(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834); - entityInfo->blinkerClassStatus.status = STATUS_CROSS_EYED; - entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gCrossEyedTurnRange, TRUE) + 1; - sub_803F580(0x1); - sub_8049ED4(); - ShowWholeRevealedDungeonMap(); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB85C); - } - EntityUpdateStatusSprites(target); - } - } -} - -void RestoreVisionTarget(Entity *pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->blinkerClassStatus.status != STATUS_EYEDROPS) { - entityInfo->blinkerClassStatus.status = STATUS_EYEDROPS; - entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gEyedropsTurnRange, FALSE) + 1; - sub_8041E3C(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB880); - DungeonRunFrameActions(0x31); - sub_8049ED4(); - ShowWholeRevealedDungeonMap(); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB89C); - } - EntityUpdateStatusSprites(target); - } -} - -void RestorePPTarget(Entity * pokemon,Entity * target, s32 param_3) -{ - volatile s32 PP; - volatile s32 basePP; - Move *movePtr; - Move *movePtr1; - s32 index; - bool8 PPChanged; - EntityInfo *entityInfo; - - PPChanged = FALSE; - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - - for(index = 0; index < MAX_MON_MOVES; index++) - { - movePtr = &entityInfo->moves.moves[index]; - movePtr1 = movePtr; - if ((movePtr->moveFlags & MOVE_FLAG_EXISTS)) { - PP = movePtr->PP; - basePP = GetMoveBasePP(movePtr1); - if (PP < basePP) { - PP += param_3; - if (PP > basePP) { - PP = basePP; - } - movePtr->PP = PP; - PPChanged = TRUE; - } - } - } - if (PPChanged) { - sub_8041E4C(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBD0); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBF0); - } - EntityUpdateStatusSprites(target); - } -} - -void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) -{ - u32 oldStat; - u32 oldStat1; - s32 newStat; - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - - entityInfo = GetEntInfo(target); - oldStat = entityInfo->atk[0]; - oldStat1 = oldStat; - - newStat = entityInfo->atk[0] + increment; - if (0xfe < newStat) { - newStat = 0xff; - } - entityInfo->atk[0] = newStat; - if (oldStat1 < (u8)newStat) { - sub_8041E60(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC33C); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC360); - } - EntityUpdateStatusSprites(target); - } -} - -void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) -{ - u32 oldStat; - u32 oldStat1; - s32 newStat; - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - - entityInfo = GetEntInfo(target); - oldStat = entityInfo->atk[1]; - oldStat1 = oldStat; - - newStat = entityInfo->atk[1] + increment; - if (0xfe < newStat) { - newStat = 0xff; - } - entityInfo->atk[1] = newStat; - if (oldStat1 < (u8)newStat) { - sub_8041E74(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC388); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3B4); - } - EntityUpdateStatusSprites(target); - } -} - -void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment) -{ - u32 oldStat; - u32 oldStat1; - s32 newStat; - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - - entityInfo = GetEntInfo(target); - oldStat = entityInfo->def[0]; - oldStat1 = oldStat; - - newStat = entityInfo->def[0] + increment; - if (0xfe < newStat) { - newStat = 0xff; - } - entityInfo->def[0] = newStat; - if (oldStat1 < (u8)newStat) { - sub_8041E84(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3D8); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3FC); - } - EntityUpdateStatusSprites(target); - } -} - -void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment) -{ - u32 oldStat; - u32 oldStat1; - s32 newStat; - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - - entityInfo = GetEntInfo(target); - oldStat = entityInfo->def[1]; - oldStat1 = oldStat; - - newStat = entityInfo->def[1] + increment; - if (0xfe < newStat) { - newStat = 0xff; - } - entityInfo->def[1] = newStat; - if (oldStat1 < (u8)newStat) { - sub_8041E94(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC428); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC454); - } - EntityUpdateStatusSprites(target); - } -} - -void LongTossStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (entityInfo->longTossClassStatus.status != STATUS_LONG_TOSS) { - entityInfo->longTossClassStatus.status = STATUS_LONG_TOSS; - sub_8041EA4(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD20C); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD22C); - } - EntityUpdateStatusSprites(target); -} - -void PierceStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (entityInfo->longTossClassStatus.status != STATUS_PIERCE) { - entityInfo->longTossClassStatus.status = STATUS_PIERCE; - sub_8041EB4(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD254); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD27C); - } - EntityUpdateStatusSprites(target); -} - -void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *move, u8 *message) -{ - bool8 bVar2; - Move *movePtr; - s32 index; - bool8 uVar5; - s32 iVar7; - s32 iVar8; - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if ((entityInfo->bideClassStatus.status == newStatus) && (newStatus == STATUS_ENRAGED)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); - } - else { - entityInfo->bideClassStatus.status = newStatus; - - for(index = 0; index < MAX_MON_MOVES; index++) - { - movePtr = &entityInfo->moves.moves[index]; - if(movePtr == move) - { - entityInfo->bideClassStatus.moveSlot = index; - break; - } - } - entityInfo->unk14A = 1; - - uVar5 = FALSE; - if (newStatus == STATUS_FLYING || newStatus == STATUS_BOUNCING) { - entityInfo->unkFF = 1; - uVar5 = TRUE; - } - else if (newStatus == STATUS_DIVING || newStatus == STATUS_DIGGING) { - entityInfo->unkFF = 2; - } - if (newStatus == STATUS_BIDE) { - entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gBideTurnRange, FALSE) + 1; - entityInfo->unkA0 = 0; - } - if (newStatus == STATUS_ENRAGED) { - entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gEnragedTurnRange, FALSE) + 1; - } - sub_8041BD0(target,uVar5); - TryDisplayDungeonLoggableMessage3(pokemon,target,message); - EntityUpdateStatusSprites(target); - - // TODO: this could probably be cleaner.. - for (index = 0, iVar8 = 0xc7ff; index < 400; index++) { - bVar2 = TRUE; - if (entityInfo->unkFF == 1) - if(iVar7 = entityInfo->unk174.raw, bVar2 = FALSE, iVar7 > iVar8) // unk174 -> u32 to s32 - { - bVar2 = TRUE; - } - if (bVar2) { - break; - } - DungeonRunFrameActions(0x53); - } - } - } -} - -void sub_8079764(Entity * pokemon) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(pokemon)) { - entityInfo = GetEntInfo(pokemon); - if ((entityInfo->bideClassStatus.status != STATUS_BIDE) && (entityInfo->bideClassStatus.status != STATUS_ENRAGED)) { - entityInfo->bideClassStatus.status = STATUS_NONE; - entityInfo->unk14A = 0; - entityInfo->unkFF = 0; - } - EntityUpdateStatusSprites(pokemon); - } -} - -void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status == newStatus) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); - } - else { - nullsub_57(target); - if ((entityInfo->reflectClassStatus.status != STATUS_COUNTER) && (entityInfo->reflectClassStatus.status != STATUS_MINI_COUNTER)) { - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target,gCounterTurnRange, FALSE) + 1; - } - entityInfo->reflectClassStatus.status = newStatus; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB0E0); - EntityUpdateStatusSprites(target); - } - } -} - -void SafeguardStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_SAFEGUARD) { - entityInfo->reflectClassStatus.status = STATUS_SAFEGUARD; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gSafeguardTurnRange, FALSE) + 1; - nullsub_58(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB048); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB074); - } - EntityUpdateStatusSprites(target); - } -} - -void MistStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_MIST) { - entityInfo->reflectClassStatus.status = STATUS_MIST; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMistTurnRange, FALSE) + 1; - nullsub_59(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB09C); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB0C4); - } - EntityUpdateStatusSprites(target); - } -} - -void WishStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_WISH) { - entityInfo->reflectClassStatus.status = STATUS_WISH; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gWishTurnRange, FALSE) + 1; - sub_8041B34(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE1C); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE3C); - } - EntityUpdateStatusSprites(target); - } -} - -void MagicCoatStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_MAGIC_COAT) { - entityInfo->reflectClassStatus.status = STATUS_MAGIC_COAT; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMagicCoatTurnRange, FALSE) + 1; - nullsub_60(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF5C); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF8C); - } - EntityUpdateStatusSprites(target); - } -} - -void LightScreenStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_LIGHT_SCREEN) { - entityInfo->reflectClassStatus.status = STATUS_LIGHT_SCREEN; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gLightScreenTurnRange, FALSE) + 1; - nullsub_61(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB130); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB160); - } - EntityUpdateStatusSprites(target); - } -} - -void ReflectStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_REFLECT) { - entityInfo->reflectClassStatus.status = STATUS_REFLECT; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gReflectTurnRange, FALSE) + 1; - nullsub_62(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB17C); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB1A8); - } - EntityUpdateStatusSprites(target); - } -} - -void ProtectStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - nullsub_63(target); - entityInfo = GetEntInfo(target); - if (entityInfo->reflectClassStatus.status != STATUS_PROTECT) { - entityInfo->reflectClassStatus.status = STATUS_PROTECT; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gProtectTurnRange, FALSE) + 1; - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9B0); - } - else { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9D8); - } - EntityUpdateStatusSprites(target); - } -} - -void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_COAT) { - entityInfo->reflectClassStatus.status = STATUS_MIRROR_COAT; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMirrorCoatTurnRange, FALSE) + 1; - nullsub_64(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAC0); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAE4); - } - EntityUpdateStatusSprites(target); - } -} - -void EndureStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_ENDURING) { - entityInfo->reflectClassStatus.status = STATUS_ENDURING; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gEnduringTurnRange, FALSE) + 1; - nullsub_65(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBF0); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC14); - } - EntityUpdateStatusSprites(target); - } -} - -void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_MOVE) { - entityInfo->reflectClassStatus.status = STATUS_MIRROR_MOVE; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMirrorMoveTurnRange, FALSE) + 1; - nullsub_66(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC38); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC5C); - } - EntityUpdateStatusSprites(target); - } -} - -void Conversion2StatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - - if(AbilityIsActive(target, ABILITY_FORECAST)) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message); - else - { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_CONVERSION2) { - entityInfo->reflectClassStatus.status = STATUS_CONVERSION2; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gConversion2TurnRange, FALSE) + 1; - nullsub_67(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC7C); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCA4); - } - EntityUpdateStatusSprites(target); - } - } -} - -void VitalThrowStatusTarget(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->reflectClassStatus.status != STATUS_VITAL_THROW) { - entityInfo->reflectClassStatus.status = STATUS_VITAL_THROW; - entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gVitalThrowTurnRange, FALSE) + 1; - nullsub_68(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCC8); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCF0); - } - EntityUpdateStatusSprites(target); - } -} - -void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) -{ - bool8 statChanged; - EntityInfo *entityInfo; - s32 index; - - statChanged = FALSE; - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - - for(index = 0; index < 2; index++) - { - if (entityInfo->offensiveStages[index] != DEFAULT_STAT_STAGE) { - entityInfo->offensiveStages[index] = DEFAULT_STAT_STAGE; - statChanged = TRUE; - } - if (entityInfo->defensiveStages[index] != DEFAULT_STAT_STAGE) { - entityInfo->defensiveStages[index] = DEFAULT_STAT_STAGE; - statChanged = TRUE; - } - if (entityInfo->hitChanceStages[index] != DEFAULT_STAT_STAGE) { - entityInfo->hitChanceStages[index] = DEFAULT_STAT_STAGE; - statChanged = TRUE; - } - if (!F248EqualsInt(entityInfo->offensiveMultipliers[index], 1)) { - entityInfo->offensiveMultipliers[index] = F248_ONE; - statChanged = TRUE; - } - if (!F248EqualsInt(entityInfo->defensiveMultipliers[index], 1)) { - entityInfo->defensiveMultipliers[index] = F248_ONE; - statChanged = TRUE; - } - } - if (statChanged) { - sub_80420C8(target); - } - else if (param_3 != 0) { - sub_80420C8(target); - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (statChanged) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD18); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD3C); - } - EntityUpdateStatusSprites(target); - } -} - -void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) -{ - bool8 moveUnsealed; // r9 - s32 moveSpeed; - Move *move; - EntityInfo *entityInfo; // r7 - bool8 bVar8; // r8 - s32 index; - - bVar8 = FALSE; - moveUnsealed = FALSE; - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - if (HasNegativeStatus(target)) { - bVar8 = TRUE; - EndSleepClassStatus(pokemon,target,0,0); - if (!EntityIsValid(target)) { - return; - } - EndBurnClassStatus(pokemon,target); - EndFrozenClassStatus(pokemon,target); - EndCringeClassStatus(pokemon,target); - EndCurseClassStatus(pokemon,target,0); - EndLeechSeedClassStatus(pokemon,target); - SendMoveEndMessage(pokemon,target); - SendEyesightEndMessage(pokemon,target); - SendMuzzledEndMessage(pokemon,target); - if (entityInfo->perishSongTurns != 0) { - entityInfo->perishSongTurns = 0; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_8100594); - } - if (entityInfo->exposed) { - entityInfo->exposed = FALSE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrExposedWoreOffMessage); - } - } - - moveSpeed = CalcSpeedStage(target); - for(index = 0; index < NUM_SPEED_COUNTERS; index++) - { - entityInfo->speedDownCounters[index] = 0; - } - - if (moveSpeed != CalcSpeedStage(target)) { - bVar8 = TRUE; - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[entityInfo->speedStage]); - } - - for(index = 0; index < MAX_MON_MOVES; index++) - { - move = &entityInfo->moves.moves[index]; - if ((move->moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags2 & MOVE_FLAG_EXISTS)) { - bVar8 = TRUE; - moveUnsealed = TRUE; - move->moveFlags2 &= ~(MOVE_FLAG_EXISTS); - } - } - - if (bVar8) { - if (param_3 != 0) { - sub_80420C8(target); - } - if (moveUnsealed) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrSealedMoveReleasedMessage); - } - } - else if (param_4 == 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_81004E8); - } - EntityUpdateStatusSprites(target); - } -} - -void sub_807A0CC(Entity * pokemon, Entity * target) -{ - Move *move; - EntityInfo *entityInfo; - s32 index; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - ResetMonEntityData(entityInfo,0); - entityInfo->perishSongTurns = 0; - entityInfo->exposed = FALSE; - - for(index = 0; index < MAX_MON_MOVES; index++) - { - move = &entityInfo->moves.moves[index]; - if ((move->moveFlags & MOVE_FLAG_EXISTS)) { - move->moveFlags2 &= ~(MOVE_FLAG_EXISTS); - } - } - EntityUpdateStatusSprites(target); - }; -} - -void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4) -{ - EntityInfo *entityInfo; - bool8 isAsleep; - - isAsleep = FALSE; - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->sleepClassStatus.status) { - case STATUS_NONE: - case 6: - break; - case STATUS_SLEEP: - isAsleep = TRUE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA6E8); - break; - case STATUS_SLEEPLESS: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA708); - break; - case STATUS_NIGHTMARE: - isAsleep = TRUE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA70C); - if (param_4) { - DealDamageToEntity(target,gNightmareDmgValue,8,0x20f); - } - break; - case STATUS_NAPPING: - isAsleep = TRUE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA710); - HealTargetHP(pokemon,target,gNappingHpHealValue, 0, FALSE); - entityInfo->sleepClassStatus.status = 0; - sub_8079F20(pokemon,target,1,1); - break; - case STATUS_YAWNING: - if (param_3) { - entityInfo->sleepClassStatus.status = STATUS_NONE; - SleepStatusTarget(pokemon,target,CalculateStatusTurns(target, gSleepFromYawnTurnRange, TRUE) + 1, TRUE); - return; - } - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA734); - break; - } - entityInfo->sleepClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); - if (isAsleep) { - sub_806CE68(target,8); - } -} - -void EndBurnClassStatus(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->burnClassStatus.status) { - case STATUS_NONE: - case 5: - break; - case STATUS_POISONED: - case STATUS_BADLY_POISONED: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8A8); - break; - case STATUS_PARALYSIS: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA868); - break; - case STATUS_BURN: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA888); - break; - - } - entityInfo->burnClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); -} - -void EndFrozenClassStatus(Entity * pokemon, Entity *target) -{ - bool8 isFrozen; - EntityInfo *entityInfo; - - isFrozen = FALSE; - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->frozenClassStatus.status) { - case STATUS_NONE: - case 8: - break; - case STATUS_FROZEN: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); - isFrozen = TRUE; - break; - case STATUS_CONSTRICTION: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA820); - break; - case STATUS_SHADOW_HOLD: - case STATUS_INGRAIN: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA824); - break; - case STATUS_WRAP: - case STATUS_WRAPPED: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA81C); - sub_8076CB4(entityInfo->unk9C); - break; - case STATUS_PETRIFIED: - TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerPetrifiedMessage); - break; - } - entityInfo->frozenClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); - if (isFrozen) { - sub_8042A74(target); - } -} - -void EndCringeClassStatus(Entity * pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->cringeClassStatus.status) { - case STATUS_NONE: - case 8: - break; - case STATUS_CONFUSED: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA800); - break; - case STATUS_COWERING: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA97C); - break; - case STATUS_TAUNTED: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA9DC); - break; - case STATUS_PAUSED: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAC38); - break; - case STATUS_INFATUATED: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAB90); - break; - case STATUS_ENCORE: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAAAC); - break; - case STATUS_CRINGE: - TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerCringingMessage); - break; - } - entityInfo->cringeClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); - CalcSpeedStage(target); -} - -void EndReflectClassStatus(Entity * pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->reflectClassStatus.status) { - case STATUS_NONE: - case 0xF: - break; - case STATUS_REFLECT: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA638); - break; - case STATUS_SAFEGUARD: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA69C); - break; - case STATUS_LIGHT_SCREEN: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA658); - break; - case STATUS_COUNTER: - case STATUS_MINI_COUNTER: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA67C); - break; - case STATUS_MAGIC_COAT: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6BC); - break; - case STATUS_WISH: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6D4); - break; - case STATUS_PROTECT: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9C0); - break; - case STATUS_MIRROR_COAT: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA68); - break; - case STATUS_ENDURING: - LogMessageByIdWithPopupCheckUser(target, *gPtrMonStoppedEnduringMessage); - break; - case STATUS_MIRROR_MOVE: - LogMessageByIdWithPopupCheckUser(target,*gPtrMonMirrorMoveFadedMessage); - break; - case STATUS_CONVERSION2: - LogMessageByIdWithPopupCheckUser(target, *gPtrMonConversion2FailedMessage); - break; - case STATUS_VITAL_THROW: - LogMessageByIdWithPopupCheckUser(target, *gPtrMonGaveUpVitalThrowMessage); - break; - case STATUS_MIST: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB40); - break; - } - entityInfo->reflectClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); -} - -void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus) -{ - u32 uVar3; - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->curseClassStatus.status) { - case STATUS_NONE: - case 4: - break; - case STATUS_CURSED: - if (curseClassStatus != STATUS_CURSED) { - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7BC); - } - break; - case STATUS_SNATCH: - if (curseClassStatus != STATUS_SNATCH) { - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7DC); - } - gDungeon->snatchPokemon = NULL; - gDungeon->unk17B3C = 0; - break; - case STATUS_DECOY: - entityInfo->curseClassStatus.status = STATUS_NONE; - uVar3 = sub_806CEBC(target); - sub_806CCB4(target,uVar3); - gDungeon->decoyIsActive = FALSE; - if (curseClassStatus != STATUS_DECOY) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9A0); - } - break; - } - entityInfo->curseClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); - } -} - -void EndLeechSeedClassStatus(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->leechSeedClassStatus.status) - { - case STATUS_NONE: - break; - case STATUS_LEECH_SEED: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA79C); - break; - case STATUS_DESTINY_BOND: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA8C); - break; - } - entityInfo->leechSeedClassStatus.status = STATUS_NONE; - entityInfo->leechSeedClassStatus.unk8 = 0xff; - EntityUpdateStatusSprites(target); - } -} - -void SendMoveEndMessage(Entity * pokemon, Entity * target) -{ - EntityInfo * entityInfo; - - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->sureShotClassStatus.status) { - case STATUS_NONE: - case 5: - break; - case STATUS_SURE_SHOT: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA8E0); - break; - case STATUS_WHIFFER: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA90C); - break; - case STATUS_SET_DAMAGE: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA934); - break; - case STATUS_FOCUS_ENERGY: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA95C); - break; - } - entityInfo->sureShotClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); -} - -void SendTransformEndMessage(Entity * pokemon, Entity *target) -{ - bool8 isInvisible; - EntityInfo *entityInfo; - u32 uVar3; - - isInvisible = FALSE; - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->invisibleClassStatus.status) { - case STATUS_NONE: - case 4: - break; - case STATUS_INVISIBLE: - isInvisible = TRUE; - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9F4); - break; - case STATUS_MOBILE: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABBC); - break; - case STATUS_TRANSFORMED: - entityInfo->apparentID = GetMonsterApparentID(target, entityInfo->id); - target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID); - uVar3 = sub_806CEBC(target); - sub_806CCB4(target,uVar3); - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB6C); - break; - } - entityInfo->invisibleClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); - if (isInvisible) { - sub_807EC28(TRUE); - } -} - -void SendEyesightEndMessage(Entity * pokemon,Entity * target) -{ - EntityInfo *entityInfo; - - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->blinkerClassStatus.status) { - case STATUS_NONE: - case 4: - break; - case STATUS_BLINKER: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA0C); - break; - case STATUS_CROSS_EYED: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA2C); - break; - case STATUS_EYEDROPS: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA48); - break; - } - entityInfo->blinkerClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); - if (entityInfo->isTeamLeader) { - DungeonRunFrameActions(0x31); - sub_8049ED4(); - ShowWholeRevealedDungeonMap(); - } -} - -void SendMuzzledEndMessage(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo; - - if (!EntityIsValid(target)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->muzzled.muzzled) { - case FALSE: - case 2: - break; - case TRUE: - LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABC0); - break; - } - entityInfo->muzzled.muzzled = FALSE; - EntityUpdateStatusSprites(target); -} - -bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target) -{ - EntityInfo *entityInfo = GetEntInfo(target); - bool32 msg = FALSE; - - if (entityInfo->frozenClassStatus.status == STATUS_PETRIFIED) { - EndFrozenClassStatus(pokemon, target); - msg = TRUE; - } - if (entityInfo->sleepClassStatus.status == STATUS_SLEEP && entityInfo->sleepClassStatus.turns == 0x7f) { - EndSleepClassStatus(pokemon,target, FALSE, TRUE); - msg = TRUE; - } - return msg; -} - -void WakeUpPokemon(Entity * pokemon) -{ - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - entityInfo->sleepClassStatus.status = STATUS_NONE; - entityInfo->sleepClassStatus.turns = 0; - sub_806A898(pokemon, 1, 1); - EntityUpdateStatusSprites(pokemon); -} - -void SendThawedMessage(Entity *pokemon, Entity *target) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) { - entityInfo->frozenClassStatus.status = STATUS_NONE; - entityInfo->frozenClassStatus.turns = 0; - entityInfo->frozenClassStatus.damageCountdown = 0; - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out! - EntityUpdateStatusSprites(target); - } - } -} +extern s16 sub_803D970(u32); +extern void sub_804178C(u32); void sub_807AA30(void) { @@ -1636,9 +91,6 @@ _WakeUp: } } -extern s16 sub_803D970(u32); -extern void sub_804178C(u32); - void sub_807AB38(Entity *entity, bool8 forcedMonsterHouse) { u8 monsterHouseRoomId; diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c deleted file mode 100644 index 85ef2cc49..000000000 --- a/src/code_807CD9C.c +++ /dev/null @@ -1,866 +0,0 @@ -#include "global.h" -#include "constants/ability.h" -#include "constants/weather.h" -#include "code_803E46C.h" -#include "code_8045A00.h" -#include "dungeon_message.h" -#include "code_806CD90.h" -#include "code_807CD9C.h" -#include "structs/str_dungeon.h" -#include "code_8077274_1.h" -#include "dungeon_ai.h" -#include "dungeon_engine.h" -#include "dungeon_generation.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_map.h" -#include "dungeon_map_access.h" -#include "dungeon_util.h" -#include "math.h" -#include "move_effects_target.h" -#include "moves.h" -#include "move_util.h" -#include "code_8041AD0.h" -#include "tile_types.h" -#include "code_803E668.h" -#include "weather.h" -#include "dungeon_config.h" -#include "dungeon_misc.h" -#include "dungeon_items.h" - -extern u32 gDungeonFramesCounter; - -extern u8 *gUnknown_80FCA10[]; -extern u8 *gUnknown_80F8A0C[]; -extern u8 *gUnknown_80FCBCC[]; -extern u8 *gUnknown_80FC9E8[]; -extern u8 *gUnknown_80FCB14[]; -extern u8 *gUnknown_80FCAE8[]; -extern u8 *gUnknown_80FC97C[]; -extern u8 *gUnknown_80FC9A0[]; -extern u8 *gUnknown_80FC584[]; -extern u8 *gUnknown_80FD320[]; -extern u8 *gUnknown_80FD2F8[]; -extern u8 *gUnknown_80FCB98[]; -extern u8 *gUnknown_80FC9C0[]; -extern u8 *gUnknown_80FD060[]; -extern u8 *gUnknown_80FD08C[]; -extern u8 *gUnknown_80FD05C[]; -extern u8 *gUnknown_80FD3D0[]; -extern u8 *gUnknown_80FD3CC[]; -extern u8 *gUnknown_80FD3C8[]; -extern u8 *gUnknown_80FD3A0[]; -extern u8 *gUnknown_80F96BC[]; -extern u8 *gUnknown_80F96EC[]; -extern struct DungeonPos *gUnknown_8107178[3]; - -extern void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s32 param_4,s32 param_5); // TODO: param_4 should be s16 -extern void sub_804216C(Entity *pokemon, Entity *target, u32 r2); -extern void sub_804218C(Entity *pokemon, Entity *target); - -EWRAM_INIT u32 gUnknown_203B444[3] = {0x28, 0x28, 0x50}; - -void sub_804EB30(); -bool8 ExposeTrap(s32 x, s32 y); -void ShowWholeRevealedDungeonMap(); -void sub_8049ED4(); -void sub_806A5B8(Entity *); -u8 sub_8045888(Entity *); -void sub_807EC28(u32); -void sub_807D068(Entity *, DungeonPos *); -u8 sub_8044B28(void); -extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); -void sub_80421AC(Entity * pokemon, Entity * target); -void sub_807BB78(Entity *pokemon); -extern void sub_803F580(u32); -bool8 sub_808384C(DungeonPos *, DungeonPos *); -u8 sub_8083660(DungeonPos *); - -void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction) -{ - const Tile *tile; - int iVar8; - bool8 flag; - DungeonPos pos; - Move move; - int counter; - Entity *entity; - PixelPos pos32; - - counter = 10; - if (IsCurrentFixedRoomBossFight()) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC9E8); // It couldn't be knocked flying! - return; - } - else - { - if (pokemon == target) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA10); // {POKEMON_0} couldn't be knocked flying! - return; - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (AbilityIsActive(target,ABILITY_SUCTION_CUPS)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! - return; - } - else - { - (GetEntInfo(target)->action).direction = (direction + 4) & DIRECTION_MASK; - sub_806CDD4(target, 6, (direction + 4) & DIRECTION_MASK); - sub_80421C0(target,0x1a3); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F8A0C); // {POKEMON_0} was blown away! - flag = TRUE; - entity = NULL; - - for(; counter > 0; counter--) - { - pos = target->pos; - pos.x += gAdjacentTileOffsets[direction].x; - pos.y += gAdjacentTileOffsets[direction].y; - if ((((pos.x < 0) || (pos.y < 0)) || (DUNGEON_MAX_SIZE_X <= pos.x)) || - (DUNGEON_MAX_SIZE_Y <= pos.y)) goto _0807CF20; - pos32.x = gAdjacentTileOffsets[direction].x << 0xA; - pos32.y = gAdjacentTileOffsets[direction].y << 0xA; - - for(iVar8 = 0; iVar8 < 6; iVar8++) - { - IncreaseEntityPixelPos(target,pos32.x,pos32.y); - if (sub_8045888(target) != 0) { - DungeonRunFrameActions(0x19); - } - } - tile = GetTile(pos.x, pos.y); - if (tile->monster != NULL) { - entity = tile->monster; - goto _0807CF26; - } - if (sub_80705F0(target,&pos)){ - flag = (GetTerrainType(tile) != TERRAIN_TYPE_WALL); - goto _0807CF20; - } - sub_80694C0(target,pos.x,pos.y,1); - } - - - flag = TRUE; - _0807CF20: - if (!flag) { - _0807CF26: - - sub_807D068(target,&target->pos); - sub_806F370(pokemon,target,gBlowAwayDmgValue,0,0,0,0x219,0,0,0); - } - if (sub_8044B28()) { - return; - } - if (entity != NULL) { - InitPokemonMove(&move,0x163); - if (!sub_80571F0(entity,&move)) { - TrySendImmobilizeSleepEndMsg(pokemon,entity); - sub_806F370(pokemon,entity,gBlowAwayDmgValue,0,0,0,0x21a,0,0,0); - } - } - if (sub_8044B28()) { - return; - } - if (!EntityIsValid(target)) { - return; - } - sub_806A5B8(target); - if (sub_80706A4(target,&target->pos)) { - WarpTarget(target,target,0,0); - } - if (!EntityIsValid(target)) { - return; - } - sub_806CE68(target,8); - if (GetEntInfo(target)->isTeamLeader) { - gDungeon->unk1 = 0; - gDungeon->unk5C0 = -1; - sub_804AC20(&target->pos); - sub_807EC28(FALSE); - } - sub_806A5B8(target); - sub_8075900(target,gDungeon->forceMonsterHouse); - } - } -} - -void sub_807D068(Entity *pokemon, DungeonPos *pos) -{ - int pixelX; - int posY; - int pixelY; - int posX; - int counter; - int iVar8; - s32 diff; - PixelPos local_34; - int incrementX; - int incrementY; - - posX = X_POS_TO_PIXELPOS(pos->x); - posY = Y_POS_TO_PIXELPOS(pos->y); - diff = (pokemon->pixelPos).x - posX; - if (diff < 0) { - diff = -diff; - } - if (diff < 0xc) { - diff = (pokemon->pixelPos).y - posY; - if (diff < 0) { - diff = -diff; - } - if (diff < 0xc) goto _0807D11E; - } - iVar8 = 0; - pixelX = (pokemon->pixelPos).x; - pixelY = (pokemon->pixelPos).y; - incrementX = (posX - pixelX) / 0xc; - incrementY = (posY - pixelY) / 0xc; - - for(counter = 0; counter < 0xC; counter++) - { - pixelX += incrementX; - pixelY += incrementY; - local_34.x = pixelX; - local_34.y = pixelY; - pokemon->unk1C.raw = sin_4096(iVar8) * 0xc; - sub_804535C(pokemon, &local_34); - if (sub_8045888(pokemon)) { - DungeonRunFrameActions(0x1a); - } - iVar8 = iVar8 + 0xaa; - } -_0807D11E: - local_34.x = posX; - local_34.y = posY; - pokemon->unk1C = IntToF248(0); - sub_804535C(pokemon,&local_34); - DungeonRunFrameActions(0x1a); -} - -void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) -{ - EntityInfo *info; - u32 direction; - DungeonPos local_2c; - bool8 flag; - - info = GetEntInfo(target); - flag = FALSE; - - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (AbilityIsActive(target,ABILITY_SUCTION_CUPS)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAE8); - return; - } - if (IsCurrentFixedRoomBossFight()) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC97C); - return; - } - if (param_3 == 1) - { - DungeonPos stairsPosition = gDungeon->stairsSpawn; - if(stairsPosition.x == target->pos.x && stairsPosition.y == target->pos.y) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC9A0); // It's already on the stairs! - PetrifiedStatusTarget(pokemon,target); - return; - } - } - - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC584); // $m0 warped! - TrySendImmobilizeSleepEndMsg(target,target); - sub_80421AC(pokemon,target); - if (sub_8045888(target)) { - direction = (info->action).direction; - target->unk1C.raw += + 0x800; - while ( target->unk1C.raw < 0xa000) { - if ((gDungeonFramesCounter & 3) == 0) { - direction = (direction + 1) & DIRECTION_MASK; - info->action.direction = direction & DIRECTION_MASK; - sub_806CE68(target,direction); - } - DungeonRunFrameActions(0x22); - target->unk1C.raw += 0x800; - } - } - - - switch(param_3) - { - default: - case 0: - if (!sub_8083660(&local_2c)) { - local_2c = target->pos; - flag = TRUE; - } - break; - case 1: - if (!sub_808384C(&local_2c,&gDungeon->stairsSpawn)) { - local_2c = target->pos; - flag = TRUE; - } - break; - case 2: - if (!sub_808384C(&local_2c,pos)) { - local_2c = target->pos; - flag = TRUE; - } - break; - case 3: - local_2c = *pos; - break; - - } - - sub_80694C0(target,local_2c.x,local_2c.y,1); - sub_804535C(target,0); - sub_807BB78(target); - sub_803F580(1); - if (sub_8045888(target)) { - direction = (info->action).direction; - target->unk1C.raw = 0x9c00; - do { - if ((gDungeonFramesCounter & 3) == 0) { - direction = (direction + 1) & DIRECTION_MASK; - info->action.direction = direction & DIRECTION_MASK; - sub_806CE68(target,direction); - } - DungeonRunFrameActions(0x22); - target->unk1C.raw -= 0x400; - } while (0 < target->unk1C.raw); - } - target->unk1C = IntToF248_2(0); - DungeonRunFrameActions(0x22); - if (flag) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCB14); // But it dropped back at the same spot! - } - if (param_3 == 1) { - PetrifiedStatusTarget(pokemon,target); - } - if (info->isTeamLeader) { - sub_804AC20(&target->pos); - gDungeon->unk1 = 0; - gDungeon->unk5C0 = -1; - sub_807EC28(0); - } - sub_806A5B8(target); - sub_8075900(target,gDungeon->forceMonsterHouse); -} - -void sub_807D3CC(Entity *param_1) -{ - u32 room; - u8 flag; - int x; - int y; - s32 range; - RoomData *roomData; - - flag = FALSE; - range = gDungeon->unk181e8.visibilityRange; - if (range == 0) { - range = 2; - } - room = GetEntityRoom(param_1); - - if (room == CORRIDOR_ROOM) { - for (y = (param_1->pos).y - range; y <= ((param_1->pos).y + range); y++) - { - for (x = (param_1->pos).x - range; x <= ((param_1->pos).x + range); x++) { - flag |= ExposeTrap(x,y); - } - } - } - else { - roomData = &gDungeon->roomData[room]; - for (y = roomData->bottomRightCornerY + -1; y <= roomData->topLeftCornerY + 1; y++) { - for (x = roomData->bottomRightCornerX + -1; x <= roomData->topLeftCornerX + 1; x++) { - flag |= ExposeTrap(x,y); - } - } - } - if (flag) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FD2F8); // All traps were exposed - ShowWholeRevealedDungeonMap(); - sub_8049ED4(); - } - else { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FD320); // There appears to be no hidden traps. - } -} - -bool8 ExposeTrap(s32 x,s32 y) -{ - const Tile *tile; - Entity *trap; - - tile = GetTile(x,y); - trap = tile->object; - if (((trap != NULL) && (GetEntityType(trap) == ENTITY_TRAP)) && (!trap->isVisible)) { - trap->isVisible = TRUE; - return TRUE; - } - else { - return FALSE; - } -} - -extern const u8 *const gUnknown_80FE034; -extern const u8 *const gUnknown_80FE060; -extern const DungeonPos gUnknown_80F4468[]; - -void HandleTrawlOrbAction(Entity *user, Entity *target) -{ - Entity itemEntities[25]; - Item itemInfo[25]; - DungeonPos targetTilePos[25]; - PixelPos itemVelocity[25]; - bool8 targetTileUsed[30]; - s32 i; - s32 itemsCount; - bool8 hasTrawled; - bool8 hallucinating; - Entity *currItemEntity; - - hasTrawled = FALSE; - itemsCount = 0; - currItemEntity = &itemEntities[0]; - - for (i = 0; i < gDungeon->numItems; i++) { - Entity *dungeonItem = gDungeon->items[i]; - if (EntityIsValid(dungeonItem)) { - if (itemsCount >= 25) - break; - - if ((abs(dungeonItem->pos.x - user->pos.x) > 2 || abs(dungeonItem->pos.y - user->pos.y) > 2) - && GetTerrainType(GetTile(dungeonItem->pos.x, dungeonItem->pos.y)) != TERRAIN_TYPE_WALL) - { - currItemEntity->type = ENTITY_ITEM; - currItemEntity->axObj.info.item = &itemInfo[itemsCount]; - currItemEntity->pos = dungeonItem->pos; - SetEntityPixelPos(currItemEntity, (dungeonItem->pos.x * 24 + 4) * 256, (dungeonItem->pos.y * 24 + 4) * 256); - currItemEntity->spawnGenID = 0; - currItemEntity->isVisible = TRUE; - currItemEntity->unk22 = 0; - currItemEntity->unk1C = IntToF248_2(0); - itemInfo[itemsCount] = gDungeon->unk3804[i]; - currItemEntity++; - itemsCount++; - } - } - } - - if (itemsCount == 0) { - LogMessageByIdWithPopupCheckUser(user, gUnknown_80FE034); - } - else { - s32 var; - s32 i; - s32 unkAngle; - s32 animFrame; - - for (i = 0; i < 30; i++) { - targetTileUsed[i] = FALSE; - } - for (i = 0; i < itemsCount; i++) { - s32 j = 0; - bool8 foundTile = FALSE; - DungeonPos pos; - - pos.x = user->pos.x; - pos.y = user->pos.y; - - for (j = 0; j < 30; j++) { - if (gUnknown_80F4468[j].x == 99) - break; - if (!targetTileUsed[j]) { - const Tile *tile; - - pos.x = user->pos.x + gUnknown_80F4468[j].x; - pos.y = user->pos.y + gUnknown_80F4468[j].y; - - tile = GetTile(pos.x, pos.y); - if (GetTerrainType(tile) == TERRAIN_TYPE_NORMAL && !(tile->terrainType & TERRAIN_TYPE_STAIRS) && tile->object == NULL) { - targetTilePos[i] = pos; - targetTileUsed[j] = TRUE; - foundTile = TRUE; - break; - } - } - } - - if (!foundTile) { - itemEntities[i].type = ENTITY_NOTHING; - targetTilePos[i].x = -1; - targetTilePos[i].y = -1; - } - } - - for (i = 0; i < itemsCount; i++) { - if (EntityIsValid(&itemEntities[i])) { - RemoveItemFromDungeonAt(&itemEntities[i].pos, 1); - ShowDungeonMapAtPos(itemEntities[i].pos.x, itemEntities[i].pos.y); - itemVelocity[i].x = (((targetTilePos[i].x * 24 + 4) * 256) - itemEntities[i].pixelPos.x) / 60; - itemVelocity[i].y = (((targetTilePos[i].y * 24 + 4) * 256) - itemEntities[i].pixelPos.y) / 60; - } - } - - sub_80421C0(user, 0x1A2); - - var = 0; - hallucinating = gDungeon->unk181e8.hallucinating; - unkAngle = 0; - for (animFrame = 0; animFrame < 60; animFrame++) { - for (i = 0; i < itemsCount; i++) { - if (EntityIsValid(&itemEntities[i])) { - IncreaseEntityPixelPos(&itemEntities[i], itemVelocity[i].x, itemVelocity[i].y); - itemEntities[i].unk1C.raw = sin_4096(unkAngle) * 0xC; - sub_80462AC(&itemEntities[i], hallucinating, 0, var, 0); - } - } - - DungeonRunFrameActions(0x13); - unkAngle += 0x22; - if (!(animFrame & 3)) { - var++; - } - var &= 7; - } - - for (i = 0; i < itemsCount; i++) { - if (targetTilePos[i].x >= 0) { - AddItemToDungeonAt(&targetTilePos[i], GetItemData(&itemEntities[i]), 1); - ShowDungeonMapAtPos(targetTilePos[i].x, targetTilePos[i].y); - hasTrawled = TRUE; - } - } - - if (hasTrawled) { - LogMessageByIdWithPopupCheckUser(user, gUnknown_80FE060); - } - else { - LogMessageByIdWithPopupCheckUser(user, gUnknown_80FE034); - } - sub_807EC28(1); - } -} - -void HandlePounceOrbAction(Entity *pokemon, Entity *target, u8 r2) { - EntityInfo *info; - const Tile *tile; - DungeonPos pos; - u32 direction = r2; - info = GetEntInfo(target); - if(AbilityIsActive(target, ABILITY_SUCTION_CUPS)) - { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FCB98); - return; - } - if(IsCurrentFixedRoomBossFight()) - { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FC9C0); - return; - } - if(direction == NUM_DIRECTIONS) - direction = info->action.direction; - sub_806CDD4(target, 6, direction); - - - while (1) - { - pos.x = target->pos.x + gAdjacentTileOffsets[direction].x; - pos.y = target->pos.y + gAdjacentTileOffsets[direction].y; - - if(pos.x <= 0 || pos.y <= 0 || pos.x > DUNGEON_MAX_SIZE_X - 2 || pos.y > DUNGEON_MAX_SIZE_Y - 2) break; - - tile = GetTile(pos.x, pos.y); - - if(tile->monster) break; - if(GetTerrainType(tile) == TERRAIN_TYPE_WALL) break; - - sub_80694C0(target, pos.x, pos.y, 0); - - sub_804535C(target, 0); - if(!sub_8045888(target)) continue; - DungeonRunFrameActions(0x3A); - } - - sub_806A5B8(target); - if(sub_80706A4(target, &target->pos)) - WarpTarget(target, target, 0, 0); - if(EntityIsValid(target)) - { - sub_806CE68(target, 8); - if(info->isTeamLeader) - { - sub_804AC20(&target->pos); - sub_807EC28(0); - } - sub_806A5B8(target); - - sub_8075900(target, gDungeon->forceMonsterHouse); - } -} - -void HandleDroughtOrbAction(Entity *pokemon, Entity *target) { - s32 x; - s32 y; - Tile *tile; - bool8 flag; - - flag = FALSE; - if(IsCurrentFixedRoomBossFight()) - { - LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FD060); - return; - } - - if(IsWaterTileset()) - { - LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FD08C); - return; - } - - for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) - for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) - { - tile = GetTileMut(x, y); - if(GetTerrainType(tile) == TERRAIN_TYPE_SECONDARY) - { - SetTerrainNormal(tile); - sub_80498A8(x, y); - flag = TRUE; - } - } - for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) - for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) - sub_8049BB0(x, y); - - if(flag) - { - sub_80421C0(pokemon, 0x1A1); - LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FD05C); - } - else - { - LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FD060); - } - gDungeon->unk644.unk2C = 1; - sub_806CF60(); - ShowWholeRevealedDungeonMap(); - sub_8049ED4(); -} - -void HandleOneRoomOrb(Entity *pokemon, Entity *target) { - bool8 bVar1; - Tile *tile; - s32 y; - Entity *entity; - s32 x; - s32 index; - bool8 isMonsterHouse; - - if (gDungeon->forceMonsterHouse != 0) { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD3C8); - return; - } - - if (gDungeon->unk3A0B != 0) { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD3CC); - return; - } - - if (IsBossFight()) { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD3D0); - return; - } - isMonsterHouse = FALSE; - - for(x = 1; x < DUNGEON_MAX_SIZE_X - 1; x++) - { - for(y = 1; y < DUNGEON_MAX_SIZE_Y - 1; y++) - { - bVar1 = 0; - tile = GetTileMut(x,y); - tile->terrainType &= ~(TERRAIN_TYPE_UNK_x400); - tile->room = 0; - if ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) - { - if((tile->terrainType & TERRAIN_TYPE_UNBREAKABLE) == 0) { - tile->spawnOrVisibilityFlags |= SPAWN_FLAG_STAIRS | SPAWN_FLAG_ITEM; - tile->terrainType &= ~(TERRAIN_TYPE_NATURAL_JUNCTION); - if ((tile->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) { - isMonsterHouse = TRUE; - } - if (GetTerrainType(tile) != TERRAIN_TYPE_SECONDARY) - if((GetTerrainType(tile) != (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) { - if (((x == 1) || (((y == 1 || (x == DUNGEON_MAX_SIZE_X - 2)) || (y == DUNGEON_MAX_SIZE_Y - 2)))) && - ((tile->object == NULL && (gDungeon->unk644.unk2C == 0)))) { - bVar1 = TRUE; - } - if (bVar1) { - SetTerrainSecondary(tile); - } - else { - if (GetTerrainType(tile) == TERRAIN_TYPE_NORMAL) continue; - SetTerrainNormal(tile); - tile->terrainType |= TERRAIN_TYPE_UNK_x400; - } - } - } - } - } - } - - - if (StairsAlwaysReachable(gDungeon->stairsSpawn.x,gDungeon->stairsSpawn.y,TRUE)) { - for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) - { - for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) - { - tile = GetTileMut(x,y); - if (!(tile->terrainType & TERRAIN_TYPE_UNBREAKABLE)) - if(((tile->terrainType & (TERRAIN_TYPE_UNREACHABLE_FROM_STAIRS| TERRAIN_TYPE_UNK_x400)) == (TERRAIN_TYPE_UNREACHABLE_FROM_STAIRS| TERRAIN_TYPE_UNK_x400))) { - SetTerrainSecondary(tile); - } - } - } - } - if (isMonsterHouse) { - gDungeon->monsterHouseRoom = FALSE; - } - for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) - { - - for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) - { - if (isMonsterHouse) { - GetTileMut(x,y)->terrainType |= TERRAIN_TYPE_IN_MONSTER_HOUSE; - } - sub_8049BB0(x,y); - } - } - - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) - { - entity = gDungeon->activePokemon[index]; - if (EntityIsValid(entity)) { - entity->room = GetTile(entity->pos.x,entity->pos.y)->room; - } - } - sub_804EB30(); - sub_804AAD4(); - sub_8049884(); - sub_806CF60(); - ShowWholeRevealedDungeonMap(); - sub_8049ED4(); - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD3A0); - sub_803E708(0x28,0x2b); - sub_8075900(pokemon,1); - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) - { - entity = gDungeon->activePokemon[index]; - if (EntityIsValid(entity)) { - sub_806A5B8(entity); - if ((EntityIsValid(entity)) && (sub_80706A4(entity,&entity->pos))) { - WarpTarget(entity,entity,0,0); - } - } - } - gDungeon->forceMonsterHouse = TRUE; - sub_803E708(0x14,0x2b); -} - - -// https://decomp.me/scratch/JZ51a -- sub_807E1A0 param_4 should be s16 but using s32 to match this func -void HandleExplosion(Entity *pokemon,Entity *target,DungeonPos *param_3,s32 param_4,u8 moveType,s16 param_6) -{ - bool8 flag; - DungeonPos *posPtr; - Tile *tile; - Entity * entity1; - Entity *entity2; - int x; - int y; - int index; - DungeonPos pos; - - u32 uStack_2c; - - uStack_2c = param_6; - for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity1 = gDungeon->activePokemon[index]; - if ((EntityIsValid(entity1)) && (AbilityIsActive(entity1, ABILITY_DAMP))) break; - } - if (index != DUNGEON_MAX_POKEMON) { - sub_804218C(pokemon,target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F96EC); - } - else if (GetApparentWeather(target) == WEATHER_RAIN) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F96EC); - } - else - { - sub_804216C(pokemon,target,param_4); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F96BC); - flag = FALSE; - - posPtr = (gUnknown_8107178)[param_4]; - if (posPtr->x != 99) { - while (posPtr->x != 99) { - pos.x = posPtr->x + param_3->x; - pos.y = posPtr->y + param_3->y; - if ((0 <= pos.x) && (0 <= pos.y) && (pos.x < DUNGEON_MAX_SIZE_X) && (pos.y < DUNGEON_MAX_SIZE_Y)) { - tile = GetTileMut(pos.x,pos.y); - if ((0 < pos.x) && (0 < pos.y && ((pos.x < (DUNGEON_MAX_SIZE_X - 1) && ((pos.y < (DUNGEON_MAX_SIZE_Y - 1) - && GetTerrainType(tile) == TERRAIN_TYPE_WALL))) - )) && (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) { - SetTerrainNormal(tile); - for(y = -1; y < 2; y++) - { - for(x = -1; x < 2; x++) - { - sub_80498A8(pos.x + x,pos.y + y); - } - } - flag = TRUE; - } - entity2 = tile->object; - if (((entity2 != NULL) && (entity2 != target)) && (GetEntityType(entity2) == ENTITY_ITEM)) { - RemoveItemFromDungeonAt(&pos, 0); - } - entity2 = tile->monster; - if (((entity2 != NULL) && (entity2 != target)) && (GetEntityType(entity2) == ENTITY_MONSTER)) { - sub_807E1A0(pokemon,entity2,moveType,uStack_2c,gUnknown_203B444[param_4]); - if (sub_8044B28()) break; - } - } - posPtr++; - } - } - if (sub_8044B28()) { - return; - } - if (GetEntityType(target) == ENTITY_MONSTER) { - sub_807E1A0(pokemon,target,moveType,uStack_2c,gUnknown_203B444[param_4]); - } - if (!flag) { - return; - } - for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) - { - for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) - { - sub_8049BB0(x,y); - } - } - ShowWholeRevealedDungeonMap(); - sub_8049ED4(); - } -} - diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c deleted file mode 100644 index bf803f2e4..000000000 --- a/src/code_807E1A0.c +++ /dev/null @@ -1,178 +0,0 @@ -#include "global.h" -#include "dungeon_misc.h" -#include "code_804267C.h" -#include "code_8045A00.h" -#include "dungeon_message.h" -#include "constants/ability.h" -#include "constants/type.h" -#include "dungeon_ai.h" -#include "dungeon_leader.h" -#include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_util.h" -#include "move_util.h" -#include "moves.h" -#include "structs/str_dungeon.h" - -extern u8 UseAttack(Entity *); -extern void sub_805E804(void); -void sub_806A2BC(Entity *pokemon, u8 param_2); -extern u8 sub_8044B28(void); -extern void nullsub_93(DungeonPos *); -extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); -extern void sub_807EC28(bool8); -extern void sub_806A5B8(Entity *); - -extern u32 gUnknown_80F5FAC[]; -extern u8 *gUnknown_80F9C4C[]; -extern u8 *gUnknown_80F9C70[]; -extern u8 *gUnknown_80F9C8C[]; -extern u8 *gUnknown_80F9CBC[]; -extern u8 *gUnknown_80FCAC0[]; - -void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s16 param_4,s32 param_5) -{ - EntityInfo *targetInfo; - u8 flag; - Move move; - s32 newHP; - s32 param_4_s32; - - param_4_s32 = param_4; - - if (EntityIsValid(target)) { - targetInfo = GetEntInfo(target); - InitPokemonMove(&move, MOVE_REGULAR_ATTACK); - if (!sub_80571F0(target,&move)) { - if (!targetInfo->isNotTeamMember) { - newHP = targetInfo->HP; - newHP /= 2; - if (MonsterIsType(target, TYPE_FIRE)) { - newHP /= 2; - } - if (newHP < 1) { - newHP = 1; - } - } - else { - newHP = param_5; - if (MonsterIsType(target, TYPE_FIRE)) { - newHP /= 2; - } - } - sub_806F370(pokemon,target,newHP,0,&flag,moveType,param_4_s32,0,0,0); - } - } -} - -void HandleSwitcherOrb(Entity *pokemon,Entity *target) -{ - DungeonPos pokemonPos; - DungeonPos targetPos; - - - if (AbilityIsActive(pokemon, ABILITY_SUCTION_CUPS)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places - } - else if(AbilityIsActive(target, ABILITY_SUCTION_CUPS)) - { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places - } - else - { - pokemonPos.x = pokemon->pos.x; - pokemonPos.y = pokemon->pos.y; - targetPos.x = target->pos.x; - targetPos.y = target->pos.y; - nullsub_93(&pokemonPos); - nullsub_93(&targetPos); - sub_80694C0(pokemon,targetPos.x,targetPos.y,1); - sub_80694C0(target,pokemonPos.x,pokemonPos.y,1); - sub_804535C(pokemon,NULL); - sub_804535C(target,NULL); - - if (EntityIsValid(pokemon)) { - if (GetEntInfo(pokemon)->isTeamLeader) { - sub_804AC20(&pokemon->pos); - sub_807EC28(FALSE); - } - sub_806A5B8(pokemon); - sub_8075900(pokemon,gDungeon->forceMonsterHouse); - } - - if (EntityIsValid(target)) { - if (GetEntInfo(target)->isTeamLeader) { - sub_804AC20(&target->pos); - sub_807EC28(FALSE); - } - sub_806A5B8(target); - sub_8075900(target,gDungeon->forceMonsterHouse); - } - } -} - -void sub_807E378(void) -{ - u16 uVar2; - Entity *leader; - - leader = GetLeader(); - if (EntityIsValid(leader)) { - - uVar2 = gDungeon->unk644.windTurns; - if ((gDungeon->unk644.windTurns < 1) || - (gDungeon->unk644.windTurns--, ((uVar2 - 1) << 0x10) < 1)) { - gDungeon->unk644.unk36 = 3; - } - - if (gDungeon->unk644.unk36 == 0) { - if (gDungeon->unk644.windTurns < 0xfa) { - sub_805E804(); - sub_806A2BC(leader,1); - UseAttack(leader); - if (sub_8044B28() == 0) { - LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C4C); - sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); - gDungeon->unk644.unk36 = 1; - } - } - } - else if (gDungeon->unk644.unk36 == 1) { - if (gDungeon->unk644.windTurns < 0x96) { - sub_805E804(); - sub_806A2BC(leader,1); - UseAttack(leader); - if (sub_8044B28() == 0) { - LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C70); - sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); - gDungeon->unk644.unk36 = 2; - } - } - } - else if (gDungeon->unk644.unk36 == 2) { - if (gDungeon->unk644.windTurns < 0x32) { - sub_805E804(); - sub_806A2BC(leader,1); - UseAttack(leader); - if (sub_8044B28() == 0) { - LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C8C); - sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); - gDungeon->unk644.unk36 = 3; - } - } - } - else if (gDungeon->unk644.windTurns < 1) { - sub_805E804(); - sub_806A2BC(leader,1); - UseAttack(leader); - if (sub_8044B28() == 0) { - LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9CBC); - sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); - gDungeon->unk644.unk36 = 4; - sub_8068FE0(leader,0x21e,leader); - } - } - } -} diff --git a/src/code_807E5AC.c b/src/code_807E5AC.c deleted file mode 100644 index eec543689..000000000 --- a/src/code_807E5AC.c +++ /dev/null @@ -1,911 +0,0 @@ -#include "global.h" -#include "weather.h" -#include "code_804267C.h" -#include "code_803E46C.h" -#include "dungeon.h" -#include "dungeon_config.h" -#include "dungeon_leader.h" -#include "dungeon_music.h" -#include "dungeon_util.h" -#include "pokemon.h" -#include "structs/map.h" -#include "dungeon_message.h" -#include "dungeon_pokemon_attributes.h" -#include "string_format.h" -#include "dungeon_movement.h" -#include "dungeon_capabilities.h" -#include "dungeon_visibility.h" -#include "dungeon_map_access.h" -#include "dungeon_movement.h" -#include "dungeon_ai_targeting.h" -#include "position_util.h" -#include "dungeon_ai.h" -#include "code_806CD90.h" -#include "code_807CD9C.h" -#include "dungeon_random.h" -#include "code_805D8C8.h" -#include "code_803E668.h" -#include "code_8045A00.h" -#include "dungeon_items.h" -#include "move_util.h" -#include "moves.h" -#include "code_80450F8.h" -#include "math.h" -#include "constants/ability.h" -#include "constants/monster.h" -#include "constants/type.h" -#include "dungeon_misc.h" -#include "code_807E5AC.h" -#include "sprite.h" - -extern OpenedFile *gUnknown_202ECA0; -extern SpriteOAM gUnknown_202EDC0; - -extern void sub_804178C(u32); -extern void sub_80429D8(Entity *r0); -extern s32 GetMonsterApparentID(Entity *pokemon, s32 id); -extern void sub_803E874(bool8 r10, s32 r9); -extern void GetWeatherName(u8 *dst, u8 weatherId); -extern s32 CalculateStatusTurns(Entity *target, const s16 *turnRange, bool8 factorCurerSkills); -extern void sub_80838EC(u8 *a); -extern bool8 sub_8044B28(void); - -void sub_807E7FC(bool8 arg0); -void sub_807EFFC(bool8 arg0); -s32 sub_807F19C(bool8 arg0); -void sub_807E8F0(Entity *pokemon); -bool8 sub_807EF48(void); -void sub_807F33C(void); - -extern const u8 *gWeatherNames[]; - -extern const u8 *const gUnknown_80FC5E0; -extern const u8 *const gUnknown_80FA778; -extern const u8 *const gUnknown_80FA758; -extern const u8 *const gUnknown_80FE674; -extern const u8 *const gUnknown_80FE65C; -extern const u8 *const gUnknown_80FE63C; -extern const u8 *const gUnknown_80FE5F0; -extern const u8 *const gUnknown_80FAD8C; -extern const u8 *const gUnknown_80FADB0; -extern const u8 *const gUnknown_80FE5C0; -extern const u8 *const gUnknown_80FE4F4; -extern const u8 *const gUnknown_80FE568; -extern const u8 *const gUnknown_80FE520; -extern const u8 *const gUnknown_80FE4D4; -extern const u8 *const gUnknown_80FE4B8; - - -// Note: gUnknown_202ECA0 file's 2d array is read as 1d array in functions below, be careful! -void sub_807E698(bool8 arg0) -{ - s32 i, j; - s32 weatherArrId = GetApparentWeather(NULL) * COLOR_RAMP_COUNT; - RGB *fileData = (void *) gUnknown_202ECA0->data; - u8 savedByte; - - sub_8042818(GetApparentWeather(NULL), arg0); - DungeonRunFrameActions(0x25); - sub_804178C(1); - savedByte = gUnknown_203B40D; - gUnknown_203B40D = 1; - - for (i = 0; i < 64; i++) { - bool8 r7 = FALSE; - - DungeonRunFrameActions(0x25); - for (j = 0; j < COLOR_RAMP_COUNT; j++) { - if (abs(gDungeon->colorRamp[j].r - fileData[weatherArrId + j].r) < 10) { - gDungeon->colorRamp[j].r = fileData[weatherArrId + j].r; - } - else { - r7 = TRUE; - if (gDungeon->colorRamp[j].r < fileData[weatherArrId + j].r) { - gDungeon->colorRamp[j].r += 10; - } - else if (gDungeon->colorRamp[j].r > fileData[weatherArrId + j].r) { - gDungeon->colorRamp[j].r -= 10; - } - } - - if (abs(gDungeon->colorRamp[j].g - fileData[weatherArrId + j].g) < 10) { - gDungeon->colorRamp[j].g = fileData[weatherArrId + j].g; - } - else { - r7 = TRUE; - if (gDungeon->colorRamp[j].g < fileData[weatherArrId + j].g) { - gDungeon->colorRamp[j].g += 10; - } - else if (gDungeon->colorRamp[j].g > fileData[weatherArrId + j].g) { - gDungeon->colorRamp[j].g -= 10; - } - } - - if (abs(gDungeon->colorRamp[j].b - fileData[weatherArrId + j].b) < 10) { - gDungeon->colorRamp[j].b = fileData[weatherArrId + j].b; - } - else { - r7 = TRUE; - if (gDungeon->colorRamp[j].b < fileData[weatherArrId + j].b) { - gDungeon->colorRamp[j].b += 10; - } - else if (gDungeon->colorRamp[j].b > fileData[weatherArrId + j].b) { - gDungeon->colorRamp[j].b -= 10; - } - } - } - - sub_803E874(FALSE, 0); - if (!r7) - break; - } - - gUnknown_203B40D = savedByte; - sub_807E7FC(arg0); -} - -void sub_807E7FC(bool8 r0) -{ - s32 i; - - Entity *cameraTarget = gDungeon->unk181e8.cameraTarget; - if (cameraTarget == NULL) { - cameraTarget = GetLeader(); - } - - if (r0) { - if (gDungeon->unk1356C == 0) { - GetWeatherName(gFormatBuffer_Monsters[0], GetApparentWeather(NULL)); - LogMessageByIdWithPopupCheckUser(cameraTarget, gUnknown_80FC5E0); // Weather: {ARG_POKEMON_0} - } - } - - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *pokemon = gDungeon->activePokemon[i]; - if (EntityIsValid(pokemon)) { - sub_807E8F0(pokemon); - } - } -} - -void sub_807E88C(void) -{ - s32 i; - s32 weatherArrId = GetApparentWeather(0) * COLOR_RAMP_COUNT; - RGB *fileData = (void *) gUnknown_202ECA0->data; - - for (i = 0; i < COLOR_RAMP_COUNT; i++) { - gDungeon->colorRamp[i].r = fileData[weatherArrId + i].r; - gDungeon->colorRamp[i].g = fileData[weatherArrId + i].g; - gDungeon->colorRamp[i].b = fileData[weatherArrId + i].b; - } - - sub_803E874(0, 0); -} - -void sub_807E8F0(Entity *pokemon) -{ - u8 oldTypes[2]; - bool8 flag = FALSE; - - if (EntityIsValid(pokemon)) { - EntityInfo *info = GetEntInfo(pokemon); - s32 previousApparentId = info->apparentID; - oldTypes[0] = info->types[0]; - oldTypes[1] = info->types[1]; - CalcSpeedStage(pokemon); - if (AbilityIsActive(pokemon, ABILITY_FORECAST)) { - info->types[0] = gCastformByWeather[GetApparentWeather(pokemon)].type; - info->types[1] = TYPE_NONE; - } - else if ((info->reflectClassStatus.status != STATUS_CONVERSION2) && (info->isColorChanged == FALSE)){ - info->types[0] = GetPokemonType(info->id, 0); - info->types[1] = GetPokemonType(info->id, 1); - } - - if ((oldTypes[0] != info->types[0]) || (oldTypes[1] != info->types[1])) { - flag = TRUE; - } - - if (IS_CASTFORM_FORM_MONSTER(info->id) || info->id == MONSTER_CASTFORM) { - if (AbilityIsActive(pokemon, ABILITY_FORECAST)) { - info->apparentID = GetMonsterApparentID(pokemon, info->id); - } - else { - info->apparentID = MONSTER_CASTFORM; - } - if (info->apparentID != previousApparentId) { - pokemon->axObj.spriteFile = GetSpriteData(info->apparentID); - sub_806CCB4(pokemon,sub_806CEBC(pokemon)); - flag = TRUE; - } - } - if (flag) { - sub_80429D8(pokemon); - } - } -} - -void GetWeatherName(u8 *buffer, u8 weather) -{ - strcpy(buffer, gWeatherNames[weather]); -} - -void MudWaterSportEffect(u8 which) -{ - if (which == 0) { - gDungeon->weather.mudSportTurns = CalculateStatusTurns(0, gMudWaterSportTurnRange, FALSE); - LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FAD8C); - } - else { - gDungeon->weather.waterSportTurns =CalculateStatusTurns(0, gMudWaterSportTurnRange, FALSE); - LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FADB0); - } -} - -bool8 sub_807EAA0(bool8 arg0, bool8 arg1) -{ - s32 i; - s32 var = 0; - s32 index = -1; - bool8 ret = FALSE; - s32 weatherBefore = GetApparentWeather(NULL); - - for (i = 0; i < 8; i++) { - if (gDungeon->weather.unkE267[i] < gDungeon->weather.naturalWeather[i]) { - gDungeon->weather.unkE267[i] = gDungeon->weather.naturalWeather[i]; - } - else if (gDungeon->weather.unkE267[i] > gDungeon->weather.naturalWeather[i]) { - sub_80838EC(&gDungeon->weather.unkE267[i]); - } - - if (var < gDungeon->weather.unkE267[i]) { - var = gDungeon->weather.unkE267[i]; - index = i; - } - } - - if (index < 0) { - gDungeon->weather.weather = gDungeon->weather.unkE265; - } - else { - gDungeon->weather.weather = index; - } - - if (gDungeon->weather.nullifyWeather) { - gDungeon->weather.weather = 0; - } - - if (weatherBefore != GetApparentWeather(NULL) || arg1) { - ret = TRUE; - sub_807E698(arg0); - } - - if (gDungeon->weather.weatherDamageCounter != 0) { - gDungeon->weather.weatherDamageCounter--; - } - else { - gDungeon->weather.weatherDamageCounter = 9; - } - - if (gDungeon->weather.mudSportTurns != 0) { - sub_80838EC(&gDungeon->weather.mudSportTurns); - if (gDungeon->weather.mudSportTurns == 0) { - LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FA778); - } - } - if (gDungeon->weather.waterSportTurns != 0) { - sub_80838EC(&gDungeon->weather.waterSportTurns); - if (gDungeon->weather.waterSportTurns == 0) { - LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FA758); - } - } - - return ret; -} - -void sub_807EC28(bool8 arg0) -{ - Entity *leader; - EntityInfo *leaderInfo; - bool32 prevTileWasShop; - bool32 isShopTile; - - if (sub_8044B28()) - return; - - leader = GetLeader(); - leaderInfo = GetEntInfo(leader); - prevTileWasShop = gDungeon->unk644.unk54; - isShopTile = (GetTileAtEntitySafe(leader)->terrainType & TERRAIN_TYPE_SHOP) != 0; - gDungeon->unk644.unk54 = isShopTile; - gDungeon->unk644.unk55 = isShopTile; - if (gDungeon->unk644.unk2A || gDungeon->unk644.unk50 == 0) - return; - - if (leaderInfo->invisibleClassStatus.status == STATUS_INVISIBLE) { - gDungeon->unk644.unk54 = 0; - gDungeon->unk644.unk55 = 0; - } - else { - s32 i; - struct MonDialogueSpriteInfo dialogueInfo; - bool8 sameRoom = FALSE; - bool8 var_2C; - bool8 var_28; - - for (i = 0; i < DUNGEON_MAX_WILD_POKEMON; i++) { - Entity *wildMon = gDungeon->wildPokemon[i]; - if (EntityIsValid(wildMon)) { - EntityInfo *wildMonInfo = GetEntInfo(wildMon); - if (wildMonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER && sub_8070BC0(wildMon) && GetEntityRoom(leader) == GetEntityRoom(wildMon)) { - sameRoom = TRUE; - } - } - } - - dialogueInfo.species = MONSTER_KECLEON; - dialogueInfo.spriteId = 0; - if (!prevTileWasShop) { - if (isShopTile == TRUE) { - if (sameRoom) { - DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE674, TRUE); // Ah welcome! - } - return; - } - } - else { - if (isShopTile == TRUE) { - return; - } - } - - if ((prevTileWasShop != TRUE || isShopTile) && !arg0) { - return; - } - - var_2C = FALSE; - var_28 = FALSE; - if (sub_807EF48()) { - var_28 = TRUE; - for (i = 0; i < DUNGEON_MAX_WILD_POKEMON; i++) { - Entity *wildMon = gDungeon->wildPokemon[i]; - if (EntityIsValid(wildMon) - && GetEntInfo(wildMon)->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER - && sub_8070BC0(wildMon) - && GetEntityRoom(leader) == GetEntityRoom(wildMon)) - { - var_2C = TRUE; - if (abs(leader->pos.x - wildMon->pos.x) >= 2 || abs(leader->pos.y - wildMon->pos.y) >= 2) { - s32 x, y; - DungeonPos pos; - - for (x = -1; x < 2; x++) { - for (y = -1; y < 2; y++) { - pos.x = leader->pos.x + x; - pos.y = leader->pos.y + y; - if (GetTile(pos.x, pos.y)->room != CORRIDOR_ROOM) { - if (!sub_80703A0(wildMon, &pos)) { - WarpTarget(leader, wildMon, 3, &pos); - goto LOOP_BREAK; // Used to break out of the nested loops - } - } - } - } - LOOP_BREAK: - } - - if (sub_8070BC0(leader)) { - sub_806CE34(leader, GetDirectionTowardsPosition(&leader->pos, &wildMon->pos)); - } - else { - var_2C = FALSE; - } - - sub_806CE68(wildMon, GetDirectionTowardsPosition(&wildMon->pos, &leader->pos)); - break; - } - } - } - - if (var_28 && !var_2C) { - if (gDungeon->unk644.unk50 > gDungeon->unk644.unk48) { - sub_807F33C(); - } - } - else if (var_28 && !sameRoom) { - if (gDungeon->unk644.unk50 > gDungeon->unk644.unk48) { - sub_807F33C(); - } - } - else { - sub_807EFFC(var_2C); - if (sub_807F19C(var_2C)) { - sub_807F33C(); - } - else if (prevTileWasShop == TRUE && !isShopTile && sameRoom) { - DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE65C, TRUE); // I await your next visit - } - } - } -} - -bool8 sub_807EF48(void) -{ - if ((gDungeon->unk644.unk50 - gDungeon->unk644.unk48) > 0) { - return TRUE; - } - if (gDungeon->unk644.unk4C != 0) { - return TRUE; - } - - return FALSE; -} - -void sub_807EF84(void) -{ - s32 val; - struct MonDialogueSpriteInfo dialogueInfo; - - dialogueInfo.species = MONSTER_KECLEON; - dialogueInfo.spriteId = 0; - - sub_807EFFC(1); - val = sub_807F19C(TRUE); - if (val != 0) { - Tile *tile = GetTileAtEntitySafe(GetLeader()); - if (tile->terrainType & TERRAIN_TYPE_SHOP) { - if (val != 2) { - DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE63C, 1); // This is very disappointing, please return any items before you leave. - } - } - else { - sub_807F33C(); - } - } - else { - DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE5F0, 1); // Looking forward to seeing you again! - } -} - -void sub_807EFFC(bool8 arg0) -{ - struct MonDialogueSpriteInfo dialogueInfo; - - if (gDungeon->unk644.unk4C == 0) - return; - - dialogueInfo.species = MONSTER_KECLEON; - dialogueInfo.spriteId = 0; - if (!arg0) - return; - - gFormatArgs[0] = gDungeon->unk644.unk4C; - if (DisplayDungeonYesNoMessage(&dialogueInfo, gUnknown_80FE5C0, TRUE) == 1) { // For the merch you have left, I shall pay X. Is that acceptable? - s32 x, y; - DungeonPos pos; - s32 local_24; - - PlaySoundEffect(0x14c); - AddToTeamMoney(gDungeon->unk644.unk4C); - local_24 = gDungeon->unk644.unk48; - for (x = gDungeon->kecleonShopPos.minX; x <= gDungeon->kecleonShopPos.maxX; x++) { - for (y = gDungeon->kecleonShopPos.minY; y <= gDungeon->kecleonShopPos.maxY; y++) { - const Tile *tile; - - pos.y = y; - pos.x = x; - tile = GetTile(x,y); - if (tile->terrainType & TERRAIN_TYPE_SHOP && tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) { - Item *itemPtr = GetItemData(tile->object); - if (!ItemInShop(itemPtr)) { - Item item = *itemPtr; - RemoveItemFromDungeonAt(&pos, 1); - if (CanSellItem(item.id)) { - item.flags |= ITEM_FLAG_IN_SHOP; - } - AddItemToDungeonAt(&pos, &item, 1); - } - } - } - } - - gDungeon->unk644.unk50 += (gDungeon->unk644.unk48 - local_24); - DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE4F4, 1); // Your patronage is valued - } -} - -s32 sub_807F19C(bool8 arg0) -{ - s32 diff; - struct MonDialogueSpriteInfo dialogueInfo; - s32 i, x, y; - - dialogueInfo.species = MONSTER_KECLEON; - dialogueInfo.spriteId = 0; - diff = gDungeon->unk644.unk50 - gDungeon->unk644.unk48; - if (diff > 0) { - if (!arg0) { - return 1; - } - - gFormatArgs[0] = diff; - if (DisplayDungeonYesNoMessage(&dialogueInfo, gUnknown_80FE568, TRUE) != 1) { // The merchandise you have chosen costs X - return 1; - } - if (gTeamInventoryRef->teamMoney < diff) { - DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE520, TRUE); // You don't have enough money. - return 2; - } - PlaySoundEffect(0x14c); - AddToTeamMoney(-diff); - - for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { - for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { - const Tile *tile = GetTile(x, y); - if (!(tile->terrainType & TERRAIN_TYPE_SHOP) && tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) { - Item *itemPtr = GetItemData(tile->object); - if (CanSellItem(itemPtr->id)) { - itemPtr->flags &= ~(ITEM_FLAG_IN_SHOP); - } - } - } - } - - for (i = 0; i < INVENTORY_SIZE; i++) { - Item *item = &gTeamInventoryRef->teamItems[i]; - if (ItemExists(item) && CanSellItem(item->id)) { - item->flags &= ~(ITEM_FLAG_IN_SHOP); - } - } - - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activePokemon[i]; - if (EntityIsValid(mon)) { - EntityInfo *monInfo = GetEntInfo(mon); - Item *item = &monInfo->heldItem; - if (ItemExists(item) && CanSellItem(item->id)) { - item->flags &= ~(ITEM_FLAG_IN_SHOP); - } - } - } - gDungeon->unk644.unk50 = gDungeon->unk644.unk48; - DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE4D4, TRUE); // Thank you very much. - } - - return 0; -} - -void sub_807F33C(void) -{ - s32 i, x, y; - - gDungeon->unk644.unk2A = 1; - gDungeon->unk644.unk2B = 1; - LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FE4B8); // Help! Thief! I've been robbed! Help me catch the thief. - for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { - for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { - const Tile *tile = GetTile(x,y); - if (tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) { - Item *item = GetItemData(tile->object); - item->flags &= ~(ITEM_FLAG_IN_SHOP); - } - } - } - - for (i = 0; i < INVENTORY_SIZE; i++) { - Item *item = &gTeamInventoryRef->teamItems[i]; - if (ItemExists(item)) { - item->flags &= ~(ITEM_FLAG_IN_SHOP); - } - } - - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *entity = gDungeon->activePokemon[i]; - if (EntityIsValid(entity)) { - Item *item; - EntityInfo *info = GetEntInfo(entity); - - info->shopkeeper = FALSE; - CalcSpeedStage(entity); - item = &info->heldItem; - if (ItemExists(item)) { - item->flags &= ~(ITEM_FLAG_IN_SHOP); - } - } - } - - gDungeon->unk644.unk50 = 0; - gDungeon->unk644.unk48 = 0; - gDungeon->unk644.unk4C = 0; -} - -extern void sub_80833E8(DungeonPos *param_1, s32 *param_2); -extern void sub_806A5B8(Entity *); -extern bool8 sub_8045888(Entity *ent); -extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); -extern void sub_807D068(Entity *, DungeonPos *); - -void sub_807F9BC(Entity *entity); - -extern const u8 *const gUnknown_80FCB40; -extern const u8 *const gUnknown_80FCB70; -extern const u8 *const gUnknown_80FE6B4; -extern const u8 *const gUnknown_80FE690; - -void sub_807F43C(Entity *target, Entity *attacker) -{ - s32 attackerDirection; - s32 var_3C; - DungeonPos attackerPos; - s32 pixelPosX, pixelPosY; - PixelPos var_54; - s32 var_30, r10; - s32 r6; - s32 newDir; - s32 i, directionId; - Entity *tileEntity; - s32 var_2C; - DungeonPos positions[40]; - s32 var_74[4]; - s32 positionsCounter; - - if (AbilityIsActive(attacker, ABILITY_SUCTION_CUPS)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FCB40); // is anchored, cannot be moved - return; - } - if (target == attacker) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FCB70); // couldn't be thrown for some reason - return; - } - - attackerPos = attacker->pos; - for (var_3C = 0; var_3C < 2; var_3C++) { - positionsCounter = 0; - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activePokemon[i]; - if (EntityIsValid(mon) && target != mon && attacker != mon && CanSeeTarget(target, mon)) { - if (var_3C == 0) { - if (GetTreatmentBetweenMonsters(target, mon, FALSE, TRUE) != 1) - continue; - } - else { - if (GetTreatmentBetweenMonsters(target, mon, FALSE, TRUE) != 0) - continue; - } - - if (var_3C == 0) { - DungeonPos pos; - for (directionId = 0; directionId < NUM_DIRECTIONS; directionId++) { - pos.x = gAdjacentTileOffsets[directionId].x + mon->pos.x; - pos.y = gAdjacentTileOffsets[directionId].y + mon->pos.y; - if (!sub_80703A0(attacker, &pos)) - break; - } - - if (directionId != NUM_DIRECTIONS && positionsCounter < 40) { - positions[positionsCounter++] = mon->pos; - } - } - else { - DungeonPos pos; - for (directionId = 0; directionId < NUM_DIRECTIONS; directionId++) { - pos.x = gAdjacentTileOffsets[directionId].x + mon->pos.x; - pos.y = gAdjacentTileOffsets[directionId].y + mon->pos.y; - if (!sub_80703A0(attacker, &pos) && positionsCounter < 40) { - positions[positionsCounter++] = pos; - } - } - } - } - } - - if (positionsCounter != 0) - break; - } - - if (positionsCounter != 0) { - s32 rnd = DungeonRandInt(positionsCounter); - attackerPos = positions[rnd]; - } - else { - sub_80833E8(&target->pos, var_74); - for (i = 0; i < 100; i++) { - DungeonPos pos; - pos.x = DungeonRandRange(var_74[0], var_74[2]); - pos.y = DungeonRandRange(var_74[1], var_74[3]); - if (!sub_80703A0(attacker, &pos)) { - attackerPos = pos; - break; - } - } - if (i == 100) { - TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FE6B4); // But it didn~27t go anywhere. - return; - } - } - - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FE690); // m0 was sent flying! - if (sub_8045888(attacker)) { - PlaySoundEffect(0x1A3); - } - - var_2C = 0; - attackerDirection = GetEntInfo(attacker)->action.direction; - r6 = max(attackerPos.x - attacker->pos.x, attackerPos.y - attacker->pos.y) << 4; - if (r6 > 80) - r6 = 80; - if (r6 < 10) - r6 = 10; - - newDir = GetDirectionTowardsPosition(&attackerPos, &attacker->pos); - - pixelPosX = X_POS_TO_PIXELPOS(attackerPos.x) + ((gAdjacentTileOffsets[newDir].x << 8) / 3); - pixelPosY = Y_POS_TO_PIXELPOS(attackerPos.y) + ((gAdjacentTileOffsets[newDir].y << 8) / 3); - - var_30 = (pixelPosX - attacker->pixelPos.x) / r6; - r10 = (pixelPosY - attacker->pixelPos.y) / r6; - var_54.x = attacker->pixelPos.x; - var_54.y = attacker->pixelPos.y; - for (i = 0; i < r6; i++) { - var_54.x += var_30; - var_54.y += r10; - sub_804535C(attacker, &var_54); - if (sub_8045888(attacker)) { - attacker->unk1C.raw = sin_4096(var_2C) << 5; - DungeonRunFrameActions(0x3B); - if (!(i & 3)) { - attackerDirection &= DIRECTION_MASK; - sub_806CDD4(attacker, 6, attackerDirection); - attackerDirection++; - } - } - var_2C += (0x800 / r6); - } - - var_54.x = pixelPosX; - var_54.y = pixelPosY; - attacker->unk1C.raw = 0; - sub_804535C(attacker, &var_54); - DungeonRunFrameActions(0x3B); - GetEntInfo(attacker)->action.direction = attackerDirection & DIRECTION_MASK; - - tileEntity = GetTile(attackerPos.x, attackerPos.y)->monster; - if (!EntityIsValid(tileEntity)) { - sub_80694C0(attacker, attackerPos.x, attackerPos.y, 1); - sub_807F9BC(attacker); - } - else { - for (directionId = 0; directionId < NUM_DIRECTIONS; directionId++) { - DungeonPos pos; - - pos.x = gAdjacentTileOffsets[directionId].x + attackerPos.x; - pos.y = gAdjacentTileOffsets[directionId].y + attackerPos.y; - if (!sub_80703A0(attacker, &pos)) { - attackerPos = pos; - break; - } - } - if (directionId == NUM_DIRECTIONS) { - WarpTarget(target, attacker, 0, NULL); - } - else { - sub_807D068(attacker, &attackerPos); - sub_80694C0(attacker, attackerPos.x, attackerPos.y, 1); - } - - if (GetEntityType(tileEntity) == ENTITY_MONSTER) { - Move move; - - InitPokemonMove(&move, MOVE_REGULAR_ATTACK); - if (!sub_80571F0(tileEntity, &move)) { - sub_806F370(target, tileEntity, gHurlOrbDmgValue, FALSE, NULL, TYPE_NONE, 0x21A, 0, 0, 0); - } - if (EntityIsValid(tileEntity)) { - sub_806CE68(tileEntity, GetEntInfo(tileEntity)->action.direction); - } - } - - sub_806F370(target, attacker, gHurlOrbDmgValue, FALSE, NULL, TYPE_NONE, 0x219, 0, 0, 0); - if (EntityIsValid(attacker)) { - sub_806CE68(attacker, GetEntInfo(attacker)->action.direction); - } - sub_803E708(0x1E, 0x3B); - sub_807F9BC(attacker); - } -} - -void sub_807F9BC(Entity *entity) -{ - if (EntityIsValid(entity)) { - EntityInfo *entInfo = GetEntInfo(entity); - if (entInfo->isTeamLeader) { - gDungeon->unk1 = 0; - gDungeon->unk5C0 = -1; - sub_804AC20(&entity->pos); - sub_807EC28(FALSE); - } - sub_806A5B8(entity); - sub_8075900(entity, gDungeon->forceMonsterHouse); - } -} - -extern u8 sub_803D6FC(void); - -void sub_807FA18(void) -{ - s32 x, y; - - for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { - for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { - Tile *tile = GetTileMut(x, y); - - if (tile->spawnOrVisibilityFlags & SPAWN_FLAG_TRAP) { - s32 trapId; - DungeonPos pos = {x, y}; - - if (tile->spawnOrVisibilityFlags & SPAWN_FLAG_UNK6) { - trapId = TRAP_WARP_TRAP; - } - else { - trapId = sub_803D6FC(); - } - - if (trapId == TRAP_WONDER_TILE) { - Entity *trap = SpawnTrap(trapId, &pos, 2); - if (trap != NULL) { - tile->object = trap; - trap->isVisible = TRUE; - } - } - else { - Entity *trap = SpawnTrap(trapId, &pos, 0); - if (trap != NULL) { - tile->object = trap; - trap->isVisible = FALSE; - } - } - } - } - } -} - -void sub_807FA9C(void) -{ - s32 x, y; - bool8 unkBool = gDungeon->unk181e8.showInvisibleTrapsMonsters; - - for (y = gDungeon->unk181e8.cameraPos.y - 5; y < gDungeon->unk181e8.cameraPos.y + 5; y++) { - for (x = gDungeon->unk181e8.cameraPos.x - 6; x < gDungeon->unk181e8.cameraPos.x + 6; x++) { - bool8 r6 = FALSE; - const Tile *tile = GetTile(x, y); - - if (tile->object != NULL && GetEntityType(tile->object) == ENTITY_TRAP && (tile->object->isVisible || unkBool)) { - r6 = TRUE; - } - if (tile->terrainType & TERRAIN_TYPE_STAIRS) { - r6 = TRUE; - } - - if (r6) { - s32 spriteX = (x * 24) - gDungeon->unk181e8.cameraPixelPos.x; - s32 spriteY = (y * 24) - gDungeon->unk181e8.cameraPixelPos.y; - if (spriteX >= -32 && spriteY >= -32 && spriteX <= 272 && spriteY <= 192) { - SpriteSetObjMode(&gUnknown_202EDC0, 0); - SpriteSetY(&gUnknown_202EDC0, spriteY); - SpriteSetX(&gUnknown_202EDC0, spriteX); - SpriteSetPriority(&gUnknown_202EDC0, 3); - SpriteSetPalNum(&gUnknown_202EDC0, 10); - SpriteSetTileNum(&gUnknown_202EDC0, 0x1FC); - - AddSprite(&gUnknown_202EDC0, 0, NULL, NULL); - } - } - } - } -} - -// diff --git a/src/code_808417C.c b/src/code_808417C.c index 20c78b8cd..78ce3099a 100644 --- a/src/code_808417C.c +++ b/src/code_808417C.c @@ -2,7 +2,7 @@ #include "constants/ability.h" #include "constants/iq_skill.h" #include "structs/dungeon_entity.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util.h" diff --git a/src/code_80848F0.c b/src/code_80848F0.c index c96ed81b1..c9b47a2b3 100644 --- a/src/code_80848F0.c +++ b/src/code_80848F0.c @@ -4,7 +4,7 @@ #include "structs/str_dungeon.h" #include "dungeon_cutscenes.h" #include "dungeon_music.h" -#include "dungeon_movement.h" +#include "dungeon_logic.h" #include "dungeon_util_1.h" #include "exclusive_pokemon.h" #include "weather.h" diff --git a/src/code_8097F40.c b/src/code_8097F40.c index 8951a0b99..320ab3314 100644 --- a/src/code_8097F40.c +++ b/src/code_8097F40.c @@ -1,6 +1,5 @@ #include "global.h" - -#include "tile_types.h" +#include "dungeon_map_access.h" bool8 IsWaterDungeon(u32 r0) { diff --git a/src/data/code_8048480.h b/src/data/code_8048480.h deleted file mode 100644 index 736cf6472..000000000 --- a/src/data/code_8048480.h +++ /dev/null @@ -1,21 +0,0 @@ -const s16 gUnknown_810A808[NUM_TYPES][NUMBER_OF_GUMMIS] = -{ - [TYPE_NONE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - [TYPE_NORMAL] = {0x00, 0x3c, 0x19, 0x19, 0x19, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x05, 0x19, 0x19, 0x19}, - [TYPE_FIRE] = {0x00, 0x19, 0x3c, 0x1e, 0x14, 0x19, 0x14, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x14, 0x1e, 0x19, 0x19, 0x19, 0x14}, - [TYPE_WATER] = {0x00, 0x19, 0x14, 0x3c, 0x1e, 0x1e, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x14}, - [TYPE_GRASS] = {0x00, 0x19, 0x1e, 0x14, 0x3c, 0x14, 0x1e, 0x19, 0x1e, 0x14, 0x1e, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19}, - [TYPE_ELECTRIC] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x3c, 0x19, 0x19, 0x19, 0x1e, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x14}, - [TYPE_ICE] = {0x00, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x3c, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x1e}, - [TYPE_FIGHTING] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x3c, 0x19, 0x19, 0x1e, 0x1e, 0x14, 0x14, 0x19, 0x19, 0x14, 0x19}, - [TYPE_POISON] = {0x00, 0x19, 0x19, 0x19, 0x14, 0x19, 0x19, 0x14, 0x3c, 0x1e, 0x19, 0x1e, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19}, - [TYPE_GROUND] = {0x00, 0x19, 0x19, 0x1e, 0x1e, 0x05, 0x1e, 0x19, 0x14, 0x3c, 0x19, 0x19, 0x19, 0x14, 0x19, 0x19, 0x19, 0x19}, - [TYPE_FLYING] = {0x00, 0x19, 0x19, 0x19, 0x14, 0x1e, 0x1e, 0x14, 0x19, 0x05, 0x3c, 0x19, 0x14, 0x1e, 0x19, 0x19, 0x19, 0x19}, - [TYPE_PSYCHIC] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x14, 0x19, 0x19, 0x19, 0x3c, 0x1e, 0x19, 0x1e, 0x19, 0x1e, 0x19}, - [TYPE_BUG] = {0x00, 0x19, 0x1e, 0x19, 0x14, 0x19, 0x19, 0x14, 0x19, 0x14, 0x1e, 0x19, 0x3c, 0x1e, 0x19, 0x19, 0x19, 0x19}, - [TYPE_ROCK] = {0x00, 0x14, 0x14, 0x1e, 0x1e, 0x19, 0x19, 0x1e, 0x14, 0x1e, 0x14, 0x19, 0x19, 0x3c, 0x19, 0x19, 0x19, 0x1e}, - [TYPE_GHOST] = {0x00, 0x05, 0x19, 0x19, 0x19, 0x19, 0x19, 0x05, 0x14, 0x19, 0x19, 0x1e, 0x14, 0x19, 0x3c, 0x19, 0x1e, 0x19}, - [TYPE_DRAGON] = {0x00, 0x19, 0x14, 0x14, 0x14, 0x14, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x3c, 0x19, 0x19}, - [TYPE_DARK] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x05, 0x1e, 0x19, 0x14, 0x19, 0x3c, 0x19}, - [TYPE_STEEL] = {0x00, 0x14, 0x1e, 0x19, 0x14, 0x19, 0x14, 0x1e, 0x05, 0x1e, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x3c}, -}; diff --git a/src/data/friend_area_settings.h b/src/data/friend_area_settings.h deleted file mode 100644 index 4a1bafd5f..000000000 --- a/src/data/friend_area_settings.h +++ /dev/null @@ -1,293 +0,0 @@ -static const FriendAreaSettings sFriendAreaSettings[NUM_FRIEND_AREAS] = // 810AA90 -{ - [FRIEND_AREA_NONE] = { - .num_pokemon = 0, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 0, - }, - [BOUNTIFUL_SEA] = { - .num_pokemon = 9, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5500, - }, - [TREASURE_SEA] = { - .num_pokemon = 10, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 4500, - }, - [SERENE_SEA] = { - .num_pokemon = 4, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 8000, - }, - [DEEP_SEA_FLOOR] = { - .num_pokemon = 12, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5500, - }, - [DEEP_SEA_CURRENT] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 0, - }, - [SEAFLOOR_CAVE] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 0, - }, - [SHALLOW_BEACH] = { - .num_pokemon = 5, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5000, - }, - [MT_DEEPGREEN] = { - .num_pokemon = 12, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 130, - }, - [MT_CLEFT] = { - .num_pokemon = 9, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5000, - }, - [MT_MOONVIEW] = { - .num_pokemon = 6, - .unlock_condition = UNLOCK_WONDER_MAIL, - .price = 0, - }, - [RAINBOW_PEAK] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 6500, - }, - [WILD_PLAINS] = { - .num_pokemon = 13, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 100, - }, - [BEAU_PLAINS] = { - .num_pokemon = 12, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 600, - }, - [SKY_BLUE_PLAINS] = { - .num_pokemon = 13, - .unlock_condition = UNLOCK_WONDER_MAIL, - .price = 0, - }, - [SAFARI] = { - .num_pokemon = 15, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 700, - }, - [SCORCHED_PLAINS] = { - .num_pokemon = 10, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5000, - }, - [SACRED_FIELD] = { - .num_pokemon = 3, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 6500 - }, - [MIST_RISE_FOREST] = { - .num_pokemon = 14, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 150 - }, - [FLYAWAY_FOREST] = { - .num_pokemon = 12, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 550 - }, - [OVERGROWN_FOREST] = { - .num_pokemon = 9, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 600 - }, - [ENERGETIC_FOREST] = { - .num_pokemon = 15, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5000 - }, - [MUSHROOM_FOREST] = { - .num_pokemon = 7, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 500 - }, - [HEALING_FOREST] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 0 - }, - [TRANSFORM_FOREST] = { - .num_pokemon = 6, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 500 - }, - [SECRETIVE_FOREST] = { - .num_pokemon = 9, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 6500 - }, - [RUB_A_DUB_RIVER] = { - .num_pokemon = 7, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 500 - }, - [TADPOLE_POND] = { - .num_pokemon = 9, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 500 - }, - [TURTLESHELL_POND] = { - .num_pokemon = 10, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5500 - }, - [MYSTIC_LAKE] = { - .num_pokemon = 4, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 2500 - }, - [WATERFALL_LAKE] = { - .num_pokemon = 4, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 3500 - }, - [PEANUT_SWAMP] = { - .num_pokemon = 7, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 2500 - }, - [POISON_SWAMP] = { - .num_pokemon = 6, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 8500 - }, - [ECHO_CAVE] = { - .num_pokemon = 11, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 7500 - }, - [CRYPTIC_CAVE] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 6500 - }, - [DRAGON_CAVE] = { - .num_pokemon = 3, - .unlock_condition = UNLOCK_WONDER_MAIL, - .price = 0 - }, - [BOULDER_CAVE] = { - .num_pokemon = 4, - .unlock_condition = UNLOCK_WONDER_MAIL, - .price = 0 - }, - [JUNGLE] = { - .num_pokemon = 13, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 800 - }, - [DECREPIT_LAB] = { - .num_pokemon = 7, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 1000 - }, - [MT_DISCIPLINE] = { - .num_pokemon = 11, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 1200 - }, - [THUNDER_MEADOW] = { - .num_pokemon = 11, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 1000 - }, - [POWER_PLANT] = { - .num_pokemon = 6, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 600 - }, - [CRATER] = { - .num_pokemon = 7, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 7500 - }, - [FURNACE_DESERT] = { - .num_pokemon = 7, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 8500 - }, - [AGED_CHAMBER_AN] = { - .num_pokemon = 14, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5500 - }, - [AGED_CHAMBER_O_EXCLAIM] = { - .num_pokemon = 14, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 5500 - }, - [ANCIENT_RELIC] = { - .num_pokemon = 6, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 8000 - }, - [DARKNESS_RIDGE] = { - .num_pokemon = 13, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 0 - }, - [FRIGID_CAVERN] = { - .num_pokemon = 7, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 9000 - }, - [ICE_FLOE_BEACH] = { - .num_pokemon = 5, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 9500 - }, - [VOLCANIC_PIT] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 0 - }, - [STRATOS_LOOKOUT] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 0 - }, - [RAVAGED_FIELD] = { - .num_pokemon = 5, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 1000 - }, - [MAGNETIC_QUARRY] = { - .num_pokemon = 3, - .unlock_condition = UNLOCK_SHOP_STORY, - .price = 1000 - }, - [LEGENDARY_ISLAND] = { - .num_pokemon = 3, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 7500 - }, - [SOUTHERN_ISLAND] = { - .num_pokemon = 2, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 9500 - }, - [ENCLOSED_ISLAND] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_LEGENDARY_REQUEST, - .price = 0 - }, - [FINAL_ISLAND] = { - .num_pokemon = 1, - .unlock_condition = UNLOCK_SHOP_POST_GAME, - .price = 8500 - }, -}; \ No newline at end of file diff --git a/src/data/items.h b/src/data/items.h deleted file mode 100644 index 2a2055bba..000000000 --- a/src/data/items.h +++ /dev/null @@ -1,37 +0,0 @@ -// LUT for money item stack size -> money amount -// NDS=020C359C -const s32 gUnknown_810A3F0[100] = { - 4, 6, 10, 14, 22, 26, 34, 38, 46, 58, - 62, 74, 82, 86, 94, 106, 118, 122, 134, 142, - 146, 158, 166, 178, 194, 202, 206, 214, 218, 226, - 254, 262, 274, 278, 298, 302, 314, 326, 334, 346, - 358, 362, 382, 386, 394, 398, 422, 446, 454, 458, - 466, 478, 482, 502, 514, 526, 538, 542, 554, 562, - 566, 586, 614, 622, 626, 634, 662, 674, 694, 698, - 706, 718, 734, 746, 758, 768, 778, 794, 802, 818, - 838, 842, 862, 866, 878, 886, 898, 914, 922, 926, - 934, 958, 974, 982, 998, 1000, 1100, 1300, 1500, 20000}; - - -const s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS] = -{ - [TYPE_NONE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - [TYPE_NORMAL] = {0x00, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x03, 0x03, 0x03}, - [TYPE_FIRE] = {0x00, 0x03, 0x07, 0x04, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04, 0x03, 0x03, 0x02, 0x04, 0x03, 0x03, 0x03, 0x02}, - [TYPE_WATER] = {0x00, 0x03, 0x02, 0x07, 0x04, 0x04, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02}, - [TYPE_GRASS] = {0x00, 0x03, 0x04, 0x02, 0x07, 0x02, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03}, - [TYPE_ELECTRIC] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x07, 0x03, 0x03, 0x03, 0x04, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02}, - [TYPE_ICE] = {0x00, 0x03, 0x04, 0x03, 0x03, 0x03, 0x07, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x03, 0x04}, - [TYPE_FIGHTING] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x03, 0x03, 0x04, 0x04, 0x02, 0x02, 0x03, 0x03, 0x02, 0x03}, - [TYPE_POISON] = {0x00, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x02, 0x07, 0x04, 0x03, 0x04, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03}, - [TYPE_GROUND] = {0x00, 0x03, 0x03, 0x04, 0x04, 0x01, 0x04, 0x03, 0x02, 0x07, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x03, 0x03}, - [TYPE_FLYING] = {0x00, 0x03, 0x03, 0x03, 0x02, 0x04, 0x04, 0x02, 0x03, 0x01, 0x07, 0x03, 0x02, 0x04, 0x03, 0x03, 0x03, 0x03}, - [TYPE_PSYCHIC] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x03, 0x07, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03}, - [TYPE_BUG] = {0x00, 0x03, 0x04, 0x03, 0x02, 0x03, 0x03, 0x02, 0x03, 0x02, 0x04, 0x03, 0x07, 0x04, 0x03, 0x03, 0x03, 0x03}, - [TYPE_ROCK] = {0x00, 0x02, 0x02, 0x04, 0x04, 0x03, 0x03, 0x04, 0x02, 0x04, 0x02, 0x03, 0x03, 0x07, 0x03, 0x03, 0x03, 0x04}, - [TYPE_GHOST] = {0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x02, 0x03, 0x03, 0x04, 0x02, 0x03, 0x07, 0x03, 0x04, 0x03}, - [TYPE_DRAGON] = {0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x03, 0x03}, - [TYPE_DARK] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x03, 0x01, 0x04, 0x03, 0x02, 0x03, 0x07, 0x03}, - [TYPE_STEEL] = {0x00, 0x02, 0x04, 0x03, 0x02, 0x03, 0x02, 0x04, 0x01, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07}, - -}; diff --git a/src/data/pokemon_3.h b/src/data/pokemon_3.h deleted file mode 100644 index 0455b84b0..000000000 --- a/src/data/pokemon_3.h +++ /dev/null @@ -1,97 +0,0 @@ -const u8 gInvalidDungeonIDs[11] = -{ - DUNGEON_BOSS_3, - DUNGEON_BOSS_4, - DUNGEON_BOSS_9, - DUNGEON_WONDROUS_SEA, - DUNGEON_AUTOPILOT, - DUNGEON_D50, - DUNGEON_D51, - DUNGEON_D54, - DUNGEON_POISON_MAZE, - DUNGEON_D61, - DUNGEON_OUT_ON_RESCUE -}; - -// NDS=020C3448 -const u8 gInvalidItemIDs[0x10] = -{ - ITEM_G_MACHINE_6, - ITEM_G_MACHINE_7, - ITEM_G_MACHINE_8, - ITEM_TM_SPIN_SLASH, - ITEM_SWITCH_BOX, - ITEM_ALERT_SPECS, - ITEM_POSSESS_ORB, - ITEM_REVIVER_ORB, - ITEM_TM_EXCAVATE, - ITEM_TOSS_ORB, - ITEM_RING_D, - ITEM_RING_E, - ITEM_RING_F, - ITEM_OBSERVER_ORB, - ITEM_BEATUP_ORB, - NUMBER_OF_ITEM_IDS -}; - -const bool8 gTacticsTargetLeader[NUM_TACTICS] = -{ - [TACTIC_LETS_GO_TOGETHER] = TRUE, - [TACTIC_GO_THE_OTHER_WAY] = FALSE, - [TACTIC_GO_AFTER_FOES] = FALSE, - [TACTIC_AVOID_THE_FIRST_HIT] = FALSE, - [TACTIC_ALL_FOR_ONE] = TRUE, - [TACTIC_GROUP_SAFETY] = TRUE, - [TACTIC_AVOID_TROUBLE] = TRUE, - [TACTIC_BE_PATIENT] = TRUE, - [TACTIC_KEEP_YOUR_DISTANCE] = TRUE, - [TACTIC_WAIT_THERE] = FALSE, - [TACTIC_GET_AWAY] = TRUE, - [TACTIC_UNUSED] = FALSE -}; - - -const s16 gReqTacticLvls[NUM_TACTICS] = -{ - [TACTIC_LETS_GO_TOGETHER] = 1, - [TACTIC_GO_THE_OTHER_WAY] = 25, - [TACTIC_GO_AFTER_FOES] = 1, - [TACTIC_AVOID_THE_FIRST_HIT] = 1, - [TACTIC_ALL_FOR_ONE] = 999, - [TACTIC_GROUP_SAFETY] = 999, - [TACTIC_AVOID_TROUBLE] = 35, - [TACTIC_BE_PATIENT] = 40, - [TACTIC_KEEP_YOUR_DISTANCE] = 20, - [TACTIC_WAIT_THERE] = 15, - [TACTIC_GET_AWAY] = 10, - [TACTIC_UNUSED] = 999, -}; - - -const s32 gReqIQSkillPts[NUM_IQ_SKILLS] = -{ - [IQ_NONE] = 9999, - [IQ_TYPE_ADVANTAGE_MASTER] = 105, - [IQ_ITEM_CATCHER] = 1, - [IQ_COURSE_CHECKER] = 1, - [IQ_SURE_HIT_ATTACKER] = 500, - [IQ_QUICK_DODGER] = 100, - [IQ_PP_CHECKER] = 2, - [IQ_NONTRAITOR] = 40, - [IQ_STATUS_CHECKER] = 25, - [IQ_EXP_GO_GETTER] = 200, - [IQ_EFFICIENCY_EXPERT] = 10, - [IQ_WEAK_TYPE_PICKER] = 125, - [IQ_ALL_TERRAIN_HIKER] = 400, - [IQ_SUPER_MOBILE] = 990, - [IQ_TRAP_AVOIDER] = 140, - [IQ_HOUSE_AVOIDER] = 800, - [IQ_ENERGY_SAVER] = 250, - [IQ_NONSLEEPER] = 160, - [IQ_SELF_CURER] = 70, - [IQ_TRAP_SEER] = 600, - [IQ_LAVA_EVADER] = 300, - [IQ_DEDICATED_TRAVELER] = 1, - [IQ_ITEM_MASTER] = 1, - [IQ_EXCLUSIVE_MOVE_USER] = 1, -}; diff --git a/src/drought_orb.c b/src/drought_orb.c new file mode 100644 index 000000000..767a48470 --- /dev/null +++ b/src/drought_orb.c @@ -0,0 +1,78 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +void HandleDroughtOrbAction(Entity *pokemon, Entity *target) +{ + s32 x; + s32 y; + Tile *tile; + bool8 flag; + + flag = FALSE; + if(IsCurrentFixedRoomBossFight()) + { + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD060); + return; + } + + if(IsWaterTileset()) + { + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD08C); + return; + } + + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) + for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) + { + tile = GetTileMut(x, y); + if(GetTerrainType(tile) == TERRAIN_TYPE_SECONDARY) + { + SetTerrainNormal(tile); + sub_80498A8(x, y); + flag = TRUE; + } + } + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) + for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) + sub_8049BB0(x, y); + + if(flag) + { + sub_80421C0(pokemon, 0x1A1); + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD05C); + } + else + { + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD060); + } + gDungeon->unk644.unk2C = 1; + sub_806CF60(); + ShowWholeRevealedDungeonMap(); + sub_8049ED4(); +} diff --git a/src/dungeon.c b/src/dungeon.c index c11ef3ac7..0ce2209b7 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -12,11 +12,11 @@ #include "random.h" #include "string_format.h" #include "strings.h" +#include "dungeon_data.h" extern const char gUnknown_8108F10[]; extern const char gUnknown_8108F18[]; extern const char gUnknown_8108F2C[]; -extern u8 gInvalidDungeonIDs[]; extern u8 gDungeonFloorCount[]; extern const u8 *const gUnknown_8108084[]; extern DungeonLocation gUnknown_8107828[]; diff --git a/src/dungeon_8067A80.c b/src/dungeon_8067A80.c new file mode 100644 index 000000000..3bc816fa5 --- /dev/null +++ b/src/dungeon_8067A80.c @@ -0,0 +1,580 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/dungeon.h" +#include "constants/item.h" +#include "constants/move_id.h" +#include "code_803E46C.h" +#include "code_803E724.h" +#include "code_8041AD0.h" +#include "code_8044CC8.h" +#include "code_8066D04.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_807CD9C.h" +#include "code_8084778.h" +#include "run_dungeon.h" +#include "dungeon_items.h" +#include "dungeon_leader.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_misc.h" +#include "dungeon_move.h" +#include "dungeon_move_util.h" +#include "dungeon_logic.h" +#include "dungeon_music.h" +#include "dungeon_random.h" +#include "dungeon_strings.h" +#include "dungeon_util.h" +#include "friend_area.h" +#include "input.h" +#include "items.h" +#include "menu_input.h" +#include "moves.h" +#include "pokemon.h" +#include "pokemon_3.h" +#include "position_util.h" +#include "sprite.h" +#include "string_format.h" +#include "text_1.h" +#include "trap.h" + +extern void sub_80684C4(void); +void sub_8045064(void); +extern void sub_8068344(void); +bool8 CanSubMenuItemBeChosen(s32 param_1); +void sub_8068310(s32 n, PokemonStruct1 **monPtrs); +void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2, s32 a3, s32 a4); +extern void DungeonShowWindows(WindowTemplates *a0, u8 a1); +u32 sub_8014140(s32 a0, const void *a1); +void sub_8083D1C(void); +void PlayDungeonConfirmationSE(void); +void PlayDungeonCancelSE(void); +void sub_806806C(PokemonStruct1 *a0); +void CreateDungeonMenuSubWindow(WindowTemplates *a0, s32 a1); + +extern const s32 gUnknown_8106E80[]; +extern MenuInputStruct gDungeonMenu; +extern u32 gDungeonFramesCounter; +extern s32 gDungeonSubMenuItemsCount; + +static EWRAM_DATA WindowHeader gUnknown_202F308 = {0}; +static EWRAM_DATA s32 gUnknown_202F30C = 0; +static EWRAM_DATA s32 gUnknown_202F310 = 0; + +// It's likely a struct only used in Blue version. Touchpad maybe? +static const u8 gUnknown_8106DA4[] = { + 0x01, 0, 0x38, 0, 0, 0, 0x18, 0, 0x18, 0, 0, 0, 0x02, 0, 0x38, 0, 0x68, 0, 0x18, 0, 0x18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static const WindowTemplates gUnknown_8106DC8 = { + .id = { + [0] = + { + .unk0 = 0, + .type = WINDOW_TYPE_WITH_HEADER, + .pos = {0x02, 0x02}, + .width = 0x11, + .height = 0x0E, + .unk10 = 0x12, + .unk12 = 0x02, + .header = &gUnknown_202F308 + }, + [1] = + { + .unk0 = 0, + .type = WINDOW_TYPE_NORMAL, + .pos = {0x15, 0x04}, + .width = 0x07, + .height = 0x04, + .unk10 = 0x04, + .unk12 = 0, + .header = NULL + }, + [2] = WIN_TEMPLATE_DUMMY, + [3] = WIN_TEMPLATE_DUMMY, + } +}; + +void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) +{ + s32 i; + s32 r10; + WindowTemplates spTxtStruct = gUnknown_8106DC8; + + gUnknown_202F30C = 0; + r10 = 0; + for (i = 0; i < a2; i++) { + a3[i]->unk0 &= ~(0x8000); + } + + while (1) { + sub_8068310(a2, a3); + if (gUnknown_202F310 >= a1) + break; + while (1) { + s32 r7 = 0, r5 = 0; + + gUnknown_202F308.count = 1; + gUnknown_202F308.currId = 0; + gUnknown_202F308.width = 0xE; + gUnknown_202F308.f3 = 0; + + ASM_MATCH_TRICK(r7); + + DungeonShowWindows(&spTxtStruct, 1); + sub_8067F00(a0, a3, gUnknown_202F30C, a2, a1); + gDungeonMenu.unk1A = min(a2, 8); + gDungeonMenu.menuIndex = r10; + gDungeonMenu.unk1C = 8; + gDungeonMenu.unk1E = 0; + gDungeonMenu.unk20 = 0; + gDungeonMenu.unk4 = 0; + gDungeonMenu.firstEntryY = 18; + gDungeonMenu.unkC = 0; + gDungeonMenu.unkE = 0; + gDungeonMenu.unk14.x = 0; + gDungeonMenu.unk0 = 0; + sub_801317C(&gDungeonMenu.unk28); + sub_80137B0(&gDungeonMenu, 0); + while (1) { + s32 r4; + + AddMenuCursorSprite(&gDungeonMenu); + r5 = 0; + r7 = 0; + if (a2 - gUnknown_202F30C > 8) { + r5 = 1; + sub_80684C4(); + } + if (gUnknown_202F30C != 0) { + r7 = 1; + sub_8068344(); + } + + r4 = sub_8014140(0, gUnknown_8106DA4); + DungeonRunFrameActions(0x37); + if (r4 == 2 && r5) { + if (a2 - gUnknown_202F30C > 8) { + s32 i; + for (i = 0; i < 6; i++) { + ScrollDownWindowFunc(0); + DungeonRunFrameActions(0x37); + } + gUnknown_202F30C++; + } + r7 = 0; + r10 = 7; + break; + } + if (gRealInputs.repeated & DPAD_DOWN) { + PlayDungeonCursorSE(1); + if (gDungeonMenu.menuIndex == 7) { + if (a2 - gUnknown_202F30C > 8) { + s32 i; + for (i = 0; i < 6; i++) { + ScrollDownWindowFunc(0); + DungeonRunFrameActions(0x37); + } + gUnknown_202F30C++; + } + r7 = 0; + r10 = 7; + break; + } + MoveMenuCursorDownWrapAround(&gDungeonMenu, 0); + } + + if (r4 == 1 && r7 != 0) { + if (gUnknown_202F30C != 0) { + s32 i; + for (i = 0; i < 6; i++) { + ScrollUpWindowFunc(0); + DungeonRunFrameActions(0x37); + } + gUnknown_202F30C--; + } + r7 = 0; + r10 = 0; + break; + } + if (gRealInputs.repeated & DPAD_UP) { + PlayDungeonCursorSE(1); + if (gDungeonMenu.menuIndex == 0) { + if (gUnknown_202F30C != 0) { + s32 i; + for (i = 0; i < 6; i++) { + ScrollUpWindowFunc(0); + DungeonRunFrameActions(0x37); + } + gUnknown_202F30C--; + } + r7 = 0; + r10 = 0; + break; + } + MoveMenuCursorUpWrapAround(&gDungeonMenu, 0); + } + + if (sub_80048C8()) { + continue; + } + + if (gRealInputs.pressed & START_BUTTON) { + sub_8083D1C(); + r7 = 3; + break; + } + if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) { + PlayDungeonConfirmationSE(); + r7 = 1; + break; + } + if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) { + PlayDungeonCancelSE(); + r7 = 2; + break; + } + } + + AddMenuCursorSprite(&gDungeonMenu); + DungeonRunFrameActions(0x37); + if (r7 == 0) { + continue; + } + else if (r7 == 2) { + r10 = gDungeonMenu.menuIndex; + if (gUnknown_202F310 < a1) { + continue; + } + + if (DisplayDungeonYesNoMessage(NULL, gUnknown_80FDFB8, TRUE) == 1) { + break; + } + else { + continue; + } + } + else if (r7 == 3) { + r10 = gDungeonMenu.menuIndex; + sub_806806C(a3[gUnknown_202F30C + r10]); + continue; + } + else { + s32 arrId; + u8 locIdIsPartner; + + r10 = gDungeonMenu.menuIndex; + arrId = gUnknown_202F30C + r10; + gDungeonSubMenuItemsCount = 0; + AddActionToDungeonSubMenu(0x29, 0); + AddActionToDungeonSubMenu(0x2A, 0); + AddActionToDungeonSubMenu(0x40, 0); + if (a3[arrId]->unk0 & 0x8000) { + SetActionUnusableInDungeonSubMenu(0x29); + } + else { + SetActionUnusableInDungeonSubMenu(0x2A); + } + + // This unnecessary variable is required to match. + locIdIsPartner = DUNGEON_JOIN_LOCATION_PARTNER; + if (a3[arrId]->isTeamLeader || (a3[arrId]->dungeonLocation.id == DUNGEON_JOIN_LOCATION_LEADER || a3[arrId]->dungeonLocation.id == locIdIsPartner)) { + SetActionUnusableInDungeonSubMenu(0x29); + } + + sub_8045064(); + CreateDungeonMenuSubWindow(&spTxtStruct, 0x15); + + while (1) { + AddMenuCursorSprite(&gDungeonMenu); + DungeonRunFrameActions(0x37); + + if (gRealInputs.repeated & DPAD_DOWN) { + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gDungeonMenu, 1); + } + if (gRealInputs.repeated & DPAD_UP) { + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gDungeonMenu, 1); + } + + if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) { + if (CanSubMenuItemBeChosen(gDungeonMenu.menuIndex)) { + PlayDungeonConfirmationSE(); + r7 = 1; + break; + } + PlayDungeonCancelSE(); + } + if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) { + PlayDungeonCancelSE(); + r7 = 0; + break; + } + } + + AddMenuCursorSprite(&gDungeonMenu); + DungeonRunFrameActions(0x37); + if (r7 != 0) { + if (gDungeonMenu.menuIndex == 0) { + a3[arrId]->unk0 |= 0x8000; + sub_8068310(a2, a3); + } + else if (gDungeonMenu.menuIndex == 1) { + a3[arrId]->unk0 &= ~(0x8000); + sub_8068310(a2, a3); + } + else { + sub_806806C(a3[arrId]); + } + } + continue; + } + } + } +} + +void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2_, s32 a3, s32 a4) +{ + s32 i, y; + s32 a2; + + a2 = a2_ - 1; + y = 0x16; + + sub_80073B8(0); + WriteFriendAreaName(gFormatBuffer_Monsters[0], a0, FALSE); + PrintFormattedStringOnWindow(12, 0, _("{POKEMON_0}"), 0, '\0'); + i = 0; + while (i < 10) { + if (a2 >= 0) { + if (a2 >= a3) { + break; + } + + PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0], a1[a2], 0); + sub_808D930(gFormatBuffer_Monsters[1], a1[a2]->speciesNum); + gFormatArgs[0] = a2 + 1; + if (a1[a2]->unk0 & 0x8000) { + InlineStrcpy(gFormatBuffer_Items[0], _("{STAR_BULLET}")); + } + else { + InlineStrcpy(gFormatBuffer_Items[0], _("{ICON_BLANK}")); + } + + if (a1[a2]->unk0 & 0x4000) { + PrintFormattedStringOnWindow(7, y, _("{MOVE_ITEM_0}{color CYAN}$v02:{POKEMON_0}{reset}"), 0, '\0'); + } + else { + PrintFormattedStringOnWindow(7, y, _("{MOVE_ITEM_0}{color YELLOW}$v02:{POKEMON_0}{reset}"), 0, '\0'); + } + } + + i++; + y += 12; + a2++; + } + + sub_80073E0(0); + sub_80073B8(1); + if (gUnknown_202F310 >= a4) { + PrintFormattedStringOnWindow(8, 2, _("Press {B_BUTTON}\nif OK."), 1, '\0'); + } + else { + gFormatArgs[0] = a4 - gUnknown_202F310; + PrintFormattedStringOnWindow(8, 2, _("Say bye to\n{VALUE_0} more"), 1, '\0'); + } + + sub_80073E0(1); +} + +void sub_806806C(PokemonStruct1 *a0) +{ + struct unkStruct_808FF20 unkStruct; + struct UnkInfoTabStruct var_C8; + WindowTemplates spTxtStruct = {0}; + s32 r7; + + spTxtStruct.id[0].type = WINDOW_TYPE_WITH_HEADER; + spTxtStruct.id[0].pos.x = 2; + spTxtStruct.id[0].pos.y = 2; + spTxtStruct.id[0].width = 0x12; + spTxtStruct.id[0].height = 0xE; + spTxtStruct.id[0].unk10 = 0x12; + spTxtStruct.id[0].unk12 = 2; + spTxtStruct.id[0].header = &gUnknown_202F308; + spTxtStruct.id[1].type = WINDOW_TYPE_NORMAL; + spTxtStruct.id[2].type = WINDOW_TYPE_NORMAL; + spTxtStruct.id[3].type = WINDOW_TYPE_NORMAL; + + r7 = 0; + unkStruct.unk40 = 0; + unkStruct.unk56 = 0; + gDungeonMenu.menuIndex = 0; + + while (1) { + bool32 loopBreak = FALSE; + s32 spF8[4] = {2, 3, 4, 5}; + + gUnknown_202F308.count = 4; + gUnknown_202F308.currId = r7; + gUnknown_202F308.width = 10; + gUnknown_202F308.f3 = 0; + + gDungeonMenu.unk1E = r7; + gDungeonMenu.unk20 = 4; + gDungeonMenu.unk1A = 0; + gDungeonMenu.menuIndex = 0; + gDungeonMenu.unk1C = 0; + gDungeonMenu.unk4 = 0; + gDungeonMenu.firstEntryY = 16; + gDungeonMenu.unk14.x = 0; + gDungeonMenu.unk0 = 0; + + sub_801317C(&gDungeonMenu.unk28); + DungeonShowWindows(&spTxtStruct, 1); + sub_808FF20(&unkStruct, a0, gDungeon->unk644.unk16); + CreatePokemonInfoTabScreen(spF8[r7], r7, &unkStruct, &var_C8, 0); + + gDungeonMenu.unkC = (gWindows[0].x + 15) * 8; + gDungeonMenu.unkE = ((gWindows[0].y + 1) * 8) - 2; + + while (1) { + s32 r5; + + AddMenuCursorSprite(&gDungeonMenu); + if (spF8[r7] == 4) { + if (var_C8.unk0[8] != 0) { + sub_80684C4(); + } + if (unkStruct.unk40 != 0) { + sub_8068344(); + } + } + + r5 = sub_8014140(0, gUnknown_8106DA4); + DungeonRunFrameActions(0x1C); + if ((gRealInputs.pressed & DPAD_RIGHT) || gDungeonMenu.unk28.dpad_right) { + PlayDungeonCursorSE(0); + if (++r7 == 4) { + r7 = 0; + } + break; + } + if ((gRealInputs.pressed & DPAD_LEFT) || gDungeonMenu.unk28.dpad_left) { + PlayDungeonCursorSE(0); + if (--r7 == -1) { + r7 = 3; + } + break; + } + + if (spF8[r7] == 4) { + if (((gRealInputs.repeated & DPAD_DOWN) || r5 == 2) && var_C8.unk0[8] != 0) { + s32 i; + + PlayDungeonCursorSE(0); + for (i = 0; i < 6; i++) { + ScrollDownWindowFunc(0); + DungeonRunFrameActions(0x1C); + } + unkStruct.unk40++; + break; + } + if (((gRealInputs.repeated & DPAD_UP) || r5 == 1) && unkStruct.unk40 != 0) { + s32 i; + + PlayDungeonCursorSE(0); + for (i = 0; i < 6; i++) { + ScrollUpWindowFunc(0); + DungeonRunFrameActions(0x1C); + } + unkStruct.unk40--; + break; + } + } + + if (sub_80048C8()) { + continue; + } + + if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) { + PlayDungeonConfirmationSE(); + loopBreak = TRUE; + break; + } + if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) { + PlayDungeonCancelSE(); + loopBreak = TRUE; + break; + } + } + + DungeonRunFrameActions(0x37); + if (loopBreak) { + break; + } + } + + sub_803EAF0(0, NULL); +} + +void sub_8068310(s32 n, PokemonStruct1 **monPtrs) +{ + s32 i; + s32 counter = 0; + + for (i = 0; i < n; i++) { + if ((monPtrs[i]->unk0 & 0x8000) != 0) { + counter++; + } + } + gUnknown_202F310 = counter; +} + +void sub_8068344(void) +{ + if ((gDungeonFramesCounter & 8) != 0) { + Window *window = &gWindows[0]; + SpriteOAM sprite = {0}; + + SpriteSetAffine1(&sprite, 0); + SpriteSetAffine2(&sprite, 0); + SpriteSetObjMode(&sprite, 0); + SpriteSetMosaic(&sprite, 0); + SpriteSetBpp(&sprite, 0); + SpriteSetShape(&sprite, 1); + SpriteSetMatrixNum(&sprite, 16); + SpriteSetSize(&sprite, 0); + SpriteSetTileNum(&sprite, 0x3F0); + SpriteSetPriority(&sprite, 0); + SpriteSetPalNum(&sprite, 15); + SpriteSetY(&sprite, (window->y * 8) + 0x8); + SpriteSetX(&sprite, (window->x * 8) + 0x40); + AddSprite(&sprite,0x100,NULL,NULL); + } +} + +// The same as sub_80623B0 +void sub_80684C4(void) +{ + if ((gDungeonFramesCounter & 8) != 0) { + Window *window = &gWindows[0]; + SpriteOAM sprite = {0}; + + SpriteSetAffine1(&sprite, 0); + SpriteSetAffine2(&sprite, 0); + SpriteSetObjMode(&sprite, 0); + SpriteSetMosaic(&sprite, 0); + SpriteSetBpp(&sprite, 0); + SpriteSetShape(&sprite, 1); + SpriteSetMatrixNum(&sprite, 0); + SpriteSetSize(&sprite, 0); + SpriteSetTileNum(&sprite, 0x3F0); + SpriteSetPriority(&sprite, 0); + SpriteSetPalNum(&sprite, 15); + SpriteSetY(&sprite, (window->y * 8) + 0x70); + SpriteSetX(&sprite, (window->x * 8) + 0x40); + AddSprite(&sprite,0x100,NULL,NULL); + } +} diff --git a/src/dungeon_8071B48.c b/src/dungeon_8071B48.c new file mode 100644 index 000000000..6a41d696f --- /dev/null +++ b/src/dungeon_8071B48.c @@ -0,0 +1,122 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/tactic.h" +#include "dungeon_config.h" +#include "dungeon_leader.h" +#include "dungeon_message.h" +#include "code_8041AD0.h" +#include "code_8077274_1.h" +#include "constants/dungeon.h" +#include "dungeon_map_access.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "dungeon.h" +#include "pokemon_3.h" +#include "code_805D8C8.h" +#include "structs/str_806B7F8.h" +#include "dungeon_logic.h" + +extern u8 *gUnknown_80FED68[]; + +extern void sub_8042920(struct Entity *r0); +extern s16 sub_803D970(u32); +extern s32 sub_803DA20(s32 param_1); +extern bool8 sub_806AA0C(s32, u32); +extern bool8 sub_8083660(DungeonPos *param_1); + +void sub_8071B48(void) +{ + const Tile *tile; + struct Entity *entity2; + struct Entity *entity; + int index; + int index1; + int counter; + struct Entity *entityPtr; + s32 level; + struct Dungeon *dungeon; // feels like a hack + struct unkStruct_806B7F8 local_2c; + + entityPtr = NULL; + dungeon = gDungeon; + if ((dungeon->unk644.unk20 != 0) && + ((dungeon->unk644.dungeonLocation.id != DUNGEON_METEOR_CAVE || (dungeon->unk37FD == 0)))) { + dungeon->unk644.unk1E++; + if (dungeon->unk644.unk2A == 0) { + if ( dungeon->unk644.unk1E < gUnknown_80F4DAA) { + return; + } + } + else { + if ( dungeon->unk644.unk1E < gUnknown_80F4DAC) { + return; + } + } + + if (dungeon->unk644.unk1E > 900) { + entity2 = dungeon->unk17B34; + if ((EntityIsValid(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity2,0); + entityPtr = entity2; + } + } + + dungeon->unk644.unk1E = 0; + dungeon->unk17B34 = NULL; + + counter = 0; + for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) + { + entity = dungeon->wildPokemon[index]; + if ((EntityIsValid(entity)) && + (tile = GetTile((entity->pos).x, (entity->pos).y), + (tile->terrainType & TERRAIN_TYPE_UNBREAKABLE) == 0)) { + counter++; + } + } + if (dungeon->unk644.unk2A == 0) { + if (gDungeon->monsterHouseRoom == CORRIDOR_ROOM) { + if (counter >= gUnknown_80F4DA6) { + return; + } + } + else + { + if (counter >= gUnknown_80F4DA8) { + return; + } + } + + } + if (entityPtr != NULL) { + DisplayDungeonLoggableMessageTrue(0,*gUnknown_80FED68); + sub_8042920(entityPtr); + } + if (dungeon->unk644.unk2A != 0) { + index1 = 0x17c; + } + else { + index1 = sub_803D970(0); + } + + level = sub_803DA20(index1); + if (level == 0) { + level = 1; + } + if ((sub_806AA0C(index1, 0)) && (sub_8083660(&local_2c.pos))) { + local_2c.species = index1; + local_2c.level = level; + local_2c.unk2 = 0; + if(DungeonRandInt(100) < GetRandomMovementChance(gDungeon->unk644.dungeonLocation.id)) + { + local_2c.unk4 = 1; + } + else + { + local_2c.unk4 = 0; + } + local_2c.unk10 = 0; + sub_806B7F8(&local_2c, FALSE); + } + } +} diff --git a/src/dungeon_8072CF4.c b/src/dungeon_8072CF4.c new file mode 100644 index 000000000..80363700b --- /dev/null +++ b/src/dungeon_8072CF4.c @@ -0,0 +1,505 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_ai_leader.h" +#include "dungeon_move_util.h" +#include "code_803E46C.h" +#include "code_8041AD0.h" +#include "code_804267C.h" +#include "code_8066D04.h" +#include "dungeon_message.h" +#include "code_8077274_1.h" +#include "code_807CD9C.h" +#include "constants/dungeon_action.h" +#include "constants/dungeon.h" +#include "constants/iq_skill.h" +#include "constants/item.h" +#include "constants/move_id.h" +#include "constants/status.h" +#include "constants/targeting.h" +#include "dungeon_logic.h" +#include "dungeon_items.h" +#include "dungeon_leader.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "move_util.h" +#include "moves.h" +#include "pokemon_3.h" +#include "pokemon.h" +#include "status.h" +#include "trap.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" + +extern u8 gUnknown_202F221; +extern u8 gUnknown_202F222; +extern u8 gUnknown_202F32C; +extern u8 gUnknown_202F32D; +extern u8 gUnknown_203B434; + +extern u8 *gUnknown_80FA5B4[]; +extern u8 *gUnknown_80FCF50[]; +extern u8 *gUnknown_80FCF38[]; +extern u8 *gUnknown_80FD2CC[]; +extern u8 *gUnknown_80FE478[]; +extern u8 *gUnknown_80FE6D4[]; + +void sub_8075BA4(Entity *param_1, u8 param_2); +void sub_804178C(u8 param_1); +void nullsub_95(Entity *); +bool8 IsNotAttacking(Entity *, bool8); +extern void sub_80671A0(Entity *); +extern void sub_8067110(Entity *); +void HandleUseMoveAIAction(Entity *target); +void sub_8041888(u8 param_1); +void sub_8085140(void); +void sub_807360C(void); +void sub_805EFB4(Entity *, u8); +void sub_8074FB0(Entity *, u8, DungeonPos *); + +void HandlePlaceItemAction(Entity *); +void HandlePickUpPlayerAction(Entity *); +void sub_8066E14(Entity * ); +void sub_807348C(void); +void sub_80732F0(void); +void sub_8066BD4(Entity*); +void HandleTalkFieldAction(Entity *); +void HandleUseMovePlayerAction(Entity *); +void HandleUseOrbAction(Entity *); +void sub_8067904(Entity *, u32); +void HandleGiveItemAction(Entity *); +void HandleTakeItemAction(Entity *); +void HandleUseItemAction(Entity *); +void sub_8066FA4(Entity *); +void HandleUnsetItemAction(Entity *,bool8); +extern u8 sub_8044B28(void); +extern u8 UseAttack(Entity *); +void sub_806A1E8(Entity *pokemon); +bool8 sub_804AE08(DungeonPos *pos); +void HandlePickUpAIAction(Entity *pokemon); +void HandleThrowItemAIAction(Entity *pokemon); +void HandleEatAIAction(Entity *pokemon); +bool8 sub_8044B84(void); +extern void sub_8074094(Entity *); +extern void sub_8071DA4(Entity *); +u32 sub_8075818(Entity *entity); +extern void MarkLastUsedMonMove(Entity *entity, Move *move); +bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move); +extern void sub_80838EC(u8 *a); + +bool8 sub_8072CF4(Entity *entity) +{ + bool8 bVar4; + bool8 bVar5; + Move *move; + s32 index; + EntityInfo *info; + bool8 bVar14; + DungeonPos pos; + DungeonPos pos1; + + sub_804178C(1); + gUnknown_203B434 = 1; + info = GetEntInfo(entity); + info->useHeldItem = FALSE; + info->unkF3 = FALSE; + gDungeon->unkB8 = entity; + if (gUnknown_80F58F4[(info->action).action][0] != 0) { + if (info->isTeamLeader) { + sub_805EFB4(entity,gUnknown_80F58F4[(info->action).action][1]); + } + else { + sub_8075BA4(entity,gUnknown_80F58F4[(info->action).action][1]); + } + } + if ((CannotAttack(entity, FALSE)) && (IsChargingAnyTwoTurnMove(entity, TRUE))) { + sub_8079764(entity); + } + + for(index = 0; index < MAX_MON_MOVES; index++) + { + move = &info->moves.moves[index]; + if ((move->moveFlags & MOVE_FLAG_EXISTS)) { + move->moveFlags2 &= ~(MOVE_FLAG2_UNK4); + } + } + if (!IsNotAttacking(entity, FALSE)) { + if (UseAttack(entity)) { + if (sub_8044B28()) { + return FALSE; + } + if (!EntityIsValid(entity)) { + return FALSE; + } + if (gUnknown_202F32D != 0) { + return TRUE; + } + } + if (!info->isTeamLeader) { + sub_8052740(10); + } + sub_806A1E8(entity); + DungeonRunFrameActions(10); + } + if (((ACTION_PASS_TURN < info->action.action) && (info->action.action != 4)) && (info->action.action != ACTION_WALK)) { + info->attacking = TRUE; + } + bVar14 = FALSE; + info->unk14A = 0; + gUnknown_202F221 = 0; + gUnknown_202F222 = 0; + switch(info->action.action) { + case ACTION_WALK: + if(info->frozenClassStatus.status == STATUS_SHADOW_HOLD) + { + goto _282; + } + else if(info->frozenClassStatus.status == STATUS_CONSTRICTION) + { + goto _282; + } + else if(info->frozenClassStatus.status == STATUS_INGRAIN) + { + goto _282; + } + else if(info->frozenClassStatus.status == STATUS_WRAP) + { + goto _282; + } + else if(info->frozenClassStatus.status == STATUS_WRAPPED) + { + _282: + info->action.action = ACTION_NOTHING; + info->waiting = TRUE; + } + else { + bVar5 = FALSE; + pos1.x = (entity->pos).x + gAdjacentTileOffsets[(info->action).direction].x; + pos1.y = (entity->pos).y + gAdjacentTileOffsets[(info->action).direction].y; + if ((!(info->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) && + (!CanMoveInDirection(entity,(info->action).direction))) { + bVar5 = TRUE; + } + if (bVar5) { + info->action.action = ACTION_NOTHING; + info->waiting = TRUE; + break; + } + else + { + pos.x = entity->pos.x; + pos.y = entity->pos.y; + sub_80694C0(entity,pos1.x,pos1.y,0); + sub_8074FB0(entity,(info->action).direction,&pos); + if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->invisibleClassStatus.status != STATUS_MOBILE)) && + (!HasHeldItem(entity,ITEM_MOBILE_SCARF))) { + sub_804AE08(&entity->pos); + } + bVar14 = TRUE; + break; + } + } + break; + case ACTION_USE_MOVE_AI: + HandleUseMoveAIAction(entity); + break; + case ACTION_STAIRS: + if ((gDungeon->unk644.dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! + } + else + { + PlayStairsSound(); + gDungeon->unk2 = 1; + gUnknown_202F32C = (info->action).direction; + } + break; + case ACTION_EAT_BERRY_SEED_DRINK: + case 0xe: + case ACTION_USE_TM: + sub_8067110(entity); + break; + case ACTION_USE_ORB: + HandleUseOrbAction(entity); + break; + case ACTION_PICK_UP_PLAYER: + HandlePickUpPlayerAction(entity); + break; + case ACTION_GIVE_ITEM: + HandleGiveItemAction(entity); + break; + case ACTION_TAKE_ITEM: + HandleTakeItemAction(entity); + break; + case 0x3e: + sub_8066BD4(entity); // ITEM_SWITCH_TOOLBOX (When you switch item in Toolbox) + break; + case ACTION_USE_ITEM: + HandleUseItemAction(entity); + break; + case ACTION_SET_ITEM: + HandleSetItemAction(entity, TRUE); + break; + case ACTION_UNSET_ITEM: + HandleUnsetItemAction(entity, TRUE); + break; + case 0x3b: + gDungeon->unkBC = gDungeon->teamPokemon[(info->action).actionParameters[0].actionUseIndex]; + break; + case ACTION_PLACE_ITEM: + HandlePlaceItemAction(entity); + break; + case 10: // Switch with Item on Ground + sub_8066E14(entity); + break; + case 0x3a: // Switch with Item on Ground (also??) + sub_8066FA4(entity); + break; + case ACTION_THROW_ITEM_PLAYER: + case ACTION_THROW_STRAIGHT_PLAYER: + case ACTION_THROW_ARC_PLAYER: + if (MonsterCanThrowItems(info)) { + nullsub_95(entity); + sub_80671A0(entity); + break; + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE6D4); + break; + case ACTION_TALK_FIELD: + HandleTalkFieldAction(entity); + break; + case ACTION_USE_MOVE_PLAYER: + HandleUseMovePlayerAction(entity); + break; + case ACTION_STRUGGLE: + sub_8067904(entity, MOVE_STRUGGLE); + break; + case ACTION_REGULAR_ATTACK: + sub_8067904(entity, MOVE_REGULAR_ATTACK); + break; + case ACTION_STEPPED_ON_TRAP: + HandleTrap(entity,&entity->pos,0,0); + break; + case ACTION_PICK_UP_AI: + HandlePickUpAIAction(entity); + break; + case ACTION_EAT_AI: + HandleEatAIAction(entity); + break; + case ACTION_THROW_ITEM_AI: + HandleThrowItemAIAction(entity); + break; + case ACTION_SECOND_THOUGHTS: + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE478); + break; + default: + info->action.action = ACTION_PASS_TURN; + break; + } + sub_807FD84(entity); + if (EntityIsValid(entity)) { + if (GetEntInfo(entity)->unk14A == 0) { + GetEntInfo(entity)->unk14A = 0; + sub_8079764(entity); + } + sub_8041888(0); + if (EntityIsValid(entity)) { + sub_8085140(); + if (info->unk14B != 0) { + bVar4 = FALSE; + info->unk14B = 0; + + for(index = 0; index < MAX_MON_MOVES; index++) + { + move = &info->moves.moves[index]; + if ((info->moves.moves[index].moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags & MOVE_FLAG_LAST_USED)) { + move->PP = 0; + bVar4 = TRUE; + } + } + if (bVar4) { + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FD2CC); + } + } + sub_807360C(); + if (!sub_8044B84()) { + sub_807348C(); + sub_80732F0(); + if (!EntityIsValid(entity)) { + return FALSE; + } + } + if (bVar14) { + sub_8075818(entity); + } + if (EntityIsValid(entity)) { + if (!sub_8044B84()) { + sub_8046D20(); + } + sub_8041888(0); + if (((EntityIsValid(entity)) && (!info->aiAllySkip)) && (!bVar14)) { + if (sub_80706A4(entity,&entity->pos) != '\0') { + WarpTarget(entity,entity,0,0); + } + sub_8074094(entity); + sub_8071DA4(entity); + } + } + } + } + return FALSE; +} + +void sub_80732F0(void) +{ + s32 index; + Entity *entity; + EntityInfo *info; + s32 moveIndex; + s32 counter; + s32 otherIndex; + u8 flag; + Move *move; + Move *move2; + Move moveStack; + u8 sl; + + for(index = 0; index < DUNGEON_MAX_POKEMON; index++){ + flag = FALSE; + entity = gDungeon->activePokemon[index]; + if(EntityIsValid(entity)){ + info = GetEntInfo(entity); + if(info->unk164 != 0xFF){ + sl = info->unk164; + if(CannotAttack(entity, TRUE)){ + info->unk164 |= 0xFF; + } + else if(!IsSleeping(entity)){ + info->unk164 |= 0xFF; + } + else if(info->muzzled.muzzled == TRUE){ + info->unk164 |= 0xFF; + } + else{ + moveIndex = DungeonRandInt(MAX_MON_MOVES); + for(counter = 0; counter < MAX_MON_MOVES; counter++){ + move = &info->moves.moves[moveIndex]; + if(MoveFlagExists(move)){ + moveStack = *move; + if(moveStack.id == MOVE_SKETCH) + goto _increase; + if(moveStack.id == MOVE_MIMIC) + goto _increase; + for(otherIndex = 0; otherIndex < MAX_MON_MOVES; otherIndex++){ + move2 = &info->moves.moves[otherIndex]; + if(MoveFlagExists(move2)){ + if(!info->isTeamLeader){ + if(!(move2->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) continue; + } + if(move2->id == MOVE_SLEEP_TALK){ + if(CanMonsterUseMove(entity, move2, TRUE)) + { + sub_80838EC(&move2->PP); + break; + } + } + } + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, *gUnknown_80FCF38); // {ARG_POKEMON_0} uttered its sleep talk! + info->action.direction = sl & DIRECTION_MASK; + TryUseChosenMove(entity, 0, ITEM_NOTHING, 1, FALSE, &moveStack); + flag = TRUE; + break; + + } + else + { +_increase: + moveIndex++; + if(moveIndex == MAX_MON_MOVES) + moveIndex = 0; + } + } + info->unk164 |= 0xFF; + if(flag) + sub_80421C0(entity, 0x2E0); + } + } + } + } +} + +void sub_807348C(void) +{ + int index; + s32 moveIndex; + Move *move; + EntityInfo *info; + Entity *pokemon; + Move chosenMove; + u8 r8; + + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { + pokemon = gDungeon->activePokemon[index]; + if (EntityIsValid(pokemon)) { + info = GetEntInfo(pokemon); + if (info->unk165 != 0xff) { + r8 = info->unk165; + if (CannotAttack(pokemon,TRUE)) { + info->unk165 |= 0xff; + info->unk164 |= 0xff; + } + else if (!IsSleeping(pokemon)) { + info->unk165 |= 0xff; + info->unk164 |= 0xff; + } + else if (info->muzzled.muzzled == TRUE) { + info->unk165 |= 0xff; + info->unk164 |= 0xff; + } + else { + for(moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) + { + move = &info->moves.moves[moveIndex]; + if (((MoveFlagExists(move)) && + ((info->isTeamLeader || (move->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) && move->id == MOVE_SNORE)) && + (CanMonsterUseMove(pokemon,move,TRUE))) { + chosenMove = *move; + sub_80838EC(&move->PP); + MarkLastUsedMonMove(pokemon,move); + break; + } + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FCF50); + info->action.direction = r8 & DIRECTION_MASK; + TryUseChosenMove(pokemon,0,ITEM_NOTHING,1,FALSE,&chosenMove); + info->unk165 |= 0xff; + info->unk164 |= 0xff; + } + } + } + } +} + +void sub_807360C(void) +{ + s32 index; + Entity *entity; + + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) + { + entity = gDungeon->activePokemon[index]; + if(EntityIsValid(entity)) + { + if(GetEntInfo(entity)->unk152 != 0) + { + GetEntInfo(entity)->unk152 = 0; + UpdateFlashFireBoost(entity, entity); + } + } + } +} + diff --git a/src/dungeon_action.c b/src/dungeon_action.c index cabeda82d..da4dad368 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -1,205 +1,64 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_action.h" -#include "constants/ability.h" #include "constants/dungeon_action.h" #include "dungeon_ai.h" #include "dungeon_ai_leader.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" #include "dungeon_leader.h" -#include "dungeon_movement.h" +#include "dungeon_logic.h" #include "dungeon_generation.h" #include "dungeon_util.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_strings.h" #include "pokemon.h" #include "items.h" #include "structs/str_item_text.h" +#include "code_8044CC8.h" +#include "dungeon_items.h" +#include "dungeon_map_access.h" +#include "dungeon_engine.h" +#include "run_dungeon.h" -extern u8 *gUnknown_80F91EC[]; -extern u8 *gUnknown_80F7C50[]; -extern u8 gUnknown_80F697C[]; -extern s16 gSpeedTurns[2][0x19]; - -extern void sub_8071B48(void); -extern void sub_8043ED0(u32); -extern u8 GetFloorType(void); extern bool8 sub_8044B28(void); extern void sub_8086AC0(void); -extern void sub_8043ED0(u32); -extern void sub_807EAA0(u32, u32); extern void UseAttack(u32); - -extern void sub_8071B48(void); extern void TriggerWeatherAbilities(void); -extern void sub_8074094(Entity *); extern void sub_8071DA4(Entity *); extern void TickStatusHeal(Entity *); -void sub_8044820(void) -{ - s32 movSpeed; - EntityInfo *entityInfo; - EntityInfo *entityInfo2; - Entity * entity; - Entity * entity2; - s32 index; +extern unkStruct_202EE44 gDungeonSubMenu[10]; - for (index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { - entity = gDungeon->wildPokemon[index]; - if (EntityIsValid(entity)) { - if (sub_8044B28()) break; - entityInfo = GetEntInfo(entity); - gDungeon->unkB8 = entity; - TriggerWeatherAbilities(); - if ((entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY) == 0) { - if ((u16)(entityInfo->flags & MOVEMENT_FLAG_UNK_14) != 0) { - entityInfo->flags &= ~(MOVEMENT_FLAG_UNK_14); - } - else - { - entityInfo->aiAllySkip = FALSE; - movSpeed = CalcSpeedStage(entity); - if (gSpeedTurns[movSpeed][gDungeon->unk644.fractionalTurn] != 0) { - if (!entityInfo->attacking) { - entityInfo->flags &= ~(MOVEMENT_FLAG_UNK_14 | MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY); - entityInfo->recalculateFollow = FALSE; - TickStatusHeal(entity); - if (EntityIsValid(entity)) { - sub_8071DA4(entity); - RunMonsterAI(entity, 0); - if (sub_8044B28()) break; - sub_8072CF4(entity); - sub_8086AC0(); - sub_8043ED0(0); - if (sub_8044B28()) break; - } - } - } - } - } - } - } - if (sub_8044B28() == 0) { - for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) - { - entity2 = gDungeon->wildPokemon[index]; - if ((EntityIsValid(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiAllySkip)) - { - sub_8074094(entity2); - if (EntityIsValid(entity2)) { - sub_8071DA4(entity2); - entityInfo2->aiAllySkip = FALSE; - } - } - } - } -} +extern s32 gDungeonSubMenuItemsCount; -void TrySpawnMonsterAndActivatePlusMinus(void) -{ - EntityInfo * entityInfo; - Entity *entity; - u32 isNotEnemy; - s32 index; +extern bool8 sub_8045888(Entity *); - if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn] != 0) { - sub_8071B48(); - gDungeon->plusIsActive[0] = FALSE; - gDungeon->plusIsActive[1] = FALSE; - gDungeon->minusIsActive[0] = FALSE; - gDungeon->minusIsActive[1] = FALSE; - gDungeon->lightningRodPokemon = NULL; - gDungeon->unk17B38 = 2; +static const u16 gUnknown_80F6964[NUM_ITEM_CATEGORIES] = { + [CATEGORY_THROWN_LINE] = 0, + [CATEGORY_THROWN_ARC] = 0, + [CATEGORY_BERRIES_SEEDS_VITAMINS] = 13, + [CATEGORY_FOOD_GUMMIES] = 14, + [CATEGORY_HELD_ITEMS] = 0, + [CATEGORY_TMS_HMS] = 16, + [CATEGORY_POKE] = 0, + [CATEGORY_7] = 18, + [CATEGORY_OTHER] = 18, + [CATEGORY_ORBS] = 49, + [CATEGORY_LINK_BOX] = 44, + [CATEGORY_USED_TM] = 18, +}; - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) - { - entity = gDungeon->activePokemon[index]; - if (EntityIsValid(entity)) { - entityInfo = GetEntInfo(entity); - entityInfo->attacking = FALSE; - - if(entityInfo->isNotTeamMember) - { - isNotEnemy = FALSE; - } - else { - isNotEnemy = TRUE; - } - - if (AbilityIsActive(entity, ABILITY_LIGHTNINGROD)) { - gDungeon->lightningRodPokemon = entity; - gDungeon->unk17B38 = entityInfo->unk98; - } - if (AbilityIsActive(entity, ABILITY_MINUS)) { - gDungeon->minusIsActive[isNotEnemy] = TRUE; - } - if (AbilityIsActive(entity, ABILITY_PLUS)) { - gDungeon->plusIsActive[isNotEnemy] = TRUE; - } - } - } - sub_8043ED0(0); - } -} - -void sub_8044AB4(void) -{ - s32 index; - - if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn + 1] != 0) { - for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (EntityIsValid(gDungeon->activePokemon[index])) { - UseAttack(0); - break; - } - } - sub_807EAA0(1,0); - sub_8086AC0(); - sub_8043ED0(0); - } -} - -bool8 sub_8044B28(void) -{ - if (gDungeon->unk4 == 0) { - if (GetLeader() == NULL) { - gDungeon->unk644.unk10 = 1; - } - else if (gDungeon->unk2 == 1) { - gDungeon->unk644.unk10 = 2; - } - else if (gDungeon->unk2 != 2) { - return FALSE; - } - else { - gDungeon->unk644.unk10 = 2; - } - } - return TRUE; -} - -bool8 sub_8044B84(void) -{ - if(gDungeon->unk10 != 0) - { - return TRUE; - } - else { - return sub_8044B28(); - } -} - -const u8 *sub_8044BA8(u16 actionId, u8 id) +UNUSED static const u8 *sub_8044BA8(u16 actionId, u8 id) { if (actionId == ACTION_STAIRS && GetFloorType() == FLOOR_TYPE_RESCUE) { - return *gUnknown_80F91EC; + return gUnknown_80F91EC; } else { - if (!AreStringsDifferent(gUnknown_80F7C50[actionId << 1], gUnknown_80F697C)) { + if (!AreStringsDifferent(gUnknown_80F7C50[actionId].str, "X")) { return gActions[GetItemActionType(id)].useText; } else { - return gUnknown_80F7C50[actionId << 1]; + return gUnknown_80F7C50[actionId].str; } } } @@ -257,3 +116,236 @@ void SetActionPassTurnOrWalk(ActionContainer *actionPointer, s16 species) actionPointer->actionParameters[0].actionUseIndex = 0; actionPointer->actionParameters[1].actionUseIndex = 0; } + +Item * sub_8044CC8(Entity *param_1, ActionParameter *param_2, UNUSED s32 a3) +{ + const Tile *tile; + Item *item; + EntityInfo *info; + + if (param_2->actionUseIndex >= 1 && param_2->actionUseIndex < INVENTORY_SIZE + 1) { + item = &gTeamInventoryRef->teamItems[param_2->actionUseIndex - 1]; + } + else if (param_2->actionUseIndex == 0x80) { + tile = GetTile((param_2->itemPos).x,(param_2->itemPos).y); + item = GetItemData(tile->object); + } + else { + if (param_2->actionUseIndex == 0x81) { + info = GetEntInfo(param_1); + } + else { + if (param_2->actionUseIndex >= 0x90 && param_2->actionUseIndex < 0x94) { + info = GetEntInfo(gDungeon->teamPokemon[param_2->actionUseIndex - 0x90]); + } + else { + return NULL; + } + } + item = &info->heldItem; + } + return item; +} + +bool8 sub_8044D40(ActionContainer *param_1,s32 index) +{ + Item *item; + ActionParameter *puVar1; + + puVar1 = ¶m_1->actionParameters[index]; + if ((u8)(puVar1->actionUseIndex - 1) < INVENTORY_SIZE) { + item = &gTeamInventoryRef->teamItems[puVar1->actionUseIndex - 1]; + item->id = ITEM_NOTHING; + item->quantity = 0; + item->flags = 0; + FillInventoryGaps(); + } + else { + if (puVar1->actionUseIndex != 0x80) { + return FALSE; + } + RemoveItemFromDungeonAt(&puVar1->itemPos,1); + } + return TRUE; +} + +Item *sub_8044D90(Entity *entity, s32 index, s32 unused) +{ + EntityInfo *info = GetEntInfo(entity); + return sub_8044CC8(entity, &info->action.actionParameters[index], unused); +} + +Entity *sub_8044DA4(Entity *entity, s32 index) +{ + EntityInfo *info = GetEntInfo(entity); + return gDungeon->teamPokemon[info->action.actionParameters[index].actionUseIndex]; +} + +u16 sub_8044DC8(Item *param_1) +{ + if (param_1->id == ITEM_SWITCH_BOX) { + return 0x35; + } + else { + return gUnknown_80F6964[GetItemCategory(param_1->id)]; + } +} + +void sub_8044DF0(Entity *entity, s32 index, u32 unused) +{ + Item *item; + EntityInfo *info; + + info = GetEntInfo(entity); + item = sub_8044D90(entity,index,unused); + if ((info->action).actionParameters[0].actionUseIndex == 0x80) { + RemoveItemFromDungeonAt(&(info->action).actionParameters[0].itemPos,1); + } + else { + item->id = ITEM_NOTHING; + item->quantity = 0; + item->flags = 0; + FillInventoryGaps(); + } +} + +void sub_8044E24(Entity *entity,int index,u32 unused) +{ + Item *itemPtr; + EntityInfo *info; + DungeonPos *pos; + Item item; + + itemPtr = sub_8044D90(entity,index,unused); + info = GetEntInfo(entity); + if (!IsHMItem(itemPtr->id)) { + if (GetItemCategory(itemPtr->id) == CATEGORY_TMS_HMS) { + if (info->action.actionParameters[index].actionUseIndex == 0x80) { + item = *itemPtr; + pos = &info->action.actionParameters[index].itemPos; + RemoveItemFromDungeonAt(pos,1); + item.quantity = itemPtr->id - 125; + item.id = ITEM_TM_USED_TM; + AddItemToDungeonAt(pos,&item,1); + } + else { + itemPtr->quantity = itemPtr->id - 125; + itemPtr->id = ITEM_TM_USED_TM; + } + } + else { + sub_8044DF0(entity,index,unused); + } + } +} + +// Similar to sub_8044BA8 +const u8 *GetDungeonSubMenuItemString(s32 param_1) +{ + u16 actionId = gDungeonSubMenu[param_1].actionId; + + if (actionId == ACTION_STAIRS && GetFloorType() == FLOOR_TYPE_RESCUE) { + return gUnknown_80F91EC; + } + else { + if (!AreStringsDifferent(gUnknown_80F7C50[actionId].str, "X")) { + return gActions[GetItemActionType(gDungeonSubMenu[param_1].unk2)].useText; + } + else { + return gUnknown_80F7C50[actionId].str; + } + } +} + +bool8 CanSubMenuItemBeChosen(s32 itemId) +{ + if (itemId < 0) + return FALSE; + else + return gDungeonSubMenu[itemId].canBeChosen; +} + +void AddActionToDungeonSubMenu(u16 actionId, u8 param_2) +{ + int index; + + if (gDungeonSubMenuItemsCount < 10) { + for(index = 0; index < gDungeonSubMenuItemsCount; index++) + { + if (gDungeonSubMenu[index].actionId == actionId) { + return; + } + } + gDungeonSubMenu[gDungeonSubMenuItemsCount].actionId = actionId; + gDungeonSubMenu[gDungeonSubMenuItemsCount].unk2 = param_2; + gDungeonSubMenu[gDungeonSubMenuItemsCount].canBeChosen = TRUE; + gDungeonSubMenuItemsCount++; + } +} + +s32 ActionToDungeonSubMenuId(u16 actionId) +{ + int index; + + for(index = 0; index < gDungeonSubMenuItemsCount; index++) + { + if (gDungeonSubMenu[index].actionId == actionId) { + return index; + } + } + return -1; +} + +void SetActionUnusableInDungeonSubMenu(u16 actionId) +{ + int index; + + for(index = 0; index < gDungeonSubMenuItemsCount; index++) + { + if (gDungeonSubMenu[index].actionId == actionId) { + gDungeonSubMenu[index].canBeChosen = FALSE; + return; + } + } +} + +bool8 IsNotAttacking(Entity *param_1, bool8 param_2) +{ + EntityInfo *info; + u16 *action; + + info = GetEntInfo(param_1); + action = &(info->action).action; + if ((param_2 == 0) || (sub_8045888(param_1))) + { + if(*action == ACTION_NOTHING) + return TRUE; + if (*action == ACTION_WALK) + return TRUE; + if (*action == ACTION_PASS_TURN) + return TRUE; + if (*action == ACTION_UNK5) + return TRUE; + return FALSE; + } + else { + return TRUE; + } +} + +void sub_8045064(void) +{ + s32 i, j; + + for (i = 0; i < gDungeonSubMenuItemsCount; i++) { + for (j = i + 1; j < gDungeonSubMenuItemsCount; j++) { + unkStruct_202EE44 temp; + unkStruct_202EE44 *iPtr = &gDungeonSubMenu[i]; + unkStruct_202EE44 *jPtr = &gDungeonSubMenu[j]; + + if (gUnknown_80F7C50[iPtr->actionId].val > gUnknown_80F7C50[jPtr->actionId].val) { + SWAP(*iPtr, *jPtr, temp); + } + } + } +} diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index fd2847195..7ef3cf44c 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -1,9 +1,8 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_ai.h" - #include "code_803E668.h" #include "code_803E724.h" -#include "code_8045A00.h" #include "dungeon_message.h" #include "code_8077274_1.h" #include "code_808417C.h" @@ -19,55 +18,20 @@ #include "dungeon_ai_attack.h" #include "dungeon_ai_items.h" #include "dungeon_ai_movement.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" #include "dungeon_items.h" #include "dungeon_leader.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util_1.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "pokemon.h" #include "status_checks.h" #include "structs/map.h" #include "structs/str_dungeon.h" #include "dungeon_misc.h" -#include "tile_types.h" extern char *gPtrCouldntBeUsedMessage; -extern char *gPtrItsaMonsterHouseMessage; - -extern u8 sub_8044B28(void); -extern void sub_807AB38(Entity *, u32); -extern void sub_8041888(u32); - -void sub_8075900(Entity *pokemon, u8 r1) -{ - if(EntityIsValid(pokemon)) - { - if(!GetEntInfo(pokemon)->isNotTeamMember) - { - if(!sub_8044B28()) - { - if(!gDungeon->unk644.monsterHouseTriggered) - { - if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) - { - // It's a monster house! - LogMessageByIdWithPopupCheckUser(GetLeader(), gPtrItsaMonsterHouseMessage); - gDungeon->unk644.monsterHouseTriggeredEvent = TRUE; - sub_807AB38(pokemon, r1); - sub_8041888(0); - if(sub_803F428(&pokemon->pos)) - sub_803E708(0x78, 0x39); - } - } - } - } - } -} void RunMonsterAI(Entity *pokemon, u32 unused) { @@ -188,3 +152,17 @@ void RunMonsterAI(Entity *pokemon, u32 unused) } } } + +void sub_8075BA4(Entity *param_1, u8 param_2) +{ + EntityInfo * entityInfo = GetEntInfo(param_1); + + if ((param_2 != 0) && (entityInfo->cringeClassStatus.status == STATUS_COWERING)) { + entityInfo->action.direction = (entityInfo->action.direction + 4) & DIRECTION_MASK; + TargetTileInFront(param_1); + } + else if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) { + entityInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); + TargetTileInFront(param_1); + } +} diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index b5b6193f6..c41ca3859 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -1,7 +1,7 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_ai_attack.h" -#include "charge_move.h" -#include "code_8045A00.h" +#include "dungeon_move_util.h" #include "dungeon_message.h" #include "code_806CD90.h" #include "constants/direction.h" @@ -13,22 +13,18 @@ #include "constants/targeting.h" #include "constants/type.h" #include "dungeon_action.h" -#include "dungeon_ai_targeting.h" #include "dungeon_ai.h" -#include "dungeon_capabilities.h" #include "dungeon_config.h" -#include "dungeon_engine.h" +#include "run_dungeon.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "items.h" #include "move_checks.h" #include "move_util.h" #include "moves.h" #include "position_util.h" -#include "status_checks_1.h" #include "status_checks.h" #include "structs/str_dungeon.h" #include "targeting_flags.h" @@ -48,13 +44,10 @@ EWRAM_DATA u8 gPotentialAttackTargetDirections[NUM_DIRECTIONS] = {0}; EWRAM_DATA s32 gPotentialAttackTargetWeights[NUM_DIRECTIONS] = {0}; EWRAM_DATA Entity *gPotentialTargets[NUM_DIRECTIONS] = {0}; -extern void sub_8055A00(Entity *, u8, u32, u32, u32); extern bool8 sub_8044B28(void); -extern void sub_8057588(Entity *, u32); extern void sub_806A1B0(Entity *); extern Item *sub_8044D90(Entity *, s32, u32); extern bool8 sub_8044D40(ActionContainer *, u32); -extern bool8 TryUseChosenMove(struct Entity *, u32, u32, u32, u32, struct Move *); extern void sub_8045BF8(u8 *, struct Item *); extern void sub_8044DF0(struct Entity *, u32, u32); extern void sub_8071DA4(struct Entity *); @@ -546,23 +539,11 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range) { - s32 distanceX = user->pos.x - target->pos.x; - s32 distanceY, distance; s32 direction; - if (distanceX < 0) - { - distanceX = -distanceX; - } - distanceY = user->pos.y - target->pos.y; - if (distanceY < 0) - { - distanceY = -distanceY; - } - distance = distanceY; - if (distanceY < distanceX) - { - distance = distanceX; - } + s32 distanceX = abs(user->pos.x - target->pos.x); + s32 distanceY = abs(user->pos.y - target->pos.y); + s32 distance = max(distanceX, distanceY); + if (distance > RANGED_ATTACK_RANGE || distance > range) { return FALSE; @@ -1070,3 +1051,12 @@ void HandleUseOrbAction(Entity *pokemon) if (!sub_8044B28()) sub_806A1B0(pokemon); } + +s16 GetMoveTargetAndRangeForPokemon(Entity *pokemon, Move *move, bool32 isAI) +{ + if (move->id == MOVE_CURSE && !isAI && !MonsterIsType(pokemon, TYPE_GHOST)) + { + return TARGETING_FLAG_BOOST_SELF | TARGETING_FLAG_TARGET_SELF; + } + return GetMoveTargetAndRange(move, isAI); +} diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c index dfe5c9f81..edfa6a92c 100644 --- a/src/dungeon_ai_item_weight.c +++ b/src/dungeon_ai_item_weight.c @@ -1,15 +1,13 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_ai_item_weight.h" - #include "constants/status.h" #include "constants/targeting.h" -#include "dungeon_ai_targeting.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_util.h" #include "moves.h" #include "number_util.h" -#include "status_checks_1.h" u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFlags) { diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index faea80b50..7ebcefafd 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -1,5 +1,5 @@ #include "global.h" - +#include "globaldata.h" #include "constants/direction.h" #include "constants/dungeon_action.h" #include "constants/iq_skill.h" @@ -9,18 +9,26 @@ #include "dungeon_ai_attack.h" #include "dungeon_ai_item_weight.h" #include "dungeon_ai_items.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "items.h" #include "structs/str_position.h" #include "position_util.h" +#include "string_format.h" +#include "dungeon_strings.h" +#include "dungeon_message.h" +#include "dungeon_music.h" +#include "dungeon_items.h" +#include "constants/dungeon.h" + +extern void sub_8045BF8(u8 *, Item *); +extern void sub_8067110(Entity *); +extern void sub_80671A0(Entity *); +extern bool8 sub_8044B28(void); #define NUM_POTENTIAL_ROCK_TARGETS 20 #define GROUND_ITEM_TOOLBOX_INDEX 0x80 @@ -40,6 +48,8 @@ EWRAM_DATA u32 gAIThrownItemProbabilities[NUM_DIRECTIONS] = {0}; extern TeamInventory *gTeamInventoryRef; +void sub_8073D14(Entity *); + void AIDecideUseItem(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); @@ -407,3 +417,167 @@ void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 ta gAIThrowItemActionChoiceCount++; } } + +void HandleEatAIAction(Entity *pokemon) +{ + sub_8067110(pokemon); +} + +void HandleThrowItemAIAction(Entity *pokemon) +{ + sub_80671A0(pokemon); +} + +void HandlePickUpAIAction(Entity *pokemon) +{ + sub_8073D14(pokemon); +} + +void sub_8073D14(Entity *entity) +{ + Item *groundItem; + EntityInfo *_entityInfo; + EntityInfo *entityInfo = GetEntInfo(entity); + Entity *tileObject = GetTileAtEntitySafe(entity)->object; + if (tileObject == NULL) + return; + if (sub_8044B28()) + return; + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + if (entityInfo->isTeamLeader) + return; + if (entityInfo->shopkeeper == 1) + return; + if (IsExperienceLocked(entityInfo->joinedAt.id)) + return; + if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) + return; + + _entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason. + groundItem = GetItemData(tileObject); + if (groundItem->flags & ITEM_FLAG_IN_SHOP) + return; + + if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) { + sub_8045BF8(gFormatBuffer_Items[0], groundItem); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + DisplayDungeonLoggableMessageTrue(entity, gMonTerrifiedCouldntPickUpItem); + } + else if (!_entityInfo->isNotTeamMember && GetItemCategory(groundItem->id) == CATEGORY_POKE) { + // Why check the same thing again? + if (_entityInfo->isNotTeamMember) { + PlaySoundEffect(0x14B); + } + else { + PlaySoundEffect(0x14C); + } + AddToTeamMoney(GetMoneyValue(groundItem)); + sub_8045BF8(gFormatBuffer_Items[0], groundItem); + RemoveItemFromDungeonAt(&entity->pos, 1); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem); + } + else { + s32 i, nItems, newInventoryId; + s32 inventoryIds[INVENTORY_SIZE + 1]; // plus held + Item *carriedItems[INVENTORY_SIZE + 1]; // plus held + s32 newQuantity; + + if (gDungeon->unk644.hasInventory && !_entityInfo->isNotTeamMember) { + for (i = 0; i < INVENTORY_SIZE; i++) { + carriedItems[i] = &gTeamInventoryRef->teamItems[i]; + inventoryIds[i] = i; + } + carriedItems[INVENTORY_SIZE] = &_entityInfo->heldItem; + inventoryIds[INVENTORY_SIZE] = -1; + nItems = INVENTORY_SIZE + 1; + } + else { + carriedItems[0] = &_entityInfo->heldItem; + inventoryIds[0] = -1; + nItems = 1; + } + + if ((groundItem->id < 9) && !(groundItem->flags & ITEM_FLAG_IN_SHOP)) { + newInventoryId = -1; + newQuantity = -1; + for (i = 0; i < nItems; i++) { + if (carriedItems[i]->flags & ITEM_FLAG_EXISTS + && !(carriedItems[i]->flags & ITEM_FLAG_IN_SHOP) + && ((groundItem->id == carriedItems[i]->id) && (groundItem->flags & ITEM_FLAG_STICKY) == (carriedItems[i]->flags & ITEM_FLAG_STICKY)) + && carriedItems[i]->quantity != 99 && newQuantity < carriedItems[i]->quantity) + { + newQuantity = carriedItems[i]->quantity; + newInventoryId = i; + } + } + + if (newInventoryId == -1) { + newQuantity = -1; + for (i = 0; i < nItems; i++) { + if (carriedItems[i]->flags & ITEM_FLAG_EXISTS + && !(carriedItems[i]->flags & ITEM_FLAG_IN_SHOP) + && groundItem->id == carriedItems[i]->id + && carriedItems[i]->quantity != 99 + && newQuantity < carriedItems[i]->quantity) + { + newQuantity = carriedItems[i]->quantity; + newInventoryId = i; + } + } + } + + if (newInventoryId != -1) { + s32 quantity = carriedItems[newInventoryId]->quantity + groundItem->quantity; + if (quantity >= 99) + quantity = 99; + carriedItems[newInventoryId]->quantity = quantity; + if (groundItem->flags & ITEM_FLAG_STICKY) + carriedItems[newInventoryId]->flags |= ITEM_FLAG_STICKY; + + sub_8045BF8(gFormatBuffer_Items[0], groundItem); + RemoveItemFromDungeonAt(&entity->pos, 1); + PlaySoundEffect(0x14A); + if (inventoryIds[newInventoryId] <= -1) + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); + else + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItemToolbox); + + return; + } + } + + for (i = 0; i < nItems; i++) { + if (!(carriedItems[i]->flags & ITEM_FLAG_EXISTS)) + break; + } + + if (i == nItems) { + sub_8045BF8(gFormatBuffer_Items[0], groundItem); + DisplayDungeonLoggableMessageTrue(entity, gMonSteppedOnItem); + } + else { + if (_entityInfo->isNotTeamMember) { + PlaySoundEffect(0x14B); + } + else { + PlaySoundEffect(0x14A); + } + + if (inventoryIds[i] <= -1) { + _entityInfo->heldItem = *groundItem; + sub_8045BF8(gFormatBuffer_Items[0], groundItem); + RemoveItemFromDungeonAt(&entity->pos, 1); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); + } + else if (AddItemToInventory(groundItem)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + DisplayDungeonLoggableMessageTrue(entity, gMonCouldntPickUpItem); + } + else { + sub_8045BF8(gFormatBuffer_Items[0], groundItem); + RemoveItemFromDungeonAt(&entity->pos, 1); + DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItemToolbox); + } + } + } +} diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index b177210cf..3aa31bb59 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -1,96 +1,12 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_ai_leader.h" -#include "charge_move.h" -#include "code_803E46C.h" -#include "code_8041AD0.h" -#include "code_804267C.h" -#include "code_8045A00.h" -#include "code_8066D04.h" -#include "dungeon_message.h" -#include "code_8077274_1.h" -#include "code_807CD9C.h" -#include "constants/dungeon_action.h" -#include "constants/dungeon.h" -#include "constants/iq_skill.h" -#include "constants/item.h" -#include "constants/move_id.h" #include "constants/status.h" #include "constants/targeting.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" -#include "dungeon_items.h" +#include "dungeon_logic.h" #include "dungeon_leader.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_random.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" -#include "move_util.h" -#include "moves.h" #include "pokemon_3.h" -#include "pokemon.h" -#include "status.h" -#include "status_checks_1.h" -#include "trap.h" -#include "dungeon_config.h" -#include "dungeon_misc.h" - -extern u8 gUnknown_202F221; -extern u8 gUnknown_202F222; -extern u8 gUnknown_202F32C; -extern u8 gUnknown_202F32D; -extern u8 gUnknown_203B434; - -extern u8 *gUnknown_80FA5B4[]; -extern u8 *gUnknown_80FCF50[]; -extern u8 *gUnknown_80FCF38[]; -extern u8 *gUnknown_80FD2CC[]; -extern u8 *gUnknown_80FE478[]; -extern u8 *gUnknown_80FE6D4[]; - -void sub_8075BA4(Entity *param_1, u8 param_2); -void sub_804178C(u8 param_1); -void nullsub_95(Entity *); -bool8 IsNotAttacking(Entity *, bool8); -extern void sub_80671A0(Entity *); -extern void sub_8067110(Entity *); -void HandleUseMoveAIAction(Entity *target); -void sub_8041888(u8 param_1); -void sub_8085140(void); -void sub_807360C(void); -void sub_805EFB4(Entity *, u8); -void sub_8074FB0(Entity *, u8, DungeonPos *); - -void HandlePlaceItemAction(Entity *); -void HandlePickUpPlayerAction(Entity *); -void sub_8066E14(Entity * ); -void sub_807348C(void); -void sub_80732F0(void); -void sub_8066BD4(Entity*); -void HandleTalkFieldAction(Entity *); -void HandleUseMovePlayerAction(Entity *); -void HandleUseOrbAction(Entity *); -void sub_8067904(Entity *, u32); -void HandleGiveItemAction(Entity *); -void HandleTakeItemAction(Entity *); -void HandleUseItemAction(Entity *); -void sub_8066FA4(Entity *); -void HandleUnsetItemAction(Entity *,bool8); -extern u8 sub_8044B28(void); -extern u8 UseAttack(Entity *); -void sub_806A1E8(Entity *pokemon); -bool8 sub_804AE08(DungeonPos *pos); -void HandlePickUpAIAction(Entity *pokemon); -void HandleThrowItemAIAction(Entity *pokemon); -void HandleEatAIAction(Entity *pokemon); -bool8 sub_8044B84(void); -extern void sub_8074094(Entity *); -extern void sub_8071DA4(Entity *); -u32 sub_8075818(Entity *entity); -extern void MarkLastUsedMonMove(Entity *entity, Move *move); -bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move); -extern void sub_80838EC(u8 *a); - bool8 TargetLeader(Entity *pokemon) { @@ -117,421 +33,3 @@ Entity* GetLeaderIfVisible(Entity *pokemon) return NULL; } -bool8 sub_8072CF4(Entity *entity) -{ - bool8 bVar4; - bool8 bVar5; - Move *move; - s32 index; - EntityInfo *info; - bool8 bVar14; - DungeonPos pos; - DungeonPos pos1; - - sub_804178C(1); - gUnknown_203B434 = 1; - info = GetEntInfo(entity); - info->useHeldItem = FALSE; - info->unkF3 = FALSE; - gDungeon->unkB8 = entity; - if (gUnknown_80F58F4[(info->action).action][0] != 0) { - if (info->isTeamLeader) { - sub_805EFB4(entity,gUnknown_80F58F4[(info->action).action][1]); - } - else { - sub_8075BA4(entity,gUnknown_80F58F4[(info->action).action][1]); - } - } - if ((CannotAttack(entity, FALSE)) && (IsChargingAnyTwoTurnMove(entity, TRUE))) { - sub_8079764(entity); - } - - for(index = 0; index < MAX_MON_MOVES; index++) - { - move = &info->moves.moves[index]; - if ((move->moveFlags & MOVE_FLAG_EXISTS)) { - move->moveFlags2 &= ~(MOVE_FLAG2_UNK4); - } - } - if (!IsNotAttacking(entity, FALSE)) { - if (UseAttack(entity)) { - if (sub_8044B28()) { - return FALSE; - } - if (!EntityIsValid(entity)) { - return FALSE; - } - if (gUnknown_202F32D != 0) { - return TRUE; - } - } - if (!info->isTeamLeader) { - sub_8052740(10); - } - sub_806A1E8(entity); - DungeonRunFrameActions(10); - } - if (((ACTION_PASS_TURN < info->action.action) && (info->action.action != 4)) && (info->action.action != ACTION_WALK)) { - info->attacking = TRUE; - } - bVar14 = FALSE; - info->unk14A = 0; - gUnknown_202F221 = 0; - gUnknown_202F222 = 0; - switch(info->action.action) { - case ACTION_WALK: - if(info->frozenClassStatus.status == STATUS_SHADOW_HOLD) - { - goto _282; - } - else if(info->frozenClassStatus.status == STATUS_CONSTRICTION) - { - goto _282; - } - else if(info->frozenClassStatus.status == STATUS_INGRAIN) - { - goto _282; - } - else if(info->frozenClassStatus.status == STATUS_WRAP) - { - goto _282; - } - else if(info->frozenClassStatus.status == STATUS_WRAPPED) - { - _282: - info->action.action = ACTION_NOTHING; - info->waiting = TRUE; - } - else { - bVar5 = FALSE; - pos1.x = (entity->pos).x + gAdjacentTileOffsets[(info->action).direction].x; - pos1.y = (entity->pos).y + gAdjacentTileOffsets[(info->action).direction].y; - if ((!(info->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) && - (!CanMoveInDirection(entity,(info->action).direction))) { - bVar5 = TRUE; - } - if (bVar5) { - info->action.action = ACTION_NOTHING; - info->waiting = TRUE; - break; - } - else - { - pos.x = entity->pos.x; - pos.y = entity->pos.y; - sub_80694C0(entity,pos1.x,pos1.y,0); - sub_8074FB0(entity,(info->action).direction,&pos); - if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->invisibleClassStatus.status != STATUS_MOBILE)) && - (!HasHeldItem(entity,ITEM_MOBILE_SCARF))) { - sub_804AE08(&entity->pos); - } - bVar14 = TRUE; - break; - } - } - break; - case ACTION_USE_MOVE_AI: - HandleUseMoveAIAction(entity); - break; - case ACTION_STAIRS: - if ((gDungeon->unk644.dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! - } - else - { - PlayStairsSound(); - gDungeon->unk2 = 1; - gUnknown_202F32C = (info->action).direction; - } - break; - case ACTION_EAT_BERRY_SEED_DRINK: - case 0xe: - case ACTION_USE_TM: - sub_8067110(entity); - break; - case ACTION_USE_ORB: - HandleUseOrbAction(entity); - break; - case ACTION_PICK_UP_PLAYER: - HandlePickUpPlayerAction(entity); - break; - case ACTION_GIVE_ITEM: - HandleGiveItemAction(entity); - break; - case ACTION_TAKE_ITEM: - HandleTakeItemAction(entity); - break; - case 0x3e: - sub_8066BD4(entity); // ITEM_SWITCH_TOOLBOX (When you switch item in Toolbox) - break; - case ACTION_USE_ITEM: - HandleUseItemAction(entity); - break; - case ACTION_SET_ITEM: - HandleSetItemAction(entity, TRUE); - break; - case ACTION_UNSET_ITEM: - HandleUnsetItemAction(entity, TRUE); - break; - case 0x3b: - gDungeon->unkBC = gDungeon->teamPokemon[(info->action).actionParameters[0].actionUseIndex]; - break; - case ACTION_PLACE_ITEM: - HandlePlaceItemAction(entity); - break; - case 10: // Switch with Item on Ground - sub_8066E14(entity); - break; - case 0x3a: // Switch with Item on Ground (also??) - sub_8066FA4(entity); - break; - case ACTION_THROW_ITEM_PLAYER: - case ACTION_THROW_STRAIGHT_PLAYER: - case ACTION_THROW_ARC_PLAYER: - if (MonsterCanThrowItems(info)) { - nullsub_95(entity); - sub_80671A0(entity); - break; - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE6D4); - break; - case ACTION_TALK_FIELD: - HandleTalkFieldAction(entity); - break; - case ACTION_USE_MOVE_PLAYER: - HandleUseMovePlayerAction(entity); - break; - case ACTION_STRUGGLE: - sub_8067904(entity, MOVE_STRUGGLE); - break; - case ACTION_REGULAR_ATTACK: - sub_8067904(entity, MOVE_REGULAR_ATTACK); - break; - case ACTION_STEPPED_ON_TRAP: - HandleTrap(entity,&entity->pos,0,0); - break; - case ACTION_PICK_UP_AI: - HandlePickUpAIAction(entity); - break; - case ACTION_EAT_AI: - HandleEatAIAction(entity); - break; - case ACTION_THROW_ITEM_AI: - HandleThrowItemAIAction(entity); - break; - case ACTION_SECOND_THOUGHTS: - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE478); - break; - default: - info->action.action = ACTION_PASS_TURN; - break; - } - sub_807FD84(entity); - if (EntityIsValid(entity)) { - if (GetEntInfo(entity)->unk14A == 0) { - GetEntInfo(entity)->unk14A = 0; - sub_8079764(entity); - } - sub_8041888(0); - if (EntityIsValid(entity)) { - sub_8085140(); - if (info->unk14B != 0) { - bVar4 = FALSE; - info->unk14B = 0; - - for(index = 0; index < MAX_MON_MOVES; index++) - { - move = &info->moves.moves[index]; - if ((info->moves.moves[index].moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags & MOVE_FLAG_LAST_USED)) { - move->PP = 0; - bVar4 = TRUE; - } - } - if (bVar4) { - LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FD2CC); - } - } - sub_807360C(); - if (!sub_8044B84()) { - sub_807348C(); - sub_80732F0(); - if (!EntityIsValid(entity)) { - return FALSE; - } - } - if (bVar14) { - sub_8075818(entity); - } - if (EntityIsValid(entity)) { - if (!sub_8044B84()) { - sub_8046D20(); - } - sub_8041888(0); - if (((EntityIsValid(entity)) && (!info->aiAllySkip)) && (!bVar14)) { - if (sub_80706A4(entity,&entity->pos) != '\0') { - WarpTarget(entity,entity,0,0); - } - sub_8074094(entity); - sub_8071DA4(entity); - } - } - } - } - return FALSE; -} - - -void sub_80732F0(void) -{ - s32 index; - Entity *entity; - EntityInfo *info; - s32 moveIndex; - s32 counter; - s32 otherIndex; - u8 flag; - Move *move; - Move *move2; - Move moveStack; - u8 sl; - - for(index = 0; index < DUNGEON_MAX_POKEMON; index++){ - flag = FALSE; - entity = gDungeon->activePokemon[index]; - if(EntityIsValid(entity)){ - info = GetEntInfo(entity); - if(info->unk164 != 0xFF){ - sl = info->unk164; - if(CannotAttack(entity, TRUE)){ - info->unk164 |= 0xFF; - } - else if(!IsSleeping(entity)){ - info->unk164 |= 0xFF; - } - else if(info->muzzled.muzzled == TRUE){ - info->unk164 |= 0xFF; - } - else{ - moveIndex = DungeonRandInt(MAX_MON_MOVES); - for(counter = 0; counter < MAX_MON_MOVES; counter++){ - move = &info->moves.moves[moveIndex]; - if(MoveFlagExists(move)){ - moveStack = *move; - if(moveStack.id == MOVE_SKETCH) - goto _increase; - if(moveStack.id == MOVE_MIMIC) - goto _increase; - for(otherIndex = 0; otherIndex < MAX_MON_MOVES; otherIndex++){ - move2 = &info->moves.moves[otherIndex]; - if(MoveFlagExists(move2)){ - if(!info->isTeamLeader){ - if(!(move2->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) continue; - } - if(move2->id == MOVE_SLEEP_TALK){ - if(CanMonsterUseMove(entity, move2, TRUE)) - { - sub_80838EC(&move2->PP); - break; - } - } - } - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); - LogMessageByIdWithPopupCheckUser(entity, *gUnknown_80FCF38); // {ARG_POKEMON_0} uttered its sleep talk! - info->action.direction = sl & DIRECTION_MASK; - TryUseChosenMove(entity, 0, ITEM_NOTHING, 1, FALSE, &moveStack); - flag = TRUE; - break; - - } - else - { -_increase: - moveIndex++; - if(moveIndex == MAX_MON_MOVES) - moveIndex = 0; - } - } - info->unk164 |= 0xFF; - if(flag) - sub_80421C0(entity, 0x2E0); - } - } - } - } -} - -void sub_807348C(void) -{ - int index; - s32 moveIndex; - Move *move; - EntityInfo *info; - Entity *pokemon; - Move chosenMove; - u8 r8; - - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - pokemon = gDungeon->activePokemon[index]; - if (EntityIsValid(pokemon)) { - info = GetEntInfo(pokemon); - if (info->unk165 != 0xff) { - r8 = info->unk165; - if (CannotAttack(pokemon,TRUE)) { - info->unk165 |= 0xff; - info->unk164 |= 0xff; - } - else if (!IsSleeping(pokemon)) { - info->unk165 |= 0xff; - info->unk164 |= 0xff; - } - else if (info->muzzled.muzzled == TRUE) { - info->unk165 |= 0xff; - info->unk164 |= 0xff; - } - else { - for(moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) - { - move = &info->moves.moves[moveIndex]; - if (((MoveFlagExists(move)) && - ((info->isTeamLeader || (move->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) && move->id == MOVE_SNORE)) && - (CanMonsterUseMove(pokemon,move,TRUE))) { - chosenMove = *move; - sub_80838EC(&move->PP); - MarkLastUsedMonMove(pokemon,move); - break; - } - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FCF50); - info->action.direction = r8 & DIRECTION_MASK; - TryUseChosenMove(pokemon,0,ITEM_NOTHING,1,FALSE,&chosenMove); - info->unk165 |= 0xff; - info->unk164 |= 0xff; - } - } - } - } -} - -void sub_807360C(void) -{ - s32 index; - Entity *entity; - - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) - { - entity = gDungeon->activePokemon[index]; - if(EntityIsValid(entity)) - { - if(GetEntInfo(entity)->unk152 != 0) - { - GetEntInfo(entity)->unk152 = 0; - UpdateFlashFireBoost(entity, entity); - } - } - } -} - diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index 9ca27b3f2..edc07dca0 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "dungeon_ai_movement.h" #include "constants/direction.h" @@ -8,16 +9,12 @@ #include "constants/tactic.h" #include "dungeon_action.h" #include "dungeon_ai_leader.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" +#include "dungeon_logic.h" #include "structs/str_dungeon.h" #include "dungeon_map_access.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" #include "dungeon_range.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "structs/map.h" #include "number_util.h" #include "position_util.h" @@ -41,7 +38,7 @@ struct CanMoveInDirectionInfo s32 direction; }; -const s32 gFaceDirectionIncrements[] = {0, 1, -1, 2, -2, 3, -3, 4, 0, -1, 1, -2, 2, -3, 3, 4}; +extern const s32 gFaceDirectionIncrements[]; void AIMovement(Entity *pokemon, bool8 showRunAwayEffect) { diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c deleted file mode 100644 index ab8563072..000000000 --- a/src/dungeon_ai_targeting.c +++ /dev/null @@ -1,556 +0,0 @@ -#include "global.h" -#include "dungeon_ai_targeting.h" - -#include "constants/ability.h" -#include "constants/dungeon.h" -#include "constants/iq_skill.h" -#include "constants/item.h" -#include "constants/status.h" -#include "constants/tactic.h" -#include "constants/targeting.h" - -#include "dungeon_engine.h" -#include "structs/str_dungeon.h" -#include "dungeon_items.h" -#include "dungeon_map_access.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_random.h" -#include "dungeon_util.h" -#include "structs/map.h" -#include "tile_types.h" - -extern void ShowVisualFlags(Entity *r0); - -const u8 gDirectionBitMasks_2[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; -const u8 gDirectionBitMasks_3[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; -const u8 gDirectionBitMasks_4[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; -const u8 gDirectionBitMasks_5[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; -const u8 gDirectionBitMasks_6[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; -const u8 gDirectionBitMasks_7[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; - -const u8 gTreatmentData[3][2][2][2] = { - { - { - {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE}, - {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE} - }, - { - {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE}, - {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE} - } - }, - { - { - {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE}, - {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE} - }, - { - {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY}, - {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY} - } - }, - { - { - {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY}, - {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY} - }, - { - {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE}, - {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE} - } - } -}; - -bool8 sub_8070F3C(Entity * pokemon, DungeonPos *pos, s32 direction) -{ - u8 terrain; - const Tile *tile; - - terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - - tile = GetTile(pos->x + gAdjacentTileOffsets[direction].x, pos->y + gAdjacentTileOffsets[direction].y); - if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && - (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { - if (!IsCurrentFixedRoomBossFight()) - { - if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || - HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - { - terrain = CROSSABLE_TERRAIN_WALL; - } - else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) - { - // BUG: If the Pokémon is a Ghost type that can normally attack through walls, - // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. - terrain = CROSSABLE_TERRAIN_CREVICE; - } - else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) - { - if ((direction & 1) != 0) - { - terrain = CROSSABLE_TERRAIN_CREVICE; - } - else - { - terrain = CROSSABLE_TERRAIN_WALL; - } - } - } - - tile = GetTile(pos->x, pos->y); - - if (((tile->walkableNeighborFlags[terrain] & gDirectionBitMasks_2[direction & DIRECTION_MASK]))) { - return TRUE; - } - } - return FALSE; -} - -bool8 sub_8070F14(Entity * pokemon, s32 direction) -{ - const Tile *tile; - - - tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); - if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && - (((tile->monster == NULL)))) { - - tile = GetTile(pokemon->pos.x, pokemon->pos.y); - - if (((tile->walkableNeighborFlags[0] & gDirectionBitMasks_3[direction & DIRECTION_MASK]))) { - return TRUE; - } - } - return FALSE; -} - -bool8 sub_8070F80(Entity * pokemon, s32 direction) -{ - u8 terrain; - const Tile *tile; - - terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - - tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); - if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && - (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { - if (!IsCurrentFixedRoomBossFight()) - { - if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || - HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - { - terrain = CROSSABLE_TERRAIN_WALL; - } - else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) - { - // BUG: If the Pokémon is a Ghost type that can normally attack through walls, - // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. - terrain = CROSSABLE_TERRAIN_CREVICE; - } - else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) - { - if ((direction & 1) != 0) - { - terrain = CROSSABLE_TERRAIN_CREVICE; - } - else - { - terrain = CROSSABLE_TERRAIN_WALL; - } - } - } - - tile = GetTile(pokemon->pos.x, pokemon->pos.y); - - if (((tile->walkableNeighborFlags[terrain] & gDirectionBitMasks_4[direction & DIRECTION_MASK]))) { - return TRUE; - } - } - return FALSE; -} - -bool8 sub_8071058(Entity * pokemon, s32 direction) -{ - u8 terrain; - const Tile *tile; - - terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - - tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); - if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && - (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER)) || - (!GetEntInfo(tile->monster)->isNotTeamMember)))) { - if (!IsCurrentFixedRoomBossFight()) - { - if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || - HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - { - terrain = CROSSABLE_TERRAIN_WALL; - } - else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) - { - // BUG: If the Pokémon is a Ghost type that can normally attack through walls, - // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. - terrain = CROSSABLE_TERRAIN_CREVICE; - } - else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) - { - if ((direction & 1) != 0) - { - terrain = CROSSABLE_TERRAIN_CREVICE; - } - else - { - terrain = CROSSABLE_TERRAIN_WALL; - } - } - } - tile = GetTile(pokemon->pos.x, pokemon->pos.y); - - if (((tile->walkableNeighborFlags[terrain] & gDirectionBitMasks_5[direction & DIRECTION_MASK]))) { - return TRUE; - } - } - return FALSE; -} - -bool8 CanAttackInDirection(Entity *pokemon, s32 direction) -{ - u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - const Tile *tile; - if (crossableTerrain < CROSSABLE_TERRAIN_CREVICE) - { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, - pokemon->pos.y + gAdjacentTileOffsets[direction].y); - if (!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) && - (tile->monster == NULL || GetEntityType(tile->monster) == ENTITY_MONSTER)) - { - if (!IsCurrentFixedRoomBossFight()) - { - if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || - HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) - { - // BUG: If the Pokémon is a Ghost type that can normally attack through walls, - // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) - { - if ((direction & 1) != 0) - { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - else - { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - } - } - tile = GetTile(pokemon->pos.x, pokemon->pos.y); - if (tile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_6[direction & DIRECTION_MASK]) - { - return TRUE; - } - } - return FALSE; -} - -bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemonInFront) -{ - u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - const Tile *currentTile; - const Tile *frontTile; - *pokemonInFront = FALSE; - frontTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, - pokemon->pos.y + gAdjacentTileOffsets[direction].y); - if (frontTile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) - { - return FALSE; - } - if (frontTile->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE && - !gDungeon->unk644.monsterHouseTriggered && - IQSkillIsEnabled(pokemon, IQ_HOUSE_AVOIDER)) - { - return FALSE; - } - if (frontTile->object != NULL && - IQSkillIsEnabled(pokemon, IQ_TRAP_AVOIDER) && - GetEntityType(frontTile->object) == ENTITY_TRAP && - (frontTile->object->isVisible || GetEntInfo(pokemon)->blinkerClassStatus.status == STATUS_EYEDROPS)) - { - return FALSE; - } - if ((frontTile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY && - gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA && - IQSkillIsEnabled(pokemon, IQ_LAVA_EVADER)) - { - return FALSE; - } - if (!IsCurrentFixedRoomBossFight()) - { - if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || - HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) - { - // BUG: If the Pokémon is a Ghost type that can normally move through walls, - // All-Terrain Hiker/Super Mobile may make the AI think it can't move through walls. - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) - { - if ((direction & 1) != 0) - { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - else - { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - } - } - currentTile = GetTile(pokemon->pos.x, pokemon->pos.y); - if (currentTile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_7[direction & DIRECTION_MASK]) - { - if (frontTile->monster == NULL) - { - return TRUE; - } - else - { - *pokemonInFront = TRUE; - } - } - return FALSE; -} - -bool8 IsAtJunction(Entity *pokemon) -{ - u32 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - if (!IsCurrentFixedRoomBossFight()) - { - if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) - { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) - { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - } - if (crossableTerrain == CROSSABLE_TERRAIN_WALL) - { - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - pokemonInfo->mobileTurnTimer += DungeonRandInt(100); - if (pokemonInfo->mobileTurnTimer < 200) - { - return FALSE; - } - else - { - pokemonInfo->mobileTurnTimer = 0; - } - } - else - { - const Tile *mapTile; - char walkableNeighborFlags; - if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA - && crossableTerrain == CROSSABLE_TERRAIN_LIQUID - && IQSkillIsEnabled(pokemon, IQ_LAVA_EVADER)) - { - crossableTerrain = CROSSABLE_TERRAIN_REGULAR; - } - mapTile = GetTile(pokemon->pos.x, pokemon->pos.y); - walkableNeighborFlags = mapTile->walkableNeighborFlags[crossableTerrain]; - /* - Check for configurations of open tiles that are considered junctions; i.e., shaped like a 'T' or '+'. - X=Wall, O=Open - - 0x54 0x51 0x45 0x15 0x55 - XOX XOX XXX XOX XOX - OOO OOX OOO XOO OOO - XXX XOX XOX XOX XOX - */ - if (walkableNeighborFlags != 0x54 && walkableNeighborFlags != 0x51 && walkableNeighborFlags != 0x45 && walkableNeighborFlags != 0x15 && walkableNeighborFlags != 0x55) - { - return FALSE; - } - } - return TRUE; -} - -bool8 ShouldAvoidFirstHit(Entity *pokemon, bool8 forceAvoid) -{ - if (!IsTacticSet(pokemon, TACTIC_AVOID_THE_FIRST_HIT)) - return FALSE; - if (!forceAvoid) - return FALSE; - return TRUE; -} - -bool8 ShouldMonsterRunAway(Entity *pokemon) -{ - if (!EntityIsValid(pokemon)) - { - return FALSE; - } - else - { - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->terrifiedTurns != 0) - { - return TRUE; - } - if (pokemonInfo->isTeamLeader) - { - return FALSE; - } - if (AbilityIsActive(pokemon, ABILITY_RUN_AWAY)) - { - bool8 runAwayActive = pokemonInfo->HP < pokemonInfo->maxHPStat / 2; - if (runAwayActive) - { - return TRUE; - } - } - if (IsTacticSet(pokemon, TACTIC_GET_AWAY) || - (IsTacticSet(pokemon, TACTIC_AVOID_TROUBLE) && pokemonInfo->HP <= pokemonInfo->maxHPStat / 2)) - { - return TRUE; - } - return FALSE; - } -} - -bool8 ShouldMonsterRunAwayAndShowEffect(Entity *pokemon, bool8 showRunAwayEffect) -{ - if (ShouldMonsterRunAway(pokemon)) - { - CheckRunAwayVisualFlag(pokemon, showRunAwayEffect); - return TRUE; - } - return FALSE; -} - -void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect) -{ - bool8 cVar1; - EntityInfo *iVar2; - iVar2 = GetEntInfo(pokemon); - - if (((!iVar2->isTeamLeader) && AbilityIsActive(pokemon,ABILITY_RUN_AWAY) && - (cVar1 = SetVisualFlags(iVar2,4,iVar2->HP <= iVar2->maxHPStat / 2), showRunAwayEffect)) && - (cVar1)) { - ShowVisualFlags(pokemon); - } -} - -u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - EntityInfo *targetData = GetEntInfo(targetPokemon); - u8 decoyAITracker; - u8 pokemonTargetingDecoy; - bool8 pokemonIsEnemy; - bool8 targetIsEnemy; - bool8 targetIsDecoy; - if (pokemon == targetPokemon) - { - return TREATMENT_TREAT_AS_ALLY; - } - if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || - targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || - pokemonInfo->monsterBehavior == BEHAVIOR_DIGLETT || - targetData->monsterBehavior == BEHAVIOR_DIGLETT || - pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || - targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET || - (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->frozenClassStatus.status == STATUS_PETRIFIED) || - (!ignoreInvisible && targetData->invisibleClassStatus.status == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) - { - return TREATMENT_IGNORE; - } - pokemonTargetingDecoy = pokemonInfo->decoyAITracker; - decoyAITracker = DECOY_AI_NONE; - if (pokemonTargetingDecoy != DECOY_AI_NONE) - { - decoyAITracker = DECOY_AI_WILD; - if (pokemonTargetingDecoy == DECOY_AI_TEAM) - { - decoyAITracker = DECOY_AI_TEAM; - } - } - if (pokemonInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL) - { - pokemonIsEnemy = FALSE; - if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_ATTACK_TEAM) - { - pokemonIsEnemy = TRUE; - } - } - else - { - pokemonIsEnemy = pokemonInfo->isNotTeamMember ? TRUE : FALSE; - } - if (targetData->shopkeeper != SHOPKEEPER_MODE_NORMAL) - { - targetIsEnemy = FALSE; - if (targetData->shopkeeper == SHOPKEEPER_MODE_ATTACK_TEAM) - { - targetIsEnemy = TRUE; - } - } - else - { - targetIsEnemy = targetData->isNotTeamMember ? TRUE : FALSE; - } - targetIsDecoy = FALSE; - if (targetData->curseClassStatus.status == STATUS_DECOY) - { - targetIsDecoy = TRUE; - } - return gTreatmentData[decoyAITracker][pokemonIsEnemy][targetIsEnemy][targetIsDecoy]; -} - -u8 sub_807167C(Entity * pokemon, Entity * target) -{ - bool8 cannotUseItems; - EntityInfo * targetEntityInfo; - EntityInfo * pokemonEntityData; - - pokemonEntityData = GetEntInfo(pokemon); - targetEntityInfo = GetEntInfo(target); - if (pokemonEntityData->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { - cannotUseItems = IsExperienceLocked(pokemonEntityData->joinedAt.id); - if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET)) { - cannotUseItems = IsExperienceLocked(targetEntityInfo->joinedAt.id); - if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) { -error: - return TREATMENT_IGNORE; - } - else - { - if ((pokemonEntityData->isNotTeamMember) != (targetEntityInfo->isNotTeamMember)) { - return TREATMENT_TREAT_AS_ENEMY; - } - else { - return TREATMENT_TREAT_AS_ALLY; - } - } - } - } - goto error; -} diff --git a/src/dungeon_boss_dialogue.c b/src/dungeon_boss_dialogue.c new file mode 100644 index 000000000..fca7f7ac8 --- /dev/null +++ b/src/dungeon_boss_dialogue.c @@ -0,0 +1,3167 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_boss_dialogue.h" +#include "constants/monster.h" + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_1 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Look, {POKEMON_0}!\n{POKEMON_2}'s over there!") +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_2[] = { + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Hey! Are you all right?\nWe're here to rescue you!"), + }, + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hey! Are you all right?\nWe've come to rescue you!"), + }, +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_DIGLETT, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...I...\nI'm scared."), +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SKARMORY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You!\nWhat do you think you're doing here?!"), +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_5[] = { + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" We came to rescue\n{POKEMON_2}!{EXTRA_MSG} Hey, {POKEMON_3}!\nQuit doing this, and release {POKEMON_2}!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" We're here to rescue\n{POKEMON_2}!{EXTRA_MSG} {POKEMON_3}!\nDon't do this! Release {POKEMON_2}!"), + }, +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_6 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SKARMORY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" How dare you!{WAIT_PRESS}\nIt's their fault!{EXTRA_MSG} I haven't slept in days\nbecause the earthquakes frighten me so!\nEvery night we had them!{EXTRA_MSG} Those earthquakes are\ncaused by this brat's ilk running wild\nunderground!"), +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_7[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Whoa, that's not true.{EXTRA_MSG} Sure there've been quakes\ngalore lately...{EXTRA_MSG} But it would take more than\n{POKEMON_2}'s family running wild under\nthe ground to set off a quake."), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" That's not true.{EXTRA_MSG}Well, it's true there have\nbeen many earthquakes lately, but...{EXTRA_MSG} It would take more than\n{POKEMON_2}'s family going wild under\nthe ground to cause earthquakes."), + }, +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_8 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SKARMORY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You be quiet!{EXTRA_MSG}We'll fight if you keep that up!"), +}; + +const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_9[] = { + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" It's useless.\n{POKEMON_3} is too steamed to talk\nreasonably.{EXTRA_MSG} We're going to have to\nfight!"), + }, + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" It's no good.\n{POKEMON_3} is too agitated to listen to\nreason.{EXTRA_MSG} We'll have to fight it out!"), + }, +}; + +const struct DungeonDialogueStruct gSkarmoryReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SKARMORY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You again?!\nPersistent pests!"), +}; + +const struct DungeonDialogueStruct gSkarmoryReFightDialogue_2 = { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Let {POKEMON_2} go!\n{POKEMON_3}!"), +}; + +const struct DungeonDialogueStruct gSkarmoryReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SKARMORY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I absolutely refuse!{EXTRA_MSG} If you want to complain so\nmuch, I'll give you a fight!"), +}; + +const struct DungeonDialogueStruct gUnknown_8100D3C = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go any farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_1[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" We've come pretty far\ninto this forest.{EXTRA_MSG} I wonder if {POKEMON_2} is\nahead..."), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Wow, we came quite a ways\ninto this forest.{EXTRA_MSG} I wonder if {POKEMON_2} is\nahead..."), + }, +}; + +const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hold it right there!"), +}; + +const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_GENGAR, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Keke!\nYou know who's going to get to\n{POKEMON_2} first? We are!{EXTRA_MSG} So, for you to go ahead...{WAIT_PRESS}\nWell, we can't let that happen."), +}; + +const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_4[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Wh-what...?{EXTRA_MSG} Hey, {POKEMON_3}!{WAIT_PRESS}\nWhy do you always try to mess with us?"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" Wh-what!{EXTRA_MSG} Hey, {POKEMON_3}!{WAIT_PRESS}\nWhy do you always mess with us?"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Wh-what?!{EXTRA_MSG} Now, hold on, {POKEMON_3}!{WAIT_PRESS}\nWhy do you always interfere with us?"), + }, +}; + +const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_5 = { + .type = 0, + .spriteId = 3, + .spritePlacementId = 12, + .speciesId = MONSTER_MEDICHAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Oh? Didn't we tell you?{WAIT_PRESS}\nOur aim is world domination〜♪ "), +}; + +const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_6 = { + .type = 0, + .spriteId = 2, + .spritePlacementId = 13, + .speciesId = MONSTER_EKANS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" {POKEMON_4}'s mama will\ngive us a generous reward...{EXTRA_MSG} And {POKEMON_4} will join\nus too...{WAIT_PRESS}\nThat brings us closer to our goal."), +}; + +const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_7 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_GENGAR, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Keke!\nAnd for that, your lot is in the way!{EXTRA_MSG} So sorry to say, but your\nparty's over right here and now!{EXTRA_MSG} Say good-bye, {POKEMON_1}!"), +}; + +const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_1[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Last time, this is where\n{POKEMON_3}'s gang appeared.{EXTRA_MSG} Did they find {POKEMON_2}\nalready, I wonder?"), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is where the {COLOR CYAN}Meanies{RESET}\nshowed up last time.{EXTRA_MSG} I wonder if {POKEMON_3}'s\nbunch already found {POKEMON_2}..."), + }, +}; + +const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_2[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Hah? It's {POKEMON_3}!{EXTRA_MSG} Why is {POKEMON_3}'s\ncrew coming after us?"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" Huh? It's {POKEMON_3}!{EXTRA_MSG} Why is the {POKEMON_3}\ngang following us?"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Huh? It's {POKEMON_3}!{EXTRA_MSG} Why is {POKEMON_3}'s gang\nfollowing us?"), + }, +}; + +const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_3 = { + .type = 0, + .spriteId = 3, + .spritePlacementId = 13, + .speciesId = MONSTER_GENGAR, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Y-you be quiet!{EXTRA_MSG} Right after we beat you last\ntime...{EXTRA_MSG} We got careless and wiped\nout too!"), +}; + +const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_4 = { + .type = 1, + .spriteId = 3, + .spritePlacementId = 13, + .speciesId = MONSTER_GENGAR, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Don't you laugh at me!{WAIT_PRESS}\nWhat makes you so high-and-mighty?{EXTRA_MSG} Whatever happens, we're\nnot going to lose to you amateurs!"), +}; + +const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_5 = { + .type = 0, + .spriteId = 2, + .spritePlacementId = 13, + .speciesId = MONSTER_GENGAR, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is it, {POKEMON_1}!\nYou're going down!"), +}; + +const struct DungeonDialogueStruct gUnknown_8101440 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}It's impossible to go any farther...{WAIT_PRESS}\n{CENTER_ALIGN}But there is nothing here.{EXTRA_MSG}{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gUnknown_81014B0[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" This is the mountain's peak..."), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is the summit..."), + }, +}; + +const struct DungeonDialogueStruct gUnknown_8101504[] = { + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Hey! {POKEMON_3}!\nWhere are you?!{EXTRA_MSG} We came to rescue\n{POKEMON_2}!\nShow yourself!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hey! {POKEMON_3}!\nWhere are you?!{EXTRA_MSG} We came to rescue\n{POKEMON_2}!\nCome out!"), + }, +}; + +const struct DungeonDialogueStruct gUnknown_81015A0 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gyaoooooooooh!\n "), +}; + +const struct DungeonDialogueStruct gUnknown_81015D4 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Waah!"), +}; + +const struct DungeonDialogueStruct gUnknown_81015E8 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I warned you!\nI have no mercy for meddlers!"), +}; + +const struct DungeonDialogueStruct gUnknown_8101624 = { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Not scared...{WAIT_PRESS}\nYou don't frighten me!"), +}; + +const struct DungeonDialogueStruct gUnknown_810165C[] = { + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Hey, {POKEMON_3}!\nLet {POKEMON_2} go!{EXTRA_MSG} A Pokémon rescue team!\nThat's what we are!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" Hey, {POKEMON_3}!\nRelease {POKEMON_2}!{EXTRA_MSG} We're a Pokémon rescue\nteam!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hey, {POKEMON_3}!\nWe demand you release {POKEMON_2}!{EXTRA_MSG} We're a Pokémon rescue\nteam!"), + }, +}; + +const struct DungeonDialogueStruct gUnknown_8101750 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You must be determined,\nto utter such words."), +}; + +const struct DungeonDialogueStruct gUnknown_810178C = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Then you shall answer..."), +}; + +const struct DungeonDialogueStruct gUnknown_81017B4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" To my great and righteous\nfury!"), +}; + +const struct DungeonDialogueStruct gZapdosReFightDialogue_1[] = { + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Hey, {POKEMON_3}!\nGuess who's back?!{EXTRA_MSG} Show yourself!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" Hey, {POKEMON_3}!\nWe're back!{EXTRA_MSG} Come out!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hey, {POKEMON_3}!\nWe're here again!{EXTRA_MSG} Show yourself!"), + }, +}; + +const struct DungeonDialogueStruct gZapdosReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" However often you may\nreturn...\nThe result will always be the same!"), +}; + +const struct DungeonDialogueStruct gZapdosReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You have no hope of\nwinning!"), +}; + +const struct DungeonDialogueStruct gZapdosReFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Prepare yourselves!"), +}; + +const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_1 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gyaoooooooooooh!\n "), +}; + +const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" So, you're back!"), +}; + +const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Since we last met, how\nmuch more have you furthered your team?"), +}; + +const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" How much stronger?"), +}; + +const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ZAPDOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Your power...{WAIT_PRESS}\nDemonstrate it for me!"), +}; + +const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_6 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The mountain's summit...{WAIT_PRESS}\n{CENTER_ALIGN}But there is no one here.{EXTRA_MSG}{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Is this it?\nIs this Mt. Blaze's summit?"), +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_2[] = { + { + .type = 0, + .spriteId = 2, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" This is one incredible place.{WAIT_PRESS}\nI know this is a volcano, but the amount\nof lava is way more than usual.{EXTRA_MSG} This might also be a part of\nthe natural disasters..."), + }, + { + .type = 0, + .spriteId = 2, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Wow. This is incredible.{WAIT_PRESS}\nI know it's a volcano, but the lava flow\nis much higher than normal.{EXTRA_MSG} This might also have a link\nto the natural calamities..."), + }, +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_3[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Yowch! It's wicked hot!{WAIT_PRESS}\nI feel like I'm burning up."), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Oogh! It's like a furnace!{WAIT_PRESS}\nI'm getting roasted!"), + }, +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_4[] = { + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 18, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" I don't want to be in a place\nthis wickedly bad.{EXTRA_MSG} Let's get through here quick."), + }, + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 18, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I don't want to spend any\ntime in a place this dangerous.{EXTRA_MSG} Let's get through this quick."), + }, +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Halt!"), +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_6[] = { + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Wh-what the...?!{EXTRA_MSG} Why did it turn dark like\nthat?!"), + }, + { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Huh, what?!{EXTRA_MSG} It suddenly turned dark!"), + }, +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_7 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I can hear the mountain's screams...{EXTRA_MSG} It is shrieking in pain...{EXTRA_MSG} Someone is causing Mt. Blaze to\nwrithe in agony!\nIs it you?!"), +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_8[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Hah?!{WAIT_PRESS}\nWe don't know what you mean!\nWe're not doing anything!{EXTRA_MSG} We just happened to be\ntraveling through here!{EXTRA_MSG} Who are you, anyway?{WAIT_PRESS}\nCome out!"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" Huh?!{WAIT_PRESS}\nYou've got it wrong!\nIt's not us!{EXTRA_MSG} We just happened to be\npassing through here!{EXTRA_MSG} Who are you, anyway?{WAIT_PRESS}\nShow yourself!\n "), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Huh?!{WAIT_PRESS}\nThat's wrong!\nWe're innocent!{EXTRA_MSG} We were just passing\nthrough!{EXTRA_MSG} Who are you, anyway?{WAIT_PRESS}\nShow yourself!"), + }, +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_9 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gyaaaaaaaaaaaa!\n "), +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_10 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" The mountain's rage is my rage!"), +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_11 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!\nThe warrior of fire am I!"), +}; + +const struct DungeonDialogueStruct gMoltresPreFightDialogue_12 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" There is no forgiving \nthose who befoul the mountain!\nEn garde!"), +}; + +const struct DungeonDialogueStruct gMoltresReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ............{WAIT_PRESS}\nMaybe {POKEMON_2} isn't around..."), +}; + +const struct DungeonDialogueStruct gMoltresReFightDialogue_2[] = { + { + .type = 0, + .spriteId = 1, + .spritePlacementId = 18, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Let's sneak through while\nwe can."), + }, + { + .type = 0, + .spriteId = 1, + .spritePlacementId = 18, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Let's slip by here while\nwe have the chance."), + }, +}; + +const struct DungeonDialogueStruct gMoltresReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You again!{EXTRA_MSG} There is no forgiving \nthose who torment the mountain!"), +}; + +const struct DungeonDialogueStruct gMoltresReFightDialogue_4[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" You've got us wrong!{WAIT_PRESS}\nWe're just..."), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" You don't understand!{WAIT_PRESS}\nWe're only..."), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Won't you listen?!{WAIT_PRESS}\nWe're only..."), + }, +}; + +const struct DungeonDialogueStruct gMoltresReFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Your words are\nmeaningless!\nEn garde!"), +}; + +const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Halt!{EXTRA_MSG} This is Mt. Blaze!{EXTRA_MSG} For you to venture to its\npeak, there can be but one reason!"), +}; + +const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You've come to challenge\nme!"), +}; + +const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" So be it!{WAIT_PRESS}\nI am the warrior of fire, {POKEMON_2}!"), +}; + +const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Have you what it takes to\ndefeat me when I am holding back nothing?"), +}; + +const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MOLTRES, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Show me!"), +}; + +const struct DungeonDialogueStruct gUnknown_810246C = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The mountain's summit...{WAIT_PRESS}\n{CENTER_ALIGN}But there is no one here.{EXTRA_MSG}{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_1[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" We've come pretty far into\nthe forest.{EXTRA_MSG} I think we'll be out if we\ncan get through this part.{WAIT_PRESS}\nIt shouldn't be long. Hang in there."), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" We sure have traveled far\ninto this forest.{EXTRA_MSG} I think we'll be out if we\ncan get through this part.{WAIT_PRESS}\nIt shouldn't be far. Let's keep going."), + }, +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ..............."), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_3 = { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...Huh?{WAIT_PRESS}\n{POKEMON_0}, did you just say something?"), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_4[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" ...I didn't think so.{EXTRA_MSG} A voice...?{WAIT_PRESS}\nI must've imagined it."), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...I didn't think so...{EXTRA_MSG} I thought I heard a voice...{WAIT_PRESS}\nI must have imagined it."), + }, +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ..................{EXTRA_MSG} ...Turn back.{EXTRA_MSG}You may not pass..."), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_6 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Who's there?!"), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_7 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You are forbidden to pass...{EXTRA_MSG} ...If you persist in trying to pass...{EXTRA_MSG} Then, so be it...{EXTRA_MSG} But only after you have defeated me!"), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_8 = { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Ow! It's too bright!{EXTRA_MSG} The ice around us is\nreflecting this light!"), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_9 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gyaaaaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_10 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nThe warder of ice!"), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_11 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Those that enter the forest\nI shall destroy with all my might!"), +}; + +const struct DungeonDialogueStruct gArticunoPreFightDialogue_12 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Let us begin!"), +}; + +const struct DungeonDialogueStruct gArticunoReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You may try all you like.\nBut you shall never pass!"), +}; + +const struct DungeonDialogueStruct gArticunoReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" If you so badly hope to\npass..."), +}; + +const struct DungeonDialogueStruct gArticunoReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Do so only if you can snatch\nvictory from me!"), +}; + +const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_1 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gyaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Your arrival in this frozen\nforest means only one thing...{EXTRA_MSG} You mean to challenge me!"), +}; + +const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nThe warder of ice!"), +}; + +const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Those that enter\nthe forest...\nI shall destroy with all my might!"), +}; + +const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ARTICUNO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" No matter who it may be!"), +}; + +const struct DungeonDialogueStruct gUnknown_8102A9C = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}This is the deepest part of the forest...{WAIT_PRESS}\n{CENTER_ALIGN}But there is no one here.{EXTRA_MSG}{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gUnknown_8102B10 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The mountain's summit...{WAIT_PRESS}\n{CENTER_ALIGN}But there is no one here.{EXTRA_MSG}{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_1 = { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Let's see...{WAIT_PRESS}\n...I wonder where we are?"), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_2[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" I know we've come pretty\nfar..."), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I'm certain we've come quite\nfar already..."), + }, +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_3 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Waaah!\nQu-quake!"), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_4[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" ...Whew!\nIt settled down."), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...Whew!\nIt's over."), + }, +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_5 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hey! {POKEMON_0}!\nOver there!"), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_6[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Hey!\nSnap out of it!"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hey!\nAre you OK?!"), + }, +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_7 = { + .type = 0, + .spriteId = 3, + .spritePlacementId = 14, + .speciesId = MONSTER_CHARIZARD, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Urrrrgh..."), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_8[] = { + { + .type = 0, + .spriteId = 5, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" What happened here?"), + }, + { + .type = 0, + .spriteId = 5, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" What happened to you?"), + }, +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_9 = { + .type = 0, + .spriteId = 3, + .spritePlacementId = 14, + .speciesId = MONSTER_CHARIZARD, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" We challenged...\n{POKEMON_2}...{WAIT_PRESS}\nAnd wiped out...\n"), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_10 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" G-{POKEMON_2}?!"), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_11 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 15, + .speciesId = MONSTER_TYRANITAR, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Grrgh...{WAIT_PRESS}\nWe... It crushed us..."), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_12[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Wait...{WAIT_PRESS}\nWhat about {POKEMON_3}?\nWhere did {POKEMON_3} go?"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" That's right.{WAIT_PRESS}\nWhat happened to {POKEMON_3}?\nWhere is {POKEMON_3}?"), + }, +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_13 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 15, + .speciesId = MONSTER_TYRANITAR, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" {POKEMON_3} is...{WAIT_PRESS}\nStill battling {POKEMON_2}..."), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_14 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" {POKEMON_0}!\nWe've got to hurry!"), +}; + +const struct DungeonDialogueStruct MagmaCavernMidDialogue_15 = { + .type = 0, + .spriteId = 3, + .spritePlacementId = 14, + .speciesId = MONSTER_CHARIZARD, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...Be careful!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_1[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Oh! {POKEMON_3}!\nAre you OK?!"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" It's {POKEMON_3}!\nAre you OK?!"), + }, +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 15, + .speciesId = MONSTER_ALAKAZAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hm!{WAIT_PRESS}\nSo it's you!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 15, + .speciesId = MONSTER_ALAKAZAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Stay back!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 15, + .speciesId = MONSTER_ALAKAZAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This opponent...{WAIT_PRESS}\nis no laughing matter!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_5 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Grgaaaaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_6 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 15, + .speciesId = MONSTER_ALAKAZAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" H-here it comes!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_7 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Coming...?{WAIT_PRESS}\nWh-where?!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_8 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 15, + .speciesId = MONSTER_ALAKAZAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Wraaaaaah!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_9 = { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" A-{POKEMON_3}!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_10[] = { + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" {POKEMON_3}'s gone!{EXTRA_MSG} Was he maybe...{WAIT_PRESS}\nknocked out?!"), + }, + { + .type = 0, + .spriteId = 12, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" {POKEMON_3} is gone!{EXTRA_MSG} Maybe...{WAIT_PRESS}\nWas he defeated?!"), + }, +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_11[] = { + { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Darn it!\nIt's our turn next."), + }, + { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" Urgh...\nIt's our turn next."), + }, + { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Ohh...\nIt's our turn next."), + }, +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_12 = { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" But I'm not going down\nwithout a fight!"), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_13 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Grgaaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct GroudonPreFightDialogue_14[] = { + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" {POKEMON_0}!\nHang tough!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" {POKEMON_0}!\nLet's do our best!"), + }, +}; + +const struct DungeonDialogueStruct gGroudonReFightDialogue_1[] = { + { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Here it comes!\n{POKEMON_0}!{EXTRA_MSG} We've got to settle\n{POKEMON_2} down this time!"), + }, + { + .type = 0, + .spriteId = 2, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Here it comes!\n{POKEMON_0}!{EXTRA_MSG} Let's make sure we subdue\n{POKEMON_2} this time!"), + }, +}; + +const struct DungeonDialogueStruct gGroudonReFightDialogue_2[] = { + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" Don't get psyched out!{EXTRA_MSG} Be brave and keep slugging!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_MOST, + .str = _(" Don't be intimidated!{EXTRA_MSG} We need to be brave to\nface this thing!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Don't be intimidated!{EXTRA_MSG} We have to fight it with\nall our courage!"), + }, +}; + +const struct DungeonDialogueStruct gGroudonReFightDialogue_3 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Grgaaaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct gGroudonReFightDialogue_4[] = { + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" {POKEMON_0}!\nLet's give it what we've got!"), + }, + { + .type = 0, + .spriteId = 3, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" {POKEMON_0}!\nLet's give it our all!"), + }, +}; + +const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_1 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Grgaaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_GROUDON, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Why have you returned?!{WAIT_PRESS}\nHow dare you disturb me in my sleep?!{EXTRA_MSG} I let rage run wild before...{WAIT_PRESS}\nBut I won't allow that again!"), +}; + +const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_GROUDON, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Those that disturb my\nsleep...{WAIT_PRESS}\nShall be crushed!"), +}; + +const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_GROUDON, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" No matter who it may be!"), +}; + +const struct DungeonDialogueStruct gUnknown_8103488 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}This appears to be the deepest level.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go any farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Is this...{WAIT_PRESS}\nThe top floor?"), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Who goes there?!{WAIT_PRESS}\nWho dares to trespass upon my\nairspace?!"), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_3[] = { + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ONLY_SQUIRTLE_TOTODILE, + .str = _(" That voice...{WAIT_PRESS}\nIs that {POKEMON_2}?"), + }, + { + .type = 0, + .spriteId = 0, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" That voice...{WAIT_PRESS}\nCould it be {POKEMON_2}?"), + }, +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_4 = { + .type = 0, + .spriteId = 128, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Indeed I am.{WAIT_PRESS}\nThe sky is my domain.{EXTRA_MSG} Depart at once!"), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_5 = { + .type = 0, + .spriteId = 4, + .spritePlacementId = 2, + .speciesId = DIALOGUE_MONSTER_PARTNER, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" But...\nWe don't have the time to argue.{EXTRA_MSG} We came here because we\nneed your help..."), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_6 = { + .type = 0, + .spriteId = 128, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Never!"), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gyaaaaaaaaaaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_8 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am a being of the sky,\nand you are but denizens of the ground.{EXTRA_MSG} To each, there is a world\ndestined as their own!{EXTRA_MSG} For hundreds of millions of\nyears, never once have I descended to\nthe ground!"), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_9 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" And the opposite shall also\nhold true!"), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_10 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Let there be no mercy for\nthose that defy the laws of nature!"), +}; + +const struct DungeonDialogueStruct gRayquazaPreFightDialogue_11 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Prepare for the end!"), +}; + +const struct DungeonDialogueStruct gRayquazaReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You return, but for no\npurpose!"), +}; + +const struct DungeonDialogueStruct gRayquazaReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is no place for the\nlikes of you!"), +}; + +const struct DungeonDialogueStruct gRayquazaReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Let there be no mercy for\nthose that trespass upon my airspace!"), +}; + +const struct DungeonDialogueStruct gRayquazaReFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Prepare for the end!"), +}; + +const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_1 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gyaaaaaaaaaaaah!\n "), +}; + +const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" So it is you who dares to\ntrespass upon my airspace!{EXTRA_MSG} You scaled the Sky Tower...{EXTRA_MSG} Now, you wish to challenge\nme to a battle?!{EXTRA_MSG} ............{WAIT_PRESS}\nIn destroying the falling star, I sustained\ninjuries upon my body and my pride...{EXTRA_MSG} To better protect my\ndomain, I have made myself stronger.{EXTRA_MSG} And so that I may draw\nout my newly gained power..."), +}; + +const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am now...{WAIT_PRESS}\nUnleashing every bit of my might!"), +}; + +const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" My power shall overwhelm...{WAIT_PRESS}\nBut you dare to stand up to it?"), +}; + +const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAYQUAZA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I commend your courage!"), +}; + +const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_6 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}This appears to be\n{CENTER_ALIGN}the top of the Sky Tower...{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gUnknown_8103BD8 = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hunh? What is it, you?"), +}; + +const struct DungeonDialogueStruct gUnknown_8103C00 = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 12, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" We don't like to brag or\nnothing, but..."), +}; + +const struct DungeonDialogueStruct gUnknown_8103C3C = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" We get furious real easy.\nYou know that?!"), +}; + +const struct DungeonDialogueStruct gUnknown_8103C74 = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 12, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" What really irritates us is\nwhen we see some dim-witted face..."), +}; + +const struct DungeonDialogueStruct gUnknown_8103CC4 = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ............{WAIT_PRESS}\nWroooooooar!{WAIT_PRESS}\nThat vacant expression..."), +}; + +const struct DungeonDialogueStruct gUnknown_8103D0C = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 12, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Gwooooh!\nIt's ticking me off!{WAIT_PRESS}\nI'm seeing red!"), +}; + +const struct DungeonDialogueStruct gUnknown_8103D50 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Mukkkeeeeeh!\nGet 'em! It's frenzy time!"), +}; + +const struct DungeonDialogueStruct gUnknown_8103D8C = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Hunh? What is it, you?"), +}; + +const struct DungeonDialogueStruct gUnknown_8103D98 = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 12, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Are you looking at me...?{WAIT_PRESS}\nAre you mocking me?"), +}; + +const struct DungeonDialogueStruct gUnknown_8103DD8 = { + .type = 1, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Gwoooooh!\nIt's ticking me off!{WAIT_PRESS}\nI'm about to blow my fuse!"), +}; + +const struct DungeonDialogueStruct gUnknown_8103E28 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 12, + .speciesId = MONSTER_MANKEY, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Mukkkeeeeeh!\nGet 'em! It's frenzy time!"), +}; + +const struct DungeonDialogueStruct gUnknown_8103E34 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gMewtwoPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ............{WAIT_PRESS}\nWas it you...?{EXTRA_MSG} ...Who...disturbed...me...in my...\nsleep...?{WAIT_PRESS}\nWas it you?"), +}; + +const struct DungeonDialogueStruct gMewtwoPreFightDialogue_2 = { + .type = 3, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MEWTWO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" My name is {POKEMON_2}.{WAIT_PRESS}\nI came into being only to fight."), +}; + +const struct DungeonDialogueStruct gMewtwoPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MEWTWO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I...{WAIT_PRESS}\nhave secluded myself here in suspended\nanimation.{EXTRA_MSG} Would you like to know\nwhy?{WAIT_PRESS}\nIt's quite simple..."), +}; + +const struct DungeonDialogueStruct gMewtwoPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MEWTWO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" If anyone--such as you--\nwere to come along..."), +}; + +const struct DungeonDialogueStruct gMewtwoPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MEWTWO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I could defeat them at full\npower!\nCome on!"), +}; + +const struct DungeonDialogueStruct gMewtwoReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ............{WAIT_PRESS}\nWas it you...?{EXTRA_MSG} ...Who...disturbed...me...in my...\nsleep...?{WAIT_PRESS}\nWas it you?"), +}; + +const struct DungeonDialogueStruct gMewtwoReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MEWTWO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I...{WAIT_PRESS}\nhave secluded myself here in suspended\nanimation...{EXTRA_MSG} Lying in wait...{WAIT_PRESS}\nFor someone like you to come."), +}; + +const struct DungeonDialogueStruct gMewtwoReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MEWTWO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}.{WAIT_PRESS}\nA Pokémon created only to fight...{WAIT_PRESS}\nAnd..."), +}; + +const struct DungeonDialogueStruct gMewtwoReFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_MEWTWO, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" The most powerful Pokémon\nof all!"), +}; + +const struct DungeonDialogueStruct gMewtwoReFightDialogue_5 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gEnteiPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" What compelled you to come?{EXTRA_MSG} The likes of you have no business\nbeing here!"), +}; + +const struct DungeonDialogueStruct gEnteiPreFightDialogue_2 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nI live surrounded by the fiery lava of\nvolcanoes!"), +}; + +const struct DungeonDialogueStruct gEnteiPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" If you refuse to leave...{WAIT_PRESS}\nI shall forcefully expel you!"), +}; + +const struct DungeonDialogueStruct gEnteiReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Did I not say to never\nreturn?{EXTRA_MSG} This is the {COLOR YELLOW_D}Fiery Field{RESET}!{WAIT_PRESS}\nIt is no place for your kind!"), +}; + +const struct DungeonDialogueStruct gEnteiReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nI live surrounded by the fiery lava of\nvolcanoes!"), +}; + +const struct DungeonDialogueStruct gEnteiReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Since you fail to heed my\nwords...{WAIT_PRESS}\nI've no choice but to defeat you!"), +}; + +const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is the {COLOR YELLOW_D}Fiery Field{RESET}!{WAIT_PRESS}\nIt is no place for your kind!{EXTRA_MSG} I am {POKEMON_2}!{WAIT_PRESS}\nI live surrounded by the fiery lava of\nvolcanoes!"), +}; + +const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Depart from here..."), +}; + +const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_ENTEI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Immediately!"), +}; + +const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_4 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The lord of this area isn't here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gRaikouPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Why...{WAIT_PRESS}\nWhy have you come...?{EXTRA_MSG} This is {COLOR YELLOW_D}Lightning Field{RESET}.{WAIT_PRESS}\nIt is my...{WAIT_PRESS}domain!"), +}; + +const struct DungeonDialogueStruct gRaikouPreFightDialogue_2 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nOne who races with lightning!{EXTRA_MSG} A body like roiling rain\nclouds!"), +}; + +const struct DungeonDialogueStruct gRaikouPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" A roar that echoes thunder!"), +}; + +const struct DungeonDialogueStruct gRaikouPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Many have trespassed upon\nmy domain..."), +}; + +const struct DungeonDialogueStruct gRaikouPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" But what became of them?{WAIT_PRESS}\nLet me demonstrate..."), +}; + +const struct DungeonDialogueStruct gRaikouPreFightDialogue_6 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" And you, too, shall\nexperience the pain they suffered!"), +}; + +const struct DungeonDialogueStruct gRaikouReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Snicker... You again.{WAIT_PRESS}\nYou don't give up easily.{EXTRA_MSG} If you so wish to taste\ndefeat again, I shall oblige!"), +}; + +const struct DungeonDialogueStruct gRaikouReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" With my electric bolts...{WAIT_PRESS}"), +}; + +const struct DungeonDialogueStruct gRaikouReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I will devastate you again!"), +}; + +const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is {COLOR YELLOW_D}Lightning Field{RESET}!{WAIT_PRESS}\nMy domain!{EXTRA_MSG} All those who enter...{WAIT_PRESS}\nI show no mercy, no matter what!"), +}; + +const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" With my electric bolts..."), +}; + +const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_RAIKOU, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I will devastate you again!"), +}; + +const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_4 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The lord of this area isn't here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gSuicunePreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Halt!"), +}; + +const struct DungeonDialogueStruct gSuicunePreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Why are you here?!"), +}; + +const struct DungeonDialogueStruct gSuicunePreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Clear and bracing air...{WAIT_PRESS}\nCrystalline, pure water...{EXTRA_MSG} To stand guard over this beautiful and\nuntainted land...{WAIT_PRESS}\nThat is why I am here."), +}; + +const struct DungeonDialogueStruct gSuicunePreFightDialogue_4 = { + .type = 3, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nOne who runs with the north wind!"), +}; + +const struct DungeonDialogueStruct gSuicunePreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Intruders foul the air\nwith their outside ills."), +}; + +const struct DungeonDialogueStruct gSuicunePreFightDialogue_6 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" There is but one solution\nfor invaders: expulsion by force!"), +}; + +const struct DungeonDialogueStruct gSuicunePreFightDialogue_7 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Here I come!"), +}; + +const struct DungeonDialogueStruct gSuicuneReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is no place for you!{EXTRA_MSG} Leave immediately!{EXTRA_MSG} If you refuse..."), +}; + +const struct DungeonDialogueStruct gSuicuneReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I will..."), +}; + +const struct DungeonDialogueStruct gSuicuneReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" With all my furious power...{WAIT_PRESS}\nDestroy you!"), +}; + +const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You mean to challenge me?{EXTRA_MSG} I find little satisfaction in\nfighting...{WAIT_PRESS}\nHowever!{EXTRA_MSG} If you refuse my\ndemands that you leave...{EXTRA_MSG} I will accept your challenge."), +}; + +const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Experience it."), +}; + +const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SUICUNE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" My true power...{WAIT_PRESS}\nUnleashed!"), +}; + +const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_4 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The lord of this area isn't here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gHoOhPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Excellent!{EXTRA_MSG} You have done well to come this far.{EXTRA_MSG} You have overcome countless\nchallenges...{EXTRA_MSG} Fought through many dangerous\nsituations...{EXTRA_MSG} and finally ascended to the very peak\nof {COLOR YELLOW_D}Mt. Faraway{RESET}!{EXTRA_MSG} Truly, only the chosen have reached\nthe summit.{EXTRA_MSG} However!"), +}; + +const struct DungeonDialogueStruct gHoOhPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is not the end!"), +}; + +const struct DungeonDialogueStruct gHoOhPreFightDialogue_3 = { + .type = 3, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_HO_OH, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nThe builder of rainbows across the sky!"), +}; + +const struct DungeonDialogueStruct gHoOhPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_HO_OH, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Only when you overcome\nme in battle...{WAIT_PRESS}\nThat is when this mountain is conquered!"), +}; + +const struct DungeonDialogueStruct gHoOhPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_HO_OH, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" This is the final challenge!"), +}; + +const struct DungeonDialogueStruct gHoOhPreFightDialogue_6 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_HO_OH, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Here I come!"), +}; + +const struct DungeonDialogueStruct HoOhReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Very good!{EXTRA_MSG} You have done well to come this far.{EXTRA_MSG} Truly, only the chosen have reached\nthe summit."), +}; + +const struct DungeonDialogueStruct HoOhReFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_HO_OH, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Your very arrival is\nevidence of a truly powerful warrior!{WAIT_PRESS}\nAnd...{EXTRA_MSG} It is also your right to\nchallenge me!"), +}; + +const struct DungeonDialogueStruct HoOhReFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_HO_OH, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Surpass your own\nlimitations..."), +}; + +const struct DungeonDialogueStruct HoOhReFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_HO_OH, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" And show me your power in\nits unbridled entirety!\nCome on!"), +}; + +const struct DungeonDialogueStruct HoOhReFightDialogue_5 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The lord of this area isn't here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gLatiosPreFightDialogue_1 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LATIOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Oh!{WAIT_PRESS}\nWho are you?!{EXTRA_MSG} ............{WAIT_PRESS}\nI see. You're trying to get your TMs back.{EXTRA_MSG} But!{EXTRA_MSG} Nobody can stop me!{EXTRA_MSG} I'm the Eon Pokémon {POKEMON_2}!"), +}; + +const struct DungeonDialogueStruct gLatiosPreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LATIOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" If you really want your\nTMs back..."), +}; + +const struct DungeonDialogueStruct gLatiosPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LATIOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You'll have to take them\nfrom me!"), +}; + +const struct DungeonDialogueStruct gLatiosReFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LATIOS, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You're back?{EXTRA_MSG} But!{EXTRA_MSG} It doesn't matter how often\nyou come!{WAIT_PRESS}\nNobody can stop me!"), +}; + +const struct DungeonDialogueStruct gUnknown_8104FC8 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go any farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gRegirockPreFightDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}{CENTER_ALIGN}EXTERMINATE!{EXTRA_MSG}{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}{CENTER_ALIGN}EXTERMINATE!"), +}; + +const struct DungeonDialogueStruct gRegicePreFightDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}{CENTER_ALIGN}EXTERMINATE!{EXTRA_MSG}{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}{CENTER_ALIGN}EXTERMINATE!"), +}; + +const struct DungeonDialogueStruct gRegisteelPreFightDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}{CENTER_ALIGN}EXTERMINATE!{EXTRA_MSG}{CENTER_ALIGN}INTRUDER ALERT!{EXTRA_MSG}{CENTER_ALIGN}EXTERMINATE!"), +}; + +const struct DungeonDialogueStruct gRegirockPostFightDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}Something fell from\n{CENTER_ALIGN}{COLOR CYAN_M}Regirock{RESET}'s body.{EXTRA_MSG}{CENTER_ALIGN}{COLOR CYAN_M}Regirock{RESET} was apparently\n{CENTER_ALIGN}guarding this item."), +}; + +const struct DungeonDialogueStruct gRegirockPostFightDialogue_2 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_0} obtained\n{CENTER_ALIGN}the {COLOR GREEN_I}Rock Part{RESET}...{EXTRA_MSG}{CENTER_ALIGN}that {COLOR CYAN_M}Regirock{RESET} was guarding!"), +}; + +const struct DungeonDialogueStruct gRegicePostFightDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}Something fell from\n{CENTER_ALIGN}{COLOR CYAN_M}Regice{RESET}'s body.{EXTRA_MSG}{CENTER_ALIGN}{COLOR CYAN_M}Regice{RESET} was apparently\n{CENTER_ALIGN}guarding this item."), +}; + +const struct DungeonDialogueStruct gRegicePostFightDialogue_2 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_0} obtained\n{CENTER_ALIGN}the {COLOR GREEN_I}Ice Part{RESET}...{EXTRA_MSG}{CENTER_ALIGN}that {COLOR CYAN_M}Regice{RESET} was guarding!"), +}; + +const struct DungeonDialogueStruct gRegisteelPostFightDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}Something fell from\n{CENTER_ALIGN}{COLOR CYAN_M}Registeel{RESET}'s body.{EXTRA_MSG}{CENTER_ALIGN}{COLOR CYAN_M}Registeel{RESET} was apparently\n{CENTER_ALIGN}guarding this item."), +}; + +const struct DungeonDialogueStruct gRegisteelPostFightDialogue_2 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_0} obtained\n{CENTER_ALIGN}the {COLOR GREEN_I}Steel Part{RESET}...{EXTRA_MSG}{CENTER_ALIGN}that {COLOR CYAN_M}Registeel{RESET} was guarding!"), +}; + +const u8 *const gUnknown_810531C =_("{CENTER_ALIGN}That means...{EXTRA_MSG}{CENTER_ALIGN}By finding the {COLOR GREEN_I}Rock Part{RESET},\n{CENTER_ALIGN}{COLOR GREEN_I}Ice Part{RESET}, and {COLOR GREEN_I}Steel Part{RESET}...{EXTRA_MSG}{CENTER_ALIGN}All three parts are yours!"); +const u8 *const gUnknown_8105360 =_("{CENTER_ALIGN}Oh? The three parts...{WAIT_PRESS}\n{CENTER_ALIGN}They're reacting to each other?"); +const u8 *const gUnknown_81053A8 =_("{CENTER_ALIGN}The three parts\n{CENTER_ALIGN}fit together...{EXTRA_MSG}{CENTER_ALIGN}and became a {COLOR GREEN_I}Music Box{RESET}!"); +const u8 *const gUnknown_8105434 =_("{CENTER_ALIGN}{POKEMON_0} obtained\n{CENTER_ALIGN}the {COLOR GREEN_I}Music Box{RESET}!{EXTRA_MSG}{CENTER_ALIGN}The {COLOR GREEN_I}Music Box{RESET} only needs\n{CENTER_ALIGN}to be in the Toolbox for it to\n{CENTER_ALIGN}attract a special something!"); +const struct DungeonDialogueStruct gJirachiPreFightDialogue_1 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ........................{EXTRA_MSG} ......Fwaaaaaaaahhh......{EXTRA_MSG} I'm still sleepy...\nFnyumnyum..."), +}; + +const struct DungeonDialogueStruct gJirachiPreFightDialogue_2 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...Who is it?{EXTRA_MSG} Who is that over there?\nFnyumnyum..."), +}; + +const struct DungeonDialogueStruct gJirachiPreFightDialogue_3 = { + .type = 2, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I'm {POKEMON_2}.\nWho are you?"), +}; + +const struct DungeonDialogueStruct gJirachiPreFightDialogue_4 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ......Fwaaaaahhhh......\nI'm still...sleepy..."), +}; + +const struct DungeonDialogueStruct gUnknown_810554C = { + .type = 1, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ......Fwaaaaahhhh......\nI'm still...sleepy..."), +}; + +const struct DungeonDialogueStruct gUnknown_8105558 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...I think I had a dream,\nand I was fighting in it...{WAIT_PRESS}\nDid I imagine it?{EXTRA_MSG} ...I'm sleepy, so I'm going\nback to sleep...\nGood night..."), +}; + +const struct DungeonDialogueStruct gUnknown_81055F4 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{COLOR CYAN_M}{POKEMON_2}{RESET} fell\n{CENTER_ALIGN}back into a deep sleep...{EXTRA_MSG}{CENTER_ALIGN}Apparently, {COLOR CYAN_M}{POKEMON_2}{RESET}\n{CENTER_ALIGN}was fighting in its sleep..."), +}; + +const struct DungeonDialogueStruct gUnknown_8105668 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ......Fwaaaaahhhh......\nI'm still...sleepy..."), +}; + +const struct DungeonDialogueStruct gUnknown_8105674 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...Oh, oh?!\nI hear singing...{EXTRA_MSG} A song of purity..."), +}; + +const struct DungeonDialogueStruct gUnknown_81056B8 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Ha!{WAIT_PRESS}\nEyes wide open!"), +}; + +const struct DungeonDialogueStruct gUnknown_81056DC = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I don't know why, but I'm\nwide awake!{EXTRA_MSG} I'm {POKEMON_2}.{EXTRA_MSG} When I awaken, I grant\na wish.\nI have to.{EXTRA_MSG} Er-hem...{WAIT_PRESS}\nThen...{WAIT_PRESS} I ask you this."), +}; + +const u8 *const gUnknown_8105798 =_("{COLOR YELLOW_N}{POKEMON_2}{RESET}: What is your \nwish?"); +const MenuItem gUnknown_810579C[] = { + {_("Lots of money."), 1}, + {_("Lots of items."), 2}, + {_("A Friend Area."), 3}, + {_("More strength."), 4}, + {_("Something good!"), 5}, + {NULL, -1}, +}; +const struct DungeonDialogueStruct gUnknown_810581C = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You want lots of money?{EXTRA_MSG} As you wish.{WAIT_PRESS}\nI'll gather all the money in the dungeon and\nbring it here.{EXTRA_MSG} Now...{WAIT_PRESS}\nHere goes!"), +}; + +const struct DungeonDialogueStruct gUnknown_81058A8 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Nnnnnnnnnn!"), +}; + +const struct DungeonDialogueStruct gUnknown_81058C4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Taaaaaaaah!"), +}; + +const struct DungeonDialogueStruct gUnknown_81058E0 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...Fwaaaaaaaahhh...{EXTRA_MSG} Using that power...\nMade me sleepy...{WAIT_PRESS}\nGood night..."), +}; + +const struct DungeonDialogueStruct gUnknown_810593C = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{COLOR CYAN_M}{POKEMON_2}{RESET} fell\n{CENTER_ALIGN}back into a deep sleep..."), +}; + +const struct DungeonDialogueStruct gUnknown_8105974 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You want lots of items?{EXTRA_MSG} As you wish.{WAIT_PRESS}\nI'll gather all the good items in the dungeon\nand bring them here.{EXTRA_MSG} Now...{WAIT_PRESS}\nHere goes!"), +}; + +const struct DungeonDialogueStruct gUnknown_8105A08 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You want a Friend Area?{EXTRA_MSG} ...But...{WAIT_PRESS}\nDon't you already have many Friend\nAreas?{EXTRA_MSG} I can't grant you that wish,\nso can you choose another one?{EXTRA_MSG} Er-hem...{WAIT_PRESS}\nThen...{WAIT_PRESS} I ask you again."), +}; + +const struct DungeonDialogueStruct gUnknown_8105AD4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You want a Friend Area?{EXTRA_MSG} As you wish.{WAIT_PRESS}\nNow...{WAIT_PRESS}\nHere goes!"), +}; + +const struct DungeonDialogueStruct gUnknown_8105B20 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I opened a new Friend Area\nfor you. It's yours to use!"), +}; + +const struct DungeonDialogueStruct gUnknown_8105B68 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{COLOR CYAN_M}{POKEMON_0}{RESET} obtained\n{CENTER_ALIGN}the Friend Area\n{CENTER_ALIGN}{COLOR GREEN_H}{MOVE_ITEM_0}{RESET}!"), +}; + +const struct DungeonDialogueStruct gUnknown_8105BA8 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" You want to be stronger?{EXTRA_MSG} As you wish.{WAIT_PRESS}\nNow...{WAIT_PRESS}\nHere goes!"), +}; + +const struct DungeonDialogueStruct gUnknown_8105BF4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I gathered up items from\nall over the dungeon that may make you \nstronger.{EXTRA_MSG} But don't use them now.{WAIT_PRESS}\nWhen you leave the {COLOR YELLOW_D}Wish Cave{RESET}, your\npowers go back to their original state.{EXTRA_MSG} So, you should only use\nthose items after you take them back.{EXTRA_MSG} I hope you keep working to\nbecome stronger!"), +}; + +const struct DungeonDialogueStruct gUnknown_8105D2C = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Something good?{WAIT_PRESS}\nThat's not very easy...{EXTRA_MSG} But I'll do my best!"), +}; + +const struct DungeonDialogueStruct gUnknown_8105D80 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" It's done..."), +}; + +const struct DungeonDialogueStruct gUnknown_8105D9C = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_JIRACHI, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" If you can get home safely,\nI think there will be something good\nwaiting for you.{WAIT_PRESS} Maybe.{WAIT_PRESS} Definitely."), +}; + +const struct DungeonDialogueStruct gJirachiReFightDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The master of this area isn't here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Why...{WAIT_PRESS}\nWhy have you come here...?{EXTRA_MSG} This is...{WAIT_PRESS}the {COLOR YELLOW_D}Silver Trench{RESET}.{WAIT_PRESS}\nThis is my territory!"), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_2 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LUGIA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" My name is {POKEMON_2}!{WAIT_PRESS}\nI am the guardian of the seas!"), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LUGIA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" To protect this sea,\nI have settled here..."), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LUGIA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" If you dare to challenge\nme..."), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_5 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LUGIA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" So be it!\nI will rise to your challenge!"), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_6 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_LUGIA, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Cast aside all thoughts!{WAIT_PRESS}\nUnleash every bit of your power!"), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_7 = { + .type = 6, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}With your life at stake...{WAIT_PRESS}\n{CENTER_ALIGN}Bring it on!{WAIT_PRESS}\n{CENTER_ALIGN} {WAIT_PRESS} "), +}; + +const struct DungeonDialogueStruct gLugiaPreFightDialogue_8 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The lord of this area isn't here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_1 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gwoooooooooooh..................\n "), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ...My power...{WAIT_PRESS}\nis bursting...{EXTRA_MSG} My infinite...{WAIT_PRESS}\npower!"), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_3 = { + .type = 5, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("Gwwwwwoooooooooooh!\n "), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" My duels against {POKEMON_3} left\nus both exhausted...{WAIT_PRESS}\nI took to a long and deep sleep...{EXTRA_MSG} All the time, I waited.\nWaited for my power to recover.{EXTRA_MSG} And now!{WAIT_PRESS}\nI am on the verge of regaining my power!"), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_5 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_KYOGRE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I am {POKEMON_2}!{WAIT_PRESS}\nThe lord of the sea!"), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_6 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_KYOGRE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Witness the destructive\nforce of my waves!"), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_7 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_KYOGRE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Marvel at my awesome\npower!"), +}; + +const struct DungeonDialogueStruct gKyogrePreFightDialogue_8 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}The lord of this area isn't here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gDeoxysPreFightDialogue_1 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = DIALOGUE_MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" ............{EXTRA_MSG} Where...{WAIT_PRESS}\nWhere am I?"), +}; + +const struct DungeonDialogueStruct gDeoxysPreFightDialogue_2 = { + .type = 2, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_DEOXYS_NORMAL, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" There was a sudden explosion...{WAIT_PRESS}\nAnd I awakened to this...{EXTRA_MSG} What is this place?{EXTRA_MSG} I am {POKEMON_2}.{WAIT_PRESS}\nI came from space."), +}; + +const struct DungeonDialogueStruct gDeoxysPreFightDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_DEOXYS_NORMAL, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" If you know, tell me."), +}; + +const struct DungeonDialogueStruct gDeoxysPreFightDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_DEOXYS_NORMAL, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I must know...{WAIT_PRESS}\nwhat happened here!"), +}; + +const struct DungeonDialogueStruct gDeoxysPreFightDialogue_5 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_1 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}Oh?{WAIT_PRESS}\n{CENTER_ALIGN}There's someone there."), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_2 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}It's...{WAIT_PRESS}\n{CENTER_ALIGN}The Time Travel Pokémon {POKEMON_2}!"), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_3 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_2} wants to join the team."), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_4 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_2} joined the team! "), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_5 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_3} appears to\n{CENTER_ALIGN}be very happy!"), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_6 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}It's delighted to have\n{CENTER_ALIGN}joined the rescue team!"), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_7 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_0} turned down\n{CENTER_ALIGN}the offer to join."), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_8 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}Celebi is very disappointed."), +}; + +const struct DungeonDialogueStruct gCelebiJoinDialogue_9 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}{POKEMON_2} left\n{CENTER_ALIGN}dejectedly..."), +}; + +const u8 *const gPtrPurityForestAllowCelebiToJoinText =_("{CENTER_ALIGN}Allow {POKEMON_2}\n{CENTER_ALIGN}to join the team?"); +const MenuItem gPurityForestAllowCelebiToJoinPrompt[] = { + {_("Yes."), 1}, + {_("No."), 2}, + {NULL, -1}, +}; +const u8 *const gPtrPurityForestRefuseCelebiConfirmText =_("{CENTER_ALIGN}Are you sure?{WAIT_PRESS}\n{CENTER_ALIGN}You're sure you won't accept it?"); +const MenuItem gPurityForestRefuseCelebiConfirmPrompt[] = { + {_("Reconsider."), 1}, + {_("Refuse."), 2}, + {NULL, -1}, +}; +const struct DungeonDialogueStruct gCelebiJoinDialogue_10 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + +const u8 *const gUnknown_810665C =_("{CENTER_ALIGN}..............."); +const u8 *const gUnknown_810668C =_("{CENTER_ALIGN}Someone has intruded\n{CENTER_ALIGN}upon the forest..."); +const u8 *const gUnknown_81066D4 =_("{CENTER_ALIGN}The enfeebled flow of icy winds...\n{CENTER_ALIGN}Is the intrusion to blame?"); +const u8 *const gUnknown_81066F0 =_("{CENTER_ALIGN}It must be stopped."); +const u8 *const gUnknown_810671C =_("{CENTER_ALIGN}For it is to protect the forest..."); +const struct DungeonDialogueStruct gUnknown_8106720 = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}Defeat the opposing team to win!\n{CENTER_ALIGN}Be careful--your opponents are tough!"), +}; + +const struct DungeonDialogueStruct gMedichamRescueDialogue_1 = { + .type = 0, + .spriteId = 4, + .spritePlacementId = 13, + .speciesId = MONSTER_MEDICHAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Oh, my, my...\nI can't seem to find a way out..."), +}; + +const struct DungeonDialogueStruct gMedichamRescueDialogue_2 = { + .type = 0, + .spriteId = 4, + .spritePlacementId = 13, + .speciesId = MONSTER_MEDICHAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" What am I to do...?"), +}; + +const struct DungeonDialogueStruct gMedichamRescueDialogue_3 = { + .type = 0, + .spriteId = 2, + .spritePlacementId = 13, + .speciesId = MONSTER_MEDICHAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Oh!\nYou?!{EXTRA_MSG} ............{WAIT_PRESS}\nPerhaps...{EXTRA_MSG} You have come to rescue\nme?"), +}; + +const struct DungeonDialogueStruct gMedichamRescueDialogue_4 = { + .type = 0, + .spriteId = 1, + .spritePlacementId = 13, + .speciesId = MONSTER_MEDICHAM, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Yes, yes!\nI am so lucky!"), +}; + +const struct DungeonDialogueStruct gUnknown_810685C = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here."), +}; + +const struct DungeonDialogueStruct gSmeargleRescueDialogue_1 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SMEARGLE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Ohhh...\nI've lost my bearings...{WAIT_PRESS}\nWhere is this?"), +}; + +const struct DungeonDialogueStruct gSmeargleRescueDialogue_2 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SMEARGLE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" I can't get out...\nI'm hungry...{WAIT_PRESS}\nI'm in trouble..."), +}; + +const struct DungeonDialogueStruct gSmeargleRescueDialogue_3 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SMEARGLE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Oh!\nYou are?!"), +}; + +const struct DungeonDialogueStruct gSmeargleRescueDialogue_4 = { + .type = 0, + .spriteId = 0, + .spritePlacementId = 13, + .speciesId = MONSTER_SMEARGLE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _(" Did you maybe come to\nrescue me?{WAIT_PRESS}\nAm I glad to see you!"), +}; + +const struct DungeonDialogueStruct gUnknown_810697C = { + .type = 4, + .spriteId = 0, + .spritePlacementId = 0, + .speciesId = MONSTER_NONE, + .allowType = DIALOGUE_ALLOW_ALL, + .str = _("{CENTER_ALIGN}There appears to be no one here.{EXTRA_MSG}{CENTER_ALIGN}It's impossible to go farther.{WAIT_PRESS}\n{CENTER_ALIGN}It's time to go back."), +}; + + diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c deleted file mode 100644 index 4441bb516..000000000 --- a/src/dungeon_capabilities.c +++ /dev/null @@ -1,161 +0,0 @@ -#include "global.h" -#include "dungeon_capabilities.h" - -#include "constants/dungeon.h" -#include "constants/iq_skill.h" -#include "constants/status.h" -#include "charge_move.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" -#include "dungeon_engine.h" -#include "dungeon_items.h" -#include "dungeon_map_access.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_util.h" -#include "structs/map.h" - -const u8 gDirectionBitMasks_1[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; - -// TODO CheckVariousStatuses, CheckVariousStatuses2, CheckVariousConditions all check for different conditions that interfere with a Pokémon's ability to act, -// but I'm not sure what the reason is for each function checking the conditions that they do. -// These functions could use better names if someone figures out a clear pattern/reasoning. -bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - - if ((checkBlinker && pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER)) - return TRUE; - if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || pokemonInfo->sleepClassStatus.status == STATUS_NAPPING || pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE) - return TRUE; - if (pokemonInfo->cringeClassStatus.status == STATUS_PAUSED || pokemonInfo->cringeClassStatus.status == STATUS_INFATUATED) - return TRUE; - if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) - return TRUE; - if (pokemonInfo->terrifiedTurns != 0) - return TRUE; - - return FALSE; -} - -bool8 sub_8070BC0(Entity* entity) -{ - EntityInfo *entityInfo = GetEntInfo(entity); - - if (IsChargingAnyTwoTurnMove(entity, FALSE) - || entityInfo->sleepClassStatus.status == STATUS_YAWNING - || entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE - || ShouldMonsterRunAway(entity) - || entityInfo->muzzled.muzzled == TRUE - || entityInfo->frozenClassStatus.status == STATUS_PETRIFIED - || entityInfo->frozenClassStatus.status == STATUS_FROZEN) - return FALSE; - - if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) - return FALSE; - if (entityInfo->sleepClassStatus.status == STATUS_SLEEP) - return FALSE; - if (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE - || entityInfo->sleepClassStatus.status == STATUS_NAPPING) - return FALSE; - if (entityInfo->cringeClassStatus.status == STATUS_CRINGE) - return FALSE; - if (entityInfo->frozenClassStatus.status == STATUS_WRAP) - return FALSE; - if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED - || entityInfo->blinkerClassStatus.status == STATUS_CROSS_EYED) - return FALSE; - if (entityInfo->curseClassStatus.status == STATUS_DECOY) - return FALSE; - if (entityInfo->blinkerClassStatus.status == STATUS_BLINKER) - return FALSE; - if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED - && entityInfo->cringeClassStatus.status != STATUS_PAUSED) - return TRUE; - - return FALSE; -} - -bool8 CheckVariousConditions(Entity *pokemon) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - - if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET - || IsExperienceLocked(pokemonInfo->joinedAt.id) - || (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon)) - || CheckVariousStatuses2(pokemon, FALSE) - || CheckVariousStatuses(pokemon)) - return TRUE; - - if (IsChargingAnyTwoTurnMove(pokemon, FALSE)) - return TRUE; - - return FALSE; -} - -bool8 CheckVariousStatuses(Entity *pokemon) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - - if ((pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS && pokemonInfo->sleepClassStatus.status != STATUS_NONE)) - return TRUE; - if (pokemonInfo->frozenClassStatus.status == STATUS_FROZEN || pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) - return TRUE; - if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) - return TRUE; - - return FALSE; -} - -bool8 CannotAttack(Entity *pokemon, bool8 skipSleep) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - - if ((skipSleep || - pokemonInfo->sleepClassStatus.status == STATUS_SLEEPLESS || - pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || - pokemonInfo->sleepClassStatus.status == STATUS_NONE) && - pokemonInfo->frozenClassStatus.status != STATUS_FROZEN && - pokemonInfo->frozenClassStatus.status != STATUS_WRAP && - pokemonInfo->frozenClassStatus.status != STATUS_WRAPPED && - pokemonInfo->frozenClassStatus.status != STATUS_PETRIFIED && - pokemonInfo->cringeClassStatus.status != STATUS_CRINGE && - pokemonInfo->cringeClassStatus.status != STATUS_PAUSED && - pokemonInfo->cringeClassStatus.status != STATUS_INFATUATED && - pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS && - !ShouldMonsterRunAway(pokemon)) - return FALSE; - - return TRUE; -} - -bool8 CanMoveInDirection(Entity *pokemon, u32 direction) -{ - u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - const Tile *currentMapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, - pokemon->pos.y + gAdjacentTileOffsets[direction].y); - - if (currentMapTile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL || currentMapTile->monster != NULL) - return FALSE; - - if (!IsCurrentFixedRoomBossFight()) - { - if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - crossableTerrain = CROSSABLE_TERRAIN_WALL; - else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { - if (direction & 1) - // Super Mobile can't break walls diagonally. - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - else - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - } - - currentMapTile = GetTile(pokemon->pos.x, pokemon->pos.y); - if (!(currentMapTile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_1[direction & DIRECTION_MASK])) - return FALSE; - - return TRUE; -} diff --git a/src/dungeon_config.c b/src/dungeon_config.c index ca4fc5ed9..a0b596cc1 100644 --- a/src/dungeon_config.c +++ b/src/dungeon_config.c @@ -1130,3 +1130,14 @@ const struct CalledMove gNaturePowerCalledMoves[] = {MOVE_SURF, HandleRegularDamagingMove}, {MOVE_ROCK_SLIDE, HandleRegularDamagingMove}, }; + +const u16 gUnknown_80F5F70[UNK12A18_ARR_COUNT] = {12, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 12}; +const s32 gUnknown_80F5FAC[76] = { + 4, 0, 3, 3, 0, 3, 0, 3, 3, 1, 0, 0, 0, 3, 0, 1, 4, + 0, 1, 1, 0, 3, 3, 0, 1, 3, 0, 0, 3, 3, 0, 3, 4, 4, + 1, 1, 1, 3, 3, 3, 0, 0, 0, 0, 0, 4, 2, 1, 2, 4, 0, + 0, 0, 0, 4, 1, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 3, 2, + 1, 1, 2, 1, 1, 4, 4, 1 +}; + +const s32 gUnknown_80F60DC[5] = {1, 1, 1, 2, 4}; diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 8b29baaca..bd98fcc6d 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -5,7 +5,6 @@ #include "code_803E668.h" #include "code_8041AD0.h" #include "code_804267C.h" -#include "code_8045A00.h" #include "code_80861A8.h" #include "code_806CD90.h" #include "code_80869E4.h" @@ -19,7 +18,7 @@ #include "dungeon_message.h" #include "dungeon_music.h" #include "dungeon_misc.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util_1.h" #include "dungeon_util.h" @@ -33,318 +32,12 @@ #include "trap.h" #include "math.h" #include "dungeon_config.h" +#include "dungeon_boss_dialogue.h" extern u32 gDungeonBrightness; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_10; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_11; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_12; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_13; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_14; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_1; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_2; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_3; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_4; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_5; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_6; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_7; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_8; -extern const struct DungeonDialogueStruct GroudonPreFightDialogue_9; -extern const struct DungeonDialogueStruct HoOhReFightDialogue_1; -extern const struct DungeonDialogueStruct HoOhReFightDialogue_2; -extern const struct DungeonDialogueStruct HoOhReFightDialogue_3; -extern const struct DungeonDialogueStruct HoOhReFightDialogue_4; -extern const struct DungeonDialogueStruct HoOhReFightDialogue_5; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_10; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_11; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_12; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_13; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_14; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_15; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_1; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_2; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_3; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_4; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_5; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_6; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_7; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_8; -extern const struct DungeonDialogueStruct MagmaCavernMidDialogue_9; -extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gArticunoPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_10; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_11; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_12; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_1; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_2; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_3; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_4; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_5; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_6; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_7; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_8; -extern const struct DungeonDialogueStruct gArticunoPreFightDialogue_9; -extern const struct DungeonDialogueStruct gArticunoReFightDialogue_1; -extern const struct DungeonDialogueStruct gArticunoReFightDialogue_2; -extern const struct DungeonDialogueStruct gArticunoReFightDialogue_3; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_10; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_1; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_2; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_3; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_4; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_5; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_6; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_7; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_8; -extern const struct DungeonDialogueStruct gCelebiJoinDialogue_9; -extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_1; -extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_2; -extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_3; -extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_4; -extern const struct DungeonDialogueStruct gDeoxysPreFightDialogue_5; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gEnteiPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_1; -extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_2; -extern const struct DungeonDialogueStruct gEnteiPreFightDialogue_3; -extern const struct DungeonDialogueStruct gEnteiReFightDialogue_1; -extern const struct DungeonDialogueStruct gEnteiReFightDialogue_2; -extern const struct DungeonDialogueStruct gEnteiReFightDialogue_3; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gGroudonPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_1; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_2; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_3; -extern const struct DungeonDialogueStruct gGroudonReFightDialogue_4; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_1; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_2; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_3; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_4; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_5; -extern const struct DungeonDialogueStruct gHoOhPreFightDialogue_6; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_1; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_2; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_3; -extern const struct DungeonDialogueStruct gJirachiPreFightDialogue_4; -extern const struct DungeonDialogueStruct gJirachiReFightDialogue_1; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_1; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_2; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_3; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_4; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_5; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_6; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_7; -extern const struct DungeonDialogueStruct gKyogrePreFightDialogue_8; -extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_1; -extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_2; -extern const struct DungeonDialogueStruct gLatiosPreFightDialogue_3; -extern const struct DungeonDialogueStruct gLatiosReFightDialogue_1; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_1; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_2; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_3; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_4; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_5; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_6; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_7; -extern const struct DungeonDialogueStruct gLugiaPreFightDialogue_8; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_1; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_2; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_3; -extern const struct DungeonDialogueStruct gMedichamRescueDialogue_4; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_1; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_2; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_3; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_4; -extern const struct DungeonDialogueStruct gMewtwoPreFightDialogue_5; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_1; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_2; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_3; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_4; -extern const struct DungeonDialogueStruct gMewtwoReFightDialogue_5; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gMoltresPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_10; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_11; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_12; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_1; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_2; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_3; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_4; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_5; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_6; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_7; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_8; -extern const struct DungeonDialogueStruct gMoltresPreFightDialogue_9; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_1; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_2; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_3; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_4; -extern const struct DungeonDialogueStruct gMoltresReFightDialogue_5; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRaikouPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_5; -extern const struct DungeonDialogueStruct gRaikouPreFightDialogue_6; -extern const struct DungeonDialogueStruct gRaikouReFightDialogue_1; -extern const struct DungeonDialogueStruct gRaikouReFightDialogue_2; -extern const struct DungeonDialogueStruct gRaikouReFightDialogue_3; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gRayquazaPostStoryPreFightDialogue_6; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_10; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_11; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_2; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_3; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_4; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_5; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_6; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_7; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_8; -extern const struct DungeonDialogueStruct gRayquazaPreFightDialogue_9; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_1; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_2; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_3; -extern const struct DungeonDialogueStruct gRayquazaReFightDialogue_4; -extern const struct DungeonDialogueStruct gRegicePostFightDialogue_1; -extern const struct DungeonDialogueStruct gRegicePostFightDialogue_2; -extern const struct DungeonDialogueStruct gRegicePreFightDialogue_1; -extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_1; -extern const struct DungeonDialogueStruct gRegirockPostFightDialogue_2; -extern const struct DungeonDialogueStruct gRegirockPreFightDialogue_1; -extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_1; -extern const struct DungeonDialogueStruct gRegisteelPostFightDialogue_2; -extern const struct DungeonDialogueStruct gRegisteelPreFightDialogue_1; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_6; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_7; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_8; -extern const struct DungeonDialogueStruct gSkarmoryPreFightDialogue_9; -extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_1; -extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_2; -extern const struct DungeonDialogueStruct gSkarmoryReFightDialogue_3; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_1; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_2; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_3; -extern const struct DungeonDialogueStruct gSmeargleRescueDialogue_4; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gSuicunePostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_1; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_2; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_3; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_4; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_5; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_6; -extern const struct DungeonDialogueStruct gSuicunePreFightDialogue_7; -extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_1; -extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_2; -extern const struct DungeonDialogueStruct gSuicuneReFightDialogue_3; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_1; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_2; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_3; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_4; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_5; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_6; -extern const struct DungeonDialogueStruct gTeamMeaniesPreFightDialogue_7; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_1; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_2; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_3; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_4; -extern const struct DungeonDialogueStruct gTeamMeaniesReFightDialogue_5; -extern const struct DungeonDialogueStruct gUnknown_8100D3C; -extern const struct DungeonDialogueStruct gUnknown_8100D3C; -extern const struct DungeonDialogueStruct gUnknown_8101440; -extern const struct DungeonDialogueStruct gUnknown_81014B0; -extern const struct DungeonDialogueStruct gUnknown_8101504; -extern const struct DungeonDialogueStruct gUnknown_81015A0; -extern const struct DungeonDialogueStruct gUnknown_81015D4; -extern const struct DungeonDialogueStruct gUnknown_81015E8; -extern const struct DungeonDialogueStruct gUnknown_8101624; -extern const struct DungeonDialogueStruct gUnknown_810165C; -extern const struct DungeonDialogueStruct gUnknown_8101750; -extern const struct DungeonDialogueStruct gUnknown_810178C; -extern const struct DungeonDialogueStruct gUnknown_81017B4; -extern const struct DungeonDialogueStruct gUnknown_8102A9C; -extern const struct DungeonDialogueStruct gUnknown_8102B10; -extern const struct DungeonDialogueStruct gUnknown_8103488; -extern const struct DungeonDialogueStruct gUnknown_8103BD8; -extern const struct DungeonDialogueStruct gUnknown_8103C00; -extern const struct DungeonDialogueStruct gUnknown_8103C3C; -extern const struct DungeonDialogueStruct gUnknown_8103C74; -extern const struct DungeonDialogueStruct gUnknown_8103CC4; -extern const struct DungeonDialogueStruct gUnknown_8103D0C; -extern const struct DungeonDialogueStruct gUnknown_8103D50; -extern const struct DungeonDialogueStruct gUnknown_8103D8C; -extern const struct DungeonDialogueStruct gUnknown_8103D98; -extern const struct DungeonDialogueStruct gUnknown_8103DD8; -extern const struct DungeonDialogueStruct gUnknown_8103E28; -extern const struct DungeonDialogueStruct gUnknown_8103E34; -extern const struct DungeonDialogueStruct gUnknown_8104FC8; -extern const struct DungeonDialogueStruct gUnknown_810554C; -extern const struct DungeonDialogueStruct gUnknown_8105558; -extern const struct DungeonDialogueStruct gUnknown_81055F4; -extern const struct DungeonDialogueStruct gUnknown_8105668; -extern const struct DungeonDialogueStruct gUnknown_8105674; -extern const struct DungeonDialogueStruct gUnknown_81056B8; -extern const struct DungeonDialogueStruct gUnknown_81056DC; -extern const struct DungeonDialogueStruct gUnknown_810581C; -extern const struct DungeonDialogueStruct gUnknown_81058A8; -extern const struct DungeonDialogueStruct gUnknown_81058C4; -extern const struct DungeonDialogueStruct gUnknown_81058E0; -extern const struct DungeonDialogueStruct gUnknown_810593C; -extern const struct DungeonDialogueStruct gUnknown_8105974; -extern const struct DungeonDialogueStruct gUnknown_8105A08; -extern const struct DungeonDialogueStruct gUnknown_8105AD4; -extern const struct DungeonDialogueStruct gUnknown_8105B20; -extern const struct DungeonDialogueStruct gUnknown_8105B68; -extern const struct DungeonDialogueStruct gUnknown_8105BA8; -extern const struct DungeonDialogueStruct gUnknown_8105BF4; -extern const struct DungeonDialogueStruct gUnknown_8105D2C; -extern const struct DungeonDialogueStruct gUnknown_8105D80; -extern const struct DungeonDialogueStruct gUnknown_8105D9C; -extern const struct DungeonDialogueStruct gUnknown_8106720; -extern const struct DungeonDialogueStruct gUnknown_810697C; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_1; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_2; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_3; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_4; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_5; -extern const struct DungeonDialogueStruct gZapdosPostStoryPreFightDialogue_6; -extern const struct DungeonDialogueStruct gZapdosReFightDialogue_1; -extern const struct DungeonDialogueStruct gZapdosReFightDialogue_2; -extern const struct DungeonDialogueStruct gZapdosReFightDialogue_3; -extern const struct DungeonDialogueStruct gZapdosReFightDialogue_4; -extern const struct MenuItem gPurityForestAllowCelebiToJoinPrompt[]; -extern const struct MenuItem gPurityForestRefuseCelebiConfirmPrompt[]; extern const struct MenuItem gUnknown_810579C[]; extern const u64 gUnknown_8107544[]; -extern const u8 *const gPtrPurityForestAllowCelebiToJoinText; -extern const u8 *const gPtrPurityForestRefuseCelebiConfirmText; extern const u8 *const gUnknown_8105798; extern const u8 gUnknown_810739C[]; extern const u8 gUnknown_81073D4[]; @@ -580,7 +273,7 @@ void SkarmoryPreFightDialogue(void) ShiftCameraToPosition(&pos1,0x40); sub_803E708(0x40,0x46); ShiftCameraToPosition(&pos2,0x30); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_2); + DisplayDungeonDialogue(gSkarmoryPreFightDialogue_2); sub_803E708(10,0x46); GetEntInfo(diglettEntity)->unk15D = 1; ShiftCameraToPosition(&pos1,0x30); @@ -591,18 +284,18 @@ void SkarmoryPreFightDialogue(void) SkarmoryEntry(skarmoryEntity); DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_4); // Skarmory: You!\nWhat do you think you're doing here?! sub_803E708(10,0x46); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_5); + DisplayDungeonDialogue(gSkarmoryPreFightDialogue_5); sub_803E708(10,0x46); DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_6); sub_803E708(10,0x46); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_7); + DisplayDungeonDialogue(gSkarmoryPreFightDialogue_7); sub_803E708(10,0x46); sub_806CDD4(skarmoryEntity,0xd,DIRECTION_SOUTH); DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_8); sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_9); + DisplayDungeonDialogue(gSkarmoryPreFightDialogue_9); sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); sub_803E708(10,0x46); @@ -714,7 +407,7 @@ void TeamMeaniesPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); sub_8086448(); sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_1); + DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_1); sub_803E708(10, 0x46); DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); sub_803E708(10, 0x46); @@ -722,7 +415,7 @@ void TeamMeaniesPreFightDialogue(void) DungeonStartNewBGM(MUS_THERES_TROUBLE); DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_3); sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_4); + DisplayDungeonDialogue(gTeamMeaniesPreFightDialogue_4); sub_803E708(10, 0x46); DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_5); sub_803E708(10, 0x46); @@ -741,13 +434,13 @@ void TeamMeaniesReFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); sub_8086448(); - DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_1); + DisplayDungeonDialogue(gTeamMeaniesReFightDialogue_1); sub_803E708(10, 0x46); DisplayDungeonDialogue(&gTeamMeaniesPreFightDialogue_2); sub_803E708(10, 0x46); sub_8087144(); sub_803E708(10, 0x46); - DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_2); + DisplayDungeonDialogue(gTeamMeaniesReFightDialogue_2); sub_803E708(10, 0x46); DisplayDungeonDialogue(&gTeamMeaniesReFightDialogue_3); sub_803E708(10, 0x46); @@ -771,9 +464,9 @@ void sub_8087130(void) void sub_8087144(void) { - Entity *iVar2; - Entity *iVar3; - Entity *iVar4; + Entity *gengarEntity; + Entity *ekansEntity; + Entity *medichamEntity; s16 auStack_10c[28]; s16 puStack_60[28]; s16 puStack_5c[28]; @@ -781,33 +474,33 @@ void sub_8087144(void) Entity *pEStack_58[3]; struct_8085B80 auStack_4c[3]; - iVar2 = GetEntityFromMonsterBehavior(BEHAVIOR_5); - iVar3 = GetEntityFromMonsterBehavior(BEHAVIOR_6); - iVar4 = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); + gengarEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GENGAR); + ekansEntity = GetEntityFromMonsterBehavior(BEHAVIOR_EKANS); + medichamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); memcpy(auStack_10c,gUnknown_810739C, 0x38); memcpy(puStack_60, gUnknown_81073D4, 0x38); memcpy(puStack_5c, gUnknown_810740C, 0x38); puStack_64[0] = auStack_10c; puStack_64[1] = puStack_60; puStack_64[2] = puStack_5c; - pEStack_58[0] = iVar2; - pEStack_58[1] = iVar3; - pEStack_58[2] = iVar4; + pEStack_58[0] = gengarEntity; + pEStack_58[1] = ekansEntity; + pEStack_58[2] = medichamEntity; DungeonStartNewBGM(MUS_THERES_TROUBLE); - sub_8086A54(iVar2); - sub_8086A54(iVar3); - sub_8086A54(iVar4); + sub_8086A54(gengarEntity); + sub_8086A54(ekansEntity); + sub_8086A54(medichamEntity); sub_8085B4C(auStack_4c,puStack_64,pEStack_58,3); - GetEntInfo(iVar2)->unk15F = 1; - GetEntInfo(iVar3)->unk15F = 1; - GetEntInfo(iVar4)->unk15F = 1; + GetEntInfo(gengarEntity)->unk15F = 1; + GetEntInfo(ekansEntity)->unk15F = 1; + GetEntInfo(medichamEntity)->unk15F = 1; while( TRUE ) { if (!sub_8085B80(auStack_4c)) break; DungeonRunFrameActions(0x46); } - GetEntInfo(iVar2)->unk15F = 0; - GetEntInfo(iVar3)->unk15F = 0; - GetEntInfo(iVar4)->unk15F = 0; + GetEntInfo(gengarEntity)->unk15F = 0; + GetEntInfo(ekansEntity)->unk15F = 0; + GetEntInfo(medichamEntity)->unk15F = 0; } void sub_8087230(void) @@ -883,11 +576,11 @@ void ZapdosPreFightDialogue(void) sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(&gUnknown_81014B0); + DisplayDungeonDialogue(gUnknown_81014B0); sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); - DisplayDungeonDialogue(&gUnknown_8101504); + DisplayDungeonDialogue(gUnknown_8101504); sub_803E708(10,0x46); ZapdosScreenFlash(3); DungeonStopBGM(); @@ -928,7 +621,7 @@ void ZapdosPreFightDialogue(void) } sub_80869E4(partnerEntity,2,1,DIRECTION_NORTHEAST); - DisplayDungeonDialogue(&gUnknown_810165C); + DisplayDungeonDialogue(gUnknown_810165C); sub_803E708(10,0x46); ZapdosScreenFlash(3); DisplayDungeonDialogue(&gUnknown_8101750); @@ -952,7 +645,7 @@ void ZapdosReFightDialogue(void) zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_8086448(); sub_803E708(10,0x46); - DisplayDungeonDialogue(&gZapdosReFightDialogue_1); + DisplayDungeonDialogue(gZapdosReFightDialogue_1); sub_803E708(10,0x46); PlaySoundEffect(0x1da); DisplayDungeonDialogue(&gUnknown_81015A0); @@ -1114,15 +807,15 @@ void MoltresPreFightDialogue(void) sub_803E708(4,0x46); SpriteLookAroundEffect(partnerEntity); sub_803E708(10,0x46); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_2); + DisplayDungeonDialogue(gMoltresPreFightDialogue_2); sub_803E708(10,0x46); MoltresScreenFlash1(0xc,5); MoltresScreenFlash2(9,5); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_3); + DisplayDungeonDialogue(gMoltresPreFightDialogue_3); sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_4); + DisplayDungeonDialogue(gMoltresPreFightDialogue_4); sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); sub_8086690(); @@ -1134,14 +827,14 @@ void MoltresPreFightDialogue(void) PlaySoundEffect(0x2f2); DungeonStopBGM(); MoltresScreenDarken(); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_6); + DisplayDungeonDialogue(gMoltresPreFightDialogue_6); sub_803E708(10,0x46); DisplayDungeonDialogue(&gMoltresPreFightDialogue_7); sub_803E708(10,0x46); PlaySoundEffect(0x1cf); sub_80856E0(partnerEntity, DIRECTION_NORTH); sub_803E708(10,0x46); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_8); + DisplayDungeonDialogue(gMoltresPreFightDialogue_8); sub_803E708(10,0x46); MoltresScreenFlash3(); PlaySoundEffect(0x1da); @@ -1184,7 +877,7 @@ void MoltresReFightDialogue(void) sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(&gMoltresReFightDialogue_2); + DisplayDungeonDialogue(gMoltresReFightDialogue_2); sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); @@ -1200,7 +893,7 @@ void MoltresReFightDialogue(void) DisplayDungeonDialogue(&gMoltresReFightDialogue_3); sub_803E708(10,0x46); MoltresScreenFlash2(0xb,6); - DisplayDungeonDialogue(&gMoltresReFightDialogue_4); + DisplayDungeonDialogue(gMoltresReFightDialogue_4); sub_803E708(10,0x46); DisplayDungeonDialogue(&gMoltresReFightDialogue_5); sub_803E708(10,0x46); @@ -1415,7 +1108,7 @@ void ArticunoPreFightDialogue(void) articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); sub_8086448(); SpriteLookAroundEffect(partnerEntity); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_1); + DisplayDungeonDialogue(gArticunoPreFightDialogue_1); sub_803E708(10,0x46); sub_8086598(); DungeonStopBGM(); @@ -1439,7 +1132,7 @@ void ArticunoPreFightDialogue(void) sub_803E708(4,0x46); SetFacingDirection(leaderEntity, DIRECTION_WEST); sub_803E708(10,0x46); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_4); + DisplayDungeonDialogue(gArticunoPreFightDialogue_4); sub_803E708(10,0x46); DisplayDungeonDialogue(&gArticunoPreFightDialogue_5); sub_803E708(10,0x46); @@ -1733,7 +1426,7 @@ void GroudonPreFightDialogue(void) alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_8086448(); - DisplayDungeonDialogue(&GroudonPreFightDialogue_1); + DisplayDungeonDialogue(GroudonPreFightDialogue_1); sub_803E708(10,0x46); sub_803E708(0x3c,0x46); DisplayDungeonDialogue(&GroudonPreFightDialogue_2); @@ -1774,12 +1467,12 @@ void GroudonPreFightDialogue(void) sub_803E708(0x28,0x46); PlaySoundEffect(0x1d5); SpriteLookAroundEffect(partnerEntity); - DisplayDungeonDialogue(&GroudonPreFightDialogue_10); + DisplayDungeonDialogue(GroudonPreFightDialogue_10); sub_803E708(10,0x46); sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(&GroudonPreFightDialogue_11); + DisplayDungeonDialogue(GroudonPreFightDialogue_11); sub_803E708(10,0x46); DungeonStopBGM(); GroudonScreenFlash2(); @@ -1794,7 +1487,7 @@ void GroudonPreFightDialogue(void) PlaySoundEffect(0x1fa); sub_8086738(); sub_8085930(DIRECTION_NORTH); - DisplayDungeonDialogue(&GroudonPreFightDialogue_14); + DisplayDungeonDialogue(GroudonPreFightDialogue_14); sub_803E708(10,0x46); sub_8086A54(groudonEntity); sub_8085930(DIRECTION_NORTH); @@ -1813,11 +1506,11 @@ void GroudonReFightDialogue(void) sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(&gGroudonReFightDialogue_1); + DisplayDungeonDialogue(gGroudonReFightDialogue_1); sub_803E708(10,0x46); GroudonScreenFlash(); sub_803E708(0x1e,0x46); - DisplayDungeonDialogue(&gGroudonReFightDialogue_2); + DisplayDungeonDialogue(gGroudonReFightDialogue_2); sub_803E708(10,0x46); DisplayDungeonDialogue(&gGroudonReFightDialogue_3); sub_803E708(10,0x46); @@ -1826,7 +1519,7 @@ void GroudonReFightDialogue(void) DungeonStopBGM(); PlaySoundEffect(0x1fa); sub_8086738(); - DisplayDungeonDialogue(&gGroudonReFightDialogue_4); + DisplayDungeonDialogue(gGroudonReFightDialogue_4); sub_803E708(10,0x46); sub_8086A54(groudonEntity); sub_8085930(DIRECTION_NORTH); @@ -2024,7 +1717,7 @@ void MagmaCavernMidDialogue(void) // // I'm certain we've come quite // far already.. - DisplayDungeonDialogue(&MagmaCavernMidDialogue_2); + DisplayDungeonDialogue(MagmaCavernMidDialogue_2); sub_803E708(10,0x46); DungeonStopBGM(); sub_80855E4(sub_80868F4); @@ -2046,7 +1739,7 @@ void MagmaCavernMidDialogue(void) // // Whew // It's over. - DisplayDungeonDialogue(&MagmaCavernMidDialogue_4); + DisplayDungeonDialogue(MagmaCavernMidDialogue_4); sub_803E708(10,0x46); PlaySoundEffect(0x1d5); SpriteLookAroundEffect(partnerEntity); @@ -2067,7 +1760,7 @@ void MagmaCavernMidDialogue(void) // // Hey! // Snap out of it! - DisplayDungeonDialogue(&MagmaCavernMidDialogue_6); + DisplayDungeonDialogue(MagmaCavernMidDialogue_6); sub_803E708(10,0x46); // Urrrrgh... DisplayDungeonDialogue(&MagmaCavernMidDialogue_7); @@ -2076,7 +1769,7 @@ void MagmaCavernMidDialogue(void) // What happened to you? // // What happened here? - DisplayDungeonDialogue(&MagmaCavernMidDialogue_8); + DisplayDungeonDialogue(MagmaCavernMidDialogue_8); sub_803E708(10,0x46); // We challenged.. // {POKEMON_2}... @@ -2100,7 +1793,7 @@ void MagmaCavernMidDialogue(void) // Wait... // What about {POKEMON_3}? // Where did {POKEMON_3} go? - DisplayDungeonDialogue(&MagmaCavernMidDialogue_12); + DisplayDungeonDialogue(MagmaCavernMidDialogue_12); sub_803E708(0x1e,0x46); // {POKEMON_3} is... // Still battling {POKEMON_2}... @@ -2283,7 +1976,7 @@ void RayquazaPreFightDialogue(void) sub_803E708(10,0x46); sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(&gRayquazaPreFightDialogue_3); + DisplayDungeonDialogue(gRayquazaPreFightDialogue_3); sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_4); diff --git a/src/dungeon_damage.c b/src/dungeon_damage.c new file mode 100644 index 000000000..ec29ea568 --- /dev/null +++ b/src/dungeon_damage.c @@ -0,0 +1,1675 @@ +#include "global.h" +#include "constants/ability.h" +#include "structs/str_dungeon.h" +#include "dungeon_logic.h" +#include "text_util.h" +#include "dungeon_message.h" +#include "string_format.h" +#include "type_effectiveness.h" +#include "constants/move_id.h" +#include "constants/monster.h" +#include "constants/status.h" +#include "constants/type.h" +#include "constants/iq_skill.h" +#include "math.h" +#include "number_util.h" +#include "status.h" +#include "dungeon_random.h" +#include "dungeon_items.h" +#include "structs/str_damage.h" +#include "dungeon_util.h" +#include "dungeon_config.h" +#include "dungeon_strings.h" +#include "dungeon_misc.h" +#include "weather.h" +#include "game_options.h" +#include "code_8077274_1.h" +#include "code_806CD90.h" +#include "constants/direction.h" +#include "constants/dungeon.h" +#include "code_803E46C.h" +#include "code_803E668.h" +#include "code_8041AD0.h" +#include "code_804267C.h" +#include "code_805D8C8.h" +#include "dungeon_map_access.h" +#include "move_effects_target.h" +#include "pokemon.h" +#include "position_util.h" +#include "random.h" +#include "sprite.h" +#include "exclusive_pokemon.h" + +extern void sub_807F43C(Entity *, Entity *); +extern void sub_8041B18(Entity *pokemon); +extern void sub_8041B90(Entity *pokemon); +extern void sub_8041D00(Entity *pokemon, Entity *target); +extern void SetShopkeeperAggression(Entity *, Entity *); +extern void sub_8042238(Entity *pokemon, Entity *target); +extern void sub_803ED30(s32, Entity *r0, u8, s32); +extern bool8 sub_806A458(Entity *); +extern bool8 sub_806F660(Entity *, Entity *); +extern bool8 sub_806A58C(s16 a0); +extern void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp); +extern void sub_8042148(Entity *pokemon); +extern void sub_8042A24(Entity *r0); +extern void sub_806A390(Entity *r0); +extern void sub_8078084(Entity * pokemon); +extern void sub_800DBBC(void); +extern void sub_80464C8(Entity *, DungeonPos *, Item *); +extern bool8 DoEnemiesEvolveWhenKOed(u8 dungeon); +extern bool8 sub_806FA5C(Entity *, Entity *, struct unkStruct_8069D4C *); +extern void EntityUpdateStatusSprites(Entity *); +extern bool8 sub_8045888(Entity *r0); +extern void sub_806F500(void); +extern void sub_803F508(Entity *); +extern bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct); +extern void sub_8041B74(Entity *pokemon); +extern void sub_8041B5C(Entity *pokemon); +extern void sub_8042940(Entity *r0); +extern void sub_80428B0(Entity *r0); +extern void sub_80428C4(Entity *r0); +extern void sub_80428D8(Entity *); +extern void sub_8042978(Entity *); +extern void sub_804298C(Entity *); +extern void sub_80428EC(Entity *); +extern void ResetMonEntityData(EntityInfo *, u32); + +extern u8 gUnknown_202F221; + +extern const s32 gUnknown_8106A4C; +extern const u8 *const gUnknown_8100548; +extern const u8 *const gUnknown_80FD46C; +extern const u8 *const gUnknown_810056C; +extern const s16 gUnknown_810AC60; +extern const s16 gUnknown_810AC68; +extern const s16 gUnknown_810AC64; +extern const s16 gUnknown_810AC66; +extern const s16 gUnknown_810AC68; +extern const s16 gUnknown_810AC62; + +static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struct DamageStruct *r5, bool32 isFalseSwipe, bool32 giveExp, s16 arg4_, s32 arg8); +void DealDamageToEntity(Entity *entity, s32 dmg, s32 r6, s32 r4); +void sub_806F63C(Entity *param_1); + +static const u32 gUnknown_8106EFC[] = { 0, 0 }; +static const s48_16 gUnknown_8106F04 = { 0x0, 0x10000 }; +static const s48_16 gUnknown_8106F0C = { 0x0, 0x20000 }; +static const s48_16 gUnknown_8106F14 = { 0x0, 0x18000 }; +static const s48_16 gUnknown_8106F1C = { 0x0, 0x8000 }; +static const s48_16 gUnknown_8106F24 = { 0x0, 0x3E70000 }; +UNUSED static const s48_16 sUnusedModifier1 = { 0, 0xC000 }; +UNUSED static const s48_16 sUnusedModifier2 = { 0x0, 0x17FFE }; +static const s48_16 gUnknown_8106F3C = {0x0, 0x8000}; +static const s48_16 gUnknown_8106F44 = {0x0, 0xE666}; +static const s48_16 gUnknown_8106F4C = {0x0, 0x18000}; + +void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC) +{ + bool32 r9; + // Some compiler weirdness, because it won't match without creating arg4 again + s32 r10 = arg4; + s32 returnDmg = 0; + + if (HandleDealingDamageInternal(attacker, target, dmgStruct, isFalseSwipe, giveExp, r10, argC)) + return; + if (dmgStruct->tookNoDamage) + return; + if (!EntityIsValid(attacker) || !EntityIsValid(target)) + return; + if (GetEntityType(attacker) != ENTITY_MONSTER || GetEntityType(target) != ENTITY_MONSTER) + return; + + r9 = arg8; + if (CheckVariousStatuses(target) || GetEntInfo(target)->bideClassStatus.status != 0) + r9 = FALSE; + if (r9 + && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1 + && attacker != target + && IsTypePhysical(dmgStruct->type) + && GetEntInfo(target)->reflectClassStatus.status == STATUS_VITAL_THROW) + { + sub_8042730(target, attacker); + sub_807F43C(target, attacker); + } + + if (GetEntInfo(target)->bideClassStatus.status == STATUS_ENRAGED) { + RaiseAttackStageTarget(attacker, target, gUnknown_8106A4C, 1); + } + + if (!EntityIsValid(attacker) || !EntityIsValid(target)) + return; + + if (r9 + && attacker != target + && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1) + { + bool32 isPhysical = IsTypePhysical(dmgStruct->type); + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_COUNTER && isPhysical) { + sub_8041B18(target); + returnDmg += 4; + } + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MINI_COUNTER && isPhysical) { + sub_8041B18(target); + returnDmg += 1; + } + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIRROR_COAT && !isPhysical) { + sub_8041B90(target); + returnDmg += 4; + } + + if (AbilityIsActive(target, ABILITY_ROUGH_SKIN)) + returnDmg += 2; + + if (returnDmg) { + struct DamageStruct sp; + + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCFA4); + sp.dmg = (dmgStruct->dmg * returnDmg) / 4; + sp.type = dmgStruct->type; + sp.residualDmgType = 6; + sp.typeEffectiveness = 2; + sp.isCrit = FALSE; + sp.unkE = 0; + sp.tookNoDamage = FALSE; + HandleDealingDamageInternal(target, attacker, &sp, FALSE, giveExp, r10, argC); + } + } + if (!EntityIsValid(attacker) || !EntityIsValid(target)) + return; + + // Check trapping / contact abilities + if (r9 + && attacker != target + && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1) + { + bool32 isPhysical = IsTypePhysical(dmgStruct->type); + EntityInfo *attackerInfo = GetEntInfo(attacker); + + if (AbilityIsActive(target, ABILITY_ARENA_TRAP) + && !MonsterIsType(attacker, TYPE_FLYING) + && !AbilityIsActive(attacker, ABILITY_LEVITATE) + && DungeonRandInt(100) < gArenaTrapActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_ARENA_TRAP; + } + if (AbilityIsActive(target, ABILITY_SHADOW_TAG) + && DungeonRandInt(100) < gShadowTagActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_SHADOW_TAG; + } + if (AbilityIsActive(target, ABILITY_MAGNET_PULL) + && MonsterIsType(attacker, TYPE_STEEL) + && DungeonRandInt(100) < gMagnetPullActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_MAGNET_PULL; + } + + if (AbilityIsActive(target, ABILITY_STATIC) + && isPhysical + && DungeonRandInt(100) < gStaticActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STATIC; + } + if (AbilityIsActive(target, ABILITY_POISON_POINT) + && DungeonRandInt(100) < gPoisonPointActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_POISON_POINT; + } + if (AbilityIsActive(target, ABILITY_EFFECT_SPORE) + && isPhysical + && DungeonRandInt(100) < gEffectSproreActivateChance) + { + s32 rnd = DungeonRandInt(3); + if (rnd < 1) + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_PSN; + else if (rnd < 2) + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_PRLZ; + else + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_SLP; + } + if (AbilityIsActive(target, ABILITY_FLAME_BODY) + && DungeonRandInt(100) < gFlameBodyActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_FLAME_BODY; + } + if (AbilityIsActive(target, ABILITY_CUTE_CHARM) + && isPhysical + && DungeonRandInt(100) < gCuteCharmActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_CUTE_CHARM; + } + if (AbilityIsActive(target, ABILITY_STENCH) + && DungeonRandInt(100) < gStenchActivateChance) + { + attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STENCH; + } + } + if (!EntityIsValid(attacker) || !EntityIsValid(target)) + return; + + // Destiny Bond + if (r9) { + EntityInfo *targetInfo = GetEntInfo(target); + if (targetInfo->leechSeedClassStatus.status == STATUS_DESTINY_BOND) { + Entity *destBondTarget = gDungeon->activePokemon[targetInfo->leechSeedClassStatus.unk8]; + if (destBondTarget == NULL) { + targetInfo->leechSeedClassStatus.status = 0; + } + else if (GetEntInfo(destBondTarget)->unk98 != targetInfo->leechSeedClassStatus.unk4) { + targetInfo->leechSeedClassStatus.status = 0; + } + else { + sub_8041D00(destBondTarget, target); + DealDamageToEntity(destBondTarget, dmgStruct->dmg, 0xC, 0x1F9); + } + } + } +} + +static inline u8 ItemId(Item *item) +{ + return item->id; +} + +static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4_, s32 arg8) +{ + s32 hpBefore, hpChange; + EntityInfo *targetData; + s32 arg4 = arg4_; + bool32 var_24 = FALSE; + bool32 r10 = FALSE; + s32 r8 = 0; + Tile *unkTile = NULL; + + dmgStruct->tookNoDamage = FALSE; + if (GetEntityType(target) != ENTITY_MONSTER) { + dmgStruct->tookNoDamage = TRUE; + return FALSE; + } + + targetData = GetEntInfo(target); + TrySendImmobilizeSleepEndMsg(attacker, target); + SetShopkeeperAggression(attacker, target); + if (GetEntityType(attacker) == ENTITY_MONSTER + && GetEntInfo(attacker)->sureShotClassStatus.status == STATUS_SET_DAMAGE + && dmgStruct->unkE == 0) + { + dmgStruct->dmg = gSetDamageDmgValue; + } + + if (arg4 != 0x20E && AbilityIsActive(target, ABILITY_STURDY) && dmgStruct->dmg == 9999) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90); + sub_8042238(attacker, target); + dmgStruct->tookNoDamage = TRUE; + return FALSE; + } + if (targetData->frozenClassStatus.status == STATUS_FROZEN) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); + sub_8042238(attacker, target); + dmgStruct->tookNoDamage = TRUE; + return FALSE; + } + + if ((targetData->sleepClassStatus.status == STATUS_SLEEP || targetData->sleepClassStatus.status == STATUS_NAPPING || targetData->sleepClassStatus.status == STATUS_NIGHTMARE) + && targetData->sleepClassStatus.turns == 0x7F) + { + WakeUpPokemon(target); + } + + if ((AbilityIsActive(target, ABILITY_VOLT_ABSORB) && dmgStruct->type == TYPE_ELECTRIC)) { + HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); + dmgStruct->tookNoDamage = TRUE; + return FALSE; + } + else if (AbilityIsActive(target, ABILITY_WATER_ABSORB) && dmgStruct->type == TYPE_WATER) { + HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); + dmgStruct->tookNoDamage = TRUE; + return FALSE; + } + + if (targetData->unk152 == 0) { + if (dmgStruct->isCrit) { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9614); + } + switch (dmgStruct->typeEffectiveness) { + case EFFECTIVENESS_IMMUNE: + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9630); + break; + case EFFECTIVENESS_RESIST: + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9654); + break; + case EFFECTIVENESS_SUPER: + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9670); + break; + } + } + + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + if (dmgStruct->dmg == 0) { + if (sub_8045888(attacker) && sub_8045888(target)) { + if (targetData->unk152 == 0) { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); + } + sub_8042238(attacker, target); + } + else { + if (targetData->unk152 == 0) { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); + } + sub_803E708(0x1E, 0x18); + } + dmgStruct->tookNoDamage = TRUE; + return FALSE; + } + else if (dmgStruct->dmg == 9999) { + if (arg8 != 0 && sub_8045888(target)) { + unkTile = GetTileAtEntitySafe(target); + sub_803E708(0x14, 0x18); + unkTile->spawnOrVisibilityFlags |= 4; + sub_8049ED4(); + } + if (targetData->unk152 == 0) { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F96A8); + } + targetData->unkA0 = 999; + } + else { + const u8 *str; + + gFormatArgs[0] = dmgStruct->dmg; + str = gUnknown_80F9764[dmgStruct->residualDmgType]; + + ASM_MATCH_TRICK(dmgStruct); + + targetData->unkA0 += dmgStruct->dmg; + if (targetData->unkA0 > 999) + targetData->unkA0 = 999; + + if (sub_8045888(target)) { + if (dmgStruct->residualDmgType != 14) { + sub_803ED30(-dmgStruct->dmg, target, 1, -1); + } + if (targetData->unk152 == 0 && str != NULL) { + TryDisplayDungeonLoggableMessage3(attacker, target, str); + } + } + else { + if (targetData->unk152 == 0 && str != NULL) { + TryDisplayDungeonLoggableMessage3(attacker, target, str); + } + } + } + + if ((dmgStruct->residualDmgType != 14 || targetData->HP <= 1) && unkTile == NULL && sub_8045888(target)) { + if ((attacker->pos.x != target->pos.x || attacker->pos.y != target->pos.y) && GetEntityType(attacker) == ENTITY_MONSTER) { + bool32 unkBool = FALSE; + if (targetData->isTeamLeader) { + if (gGameOptionsRef->damageTurn != 0 && !sub_806A458(target)) { + if (CanSeeTarget(target, attacker)) + unkBool = TRUE; + else + unkBool = FALSE; + } + } + else { + unkBool = FALSE; + } + if (targetData->blinkerClassStatus.status == STATUS_BLINKER || targetData->blinkerClassStatus.status == STATUS_CROSS_EYED) + unkBool = FALSE; + if (unkBool) { + EntityInfo *info = GetEntInfo(target); + info->action.direction = (GetDirectionTowardsPosition(&target->pos, &attacker->pos) & DIRECTION_MASK); + } + TargetTileInFront(target); + } + sub_806CDD4(target, 6, GetEntInfo(target)->action.direction); + sub_80420E8(target, dmgStruct); + var_24 = TRUE; + } + + // HP goes down + hpBefore = targetData->HP; + if (targetData->HP > dmgStruct->dmg) + targetData->HP -= dmgStruct->dmg; + else + targetData->HP = 0; + + if (targetData->reflectClassStatus.status == STATUS_ENDURING) { + if (targetData->HP == 0) { + targetData->HP = 1; + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_8100548); + } + } + else if (isFalseSwipe == TRUE && targetData->HP == 0) { + targetData->HP = 1; + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_810056C); + } + + hpChange = hpBefore - targetData->HP; + if (hpChange < 0) + hpChange = 0; + + if (var_24 || unkTile != NULL) + sub_803E708(0xA, 0x18); + + if (targetData->HP != 0) { + if (var_24) { + sub_806CE68(target, 8); + } + if (HasHeldItem(target, ITEM_JOY_RIBBON) && hpChange > 0 && dmgStruct->dmg != 9999) { + sub_8071D4C(attacker, target, hpChange); + } + + if (unkTile != NULL) + { + unkTile->spawnOrVisibilityFlags &= ~(0x4); + sub_8049ED4(); + } + return FALSE; + } + + // 0 HP + if (targetData->invisibleClassStatus.status == STATUS_TRANSFORMED) { + SendTransformEndMessage(attacker, target); + } + + if (unkTile != NULL) { + sub_803E708(0x14, 0x18); + target->unk22 = 2; + sub_803E708(0xA, 0x18); + unkTile->spawnOrVisibilityFlags &= ~(0x4); + sub_8049ED4(); + } + else if (var_24) { + target->unk22 = 1; + sub_803E708(0x1E, 0x18); + } + + r8 = 1; + if (EntityIsValid(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && attacker != target) + r8 = 0; + + targetData->unk14C = 0; + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + if (dmgStruct->residualDmgType == 19 || dmgStruct->residualDmgType == 20) { + if (targetData->isNotTeamMember) { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9E44); + } + else { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9E44); + } + } + else if (targetData->isNotTeamMember) + { + if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); + } + else { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9CC0[r8]); + } + } + else { + PokemonStruct2 *recruitedMon = &gRecruitedPokemonRef->pokemon2[targetData->teamIndex]; + if (targetData->isTeamLeader || (targetData->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]); + } + else if (IsExperienceLocked(targetData->joinedAt.id)) { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]); + } + else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); + } + else if (sub_806A58C(recruitedMon->unkA)) { + if (gDungeon->unk644.unk19 != 0) { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D8C[r8]); + } + else { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D84[r8]); + } + } + else { + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D28[r8]); + } + } + + if (targetData->frozenClassStatus.status == STATUS_WRAP || targetData->frozenClassStatus.status == STATUS_WRAPPED) { + sub_8076CB4(targetData->unk9C); + } + + // Try revive items + if (targetData->heldItem.flags & ITEM_FLAG_EXISTS) { + // This do/while 0 loop has no effect other than matching asm, and can be removed. + do + { + if (!(ItemSticky(&targetData->heldItem)) && !(ItemInShop(&targetData->heldItem)) && ItemId(&targetData->heldItem) == ITEM_REVIVER_ORB) { + sub_8042148(target); + target->unk22 = 0; + targetData->HP = targetData->maxHPStat; + targetData->unk158 = 0; + targetData->unk14C = 1; + targetData->belly = targetData->maxBelly; + if (targetData->isTeamLeader) { + gDungeon->unk644.unk35 = 0; + gDungeon->unk644.itemHoldersIdentified = 0; + } + ZeroOutItem(&targetData->heldItem); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); + } + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); + } + sub_8078084(target); + ResetMonEntityData(targetData, 0); + sub_800DBBC(); + sub_806A390(target); + sub_806CCB4(target, sub_806CEBC(target)); + EntityUpdateStatusSprites(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); + sub_806F63C(target); + return FALSE; + } + } while(0); + } + + if (targetData->isTeamLeader) + { + Item *heldItem = &targetData->heldItem; + if (ItemExists(heldItem) && !(ItemSticky(heldItem)) && ItemId(heldItem) == ITEM_POSSESS_ORB ) { + s32 i; + Entity *teamMember; + + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { + teamMember = gDungeon->teamPokemon[i]; + if (EntityIsValid(teamMember) + && teamMember != target + && CanSeeTarget(target, teamMember) + && abs(teamMember->pos.x - target->pos.x) <= 1 && abs(teamMember->pos.y - target->pos.y) <= 1) + { + break; + } + } + if (i != MAX_TEAM_MEMBERS) { + DungeonPos monPos; // r4 + + sub_8042148(target); + + monPos = teamMember->pos; + sub_8068FE0(teamMember, 0x221, target); + sub_80694C0(target, monPos.x, monPos.y, 1); + sub_804535C(target, NULL); + target->unk22 = 0; + targetData->HP = targetData->maxHPStat; + sub_8042A24(target); + targetData->unk158 = 0; + targetData->unk14C = 1; + targetData->belly = targetData->maxBelly; + if (targetData->isTeamLeader) { + gDungeon->unk644.unk35 = 0; + gDungeon->unk644.itemHoldersIdentified = 0; + } + ZeroOutItem(heldItem); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); + } + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); + } + sub_8078084(target); + ResetMonEntityData(targetData, 0); + sub_800DBBC(); + sub_806A390(target); + sub_806CCB4(target, sub_806CEBC(target)); + EntityUpdateStatusSprites(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], teamMember, 0); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484); + sub_806F63C(target); + return FALSE; + } + + } + + } + + if (IQSkillIsEnabled(target, IQ_ITEM_MASTER)) { + s32 i; // r3 + Item *reviverSeed = NULL; // r4 + if (ItemExists(&targetData->heldItem) && !ItemSticky(&targetData->heldItem) && ItemId(&targetData->heldItem) == ITEM_REVIVER_SEED) + reviverSeed = &targetData->heldItem; + if (reviverSeed == NULL && !targetData->isNotTeamMember) { + for (i = 0; i < INVENTORY_SIZE; i++) { + Item *bagItem = &gTeamInventoryRef->teamItems[i]; + if (!(bagItem->flags & ITEM_FLAG_EXISTS)) + continue; + if (bagItem->flags & ITEM_FLAG_STICKY) + continue; + if (bagItem->id == ITEM_REVIVER_SEED) { + reviverSeed = bagItem; + break; + } + } + } + + if (reviverSeed != NULL) { + sub_8042148(target); + CreateItemWithStickyChance(reviverSeed, ITEM_PLAIN_SEED, FORCE_STICKY_NEVER); + target->unk22 = 0; + targetData->HP = targetData->maxHPStat; + targetData->unk158 = 0; + targetData->unk14C = 1; + targetData->belly = targetData->maxBelly; + if (targetData->isTeamLeader) { + gDungeon->unk644.unk35 = 0; + gDungeon->unk644.itemHoldersIdentified = 0; + } + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); + } + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); + } + sub_8078084(target); + ResetMonEntityData(targetData, 0); + sub_800DBBC(); + sub_806A390(target); + sub_806CCB4(target, sub_806CEBC(target)); + EntityUpdateStatusSprites(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); + sub_806F63C(target); + return FALSE; + } + } + + if (!targetData->isTeamLeader && ItemExists(&targetData->heldItem)) { + sub_80464C8(target, &target->pos, &targetData->heldItem); + ZeroOutItem(&targetData->heldItem); + } + if (targetData->bossFlag) { + gDungeon->unk644.bossSongIndex = 999; + } + + // Give exp + r10 = FALSE; + if (GetEntityType(attacker) == ENTITY_MONSTER) { + EntityInfo *attackerData = GetEntInfo(attacker); + s32 exp = CalculateEXPGain(targetData->id, targetData->level); + switch (targetData->expMultiplier) { + case EXP_BOOSTED: + exp *= 3; + exp /= 2; + break; + case EXP_HALVED: + exp /= 2; + break; + } + if (exp == 0) + exp = 1; + if (attackerData->isTeamLeader) { + sub_80980B4(targetData->id); + } + if (targetData->grudge) { + attackerData->unk14B = 1; + } + + if (giveExp == TRUE) { + if (!attackerData->isNotTeamMember) { + if (targetData->isNotTeamMember) { + s32 i; + + sub_8071D4C(attacker, attacker, exp); + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { + Entity *teamMember = gDungeon->teamPokemon[i]; + if (EntityIsValid(teamMember) && teamMember != attacker) { + sub_8071D4C(attacker, teamMember, exp); + } + } + r10 = TRUE; + } + } + else { + if (DoEnemiesEvolveWhenKOed(gDungeon->unk644.dungeonLocation.id)) { + attackerData->unk149 = 1; + gDungeon->unkD = 1; + } + } + } + } + + if (EntityIsValid(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && !GetEntInfo(attacker)->isTeamLeader) + r10 = FALSE; + + if (r10) { + struct unkStruct_8069D4C sp; + + sub_8069D4C(&sp, target); + if (sub_806F660(attacker, target)) { + if (!sub_806FA5C(attacker, target, &sp)) { + sub_8068FE0(target, 0x1F5, attacker); + } + else { + gUnknown_202F221 = 1; + } + } + else { + sub_8068FE0(target, arg4, attacker); + } + } + else { + sub_8068FE0(target, arg4, attacker); + } + + return TRUE; +} + +bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, DamageStruct *dmgStruct) +{ + bool8 torrentFlag; + bool8 overgrowFlag; + bool8 swarmFlag; + bool8 blazeFlag; + bool8 torrentVisualFlag; + bool8 overgrowVisualFlag; + bool8 swarmVisualFlag; + bool8 blazeVisualFlag; + bool8 bVar4; + EntityInfo *targetInfo; + s32 effectiveness; + s32 index; + s32 local_38 [2]; + s32 hasWonderGuard; + s32 normalOrFightingType; + EntityInfo *pokemonInfo; + u8 weather; + s32 temp; + + bVar4 = FALSE; + normalOrFightingType = FALSE; + pokemonInfo = GetEntInfo(pokemon); + targetInfo = GetEntInfo(target); + FP48_16_FromS32(param_1, 1); + dmgStruct->isCrit = 0; + dmgStruct->unkE = 0; + hasWonderGuard = FALSE; + if (!EntityIsValid(target)) { + return TRUE; + } + else { + if ((type == TYPE_NORMAL) || (type == TYPE_FIGHTING)) { + normalOrFightingType = TRUE; + } + if ((AbilityIsActive(target, ABILITY_WONDER_GUARD)) && (type != TYPE_NONE)) { + hasWonderGuard = TRUE; + } + dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; + for (index = 0; index < 2; index++) { + const s48_16 *local_48[] = {&gUnknown_8106F3C, &gUnknown_8106F44, &gUnknown_8106F04, &gUnknown_8106F4C}; + if (F48_16_IsZero(param_1)) break; + if (((normalOrFightingType) && (targetInfo->types[index] == TYPE_GHOST)) && (targetInfo->exposed == FALSE)) { + effectiveness = EFFECTIVENESS_IMMUNE; + gDungeon->unk134.pokemonExposed = TRUE; + } + else { + effectiveness = gTypeEffectivenessChart[type][targetInfo->types[index]]; + } + if (effectiveness != EFFECTIVENESS_NEUTRAL) { + F48_16_SMul(param_1,param_1,local_48[effectiveness]); + } + local_38[index] = effectiveness; + gDungeon->unk134.unk13C[index] = effectiveness; + } + + dmgStruct->typeEffectiveness = gEffectivenessChart[local_38[0]][local_38[1]]; + bVar4 = TRUE; + if ((dmgStruct->typeEffectiveness != EFFECTIVENESS_SUPER) && (bVar4 = FALSE, hasWonderGuard)) { + temp = gUnknown_8106EFC[1]; + param_1->hi = gUnknown_8106EFC[0]; + param_1->lo = temp; + } + + if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (AbilityIsActive(target,ABILITY_THICK_FAT))) { + gDungeon->unk134.unk16D = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); + } + if ((type == TYPE_FIRE) && (GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE)) { + gDungeon->unk134.fill16E[0] = TRUE; + FP48_16_FromS32(param_1,0); + dmgStruct->typeEffectiveness = EFFECTIVENESS_IMMUNE; + dmgStruct->isCrit = 0; + dmgStruct->unkE = 1; + bVar4 = FALSE; + } + if ((type == TYPE_GROUND) && (AbilityIsActive(target, ABILITY_LEVITATE))) { + gDungeon->unk134.fill16E[1] = TRUE; + FP48_16_FromS32(param_1,0); + dmgStruct->typeEffectiveness = EFFECTIVENESS_IMMUNE; + dmgStruct->isCrit = 0; + dmgStruct->unkE = 1; + bVar4 = FALSE; + } + if ((type == TYPE_WATER) && (AbilityIsActive(pokemon, ABILITY_TORRENT))) { + torrentFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; + torrentVisualFlag = SetVisualFlags(pokemonInfo,0x80,torrentFlag); + if (torrentFlag) { + gDungeon->unk134.fill16E[2] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); + } + if (torrentVisualFlag) { + sub_80428EC(pokemon); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEDA8); + } + } + if ((type == TYPE_GRASS) && (AbilityIsActive(pokemon, ABILITY_OVERGROW))) { + overgrowFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; + overgrowVisualFlag = SetVisualFlags(pokemonInfo,2,overgrowFlag); + if (overgrowFlag) { + gDungeon->unk134.fill16E[3] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); + } + if (overgrowVisualFlag) { + sub_80428D8(pokemon); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FED88); + } + } + if ((type == TYPE_BUG) && (AbilityIsActive(pokemon, ABILITY_SWARM))) { + swarmFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; + swarmVisualFlag = SetVisualFlags(pokemonInfo,0x10,swarmFlag); + if (swarmFlag) { + gDungeon->unk134.fill16E[4] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); + } + if (swarmVisualFlag) { + sub_8042978(pokemon); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEDC8); + } + } + if ((type == TYPE_FIRE) && (AbilityIsActive(pokemon, ABILITY_BLAZE))) { + blazeFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; + blazeVisualFlag = SetVisualFlags(pokemonInfo,0x20,blazeFlag); + if (blazeFlag) { + gDungeon->unk134.fill16E[5] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); + } + if (blazeVisualFlag) { + sub_804298C(pokemon); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEDE8); + } + } + if (!(F48_16_IsZero(param_1)) && (MonsterIsType(pokemon, type))) { + gDungeon->unk134.fill16E[6] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F14); + } + weather = GetApparentWeather(pokemon); + if (weather == WEATHER_SUNNY) { + if (type == TYPE_FIRE) { + gDungeon->unk134.unk16C = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F14); + } + else if (type == TYPE_WATER) { + gDungeon->unk134.unk16C = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); + } + } + if (weather == WEATHER_RAIN) { + if (type == TYPE_FIRE) { + gDungeon->unk134.unk16B = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); + } + else if (type == TYPE_WATER) { + gDungeon->unk134.unk16B = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F14); + } + } + if ((weather == WEATHER_CLOUDY) && (type != TYPE_NORMAL)) { + static const s48_16 gUnknown_8106F64 = {0x0, 0xC000}; + F48_16_SMul(param_1,param_1, &gUnknown_8106F64); + gDungeon->unk134.unk16A = TRUE; + } + if (((gDungeon->weather.mudSportTurns != 0) || (weather == WEATHER_FOG)) && (type == TYPE_ELECTRIC)) { + gDungeon->unk134.fill16E[7] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); + } + if ((gDungeon->weather.waterSportTurns != 0) && (type == TYPE_FIRE)) { + gDungeon->unk134.fill16E[8] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); + } + if ((type == TYPE_ELECTRIC) && (pokemonInfo->bideClassStatus.status == STATUS_CHARGING)) { + gDungeon->unk134.fill16E[9] = TRUE; + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); + } + } + return bVar4; +} + +s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) +{ + s32 weight = 1; + bool8 checkExposed = FALSE; + EntityInfo *userData; + EntityInfo *targetData; + u8 *targetTypes; + u8 *targetType; + u32 moveTypeOffset; + if (!EntityIsValid(target)) + { + return 1; + } + if (moveType == TYPE_NORMAL || moveType == TYPE_FIGHTING) + { + checkExposed = TRUE; + } + userData = GetEntInfo(user); + targetData = GetEntInfo(target); + if (moveType == TYPE_FIRE && GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE) + { + return 0; + } + if (moveType == TYPE_ELECTRIC && AbilityIsActive(target, ABILITY_VOLT_ABSORB)) + { + return 0; + } + if (moveType == TYPE_WATER && AbilityIsActive(target, ABILITY_WATER_ABSORB)) + { + return 0; + } + if (moveType == TYPE_GROUND && AbilityIsActive(target, ABILITY_LEVITATE)) + { + return 1; + } + targetTypes = targetData->types; + moveTypeOffset = moveType * NUM_TYPES * sizeof(s16); + targetType = targetData->types; + do + { + s32 effectiveness; + u32 typeEffectivenessMultipliers[NUM_EFFECTIVENESS] = {0, 1, 2, 4}; + if (checkExposed && *targetType == TYPE_GHOST && !targetData->exposed) + { + effectiveness = 0; + gDungeon->unk134.pokemonExposed = TRUE; + } + else + { + effectiveness = gTypeEffectivenessChart[moveType][*targetType]; + // Used to swap variable initialization order at the loop start. + effectiveness = *(s16*)(((s8*) gTypeEffectivenessChart) + moveTypeOffset + *targetType * 2); + } + if (weight == 0) + { + goto breakLoop; + } + weight *= typeEffectivenessMultipliers[effectiveness]; + weight /= 2; + if (weight == 0) + { + // BUG: If the Pokmon's first type resists the move, the second type is ignored. + // This calculates type effectiveness incorrectly if the first type resists the move and the second type is weak to the move. + // For example, a Fire-type move is considered not very effective against a Rock/Bug-type like Anorith. + return 2; + } + } while ((s32)(++targetType) <= (s32)(targetTypes + 1)); + breakLoop: + if ((moveType == TYPE_FIRE || moveType == TYPE_ICE) && AbilityIsActive(target, ABILITY_THICK_FAT)) + { + return 2; + } + if (moveType == TYPE_WATER && AbilityIsActive(user, ABILITY_TORRENT)) + { + s32 maxHPStat = userData->maxHPStat; + if (maxHPStat < 0) + { + maxHPStat += 3; + } + if (maxHPStat >> 2 >= userData->HP) + { + weight *= 2; + } + } + if (moveType == TYPE_GRASS && AbilityIsActive(user, ABILITY_OVERGROW)) + { + s32 maxHPStat = userData->maxHPStat; + if (maxHPStat < 0) + { + maxHPStat += 3; + } + if (maxHPStat >> 2 >= userData->HP) + { + weight *= 2; + } + } + if (moveType == TYPE_BUG && AbilityIsActive(user, ABILITY_SWARM)) + { + s32 maxHPStat = userData->maxHPStat; + if (maxHPStat < 0) + { + maxHPStat += 3; + } + if (maxHPStat >> 2 >= userData->HP) + { + weight *= 2; + } + } + if (moveType == TYPE_FIRE && AbilityIsActive(user, ABILITY_BLAZE)) + { + s32 maxHPStat = userData->maxHPStat; + if (maxHPStat < 0) + { + maxHPStat += 3; + } + if (maxHPStat >> 2 >= userData->HP) + { + weight *= 2; + } + } + if (weight == 0) + { + return 2; + } + if (MonsterIsType(user, moveType)) + { + weight *= 2; + } + targetTypes = targetData->types; + if (GetApparentWeather(user) == WEATHER_SUNNY) + { + if (moveType == TYPE_FIRE) + { + weight *= 2; + } + else if (moveType == TYPE_WATER) + { + return 2; + } + } + if (gDungeon->weather.mudSportTurns != 0 && moveType == TYPE_ELECTRIC) + { + return 2; + } + if (gDungeon->weather.waterSportTurns != 0 && moveType == TYPE_FIRE) + { + return 2; + } + if (moveType == TYPE_ELECTRIC && userData->bideClassStatus.status == STATUS_CHARGING) + { + weight *= 2; + } + if (weight > 2) + { + weight = 3; + } + return weight + 2; +} + +static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, s32 *atkStat, s32 *defStat, s32 rand) +{ + bool32 isNotEnemy; + s32 atkMultiplier = 1; + s32 atkDivisor = 1; + s32 defMultiplier = 1; + s32 defDivisor = 1; + s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0; + + if (AbilityIsActive(attacker, ABILITY_GUTS)) { + EntityInfo *entInfo = GetEntInfo(attacker); + bool8 gutsBoost = HasNegativeStatus(attacker); + bool8 visFlags_attacker_1 = SetVisualFlags(entInfo,1,gutsBoost); + + if (gutsBoost) { + atkMultiplier = 2; + } + if (visFlags_attacker_1) { + sub_80428B0(attacker); + TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE04); // Guts boosted its power + } + } + + if ((AbilityIsActive(attacker, ABILITY_HUGE_POWER)) || (AbilityIsActive(attacker, ABILITY_PURE_POWER))) { + EntityInfo *entInfo = GetEntInfo(attacker); + bool32 hugePowerBoost = (rand < 33 && splitIndex == 0); + bool8 visFlags_attacker_2 = SetVisualFlags(entInfo,0x100,hugePowerBoost); + + if (hugePowerBoost) { + atkMultiplier *= 3; + atkDivisor *= 2; + } + if (visFlags_attacker_2) { + sub_80428C4(attacker); + TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE2C); // It's special ability boosted Attack + } + } + + if ((AbilityIsActive(attacker, ABILITY_HUSTLE)) && (splitIndex == 0)) { + atkMultiplier *= 3; + atkDivisor *= 2; + } + + if (GetEntInfo(attacker)->isNotTeamMember) { + isNotEnemy = FALSE; + } + else { + isNotEnemy = TRUE; + } + + if ((AbilityIsActive(attacker, ABILITY_PLUS)) && (splitIndex == 1) && gDungeon->minusIsActive[isNotEnemy]) { + atkMultiplier *= 15; + atkDivisor *= 10; + } + if ((AbilityIsActive(attacker, ABILITY_MINUS)) && (splitIndex == 1) && gDungeon->plusIsActive[isNotEnemy]) { + atkMultiplier *= 15; + atkDivisor *= 10; + } + + if (AbilityIsActive(target, ABILITY_INTIMIDATE) && (splitIndex == 0)) { + atkMultiplier *= 4; + atkDivisor *= 5; + } + + if ((AbilityIsActive(target, ABILITY_MARVEL_SCALE)) && (splitIndex == 0)) { + EntityInfo *targetInfo = GetEntInfo(target); + bool8 hasNegStatus_target = HasNegativeStatus(target); + bool8 visFlags_target = SetVisualFlags(targetInfo, 8, hasNegStatus_target); + + if (hasNegStatus_target) { + defMultiplier *= 3; + defDivisor *= 2; + } + if (visFlags_target) { + sub_8042940(target); + TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE54); // Its special ability quickened attacks! + } + } + + *atkStat *= atkMultiplier; + *defStat *= defMultiplier; + if (atkDivisor != 1) { + *atkStat = *atkStat / atkDivisor; + } + if (defDivisor != 1) { + *defStat = *defStat / defDivisor; + } +} + +static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType) +{ + dmgStruct->dmg = 1; + dmgStruct->residualDmgType = 0; + dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct->type = moveType; + dmgStruct->isCrit = FALSE; + dmgStruct->unkE = 0; + dmgStruct->tookNoDamage = FALSE; +} + +void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s24_8 arg8, u16 moveId, bool8 arg_10) +{ + EntityInfo *attackerInfo = GetEntInfo(attacker); + EntityInfo *targetInfo = GetEntInfo(target); + s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0; + + sub_806F500(); + if (!attackerInfo->isTeamLeader && FixedPointToInt(attackerInfo->belly) == 0) { + SetDamageOne(dmgStruct, moveType); + } + else if (moveId == MOVE_REGULAR_ATTACK && AbilityIsActive(target, ABILITY_WONDER_GUARD)) { + SetDamageOne(dmgStruct, moveType); + } + else { + s32 atkStatStage, defStatStage; + s24_8 statCalc; + s32 atkStat, defStat; + s32 rand; + s32 r6; + s48_16 unkSp1; + s48_16 unkSp2; + s48_16 unkSp3; + s48_16 unkSp4; + s48_16 unkSp5; + s48_16 unkSp6; + s48_16 unkSp7; + s48_16 unkSp8; + s48_16 unkSp9; + s48_16 unkSp10; + s48_16 unkSp11; + bool8 r5; + + dmgStruct->type = moveType; + gDungeon->unk134.unk134 = moveType; + gDungeon->unk134.unk138 = splitIndex; + + atkStatStage = attackerInfo->offensiveStages[splitIndex]; + if (arg_10 && moveType == TYPE_FIRE) { + atkStatStage += attackerInfo->flashFireBoost; + gDungeon->unk134.unk140[2] = attackerInfo->flashFireBoost; + } + if (attackerInfo->apparentID == MONSTER_DEOXYS_ATTACK) { + atkStatStage += 2; + } + if (attackerInfo->apparentID == MONSTER_DEOXYS_DEFENSE) { + atkStatStage -= 2; + } + if (attackerInfo->apparentID == MONSTER_DEOXYS_SPEED) { + atkStatStage -= 2; + } + + if (atkStatStage < 0) atkStatStage = 0; + if (atkStatStage > 20) atkStatStage = 20; + + gDungeon->unk134.unk13E[0] = atkStatStage; + gDungeon->unk134.unk140[0] = attackerInfo->atk[splitIndex] + movePower; + statCalc = s24_8_mul(IntToF248(attackerInfo->atk[splitIndex] + movePower), gAtkStatStageMultipliers[atkStatStage]); + statCalc = s24_8_mul(statCalc, attackerInfo->offensiveMultipliers[splitIndex]); + atkStat = F248ToInt(statCalc); + + defStatStage = targetInfo->defensiveStages[splitIndex]; + if (splitIndex == 0 && targetInfo->bideClassStatus.status == STATUS_SKULL_BASH) { + gDungeon->unk134.unk17A = 1; + defStatStage++; + } + if (targetInfo->apparentID == MONSTER_DEOXYS_ATTACK) { + defStatStage -= 2; + } + if (targetInfo->apparentID == MONSTER_DEOXYS_DEFENSE) { + defStatStage += 2; + } + if (targetInfo->apparentID == MONSTER_DEOXYS_SPEED) { + defStatStage -= 2; + } + + if (defStatStage < 0) defStatStage = 0; + if (defStatStage > 20) defStatStage = 20; + + gDungeon->unk134.unk13E[1] = defStatStage; + gDungeon->unk134.unk140[1] = targetInfo->def[splitIndex]; + statCalc = s24_8_mul(IntToF248(targetInfo->def[splitIndex]), gDefStatStageMultipliers[defStatStage]); + statCalc = s24_8_mul(statCalc, targetInfo->defensiveMultipliers[splitIndex]); + defStat = F248ToInt(statCalc); + + rand = DungeonRandInt(100); + if (splitIndex == 0) { + if (HasHeldItem(attacker, ITEM_POWER_BAND)) { + atkStat += gUnknown_810AC60; + gDungeon->unk134.unk160 += gUnknown_810AC60; + } + if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { + atkStat += gUnknown_810AC68; + gDungeon->unk134.unk160 += gUnknown_810AC68; + } + if (arg_10 && HasHeldItem(target, ITEM_DEF_SCARF)) { + defStat += gUnknown_810AC64; + gDungeon->unk134.unk162 += gUnknown_810AC64; + } + } + else { + if (arg_10 && HasHeldItem(target, ITEM_ZINC_BAND)) { + defStat += gUnknown_810AC66; + gDungeon->unk134.unk163 += gUnknown_810AC66; + } + if (HasHeldItem(attacker, ITEM_SPECIAL_BAND)) { + atkStat += gUnknown_810AC62; + gDungeon->unk134.unk161 += gUnknown_810AC62; + } + if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { + atkStat += gUnknown_810AC68; + gDungeon->unk134.unk161 += gUnknown_810AC68; + } + } + + gDungeon->unk134.unk140[3] = atkStat; + gDungeon->unk134.unk140[4] = defStat; + if (atkStat < 0) atkStat = 0; + if (atkStat >= 999) atkStat = 999; + + attackerInfo->previousVisualFlags &= ~(0x100); + attackerInfo->visualFlags &= ~(0x100); + ApplyAtkDefStatBoosts(attacker, target, moveType, &atkStat, &defStat, rand); + FP48_16_FromS32(&unkSp1, atkStat - defStat); + FP48_16_FromS32(&unkSp2, 8); + F48_16_SDiv(&unkSp1, &unkSp1, &unkSp2); + if (!attackerInfo->isNotTeamMember) { + FP48_16_FromS32(&unkSp2, attackerInfo->level); + unkSp3.hi = 0; + unkSp3.lo = 0xAAAA; + F48_16_SMul(&unkSp2, &unkSp2, &unkSp3); + r6 = (attackerInfo->level * 2) / 3; + } + else { + s32 unkAtkStat2 = attackerInfo->atk[splitIndex]; + s32 unkDefStat2 = 1; + ApplyAtkDefStatBoosts(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); + FP48_16_FromS32(&unkSp2, unkAtkStat2); + FP48_16_FromS32(&unkSp3, 3); + F48_16_SDiv(&unkSp2, &unkSp2, &unkSp3); + r6 = unkAtkStat2 / 3; + } + FP48_16_Add(&unkSp4, &unkSp1, &unkSp2); + gDungeon->unk134.unk140[5] = r6; + gDungeon->unk134.unk140[6] = FP48_16_ToS32(&unkSp4); + unkSp5 = unkSp4; + unkSp7 = unkSp4; + F48_16_SMul(&unkSp5, &unkSp5, &unkSp5); + unkSp6.hi = 0; + unkSp6.lo = 0xCCC; + F48_16_SMul(&unkSp5, &unkSp5, &unkSp6); + FP48_16_FromS32(&unkSp6, 2); + F48_16_SMul(&unkSp7, &unkSp7, &unkSp6); + FP48_16_FromS32(&unkSp6, defStat); + FP48_16_Subtract(&unkSp7, &unkSp7, &unkSp6); + FP48_16_FromS32(&unkSp6, 10); + FP48_16_Add(&unkSp7, &unkSp7, &unkSp6); + FP48_16_Add(&unkSp8, &unkSp5, &unkSp7); + if (FP48_16_SLessThan(&gUnknown_8106F24, &unkSp8)) { + unkSp8 = gUnknown_8106F24; + } + if (FP48_16_SLessThan(&unkSp8, &gUnknown_8106F04)) { + unkSp8 = gUnknown_8106F04; + } + r5 = sub_806E100(&unkSp9, attacker, target, moveType, dmgStruct); + + if (moveType == TYPE_FIRE) { + s32 flashFireStatus = GetFlashFireStatus(target); + if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) { + targetInfo->unk152 = 1; + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger! + } + else { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FADD8); // m1 used Flash Fire to absorb fire! + } + } + } + if (arg_10) { + if (splitIndex == 0 && targetInfo->reflectClassStatus.status == STATUS_REFLECT) { + sub_8041B74(target); + F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); + gDungeon->unk134.unk166 = 1; + } + if (splitIndex == 1 && targetInfo->reflectClassStatus.status == STATUS_LIGHT_SCREEN) { + sub_8041B5C(target); + F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); + gDungeon->unk134.unk167 = 1; + } + } + + // Check crit + if (!AbilityIsActive(target, ABILITY_BATTLE_ARMOR) && !AbilityIsActive(target, ABILITY_SHELL_ARMOR)) { + s32 critOdds; + + if (attackerInfo->isNotTeamMember) { + critOdds = 0; + } + else { + critOdds = critChance; + } + + if (attackerInfo->sureShotClassStatus.status == STATUS_FOCUS_ENERGY) { + critOdds = 999; + gDungeon->unk134.unk168 = 1; + } + else { + if (HasHeldItem(attacker, ITEM_SCOPE_LENS)) { + critOdds += gCritOddsScopeLensPatsyBand; + gDungeon->unk134.unk164 = 1; + } + if (HasHeldItem(target, ITEM_PATSY_BAND)) { + critOdds += gCritOddsScopeLensPatsyBand; + gDungeon->unk134.unk165 = 1; + } + if (r5 && IQSkillIsEnabled(attacker, IQ_TYPE_ADVANTAGE_MASTER)) { + critOdds = gCritOddsIqAdvantageMaster; + gDungeon->unk134.unk169 = 1; + } + } + if (DungeonRandInt(100) < critOdds) { + F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F14); + dmgStruct->isCrit = TRUE; + } + } + + gDungeon->unk134.unk154 = FP48_16_ToS32(&unkSp8); + F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); + { + // Ugly hack needed to match + #ifdef NONMATCHING + s24_8 arg8_Match; + #else + register s24_8 arg8_Match asm("r2"); + #endif // NONMATCHING + + gDungeon->unk134.unk15C = arg8_Match = arg8; + FP48_16_FromF248(&unkSp10, arg8_Match); + F48_16_SMul(&unkSp8, &unkSp8, &unkSp10); + } + + // ALSO needed to match. unk694 chosen randomly and it worked with matching. + ASM_MATCH_TRICK(gDungeon->unk644.unk50); + gDungeon->unk134.unk150 = FP48_16_ToS32(&unkSp8); + { + s32 rnd = DungeonRandInt(0x4000); + unkSp9.hi = 0; + unkSp9.lo = 0xE000 + rnd; + } + F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); + FP48_16_FromS32(&unkSp11, 100); + + F48_16_SMul(&unkSp9, &unkSp11, &unkSp9); + gDungeon->unk134.unk158 = FP48_16_ToS32(&unkSp9); + + dmgStruct->dmg = FP48_16_ToS32(&unkSp8); + dmgStruct->residualDmgType = 0; + if (dmgStruct->dmg == 0) { + dmgStruct->isCrit = FALSE; + } + } +} + +void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct) +{ + s48_16 unkSp1; + s48_16 unkSp2; + s32 a2New = a2; + + if (a2New <= 0) a2New = 1; + if (a2New > 999) a2New = 999; + + dmgStruct->type = moveType; + sub_806E100(&unkSp1, attacker, target, moveType, dmgStruct); + FP48_16_FromS32(&unkSp2, a2New); + F48_16_SMul(&unkSp2, &unkSp2, &unkSp1); + dmgStruct->dmg = FP48_16_ToS32(&unkSp2); + dmgStruct->residualDmgType = 0; +} + +void DealDamageToEntity(Entity *entity, s32 dmg, s32 r6, s32 r4) +{ + Entity spEntity; + struct DamageStruct dmgStruct; + s32 r4_ = (s16) r4; + + sub_80457DC(&spEntity); + dmgStruct.dmg = dmg; + dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct.type = TYPE_NONE; + dmgStruct.residualDmgType = r6; + dmgStruct.isCrit = FALSE; + dmgStruct.unkE = 0; + dmgStruct.tookNoDamage = FALSE; + HandleDealingDamage(&spEntity, entity, &dmgStruct, FALSE, FALSE, r4_, FALSE, 0); +} + +void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 giveExp, bool8 *tookNoDamage, u8 moveType, s16 arg_8, s32 residualDmgType, s32 arg_10, s32 arg_14) +{ + s32 i; + struct DamageStruct dmgStruct; + s32 arg_8_ = arg_8; + s32 dmgNew = dmg; + + dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct.residualDmgType = residualDmgType; + dmgStruct.type = moveType; + dmgStruct.isCrit = FALSE; + dmgStruct.unkE = 0; + + if (moveType != TYPE_NONE) { + s32 typeEffectiveness[2]; + EntityInfo *targetInfo = GetEntInfo(target); + for (i = 0; i < 2; i++) { + s32 effectiv = gTypeEffectivenessChart[moveType][targetInfo->types[i]]; + typeEffectiveness[i] = effectiv; + } + if (AbilityIsActive(target, ABILITY_WONDER_GUARD)) { + if (gEffectivenessChart[typeEffectiveness[0]][typeEffectiveness[1]] != EFFECTIVENESS_SUPER) { + dmgNew = 0; + } + } + } + + dmgStruct.dmg = dmgNew; + if (dmgNew == 0) { + dmgStruct.tookNoDamage = TRUE; + } + else { + dmgStruct.tookNoDamage = FALSE; + } + + HandleDealingDamage(pokemon, target, &dmgStruct, FALSE, giveExp, arg_8_, arg_10, arg_14); + if (tookNoDamage != NULL) { + *tookNoDamage = dmgStruct.tookNoDamage; + } +} + +void SetShopkeeperAggression(Entity *pokemon, Entity *target) +{ + EntityInfo *info; + + info = GetEntInfo(target); + + if(info->shopkeeper != SHOPKEEPER_MODE_NORMAL) + { + if(GetEntityType(pokemon) == ENTITY_MONSTER) + { + if(GetEntInfo(pokemon)->isNotTeamMember) + { + info->shopkeeper = SHOPKEEPER_MODE_ATTACK_ENEMIES; + } + else + { + info->shopkeeper = SHOPKEEPER_MODE_ATTACK_TEAM; + } + } + } +} + +void sub_806F480(Entity *pokemon, u8 r1) +{ + EntityInfo *info; + + info = GetEntInfo(pokemon); + + if(info->shopkeeper != SHOPKEEPER_MODE_NORMAL) + { + if(r1) + { + info->shopkeeper = SHOPKEEPER_MODE_ATTACK_ENEMIES; + } + else + { + info->shopkeeper = SHOPKEEPER_MODE_ATTACK_TEAM; + } + } +} + +u8 sub_806F4A4(Entity *pokemon, u8 type) +{ + EntityInfo *info = GetEntInfo(pokemon); + s32 index; + + if(MonsterIsType(pokemon, TYPE_GHOST)) + { + if(type == TYPE_NORMAL || type == TYPE_FIGHTING) + if(!info->exposed) + return FALSE; + } + for(index = 0; index < 2; index++) + { + if(gTypeEffectivenessChart[type][info->types[index]] == EFFECTIVENESS_IMMUNE) + return FALSE; + } + return TRUE; +} + +void sub_806F500(void) +{ + struct unkStruct_Dungeon134_sub *temp; + + temp = &gDungeon->unk134; + + temp->unk134 = 0; + temp->unk138 = 0; + temp->unk13C[0] = 0; + temp->unk13C[1] = 0; + temp->unk13E[0] = 0xA; + temp->unk13E[1] = 0xA; + temp->unk140[0] = 1; + temp->unk140[1] = 1; + temp->unk140[2] = 0; + temp->unk140[4] = 0; + temp->unk140[3] = 0; + temp->unk140[5] = 0; + temp->unk140[6] = 0; + temp->unk150 = 0; + temp->unk158 = 0; + temp->unk15C = F248_ZERO; + temp->unk160 = 0; + temp->unk161 = 0; + temp->unk162 = 0; + temp->unk163 = 0; + temp->unk164 = 0; + temp->unk165 = 0; + temp->unk166 = 0; + temp->unk167 = 0; + temp->unk168 = 0; + temp->unk169 = 0; + temp->unk16A = 0; + temp->unk16C = 0; + temp->unk16B = 0; + temp->unk16D = 0; + temp->fill16E[0] = 0; + temp->fill16E[1] = 0; + temp->fill16E[2] = 0; + temp->fill16E[3] = 0; + temp->fill16E[4] = 0; + temp->fill16E[5] = 0; + temp->fill16E[6] = 0; + temp->fill16E[7] = 0; + temp->fill16E[8] = 0; + temp->fill16E[9] = 0; + temp->fill16E[10] = 0; + temp->pokemonExposed = FALSE; + temp->unk17A = 0; +} + +static const s32 gUnknown_8106F7C[] = {0, 0, 0, 1}; + +s32 sub_806F62C(int param_1) +{ + return gUnknown_8106F7C[param_1]; +} + +void sub_806F63C(Entity *param_1) +{ + UnkDungeonGlobal_unk181E8_sub *temp; + + temp = &gDungeon->unk181e8; + + if (temp->cameraTarget == param_1) { + sub_803F508(temp->cameraTarget); + } +} diff --git a/src/dungeon_data.c b/src/dungeon_data.c new file mode 100644 index 000000000..fdf495714 --- /dev/null +++ b/src/dungeon_data.c @@ -0,0 +1,597 @@ +#include "global.h" +// #include "globaldata.h" TODO: once gDungeons is moved to C +#include "dungeon_data.h" +#include "dungeon_map_access.h" +#include "constants/walkable_tile.h" + +// TODO: gDungeons from `dungeon/dungeon_data.inc` + +const u8 gInvalidDungeonIDs[11] = +{ + DUNGEON_BOSS_3, + DUNGEON_BOSS_4, + DUNGEON_BOSS_9, + DUNGEON_WONDROUS_SEA, + DUNGEON_AUTOPILOT, + DUNGEON_D50, + DUNGEON_D51, + DUNGEON_D54, + DUNGEON_POISON_MAZE, + DUNGEON_D61, + DUNGEON_OUT_ON_RESCUE +}; + +// NDS=020C3448 +const u8 gInvalidItemIDs[16] = +{ + ITEM_G_MACHINE_6, + ITEM_G_MACHINE_7, + ITEM_G_MACHINE_8, + ITEM_TM_SPIN_SLASH, + ITEM_SWITCH_BOX, + ITEM_ALERT_SPECS, + ITEM_POSSESS_ORB, + ITEM_REVIVER_ORB, + ITEM_TM_EXCAVATE, + ITEM_TOSS_ORB, + ITEM_RING_D, + ITEM_RING_E, + ITEM_RING_F, + ITEM_OBSERVER_ORB, + ITEM_BEATUP_ORB, + NUMBER_OF_ITEM_IDS +}; + +const bool8 gTacticsTargetLeader[NUM_TACTICS] = +{ + [TACTIC_LETS_GO_TOGETHER] = TRUE, + [TACTIC_GO_THE_OTHER_WAY] = FALSE, + [TACTIC_GO_AFTER_FOES] = FALSE, + [TACTIC_AVOID_THE_FIRST_HIT] = FALSE, + [TACTIC_ALL_FOR_ONE] = TRUE, + [TACTIC_GROUP_SAFETY] = TRUE, + [TACTIC_AVOID_TROUBLE] = TRUE, + [TACTIC_BE_PATIENT] = TRUE, + [TACTIC_KEEP_YOUR_DISTANCE] = TRUE, + [TACTIC_WAIT_THERE] = FALSE, + [TACTIC_GET_AWAY] = TRUE, + [TACTIC_UNUSED] = FALSE +}; + +const s16 gReqTacticLvls[NUM_TACTICS] = +{ + [TACTIC_LETS_GO_TOGETHER] = 1, + [TACTIC_GO_THE_OTHER_WAY] = 25, + [TACTIC_GO_AFTER_FOES] = 1, + [TACTIC_AVOID_THE_FIRST_HIT] = 1, + [TACTIC_ALL_FOR_ONE] = 999, + [TACTIC_GROUP_SAFETY] = 999, + [TACTIC_AVOID_TROUBLE] = 35, + [TACTIC_BE_PATIENT] = 40, + [TACTIC_KEEP_YOUR_DISTANCE] = 20, + [TACTIC_WAIT_THERE] = 15, + [TACTIC_GET_AWAY] = 10, + [TACTIC_UNUSED] = 999, +}; + +const s32 gReqIQSkillPts[NUM_IQ_SKILLS] = +{ + [IQ_NONE] = 9999, + [IQ_TYPE_ADVANTAGE_MASTER] = 105, + [IQ_ITEM_CATCHER] = 1, + [IQ_COURSE_CHECKER] = 1, + [IQ_SURE_HIT_ATTACKER] = 500, + [IQ_QUICK_DODGER] = 100, + [IQ_PP_CHECKER] = 2, + [IQ_NONTRAITOR] = 40, + [IQ_STATUS_CHECKER] = 25, + [IQ_EXP_GO_GETTER] = 200, + [IQ_EFFICIENCY_EXPERT] = 10, + [IQ_WEAK_TYPE_PICKER] = 125, + [IQ_ALL_TERRAIN_HIKER] = 400, + [IQ_SUPER_MOBILE] = 990, + [IQ_TRAP_AVOIDER] = 140, + [IQ_HOUSE_AVOIDER] = 800, + [IQ_ENERGY_SAVER] = 250, + [IQ_NONSLEEPER] = 160, + [IQ_SELF_CURER] = 70, + [IQ_TRAP_SEER] = 600, + [IQ_LAVA_EVADER] = 300, + [IQ_DEDICATED_TRAVELER] = 1, + [IQ_ITEM_MASTER] = 1, + [IQ_EXCLUSIVE_MOVE_USER] = 1, +}; + +// LUT for money item stack size -> money amount +// NDS=020C359C +const s32 gUnknown_810A3F0[100] = { + 4, 6, 10, 14, 22, 26, 34, 38, 46, 58, + 62, 74, 82, 86, 94, 106, 118, 122, 134, 142, + 146, 158, 166, 178, 194, 202, 206, 214, 218, 226, + 254, 262, 274, 278, 298, 302, 314, 326, 334, 346, + 358, 362, 382, 386, 394, 398, 422, 446, 454, 458, + 466, 478, 482, 502, 514, 526, 538, 542, 554, 562, + 566, 586, 614, 622, 626, 634, 662, 674, 694, 698, + 706, 718, 734, 746, 758, 768, 778, 794, 802, 818, + 838, 842, 862, 866, 878, 886, 898, 914, 922, 926, + 934, 958, 974, 982, 998, 1000, 1100, 1300, 1500, 20000 +}; + +const s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS] = +{ + [TYPE_NONE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + [TYPE_NORMAL] = {0x00, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x03, 0x03, 0x03}, + [TYPE_FIRE] = {0x00, 0x03, 0x07, 0x04, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04, 0x03, 0x03, 0x02, 0x04, 0x03, 0x03, 0x03, 0x02}, + [TYPE_WATER] = {0x00, 0x03, 0x02, 0x07, 0x04, 0x04, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02}, + [TYPE_GRASS] = {0x00, 0x03, 0x04, 0x02, 0x07, 0x02, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03}, + [TYPE_ELECTRIC] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x07, 0x03, 0x03, 0x03, 0x04, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02}, + [TYPE_ICE] = {0x00, 0x03, 0x04, 0x03, 0x03, 0x03, 0x07, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x03, 0x04}, + [TYPE_FIGHTING] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x03, 0x03, 0x04, 0x04, 0x02, 0x02, 0x03, 0x03, 0x02, 0x03}, + [TYPE_POISON] = {0x00, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x02, 0x07, 0x04, 0x03, 0x04, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03}, + [TYPE_GROUND] = {0x00, 0x03, 0x03, 0x04, 0x04, 0x01, 0x04, 0x03, 0x02, 0x07, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x03, 0x03}, + [TYPE_FLYING] = {0x00, 0x03, 0x03, 0x03, 0x02, 0x04, 0x04, 0x02, 0x03, 0x01, 0x07, 0x03, 0x02, 0x04, 0x03, 0x03, 0x03, 0x03}, + [TYPE_PSYCHIC] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x03, 0x07, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03}, + [TYPE_BUG] = {0x00, 0x03, 0x04, 0x03, 0x02, 0x03, 0x03, 0x02, 0x03, 0x02, 0x04, 0x03, 0x07, 0x04, 0x03, 0x03, 0x03, 0x03}, + [TYPE_ROCK] = {0x00, 0x02, 0x02, 0x04, 0x04, 0x03, 0x03, 0x04, 0x02, 0x04, 0x02, 0x03, 0x03, 0x07, 0x03, 0x03, 0x03, 0x04}, + [TYPE_GHOST] = {0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x02, 0x03, 0x03, 0x04, 0x02, 0x03, 0x07, 0x03, 0x04, 0x03}, + [TYPE_DRAGON] = {0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x03, 0x03}, + [TYPE_DARK] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x03, 0x01, 0x04, 0x03, 0x02, 0x03, 0x07, 0x03}, + [TYPE_STEEL] = {0x00, 0x02, 0x04, 0x03, 0x02, 0x03, 0x02, 0x04, 0x01, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07}, +}; + +const s16 gUnknown_810A808[NUM_TYPES][NUMBER_OF_GUMMIS] = +{ + [TYPE_NONE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + [TYPE_NORMAL] = {0x00, 0x3c, 0x19, 0x19, 0x19, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x05, 0x19, 0x19, 0x19}, + [TYPE_FIRE] = {0x00, 0x19, 0x3c, 0x1e, 0x14, 0x19, 0x14, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x14, 0x1e, 0x19, 0x19, 0x19, 0x14}, + [TYPE_WATER] = {0x00, 0x19, 0x14, 0x3c, 0x1e, 0x1e, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x14}, + [TYPE_GRASS] = {0x00, 0x19, 0x1e, 0x14, 0x3c, 0x14, 0x1e, 0x19, 0x1e, 0x14, 0x1e, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19}, + [TYPE_ELECTRIC] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x3c, 0x19, 0x19, 0x19, 0x1e, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x14}, + [TYPE_ICE] = {0x00, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x3c, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x1e}, + [TYPE_FIGHTING] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x3c, 0x19, 0x19, 0x1e, 0x1e, 0x14, 0x14, 0x19, 0x19, 0x14, 0x19}, + [TYPE_POISON] = {0x00, 0x19, 0x19, 0x19, 0x14, 0x19, 0x19, 0x14, 0x3c, 0x1e, 0x19, 0x1e, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19}, + [TYPE_GROUND] = {0x00, 0x19, 0x19, 0x1e, 0x1e, 0x05, 0x1e, 0x19, 0x14, 0x3c, 0x19, 0x19, 0x19, 0x14, 0x19, 0x19, 0x19, 0x19}, + [TYPE_FLYING] = {0x00, 0x19, 0x19, 0x19, 0x14, 0x1e, 0x1e, 0x14, 0x19, 0x05, 0x3c, 0x19, 0x14, 0x1e, 0x19, 0x19, 0x19, 0x19}, + [TYPE_PSYCHIC] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x14, 0x19, 0x19, 0x19, 0x3c, 0x1e, 0x19, 0x1e, 0x19, 0x1e, 0x19}, + [TYPE_BUG] = {0x00, 0x19, 0x1e, 0x19, 0x14, 0x19, 0x19, 0x14, 0x19, 0x14, 0x1e, 0x19, 0x3c, 0x1e, 0x19, 0x19, 0x19, 0x19}, + [TYPE_ROCK] = {0x00, 0x14, 0x14, 0x1e, 0x1e, 0x19, 0x19, 0x1e, 0x14, 0x1e, 0x14, 0x19, 0x19, 0x3c, 0x19, 0x19, 0x19, 0x1e}, + [TYPE_GHOST] = {0x00, 0x05, 0x19, 0x19, 0x19, 0x19, 0x19, 0x05, 0x14, 0x19, 0x19, 0x1e, 0x14, 0x19, 0x3c, 0x19, 0x1e, 0x19}, + [TYPE_DRAGON] = {0x00, 0x19, 0x14, 0x14, 0x14, 0x14, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x3c, 0x19, 0x19}, + [TYPE_DARK] = {0x00, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x1e, 0x19, 0x19, 0x19, 0x05, 0x1e, 0x19, 0x14, 0x19, 0x3c, 0x19}, + [TYPE_STEEL] = {0x00, 0x14, 0x1e, 0x19, 0x14, 0x19, 0x14, 0x1e, 0x05, 0x1e, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x3c}, +}; + +const FriendAreaSettings gFriendAreaSettings[NUM_FRIEND_AREAS] = +{ + [FRIEND_AREA_NONE] = { + .num_pokemon = 0, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 0, + }, + [BOUNTIFUL_SEA] = { + .num_pokemon = 9, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5500, + }, + [TREASURE_SEA] = { + .num_pokemon = 10, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 4500, + }, + [SERENE_SEA] = { + .num_pokemon = 4, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 8000, + }, + [DEEP_SEA_FLOOR] = { + .num_pokemon = 12, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5500, + }, + [DEEP_SEA_CURRENT] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 0, + }, + [SEAFLOOR_CAVE] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 0, + }, + [SHALLOW_BEACH] = { + .num_pokemon = 5, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5000, + }, + [MT_DEEPGREEN] = { + .num_pokemon = 12, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 130, + }, + [MT_CLEFT] = { + .num_pokemon = 9, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5000, + }, + [MT_MOONVIEW] = { + .num_pokemon = 6, + .unlock_condition = UNLOCK_WONDER_MAIL, + .price = 0, + }, + [RAINBOW_PEAK] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 6500, + }, + [WILD_PLAINS] = { + .num_pokemon = 13, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 100, + }, + [BEAU_PLAINS] = { + .num_pokemon = 12, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 600, + }, + [SKY_BLUE_PLAINS] = { + .num_pokemon = 13, + .unlock_condition = UNLOCK_WONDER_MAIL, + .price = 0, + }, + [SAFARI] = { + .num_pokemon = 15, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 700, + }, + [SCORCHED_PLAINS] = { + .num_pokemon = 10, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5000, + }, + [SACRED_FIELD] = { + .num_pokemon = 3, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 6500 + }, + [MIST_RISE_FOREST] = { + .num_pokemon = 14, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 150 + }, + [FLYAWAY_FOREST] = { + .num_pokemon = 12, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 550 + }, + [OVERGROWN_FOREST] = { + .num_pokemon = 9, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 600 + }, + [ENERGETIC_FOREST] = { + .num_pokemon = 15, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5000 + }, + [MUSHROOM_FOREST] = { + .num_pokemon = 7, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 500 + }, + [HEALING_FOREST] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 0 + }, + [TRANSFORM_FOREST] = { + .num_pokemon = 6, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 500 + }, + [SECRETIVE_FOREST] = { + .num_pokemon = 9, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 6500 + }, + [RUB_A_DUB_RIVER] = { + .num_pokemon = 7, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 500 + }, + [TADPOLE_POND] = { + .num_pokemon = 9, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 500 + }, + [TURTLESHELL_POND] = { + .num_pokemon = 10, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5500 + }, + [MYSTIC_LAKE] = { + .num_pokemon = 4, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 2500 + }, + [WATERFALL_LAKE] = { + .num_pokemon = 4, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 3500 + }, + [PEANUT_SWAMP] = { + .num_pokemon = 7, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 2500 + }, + [POISON_SWAMP] = { + .num_pokemon = 6, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 8500 + }, + [ECHO_CAVE] = { + .num_pokemon = 11, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 7500 + }, + [CRYPTIC_CAVE] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 6500 + }, + [DRAGON_CAVE] = { + .num_pokemon = 3, + .unlock_condition = UNLOCK_WONDER_MAIL, + .price = 0 + }, + [BOULDER_CAVE] = { + .num_pokemon = 4, + .unlock_condition = UNLOCK_WONDER_MAIL, + .price = 0 + }, + [JUNGLE] = { + .num_pokemon = 13, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 800 + }, + [DECREPIT_LAB] = { + .num_pokemon = 7, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 1000 + }, + [MT_DISCIPLINE] = { + .num_pokemon = 11, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 1200 + }, + [THUNDER_MEADOW] = { + .num_pokemon = 11, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 1000 + }, + [POWER_PLANT] = { + .num_pokemon = 6, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 600 + }, + [CRATER] = { + .num_pokemon = 7, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 7500 + }, + [FURNACE_DESERT] = { + .num_pokemon = 7, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 8500 + }, + [AGED_CHAMBER_AN] = { + .num_pokemon = 14, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5500 + }, + [AGED_CHAMBER_O_EXCLAIM] = { + .num_pokemon = 14, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 5500 + }, + [ANCIENT_RELIC] = { + .num_pokemon = 6, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 8000 + }, + [DARKNESS_RIDGE] = { + .num_pokemon = 13, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 0 + }, + [FRIGID_CAVERN] = { + .num_pokemon = 7, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 9000 + }, + [ICE_FLOE_BEACH] = { + .num_pokemon = 5, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 9500 + }, + [VOLCANIC_PIT] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 0 + }, + [STRATOS_LOOKOUT] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 0 + }, + [RAVAGED_FIELD] = { + .num_pokemon = 5, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 1000 + }, + [MAGNETIC_QUARRY] = { + .num_pokemon = 3, + .unlock_condition = UNLOCK_SHOP_STORY, + .price = 1000 + }, + [LEGENDARY_ISLAND] = { + .num_pokemon = 3, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 7500 + }, + [SOUTHERN_ISLAND] = { + .num_pokemon = 2, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 9500 + }, + [ENCLOSED_ISLAND] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_LEGENDARY_REQUEST, + .price = 0 + }, + [FINAL_ISLAND] = { + .num_pokemon = 1, + .unlock_condition = UNLOCK_SHOP_POST_GAME, + .price = 8500 + }, +}; + +const s16 gUnknown_810AC60 = 12; +const s16 gUnknown_810AC62 = 12; +const s16 gUnknown_810AC64 = 8; +const s16 gUnknown_810AC66 = 8; +const s16 gUnknown_810AC68 = 8; + +const u8 gBestResistTypeTable[NUM_TYPES] = +{ + [TYPE_NONE] = TYPE_NONE, + [TYPE_NORMAL] = TYPE_GHOST, + [TYPE_FIRE] = TYPE_WATER, + [TYPE_WATER] = TYPE_GRASS, + [TYPE_GRASS] = TYPE_BUG, + [TYPE_ELECTRIC] = TYPE_GROUND, + [TYPE_ICE] = TYPE_FIRE, + [TYPE_FIGHTING] = TYPE_GHOST, + [TYPE_POISON] = TYPE_STEEL, + [TYPE_GROUND] = TYPE_FLYING, + [TYPE_FLYING] = TYPE_ROCK, + [TYPE_PSYCHIC] = TYPE_DARK, + [TYPE_BUG] = TYPE_POISON, + [TYPE_ROCK] = TYPE_FIGHTING, + [TYPE_GHOST] = TYPE_NORMAL, + [TYPE_DRAGON] = TYPE_STEEL, + [TYPE_DARK] = TYPE_DARK, + [TYPE_STEEL] = TYPE_ELECTRIC, +}; + +const bool8 gIsTypePhysicalTable[NUM_TYPES] = { + [TYPE_NONE] = TRUE, + [TYPE_NORMAL] = TRUE, + [TYPE_FIGHTING] = TRUE, + [TYPE_POISON] = TRUE, + [TYPE_GROUND] = TRUE, + [TYPE_FLYING] = TRUE, + [TYPE_BUG] = TRUE, + [TYPE_ROCK] = TRUE, + [TYPE_GHOST] = TRUE, + [TYPE_STEEL] = TRUE, +}; +const s32 gUnknown_810AC90[10] = {2, 4, 6, 7, 8, 9, 0xA, 0xD, 0xF, 0x11}; +const s16 gFrenzyPlantIQReq = 333; +const s16 gHydroCannonIQReq = 333; +const s16 gBlastBurnIQReq = 333; +const s16 gVoltTackleIQReq = 333; + +const u8 gDungeonWaterType[76] = { + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_WATER, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_WATER, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_LAVA, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_LAVA, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_LAVA, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_LAVA, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, + DUNGEON_WATER_TYPE_NONE, +}; + +const struct ExclusivePokemon gExclusivePokemon[NUM_EXCLUSIVE_POKEMON] = { + + RED_EXCLUSIVE(MONSTER_PORYGON), + BLUE_EXCLUSIVE(MONSTER_PORYGON2), + BLUE_EXCLUSIVE(MONSTER_MAGIKARP), + BLUE_EXCLUSIVE(MONSTER_GYARADOS), + RED_EXCLUSIVE(MONSTER_FEEBAS), + RED_EXCLUSIVE(MONSTER_MILOTIC), + RED_EXCLUSIVE(MONSTER_PLUSLE), + BLUE_EXCLUSIVE(MONSTER_MINUN), + BLUE_EXCLUSIVE(MONSTER_LAPRAS), + RED_EXCLUSIVE(MONSTER_MANTINE), + RED_EXCLUSIVE(MONSTER_ROSELIA), + BLUE_EXCLUSIVE(MONSTER_AIPOM), +}; diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index 8ab386c0f..505c5ef70 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -1,17 +1,16 @@ #include "global.h" -#include "dungeon_engine.h" - +#include "globaldata.h" +#include "run_dungeon.h" #include "code_803E46C.h" #include "constants/dungeon.h" #include "dungeon_ai_leader.h" #include "dungeon_ai.h" #include "dungeon_leader.h" -#include "dungeon_movement.h" #include "dungeon_util.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" - -extern s16 gSpeedTurns[2][25]; +#include "constants/ability.h" +#include "dungeon_logic.h" extern bool8 sub_8044B28(void); extern void TrySpawnMonsterAndActivatePlusMinus(void); @@ -22,41 +21,24 @@ extern void sub_8044AB4(void); extern u8 UseAttack(u32); extern void TickStatusHeal(Entity *); extern void sub_8086AC0(void); -extern void sub_8043ED0(u32); extern void sub_8071DA4(Entity *); extern void TriggerWeatherAbilities(void); extern void DungeonHandlePlayerInput(void); extern void sub_805F02C(void); +extern void sub_8074094(Entity *); +extern void sub_8071B48(void); +extern void sub_807EAA0(u32, u32); static void sub_8044454(void); static bool8 xxx_dungeon_80442D0(bool8); - -bool8 IsBossFight() -{ - if (gDungeon->fixedRoomNumber != 0 && gDungeon->fixedRoomNumber <= 0x31) - { - return TRUE; - } - return FALSE; -} - -bool8 IsCurrentFixedRoomBossFight() -{ - if (gDungeon->tileset > DUNGEON_OUT_ON_RESCUE) - { - return TRUE; - } - return FALSE; -} - -bool8 IsMakuhitaTrainingMaze(void) -{ - if (DUNGEON_IS_MAZE(gDungeon->unk644.dungeonLocation.id)) - return TRUE; - else - return FALSE; -} +const s16 gSpeedTurns[NUM_SPEED_COUNTERS][25] = { + [0] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0}, + [1] = {0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, 0}, + [2] = {0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0}, + [3] = {0, 22, 23, 24, 0, 25, 26, 27, 0, 28, 29, 30, 0, 31, 32, 33, 0, 34, 35, 36, 0, 37, 38, 39, 0}, + [4] = {40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64}, +}; void RunFractionalTurn(bool8 param_1) { @@ -221,3 +203,283 @@ void sub_80444F4(Entity *pokemon) } } } + +struct Struct_8044574 +{ + Entity *entityPtr; + struct Struct_8044574 *next; +}; + +void sub_8044574(void) +{ + s32 i, id; + struct Struct_8044574 sp0[4]; + struct Struct_8044574 sp40[4]; + + Entity *leader = GetLeader(); + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { + Entity *teamMon = gDungeon->teamPokemon[i]; + if (EntityIsValid(teamMon)) { + EntityInfo *teamMonInfo = GetEntInfo(teamMon); + if (!teamMonInfo->isTeamLeader) { + s32 spdStage; + + if (sub_8044B28()) + break; + gDungeon->unkB8 = teamMon; + TriggerWeatherAbilities(); + teamMonInfo->aiAllySkip = FALSE; + + spdStage = CalcSpeedStage(teamMon); + if (gSpeedTurns[spdStage][gDungeon->unk644.fractionalTurn] != 0 + && !teamMonInfo->attacking + && !(teamMonInfo->flags & 0x8000)) + { + if (teamMonInfo->flags & 0x4000) { + teamMonInfo->flags &= ~(0x4000); + } + else { + teamMonInfo->recalculateFollow = FALSE; + TickStatusHeal(teamMon); + if (EntityIsValid(teamMon)) { + s32 j; + + sub_8071DA4(teamMon); + for (j = 0; j < 3; j++) { + RunMonsterAI(teamMon, 0); + if (sub_8044B28() || !sub_8072CF4(teamMon)) + break; + sub_8086AC0(); + sub_8043ED0(0); + if (sub_8044B28()) + break; + } + } + } + } + } + } + } + + for (id = 0; id < 3; id++) { + struct Struct_8044574 *ptr; + + for (i = 0; i < 3; i++) { + sp0[i].entityPtr = NULL; + sp0[i].next = &sp0[i+1]; + } + sp0[3].entityPtr = NULL; + sp0[3].next = NULL; + + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { + Entity *teamMon = gDungeon->teamPokemon[i]; + if (EntityIsValid(teamMon)) { + EntityInfo *teamMonInfo = GetEntInfo(teamMon); + if (teamMonInfo->aiAllySkip) { + if (teamMonInfo->isTeamLeader) { + teamMonInfo->recalculateFollow = FALSE; + teamMonInfo->aiAllySkip = FALSE; + } + else { + s32 x = abs(leader->pos.x - teamMon->pos.x); + s32 y = abs(leader->pos.y - teamMon->pos.y); + s32 distance = max(x, y); + + if (distance >= 3) + distance = 2; + + sp40[i].entityPtr = teamMon; + sp40[i].next = sp0[distance].next; + sp0[distance].next = &sp40[i]; + } + } + } + } + + ptr = &sp0[0]; + while (ptr != NULL) { + Entity *entity = ptr->entityPtr; + if (entity != NULL) { + EntityInfo *info = GetEntInfo(entity); + info->recalculateFollow = TRUE; + info->aiAllySkip = FALSE; + RunMonsterAI(entity,1); + sub_8072CF4(entity); + sub_8086AC0(); + sub_8043ED0(0); + EntityIsValid(entity); // Does nothing + } + ptr = ptr->next; + } + } + + if (!sub_8044B28()) { + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { + Entity *teamMon = gDungeon->teamPokemon[i]; + if (EntityIsValid(teamMon)) { + EntityInfo *teamMonInfo = GetEntInfo(teamMon); + if (teamMonInfo->aiAllySkip) { + sub_8074094(teamMon); + if (EntityIsValid(teamMon)) { + sub_8071DA4(teamMon); + teamMonInfo->aiAllySkip = FALSE; + } + } + } + } + } +} + +void sub_8044820(void) +{ + s32 movSpeed; + EntityInfo *entityInfo; + EntityInfo *entityInfo2; + Entity * entity; + Entity * entity2; + s32 index; + + for (index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { + entity = gDungeon->wildPokemon[index]; + if (EntityIsValid(entity)) { + if (sub_8044B28()) break; + entityInfo = GetEntInfo(entity); + gDungeon->unkB8 = entity; + TriggerWeatherAbilities(); + if ((entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY) == 0) { + if ((u16)(entityInfo->flags & MOVEMENT_FLAG_UNK_14) != 0) { + entityInfo->flags &= ~(MOVEMENT_FLAG_UNK_14); + } + else + { + entityInfo->aiAllySkip = FALSE; + movSpeed = CalcSpeedStage(entity); + if (gSpeedTurns[movSpeed][gDungeon->unk644.fractionalTurn] != 0) { + if (!entityInfo->attacking) { + entityInfo->flags &= ~(MOVEMENT_FLAG_UNK_14 | MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY); + entityInfo->recalculateFollow = FALSE; + TickStatusHeal(entity); + if (EntityIsValid(entity)) { + sub_8071DA4(entity); + RunMonsterAI(entity, 0); + if (sub_8044B28()) break; + sub_8072CF4(entity); + sub_8086AC0(); + sub_8043ED0(0); + if (sub_8044B28()) break; + } + } + } + } + } + } + } + if (sub_8044B28() == 0) { + for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) + { + entity2 = gDungeon->wildPokemon[index]; + if ((EntityIsValid(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiAllySkip)) + { + sub_8074094(entity2); + if (EntityIsValid(entity2)) { + sub_8071DA4(entity2); + entityInfo2->aiAllySkip = FALSE; + } + } + } + } +} + +void TrySpawnMonsterAndActivatePlusMinus(void) +{ + EntityInfo * entityInfo; + Entity *entity; + u32 isNotEnemy; + s32 index; + + if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn] != 0) { + sub_8071B48(); + gDungeon->plusIsActive[0] = FALSE; + gDungeon->plusIsActive[1] = FALSE; + gDungeon->minusIsActive[0] = FALSE; + gDungeon->minusIsActive[1] = FALSE; + gDungeon->lightningRodPokemon = NULL; + gDungeon->unk17B38 = 2; + + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) + { + entity = gDungeon->activePokemon[index]; + if (EntityIsValid(entity)) { + entityInfo = GetEntInfo(entity); + entityInfo->attacking = FALSE; + + if(entityInfo->isNotTeamMember) + { + isNotEnemy = FALSE; + } + else { + isNotEnemy = TRUE; + } + + if (AbilityIsActive(entity, ABILITY_LIGHTNINGROD)) { + gDungeon->lightningRodPokemon = entity; + gDungeon->unk17B38 = entityInfo->unk98; + } + if (AbilityIsActive(entity, ABILITY_MINUS)) { + gDungeon->minusIsActive[isNotEnemy] = TRUE; + } + if (AbilityIsActive(entity, ABILITY_PLUS)) { + gDungeon->plusIsActive[isNotEnemy] = TRUE; + } + } + } + sub_8043ED0(0); + } +} + +void sub_8044AB4(void) +{ + s32 index; + + if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn + 1] != 0) { + for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { + if (EntityIsValid(gDungeon->activePokemon[index])) { + UseAttack(0); + break; + } + } + sub_807EAA0(1,0); + sub_8086AC0(); + sub_8043ED0(0); + } +} + +bool8 sub_8044B28(void) +{ + if (gDungeon->unk4 == 0) { + if (GetLeader() == NULL) { + gDungeon->unk644.unk10 = 1; + } + else if (gDungeon->unk2 == 1) { + gDungeon->unk644.unk10 = 2; + } + else if (gDungeon->unk2 != 2) { + return FALSE; + } + else { + gDungeon->unk644.unk10 = 2; + } + } + return TRUE; +} + +bool8 sub_8044B84(void) +{ + if(gDungeon->unk10 != 0) + { + return TRUE; + } + else { + return sub_8044B28(); + } +} diff --git a/src/dungeon_generation.c b/src/dungeon_generation.c index a382f6dca..6ccf6a307 100644 --- a/src/dungeon_generation.c +++ b/src/dungeon_generation.c @@ -1,26 +1,22 @@ #include "global.h" +#include "globaldata.h" #include "def_filearchives.h" #include "dungeon_generation.h" #include "file_system.h" -#include "tile_types.h" #include "dungeon_map_access.h" #include "dungeon_message.h" #include "dungeon_random.h" #include "dungeon_util.h" #include "items.h" #include "pokemon.h" -#include "code_80450F8.h" #include "code_803E668.h" #include "constants/direction.h" #include "constants/item.h" #include "constants/monster.h" #include "structs/str_dungeon.h" #include "structs/map.h" -#include "structs/str_806B7F8.h" #include "dungeon_config.h" -#include "dungeon_items.h" - -extern const u8 gUnknown_80F6DCC[]; +#include "dungeon_generation_fixed.h" extern s32 sub_803DA20(s16 species); extern void sub_8049840(void); @@ -30,8 +26,6 @@ extern void sub_8049B8C(void); extern u8 GetFloorType(); extern void sub_806C330(s32 a0, s32 a1, s16 a2, u8 a3); -extern const bool8 gUnknown_80F6DD5[][NUM_DIRECTIONS]; - enum CardinalDirection { CARDINAL_DIR_RIGHT, @@ -173,7 +167,7 @@ void GenerateFloor(void) bool8 secondaryGen = FALSE; FloorProperties *floorProps = &gDungeon->floorProperties; - gDungeon->unk13568 = OpenFileAndGetFileDataPtr(gUnknown_80F6DCC, &gDungeonFileArchive); + gDungeon->unk13568 = OpenFileAndGetFileDataPtr("fixedmap", &gDungeonFileArchive); sHasKecleonShop = FALSE; sHasMonsterHouse = 0; sHasMaze = FALSE; @@ -2372,6 +2366,60 @@ static void CreateGridCellConnections(struct GridCell grid[GRID_CELL_LEN][GRID_C } } +/* + * Used in GenerateRoomImperfections, table for determining + * which directions we expect to find open or closed (wall/secondary) tiles in + * + * Ex. If generating from the Top-Left corner, we should only expect to find + * open tiles below us or to our right, otherwise the room will look very strange. + */ +static const bool8 sCornerCardinalNeighborExpectOpen[][NUM_DIRECTIONS] = { + // Top-Left Corner + [0] = { + [DIRECTION_SOUTH] = TRUE, + [DIRECTION_SOUTHEAST] = FALSE, + [DIRECTION_EAST] = TRUE, + [DIRECTION_NORTHEAST] = FALSE, + [DIRECTION_NORTH] = FALSE, + [DIRECTION_NORTHWEST] = FALSE, + [DIRECTION_WEST] = FALSE, + [DIRECTION_SOUTHWEST] = FALSE, + }, + // Top-Right Corner + [1] = { + [DIRECTION_SOUTH] = TRUE, + [DIRECTION_SOUTHEAST] = FALSE, + [DIRECTION_EAST] = FALSE, + [DIRECTION_NORTHEAST] = FALSE, + [DIRECTION_NORTH] = FALSE, + [DIRECTION_NORTHWEST] = FALSE, + [DIRECTION_WEST] = TRUE, + [DIRECTION_SOUTHWEST] = FALSE, + }, + // Bottom-Right Corner + [2] = { + [DIRECTION_SOUTH] = FALSE, + [DIRECTION_SOUTHEAST] = FALSE, + [DIRECTION_EAST] = FALSE, + [DIRECTION_NORTHEAST] = FALSE, + [DIRECTION_NORTH] = TRUE, + [DIRECTION_NORTHWEST] = FALSE, + [DIRECTION_WEST] = TRUE, + [DIRECTION_SOUTHWEST] = FALSE, + }, + // Bottom-Left Corner + [3] = { + [DIRECTION_SOUTH] = FALSE, + [DIRECTION_SOUTHEAST] = FALSE, + [DIRECTION_EAST] = TRUE, + [DIRECTION_NORTHEAST] = FALSE, + [DIRECTION_NORTH] = TRUE, + [DIRECTION_NORTHWEST] = FALSE, + [DIRECTION_WEST] = FALSE, + [DIRECTION_SOUTHWEST] = FALSE, + }, +}; + /* * GenerateRoomImperfections - Attempt to generate room imperfections for each room, if flagged to do so. * @@ -2554,7 +2602,7 @@ static void GenerateRoomImperfections(struct GridCell grid[GRID_CELL_LEN][GRID_C s32 nextY = gAdjacentTileOffsets[direction].y; bool8 isOpen = (GetTerrainType(GetTile(pt_x + nextX, pt_y + nextY)) == TERRAIN_TYPE_NORMAL); - if (gUnknown_80F6DD5[startingCorner][direction] != isOpen) + if (sCornerCardinalNeighborExpectOpen[startingCorner][direction] != isOpen) break; // Advance by 2 to only check cardinal directions @@ -4545,6 +4593,8 @@ void SetSecondaryTerrainOnWall(Tile *tile) } } +static const s32 sNumToGenTable[8] = {1, 1, 1, 2, 2, 2, 3, 3}; + /* * GenerateSecondaryTerrainFormations - Generates secondary terrain (water/lava) formations * @@ -4559,7 +4609,6 @@ void SetSecondaryTerrainOnWall(Tile *tile) * * The formations will never cut into room tiles, but can pass through to the other side. */ -extern const s32 gUnknown_80F6DF8[8]; // This function IS IMPOSSIBLE TO MATCH! Tried with 3 different compiler outputs and got nothing. Functionally it is the same, for the gba it's just a stack difference. // https://decomp.me/scratch/9E4Uj - Red // https://decomp.me/scratch/sA4YH - Blue @@ -4578,7 +4627,7 @@ static void GenerateSecondaryTerrainFormations(u32 flag, FloorProperties *floorP return; // Generate 1-3 "river+lake" formations - for (numToGen = gUnknown_80F6DF8[DungeonRandInt(ARRAY_COUNT(gUnknown_80F6DF8))]; numToGen != 0; numToGen--) { + for (numToGen = sNumToGenTable[DungeonRandInt(ARRAY_COUNT(sNumToGenTable))]; numToGen != 0; numToGen--) { s32 dirX, dirY; bool8 upwards; s32 stepsUntilLake; @@ -4863,7 +4912,7 @@ static void GenerateSecondaryTerrainFormations(u32 flag, FloorProperties *floorP " str r2, [sp, 0x70]\n" " b _08050746\n" " .align 2, 0\n" -"_08050738: .4byte gUnknown_80F6DF8\n" +"_08050738: .4byte sNumToGenTable\n" "_0805073C:\n" " movs r0, 0\n" " str r0, [sp, 0x74]\n" @@ -5837,14 +5886,11 @@ static u8 sub_80511F0(void) return gUnknown_202F1E0; } -static bool8 PlaceFixedRoomTile(Tile *tile, u8 a1, s32 x, s32 y, u8 a5); -static bool8 sub_805210C(u8 itemId); - -static bool8 sub_805124C(Tile *tile, u8 a1, s32 x, s32 y, u8 a5) +static bool8 sub_805124C(Tile *tile, u8 a1, s32 x, s32 y, bool8 spawnTrapOrItem) { tile->terrainType |= TERRAIN_TYPE_UNBREAKABLE; tile->unkE = 0; - return PlaceFixedRoomTile(tile, a1, x, y, a5); + return PlaceFixedRoomTile(tile, a1, x, y, spawnTrapOrItem); } static void sub_8051288(s32 fixedRoomNumber) @@ -5862,7 +5908,7 @@ static void sub_8051288(s32 fixedRoomNumber) for (y = 5; y < fixedRoomSizeY + 5; y++) { for (x = 5; x < fixedRoomSizeX + 5; x++) { u8 unk = sub_80511F0(); - if (sub_805124C(GetTileMut(x, y), unk, x, y, 1)) { + if (sub_805124C(GetTileMut(x, y), unk, x, y, TRUE)) { dungeon->stairsSpawn.x = x; dungeon->stairsSpawn.y = y; } @@ -5933,7 +5979,7 @@ static void sub_8051438(struct GridCell *gridCell, s32 fixedRoomNumber) Tile *tile = GetTileMut(x, y); dungeon->unkE87C[xIndex][yIndex] = unk; - sub_805124C(&dungeon->unkE27C[xIndex][yIndex], unk, x, y, 0); + sub_805124C(&dungeon->unkE27C[xIndex][yIndex], unk, x, y, FALSE); roomId = tile->room; *tile = dungeon->unkE27C[xIndex][yIndex]; if (x >= gridCell->start.x + 2 && x < gridCell->end.x - 2 && y >= gridCell->start.y + 2 && y < gridCell->end.y - 2) { @@ -5954,7 +6000,7 @@ static void sub_8051438(struct GridCell *gridCell, s32 fixedRoomNumber) Tile *tile = GetTileMut(x, y); u8 roomId = tile->room; - sub_805124C(tile, unk, x, y, 1); + sub_805124C(tile, unk, x, y, TRUE); tile->room = roomId; dungeon->unkE8BC = roomId; } @@ -6087,331 +6133,3 @@ static void ResetInnerBoundaryTileRows(void) } } } - -static void sub_805193C(u8 itemId, s32 x, s32 y, s32 quantity, u32 itemFlags) -{ - Item item; - DungeonPos pos = {x, y}; - - if (sub_805210C(itemId)) { - ItemIdToSlot(&item, ITEM_LINK_CABLE, 0); - } - else { - ItemIdToSlot(&item, itemId, 0); - } - - item.flags |= itemFlags; - if (quantity != 0) { - item.quantity = quantity; - } - - AddItemToDungeonAt(&pos, &item, 1); -} - -// s16 species memes strike again. Will the fix ever be discovered? -static void sub_8051998(s16 species_, s32 x, s32 y, u32 unk2_, u32 UNUSED unused) -{ - struct unkStruct_806B7F8 unkStruct; - s32 species = SpeciesId(species_); - u8 unk2 = unk2_; - - if (species_ == MONSTER_DECOY) { - unkStruct.species = MONSTER_POLIWAG; - unkStruct.level = sub_803DA20(MONSTER_POLIWAG); - unkStruct.unk2 = unk2; - unkStruct.unk4 = 0; - unkStruct.unk10 = 0; - unkStruct.pos.x = x; - unkStruct.pos.y = y; - sub_806B7F8(&unkStruct, TRUE); - } - else if (species != MONSTER_NONE) { - unkStruct.species = species; - unkStruct.level = sub_803DA20(species); - unkStruct.unk2 = unk2; - unkStruct.unk4 = 0; - unkStruct.unk10 = 0; - unkStruct.pos.x = x; - unkStruct.pos.y = y; - sub_806B7F8(&unkStruct, TRUE); - } -} - -static void SpawnEnemyTrapAtPos(u8 trapId, s32 x, s32 y, bool8 isVisible) -{ - DungeonPos pos; - Entity *trapEntity; - Tile *tile = GetTileMut(x, y); - - pos.x = x; - pos.y = y; - trapEntity = SpawnTrap(trapId, &pos, 0); - if (trapEntity != NULL) { - tile->object = trapEntity; - trapEntity->isVisible = isVisible; - } -} - -struct UnkStruct_80F6D20 -{ - u8 unk0; - s16 unk2; - u32 unk4; - s16 unk8; - u8 unkA; - u8 unkB; - u8 unkC; - u8 unkD; - u8 unkE; -}; - -extern const struct UnkStruct_80F6D20 gUnknown_80F6D20[]; - -// Used to spawn a single tile when generating a fixed room. The tile might contain an item or a monster. -static bool8 PlaceFixedRoomTile(Tile *tile, u8 fixedRoomActionId, s32 x, s32 y, bool8 a5) -{ - if (fixedRoomActionId > 0xF) { - SetTerrainNormal(tile); - } - - switch (fixedRoomActionId) { - case 69: - gDungeon->unk644.unk40 = x; - gDungeon->unk644.unk42 = y; - SpawnEnemyTrapAtPos(TRAP_SEAL_TRAP, x, y, FALSE); - // fall through - case 0: - SetTerrainNormal(tile); - tile->room = 0; - break; - case 1: - SetTerrainWall(tile); - tile->terrainType &= ~(TERRAIN_TYPE_UNBREAKABLE); - tile->room = CORRIDOR_ROOM; - break; - case 4: - SetTerrainNormal(tile); - gDungeon->playerSpawn.x = x; - gDungeon->playerSpawn.y = y; - tile->room = 0; - break; - case 5: - SetTerrainSecondary(tile); - tile->room = 0; - break; - case 6: - SetTerrainType(tile, TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL); - tile->room = CORRIDOR_ROOM; - break; - case 7: - gUnknown_202F1A8 = 1; - sub_8049840(); - // fall through - case 10: - SetTerrainType(tile, TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL); - tile->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; - tile->room = CORRIDOR_ROOM; - break; - case 8: - case 67: - SetTerrainNormal(tile); - tile->spawnOrVisibilityFlags |= SPAWN_FLAG_STAIRS; - tile->spawnOrVisibilityFlags &= ~(SPAWN_FLAG_ITEM); - tile->room = 0; - gDungeon->stairsSpawn.x = x; - gDungeon->stairsSpawn.y = y; - break; - case 68: - tile->terrainType |= TERRAIN_TYPE_UNK_x800; - SetTerrainNormal(tile); - tile->spawnOrVisibilityFlags &= ~(SPAWN_FLAG_ITEM); - tile->room = 0; - break; - case 9: - SetTerrainNormal(tile); - tile->room = CORRIDOR_ROOM; - break; - case 11: - SetTerrainNormal(tile); - tile->terrainType |= TERRAIN_TYPE_UNK_x800; - tile->room = 0; - break; - case 12: - SetTerrainNormal(tile); - tile->terrainType |= TERRAIN_TYPE_UNK_x1000; - tile->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; - tile->terrainType |= TERRAIN_TYPE_UNK_x800; - tile->room = 0; - break; - case 2: - case 13: - case 14: - SetTerrainWall(tile); - tile->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; - tile->room = CORRIDOR_ROOM; - break; - default: - if (fixedRoomActionId > 15 && fixedRoomActionId < 220) { - const struct UnkStruct_80F6D20 *ptr = &gUnknown_80F6D20[fixedRoomActionId]; - tile->room = ptr->unkC; - if (ptr->unk0 != 0) { - if (a5) { - sub_805193C(ptr->unk0, x, y, ptr->unk2, ptr->unk4); - } - else { - gDungeon->unk644.unk47 = ptr->unk0; - } - } - else { - if (ptr->unk4 != 0) { - gDungeon->unkE220[ptr->unk4 - 1].x = x; - gDungeon->unkE220[ptr->unk4 - 1].y = y; - } - } - - if (ptr->unk8 != 0) { - sub_8051998(ptr->unk8, x, y, ptr->unkA, fixedRoomActionId); - } - - if (ptr->unkB != 20 && a5) { - SpawnEnemyTrapAtPos(ptr->unkB, x, y, ptr->unkD); - } - - if (ptr->unkE != 0) { - SetTerrainSecondary(tile); - } - } - break; - case 3: - case 15: - break; - } - - return FALSE; -} - -void sub_8051E3C(void) -{ - s32 x, y; - - for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { - for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { - Tile *tile = GetTileMut(x, y); - if (tile->unkE > 0xF) { - PlaceFixedRoomTile(tile, tile->unkE, x, y, FALSE); - } - } - } -} - -extern const u8 *const gUnknown_80FDDF0; -extern const u8 *const gUnknown_80FDDD0; - -void sub_8051E7C(Entity *pokemon) -{ - Tile *tile = GetTileMut(pokemon->pos.x, pokemon->pos.y - 1); - - if (!(tile->terrainType & TERRAIN_TYPE_UNK_x1000)) { - LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FDDF0); // It can't be used here! - } - else if (!gDungeon->unk3A09) { - s32 x, y; - DungeonPos pos = {pokemon->pos.x, pokemon->pos.y - 1}; - u32 roomId = GetEntityRoom(pokemon); - - for (y = pokemon->pos.y - 21; y <= pokemon->pos.y + 19; y++) { - for (x = pokemon->pos.x -20; x <= pokemon->pos.x + 20; x++) { - Tile *loopTile; - s32 xDiff = x - gDungeon->unkE250.minX; - s32 yDiff = y - gDungeon->unkE250.minY; - - if (xDiff < 0 || yDiff < 0) - continue; - if (xDiff >= 8 || yDiff >= 8) - continue; - if (x < gDungeon->unkE250.minX + 1 || y < gDungeon->unkE250.minY + 1) - continue; - if (x >= gDungeon->unkE250.maxX - 1 || y >= gDungeon->unkE250.maxY - 1) - continue; - - loopTile = GetTileMut(x, y); - if (loopTile->terrainType & TERRAIN_TYPE_UNBREAKABLE) { - loopTile->terrainType = gDungeon->unkE27C[xDiff][yDiff].terrainType; - loopTile->spawnOrVisibilityFlags = gDungeon->unkE27C[xDiff][yDiff].spawnOrVisibilityFlags; - } - - PlaceFixedRoomTile(loopTile, gDungeon->unkE87C[xDiff][yDiff], x, y, TRUE); - loopTile->spawnOrVisibilityFlags |= 3; - if (roomId != CORRIDOR_ROOM) { - loopTile->room = roomId; - } - } - } - - for (y = pokemon->pos.y - 21; y <= pokemon->pos.y + 19; y++) { - for (x = pokemon->pos.x -20; x <= pokemon->pos.x + 20; x++) { - s32 xDiff = x - gDungeon->unkE250.minX; - s32 yDiff = y - gDungeon->unkE250.minY; - - if (xDiff < 0 || yDiff < 0) - continue; - if (xDiff >= 8 || yDiff >= 8) - continue; - if (x < gDungeon->unkE250.minX + 1 || y < gDungeon->unkE250.minY + 1) - continue; - if (x >= gDungeon->unkE250.maxX - 1 || y >= gDungeon->unkE250.maxY - 1) - continue; - - sub_80498A8(x, y); - } - } - - gDungeon->unk3A09 = TRUE; - tile->terrainType &= ~(TERRAIN_TYPE_IMPASSABLE_WALL | TERRAIN_TYPE_UNK_x1000); - sub_80498A8(pokemon->pos.x, pokemon->pos.y - 1); - sub_8049B8C(); - sub_8049ED4(); - sub_80429FC(&pos); - LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FDDD0); // The closed corridor was opened! - sub_803E708(0x14, 0x3C); - } - else { - LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FDDF0); // It can't be used here! - } -} - -static inline bool8 MonHasItem(PokemonStruct1 *mon) -{ - return (mon->heldItem.id != 0); -} - -static bool8 sub_805210C(u8 itemId) -{ - s32 i; - - for (i = 0; i < INVENTORY_SIZE; i++) { - if (ItemExists(&gTeamInventoryRef->teamItems[i])) { - if (gTeamInventoryRef->teamItems[i].id == itemId) - return TRUE; - } - } - - for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - if (PokemonFlag1Struct2(&gRecruitedPokemonRef->pokemon2[i]) && ItemExists(&gRecruitedPokemonRef->pokemon2[i].itemSlot)) { - if (gRecruitedPokemonRef->pokemon2[i].itemSlot.id == itemId) - return TRUE; - } - } - - for (i = 0; i < NUM_MONSTERS; i++) { - if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { - if (MonHasItem(&gRecruitedPokemonRef->pokemon[i]) && gRecruitedPokemonRef->pokemon[i].heldItem.id == itemId) - return TRUE; - } - } - - if (gTeamInventoryRef->teamStorage[itemId] != 0) - return TRUE; - - return FALSE; -} diff --git a/src/dungeon_generation_fixed.c b/src/dungeon_generation_fixed.c new file mode 100644 index 000000000..365ba6569 --- /dev/null +++ b/src/dungeon_generation_fixed.c @@ -0,0 +1,1096 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_generation_fixed.h" +#include "dungeon_generation.h" +#include "dungeon_map_access.h" +#include "items.h" +#include "pokemon.h" +#include "dungeon_util.h" +#include "dungeon_items.h" +#include "dungeon_message.h" +#include "code_803E668.h" +#include "structs/str_806B7F8.h" +#include "constants/monster.h" +#include "constants/trap.h" +#include "constants/item.h" + +extern s32 sub_803DA20(s16 species); +extern void sub_80429FC(DungeonPos *r0); + +static bool8 sub_805210C(u8 itemId); + +static void SpawnItemAtPos(u8 itemId, s32 x, s32 y, s32 quantity, u32 itemFlags) +{ + Item item; + DungeonPos pos = {x, y}; + + if (sub_805210C(itemId)) { + ItemIdToSlot(&item, ITEM_LINK_CABLE, 0); + } + else { + ItemIdToSlot(&item, itemId, 0); + } + + item.flags |= itemFlags; + if (quantity != 0) { + item.quantity = quantity; + } + + AddItemToDungeonAt(&pos, &item, 1); +} + +// s16 species memes strike again. Will the fix ever be discovered? +static void SpawnSpeciesAtPos(s16 species_, s32 x, s32 y, u32 monsterBehav_, u32 UNUSED unused) +{ + struct unkStruct_806B7F8 unkStruct; + s32 species = SpeciesId(species_); + u8 monsterBehav = monsterBehav_; + + if (species_ == MONSTER_DECOY) { + unkStruct.species = MONSTER_POLIWAG; + unkStruct.level = sub_803DA20(MONSTER_POLIWAG); + unkStruct.unk2 = monsterBehav; + unkStruct.unk4 = 0; + unkStruct.unk10 = 0; + unkStruct.pos.x = x; + unkStruct.pos.y = y; + sub_806B7F8(&unkStruct, TRUE); + } + else if (species != MONSTER_NONE) { + unkStruct.species = species; + unkStruct.level = sub_803DA20(species); + unkStruct.unk2 = monsterBehav; + unkStruct.unk4 = 0; + unkStruct.unk10 = 0; + unkStruct.pos.x = x; + unkStruct.pos.y = y; + sub_806B7F8(&unkStruct, TRUE); + } +} + +static void SpawnEnemyTrapAtPos(u8 trapId, s32 x, s32 y, bool8 isVisible) +{ + DungeonPos pos; + Entity *trapEntity; + Tile *tile = GetTileMut(x, y); + + pos.x = x; + pos.y = y; + trapEntity = SpawnTrap(trapId, &pos, 0); + if (trapEntity != NULL) { + tile->object = trapEntity; + trapEntity->isVisible = isVisible; + } +} + +struct FixedRoomEntitiesInfo +{ + u8 itemId; + s16 itemQuantity; + u32 unk4; + s16 speciesId; + u8 monsterBehavior; + u8 trapId; + u8 roomId; + bool8 trapVisible; + bool8 setTerrainToSecondary; +}; + +static const struct FixedRoomEntitiesInfo sFixedRoomEntities[204] = { + [0] = { + .speciesId = MONSTER_SKARMORY, + .monsterBehavior = BEHAVIOR_SKARMORY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [1] = { + .speciesId = MONSTER_DIGLETT, + .monsterBehavior = BEHAVIOR_DIGLETT, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [2] = { + .speciesId = MONSTER_GENGAR, + .monsterBehavior = BEHAVIOR_GENGAR, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [3] = { + .speciesId = MONSTER_EKANS, + .monsterBehavior = BEHAVIOR_EKANS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [4] = { + .speciesId = MONSTER_MEDICHAM, + .monsterBehavior = BEHAVIOR_MEDICHAM, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [5] = { + .speciesId = MONSTER_ZAPDOS, + .monsterBehavior = BEHAVIOR_ZAPDOS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [6] = { + .unk4 = 1, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [7] = { + .unk4 = 2, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [8] = { + .unk4 = 3, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [9] = { + .unk4 = 4, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [10] = { + .unk4 = 5, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [11] = { + .unk4 = 6, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [12] = { + .unk4 = 7, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [13] = { + .unk4 = 8, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [14] = { + .speciesId = MONSTER_MOLTRES, + .monsterBehavior = BEHAVIOR_MOLTRES, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [15] = { + .speciesId = MONSTER_ALAKAZAM, + .monsterBehavior = BEHAVIOR_ALAKAZAM_1, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [16] = { + .speciesId = MONSTER_TYRANITAR, + .monsterBehavior = BEHAVIOR_GROUDON_1, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [17] = { + .speciesId = MONSTER_CHARIZARD, + .monsterBehavior = BEHAVIOR_ALAKAZAM_2, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [18] = { + .speciesId = MONSTER_ARTICUNO, + .monsterBehavior = BEHAVIOR_ARTICUNO, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [19] = { + .speciesId = MONSTER_GROUDON, + .monsterBehavior = BEHAVIOR_GROUDON_2, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [20] = { + .speciesId = MONSTER_RAYQUAZA, + .monsterBehavior = BEHAVIOR_RAYQUAZA, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [21] = { + .speciesId = MONSTER_MANKEY, + .monsterBehavior = BEHAVIOR_MANKEY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [22] = { + .speciesId = MONSTER_MEWTWO, + .monsterBehavior = BEHAVIOR_MEWTWO, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [23] = { + .speciesId = MONSTER_ENTEI, + .monsterBehavior = BEHAVIOR_ENTEI, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [24] = { + .speciesId = MONSTER_RAIKOU, + .monsterBehavior = BEHAVIOR_RAIKOU, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [25] = { + .speciesId = MONSTER_SUICUNE, + .monsterBehavior = BEHAVIOR_SUICUNE, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [26] = { + .speciesId = MONSTER_HO_OH, + .monsterBehavior = BEHAVIOR_HO_OH, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [27] = { + .speciesId = MONSTER_LATIOS, + .monsterBehavior = BEHAVIOR_LATIOS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [28] = { + .speciesId = MONSTER_REGIROCK, + .monsterBehavior = BEHAVIOR_REGIROCK, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [29] = { + .speciesId = MONSTER_REGICE, + .monsterBehavior = BEHAVIOR_REGICE, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [30] = { + .speciesId = MONSTER_REGISTEEL, + .monsterBehavior = BEHAVIOR_REGISTEEL, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [31] = { + .speciesId = MONSTER_JIRACHI, + .monsterBehavior = BEHAVIOR_JIRACHI, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [32] = { + .speciesId = MONSTER_LUGIA, + .monsterBehavior = BEHAVIOR_LUGIA, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [33] = { + .speciesId = MONSTER_KYOGRE, + .monsterBehavior = BEHAVIOR_KYOGRE, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [34] = { + .speciesId = MONSTER_DEOXYS_NORMAL, + .monsterBehavior = BEHAVIOR_29, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [35] = { + .speciesId = MONSTER_DEOXYS_ATTACK, + .monsterBehavior = BEHAVIOR_FIXED_ENEMY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [36] = { + .speciesId = MONSTER_DEOXYS_DEFENSE, + .monsterBehavior = BEHAVIOR_FIXED_ENEMY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [37] = { + .speciesId = MONSTER_DEOXYS_SPEED, + .monsterBehavior = BEHAVIOR_FIXED_ENEMY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [38] = { + .itemId = ITEM_ORAN_BERRY, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [39] = { + .itemId = ITEM_STICK, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [40] = { + .speciesId = MONSTER_TORCHIC, + .monsterBehavior = BEHAVIOR_FIXED_ENEMY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [41] = { + .speciesId = MONSTER_IVYSAUR, + .monsterBehavior = BEHAVIOR_FIXED_ENEMY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [42] = { + .speciesId = MONSTER_MUDKIP, + .monsterBehavior = BEHAVIOR_FIXED_ENEMY, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [43] = { + .speciesId = MONSTER_SMEARGLE, + .monsterBehavior = BEHAVIOR_SMEARGLE, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [44] = { + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [45] = { + .trapId = NUM_TRAPS, + .roomId = 1, + }, + [46] = { + .trapId = NUM_TRAPS, + .roomId = 2, + }, + [47] = { + .trapId = NUM_TRAPS, + .roomId = 3, + }, + [48] = { + .trapId = NUM_TRAPS, + .roomId = 4, + }, + [49] = { + .trapId = NUM_TRAPS, + .roomId = 5, + }, + [50] = { + .trapId = NUM_TRAPS, + .roomId = 0, + .setTerrainToSecondary = TRUE, + }, + [51] = { + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [52] = { + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [53] = { + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [54] = { + .itemId = ITEM_HM_FLY, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [55] = { + .itemId = ITEM_HM_SURF, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [56] = { + .itemId = ITEM_HM_DIVE, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [57] = { + .itemId = ITEM_HM_WATERFALL, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [58] = { + .itemId = ITEM_BEAUTY_SCARF, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [59] = { + .speciesId = MONSTER_CELEBI, + .monsterBehavior = BEHAVIOR_CELEBI, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [60] = { + .itemId = ITEM_FRIEND_BOW, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [61] = { + .itemId = ITEM_TM_WIDE_SLASH, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [62] = { + .itemId = ITEM_VACUUM_CUT, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [63] = { + .itemId = ITEM_SUN_RIBBON, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [64] = { + .itemId = ITEM_LUNAR_RIBBON, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [65] = { + .itemId = ITEM_LUNAR_RIBBON, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [66] = { + .itemId = ITEM_HM_CUT, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [67] = { + .itemId = ITEM_HM_STRENGTH, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [68] = { + .itemId = ITEM_HM_FLASH, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [69] = { + .itemId = ITEM_HM_ROCK_SMASH, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [70] = { + .itemId = ITEM_DEEPSEASCALE, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [71] = { + .itemId = ITEM_WISH_STONE, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [72] = { + .itemId = ITEM_DEEPSEATOOTH, + .itemQuantity = 0, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [73] = { + .speciesId = MONSTER_ZIGZAGOON, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [74] = { + .speciesId = MONSTER_FURRET, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [75] = { + .speciesId = MONSTER_FARFETCHD, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [76] = { + .speciesId = MONSTER_RATICATE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [77] = { + .speciesId = MONSTER_PONYTA, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [78] = { + .speciesId = MONSTER_SLUGMA, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [79] = { + .speciesId = MONSTER_MAGBY, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [80] = { + .speciesId = MONSTER_POLIWAG, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [81] = { + .speciesId = MONSTER_EXEGGCUTE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [82] = { + .speciesId = MONSTER_SUNKERN, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [83] = { + .speciesId = MONSTER_SHROOMISH, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [84] = { + .speciesId = MONSTER_CACNEA, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [85] = { + .speciesId = MONSTER_ELECTRIKE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [86] = { + .speciesId = MONSTER_VOLTORB, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [87] = { + .speciesId = MONSTER_SWINUB, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [88] = { + .speciesId = MONSTER_PILOSWINE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [89] = { + .speciesId = MONSTER_SNORUNT, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [90] = { + .speciesId = MONSTER_MEDITITE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [91] = { + .speciesId = MONSTER_TYROGUE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [92] = { + .speciesId = MONSTER_HITMONLEE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [93] = { + .speciesId = MONSTER_PHANPY, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [94] = { + .speciesId = MONSTER_DIGLETT, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [95] = { + .speciesId = MONSTER_DODUO, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [96] = { + .speciesId = MONSTER_FARFETCHD, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [97] = { + .speciesId = MONSTER_PIDGEY, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [98] = { + .speciesId = MONSTER_WOBBUFFET, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [99] = { + .speciesId = MONSTER_NIDORAN_F, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [100] = { + .speciesId = MONSTER_NIDORAN_M, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [101] = { + .speciesId = MONSTER_PINSIR, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [102] = { + .speciesId = MONSTER_BEEDRILL, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [103] = { + .speciesId = MONSTER_WEEDLE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [104] = { + .speciesId = MONSTER_PUPITAR, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [105] = { + .speciesId = MONSTER_SUDOWOODO, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [106] = { + .speciesId = MONSTER_GEODUDE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [107] = { + .speciesId = MONSTER_GASTLY, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [108] = { + .speciesId = MONSTER_BAGON, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [109] = { + .speciesId = MONSTER_SHELGON, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [110] = { + .speciesId = MONSTER_POOCHYENA, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [111] = { + .speciesId = MONSTER_MURKROW, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [112] = { + .speciesId = MONSTER_ARON, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [113] = { + .speciesId = MONSTER_BELDUM, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [114] = { + .speciesId = MONSTER_OCTILLERY, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [115] = { + .speciesId = MONSTER_TENTACRUEL, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [116] = { + .speciesId = MONSTER_CRADILY, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [117] = { + .speciesId = MONSTER_BLASTOISE, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [118] = { + .speciesId = MONSTER_FERALIGATR, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [119] = { + .speciesId = MONSTER_SWAMPERT, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [120] = { + .speciesId = MONSTER_GOLEM, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [121] = { + .speciesId = MONSTER_GRAVELER, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [122] = { + .speciesId = MONSTER_MUDKIP, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [123] = { + .speciesId = MONSTER_SHIFTRY, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [124] = { + .speciesId = MONSTER_NUZLEAF, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [125] = { + .speciesId = MONSTER_POLIWAG, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [126] = { + .speciesId = MONSTER_POLIWAG, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [127] = { + .speciesId = MONSTER_POLIWAG, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, + [128] = { + .speciesId = MONSTER_POLIWAG, + .monsterBehavior = BEHAVIOR_MAZE_BOSS, + .trapId = NUM_TRAPS, + .roomId = 0, + }, +}; + +// Used to spawn a single tile when generating a fixed room. The tile might contain an item or a monster. +bool8 PlaceFixedRoomTile(Tile *tile, u8 fixedRoomActionId, s32 x, s32 y, bool8 spawnTrapOrItem) +{ + if (fixedRoomActionId > 0xF) { + SetTerrainNormal(tile); + } + + switch (fixedRoomActionId) { + case 69: + gDungeon->unk644.unk40 = x; + gDungeon->unk644.unk42 = y; + SpawnEnemyTrapAtPos(TRAP_SEAL_TRAP, x, y, FALSE); + // fall through + case 0: + SetTerrainNormal(tile); + tile->room = 0; + break; + case 1: + SetTerrainWall(tile); + tile->terrainType &= ~(TERRAIN_TYPE_UNBREAKABLE); + tile->room = CORRIDOR_ROOM; + break; + case 4: + SetTerrainNormal(tile); + gDungeon->playerSpawn.x = x; + gDungeon->playerSpawn.y = y; + tile->room = 0; + break; + case 5: + SetTerrainSecondary(tile); + tile->room = 0; + break; + case 6: + SetTerrainType(tile, TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL); + tile->room = CORRIDOR_ROOM; + break; + case 7: + gUnknown_202F1A8 = 1; + sub_8049840(); + // fall through + case 10: + SetTerrainType(tile, TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL); + tile->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; + tile->room = CORRIDOR_ROOM; + break; + case 8: + case 67: + SetTerrainNormal(tile); + tile->spawnOrVisibilityFlags |= SPAWN_FLAG_STAIRS; + tile->spawnOrVisibilityFlags &= ~(SPAWN_FLAG_ITEM); + tile->room = 0; + gDungeon->stairsSpawn.x = x; + gDungeon->stairsSpawn.y = y; + break; + case 68: + tile->terrainType |= TERRAIN_TYPE_UNK_x800; + SetTerrainNormal(tile); + tile->spawnOrVisibilityFlags &= ~(SPAWN_FLAG_ITEM); + tile->room = 0; + break; + case 9: + SetTerrainNormal(tile); + tile->room = CORRIDOR_ROOM; + break; + case 11: + SetTerrainNormal(tile); + tile->terrainType |= TERRAIN_TYPE_UNK_x800; + tile->room = 0; + break; + case 12: + SetTerrainNormal(tile); + tile->terrainType |= TERRAIN_TYPE_UNK_x1000; + tile->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; + tile->terrainType |= TERRAIN_TYPE_UNK_x800; + tile->room = 0; + break; + case 2: + case 13: + case 14: + SetTerrainWall(tile); + tile->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; + tile->room = CORRIDOR_ROOM; + break; + default: + if (fixedRoomActionId >= 16 && fixedRoomActionId <= 219) { + const struct FixedRoomEntitiesInfo *ptr = &sFixedRoomEntities[fixedRoomActionId - 16]; + tile->room = ptr->roomId; + if (ptr->itemId != 0) { + if (spawnTrapOrItem) { + SpawnItemAtPos(ptr->itemId, x, y, ptr->itemQuantity, ptr->unk4); + } + else { + gDungeon->unk644.unk47 = ptr->itemId; + } + } + else { + if (ptr->unk4 != 0) { + gDungeon->unkE220[ptr->unk4 - 1].x = x; + gDungeon->unkE220[ptr->unk4 - 1].y = y; + } + } + + if (ptr->speciesId != 0) { + SpawnSpeciesAtPos(ptr->speciesId, x, y, ptr->monsterBehavior, fixedRoomActionId); + } + + if (ptr->trapId != NUM_TRAPS && spawnTrapOrItem) { + SpawnEnemyTrapAtPos(ptr->trapId, x, y, ptr->trapVisible); + } + + if (ptr->setTerrainToSecondary) { + SetTerrainSecondary(tile); + } + } + break; + case 3: + case 15: + break; + } + + return FALSE; +} + +void sub_8051E3C(void) +{ + s32 x, y; + + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { + for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { + Tile *tile = GetTileMut(x, y); + if (tile->unkE > 0xF) { + PlaceFixedRoomTile(tile, tile->unkE, x, y, FALSE); + } + } + } +} + +extern const u8 *const gUnknown_80FDDF0; +extern const u8 *const gUnknown_80FDDD0; + +void sub_8051E7C(Entity *pokemon) +{ + Tile *tile = GetTileMut(pokemon->pos.x, pokemon->pos.y - 1); + + if (!(tile->terrainType & TERRAIN_TYPE_UNK_x1000)) { + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FDDF0); // It can't be used here! + } + else if (!gDungeon->unk3A09) { + s32 x, y; + DungeonPos pos = {pokemon->pos.x, pokemon->pos.y - 1}; + u32 roomId = GetEntityRoom(pokemon); + + for (y = pokemon->pos.y - 21; y <= pokemon->pos.y + 19; y++) { + for (x = pokemon->pos.x -20; x <= pokemon->pos.x + 20; x++) { + Tile *loopTile; + s32 xDiff = x - gDungeon->unkE250.minX; + s32 yDiff = y - gDungeon->unkE250.minY; + + if (xDiff < 0 || yDiff < 0) + continue; + if (xDiff >= 8 || yDiff >= 8) + continue; + if (x < gDungeon->unkE250.minX + 1 || y < gDungeon->unkE250.minY + 1) + continue; + if (x >= gDungeon->unkE250.maxX - 1 || y >= gDungeon->unkE250.maxY - 1) + continue; + + loopTile = GetTileMut(x, y); + if (loopTile->terrainType & TERRAIN_TYPE_UNBREAKABLE) { + loopTile->terrainType = gDungeon->unkE27C[xDiff][yDiff].terrainType; + loopTile->spawnOrVisibilityFlags = gDungeon->unkE27C[xDiff][yDiff].spawnOrVisibilityFlags; + } + + PlaceFixedRoomTile(loopTile, gDungeon->unkE87C[xDiff][yDiff], x, y, TRUE); + loopTile->spawnOrVisibilityFlags |= 3; + if (roomId != CORRIDOR_ROOM) { + loopTile->room = roomId; + } + } + } + + for (y = pokemon->pos.y - 21; y <= pokemon->pos.y + 19; y++) { + for (x = pokemon->pos.x -20; x <= pokemon->pos.x + 20; x++) { + s32 xDiff = x - gDungeon->unkE250.minX; + s32 yDiff = y - gDungeon->unkE250.minY; + + if (xDiff < 0 || yDiff < 0) + continue; + if (xDiff >= 8 || yDiff >= 8) + continue; + if (x < gDungeon->unkE250.minX + 1 || y < gDungeon->unkE250.minY + 1) + continue; + if (x >= gDungeon->unkE250.maxX - 1 || y >= gDungeon->unkE250.maxY - 1) + continue; + + sub_80498A8(x, y); + } + } + + gDungeon->unk3A09 = TRUE; + tile->terrainType &= ~(TERRAIN_TYPE_IMPASSABLE_WALL | TERRAIN_TYPE_UNK_x1000); + sub_80498A8(pokemon->pos.x, pokemon->pos.y - 1); + sub_8049B8C(); + sub_8049ED4(); + sub_80429FC(&pos); + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FDDD0); // The closed corridor was opened! + sub_803E708(0x14, 0x3C); + } + else { + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FDDF0); // It can't be used here! + } +} + +static inline bool8 MonHasItem(PokemonStruct1 *mon) +{ + return (mon->heldItem.id != 0); +} + +static bool8 sub_805210C(u8 itemId) +{ + s32 i; + + for (i = 0; i < INVENTORY_SIZE; i++) { + if (ItemExists(&gTeamInventoryRef->teamItems[i])) { + if (gTeamInventoryRef->teamItems[i].id == itemId) + return TRUE; + } + } + + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { + if (PokemonFlag1Struct2(&gRecruitedPokemonRef->pokemon2[i]) && ItemExists(&gRecruitedPokemonRef->pokemon2[i].itemSlot)) { + if (gRecruitedPokemonRef->pokemon2[i].itemSlot.id == itemId) + return TRUE; + } + } + + for (i = 0; i < NUM_MONSTERS; i++) { + if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { + if (MonHasItem(&gRecruitedPokemonRef->pokemon[i]) && gRecruitedPokemonRef->pokemon[i].heldItem.id == itemId) + return TRUE; + } + } + + if (gTeamInventoryRef->teamStorage[itemId] != 0) + return TRUE; + + return FALSE; +} diff --git a/src/code_8048480.c b/src/dungeon_item_action.c similarity index 96% rename from src/code_8048480.c rename to src/dungeon_item_action.c index bfbe110db..6037e86d1 100644 --- a/src/code_8048480.c +++ b/src/dungeon_item_action.c @@ -1,7 +1,7 @@ #include "global.h" +#include "globaldata.h" #include "code_803E668.h" #include "code_8041AD0.h" -#include "code_8045A00.h" #include "dungeon_message.h" #include "code_8077274_1.h" #include "code_807CD9C.h" @@ -12,10 +12,8 @@ #include "constants/status.h" #include "constants/type.h" #include "dungeon_action.h" -#include "dungeon_capabilities.h" #include "dungeon_items.h" #include "dungeon_music.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" #include "dungeon_util.h" #include "move_effects_target.h" @@ -31,8 +29,8 @@ #include "dungeon_menu_moves.h" #include "dungeon_misc.h" #include "code_803E724.h" - -extern s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS]; +#include "dungeon_data.h" +#include "dungeon_logic.h" extern u8 *gUnknown_80F89F4[]; extern u8 *gUnknown_80FB580[]; @@ -66,8 +64,6 @@ extern u8 *gUnknown_80FECA0[]; extern u8 *gItemStickyDoesntWorkText[]; extern u8 *gUnknown_80F9BD8[]; -#include "data/code_8048480.h" - extern void sub_8078B5C(Entity *, Entity *, u32, u32, u32); extern void sub_8051E7C(Entity *pokemon); extern void sub_8045BF8(u8 *, Item *); @@ -133,36 +129,6 @@ extern void sub_80464C8(Entity *, DungeonPos *, Item *); extern void sub_806A6E8(Entity *); extern void sub_8042390(Entity *, Item *); -bool8 sub_8047930(Entity *pokemon, Entity *target) -{ - bool8 flag; - - if (((GetEntInfo(target)->shopkeeper == TRUE) || - (GetEntInfo(target)->monsterBehavior == BEHAVIOR_DIGLETT)) || (GetEntInfo(target)->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { - return FALSE; - } - else { - if(DungeonRandInt(100) < gUnknownDungeonChance) - flag = TRUE; - else - flag = FALSE; - if (GetEntityType(pokemon) == ENTITY_MONSTER) { - if (HasHeldItem(pokemon, ITEM_WHIFF_SPECS)) { - flag = FALSE; - } - else { - if (HasHeldItem(pokemon, ITEM_LOCKON_SPECS)) { - flag = TRUE; - } - } - } - if ((GetEntityType(target) == ENTITY_MONSTER) && (HasHeldItem(target, ITEM_DODGE_SCARF))) { - flag = FALSE; - } - } - return flag; -} - void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity *target, Item *item) { EntityInfo *info; diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 478a21066..15420c01d 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -3,10 +3,8 @@ #include "dungeon_items.h" #include "code_803E668.h" #include "code_8041AD0.h" -#include "code_8045A00.h" #include "code_80861A8.h" #include "code_80869E4.h" -#include "dungeon_capabilities.h" #include "dungeon_leader.h" #include "dungeon_random.h" #include "dungeon_util.h" @@ -17,14 +15,13 @@ #include "dungeon_message.h" #include "dungeon_music.h" #include "dungeon_map.h" -#include "dungeon_ai_targeting.h" +#include "dungeon_strings.h" +#include "dungeon_logic.h" #include "string_format.h" #include "items.h" -#include "status_checks_1.h" #include "structs/map.h" #include "trap.h" #include "math.h" -#include "code_80450F8.h" #include "structs/str_item_text.h" #include "code_803E46C.h" #include "sprite.h" @@ -32,26 +29,11 @@ extern SpriteOAM gUnknown_202EDC0; extern const s32 gUnknown_810A3F0[]; -extern const u8 *gUnknown_80FA408[]; extern const u8 *gUnknown_810531C[]; extern const u8 *gUnknown_8105360[]; extern const u8 *gUnknown_81053A8[]; extern const u8 *gUnknown_8105434[]; -extern const u8 *gPickedUpItemToolbox[]; -extern const u8 *gMonTerrifiedCouldntPickUpItem[]; -extern const u8 *gPickedUpItem2[]; -extern const u8 *gMonCouldntPickUpItem[]; -extern const u8 *gPickedUpItem[]; -extern const u8 *gMonSteppedOnItem[]; -extern const u8 *const gUnknown_80FED30; extern const DungeonPos gUnknown_80F4468[]; -extern const u8 *const gItemFellOnGround; -extern const u8 *const gItemLost; -extern const u8 *const gItemFellOutOfSight; -extern const u8 *const gItemFellInWater; -extern const u8 *const gItemBuried; -extern const u8 *gSeveralItemsLost; -extern const u8 *gAllItemsLost; extern void sub_80416E0(PixelPos *r0, u32, bool8); extern void sub_80855E4(void *); @@ -197,7 +179,7 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg) } sub_8045BF8(gFormatBuffer_Items[0],tileItem); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); - LogMessageByIdWithPopupCheckUser(leader,*gMonSteppedOnItem); + LogMessageByIdWithPopupCheckUser(leader,gMonSteppedOnItem); } else if (ShouldMonsterRunAwayAndShowEffect(leader,1)) { if (!printMsg) { @@ -205,14 +187,14 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg) } sub_8045BF8(gFormatBuffer_Items[0],tileItem); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); - LogMessageByIdWithPopupCheckUser(leader,*gMonTerrifiedCouldntPickUpItem); + LogMessageByIdWithPopupCheckUser(leader,gMonTerrifiedCouldntPickUpItem); } else if (GetItemCategory(tileItem->id) == CATEGORY_POKE) { PlaySoundEffect(0x14c); AddToTeamMoney(GetMoneyValue(tileItem)); sub_8045BF8(gFormatBuffer_Items[0],tileItem); RemoveItemFromDungeonAt(pos,TRUE); - LogMessageByIdWithPopupCheckUser(leader,*gPickedUpItem); + LogMessageByIdWithPopupCheckUser(leader,gPickedUpItem); TryDisplayItemPickupTutorialMessage(tileItem->id); } else { @@ -281,10 +263,10 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg) RemoveItemFromDungeonAt(pos,TRUE); PlaySoundEffect(0x14a); if (inventoryIds[index] < 0) { - LogMessageByIdWithPopupCheckUser(leader,*gPickedUpItem2); + LogMessageByIdWithPopupCheckUser(leader,gPickedUpItem2); } else { - LogMessageByIdWithPopupCheckUser(leader,*gPickedUpItemToolbox); + LogMessageByIdWithPopupCheckUser(leader,gPickedUpItemToolbox); } TryDisplayItemPickupTutorialMessage(tileItem->id); return; @@ -302,7 +284,7 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg) } sub_8045BF8(gFormatBuffer_Items[0],tileItem); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); - LogMessageByIdWithPopupCheckUser(leader,*gMonSteppedOnItem); + LogMessageByIdWithPopupCheckUser(leader,gMonSteppedOnItem); } else { PlaySoundEffect(0x14a); @@ -310,16 +292,16 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg) leaderInfo->heldItem = *tileItem; sub_8045BF8(gFormatBuffer_Items[0],tileItem); RemoveItemFromDungeonAt(pos,TRUE); - LogMessageByIdWithPopupCheckUser(leader,*gPickedUpItem2); + LogMessageByIdWithPopupCheckUser(leader,gPickedUpItem2); } else if (AddItemToInventory(tileItem) != 0) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); - LogMessageByIdWithPopupCheckUser(leader,*gMonCouldntPickUpItem); + LogMessageByIdWithPopupCheckUser(leader,gMonCouldntPickUpItem); } else { sub_8045BF8(gFormatBuffer_Items[0],tileItem); RemoveItemFromDungeonAt(pos,TRUE); - LogMessageByIdWithPopupCheckUser(leader,*gPickedUpItemToolbox); + LogMessageByIdWithPopupCheckUser(leader,gPickedUpItemToolbox); } TryDisplayItemPickupTutorialMessage(tileItem->id); } @@ -759,7 +741,7 @@ void sub_8046D20(void) cVar1 = gDungeon->unk8; gDungeon->unk8 = sub_8046D70(); if (((gDungeon->unk8 == 1) && (cVar1 == 0)) && - (DisplayDungeonYesNoMessage(0, *gUnknown_80FA408, 1) == 1)) { + (DisplayDungeonYesNoMessage(0, gUnknown_80FA408, 1) == 1)) { gDungeon->unk4 = 1; gDungeon->unk11 = 2; } diff --git a/src/dungeon_kecleon_shop.c b/src/dungeon_kecleon_shop.c new file mode 100644 index 000000000..b4d1e5927 --- /dev/null +++ b/src/dungeon_kecleon_shop.c @@ -0,0 +1,357 @@ +#include "global.h" +#include "globaldata.h" +#include "weather.h" +#include "code_804267C.h" +#include "code_803E46C.h" +#include "dungeon.h" +#include "dungeon_config.h" +#include "dungeon_leader.h" +#include "dungeon_music.h" +#include "dungeon_util.h" +#include "pokemon.h" +#include "structs/map.h" +#include "dungeon_message.h" +#include "dungeon_logic.h" +#include "string_format.h" +#include "dungeon_map_access.h" +#include "position_util.h" +#include "dungeon_ai.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "dungeon_random.h" +#include "code_805D8C8.h" +#include "code_803E668.h" +#include "dungeon_items.h" +#include "move_util.h" +#include "moves.h" +#include "math.h" +#include "constants/ability.h" +#include "constants/monster.h" +#include "constants/type.h" +#include "dungeon_misc.h" +#include "code_807E5AC.h" +#include "sprite.h" +#include "dungeon_strings.h" + +extern bool8 sub_8044B28(void); + +bool8 sub_807EF48(void); +void sub_807EFFC(bool8 arg0); +s32 sub_807F19C(bool8 arg0); +void sub_807F33C(void); + +void sub_807EC28(bool8 arg0) +{ + Entity *leader; + EntityInfo *leaderInfo; + bool32 prevTileWasShop; + bool32 isShopTile; + + if (sub_8044B28()) + return; + + leader = GetLeader(); + leaderInfo = GetEntInfo(leader); + prevTileWasShop = gDungeon->unk644.unk54; + isShopTile = (GetTileAtEntitySafe(leader)->terrainType & TERRAIN_TYPE_SHOP) != 0; + gDungeon->unk644.unk54 = isShopTile; + gDungeon->unk644.unk55 = isShopTile; + if (gDungeon->unk644.unk2A || gDungeon->unk644.unk50 == 0) + return; + + if (leaderInfo->invisibleClassStatus.status == STATUS_INVISIBLE) { + gDungeon->unk644.unk54 = 0; + gDungeon->unk644.unk55 = 0; + } + else { + s32 i; + struct MonDialogueSpriteInfo dialogueInfo; + bool8 sameRoom = FALSE; + bool8 var_2C; + bool8 var_28; + + for (i = 0; i < DUNGEON_MAX_WILD_POKEMON; i++) { + Entity *wildMon = gDungeon->wildPokemon[i]; + if (EntityIsValid(wildMon)) { + EntityInfo *wildMonInfo = GetEntInfo(wildMon); + if (wildMonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER && sub_8070BC0(wildMon) && GetEntityRoom(leader) == GetEntityRoom(wildMon)) { + sameRoom = TRUE; + } + } + } + + dialogueInfo.species = MONSTER_KECLEON; + dialogueInfo.spriteId = 0; + if (!prevTileWasShop) { + if (isShopTile == TRUE) { + if (sameRoom) { + DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE674, TRUE); // Ah welcome! + } + return; + } + } + else { + if (isShopTile == TRUE) { + return; + } + } + + if ((prevTileWasShop != TRUE || isShopTile) && !arg0) { + return; + } + + var_2C = FALSE; + var_28 = FALSE; + if (sub_807EF48()) { + var_28 = TRUE; + for (i = 0; i < DUNGEON_MAX_WILD_POKEMON; i++) { + Entity *wildMon = gDungeon->wildPokemon[i]; + if (EntityIsValid(wildMon) + && GetEntInfo(wildMon)->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER + && sub_8070BC0(wildMon) + && GetEntityRoom(leader) == GetEntityRoom(wildMon)) + { + var_2C = TRUE; + if (abs(leader->pos.x - wildMon->pos.x) >= 2 || abs(leader->pos.y - wildMon->pos.y) >= 2) { + s32 x, y; + DungeonPos pos; + + for (x = -1; x < 2; x++) { + for (y = -1; y < 2; y++) { + pos.x = leader->pos.x + x; + pos.y = leader->pos.y + y; + if (GetTile(pos.x, pos.y)->room != CORRIDOR_ROOM) { + if (!sub_80703A0(wildMon, &pos)) { + WarpTarget(leader, wildMon, 3, &pos); + goto LOOP_BREAK; // Used to break out of the nested loops + } + } + } + } + LOOP_BREAK: + } + + if (sub_8070BC0(leader)) { + sub_806CE34(leader, GetDirectionTowardsPosition(&leader->pos, &wildMon->pos)); + } + else { + var_2C = FALSE; + } + + sub_806CE68(wildMon, GetDirectionTowardsPosition(&wildMon->pos, &leader->pos)); + break; + } + } + } + + if (var_28 && !var_2C) { + if (gDungeon->unk644.unk50 > gDungeon->unk644.unk48) { + sub_807F33C(); + } + } + else if (var_28 && !sameRoom) { + if (gDungeon->unk644.unk50 > gDungeon->unk644.unk48) { + sub_807F33C(); + } + } + else { + sub_807EFFC(var_2C); + if (sub_807F19C(var_2C)) { + sub_807F33C(); + } + else if (prevTileWasShop == TRUE && !isShopTile && sameRoom) { + DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE65C, TRUE); // I await your next visit + } + } + } +} + +bool8 sub_807EF48(void) +{ + if ((gDungeon->unk644.unk50 - gDungeon->unk644.unk48) > 0) { + return TRUE; + } + if (gDungeon->unk644.unk4C != 0) { + return TRUE; + } + + return FALSE; +} + +void sub_807EF84(void) +{ + s32 val; + struct MonDialogueSpriteInfo dialogueInfo; + + dialogueInfo.species = MONSTER_KECLEON; + dialogueInfo.spriteId = 0; + + sub_807EFFC(1); + val = sub_807F19C(TRUE); + if (val != 0) { + Tile *tile = GetTileAtEntitySafe(GetLeader()); + if (tile->terrainType & TERRAIN_TYPE_SHOP) { + if (val != 2) { + DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE63C, 1); // This is very disappointing, please return any items before you leave. + } + } + else { + sub_807F33C(); + } + } + else { + DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE5F0, 1); // Looking forward to seeing you again! + } +} + +void sub_807EFFC(bool8 arg0) +{ + struct MonDialogueSpriteInfo dialogueInfo; + + if (gDungeon->unk644.unk4C == 0) + return; + + dialogueInfo.species = MONSTER_KECLEON; + dialogueInfo.spriteId = 0; + if (!arg0) + return; + + gFormatArgs[0] = gDungeon->unk644.unk4C; + if (DisplayDungeonYesNoMessage(&dialogueInfo, gUnknown_80FE5C0, TRUE) == 1) { // For the merch you have left, I shall pay X. Is that acceptable? + s32 x, y; + DungeonPos pos; + s32 local_24; + + PlaySoundEffect(0x14c); + AddToTeamMoney(gDungeon->unk644.unk4C); + local_24 = gDungeon->unk644.unk48; + for (x = gDungeon->kecleonShopPos.minX; x <= gDungeon->kecleonShopPos.maxX; x++) { + for (y = gDungeon->kecleonShopPos.minY; y <= gDungeon->kecleonShopPos.maxY; y++) { + const Tile *tile; + + pos.y = y; + pos.x = x; + tile = GetTile(x,y); + if (tile->terrainType & TERRAIN_TYPE_SHOP && tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) { + Item *itemPtr = GetItemData(tile->object); + if (!ItemInShop(itemPtr)) { + Item item = *itemPtr; + RemoveItemFromDungeonAt(&pos, 1); + if (CanSellItem(item.id)) { + item.flags |= ITEM_FLAG_IN_SHOP; + } + AddItemToDungeonAt(&pos, &item, 1); + } + } + } + } + + gDungeon->unk644.unk50 += (gDungeon->unk644.unk48 - local_24); + DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE4F4, 1); // Your patronage is valued + } +} + +s32 sub_807F19C(bool8 arg0) +{ + s32 diff; + struct MonDialogueSpriteInfo dialogueInfo; + s32 i, x, y; + + dialogueInfo.species = MONSTER_KECLEON; + dialogueInfo.spriteId = 0; + diff = gDungeon->unk644.unk50 - gDungeon->unk644.unk48; + if (diff > 0) { + if (!arg0) { + return 1; + } + + gFormatArgs[0] = diff; + if (DisplayDungeonYesNoMessage(&dialogueInfo, gUnknown_80FE568, TRUE) != 1) { // The merchandise you have chosen costs X + return 1; + } + if (gTeamInventoryRef->teamMoney < diff) { + DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE520, TRUE); // You don't have enough money. + return 2; + } + PlaySoundEffect(0x14c); + AddToTeamMoney(-diff); + + for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { + const Tile *tile = GetTile(x, y); + if (!(tile->terrainType & TERRAIN_TYPE_SHOP) && tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) { + Item *itemPtr = GetItemData(tile->object); + if (CanSellItem(itemPtr->id)) { + itemPtr->flags &= ~(ITEM_FLAG_IN_SHOP); + } + } + } + } + + for (i = 0; i < INVENTORY_SIZE; i++) { + Item *item = &gTeamInventoryRef->teamItems[i]; + if (ItemExists(item) && CanSellItem(item->id)) { + item->flags &= ~(ITEM_FLAG_IN_SHOP); + } + } + + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *mon = gDungeon->activePokemon[i]; + if (EntityIsValid(mon)) { + EntityInfo *monInfo = GetEntInfo(mon); + Item *item = &monInfo->heldItem; + if (ItemExists(item) && CanSellItem(item->id)) { + item->flags &= ~(ITEM_FLAG_IN_SHOP); + } + } + } + gDungeon->unk644.unk50 = gDungeon->unk644.unk48; + DisplayDungeonMessage(&dialogueInfo, gUnknown_80FE4D4, TRUE); // Thank you very much. + } + + return 0; +} + +void sub_807F33C(void) +{ + s32 i, x, y; + + gDungeon->unk644.unk2A = 1; + gDungeon->unk644.unk2B = 1; + LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FE4B8); // Help! Thief! I've been robbed! Help me catch the thief. + for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { + const Tile *tile = GetTile(x,y); + if (tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) { + Item *item = GetItemData(tile->object); + item->flags &= ~(ITEM_FLAG_IN_SHOP); + } + } + } + + for (i = 0; i < INVENTORY_SIZE; i++) { + Item *item = &gTeamInventoryRef->teamItems[i]; + if (ItemExists(item)) { + item->flags &= ~(ITEM_FLAG_IN_SHOP); + } + } + + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *entity = gDungeon->activePokemon[i]; + if (EntityIsValid(entity)) { + Item *item; + EntityInfo *info = GetEntInfo(entity); + + info->shopkeeper = FALSE; + CalcSpeedStage(entity); + item = &info->heldItem; + if (ItemExists(item)) { + item->flags &= ~(ITEM_FLAG_IN_SHOP); + } + } + } + + gDungeon->unk644.unk50 = 0; + gDungeon->unk644.unk48 = 0; + gDungeon->unk644.unk4C = 0; +} diff --git a/src/dungeon_logic.c b/src/dungeon_logic.c new file mode 100644 index 000000000..25cf204b6 --- /dev/null +++ b/src/dungeon_logic.c @@ -0,0 +1,1448 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_logic.h" +#include "structs/map.h" +#include "constants/item.h" +#include "constants/iq_skill.h" +#include "constants/status.h" +#include "constants/type.h" +#include "constants/weather.h" +#include "run_dungeon.h" +#include "dungeon_items.h" +#include "structs/str_dungeon.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "pokemon.h" +#include "weather.h" +#include "constants/ability.h" +#include "constants/dungeon.h" +#include "constants/tactic.h" +#include "constants/targeting.h" +#include "dungeon_random.h" +#include "dungeon_move_util.h" +#include "code_800D090.h" +#include "dungeon_message.h" +#include "pokemon_mid.h" +#include "dungeon_strings.h" +#include "constants/move_id.h" +#include "moves.h" +#include "pokemon_3.h" +#include "pokemon.h" +#include "dungeon_config.h" + +// This file deals with things like controlling movement, walkable tiles, ai targeting, status checks and pokemon attributes. + +extern void sub_80429B4(Entity *r0); +extern void ShowVisualFlags(Entity *r0); + +EWRAM_DATA u8 gWalkableTileToCrossableTerrain[8] = {0}; + +u8 GetCrossableTerrain(s16 species) +{ + u8 walkableTiles = GetMovementType(species); + if (walkableTiles >= NUM_CROSSABLE_TERRAIN) + { + // Pokémon that can cross water or lava have a walkable tile value of 4 (MOVEMENT_TYPE_LAVA) or 5 (MOVEMENT_TYPE_WATER), respectively. + // Indices 4 and 5 in this array are assigned either CROSSABLE_TERRAIN_REGULAR or CROSSABLE_TERRAIN_LIQUID + // depending on whether the dungeon's liquid is water or lava. + // For example, a lava dungeon like Mt. Blaze would have these values: + // gWalkableTileToCrossableTerrain[MOVEMENT_TYPE_LAVA]: CROSSABLE_TERRAIN_LIQUID + // gWalkableTileToCrossableTerrain[MOVEMENT_TYPE_WATER]: CROSSABLE_TERRAIN_REGULAR + // This means a Fire-type can cross the dungeon's liquid, while a Water-type cannot. + return gWalkableTileToCrossableTerrain[walkableTiles]; + } + else + { + return walkableTiles; + } +} + +u8 sub_807034C(s32 id, const Tile *tile) +{ + s32 crossableTerrain; + u16 tileFlags; + s32 id_s32; + + id_s32 = SpeciesId(id); + + if ((tile->monster == NULL) && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) { + crossableTerrain = GetCrossableTerrain(id_s32); + tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); + switch(crossableTerrain) + { + case CROSSABLE_TERRAIN_LIQUID: + if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; + case CROSSABLE_TERRAIN_REGULAR: + if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; + break; + case CROSSABLE_TERRAIN_WALL: + default: + return FALSE; + case CROSSABLE_TERRAIN_CREVICE: + if(tileFlags != 0) return FALSE; + } + } + return TRUE; +} + +u8 sub_80703A0(Entity *pokemon, DungeonPos *pos) +{ + const Tile *tile; + u8 crossableTerrain; + u16 tileFlags; + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + tile = GetTile(pos->x,pos->y); + if (pos->x < 0 || pos->y < 0) + return TRUE; + if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) + return TRUE; + if (tile->monster != NULL) + return TRUE; + if (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) + return TRUE; + + if ((IsCurrentFixedRoomBossFight()) || ((entityInfo->invisibleClassStatus.status != STATUS_MOBILE && (!HasHeldItem(pokemon, ITEM_MOBILE_SCARF))))) { + crossableTerrain = GetCrossableTerrain(entityInfo->id); + tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); + if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + switch(crossableTerrain) + { + case CROSSABLE_TERRAIN_LIQUID: + if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; + case CROSSABLE_TERRAIN_REGULAR: + if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; + break; + case CROSSABLE_TERRAIN_WALL: + default: + return FALSE; + case CROSSABLE_TERRAIN_CREVICE: + if(tileFlags != 0) return FALSE; + } + } + else { + return FALSE; + } + + return TRUE; +} + +bool8 CanCrossWalls(Entity *pokemon) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + if (pokemonInfo->invisibleClassStatus.status == STATUS_MOBILE) + { + return TRUE; + } + if (HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + { + return TRUE; + } + if (GetCrossableTerrain(pokemonInfo->id) == CROSSABLE_TERRAIN_WALL) + { + return TRUE; + } + return FALSE; +} + +bool8 sub_807049C(Entity *pokemon, DungeonPos *pos) +{ + s32 crossableTerrain; + const Tile *tile; + u16 tileFlags; + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + tile = GetTile(pos->x,pos->y); + if (pos->x < 0 || pos->y < 0) + return TRUE; + if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) + return TRUE; + if (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) + return TRUE; + if (tile->monster != NULL && GetEntityType(tile->monster) != ENTITY_MONSTER) + return TRUE; + + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + crossableTerrain = GetCrossableTerrain(entityInfo->id); + tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); + if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + switch(crossableTerrain) + { + case CROSSABLE_TERRAIN_LIQUID: + if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; + case CROSSABLE_TERRAIN_REGULAR: + if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; + break; + case CROSSABLE_TERRAIN_WALL: + default: + return FALSE; + case CROSSABLE_TERRAIN_CREVICE: + if(tileFlags != 0) return FALSE; + } + } + else { + return FALSE; + } + + return TRUE; +} + +bool8 sub_8070564(Entity *pokemon, DungeonPos *pos) +{ + u16 crossableTerrain; + u32 tileFlags; + + EntityInfo *entityInfo = GetEntInfo(pokemon); + const Tile *tile = GetTile(pos->x,pos->y); + + if (pos->x < 0 || pos->y < 0) + return TRUE; + if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) + return TRUE; + if (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) + return TRUE; + if (tile->monster != NULL && GetEntityType(tile->monster) != ENTITY_MONSTER) + return TRUE; + + crossableTerrain = GetCrossableTerrain(entityInfo->id); + tileFlags = GetTerrainType(tile); + + switch (crossableTerrain) + { + default: + return FALSE; + case CROSSABLE_TERRAIN_WALL: + case CROSSABLE_TERRAIN_CREVICE: + if (tileFlags != TERRAIN_TYPE_WALL) return FALSE; + break; + case CROSSABLE_TERRAIN_REGULAR: + if (tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; + break; + case CROSSABLE_TERRAIN_LIQUID: + if (tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; + if (tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; + break; + } + + return TRUE; +} + +bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos) +{ + s32 crossableTerrain; + const Tile *tile; + u16 tileFlags; + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + tile = GetTile(pos->x,pos->y); + if (pos->x < 0 || pos->y < 0) + return TRUE; + if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) + return TRUE; + if (((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) && (tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + crossableTerrain = GetCrossableTerrain(entityInfo->id); + tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); + if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + + switch(crossableTerrain) + { + case CROSSABLE_TERRAIN_WALL: + default: + return FALSE; + case CROSSABLE_TERRAIN_REGULAR: + case CROSSABLE_TERRAIN_LIQUID: + case CROSSABLE_TERRAIN_CREVICE: + if(tileFlags != 0) return FALSE; + } + } + else return FALSE; + } + return TRUE; +} + +bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos) +{ + s32 crossableTerrain; + const Tile *tile; + u16 tileFlags; + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + tile = GetTile(pos->x,pos->y); + if (pos->x < 0 || pos->y < 0) + return TRUE; + if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) + return TRUE; + if ((((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) + && (tile->monster == NULL || ((GetEntityType(tile->monster) == ENTITY_MONSTER) && (GetEntInfo(tile->monster) == entityInfo)))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + crossableTerrain = GetCrossableTerrain(entityInfo->id); + tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); + if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + switch(crossableTerrain) + { + case CROSSABLE_TERRAIN_LIQUID: + if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; + case CROSSABLE_TERRAIN_REGULAR: + if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; + break; + case CROSSABLE_TERRAIN_WALL: + default: + return FALSE; + case CROSSABLE_TERRAIN_CREVICE: + if(tileFlags != 0) return FALSE; + } + } + else return FALSE; + } + return TRUE; +} + +s32 CalcSpeedStage(Entity *pokemon) +{ + s32 index; + s32 speed; + EntityInfo * entityInfo; + + entityInfo = GetEntInfo(pokemon); + speed = 0; + + for(index = 0; index < NUM_SPEED_COUNTERS; index++) + { + if (entityInfo->speedUpCounters[index + NUM_SPEED_COUNTERS] != 0) { + speed--; + } + if (entityInfo->speedUpCounters[index] != 0) { + speed++; + } + } + + if (entityInfo->burnClassStatus.status == STATUS_PARALYSIS) { + speed--; + } + + speed += GetMovementSpeed(entityInfo->id); + if ((MonsterIsType(pokemon, TYPE_ICE)) && (GetApparentWeather(pokemon) == WEATHER_SNOW)) { + speed++; + } + if (entityInfo->apparentID == MONSTER_DEOXYS_SPEED) { + speed++; + } + if ((entityInfo->id == MONSTER_KECLEON) && entityInfo->isNotTeamMember && + gDungeon->unk644.unk2A) { + speed++; + } + if (speed < 0) { + speed = 0; + } + if (MAX_SPEED_STAGE < speed) { + speed = MAX_SPEED_STAGE; + } + entityInfo->speedStage = speed; + return speed; +} + +s32 sub_8070828(Entity *pokemon, bool8 displayMessage) +{ + bool8 flag; + + flag = FALSE; + if (!EntityIsValid(pokemon)) { + return 0; + } + else { + if ((AbilityIsActive(pokemon, ABILITY_SWIFT_SWIM)) && (GetApparentWeather(pokemon) == WEATHER_RAIN)) { + flag = TRUE; + } + if ((AbilityIsActive(pokemon, ABILITY_CHLOROPHYLL)) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { + flag = TRUE; + } + if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) { + sub_80429B4(pokemon); + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FEE80); + } + if (flag) { + return 2; + } + else { + return 1; + } + } +} + +void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) +{ + if (((gDungeon->unk181e8.blinded || + gDungeon->unk181e8.hallucinating) || + (param_2->invisibleClassStatus.status == STATUS_INVISIBLE)) && + (param_2->isNotTeamMember)) + { + strcpy(buffer, gUnknown_80F8988); + } + else + { + if (param_2->curseClassStatus.status == STATUS_DECOY) { + strcpy(buffer, gUnknown_80F8968); + } + else + { + if (param_2->isNotTeamMember) { + if ((param_2->joinedAt.id == 0x4A) || (param_2->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { + CopyYellowMonsterNametoBuffer(buffer, param_2->apparentID); + } + else + CopyCyanMonsterNametoBuffer(buffer, param_2->apparentID); + } + else + { + sub_808D9DC(buffer, &gRecruitedPokemonRef->pokemon2[param_2->teamIndex],colorNum); + } + } + } +} + +void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum) +{ + if (entityInfo->curseClassStatus.status == STATUS_DECOY) { + sprintfStatic(buffer, _("{color}%c%s{reset}"), colorNum + 0x30, gUnknown_80F8974); + } + else if (entityInfo->isNotTeamMember) { + CopyCyanMonsterNametoBuffer(buffer, entityInfo->apparentID); + } + else { + sub_808D9DC(buffer, &gRecruitedPokemonRef->pokemon2[entityInfo->teamIndex], colorNum); + } +} + +void sub_80709C8(u8 *buffer, EntityInfo *entityInfo) +{ + if (((gDungeon->unk181e8.blinded || + gDungeon->unk181e8.hallucinating) || + (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE)) && + (entityInfo->isNotTeamMember)) + { + strcpy(buffer, gUnknown_80F8994); + } + else + { + if (entityInfo->curseClassStatus.status == STATUS_DECOY) { + strcpy(buffer, gUnknown_80F8974); + } + else + { + if (entityInfo->isNotTeamMember) { + CopyMonsterNameToBuffer(buffer, entityInfo->apparentID); + } + else + { + sub_808DA0C(buffer, &gRecruitedPokemonRef->pokemon2[entityInfo->teamIndex]); + } + } + } +} + +bool8 HasNegativeStatus(Entity *pokemon) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + s32 i; + if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || + pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE || + pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || + pokemonInfo->burnClassStatus.status != STATUS_NONE || + (pokemonInfo->frozenClassStatus.status != STATUS_INGRAIN && pokemonInfo->frozenClassStatus.status != STATUS_NONE) || + pokemonInfo->cringeClassStatus.status != STATUS_NONE || + pokemonInfo->curseClassStatus.status == STATUS_CURSED || + pokemonInfo->curseClassStatus.status == STATUS_DECOY || + pokemonInfo->leechSeedClassStatus.status == STATUS_LEECH_SEED || + pokemonInfo->sureShotClassStatus.status == STATUS_WHIFFER || + pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER || + pokemonInfo->blinkerClassStatus.status == STATUS_CROSS_EYED || + pokemonInfo->muzzled.muzzled == TRUE || + pokemonInfo->exposed || + pokemonInfo->perishSongTurns != 0) + { + return TRUE; + } + for (i = 0; i < MAX_MON_MOVES; i++) + { + Move *moves = pokemonInfo->moves.moves; + if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags2 & MOVE_FLAG_SEALED) + { + return TRUE; + } + } + for (i = 0; i < NUM_SPEED_COUNTERS; i++) + { + if (pokemonInfo->speedDownCounters[i] != 0) + { + return TRUE; + } + } + return FALSE; +} + +bool8 IsSleeping(Entity *pokemon) +{ + if (GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_SLEEP && + GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NAPPING && + GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NIGHTMARE) + { + return FALSE; + } + return TRUE; +} + +bool8 HasLowHealth(Entity *pokemon) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + if (pokemonInfo->HP <= pokemonInfo->maxHPStat / 4) + { + return TRUE; + } + return FALSE; +} + +// TODO CheckVariousStatuses, CheckVariousStatuses2, CheckVariousConditions all check for different conditions that interfere with a Pokémon's ability to act, +// but I'm not sure what the reason is for each function checking the conditions that they do. +// These functions could use better names if someone figures out a clear pattern/reasoning. +bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + + if ((checkBlinker && pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER)) + return TRUE; + if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || pokemonInfo->sleepClassStatus.status == STATUS_NAPPING || pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE) + return TRUE; + if (pokemonInfo->cringeClassStatus.status == STATUS_PAUSED || pokemonInfo->cringeClassStatus.status == STATUS_INFATUATED) + return TRUE; + if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) + return TRUE; + if (pokemonInfo->terrifiedTurns != 0) + return TRUE; + + return FALSE; +} + +bool8 sub_8070BC0(Entity* entity) +{ + EntityInfo *entityInfo = GetEntInfo(entity); + + if (IsChargingAnyTwoTurnMove(entity, FALSE) + || entityInfo->sleepClassStatus.status == STATUS_YAWNING + || entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE + || ShouldMonsterRunAway(entity) + || entityInfo->muzzled.muzzled == TRUE + || entityInfo->frozenClassStatus.status == STATUS_PETRIFIED + || entityInfo->frozenClassStatus.status == STATUS_FROZEN) + return FALSE; + + if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) + return FALSE; + if (entityInfo->sleepClassStatus.status == STATUS_SLEEP) + return FALSE; + if (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE + || entityInfo->sleepClassStatus.status == STATUS_NAPPING) + return FALSE; + if (entityInfo->cringeClassStatus.status == STATUS_CRINGE) + return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_WRAP) + return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED + || entityInfo->blinkerClassStatus.status == STATUS_CROSS_EYED) + return FALSE; + if (entityInfo->curseClassStatus.status == STATUS_DECOY) + return FALSE; + if (entityInfo->blinkerClassStatus.status == STATUS_BLINKER) + return FALSE; + if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED + && entityInfo->cringeClassStatus.status != STATUS_PAUSED) + return TRUE; + + return FALSE; +} + +bool8 CheckVariousConditions(Entity *pokemon) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + + if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET + || IsExperienceLocked(pokemonInfo->joinedAt.id) + || (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon)) + || CheckVariousStatuses2(pokemon, FALSE) + || CheckVariousStatuses(pokemon)) + return TRUE; + + if (IsChargingAnyTwoTurnMove(pokemon, FALSE)) + return TRUE; + + return FALSE; +} + +bool8 CheckVariousStatuses(Entity *pokemon) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + + if ((pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS && pokemonInfo->sleepClassStatus.status != STATUS_NONE)) + return TRUE; + if (pokemonInfo->frozenClassStatus.status == STATUS_FROZEN || pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) + return TRUE; + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) + return TRUE; + + return FALSE; +} + +bool8 CannotAttack(Entity *pokemon, bool8 skipSleep) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + + if ((skipSleep || + pokemonInfo->sleepClassStatus.status == STATUS_SLEEPLESS || + pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || + pokemonInfo->sleepClassStatus.status == STATUS_NONE) && + pokemonInfo->frozenClassStatus.status != STATUS_FROZEN && + pokemonInfo->frozenClassStatus.status != STATUS_WRAP && + pokemonInfo->frozenClassStatus.status != STATUS_WRAPPED && + pokemonInfo->frozenClassStatus.status != STATUS_PETRIFIED && + pokemonInfo->cringeClassStatus.status != STATUS_CRINGE && + pokemonInfo->cringeClassStatus.status != STATUS_PAUSED && + pokemonInfo->cringeClassStatus.status != STATUS_INFATUATED && + pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS && + !ShouldMonsterRunAway(pokemon)) + return FALSE; + + return TRUE; +} + +static const u8 gDirectionBitMasks_1[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +static const u8 gDirectionBitMasks_2[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +static const u8 gDirectionBitMasks_3[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +static const u8 gDirectionBitMasks_4[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +static const u8 gDirectionBitMasks_5[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +static const u8 gDirectionBitMasks_6[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; +static const u8 gDirectionBitMasks_7[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; + +static const u8 gTreatmentData[3][2][2][2] = { + { + { + {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE}, + {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE} + }, + { + {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE}, + {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE} + } + }, + { + { + {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE}, + {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE} + }, + { + {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY}, + {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY} + } + }, + { + { + {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY}, + {TREATMENT_IGNORE, TREATMENT_TREAT_AS_ENEMY} + }, + { + {TREATMENT_TREAT_AS_ENEMY, TREATMENT_IGNORE}, + {TREATMENT_TREAT_AS_ALLY, TREATMENT_IGNORE} + } + } +}; + +bool8 CanMoveInDirection(Entity *pokemon, u32 direction) +{ + u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); + const Tile *currentMapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, + pokemon->pos.y + gAdjacentTileOffsets[direction].y); + + if (currentMapTile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL || currentMapTile->monster != NULL) + return FALSE; + + if (!IsCurrentFixedRoomBossFight()) + { + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + crossableTerrain = CROSSABLE_TERRAIN_WALL; + else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { + if (direction & 1) + // Super Mobile can't break walls diagonally. + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + else + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + } + + currentMapTile = GetTile(pokemon->pos.x, pokemon->pos.y); + if (!(currentMapTile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_1[direction & DIRECTION_MASK])) + return FALSE; + + return TRUE; +} + +bool8 sub_8070F3C(Entity * pokemon, DungeonPos *pos, s32 direction) +{ + u8 terrain; + const Tile *tile; + + terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); + + tile = GetTile(pos->x + gAdjacentTileOffsets[direction].x, pos->y + gAdjacentTileOffsets[direction].y); + if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && + (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { + if (!IsCurrentFixedRoomBossFight()) + { + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || + HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + { + terrain = CROSSABLE_TERRAIN_WALL; + } + else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) + { + // BUG: If the Pokémon is a Ghost type that can normally attack through walls, + // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. + terrain = CROSSABLE_TERRAIN_CREVICE; + } + else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) + { + if ((direction & 1) != 0) + { + terrain = CROSSABLE_TERRAIN_CREVICE; + } + else + { + terrain = CROSSABLE_TERRAIN_WALL; + } + } + } + + tile = GetTile(pos->x, pos->y); + + if (((tile->walkableNeighborFlags[terrain] & gDirectionBitMasks_2[direction & DIRECTION_MASK]))) { + return TRUE; + } + } + return FALSE; +} + +bool8 sub_8070F14(Entity * pokemon, s32 direction) +{ + const Tile *tile; + + + tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); + if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && + (((tile->monster == NULL)))) { + + tile = GetTile(pokemon->pos.x, pokemon->pos.y); + + if (((tile->walkableNeighborFlags[0] & gDirectionBitMasks_3[direction & DIRECTION_MASK]))) { + return TRUE; + } + } + return FALSE; +} + +bool8 sub_8070F80(Entity * pokemon, s32 direction) +{ + u8 terrain; + const Tile *tile; + + terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); + + tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); + if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && + (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { + if (!IsCurrentFixedRoomBossFight()) + { + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || + HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + { + terrain = CROSSABLE_TERRAIN_WALL; + } + else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) + { + // BUG: If the Pokémon is a Ghost type that can normally attack through walls, + // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. + terrain = CROSSABLE_TERRAIN_CREVICE; + } + else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) + { + if ((direction & 1) != 0) + { + terrain = CROSSABLE_TERRAIN_CREVICE; + } + else + { + terrain = CROSSABLE_TERRAIN_WALL; + } + } + } + + tile = GetTile(pokemon->pos.x, pokemon->pos.y); + + if (((tile->walkableNeighborFlags[terrain] & gDirectionBitMasks_4[direction & DIRECTION_MASK]))) { + return TRUE; + } + } + return FALSE; +} + +UNUSED static bool8 sub_8071058(Entity * pokemon, s32 direction) +{ + u8 terrain; + const Tile *tile; + + terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); + + tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); + if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) && + (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER)) || + (!GetEntInfo(tile->monster)->isNotTeamMember)))) { + if (!IsCurrentFixedRoomBossFight()) + { + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || + HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + { + terrain = CROSSABLE_TERRAIN_WALL; + } + else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) + { + // BUG: If the Pokémon is a Ghost type that can normally attack through walls, + // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. + terrain = CROSSABLE_TERRAIN_CREVICE; + } + else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) + { + if ((direction & 1) != 0) + { + terrain = CROSSABLE_TERRAIN_CREVICE; + } + else + { + terrain = CROSSABLE_TERRAIN_WALL; + } + } + } + tile = GetTile(pokemon->pos.x, pokemon->pos.y); + + if (((tile->walkableNeighborFlags[terrain] & gDirectionBitMasks_5[direction & DIRECTION_MASK]))) { + return TRUE; + } + } + return FALSE; +} + +bool8 CanAttackInDirection(Entity *pokemon, s32 direction) +{ + u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); + const Tile *tile; + if (crossableTerrain < CROSSABLE_TERRAIN_CREVICE) + { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, + pokemon->pos.y + gAdjacentTileOffsets[direction].y); + if (!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) && + (tile->monster == NULL || GetEntityType(tile->monster) == ENTITY_MONSTER)) + { + if (!IsCurrentFixedRoomBossFight()) + { + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || + HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) + { + // BUG: If the Pokémon is a Ghost type that can normally attack through walls, + // All-Terrain Hiker/Super Mobile may make the AI think it can't attack through walls. + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) + { + if ((direction & 1) != 0) + { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + else + { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + } + } + tile = GetTile(pokemon->pos.x, pokemon->pos.y); + if (tile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_6[direction & DIRECTION_MASK]) + { + return TRUE; + } + } + return FALSE; +} + +bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemonInFront) +{ + u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); + const Tile *currentTile; + const Tile *frontTile; + *pokemonInFront = FALSE; + frontTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, + pokemon->pos.y + gAdjacentTileOffsets[direction].y); + if (frontTile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) + { + return FALSE; + } + if (frontTile->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE && + !gDungeon->unk644.monsterHouseTriggered && + IQSkillIsEnabled(pokemon, IQ_HOUSE_AVOIDER)) + { + return FALSE; + } + if (frontTile->object != NULL && + IQSkillIsEnabled(pokemon, IQ_TRAP_AVOIDER) && + GetEntityType(frontTile->object) == ENTITY_TRAP && + (frontTile->object->isVisible || GetEntInfo(pokemon)->blinkerClassStatus.status == STATUS_EYEDROPS)) + { + return FALSE; + } + if ((frontTile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY && + gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA && + IQSkillIsEnabled(pokemon, IQ_LAVA_EVADER)) + { + return FALSE; + } + if (!IsCurrentFixedRoomBossFight()) + { + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || + HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) + { + // BUG: If the Pokémon is a Ghost type that can normally move through walls, + // All-Terrain Hiker/Super Mobile may make the AI think it can't move through walls. + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) + { + if ((direction & 1) != 0) + { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + else + { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + } + } + currentTile = GetTile(pokemon->pos.x, pokemon->pos.y); + if (currentTile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_7[direction & DIRECTION_MASK]) + { + if (frontTile->monster == NULL) + { + return TRUE; + } + else + { + *pokemonInFront = TRUE; + } + } + return FALSE; +} + +bool8 IsAtJunction(Entity *pokemon) +{ + u32 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); + if (!IsCurrentFixedRoomBossFight()) + { + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) + { + crossableTerrain = CROSSABLE_TERRAIN_CREVICE; + } + else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) + { + crossableTerrain = CROSSABLE_TERRAIN_WALL; + } + } + if (crossableTerrain == CROSSABLE_TERRAIN_WALL) + { + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + pokemonInfo->mobileTurnTimer += DungeonRandInt(100); + if (pokemonInfo->mobileTurnTimer < 200) + { + return FALSE; + } + else + { + pokemonInfo->mobileTurnTimer = 0; + } + } + else + { + const Tile *mapTile; + char walkableNeighborFlags; + if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA + && crossableTerrain == CROSSABLE_TERRAIN_LIQUID + && IQSkillIsEnabled(pokemon, IQ_LAVA_EVADER)) + { + crossableTerrain = CROSSABLE_TERRAIN_REGULAR; + } + mapTile = GetTile(pokemon->pos.x, pokemon->pos.y); + walkableNeighborFlags = mapTile->walkableNeighborFlags[crossableTerrain]; + /* + Check for configurations of open tiles that are considered junctions; i.e., shaped like a 'T' or '+'. + X=Wall, O=Open + + 0x54 0x51 0x45 0x15 0x55 + XOX XOX XXX XOX XOX + OOO OOX OOO XOO OOO + XXX XOX XOX XOX XOX + */ + if (walkableNeighborFlags != 0x54 && walkableNeighborFlags != 0x51 && walkableNeighborFlags != 0x45 && walkableNeighborFlags != 0x15 && walkableNeighborFlags != 0x55) + { + return FALSE; + } + } + return TRUE; +} + +bool8 ShouldAvoidFirstHit(Entity *pokemon, bool8 forceAvoid) +{ + if (!IsTacticSet(pokemon, TACTIC_AVOID_THE_FIRST_HIT)) + return FALSE; + if (!forceAvoid) + return FALSE; + return TRUE; +} + +bool8 ShouldMonsterRunAway(Entity *pokemon) +{ + if (!EntityIsValid(pokemon)) + { + return FALSE; + } + else + { + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + if (pokemonInfo->terrifiedTurns != 0) + { + return TRUE; + } + if (pokemonInfo->isTeamLeader) + { + return FALSE; + } + if (AbilityIsActive(pokemon, ABILITY_RUN_AWAY)) + { + bool8 runAwayActive = pokemonInfo->HP < pokemonInfo->maxHPStat / 2; + if (runAwayActive) + { + return TRUE; + } + } + if (IsTacticSet(pokemon, TACTIC_GET_AWAY) || + (IsTacticSet(pokemon, TACTIC_AVOID_TROUBLE) && pokemonInfo->HP <= pokemonInfo->maxHPStat / 2)) + { + return TRUE; + } + return FALSE; + } +} + +bool8 ShouldMonsterRunAwayAndShowEffect(Entity *pokemon, bool8 showRunAwayEffect) +{ + if (ShouldMonsterRunAway(pokemon)) + { + CheckRunAwayVisualFlag(pokemon, showRunAwayEffect); + return TRUE; + } + return FALSE; +} + +void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect) +{ + bool8 cVar1; + EntityInfo *iVar2; + iVar2 = GetEntInfo(pokemon); + + if (((!iVar2->isTeamLeader) && AbilityIsActive(pokemon,ABILITY_RUN_AWAY) && + (cVar1 = SetVisualFlags(iVar2,4,iVar2->HP <= iVar2->maxHPStat / 2), showRunAwayEffect)) && + (cVar1)) { + ShowVisualFlags(pokemon); + } +} + +u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + EntityInfo *targetData = GetEntInfo(targetPokemon); + u8 decoyAITracker; + u8 pokemonTargetingDecoy; + bool8 pokemonIsEnemy; + bool8 targetIsEnemy; + bool8 targetIsDecoy; + if (pokemon == targetPokemon) + { + return TREATMENT_TREAT_AS_ALLY; + } + if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || + targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || + pokemonInfo->monsterBehavior == BEHAVIOR_DIGLETT || + targetData->monsterBehavior == BEHAVIOR_DIGLETT || + pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || + targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET || + (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->frozenClassStatus.status == STATUS_PETRIFIED) || + (!ignoreInvisible && targetData->invisibleClassStatus.status == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) + { + return TREATMENT_IGNORE; + } + pokemonTargetingDecoy = pokemonInfo->decoyAITracker; + decoyAITracker = DECOY_AI_NONE; + if (pokemonTargetingDecoy != DECOY_AI_NONE) + { + decoyAITracker = DECOY_AI_WILD; + if (pokemonTargetingDecoy == DECOY_AI_TEAM) + { + decoyAITracker = DECOY_AI_TEAM; + } + } + if (pokemonInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL) + { + pokemonIsEnemy = FALSE; + if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_ATTACK_TEAM) + { + pokemonIsEnemy = TRUE; + } + } + else + { + pokemonIsEnemy = pokemonInfo->isNotTeamMember ? TRUE : FALSE; + } + if (targetData->shopkeeper != SHOPKEEPER_MODE_NORMAL) + { + targetIsEnemy = FALSE; + if (targetData->shopkeeper == SHOPKEEPER_MODE_ATTACK_TEAM) + { + targetIsEnemy = TRUE; + } + } + else + { + targetIsEnemy = targetData->isNotTeamMember ? TRUE : FALSE; + } + targetIsDecoy = FALSE; + if (targetData->curseClassStatus.status == STATUS_DECOY) + { + targetIsDecoy = TRUE; + } + return gTreatmentData[decoyAITracker][pokemonIsEnemy][targetIsEnemy][targetIsDecoy]; +} + +u8 sub_807167C(Entity * pokemon, Entity * target) +{ + bool8 cannotUseItems; + EntityInfo * targetEntityInfo; + EntityInfo * pokemonEntityData; + + pokemonEntityData = GetEntInfo(pokemon); + targetEntityInfo = GetEntInfo(target); + if (pokemonEntityData->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { + cannotUseItems = IsExperienceLocked(pokemonEntityData->joinedAt.id); + if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET)) { + cannotUseItems = IsExperienceLocked(targetEntityInfo->joinedAt.id); + if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) { +error: + return TREATMENT_IGNORE; + } + else + { + if ((pokemonEntityData->isNotTeamMember) != (targetEntityInfo->isNotTeamMember)) { + return TREATMENT_TREAT_AS_ENEMY; + } + else { + return TREATMENT_TREAT_AS_ALLY; + } + } + } + } + goto error; +} + +bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage) +{ + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_SAFEGUARD) { + if (displayMessage) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); + } + return TRUE; + } + return FALSE; +} + +bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) +{ + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIST) { + if (displayMessage) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); + } + return TRUE; + } + else { + if (AbilityIsActive(target, ABILITY_CLEAR_BODY) || AbilityIsActive(target, ABILITY_WHITE_SMOKE)) { + if (displayMessage) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC); + } + return TRUE; + } + } + return FALSE; +} + +bool8 sub_80717A4(Entity *pokemon, u16 moveID) +{ + EntityInfo * entityInfo; + s32 i; + + entityInfo = GetEntInfo(pokemon); + if ((entityInfo->sleepClassStatus.status != STATUS_SLEEP) && (entityInfo->sleepClassStatus.status != STATUS_NAPPING) && (entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE)) { + return FALSE; + } + else { + for (i = 0; i < MAX_MON_MOVES; i++) { + Move *move = &entityInfo->moves.moves[i]; + if (MoveFlagExists(move) + && (entityInfo->isTeamLeader || (move->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) + && sub_805744C(pokemon, move, TRUE) + && move->PP != 0 + && move->id == moveID) + { + return TRUE; + } + } + } + + return FALSE; +} + +bool8 AbilityIsActive(Entity *pokemon, u8 ability) +{ + if (!EntityIsValid(pokemon)) + { + return FALSE; + } + else + { + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + if (pokemonInfo->abilities[0] == ability || pokemonInfo->abilities[1] == ability) + { + return TRUE; + } + return FALSE; + } +} + +bool8 MonsterIsType(Entity *pokemon, u8 type) +{ + EntityInfo *pokemonInfo = pokemonInfo = GetEntInfo(pokemon); + if (type == TYPE_NONE) + { + return FALSE; + } + if (pokemonInfo->types[0] == type) + { + return TRUE; + } + if (pokemonInfo->types[1] == type) + { + return TRUE; + } + return FALSE; +} + +bool8 CanSeeInvisibleMonsters(Entity *pokemon) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + if (pokemonInfo->blinkerClassStatus.status != STATUS_EYEDROPS) + { + if (!HasHeldItem(pokemon, ITEM_GOGGLE_SPECS)) + return FALSE; + else + return TRUE; + } + else + return TRUE; +} + +bool8 IsTacticSet(Entity *pokemon, u8 tactic) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + if (pokemonInfo->isTeamLeader) + { + bool8 isGoTheOtherWay = tactic == TACTIC_GO_THE_OTHER_WAY; + return isGoTheOtherWay; + } + return pokemonInfo->tactic == tactic; +} + +bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill) +{ + return IsIQSkillSet(&GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill); +} + +UNUSED static bool8 IQSkillPairIsEnabled(Entity *pokemon, u8 IQSkill1, u8 IQSkill2) +{ + return IsIQSkillSet(&GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill1 | 1 << IQSkill2); +} + +void LoadIQSkills(Entity *pokemon) +{ + s32 IQSkill; + EntityInfo *pokemonInfo; + + pokemonInfo = GetEntInfo(pokemon); + if (pokemonInfo->isNotTeamMember) { + IqSkillFlags *iqSkills = &pokemonInfo->IQSkillFlags; + SetIQSkill(iqSkills, IQ_STATUS_CHECKER); + SetIQSkill(iqSkills, IQ_PP_CHECKER); + SetIQSkill(iqSkills, IQ_ITEM_CATCHER); + if (pokemonInfo->bossFlag) + SetIQSkill(iqSkills, IQ_SELF_CURER); + if (pokemonInfo->level >= gIqItemMasterMinWildLevel) + SetIQSkill(iqSkills, IQ_ITEM_MASTER); + pokemonInfo->tactic = TACTIC_GO_AFTER_FOES; + } + else { + pokemonInfo->IQSkillFlags.flags[0] = 0; + pokemonInfo->IQSkillFlags.flags[1] = 0; + pokemonInfo->IQSkillFlags.flags[2] = 0; + for(IQSkill = IQ_TYPE_ADVANTAGE_MASTER; IQSkill < NUM_IQ_SKILLS; IQSkill++) + { + if (HasIQForSkill(pokemonInfo->IQ,IQSkill) && + IsIQSkillSet(&pokemonInfo->IQSkillMenuFlags, 1 << IQSkill)) + { + SetIQSkill(&pokemonInfo->IQSkillFlags,IQSkill); + } + } + } +} + +bool8 CanSeeTeammate(Entity * pokemon) +{ + Entity *teamMember; + s32 memberIdx; + + if (GetEntInfo(pokemon)->isNotTeamMember) { + return FALSE; + } + else + { + for(memberIdx = 0; memberIdx < MAX_TEAM_MEMBERS; memberIdx++) + { + teamMember = gDungeon->teamPokemon[memberIdx]; + if (EntityIsValid(pokemon) && (pokemon != teamMember) && (CanSeeTarget(pokemon,teamMember))) + { + return TRUE; + } + } + return FALSE; + } +} + +u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove) +{ + if (pokeMove->id == MOVE_HIDDEN_POWER) + return GetEntInfo(pokemon)->hiddenPower.hiddenPowerType; + else + return GetMoveType(pokeMove); +} + +s32 GetMovePower(Entity *pokemon, Move *pokeMove) +{ + if(pokeMove->id == MOVE_HIDDEN_POWER) + return (GetEntInfo(pokemon)->hiddenPower.hiddenPowerBasePower + pokeMove->ginseng); + else + return (GetMoveBasePower(pokeMove) + pokeMove->ginseng); +} + +bool8 MonsterCanThrowItems(EntityInfo *pokemon) +{ + if(!MonsterIDCanThrowItems(pokemon->id)) + return FALSE; + return TRUE; +} + +bool8 sub_8071A8C(Entity *pokemon) +{ + EntityInfo *pokemonInfo; + if(EntityIsValid(pokemon)) + { + pokemonInfo = GetEntInfo(pokemon); + if(pokemonInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) + { + if(!IsExperienceLocked(pokemonInfo->joinedAt.id)) + return TRUE; + } + } + return FALSE; +} + +bool8 SetVisualFlags(EntityInfo *entityInfo, u16 newFlag, bool8 param_3) +{ + if ((entityInfo->visualFlags & newFlag)) { + entityInfo->previousVisualFlags = newFlag | entityInfo->previousVisualFlags; + } + else { + entityInfo->previousVisualFlags = entityInfo->previousVisualFlags & ~newFlag; + } + + if (param_3) { + entityInfo->visualFlags = newFlag | entityInfo->visualFlags; + } + else { + entityInfo->visualFlags = entityInfo->visualFlags & ~newFlag; + } + if ( ((entityInfo->previousVisualFlags & newFlag) == 0) && ((entityInfo->visualFlags & newFlag)) ) { + return TRUE; + } + else { + return FALSE; + } +} diff --git a/src/dungeon_main.c b/src/dungeon_main.c index ee40d17df..b21dc9381 100644 --- a/src/dungeon_main.c +++ b/src/dungeon_main.c @@ -10,20 +10,18 @@ #include "structs/str_text.h" #include "structs/struct_sub80095e4.h" #include "bg_control.h" -#include "charge_move.h" +#include "dungeon_move_util.h" #include "code_800D090.h" #include "code_801602C.h" #include "code_801B3C0.h" #include "code_803E46C.h" #include "code_803E724.h" #include "code_8044CC8.h" -#include "code_8045A00.h" #include "code_8066D04.h" #include "code_806CD90.h" #include "dungeon_action.h" #include "dungeon_ai_movement.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" +#include "dungeon_logic.h" #include "dungeon_items.h" #include "dungeon_leader.h" #include "dungeon_main.h" @@ -36,13 +34,11 @@ #include "dungeon_menu_team.h" #include "dungeon_menu_tile.h" #include "dungeon_message.h" +#include "dungeon_message_log.h" #include "dungeon_misc.h" -#include "dungeon_movement.h" #include "dungeon_music.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "game_options.h" #include "input.h" #include "items.h" @@ -54,9 +50,7 @@ #include "pokemon.h" #include "pokemon_3.h" #include "sprite.h" -#include "status_checks_1.h" #include "string_format.h" -#include "tile_types.h" #include "trap.h" #include "weather.h" diff --git a/src/dungeon_map.c b/src/dungeon_map.c index f0db4757a..e15ad2c41 100644 --- a/src/dungeon_map.c +++ b/src/dungeon_map.c @@ -21,7 +21,6 @@ #include "text_1.h" #include "trap.h" -extern DungeonPos gPlayerDotMapPosition; extern s32 gUnknown_202EDD0; extern u8 GetFloorType(void); @@ -67,6 +66,7 @@ EWRAM_DATA bool8 gShowDungeonMap = FALSE; EWRAM_DATA static u8 sPlayerDotFrames = 0; EWRAM_DATA static OpenedFile *sDungeonMapGfxFile = NULL; EWRAM_DATA static void *sDungeonMapVramDst = NULL; +EWRAM_INIT DungeonPos gPlayerDotMapPosition = {100, 100}; // All traps look the same on Map, except for the Wonder Tile. static const u8 sTrapToMapGfxId[NUM_TRAPS] = diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index ad16366b5..1dfa0ecb0 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -1,34 +1,25 @@ #include "global.h" +#include "globaldata.h" +#include "dungeon_map_access.h" #include "constants/walkable_tile.h" #include "structs/str_dungeon.h" -#include "code_8042B34.h" +#include "run_dungeon.h" #include "code_8004AA0.h" #include "code_8009804.h" #include "decompress_at.h" #include "def_filearchives.h" -#include "dungeon_engine.h" #include "dungeon_leader.h" #include "dungeon_map.h" -#include "dungeon_map_access.h" -#include "dungeon_movement.h" +#include "dungeon_logic.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "game_options.h" #include "random.h" #include "text_1.h" -#include "tile_types.h" +#include "code_806CD90.h" -extern const Tile gOtherOobTile; -extern const Tile gWaterOobTile; -extern u8 gUnknown_80F6A04[]; -extern u8 gUnknown_80F6A10[]; -extern u8 gUnknown_80F6A28[]; -extern u8 gUnknown_80F6A1C[]; -extern u8 gUnknown_80F6A34[]; -extern u8 gUnknown_80F6A40[]; extern u8 gUnknown_8108EC0[]; -extern const s16 gUnknown_80F6A4A[]; -extern const s16 gUnknown_80F6C06[]; + +extern void sub_8042A14(DungeonPos *); EWRAM_DATA OpenedFile *gDungeonPaletteFile = {0}; EWRAM_DATA unkStruct_202EE8C gUnknown_202EE8C[32] = {0}; @@ -37,6 +28,16 @@ EWRAM_DATA Tile gOutOfBoundsTileData = {0}; EWRAM_INIT const Tile *gCurTilesetOobTile = {NULL}; +static const Tile gOtherOobTile = { + .unk8 = 1, + .room = CORRIDOR_ROOM +}; +// These 2 are identical. All fields equal to 0 except unk8 and room. +static const Tile gWaterOobTile = { + .unk8 = 1, + .room = CORRIDOR_ROOM +}; + const Tile *GetTile(s32 x, s32 y) { if (x >= 0 && y >= 0 && x < DUNGEON_MAX_SIZE_X && y < DUNGEON_MAX_SIZE_Y) @@ -80,32 +81,32 @@ void LoadDungeonTilesetAssets(void) OpenedFile *file_1; u8 fileName [12]; - sprintf(fileName,gUnknown_80F6A04,gUnknown_8108EC0[gDungeon->tileset]); // b%02dfon + sprintf(fileName,"b%02dfon",gUnknown_8108EC0[gDungeon->tileset]); file = OpenFileAndGetFileDataPtr(fileName,&gDungeonFileArchive); DecompressATGlobalFile((u32 *)0x06008000,0,file); CloseFile(file); - sprintf(fileName,gUnknown_80F6A10,gDungeon->tileset); // b%02dpal + sprintf(fileName,"b%02dpal",gDungeon->tileset); gDungeonPaletteFile = OpenFileAndGetFileDataPtr(fileName,&gDungeonFileArchive); - sprintf(fileName,gUnknown_80F6A1C,gUnknown_8108EC0[gDungeon->tileset]); // b%02dcel + sprintf(fileName,"b%02dcel",gUnknown_8108EC0[gDungeon->tileset]); file_1 = OpenFileAndGetFileDataPtr(fileName,&gDungeonFileArchive); DecompressATFile(gDungeon->unk11884,0x1194,file_1); CloseFile(file_1); if (gDungeon->tileset < 0x40) { - sprintf(fileName,gUnknown_80F6A28,gUnknown_8108EC0[gDungeon->tileset]); // b%02dcex + sprintf(fileName,"b%02dcex",gUnknown_8108EC0[gDungeon->tileset]); file = OpenFileAndGetFileDataPtr(fileName,&gDungeonFileArchive); DecompressATFile(gDungeon->unk12C24,0x930,file); CloseFile(file); } else { - sprintf(fileName,gUnknown_80F6A34,gDungeon->tileset); // b%02demap0 + sprintf(fileName,"b%02demap0",gDungeon->tileset); file = OpenFileAndGetFileDataPtr(fileName,&gDungeonFileArchive); DecompressATFile(gDungeon->unk12C24,0x240,file); CloseFile(file); } - sprintf(fileName,gUnknown_80F6A40,gDungeon->tileset); // b%02dcanm + sprintf(fileName,"b%02dcanm",gDungeon->tileset); gUnknown_202F18C = OpenFileAndGetFileDataPtr(fileName,&gDungeonFileArchive); sub_8004AA4(gUnknown_202EE8C,gUnknown_202F18C,0x20); gWalkableTileToCrossableTerrain[0] = CROSSABLE_TERRAIN_REGULAR; @@ -437,6 +438,43 @@ void sub_8049BB0(s32 x, s32 y) GetTileMut(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_WALL] = flags[CROSSABLE_TERRAIN_WALL]; } +static const s16 gUnknown_80F6A4A[] = { + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, + 0, 1, 2, 0, 1, 2 +}; + +static const s16 gUnknown_80F6C06[] = { + -9, -9, -9, -10, -10, -10, -8, -8, -8, -7, -7, -7, + -6, -6, -6, -5, -5, -5, -4, -4, -4, -3, -3, -3, + -2, -2, -2, -1, -1, -1, 0, 0, 0, 1, 1, 1, + 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, + 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, + 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, + 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, + 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, + 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, + 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, + 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, + 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, + 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, + 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, + 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, + 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, + 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, + 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63 +}; + void sub_8049ED4(void) { bool32 hallucinating, showInvisibleTrapsMonsters; @@ -1025,3 +1063,160 @@ void sub_804AC20(DungeonPos *pos) } } } + +bool8 PosHasItem(DungeonPos *pos) +{ + const Tile *tile; + Entity *entity; + + tile = GetTile(pos->x,pos->y); + entity = tile->object; + if ((entity != NULL) && (GetEntityType(entity) == ENTITY_ITEM)) { + return TRUE; + } + return FALSE; +} + +Entity *GetMonsterAtPos(DungeonPos *pos) +{ + const Tile *tile; + Entity *entity; + + tile = GetTile(pos->x,pos->y); + entity = tile->monster; + if ((entity != NULL) && (entity->type == ENTITY_MONSTER)) { + return entity; + } + return NULL; +} + +bool8 sub_804AD34(DungeonPos *pos) +{ + Tile *tile; + s32 x; + Entity * entity; + s32 y; + bool8 iVar8; + s32 index; + + iVar8 = 0; + tile = GetTileMut(pos->x,pos->y); + if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))){ + iVar8 = 1; + tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL; + + for(y = -1; y < 2; y++) + { + for(x = -1; x < 2; x++) + { + sub_80498A8(x + pos->x, y + pos->y); + sub_8049BB0(x + pos->x, y + pos->y); + ShowDungeonMapAtPos(x + pos->x, y + pos->y); + } + } + } + if (iVar8 != 0) { + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) + { + entity = gDungeon->activePokemon[index]; + if (EntityIsValid(entity)) { + sub_806CF98(entity); + } + } + sub_8049ED4(); + sub_8042A14(pos); + } + return iVar8; +} + +bool8 sub_804AE08(DungeonPos *pos) +{ + Tile *tile; + s32 x; + s32 y; + bool8 uVar6; + + uVar6 = FALSE; + tile = GetTileMut(pos->x,pos->y); + + if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))) { + uVar6 = TRUE; + tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL; + tile->spawnOrVisibilityFlags = tile->spawnOrVisibilityFlags | 0x10; + + for(y = -1; y < 2; y++) + { + for(x = -1; x < 2; x++) + { + sub_8049BB0(x + pos->x, y + pos->y); + } + } + } + return uVar6; +} + +void sub_804AE84(DungeonPos *pos) +{ + Tile *tile; + s32 x; + Entity * entity; + s32 index; + s32 y; + + tile = GetTileMut(pos->x,pos->y); + if ((tile->spawnOrVisibilityFlags & 0x10) != 0) { + tile->spawnOrVisibilityFlags &= 0xffef; + + for(y = -1; y < 2; y++) + { + for(x = -1; x < 2; x++) + { + sub_80498A8(x + pos->x, y + pos->y); + ShowDungeonMapAtPos(x + pos->x, y + pos->y); + } + } + + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) + { + entity = gDungeon->activePokemon[index]; + if (EntityIsValid(entity)) { + sub_806CF98(entity); + } + } + sub_8049ED4(); + sub_8042A14(pos); + } +} + +bool8 IsTileGround(Tile *tile) +{ + bool8 isGround = FALSE; + if (IsWaterTileset()) + { + if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + { + isGround = TRUE; + } + } + else if ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_SECONDARY || + gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA) + { + isGround = TRUE; + } + return isGround; +} + +bool8 IsWaterTileset(void) +{ + if (gDungeon->tileset == 0 || + gDungeon->tileset == 0x31 || + gDungeon->tileset == 0x20 || + gDungeon->tileset == 0x21 || + gDungeon->tileset == 0x36) + { + return TRUE; + } + return FALSE; +} diff --git a/src/dungeon_menu_items.c b/src/dungeon_menu_items.c index 24dcc021b..9c88939b4 100644 --- a/src/dungeon_menu_items.c +++ b/src/dungeon_menu_items.c @@ -9,27 +9,23 @@ #include "dungeon_main.h" #include "dungeon_message.h" #include "dungeon_action.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_util.h" #include "pokemon.h" #include "items.h" #include "dungeon_music.h" #include "dungeon_ai_movement.h" -#include "code_8045A00.h" #include "string_format.h" #include "code_803E46C.h" #include "code_803E724.h" #include "trap.h" #include "dungeon_map_access.h" -#include "status_checks_1.h" #include "dungeon_items.h" #include "dungeon_leader.h" -#include "tile_types.h" #include "menu_input.h" #include "text_1.h" #include "code_8044CC8.h" #include "code_801B3C0.h" -#include "dungeon_capabilities.h" extern void PlayDungeonCancelSE(void); extern void PlayDungeonConfirmationSE(void); diff --git a/src/dungeon_menu_moves.c b/src/dungeon_menu_moves.c index 1124678d1..65f54babc 100644 --- a/src/dungeon_menu_moves.c +++ b/src/dungeon_menu_moves.c @@ -5,31 +5,28 @@ #include "code_803E46C.h" #include "code_803E724.h" #include "code_8044CC8.h" -#include "code_8045A00.h" #include "dungeon_action.h" #include "dungeon_leader.h" #include "dungeon_main.h" #include "dungeon_menu_moves.h" #include "dungeon_menu_team.h" #include "dungeon_message.h" -#include "dungeon_movement.h" +#include "dungeon_logic.h" #include "dungeon_music.h" #include "dungeon_random.h" #include "dungeon_submenu.h" +#include "dungeon_strings.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "input.h" #include "moves.h" #include "menu_input.h" #include "move_util.h" #include "music.h" #include "pokemon.h" -#include "status_checks_1.h" #include "string_format.h" #include "text_1.h" #include "text_2.h" #include "text_3.h" -#include "tile_types.h" extern void PlayDungeonCancelSE(void); extern void PlayDungeonConfirmationSE(void); @@ -52,15 +49,6 @@ extern s32 ActionToDungeonSubMenuId(u16 param_1); extern s32 gDungeonSubMenuItemsCount; extern MenuInputStruct gDungeonMenu; -extern const u8 *const gUnknown_80FE978; -extern const u8 *const gUnknown_80FDFE8; -extern const u8 *const gUnknown_80F8B40; -extern const u8 *const gUnknown_80F8B64; -extern const u8 *const gUnknown_80F8BB4; -extern const u8 *const gUnknown_80F8B88; -extern const u8 *const gUnknown_80FDF70; -extern const u8 *const gUnknown_80FDF00; - static void ShowMovesMenuWindows(Entity *entity, EntityInfo *entInfo, u8 a2, WindowTemplates *windows, WindowHeader *header, u8 *arg5, s32 arg6, s32 arg7); static void AddMovesSubMenuOptions(Entity *entity, bool8 addLinkOptions, bool8 addUseMove); static void SetSubMenuOptionAction(ActionContainer *a0, s32 a1, s32 a2); @@ -924,11 +912,6 @@ static void sub_8063E30(Move *moves, s32 id) unk_FixLinkedMovesSetEnabled8(moves); } -static inline void ResetMoveFlags(Move *move) -{ - move->moveFlags = 0; -} - bool8 sub_8063E70(Entity *entity, Move *moves, bool8 showYesNoBox, bool8 allowBPress) { s32 i, count; diff --git a/src/dungeon_menu_others.c b/src/dungeon_menu_others.c index 01495c30a..613cfc419 100644 --- a/src/dungeon_menu_others.c +++ b/src/dungeon_menu_others.c @@ -4,7 +4,6 @@ #include "code_803E46C.h" #include "code_803E724.h" #include "code_8044CC8.h" -#include "code_8045A00.h" #include "code_8097DD0.h" #include "dungeon.h" #include "dungeon_action.h" @@ -15,7 +14,9 @@ #include "dungeon_menu_others.h" #include "dungeon_menu_recruitment.h" #include "dungeon_message.h" +#include "dungeon_message_log.h" #include "dungeon_music.h" +#include "dungeon_strings.h" #include "dungeon_submenu.h" #include "dungeon_util.h" #include "game_options.h" @@ -36,35 +37,6 @@ extern u16 GetLeaderActionId(void); extern MenuInputStruct gDungeonMenu; -extern const u8 *const gUnknown_80FEBF8; -extern const u8 *const gUnknown_80FEC28; -extern const u8 *const gUnknown_80FDE6C; -extern const u8 *const gUnknown_80FDEB8; -extern const u8 *const gUnknown_80FEA44; -extern const u8 *const gUnknown_80FEA50; -extern const u8 *const gUnknown_80FEA28; -extern const u8 *const gUnknown_80FEA10; -extern const u8 *const gUnknown_80FE9F8; -extern const u8 *const gUnknown_80FE9E8; -extern const u8 *const gUnknown_80FE9CC; -extern const u8 *const gUnknown_80FE8F8; -extern const u8 *const gUnknown_80FF770; -extern const u8 *const gUnknown_80FE8F4; -extern const u8 *const gGameOptionsTextPtr; -extern const u8 *const gOptionsDungeonTextPtr; -extern const u8 *const gOptionsOthersTextPtr; -extern const u8 *const gUnknown_80FE748; -extern const u8 *const gUnknown_80FE764; -extern const u8 *const gUnknown_80FE7C0; -extern const u8 *const gUnknown_80FE788; -extern const u8 *const gUnknown_80FE7A8; -extern const u8 *const gUnknown_80FE7E4; -extern const u8 *const gUnknown_80FA61C; -extern const u8 *const gUnknown_80FA5F4; -extern const u8 *const gOptionsOthersTextPtr; -extern const u8 *const gOptionsWindowColorPtr; -extern const u8 *const gUnknown_80FF774[]; - static void PrintOthersMenuOptions(void); static void ShowGameOptionsMenu(void); static void ShowQuickSaveGiveUpMenu(void); @@ -540,16 +512,6 @@ static void PrintOthersMenuOptions(void) sub_80073E0(0); } -struct Struct_80F7C50 -{ - const u8 *str; - s32 val; -}; - -// TODO: Fix this table in other file - -extern const struct Struct_80F7C50 gUnknown_80F7C50[]; - static void PrintQuickSaveMenuOptions(void) { s32 optionsCount, currOptionId; @@ -884,21 +846,6 @@ static bool8 UnknownOthersOption(void) return FALSE; } -enum -{ - HINTS_CONTROLS, - HINTS_ORIENTATION, - HINTS_SEEDS, - HINTS_MOVES, - HINTS_RANGE, - HINTS_LINKING_MOVES, - HINTS_POKEMON_TYPES, - HINTS_TOUCH_SCREEN, - HINTS_COUNT, -}; - -#define HINTS_COUNT_RED_VERSION HINTS_COUNT - 1 // No Touch Screen Hints in Red - static void ShowHintsMenu(void) { while (1) { @@ -980,15 +927,13 @@ static void PrintHintsMenu(void) DungeonShowWindows(&windows, TRUE); sub_80137B0(&gDungeonMenu, 0); sub_80073B8(0); - PrintFormattedStringOnWindow(16, 0, gUnknown_80FF770, 0, '\0'); + PrintFormattedStringOnWindow(16, 0, gText_Hints, 0, '\0'); for (i = 0; i < HINTS_COUNT_RED_VERSION; i++) { - PrintFormattedStringOnWindow(8, GetMenuEntryYCoord(&gDungeonMenu, i), gUnknown_80FF774[i], 0, '\0'); + PrintFormattedStringOnWindow(8, GetMenuEntryYCoord(&gDungeonMenu, i), gHintsNames[i], 0, '\0'); } sub_80073E0(0); } -extern const u8 *const gUnknown_80FF7EC[2][HINTS_COUNT]; - static void ShowChosenHintWindow(s32 hintId) { bool8 unk9 = (gGameOptionsRef->unk9 != 0); @@ -1034,8 +979,8 @@ static void ShowChosenHintWindow(s32 hintId) gDungeonMenu.unkC = (gWindows[0].x + 19) * 8; gDungeonMenu.unkE = ((gWindows[0].y + 1) * 8) - 2; sub_80073B8(0); - PrintFormattedStringOnWindow(16 + hintId * 8, 0, gUnknown_80FF774[hintId], 0, '\0'); - PrintFormattedStringOnWindow(8, 16, gUnknown_80FF7EC[unk9][hintId], 0, '\0'); + PrintFormattedStringOnWindow(16 + hintId * 8, 0, gHintsNames[hintId], 0, '\0'); + PrintFormattedStringOnWindow(8, 16, gHintsDescriptions[unk9][hintId], 0, '\0'); sub_80073E0(0); while (1) { diff --git a/src/dungeon_menu_recruitment.c b/src/dungeon_menu_recruitment.c index 7710672d9..39ee7cbcc 100644 --- a/src/dungeon_menu_recruitment.c +++ b/src/dungeon_menu_recruitment.c @@ -6,6 +6,7 @@ #include "dungeon.h" #include "dungeon_menu_recruitment.h" #include "dungeon_message.h" +#include "dungeon_message_log.h" #include "dungeon_music.h" #include "exclusive_pokemon.h" #include "input.h" diff --git a/src/dungeon_menu_stairs.c b/src/dungeon_menu_stairs.c index 27727ea56..269b249aa 100644 --- a/src/dungeon_menu_stairs.c +++ b/src/dungeon_menu_stairs.c @@ -3,7 +3,6 @@ #include "code_803E46C.h" #include "code_803E724.h" #include "code_8044CC8.h" -#include "code_8045A00.h" #include "code_8097DD0.h" #include "dungeon.h" #include "dungeon_action.h" diff --git a/src/dungeon_menu_team.c b/src/dungeon_menu_team.c index a0edd4650..f32bb7e89 100644 --- a/src/dungeon_menu_team.c +++ b/src/dungeon_menu_team.c @@ -11,12 +11,10 @@ #include "code_803E46C.h" #include "code_803E724.h" #include "code_8044CC8.h" -#include "code_8045A00.h" #include "code_806CD90.h" #include "code_8097DD0.h" #include "dungeon_action.h" #include "dungeon_ai_movement.h" -#include "dungeon_capabilities.h" #include "dungeon_items.h" #include "dungeon_leader.h" #include "dungeon_main.h" @@ -25,13 +23,11 @@ #include "dungeon_menu_team.h" #include "dungeon_message.h" #include "dungeon_misc.h" -#include "dungeon_movement.h" +#include "dungeon_logic.h" #include "dungeon_music.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" #include "dungeon_submenu.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "input.h" #include "items.h" #include "menu_input.h" @@ -42,10 +38,8 @@ #include "pokemon.h" #include "pokemon_3.h" #include "sprite.h" -#include "status_checks_1.h" #include "string_format.h" #include "text_2.h" -#include "tile_types.h" #include "weather.h" extern bool8 sub_8048A68(Entity *param_1,Item *item); diff --git a/src/dungeon_menu_tile.c b/src/dungeon_menu_tile.c index 6d9004712..1079ea36b 100644 --- a/src/dungeon_menu_tile.c +++ b/src/dungeon_menu_tile.c @@ -3,7 +3,6 @@ #include "code_803E46C.h" #include "code_803E724.h" #include "code_8044CC8.h" -#include "code_8045A00.h" #include "code_8097DD0.h" #include "dungeon.h" #include "dungeon_action.h" diff --git a/src/dungeon_message.c b/src/dungeon_message.c index dc904cd8b..ff2ae0523 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -1,4 +1,7 @@ #include "global.h" +#include "globaldata.h" +#include "dungeon_message.h" +#include "dungeon_message_log.h" #include "structs/dungeon_entity.h" #include "bg_palette_buffer.h" #include "code_8009804.h" @@ -7,11 +10,9 @@ #include "code_803E46C.h" #include "code_803E668.h" #include "code_803E724.h" -#include "code_8045A00.h" #include "dungeon.h" #include "dungeon_leader.h" #include "dungeon_map.h" -#include "dungeon_message.h" #include "dungeon_music.h" #include "dungeon_util.h" #include "dungeon_util_1.h" @@ -25,15 +26,11 @@ #include "text_1.h" #include "text_2.h" #include "text_3.h" +#include "dungeon_strings.h" void sub_80526D0(s32 r0); -static void PutStringsOnMessageLog(void); -static bool8 TryScrollLogDown(s32 a0); -static bool8 TryScrollLogUp(s32 a0); -static void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2); -static void CreateMessageLogArrow(bool8 upArrow, s32 y); -static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, u8 r2); static bool8 sub_8052DC0(Entity *); +static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, bool8 r2); extern bool8 sub_8045888(Entity *pokemon); extern void sub_805E804(void); @@ -47,18 +44,9 @@ extern u8 gUnknown_203B40C; extern u8 gUnknown_202EE01; extern s32 gDungeonFramesCounter; -extern const u8 gUnknown_80F7AE8[]; -extern const u8 gUnknown_80F7AF8[]; -extern const u8 gUnknown_80F7AFC[]; -extern const u8 gUnknown_80F7B04[]; -extern const u16 gUnknown_80F7AEA[]; - static EWRAM_DATA Entity *sLastLogMsgEntity = NULL; static UNUSED EWRAM_DATA u8 sUnused = 0; static EWRAM_DATA SpriteOAM sUnknown_202F1F0 = {0}; -static EWRAM_DATA s32 sMessageLogCursor = 0; -static EWRAM_DATA u8 sMessageLogFlags = 0; -static EWRAM_DATA SpriteOAM sMessageLogArrowSpriteOAM = {0}; EWRAM_INIT u8 gUnknown_203B434 = 1; void sub_80521D0(void) @@ -78,7 +66,7 @@ void sub_8052210(bool8 a0) s32 i; for (i = 0; i < UNK_1BBD4_STR_COUNT; i++) { - InlineStrcpy(gDungeon->unk1BDD4.unk0[i], gUnknown_80F7AE8); + InlineStrcpy(gDungeon->unk1BDD4.unk0[i], ""); } gDungeon->unk1BDD4.unk1C05F = 0; gDungeon->unk1BDD4.unk1C060 = 0; @@ -401,6 +389,8 @@ struct Struct_sub_808CDB0 extern const struct Struct_sub_808CDB0 *sub_808CDB0(s32 a0); +static const u16 sUnknownDialogueFlags[] = {0x30D, 0x10D, 0x30D, 0x10D, 0x301, 1, 0x11}; + void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) { MonPortraitMsg monPortrait; @@ -419,7 +409,7 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) } else { leaderId = MONSTER_NONE; - strcpy(gFormatBuffer_Monsters[0], gUnknown_80F7AF8); // ?? + InlineStrcpy(gFormatBuffer_Monsters[0], "??"); } if (partner != NULL) { @@ -431,58 +421,58 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) } else { partnerId = MONSTER_NONE; - strcpy(gFormatBuffer_Monsters[1], gUnknown_80F7AF8); // ?? + InlineStrcpy(gFormatBuffer_Monsters[1], "??"); } - switch (dialogueInfo->unk4) { - case 425: + switch (dialogueInfo->speciesId) { + case DIALOGUE_MONSTER_PLAYER: dialogueMonId = leaderId; - sprintfStatic(gSpeakerNameBuffer, gUnknown_80F7AFC, gFormatBuffer_Monsters); + sprintfStatic(gSpeakerNameBuffer, _("{COLOR YELLOW}%s{RESET}"), gFormatBuffer_Monsters); break; - case 426: + case DIALOGUE_MONSTER_PARTNER: dialogueMonId = partnerId; - sprintfStatic(gSpeakerNameBuffer, gUnknown_80F7AFC, gFormatBuffer_Monsters[1]); + sprintfStatic(gSpeakerNameBuffer, _("{COLOR YELLOW}%s{RESET}"), gFormatBuffer_Monsters[1]); break; - case 427: + case DIALOGUE_MONSTER_NONE: dialogueMonId = MONSTER_NONE; - strcpy(gSpeakerNameBuffer, gUnknown_80F7B04); + InlineStrcpy(gSpeakerNameBuffer, _("{COLOR YELLOW}{SPEECH_BUBBLE}{RESET}")); break; default: - dialogueMonId = dialogueInfo->unk4; + dialogueMonId = dialogueInfo->speciesId; CopyYellowMonsterNametoBuffer(gSpeakerNameBuffer, dialogueMonId); break; } - if (dialogueInfo->unk0 == 2 || dialogueInfo->unk0 == 3) { - strcpy(gSpeakerNameBuffer, gUnknown_80F7B04); + if (dialogueInfo->type == 2 || dialogueInfo->type == 3) { + InlineStrcpy(gSpeakerNameBuffer, _("{COLOR YELLOW}{SPEECH_BUBBLE}{RESET}")); } while (1) { - if (dialogueInfo->unk6 == 0) + if (dialogueInfo->allowType == DIALOGUE_ALLOW_ALL) break; - if (dialogueInfo->unk6 == 7 && (dialogueMonId == MONSTER_SQUIRTLE || dialogueMonId == MONSTER_TOTODILE)) + if (dialogueInfo->allowType == DIALOGUE_ONLY_SQUIRTLE_TOTODILE && (dialogueMonId == MONSTER_SQUIRTLE || dialogueMonId == MONSTER_TOTODILE)) break; - if (dialogueInfo->unk6 == 1 && (dialogueMonId == MONSTER_BULBASAUR || dialogueMonId == MONSTER_CYNDAQUIL || dialogueMonId == MONSTER_MUDKIP || dialogueMonId == MONSTER_PIKACHU || dialogueMonId == MONSTER_CHARMANDER || dialogueMonId == MONSTER_TREECKO)) + if (dialogueInfo->allowType == DIALOGUE_ALLOW_MOST && (dialogueMonId == MONSTER_BULBASAUR || dialogueMonId == MONSTER_CYNDAQUIL || dialogueMonId == MONSTER_MUDKIP || dialogueMonId == MONSTER_PIKACHU || dialogueMonId == MONSTER_CHARMANDER || dialogueMonId == MONSTER_TREECKO)) break; - if (dialogueInfo->unk6 == 280 && (dialogueMonId == MONSTER_TORCHIC || dialogueMonId == MONSTER_CHIKORITA)) + if (dialogueInfo->allowType == DIALOGUE_ONLY_TORCHIC_CHICORITA && (dialogueMonId == MONSTER_TORCHIC || dialogueMonId == MONSTER_CHIKORITA)) break; dialogueInfo++; } if (!gDungeon->unk181e8.blinded && !gDungeon->unk181e8.hallucinating - && dialogueInfo->unk0 != 4 - && dialogueInfo->unk2 != 0x80 + && dialogueInfo->type != 4 + && dialogueInfo->spriteId != 0x80 && dialogueMonId != MONSTER_NONE) { - const struct Struct_sub_808CDB0 *strPtr = sub_808CDB0(dialogueInfo->unk3); + const struct Struct_sub_808CDB0 *strPtr = sub_808CDB0(dialogueInfo->spritePlacementId); monPortraitPtr = &monPortrait; monPortraitPtr->faceFile = GetDialogueSpriteDataPtr(dialogueMonId); if (monPortraitPtr->faceFile != NULL) { monPortraitPtr->faceData = (PortraitGfx *) monPortraitPtr->faceFile->data; monPortraitPtr->unkE = 0; - monPortraitPtr->spriteId = dialogueInfo->unk2; + monPortraitPtr->spriteId = dialogueInfo->spriteId; monPortraitPtr->flip = strPtr->flip; monPortraitPtr->pos.x = strPtr->pos.x; monPortraitPtr->pos.y = strPtr->pos.y; @@ -498,14 +488,14 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) sub_8052740(10); sub_803EAF0(2, NULL); sub_8052210(FALSE); - CreateDialogueBoxAndPortrait(dialogueInfo->str, 0, monPortraitPtr, gUnknown_80F7AEA[dialogueInfo->unk0]); + CreateDialogueBoxAndPortrait(dialogueInfo->str, 0, monPortraitPtr, sUnknownDialogueFlags[dialogueInfo->type]); PRINT_STRING_WAIT_PRESS(&chosenMenuIndex); if (monPortraitPtr != NULL) { CloseFile(monPortraitPtr->faceFile); } - if (dialogueInfo->unk0 != 1 && dialogueInfo->unk0 != 3) { + if (dialogueInfo->type != 1 && dialogueInfo->type != 3) { LoadDungeonMapPalette(); sub_803EAF0(0, NULL); } @@ -607,7 +597,7 @@ void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) ids[0] = GetEntInfo(leader)->apparentID; } else { - strcpy(gFormatBuffer_Monsters[0], gUnknown_80F7AF8); + InlineStrcpy(gFormatBuffer_Monsters[0], "??"); ids[0] = 0; } @@ -616,7 +606,7 @@ void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) ids[1] = GetEntInfo(partner)->apparentID; } else { - strcpy(gFormatBuffer_Monsters[1], gUnknown_80F7AF8); + InlineStrcpy(gFormatBuffer_Monsters[1], "??"); ids[1] = 0; } } @@ -626,31 +616,6 @@ static bool8 sub_8052DC0(Entity *entity) return sub_8045888(entity); } -struct TutorialFlagMsg -{ - s32 flagId; - const u8 *str; -}; - -extern const struct TutorialFlagMsg gUnknown_80FF020; -extern const struct TutorialFlagMsg gUnknown_80FF080; -extern const struct TutorialFlagMsg gUnknown_80FF0D8; -extern const struct TutorialFlagMsg gUnknown_80FF13C; -extern const struct TutorialFlagMsg gUnknown_80FF1B4; -extern const struct TutorialFlagMsg gMovementTutorial; -extern const struct TutorialFlagMsg gHungerTutorial; -extern const struct TutorialFlagMsg gFoodTutorial; -extern const struct TutorialFlagMsg gOranTutorial; -extern const struct TutorialFlagMsg gCheriTutorial; -extern const struct TutorialFlagMsg gBlastSeedTutorial; -extern const struct TutorialFlagMsg gUnknown_80FF4A0; -extern const struct TutorialFlagMsg gPechaTutorial; -extern const struct TutorialFlagMsg gSleepSeedTutorial; -extern const struct TutorialFlagMsg gMoneyTutorial; - -extern const u8 *const gUnknown_80FF6F8; -extern const u8 *const gUnknown_80FF6A4; - static inline bool32 DislayTutorialMsg(Entity *leader, const struct TutorialFlagMsg *tutorial, bool32 unkFunctionCall) { const u8 *str; @@ -798,268 +763,3 @@ const u8 *GetCurrentDungeonName(void) return GetDungeonName1(gDungeon->unk644.dungeonLocation.id); } } - -void ResetMessageLog(void) -{ - s32 i; - - gDungeon->unk16 = 0; - gDungeon->unkB = 1; - for (i = 0; i < MESSAGE_LOG_STRINGS_COUNT; i++) { - gDungeon->messageLogStrings[i].str[0] = '\0'; - gDungeon->messageLogStrings[i].unk0 = 0; - gDungeon->messageLogStrings[i].unk1 = 0; - gDungeon->messageLogStrings[i].unk2 = 0; - } -} - -UNUSED void sub_8053200(void) -{ - gDungeon->unkB = 1; -} - -static void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2) -{ - u8 *dst = &gDungeon->messageLogStrings[gDungeon->unk16].str[0]; - u8 *maxDst = &gDungeon->messageLogStrings[gDungeon->unk16].str[MESSAGE_LOG_BUFFER_SIZE - 1]; - gDungeon->messageLogStrings[gDungeon->unk16].unk0 = 1; - gDungeon->messageLogStrings[gDungeon->unk16].unk1 = a1; - gDungeon->messageLogStrings[gDungeon->unk16].unk2 = a2; - - while (*src != '\0') { - if (*src == '\r') break; - if (dst < maxDst) { - *(dst++) = *src; - } - src++; - } - - *dst = '\0'; - if (++gDungeon->unk16 >= MESSAGE_LOG_STRINGS_COUNT) { - gDungeon->unk16 = 0; - } - - gDungeon->unkB = 1; -} - -#define MESSAGE_LOG_ROW_COUNT 8 // How many log messages are shown - -UNUSED static const char sPksDirMeme[] = "pksdir0"; -// Possibly something menu related? -// Unfortunately, this is passed to sub_8014140 which is a nullsub. It could be used for Blue and Nintendo DS' touch screen. -static const u8 sUnknownMessageLogData[] = -{ - 0x01, 0x00, 0x54, 0x00, 0xf0, 0xff, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x54, 0x00, - 0x6a, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 -}; - -bool32 DisplayMessageLog(void) -{ - bool8 unkRet; - MenuInputStructSub menuInput; - - sub_801317C(&menuInput); - sub_803EAF0(9, NULL); - do { - DungeonRunFrameActions(13); - unkRet = sub_8008D8C(0); - } while (unkRet); - - sMessageLogCursor = 0; - sMessageLogFlags = 0; - PutStringsOnMessageLog(); - - while (1) { - s32 unkVar; - bool32 scroll = FALSE; - - sMessageLogFlags = 0; - nullsub_34(&menuInput, 0); - unkVar = sub_8014140(0, sUnknownMessageLogData); - - if (TryScrollLogUp(unkVar)) - scroll = TRUE; - if (TryScrollLogDown(unkVar)) - scroll = TRUE; - - if (!scroll) { - DungeonRunFrameActions(0xD); - } - - if (sMessageLogFlags & FLAG_CAN_SCROLL_UP) { - CreateMessageLogArrow(TRUE, -8); - } - if (sMessageLogFlags & FLAG_CAN_SCROLL_DOWN) { - CreateMessageLogArrow(FALSE, 114); - } - - if (!sub_80048C8()) { - if (gRealInputs.pressed & B_BUTTON || menuInput.b_button) { - PlayDungeonCancelSE(); - break; - } - else if (gRealInputs.pressed & A_BUTTON) { - PlayDungeonConfirmationSE(); - break; - } - } - } - - sub_803EAF0(0, NULL); - return TRUE; -} - -static void PutStringsOnMessageLog(void) -{ - s32 i; - s32 arrId = gDungeon->unk16; - s32 y = 16; - - arrId -= 8; - if (arrId < 0) - arrId += MESSAGE_LOG_STRINGS_COUNT; - - sub_80073B8(0); - for (i = 0; i < MESSAGE_LOG_ROW_COUNT; i++) { - struct MessageLogString *msgLogString = &gDungeon->messageLogStrings[arrId]; - - if (msgLogString->unk0) { - if (msgLogString->unk1) { - AddDoubleUnderScoreHighlight(0, 0, y, 0xE0, 7); - } - PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); - y += 14; - } - if (++arrId >= MESSAGE_LOG_STRINGS_COUNT) - arrId = 0; - } - - sub_80073E0(0); - sub_8007334(0); -} - -static bool8 TryScrollLogUp(s32 a0) -{ - s32 i; - struct MessageLogString *msgLogString; - s32 y; - s32 arrId; - - while (1) - { - arrId = gDungeon->unk16 + sMessageLogCursor; - y = 2; - arrId -= 9; - while (arrId < 0) { - arrId += MESSAGE_LOG_STRINGS_COUNT; - } - while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { - arrId -= MESSAGE_LOG_STRINGS_COUNT; - } - - if (gDungeon->messageLogStrings[arrId].unk0 && sMessageLogCursor > -12) { - sMessageLogFlags |= FLAG_CAN_SCROLL_UP; - if (gRealInputs.repeated & DPAD_UP) - break; - if (a0 == 1) - break; - } - - return FALSE; - } - PlayDungeonCursorSE(0); - sub_80073B8(0); - msgLogString = &gDungeon->messageLogStrings[arrId]; - if (msgLogString->unk0) { - sub_80087EC(0, 0, 0, 0xD0, 0x10); - if (msgLogString->unk1) { - AddDoubleUnderScoreHighlight(0, 0, y, 0xE0, 7); - } - PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); - } - sub_80073E0(0); - DungeonRunFrameActions(0xD); - - for (i = 0; i < 7; i++) { - ScrollUpWindowFunc(0); - DungeonRunFrameActions(0xD); - } - - sMessageLogCursor--; - return TRUE; -} - -static bool8 TryScrollLogDown(s32 a0) -{ - s32 i; - struct MessageLogString *msgLogString; - s32 y; - s32 arrId; - - while (1) - { - arrId = gDungeon->unk16 + sMessageLogCursor; - y = 128; - while (arrId < 0) { - arrId += MESSAGE_LOG_STRINGS_COUNT; - } - while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { - arrId -= MESSAGE_LOG_STRINGS_COUNT; - } - - if (sMessageLogCursor < 0) { - sMessageLogFlags |= FLAG_CAN_SCROLL_DOWN; - if (gRealInputs.repeated & DPAD_DOWN) - break; - if (a0 == 2) - break; - } - - return FALSE; - } - PlayDungeonCursorSE(0); - sub_80073B8(0); - msgLogString = &gDungeon->messageLogStrings[arrId]; - if (msgLogString->unk0) { - sub_80087EC(0, 0, y, 0x68, 0x10); - if (msgLogString->unk1) { - AddDoubleUnderScoreHighlight(0, 0, y, 0xE0, 7); - } - PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); - } - sub_80073E0(0); - DungeonRunFrameActions(0xD); - - for (i = 0; i < 7; i++) { - ScrollDownWindowFunc(0); - DungeonRunFrameActions(0xD); - } - - sMessageLogCursor++; - return TRUE; -} - -static void CreateMessageLogArrow(bool8 upArrow, s32 y) -{ - Window *window = &gWindows[0]; - if (!(gDungeonFramesCounter & 8)) { - SpriteSetAffine1(&sMessageLogArrowSpriteOAM, 0); - SpriteSetAffine2(&sMessageLogArrowSpriteOAM, 0); - SpriteSetObjMode(&sMessageLogArrowSpriteOAM, 0); - SpriteSetMosaic(&sMessageLogArrowSpriteOAM, 0); - SpriteSetBpp(&sMessageLogArrowSpriteOAM, 0); - SpriteSetMatrixNum(&sMessageLogArrowSpriteOAM, (upArrow != FALSE) ? (16) : 0); - SpriteSetPalNum(&sMessageLogArrowSpriteOAM, 15); - SpriteSetY(&sMessageLogArrowSpriteOAM, (window->y * 8) + y); - SpriteSetX(&sMessageLogArrowSpriteOAM, (window->x * 8) + 92); - SpriteSetShape(&sMessageLogArrowSpriteOAM, 1); - SpriteSetSize(&sMessageLogArrowSpriteOAM, 0); - SpriteSetPriority(&sMessageLogArrowSpriteOAM, 0); - SpriteSetPalNum(&sMessageLogArrowSpriteOAM, 15); - SpriteSetTileNum(&sMessageLogArrowSpriteOAM, 0x3f0); - - AddSprite(&sMessageLogArrowSpriteOAM, 127, NULL, NULL); - } -} - diff --git a/src/dungeon_message_log.c b/src/dungeon_message_log.c new file mode 100644 index 000000000..e9e5729ec --- /dev/null +++ b/src/dungeon_message_log.c @@ -0,0 +1,297 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_message_log.h" +#include "dungeon_message.h" +#include "dungeon.h" +#include "text_1.h" +#include "text_2.h" +#include "text_3.h" +#include "input.h" +#include "menu_input.h" +#include "code_803E46C.h" +#include "dungeon_music.h" +#include "sprite.h" +#include "code_803E724.h" + +#define MESSAGE_LOG_ROW_COUNT 8 // How many log messages are shown + +extern bool8 sub_8045888(Entity *pokemon); +extern void sub_805E804(void); +extern void sub_8083E28(void); +extern u32 sub_8014140(s32 a0, const void *a1); +extern void PlayDungeonCancelSE(void); +extern void PlayDungeonConfirmationSE(void); + +extern s32 gDungeonFramesCounter; + +static void PutStringsOnMessageLog(void); +static bool8 TryScrollLogDown(s32 a0); +static bool8 TryScrollLogUp(s32 a0); +static void CreateMessageLogArrow(bool8 upArrow, s32 y); + +static EWRAM_DATA s32 sMessageLogCursor = 0; +static EWRAM_DATA u8 sMessageLogFlags = 0; +static EWRAM_DATA SpriteOAM sMessageLogArrowSpriteOAM = {0}; + +void ResetMessageLog(void) +{ + s32 i; + + gDungeon->unk16 = 0; + gDungeon->unkB = 1; + for (i = 0; i < MESSAGE_LOG_STRINGS_COUNT; i++) { + gDungeon->messageLogStrings[i].str[0] = '\0'; + gDungeon->messageLogStrings[i].unk0 = 0; + gDungeon->messageLogStrings[i].unk1 = 0; + gDungeon->messageLogStrings[i].unk2 = 0; + } +} + +// Unused in Red, used in Blue +void sub_8053200(void) +{ + gDungeon->unkB = 1; +} + +void CopyStringToMessageLog(const u8 *src, u32 a1, u32 a2) +{ + u8 *dst = &gDungeon->messageLogStrings[gDungeon->unk16].str[0]; + u8 *maxDst = &gDungeon->messageLogStrings[gDungeon->unk16].str[MESSAGE_LOG_BUFFER_SIZE - 1]; + gDungeon->messageLogStrings[gDungeon->unk16].unk0 = 1; + gDungeon->messageLogStrings[gDungeon->unk16].unk1 = a1; + gDungeon->messageLogStrings[gDungeon->unk16].unk2 = a2; + + while (*src != '\0') { + if (*src == '\r') break; + if (dst < maxDst) { + *(dst++) = *src; + } + src++; + } + + *dst = '\0'; + if (++gDungeon->unk16 >= MESSAGE_LOG_STRINGS_COUNT) { + gDungeon->unk16 = 0; + } + + gDungeon->unkB = 1; +} + +// Possibly something menu related? +// Unfortunately, this is passed to sub_8014140 which is a nullsub. It could be used for Blue and Nintendo DS' touch screen. +static const u8 sUnknownMessageLogData[] = +{ + 0x01, 0x00, 0x54, 0x00, 0xf0, 0xff, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x54, 0x00, + 0x6a, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +bool32 DisplayMessageLog(void) +{ + bool8 unkRet; + MenuInputStructSub menuInput; + + sub_801317C(&menuInput); + sub_803EAF0(9, NULL); + do { + DungeonRunFrameActions(13); + unkRet = sub_8008D8C(0); + } while (unkRet); + + sMessageLogCursor = 0; + sMessageLogFlags = 0; + PutStringsOnMessageLog(); + + while (1) { + s32 unkVar; + bool32 scroll = FALSE; + + sMessageLogFlags = 0; + nullsub_34(&menuInput, 0); + unkVar = sub_8014140(0, sUnknownMessageLogData); + + if (TryScrollLogUp(unkVar)) + scroll = TRUE; + if (TryScrollLogDown(unkVar)) + scroll = TRUE; + + if (!scroll) { + DungeonRunFrameActions(0xD); + } + + if (sMessageLogFlags & FLAG_CAN_SCROLL_UP) { + CreateMessageLogArrow(TRUE, -8); + } + if (sMessageLogFlags & FLAG_CAN_SCROLL_DOWN) { + CreateMessageLogArrow(FALSE, 114); + } + + if (!sub_80048C8()) { + if (gRealInputs.pressed & B_BUTTON || menuInput.b_button) { + PlayDungeonCancelSE(); + break; + } + else if (gRealInputs.pressed & A_BUTTON) { + PlayDungeonConfirmationSE(); + break; + } + } + } + + sub_803EAF0(0, NULL); + return TRUE; +} + +static void PutStringsOnMessageLog(void) +{ + s32 i; + s32 arrId = gDungeon->unk16; + s32 y = 16; + + arrId -= 8; + if (arrId < 0) + arrId += MESSAGE_LOG_STRINGS_COUNT; + + sub_80073B8(0); + for (i = 0; i < MESSAGE_LOG_ROW_COUNT; i++) { + struct MessageLogString *msgLogString = &gDungeon->messageLogStrings[arrId]; + + if (msgLogString->unk0) { + if (msgLogString->unk1) { + AddDoubleUnderScoreHighlight(0, 0, y, 0xE0, 7); + } + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); + y += 14; + } + if (++arrId >= MESSAGE_LOG_STRINGS_COUNT) + arrId = 0; + } + + sub_80073E0(0); + sub_8007334(0); +} + +static bool8 TryScrollLogUp(s32 a0) +{ + s32 i; + struct MessageLogString *msgLogString; + s32 y; + s32 arrId; + + while (1) + { + arrId = gDungeon->unk16 + sMessageLogCursor; + y = 2; + arrId -= 9; + while (arrId < 0) { + arrId += MESSAGE_LOG_STRINGS_COUNT; + } + while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { + arrId -= MESSAGE_LOG_STRINGS_COUNT; + } + + if (gDungeon->messageLogStrings[arrId].unk0 && sMessageLogCursor > -12) { + sMessageLogFlags |= FLAG_CAN_SCROLL_UP; + if (gRealInputs.repeated & DPAD_UP) + break; + if (a0 == 1) + break; + } + + return FALSE; + } + PlayDungeonCursorSE(0); + sub_80073B8(0); + msgLogString = &gDungeon->messageLogStrings[arrId]; + if (msgLogString->unk0) { + sub_80087EC(0, 0, 0, 0xD0, 0x10); + if (msgLogString->unk1) { + AddDoubleUnderScoreHighlight(0, 0, y, 0xE0, 7); + } + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); + } + sub_80073E0(0); + DungeonRunFrameActions(0xD); + + for (i = 0; i < 7; i++) { + ScrollUpWindowFunc(0); + DungeonRunFrameActions(0xD); + } + + sMessageLogCursor--; + return TRUE; +} + +static bool8 TryScrollLogDown(s32 a0) +{ + s32 i; + struct MessageLogString *msgLogString; + s32 y; + s32 arrId; + + while (1) + { + arrId = gDungeon->unk16 + sMessageLogCursor; + y = 128; + while (arrId < 0) { + arrId += MESSAGE_LOG_STRINGS_COUNT; + } + while (arrId >= MESSAGE_LOG_STRINGS_COUNT) { + arrId -= MESSAGE_LOG_STRINGS_COUNT; + } + + if (sMessageLogCursor < 0) { + sMessageLogFlags |= FLAG_CAN_SCROLL_DOWN; + if (gRealInputs.repeated & DPAD_DOWN) + break; + if (a0 == 2) + break; + } + + return FALSE; + } + PlayDungeonCursorSE(0); + sub_80073B8(0); + msgLogString = &gDungeon->messageLogStrings[arrId]; + if (msgLogString->unk0) { + sub_80087EC(0, 0, y, 0x68, 0x10); + if (msgLogString->unk1) { + AddDoubleUnderScoreHighlight(0, 0, y, 0xE0, 7); + } + PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); + } + sub_80073E0(0); + DungeonRunFrameActions(0xD); + + for (i = 0; i < 7; i++) { + ScrollDownWindowFunc(0); + DungeonRunFrameActions(0xD); + } + + sMessageLogCursor++; + return TRUE; +} + +static void CreateMessageLogArrow(bool8 upArrow, s32 y) +{ + Window *window = &gWindows[0]; + if (!(gDungeonFramesCounter & 8)) { + SpriteSetAffine1(&sMessageLogArrowSpriteOAM, 0); + SpriteSetAffine2(&sMessageLogArrowSpriteOAM, 0); + SpriteSetObjMode(&sMessageLogArrowSpriteOAM, 0); + SpriteSetMosaic(&sMessageLogArrowSpriteOAM, 0); + SpriteSetBpp(&sMessageLogArrowSpriteOAM, 0); + SpriteSetMatrixNum(&sMessageLogArrowSpriteOAM, (upArrow != FALSE) ? (16) : 0); + SpriteSetPalNum(&sMessageLogArrowSpriteOAM, 15); + SpriteSetY(&sMessageLogArrowSpriteOAM, (window->y * 8) + y); + SpriteSetX(&sMessageLogArrowSpriteOAM, (window->x * 8) + 92); + SpriteSetShape(&sMessageLogArrowSpriteOAM, 1); + SpriteSetSize(&sMessageLogArrowSpriteOAM, 0); + SpriteSetPriority(&sMessageLogArrowSpriteOAM, 0); + SpriteSetPalNum(&sMessageLogArrowSpriteOAM, 15); + SpriteSetTileNum(&sMessageLogArrowSpriteOAM, 0x3f0); + + AddSprite(&sMessageLogArrowSpriteOAM, 127, NULL, NULL); + } +} + diff --git a/src/dungeon_misc.c b/src/dungeon_misc.c index 29bfba921..f1a141221 100644 --- a/src/dungeon_misc.c +++ b/src/dungeon_misc.c @@ -11,16 +11,15 @@ #include "moves.h" #include "string_format.h" #include "friend_area.h" -#include "code_80450F8.h" -#include "code_8045A00.h" #include "code_803E668.h" -#include "dungeon_engine.h" +#include "run_dungeon.h" #include "move_effects_target.h" #include "dungeon_map_access.h" #include "dungeon_map.h" #include "dungeon_leader.h" #include "dungeon_message.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_message_log.h" +#include "dungeon_logic.h" #include "constants/dungeon.h" #include "constants/friend_area.h" #include "constants/status.h" @@ -30,16 +29,11 @@ #include "constants/weather.h" #include "code_806CD90.h" #include "code_8077274_1.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_movement.h" #include "dungeon_util.h" -#include "status_checks_1.h" #include "exclusive_pokemon.h" #include "dungeon_config.h" #include "game_options.h" #include "weather.h" -#include "tile_types.h" -#include "dungeon_capabilities.h" #include "text_util.h" #include "dungeon_random.h" #include "position_util.h" @@ -47,6 +41,7 @@ #include "code_803E46C.h" #include "def_filearchives.h" #include "code_803D110.h" +#include "dungeon_strings.h" static void EnsureCastformLoaded(void); static void EnsureDeoxysLoaded(void); @@ -95,26 +90,6 @@ extern void sub_806B678(void); extern void EntityUpdateStatusSprites(Entity *); extern Entity *sub_80696A8(Entity *a0); -extern u8 *gUnknown_80FE168[]; -extern u8 *gUnknown_80FE134[]; -extern u8 *gUnknown_80FE0F4[]; -extern u8 *gUnknown_80FE0F8[]; -extern u8 *gUnknown_80FE0AC[]; -extern u8 *gUnknown_80FE2D0[]; -extern u8 *gUnknown_80FE268[]; -extern u8 *gUnknown_80FE28C[]; -extern u8 *gUnknown_80FA580[]; -extern u8 *gUnknown_80FCC7C[]; -extern u8 *gUnknown_80FCCAC[]; -extern u8 *gUnknown_80FDCC8[]; -extern const u8 *const gUnknown_80FD594; -extern const u8 *const gUnknown_80FD5B8; -extern const u8 *const gUnknown_80FEAC4; -extern const u8 *const gPtrLinkMoveTwoUsesWarningMessage; -extern const u8 *const gPtrLinkMoveOneUseWarningMessage; -extern const u8 *const gPtrLinkedMovesComeApartMessage; -extern const u8 *const gUnknown_80FE1A4; -extern const u8 *const gUnknown_80FE20C; extern const s16 gUnknown_810AC60; // 0xC extern const s16 gUnknown_810AC62; // 0xC extern const s16 gUnknown_810AC68; // 0x8 @@ -309,13 +284,13 @@ void sub_8068A84(PokemonStruct1 *pokemon) if (totalBodySize >= 7) { PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0],pokemon,0); if (pokemon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON) { - DisplayDungeonMessage(0,*gUnknown_80FE0F4,1); + DisplayDungeonMessage(0,gUnknown_80FE0F4,1); } else if (pokemon->dungeonLocation.id == DUNGEON_RESCUE_TEAM_BASE) { - DisplayDungeonMessage(0,*gUnknown_80FE0F8,1); + DisplayDungeonMessage(0,gUnknown_80FE0F8,1); } else { - DisplayDungeonMessage(0,*gUnknown_80FE0AC,1); + DisplayDungeonMessage(0,gUnknown_80FE0AC,1); } } else { @@ -332,26 +307,26 @@ void sub_8068A84(PokemonStruct1 *pokemon) ZeroOutItem(&monPtr->itemSlot); PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0],pokemon,6); if (pokemon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON) { - DisplayDungeonMessage(0,*gUnknown_80FE168,1); + DisplayDungeonMessage(0,gUnknown_80FE168,1); } else if (pokemon->dungeonLocation.id == DUNGEON_RESCUE_TEAM_BASE) { ; } else { - DisplayDungeonMessage(0,*gUnknown_80FE134,1); + DisplayDungeonMessage(0,gUnknown_80FE134,1); } return; } } PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0],pokemon,6); if (pokemon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON) { - DisplayDungeonMessage(0,*gUnknown_80FE0F4,1); + DisplayDungeonMessage(0,gUnknown_80FE0F4,1); } else if (pokemon->dungeonLocation.id == DUNGEON_RESCUE_TEAM_BASE) { - DisplayDungeonMessage(0,*gUnknown_80FE0F8,1); + DisplayDungeonMessage(0,gUnknown_80FE0F8,1); } else { - DisplayDungeonMessage(0,*gUnknown_80FE0AC,1); + DisplayDungeonMessage(0,gUnknown_80FE0AC,1); } } } @@ -584,8 +559,8 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3) && gDungeon->unk644.unk34 != TRUE) { if (gDungeon->unk644.unk37 > 0) { - if (DisplayDungeonYesNoMessage(NULL,*gUnknown_80FE268,1) == 1) { - DisplayDungeonMessage(NULL,*gUnknown_80FE28C,1); + if (DisplayDungeonYesNoMessage(NULL,gUnknown_80FE268,1) == 1) { + DisplayDungeonMessage(NULL,gUnknown_80FE28C,1); gDungeon->unk4 = 1; gDungeon->unk6 = 1; gDungeon->unk644.unk10 = 1; @@ -594,7 +569,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3) } } else { - DisplayDungeonMessage(NULL,*gUnknown_80FE2D0,1); + DisplayDungeonMessage(NULL,gUnknown_80FE2D0,1); } } } @@ -656,7 +631,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3) sub_8084E00(entity,entInfo->monsterBehavior, unkArg == 500); if (IS_DEOXYS_FORM_MONSTER(entInfo->apparentID) && !IsBossFight() && entInfo->isNotTeamMember) { gDungeon->deoxysDefeat = 1; - DisplayDungeonLoggableMessageTrue(entity,*gUnknown_80FA580); + DisplayDungeonLoggableMessageTrue(entity,gUnknown_80FA580); sub_803E178(); sub_8049ED4(); } @@ -1220,7 +1195,7 @@ void sub_8069F9C(Entity *pokemon, Entity *target, Move *move) targetInfo->abilities[abilityIndex] = abilities[randomIndex]; gDungeon->unkC = 1; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FCC7C); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCC7C); sub_8042900(target); EndAbilityImmuneStatus(pokemon, target); } @@ -1244,7 +1219,7 @@ void sub_8069F9C(Entity *pokemon, Entity *target, Move *move) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); str = GetUnformattedTypeString(targetInfo->types[0]); strcpy(gFormatBuffer_Items[0], str); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCAC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCCAC); sub_8042968(target); } } @@ -1269,7 +1244,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); typeString = GetUnformattedTypeString(uVar2_u32); strcpy(gFormatBuffer_Items[0],typeString); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCC8); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDCC8); } } } diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 7fa4c9d1f..b59185341 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -1,10 +1,13 @@ #include "global.h" +#include "globaldata.h" +#include "dungeon_move.h" +#include "dungeon_move_util.h" #include "constants/ability.h" #include "constants/iq_skill.h" #include "constants/status.h" #include "constants/weather.h" #include "structs/str_damage.h" -#include "charge_move.h" +#include "dungeon_move_util.h" #include "code_800DAC0.h" #include "code_800E9E4.h" #include "code_800ED38.h" @@ -12,24 +15,20 @@ #include "code_803E668.h" #include "code_803E724.h" #include "code_8041AD0.h" -#include "code_8045A00.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "code_807CD9C.h" #include "code_808417C.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" +#include "dungeon_logic.h" #include "dungeon_config.h" -#include "dungeon_engine.h" +#include "run_dungeon.h" #include "dungeon_items.h" #include "dungeon_map_access.h" #include "dungeon_message.h" #include "dungeon_misc.h" -#include "dungeon_move.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_random.h" +#include "dungeon_strings.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "math.h" #include "move_effects_target.h" #include "move_util.h" @@ -38,7 +37,6 @@ #include "sprite.h" #include "status.h" #include "status_actions.h" -#include "status_checks_1.h" #include "weather.h" #include "targeting_flags.h" #include "text_util.h" @@ -302,65 +300,10 @@ extern bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 pa extern bool8 MetronomeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); extern bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -s32 HandleDamagingMove(Entity *, Entity *, Move *, s24_8, s32); -static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct DamageStruct *dmgStruct, s16 unk); -static void TriggerTargetAbilityEffect(Entity *attacker); -static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accuracyType, bool8 selfAlwaysHits); -bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray, bool32 itemId, bool8 arg_4, bool32 unused); -bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3); -static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *move); -void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 isLinkedMove); -static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_, Entity *attacker, Entity *target, Move *move, bool32 canHitAnyone_); -bool8 sub_8055988(Entity *r2, Entity *r4); -void sub_80559DC(Entity *entity1, Entity *entity2); -static void SortTargets(Entity **targetsArray, Entity *attacker); - extern const s32 gUnknown_8106A50; extern const s32 gUnknown_8106A4C; -extern const u8 *const gUnknown_80FEEA4; -extern const u8 *const gUnknown_80FEEC8; -extern const u8 *const gUnknown_80FEEEC; -extern const u8 *const gUnknown_80FEF0C; -extern const u8 *const gUnknown_80FEF30; -extern const u8 *const gUnknown_80FEF4C; -extern const u8 *const gUnknown_80FEF50; -extern const u8 *const gUnknown_80FEF54; -extern const u8 *const gUnknown_80FEF74; -extern const u8 *const gUnknown_80FEF98; -extern const u8 *const gUnknown_80FEFD0; -extern const u8 *const gUnknown_80FECA4; -extern const u8 *const gUnknown_80F9158; -extern const u8 *const gUnknown_80FC72C; -extern const u8 *const gUnknown_80FC700; -extern const u8 *const gUnknown_80FC6D0; -extern const u8 *const gUnknown_80FC710; -extern const u8 *const gUnknown_80FC6FC; -extern const u8 *const gUnknown_80FECBC; -extern const u8 *const gUnknown_80FECE0; -extern const u8 *const gUnknown_80F9688; -extern const u8 *const gUnknown_80FC714; -extern const u8 *const gUnknown_80FC718; -extern const u8 *const gUnknown_80FC6A8; -extern const u8 *const gUnknown_80FD2D0; -extern const u8 *const gUnknown_80FD2DC; -extern const u8 *const gUnknown_80F93C8; -extern const u8 *const gUnknown_80FC690; -extern const u8 *const gUnknown_80FC6A4; -extern const u8 *const gUnknown_80FCD28; -extern const u8 *const gUnknown_80FCD0C; -extern const u8 *const gUnknown_80FDD88; -extern const u8 *const gUnknown_80FDD20; -extern const u8 *const gUnknown_80FDDA8; -extern const u8 *const gUnknown_80FDD48; -extern const u8 *const gUnknown_80FDDAC; -extern const u8 *const gUnknown_80FC52C; -extern const u8 *const gUnknown_80FC558; -extern const u8 *const gUnknown_80FC574; -extern const u8 *const gUnknown_8100524; -extern const u8 *const gUnknown_80F9364; -extern const u8 *const gUnknown_80F93A4; -extern const u8 *const gUnknown_80F9384; -extern const u8 *const gUnknown_80F9380; + +static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct DamageStruct *dmgStruct, s16 unk_); EWRAM_DATA s32 gUnknown_202F208 = 0; EWRAM_DATA s32 gUnknown_202F20C = 0; @@ -375,11 +318,8 @@ EWRAM_DATA u8 gUnknown_202F221 = 0; EWRAM_DATA u8 gUnknown_202F222 = 0; EWRAM_DATA s32 gUnknown_202F224 = 0; EWRAM_DATA s32 gMetronomeCalledArrayId = 0; -static EWRAM_INIT Entity *gUnknown_203B438 = NULL; -#define MAX_MOVE_TARGETS 64 - -static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, s32 itemId, bool32 isLinkedMove) +void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, s32 itemId, bool32 isLinkedMove) { s32 i = 0; u16 moveId; @@ -1732,7 +1672,7 @@ s32 sub_8055864(Entity *attacker, Entity *target, Move *move, s32 param_4, s32 i } // This unused function returns FALSE if target's typing makes it immune to move's type. -UNUSED bool32 TargetNotImmuneTo(Move *move, Entity *target) +static UNUSED bool32 TargetNotImmuneTo(Move *move, Entity *target) { s32 i; s32 dmg = 1; @@ -1783,1314 +1723,3 @@ void sub_80559DC(Entity *entity1, Entity *entity2) entInfo->action.direction = direction & DIRECTION_MASK; sub_806CE68(entity1, direction); } - -bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s32 arg_0) -{ - s32 i, j; - s32 moveId; - EntityInfo *attackerInfo = GetEntInfo(attacker); - bool32 isLinkedMove; - - moveId = firstMoveId; - if (firstMoveId >= MAX_MON_MOVES) - return FALSE; - - attackerInfo->abilityEffectFlags = 0; - attackerInfo->unk159 = 0; - if (attackerInfo->cringeClassStatus.status == STATUS_CRINGE) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC714); // is cringing! - return FALSE; - } - else if (attackerInfo->cringeClassStatus.status == STATUS_INFATUATED) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC718); // is infatuated! - return FALSE; - } - else if (attackerInfo->burnClassStatus.status == STATUS_PARALYSIS) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A8); // is paralyzed! - return FALSE; - } - - gUnknown_202F222 = 0; - gUnknown_202F208 = 0; - gUnknown_202F221 = 0; - for (i = 0; i < MAX_MON_MOVES; i++) { - attackerInfo->mimicMoveIDs[i] = 0; - } - - for (i = 0, j = 0; i < MAX_MON_MOVES; i++) { - j++; - if (++moveId >= MAX_MON_MOVES) - break; - if (!(attackerInfo->moves.moves[moveId].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) - break; - } - - isLinkedMove = (j > 1); - moveId = firstMoveId; - - while (1) { - Move *currMove = &attackerInfo->moves.moves[moveId]; - if (!EntityIsValid(attacker) || sub_8044B28()) - break; - - if (currMove->id == MOVE_SNORE || currMove->id == MOVE_SLEEP_TALK) { - if (!IsSleeping(attacker)) { - if (CannotAttack(attacker, TRUE)) - break; - } - } - else { - if (CannotAttack(attacker, FALSE)) - break; - } - - if (gUnknown_202F221 != 0) - break; - - if (MoveFlagExists(currMove)) { - bool32 moveUsable = TRUE; - bool32 var_28 = FALSE; - bool32 statusMoveMatch = MoveMatchesBideClassStatus(attacker, currMove); - - if (currMove->PP != 0) { - if (!statusMoveMatch) { - var_28 = TRUE; - } - } - else { - if (!statusMoveMatch) { - BufferMoveName(gFormatBuffer_Items[0], currMove, NULL); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80F93C8); // The move can't be used! - moveUsable = FALSE; - } - } - - if (moveUsable) { - bool32 moveWasUsed; - s32 unkBefore = gUnknown_202F208; - - attackerInfo->unk159 = statusMoveMatch; - if (currMove->id == MOVE_ASSIST) { - Move assistMove = *currMove; - - assistMove.id = sub_8057144(attacker); - BufferMoveName(gFormatBuffer_Items[0], &assistMove, NULL); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: - moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, &assistMove); - } - else { - moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, currMove); - } - - if (var_28 && moveWasUsed) { - if (currMove->moveFlags2 & MOVE_FLAG2_UNK4) { - currMove->moveFlags2 &= ~(MOVE_FLAG2_UNK4); - } - else { - currMove->moveFlags2 |= MOVE_FLAG_TEMPORARY; - } - } - - if (unkBefore == gUnknown_202F208) { - if (itemId == 0) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC690); // The currMove failed! - } - else { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A4); // The Orb failed! - } - } - } - } - - sub_804178C(1); - if (!EntityIsValid(attacker) || sub_8044B28()) - break; - if (++moveId >= MAX_MON_MOVES) - break; - if (!MoveFlagLinkChain(&attackerInfo->moves.moves[moveId])) - break; - } - - if (EntityIsValid(attacker)) { - for (i = 0; i < MAX_MON_MOVES; i++) { - if (attackerInfo->mimicMoveIDs[i] != 0) { - Move mimicMove, assistMove; - Move *movePtr; - - movePtr = &mimicMove; - InitPokemonMoveOrNullObject(&mimicMove, attackerInfo->mimicMoveIDs[i]); - if (MoveFlagExists(&mimicMove)) { - if (mimicMove.id == MOVE_ASSIST) { - assistMove = mimicMove; - assistMove.id = sub_8057144(attacker); - movePtr = &assistMove; - BufferMoveName(gFormatBuffer_Items[0], &assistMove, NULL); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: - } - TryUseChosenMove(attacker, 0, itemId, arg_0, isLinkedMove, movePtr); - } - sub_804178C(1); - } - } - } - - if (EntityIsValid(attacker)) { - sub_8071DA4(attacker); - if (EntityIsValid(attacker) && gUnknown_202F222 != 0) { - gUnknown_202F222 = 0; - if (EntityIsValid(attacker)) { - EntityInfo *attackerInfo = GetEntInfo(attacker); - s32 statusTurns = CalculateStatusTurns(attacker, gPauseTurnRange, TRUE); - PausedStatusTarget(attacker, attacker, 1, statusTurns, FALSE); - SetExpMultplier(attackerInfo); - } - } - } - - return TRUE; -} - -static void TriggerTargetAbilityEffect(Entity *attacker) -{ - if (EntityIsValid(attacker)) { - EntityInfo *entInfo = GetEntInfo(attacker); - - if (entInfo->abilityEffectFlags & ABILITY_FLAG_ARENA_TRAP) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEA4); // Arena Trap prevents movement! - ImmobilizedStatusTarget(attacker, attacker); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_SHADOW_TAG) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEC8); // Shadow Tag prevents movement! - ImmobilizedStatusTarget(attacker, attacker); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_MAGNET_PULL) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEEC); // Magnet Pull prevents movement! - ImmobilizedStatusTarget(attacker, attacker); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF0C); // Static caused paralysis! - ParalyzeStatusTarget(attacker, attacker, TRUE); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PRLZ) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF30); // Effect Spore scattered spores - ParalyzeStatusTarget(attacker, attacker, TRUE); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_POISON_POINT) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF4C); // Poison Point struck! - PoisonedStatusTarget(attacker, attacker, TRUE); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PSN) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF50); // Effect Spore scattered spores! - PoisonedStatusTarget(attacker, attacker, TRUE); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_SLP) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF54); // Effect Spore scattered spores! - SleepStatusTarget(attacker, attacker, CalculateStatusTurns(attacker, gSleepTurnRange, TRUE), TRUE); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_FLAME_BODY) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF74); // Flame Body caused a burn! - BurnedStatusTarget(attacker, attacker, TRUE, TRUE); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_CUTE_CHARM) { - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF98); // Cute Charm caused infatuation - InfatuateStatusTarget(attacker, attacker, TRUE); - } - if (entInfo->abilityEffectFlags & ABILITY_FLAG_STENCH) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEFD0); // A horrid stench billowed out - sub_80428A0(attacker); - entInfo->terrifiedTurns = gStenchTerrifiedTurnsNo; - } - - entInfo->abilityEffectFlags = 0; - } -} - -bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move) -{ - s32 i; - Entity *targetsArray[MAX_MOVE_TARGETS + 1]; - const u8 *msg; - Move metronomeMove, naturePwrMove; - s32 var_2C; - s32 var_28; - s32 var_24; - bool8 moveUsable; - - msg = NULL; - targetsArray[0] = NULL; - - sub_804178C(1); - if (move->id == MOVE_METRONOME) { - gMetronomeCalledArrayId = DungeonRandInt(METRONOME_AVAILABLE_CALLED_MOVES); - InitPokemonMove(&metronomeMove, gMetronomeCalledMoves[gMetronomeCalledArrayId].moveID); - metronomeMove.moveFlags = move->moveFlags; - metronomeMove.moveFlags2 = move->moveFlags2; - sub_8056468(attacker, move, gUnknown_80FECBC, targetsArray, itemId, TRUE, FALSE); - sub_804178C(1); - move = &metronomeMove; - } - else if (move->id == MOVE_NATURE_POWER) - { - s32 tileset = gDungeon->tileset; - - if (tileset < 0) - tileset = 0; - if (tileset > 74) - tileset = 74; - - InitPokemonMove(&naturePwrMove, gNaturePowerCalledMoves[tileset].moveID); - naturePwrMove.moveFlags = move->moveFlags; - naturePwrMove.moveFlags2 = move->moveFlags2; - sub_8056468(attacker, move, gUnknown_80FECE0, targetsArray, itemId, TRUE, FALSE); - sub_804178C(1); - move = &naturePwrMove; - } - - var_28 = 0; - if ((GetMoveTargetAndRangeForPokemon(attacker, move, TRUE) - & (0xF0)) == TARGETING_FLAG_TARGET_LINE) - { - var_28 = 10; - } - if ((GetMoveTargetAndRangeForPokemon(attacker, move, TRUE) - & (0xF0)) == TARGETING_FLAG_CUT_CORNERS) - { - var_28 = 1; - if ((move->id != MOVE_SOLARBEAM || GetApparentWeather(attacker) != WEATHER_SUNNY) && DoesMoveCharge(move->id)) { - if (!MoveMatchesBideClassStatus(attacker, move)) { - var_28 = 0; - } - } - } - - SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); - BufferMoveName(gFormatBuffer_Items[0], move, NULL); - if (MoveMatchesBideClassStatus(attacker, move)) { - msg = gUnknown_80FC72C; // mon loosed move - GetEntInfo(attacker)->unkFF = 0; - moveUsable = sub_805744C(attacker, move, TRUE); - } - else { - if (itemId == 0) { - msg = GetMoveUseText(move->id); - } - else { - msg = gUnknown_80F9158; - } - moveUsable = CanMonsterUseMove(attacker, move, TRUE); - } - - if (moveUsable && r6) { - MarkLastUsedMonMove(attacker, move); - } - - if (GetEntInfo(attacker)->muzzled.muzzled == TRUE && FailsWhileMuzzled(move->id)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); - LogMessageByIdWithPopupCheckUser(attacker, msg); - sub_803E708(0xA, 0x3F); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC710); // is muzzled! - return FALSE; - } - else if (!moveUsable) { - SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); - if (itemId == 0) { - BufferMoveName(gFormatBuffer_Items[0], move, NULL); - LogMessageByIdWithPopupCheckUser(attacker, msg); - sub_803E708(0xA, 0x3F); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6D0); // But the move couldn't be used! - } - else { - BufferItemName(gFormatBuffer_Items[0], itemId, NULL); - LogMessageByIdWithPopupCheckUser(attacker, msg); - sub_803E708(0xA, 0x3F); - LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6FC); // But Orbs are prevented from being used! - } - return FALSE; - } - - gUnknown_202F214 = 0; - gUnknown_202F20C = 0; - gUnknown_202F210 = 0; - gUnknown_202F218 = 0; - gUnknown_202F219 = 0; - gUnknown_202F21A = 0; - gUnknown_202F21C = 0; - gUnknown_202F220 = 0; - if (isLinkedMove && GetEntInfo(attacker)->unk153 <= 3) { - GetEntInfo(attacker)->unk153++; - } - - var_2C = sub_8057070(move); - for (i = 0; i < var_2C; i++) { - u8 r4; - EntityInfo *entInfo; - - var_24 = 1; - if (gUnknown_202F220 != 0 || gUnknown_202F221 != 0) - break; - if (!EntityIsValid(attacker) || sub_8044B28()) - return TRUE; - - entInfo = GetEntInfo(attacker); - if (var_30 != 0 || move->id == MOVE_SNORE || move->id == MOVE_SLEEP_TALK) { - if (!IsSleeping(attacker) && CannotAttack(attacker, TRUE)) - break; - } - else { - if (CannotAttack(attacker, FALSE)) - break; - } - entInfo->unk14A = 0; - if (move->id == MOVE_THRASH) { - GetEntInfo(attacker)->action.direction = DungeonRandInt(NUM_DIRECTIONS); - TargetTileInFront(attacker); - var_24 = 0; - } - gUnknown_203B438 = NULL; - targetsArray[0] = 0; - if (var_28 == 0 || var_28 == 1) { - SetTargetsForMove(targetsArray, attacker, move); - SortTargets(targetsArray, attacker); - if (i != 0 && var_24 != 0 && targetsArray[0] == NULL) - break; - } - r4 = sub_8056468(attacker, move, msg, targetsArray, itemId, (i == 0), var_28); - msg = NULL; - if (gUnknown_203B438 != 0) { - sub_806A1E8(gUnknown_203B438); - } - - if (GetEntInfo(attacker)->cringeClassStatus.status != STATUS_CONFUSED && GetEntInfo(attacker)->cringeClassStatus.status != STATUS_COWERING) { - EntityInfo *entInfo = GetEntInfo(attacker); - entInfo->targetPos.x = 0; - entInfo->targetPos.y = 0; - } - - gUnknown_202F214++; - if (var_28 != 0) { - sub_80566F8(attacker, move, var_28, r4, itemId, isLinkedMove); - } - else { - UseMoveAgainstTargets(targetsArray, attacker, move, itemId, isLinkedMove); - } - - if (!EntityIsValid(attacker)) - break; - - sub_806CF18(attacker); - if (GetEntInfo(attacker)->unk14A == 0) { - GetEntInfo(attacker)->unk14A = 0; // Redundant as it's already 0 - sub_8079764(attacker); - } - } - - - if (gUnknown_202F21A != 0) { - EndFrozenClassStatus(attacker, attacker); - EndLeechSeedClassStatus(attacker, attacker); - } - - if (gUnknown_202F219 != 0 && EntityIsValid(attacker)) { - EntityInfo *entInfo = GetEntInfo(attacker); - - ConfuseStatusTarget(attacker, attacker, FALSE); - SetExpMultplier(entInfo); - } - return TRUE; -} - -bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray, bool32 itemId, bool8 arg_4, bool32 unused) -{ - s32 i; - bool8 ret = FALSE; - bool32 r7 = (sub_8045888(entity) != FALSE); - - if (str != NULL) { - for (i = 0; i < 65; i++) { - if (unkArray[i] == NULL) { - break; - } - if (sub_8045888(unkArray[i])) { - r7 = TRUE; - break; - } - } - - if (r7) { - SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(entity), 0); - if (itemId == 0) { - BufferMoveName(gFormatBuffer_Items[0], move, NULL); - } - else { - BufferItemName(gFormatBuffer_Items[0], itemId, NULL); - } - } - - if (move->id != MOVE_REGULAR_ATTACK) { - DisplayDungeonLoggableMessageTrue(entity, str); - } - else { - DisplayDungeonLoggableMessageFalse(entity, str); - } - } - - if (r7) { - if (arg_4) { - ret = sub_8040BB0(entity, move, TRUE); - } - else { - ret = sub_8040BB0(entity, move, FALSE); - } - sub_8040DA0(entity, move); - } - else { - sub_806CE68(entity, GetEntInfo(entity)->action.direction); - } - - return ret; -} - -struct UnkStruct_sub_800E308_1 -{ - s16 unk0; - s16 unk2; - DungeonPos unk4; - DungeonPos unk8; - s32 unkC; - s32 unk10; -}; - -extern s32 sub_800E308(struct UnkStruct_sub_800E308_1 *, DungeonPos *); - -s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4) -{ - struct UnkStruct_sub_800E308_1 unkSp1; - DungeonPos unkSp2; - EntityInfo *entInfo = GetEntInfo(entity); - - if (!gDungeon->unk181e8.blinded && (GetBodySize(entInfo->apparentID) < 4 || r4 != 1)) { - s32 unk6 = sub_800ECB8(sub_80412E0(move->id, GetApparentWeather(entity), 1))->unk6; - s32 pixelPosX = X_POS_TO_PIXELPOS(pos->x); - s32 pixelPosY = Y_POS_TO_PIXELPOS(pos->y); - - unkSp2.x = pixelPosX / 256; - unkSp2.y = pixelPosY / 256; - - if (unk6 != 0) { - s32 someRetVal; - - sub_800EF10(sub_80412E0(move->id, GetApparentWeather(entity), 1)); - sub_800EF64(); - DungeonRunFrameActions(0x5E); - someRetVal = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), 1)); - if (someRetVal != -1) { - sub_800569C(&unkSp1.unk8, &entity->axObj, someRetVal); - } - else { - unkSp1.unk8 = (DungeonPos) {0}; - } - unkSp1.unk0 = sub_80412E0(move->id, GetApparentWeather(entity), 1); - unkSp1.unk2 = entInfo->apparentID; - unkSp1.unk4.x = entity->pixelPos.x / 256; - unkSp1.unk4.y = entity->pixelPos.y / 256; - unkSp1.unkC = entInfo->action.direction; - unkSp1.unk10 = 0; - - return sub_800E308(&unkSp1, &unkSp2); - } - } - - return -1; -} - -// This would signify a new file starts here, but it makes little sense tbh. -UNUSED static const char sPksDirMeme[] = "pksdir0"; - -static const s32 gUnknown_81069D4[NUM_DIRECTIONS] = -{ - [DIRECTION_SOUTH] = 1, - [DIRECTION_SOUTHEAST] = 1, - [DIRECTION_EAST] = 1, - [DIRECTION_NORTHEAST] = 0, - [DIRECTION_NORTH] = 0, - [DIRECTION_NORTHWEST] = 0, - [DIRECTION_WEST] = 1, - [DIRECTION_SOUTHWEST] = 1 -}; - -// This function looks important, but what does it do? -void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 isLinkedMove) -{ - DungeonPos var_68; - DungeonPos var_64; - Entity *targetsArray[2]; // Only 2 hmm - s32 var_4C, var_48; - s32 i, j; - s32 targetArrId; - s32 var_3C; - s32 var_38; - s32 var_34; - s32 var_30; - s32 var_2C; - s32 var_28, var_24; - s32 someCount; - EntityInfo *attackerInfo; - s32 unkRetVal; - s32 divResult; - s32 r9; - - targetArrId = 0; - someCount = 0; - attackerInfo = GetEntInfo(attacker); - unkRetVal = sub_800ED20(move->id); - var_30 = 2; - if (unkRetVal != 1) { - var_30 = 6; - if (unkRetVal == 2) { - var_30 = 3; - } - } - - var_68.x = attacker->pos.x; - var_68.y = attacker->pos.y; - var_4C = gAdjacentTileOffsets[attackerInfo->action.direction].x; - var_48 = gAdjacentTileOffsets[attackerInfo->action.direction].y; - for (i = 0; i < a2; i++) - { - const Tile *tile; - - if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) - break; - - var_68.x += var_4C; - var_68.y += var_48; - someCount++; - tile = GetTile(var_68.x, var_68.y); - if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) - break; - if (tile->monster != NULL && GetEntityType(tile->monster) == ENTITY_MONSTER) - break; - } - - if (MoveRequiresCharging(attacker, move->id) && !MoveMatchesBideClassStatus(attacker, move)) { - var_34 = -1; - } - else { - var_34 = sub_8056564(attacker, &var_68, move, a2); - } - - var_68.x = attacker->pos.x; - var_68.y = attacker->pos.y; - var_4C = gAdjacentTileOffsets[attackerInfo->action.direction].x; - var_48 = gAdjacentTileOffsets[attackerInfo->action.direction].y; - divResult = someCount * (24 / var_30); - if (a2 > 1) { - var_3C = divResult + 8; - if (var_3C >= 64) { - var_3C = 64; - } - } - else { - var_3C = 32; - } - - r9 = 0; - var_2C = 0x80000 / divResult; - var_38 = gUnknown_81069D4[attackerInfo->action.direction]; - gDungeon->unk1BDD4.unk1C05E = 1; - - for (i = 0; i < a2; i++) - { - DungeonPos var_68Before; - const Tile *tile; - - if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) - break; - - var_68Before = var_68; - var_68.x += var_4C; - var_68.y += var_48; - if (sub_803F428(&var_68) && !gDungeon->unk181e8.blinded) { - PixelPos pos32; - pos32.x = X_POS_TO_PIXELPOS(var_68Before.x); - pos32.y = Y_POS_TO_PIXELPOS(var_68Before.y); - var_28 = var_30 * (var_4C << 8); - var_24 = var_30 * (var_48 << 8); - for (j = 0; j < 24 / var_30; j++) { - if (var_34 >= 0) { - s32 r3; - s32 r2; - - if (a3 != 0) { - r3 = sin_4096(r9 / 256) * var_3C; - } - else { - r3 = 0; - } - var_64.x = pos32.x / 256; - var_64.y = (pos32.y - r3) / 256; - r2 = pos32.y / 256; - r2 -= gDungeon->unk181e8.cameraPixelPos.y; - r2 /= 2; - sub_800E3AC(var_34, &var_64, r2 + var_38); - } - DungeonRunFrameActions(0x30); - pos32.x += var_28; - pos32.y += var_24; - r9 += var_2C; - } - } - else { - r9 += (24 / var_30) * var_2C; - } - - tile = GetTile(var_68.x, var_68.y); - if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) - break; - if (tile->monster != NULL && GetEntityType(tile->monster) == ENTITY_MONSTER && !sub_80571F0(tile->monster, move)) { - if (targetArrId <= 0) { - bool8 canHitAnyone = FALSE; - s32 targetFlags; - EntityInfo *attackerInfo = GetEntInfo(attacker); - if (attackerInfo->cringeClassStatus.status == STATUS_CONFUSED - || attackerInfo->blinkerClassStatus.status == STATUS_BLINKER - || attackerInfo->cringeClassStatus.status == STATUS_COWERING) - { - canHitAnyone = TRUE; - } - targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); - targetArrId = SetNewTarget(targetArrId, targetsArray, targetFlags, attacker, tile->monster, move, canHitAnyone); - } - break; - } - } - - if (var_34 >= 0) { - sub_800DC14(var_34); - } - sub_804178C(1); - gDungeon->unk1BDD4.unk1C05E = 0; - - if (targetArrId > 0) { - targetsArray[targetArrId] = NULL; - UseMoveAgainstTargets(targetsArray, attacker, move, itemId, isLinkedMove); - } - else if (a2 == 1 && sub_803F428(&var_68)) { - sub_803E708(1, 0x4A); - sub_8041168(attacker, NULL, move, &var_68); - } -} - -static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accuracyType, bool8 selfAlwaysHits) -{ - s32 statStageAccuracy, statStageEvasion; - s24_8 statStageMul; - s32 accuracy = GetMoveAccuracyOrAIChance(move, accuracyType); - s32 rand = DungeonRandInt(100); - EntityInfo *attackerInfo = GetEntInfo(attacker); - EntityInfo *targetInfo = GetEntInfo(target); - - if (selfAlwaysHits && attacker == target) - return TRUE; - if (move->id == MOVE_REGULAR_ATTACK && IQSkillIsEnabled(attacker, IQ_SURE_HIT_ATTACKER)) - return TRUE; - if (attackerInfo->sureShotClassStatus.status == STATUS_SURE_SHOT) - return TRUE; - if (attackerInfo->sureShotClassStatus.status == STATUS_WHIFFER) - return FALSE; - if (accuracy > 100) - return TRUE; - - if (HasHeldItem(target, ITEM_DETECT_BAND)) { - accuracy -= gDetectBandAccuracyDebuffValue; - } - if (IQSkillIsEnabled(target, IQ_QUICK_DODGER)) { - accuracy -= gIqQuickDodgerAccuracyDebuffValue; - } - - statStageAccuracy = attackerInfo->hitChanceStages[0]; - if (AbilityIsActive(attacker, ABILITY_COMPOUNDEYES)) { - statStageAccuracy += 2; - } - if (move->id == MOVE_THUNDER) { - s32 weather = GetApparentWeather(attacker); - if (weather == WEATHER_RAIN) { - return TRUE; - } - else if (weather == WEATHER_SUNNY) { - statStageAccuracy -= 2; - } - } - - if (statStageAccuracy < 0) statStageAccuracy = 0; - if (statStageAccuracy > 20) statStageAccuracy = 20; - - statStageMul = gAccEvsStatStageMultipliers[0][statStageAccuracy]; - if (statStageMul.raw < 0) statStageMul.raw = 0; - if (statStageMul.raw > IntToF248_2(100).raw) statStageMul = IntToF248_2(100); - - accuracy *= statStageMul.raw; - accuracy /= 256; - - statStageEvasion = targetInfo->hitChanceStages[1]; - if (targetInfo->exposed) { - statStageEvasion = 10; - } - if (GetApparentWeather(target) == WEATHER_SANDSTORM && AbilityIsActive(target, ABILITY_SAND_VEIL)) { - statStageEvasion += 2; - } - if (AbilityIsActive(attacker, ABILITY_HUSTLE)) { - bool32 specialMove = (IsTypePhysical(GetMoveType(move)) == FALSE); - if (!specialMove) { - statStageEvasion += 2; - } - } - - if (statStageEvasion < 0) statStageEvasion = 0; - if (statStageEvasion > 20) statStageEvasion = 20; - - statStageMul = gAccEvsStatStageMultipliers[1][statStageEvasion]; - if (statStageMul.raw < 0) statStageMul.raw = 0; - if (statStageMul.raw > IntToF248_2(100).raw) statStageMul = IntToF248_2(100); - - accuracy *= statStageMul.raw; - accuracy /= 256; - if (rand < accuracy) - return TRUE; - else - return FALSE; -} - -static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *move) -{ - s32 targetFlags; - s32 targetFlagsAnd; - s32 arrId = 0; - bool8 canHitPartner = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED - || GetEntInfo(attacker)->blinkerClassStatus.status == STATUS_BLINKER - || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); - bool8 canHitSelf = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); - - if (IQSkillIsEnabled(attacker, IQ_NONTRAITOR)) { - canHitSelf = FALSE; - canHitPartner = FALSE; - } - targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); - if ((targetFlags & 0xF) == 4) { - bool32 usable = MoveMatchesBideClassStatus(attacker, move); - if (move->id == MOVE_SOLARBEAM && GetApparentWeather(attacker) == WEATHER_SUNNY) { - usable = TRUE; - } - if (usable) - targetFlags = 0; - else - targetFlags = 0x73; - } - - targetFlagsAnd = targetFlags & 0xF0; - if (targetFlagsAnd == 0) { - Entity *targetEntity = sub_80696A8(attacker); - if (targetEntity != NULL) { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); - } - } - else if (targetFlagsAnd == 0x10 || targetFlagsAnd == 0x20) { - s32 i; - s32 direction, to; - EntityInfo *entInfo = GetEntInfo(attacker); - if (targetFlagsAnd == 0x20) { - direction = entInfo->action.direction; - to = 8; - } - else { - direction = entInfo->action.direction - 1; - to = 3; - } - for (i = 0; i < to; i++, direction++) { - Entity *targetEntity; - DungeonPos unkPositon; - - direction &= DIRECTION_MASK; - unkPositon.x = attacker->pos.x + gAdjacentTileOffsets[direction].x ; - unkPositon.y = attacker->pos.y + gAdjacentTileOffsets[direction].y; - targetEntity = GetMonsterAtPos(&unkPositon); - if (targetEntity != NULL) { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); - } - } - } - else if (targetFlagsAnd == 0x30) { - s32 i; - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activePokemon[i]; - if (EntityIsValid(dungeonMon) && sub_8045A70(attacker, dungeonMon)) { - if (dungeonMon == attacker) { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); - } - else { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); - } - } - } - } - else if (targetFlagsAnd == 0x40) { - bool32 r4 = FALSE; - Entity *targetEntity = sub_80696FC(attacker); - if (targetEntity != NULL) { - s32 arrIdBefore = arrId; - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); - r4 = (arrId != arrIdBefore); - } - if (!r4) { - targetEntity = sub_806977C(attacker); - if (targetEntity != NULL) { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); - } - } - } - else if (targetFlagsAnd == 0x50) { - // Nothing happens here - } - else if (targetFlagsAnd == 0x80) { - Entity *targetEntity = sub_80696FC(attacker); - if (targetEntity != NULL) { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); - } - } - else if (targetFlagsAnd == 0x60) { - s32 i; - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activePokemon[i]; - if (EntityIsValid(dungeonMon)) { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); - } - } - } - else if (targetFlagsAnd == 0x70) { - arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitPartner); - } - - targetsArray[arrId] = NULL; -} - -static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_, Entity *attacker, Entity *target, Move *move, bool32 canHitAnyone_) -{ - bool32 canHitTarget; - EntityInfo *targetInfo; - - // It's happening again, all over the codebase there are problems with s16 arguments, where the lsl/asr asm can't be matched. What is going on with that? - s32 targetFlags = (s16)targetFlags_; - bool8 canHitAnyone = canHitAnyone_; - canHitTarget = FALSE; - targetInfo = GetEntInfo(target); - - if (move->id == MOVE_BATON_PASS && attacker == target) - return targetArrId; - if (targetInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER) - return targetArrId; - if (targetInfo->monsterBehavior == BEHAVIOR_DIGLETT || targetInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) - return targetArrId; - - if (canHitAnyone) { - canHitTarget = TRUE; - } - else { - s32 targetFlagsAnd = targetFlags & 0xF; - if (targetFlagsAnd == 0 || targetFlagsAnd == 4) { - if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 1) { - canHitTarget = TRUE; - } - } - else if (targetFlagsAnd == 1) { - if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 0) { - canHitTarget = TRUE; - } - } - else if (targetFlagsAnd == 2) { - canHitTarget = TRUE; - } - else if (targetFlagsAnd == 5) { - if (attacker != target) { - canHitTarget = TRUE; - } - } - else if (targetFlagsAnd == 6) { - if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 0 && attacker != target) { - canHitTarget = TRUE; - } - } - else if (targetFlagsAnd == 3) { - canHitTarget = TRUE; - } - } - - if (sub_80571F0(target, move)) { - canHitTarget = FALSE; - } - - if (canHitTarget && targetArrId < MAX_MOVE_TARGETS) { - targetsArray[targetArrId] = target; - if (!GetEntInfo(target)->isNotTeamMember && gUnknown_203B438 == NULL) { - gUnknown_203B438 = target; - } - targetArrId++; - } - - return targetArrId; -} - -struct MultiTurnChargeMove -{ - u16 moveID; - u8 status; -}; - -const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { - {MOVE_SOLARBEAM, STATUS_SOLARBEAM}, - {MOVE_SKY_ATTACK, STATUS_SKY_ATTACK}, - {MOVE_RAZOR_WIND, STATUS_RAZOR_WIND}, - {MOVE_FOCUS_PUNCH, STATUS_FOCUS_PUNCH}, - {MOVE_SKULL_BASH, STATUS_SKULL_BASH}, - {MOVE_FLY, STATUS_FLYING}, - {MOVE_BOUNCE, STATUS_BOUNCING}, - {MOVE_DIVE, STATUS_DIVING}, - {MOVE_DIG, STATUS_DIGGING}, - {MOVE_NOTHING, STATUS_NONE} -}; - -const u32 gMultiTurnBideClassStatuses[10] = { - STATUS_SOLARBEAM, - STATUS_SKY_ATTACK, - STATUS_RAZOR_WIND, - STATUS_FOCUS_PUNCH, - STATUS_SKULL_BASH, - STATUS_FLYING, - STATUS_BOUNCING, - STATUS_DIVING, - STATUS_DIGGING, - STATUS_NONE -}; - -s32 sub_8057070(Move *move) -{ - s32 numberOfChainedHits = GetMoveNumberOfChainedHits(move); - if (numberOfChainedHits == 0) - return DungeonRandRange(2, 6); - else - return numberOfChainedHits; -} - -bool8 MoveCausesPaused(Move *move) -{ - if(move->id == MOVE_FRENZY_PLANT) return TRUE; - if(move->id == MOVE_HYDRO_CANNON) return TRUE; - if(move->id == MOVE_HYPER_BEAM) return TRUE; - if(move->id == MOVE_BLAST_BURN) return TRUE; - - return FALSE; -} - -bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move) -{ - if (!EntityIsValid(pokemon)) - { - return FALSE; - } - else - { - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - s32 i; - for (i = 0; i < 100; i++) - { - if (gMultiTurnChargeMoves[i].moveID == MOVE_NOTHING) - { - return FALSE; - } - if (move->id == gMultiTurnChargeMoves[i].moveID && - pokemonInfo->bideClassStatus.status == gMultiTurnChargeMoves[i].status) - { - return TRUE; - } - } - return FALSE; - } -} - -bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) -{ - if (!EntityIsValid(pokemon)) - { - return FALSE; - } - else - { - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - int i = 0; - u8 *bideClassStatusPointer = &pokemonInfo->bideClassStatus.status; - u8 *bideClassStatusPointer2; - u8 chargeStatus = STATUS_CHARGING; - for (; i < 100; i++) - { - u8 currentStatus = gMultiTurnBideClassStatuses[i]; - u8 bideClassStatus; - if (currentStatus == STATUS_NONE) - { - return FALSE; - } - bideClassStatus = *bideClassStatusPointer; - bideClassStatusPointer2 = &pokemonInfo->bideClassStatus.status; - if (bideClassStatus == currentStatus) - { - return TRUE; - } - } - // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnBideClassStatuses array. - if (checkCharge && *bideClassStatusPointer2 == chargeStatus) - { - return TRUE; - } - return FALSE; - } -} - -u32 sub_8057144(Entity * pokemon) -{ - Move *moveStack[80]; - int i, j, nMoves; - - nMoves = 0; - for (i = 0; i < DUNGEON_MAX_POKEMON; i++) - { - Entity *dungeonMon = gDungeon->activePokemon[i]; - if (EntityIsValid(dungeonMon)) { - Move *moves = GetEntInfo(dungeonMon)->moves.moves; - for (j = 0; j < MAX_MON_MOVES; j++) - { - if (moves[j].moveFlags & MOVE_FLAG_EXISTS - && !MoveRequiresCharging(pokemon, moves[j].id) - && moves[j].id != MOVE_SKETCH - && nMoves < 80) { - moveStack[nMoves++] = &moves[j]; - } - } - } - } - - if (nMoves == 0) { - return MOVE_REGULAR_ATTACK; - } - else { - return moveStack[DungeonRandInt(nMoves)]->id; - } -} - -bool8 sub_80571F0(Entity * pokemon, Move *move) -{ - u16 moveID; - s32 tileset; - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - - if (entityInfo->unkFF == 1) { - moveID = move->id; - if ((moveID == MOVE_SKY_UPPERCUT) || (moveID == MOVE_TWISTER) || (moveID == MOVE_GUST) || (moveID == MOVE_THUNDER)) - return FALSE; - else - return TRUE; - } - else if (entityInfo->unkFF == 2) { - if (entityInfo->bideClassStatus.status == STATUS_DIVING) { - if (move->id == MOVE_WHIRLPOOL || move->id == MOVE_SURF) return FALSE; - } - else if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { - moveID = move->id; - if (moveID == MOVE_EARTHQUAKE || moveID == MOVE_MAGNITUDE) return FALSE; - if (moveID == MOVE_NATURE_POWER) { - tileset = gDungeon->tileset; - if (tileset < 0) { - tileset = 0; - } - if (0x4a < tileset) { - tileset = 0x4a; - } - if (gNaturePowerCalledMoves[tileset].moveID == MOVE_EARTHQUAKE) return FALSE; - } - } - return TRUE; - } - return FALSE; -} - -bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) -{ - bool8 uVar2; - if (sub_8044B28()) - return FALSE; - if (!EntityIsValid(pokemon) || !EntityIsValid(target)) - return FALSE; - if (GetEntInfo(target)->unk158 == 0 || GetEntInfo(target)->HP == 0) - return FALSE; - - if (chance != 0) { - if (AbilityIsActive(pokemon, ABILITY_SERENE_GRACE)) { - uVar2 = DungeonRandOutcome_2(chance * 2); - } - else - { - uVar2 = DungeonRandOutcome_2(chance); - } - } - else - { - uVar2 = TRUE; - } - - if (uVar2 && (pokemon != target) && AbilityIsActive(target, ABILITY_SHIELD_DUST)) - { - sub_80429C8(target); - return FALSE; - } - - return uVar2; -} - -bool8 RollSecondaryEffect(Entity *pokemon, s32 chance) -{ - if(!EntityIsValid(pokemon)) - return FALSE; - if(chance == 0) - return TRUE; - if(AbilityIsActive(pokemon, ABILITY_SERENE_GRACE)) - return DungeonRandOutcome_2(chance * 2); - else - return DungeonRandOutcome_2(chance); -} - -bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker) -{ - s32 i; - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - Move *move = &pokemonInfo->moves.moves[moveIndex]; - if (!MoveFlagExists(move)) - return FALSE; - if (MoveFlagLinkChain(move) || MoveFlagDisabled(move) || MoveFlagSealed(move)) - return FALSE; - - for (i = 0; i < MAX_MON_MOVES; i++) { - if (CanMonsterUseMove(pokemon, move, hasPPChecker)) - return TRUE; - move++; - if (move >= &pokemonInfo->moves.moves[MAX_MON_MOVES]) - break; - if (!(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) - break; - } - - return FALSE; -} - -bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (move->id == MOVE_REGULAR_ATTACK) - { - return TRUE; - } - if (move->moveFlags & MOVE_FLAG_DISABLED || move->moveFlags2 & MOVE_FLAG_SEALED) - { - return FALSE; - } - if (hasPPChecker) - { - if (move->PP == 0) - { - return FALSE; - } - if (pokemonInfo->cringeClassStatus.status == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) - { - return FALSE; - } - if (pokemonInfo->cringeClassStatus.status == STATUS_ENCORE) - { - if (move->id == MOVE_STRUGGLE) - { - if (!(pokemonInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED)) - { - return FALSE; - } - } - else if (!(move->moveFlags & MOVE_FLAG_LAST_USED)) - { - return FALSE; - } - } - } - return TRUE; -} - -bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3) -{ - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - if (move->id != MOVE_REGULAR_ATTACK) { - if (((move->moveFlags & MOVE_FLAG_DISABLED)) || ((move->moveFlags2 & MOVE_FLAG_EXISTS))) { - return FALSE; - } - if (param_3 != 0) { - if ((entityInfo->cringeClassStatus.status == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; - if (entityInfo->cringeClassStatus.status == STATUS_ENCORE) { - if (move->id == MOVE_STRUGGLE) { - if((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; - } - else { - if((move->moveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; - } - } - } - } - return TRUE; -} - -// Attacker always goes last -static void SortTargets(Entity **targetsArray, Entity *attacker) -{ - Entity *localArray[MAX_MOVE_TARGETS + 1]; - s32 i; - s32 count = 0; - - for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { - if (targetsArray[i] == NULL) - break; - if (targetsArray[i] == attacker) - continue; - if (count >= MAX_MOVE_TARGETS) - break; - localArray[count++] = targetsArray[i]; - } - - for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { - if (targetsArray[i] == NULL) - break; - if (targetsArray[i] != attacker) - continue; - if (count >= MAX_MOVE_TARGETS) - break; - localArray[count++] = targetsArray[i]; - } - - for (; count < MAX_MOVE_TARGETS + 1; count++) { - localArray[count] = NULL; - } - - for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { - targetsArray[i] = localArray[i]; - } -} - -// TODO: This file could(should?) be merged with move_actions.c, status_actions.c and move_checks.c into one. diff --git a/src/dungeon_move_util.c b/src/dungeon_move_util.c new file mode 100644 index 000000000..b9f104eb5 --- /dev/null +++ b/src/dungeon_move_util.c @@ -0,0 +1,1445 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_move_util.h" +#include "constants/ability.h" +#include "constants/iq_skill.h" +#include "constants/status.h" +#include "constants/weather.h" +#include "structs/str_damage.h" +#include "dungeon_move_util.h" +#include "code_800DAC0.h" +#include "code_800E9E4.h" +#include "code_800ED38.h" +#include "code_803E46C.h" +#include "code_803E668.h" +#include "code_803E724.h" +#include "code_8041AD0.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_807CD9C.h" +#include "code_808417C.h" +#include "dungeon_logic.h" +#include "dungeon_config.h" +#include "run_dungeon.h" +#include "dungeon_items.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_misc.h" +#include "dungeon_move.h" +#include "dungeon_random.h" +#include "dungeon_strings.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "move_util.h" +#include "moves.h" +#include "position_util.h" +#include "sprite.h" +#include "status.h" +#include "status_actions.h" +#include "weather.h" +#include "targeting_flags.h" +#include "text_util.h" + +extern void sub_80429C8(Entity *r0); +extern bool8 sub_8045888(Entity *r0); +extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, s24_8, u16, u32); +extern s16 sub_8057600(Move *move, s32 itemID); +extern void sub_803ED30(s32, Entity *r0, u8, s32); +extern void sub_8042238(Entity *pokemon, Entity *target); +extern void sub_806A1E8(Entity *pokemon); +extern bool8 sub_8044B28(void); +extern void sub_804178C(u32); +extern void sub_8071DA4(Entity *); +extern void sub_80428A0(Entity *r0); +extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8); +extern void sub_8040DA0(Entity *entity, Move *move); +extern u16 sub_80412E0(u16 moveId, u8 weather, u8 a2); +extern void sub_800EF10(u16 r0); +extern s32 sub_800E710(s16 a0, u16 a1); +extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2); +extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *); +extern Entity *sub_80696A8(Entity *a0); +extern Entity *GetMonsterAtPos(DungeonPos *pos); +extern Entity *sub_80696FC(Entity *); +extern Entity *sub_806977C(Entity *); +extern void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct); +extern void MarkLastUsedMonMove(Entity *entity, Move *move); +extern s32 sub_8057070(Move *move); +extern bool8 MoveRequiresCharging(Entity* pokemon,u16 param_2); +extern s32 sub_800ED20(u16 param_1); +extern bool32 EarthquakeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +extern void sub_8042930(Entity *r0); +extern void sub_8041B48(Entity *pokemon); +extern void sub_8041BA8(Entity *pokemon); +extern void sub_8042950(Entity *r0); +extern void sub_80421C0(Entity *pokemon, u16 r1); +extern s16 sub_8094828(u16, u8); +struct UnkStruct_sub_800E308_1 +{ + s16 unk0; + s16 unk2; + DungeonPos unk4; + DungeonPos unk8; + s32 unkC; + s32 unk10; +}; +extern s32 sub_800E308(struct UnkStruct_sub_800E308_1 *, DungeonPos *); + +static u8 ToItemID(u32 itemID); + +static EWRAM_INIT Entity *gUnknown_203B438 = NULL; + +bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s32 arg_0) +{ + s32 i, j; + s32 moveId; + EntityInfo *attackerInfo = GetEntInfo(attacker); + bool32 isLinkedMove; + + moveId = firstMoveId; + if (firstMoveId >= MAX_MON_MOVES) + return FALSE; + + attackerInfo->abilityEffectFlags = 0; + attackerInfo->unk159 = 0; + if (attackerInfo->cringeClassStatus.status == STATUS_CRINGE) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC714); // is cringing! + return FALSE; + } + else if (attackerInfo->cringeClassStatus.status == STATUS_INFATUATED) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC718); // is infatuated! + return FALSE; + } + else if (attackerInfo->burnClassStatus.status == STATUS_PARALYSIS) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A8); // is paralyzed! + return FALSE; + } + + gUnknown_202F222 = 0; + gUnknown_202F208 = 0; + gUnknown_202F221 = 0; + for (i = 0; i < MAX_MON_MOVES; i++) { + attackerInfo->mimicMoveIDs[i] = 0; + } + + for (i = 0, j = 0; i < MAX_MON_MOVES; i++) { + j++; + if (++moveId >= MAX_MON_MOVES) + break; + if (!(attackerInfo->moves.moves[moveId].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) + break; + } + + isLinkedMove = (j > 1); + moveId = firstMoveId; + + while (1) { + Move *currMove = &attackerInfo->moves.moves[moveId]; + if (!EntityIsValid(attacker) || sub_8044B28()) + break; + + if (currMove->id == MOVE_SNORE || currMove->id == MOVE_SLEEP_TALK) { + if (!IsSleeping(attacker)) { + if (CannotAttack(attacker, TRUE)) + break; + } + } + else { + if (CannotAttack(attacker, FALSE)) + break; + } + + if (gUnknown_202F221 != 0) + break; + + if (MoveFlagExists(currMove)) { + bool32 moveUsable = TRUE; + bool32 var_28 = FALSE; + bool32 statusMoveMatch = MoveMatchesBideClassStatus(attacker, currMove); + + if (currMove->PP != 0) { + if (!statusMoveMatch) { + var_28 = TRUE; + } + } + else { + if (!statusMoveMatch) { + BufferMoveName(gFormatBuffer_Items[0], currMove, NULL); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80F93C8); // The move can't be used! + moveUsable = FALSE; + } + } + + if (moveUsable) { + bool32 moveWasUsed; + s32 unkBefore = gUnknown_202F208; + + attackerInfo->unk159 = statusMoveMatch; + if (currMove->id == MOVE_ASSIST) { + Move assistMove = *currMove; + + assistMove.id = sub_8057144(attacker); + BufferMoveName(gFormatBuffer_Items[0], &assistMove, NULL); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: + moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, &assistMove); + } + else { + moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, currMove); + } + + if (var_28 && moveWasUsed) { + if (currMove->moveFlags2 & MOVE_FLAG2_UNK4) { + currMove->moveFlags2 &= ~(MOVE_FLAG2_UNK4); + } + else { + currMove->moveFlags2 |= MOVE_FLAG_TEMPORARY; + } + } + + if (unkBefore == gUnknown_202F208) { + if (itemId == 0) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC690); // The currMove failed! + } + else { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A4); // The Orb failed! + } + } + } + } + + sub_804178C(1); + if (!EntityIsValid(attacker) || sub_8044B28()) + break; + if (++moveId >= MAX_MON_MOVES) + break; + if (!MoveFlagLinkChain(&attackerInfo->moves.moves[moveId])) + break; + } + + if (EntityIsValid(attacker)) { + for (i = 0; i < MAX_MON_MOVES; i++) { + if (attackerInfo->mimicMoveIDs[i] != 0) { + Move mimicMove, assistMove; + Move *movePtr; + + movePtr = &mimicMove; + InitPokemonMoveOrNullObject(&mimicMove, attackerInfo->mimicMoveIDs[i]); + if (MoveFlagExists(&mimicMove)) { + if (mimicMove.id == MOVE_ASSIST) { + assistMove = mimicMove; + assistMove.id = sub_8057144(attacker); + movePtr = &assistMove; + BufferMoveName(gFormatBuffer_Items[0], &assistMove, NULL); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: + } + TryUseChosenMove(attacker, 0, itemId, arg_0, isLinkedMove, movePtr); + } + sub_804178C(1); + } + } + } + + if (EntityIsValid(attacker)) { + sub_8071DA4(attacker); + if (EntityIsValid(attacker) && gUnknown_202F222 != 0) { + gUnknown_202F222 = 0; + if (EntityIsValid(attacker)) { + EntityInfo *attackerInfo = GetEntInfo(attacker); + s32 statusTurns = CalculateStatusTurns(attacker, gPauseTurnRange, TRUE); + PausedStatusTarget(attacker, attacker, 1, statusTurns, FALSE); + SetExpMultplier(attackerInfo); + } + } + } + + return TRUE; +} + +void TriggerTargetAbilityEffect(Entity *attacker) +{ + if (EntityIsValid(attacker)) { + EntityInfo *entInfo = GetEntInfo(attacker); + + if (entInfo->abilityEffectFlags & ABILITY_FLAG_ARENA_TRAP) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEA4); // Arena Trap prevents movement! + ImmobilizedStatusTarget(attacker, attacker); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_SHADOW_TAG) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEC8); // Shadow Tag prevents movement! + ImmobilizedStatusTarget(attacker, attacker); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_MAGNET_PULL) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEEC); // Magnet Pull prevents movement! + ImmobilizedStatusTarget(attacker, attacker); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF0C); // Static caused paralysis! + ParalyzeStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PRLZ) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF30); // Effect Spore scattered spores + ParalyzeStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_POISON_POINT) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF4C); // Poison Point struck! + PoisonedStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PSN) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF50); // Effect Spore scattered spores! + PoisonedStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_SLP) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF54); // Effect Spore scattered spores! + SleepStatusTarget(attacker, attacker, CalculateStatusTurns(attacker, gSleepTurnRange, TRUE), TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_FLAME_BODY) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF74); // Flame Body caused a burn! + BurnedStatusTarget(attacker, attacker, TRUE, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_CUTE_CHARM) { + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF98); // Cute Charm caused infatuation + InfatuateStatusTarget(attacker, attacker, TRUE); + } + if (entInfo->abilityEffectFlags & ABILITY_FLAG_STENCH) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEFD0); // A horrid stench billowed out + sub_80428A0(attacker); + entInfo->terrifiedTurns = gStenchTerrifiedTurnsNo; + } + + entInfo->abilityEffectFlags = 0; + } +} + +bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move) +{ + s32 i; + Entity *targetsArray[MAX_MOVE_TARGETS + 1]; + const u8 *msg; + Move metronomeMove, naturePwrMove; + s32 var_2C; + s32 var_28; + s32 var_24; + bool8 moveUsable; + + msg = NULL; + targetsArray[0] = NULL; + + sub_804178C(1); + if (move->id == MOVE_METRONOME) { + gMetronomeCalledArrayId = DungeonRandInt(METRONOME_AVAILABLE_CALLED_MOVES); + InitPokemonMove(&metronomeMove, gMetronomeCalledMoves[gMetronomeCalledArrayId].moveID); + metronomeMove.moveFlags = move->moveFlags; + metronomeMove.moveFlags2 = move->moveFlags2; + sub_8056468(attacker, move, gUnknown_80FECBC, targetsArray, itemId, TRUE, FALSE); + sub_804178C(1); + move = &metronomeMove; + } + else if (move->id == MOVE_NATURE_POWER) + { + s32 tileset = gDungeon->tileset; + + if (tileset < 0) + tileset = 0; + if (tileset > 74) + tileset = 74; + + InitPokemonMove(&naturePwrMove, gNaturePowerCalledMoves[tileset].moveID); + naturePwrMove.moveFlags = move->moveFlags; + naturePwrMove.moveFlags2 = move->moveFlags2; + sub_8056468(attacker, move, gUnknown_80FECE0, targetsArray, itemId, TRUE, FALSE); + sub_804178C(1); + move = &naturePwrMove; + } + + var_28 = 0; + if ((GetMoveTargetAndRangeForPokemon(attacker, move, TRUE) + & (0xF0)) == TARGETING_FLAG_TARGET_LINE) + { + var_28 = 10; + } + if ((GetMoveTargetAndRangeForPokemon(attacker, move, TRUE) + & (0xF0)) == TARGETING_FLAG_CUT_CORNERS) + { + var_28 = 1; + if ((move->id != MOVE_SOLARBEAM || GetApparentWeather(attacker) != WEATHER_SUNNY) && DoesMoveCharge(move->id)) { + if (!MoveMatchesBideClassStatus(attacker, move)) { + var_28 = 0; + } + } + } + + SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); + BufferMoveName(gFormatBuffer_Items[0], move, NULL); + if (MoveMatchesBideClassStatus(attacker, move)) { + msg = gUnknown_80FC72C; // mon loosed move + GetEntInfo(attacker)->unkFF = 0; + moveUsable = sub_805744C(attacker, move, TRUE); + } + else { + if (itemId == 0) { + msg = GetMoveUseText(move->id); + } + else { + msg = gUnknown_80F9158; + } + moveUsable = CanMonsterUseMove(attacker, move, TRUE); + } + + if (moveUsable && r6) { + MarkLastUsedMonMove(attacker, move); + } + + if (GetEntInfo(attacker)->muzzled.muzzled == TRUE && FailsWhileMuzzled(move->id)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, msg); + sub_803E708(0xA, 0x3F); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC710); // is muzzled! + return FALSE; + } + else if (!moveUsable) { + SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); + if (itemId == 0) { + BufferMoveName(gFormatBuffer_Items[0], move, NULL); + LogMessageByIdWithPopupCheckUser(attacker, msg); + sub_803E708(0xA, 0x3F); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6D0); // But the move couldn't be used! + } + else { + BufferItemName(gFormatBuffer_Items[0], itemId, NULL); + LogMessageByIdWithPopupCheckUser(attacker, msg); + sub_803E708(0xA, 0x3F); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6FC); // But Orbs are prevented from being used! + } + return FALSE; + } + + gUnknown_202F214 = 0; + gUnknown_202F20C = 0; + gUnknown_202F210 = 0; + gUnknown_202F218 = 0; + gUnknown_202F219 = 0; + gUnknown_202F21A = 0; + gUnknown_202F21C = 0; + gUnknown_202F220 = 0; + if (isLinkedMove && GetEntInfo(attacker)->unk153 <= 3) { + GetEntInfo(attacker)->unk153++; + } + + var_2C = sub_8057070(move); + for (i = 0; i < var_2C; i++) { + u8 r4; + EntityInfo *entInfo; + + var_24 = 1; + if (gUnknown_202F220 != 0 || gUnknown_202F221 != 0) + break; + if (!EntityIsValid(attacker) || sub_8044B28()) + return TRUE; + + entInfo = GetEntInfo(attacker); + if (var_30 != 0 || move->id == MOVE_SNORE || move->id == MOVE_SLEEP_TALK) { + if (!IsSleeping(attacker) && CannotAttack(attacker, TRUE)) + break; + } + else { + if (CannotAttack(attacker, FALSE)) + break; + } + entInfo->unk14A = 0; + if (move->id == MOVE_THRASH) { + GetEntInfo(attacker)->action.direction = DungeonRandInt(NUM_DIRECTIONS); + TargetTileInFront(attacker); + var_24 = 0; + } + gUnknown_203B438 = NULL; + targetsArray[0] = 0; + if (var_28 == 0 || var_28 == 1) { + SetTargetsForMove(targetsArray, attacker, move); + SortTargets(targetsArray, attacker); + if (i != 0 && var_24 != 0 && targetsArray[0] == NULL) + break; + } + r4 = sub_8056468(attacker, move, msg, targetsArray, itemId, (i == 0), var_28); + msg = NULL; + if (gUnknown_203B438 != 0) { + sub_806A1E8(gUnknown_203B438); + } + + if (GetEntInfo(attacker)->cringeClassStatus.status != STATUS_CONFUSED && GetEntInfo(attacker)->cringeClassStatus.status != STATUS_COWERING) { + EntityInfo *entInfo = GetEntInfo(attacker); + entInfo->targetPos.x = 0; + entInfo->targetPos.y = 0; + } + + gUnknown_202F214++; + if (var_28 != 0) { + sub_80566F8(attacker, move, var_28, r4, itemId, isLinkedMove); + } + else { + UseMoveAgainstTargets(targetsArray, attacker, move, itemId, isLinkedMove); + } + + if (!EntityIsValid(attacker)) + break; + + sub_806CF18(attacker); + if (GetEntInfo(attacker)->unk14A == 0) { + GetEntInfo(attacker)->unk14A = 0; // Redundant as it's already 0 + sub_8079764(attacker); + } + } + + + if (gUnknown_202F21A != 0) { + EndFrozenClassStatus(attacker, attacker); + EndLeechSeedClassStatus(attacker, attacker); + } + + if (gUnknown_202F219 != 0 && EntityIsValid(attacker)) { + EntityInfo *entInfo = GetEntInfo(attacker); + + ConfuseStatusTarget(attacker, attacker, FALSE); + SetExpMultplier(entInfo); + } + return TRUE; +} + +bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray, bool32 itemId, bool8 arg_4, bool32 unused) +{ + s32 i; + bool8 ret = FALSE; + bool32 r7 = (sub_8045888(entity) != FALSE); + + if (str != NULL) { + for (i = 0; i < 65; i++) { + if (unkArray[i] == NULL) { + break; + } + if (sub_8045888(unkArray[i])) { + r7 = TRUE; + break; + } + } + + if (r7) { + SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(entity), 0); + if (itemId == 0) { + BufferMoveName(gFormatBuffer_Items[0], move, NULL); + } + else { + BufferItemName(gFormatBuffer_Items[0], itemId, NULL); + } + } + + if (move->id != MOVE_REGULAR_ATTACK) { + DisplayDungeonLoggableMessageTrue(entity, str); + } + else { + DisplayDungeonLoggableMessageFalse(entity, str); + } + } + + if (r7) { + if (arg_4) { + ret = sub_8040BB0(entity, move, TRUE); + } + else { + ret = sub_8040BB0(entity, move, FALSE); + } + sub_8040DA0(entity, move); + } + else { + sub_806CE68(entity, GetEntInfo(entity)->action.direction); + } + + return ret; +} + +s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4) +{ + struct UnkStruct_sub_800E308_1 unkSp1; + DungeonPos unkSp2; + EntityInfo *entInfo = GetEntInfo(entity); + + if (!gDungeon->unk181e8.blinded && (GetBodySize(entInfo->apparentID) < 4 || r4 != 1)) { + s32 unk6 = sub_800ECB8(sub_80412E0(move->id, GetApparentWeather(entity), 1))->unk6; + s32 pixelPosX = X_POS_TO_PIXELPOS(pos->x); + s32 pixelPosY = Y_POS_TO_PIXELPOS(pos->y); + + unkSp2.x = pixelPosX / 256; + unkSp2.y = pixelPosY / 256; + + if (unk6 != 0) { + s32 someRetVal; + + sub_800EF10(sub_80412E0(move->id, GetApparentWeather(entity), 1)); + sub_800EF64(); + DungeonRunFrameActions(0x5E); + someRetVal = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), 1)); + if (someRetVal != -1) { + sub_800569C(&unkSp1.unk8, &entity->axObj, someRetVal); + } + else { + unkSp1.unk8 = (DungeonPos) {0}; + } + unkSp1.unk0 = sub_80412E0(move->id, GetApparentWeather(entity), 1); + unkSp1.unk2 = entInfo->apparentID; + unkSp1.unk4.x = entity->pixelPos.x / 256; + unkSp1.unk4.y = entity->pixelPos.y / 256; + unkSp1.unkC = entInfo->action.direction; + unkSp1.unk10 = 0; + + return sub_800E308(&unkSp1, &unkSp2); + } + } + + return -1; +} + +static const s32 gUnknown_81069D4[NUM_DIRECTIONS] = +{ + [DIRECTION_SOUTH] = 1, + [DIRECTION_SOUTHEAST] = 1, + [DIRECTION_EAST] = 1, + [DIRECTION_NORTHEAST] = 0, + [DIRECTION_NORTH] = 0, + [DIRECTION_NORTHWEST] = 0, + [DIRECTION_WEST] = 1, + [DIRECTION_SOUTHWEST] = 1 +}; + +// This function looks important, but what does it do? +void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 isLinkedMove) +{ + DungeonPos var_68; + DungeonPos var_64; + Entity *targetsArray[2]; // Only 2 hmm + s32 var_4C, var_48; + s32 i, j; + s32 targetArrId; + s32 var_3C; + s32 var_38; + s32 var_34; + s32 var_30; + s32 var_2C; + s32 var_28, var_24; + s32 someCount; + EntityInfo *attackerInfo; + s32 unkRetVal; + s32 divResult; + s32 r9; + + targetArrId = 0; + someCount = 0; + attackerInfo = GetEntInfo(attacker); + unkRetVal = sub_800ED20(move->id); + var_30 = 2; + if (unkRetVal != 1) { + var_30 = 6; + if (unkRetVal == 2) { + var_30 = 3; + } + } + + var_68.x = attacker->pos.x; + var_68.y = attacker->pos.y; + var_4C = gAdjacentTileOffsets[attackerInfo->action.direction].x; + var_48 = gAdjacentTileOffsets[attackerInfo->action.direction].y; + for (i = 0; i < a2; i++) + { + const Tile *tile; + + if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) + break; + + var_68.x += var_4C; + var_68.y += var_48; + someCount++; + tile = GetTile(var_68.x, var_68.y); + if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + break; + if (tile->monster != NULL && GetEntityType(tile->monster) == ENTITY_MONSTER) + break; + } + + if (MoveRequiresCharging(attacker, move->id) && !MoveMatchesBideClassStatus(attacker, move)) { + var_34 = -1; + } + else { + var_34 = sub_8056564(attacker, &var_68, move, a2); + } + + var_68.x = attacker->pos.x; + var_68.y = attacker->pos.y; + var_4C = gAdjacentTileOffsets[attackerInfo->action.direction].x; + var_48 = gAdjacentTileOffsets[attackerInfo->action.direction].y; + divResult = someCount * (24 / var_30); + if (a2 > 1) { + var_3C = divResult + 8; + if (var_3C >= 64) { + var_3C = 64; + } + } + else { + var_3C = 32; + } + + r9 = 0; + var_2C = 0x80000 / divResult; + var_38 = gUnknown_81069D4[attackerInfo->action.direction]; + gDungeon->unk1BDD4.unk1C05E = 1; + + for (i = 0; i < a2; i++) + { + DungeonPos var_68Before; + const Tile *tile; + + if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) + break; + + var_68Before = var_68; + var_68.x += var_4C; + var_68.y += var_48; + if (sub_803F428(&var_68) && !gDungeon->unk181e8.blinded) { + PixelPos pos32; + pos32.x = X_POS_TO_PIXELPOS(var_68Before.x); + pos32.y = Y_POS_TO_PIXELPOS(var_68Before.y); + var_28 = var_30 * (var_4C << 8); + var_24 = var_30 * (var_48 << 8); + for (j = 0; j < 24 / var_30; j++) { + if (var_34 >= 0) { + s32 r3; + s32 r2; + + if (a3 != 0) { + r3 = sin_4096(r9 / 256) * var_3C; + } + else { + r3 = 0; + } + var_64.x = pos32.x / 256; + var_64.y = (pos32.y - r3) / 256; + r2 = pos32.y / 256; + r2 -= gDungeon->unk181e8.cameraPixelPos.y; + r2 /= 2; + sub_800E3AC(var_34, &var_64, r2 + var_38); + } + DungeonRunFrameActions(0x30); + pos32.x += var_28; + pos32.y += var_24; + r9 += var_2C; + } + } + else { + r9 += (24 / var_30) * var_2C; + } + + tile = GetTile(var_68.x, var_68.y); + if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + break; + if (tile->monster != NULL && GetEntityType(tile->monster) == ENTITY_MONSTER && !sub_80571F0(tile->monster, move)) { + if (targetArrId <= 0) { + bool8 canHitAnyone = FALSE; + s32 targetFlags; + EntityInfo *attackerInfo = GetEntInfo(attacker); + if (attackerInfo->cringeClassStatus.status == STATUS_CONFUSED + || attackerInfo->blinkerClassStatus.status == STATUS_BLINKER + || attackerInfo->cringeClassStatus.status == STATUS_COWERING) + { + canHitAnyone = TRUE; + } + targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); + targetArrId = SetNewTarget(targetArrId, targetsArray, targetFlags, attacker, tile->monster, move, canHitAnyone); + } + break; + } + } + + if (var_34 >= 0) { + sub_800DC14(var_34); + } + sub_804178C(1); + gDungeon->unk1BDD4.unk1C05E = 0; + + if (targetArrId > 0) { + targetsArray[targetArrId] = NULL; + UseMoveAgainstTargets(targetsArray, attacker, move, itemId, isLinkedMove); + } + else if (a2 == 1 && sub_803F428(&var_68)) { + sub_803E708(1, 0x4A); + sub_8041168(attacker, NULL, move, &var_68); + } +} + +bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accuracyType, bool8 selfAlwaysHits) +{ + s32 statStageAccuracy, statStageEvasion; + s24_8 statStageMul; + s32 accuracy = GetMoveAccuracyOrAIChance(move, accuracyType); + s32 rand = DungeonRandInt(100); + EntityInfo *attackerInfo = GetEntInfo(attacker); + EntityInfo *targetInfo = GetEntInfo(target); + + if (selfAlwaysHits && attacker == target) + return TRUE; + if (move->id == MOVE_REGULAR_ATTACK && IQSkillIsEnabled(attacker, IQ_SURE_HIT_ATTACKER)) + return TRUE; + if (attackerInfo->sureShotClassStatus.status == STATUS_SURE_SHOT) + return TRUE; + if (attackerInfo->sureShotClassStatus.status == STATUS_WHIFFER) + return FALSE; + if (accuracy > 100) + return TRUE; + + if (HasHeldItem(target, ITEM_DETECT_BAND)) { + accuracy -= gDetectBandAccuracyDebuffValue; + } + if (IQSkillIsEnabled(target, IQ_QUICK_DODGER)) { + accuracy -= gIqQuickDodgerAccuracyDebuffValue; + } + + statStageAccuracy = attackerInfo->hitChanceStages[0]; + if (AbilityIsActive(attacker, ABILITY_COMPOUNDEYES)) { + statStageAccuracy += 2; + } + if (move->id == MOVE_THUNDER) { + s32 weather = GetApparentWeather(attacker); + if (weather == WEATHER_RAIN) { + return TRUE; + } + else if (weather == WEATHER_SUNNY) { + statStageAccuracy -= 2; + } + } + + if (statStageAccuracy < 0) statStageAccuracy = 0; + if (statStageAccuracy > 20) statStageAccuracy = 20; + + statStageMul = gAccEvsStatStageMultipliers[0][statStageAccuracy]; + if (statStageMul.raw < 0) statStageMul.raw = 0; + if (statStageMul.raw > IntToF248_2(100).raw) statStageMul = IntToF248_2(100); + + accuracy *= statStageMul.raw; + accuracy /= 256; + + statStageEvasion = targetInfo->hitChanceStages[1]; + if (targetInfo->exposed) { + statStageEvasion = 10; + } + if (GetApparentWeather(target) == WEATHER_SANDSTORM && AbilityIsActive(target, ABILITY_SAND_VEIL)) { + statStageEvasion += 2; + } + if (AbilityIsActive(attacker, ABILITY_HUSTLE)) { + bool32 specialMove = (IsTypePhysical(GetMoveType(move)) == FALSE); + if (!specialMove) { + statStageEvasion += 2; + } + } + + if (statStageEvasion < 0) statStageEvasion = 0; + if (statStageEvasion > 20) statStageEvasion = 20; + + statStageMul = gAccEvsStatStageMultipliers[1][statStageEvasion]; + if (statStageMul.raw < 0) statStageMul.raw = 0; + if (statStageMul.raw > IntToF248_2(100).raw) statStageMul = IntToF248_2(100); + + accuracy *= statStageMul.raw; + accuracy /= 256; + if (rand < accuracy) + return TRUE; + else + return FALSE; +} + +void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *move) +{ + s32 targetFlags; + s32 targetFlagsAnd; + s32 arrId = 0; + bool8 canHitPartner = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED + || GetEntInfo(attacker)->blinkerClassStatus.status == STATUS_BLINKER + || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); + bool8 canHitSelf = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); + + if (IQSkillIsEnabled(attacker, IQ_NONTRAITOR)) { + canHitSelf = FALSE; + canHitPartner = FALSE; + } + targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); + if ((targetFlags & 0xF) == 4) { + bool32 usable = MoveMatchesBideClassStatus(attacker, move); + if (move->id == MOVE_SOLARBEAM && GetApparentWeather(attacker) == WEATHER_SUNNY) { + usable = TRUE; + } + if (usable) + targetFlags = 0; + else + targetFlags = 0x73; + } + + targetFlagsAnd = targetFlags & 0xF0; + if (targetFlagsAnd == 0) { + Entity *targetEntity = sub_80696A8(attacker); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + else if (targetFlagsAnd == 0x10 || targetFlagsAnd == 0x20) { + s32 i; + s32 direction, to; + EntityInfo *entInfo = GetEntInfo(attacker); + if (targetFlagsAnd == 0x20) { + direction = entInfo->action.direction; + to = 8; + } + else { + direction = entInfo->action.direction - 1; + to = 3; + } + for (i = 0; i < to; i++, direction++) { + Entity *targetEntity; + DungeonPos unkPositon; + + direction &= DIRECTION_MASK; + unkPositon.x = attacker->pos.x + gAdjacentTileOffsets[direction].x ; + unkPositon.y = attacker->pos.y + gAdjacentTileOffsets[direction].y; + targetEntity = GetMonsterAtPos(&unkPositon); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + } + else if (targetFlagsAnd == 0x30) { + s32 i; + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *dungeonMon = gDungeon->activePokemon[i]; + if (EntityIsValid(dungeonMon) && sub_8045A70(attacker, dungeonMon)) { + if (dungeonMon == attacker) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); + } + else { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); + } + } + } + } + else if (targetFlagsAnd == 0x40) { + bool32 r4 = FALSE; + Entity *targetEntity = sub_80696FC(attacker); + if (targetEntity != NULL) { + s32 arrIdBefore = arrId; + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + r4 = (arrId != arrIdBefore); + } + if (!r4) { + targetEntity = sub_806977C(attacker); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + } + else if (targetFlagsAnd == 0x50) { + // Nothing happens here + } + else if (targetFlagsAnd == 0x80) { + Entity *targetEntity = sub_80696FC(attacker); + if (targetEntity != NULL) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); + } + } + else if (targetFlagsAnd == 0x60) { + s32 i; + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *dungeonMon = gDungeon->activePokemon[i]; + if (EntityIsValid(dungeonMon)) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); + } + } + } + else if (targetFlagsAnd == 0x70) { + arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitPartner); + } + + targetsArray[arrId] = NULL; +} + +s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_, Entity *attacker, Entity *target, Move *move, bool32 canHitAnyone_) +{ + bool32 canHitTarget; + EntityInfo *targetInfo; + + // It's happening again, all over the codebase there are problems with s16 arguments, where the lsl/asr asm can't be matched. What is going on with that? + s32 targetFlags = (s16)targetFlags_; + bool8 canHitAnyone = canHitAnyone_; + canHitTarget = FALSE; + targetInfo = GetEntInfo(target); + + if (move->id == MOVE_BATON_PASS && attacker == target) + return targetArrId; + if (targetInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER) + return targetArrId; + if (targetInfo->monsterBehavior == BEHAVIOR_DIGLETT || targetInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) + return targetArrId; + + if (canHitAnyone) { + canHitTarget = TRUE; + } + else { + s32 targetFlagsAnd = targetFlags & 0xF; + if (targetFlagsAnd == 0 || targetFlagsAnd == 4) { + if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 1) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 1) { + if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 0) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 2) { + canHitTarget = TRUE; + } + else if (targetFlagsAnd == 5) { + if (attacker != target) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 6) { + if (GetTreatmentBetweenMonsters(attacker, target, TRUE, FALSE) == 0 && attacker != target) { + canHitTarget = TRUE; + } + } + else if (targetFlagsAnd == 3) { + canHitTarget = TRUE; + } + } + + if (sub_80571F0(target, move)) { + canHitTarget = FALSE; + } + + if (canHitTarget && targetArrId < MAX_MOVE_TARGETS) { + targetsArray[targetArrId] = target; + if (!GetEntInfo(target)->isNotTeamMember && gUnknown_203B438 == NULL) { + gUnknown_203B438 = target; + } + targetArrId++; + } + + return targetArrId; +} + +struct MultiTurnChargeMove +{ + u16 moveID; + u8 status; +}; + +const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { + {MOVE_SOLARBEAM, STATUS_SOLARBEAM}, + {MOVE_SKY_ATTACK, STATUS_SKY_ATTACK}, + {MOVE_RAZOR_WIND, STATUS_RAZOR_WIND}, + {MOVE_FOCUS_PUNCH, STATUS_FOCUS_PUNCH}, + {MOVE_SKULL_BASH, STATUS_SKULL_BASH}, + {MOVE_FLY, STATUS_FLYING}, + {MOVE_BOUNCE, STATUS_BOUNCING}, + {MOVE_DIVE, STATUS_DIVING}, + {MOVE_DIG, STATUS_DIGGING}, + {MOVE_NOTHING, STATUS_NONE} +}; + +const u32 gMultiTurnBideClassStatuses[10] = { + STATUS_SOLARBEAM, + STATUS_SKY_ATTACK, + STATUS_RAZOR_WIND, + STATUS_FOCUS_PUNCH, + STATUS_SKULL_BASH, + STATUS_FLYING, + STATUS_BOUNCING, + STATUS_DIVING, + STATUS_DIGGING, + STATUS_NONE +}; + +s32 sub_8057070(Move *move) +{ + s32 numberOfChainedHits = GetMoveNumberOfChainedHits(move); + if (numberOfChainedHits == 0) + return DungeonRandRange(2, 6); + else + return numberOfChainedHits; +} + +bool8 MoveCausesPaused(Move *move) +{ + if(move->id == MOVE_FRENZY_PLANT) return TRUE; + if(move->id == MOVE_HYDRO_CANNON) return TRUE; + if(move->id == MOVE_HYPER_BEAM) return TRUE; + if(move->id == MOVE_BLAST_BURN) return TRUE; + + return FALSE; +} + +bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move) +{ + if (!EntityIsValid(pokemon)) + { + return FALSE; + } + else + { + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + s32 i; + for (i = 0; i < 100; i++) + { + if (gMultiTurnChargeMoves[i].moveID == MOVE_NOTHING) + { + return FALSE; + } + if (move->id == gMultiTurnChargeMoves[i].moveID && + pokemonInfo->bideClassStatus.status == gMultiTurnChargeMoves[i].status) + { + return TRUE; + } + } + return FALSE; + } +} + +bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) +{ + if (!EntityIsValid(pokemon)) + { + return FALSE; + } + else + { + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + int i = 0; + u8 *bideClassStatusPointer = &pokemonInfo->bideClassStatus.status; + u8 *bideClassStatusPointer2; + u8 chargeStatus = STATUS_CHARGING; + for (; i < 100; i++) + { + u8 currentStatus = gMultiTurnBideClassStatuses[i]; + u8 bideClassStatus; + if (currentStatus == STATUS_NONE) + { + return FALSE; + } + bideClassStatus = *bideClassStatusPointer; + bideClassStatusPointer2 = &pokemonInfo->bideClassStatus.status; + if (bideClassStatus == currentStatus) + { + return TRUE; + } + } + // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnBideClassStatuses array. + if (checkCharge && *bideClassStatusPointer2 == chargeStatus) + { + return TRUE; + } + return FALSE; + } +} + +u32 sub_8057144(Entity * pokemon) +{ + Move *moveStack[80]; + int i, j, nMoves; + + nMoves = 0; + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) + { + Entity *dungeonMon = gDungeon->activePokemon[i]; + if (EntityIsValid(dungeonMon)) { + Move *moves = GetEntInfo(dungeonMon)->moves.moves; + for (j = 0; j < MAX_MON_MOVES; j++) + { + if (moves[j].moveFlags & MOVE_FLAG_EXISTS + && !MoveRequiresCharging(pokemon, moves[j].id) + && moves[j].id != MOVE_SKETCH + && nMoves < 80) { + moveStack[nMoves++] = &moves[j]; + } + } + } + } + + if (nMoves == 0) { + return MOVE_REGULAR_ATTACK; + } + else { + return moveStack[DungeonRandInt(nMoves)]->id; + } +} + +bool8 sub_80571F0(Entity * pokemon, Move *move) +{ + u16 moveID; + s32 tileset; + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + + if (entityInfo->unkFF == 1) { + moveID = move->id; + if ((moveID == MOVE_SKY_UPPERCUT) || (moveID == MOVE_TWISTER) || (moveID == MOVE_GUST) || (moveID == MOVE_THUNDER)) + return FALSE; + else + return TRUE; + } + else if (entityInfo->unkFF == 2) { + if (entityInfo->bideClassStatus.status == STATUS_DIVING) { + if (move->id == MOVE_WHIRLPOOL || move->id == MOVE_SURF) return FALSE; + } + else if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { + moveID = move->id; + if (moveID == MOVE_EARTHQUAKE || moveID == MOVE_MAGNITUDE) return FALSE; + if (moveID == MOVE_NATURE_POWER) { + tileset = gDungeon->tileset; + if (tileset < 0) { + tileset = 0; + } + if (0x4a < tileset) { + tileset = 0x4a; + } + if (gNaturePowerCalledMoves[tileset].moveID == MOVE_EARTHQUAKE) return FALSE; + } + } + return TRUE; + } + return FALSE; +} + +bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) +{ + bool8 uVar2; + if (sub_8044B28()) + return FALSE; + if (!EntityIsValid(pokemon) || !EntityIsValid(target)) + return FALSE; + if (GetEntInfo(target)->unk158 == 0 || GetEntInfo(target)->HP == 0) + return FALSE; + + if (chance != 0) { + if (AbilityIsActive(pokemon, ABILITY_SERENE_GRACE)) { + uVar2 = DungeonRandOutcome_2(chance * 2); + } + else + { + uVar2 = DungeonRandOutcome_2(chance); + } + } + else + { + uVar2 = TRUE; + } + + if (uVar2 && (pokemon != target) && AbilityIsActive(target, ABILITY_SHIELD_DUST)) + { + sub_80429C8(target); + return FALSE; + } + + return uVar2; +} + +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance) +{ + if(!EntityIsValid(pokemon)) + return FALSE; + if(chance == 0) + return TRUE; + if(AbilityIsActive(pokemon, ABILITY_SERENE_GRACE)) + return DungeonRandOutcome_2(chance * 2); + else + return DungeonRandOutcome_2(chance); +} + +bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker) +{ + s32 i; + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + Move *move = &pokemonInfo->moves.moves[moveIndex]; + if (!MoveFlagExists(move)) + return FALSE; + if (MoveFlagLinkChain(move) || MoveFlagDisabled(move) || MoveFlagSealed(move)) + return FALSE; + + for (i = 0; i < MAX_MON_MOVES; i++) { + if (CanMonsterUseMove(pokemon, move, hasPPChecker)) + return TRUE; + move++; + if (move >= &pokemonInfo->moves.moves[MAX_MON_MOVES]) + break; + if (!(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) + break; + } + + return FALSE; +} + +bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker) +{ + EntityInfo *pokemonInfo = GetEntInfo(pokemon); + if (move->id == MOVE_REGULAR_ATTACK) + { + return TRUE; + } + if (move->moveFlags & MOVE_FLAG_DISABLED || move->moveFlags2 & MOVE_FLAG_SEALED) + { + return FALSE; + } + if (hasPPChecker) + { + if (move->PP == 0) + { + return FALSE; + } + if (pokemonInfo->cringeClassStatus.status == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) + { + return FALSE; + } + if (pokemonInfo->cringeClassStatus.status == STATUS_ENCORE) + { + if (move->id == MOVE_STRUGGLE) + { + if (!(pokemonInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED)) + { + return FALSE; + } + } + else if (!(move->moveFlags & MOVE_FLAG_LAST_USED)) + { + return FALSE; + } + } + } + return TRUE; +} + +bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3) +{ + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + if (move->id != MOVE_REGULAR_ATTACK) { + if (((move->moveFlags & MOVE_FLAG_DISABLED)) || ((move->moveFlags2 & MOVE_FLAG_EXISTS))) { + return FALSE; + } + if (param_3 != 0) { + if ((entityInfo->cringeClassStatus.status == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; + if (entityInfo->cringeClassStatus.status == STATUS_ENCORE) { + if (move->id == MOVE_STRUGGLE) { + if((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; + } + else { + if((move->moveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; + } + } + } + } + return TRUE; +} + +// Attacker always goes last +void SortTargets(Entity **targetsArray, Entity *attacker) +{ + Entity *localArray[MAX_MOVE_TARGETS + 1]; + s32 i; + s32 count = 0; + + for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { + if (targetsArray[i] == NULL) + break; + if (targetsArray[i] == attacker) + continue; + if (count >= MAX_MOVE_TARGETS) + break; + localArray[count++] = targetsArray[i]; + } + + for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { + if (targetsArray[i] == NULL) + break; + if (targetsArray[i] != attacker) + continue; + if (count >= MAX_MOVE_TARGETS) + break; + localArray[count++] = targetsArray[i]; + } + + for (; count < MAX_MOVE_TARGETS + 1; count++) { + localArray[count] = NULL; + } + + for (i = 0; i < MAX_MOVE_TARGETS + 1; i++) { + targetsArray[i] = localArray[i]; + } +} + +bool8 MoveRequiresCharging(Entity* pokemon, u16 moveID) +{ + if ((moveID == MOVE_SOLARBEAM) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { + return FALSE; + } + else { + return DoesMoveCharge(moveID); + } +} + +void sub_8057588(Entity * pokemon, u8 param_2) +{ + Move *move; + s32 index; + s32 PPtoRemove; + s32 PPCounter; + EntityInfo *entityInfo; + + if (EntityIsValid(pokemon)) { + entityInfo = GetEntInfo(pokemon); + for(index = 0; index < MAX_MON_MOVES; index++) + { + move = &entityInfo->moves.moves[index]; + if ((move->moveFlags & MOVE_FLAG_EXISTS)) { + PPtoRemove = 1; + if ((move->moveFlags2 & MOVE_FLAG_LAST_USED)) { + move->moveFlags2 &= ~(MOVE_FLAG_LAST_USED); + PPtoRemove = 2; + } + if (((move->moveFlags2 & MOVE_FLAG_SET)) && (move->moveFlags2 &= ~(MOVE_FLAG_SET), param_2 != 0)) + { + if(PPtoRemove != 0) + { + PPCounter = PPtoRemove; + for (; PPCounter != 0; PPCounter--) { + if (move->PP != 0) { + move->PP--; + } + } + } + } + } + } + } +} + +s16 sub_8057600(Move *move, s32 itemID) +{ + return sub_8094828(move->id, ToItemID(itemID)); +} + +static u8 ToItemID(u32 itemID) +{ + if(itemID == ITEM_NOTHING) + return ITEM_NOTHING; + else + return itemID; +} diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c deleted file mode 100644 index b4a83eafd..000000000 --- a/src/dungeon_movement.c +++ /dev/null @@ -1,348 +0,0 @@ -#include "global.h" -#include "structs/map.h" -#include "dungeon_movement.h" - -#include "constants/item.h" -#include "constants/iq_skill.h" -#include "constants/status.h" -#include "constants/type.h" -#include "constants/weather.h" -#include "dungeon_engine.h" -#include "dungeon_items.h" -#include "structs/str_dungeon.h" -#include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_util.h" -#include "pokemon.h" -#include "weather.h" - -EWRAM_DATA u8 gWalkableTileToCrossableTerrain[8] = {0}; - -u8 GetCrossableTerrain(s16 species) -{ - u8 walkableTiles = GetMovementType(species); - if (walkableTiles >= NUM_CROSSABLE_TERRAIN) - { - // Pokémon that can cross water or lava have a walkable tile value of 4 (MOVEMENT_TYPE_LAVA) or 5 (MOVEMENT_TYPE_WATER), respectively. - // Indices 4 and 5 in this array are assigned either CROSSABLE_TERRAIN_REGULAR or CROSSABLE_TERRAIN_LIQUID - // depending on whether the dungeon's liquid is water or lava. - // For example, a lava dungeon like Mt. Blaze would have these values: - // gWalkableTileToCrossableTerrain[MOVEMENT_TYPE_LAVA]: CROSSABLE_TERRAIN_LIQUID - // gWalkableTileToCrossableTerrain[MOVEMENT_TYPE_WATER]: CROSSABLE_TERRAIN_REGULAR - // This means a Fire-type can cross the dungeon's liquid, while a Water-type cannot. - return gWalkableTileToCrossableTerrain[walkableTiles]; - } - else - { - return walkableTiles; - } -} - -u8 sub_807034C(s32 id, const Tile *tile) -{ - s32 crossableTerrain; - u16 tileFlags; - s32 id_s32; - - id_s32 = SpeciesId(id); - - if ((tile->monster == NULL) && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) { - crossableTerrain = GetCrossableTerrain(id_s32); - tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); - switch(crossableTerrain) - { - case CROSSABLE_TERRAIN_LIQUID: - if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; - case CROSSABLE_TERRAIN_REGULAR: - if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; - break; - case CROSSABLE_TERRAIN_WALL: - default: - return FALSE; - case CROSSABLE_TERRAIN_CREVICE: - if(tileFlags != 0) return FALSE; - } - } - return TRUE; -} - -u8 sub_80703A0(Entity *pokemon, DungeonPos *pos) -{ - const Tile *tile; - u8 crossableTerrain; - u16 tileFlags; - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - tile = GetTile(pos->x,pos->y); - if (pos->x < 0 || pos->y < 0) - return TRUE; - if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) - return TRUE; - if (tile->monster != NULL) - return TRUE; - if (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) - return TRUE; - - if ((IsCurrentFixedRoomBossFight()) || ((entityInfo->invisibleClassStatus.status != STATUS_MOBILE && (!HasHeldItem(pokemon, ITEM_MOBILE_SCARF))))) { - crossableTerrain = GetCrossableTerrain(entityInfo->id); - tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); - if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - switch(crossableTerrain) - { - case CROSSABLE_TERRAIN_LIQUID: - if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; - case CROSSABLE_TERRAIN_REGULAR: - if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; - break; - case CROSSABLE_TERRAIN_WALL: - default: - return FALSE; - case CROSSABLE_TERRAIN_CREVICE: - if(tileFlags != 0) return FALSE; - } - } - else { - return FALSE; - } - - return TRUE; -} - -bool8 CanCrossWalls(Entity *pokemon) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->invisibleClassStatus.status == STATUS_MOBILE) - { - return TRUE; - } - if (HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) - { - return TRUE; - } - if (GetCrossableTerrain(pokemonInfo->id) == CROSSABLE_TERRAIN_WALL) - { - return TRUE; - } - return FALSE; -} - -bool8 sub_807049C(Entity *pokemon, DungeonPos *pos) -{ - s32 crossableTerrain; - const Tile *tile; - u16 tileFlags; - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - tile = GetTile(pos->x,pos->y); - if (pos->x < 0 || pos->y < 0) - return TRUE; - if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) - return TRUE; - if (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) - return TRUE; - if (tile->monster != NULL && GetEntityType(tile->monster) != ENTITY_MONSTER) - return TRUE; - - if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { - crossableTerrain = GetCrossableTerrain(entityInfo->id); - tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); - if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - switch(crossableTerrain) - { - case CROSSABLE_TERRAIN_LIQUID: - if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; - case CROSSABLE_TERRAIN_REGULAR: - if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; - break; - case CROSSABLE_TERRAIN_WALL: - default: - return FALSE; - case CROSSABLE_TERRAIN_CREVICE: - if(tileFlags != 0) return FALSE; - } - } - else { - return FALSE; - } - - return TRUE; -} - -bool8 sub_8070564(Entity *pokemon, DungeonPos *pos) -{ - u16 crossableTerrain; - u32 tileFlags; - - EntityInfo *entityInfo = GetEntInfo(pokemon); - const Tile *tile = GetTile(pos->x,pos->y); - - if (pos->x < 0 || pos->y < 0) - return TRUE; - if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) - return TRUE; - if (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) - return TRUE; - if (tile->monster != NULL && GetEntityType(tile->monster) != ENTITY_MONSTER) - return TRUE; - - crossableTerrain = GetCrossableTerrain(entityInfo->id); - tileFlags = GetTerrainType(tile); - - switch (crossableTerrain) - { - default: - return FALSE; - case CROSSABLE_TERRAIN_WALL: - case CROSSABLE_TERRAIN_CREVICE: - if (tileFlags != TERRAIN_TYPE_WALL) return FALSE; - break; - case CROSSABLE_TERRAIN_REGULAR: - if (tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; - break; - case CROSSABLE_TERRAIN_LIQUID: - if (tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; - if (tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; - break; - } - - return TRUE; -} - -bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos) -{ - s32 crossableTerrain; - const Tile *tile; - u16 tileFlags; - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - tile = GetTile(pos->x,pos->y); - if (pos->x < 0 || pos->y < 0) - return TRUE; - if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) - return TRUE; - if (((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) && (tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { - crossableTerrain = GetCrossableTerrain(entityInfo->id); - tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); - if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - - switch(crossableTerrain) - { - case CROSSABLE_TERRAIN_WALL: - default: - return FALSE; - case CROSSABLE_TERRAIN_REGULAR: - case CROSSABLE_TERRAIN_LIQUID: - case CROSSABLE_TERRAIN_CREVICE: - if(tileFlags != 0) return FALSE; - } - } - else return FALSE; - } - return TRUE; -} - -bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos) -{ - s32 crossableTerrain; - const Tile *tile; - u16 tileFlags; - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - tile = GetTile(pos->x,pos->y); - if (pos->x < 0 || pos->y < 0) - return TRUE; - if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) - return TRUE; - if ((((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) - && (tile->monster == NULL || ((GetEntityType(tile->monster) == ENTITY_MONSTER) && (GetEntInfo(tile->monster) == entityInfo)))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { - crossableTerrain = GetCrossableTerrain(entityInfo->id); - tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); - if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { - crossableTerrain = CROSSABLE_TERRAIN_CREVICE; - } - if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) { - crossableTerrain = CROSSABLE_TERRAIN_WALL; - } - switch(crossableTerrain) - { - case CROSSABLE_TERRAIN_LIQUID: - if(tileFlags == TERRAIN_TYPE_SECONDARY) return FALSE; - case CROSSABLE_TERRAIN_REGULAR: - if(tileFlags == TERRAIN_TYPE_NORMAL) return FALSE; - break; - case CROSSABLE_TERRAIN_WALL: - default: - return FALSE; - case CROSSABLE_TERRAIN_CREVICE: - if(tileFlags != 0) return FALSE; - } - } - else return FALSE; - } - return TRUE; -} - -s32 CalcSpeedStage(Entity *pokemon) -{ - s32 index; - s32 speed; - EntityInfo * entityInfo; - - entityInfo = GetEntInfo(pokemon); - speed = 0; - - for(index = 0; index < NUM_SPEED_COUNTERS; index++) - { - if (entityInfo->speedUpCounters[index + NUM_SPEED_COUNTERS] != 0) { - speed--; - } - if (entityInfo->speedUpCounters[index] != 0) { - speed++; - } - } - - if (entityInfo->burnClassStatus.status == STATUS_PARALYSIS) { - speed--; - } - - speed += GetMovementSpeed(entityInfo->id); - if ((MonsterIsType(pokemon, TYPE_ICE)) && (GetApparentWeather(pokemon) == WEATHER_SNOW)) { - speed++; - } - if (entityInfo->apparentID == MONSTER_DEOXYS_SPEED) { - speed++; - } - if ((entityInfo->id == MONSTER_KECLEON) && entityInfo->isNotTeamMember && - gDungeon->unk644.unk2A) { - speed++; - } - if (speed < 0) { - speed = 0; - } - if (MAX_SPEED_STAGE < speed) { - speed = MAX_SPEED_STAGE; - } - entityInfo->speedStage = speed; - return speed; -} diff --git a/src/dungeon_music.c b/src/dungeon_music.c index 53b3b6a54..ff857b99e 100644 --- a/src/dungeon_music.c +++ b/src/dungeon_music.c @@ -7,8 +7,8 @@ #include "dungeon_music.h" #include "dungeon_util.h" #include "music.h" -#include "status_checks_1.h" #include "text_util.h" +#include "dungeon_logic.h" extern MenuInputStruct gDungeonMenu; diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c deleted file mode 100644 index ede950268..000000000 --- a/src/dungeon_pokemon_attributes.c +++ /dev/null @@ -1,277 +0,0 @@ -#include "global.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_message.h" -#include "code_8045A00.h" -#include "constants/ability.h" -#include "constants/dungeon.h" -#include "constants/iq_skill.h" -#include "constants/move_id.h" -#include "constants/status.h" -#include "constants/tactic.h" -#include "constants/type.h" -#include "dungeon_items.h" -#include "dungeon_util.h" -#include "dungeon_visibility.h" -#include "moves.h" -#include "pokemon_3.h" -#include "pokemon.h" -#include "dungeon_config.h" -#include "structs/str_dungeon.h" - -extern const u8 *gUnknown_80FC31C; -extern const u8 * gUnknown_80FCEFC; -extern const u8 * gUnknown_80FC2FC; -extern bool8 sub_805744C(Entity *, Move *, u32); - -bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage) -{ - if (GetEntInfo(target)->reflectClassStatus.status == STATUS_SAFEGUARD) { - if (displayMessage) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); - } - return TRUE; - } - return FALSE; -} - -bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) -{ - if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIST) { - if (displayMessage) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); - } - return TRUE; - } - else { - if (AbilityIsActive(target, ABILITY_CLEAR_BODY) || AbilityIsActive(target, ABILITY_WHITE_SMOKE)) { - if (displayMessage) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC); - } - return TRUE; - } - } - return FALSE; -} - -bool8 sub_80717A4(Entity *pokemon, u16 moveID) -{ - EntityInfo * entityInfo; - s32 i; - - entityInfo = GetEntInfo(pokemon); - if ((entityInfo->sleepClassStatus.status != STATUS_SLEEP) && (entityInfo->sleepClassStatus.status != STATUS_NAPPING) && (entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE)) { - return FALSE; - } - else { - for (i = 0; i < MAX_MON_MOVES; i++) { - Move *move = &entityInfo->moves.moves[i]; - if (MoveFlagExists(move) - && (entityInfo->isTeamLeader || (move->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) - && sub_805744C(pokemon, move, TRUE) - && move->PP != 0 - && move->id == moveID) - { - return TRUE; - } - } - } - - return FALSE; -} - -bool8 AbilityIsActive(Entity *pokemon, u8 ability) -{ - if (!EntityIsValid(pokemon)) - { - return FALSE; - } - else - { - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->abilities[0] == ability || pokemonInfo->abilities[1] == ability) - { - return TRUE; - } - return FALSE; - } -} - -bool8 MonsterIsType(Entity *pokemon, u8 type) -{ - EntityInfo *pokemonInfo = pokemonInfo = GetEntInfo(pokemon); - if (type == TYPE_NONE) - { - return FALSE; - } - if (pokemonInfo->types[0] == type) - { - return TRUE; - } - if (pokemonInfo->types[1] == type) - { - return TRUE; - } - return FALSE; -} - -bool8 CanSeeInvisibleMonsters(Entity *pokemon) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->blinkerClassStatus.status != STATUS_EYEDROPS) - { - if (!HasHeldItem(pokemon, ITEM_GOGGLE_SPECS)) - return FALSE; - else - return TRUE; - } - else - return TRUE; -} - -bool8 IsTacticSet(Entity *pokemon, u8 tactic) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->isTeamLeader) - { - bool8 isGoTheOtherWay = tactic == TACTIC_GO_THE_OTHER_WAY; - return isGoTheOtherWay; - } - return pokemonInfo->tactic == tactic; -} - -bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill) -{ - return IsIQSkillSet(&GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill); -} - -bool8 IQSkillPairIsEnabled(Entity *pokemon, u8 IQSkill1, u8 IQSkill2) -{ - return IsIQSkillSet(&GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill1 | 1 << IQSkill2); -} - -void LoadIQSkills(Entity *pokemon) -{ - s32 IQSkill; - EntityInfo *pokemonInfo; - - pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->isNotTeamMember) { - IqSkillFlags *iqSkills = &pokemonInfo->IQSkillFlags; - SetIQSkill(iqSkills, IQ_STATUS_CHECKER); - SetIQSkill(iqSkills, IQ_PP_CHECKER); - SetIQSkill(iqSkills, IQ_ITEM_CATCHER); - if (pokemonInfo->bossFlag) - SetIQSkill(iqSkills, IQ_SELF_CURER); - if (pokemonInfo->level >= gIqItemMasterMinWildLevel) - SetIQSkill(iqSkills, IQ_ITEM_MASTER); - pokemonInfo->tactic = TACTIC_GO_AFTER_FOES; - } - else { - pokemonInfo->IQSkillFlags.flags[0] = 0; - pokemonInfo->IQSkillFlags.flags[1] = 0; - pokemonInfo->IQSkillFlags.flags[2] = 0; - for(IQSkill = IQ_TYPE_ADVANTAGE_MASTER; IQSkill < NUM_IQ_SKILLS; IQSkill++) - { - if (HasIQForSkill(pokemonInfo->IQ,IQSkill) && - IsIQSkillSet(&pokemonInfo->IQSkillMenuFlags, 1 << IQSkill)) - { - SetIQSkill(&pokemonInfo->IQSkillFlags,IQSkill); - } - } - } -} - -bool8 CanSeeTeammate(Entity * pokemon) -{ - Entity *teamMember; - s32 memberIdx; - - if (GetEntInfo(pokemon)->isNotTeamMember) { - return FALSE; - } - else - { - for(memberIdx = 0; memberIdx < MAX_TEAM_MEMBERS; memberIdx++) - { - teamMember = gDungeon->teamPokemon[memberIdx]; - if (EntityIsValid(pokemon) && (pokemon != teamMember) && (CanSeeTarget(pokemon,teamMember))) - { - return TRUE; - } - } - return FALSE; - } -} - -u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove) -{ - if (pokeMove->id == MOVE_HIDDEN_POWER) - return GetEntInfo(pokemon)->hiddenPower.hiddenPowerType; - else - return GetMoveType(pokeMove); -} - -s32 GetMovePower(Entity *pokemon, Move *pokeMove) -{ - if(pokeMove->id == MOVE_HIDDEN_POWER) - return (GetEntInfo(pokemon)->hiddenPower.hiddenPowerBasePower + pokeMove->ginseng); - else - return (GetMoveBasePower(pokeMove) + pokeMove->ginseng); -} - -bool8 MonsterCanThrowItems(EntityInfo *pokemon) -{ - if(!MonsterIDCanThrowItems(pokemon->id)) - return FALSE; - return TRUE; -} - -static inline bool8 sub_8071A8C_sub(EntityInfo *pokemonInfo) -{ - if(pokemonInfo->joinedAt.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON || - pokemonInfo->joinedAt.id == DUNGEON_RESCUE_TEAM_BASE) - return TRUE; - else - return FALSE; -} - -bool8 sub_8071A8C(Entity *pokemon) -{ - EntityInfo *pokemonInfo; - if(EntityIsValid(pokemon)) - { - pokemonInfo = GetEntInfo(pokemon); - if(pokemonInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) - { - if(!sub_8071A8C_sub(pokemonInfo)) - return TRUE; - } - } - return FALSE; -} - -bool8 SetVisualFlags(EntityInfo *entityInfo, u16 newFlag, bool8 param_3) -{ - if ((entityInfo->visualFlags & newFlag)) { - entityInfo->previousVisualFlags = newFlag | entityInfo->previousVisualFlags; - } - else { - entityInfo->previousVisualFlags = entityInfo->previousVisualFlags & ~newFlag; - } - - if (param_3) { - entityInfo->visualFlags = newFlag | entityInfo->visualFlags; - } - else { - entityInfo->visualFlags = entityInfo->visualFlags & ~newFlag; - } - if ( ((entityInfo->previousVisualFlags & newFlag) == 0) && ((entityInfo->visualFlags & newFlag)) ) { - return TRUE; - } - else { - return FALSE; - } -} diff --git a/src/dungeon_pos_data.c b/src/dungeon_pos_data.c new file mode 100644 index 000000000..914137d61 --- /dev/null +++ b/src/dungeon_pos_data.c @@ -0,0 +1,595 @@ +#include "global.h" +#include "structs/str_position.h" + +const DungeonPos gAdjacentTileOffsets[] = { + {0, 1}, + {1, 1}, + {1, 0}, + {1, -1}, + {0, -1}, + {-1, -1}, + {-1, 0}, + {-1, 1} +}; + +const DungeonPos gUnknown_80F4468[76] = { + {0, 0}, + {0, -1}, + {1, 0}, + {0, 1}, + {-1, 0}, + {-1, -1}, + {1, -1}, + {-1, 1}, + {1, 1}, + {-2, -2}, + {-1, -2}, + {0, -2}, + {1, -2}, + {2, -2}, + {-2, -1}, + {2, -1}, + {-2, 0}, + {2, 0}, + {-2, 1}, + {2, 1}, + {-2, 2}, + {-1, 2}, + {0, 2}, + {1, 2}, + {2, 2}, + {99, 99}, + {0, 0}, + {-1, 0}, + {0, -1}, + {0, 1}, + {1, 0}, + {-1, -1}, + {-1, 1}, + {-2, 0}, + {0, -2}, + {0, 2}, + {1, -1}, + {1, 1}, + {2, 0}, + {-1, -2}, + {-1, 2}, + {-2, -1}, + {-2, 1}, + {-3, 0}, + {0, -3}, + {0, 3}, + {1, -2}, + {1, 2}, + {2, -1}, + {2, 1}, + {3, 0}, + {-1, -3}, + {-1, 3}, + {-2, -2}, + {-2, 2}, + {-3, -1}, + {-3, 1}, + {1, -3}, + {1, 3}, + {2, -2}, + {2, 2}, + {3, -1}, + {3, 1}, + {-2, -3}, + {-2, 3}, + {-3, -2}, + {-3, 2}, + {2, -3}, + {2, 3}, + {3, -2}, + {3, 2}, + {-3, -3}, + {-3, 3}, + {3, -3}, + {3, 3}, + {99, 99}, +}; + +const DungeonPos gUnknown_80F4598[158] = { + {0, 0}, + {-1, 0}, + {1, 0}, + {0, 1}, + {0, -1}, + {-1, -1}, + {-1, 1}, + {-2, 0}, + {0, -2}, + {0, 2}, + {1, -1}, + {1, 1}, + {2, 0}, + {-1, -2}, + {-1, 2}, + {-2, -1}, + {-2, 1}, + {-3, 0}, + {0, -3}, + {0, 3}, + {1, -2}, + {1, 2}, + {2, -1}, + {2, 1}, + {3, 0}, + {-1, -3}, + {-1, 3}, + {-2, -2}, + {-2, 2}, + {-3, -1}, + {-3, 1}, + {1, -3}, + {1, 3}, + {2, -2}, + {2, 2}, + {3, -1}, + {3, 1}, + {-2, -3}, + {-2, 3}, + {-3, -2}, + {-3, 2}, + {2, -3}, + {2, 3}, + {3, -2}, + {3, 2}, + {-3, -3}, + {-3, 3}, + {3, -3}, + {3, 3}, + {-4, 0}, + {4, 0}, + {0, -4}, + {0, 4}, + {-4, 1}, + {4, 1}, + {-1, -4}, + {-1, 4}, + {-4, -1}, + {4, -1}, + {1, -4}, + {1, 4}, + {-4, 2}, + {4, 2}, + {-2, -4}, + {-2, 4}, + {-4, -2}, + {4, -2}, + {2, -4}, + {2, 4}, + {-4, 3}, + {4, 3}, + {-3, -4}, + {-3, 4}, + {-4, -3}, + {4, -3}, + {3, -4}, + {3, 4}, + {-4, 4}, + {4, 4}, + {-4, -4}, + {-4, 4}, + {-5, 0}, + {5, 0}, + {0, -5}, + {0, 5}, + {-5, -1}, + {5, -1}, + {-1, -5}, + {-1, 5}, + {-5, 1}, + {5, 1}, + {1, -5}, + {1, 5}, + {-5, -2}, + {5, -2}, + {-2, -5}, + {-2, 5}, + {-5, 2}, + {5, 2}, + {2, -5}, + {2, 5}, + {-5, -3}, + {5, -3}, + {-3, -5}, + {-3, 5}, + {-5, 3}, + {5, 3}, + {3, -5}, + {3, 5}, + {-5, -4}, + {5, -4}, + {-4, -5}, + {-4, 5}, + {-5, 4}, + {5, 4}, + {4, -5}, + {4, 5}, + {-5, -5}, + {5, -5}, + {-5, -5}, + {-5, 5}, + {99, 99}, + {0, -1}, + {1, 0}, + {0, 1}, + {-1, 0}, + {-1, -1}, + {1, -1}, + {-1, 1}, + {1, 1}, + {-2, -2}, + {-1, -2}, + {0, -2}, + {1, -2}, + {2, -2}, + {-2, -1}, + {2, -1}, + {-2, 0}, + {2, 0}, + {-2, 1}, + {2, 1}, + {-2, 2}, + {-1, 2}, + {0, 2}, + {1, 2}, + {2, 2}, + {0, 0}, + {99, 99}, + {0, 0}, + {0, -1}, + {1, 0}, + {0, 1}, + {-1, 0}, + {-1, -1}, + {1, -1}, + {-1, 1}, + {1, 1}, + {99, 99}, +}; + +static const DungeonPos gUnknown_80F4810[99] = { + {0, 1}, + {0, 2}, + {1, 2}, + {-1, 2}, + {0, 3}, + {1, 3}, + {-1, 3}, + {2, 3}, + {-2, 3}, + {0, 4}, + {1, 4}, + {-1, 4}, + {2, 4}, + {-2, 4}, + {3, 4}, + {-3, 4}, + {0, 5}, + {1, 5}, + {-1, 5}, + {2, 5}, + {-2, 5}, + {3, 5}, + {-3, 5}, + {4, 5}, + {-4, 5}, + {0, 6}, + {1, 6}, + {-1, 6}, + {2, 6}, + {-2, 6}, + {3, 6}, + {-3, 6}, + {4, 6}, + {-4, 6}, + {5, 6}, + {-5, 6}, + {0, 7}, + {1, 7}, + {-1, 7}, + {2, 7}, + {-2, 7}, + {3, 7}, + {-3, 7}, + {4, 7}, + {-4, 7}, + {5, 7}, + {-5, 7}, + {6, 7}, + {-6, 7}, + {0, 8}, + {1, 8}, + {-1, 8}, + {2, 8}, + {-2, 8}, + {3, 8}, + {-3, 8}, + {4, 8}, + {-4, 8}, + {5, 8}, + {-5, 8}, + {6, 8}, + {-6, 8}, + {7, 8}, + {-7, 8}, + {0, 9}, + {1, 9}, + {-1, 9}, + {2, 9}, + {-2, 9}, + {3, 9}, + {-3, 9}, + {4, 9}, + {-4, 9}, + {5, 9}, + {-5, 9}, + {6, 9}, + {-6, 9}, + {7, 9}, + {-7, 9}, + {8, 9}, + {-8, 9}, + {0, 10}, + {1, 10}, + {-1, 10}, + {2, 10}, + {-2, 10}, + {3, 10}, + {-3, 10}, + {4, 10}, + {-4, 10}, + {5, 10}, + {-5, 10}, + {6, 10}, + {-6, 10}, + {7, 10}, + {-7, 10}, + {8, 10}, + {-8, 10}, + {99, 99}, +}; + +static const DungeonPos gUnknown_80F499C[101] = { + {1, 0}, + {2, 0}, + {2, -1}, + {2, 1}, + {3, 0}, + {3, -1}, + {3, 1}, + {3, -2}, + {3, 2}, + {4, 0}, + {4, -1}, + {4, 1}, + {4, -2}, + {4, 2}, + {4, -3}, + {4, 3}, + {5, 0}, + {5, -1}, + {5, 1}, + {5, -2}, + {5, 2}, + {5, -3}, + {5, 3}, + {5, -4}, + {5, 4}, + {6, 0}, + {6, -1}, + {6, 1}, + {6, -2}, + {6, 2}, + {6, -3}, + {6, 3}, + {6, -4}, + {6, 4}, + {6, -5}, + {6, 5}, + {7, 0}, + {7, -1}, + {7, 1}, + {7, -2}, + {7, 2}, + {7, -3}, + {7, 3}, + {7, -4}, + {7, 4}, + {7, -5}, + {7, 5}, + {7, -6}, + {7, 6}, + {8, 0}, + {8, -1}, + {8, 1}, + {8, -2}, + {8, 2}, + {8, -3}, + {8, 3}, + {8, -4}, + {8, 4}, + {8, -5}, + {8, 5}, + {8, -6}, + {8, 6}, + {8, -7}, + {8, 7}, + {9, 0}, + {9, -1}, + {9, 1}, + {9, -2}, + {9, 2}, + {9, -3}, + {9, 3}, + {9, -4}, + {9, 4}, + {9, -5}, + {9, 5}, + {9, -6}, + {9, 6}, + {9, -7}, + {9, 7}, + {9, -8}, + {9, 8}, + {10, 0}, + {10, -1}, + {10, 1}, + {10, -2}, + {10, 2}, + {10, -3}, + {10, 3}, + {10, -4}, + {10, 4}, + {10, -5}, + {10, 5}, + {10, -6}, + {10, 6}, + {10, -7}, + {10, 7}, + {10, -8}, + {10, 8}, + {10, -9}, + {10, 9}, + {99, 99}, +}; + +static const DungeonPos gUnknown_80F4B30[101] = { + {1, 1}, + {2, 2}, + {2, 1}, + {1, 2}, + {3, 3}, + {3, 2}, + {2, 3}, + {3, 1}, + {1, 3}, + {4, 4}, + {4, 3}, + {3, 4}, + {4, 2}, + {2, 4}, + {4, 1}, + {1, 4}, + {5, 5}, + {5, 4}, + {4, 5}, + {5, 3}, + {3, 5}, + {5, 2}, + {2, 5}, + {5, 1}, + {1, 5}, + {6, 6}, + {6, 5}, + {5, 6}, + {6, 4}, + {4, 6}, + {6, 3}, + {3, 6}, + {6, 2}, + {2, 6}, + {6, 1}, + {1, 6}, + {7, 7}, + {7, 6}, + {6, 7}, + {7, 5}, + {5, 7}, + {7, 4}, + {4, 7}, + {7, 3}, + {3, 7}, + {7, 2}, + {2, 7}, + {7, 1}, + {1, 7}, + {8, 8}, + {8, 7}, + {7, 8}, + {8, 6}, + {6, 8}, + {8, 5}, + {5, 8}, + {8, 4}, + {4, 8}, + {8, 3}, + {3, 8}, + {8, 2}, + {2, 8}, + {8, 1}, + {1, 8}, + {9, 9}, + {9, 8}, + {8, 9}, + {9, 7}, + {7, 9}, + {9, 6}, + {6, 9}, + {9, 5}, + {5, 9}, + {9, 4}, + {4, 9}, + {9, 3}, + {3, 9}, + {9, 2}, + {2, 9}, + {9, 1}, + {1, 9}, + {10, 10}, + {10, 9}, + {9, 10}, + {10, 8}, + {8, 10}, + {10, 7}, + {7, 10}, + {10, 6}, + {6, 10}, + {10, 5}, + {5, 10}, + {10, 4}, + {4, 10}, + {10, 3}, + {3, 10}, + {10, 2}, + {2, 10}, + {10, 1}, + {1, 10}, + {99, 99}, +}; + +struct Struct80F4CC4 { + const DungeonPos *posArray; + s16 unk4; + s16 unk6; +}; + +const struct Struct80F4CC4 gUnknown_80F4CC4[] = { + {gUnknown_80F4810, 1, 1}, + {gUnknown_80F4B30, 1, 1}, + {gUnknown_80F499C, 1, 1}, + {gUnknown_80F4B30, 1, -1}, + {gUnknown_80F4810, -1, -1}, + {gUnknown_80F4B30, -1, -1}, + {gUnknown_80F499C, -1, -1}, + {gUnknown_80F4B30, -1, 1}, +}; + +const s32 gFaceDirectionIncrements[] = {0, 1, -1, 2, -2, 3, -3, 4, 0, -1, 1, -2, 2, -3, 3, 4}; + +const DungeonPos gUnknown_80F4D44[] = { + {0, 256}, + {256, 256}, + {256, 0}, + {256, -256}, + {0, -256}, + {-256, -256}, + {-256, 0}, + {-256, 256}, +}; + +const u8 gUnknown_80F4D64[] = {2, 6, 4, 0, 2, 0, 4, 6, 4, 0, 6, 2, 4, 2, 6, 0, 6, 2, 0, 4, 6, 4, 2, 0, 0, 4, 2, 6, 0, 6, 2, 4}; diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c index 2e0e1b18b..8ebdfd491 100644 --- a/src/dungeon_serializer.c +++ b/src/dungeon_serializer.c @@ -2,13 +2,11 @@ #include "globaldata.h" #include "structs/str_dungeon.h" #include "code_800F958.h" -#include "code_80450F8.h" -#include "code_8045A00.h" #include "code_805D8C8.h" #include "code_806CD90.h" #include "dungeon_items.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_serializer.h" #include "dungeon_util.h" #include "pokemon.h" diff --git a/src/dungeon_strings.c b/src/dungeon_strings.c new file mode 100644 index 000000000..2d4294605 --- /dev/null +++ b/src/dungeon_strings.c @@ -0,0 +1,1163 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_strings.h" + +// TODO: Give proper names to the strings +const ItemText gActions[] = { + [0] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, + [1] = { _("{POKEMON_0} threw\nthe {MOVE_ITEM_0}."), _("Throw")}, + [2] = { _("{POKEMON_0} threw\nthe {MOVE_ITEM_0}."), _("Throw")}, + [3] = { _("{POKEMON_0} equipped\nthe {MOVE_ITEM_0}."), _("Equip")}, + [4] = { _("{POKEMON_0} ate\nthe {MOVE_ITEM_0}."), _("Eat")}, + [5] = { _("{POKEMON_0} swallowed\nthe {MOVE_ITEM_0}."), _("Ingest")}, + [6] = { _("{POKEMON_0} peeled\nthe {MOVE_ITEM_0}."), _("Peel")}, + [7] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, + [8] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, + [9] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, + [10] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, + [11] = { _("{POKEMON_0} put on\nthe {MOVE_ITEM_0}."), _("Equip")}, + [12] = { _("{POKEMON_0} put on\nthe {MOVE_ITEM_0}."), _("Equip")}, + [13] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, + [14] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, + [15] = { _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."), _("Use")}, +}; + +const struct Struct_80F7C50 gUnknown_80F7C50[] = { + [0] = { _("???"), 0x0000000A}, + [1] = { _("Wait"), 0x0000000A}, + [2] = { _("Move"), 0x0000000A}, + [3] = { _("Move"), 0x0000000A}, + [4] = { _("Wait"), 0x0000000A}, + [5] = { _("Wait"), 0x0000000A}, + [6] = { _("Next"), 0x0000000A}, + [7] = { _("Prev."), 0x0000000A}, + [8] = { _("Place"), 0x0000000A}, + [9] = { _("Get"), 0x0000000A}, + [10] = { _("Switch"), 0x0000000A}, + [11] = { _("Throw"), 0x0000000A}, + [12] = { _("Info"), 0x0000005A}, + [13] = { _("X"), 0x0000000A}, + [14] = { _("X"), 0x0000000A}, + [15] = { _("X"), 0x0000000A}, + [16] = { _("X"), 0x0000000A}, + [17] = { _("X"), 0x0000000A}, + [18] = { _("X"), 0x0000000A}, + [19] = { _("Talk"), 0x0000000A}, + [20] = { _("Use"), 0x0000000A}, + [21] = { _("Use"), 0x0000000A}, + [22] = { _(""), 0x0000000A}, + [23] = { _("Struggle"), 0x0000000A}, + [24] = { _("$$$$"), 0x000003E7}, + [25] = { _("Moves"), 0x0000000A}, + [26] = { _("Tactics"), 0x0000000A}, + [27] = { _("Summary"), 0x0000000A}, + [28] = { _("Talk"), 0x0000000A}, + [29] = { _("Info"), 0x0000005A}, + [30] = { _("Set"), 0x0000000A}, + [31] = { _("Switch"), 0x0000000A}, + [32] = { _("Link"), 0x0000000A}, + [33] = { _("Delink"), 0x0000000A}, + [34] = { _("Forget"), 0x0000000A}, + [35] = { _("Use"), 0x0000000A}, + [36] = { _("Throw"), 0x0000000A}, + [37] = { _("Trigger"), 0x0000000A}, + [38] = { _("Proceed"), 0x0000000A}, + [39] = { _("Throw"), 0x00000005}, + [40] = { _("Switch"), 0x0000000A}, + [41] = { _("Farewell"), 0x0000000A}, + [42] = { _("Cancel"), 0x0000000A}, + [43] = { _("Quicksave"), 0x0000000A}, + [44] = { _("Use"), 0x0000000A}, + [45] = { _("Talk"), 0x0000000A}, + [46] = { _("Give Up"), 0x0000000A}, + [47] = { _("Switch"), 0x0000000A}, + [48] = { _("Check IQ"), 0x0000000A}, + [49] = { _("Use"), 0x0000000A}, + [50] = { _("Use"), 0x0000000A}, + [51] = { _("Deselect"), 0x0000000A}, + [52] = { _("Farewell"), 0x0000000A}, + [53] = { _("Use"), 0x0000000A}, + [54] = { _("Give"), 0x0000000A}, + [55] = { _("Take"), 0x0000000A}, + [56] = { _("Use"), 0x0000000A}, + [57] = { _(""), 0x0000000A}, + [58] = { _("Swap"), 0x0000000A}, + [59] = { _("Leader"), 0x0000000A}, + [60] = { _("Set"), 0x0000000A}, + [61] = { _("Deselect"), 0x0000000A}, + [62] = { _("Swap"), 0x0000000A}, + [63] = { _("Pick Up"), 0x0000000A}, + [64] = { _("Summary"), 0x0000000A}, + [65] = { _("Throw"), 0x00000005}, +}; + +const u8 *const gUnknown_80F7F70[] = { + [0] = _("Stairs leading to the next floor.\nIf you are on the final floor, you will\nescape from the dungeon."), + [1] = _("The warp zone leading to the next floor.\nIf you are on the final floor, you will\nescape from the dungeon."), + [2] = _("You reached the rescue spot where your\nfriend's team went down!\nSend an {color RED}A-OK Mail{reset} from the Pelipper Post\nOffice to let your friend know you've\nrescued the defeated team."), +}; + +const u8 *const gUnknown_80F8104[] = { + [0] = _("Stairs"), + [1] = _("Warp Zone"), + [2] = _("Rescue Spot"), +}; + +const u8 *const gTrapDescriptions[NUM_TRAPS] = { + [TRAP_TRIP_TRAP] = _("Stepping on this trap makes the Pokémon\ntrip and drop an item."), + [TRAP_MUD_TRAP] = _("Stepping on this trap makes it blow\nmud that lowers the Pokémon's {color YELLOW}Attack{reset},\n{color YELLOW}Defense{reset}, {color YELLOW}Special Attack{reset}, or\n{color YELLOW}Special Defense{reset} by one level."), + [TRAP_STICKY_TRAP] = _("Stepping on this trap makes a random\nitem become sticky and unusable."), + [TRAP_GRIMY_TRAP] = _("Stepping on this trap makes it spew\nmuck that gums up food."), + [TRAP_SUMMON_TRAP] = _("Stepping on this trap releases a sweet\naroma that attracts Pokémon from afar."), + [TRAP_PITFALL_TRAP] = _("Stepping on this trap drops the Pokémon\nto the next floor, inflicting damage.\nIf it's not the team leader, the Pokémon\nfaints. If that happens, even a Reviver\nSeed can't help the fainted Pokémon."), + [TRAP_WARP_TRAP] = _("Stepping on this trap instantly warps\nthe Pokémon to another spot on the floor."), + [TRAP_WHIRLWIND_TRAP] = _("Stepping on this trap triggers a blast\nof some sort that sends the Pokémon\nflying."), + [TRAP_SPIN_TRAP] = _("Stepping on this trap spins the Pokémon\naround dizzyingly, making it \n{color CYAN}confused{reset}."), + [TRAP_SLUMBER_TRAP] = _("Stepping on this trap releases a sleeping\ngas that puts the Pokémon to\n{color CYAN}sleep{reset}."), + [TRAP_SLOW_TRAP] = _("Stepping on this trap lowers the\nPokémon's {color YELLOW}Movement Speed{reset} by one level."), + [TRAP_SEAL_TRAP] = _("Stepping on this trap disables one\nof the Pokémon's moves as long\nas it remains on the same floor."), + [TRAP_POISON_TRAP] = _("Stepping on this trap looses poison\nspikes that leave the Pokémon {color CYAN}poisoned{reset}."), + [TRAP_SELFDESTRUCT_TRAP] = _("Stepping on this trap makes it {color CYAN}explode{reset}.\nIts damage extends to other Pokémon,\nitems, and walls around the trap."), + [TRAP_EXPLOSION_TRAP] = _("Stepping on this trap triggers a\n{color CYAN}huge explosion{reset}.\nIts damage extends to other Pokémon,\nitems, and walls. It has a bigger\nrange than a Selfdestruct Trap."), + [TRAP_PP_ZERO_TRAP] = _("Stepping on this trap completely drains\nthe {color YELLOW}PP{reset} of a random move."), + [TRAP_CHESTNUT_TRAP] = _("Stepping on this trap makes a spiky,\nunshelled Chestnut drop, inflicting\ndamage."), + [TRAP_WONDER_TILE] = _("An odd floor tile seen in many dungeons.\nStepping on it resets the Pokémon's\n{color YELLOW}Attack{reset}, {color YELLOW}Defense{reset}, and so on, if\nthey are boosted or reduced."), + [TRAP_POKEMON_TRAP] = _("Stepping on this trap transforms all\nitems in the room into hostile Pokémon."), + [TRAP_SPIKE_TRAP] = _("Stepping on this trap inflicts damage.\nIt can be made using the move {color YELLOW}Spikes{reset}."), +}; + +const u8 *const gUnknown_80F8968 = _("{color YELLOW}Decoy{reset}"); +const u8 *const gUnknown_80F8974 = _("Decoy"); +const u8 *const gUnknown_80F8988 = _("{color YELLOW}Pokémon{reset}"); +const u8 *const gUnknown_80F8994 = _("Pokémon"); +const u8 *const gUnknown_80F89B4 = _("Your partner {POKEMON_0} fainted!"); +const u8 *const gUnknown_80F89D4 = _("Your client {POKEMON_0} fainted!"); +const u8 *const gUnknown_80F89D8 = _("Your client {POKEMON_0} fainted!"); +const u8 *const gUnknown_80F89F4 = _("But nothing happened!"); +const u8 *const gUnknown_80F8A0C = _("{POKEMON_0} was blown away!"); +const u8 *const gUnknown_80F8A28 = _("No move has been set."); +const u8 *const gUnknown_80F8A4C = _("The set move can't be used."); +const u8 *const gUnknown_80F8A6C = _("You're being constricted!"); +const u8 *const gUnknown_80F8A84 = _("You can't move!"); +const u8 *const gUnknown_80F8AB0 = _("You can't move while you're rooted!"); +const u8 *const gUnknown_80F8ADC = _("You can't move while wrapping a foe!"); +const u8 *const gUnknown_80F8B0C = _("The foe has you wrapped! You can't move!"); +const u8 *const gUnknown_80F8B24 = _("There are no items."); +const u8 *const gUnknown_80F8B40 = _("The move {MOVE_ITEM_0} was set."); +const u8 *const gUnknown_80F8B64 = _("The move {MOVE_ITEM_0} was deselected."); +const u8 *const gUnknown_80F8B68 = _(""); +const u8 *const gUnknown_80F8B88 = _("The move {MOVE_ITEM_0} was delinked."); +const u8 *const gUnknown_80F8BB4 = _("The linked moves were left unchanged."); +const u8 *const gUnknown_80F8BE0 = _("It's all sticky and doesn't work!"); +const u8 *const gUnknown_80F8BE4 = _("The {MOVE_ITEM_1} is all sticky!\nIt doesn't work!"); +const u8 *const gItemStickyCannotMove1 = _("The {MOVE_ITEM_1} is all sticky!\nIt can't be moved."); +const u8 *const gItemStickyCannotMove2 = _("The {MOVE_ITEM_1} is all sticky!\nIt can't be moved."); +const u8 *const gItemStickyCannotMove3 = _("The {MOVE_ITEM_1} is all sticky!\nIt can't be moved."); +const u8 *const gItemStickyCannotEquip = _("The {MOVE_ITEM_0} is all sticky!\nIt can't be equipped."); +const u8 *const gMonTookAndReturnedItem = _("{POKEMON_1} took the {MOVE_ITEM_0}\nand returned the {MOVE_ITEM_1}."); +const u8 *const gUnknown_80F8CE4 = _("The {MOVE_ITEM_0} was set.\nHold {L_BUTTON} then press {R_BUTTON} to throw one."); +const u8 *const gUnknown_80F8CE8 = _("The {MOVE_ITEM_0} was set.\nHold {L_BUTTON} then press {R_BUTTON} to throw one."); +const u8 *const gUnknown_80F8D04 = _("Equipped the item {MOVE_ITEM_0}."); +const u8 *const gUnknown_80F8D20 = _("The {MOVE_ITEM_0} was deselected."); +const u8 *const gUnknown_80F8D44 = _("The item {MOVE_ITEM_0} was given\nto {POKEMON_1}."); +const u8 *const gUnknown_80F8D60 = _("The Toolbox is full."); +const u8 *const gUnknown_80F8D7C = _("{POKEMON_0} returned\nthe {MOVE_ITEM_0}."); +const u8 *const gUnknown_80F8DB4 = _("The {MOVE_ITEM_0} was exchanged for\nthe {MOVE_ITEM_1} in the Toolbox."); +const u8 *const gUnknown_80F8DB8 = _("{POKEMON_1} used the {MOVE_ITEM_0}\nit was holding!"); +const u8 *const gUnknown_80F8DE0 = _(""); +const u8 *const gUnknown_80F8E04 = _("It can't be put down here."); +const u8 *const gUnknown_80F8E28 = _("{POKEMON_0} put the {MOVE_ITEM_0}\non the ground."); +const u8 *const gUnknown_80F8E2C = _(""); +const u8 *const gNoExchangesHere = _("Items can't be exchanged here."); +const u8 *const gNothingCanBePutDownHere = _("Nothing can be put down here."); +const u8 *const gSwappedGroundItem = _("Exchanged the {MOVE_ITEM_1} on the\nground with the {MOVE_ITEM_0}."); +const u8 *const gMonThrewItem1 = _("{POKEMON_0} threw the {MOVE_ITEM_0}!"); +const u8 *const gMonThrewItem2 = _("{POKEMON_0} threw the {MOVE_ITEM_0}!"); +const u8 *const gCannotTalk = _("You can't talk now."); +const u8 *const gCannotFarewell = _("You can't say farewell now."); +const u8 *const gMonCringing = _("{POKEMON_0} is cringing!"); +const u8 *const gMonParalyzed = _("{POKEMON_0} is paralyzed!"); +const u8 *const gMonSteppedOnItem = _("{POKEMON_0} stepped on\nthe {MOVE_ITEM_0}."); +const u8 *const gMonTerrifiedCouldntPickUpItem = _("{POKEMON_0} is terrified.\nIt didn't pick up the {MOVE_ITEM_0}."); +const u8 *const gMonCouldntPickUpItem = _("{POKEMON_0} couldn't pick up\nthe {MOVE_ITEM_0}."); +const u8 *const gPickedUpItem2 = _("Picked up the {MOVE_ITEM_0}."); +const u8 *const gPickedUpItemToolbox = _("Picked up the {MOVE_ITEM_0} and\nput it in the Toolbox."); +const u8 *const gPickedUpItem = _("Picked up the {MOVE_ITEM_0}."); +const u8 *const gMonPickedUpItem2 = _("{POKEMON_0} picked up\nthe {MOVE_ITEM_0}."); +const u8 *const gMonPickedUpItemToolbox = _("{POKEMON_0} picked up the\n{MOVE_ITEM_0} and put it in the Toolbox."); +const u8 *const gMonPickedUpItem = _("{POKEMON_0} picked up\nthe {MOVE_ITEM_0}."); +const u8 *const gSayFarewellQ = _("Say farewell to {POKEMON_0}?\nIt will be gone from the team forever."); +const u8 *const gSendMonBackWithItemQ = _("Send {POKEMON_0} back?\n{POKEMON_0}'s hold item will be lost."); +const u8 *const gSendMonBackQ = _("Send {POKEMON_0} back?"); +const u8 *const gUnknown_80F9114 = _("Say farewell to {POKEMON_0} and dismiss\nit from the team?"); +const u8 *const gUnknown_80F913C = _("{POKEMON_0} seemed disappointed and left."); +const u8 *const gMonWentBack = _("{POKEMON_0} went back."); +const u8 *const gMonDisappointedAndLeft = _("{POKEMON_0} seemed disappointed and left."); +const u8 *const gUnknown_80F9158 = _("{POKEMON_0} used\nthe {MOVE_ITEM_0}."); +const u8 *const gUnknown_80F9174 = _("$-Belly:{UNK_MACRO_3E M3E_147}{VALUE_0}/{VALUE_1}"); +const u8 *const gUnknown_80F9190 = _("Money:{UNK_MACRO_3E M3E_147}{VALUE_0} {POKE}"); +const u8 *const gUnknown_80F91A8 = _("Weather:{UNK_MACRO_3E M3E_159}{POKEMON_0}"); +const u8 *const gUnknown_80F91C8 = _("Play:{UNK_MACRO_3E M3E_147}{VALUE_0}:$V12:$V22"); +const u8 *const gUnknown_80F91E0 = _("{POKEMON_0}{UNK_MACRO_3E M3E_66}$v03/$v13"); +const u8 *const gUnknown_80F91EC = _("Rescue"); +const u8 *const gTrapNames[NUM_TRAPS] = { + [TRAP_TRIP_TRAP] = _("Trip Trap"), + [TRAP_MUD_TRAP] = _("Mud Trap"), + [TRAP_STICKY_TRAP] = _("Sticky Trap"), + [TRAP_GRIMY_TRAP] = _("Grimy Trap"), + [TRAP_SUMMON_TRAP] = _("Summon Trap"), + [TRAP_PITFALL_TRAP] = _("Pitfall Trap"), + [TRAP_WARP_TRAP] = _("Warp Trap"), + [TRAP_WHIRLWIND_TRAP] = _("Gust Trap"), + [TRAP_SPIN_TRAP] = _("Spin Trap"), + [TRAP_SLUMBER_TRAP] = _("Slumber Trap"), + [TRAP_SLOW_TRAP] = _("Slow Trap"), + [TRAP_SEAL_TRAP] = _("Seal Trap"), + [TRAP_POISON_TRAP] = _("Poison Trap"), + [TRAP_SELFDESTRUCT_TRAP] = _("Selfdestruct Trap"), + [TRAP_EXPLOSION_TRAP] = _("Explosion Trap"), + [TRAP_PP_ZERO_TRAP] = _("PP-Zero Trap"), + [TRAP_CHESTNUT_TRAP] = _("Chestnut Trap"), + [TRAP_WONDER_TILE] = _("Wonder Tile"), + [TRAP_POKEMON_TRAP] = _("Pokémon Trap"), + [TRAP_SPIKE_TRAP] = _("Spiked Tile"), +}; + +const u8 *const gUnknown_80F9364 = _("{POKEMON_1} is unaffected!"); +const u8 *const gUnknown_80F9380 = _("The move missed {POKEMON_1}!"); +const u8 *const gUnknown_80F9384 = _("The move missed {POKEMON_1}!"); +const u8 *const gUnknown_80F93A4 = _("It had no effect on {POKEMON_1}!"); +const u8 *const gUnknown_80F93C8 = _("The move {MOVE_ITEM_0} can't be used!"); +const u8 *const gItemFellOnGround = _("The {MOVE_ITEM_0} fell on the ground."); +const u8 *const gItemFellInWater = _("The {MOVE_ITEM_0} fell in the water."); +const u8 *const gItemBuried = _("The {MOVE_ITEM_0} became buried."); +const u8 *const gItemLost = _("The {MOVE_ITEM_0} was lost!"); +const u8 *const gAllItemsLost = _("All the items were lost!"); +const u8 *const gSeveralItemsLost = _("Several items were lost!"); +const u8 *const gItemFellOutOfSight = _("The {MOVE_ITEM_0} fell out of sight!"); +const u8 *const gUnknown_80F94C4 = _("The {MOVE_ITEM_0} went flying\ntowards {POKEMON_0}!"); +const u8 *const gUnknown_80F94D8 = _("It missed {POKEMON_0}!"); +const u8 *const gUnknown_80F94F0 = _("{POKEMON_0} dodged the {MOVE_ITEM_0}!"); +const u8 *const gUnknown_80F9510 = _("The {MOVE_ITEM_0} bounced off\n{POKEMON_0}!"); +const u8 *const gUnknown_80F9530 = _("The {MOVE_ITEM_0} flew out of sight!"); +const u8 *const gPtrFrozenMessage = _("{POKEMON_0} is frozen solid!"); +const u8 *const gPtrWrappedAroundMessage = _("{POKEMON_0} has its foe wrapped!"); +const u8 *const gPtrWrappedByMessage = _("{POKEMON_0} is wrapped by its foe!"); +const u8 *const gPtrPausedMessage = _("{POKEMON_0} can't move!"); +const u8 *const gPtrInfatuatedMessage = _("{POKEMON_0} is infatuated!"); +const u8 *const gPtrBideMessage = _("{POKEMON_0} is storing energy!"); +const u8 *const gUnknown_80F95EC = _("{POKEMON_0} is asleep!"); +const u8 *const gUnknown_80F9600 = _("{POKEMON_1} is frozen!"); +const u8 *const gUnknown_80F9614 = _("A critical hit!"); +const u8 *const gUnknown_80F9630 = _("It has little effect..."); +const u8 *const gUnknown_80F9654 = _("It's not very effective..."); +const u8 *const gUnknown_80F9670 = _("It's super effective!"); +const u8 *const gUnknown_80F9688 = _("{POKEMON_1} took no damage!"); +const u8 *const gUnknown_80F96A8 = _("{POKEMON_1} took calamitous damage!"); +const u8 *const gUnknown_80F96BC = _("{POKEMON_0} exploded!"); +const u8 *const gUnknown_80F96EC = _("The damp conditions prevented\nan explosion!"); +const u8 *const gUnknown_80F970C = _("{POKEMON_0} fell into the pitfall!"); +const u8 *const gUnknown_80F9728 = _("Avoided the pitfall!"); +const u8 *const gUnknown_80F9740 = _("{POKEMON_0} is famished."); +const u8 *const gUnknown_80F9760 = _("{POKEMON_0} is already famished."); +const u8 *const gUnknown_80F9764[] = { + [0] = _("{POKEMON_1} took {VALUE_0} damage!"), + [1] = _("{POKEMON_1}'s burn inflicted\n{VALUE_0} damage!"), + [2] = _("{POKEMON_1} was squeezed for\n{VALUE_0} damage!"), + [3] = _("{POKEMON_1} took {VALUE_0} damage\nfrom poison!"), + [4] = _("{POKEMON_1} took {VALUE_0} damage!"), + [5] = _("{POKEMON_1} was wrapped for\n{VALUE_0} damage!"), + [6] = _("{POKEMON_1} took {VALUE_0} damage\nfrom the counterattack!"), + [7] = _("{POKEMON_1} was cursed for\n{VALUE_0} damage!"), + [8] = _("{POKEMON_1} awoke from its nightmare\nand took {VALUE_0} damage!"), + [9] = _("{POKEMON_1} took {VALUE_0} damage\nfrom Leech Seed!"), + [10] = _("{POKEMON_1} stepped on spikes for\n{VALUE_0} damage!"), + [11] = _("{POKEMON_1} took {VALUE_0} damage\nfrom Perish Song!"), + [12] = _("{POKEMON_1} took {VALUE_0} damage\nfrom Destiny Bond!"), + [13] = _("{POKEMON_1} was showered with sludge\nfor {VALUE_0} damage!"), + [14] = NULL, + [15] = _("The Chestnut Trap hit {POKEMON_1}\nfor {VALUE_0} damage!"), + [16] = _("The Chestnut Trap hit {POKEMON_1}\nfor {VALUE_0} damage!"), + [17] = _("{POKEMON_1} took {VALUE_0} damage!"), + [18] = _("The bad weather inflicted {VALUE_0} damage\non {POKEMON_1}!"), + [19] = _("The move failed!\n{POKEMON_1} took {VALUE_0} damage!"), + [20] = _("The recoil hit {POKEMON_1} for\n{VALUE_0} damage!"), +}; + +const u8 *const gWeatherNames[WEATHER_COUNT] = { + [WEATHER_CLEAR] = _("Clear"), + [WEATHER_SUNNY] = _("Sunny"), + [WEATHER_SANDSTORM] = _("Sandstorm"), + [WEATHER_CLOUDY] = _("Cloudy"), + [WEATHER_RAIN] = _("Rain"), + [WEATHER_HAIL] = _("Hail"), + [WEATHER_FOG] = _("Fog"), + [WEATHER_SNOW] = _("Snow"), +}; + +const u8 *const gUnknown_80F9ACC = _("{POKEMON_0}'s HP went up {VALUE_0}!"); +const u8 *const gUnknown_80F9AEC = _("{POKEMON_0}'s Attack went up {VALUE_1}!"); +const u8 *const gUnknown_80F9B10 = _("{POKEMON_0}'s Defense went up {VALUE_2}!"); +const u8 *const gUnknown_80F9B34 = _("{POKEMON_0}'s Sp. Atk. went up {VALUE_3}!"); +const u8 *const gUnknown_80F9B58 = _("{POKEMON_0}'s Sp. Def. went up $d4!"); +const u8 *const gUnknown_80F9B74 = _("{POKEMON_0} didn't level up."); +const u8 *const gUnknown_80F9B94 = _("{POKEMON_0} didn't level down."); +const u8 *const gUnknown_80F9BB0 = _("{POKEMON_0} became the leader!"); +const u8 *const gUnknown_80F9BD8 = _("The leader couldn't be switched!"); +const u8 *const gUnknown_80F9C08 = _("You haven't paid for the merchandise yet!"); +const u8 *const gUnknown_80F9C2C = _("A thief can't switch leaders!"); +const u8 *const gUnknown_80F9C4C = _("...Something's stirring."); +const u8 *const gUnknown_80F9C70 = _("...Something's approaching."); +const u8 *const gUnknown_80F9C8C = _("It's getting closer!"); +const u8 *const gUnknown_80F9CBC = _("It's right nearby! It's gusting hard!"); +const u8 *const gUnknown_80F9CC0[] = { + [0] = _("{POKEMON_1} was defeated!"), + [1] = _("{POKEMON_1} fainted!"), +}; + +const u8 *const gUnknown_80F9CEC[] = { + [0] = _("Oh, no! {POKEMON_1} was defeated!"), + [1] = _("Oh, no! {POKEMON_1} fainted!"), +}; + +const u8 *const gUnknown_80F9D28[] = { + [0] = _("{POKEMON_1} was defeated!\nIt left the rescue team!"), + [1] = _("{POKEMON_1} fainted!\nIt left the rescue team!"), +}; + +const u8 *const gUnknown_80F9D84[] = { + [0] = _("Oh, no! {POKEMON_1} was defeated!"), + [1] = _("Oh, no! {POKEMON_1} fainted!"), +}; + +const u8 *const gUnknown_80F9D8C[] = { + [0] = _("{POKEMON_1} went back for now!"), + [1] = _("Oh, no! {POKEMON_1} fainted!"), +}; + +const u8 *const gUnknown_80F9DAC[] = { + [0] = _("Your client {POKEMON_1} was defeated!"), + [1] = _("Your client {POKEMON_1} fainted!"), +}; + +const u8 *const gUnknown_80F9DF0[] = { + [0] = _("{POKEMON_1} was defeated while awaiting\nrescue!"), + [1] = _("{POKEMON_1} fainted while awaiting\nrescue!"), +}; + +const u8 *const gUnknown_80F9E44 = _("{POKEMON_1} fainted!"); +const u8 *const gUnknown_80F9E64 = _("{POKEMON_0} gained {VALUE_0} Exp. Points!"); +const u8 *const gUnknown_80F9E80 = _("{POKEMON_0} grew to Level {VALUE_0}!"); +const u8 *const gUnknown_80F9E84 = _("{POKEMON_0}'s level remained unchanged."); +const u8 *const gUnknown_80F9EC8 = _("{POKEMON_0} dropped to Level {VALUE_0}!"); +const u8 *const gUnknown_80F9EEC = _("{POKEMON_0}'s level didn't go down."); +const u8 *const gUnknown_80F9F04 = _("{POKEMON_0} learned {MOVE_ITEM_0}!"); +const u8 *const gUnknown_80F9F2C = _("{POKEMON_0} didn't learn the new move."); +const u8 *const gUnknown_80F9FA4 = _("This Pokémon learned a new move,\nso it must forget an old one. Moves can\nbe relearned at the Gulpin Link Shop."); +const u8 *const gUnknown_80F9FE8 = _("Yes! {POKEMON_0} wants to join the team!\nAccept {POKEMON_0} as a team member?"); +const u8 *const gUnknown_80F9FEC = _(""); +const u8 *const gUnknown_80FA004 = _("{POKEMON_0} went away..."); +const u8 *const gUnknown_80FA030 = _("The Pokémon couldn't join the team..."); +const u8 *const gUnknown_80FA058 = _("But it couldn't join the team."); +const u8 *const gUnknown_80FA090 = _("A new member joined the team!\nGive it a nickname?"); +const u8 *const gUnknown_80FA0C8 = _("Please give your new team member\na proper nickname!"); +const u8 *const gUnknown_80FA0F0 = _("{POKEMON_0} joined $t to\ngo on adventures!"); +const u8 *const gUnknown_80FA120 = _("{POKEMON_0} gained access to\nthe Friend Area {FRIEND_AREA}."); +const u8 *const gUnknown_80FA124[] = { + [0] = _("{POKEMON_0} was slowed!"), + [1] = _("{POKEMON_0} returned to normal speed!"), + [2] = _("{POKEMON_0}'s at double speed!"), + [3] = _("{POKEMON_0}'s at triple speed!"), + [4] = _("{POKEMON_0}'s at quadruple speed!"), +}; + +const u8 *const gUnknown_80FA260 = _("The Rescue Team Badge\nshone on {POKEMON_1}!\n{POKEMON_1} gained a magical power!\n{POKEMON_1}: Thank you!\nPlease come see me at the Pelipper\nPost Office later.\n{POKEMON_1} escaped from the dungeon!"); +const u8 *const gUnknown_80FA2B0 = _("{POKEMON_1} happily accepted the item!\n\n\n{POKEMON_1}: Thank you!\n\n\n{POKEMON_1} left the dungeon!\n\n"); +const u8 *const gUnknown_80FA2F0 = _("Yes! {POKEMON_1} was found!\nUse the Rescue Team Badge to save\n{POKEMON_1}?"); +const u8 *const gUnknown_80FA32C = _("Yes! {POKEMON_1} was found!\nDeliver the requested item to\n{POKEMON_1}?"); +const u8 *const gUnknown_80FA36C = _("A mission has been completed!\nWould you like to leave now?"); +const u8 *const gUnknown_80FA370 = _("A mission has been completed!\nWould you like to leave now?"); +const u8 *const gUnknown_80FA394 = _("Do you really want to leave?"); +const u8 *const gUnknown_80FA3B8 = _("Continue with your adventure?"); +const u8 *const gUnknown_80FA408 = _("You're holding a delivery item.\nReturn to the base without continuing?"); +const u8 *const gUnknown_80FA448 = _("The {MOVE_ITEM_0} isn't in the Toolbox.\nIt couldn't be delivered."); +const u8 *const gUnknown_80FA464 = _("{POKEMON_1} can't talk now."); +const u8 *const gUnknown_80FA4D4 = _("Yes! {POKEMON_2} was successfully\nescorted!\n{POKEMON_2} is delighted!\n{POKEMON_2}: Thank you!\n\n\n{POKEMON_2}'s twosome left the dungeon!\n\n"); +const u8 *const gUnknown_80FA4D8 = _("A mission has been completed!\nWould you like to leave now?"); +const u8 *const gUnknown_80FA500 = _("{POKEMON_2} doesn't seem to be around."); +const u8 *const gUnknown_80FA52C = _("The mission can no longer be completed!"); +const u8 *const gUnknown_80FA530 = _("{POKEMON_1} can't talk now."); +const u8 *const gUnknown_80FA54C = _("{POKEMON_2} can't talk now."); +const u8 *const gUnknown_80FA580 = _("Deoxys was a mirage!\nA set of stairs appeared!"); +const u8 *const gUnknown_80FA5B4 = _("It's impossible to go down the stairs\nnow!"); +const u8 *const gUnknown_80FA5B8 = _(""); +const u8 *const gUnknown_80FA5F4 = _("No Pokémon will join the rescue team\nin this dungeon."); +const u8 *const gUnknown_80FA61C = _("There are no potential recruits."); +const u8 *const gUnknown_80FA638 = _("{POKEMON_0}'s Reflect faded."); +const u8 *const gUnknown_80FA658 = _("{POKEMON_0}'s Light Screen faded."); +const u8 *const gUnknown_80FA67C = _("{POKEMON_0}'s Counter effect faded."); +const u8 *const gUnknown_80FA69C = _("{POKEMON_0}'s Safeguard faded."); +const u8 *const gUnknown_80FA6BC = _("{POKEMON_0}'s Magic Coat faded."); +const u8 *const gUnknown_80FA6D4 = _("{POKEMON_0}'s Wish faded."); +const u8 *const gUnknown_80FA6E8 = _("{POKEMON_0} woke up!"); +const u8 *const gUnknown_80FA708 = _("{POKEMON_0} is no longer sleepless!"); +const u8 *const gUnknown_80FA70C = _("{POKEMON_0} woke up!"); +const u8 *const gUnknown_80FA710 = _("{POKEMON_0} woke up!"); +const u8 *const gUnknown_80FA734 = _("{POKEMON_0} got over its drowsiness!"); +const u8 *const gUnknown_80FA758 = _("Water Sport's effect faded."); +const u8 *const gUnknown_80FA778 = _("Mud Sport's effect faded."); +const u8 *const gUnknown_80FA79C = _("{POKEMON_0}'s Leech Seed wore off."); +const u8 *const gUnknown_80FA7BC = _("{POKEMON_0} is no longer cursed!"); +const u8 *const gUnknown_80FA7DC = _("{POKEMON_0}'s Snatch wore off!"); +const u8 *const gUnknown_80FA800 = _("{POKEMON_0} recovered from confusion!"); +const u8 *const gUnknown_80FA81C = _("{POKEMON_0} regained mobility!"); +const u8 *const gUnknown_80FA820 = _("{POKEMON_0} regained mobility!"); +const u8 *const gUnknown_80FA824 = _("{POKEMON_0} regained mobility!"); +const u8 *const gUnknown_80FA844 = _("{POKEMON_0}'s Ingrain wore off!"); +const u8 *const gUnknown_80FA868 = _("{POKEMON_0} recovered from paralysis!"); +const u8 *const gUnknown_80FA888 = _("{POKEMON_0} recovered from a burn!"); +const u8 *const gUnknown_80FA8A8 = _("{POKEMON_0} recovered from poison!"); +const u8 *const gUnknown_80FA8BC = _("{POKEMON_0} thawed out!"); +const u8 *const gUnknown_80FA8E0 = _("{POKEMON_0} lost its Sure Shot status!"); +const u8 *const gUnknown_80FA90C = _("{POKEMON_0} recovered from its\nWhiffer status!"); +const u8 *const gUnknown_80FA934 = _("{POKEMON_0}'s damage returned to normal!"); +const u8 *const gUnknown_80FA95C = _("{POKEMON_0} lost its Focus Energy status!"); +const u8 *const gUnknown_80FA97C = _("{POKEMON_0} is no longer cowering!"); +const u8 *const gUnknown_80FA9A0 = _("The decoy Pokémon went away!"); +const u8 *const gUnknown_80FA9C0 = _("{POKEMON_0}'s Protect wore off!"); +const u8 *const gUnknown_80FA9DC = _("{POKEMON_0}'s Taunt wore off!"); +const u8 *const gUnknown_80FA9F4 = _("{POKEMON_0} became visible!"); +const u8 *const gUnknown_80FAA0C = _("{POKEMON_0} regained sight!"); +const u8 *const gUnknown_80FAA2C = _("{POKEMON_0} can see normally again!"); +const u8 *const gUnknown_80FAA48 = _("{POKEMON_0} returned to normal!"); +const u8 *const gUnknown_80FAA68 = _("{POKEMON_0}'s Mirror Coat faded!"); +const u8 *const gUnknown_80FAA8C = _("{POKEMON_0} gave up on Destiny Bond!"); +const u8 *const gUnknown_80FAAAC = _("{POKEMON_0} recovered from Encore!"); +const u8 *const gPtrMonStoppedEnduringMessage = _("{POKEMON_0} stopped enduring!"); +const u8 *const gPtrMonMirrorMoveFadedMessage = _("{POKEMON_0}'s Mirror Move faded!"); +const u8 *const gPtrMonConversion2FailedMessage = _("{POKEMON_0}'s Conversion 2 faded!"); +const u8 *const gPtrMonGaveUpVitalThrowMessage = _("{POKEMON_0} gave up on Vital Throw!"); +const u8 *const gUnknown_80FAB40 = _("{POKEMON_0}'s Mist faded!"); +const u8 *const gUnknown_80FAB6C = _("{POKEMON_0}'s appearance returned to\nnormal!"); +const u8 *const gUnknown_80FAB90 = _("{POKEMON_0} got over its infatuation!"); +const u8 *const gUnknown_80FABBC = _("{POKEMON_0} can't go through walls\nanymore!"); +const u8 *const gUnknown_80FABC0 = _("{POKEMON_0} returned to normal!"); +const u8 *const gUnknown_80FABD8 = _("{POKEMON_0}'s rage faded!"); +const u8 *const gPtrMonNoLongerPetrifiedMessage = _("{POKEMON_0} is no longer petrified!"); +const u8 *const gPtrMonNoLongerCringingMessage = _("{POKEMON_0} is no longer cringing!"); +const u8 *const gUnknown_80FAC38 = _("{POKEMON_0} is no longer paused!"); +const u8 *const gUnknown_80FAC54 = _("{POKEMON_0} readies Razor Wind!"); +const u8 *const gUnknown_80FAC74 = _("{POKEMON_0} began storing energy!"); +const u8 *const gUnknown_80FAC88 = _("{POKEMON_0} is enraged!"); +const u8 *const gUnknown_80FACA4 = _("{POKEMON_0} is focusing energy!"); +const u8 *const gUnknown_80FACC4 = _("{POKEMON_0} is readying Sky Attack!"); +const u8 *const gUnknown_80FACE4 = _("{POKEMON_0} is readying Solarbeam!"); +const u8 *const gUnknown_80FACFC = _("{POKEMON_0} flew up high!"); +const u8 *const gUnknown_80FAD10 = _("{POKEMON_0} bounced up!"); +const u8 *const gUnknown_80FAD2C = _("{POKEMON_0} dove underwater!"); +const u8 *const gUnknown_80FAD4C = _("{POKEMON_0} burrowed underground!"); +const u8 *const gUnknown_80FAD6C = _("{POKEMON_0} began charging power!"); +const u8 *const gUnknown_80FAD8C = _("Mud Sport came into effect!"); +const u8 *const gUnknown_80FADB0 = _("Water Sport came into effect!"); +const u8 *const gUnknown_80FADD8 = _("{POKEMON_1} used Flash Fire to absorb\nfire!"); +const u8 *const gUnknown_80FAE00 = _("Fire moves won't become stronger!"); +const u8 *const gUnknown_80FAE1C = _("{POKEMON_0} began using Wish!"); +const u8 *const gUnknown_80FAE3C = _("{POKEMON_0} is already using Wish."); +const u8 *const gUnknown_80FAE58 = _("{POKEMON_0} took a leech seed!"); +const u8 *const gUnknown_80FAE7C = _("{POKEMON_0} already has a leech seed!"); +const u8 *const gUnknown_80FAEA0 = _("Item locations became evident!"); +const u8 *const gUnknown_80FAEC8 = _("The stair location became clear!"); +const u8 *const gUnknown_80FAEF0 = _("Item locations are already known."); +const u8 *const gUnknown_80FAF1C = _("The stair location is already known."); +const u8 *const gUnknown_80FAF3C = _("There are no stairs here."); +const u8 *const gUnknown_80FAF5C = _("{POKEMON_0} put up its magic coat!"); +const u8 *const gUnknown_80FAF8C = _("{POKEMON_0} is already cloaked in its\nmagic coat!"); +const u8 *const gUnknown_80FAFAC = _("{POKEMON_0} can locate foes now!"); +const u8 *const gUnknown_80FAFD0 = _("Foes can already be located!"); +const u8 *const gUnknown_80FAFF0 = _("{POKEMON_0} readies its Skull Bash!"); +const u8 *const gUnknown_80FB004 = _("{POKEMON_0} was cursed!"); +const u8 *const gUnknown_80FB01C = _("{POKEMON_0} readied Snatch!"); +const u8 *const gUnknown_80FB048 = _("{POKEMON_0} gained the protection\nof Safeguard!"); +const u8 *const gUnknown_80FB074 = _("{POKEMON_0} is already protected\nby Safeguard."); +const u8 *const gUnknown_80FB09C = _("{POKEMON_0} gained the protection\nof Mist!"); +const u8 *const gUnknown_80FB0C4 = _("{POKEMON_0} is already protected\nby Mist."); +const u8 *const gUnknown_80FB0E0 = _("{POKEMON_0} is set to counter!"); +const u8 *const gUnknown_80FB10C = _("{POKEMON_0} has been waiting to\ncounterattack!"); +const u8 *const gUnknown_80FB130 = _("{POKEMON_0} put up its light screen!"); +const u8 *const gUnknown_80FB160 = _("{POKEMON_0} is already protected\nby Light Screen."); +const u8 *const gUnknown_80FB17C = _("{POKEMON_0} put up its reflect!"); +const u8 *const gUnknown_80FB1A8 = _("{POKEMON_0} is already protected by\nReflect."); +const u8 *const gUnknown_80FB1C4 = _("{POKEMON_0} recovered {VALUE_0} HP!"); +const u8 *const gUnknown_80FB1E0 = _("{POKEMON_0} was fully healed!"); +const u8 *const gUnknown_80FB204 = _("{POKEMON_0}'s HP remained unchanged."); +const u8 *const gUnknown_80FB21C = _("{POKEMON_0} has full HP."); +const u8 *const gUnknown_80FB240 = _("{POKEMON_0}'s max. HP rose by {VALUE_1}."); +const u8 *const gUnknown_80FB25C = _("{POKEMON_0} became confused!"); +const u8 *const gUnknown_80FB27C = _("{POKEMON_0} is already confused!"); +const u8 *const gUnknown_80FB2AC = _("{POKEMON_0} became paralyzed!\nIt can't attack!"); +const u8 *const gUnknown_80FB2CC = _("{POKEMON_0} is already paralyzed!"); +const u8 *const gUnknown_80FB2E0 = _("{POKEMON_0} cringed!"); +const u8 *const gUnknown_80FB300 = _("{POKEMON_0} is already cringing!"); +const u8 *const gUnknown_80FB318 = _("{POKEMON_0} fell asleep!"); +const u8 *const gUnknown_80FB31C = _("{POKEMON_0} fell asleep!"); +const u8 *const gUnknown_80FB338 = _("{POKEMON_0} is already asleep!"); +const u8 *const gUnknown_80FB35C = _("{POKEMON_0} is locked in a nightmare!"); +const u8 *const gUnknown_80FB360 = _("{POKEMON_0} is already asleep!"); +const u8 *const gUnknown_80FB380 = _("{POKEMON_0} didn't become drowsy!"); +const u8 *const gUnknown_80FB384 = _("{POKEMON_0} is already asleep!"); +const u8 *const gUnknown_80FB388 = _("{POKEMON_0} didn't become drowsy!"); +const u8 *const gUnknown_80FB3A4 = _("{POKEMON_0} had a nightmare!"); +const u8 *const gUnknown_80FB3CC = _("{POKEMON_0} is already having\na nightmare!"); +const u8 *const gUnknown_80FB3D0 = _("{POKEMON_0} didn't become drowsy!"); +const u8 *const gUnknown_80FB3E0 = _("{POKEMON_0} yawned!"); +const u8 *const gUnknown_80FB3F8 = _("{POKEMON_0} didn't yawn!"); +const u8 *const gUnknown_80FB414 = _("{POKEMON_0} is already yawning!"); +const u8 *const gUnknown_80FB418 = _("{POKEMON_0} is already asleep!"); +const u8 *const gUnknown_80FB41C = _("{POKEMON_0} woke up!"); +const u8 *const gUnknown_80FB43C = _("{POKEMON_0} is already sleepless!"); +const u8 *const gUnknown_80FB458 = _("{POKEMON_0} became sleepless!"); +const u8 *const gUnknown_80FB480 = _("{POKEMON_0} can't move on the next turn!"); +const u8 *const gUnknown_80FB4B0 = _("{POKEMON_0} already can't move on\nthe next turn!"); +const u8 *const gUnknown_80FB4D4 = _("{POKEMON_0} can't move for a while!"); +const u8 *const gUnknown_80FB4F0 = _("{POKEMON_0} is already paused!"); +const u8 *const gUnknown_80FB50C = _("{POKEMON_0} became infatuated!"); +const u8 *const gUnknown_80FB52C = _("{POKEMON_0} is already infatuated!"); +const u8 *const gUnknown_80FB548 = _("{POKEMON_0} sustained a burn!"); +const u8 *const gUnknown_80FB564 = _("{POKEMON_0} already has a burn!"); +const u8 *const gUnknown_80FB580 = _("But nothing happened."); +const u8 *const gUnknown_80FB598 = _("{POKEMON_0} was poisoned!"); +const u8 *const gUnknown_80FB5B4 = _("{POKEMON_0} was badly poisoned!"); +const u8 *const gUnknown_80FB5D4 = _("{POKEMON_0} is already poisoned!"); +const u8 *const gUnknown_80FB5F8 = _("{POKEMON_0} is already badly poisoned!"); +const u8 *const gUnknown_80FB610 = _("{POKEMON_0} became frozen!"); +const u8 *const gUnknown_80FB628 = _("{POKEMON_0} was squeezed!"); +const u8 *const gUnknown_80FB64C = _("{POKEMON_0} is already being squeezed!"); +const u8 *const gUnknown_80FB668 = _("{POKEMON_0} became immobilized!"); +const u8 *const gUnknown_80FB688 = _("{POKEMON_0} is already immobilized!"); +const u8 *const gUnknown_80FB6A4 = _("{POKEMON_0} put down its roots!"); +const u8 *const gUnknown_80FB6C0 = _("{POKEMON_0} is already rooted!"); +const u8 *const gUnknown_80FB6D8 = _("{POKEMON_0} became wrapped!"); +const u8 *const gUnknown_80FB6FC = _("{POKEMON_0} has a foe wrapped already!"); +const u8 *const gUnknown_80FB718 = _("{POKEMON_0} is already wrapped!"); +const u8 *const gUnknown_80FB73C = _("{POKEMON_0} attained Sure Shot status!"); +const u8 *const gUnknown_80FB764 = _("{POKEMON_0} already has Sure Shot\nstatus!"); +const u8 *const gUnknown_80FB780 = _("{POKEMON_0} became a whiffer!"); +const u8 *const gUnknown_80FB7A0 = _("{POKEMON_0} is already a whiffer!"); +const u8 *const gUnknown_80FB7BC = _("{POKEMON_0} became petrified!"); +const u8 *const gUnknown_80FB7DC = _("{POKEMON_0} is already petrified!"); +const u8 *const gUnknown_80FB7F4 = _("{POKEMON_0} was blinded!"); +const u8 *const gUnknown_80FB810 = _("{POKEMON_0} is already blinded!"); +const u8 *const gUnknown_80FB834 = _("{POKEMON_0}'s vision turned weird!"); +const u8 *const gUnknown_80FB85C = _("{POKEMON_0}'s vision is already weird!"); +const u8 *const gUnknown_80FB880 = _("{POKEMON_0}'s vision was restored!"); +const u8 *const gUnknown_80FB89C = _("{POKEMON_0}'s vision is fine!"); +const u8 *const gUnknown_80FB8BC = _("{POKEMON_0}'s damage was fixed!"); +const u8 *const gUnknown_80FB8E4 = _("{POKEMON_0}'s damage is already fixed!"); +const u8 *const gUnknown_80FB900 = _("{POKEMON_0} is getting pumped!"); +const u8 *const gUnknown_80FB924 = _("{POKEMON_0} is already getting pumped!"); +const u8 *const gUnknown_80FB940 = _("{POKEMON_0} cowered in fear!"); +const u8 *const gUnknown_80FB960 = _("{POKEMON_0} is already cowering!"); +const u8 *const gUnknown_80FB978 = _("{POKEMON_0} became a decoy!"); +const u8 *const gUnknown_80FB994 = _("{POKEMON_0} is already a decoy!"); +const u8 *const gUnknown_80FB9B0 = _("{POKEMON_0} protected itself!"); +const u8 *const gUnknown_80FB9D8 = _("{POKEMON_0} is already protecting itself!"); +const u8 *const gUnknown_80FB9F0 = _("{POKEMON_0} was taunted!"); +const u8 *const gUnknown_80FBA14 = _("{POKEMON_0} has been taunted already!"); +const u8 *const gUnknown_80FBA38 = _("{POKEMON_0} stored power {VALUE_0} time(s)!"); +const u8 *const gUnknown_80FBA60 = _("{POKEMON_0} can't store any more power!"); +const u8 *const gUnknown_80FBA80 = _("{POKEMON_0} disappeared from view!"); +const u8 *const gUnknown_80FBAA0 = _("{POKEMON_0} is invisible already!"); +const u8 *const gUnknown_80FBAC0 = _("{POKEMON_0} put up its mirror coat!"); +const u8 *const gUnknown_80FBAE4 = _("{POKEMON_0} already has a mirror coat!"); +const u8 *const gUnknown_80FBB04 = _("{POKEMON_0} heard the perish song!"); +const u8 *const gUnknown_80FBB28 = _("{POKEMON_0} already heard that song!"); +const u8 *const gUnknown_80FBB4C = _("{POKEMON_0} readied its Destiny Bond!"); +const u8 *const gUnknown_80FBB78 = _("{POKEMON_0} already has Destiny Bond\nreadied!"); +const u8 *const gUnknown_80FBB94 = _("{POKEMON_0} earned an encore!"); +const u8 *const gUnknown_80FBBB8 = _("{POKEMON_0} is already doing encores!"); +const u8 *const gUnknown_80FBBD4 = _("{POKEMON_0} won't do encores!"); +const u8 *const gUnknown_80FBBF0 = _("{POKEMON_0} is set to endure!"); +const u8 *const gUnknown_80FBC14 = _("{POKEMON_0} is already set to endure!"); +const u8 *const gUnknown_80FBC38 = _("{POKEMON_0} readied its Mirror Move!"); +const u8 *const gUnknown_80FBC5C = _("{POKEMON_0} already used Mirror Move!"); +const u8 *const gUnknown_80FBC7C = _("{POKEMON_0} has Conversion 2 up!"); +const u8 *const gUnknown_80FBCA4 = _("{POKEMON_0} already has Conversion 2 up!"); +const u8 *const gUnknown_80FBCC8 = _("{POKEMON_0} readied its Vital Throw!"); +const u8 *const gUnknown_80FBCF0 = _("{POKEMON_0} is already set for\nVital Throw!"); +const u8 *const gUnknown_80FBD18 = _("{POKEMON_0}'s stats returned to normal."); +const u8 *const gUnknown_80FBD3C = _("{POKEMON_0}'s stats appear unchanged."); +const u8 *const gUnknown_80FBD58 = _("It psyched itself up!"); +const u8 *const gUnknown_80FBD78 = _("{POKEMON_0}'s Belly went down."); +const u8 *const gUnknown_80FBD9C = _("{POKEMON_0}'s max. Belly size shrank!"); +const u8 *const gUnknown_80FBDC4 = _("{POKEMON_0}'s max. Belly size increased!"); +const u8 *const gUnknown_80FBDF0 = _("{POKEMON_0}'s Belly won't get any bigger!"); +const u8 *const gUnknown_80FBE14 = _("{POKEMON_0}'s Belly didn't change!"); +const u8 *const gUnknown_80FBE3C = _("{POKEMON_0}'s Belly size didn't change!"); +const u8 *const gUnknown_80FBE40 = _("{POKEMON_0}'s Belly didn't change!"); +const u8 *const gUnknown_80FBE64 = _("{POKEMON_0}'s Belly filled up full!"); +const u8 *const gUnknown_80FBE84 = _("{POKEMON_0}'s Belly was filled!"); +const u8 *const gUnknown_80FBEA0 = _("{POKEMON_0}'s Belly dropped!"); +const u8 *const gUnknown_80FBEC0 = _("{POKEMON_0} transformed into\n{POKEMON_1}!"); +const u8 *const gUnknown_80FBEE4 = _("{POKEMON_0}'s transformation failed!"); +const u8 *const gUnknown_80FBF04 = _("{POKEMON_0} is already transformed."); +const u8 *const gUnknown_80FBF28 = _("{POKEMON_0} can go through walls now!"); +const u8 *const gUnknown_80FBF50 = _("{POKEMON_0} can already go through walls!"); +const u8 *const gUnknown_80FBF68 = _("{POKEMON_0} became muzzled!"); +const u8 *const gUnknown_80FBF84 = _("{POKEMON_0} is already muzzled!"); +const u8 *const gUnknown_80FBF9C = _("{POKEMON_0} was exposed!"); +const u8 *const gUnknown_80FBFB8 = _("{POKEMON_0} is already exposed!"); +const u8 *const gUnknown_80FBFD8 = _("{POKEMON_0} isn't a Ghost type!"); +const u8 *const gUnknown_80FC000 = _("{POKEMON_0}'s Evasion returned to normal!"); +const u8 *const gUnknown_80FC028 = _("Item holders are now identified!"); +const u8 *const gUnknown_80FC054 = _("It can already identify item holders."); +const u8 *const gUnknown_80FC074 = _("{POKEMON_0} is already in a rage!"); +const u8 *const gUnknown_80FC084 = _("Accuracy"); +const u8 *const gUnknown_80FC090 = _("Evasion"); +const u8 *const gUnknown_80FC09C = _("Defense"); +const u8 *const gUnknown_80FC0AC = _("Sp. Def."); +const u8 *const gUnknown_80FC0B8 = _("Attack"); +const u8 *const gUnknown_80FC0C8 = _("Sp. Atk."); +const u8 *const gUnknown_80FC0D4 = _("sharply"); +const u8 *const gUnknown_80FC0E4 = _("slightly"); +const u8 *const gUnknown_80FC0FC = _("{POKEMON_0}'s {MOVE_ITEM_0} rose!"); +const u8 *const gUnknown_80FC114 = _("{POKEMON_0}'s {MOVE_ITEM_0} fell!"); +const u8 *const gUnknown_80FC118 = _("{POKEMON_0}'s {MOVE_ITEM_0} rose!"); +const u8 *const gUnknown_80FC11C = _("{POKEMON_0}'s {MOVE_ITEM_0} fell!"); +const u8 *const gUnknown_80FC138 = _("{POKEMON_0}'s {MOVE_ITEM_0} rose\n{MOVE_ITEM_1}!"); +const u8 *const gUnknown_80FC13C = _("{POKEMON_0}'s {MOVE_ITEM_0} rose\n{MOVE_ITEM_1}!"); +const u8 *const gUnknown_80FC158 = _("{POKEMON_0}'s {MOVE_ITEM_0} fell\n{MOVE_ITEM_1}!"); +const u8 *const gUnknown_80FC15C = _("{POKEMON_0}'s {MOVE_ITEM_0} fell\n{MOVE_ITEM_1}!"); +const u8 *const gUnknown_80FC180 = _("{POKEMON_0}'s {MOVE_ITEM_0} remained\nunchanged!"); +const u8 *const gUnknown_80FC184 = _("{POKEMON_0}'s {MOVE_ITEM_0} remained\nunchanged!"); +const u8 *const gUnknown_80FC1A4 = _("{POKEMON_0}'s {MOVE_ITEM_0} fell\nslightly!"); +const u8 *const gUnknown_80FC1C4 = _("{POKEMON_0}'s {MOVE_ITEM_0} rose\nslightly!"); +const u8 *const gUnknown_80FC1F0 = _("{POKEMON_0}'s {MOVE_ITEM_0} won't\ngo down any more!"); +const u8 *const gUnknown_80FC218 = _("{POKEMON_0}'s {MOVE_ITEM_0} won't\ngo up any more!"); +const u8 *const gUnknown_80FC21C = _("{POKEMON_0}'s {MOVE_ITEM_0} won't\ngo up any more!"); +const u8 *const gUnknown_80FC248 = _("{POKEMON_0}'s {MOVE_ITEM_0} won't\ngo down any more."); +const u8 *const gUnknown_80FC270 = _("{POKEMON_0}'s {MOVE_ITEM_0} won't\ngo up any more."); +const u8 *const gUnknown_80FC274 = _("{POKEMON_0}'s {MOVE_ITEM_0} won't\ngo down any more."); +const u8 *const gUnknown_80FC298 = _("{POKEMON_0}'s speed didn't change!"); +const u8 *const gUnknown_80FC2B8 = _("{POKEMON_0} can't go any faster!"); +const u8 *const gUnknown_80FC2D8 = _("{POKEMON_0} can't go any slower!"); +const u8 *const gUnknown_80FC2FC = _("{POKEMON_0} is protected by Safeguard!"); +const u8 *const gUnknown_80FC31C = _("{POKEMON_0} is protected by Mist!"); +const u8 *const gUnknown_80FC33C = _("{POKEMON_0}'s Attack was boosted."); +const u8 *const gUnknown_80FC360 = _("{POKEMON_0}'s Attack didn't go up."); +const u8 *const gUnknown_80FC388 = _("{POKEMON_0}'s Special Attack was boosted."); +const u8 *const gUnknown_80FC3B4 = _("{POKEMON_0}'s Special Attack didn't go up."); +const u8 *const gUnknown_80FC3D8 = _("{POKEMON_0}'s Defense was boosted."); +const u8 *const gUnknown_80FC3FC = _("{POKEMON_0}'s Defense didn't go up."); +const u8 *const gUnknown_80FC428 = _("{POKEMON_0}'s Special Defense was\nboosted."); +const u8 *const gUnknown_80FC454 = _("{POKEMON_0}'s Special Defense didn't\ngo up."); +const u8 *const gUnknown_80FC458 = _("{POKEMON_0}'s Attack was weakened."); +const u8 *const gUnknown_80FC47C = _("{POKEMON_0}'s Attack didn't go down."); +const u8 *const gUnknown_80FC4A4 = _("{POKEMON_0}'s Special Attack was\nweakened."); +const u8 *const gUnknown_80FC4D0 = _("{POKEMON_0}'s Special Attack didn't go\ndown."); +const u8 *const gUnknown_80FC52C = _("The target's Magic Coat bounced it back!"); +const u8 *const gUnknown_80FC558 = _("The target's Mirror Move returned it!"); +const u8 *const gUnknown_80FC574 = _("{POKEMON_1} protected itself!"); +const u8 *const gUnknown_80FC584 = _("{POKEMON_0} warped!"); +const u8 *const gUnknown_80FC5A8 = _("A trap can't be laid here."); +const u8 *const gUnknown_80FC5CC = _("{POKEMON_0} was too hungry to use it!"); +const u8 *const gUnknown_80FC5E0 = _("Weather: {POKEMON_0}"); +const u8 *const gUnknown_80FC5F8 = _("A trap was laid!"); +const u8 *const gUnknown_80FC5FC = _("A trap can't be laid here."); +const u8 *const gUnknown_80FC614 = _("Got {POKEMON_1}'s item!"); +const u8 *const gUnknown_80FC654 = _("{POKEMON_0} has an item already.\nIt couldn't get another item."); +const u8 *const gUnknown_80FC678 = _("{POKEMON_1} doesn't have anything!"); +const u8 *const gUnknown_80FC690 = _("The move failed!"); +const u8 *const gUnknown_80FC6A4 = _("The Orb failed!"); +const u8 *const gUnknown_80FC6A8 = _("{POKEMON_0} is paralyzed!"); +const u8 *const gUnknown_80FC6D0 = _("But the move couldn't be used!"); +const u8 *const gUnknown_80FC6FC = _("But Orbs are prevented from being used!"); +const u8 *const gUnknown_80FC710 = _("{POKEMON_0} is muzzled!"); +const u8 *const gUnknown_80FC714 = _("{POKEMON_0} is cringing!"); +const u8 *const gUnknown_80FC718 = _("{POKEMON_0} is infatuated!"); +const u8 *const gUnknown_80FC72C = _("{POKEMON_0} loosed {MOVE_ITEM_0}!"); +const u8 *const gUnknown_80FC730 = _("But nothing happened."); +const u8 *const gUnknown_80FC734 = _("But nothing happened."); +const u8 *const gUnknown_80FC74C = _("Nothing happened."); +const u8 *const gUnknown_80FC770 = _("But no power had been stored!"); +const u8 *const gUnknown_80FC790 = _("{POKEMON_0} traded items with\n{POKEMON_1}!"); +const u8 *const gUnknown_80FC7AC = _("The item trade failed!"); +const u8 *const gUnknown_80FC7C8 = _("{POKEMON_0}'s move missed!"); +const u8 *const gUnknown_80FC7EC = _("{POKEMON_0} and {POKEMON_1} shared\ntheir HP!"); +const u8 *const gUnknown_80FC81C = _("{POKEMON_0} copied the target's\nspecial ability!"); +const u8 *const gUnknown_80FC854 = _("{POKEMON_0} couldn't copy the target's\nWonder Guard!"); +const u8 *const gUnknown_80FC888 = _("{POKEMON_0} swapped special abilities\nwith the target!"); +const u8 *const gUnknown_80FC8C0 = _("{POKEMON_0} couldn't swap the target's\nWonder Guard!"); +const u8 *const gUnknown_80FC8F0 = _("All sticky, gummed-up items were cleaned!"); +const u8 *const gUnknown_80FC920 = _("There were no sticky, gummed-up items."); +const u8 *const gUnknown_80FC924 = _("The target is a Ground type!\nMud-Slap didn't work!"); +const u8 *const gUnknown_80FC97C = _("There's nowhere to warp!"); +const u8 *const gUnknown_80FC9A0 = _("It's already on the stairs."); +const u8 *const gUnknown_80FC9C0 = _("It couldn't make a leap!"); +const u8 *const gUnknown_80FC9E8 = _("It couldn't be knocked flying!"); +const u8 *const gUnknown_80FCA10 = _("{POKEMON_0} couldn't be knocked flying!"); +const u8 *const gUnknown_80FCA3C = _("It had no power stockpiled to spit up!"); +const u8 *const gUnknown_80FCA60 = _("{POKEMON_0}'s {MOVE_ITEM_0} didn't\ngo down!"); +const u8 *const gUnknown_80FCA64 = _("{POKEMON_0}'s {MOVE_ITEM_0} didn't\ngo down!"); +const u8 *const gUnknown_80FCA90 = _("{POKEMON_1} is sturdy!\nIt withstood the move!"); +const u8 *const gUnknown_80FCAC0 = _("{POKEMON_0} is anchored!\nIt won't switch places!"); +const u8 *const gUnknown_80FCAE8 = _("{POKEMON_0} is anchored!\nIt won't warp!"); +const u8 *const gUnknown_80FCB14 = _("But it dropped back at the same spot!"); +const u8 *const gUnknown_80FCB40 = _("{POKEMON_0} is anchored!\nIt can't be thrown!"); +const u8 *const gUnknown_80FCB70 = _("{POKEMON_0} couldn't be thrown for\nsome reason!"); +const u8 *const gUnknown_80FCB98 = _("{POKEMON_0} is anchored!\nIt can't leap!"); +const u8 *const gUnknown_80FCBCC = _("{POKEMON_0} is anchored!\nIt can't be knocked flying!"); +const u8 *const gUnknown_80FCBF8 = _("{POKEMON_0} is limber!\nIt can't be paralyzed!"); +const u8 *const gUnknown_80FCC18 = _("But {POKEMON_0} didn't cringe!"); +const u8 *const gUnknown_80FCC4C = _("{POKEMON_0} is oblivious!\nIt doesn't get infatuated!"); +const u8 *const gUnknown_80FCC7C = _("{POKEMON_0} traced the target's\nspecial ability!"); +const u8 *const gUnknown_80FCCAC = _("{POKEMON_0}'s Color Change made it\nthe {MOVE_ITEM_0} type!"); +const u8 *const gUnknown_80FCCB0 = _(""); +const u8 *const gUnknown_80FCCE4 = _("But the target's item couldn't be taken!"); +const u8 *const gUnknown_80FCCE8 = _("But the target's item couldn't be taken!"); +const u8 *const gUnknown_80FCD0C = _("A Lightningrod took the move!"); +const u8 *const gUnknown_80FCD28 = _("The move was snatched!"); +const u8 *const gUnknown_80FCD54 = _("{POKEMON_0}'s Insomnia prevents\ndrowsiness!"); +const u8 *const gUnknown_80FCD58 = _("{POKEMON_0}'s Insomnia prevents\ndrowsiness!"); +const u8 *const gUnknown_80FCD88 = _("{POKEMON_0}'s Vital Spirit prevents\ndrowsiness!"); +const u8 *const gUnknown_80FCDB4 = _("{POKEMON_0}'s Own Tempo prevents\nconfusion!"); +const u8 *const gUnknown_80FCDE0 = _("{POKEMON_0}'s Magma Armor prevents\nfreezing!"); +const u8 *const gUnknown_80FCE00 = _("{POKEMON_0} is an unfreezable type!"); +const u8 *const gUnknown_80FCE34 = _("The magma's heat prevents {POKEMON_0}\nfrom freezing!"); +const u8 *const gUnknown_80FCE5C = _("{POKEMON_0}'s Water Veil prevents burns!"); +const u8 *const gUnknown_80FCE84 = _("{POKEMON_0}'s type doesn't get burns!"); +const u8 *const gUnknown_80FCEB0 = _("{POKEMON_0}'s Immunity prevents\npoisoning!"); +const u8 *const gUnknown_80FCEDC = _("{POKEMON_0}'s type doesn't get poisoned!"); +const u8 *const gUnknown_80FCEFC = _("It had no effect on {POKEMON_0}!"); +const u8 *const gUnknown_80FCF18 = _("Yes! {POKEMON_0} leveled up!"); +const u8 *const gUnknown_80FCF38 = _("{POKEMON_0} uttered its sleep talk!"); +const u8 *const gUnknown_80FCF50 = _("{POKEMON_0} loosed a snore!"); +const u8 *const gUnknown_80FCF74 = _("The weather remained unchanged!"); +const u8 *const gUnknown_80FCF78 = _("The weather remained unchanged!"); +const u8 *const gUnknown_80FCF7C = _("The weather remained unchanged!"); +const u8 *const gUnknown_80FCF80 = _("The weather remained unchanged!"); +const u8 *const gUnknown_80FCFA4 = _("Its power was rebounded back!"); +const u8 *const gUnknown_80FCFBC = _("{MOVE_ITEM_0} was tormented!"); +const u8 *const gUnknown_80FCFE4 = _("The target couldn't be tormented!"); +const u8 *const gUnknown_80FD018 = _("The target's HP can't be halved anymore!"); +const u8 *const gUnknown_80FD040 = _("It became brighter on the floor!"); +const u8 *const gUnknown_80FD05C = _("The floor was drained!"); +const u8 *const gUnknown_80FD060 = _("But nothing happened."); +const u8 *const gUnknown_80FD08C = _("There is too much water to be drained!"); +const u8 *const gUnknown_80FD0B4 = _("It filled in the ground in front!"); +const u8 *const gUnknown_80FD0B8 = _("But nothing happened."); +const u8 *const gUnknown_80FD0BC = _("The stairs were located!"); +const u8 *const gUnknown_80FD0DC = _(""); +const u8 *const gUnknown_80FD0E0 = _(""); +const u8 *const gUnknown_80FD0E4 = _(""); +const u8 *const gUnknown_80FD104 = _("The barrier was shattered!"); +const u8 *const gUnknown_80FD128 = _("It can only be used on water!"); +const u8 *const gUnknown_80FD14C = _("It can only be used on land!"); +const u8 *const gUnknown_80FD170 = _("{POKEMON_1}'s item was swatted down!"); +const u8 *const gUnknown_80FD18C = _("The target has no item!"); +const u8 *const gUnknown_80FD1B0 = _("Nearby traps were destroyed!"); +const u8 *const gUnknown_80FD1CC = _("There were no traps."); +const u8 *const gUnknown_80FD1EC = _("It can't be used here."); +const u8 *const gUnknown_80FD20C = _("{POKEMON_1} can throw a long way!"); +const u8 *const gUnknown_80FD22C = _("{POKEMON_1} can throw far already!"); +const u8 *const gUnknown_80FD254 = _("{POKEMON_1}'s throws can pierce things!"); +const u8 *const gUnknown_80FD27C = _("{POKEMON_1}'s throws can pierce already!"); +const u8 *const gUnknown_80FD294 = _("{POKEMON_1} bears a grudge!"); +const u8 *const gUnknown_80FD2B4 = _("{POKEMON_1} already bears a grudge!"); +const u8 *const gUnknown_80FD2CC = _("It's a grudge!"); +const u8 *const gUnknown_80FD2DC = _("Assist: {MOVE_ITEM_0}"); +const u8 *const gUnknown_80FD2F8 = _("All traps were exposed!"); +const u8 *const gUnknown_80FD320 = _("There appear to be no hidden traps."); +const u8 *const gUnknown_80FD350 = _("The last move used by {POKEMON_1} lost\nall its PP!"); +const u8 *const gUnknown_80FD370 = _("Nothing happened to {POKEMON_1}."); +const u8 *const gUnknown_80FD3A0 = _("The walls crumbled, making one big room!"); +const u8 *const gUnknown_80FD3C8 = _("This floor is already one big room!"); +const u8 *const gUnknown_80FD3CC = _("It can't be used here."); +const u8 *const gUnknown_80FD3D0 = _("It can't be used here."); +const u8 *const gUnknown_80FD3F0 = _("It dug the wall in front!"); +const u8 *const gUnknown_80FD40C = _("Can't use that here!"); +const u8 *const gUnknown_80FD430 = _("Can't use that diagonally!"); +const u8 *const gUnknown_80FD434 = _("{POKEMON_0} transformed into\n{POKEMON_1}!"); +const u8 *const gUnknown_80FD450 = _("{POKEMON_0} can't transform!"); +const u8 *const gUnknown_80FD454 = _("But nothing happened."); +const u8 *const gUnknown_80FD46C = _("{POKEMON_1} was revived!"); +const u8 *const gUnknown_80FD484 = _("{POKEMON_0} possessed {POKEMON_1}!"); +const u8 *const gUnknown_80FD4B0 = _("The target's stench is overwhelming!"); +const u8 *const gUnknown_80FD4C4 = _("{POKEMON_0} escaped!"); +const u8 *const gUnknown_80FD4DC = _("{POKEMON_0} can't escape!"); +const u8 *const gUnknown_80FD500 = _("{POKEMON_0} was protected by its Band!"); +const u8 *const gUnknown_80FD524 = _("{POKEMON_0} was protected by its Scarf!"); +const u8 *const gUnknown_80FD548 = _("{POKEMON_0} was protected by its Scope!"); +const u8 *const gUnknown_80FD54C = _("{POKEMON_0} was protected by its Scope!"); +const u8 *const gUnknown_80FD550 = _("{POKEMON_0} was protected by its Band!"); +const u8 *const gUnknown_80FD574 = _("{POKEMON_1} was protected by its Specs!"); +const u8 *const gUnknown_80FD578 = _("{POKEMON_1} was protected by its Specs!"); +const u8 *const gUnknown_80FD57C = _("{POKEMON_1} was protected by its Specs!"); +const u8 *const gUnknown_80FD594 = _("Getting hungry..."); +const u8 *const gUnknown_80FD5B8 = _("Getting dizzy from hunger..."); +const u8 *const gUnknown_80FD5DC = _("Oh, no! Your Belly's empty!"); +const u8 *const gUnknown_80FD608 = _("Hurry! You've got to eat something!"); +const u8 *const gUnknown_80FD628 = _("You'll faint from hunger!"); +const u8 *const gUnknown_80FD644 = _("Its IQ didn't change."); +const u8 *const gUnknown_80FD648[] = { + [0] = _("It seems to love this Gummi!"), + [1] = _("It seems to like this Gummi!"), + [2] = _("It doesn't seem to dislike this Gummi."), + [3] = _("It seemed to be somewhat satisfied."), +}; + +const u8 *const gUnknown_80FD6E8[] = { + [0] = _("IQ rose sharply!"), + [1] = _("IQ went up significantly!"), + [2] = _("IQ went up somewhat!"), + [3] = _("IQ went up slightly!"), + [4] = _("IQ didn't change."), +}; + +const u8 *const gUnknown_80FD788 = _("A food item went bad."); +const u8 *const gUnknown_80FD7AC = _("Several food items went bad."); +const u8 *const gUnknown_80FD7D4 = _("Nothing particularly bad happened."); +const u8 *const gUnknown_80FD7F4 = _("Stepped on something weird!"); +const u8 *const gSteppedOnTrapStrings[NUM_TRAPS] = { + [0] = _("There was a {POKEMON_0} underfoot!"), + [1] = _("Mud splashed up from the {POKEMON_0}!"), + [2] = _("Stepped on a Sticky Trap!"), + [3] = _("Sludge splashed up from the ground!"), + [4] = _("A sweet, Pokémon-attracting aroma\nspread!"), + [5] = _("{POKEMON_0}!"), + [6] = _("Stepped on a {POKEMON_0}!"), + [7] = _("A sudden gust blew!"), + [8] = _("The trap spun around!"), + [9] = _("Sleeping gas erupted!"), + [10] = _("Stepped on a Slow Trap!"), + [11] = _("Stepped on a Seal Trap!"), + [12] = _("Poison spikes shot out!"), + [13] = _("Stepped on a Selfdestruct Trap!"), + [14] = _("Stepped on an Explosion Trap!"), + [15] = _("Stepped on a PP-Zero Trap!"), + [16] = _("Stepped on a Chestnut Trap!"), + [17] = _("Stepped on a Wonder Tile!"), + [18] = _("Stepped on a Pokémon Trap!"), + [19] = _("Stepped on a Spiked Tile!"), +}; + +const u8 *const gUnknown_80FDA80 = _("The move {MOVE_ITEM_0} lost its PP!"); +const u8 *const gUnknown_80FDAA0 = _("All PP are already gone!"); +const u8 *const gUnknown_80FDACC = _("Unclaimed items turned into Pokémon!"); +const u8 *const gUnknown_80FDAE4 = _("Nothing happened!"); +const u8 *const gUnknown_80FDB04 = _("The move {MOVE_ITEM_0} was sealed!"); +const u8 *const gUnknown_80FDB2C = _("All the moves are sealed already!"); +const u8 *const gUnknown_80FDB5C = _("Its Scarf stopped the trap from\nspringing!"); +const u8 *const gUnknown_80FDB7C = _("The trap failed to work!"); +const u8 *const gUnknown_80FDBA0 = _("But there is no one in the way!"); +const u8 *const gUnknown_80FDBB8 = _("{POKEMON_0} caught the {MOVE_ITEM_0}!"); +const u8 *const gUnknown_80FDBD0 = _("{POKEMON_0} regained PP."); +const u8 *const gUnknown_80FDBF0 = _("{POKEMON_0} has full PP already!"); +const u8 *const gUnknown_80FDC18 = _("The {MOVE_ITEM_0} became sticky and\nunusable!"); +const u8 *const gUnknown_80FDC40 = _("But nothing happened in particular."); +const u8 *const gUnknown_80FDC7C = _("The No-Stick Cap prevented items from\ngetting sticky!"); +const u8 *const gUnknown_80FDC9C = _("The used TM was recharged!"); +const u8 *const gUnknown_80FDCA0 = _("But nothing happened."); +const u8 *const gUnknown_80FDCA4 = _("{POKEMON_0} is muzzled!"); +const u8 *const gUnknown_80FDCC8 = _("{POKEMON_0} converted to\nthe {MOVE_ITEM_0} type!"); +const u8 *const gUnknown_80FDCE4 = _("{POKEMON_0} mimicked its foe!"); +const u8 *const gUnknown_80FDD00 = _("{POKEMON_0}'s Mimic failed!"); +const u8 *const gUnknown_80FDD20 = _("The move was passed off!"); +const u8 *const gUnknown_80FDD48 = _("There's no one to pass off to!"); +const u8 *const gUnknown_80FDD88 = _("A mysterious force prevents moves\nfrom being passed off!"); +const u8 *const gUnknown_80FDDA8 = _("The attack was passed off!"); +const u8 *const gUnknown_80FDDAC = _("There's no one to pass off to!"); +const u8 *const gUnknown_80FDDD0 = _("The closed corridor was opened!"); +const u8 *const gUnknown_80FDDF0 = _("It can't be used here!"); +const u8 *const gUnknown_80FDE18 = _("There is nothing at {POKEMON_0}'s feet."); +const u8 *const gUnknown_80FDE6C = _("Your adventure to this point will be saved\nin preparation for shutting down."); +const u8 *const gUnknown_80FDEB8 = _("Give up on this adventure?\nIf you do, it will be treated as a defeat."); +const u8 *const gUnknown_80FDF00 = _("Will the linked moves be forgotten,\nincluding the selected {MOVE_ITEM_0}?"); +const u8 *const gUnknown_80FDF40 = _("Only four moves may be learned!\nWill a move be forgotten?"); +const u8 *const gUnknown_80FDF70 = _("The move {MOVE_ITEM_0} will be\nforgotten.\nIs that OK?"); +const u8 *const gUnknown_80FDFB8 = _("The chosen Pokémon will leave the Friend\nArea forever.\nIs that OK?"); +const u8 *const gUnknown_80FDFE8 = _("{R_BUTTON} + {DPAD}: Shift moves\n{SELECT_BUTTON}: Switch set moves"); +const u8 *const gUnknown_80FE008 = _("{POKEMON_0} can't talk just now."); +const u8 *const gUnknown_80FE034 = _("There are no items that can be trawled!"); +const u8 *const gUnknown_80FE060 = _("All unclaimed items were drawn close!"); +const u8 *const gUnknown_80FE0AC = _("There is no room on your team to accept\nthe guest rescue team's {POKEMON_0}."); +const u8 *const gUnknown_80FE0F4 = _("There is no room on your team to fit\nthe {POKEMON_0} that needs your help."); +const u8 *const gUnknown_80FE0F8 = _("There is no room on your team to fit\nthe {POKEMON_0} that needs your help."); +const u8 *const gUnknown_80FE134 = _("The guest rescue team's {POKEMON_0}\njoined your rescue team!"); +const u8 *const gUnknown_80FE168 = _("Your client, {POKEMON_0}, joined\nyour rescue team!"); +const u8 *const gUnknown_80FE1A4 = _("The Friend Area {MOVE_ITEM_0} is\nfull.\nA friend must be released."); +const u8 *const gUnknown_80FE20C = _("If you dismiss this Pokémon,\nit may never again join your rescue team.\nBid farewell to it anyway?"); +const u8 *const gUnknown_80FE268 = _("Would you like to get help using a distress\ncall or get the password for getting\nhelp?"); +const u8 *const gUnknown_80FE28C = _("A call for help will be issued."); +const u8 *const gUnknown_80FE2D0 = _("Your rescue team is not eligible to\nreceive any more rescues."); +const u8 *const gUnknown_80FE2EC = _("{POKEMON_0} evolved into {POKEMON_1}!"); +const u8 *const gPtrItsaMonsterHouseMessage = _("It's a monster house!"); +const u8 *const gUnknown_80FE330 = _("It became the move {MOVE_ITEM_0}'s type!"); +const u8 *const gUnknown_80FE36C = _("There were no moves that could be used\nfor Conversion!"); +const u8 *const gUnknown_80FE38C = _("The move {MOVE_ITEM_0} was sketched!"); +const u8 *const gUnknown_80FE3BC = _("There were no moves that could be\nsketched!"); +const u8 *const gItemStickyDoesntWorkText = _("{MOVE_ITEM_0} is all sticky!\nIt doesn't work!"); +const u8 *const gUnknown_80FE3EC = _("{POKEMON_0} learned the move\n{MOVE_ITEM_0}."); +const u8 *const gUnknown_80FE40C = _("But nothing happened."); +const u8 *const gUnknown_80FE434 = _("Lucky! The move got a lot stronger!"); +const u8 *const gUnknown_80FE454 = _("The set move got stronger!"); +const u8 *const gUnknown_80FE458 = _("But nothing happened."); +const u8 *const gUnknown_80FE478 = _("{POKEMON_0} had second thoughts!"); +const u8 *const gUnknown_80FE4B8 = _("Help! Thief! I've been robbed!\nHelp me catch the thief!"); +const u8 *const gUnknown_80FE4D4 = _("Thank you so very much."); +const u8 *const gUnknown_80FE4F4 = _("Your patronage is valued."); +const u8 *const gUnknown_80FE520 = _("You don't seem to have enough money."); +const u8 *const gUnknown_80FE568 = _("The merchandise you have chosen\ncosts {VALUE_0} {POKE}.\nIs that acceptable?"); +const u8 *const gUnknown_80FE5C0 = _("For the merchandise you have left me,\nI shall pay {VALUE_0} {POKE}.\nIs that acceptable?"); +const u8 *const gUnknown_80FE5F0 = _("I'm looking forward to serving you again!"); +const u8 *const gUnknown_80FE63C = _("That is very disappointing.\nPlease return any items\nbefore you leave..."); +const u8 *const gUnknown_80FE65C = _("I await your next visit."); +const u8 *const gUnknown_80FE674 = _("Ah, welcome〜♪"); +const u8 *const gUnknown_80FE690 = _("{POKEMON_0} was sent flying!"); +const u8 *const gUnknown_80FE6B4 = _("But it didn't go anywhere."); +const u8 *const gUnknown_80FE6D4 = _("{POKEMON_0} can't throw items!"); +const u8 *const gUnknown_80FE6E8 = _("The Last Outing"); +const u8 *const gUnknown_80FE6F4 = _("Someone"); +const u8 *const gUnknown_80FE708 = _("Tile underfoot"); +const u8 *const gUnknown_80FE70C = _("Stairs"); +const u8 *const gUnknown_80FE720 = _("Rescue Point"); +const u8 *const gUnknown_80FE724 = _("Warp Zone"); +const u8 *const gOptionsDungeonTextPtr = _("Dungeon"); +const u8 *const gOptionsOthersTextPtr = _("Others"); +const u8 *const gUnknown_80FE748 = _("Default"); +const u8 *const gUnknown_80FE764 = _("Speed{UNK_MACRO_3D M3D_80}Slow{UNK_MACRO_3D M3D_136}Fast"); +const u8 *const gUnknown_80FE788 = _("Far-off pals{UNK_MACRO_3D M3D_80}Self{UNK_MACRO_3D M3D_136}Look"); +const u8 *const gUnknown_80FE7A8 = _("Damage turn{UNK_MACRO_3D M3D_80}No{UNK_MACRO_3D M3D_136}Yes"); +const u8 *const gUnknown_80FE7C0 = _("Grids{UNK_MACRO_3D M3D_80}Off{UNK_MACRO_3D M3D_136}On"); +const u8 *const gUnknown_80FE7E4 = _("Map{UNK_MACRO_3D M3D_80}Off{UNK_MACRO_3D M3D_120}Clear{UNK_MACRO_3D M3D_160}Shade"); +const u8 *const gOptionsWindowColorPtr = _("Windows{UNK_MACRO_3D M3D_80}Blue{UNK_MACRO_3D M3D_120}Red{UNK_MACRO_3D M3D_160}Green"); +const u8 *const gDsTopScreenOptions[] = { + [0] = _("Top screen: Team data"), + [1] = _("Top screen: Team data"), + [2] = _("Top screen: Team data"), + [3] = _("Top screen: Message log"), + [4] = _("Top screen: Message log"), + [5] = _("Top screen: Message log"), + [6] = _("Top screen: Map and team"), +}; + +const u8 *const gDsBottomScreenOptions[] = { + [0] = _("Bottom screen: No map"), + [1] = _("Bottom screen: Clear map"), + [2] = _("Bottom screen: Shaded map"), + [3] = _("Bottom screen: No map"), + [4] = _("Bottom screen: Clear map"), + [5] = _("Bottom screen: Shaded map"), + [6] = _("Bottom screen: No map"), +}; + +const u8 *const gGameOptionsTextPtr = _("Game Options"); +const u8 *const gUnknown_80FE8F4 = _("Quicksave"); +const u8 *const gUnknown_80FE8F8 = _("Others"); +const u8 *const gTeamToolboxAPtr = _("Team Toolbox A"); +const u8 *const gTeamToolboxBPtr = _("Team Toolbox B"); +const u8 *const gFieldItemMenuGroundTextPtr = _("Ground"); +const u8 *const gUnknown_80FE940 = _("{POKEMON_0}'s item"); +const u8 *const gWhichTextPtr1 = _("Which?"); +const u8 *const gWhichTextPtr2 = _("Which?"); +const u8 *const gUnknown_80FE954 = _("Tactics"); +const u8 *const gUnknown_80FE95C = _("{MOVE_ITEM_0}"); +const u8 *const gUnknown_80FE960 = _("{MOVE_ITEM_0}"); +const u8 *const gUnknown_80FE964 = _("{MOVE_ITEM_0}"); +const u8 *const gUnknown_80FE978 = _("{POKEMON_0}'s moves"); +const u8 *const gFieldMenuMovesPtr = _("{UNK_MACRO_5F_1}Moves"); +const u8 *const gFieldMenuItemsPtr = _("{UNK_MACRO_5F_2}Items"); +const u8 *const gFieldMenuTeamPtr = _("{UNK_MACRO_5F_3}Team"); +const u8 *const gFieldMenuOthersPtr = _("{UNK_MACRO_5F_4}Others"); +const u8 *const gFieldMenuGroundPtr = _("{UNK_MACRO_5F_5}Ground"); +const u8 *const gUnknown_80FE9CC = _("Game Options"); +const u8 *const gUnknown_80FE9E8 = _("Quicksave or Give Up"); +const u8 *const gUnknown_80FE9F8 = _("Message log"); +const u8 *const gUnknown_80FEA10 = _("Mission objectives"); +const u8 *const gUnknown_80FEA28 = _("Recruitment search"); +const u8 *const gUnknown_80FEA44 = _("{COLOR RED}Recruitment search{RESET}"); +const u8 *const gUnknown_80FEA50 = _("Hints"); +const u8 *const gUnknown_80FEA68 = _("Potential recruits"); +const u8 *const gUnknown_80FEA80 = _("Recruited Pokémon"); +const u8 *const gUnknown_80FEA8C = _("None"); +const u8 *const gUnknown_80FEAC4 = _("{POKEMON_0}'s IQ rose!\nIt learned the IQ skill\n“{MOVE_ITEM_0}”!"); +const u8 *const gUnknown_80FEAE8 = _("It appears to be weak here..."); +const u8 *const gUnknown_80FEB08 = _("{POKEMON_1} became the {MOVE_ITEM_0} type."); +const u8 *const gUnknown_80FEB30 = _("{POKEMON_1} took Perish Song's effect!"); +const u8 *const gUnknown_80FEB60 = _("It can't lend a helping hand to itself!"); +const u8 *const gUnknown_80FEB88 = _("Poor type match! It has no effect!"); +const u8 *const gUnknown_80FEB8C = _("Poor type match! It has no effect!"); +const u8 *const gUnknown_80FEB90 = _("Poor type match! It has no effect!"); +const u8 *const gUnknown_80FEBBC = _("It avoided a burn by being on water!"); +const u8 *const gUnknown_80FEBDC = _("It couldn't flop around!"); +const u8 *const gUnknown_80FEBF8 = _("Change the settings?"); +const u8 *const gUnknown_80FEC28 = _("Reset the options to their default setting?"); +const u8 *const gUnknown_80FEC48 = _("Rescue chances left: {VALUE_0}"); +const u8 *const gUnknown_80FEC7C = _("This team can't send out for help anymore!"); +const u8 *const gUnknown_80FECA0 = _("Are you done with the Link Box?"); +const u8 *const gUnknown_80FECBC = _("{POKEMON_0} waggled its finger!"); +const u8 *const gUnknown_80FECE0 = _("{POKEMON_0} drew out nature's power!"); +const u8 *const gUnknown_80FED00 = _("Pokémon were drawn close!"); +const u8 *const gUnknown_80FED04 = _("But nothing happened!"); +const u8 *const gUnknown_80FED08 = _("But nothing happened!"); +const u8 *const gUnknown_80FED0C = _("But nothing happened!"); +const u8 *const gUnknown_80FED30 = _("It bounced off the trick tile!"); +const u8 *const gUnknown_80FED34 = _("{POKEMON_0} disappeared in the blast!"); +const u8 *const gUnknown_80FED68 = _("{POKEMON_0} blinked."); +const u8 *const gUnknown_80FED88 = _("Overgrow boosted its power!"); +const u8 *const gUnknown_80FEDA8 = _("Torrent boosted its power!"); +const u8 *const gUnknown_80FEDC8 = _("Swarm boosted its power!"); +const u8 *const gUnknown_80FEDE8 = _("Blaze boosted its power!"); +const u8 *const gUnknown_80FEE04 = _("Guts boosted its power!"); +const u8 *const gUnknown_80FEE2C = _("Its special ability boosted Attack!"); +const u8 *const gUnknown_80FEE54 = _("Marvel Scale boosted its Defense!"); +const u8 *const gUnknown_80FEE80 = _("Its special ability quickened attacks!"); +const u8 *const gUnknown_80FEEA4 = _("Arena Trap prevents movement!"); +const u8 *const gUnknown_80FEEC8 = _("Shadow Tag prevents movement!"); +const u8 *const gUnknown_80FEEEC = _("Magnet Pull prevents movement!"); +const u8 *const gUnknown_80FEF0C = _("Static caused paralysis!"); +const u8 *const gUnknown_80FEF30 = _("Effect Spore scattered spores!"); +const u8 *const gUnknown_80FEF4C = _("Poison Point struck!"); +const u8 *const gUnknown_80FEF50 = _("Effect Spore scattered spores!"); +const u8 *const gUnknown_80FEF54 = _("Effect Spore scattered spores!"); +const u8 *const gUnknown_80FEF74 = _("Flame Body caused a burn!"); +const u8 *const gUnknown_80FEF98 = _("Cute Charm caused infatuation!"); +const u8 *const gUnknown_80FEFD0 = _("A horrid stench billowed out!\n{POKEMON_0} became terrified!"); +const u8 *const gUnknown_80FEFF4 = _("Transform can't be used here!"); +const u8 *const gUnknown_80FF01C = _("{POKEMON_0}'s Synchronize took effect!"); +const struct TutorialFlagMsg gUnknown_80FF020 = { + 0x00, _("Head for the destination while attacking\nfoes with {A_BUTTON}.\nTry not to let a partner faint!") +}; + +const struct TutorialFlagMsg gUnknown_80FF080 = { + 0x01, _("Foes won't move until you do.\nOpen the menu with {B_BUTTON} and\nthink before you act!") +}; + +const struct TutorialFlagMsg gUnknown_80FF0D8 = { + 0x02, _("Your team regains HP as it moves.\nHold {B_BUTTON} then press {A_BUTTON} to recover\nHP quickly on the spot.") +}; + +const struct TutorialFlagMsg gUnknown_80FF13C = { + 0x0c, _("Defeat foes using moves instead of\n{A_BUTTON} attacks for more Exp. Points.\nChoose and set the move you want to use.") +}; + +const struct TutorialFlagMsg gUnknown_80FF1B4 = { + 0x0d, _("Choose a partner with the Team command\nand set its tactics and IQ skills.\nCooperation with partners is the key!") +}; + +const struct TutorialFlagMsg gMovementTutorial = { + 0x0e, _("Hold {B_BUTTON} then press {DPAD} to speed up\nmovement. Hold {R_BUTTON} then press {DPAD}\nto move only diagonally.") +}; + +const struct TutorialFlagMsg gHungerTutorial = { + 0x0f, _("Eat an Apple or Gummi when your Belly\ngoes down. Being famished can cause\nfainting, so check your Belly in the menu.") +}; + +const struct TutorialFlagMsg gFoodTutorial = { + 0x03, _("Eating an Apple or Gummi fills your Belly.\nChoose them under Items in the menu\nand eat one before your Belly gets empty.") +}; + +const struct TutorialFlagMsg gOranTutorial = { + 0x04, _("An Oran Berry restores HP.\nOpen the menu with {B_BUTTON} and\nselect it under Items.") +}; + +const struct TutorialFlagMsg gCheriTutorial = { + 0x05, _("A Cheri Berry heals paralysis.\nOpen the menu with {B_BUTTON} and\nselect it under Items.") +}; + +const struct TutorialFlagMsg gBlastSeedTutorial = { + 0x06, _("A Blast Seed flames the foe you\nare facing.\nTurn to face the foe, then use the item.") +}; + +const struct TutorialFlagMsg gUnknown_80FF4A0 = { + 0x07, _("Gravelerocks can be lobbed at distant foes.\nSet them for use under Items.\nHold {L_BUTTON} then press {R_BUTTON} to throw them.") +}; + +const struct TutorialFlagMsg gPechaTutorial = { + 0x09, _("A Pecha Berry heals any kind of poisoning.\nOpen the menu with {B_BUTTON} and\nselect it under Items.") +}; + +const struct TutorialFlagMsg gSleepSeedTutorial = { + 0x0a, _("Throw a Sleep Seed at a foe to put it\nto sleep for a little while.\nEating it will put you to sleep!") +}; + +const struct TutorialFlagMsg gMoneyTutorial = { + 0x0b, _("{POKE} is the money in this world.\nCollect and save it to buy useful\nitems.") +}; + +const u8 *const gUnknown_80FF674 = _("You're a thief!\nYou're not recognized as a rescuer!"); +const u8 *const gUnknown_80FF678 = _("But nothing happened."); +const u8 *const gUnknown_80FF6A4 = _("You've reached a destination floor!"); +const u8 *const gUnknown_80FF6F8 = _("You've reached a destination floor!\nBut the Pokémon you seek isn't here..."); +const u8 *const gUnknown_80FF730 = _("{MOVE_ITEM_0} was added to\n{POKEMON_0}'s list of usable tactics."); +const u8 *const gUnknown_80FF76C = _("Items can't be thrown when a Pokémon's\nterrified!"); +const u8 *const gText_Hints = _("Hints"); + +const u8 *const gHintsNames[HINTS_COUNT] = { + [HINTS_CONTROLS] = _("Controls"), + [HINTS_ORIENTATION] = _("Orientation"), + [HINTS_SEEDS] = _("Seeds"), + [HINTS_MOVES] = _("Moves"), + [HINTS_RANGE] = _("Range"), + [HINTS_LINKING_MOVES] = _("Linking moves"), + [HINTS_POKEMON_TYPES] = _("Pokémon types"), + [HINTS_TOUCH_SCREEN] = _("Touch Screen"), +}; + +const u8 *const gHintsDescriptions[2][HINTS_COUNT] = { + [0] = { + [HINTS_CONTROLS] = _("{L_BUTTON}+{A_BUTTON}: Use set move\n{L_BUTTON}+{B_BUTTON}: Display message log\n{L_BUTTON}+{R_BUTTON}: Throw set item\n{R_BUTTON}+{DPAD}: Move diagonally\n{SELECT_BUTTON}: Floor map\n{START_BUTTON}: Rotate mode\nSelect item/move + {START_BUTTON}: Description"), + [HINTS_ORIENTATION] = _("Avoid attacks by moving diagonally.\nKeeping {R_BUTTON} pressed, press\n{DPAD} to move only diagonally.\nIt's also crucial to change the direction\nyou're facing without taking a step.\nJust tap {R_BUTTON}!"), + [HINTS_SEEDS] = _("Seeds can be thrown.\nThey are usually for eating, but throw\nthem at foes to get the same effect.\nIf you have any Seeds you don't want\nto eat, try throwing them at foes.\nYou can also throw them at partners.\nIf they hit, their effects will be felt."), + [HINTS_MOVES] = _("Normal-, Steel-, Poison-, Ground-,\nFlying-, Bug-, Rock-, Ghost-, and\nFighting-type moves are based on\nAttack and Defense. Fire-, Dark-,\nWater-, Grass-, Electric-, Ice-,\nPsychic-, and Dragon-type moves\nare based on Sp. Atk. and Sp. Def."), + [HINTS_RANGE] = _("All moves have a range of effect.\nA move that affects a room, such as\nGrowl, reaches 2 tiles when in a\ncorridor. However, if the visibility is\nlimited to only 1 tile, the move's\nrange will be likewise restricted.\nCheck the descriptions of moves!"), + [HINTS_LINKING_MOVES] = _("Moves can be linked at the Gulpin Link\nShop or by using a Link Box.\nTwo moves can be linked and used\nsimultaneously.\nIf they're used even once in defeating\na foe, you will earn more Exp. Points,\nbut your Belly will go down faster, too."), + [HINTS_POKEMON_TYPES] = _("There are seventeen types of Pokémon\nand moves: Normal, Fire, Water, Grass,\nElectric, Ice, Fighting, Poison, Ground,\nFlying, Psychic, Bug, Rock, Ghost,\nDragon, Dark, and Steel. All Pokémon\nhave one or two types that determine\nthe damage they take and give."), + [HINTS_TOUCH_SCREEN] = _("Press once: Push a foe to attack.\nTouch the floor to move. Advance text.\nCancel.\nPress twice: Use the set move.\nPress your Pokémon to move fast.\nKeep pressed to change directions\nwithout moving."), + }, + [1] = { + [HINTS_CONTROLS] = _("{L_BUTTON}+{A_BUTTON}: Use set move\n{L_BUTTON}+{B_BUTTON}: Display message log\n{L_BUTTON}+{R_BUTTON}: Throw set item\n{R_BUTTON}+{DPAD}: Move diagonally\n{NDS_Y_BUTTON}: Rotate mode\n{SELECT_BUTTON}: Floor map\nSelect item/move + {START_BUTTON}: Description"), + [HINTS_ORIENTATION] = _("Avoid attacks by moving diagonally.\nKeeping {R_BUTTON} pressed, press\n{DPAD} to move only diagonally.\nIt's crucial to change the direction\nyou're facing without taking a step.\nHold {NDS_Y_BUTTON} to do so.\n"), + [HINTS_SEEDS] = _("Seeds can be thrown.\nThey are usually for eating, but throw\nthem at foes to get the same effect.\nIf you have any Seeds you don't want\nto eat, try throwing them at foes.\nYou can also throw them at partners.\nIf they hit, their effects will be felt."), + [HINTS_MOVES] = _("Normal-, Steel-, Poison-, Ground-,\nFlying-, Bug-, Rock-, Ghost-, and\nFighting-type moves are based on\nAttack and Defense. Fire-, Dark-,\nWater-, Grass-, Electric-, Ice-,\nPsychic-, and Dragon-type moves\nare based on Sp. Atk. and Sp. Def."), + [HINTS_RANGE] = _("All moves have a range of effect.\nA move that affects a room, such as\nGrowl, reaches 2 tiles when in a\ncorridor. However, if the visibility is\nlimited to only 1 tile, the move's\nrange will be likewise restricted.\nCheck the descriptions of moves!"), + [HINTS_LINKING_MOVES] = _("Moves can be linked at the Gulpin Link\nShop or by using a Link Box.\nTwo moves can be linked and used\nsimultaneously.\nIf they're used even once in defeating\na foe, you will earn more Exp. Points,\nbut your Belly will go down faster, too."), + [HINTS_POKEMON_TYPES] = _("There are seventeen types of Pokémon\nand moves: Normal, Fire, Water, Grass,\nElectric, Ice, Fighting, Poison, Ground,\nFlying, Psychic, Bug, Rock, Ghost,\nDragon, Dark, and Steel. All Pokémon\nhave one or two types that determine\nthe damage they take and give."), + [HINTS_TOUCH_SCREEN] = _("Touch once to attack a foe, walk,\nadvance text, cancel, or pick up \nan item off the ground.\nTouch twice to use the set move.\nTouch the leader twice to move fast.\nTouch and hold to change directions\nwithout taking a step."), + } +}; + +const u8 *const gUnknown_8100208 = _("Switch places with your teammate?\nThis will cause the teammate to warp."); +const u8 *const gPtrMagnitudeMessage = _("It's Magnitude {VALUE_0}!"); +const u8 *const gPtrSleepingTargetOnlyMessage = _("It only works on a sleeping target!"); +const u8 *const gPtrFeralFoundItemMessage = _("{POKEMON_0} found an item somewhere."); +const u8 *const gPtrSelfHealPreventedHungerMessage = _("Its self-healing prevented hunger!"); +const u8 *const gUnknown_81002B8 = _("Rescue challenges left: {VALUE_0}"); +const u8 *const gPtrFinalChanceMessage = _("This is your final chance!"); +const u8 *const gPtrLinkedMovesComeApartMessage = _("The linked moves came apart!"); +const u8 *const gPtrLinkMoveOneUseWarningMessage = _("{color YELLOW}The linked moves are almost out of PP!{reset}\n{color YELLOW}Use them again and they will come apart!{reset}"); +const u8 *const gPtrLinkMoveTwoUsesWarningMessage = _("{color YELLOW}The linked moves are almost out of PP!{reset}\n{color YELLOW}Use them twice and they will come apart!{reset}"); +const u8 *const gPtrIcePartCrumbledMessage = _("The Ice Part crumbled away..."); +const u8 *const gPtrRockPartCrumbledMessage = _("The Rock Part crumbled away..."); +const u8 *const gPtrSteelPartCrumbledMessage = _("The Steel Part crumbled away..."); +const u8 *const gPtrWishStoneCrumbledMessage = _("The Wish Stone crumbled away..."); +const u8 *const gPtrMusicBoxPlayedCrumbledMessage = _("The Music Box played a beautiful melody,\nthen crumbled away..."); +const u8 *const gPtrMysteriousPowerPreventedUseMessage = _("But a mysterious power prevented its use!"); +const u8 *const gPtrCouldntBeUsedMessage = _("But it couldn't be used!"); +const u8 *const gUnknown_81004E8 = _("But nothing happened."); +const u8 *const gUnknown_81004EC = _("But nothing happened."); +const u8 *const gUnknown_81004F0 = _("But nothing happened."); +const u8 *const gUnknown_8100524 = _("{POKEMON_1}'s Soundproof suppressed\nthe sound move!"); +const u8 *const gUnknown_8100548 = _("The attack was barely endured!"); +const u8 *const gUnknown_810056C = _("False Swipe prevented fainting!"); +const u8 *const gUnknown_8100594 = _("Perish Song's effect wore off!"); +const u8 *const gPtrExposedWoreOffMessage = _("The Exposed status wore off!"); +const u8 *const gPtrSealedMoveReleasedMessage = _("The sealed move was released!"); +const u8 *const gPtrCantLeechSeedSelfMessage = _("A leech seed can't be planted on the user!"); +const u8 *const gPtrCantLeechSeedMonMessage = _("A leech seed couldn't be planted on\n{POKEMON_0}!"); +const u8 *const gPtrMoveInterruptedMessage = _("The move was interrupted!"); +const u8 *const gPtrClientFaintedMessage = _("Your client Pokémon has fainted!\nA rescue call can't be made!"); +const u8 *const gPtrCantUseInDungeonMessage = _("It can't be used in a dungeon!"); +const u8 *const gPtrForecastPreventsTypeSwitchMessage = _("Its Forecast prevents type switching!"); +const u8 *const gPtrForecastPreventsConversion2Message = _("Its Forecast prevents Conversion 2!"); +const u8 *const gPtrStenchWavedOffMessage = _("The stench was waved off!"); +const u8 *const gPtrProtectSavedItMessage = _("Its Protect saved it!"); diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 56d64ace0..e54d23143 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -1,27 +1,40 @@ #include "global.h" +#include "globaldata.h" +#include "dungeon_util.h" #include "structs/str_dungeon.h" #include "structs/str_traps.h" +#include "structs/map.h" #include "code_800F958.h" #include "code_8041AD0.h" #include "code_8069E0C.h" #include "code_807E5AC.h" #include "dungeon_items.h" #include "dungeon_map_access.h" +#include "code_803E724.h" +#include "dungeon_range.h" +#include "pokemon.h" +#include "code_805D8C8.h" +#include "constants/status.h" +#include "constants/item.h" +#include "dungeon_logic.h" +#include "dungeon_random.h" #include "dungeon_util.h" +#include "dungeon_leader.h" +#include "dungeon_message.h" +#include "dungeon_music.h" +#include "dungeon_map.h" +#include "string_format.h" +#include "items.h" +#include "trap.h" extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE]; extern u8 gUnknown_202EE76[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE]; -const DungeonPos gAdjacentTileOffsets[] = { - {0, 1}, - {1, 1}, - {1, 0}, - {1, -1}, - {0, -1}, - {-1, -1}, - {-1, 0}, - {-1, 1} -}; +extern const u8 *gUnknown_80FE6F4[]; + +extern void sub_8045ACC(void); +extern s32 GetMonsterApparentID(Entity *pokemon, s32 id); +extern void sub_8045BF8(u8 *, Item *); bool8 EntityIsValid(Entity *entity) { @@ -116,7 +129,8 @@ void sub_804513C(void) } } -void sub_804522C(void) { +void sub_804522C(void) +{ s32 index; Entity *entity; Entity *entity2; @@ -198,3 +212,414 @@ void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y) entity->pixelPos.y += y; } +Entity *sub_80453AC(s32 _species) +{ + s32 i; + s32 species = (s16) _species; + s32 validId = -1; + s32 bodySize = GetBodySize(species); + + for (i = 0; i <= MAX_TEAM_BODY_SIZE - bodySize; i++) { + s32 j; + for (j = 0; j < bodySize; j++) { + if (gUnknown_202EE70[i + j] != 0) + break; + } + + if (j == bodySize) { + validId = i; + break; + } + } + + if (validId != -1) { + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { + s32 apparentId; + s32 j; + Entity *entity = gDungeon->teamPokemon[i]; + + if (!EntityIsValid(entity)) { + entity->type = ENTITY_MONSTER; + entity->unk24 = i; + entity->axObj.info.monster = &gDungeon->unk69C[i]; + entity->axObj.info.monster->id = species; + apparentId = (s16) GetMonsterApparentID(NULL, species); + entity->axObj.info.monster->apparentID = apparentId; + entity->axObj.info.monster->isNotTeamMember = FALSE; + + entity->axObj.spriteFile = GetSpriteData((s16)GetMonsterApparentID(NULL, species)); + entity->axObj.unk40_maybeAnimTimer = (validId * 16) + 0x40; + entity->axObj.unk42_animId1 = 7; + entity->axObj.unk44_direction1 = 0; + entity->axObj.unk43_animId2 = 0xFF; + entity->axObj.unk45_orientation = 1; + entity->axObj.unk47 = 1; + + entity->unk1C = IntToF248(0); + sub_8045ACC(); + entity->axObj.info.monster->unk167 = validId; + entity->axObj.info.monster->unk168 = bodySize; + + for (j = 0; j < bodySize; j++) { + gUnknown_202EE70[validId] = 1; + validId++; + } + + entity->spawnGenID = gDungeon->unk644.unk24++; + return entity; + } + } + } + + return NULL; +} + +Entity *sub_804550C(s32 _species) +{ + s32 i; + s32 species = (s16) _species; + s32 validId = -1; + s32 bodySize = GetBodySize(species); + + for (i = 0; i <= DUNGEON_MAX_WILD_POKEMON_BODY_SIZE - bodySize; i++) { + s32 j; + for (j = 0; j < bodySize; j++) { + if (gUnknown_202EE76[i + j] != 0) + break; + } + + if (j == bodySize) { + validId = i; + break; + } + } + + if (validId != -1) { + for (i = 0; i < DUNGEON_MAX_WILD_POKEMON_BODY_SIZE; i++) { + s32 j; + Entity *entity = gDungeon->wildPokemon[i]; + + if (!EntityIsValid(entity)) { + entity->type = ENTITY_MONSTER; + entity->unk24 = i; + entity->unk22 = 0; + entity->axObj.info.monster = &gDungeon->unkEBC[i]; + entity->axObj.info.monster->id = species; + entity->axObj.info.monster->apparentID = GetMonsterApparentID(NULL, species); + entity->axObj.info.monster->isNotTeamMember = TRUE; + + entity->axObj.spriteFile = GetSpriteData((s16)GetMonsterApparentID(NULL, species)); + entity->axObj.unk40_maybeAnimTimer = ((validId + 6) * 16) + 0x40; + entity->axObj.unk42_animId1 = 7; + entity->axObj.unk44_direction1 = 0; + entity->axObj.unk43_animId2 = 0xFF; + entity->axObj.unk45_orientation = 1; + entity->axObj.unk47 = 1; + + entity->unk1C = IntToF248(0); + + entity->axObj.info.monster->unk167 = validId; + entity->axObj.info.monster->unk168 = bodySize; + + for (j = 0; j < bodySize; j++) { + gUnknown_202EE76[validId] = 1; + validId++; + } + + sub_8045ACC(); + + entity->spawnGenID = gDungeon->unk644.unk24++; + return entity; + } + } + } + + return NULL; +} + +Entity *SpawnTrap(u8 trapID, DungeonPos *pos, u8 c) +{ + Entity *entity; + s32 i; + + for (i = 0; i < DUNGEON_MAX_TRAPS; i++) { + entity = gDungeon->traps[i]; + if (!EntityIsValid(entity)) { + entity->type = ENTITY_TRAP; + entity->axObj.info.trap = &gDungeon->unk3908[i]; + entity->axObj.info.trap->id = trapID; + entity->axObj.info.trap->unk1 = c; + + entity->unk1C = IntToF248(0); + entity->unk22 = 0; + entity->pos = *pos; + entity->spawnGenID = 0; + return entity; + } + } + + return NULL; +} + +Entity *sub_8045708(DungeonPos *pos) +{ + s32 i; + Entity *ent; + + if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA + && (GetTileMut(pos->x, pos->y)->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { + return NULL; + } + + for (i = 0; i < DUNGEON_MAX_ITEMS; i++) { + ent = gDungeon->items[i]; + if (!EntityIsValid(ent)) { + ent->type = ENTITY_ITEM; + ent->axObj.info.item = &gDungeon->unk3804[i]; + + ent->pos = *pos; + SetEntityPixelPos(ent, ((pos->x * 24) + 4) * 0x100, ((pos->y * 24) + 4) * 0x100); + ent->spawnGenID = 0; + ent->unk22 = 0; + ent->unk1C = IntToF248(0); + return ent; + } + } + + return NULL; +} + +void sub_80457DC(Entity* ent) +{ + ent->type = ENTITY_UNK_5; + ent->pos.x = 0; + ent->pos.y = 0; + SetEntityPixelPos(ent, 0, 0); + ent->spawnGenID = 0; + ent->unk22 = 0; +} + +bool8 sub_8045804(Entity *ent) +{ + UnkDungeonGlobal_unk181E8_sub* saveTyping; + Entity* camTarget; + EntityInfo *monInfo; + + switch (GetEntityType(ent)) { + case ENTITY_MONSTER: { + if (ent->isVisible) { + saveTyping = &gDungeon->unk181e8; + camTarget = saveTyping->cameraTarget; + monInfo = GetEntInfo(ent); + + if (!monInfo->isNotTeamMember) + return TRUE; + + if (!saveTyping->showInvisibleTrapsMonsters && monInfo->invisibleClassStatus.status == STATUS_INVISIBLE) + return FALSE; + + if (saveTyping->allTilesRevealed || saveTyping->unk1820D) + return TRUE; + + if (camTarget != NULL) + return IsPositionActuallyInSight(&saveTyping->cameraPos, &ent->pos); + } + return FALSE; + } + /*case ENTITY_TRAP: + case ENTITY_ITEM: + case ENTITY_UNK_4:*/ + default: { + return TRUE; + } + case ENTITY_NOTHING: + case ENTITY_UNK_5: { + return FALSE; + } + } +} + +bool8 sub_8045888(Entity *ent) +{ + if (ent->isVisible) { + s32 x = (ent->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x; + s32 y = (ent->pixelPos.y / 256) - gDungeon->unk181e8.cameraPixelPos.y; + + if (x >= -32 && y >= -32 && x <= 272 && y <= 192) { + UnkDungeonGlobal_unk181E8_sub *saveTyping = &gDungeon->unk181e8; + + switch (GetEntityType(ent)) { + case ENTITY_ITEM: { + if (!saveTyping->showAllFloorItems && !sub_803F428(&ent->pos)) + return FALSE; + break; + } + case ENTITY_MONSTER: { + EntityInfo *monInfo = GetEntInfo(ent); + + if (monInfo->isNotTeamMember) { + if (!gDungeon->unk181e8.showInvisibleTrapsMonsters && monInfo->invisibleClassStatus.status == STATUS_INVISIBLE) + return FALSE; + + if (!saveTyping->unk1820D && !sub_803F428(&ent->pos)) + return FALSE; + } + break; + } + case ENTITY_TRAP: { + if (!gDungeon->unk181e8.showInvisibleTrapsMonsters && !ent->isVisible) + return FALSE; + break; + } + case ENTITY_NOTHING: + case ENTITY_UNK_5: { + return FALSE; + } + case ENTITY_UNK_4: + default: { + break; + } + } + + return TRUE; + } + } + + return FALSE; +} + +bool8 CanSeeTarget(Entity *entity, Entity *targetEntity) +{ + if (!EntityIsValid(entity) || !EntityIsValid(targetEntity) || !targetEntity->isVisible) + { + return FALSE; + } + if (targetEntity->type == ENTITY_MONSTER) + { + if (entity->type == ENTITY_MONSTER) + { + if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) + { + return FALSE; + } + if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) + { + return FALSE; + } + } + else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) + { + return FALSE; + } + } + return IsPositionActuallyInSight(&entity->pos, &targetEntity->pos); +} + +bool8 CanTargetEntity(Entity *entity, Entity *targetEntity) +{ + if (!EntityIsValid(entity) || !EntityIsValid(targetEntity) || !targetEntity->isVisible) + { + return FALSE; + } + if (targetEntity->type == ENTITY_MONSTER) + { + if (entity->type == ENTITY_MONSTER) + { + if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) + { + return FALSE; + } + if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) + { + return FALSE; + } + } + else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) + { + return FALSE; + } + } + return IsPositionInSight(&entity->pos, &targetEntity->pos); +} + +bool8 sub_8045A70(Entity *entity, Entity *targetEntity) +{ + if (EntityIsValid(entity) && EntityIsValid(targetEntity) && targetEntity->isVisible) + { + return IsPositionActuallyInSight(&entity->pos, &targetEntity->pos); + } + return FALSE; +} + +bool8 sub_8045AAC(Entity *entity, DungeonPos *pos) +{ + return IsPositionActuallyInSight(&entity->pos, pos); +} + +bool8 CanTargetPosition(Entity *entity, DungeonPos *pos) +{ + return IsPositionInSight(&entity->pos, pos); +} + +void sub_8045ACC(void) +{ + Entity *entity; + s32 index; + s32 pokeCount; + + pokeCount = 0; + + for(index = 0; index < MAX_TEAM_MEMBERS; index++) + { + entity = gDungeon->teamPokemon[index]; + if (EntityIsValid(entity)) { + gDungeon->activePokemon[pokeCount] = entity; + pokeCount++; + } + } + + for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) + { + entity = gDungeon->wildPokemon[index]; + if (EntityIsValid(entity)) { + gDungeon->activePokemon[pokeCount] = entity; + pokeCount++; + } + } + for (; pokeCount < DUNGEON_MAX_POKEMON; pokeCount++) { + gDungeon->activePokemon[pokeCount] = NULL; + } +} + +s32 GetTeamMemberEntityIndex(Entity *pokemon) +{ + Entity *entity; + s32 index; + + for(index = 0; index < MAX_TEAM_MEMBERS; index++) + { + entity = gDungeon->teamPokemon[index]; + if (pokemon == entity) + return index; + } + return -1; +} + +void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3) +{ + switch(GetEntityType(entity)) + { + case ENTITY_MONSTER: + SetMessageArgument_2(buffer, GetEntInfo(entity), param_3); + break; + case ENTITY_ITEM: + sub_8045BF8(buffer, GetItemData_1(entity)); + break; + case ENTITY_TRAP: + GetTrapName(buffer, GetTrapData_1(entity)->id); + break; + default: + strcpy(buffer, *gUnknown_80FE6F4); + break; + } +} diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index 47465fbe3..ef2df02e7 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -3,7 +3,6 @@ #include "dungeon_misc.h" #include "code_803E46C.h" #include "code_803E668.h" -#include "code_80450F8.h" #include "code_806CD90.h" #include "constants/direction.h" #include "constants/dungeon.h" @@ -345,15 +344,15 @@ bool8 ShouldRunMonsterAI(Entity *pokemon) { case BEHAVIOR_RESCUE_TARGET: case BEHAVIOR_SKARMORY: - case BEHAVIOR_5: - case BEHAVIOR_6: + case BEHAVIOR_GENGAR: + case BEHAVIOR_EKANS: case BEHAVIOR_MEDICHAM: case BEHAVIOR_ZAPDOS: case BEHAVIOR_MOLTRES: case BEHAVIOR_ARTICUNO: case BEHAVIOR_GROUDON_2: case BEHAVIOR_RAYQUAZA: - case BEHAVIOR_16: + case BEHAVIOR_MANKEY: case BEHAVIOR_MEWTWO: case BEHAVIOR_ENTEI: case BEHAVIOR_RAIKOU: @@ -373,7 +372,7 @@ bool8 ShouldRunMonsterAI(Entity *pokemon) case BEHAVIOR_33: case BEHAVIOR_34: case BEHAVIOR_35: - case BEHAVIOR_36: + case BEHAVIOR_MAZE_BOSS: return TRUE; case BEHAVIOR_FIXED_ENEMY: case BEHAVIOR_ALLY: diff --git a/src/dungeon_visibility.c b/src/dungeon_visibility.c deleted file mode 100644 index 4ba991e6d..000000000 --- a/src/dungeon_visibility.c +++ /dev/null @@ -1,81 +0,0 @@ -#include "global.h" -#include "dungeon_visibility.h" - -#include "constants/status.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_range.h" -#include "dungeon_util.h" - -bool8 CanSeeTarget(Entity *entity, Entity *targetEntity) -{ - if (!EntityIsValid(entity) || !EntityIsValid(targetEntity) || !targetEntity->isVisible) - { - return FALSE; - } - if (targetEntity->type == ENTITY_MONSTER) - { - if (entity->type == ENTITY_MONSTER) - { - if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) - { - return FALSE; - } - if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) - { - return FALSE; - } - } - else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) - { - return FALSE; - } - } - return IsPositionActuallyInSight(&entity->pos, &targetEntity->pos); -} - -bool8 CanTargetEntity(Entity *entity, Entity *targetEntity) -{ - if (!EntityIsValid(entity) || !EntityIsValid(targetEntity) || !targetEntity->isVisible) - { - return FALSE; - } - if (targetEntity->type == ENTITY_MONSTER) - { - if (entity->type == ENTITY_MONSTER) - { - if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) - { - return FALSE; - } - if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) - { - return FALSE; - } - } - else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) - { - return FALSE; - } - } - return IsPositionInSight(&entity->pos, &targetEntity->pos); -} - -bool8 sub_8045A70(Entity *entity, Entity *targetEntity) -{ - if (EntityIsValid(entity) && EntityIsValid(targetEntity) && targetEntity->isVisible) - { - return IsPositionActuallyInSight(&entity->pos, &targetEntity->pos); - } - return FALSE; -} - -bool8 sub_8045AAC(Entity *entity, DungeonPos *pos) -{ - return IsPositionActuallyInSight(&entity->pos, pos); -} - -bool8 CanTargetPosition(Entity *entity, DungeonPos *pos) -{ - return IsPositionInSight(&entity->pos, pos); -} - diff --git a/src/dungeon_wind.c b/src/dungeon_wind.c new file mode 100644 index 000000000..3479d0c23 --- /dev/null +++ b/src/dungeon_wind.c @@ -0,0 +1,90 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_misc.h" +#include "code_804267C.h" +#include "dungeon_message.h" +#include "constants/ability.h" +#include "constants/type.h" +#include "dungeon_ai.h" +#include "dungeon_leader.h" +#include "dungeon_map_access.h" +#include "dungeon_logic.h" +#include "dungeon_util.h" +#include "dungeon_config.h" +#include "dungeon_strings.h" +#include "move_util.h" +#include "moves.h" +#include "structs/str_dungeon.h" + +extern u8 UseAttack(Entity *); +extern void sub_805E804(void); +void sub_806A2BC(Entity *pokemon, u8 param_2); +extern u8 sub_8044B28(void); +extern void nullsub_93(DungeonPos *); +extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); +extern void sub_807EC28(bool8); +extern void sub_806A5B8(Entity *); + +void sub_807E378(void) +{ + u16 uVar2; + Entity *leader; + + leader = GetLeader(); + if (EntityIsValid(leader)) { + + uVar2 = gDungeon->unk644.windTurns; + if ((gDungeon->unk644.windTurns < 1) || + (gDungeon->unk644.windTurns--, ((uVar2 - 1) << 0x10) < 1)) { + gDungeon->unk644.unk36 = 3; + } + + if (gDungeon->unk644.unk36 == 0) { + if (gDungeon->unk644.windTurns < 0xfa) { + sub_805E804(); + sub_806A2BC(leader,1); + UseAttack(leader); + if (sub_8044B28() == 0) { + LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C4C); + sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); + gDungeon->unk644.unk36 = 1; + } + } + } + else if (gDungeon->unk644.unk36 == 1) { + if (gDungeon->unk644.windTurns < 0x96) { + sub_805E804(); + sub_806A2BC(leader,1); + UseAttack(leader); + if (sub_8044B28() == 0) { + LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C70); + sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); + gDungeon->unk644.unk36 = 2; + } + } + } + else if (gDungeon->unk644.unk36 == 2) { + if (gDungeon->unk644.windTurns < 0x32) { + sub_805E804(); + sub_806A2BC(leader,1); + UseAttack(leader); + if (sub_8044B28() == 0) { + LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C8C); + sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); + gDungeon->unk644.unk36 = 3; + } + } + } + else if (gDungeon->unk644.windTurns < 1) { + sub_805E804(); + sub_806A2BC(leader,1); + UseAttack(leader); + if (sub_8044B28() == 0) { + LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9CBC); + sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); + gDungeon->unk644.unk36 = 4; + sub_8068FE0(leader,0x21e,leader); + } + } + } +} diff --git a/src/exclusive_pokemon.c b/src/exclusive_pokemon.c index 96a7c7900..de8c43553 100644 --- a/src/exclusive_pokemon.c +++ b/src/exclusive_pokemon.c @@ -1,21 +1,6 @@ #include "global.h" #include "exclusive_pokemon.h" - -const struct ExclusivePokemon gExclusivePokemon[NUM_EXCLUSIVE_POKEMON] = { - - RED_EXCLUSIVE(MONSTER_PORYGON), - BLUE_EXCLUSIVE(MONSTER_PORYGON2), - BLUE_EXCLUSIVE(MONSTER_MAGIKARP), - BLUE_EXCLUSIVE(MONSTER_GYARADOS), - RED_EXCLUSIVE(MONSTER_FEEBAS), - RED_EXCLUSIVE(MONSTER_MILOTIC), - RED_EXCLUSIVE(MONSTER_PLUSLE), - BLUE_EXCLUSIVE(MONSTER_MINUN), - BLUE_EXCLUSIVE(MONSTER_LAPRAS), - RED_EXCLUSIVE(MONSTER_MANTINE), - RED_EXCLUSIVE(MONSTER_ROSELIA), - BLUE_EXCLUSIVE(MONSTER_AIPOM), -}; +#include "dungeon_data.h" const u8 filler_ex0[8] = { diff --git a/src/explosion.c b/src/explosion.c new file mode 100644 index 000000000..837cf0a19 --- /dev/null +++ b/src/explosion.c @@ -0,0 +1,209 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +extern u8 sub_8044B28(void); +extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); +extern void sub_804216C(Entity *pokemon, Entity *target, u32 r2); +extern void sub_804218C(Entity *pokemon, Entity *target); + +static EWRAM_INIT u32 gUnknown_203B444[3] = {0x28, 0x28, 0x50}; + +void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s32 param_4,s32 param_5); + +static const DungeonPos gUnknown_81070E8[] = { + {0, 0}, + {0, 1}, + {1, 1}, + {1, 0}, + {1, -1}, + {0, -1}, + {-1, -1}, + {-1, 0}, + {-1, 1}, + {99, 99}, +}; + +static const DungeonPos gUnknown_8107110[] = { + {0, 0}, + {0, 1}, + {1, 1}, + {1, 0}, + {1, -1}, + {0, -1}, + {-1, -1}, + {-1, 0}, + {-1, 1}, + {0, 2}, + {1, 2}, + {2, 2}, + {2, 1}, + {2, 0}, + {2, -1}, + {2, -2}, + {1, -2}, + {0, -2}, + {-1, -2}, + {-2, -2}, + {-2, -1}, + {-2, 0}, + {-2, 1}, + {-2, 2}, + {-1, 2}, + {99, 99}, +}; + +static const DungeonPos *const gUnknown_8107178[3] = { + gUnknown_81070E8, + gUnknown_81070E8, + gUnknown_8107110 +}; + +void HandleExplosion(Entity *pokemon,Entity *target,DungeonPos *param_3,s32 param_4,u8 moveType,s16 param_6) +{ + bool8 flag; + const DungeonPos *posPtr; + Tile *tile; + Entity * entity1; + Entity *entity2; + int x; + int y; + int index; + DungeonPos pos; + + u32 uStack_2c; + + uStack_2c = param_6; + for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { + entity1 = gDungeon->activePokemon[index]; + if ((EntityIsValid(entity1)) && (AbilityIsActive(entity1, ABILITY_DAMP))) break; + } + if (index != DUNGEON_MAX_POKEMON) { + sub_804218C(pokemon,target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80F96EC); + } + else if (GetApparentWeather(target) == WEATHER_RAIN) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80F96EC); + } + else + { + sub_804216C(pokemon,target,param_4); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80F96BC); + flag = FALSE; + + posPtr = (gUnknown_8107178)[param_4]; + if (posPtr->x != 99) { + while (posPtr->x != 99) { + pos.x = posPtr->x + param_3->x; + pos.y = posPtr->y + param_3->y; + if ((0 <= pos.x) && (0 <= pos.y) && (pos.x < DUNGEON_MAX_SIZE_X) && (pos.y < DUNGEON_MAX_SIZE_Y)) { + tile = GetTileMut(pos.x,pos.y); + if ((0 < pos.x) && (0 < pos.y && ((pos.x < (DUNGEON_MAX_SIZE_X - 1) && ((pos.y < (DUNGEON_MAX_SIZE_Y - 1) + && GetTerrainType(tile) == TERRAIN_TYPE_WALL))) + )) && (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) { + SetTerrainNormal(tile); + for(y = -1; y < 2; y++) + { + for(x = -1; x < 2; x++) + { + sub_80498A8(pos.x + x,pos.y + y); + } + } + flag = TRUE; + } + entity2 = tile->object; + if (((entity2 != NULL) && (entity2 != target)) && (GetEntityType(entity2) == ENTITY_ITEM)) { + RemoveItemFromDungeonAt(&pos, 0); + } + entity2 = tile->monster; + if (((entity2 != NULL) && (entity2 != target)) && (GetEntityType(entity2) == ENTITY_MONSTER)) { + sub_807E1A0(pokemon,entity2,moveType,uStack_2c,gUnknown_203B444[param_4]); + if (sub_8044B28()) break; + } + } + posPtr++; + } + } + if (sub_8044B28()) { + return; + } + if (GetEntityType(target) == ENTITY_MONSTER) { + sub_807E1A0(pokemon,target,moveType,uStack_2c,gUnknown_203B444[param_4]); + } + if (!flag) { + return; + } + for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) + { + for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) + { + sub_8049BB0(x,y); + } + } + ShowWholeRevealedDungeonMap(); + sub_8049ED4(); + } +} + +void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s32 param_4,s32 param_5) +{ + EntityInfo *targetInfo; + u8 flag; + Move move; + s32 newHP; + s32 param_4_s32; + + param_4_s32 = (s16) param_4; + + if (EntityIsValid(target)) { + targetInfo = GetEntInfo(target); + InitPokemonMove(&move, MOVE_REGULAR_ATTACK); + if (!sub_80571F0(target,&move)) { + if (!targetInfo->isNotTeamMember) { + newHP = targetInfo->HP; + newHP /= 2; + if (MonsterIsType(target, TYPE_FIRE)) { + newHP /= 2; + } + if (newHP < 1) { + newHP = 1; + } + } + else { + newHP = param_5; + if (MonsterIsType(target, TYPE_FIRE)) { + newHP /= 2; + } + } + sub_806F370(pokemon,target,newHP,0,&flag,moveType,param_4_s32,0,0,0); + } + } +} + diff --git a/src/expose_trap.c b/src/expose_trap.c new file mode 100644 index 000000000..929c7c824 --- /dev/null +++ b/src/expose_trap.c @@ -0,0 +1,88 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +bool8 ExposeTrap(s32 x,s32 y); + +void sub_807D3CC(Entity *param_1) +{ + u32 room; + u8 flag; + int x; + int y; + s32 range; + RoomData *roomData; + + flag = FALSE; + range = gDungeon->unk181e8.visibilityRange; + if (range == 0) { + range = 2; + } + room = GetEntityRoom(param_1); + + if (room == CORRIDOR_ROOM) { + for (y = (param_1->pos).y - range; y <= ((param_1->pos).y + range); y++) + { + for (x = (param_1->pos).x - range; x <= ((param_1->pos).x + range); x++) { + flag |= ExposeTrap(x,y); + } + } + } + else { + roomData = &gDungeon->roomData[room]; + for (y = roomData->bottomRightCornerY + -1; y <= roomData->topLeftCornerY + 1; y++) { + for (x = roomData->bottomRightCornerX + -1; x <= roomData->topLeftCornerX + 1; x++) { + flag |= ExposeTrap(x,y); + } + } + } + if (flag) { + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80FD2F8); // All traps were exposed + ShowWholeRevealedDungeonMap(); + sub_8049ED4(); + } + else { + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80FD320); // There appears to be no hidden traps. + } +} + +bool8 ExposeTrap(s32 x,s32 y) +{ + const Tile *tile; + Entity *trap; + + tile = GetTile(x,y); + trap = tile->object; + if (((trap != NULL) && (GetEntityType(trap) == ENTITY_TRAP)) && (!trap->isVisible)) { + trap->isVisible = TRUE; + return TRUE; + } + else { + return FALSE; + } +} diff --git a/src/friend_area.c b/src/friend_area.c index 6e0c5e49a..3eb41a680 100644 --- a/src/friend_area.c +++ b/src/friend_area.c @@ -7,6 +7,7 @@ #include "items.h" #include "pokemon.h" #include "strings.h" +#include "dungeon_data.h" EWRAM_DATA static bool8 sBoughtFriendAreas[NUM_FRIEND_AREAS] = {0}; @@ -15,7 +16,6 @@ EWRAM_INIT bool8 *gFriendAreas = {NULL}; // data_8107010.s extern const u8 sUnknown_81098A4[]; extern const u8 sUnknown_81098AC[]; -#include "data/friend_area_settings.h" // 810AA90 void LoadFriendAreas(void) { @@ -41,7 +41,7 @@ u8 sub_80923D4(s32 target) s32 sum = 0; for (i = 0; i < NUM_FRIEND_AREAS; i++) { - sum += sFriendAreaSettings[i].num_pokemon; + sum += gFriendAreaSettings[i].num_pokemon; if (sum > target) return i; } @@ -100,12 +100,12 @@ const u8 *GetFriendAreaName(u8 index) u8 GetFriendAreaUnlockCondition(u8 index) { - return sFriendAreaSettings[index].unlock_condition; + return gFriendAreaSettings[index].unlock_condition; } s32 GetFriendAreaPrice(u8 index) { - return sFriendAreaSettings[index].price; + return gFriendAreaSettings[index].price; } void sub_8092558(u8 *buffer, u8 index) @@ -119,7 +119,7 @@ void WriteFriendAreaName(u8 *buffer, u8 index, bool8 printPrice) u8 priceBuffer[20]; if (printPrice) { - WriteHighDecimal(sFriendAreaSettings[index].price, priceBuffer, 1); + WriteHighDecimal(gFriendAreaSettings[index].price, priceBuffer, 1); sprintfStatic(buffer, sUnknown_81098AC, gFriendAreaNames[index], 96, priceBuffer); } else @@ -162,14 +162,14 @@ void GetFriendAreaCapacity2(u8 friendArea, FriendAreaCapacity *dst, bool8 checkL iVar4 = 0; for (i = 0; i < friendArea; i++) - iVar4 += sFriendAreaSettings[i].num_pokemon; + iVar4 += gFriendAreaSettings[i].num_pokemon; dst->unk8 = iVar4; dst->hasFriendArea = gFriendAreas[i]; if (dst->hasFriendArea) { dst->currNoPokemon = 0; - dst->maxPokemon = sFriendAreaSettings[i].num_pokemon; + dst->maxPokemon = gFriendAreaSettings[i].num_pokemon; for (i = 0; i < dst->maxPokemon; i++, iVar4++) { pokeStruct = &gRecruitedPokemonRef->pokemon[iVar4]; @@ -197,14 +197,14 @@ void GetFriendAreaCapacity(u8 areaId, FriendAreaCapacity *dst, bool8 checkPartne r5 = 0; for (i = 0; i < areaId; i++) - r5 += sFriendAreaSettings[i].num_pokemon; + r5 += gFriendAreaSettings[i].num_pokemon; dst->unk8 = r5; dst->hasFriendArea = gFriendAreas[i]; if (dst->hasFriendArea) { dst->currNoPokemon = 0; - dst->maxPokemon = sFriendAreaSettings[i].num_pokemon; + dst->maxPokemon = gFriendAreaSettings[i].num_pokemon; max = dst->maxPokemon; for (i = 0; i < max; i++, r5++) { diff --git a/src/hurl_orb.c b/src/hurl_orb.c new file mode 100644 index 000000000..9a2703772 --- /dev/null +++ b/src/hurl_orb.c @@ -0,0 +1,251 @@ +#include "global.h" +#include "globaldata.h" +#include "code_803E46C.h" +#include "code_803E668.h" +#include "code_8041AD0.h" +#include "code_804267C.h" +#include "code_805D8C8.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_807CD9C.h" +#include "code_807E5AC.h" +#include "constants/ability.h" +#include "constants/monster.h" +#include "constants/type.h" +#include "constants/weather.h" +#include "dungeon.h" +#include "dungeon_ai.h" +#include "dungeon_config.h" +#include "dungeon_generation.h" +#include "dungeon_items.h" +#include "dungeon_leader.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_misc.h" +#include "dungeon_music.h" +#include "dungeon_random.h" +#include "dungeon_strings.h" +#include "dungeon_util.h" +#include "math.h" +#include "moves.h" +#include "move_effects_target.h" +#include "move_util.h" +#include "pokemon.h" +#include "position_util.h" +#include "run_dungeon.h" +#include "sprite.h" +#include "string_format.h" +#include "structs/map.h" +#include "structs/str_dungeon.h" +#include "weather.h" + +extern void sub_80833E8(DungeonPos *param_1, s32 *param_2); +extern void sub_806A5B8(Entity *); +extern bool8 sub_8045888(Entity *ent); +extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); +extern void sub_807D068(Entity *, DungeonPos *); +extern void sub_807EC28(bool8 arg0); + +void sub_807F9BC(Entity *entity); + +void sub_807F43C(Entity *target, Entity *attacker) +{ + s32 attackerDirection; + s32 var_3C; + DungeonPos attackerPos; + s32 pixelPosX, pixelPosY; + PixelPos var_54; + s32 var_30, r10; + s32 r6; + s32 newDir; + s32 i, directionId; + Entity *tileEntity; + s32 var_2C; + DungeonPos positions[40]; + s32 var_74[4]; + s32 positionsCounter; + + if (AbilityIsActive(attacker, ABILITY_SUCTION_CUPS)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FCB40); // is anchored, cannot be moved + return; + } + if (target == attacker) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FCB70); // couldn't be thrown for some reason + return; + } + + attackerPos = attacker->pos; + for (var_3C = 0; var_3C < 2; var_3C++) { + positionsCounter = 0; + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *mon = gDungeon->activePokemon[i]; + if (EntityIsValid(mon) && target != mon && attacker != mon && CanSeeTarget(target, mon)) { + if (var_3C == 0) { + if (GetTreatmentBetweenMonsters(target, mon, FALSE, TRUE) != 1) + continue; + } + else { + if (GetTreatmentBetweenMonsters(target, mon, FALSE, TRUE) != 0) + continue; + } + + if (var_3C == 0) { + DungeonPos pos; + for (directionId = 0; directionId < NUM_DIRECTIONS; directionId++) { + pos.x = gAdjacentTileOffsets[directionId].x + mon->pos.x; + pos.y = gAdjacentTileOffsets[directionId].y + mon->pos.y; + if (!sub_80703A0(attacker, &pos)) + break; + } + + if (directionId != NUM_DIRECTIONS && positionsCounter < 40) { + positions[positionsCounter++] = mon->pos; + } + } + else { + DungeonPos pos; + for (directionId = 0; directionId < NUM_DIRECTIONS; directionId++) { + pos.x = gAdjacentTileOffsets[directionId].x + mon->pos.x; + pos.y = gAdjacentTileOffsets[directionId].y + mon->pos.y; + if (!sub_80703A0(attacker, &pos) && positionsCounter < 40) { + positions[positionsCounter++] = pos; + } + } + } + } + } + + if (positionsCounter != 0) + break; + } + + if (positionsCounter != 0) { + s32 rnd = DungeonRandInt(positionsCounter); + attackerPos = positions[rnd]; + } + else { + sub_80833E8(&target->pos, var_74); + for (i = 0; i < 100; i++) { + DungeonPos pos; + pos.x = DungeonRandRange(var_74[0], var_74[2]); + pos.y = DungeonRandRange(var_74[1], var_74[3]); + if (!sub_80703A0(attacker, &pos)) { + attackerPos = pos; + break; + } + } + if (i == 100) { + TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FE6B4); // But it didn~27t go anywhere. + return; + } + } + + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FE690); // m0 was sent flying! + if (sub_8045888(attacker)) { + PlaySoundEffect(0x1A3); + } + + var_2C = 0; + attackerDirection = GetEntInfo(attacker)->action.direction; + r6 = max(attackerPos.x - attacker->pos.x, attackerPos.y - attacker->pos.y) << 4; + if (r6 > 80) + r6 = 80; + if (r6 < 10) + r6 = 10; + + newDir = GetDirectionTowardsPosition(&attackerPos, &attacker->pos); + + pixelPosX = X_POS_TO_PIXELPOS(attackerPos.x) + ((gAdjacentTileOffsets[newDir].x << 8) / 3); + pixelPosY = Y_POS_TO_PIXELPOS(attackerPos.y) + ((gAdjacentTileOffsets[newDir].y << 8) / 3); + + var_30 = (pixelPosX - attacker->pixelPos.x) / r6; + r10 = (pixelPosY - attacker->pixelPos.y) / r6; + var_54.x = attacker->pixelPos.x; + var_54.y = attacker->pixelPos.y; + for (i = 0; i < r6; i++) { + var_54.x += var_30; + var_54.y += r10; + sub_804535C(attacker, &var_54); + if (sub_8045888(attacker)) { + attacker->unk1C.raw = sin_4096(var_2C) << 5; + DungeonRunFrameActions(0x3B); + if (!(i & 3)) { + attackerDirection &= DIRECTION_MASK; + sub_806CDD4(attacker, 6, attackerDirection); + attackerDirection++; + } + } + var_2C += (0x800 / r6); + } + + var_54.x = pixelPosX; + var_54.y = pixelPosY; + attacker->unk1C.raw = 0; + sub_804535C(attacker, &var_54); + DungeonRunFrameActions(0x3B); + GetEntInfo(attacker)->action.direction = attackerDirection & DIRECTION_MASK; + + tileEntity = GetTile(attackerPos.x, attackerPos.y)->monster; + if (!EntityIsValid(tileEntity)) { + sub_80694C0(attacker, attackerPos.x, attackerPos.y, 1); + sub_807F9BC(attacker); + } + else { + for (directionId = 0; directionId < NUM_DIRECTIONS; directionId++) { + DungeonPos pos; + + pos.x = gAdjacentTileOffsets[directionId].x + attackerPos.x; + pos.y = gAdjacentTileOffsets[directionId].y + attackerPos.y; + if (!sub_80703A0(attacker, &pos)) { + attackerPos = pos; + break; + } + } + if (directionId == NUM_DIRECTIONS) { + WarpTarget(target, attacker, 0, NULL); + } + else { + sub_807D068(attacker, &attackerPos); + sub_80694C0(attacker, attackerPos.x, attackerPos.y, 1); + } + + if (GetEntityType(tileEntity) == ENTITY_MONSTER) { + Move move; + + InitPokemonMove(&move, MOVE_REGULAR_ATTACK); + if (!sub_80571F0(tileEntity, &move)) { + sub_806F370(target, tileEntity, gHurlOrbDmgValue, FALSE, NULL, TYPE_NONE, 0x21A, 0, 0, 0); + } + if (EntityIsValid(tileEntity)) { + sub_806CE68(tileEntity, GetEntInfo(tileEntity)->action.direction); + } + } + + sub_806F370(target, attacker, gHurlOrbDmgValue, FALSE, NULL, TYPE_NONE, 0x219, 0, 0, 0); + if (EntityIsValid(attacker)) { + sub_806CE68(attacker, GetEntInfo(attacker)->action.direction); + } + sub_803E708(0x1E, 0x3B); + sub_807F9BC(attacker); + } +} + +void sub_807F9BC(Entity *entity) +{ + if (EntityIsValid(entity)) { + EntityInfo *entInfo = GetEntInfo(entity); + if (entInfo->isTeamLeader) { + gDungeon->unk1 = 0; + gDungeon->unk5C0 = -1; + sub_804AC20(&entity->pos); + sub_807EC28(FALSE); + } + sub_806A5B8(entity); + sub_8075900(entity, gDungeon->forceMonsterHouse); + } +} diff --git a/src/items.c b/src/items.c index 89e887a17..b2a1e05a6 100644 --- a/src/items.c +++ b/src/items.c @@ -14,6 +14,8 @@ #include "text_util.h" #include "strings.h" +extern const s32 gUnknown_810A3F0[100]; +extern const s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS]; extern const char gItemParaFileName[]; extern const char gUnknown_8109794[]; extern const char gUnknown_81097A4[]; @@ -39,8 +41,6 @@ EWRAM_INIT TeamInventory *gTeamInventoryRef = {NULL}; // NDS=020EAF98 extern void SortKecleonShopInventory(); bool8 AddKecleonWareItem(u8); -#include "data/items.h" - static void sub_8090F58(u8 *, u8 *, Item *, const unkStruct_8090F58 *); // arm9.bin::020610C0 diff --git a/src/main_loops.c b/src/main_loops.c index 62c13479b..e576740c7 100644 --- a/src/main_loops.c +++ b/src/main_loops.c @@ -10,7 +10,7 @@ #include "code_800C9CC.h" #include "code_800D090_1.h" #include "code_80118A4.h" -#include "code_8042B34.h" +#include "run_dungeon.h" #include "code_8094F88.h" #include "code_80958E8.h" #include "code_8097670.h" diff --git a/src/math.c b/src/math.c index 2ac98872d..8362721ba 100644 --- a/src/math.c +++ b/src/math.c @@ -554,7 +554,7 @@ static bool8 F48_16_IsNegative(s48_16 *a) return FALSE; } -bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b) +bool8 FP48_16_SLessThan(const s48_16 *a, const s48_16 *b) { s32 r1; u32 a0; diff --git a/src/move_actions.c b/src/move_actions.c deleted file mode 100644 index c1e561fba..000000000 --- a/src/move_actions.c +++ /dev/null @@ -1,2882 +0,0 @@ -#include "global.h" -#include "charge_move.h" -#include "code_803E46C.h" -#include "code_803E724.h" -#include "code_8045A00.h" -#include "code_806CD90.h" -#include "code_8077274_1.h" -#include "code_807CD9C.h" -#include "code_808417C.h" -#include "constants/ability.h" -#include "constants/status.h" -#include "constants/targeting.h" -#include "constants/type.h" -#include "constants/weather.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_items.h" -#include "dungeon_map_access.h" -#include "dungeon_message.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_random.h" -#include "dungeon_util.h" -#include "move_effects_target.h" -#include "moves.h" -#include "number_util.h" -#include "pokemon.h" -#include "status_actions.h" -#include "status_checks_1.h" -#include "status.h" -#include "structs/dungeon_entity.h" -#include "structs/map.h" -#include "structs/str_dungeon.h" -#include "tile_types.h" -#include "weather.h" -#include "dungeon_config.h" -#include "dungeon_misc.h" - -extern const u8 *const gUnknown_80FD350; -extern const u8 *const gUnknown_80FD370; -extern u8 *gUnknown_80FE3BC[]; -extern u8 *gUnknown_80FE38C[]; -extern u8 *gUnknown_80FC888[]; -extern u8 *gUnknown_80FC8C0[]; -extern u8 *gUnknown_80FEB88[]; -extern u8 *gUnknown_80FAD6C[]; -extern u8 *gUnknown_80FBD58[]; -extern u8 *gUnknown_80FACC4[]; -extern u8 gUnknown_202F21A; -extern u8 gUnknown_202F219; -extern u8 *gUnknown_80FACA4[]; -extern u8 *gUnknown_80FD104[]; -extern u8 *gUnknown_80FD294[]; -extern u8 *gUnknown_80FD2B4[]; -extern u8 *gUnknown_80FAC74[]; -extern u8 *gUnknown_80FAC54[]; -extern u8 *gUnknown_80FAE00[]; -extern u8 *gUnknown_80FADD8[]; -extern u8 *gUnknown_80FAC88; -extern u8 *gUnknown_80FD018[]; -extern u8 *gUnknown_80FCFBC[]; -extern u8 *gUnknown_80FCFE4[]; -extern u32 gUnknown_8106A4C; -extern u8 *gUnknown_80FC734[]; -extern u8 *gUnknown_80FC7EC[]; -extern u8 *gUnknown_80FCF74[]; -extern u8 *gUnknown_80FCF80[]; -extern u32 gUnknown_8106A50; -extern u8 *gUnknown_80FD14C[]; -extern u8 *gUnknown_80FAD4C[]; -extern s24_8 gUnknown_8106A54[]; -extern u8 *gUnknown_80FCF78[]; -extern u8 *gUnknown_80FACFC[]; -extern u8 *gUnknown_80FACE4[]; -extern u8 *gUnknown_80FEB8C[]; -extern u32 gUnknown_8106A4C; -extern u32 gUnknown_8106A50; - -extern s16 gUnknown_80F4E00; -extern u8 *gUnknown_80FD128[]; -extern u8 *gUnknown_80FAD2C[]; -extern u8 *gUnknown_80FC74C[]; -extern u8 *gUnknown_80FC790[]; -extern u8 *gUnknown_80FC7AC[]; -extern u8 *gUnknown_80FD578[]; -extern u8 *gUnknown_80FCCE4[]; -extern u8 *gUnknown_80FC81C[]; -extern u8 *gUnknown_80FC854[]; -extern u8 *gUnknown_80FCF7C[]; -extern u8 *gUnknown_80FC730[]; -extern u8 *gUnknown_80FC770[]; -extern u8 *gUnknown_80FCA3C[]; -extern u8 *gUnknown_80FD170[]; -extern u8 *gUnknown_80FCCE8[]; -extern u8 *gUnknown_80FD18C[]; -extern u8 *gUnknown_80FD57C[]; -extern u8 *gUnknown_80FEBDC[]; -extern u8 *gUnknown_80FC5CC[]; -extern u8 *gUnknown_81004EC[]; -extern u8 *gUnknown_81004EC[]; -extern u8 *gUnknown_80FC7C8[]; -extern u8 *gUnknown_80FAD10[]; -extern u8 *gUnknown_80FEB90[]; -extern u8 *gUnknown_80FEB60[]; -extern u8 *gUnknown_80FE330[]; -extern u8 *gUnknown_80FE36C[]; -extern u8 *gPtrForecastPreventsTypeSwitchMessage[]; - -extern u32 gUnknown_202F210; -extern u32 gUnknown_202F214; -extern u8 gUnknown_202F218; -extern u32 gUnknown_202F21C; -extern bool8 gUnknown_202F220; - -extern void sub_806A5B8(Entity *entity); -void sub_8075900(Entity *pokemon, u8 r1); -extern u8 sub_8044B28(void); -extern void sub_807EC28(bool8); -extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); -extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); -static void sub_805A7D4(Entity *, Entity *, Item *, DungeonPos *); -extern void MudWaterSportEffect(u32); -extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); -extern void sub_806A6E8(Entity *); - -extern void EndAbilityImmuneStatus(Entity *, Entity *); -extern u8 sub_806F4A4(Entity *, u32); -extern void HandleExplosion(Entity *pokemon, Entity *target, DungeonPos *pos, u32, u8 moveType, s16); -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 s32 sub_80556BC(Entity *, Entity *, u8, Move *, s24_8, u32); - -// move_util.h -extern bool8 sub_805727C(Entity *, Entity *, s16); -bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); -bool8 sub_80571F0(Entity * pokemon, Move *move); - -extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); -extern u32 HandleDamagingMove(Entity *, Entity *, Move *, s24_8, u32); -u8 ToItemID(u32 param_1); -extern s16 sub_8094828(u16, u8); -extern void DealDamageToEntity(Entity *, s32, u32, u32); - -extern u32 gUnknown_8106A4C; - -bool8 MoveRequiresCharging(Entity* pokemon, u16 moveID) -{ - if ((moveID == MOVE_SOLARBEAM) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { - return FALSE; - } - else { - return DoesMoveCharge(moveID); - } -} - -void sub_8057588(Entity * pokemon, u8 param_2) -{ - Move *move; - s32 index; - s32 PPtoRemove; - s32 PPCounter; - EntityInfo *entityInfo; - - if (EntityIsValid(pokemon)) { - entityInfo = GetEntInfo(pokemon); - for(index = 0; index < MAX_MON_MOVES; index++) - { - move = &entityInfo->moves.moves[index]; - if ((move->moveFlags & MOVE_FLAG_EXISTS)) { - PPtoRemove = 1; - if ((move->moveFlags2 & MOVE_FLAG_LAST_USED)) { - move->moveFlags2 &= ~(MOVE_FLAG_LAST_USED); - PPtoRemove = 2; - } - if (((move->moveFlags2 & MOVE_FLAG_SET)) && (move->moveFlags2 &= ~(MOVE_FLAG_SET), param_2 != 0)) - { - if(PPtoRemove != 0) - { - PPCounter = PPtoRemove; - for (; PPCounter != 0; PPCounter--) { - if (move->PP != 0) { - move->PP--; - } - } - } - } - } - } - } -} - -s16 sub_8057600(Move *move, s32 itemID) -{ - return sub_8094828(move->id, ToItemID(itemID)); -} - -u8 ToItemID(u32 itemID) -{ - if(itemID == ITEM_NOTHING) - return ITEM_NOTHING; - else - return itemID; -} - -bool8 IronTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon, target, gIronTailSecondaryChance)) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, FALSE); - } - } - return flag; -} - -bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - bool8 flag; - - flag = FALSE; - gUnknown_202F21C++; - - if (HandleDamagingMove(pokemon, target, move, gUnknown_8106A54[gUnknown_202F21C], param_4) == 0) - gUnknown_202F220 = 1; - else - flag = TRUE; - return flag; -} - -bool8 YawnMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4) -{ - YawnedStatusTarget(pokemon, target, CalculateStatusTurns(target,gYawnTurnRange,TRUE) + 1); - return TRUE; -} - -// NOTE: Is there a better name for this? -bool8 BasicSleepMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4) -{ - SleepStatusTarget(pokemon, target, CalculateStatusTurns(target, gSleepTurnRange, TRUE), TRUE); - return TRUE; -} - -bool8 NightmareMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4) -{ - NightmareStatusTarget(pokemon, target, CalculateStatusTurns(target,gNightmareTurnRange,TRUE)); - return TRUE; -} - -bool8 MorningSunMoveAction(Entity * pokemon,Entity * target, Move *move, s32 param_4) -{ - HealTargetHP(pokemon, target, gMorningSunHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); - return TRUE; -} - -bool8 VitalThrowMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - VitalThrowStatusTarget(pokemon, target); - return TRUE; -} - -bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - Tile *tile; - bool8 flag; - - flag = FALSE; - tile = GetTileAtEntitySafe(pokemon); - if ((!IsTileGround(tile)) || ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != 1)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD14C); // It can only be used on land! - } - else { - if (MoveMatchesBideClassStatus(pokemon,move)) { - HandleDamagingMove(pokemon,target,move,gDigModifier,param_4); - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon,pokemon,STATUS_DIGGING,move,*gUnknown_80FAD4C); // $m0 burrowed underground! - } - flag = TRUE; - } - return flag; -} - -bool32 SweetScentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - LowerAccuracyStageTarget(pokemon,target,gUnknown_8106A50,TRUE); - return TRUE; -} - -bool32 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,FloatToF248(0.5),TRUE); - return TRUE; -} - -bool32 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - gDungeon->weather.unkE267[WEATHER_RAIN] = gMoveWeatherDuration; - if (sub_807EAA0(1,0) == 0) { - // The weather remains unchanged - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCF74); - } - return TRUE; -} - -bool32 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - gDungeon->weather.unkE267[WEATHER_HAIL] = gMoveWeatherDuration; - if (sub_807EAA0(1,0) == 0) { - // The weather remains unchanged - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCF80); - } - return TRUE; -} - -bool32 sub_80578EC(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - sub_8079F20(pokemon, target, 1, 0); - return TRUE; -} - -bool32 BubbleMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) -{ - bool32 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target, gBubbleSecondaryChance)) { - LowerMovementSpeedTarget(pokemon, target, 1, FALSE); - } - } - return flag; -} - -bool32 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - EncoreStatusTarget(pokemon, target); - return TRUE; -} - -bool32 RageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - // {POKEMON_0} is enraged - SetChargeStatusTarget(pokemon,target,STATUS_ENRAGED,move,gUnknown_80FAC88); - return TRUE; -} - -bool32 SuperFangMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s32 newHP; - bool8 local_24; - - newHP = GetEntInfo(target)->HP / 2; - local_24 = FALSE; - if (newHP != 0) { - sub_806F370(pokemon,target,newHP,1,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0); - local_24 = local_24 == 0; - } - else - { - // The target's HP can't be halved anymore - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD018); - } - return local_24; -} - -bool8 PainSplitMoveAction(Entity *attacker, Entity *target, Move *move, s32 param_4) -{ - EntityInfo *attackerInfo = GetEntInfo(attacker); - EntityInfo *targetInfo = GetEntInfo(target); - s32 newHP = (attackerInfo->HP + targetInfo->HP) / 2; - - attackerInfo->HP = newHP; - targetInfo->HP = newHP; - if (attackerInfo->HP > attackerInfo->maxHPStat) { - attackerInfo->HP = attackerInfo->maxHPStat; - } - if (targetInfo->HP > targetInfo->maxHPStat) { - targetInfo->HP = targetInfo->maxHPStat; - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],attacker,0); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - SetExpMultplier(attackerInfo); - - // $m0 and $m1 shared their HP - TryDisplayDungeonLoggableMessage3(attacker,target,*gUnknown_80FC7EC); - return TRUE; -} - -bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - Move *movePtr; - s32 iVar4; - Move struggleMove; - EntityInfo *entityInfo; - bool8 isTormented; - - entityInfo = GetEntInfo(target); - isTormented = FALSE; - - for(iVar4 = 0; iVar4 < MAX_MON_MOVES; iVar4++) - { - movePtr = &entityInfo->moves.moves[iVar4]; - if ((movePtr->moveFlags & MOVE_FLAG_EXISTS) != 0) { - if ((movePtr->moveFlags & MOVE_FLAG_DISABLED) == 0) { - if ((movePtr->moveFlags & MOVE_FLAG_LAST_USED) != 0) { - BufferMoveName(gFormatBuffer_Items[0],movePtr,0); - // $i0 was tormented - TryDisplayDungeonLoggableMessage3(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 ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_DISABLED) == 0) { - if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) != 0) { - InitPokemonMove(&struggleMove, MOVE_STRUGGLE); - entityInfo->moves.struggleMoveFlags |= MOVE_FLAG_DISABLED; - isTormented = TRUE; - BufferMoveName(gFormatBuffer_Items[0],&struggleMove,0); - // $i0 was tormented - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCFBC); - } - } - else if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) { - entityInfo->moves.struggleMoveFlags &= ~(MOVE_FLAG_DISABLED); - } - if (isTormented) - { - if(entityInfo->bideClassStatus.status == STATUS_BIDE) { - entityInfo->bideClassStatus.status = STATUS_NONE; - } - } - else - { - // The target couldn't be tormented - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCFE4); - } - return isTormented; -} - -bool8 StringShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - LowerMovementSpeedTarget(pokemon, target, 1, TRUE); - return TRUE; -} - -bool8 SwaggerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - ConfuseStatusTarget(pokemon, target, TRUE); - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 2); - return TRUE; -} - -bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (IsSleeping(pokemon)) { - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gSnoreSecondaryChance)) { - CringeStatusTarget(pokemon,target,FALSE); - } - } - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC734); - } - return flag; -} - -bool8 ScreechMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - ChangeDefenseMultiplierTarget(pokemon, target, gUnknown_8106A4C, FloatToF248(0.25), 1); - return TRUE; -} - -bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gRockSlideSecondaryChance)) { - CringeStatusTarget(pokemon,target,FALSE); - } - } - return flag; -} - -bool32 WeatherBallMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - u32 weather; - s32 flag; - - weather = GetApparentWeather(pokemon); - flag = sub_80556BC(pokemon,target,gWeatherBallTypes[weather],move, - gWeatherBallModifiers[weather],param_4); - if (flag) { - flag = TRUE; - } - return flag; -} - -bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - s24_8 modifier; - bool8 flag; - u8 chargeStatus; - - flag = FALSE; - chargeStatus = GetEntInfo(target)->bideClassStatus.status; - modifier = IntToF248_2(1); - if (chargeStatus == STATUS_DIVING) { - modifier = IntToF248_2(2); - } - if (HandleDamagingMove(pokemon,target,move,modifier,param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gMovesConstrictionChance)) { - SqueezedStatusTarget(pokemon,target,0x3b,FALSE); - } - } - return flag; -} - -bool8 FakeTearsMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50, 2, 1, TRUE); - return TRUE; -} - -bool8 SpiteMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - s32 i; - EntityInfo *targetInfo = GetEntInfo(target); - bool8 flag = FALSE; - - for (i = 0; i < MAX_MON_MOVES; i++) { - Move *move = &targetInfo->moves.moves[i]; - if (MoveFlagExists(move) && MoveFlagLastUsed(move)) { - move->PP = 0; - flag = TRUE; - } - } - - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - if (flag) { - TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD350); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD370); - } - - return flag; -} - -bool8 FocusEnergyMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - FocusEnergyStatusTarget(pokemon, target); - return TRUE; -} - -bool8 SmokescreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - WhifferStatusTarget(pokemon, target, CalculateStatusTurns(target, gWhifferTurnRange, TRUE)); - return TRUE; -} - -bool8 MirrorMoveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - SendThawedMessage(pokemon, target); - MirrorMoveStatusTarget(pokemon, target); - return TRUE; -} - -bool8 OverheatMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - EntityInfo *entityInfo; - bool8 flag; - - flag = FALSE; - entityInfo = GetEntInfo(pokemon); - SendThawedMessage(pokemon,target); - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if (RollSecondaryEffect(pokemon, 0)) { - entityInfo->unk155 = 1; - } - } - return flag; -} - -bool8 AuroraBeamMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gAuroraBeamAtkLowerChance)) - { - ChangeAttackMultiplierTarget(pokemon, target, gUnknown_8106A4C, FloatToF248(0.5), FALSE); - } - } - return flag; -} - -bool8 MementoMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(pokemon); - entityInfo->HP = 1; - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,FloatToF248(0.25),TRUE); - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A50,FloatToF248(0.25),TRUE); - entityInfo->unk154 = 1; - return TRUE; -} - -bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gOctazookaAccLowerChance)) - { - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, FALSE); - } - } - return flag; -} - -bool8 FlatterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - ConfuseStatusTarget(pokemon, target, TRUE); - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50, 1); - return TRUE; -} - -bool8 WillOWispMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - u8 flashFireStatus; - - flashFireStatus = GetFlashFireStatus(target); - if (flashFireStatus != FLASH_FIRE_STATUS_NONE) { - if (GetEntInfo(target)->unk152 == 0) { - GetEntInfo(target)->unk152 = 1; - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE00); // Fire moves won't become stronger - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FADD8); // $m0 used flash fire to absorb fire - } - } - } - else { - BurnedStatusTarget(pokemon,target, 0, TRUE); - } - return TRUE; -} - -bool8 ReturnMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) -{ - s32 i; - bool8 local_24; - EntityInfo *entityInfo = GetEntInfo(pokemon); - s32 dmg = 1; - - for (i = 0; i < 999 && gReturnDmgData[i].minIq >= 0; i++) { - if (entityInfo->IQ < gReturnDmgData[i].minIq) { - dmg = gReturnDmgData[i].dmgVal; - break; - } - } - - sub_806F370(pokemon,target,dmg,1,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0); - local_24 = (local_24 == 0); - return local_24; -} - -bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4) -{ - EntityInfo *entityInfo; - bool8 hasGrudge; - - hasGrudge = FALSE; - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (entityInfo->grudge) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD2B4); - } - else { - entityInfo->grudge = TRUE; - hasGrudge = TRUE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD294); - } - return hasGrudge; -} - -bool8 CounterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - CounterStatusTarget(pokemon, target, STATUS_COUNTER); - return TRUE; -} - -bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - SendThawedMessage(pokemon, target); - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gFlameWheelSecondaryChance)) - { - BurnedStatusTarget(pokemon, target, 0, FALSE); - } - } - return flag; -} - -// NOTE: Do we have a better name for this?? -bool8 BasicFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - SendThawedMessage(pokemon, target); - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gFireMoveBurnSecondaryChance)) - { - BurnedStatusTarget(pokemon, target, 0, FALSE); - } - } - return flag; -} - -bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - u16 uVar1; - uVar1 = (move->id == MOVE_FORESIGHT) ? 0x7A : 0x51; - ExposeStatusTarget(pokemon, target, uVar1); - return TRUE; -} - -bool8 DoubleTeamMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50); - return TRUE; -} - -bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - s32 modifierInt; - EntityInfo *targetInfo; - - modifierInt = 1; - targetInfo = GetEntInfo(target); - if(targetInfo->bideClassStatus.status == STATUS_FLYING || targetInfo->bideClassStatus.status == STATUS_BOUNCING) - modifierInt = 2; - flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(modifierInt),param_4) ? TRUE : FALSE; - return flag; -} - -// NOTE: Is there a better name for this? -bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1); - return TRUE; -} - -bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - ParalyzeStatusTarget(pokemon, target, TRUE); - return TRUE; -} - -// NOTE: Is there a better name for this? -bool8 BasicRaiseAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1); - return TRUE; -} - -bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - bool8 flag; - - if (MoveMatchesBideClassStatus(pokemon,move)) { - flag = HandleDamagingMove(pokemon,target,move,gRazorWindModifier,param_4) ? TRUE : FALSE; - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon,pokemon,STATUS_RAZOR_WIND,move,*gUnknown_80FAC54); - flag = TRUE; - } - return flag; -} - -bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - SetChargeStatusTarget(pokemon, target, STATUS_BIDE, move, *gUnknown_80FAC74); - return TRUE; -} - -bool8 Bide2MoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s32 iVar2; - bool8 local_18; - - local_18 = FALSE; - iVar2 = GetEntInfo(pokemon)->unkA0 * 2; - if (999 < iVar2) { - iVar2 = 999; - } - sub_806F370(pokemon,target,iVar2,1,&local_18, GetMoveType(move),0x1ff,0,1,0); - - local_18 = local_18 == 0; - return local_18; -} - -bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gShadowBallSecondaryChance)) - { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50, 1, 1, FALSE); - } - } - return flag; -} - -bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gBiteSecondaryChance)) - { - CringeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gThunderSecondaryChance)) - { - ParalyzeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s32 diffHP; - bool8 local_24; - EntityInfo *entityInfo; - EntityInfo *entityInfo1; - - - local_24 = 0; - entityInfo = GetEntInfo(pokemon); - entityInfo1 = GetEntInfo(target); - diffHP = entityInfo1->HP - entityInfo->HP; - if (diffHP < 0) { - diffHP = 0; - } - sub_806F370(pokemon,target,diffHP,0,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0); - - local_24 = local_24 == 0; - return local_24; -} - -bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - s24_8 modifier; - - modifier = IntToF248_2(1); - if((GetEntInfo(pokemon)->burnClassStatus.status) != STATUS_NONE) - modifier = gFacadeModifier; - flag = HandleDamagingMove(pokemon,target,move,modifier,param_4) ? TRUE : FALSE; - return flag; -} - -bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gConstrictBubblebeamSecondaryChance)) - { - LowerMovementSpeedTarget(pokemon, target, 1, FALSE); - } - } - return flag; -} - -bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if ((GetEntInfo(target)->reflectClassStatus.status == STATUS_REFLECT) || (GetEntInfo(target)->reflectClassStatus.status == STATUS_LIGHT_SCREEN)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD104); // The barrier was shattered - EndReflectClassStatus(pokemon,target); - flag = TRUE; - } - - flag |= (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0); - return flag; -} - -bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, 0)) - { - LowerMovementSpeedTarget(pokemon, target, 1, FALSE); - } - } - return flag; -} - -bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - bool8 flag; - - if (MoveMatchesBideClassStatus(pokemon,move)) { - flag = HandleDamagingMove(pokemon,target,move,gFocusPunchModifier,param_4) ? TRUE : FALSE; - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon,pokemon,STATUS_FOCUS_PUNCH,move,*gUnknown_80FACA4); - flag = TRUE; - } - return flag; -} - -bool8 GigaDrainMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - bool8 hasLiquidOoze; - s32 uVar3; - s32 newHP; - bool8 flag; - EntityInfo *entityInfo; - - hasLiquidOoze = AbilityIsActive(target, ABILITY_LIQUID_OOZE); - uVar3 = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4); - flag = uVar3 != 0 ? TRUE : FALSE; - if (flag && RollSecondaryEffect(pokemon, 0)) { - newHP = uVar3 / 2; - entityInfo = GetEntInfo(pokemon); - flag = TRUE; - if (newHP < 1) { - newHP = 1; - } - SetExpMultplier(entityInfo); - if (hasLiquidOoze) { - DealDamageToEntity(pokemon, newHP, 0xd, 0x1fa); - } - else { - HealTargetHP(pokemon, pokemon, newHP, 0, TRUE); - } - } - return flag; -} - -bool8 ReversalMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - s32 index; - bool8 flag; - EntityInfo *entityInfo = GetEntInfo(pokemon); - s32 maxHp = entityInfo->maxHPStat; - if (entityInfo->HP <= entityInfo->maxHPStat / 4) { - index = 0; - } - else if (entityInfo->HP <= maxHp / 2) { - index = 1; - } - else if (entityInfo->HP <= (maxHp * 3) / 4) { - index = 2; - } - else { - index = 3; - } - - flag = HandleDamagingMove(pokemon,target,move,gReversalModifiers[index],param_4) ? TRUE : FALSE; - return flag; -} - -bool8 SmellingSaltMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - bool8 flag; - - if (GetEntInfo(target)->burnClassStatus.status == STATUS_PARALYSIS) { - flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(2),param_4) ? TRUE : FALSE; - EndBurnClassStatus(pokemon, target); - } - else { - flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) ? TRUE : FALSE; - } - return flag; -} - -bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50, 3, 1, TRUE); - return TRUE; -} - -bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s32 index = gUnknown_8106A4C; - LowerAttackStageTarget(pokemon, target, index, 1, 1, TRUE); - LowerDefenseStageTarget(pokemon, target, index, 1, 1, TRUE); - return TRUE; -} - -bool8 sub_805889C(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - ImmobilizedStatusTarget(pokemon, target); - return TRUE; -} - -bool8 HazeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - sub_8079E34(pokemon, target, TRUE); - return TRUE; -} - -bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag = FALSE; - if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) - { - flag = TRUE; - if(RollSecondaryEffect(pokemon, 0)) - { - gUnknown_202F219 = 1; - } - } - return flag; -} - -bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s24_8 weight; - bool8 flag; - EntityInfo *entityInfo = GetEntInfo(target); - - weight.raw = GetWeight(entityInfo->apparentID); - flag = HandleDamagingMove(pokemon, target, move, weight, param_4) != 0 ? TRUE: FALSE; - return flag; -} - -bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag = FALSE; - EntityInfo *entityInfo; - s32 index1; - s32 index2; - if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) - { - flag = TRUE; - if(RollSecondaryEffect(pokemon, gAncientPowerSecondaryChance)) - { - entityInfo = GetEntInfo(pokemon); - RaiseMovementSpeedTarget(pokemon, pokemon, 0, TRUE); - index1 = gUnknown_8106A4C; - RaiseAttackStageTarget(pokemon, pokemon, index1, 1); - index2 = gUnknown_8106A50; - RaiseAttackStageTarget(pokemon, pokemon, index2, 1); - RaiseDefenseStageTarget(pokemon, pokemon, index1, 1); - RaiseDefenseStageTarget(pokemon, pokemon, index2, 1); - SetExpMultplier(entityInfo); - } - } - return flag; -} - -bool8 SynthesisMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - HealTargetHP(pokemon, target, gSynthesisHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); - return TRUE; -} - -bool8 AgilityMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseMovementSpeedTarget(pokemon, target, 0, TRUE); - return TRUE; -} - -bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag = FALSE; - if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) - { - flag = TRUE; - if(RollSecondaryEffect(pokemon, 0)) - { - gUnknown_202F21A = 1; - } - } - return flag; -} - -bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - SureShotStatusTarget(pokemon, target, CalculateStatusTurns(target, gSureShotTurnRange, FALSE)); - return TRUE; -} - -bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1); - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50, 1); - return TRUE; -} - -bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag = FALSE; - - if(MoveMatchesBideClassStatus(pokemon, move)) - { - if (HandleDamagingMove(pokemon, target, move, gSkyAttackModifier, param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gSkyAttackSecondaryChance)) - CringeStatusTarget(pokemon, target, FALSE); - } - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon, pokemon, STATUS_SKY_ATTACK, move, *gUnknown_80FACC4); - flag = TRUE; - } - return flag; -} - -// NOTE: Is there a better name for this? -bool8 BasicIceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gIceMoveFreezeSecondaryChance)) - { - FrozenStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - EntityInfo *entityInfo; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, pokemon, gMeteorMashSecondaryChance)) - { - entityInfo = GetEntInfo(pokemon); - RaiseAttackStageTarget(pokemon, pokemon, gUnknown_8106A4C, 1); - SetExpMultplier(entityInfo); - } - } - return flag; -} - -bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - EndureStatusTarget(pokemon, pokemon); - return TRUE; -} - -bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - LowerMovementSpeedTarget(pokemon, target, 1, TRUE); - return TRUE; -} - -bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gMovesConfusionSecondaryChance)) - { - ConfuseStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 PsywaveMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s32 rand; - bool8 flag; - - rand = DungeonRandRange(128, 384); // 0x80 - 0x180 - rand = (rand * GetEntInfo(pokemon)->level) / 256; - if (rand < 0) { - rand = 1; - } - if (199 < rand) { - rand = 199; - } - flag = sub_8055864(pokemon,target,move,rand,param_4) != 0 ? TRUE: FALSE; - return flag; -} - -bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_5) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gPsychicSecondaryChance)) - { - LowerDefenseStageTarget(pokemon, target, param_4, 1, 1, FALSE); - } - } - return flag; -} - -bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag = FALSE; - if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) - { - flag = TRUE; - if(RollSecondaryEffect(pokemon, 0)) - { - LowerAttackStageTarget(pokemon, pokemon, gUnknown_8106A50, 2, 0, FALSE); - } - } - return flag; -} - -bool8 UproarMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - SleeplessStatusTarget(pokemon, target); - return TRUE; -} - -bool8 WaterSpoutMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - s32 index; - bool8 flag; - EntityInfo *entityInfo = GetEntInfo(pokemon); - s32 maxHp = entityInfo->maxHPStat; - if (entityInfo->HP <= entityInfo->maxHPStat / 4) { - index = 0; - } - else if (entityInfo->HP <= maxHp / 2) { - index = 1; - } - else if (entityInfo->HP <= (maxHp * 3) / 4) { - index = 2; - } - else { - index = 3; - } - - flag = HandleDamagingMove(pokemon,target,move,gWaterSpoutModifiers[index],param_4) ? TRUE : FALSE; - return flag; -} - - -bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - s32 index; - EntityInfo *iVar3; - EntityInfo *iVar4; - - iVar4 = GetEntInfo(pokemon); - iVar3 = GetEntInfo(target); - nullsub_92(target); - - for(index = 0; index < 2; index++) - { - iVar4->offensiveStages[index] = iVar3->offensiveStages[index]; - iVar4->defensiveStages[index] = iVar3->defensiveStages[index]; - iVar4->hitChanceStages[index] = iVar3->hitChanceStages[index]; - iVar4->offensiveMultipliers[index] = iVar3->offensiveMultipliers[index]; - iVar4->defensiveMultipliers[index] = iVar3->defensiveMultipliers[index]; - } - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD58); // It psyched itself up! - SetExpMultplier(iVar4); - return TRUE; -} - -bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - int iVar2; - int iVar3; - bool8 flag; - - flag = FALSE; - if ((HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) && (EntityIsValid(pokemon))) { - iVar2 = GetEntInfo(pokemon)->maxHPStat; - if (iVar2 < 0) { - iVar2 = iVar2 + 7; - } - iVar3 = iVar2 >> 3; - if (iVar3 == 0) { - iVar3 = 1; - } - flag = TRUE; - if ((!AbilityIsActive(pokemon, ABILITY_ROCK_HEAD)) && RollSecondaryEffect(pokemon, 0)) { - sub_806F370(pokemon,pokemon,iVar3,0,0,0,0x1fd,0x14,1,0); - } - } - return flag; -} - -bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - HealTargetHP(pokemon, target, GetEntInfo(target)->maxHPStat / 2, 0, TRUE); - return TRUE; -} - -bool32 EarthquakeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - bool32 flag; - EntityInfo *entityInfo; - s32 modifierInt; - - entityInfo = GetEntInfo(target); - modifierInt = 1; - gDungeon->unk181e8.unk18200 = 0xc; - gDungeon->unk181e8.unk18204 = 0; - if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { - modifierInt = 2; - } - flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(modifierInt),param_4); - if (flag != 0) { - flag = TRUE; - } - return flag; -} - -bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - bool8 flag; - s32 tileset; - Move natureMove; - - tileset = gDungeon->tileset; - if (tileset < 0) { - tileset = 0; - } - if (0x4a < tileset) { - tileset = 0x4a; - } - InitPokemonMove(&natureMove, gNaturePowerCalledMoves[tileset].moveID); - flag = gNaturePowerCalledMoves[tileset].callback(pokemon,target,&natureMove,param_4); - return flag; -} - -bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gLickSecondaryChance)) - { - ParalyzeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 SelfDestructMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - HandleExplosion(pokemon, target, &target->pos, 1, GetMoveType(move), sub_8057600(move, param_4)); - return TRUE; -} - -bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - ParalyzeStatusTarget(pokemon, target, TRUE); - return TRUE; -} - -bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - SetChargeStatusTarget(pokemon, target, STATUS_CHARGING, move, *gUnknown_80FAD6C); - return TRUE; -} - -bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gThunderboltSecondaryChance)) - { - ParalyzeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 MistMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - MistStatusTarget(pokemon, target); - return TRUE; -} - -bool8 FissureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - u8 moveType; - bool8 uVar5; - bool8 flag; - - flag = FALSE; - moveType = GetMoveType(move); - - uVar5 = sub_806F4A4(target, moveType) != 0 ? TRUE : FALSE; - - if (AbilityIsActive(target, ABILITY_LEVITATE)) { - uVar5 = FALSE; - } - if (!uVar5) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB88); - } - else { - sub_806F370(pokemon,target,9999,1,&flag,GetMoveType(move),sub_8057600(move,param_4),0,1,1); - flag = flag == 0; - } - return flag; -} - -bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gExtrasensorySecondaryChance)) - { - CringeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 SafeguardMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - SafeguardStatusTarget(pokemon, target); - return TRUE; -} - -bool8 AbsorbMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - bool8 hasLiquidOoze; - s32 iVar3; - s32 iVar4; - bool8 flag; - - flag = FALSE; - hasLiquidOoze = AbilityIsActive(target, ABILITY_LIQUID_OOZE); - iVar3 = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4); - if (iVar3 != 0) { - iVar4 = iVar3 / 2; - if (iVar4 < 1) { - iVar4 = 1; - } - if (EntityIsValid(pokemon)) { - EntityInfo *entityInfo = GetEntInfo(pokemon); - flag = TRUE; - SetExpMultplier(entityInfo); - if (RollSecondaryEffect(pokemon,0)) { - if (hasLiquidOoze) { - DealDamageToEntity(pokemon,iVar4,0xd,0x1fa); - } - else { - HealTargetHP(pokemon,pokemon,iVar4,0,1); - } - } - } - } - return flag; -} - -bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - bool32 flag; - - EntityInfo *pokeEntityData = GetEntInfo(pokemon); - EntityInfo *targetEntityInfo = GetEntInfo(target); - if ((AbilityIsActive(target, ABILITY_WONDER_GUARD)) || (AbilityIsActive(pokemon, ABILITY_WONDER_GUARD))) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC8C0); - flag = FALSE; - } - else - { - s32 ability1 = targetEntityInfo->abilities[0]; - s32 ability2 = targetEntityInfo->abilities[1]; - targetEntityInfo->abilities[0] = pokeEntityData->abilities[0]; - targetEntityInfo->abilities[1] = pokeEntityData->abilities[1]; - pokeEntityData->abilities[0] = ability1; - pokeEntityData->abilities[1] = ability2; - gDungeon->unkC = 1; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC888); - // Weirdly enough SetExpMultplier inline doesn't work here... - if (pokeEntityData->expMultiplier == EXP_HALVED) { - pokeEntityData->expMultiplier = EXP_REGULAR; - } - EndAbilityImmuneStatus(pokemon,pokemon); - EndAbilityImmuneStatus(pokemon,target); - flag = TRUE; - } - return flag; -} - -bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - s32 i; - bool32 ret = FALSE; - EntityInfo *pokeInfo = GetEntInfo(pokemon); - EntityInfo *targetInfo = GetEntInfo(target); - bool32 moveFound = FALSE; - u16 moveId = MOVE_NOTHING; - - for (i = 0; i < MAX_MON_MOVES; i++) { - if (MoveFlagExists(&targetInfo->moves.moves[i]) && targetInfo->moves.moves[i].moveFlags & MOVE_FLAG_LAST_USED) { - moveId = targetInfo->moves.moves[i].id; - moveFound = TRUE; - break; - } - } - - if (!moveFound) { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FE3BC); - return FALSE; - } - - if (moveId == MOVE_NOTHING) { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FE3BC); - } - else { - InitPokemonMove(move, moveId); - BufferMoveName(gFormatBuffer_Items[0], move, 0); - move->moveFlags2 |= MOVE_FLAG2_UNK4; - move->moveFlags2 |= MOVE_FLAG_REPLACE; - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FE38C); - ASM_MATCH_TRICK(pokeInfo); - SetExpMultplier(pokeInfo); - ret = TRUE; - } - - return ret; -} - -bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gHeadbuttSecondaryChance)) - { - CringeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 DoubleEdgeMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - s32 HP; - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if ((!AbilityIsActive(pokemon, ABILITY_ROCK_HEAD)) && (RollSecondaryEffect(pokemon,0) != 0)) { - HP = GetEntInfo(pokemon)->maxHPStat; - if (HP < 0) { - HP = HP + 7; - } - HP = HP >> 3; - if (HP == 0) { - HP = 1; - } - sub_806F370(pokemon,pokemon,HP,0,0,0,0x1fd,0x14,1,0); - } - } - return flag; -} - - -bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - gDungeon->weather.unkE267[WEATHER_SANDSTORM] = gMoveWeatherDuration; - if(sub_807EAA0(1, 0) == 0) - { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FCF78); - } - return TRUE; -} - -bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, TRUE); - return TRUE; -} - -bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gSmogSecondaryChance)) - { - PoisonedStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 GrowthMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50, 1); - return TRUE; -} - -bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gSacredFireSecondaryChance)) - { - BurnedStatusTarget(pokemon, target, 0, FALSE); - } - } - return flag; -} - -bool8 sub_80595EC(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - u8 moveType; - u8 local_20; - - local_20 = 0; - if (sub_806F4A4(target,GetMoveType(move)) == 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB8C); - return FALSE; - } - else { - moveType = GetMoveType(move); - sub_806F370(pokemon,target,9999,1,&local_20,moveType,sub_8057600(move,param_4),0,1,0); - local_20 = (local_20 == 0); - return local_20; - } -} - -bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - u8 weather; // weather and flag are reused in same variable - s24_8 modifier; - - weather = GetApparentWeather(pokemon); - if ((weather == WEATHER_SUNNY) || (MoveMatchesBideClassStatus(pokemon,move))) { - modifier = gSolarBeamModifier; - - if (((weather == WEATHER_SANDSTORM) || (weather == WEATHER_RAIN)) || weather == WEATHER_HAIL) { - modifier.raw /= 2; - } - weather = HandleDamagingMove(pokemon,target,move,modifier,param_4) != 0 ? TRUE : FALSE; - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon,pokemon,STATUS_SOLARBEAM,move,*gUnknown_80FACE4); - weather = TRUE; - } - return weather; -} - -bool8 SonicboomMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - u8 local_20; - - local_20 = 0; - sub_806F370(pokemon,target,gSonicboomDmgValue,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,1,0); - local_20 = local_20 == 0; - return local_20; -} - -bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (MoveMatchesBideClassStatus(pokemon,move)) { - flag = HandleDamagingMove(pokemon,target,move,gFlyModifier,param_4) != 0 ? TRUE : FALSE; - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon,pokemon,STATUS_FLYING,move,*gUnknown_80FACFC); - flag = TRUE; - } - return flag; -} - -bool8 ExplosionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - HandleExplosion(pokemon,target,&target->pos,2,GetMoveType(move),sub_8057600(move,param_4)); - return TRUE; -} - -bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (IsTileGround(GetTileAtEntitySafe(pokemon))) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD128); - } - else if (MoveMatchesBideClassStatus(pokemon,move)) { - flag = HandleDamagingMove(pokemon,target,move,gDiveModifier,param_4) != 0 ? TRUE : FALSE; - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon,pokemon,STATUS_DIVING,move,*gUnknown_80FAD2C); - flag = TRUE; - } - return flag; -} - -bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gMuddyWaterAccLowerChance)) - { - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, FALSE); - } - } - return flag; -} - -bool8 StockpileMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - HandleStockpile(pokemon, target); - return TRUE; -} - -bool8 TwisterMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - s32 modifierInt = 1; - bool8 flag = FALSE; - EntityInfo *entInfo = GetEntInfo(target); - - if (entInfo->bideClassStatus.status == STATUS_FLYING || entInfo->bideClassStatus.status == STATUS_BOUNCING) { - modifierInt = 2; - } - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(modifierInt),param_4) != 0) - { - flag = TRUE; - if(sub_805727C(pokemon,target,gTwisterSecondaryChance) != 0) { - CringeStatusTarget(pokemon,target,FALSE); - } - } - return flag; -} - -bool8 TwineedleMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - gUnknown_202F218 = 1; - } - if (((gUnknown_202F218 != 0) && (gUnknown_202F214 == 2)) && - (sub_805727C(pokemon,target,gTwineedleSecondaryChance) != 0)) { - PoisonedStatusTarget(pokemon,target,FALSE); - } - return flag; -} - -bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s32 HP; - - HP = GetEntInfo(target)->maxHPStat; - if(HP < 0) - HP += 3; - HealTargetHP(pokemon, target, HP >> 2, 0, TRUE); - return TRUE; -} - -bool8 MinimizeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50); - return TRUE; -} - -bool8 sub_8059A2C(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - u8 local_20; - u32 level; - - local_20 = 0; - level = GetEntInfo(pokemon)->level; - sub_806F370(pokemon,target,level,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,1,0); - local_20 = local_20 == 0; - return local_20; -} - -bool8 SupersonicMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - ConfuseStatusTarget(pokemon, target, TRUE); - return TRUE; -} - -bool8 TauntMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - TauntStatusTarget(pokemon, target); - return TRUE; -} - -bool8 MoonlightMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - HealTargetHP(pokemon, target, gMoonlightHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); - return TRUE; -} - -bool8 HornDrillMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - u8 local_20; - - local_20 = 0; - if (sub_806F4A4(target,GetMoveType(move)) == 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB90); - return FALSE; - } - else { - sub_806F370(pokemon,target,9999,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,0,0); - local_20 = local_20 == 0; - return local_20; - } -} - -bool8 SwordsDanceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 2); - return TRUE; -} - -bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - u8 moveType; - Move *movePtr; - s32 index; - EntityInfo * info; - s32 counter; - s32 newIndex; - Move *moveStack [MAX_MON_MOVES]; - - counter = 0; - info = GetEntInfo(target); - if (AbilityIsActive(target, ABILITY_FORECAST)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); - return FALSE; - } - else - { - for(index = 0; index < MAX_MON_MOVES; index++) - { - movePtr = &info->moves.moves[index]; - if (((movePtr->moveFlags & MOVE_FLAG_EXISTS)) && (GetMoveTypeForMonster(target,movePtr) != TYPE_NONE)) { - moveStack[counter] = movePtr; - counter++; - } - } - if (counter == 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE36C); - return FALSE; - } - else - { - newIndex = DungeonRandInt(counter); - moveType = GetMoveTypeForMonster(target,moveStack[newIndex]); - info->types[0] = moveType; - info->types[1] = TYPE_NONE; - info->isColorChanged = TRUE; - BufferMoveName(gFormatBuffer_Items[0], moveStack[newIndex], NULL); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FE330); - return TRUE; - } - } -} - -bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - Conversion2StatusTarget(pokemon, target); - return TRUE; -} - -bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - flag = FALSE; - if(pokemon == target) - { - TryDisplayDungeonLoggableMessage3(target, target, *gUnknown_80FEB60); - } - else { - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1); - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50, 1); - flag = TRUE; - } - return flag; -} - -bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 2); - return TRUE; -} - -bool8 WarpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - WarpTarget(pokemon, target, 0, NULL); - return TRUE; -} - -bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gThundershockSecondaryChance)) - { - ParalyzeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - ParalyzeStatusTarget(pokemon, target, TRUE); - return TRUE; -} - -bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, 0)) - { - ParalyzeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 BlockMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - ImmobilizedStatusTarget(pokemon, target); - return TRUE; -} - -bool8 PoisonGasMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - PoisonedStatusTarget(pokemon, target, TRUE); - return TRUE; -} - -bool8 ToxicMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - BadlyPoisonedStatusTarget(pokemon, target, TRUE); - return TRUE; -} - -bool8 PoisonFangMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gPoisonFangSecondaryChance)) - { - BadlyPoisonedStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gPoisonStingSecondaryChance)) - { - PoisonedStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 JumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5) -{ - u8 moveType; - u32 movePower; - u32 moveCritChance; - bool8 flag; - s32 local_30 [4]; - u8 auStack_20; - - flag = FALSE; - if (param_5 == 0) { - flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0 ? TRUE : FALSE; - } - if (!flag) { - moveType = GetMoveTypeForMonster(pokemon,move); - movePower = GetMovePower(pokemon,move); - moveCritChance = GetMoveCritChance(move); - CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0); - SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8); - local_30[0] = local_30[0] / 2; - if (local_30[0] == 0) { - local_30[0] = 1; - } - sub_806F370(pokemon,pokemon,local_30[0],0,&auStack_20,0,0x1f7,0x13,1,0); - } - return flag; -} - -bool8 BounceMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (MoveMatchesBideClassStatus(pokemon, move)) { - if (HandleDamagingMove(pokemon, target, move, gBounceModifier, param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon, target, gBounceSecondaryChance) != 0) { - ParalyzeStatusTarget(pokemon, target, FALSE); - } - } - sub_8079764(pokemon); - } - else { - SetChargeStatusTarget(pokemon, pokemon, STATUS_BOUNCING, move, *gUnknown_80FAD10); - flag = TRUE; - } - return flag; -} - -bool8 HiJumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5) -{ - u8 moveType; - u32 movePower; - u32 moveCritChance; - bool8 flag; - s32 local_30 [4]; - u8 auStack_20; - - flag = FALSE; - if (param_5 == 0) { - flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(2),param_4) != 0 ? TRUE : FALSE; - } - if (!flag) { - moveType = GetMoveTypeForMonster(pokemon,move); - movePower = GetMovePower(pokemon,move); - moveCritChance = GetMoveCritChance(move); - CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0); - SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8); - local_30[0] = local_30[0] / 2; - if (local_30[0] == 0) { - local_30[0] = 1; - } - sub_806F370(pokemon,pokemon,local_30[0],0,&auStack_20,0,0x1f8,0x13,1,0); - } - return flag; -} - -bool8 TriAttackMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4)) - { - flag = TRUE; - if(sub_805727C(pokemon, target, gTriAttackSecondaryChance)) - { - switch(DungeonRandInt(3)) - { - case 0: - default: - ParalyzeStatusTarget(pokemon, target, FALSE); - break; - case 1: - BurnedStatusTarget(pokemon, target, 0, FALSE); - break; - case 2: - FrozenStatusTarget(pokemon, target, FALSE); - break; - } - } - } - return flag; -} - -bool8 TrickMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) -{ - EntityInfo *r9; - EntityInfo *r8; - EntityInfo *r7; - EntityInfo *sp; - Item item; - bool32 flag; - Item *item1; - Item *item2; - - flag = FALSE; - r9 = GetEntInfo(pokemon); - r7 = r9; - r8 = GetEntInfo(target); - sp = r8; - - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (AbilityIsActive(target, ABILITY_STICKY_HOLD)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE4); - return FALSE; - } - else if (HasHeldItem(target, ITEM_ALERT_SPECS)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD578); - return FALSE; - } - else - { - item1 = &r9->heldItem; - item2 = &r8->heldItem; - if (!(item1->flags & ITEM_FLAG_EXISTS)) - flag = TRUE; - - if(!(item2->flags & ITEM_FLAG_EXISTS)) - flag = TRUE; - - if (flag) - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7AC); // The item trade failed - return FALSE; - } - else - { - item = r7->heldItem; - r7->heldItem = sp->heldItem; - sp->heldItem = item; - sub_806A6E8(pokemon); - sub_806A6E8(target); - SetExpMultplier(r7); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC790); // Traded items - return TRUE; - } - } -} - -bool8 TripleKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - gUnknown_202F210++; - flag = HandleDamagingMove(pokemon, target, move, IntToF248_2(gUnknown_202F210), param_4) ? TRUE : FALSE; - return flag; -} - -bool8 MudWaterSportMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - if(move->id == MOVE_MUD_SPORT) - { - MudWaterSportEffect(0); - } - else - { - MudWaterSportEffect(1); - } - return TRUE; -} - - -bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, 0)) - { - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, FALSE); - } - } - return flag; -} - -bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - return ThiefAction(pokemon, target, move, param_4); -} - -bool8 AmnesiaMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50, 2); - return TRUE; -} - -bool8 GrowlMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, TRUE); - return TRUE; -} - -bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - s32 modifierInt; - s24_8 modifier; - - flag = FALSE; - if (GetEntInfo(target)->bideClassStatus.status == STATUS_DIVING) { - modifierInt = IntToF248_2(2).raw; - } - else { - modifierInt = IntToF248_2(1).raw; - } - modifier.raw = modifierInt; - if(HandleDamagingMove(pokemon,target,move,modifier,param_4) != 0) - flag = TRUE; - return flag; -} - -bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - EntityInfo * entityInfo; - EntityInfo * targetEntityInfo; - - entityInfo = GetEntInfo(pokemon); - targetEntityInfo = GetEntInfo(target); - if (AbilityIsActive(target, ABILITY_WONDER_GUARD)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC854); - return FALSE; - } - else - { - entityInfo->abilities[0] = targetEntityInfo->abilities[0]; - entityInfo->abilities[1] = targetEntityInfo->abilities[1]; - gDungeon->unkC = 1; - SetExpMultplier(entityInfo); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC81C); - EndAbilityImmuneStatus(pokemon, pokemon); - return TRUE; - } -} - -bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - gDungeon->weather.unkE267[WEATHER_SUNNY] = gMoveWeatherDuration; - if (sub_807EAA0(1,0) == 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCF7C); - } - return TRUE; -} - -bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, TRUE); - return TRUE; -} - -bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - WishStatusTarget(pokemon, target); - return TRUE; -} - -bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, gFakeOutSecondaryChance)) - { - CringeStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC730); - return FALSE; -} - -bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool32 flag; - Item item; - DungeonPos pos; - - flag = FALSE; - if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (RollSecondaryEffect(pokemon, 0) != 0) { - if (!EntityIsValid(target)) { - pos.x = 0; - pos.y = 0; - CreateItemWithStickyChance(&item,ITEM_POKE,2); - sub_805A7D4(pokemon,target,&item,&pos); - } - } - } - return flag; -} - -bool8 AssistMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC74C); - return FALSE; -} - -bool8 RestMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - NappingStatusTarget(pokemon, target, CalculateStatusTurns(target, gNappingTurnRange, FALSE)); - return TRUE; -} - -bool8 IngrainMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - IngrainedStatusTarget(pokemon, target); - return TRUE; -} - -bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - u8 *stockpileStage; - - stockpileStage = &GetEntInfo(target)->stockpileStage; - if (*stockpileStage != 0) { - HealTargetHP(pokemon,target,gStockpileHealHpValues[*stockpileStage],0,TRUE); - *stockpileStage = 0; - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC770); - } - return TRUE; -} - -bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - CurseStatusTarget(pokemon, target); - return TRUE; -} - -bool8 sub_805A568(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) ? TRUE : FALSE; - return flag; -} - -bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - u32 stat; - bool32 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,pokemon,0) != 0) { - stat = gUnknown_8106A4C; - LowerAttackStageTarget(pokemon,pokemon,stat,1,0,FALSE); - LowerDefenseStageTarget(pokemon,pokemon,stat,1,0,FALSE); - } - } - return flag; -} - -bool8 SteelWingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 param_5) -{ - EntityInfo *entityInfo; - bool32 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_5) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,pokemon,gSteelWingSecondaryChance) != 0) { - entityInfo = GetEntInfo(pokemon); - RaiseDefenseStageTarget(pokemon,pokemon,stat,1); - SetExpMultplier(entityInfo); - } - } - return flag; -} - -bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - u8 *stockpileStage; - - stockpileStage = &GetEntInfo(pokemon)->stockpileStage; - if (*stockpileStage != 0) { - HandleDamagingMove(pokemon,target,move,IntToF248_2(*stockpileStage),param_4); - *stockpileStage = 0; - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA3C); - } - return TRUE; -} - -bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if(sub_805727C(pokemon, target, 0)) - { - ConfuseStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - EntityInfo *entityInfo; - EntityInfo *targetEntityInfo; - Item heldItem; - DungeonPos pos; - - entityInfo = GetEntInfo(pokemon); - targetEntityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - if (AbilityIsActive(target, ABILITY_STICKY_HOLD)) - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE8); - return FALSE; - } - else if (HasHeldItem(target, ITEM_ALERT_SPECS)) - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD57C); - return FALSE; - } - else - { - heldItem = targetEntityInfo->heldItem; - if (!ItemExists(&heldItem)) - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD18C); - return FALSE; - } - else - { - ZeroOutItem(&targetEntityInfo->heldItem); - 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); - if (sub_80706A4(target, &target->pos) != 0) - { - WarpTarget(pokemon, target, 0, NULL); - } - return TRUE; - } - } -} - -static void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, - DungeonPos *pos) -{ - Entity stackEntity; - - stackEntity.type = ENTITY_ITEM; - stackEntity.unk24 = 0; - stackEntity.isVisible = TRUE; - stackEntity.unk22 = 0; - stackEntity.axObj.info.item = item; - stackEntity.pos.x = target->pos.x + pos->x; - stackEntity.pos.y = target->pos.y + pos->y; - SetEntityPixelPos(&stackEntity,(target->pos.x * 0x18 + 4) * 0x100, - (target->pos.y * 0x18 + 4) * 0x100); - stackEntity.spawnGenID = 0; - SubstitutePlaceholderStringTags(gFormatBuffer_Items[0],&stackEntity,0); - sub_804652C(pokemon,&stackEntity,item,1,0); -} - -bool8 SplashMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - int x; - int y; - int counter; - DungeonPos *r9; - DungeonPos pos1; - Move stackMove; - PixelPos pos2; - Tile *tile; - Entity *entity; - u8 check; - - - pos1 = target->pos; - sub_806CDD4(target,10,8); - - for(counter = 0; counter < 0x28; counter++) - { - x = DungeonRandInt(3); - y = DungeonRandInt(3); - x--; - y--; - if ((x != 0) || (y != 0)) { - pos1.x = target->pos.x + x; - pos1.y = target->pos.y + y; - if (sub_80705F0(target,&pos1) == 0) goto _0805A8C2; - } - } -_0805A8C2: - if (counter == 0x28) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEBDC); - return FALSE; - } - - pos2.x = (X_POS_TO_PIXELPOS(pos1.x) - target->pixelPos.x) / 0xc; - pos2.y = (Y_POS_TO_PIXELPOS(pos1.y) - target->pixelPos.y) / 0xc; - - if (((check = sub_803F428(&target->pos), r9 = &target->pos, check)) || (sub_803F428(&pos1))) { - for(counter = 0; counter < 0xC; counter++) - { - IncreaseEntityPixelPos(target,pos2.x,pos2.y); - DungeonRunFrameActions(0x2c); - } - } - tile = GetTileMut(pos1.x,pos1.y); - entity = tile->monster; - if (entity != NULL) { - if (GetEntityType(entity) == ENTITY_MONSTER) { - InitPokemonMove(&stackMove,MOVE_REGULAR_ATTACK); - if (sub_80571F0(entity,&stackMove) == 0) { - sub_806F370(pokemon,entity,gSplashDmgValue,0,0,TYPE_NONE,sub_8057600(move, param_4),0,1,0); - } - if ((sub_8044B28() == 0) && (EntityIsValid(pokemon))) { - sub_806F370(pokemon,pokemon,gSplashDmgValue,0,0,0,0x1fe,0,0,0); - if ((sub_8044B28() == 0) && (EntityIsValid(pokemon))) goto _0805A9FE; - } - } - else { -_0805A9FE: - if (EntityIsValid(target)) { - if ((sub_803F428(r9)) || (sub_803F428(&pos1))) { - for(counter = 0; counter < 0xC; counter++) - { - IncreaseEntityPixelPos(target, -pos2.x,-pos2.y); - DungeonRunFrameActions(0x2c); - } - } - goto _0805AA5E; - } - } - } - else - { - sub_80694C0(target,pos1.x,pos1.y,0); -_0805AA5E: - if (EntityIsValid(target)) { -#ifndef NOMATCHING - register DungeonPos *pos asm("r1"); -#else - DungeonPos *pos; -#endif - sub_804535C(target, NULL); - pos = r9; - if (sub_80706A4(target, pos)) { - WarpTarget(pokemon,target,0,0); - } - if (GetEntInfo(target)->isTeamLeader) { - sub_804AC20(r9); - sub_807EC28(FALSE); - } - sub_806A5B8(target); - sub_8075900(target,gDungeon->forceMonsterHouse); - } - } - return TRUE; -} - -bool8 sub_805AAD0(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - FixedDamageStatusTarget(pokemon, pokemon); - return TRUE; -} - -bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) -{ - EntityInfo *info; - bool8 flag; - - info = GetEntInfo(pokemon); - flag = FALSE; - if (FixedPointToInt(info->belly) > 1) { - RaiseAttackStageTarget(pokemon,target,gUnknown_8106A4C,99); - info->belly = IntToFixedPoint(1); - flag = TRUE; - } - else { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5CC); - } - return flag; -} - -bool8 LightScreenMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - LightScreenStatusTarget(pokemon, target); - return TRUE; -} - -bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gSecretPowerSecondaryEffectChance) != 0) { - switch(gSecretPowerTable[gDungeon->tileset]) { - case 0: - PoisonedStatusTarget(pokemon,target,FALSE); - break; - case 1: - SleepStatusTarget(pokemon,target,CalculateStatusTurns(target,gSleepTurnRange,TRUE),FALSE); - break; - case 2: - LowerMovementSpeedTarget(pokemon,target,1,FALSE); - break; - case 3: - LowerAttackStageTarget(pokemon,target,gUnknown_8106A4C,1,1,FALSE); - break; - case 4: - LowerDefenseStageTarget(pokemon,target,gUnknown_8106A4C,1,1,FALSE); - break; - case 5: - LowerAccuracyStageTarget(pokemon,target,gUnknown_8106A4C,FALSE); - break; - case 6: - ConfuseStatusTarget(pokemon,target,FALSE); - break; - case 7: - CringeStatusTarget(pokemon,target,FALSE); - break; - case 8: - default: - ParalyzeStatusTarget(pokemon,target,FALSE); - break; - } - } - } - return flag; -} - -bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gDizzyPunchSecondaryChance) != 0) { - ConfuseStatusTarget(pokemon, target, FALSE); - } - } - return flag; -} - -bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - s32 stat = gUnknown_8106A4C; - RaiseAttackStageTarget(pokemon, target, stat, 1); - RaiseDefenseStageTarget(pokemon, target, stat, 1); - return TRUE; -} - -bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - PausedStatusTarget(pokemon, target, 1, CalculateStatusTurns(target, gObserverOrbPausedTurnRange, TRUE), TRUE); - return TRUE; -} - -bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C, 2, 1, TRUE); - return TRUE; -} - -bool32 BeatUpMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - s32 numPossibleTargets; - s32 i; - Entity **possibleTargets; - bool32 flag = FALSE; - EntityInfo *info = GetEntInfo(pokemon); - - if (info->isNotTeamMember) { - possibleTargets = gDungeon->wildPokemon; - numPossibleTargets = DUNGEON_MAX_WILD_POKEMON; - } - else { - possibleTargets = gDungeon->teamPokemon; - numPossibleTargets = MAX_TEAM_MEMBERS; - } - - for (i = 0; i < numPossibleTargets; i++) { - Entity *targetEntity = possibleTargets[i]; - if (EntityIsValid(targetEntity) - && pokemon != targetEntity - && GetTreatmentBetweenMonsters(pokemon,targetEntity,FALSE,FALSE) == TREATMENT_TREAT_AS_ALLY) - { - EntityInfo *targetInfo = GetEntInfo(targetEntity); - if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsExperienceLocked(targetInfo->joinedAt.id)) { - WarpTarget(pokemon,targetEntity,2,&target->pos); - flag = TRUE; - SetExpMultplier(info); - } - } - } - - if (!flag) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_81004EC); - } - return flag; -} - -bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) -{ - bool8 flag; - - SendThawedMessage(pokemon, target); - flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(2),param_4) != 0 ? TRUE : FALSE; - return flag; -} - -bool8 CrushClawMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gCrushClawSecondaryChance) != 0) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, FALSE); - } - } - return flag; -} - -bool8 BlazeKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - flag = FALSE; - SendThawedMessage(pokemon, target); - if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gBlazeKickSecondaryChance) != 0) { - BurnedStatusTarget(pokemon, target, 0, FALSE); - } - } - return flag; -} - -bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - bool8 flag; - - s32 rand1 = DungeonRandInt(100); - s32 rand2 = rand1; - if (rand1 < 10) { - flag = (sub_8055864(pokemon,target,move,0x78,param_4) != 0); - return flag; - } - else { - if (rand1 < 30) { - HealTargetHP(pokemon,target,GetEntInfo(target)->maxHPStat/4,0, - TRUE); - return TRUE; - } - else if (rand2 >= 60) { - flag = (sub_8055864(pokemon,target,move,0x28,param_4) != 0); - return flag; - } - else { - flag = (sub_8055864(pokemon,target,move,0x50,param_4) != 0); - return flag; - } - } -} diff --git a/src/move_checks.c b/src/move_checks.c index e6e846c64..0b395bc22 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -1,23 +1,21 @@ #include "global.h" +#include "globaldata.h" #include "math.h" #include "constants/status.h" #include "constants/type.h" #include "constants/weather.h" -#include "dungeon_engine.h" +#include "run_dungeon.h" #include "structs/str_dungeon.h" #include "dungeon_items.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "move_checks.h" #include "moves.h" #include "number_util.h" #include "status.h" #include "status_actions.h" -#include "status_checks_1.h" #include "text_util.h" -#include "tile_types.h" #include "trap.h" #include "weather.h" #include "dungeon_config.h" diff --git a/src/move_orb_actions_1.c b/src/move_orb_actions_1.c new file mode 100644 index 000000000..e27fac8ed --- /dev/null +++ b/src/move_orb_actions_1.c @@ -0,0 +1,1021 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_move_util.h" +#include "code_803E46C.h" +#include "code_803E724.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_807CD9C.h" +#include "code_808417C.h" +#include "constants/ability.h" +#include "constants/status.h" +#include "constants/targeting.h" +#include "constants/type.h" +#include "constants/weather.h" +#include "dungeon_logic.h" +#include "dungeon_items.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "dungeon_move.h" +#include "move_effects_target.h" +#include "moves.h" +#include "number_util.h" +#include "pokemon.h" +#include "status_actions.h" +#include "status.h" +#include "structs/dungeon_entity.h" +#include "structs/map.h" +#include "structs/str_dungeon.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_strings.h" + +extern void sub_806A5B8(Entity *entity); +void sub_8075900(Entity *pokemon, u8 r1); +extern u8 sub_8044B28(void); +extern void sub_807EC28(bool8); +extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +extern void MudWaterSportEffect(u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +extern void sub_806A6E8(Entity *); + +extern void EndAbilityImmuneStatus(Entity *, Entity *); +extern u8 sub_806F4A4(Entity *, u32); +extern void HandleExplosion(Entity *pokemon, Entity *target, DungeonPos *pos, u32, u8 moveType, s16); +extern void nullsub_92(Entity *); +extern u8 sub_807EAA0(u32, u32); + +// move_util.h +extern bool8 sub_805727C(Entity *, Entity *, s32); +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); +bool8 sub_80571F0(Entity * pokemon, Move *move); + +extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void DealDamageToEntity(Entity *, s32, u32, u32); +extern s16 sub_8057600(Move *move, s32 itemID); + +// Note: For some reason I have to define these as an array of 1 to match asm. +const s32 gUnknown_8106A4C[1] = {0}; +const s32 gUnknown_8106A50[1] = {1}; + +bool8 IronTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon, target, gIronTailSecondaryChance)) { + LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1, 1, FALSE); + } + } + return flag; +} + +static const s24_8 sRolloutModifiers[] = { + IntToF248_2(1.0), IntToF248_2(1.0), IntToF248_2(1.5), IntToF248_2(2.0), IntToF248_2(2.5), IntToF248_2(3.0), IntToF248_2(3.5), IntToF248_2(4.0), IntToF248_2(4.5), IntToF248_2(5.0) +}; + +bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + bool8 flag; + + flag = FALSE; + gUnknown_202F21C++; + + if (HandleDamagingMove(pokemon, target, move, sRolloutModifiers[gUnknown_202F21C], param_4) == 0) + gUnknown_202F220 = 1; + else + flag = TRUE; + return flag; +} + +bool8 YawnMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4) +{ + YawnedStatusTarget(pokemon, target, CalculateStatusTurns(target,gYawnTurnRange,TRUE) + 1); + return TRUE; +} + +// NOTE: Is there a better name for this? +bool8 BasicSleepMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4) +{ + SleepStatusTarget(pokemon, target, CalculateStatusTurns(target, gSleepTurnRange, TRUE), TRUE); + return TRUE; +} + +bool8 NightmareMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4) +{ + NightmareStatusTarget(pokemon, target, CalculateStatusTurns(target,gNightmareTurnRange,TRUE)); + return TRUE; +} + +bool8 MorningSunMoveAction(Entity * pokemon,Entity * target, Move *move, s32 param_4) +{ + HealTargetHP(pokemon, target, gMorningSunHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); + return TRUE; +} + +bool8 VitalThrowMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + VitalThrowStatusTarget(pokemon, target); + return TRUE; +} + +bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + Tile *tile; + bool8 flag; + + flag = FALSE; + tile = GetTileAtEntitySafe(pokemon); + if ((!IsTileGround(tile)) || ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != 1)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD14C); // It can only be used on land! + } + else { + if (MoveMatchesBideClassStatus(pokemon,move)) { + HandleDamagingMove(pokemon,target,move,gDigModifier,param_4); + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon,pokemon,STATUS_DIGGING,move,gUnknown_80FAD4C); // $m0 burrowed underground! + } + flag = TRUE; + } + return flag; +} + +bool32 SweetScentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + LowerAccuracyStageTarget(pokemon,target,gUnknown_8106A50[0],TRUE); + return TRUE; +} + +bool32 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C[0],FloatToF248(0.5),TRUE); + return TRUE; +} + +bool32 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + gDungeon->weather.unkE267[WEATHER_RAIN] = gMoveWeatherDuration; + if (sub_807EAA0(1,0) == 0) { + // The weather remains unchanged + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCF74); + } + return TRUE; +} + +bool32 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + gDungeon->weather.unkE267[WEATHER_HAIL] = gMoveWeatherDuration; + if (sub_807EAA0(1,0) == 0) { + // The weather remains unchanged + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCF80); + } + return TRUE; +} + +bool32 sub_80578EC(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + sub_8079F20(pokemon, target, 1, 0); + return TRUE; +} + +bool32 BubbleMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) +{ + bool32 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target, gBubbleSecondaryChance)) { + LowerMovementSpeedTarget(pokemon, target, 1, FALSE); + } + } + return flag; +} + +bool32 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + EncoreStatusTarget(pokemon, target); + return TRUE; +} + +bool32 RageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + // {POKEMON_0} is enraged + SetChargeStatusTarget(pokemon,target,STATUS_ENRAGED,move,gUnknown_80FAC88); + return TRUE; +} + +bool32 SuperFangMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s32 newHP; + bool8 local_24; + + newHP = GetEntInfo(target)->HP / 2; + local_24 = FALSE; + if (newHP != 0) { + sub_806F370(pokemon,target,newHP,1,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0); + local_24 = local_24 == 0; + } + else + { + // The target's HP can't be halved anymore + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD018); + } + return local_24; +} + +bool8 PainSplitMoveAction(Entity *attacker, Entity *target, Move *move, s32 param_4) +{ + EntityInfo *attackerInfo = GetEntInfo(attacker); + EntityInfo *targetInfo = GetEntInfo(target); + s32 newHP = (attackerInfo->HP + targetInfo->HP) / 2; + + attackerInfo->HP = newHP; + targetInfo->HP = newHP; + if (attackerInfo->HP > attackerInfo->maxHPStat) { + attackerInfo->HP = attackerInfo->maxHPStat; + } + if (targetInfo->HP > targetInfo->maxHPStat) { + targetInfo->HP = targetInfo->maxHPStat; + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],attacker,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); + SetExpMultplier(attackerInfo); + + // $m0 and $m1 shared their HP + TryDisplayDungeonLoggableMessage3(attacker,target,gUnknown_80FC7EC); + return TRUE; +} + +bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + Move *movePtr; + s32 iVar4; + Move struggleMove; + EntityInfo *entityInfo; + bool8 isTormented; + + entityInfo = GetEntInfo(target); + isTormented = FALSE; + + for(iVar4 = 0; iVar4 < MAX_MON_MOVES; iVar4++) + { + movePtr = &entityInfo->moves.moves[iVar4]; + if ((movePtr->moveFlags & MOVE_FLAG_EXISTS) != 0) { + if ((movePtr->moveFlags & MOVE_FLAG_DISABLED) == 0) { + if ((movePtr->moveFlags & MOVE_FLAG_LAST_USED) != 0) { + BufferMoveName(gFormatBuffer_Items[0],movePtr,0); + // $i0 was tormented + TryDisplayDungeonLoggableMessage3(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 ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_DISABLED) == 0) { + if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) != 0) { + InitPokemonMove(&struggleMove, MOVE_STRUGGLE); + entityInfo->moves.struggleMoveFlags |= MOVE_FLAG_DISABLED; + isTormented = TRUE; + BufferMoveName(gFormatBuffer_Items[0],&struggleMove,0); + // $i0 was tormented + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCFBC); + } + } + else if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) { + entityInfo->moves.struggleMoveFlags &= ~(MOVE_FLAG_DISABLED); + } + if (isTormented) + { + if(entityInfo->bideClassStatus.status == STATUS_BIDE) { + entityInfo->bideClassStatus.status = STATUS_NONE; + } + } + else + { + // The target couldn't be tormented + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCFE4); + } + return isTormented; +} + +bool8 StringShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + LowerMovementSpeedTarget(pokemon, target, 1, TRUE); + return TRUE; +} + +bool8 SwaggerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + ConfuseStatusTarget(pokemon, target, TRUE); + RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 2); + return TRUE; +} + +bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (IsSleeping(pokemon)) { + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gSnoreSecondaryChance)) { + CringeStatusTarget(pokemon,target,FALSE); + } + } + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC734); + } + return flag; +} + +bool8 ScreechMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + ChangeDefenseMultiplierTarget(pokemon, target, gUnknown_8106A4C[0], FloatToF248(0.25), 1); + return TRUE; +} + +bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gRockSlideSecondaryChance)) { + CringeStatusTarget(pokemon,target,FALSE); + } + } + return flag; +} + +bool32 WeatherBallMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + u32 weather; + s32 flag; + + weather = GetApparentWeather(pokemon); + flag = sub_80556BC(pokemon,target,gWeatherBallTypes[weather],move, + gWeatherBallModifiers[weather],param_4); + if (flag) { + flag = TRUE; + } + return flag; +} + +bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + s24_8 modifier; + bool8 flag; + u8 chargeStatus; + + flag = FALSE; + chargeStatus = GetEntInfo(target)->bideClassStatus.status; + modifier = IntToF248_2(1); + if (chargeStatus == STATUS_DIVING) { + modifier = IntToF248_2(2); + } + if (HandleDamagingMove(pokemon,target,move,modifier,param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gMovesConstrictionChance)) { + SqueezedStatusTarget(pokemon,target,0x3b,FALSE); + } + } + return flag; +} + +bool8 FakeTearsMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 2, 1, TRUE); + return TRUE; +} + +bool8 SpiteMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + s32 i; + EntityInfo *targetInfo = GetEntInfo(target); + bool8 flag = FALSE; + + for (i = 0; i < MAX_MON_MOVES; i++) { + Move *move = &targetInfo->moves.moves[i]; + if (MoveFlagExists(move) && MoveFlagLastUsed(move)) { + move->PP = 0; + flag = TRUE; + } + } + + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + if (flag) { + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD350); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD370); + } + + return flag; +} + +bool8 FocusEnergyMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + FocusEnergyStatusTarget(pokemon, target); + return TRUE; +} + +bool8 SmokescreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + WhifferStatusTarget(pokemon, target, CalculateStatusTurns(target, gWhifferTurnRange, TRUE)); + return TRUE; +} + +bool8 MirrorMoveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + SendThawedMessage(pokemon, target); + MirrorMoveStatusTarget(pokemon, target); + return TRUE; +} + +bool8 OverheatMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + EntityInfo *entityInfo; + bool8 flag; + + flag = FALSE; + entityInfo = GetEntInfo(pokemon); + SendThawedMessage(pokemon,target); + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if (RollSecondaryEffect(pokemon, 0)) { + entityInfo->unk155 = 1; + } + } + return flag; +} + +bool8 AuroraBeamMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gAuroraBeamAtkLowerChance)) + { + ChangeAttackMultiplierTarget(pokemon, target, gUnknown_8106A4C[0], FloatToF248(0.5), FALSE); + } + } + return flag; +} + +bool8 MementoMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + entityInfo->HP = 1; + ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C[0],FloatToF248(0.25),TRUE); + ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A50[0],FloatToF248(0.25),TRUE); + entityInfo->unk154 = 1; + return TRUE; +} + +bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gOctazookaAccLowerChance)) + { + LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C[0], FALSE); + } + } + return flag; +} + +bool8 FlatterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + ConfuseStatusTarget(pokemon, target, TRUE); + RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50[0], 1); + return TRUE; +} + +bool8 WillOWispMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + u8 flashFireStatus; + + flashFireStatus = GetFlashFireStatus(target); + if (flashFireStatus != FLASH_FIRE_STATUS_NONE) { + if (GetEntInfo(target)->unk152 == 0) { + GetEntInfo(target)->unk152 = 1; + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); + if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAE00); // Fire moves won't become stronger + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FADD8); // $m0 used flash fire to absorb fire + } + } + } + else { + BurnedStatusTarget(pokemon,target, 0, TRUE); + } + return TRUE; +} + +bool8 ReturnMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) +{ + s32 i; + bool8 local_24; + EntityInfo *entityInfo = GetEntInfo(pokemon); + s32 dmg = 1; + + for (i = 0; i < 999 && gReturnDmgData[i].minIq >= 0; i++) { + if (entityInfo->IQ < gReturnDmgData[i].minIq) { + dmg = gReturnDmgData[i].dmgVal; + break; + } + } + + sub_806F370(pokemon,target,dmg,1,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0); + local_24 = (local_24 == 0); + return local_24; +} + +bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4) +{ + EntityInfo *entityInfo; + bool8 hasGrudge; + + hasGrudge = FALSE; + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); + if (entityInfo->grudge) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD2B4); + } + else { + entityInfo->grudge = TRUE; + hasGrudge = TRUE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD294); + } + return hasGrudge; +} + +bool8 CounterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + CounterStatusTarget(pokemon, target, STATUS_COUNTER); + return TRUE; +} + +bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + SendThawedMessage(pokemon, target); + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gFlameWheelSecondaryChance)) + { + BurnedStatusTarget(pokemon, target, 0, FALSE); + } + } + return flag; +} + +// NOTE: Do we have a better name for this?? +bool8 BasicFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + SendThawedMessage(pokemon, target); + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gFireMoveBurnSecondaryChance)) + { + BurnedStatusTarget(pokemon, target, 0, FALSE); + } + } + return flag; +} + +bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + u16 uVar1; + uVar1 = (move->id == MOVE_FORESIGHT) ? 0x7A : 0x51; + ExposeStatusTarget(pokemon, target, uVar1); + return TRUE; +} + +bool8 DoubleTeamMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50[0]); + return TRUE; +} + +bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + s32 modifierInt; + EntityInfo *targetInfo; + + modifierInt = 1; + targetInfo = GetEntInfo(target); + if(targetInfo->bideClassStatus.status == STATUS_FLYING || targetInfo->bideClassStatus.status == STATUS_BOUNCING) + modifierInt = 2; + flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(modifierInt),param_4) ? TRUE : FALSE; + return flag; +} + +// NOTE: Is there a better name for this? +bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); + return TRUE; +} + +bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + ParalyzeStatusTarget(pokemon, target, TRUE); + return TRUE; +} + +// NOTE: Is there a better name for this? +bool8 BasicRaiseAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); + return TRUE; +} + +bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + bool8 flag; + + if (MoveMatchesBideClassStatus(pokemon,move)) { + flag = HandleDamagingMove(pokemon,target,move,gRazorWindModifier,param_4) ? TRUE : FALSE; + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon,pokemon,STATUS_RAZOR_WIND,move,gUnknown_80FAC54); + flag = TRUE; + } + return flag; +} + +bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + SetChargeStatusTarget(pokemon, target, STATUS_BIDE, move, gUnknown_80FAC74); + return TRUE; +} + +bool8 Bide2MoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s32 iVar2; + bool8 local_18; + + local_18 = FALSE; + iVar2 = GetEntInfo(pokemon)->unkA0 * 2; + if (999 < iVar2) { + iVar2 = 999; + } + sub_806F370(pokemon,target,iVar2,1,&local_18, GetMoveType(move),0x1ff,0,1,0); + + local_18 = local_18 == 0; + return local_18; +} + +bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gShadowBallSecondaryChance)) + { + LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 1, 1, FALSE); + } + } + return flag; +} + +bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gBiteSecondaryChance)) + { + CringeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gThunderSecondaryChance)) + { + ParalyzeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s32 diffHP; + bool8 local_24; + EntityInfo *entityInfo; + EntityInfo *entityInfo1; + + + local_24 = 0; + entityInfo = GetEntInfo(pokemon); + entityInfo1 = GetEntInfo(target); + diffHP = entityInfo1->HP - entityInfo->HP; + if (diffHP < 0) { + diffHP = 0; + } + sub_806F370(pokemon,target,diffHP,0,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0); + + local_24 = local_24 == 0; + return local_24; +} + +bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + s24_8 modifier; + + modifier = IntToF248_2(1); + if((GetEntInfo(pokemon)->burnClassStatus.status) != STATUS_NONE) + modifier = gFacadeModifier; + flag = HandleDamagingMove(pokemon,target,move,modifier,param_4) ? TRUE : FALSE; + return flag; +} + +bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gConstrictBubblebeamSecondaryChance)) + { + LowerMovementSpeedTarget(pokemon, target, 1, FALSE); + } + } + return flag; +} + +bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if ((GetEntInfo(target)->reflectClassStatus.status == STATUS_REFLECT) || (GetEntInfo(target)->reflectClassStatus.status == STATUS_LIGHT_SCREEN)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD104); // The barrier was shattered + EndReflectClassStatus(pokemon,target); + flag = TRUE; + } + + flag |= (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0); + return flag; +} + +bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, 0)) + { + LowerMovementSpeedTarget(pokemon, target, 1, FALSE); + } + } + return flag; +} + +bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + bool8 flag; + + if (MoveMatchesBideClassStatus(pokemon,move)) { + flag = HandleDamagingMove(pokemon,target,move,gFocusPunchModifier,param_4) ? TRUE : FALSE; + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon,pokemon,STATUS_FOCUS_PUNCH,move,gUnknown_80FACA4); + flag = TRUE; + } + return flag; +} + +bool8 GigaDrainMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + bool8 hasLiquidOoze; + s32 uVar3; + s32 newHP; + bool8 flag; + EntityInfo *entityInfo; + + hasLiquidOoze = AbilityIsActive(target, ABILITY_LIQUID_OOZE); + uVar3 = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4); + flag = uVar3 != 0 ? TRUE : FALSE; + if (flag && RollSecondaryEffect(pokemon, 0)) { + newHP = uVar3 / 2; + entityInfo = GetEntInfo(pokemon); + flag = TRUE; + if (newHP < 1) { + newHP = 1; + } + SetExpMultplier(entityInfo); + if (hasLiquidOoze) { + DealDamageToEntity(pokemon, newHP, 0xd, 0x1fa); + } + else { + HealTargetHP(pokemon, pokemon, newHP, 0, TRUE); + } + } + return flag; +} + +bool8 ReversalMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + s32 index; + bool8 flag; + EntityInfo *entityInfo = GetEntInfo(pokemon); + s32 maxHp = entityInfo->maxHPStat; + if (entityInfo->HP <= entityInfo->maxHPStat / 4) { + index = 0; + } + else if (entityInfo->HP <= maxHp / 2) { + index = 1; + } + else if (entityInfo->HP <= (maxHp * 3) / 4) { + index = 2; + } + else { + index = 3; + } + + flag = HandleDamagingMove(pokemon,target,move,gReversalModifiers[index],param_4) ? TRUE : FALSE; + return flag; +} + +bool8 SmellingSaltMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + bool8 flag; + + if (GetEntInfo(target)->burnClassStatus.status == STATUS_PARALYSIS) { + flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(2),param_4) ? TRUE : FALSE; + EndBurnClassStatus(pokemon, target); + } + else { + flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) ? TRUE : FALSE; + } + return flag; +} + +bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 3, 1, TRUE); + return TRUE; +} + +bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s32 index = gUnknown_8106A4C[0]; + LowerAttackStageTarget(pokemon, target, index, 1, 1, TRUE); + LowerDefenseStageTarget(pokemon, target, index, 1, 1, TRUE); + return TRUE; +} + +bool8 sub_805889C(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + ImmobilizedStatusTarget(pokemon, target); + return TRUE; +} + +bool8 HazeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + sub_8079E34(pokemon, target, TRUE); + return TRUE; +} + +bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag = FALSE; + if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) + { + flag = TRUE; + if(RollSecondaryEffect(pokemon, 0)) + { + gUnknown_202F219 = 1; + } + } + return flag; +} + +bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s24_8 weight; + bool8 flag; + EntityInfo *entityInfo = GetEntInfo(target); + + weight.raw = GetWeight(entityInfo->apparentID); + flag = HandleDamagingMove(pokemon, target, move, weight, param_4) != 0 ? TRUE: FALSE; + return flag; +} + +bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag = FALSE; + EntityInfo *entityInfo; + s32 index1; + s32 index2; + if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) + { + flag = TRUE; + if(RollSecondaryEffect(pokemon, gAncientPowerSecondaryChance)) + { + entityInfo = GetEntInfo(pokemon); + RaiseMovementSpeedTarget(pokemon, pokemon, 0, TRUE); + index1 = gUnknown_8106A4C[0]; + RaiseAttackStageTarget(pokemon, pokemon, index1, 1); + index2 = gUnknown_8106A50[0]; + RaiseAttackStageTarget(pokemon, pokemon, index2, 1); + RaiseDefenseStageTarget(pokemon, pokemon, index1, 1); + RaiseDefenseStageTarget(pokemon, pokemon, index2, 1); + SetExpMultplier(entityInfo); + } + } + return flag; +} + +bool8 SynthesisMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + HealTargetHP(pokemon, target, gSynthesisHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); + return TRUE; +} + +bool8 AgilityMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseMovementSpeedTarget(pokemon, target, 0, TRUE); + return TRUE; +} + +bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag = FALSE; + if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) + { + flag = TRUE; + if(RollSecondaryEffect(pokemon, 0)) + { + gUnknown_202F21A = 1; + } + } + return flag; +} + +bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + SureShotStatusTarget(pokemon, target, CalculateStatusTurns(target, gSureShotTurnRange, FALSE)); + return TRUE; +} + +bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); + RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 1); + return TRUE; +} + diff --git a/src/move_orb_actions_2.c b/src/move_orb_actions_2.c new file mode 100644 index 000000000..a4136ffd0 --- /dev/null +++ b/src/move_orb_actions_2.c @@ -0,0 +1,965 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_move_util.h" +#include "code_803E46C.h" +#include "code_803E724.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_807CD9C.h" +#include "code_808417C.h" +#include "constants/ability.h" +#include "constants/status.h" +#include "constants/targeting.h" +#include "constants/type.h" +#include "constants/weather.h" +#include "dungeon_logic.h" +#include "dungeon_items.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "dungeon_move.h" +#include "move_effects_target.h" +#include "moves.h" +#include "number_util.h" +#include "pokemon.h" +#include "status_actions.h" +#include "status.h" +#include "structs/dungeon_entity.h" +#include "structs/map.h" +#include "structs/str_dungeon.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_strings.h" + +extern void sub_806A5B8(Entity *entity); +void sub_8075900(Entity *pokemon, u8 r1); +extern u8 sub_8044B28(void); +extern void sub_807EC28(bool8); +extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +extern void MudWaterSportEffect(u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +extern void sub_806A6E8(Entity *); + +extern void EndAbilityImmuneStatus(Entity *, Entity *); +extern u8 sub_806F4A4(Entity *, u32); +extern void HandleExplosion(Entity *pokemon, Entity *target, DungeonPos *pos, u32, u8 moveType, s16); +extern void nullsub_92(Entity *); +extern u8 sub_807EAA0(u32, u32); + +// move_util.h +extern bool8 sub_805727C(Entity *, Entity *, s32); +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); +bool8 sub_80571F0(Entity * pokemon, Move *move); + +extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void DealDamageToEntity(Entity *, s32, u32, u32); +extern s16 sub_8057600(Move *move, s32 itemID); + +extern u32 gUnknown_8106A4C; +extern u32 gUnknown_8106A50; + +bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag = FALSE; + + if(MoveMatchesBideClassStatus(pokemon, move)) + { + if (HandleDamagingMove(pokemon, target, move, gSkyAttackModifier, param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gSkyAttackSecondaryChance)) + CringeStatusTarget(pokemon, target, FALSE); + } + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon, pokemon, STATUS_SKY_ATTACK, move, gUnknown_80FACC4); + flag = TRUE; + } + return flag; +} + +// NOTE: Is there a better name for this? +bool8 BasicIceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gIceMoveFreezeSecondaryChance)) + { + FrozenStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + EntityInfo *entityInfo; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, pokemon, gMeteorMashSecondaryChance)) + { + entityInfo = GetEntInfo(pokemon); + RaiseAttackStageTarget(pokemon, pokemon, gUnknown_8106A4C, 1); + SetExpMultplier(entityInfo); + } + } + return flag; +} + +bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + EndureStatusTarget(pokemon, pokemon); + return TRUE; +} + +bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + LowerMovementSpeedTarget(pokemon, target, 1, TRUE); + return TRUE; +} + +bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gMovesConfusionSecondaryChance)) + { + ConfuseStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 PsywaveMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s32 rand; + bool8 flag; + + rand = DungeonRandRange(128, 384); // 0x80 - 0x180 + rand = (rand * GetEntInfo(pokemon)->level) / 256; + if (rand < 0) { + rand = 1; + } + if (199 < rand) { + rand = 199; + } + flag = sub_8055864(pokemon,target,move,rand,param_4) != 0 ? TRUE: FALSE; + return flag; +} + +bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_5) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gPsychicSecondaryChance)) + { + LowerDefenseStageTarget(pokemon, target, param_4, 1, 1, FALSE); + } + } + return flag; +} + +bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag = FALSE; + if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) + { + flag = TRUE; + if(RollSecondaryEffect(pokemon, 0)) + { + LowerAttackStageTarget(pokemon, pokemon, gUnknown_8106A50, 2, 0, FALSE); + } + } + return flag; +} + +bool8 UproarMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + SleeplessStatusTarget(pokemon, target); + return TRUE; +} + +bool8 WaterSpoutMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + s32 index; + bool8 flag; + EntityInfo *entityInfo = GetEntInfo(pokemon); + s32 maxHp = entityInfo->maxHPStat; + if (entityInfo->HP <= entityInfo->maxHPStat / 4) { + index = 0; + } + else if (entityInfo->HP <= maxHp / 2) { + index = 1; + } + else if (entityInfo->HP <= (maxHp * 3) / 4) { + index = 2; + } + else { + index = 3; + } + + flag = HandleDamagingMove(pokemon,target,move,gWaterSpoutModifiers[index],param_4) ? TRUE : FALSE; + return flag; +} + +bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + s32 index; + EntityInfo *iVar3; + EntityInfo *iVar4; + + iVar4 = GetEntInfo(pokemon); + iVar3 = GetEntInfo(target); + nullsub_92(target); + + for(index = 0; index < 2; index++) + { + iVar4->offensiveStages[index] = iVar3->offensiveStages[index]; + iVar4->defensiveStages[index] = iVar3->defensiveStages[index]; + iVar4->hitChanceStages[index] = iVar3->hitChanceStages[index]; + iVar4->offensiveMultipliers[index] = iVar3->offensiveMultipliers[index]; + iVar4->defensiveMultipliers[index] = iVar3->defensiveMultipliers[index]; + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBD58); // It psyched itself up! + SetExpMultplier(iVar4); + return TRUE; +} + +bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + int iVar2; + int iVar3; + bool8 flag; + + flag = FALSE; + if ((HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) && (EntityIsValid(pokemon))) { + iVar2 = GetEntInfo(pokemon)->maxHPStat; + if (iVar2 < 0) { + iVar2 = iVar2 + 7; + } + iVar3 = iVar2 >> 3; + if (iVar3 == 0) { + iVar3 = 1; + } + flag = TRUE; + if ((!AbilityIsActive(pokemon, ABILITY_ROCK_HEAD)) && RollSecondaryEffect(pokemon, 0)) { + sub_806F370(pokemon,pokemon,iVar3,0,0,0,0x1fd,0x14,1,0); + } + } + return flag; +} + +bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + HealTargetHP(pokemon, target, GetEntInfo(target)->maxHPStat / 2, 0, TRUE); + return TRUE; +} + +bool32 EarthquakeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + bool32 flag; + EntityInfo *entityInfo; + s32 modifierInt; + + entityInfo = GetEntInfo(target); + modifierInt = 1; + gDungeon->unk181e8.unk18200 = 0xc; + gDungeon->unk181e8.unk18204 = 0; + if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { + modifierInt = 2; + } + flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(modifierInt),param_4); + if (flag != 0) { + flag = TRUE; + } + return flag; +} + +bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + bool8 flag; + s32 tileset; + Move natureMove; + + tileset = gDungeon->tileset; + if (tileset < 0) { + tileset = 0; + } + if (0x4a < tileset) { + tileset = 0x4a; + } + InitPokemonMove(&natureMove, gNaturePowerCalledMoves[tileset].moveID); + flag = gNaturePowerCalledMoves[tileset].callback(pokemon,target,&natureMove,param_4); + return flag; +} + +bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gLickSecondaryChance)) + { + ParalyzeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 SelfDestructMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + HandleExplosion(pokemon, target, &target->pos, 1, GetMoveType(move), sub_8057600(move, param_4)); + return TRUE; +} + +bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + ParalyzeStatusTarget(pokemon, target, TRUE); + return TRUE; +} + +bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + SetChargeStatusTarget(pokemon, target, STATUS_CHARGING, move, gUnknown_80FAD6C); + return TRUE; +} + +bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gThunderboltSecondaryChance)) + { + ParalyzeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 MistMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + MistStatusTarget(pokemon, target); + return TRUE; +} + +bool8 FissureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + u8 moveType; + bool8 uVar5; + bool8 flag; + + flag = FALSE; + moveType = GetMoveType(move); + + uVar5 = sub_806F4A4(target, moveType) != 0 ? TRUE : FALSE; + + if (AbilityIsActive(target, ABILITY_LEVITATE)) { + uVar5 = FALSE; + } + if (!uVar5) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEB88); + } + else { + sub_806F370(pokemon,target,9999,1,&flag,GetMoveType(move),sub_8057600(move,param_4),0,1,1); + flag = flag == 0; + } + return flag; +} + +bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gExtrasensorySecondaryChance)) + { + CringeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 SafeguardMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + SafeguardStatusTarget(pokemon, target); + return TRUE; +} + +bool8 AbsorbMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + bool8 hasLiquidOoze; + s32 iVar3; + s32 iVar4; + bool8 flag; + + flag = FALSE; + hasLiquidOoze = AbilityIsActive(target, ABILITY_LIQUID_OOZE); + iVar3 = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4); + if (iVar3 != 0) { + iVar4 = iVar3 / 2; + if (iVar4 < 1) { + iVar4 = 1; + } + if (EntityIsValid(pokemon)) { + EntityInfo *entityInfo = GetEntInfo(pokemon); + flag = TRUE; + SetExpMultplier(entityInfo); + if (RollSecondaryEffect(pokemon,0)) { + if (hasLiquidOoze) { + DealDamageToEntity(pokemon,iVar4,0xd,0x1fa); + } + else { + HealTargetHP(pokemon,pokemon,iVar4,0,1); + } + } + } + } + return flag; +} + +bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + bool32 flag; + + EntityInfo *pokeEntityData = GetEntInfo(pokemon); + EntityInfo *targetEntityInfo = GetEntInfo(target); + if ((AbilityIsActive(target, ABILITY_WONDER_GUARD)) || (AbilityIsActive(pokemon, ABILITY_WONDER_GUARD))) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC8C0); + flag = FALSE; + } + else + { + s32 ability1 = targetEntityInfo->abilities[0]; + s32 ability2 = targetEntityInfo->abilities[1]; + targetEntityInfo->abilities[0] = pokeEntityData->abilities[0]; + targetEntityInfo->abilities[1] = pokeEntityData->abilities[1]; + pokeEntityData->abilities[0] = ability1; + pokeEntityData->abilities[1] = ability2; + gDungeon->unkC = 1; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC888); + // Weirdly enough SetExpMultplier inline doesn't work here... + if (pokeEntityData->expMultiplier == EXP_HALVED) { + pokeEntityData->expMultiplier = EXP_REGULAR; + } + EndAbilityImmuneStatus(pokemon,pokemon); + EndAbilityImmuneStatus(pokemon,target); + flag = TRUE; + } + return flag; +} + +bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + s32 i; + bool32 ret = FALSE; + EntityInfo *pokeInfo = GetEntInfo(pokemon); + EntityInfo *targetInfo = GetEntInfo(target); + bool32 moveFound = FALSE; + u16 moveId = MOVE_NOTHING; + + for (i = 0; i < MAX_MON_MOVES; i++) { + if (MoveFlagExists(&targetInfo->moves.moves[i]) && targetInfo->moves.moves[i].moveFlags & MOVE_FLAG_LAST_USED) { + moveId = targetInfo->moves.moves[i].id; + moveFound = TRUE; + break; + } + } + + if (!moveFound) { + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FE3BC); + return FALSE; + } + + if (moveId == MOVE_NOTHING) { + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FE3BC); + } + else { + InitPokemonMove(move, moveId); + BufferMoveName(gFormatBuffer_Items[0], move, 0); + move->moveFlags2 |= MOVE_FLAG2_UNK4; + move->moveFlags2 |= MOVE_FLAG_REPLACE; + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FE38C); + ASM_MATCH_TRICK(pokeInfo); + SetExpMultplier(pokeInfo); + ret = TRUE; + } + + return ret; +} + +bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gHeadbuttSecondaryChance)) + { + CringeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 DoubleEdgeMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + s32 HP; + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if ((!AbilityIsActive(pokemon, ABILITY_ROCK_HEAD)) && (RollSecondaryEffect(pokemon,0) != 0)) { + HP = GetEntInfo(pokemon)->maxHPStat; + if (HP < 0) { + HP = HP + 7; + } + HP = HP >> 3; + if (HP == 0) { + HP = 1; + } + sub_806F370(pokemon,pokemon,HP,0,0,0,0x1fd,0x14,1,0); + } + } + return flag; +} + +bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + gDungeon->weather.unkE267[WEATHER_SANDSTORM] = gMoveWeatherDuration; + if(sub_807EAA0(1, 0) == 0) + { + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCF78); + } + return TRUE; +} + +bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, TRUE); + return TRUE; +} + +bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gSmogSecondaryChance)) + { + PoisonedStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 GrowthMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50, 1); + return TRUE; +} + +bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gSacredFireSecondaryChance)) + { + BurnedStatusTarget(pokemon, target, 0, FALSE); + } + } + return flag; +} + +bool8 sub_80595EC(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + u8 moveType; + u8 local_20; + + local_20 = 0; + if (sub_806F4A4(target,GetMoveType(move)) == 0) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEB8C); + return FALSE; + } + else { + moveType = GetMoveType(move); + sub_806F370(pokemon,target,9999,1,&local_20,moveType,sub_8057600(move,param_4),0,1,0); + local_20 = (local_20 == 0); + return local_20; + } +} + +bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + u8 weather; // weather and flag are reused in same variable + s24_8 modifier; + + weather = GetApparentWeather(pokemon); + if ((weather == WEATHER_SUNNY) || (MoveMatchesBideClassStatus(pokemon,move))) { + modifier = gSolarBeamModifier; + + if (((weather == WEATHER_SANDSTORM) || (weather == WEATHER_RAIN)) || weather == WEATHER_HAIL) { + modifier.raw /= 2; + } + weather = HandleDamagingMove(pokemon,target,move,modifier,param_4) != 0 ? TRUE : FALSE; + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon,pokemon,STATUS_SOLARBEAM,move,gUnknown_80FACE4); + weather = TRUE; + } + return weather; +} + +bool8 SonicboomMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + u8 local_20; + + local_20 = 0; + sub_806F370(pokemon,target,gSonicboomDmgValue,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,1,0); + local_20 = local_20 == 0; + return local_20; +} + +bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (MoveMatchesBideClassStatus(pokemon,move)) { + flag = HandleDamagingMove(pokemon,target,move,gFlyModifier,param_4) != 0 ? TRUE : FALSE; + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon,pokemon,STATUS_FLYING,move,gUnknown_80FACFC); + flag = TRUE; + } + return flag; +} + +bool8 ExplosionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + HandleExplosion(pokemon,target,&target->pos,2,GetMoveType(move),sub_8057600(move,param_4)); + return TRUE; +} + +bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (IsTileGround(GetTileAtEntitySafe(pokemon))) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD128); + } + else if (MoveMatchesBideClassStatus(pokemon,move)) { + flag = HandleDamagingMove(pokemon,target,move,gDiveModifier,param_4) != 0 ? TRUE : FALSE; + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon,pokemon,STATUS_DIVING,move,gUnknown_80FAD2C); + flag = TRUE; + } + return flag; +} + +bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gMuddyWaterAccLowerChance)) + { + LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, FALSE); + } + } + return flag; +} + +bool8 StockpileMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + HandleStockpile(pokemon, target); + return TRUE; +} + +bool8 TwisterMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + s32 modifierInt = 1; + bool8 flag = FALSE; + EntityInfo *entInfo = GetEntInfo(target); + + if (entInfo->bideClassStatus.status == STATUS_FLYING || entInfo->bideClassStatus.status == STATUS_BOUNCING) { + modifierInt = 2; + } + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(modifierInt),param_4) != 0) + { + flag = TRUE; + if(sub_805727C(pokemon,target,gTwisterSecondaryChance) != 0) { + CringeStatusTarget(pokemon,target,FALSE); + } + } + return flag; +} + +bool8 TwineedleMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + gUnknown_202F218 = 1; + } + if (((gUnknown_202F218 != 0) && (gUnknown_202F214 == 2)) && + (sub_805727C(pokemon,target,gTwineedleSecondaryChance) != 0)) { + PoisonedStatusTarget(pokemon,target,FALSE); + } + return flag; +} + +bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s32 HP; + + HP = GetEntInfo(target)->maxHPStat; + if(HP < 0) + HP += 3; + HealTargetHP(pokemon, target, HP >> 2, 0, TRUE); + return TRUE; +} + +bool8 MinimizeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50); + return TRUE; +} + +bool8 sub_8059A2C(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + u8 local_20; + u32 level; + + local_20 = 0; + level = GetEntInfo(pokemon)->level; + sub_806F370(pokemon,target,level,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,1,0); + local_20 = local_20 == 0; + return local_20; +} + +bool8 SupersonicMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + ConfuseStatusTarget(pokemon, target, TRUE); + return TRUE; +} + +bool8 TauntMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + TauntStatusTarget(pokemon, target); + return TRUE; +} + +bool8 MoonlightMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + HealTargetHP(pokemon, target, gMoonlightHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); + return TRUE; +} + +bool8 HornDrillMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + u8 local_20; + + local_20 = 0; + if (sub_806F4A4(target,GetMoveType(move)) == 0) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEB90); + return FALSE; + } + else { + sub_806F370(pokemon,target,9999,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,0,0); + local_20 = local_20 == 0; + return local_20; + } +} + +bool8 SwordsDanceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 2); + return TRUE; +} + +bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + u8 moveType; + Move *movePtr; + s32 index; + EntityInfo * info; + s32 counter; + s32 newIndex; + Move *moveStack [MAX_MON_MOVES]; + + counter = 0; + info = GetEntInfo(target); + if (AbilityIsActive(target, ABILITY_FORECAST)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrForecastPreventsTypeSwitchMessage); + return FALSE; + } + else + { + for(index = 0; index < MAX_MON_MOVES; index++) + { + movePtr = &info->moves.moves[index]; + if (((movePtr->moveFlags & MOVE_FLAG_EXISTS)) && (GetMoveTypeForMonster(target,movePtr) != TYPE_NONE)) { + moveStack[counter] = movePtr; + counter++; + } + } + if (counter == 0) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FE36C); + return FALSE; + } + else + { + newIndex = DungeonRandInt(counter); + moveType = GetMoveTypeForMonster(target,moveStack[newIndex]); + info->types[0] = moveType; + info->types[1] = TYPE_NONE; + info->isColorChanged = TRUE; + BufferMoveName(gFormatBuffer_Items[0], moveStack[newIndex], NULL); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FE330); + return TRUE; + } + } +} + +bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + Conversion2StatusTarget(pokemon, target); + return TRUE; +} + +bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + flag = FALSE; + if(pokemon == target) + { + TryDisplayDungeonLoggableMessage3(target, target, gUnknown_80FEB60); + } + else { + RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1); + RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50, 1); + flag = TRUE; + } + return flag; +} + +bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 2); + return TRUE; +} + +bool8 WarpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + WarpTarget(pokemon, target, 0, NULL); + return TRUE; +} + +bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gThundershockSecondaryChance)) + { + ParalyzeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + ParalyzeStatusTarget(pokemon, target, TRUE); + return TRUE; +} + +bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, 0)) + { + ParalyzeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 BlockMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + ImmobilizedStatusTarget(pokemon, target); + return TRUE; +} + +bool8 PoisonGasMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + PoisonedStatusTarget(pokemon, target, TRUE); + return TRUE; +} + +bool8 ToxicMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + BadlyPoisonedStatusTarget(pokemon, target, TRUE); + return TRUE; +} + +bool8 PoisonFangMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gPoisonFangSecondaryChance)) + { + BadlyPoisonedStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + diff --git a/src/move_orb_actions_3.c b/src/move_orb_actions_3.c new file mode 100644 index 000000000..c70bfbb75 --- /dev/null +++ b/src/move_orb_actions_3.c @@ -0,0 +1,1076 @@ +#include "global.h" +#include "globaldata.h" +#include "code_803E46C.h" +#include "code_803E724.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_807CD9C.h" +#include "code_808417C.h" +#include "constants/ability.h" +#include "constants/move_id.h" +#include "constants/status.h" +#include "constants/targeting.h" +#include "constants/type.h" +#include "constants/weather.h" +#include "dungeon_logic.h" +#include "dungeon_config.h" +#include "run_dungeon.h" +#include "dungeon_items.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_misc.h" +#include "dungeon_move.h" +#include "dungeon_move_util.h" +#include "dungeon_random.h" +#include "dungeon_strings.h" +#include "dungeon_util.h" +#include "moves.h" +#include "move_effects_target.h" +#include "move_util.h" +#include "number_util.h" +#include "pokemon.h" +#include "status.h" +#include "status_actions.h" +#include "structs/dungeon_entity.h" +#include "structs/map.h" +#include "structs/str_dungeon.h" +#include "text_util.h" +#include "trap.h" +#include "weather.h" + +extern void sub_806A5B8(Entity *entity); +void sub_8075900(Entity *pokemon, u8 r1); +extern u8 sub_8044B28(void); +extern void sub_807EC28(bool8); +extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +static void sub_805A7D4(Entity *, Entity *, Item *, DungeonPos *); +extern void MudWaterSportEffect(u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +extern void sub_806A6E8(Entity *); + +extern void EndAbilityImmuneStatus(Entity *, Entity *); +extern u8 sub_806F4A4(Entity *, u32); +extern void HandleExplosion(Entity *pokemon, Entity *target, DungeonPos *pos, u32, u8 moveType, s16); +extern void nullsub_92(Entity *); +extern u8 sub_807EAA0(u32, u32); + +// move_util.h +extern bool8 sub_805727C(Entity *, Entity *, s32); +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); +bool8 sub_80571F0(Entity * pokemon, Move *move); + +extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); +extern void DealDamageToEntity(Entity *, s32, u32, u32); +extern s16 sub_8057600(Move *move, s32 itemID); + +extern u32 gUnknown_8106A4C; +extern u32 gUnknown_8106A50; + +bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gPoisonStingSecondaryChance)) + { + PoisonedStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 JumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5) +{ + u8 moveType; + u32 movePower; + u32 moveCritChance; + bool8 flag; + s32 local_30 [4]; + u8 auStack_20; + + flag = FALSE; + if (param_5 == 0) { + flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0 ? TRUE : FALSE; + } + if (!flag) { + moveType = GetMoveTypeForMonster(pokemon,move); + movePower = GetMovePower(pokemon,move); + moveCritChance = GetMoveCritChance(move); + CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0); + SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC7C8); + local_30[0] = local_30[0] / 2; + if (local_30[0] == 0) { + local_30[0] = 1; + } + sub_806F370(pokemon,pokemon,local_30[0],0,&auStack_20,0,0x1f7,0x13,1,0); + } + return flag; +} + +bool8 BounceMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (MoveMatchesBideClassStatus(pokemon, move)) { + if (HandleDamagingMove(pokemon, target, move, gBounceModifier, param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon, target, gBounceSecondaryChance) != 0) { + ParalyzeStatusTarget(pokemon, target, FALSE); + } + } + sub_8079764(pokemon); + } + else { + SetChargeStatusTarget(pokemon, pokemon, STATUS_BOUNCING, move, gUnknown_80FAD10); + flag = TRUE; + } + return flag; +} + +bool8 HiJumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5) +{ + u8 moveType; + u32 movePower; + u32 moveCritChance; + bool8 flag; + s32 local_30 [4]; + u8 auStack_20; + + flag = FALSE; + if (param_5 == 0) { + flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(2),param_4) != 0 ? TRUE : FALSE; + } + if (!flag) { + moveType = GetMoveTypeForMonster(pokemon,move); + movePower = GetMovePower(pokemon,move); + moveCritChance = GetMoveCritChance(move); + CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0); + SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC7C8); + local_30[0] = local_30[0] / 2; + if (local_30[0] == 0) { + local_30[0] = 1; + } + sub_806F370(pokemon,pokemon,local_30[0],0,&auStack_20,0,0x1f8,0x13,1,0); + } + return flag; +} + +bool8 TriAttackMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4)) + { + flag = TRUE; + if(sub_805727C(pokemon, target, gTriAttackSecondaryChance)) + { + switch(DungeonRandInt(3)) + { + case 0: + default: + ParalyzeStatusTarget(pokemon, target, FALSE); + break; + case 1: + BurnedStatusTarget(pokemon, target, 0, FALSE); + break; + case 2: + FrozenStatusTarget(pokemon, target, FALSE); + break; + } + } + } + return flag; +} + +bool8 TrickMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) +{ + EntityInfo *r9; + EntityInfo *r8; + EntityInfo *r7; + EntityInfo *sp; + Item item; + bool32 flag; + Item *item1; + Item *item2; + + flag = FALSE; + r9 = GetEntInfo(pokemon); + r7 = r9; + r8 = GetEntInfo(target); + sp = r8; + + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); + if (AbilityIsActive(target, ABILITY_STICKY_HOLD)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCCE4); + return FALSE; + } + else if (HasHeldItem(target, ITEM_ALERT_SPECS)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD578); + return FALSE; + } + else + { + item1 = &r9->heldItem; + item2 = &r8->heldItem; + if (!(item1->flags & ITEM_FLAG_EXISTS)) + flag = TRUE; + + if(!(item2->flags & ITEM_FLAG_EXISTS)) + flag = TRUE; + + if (flag) + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC7AC); // The item trade failed + return FALSE; + } + else + { + item = r7->heldItem; + r7->heldItem = sp->heldItem; + sp->heldItem = item; + sub_806A6E8(pokemon); + sub_806A6E8(target); + SetExpMultplier(r7); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC790); // Traded items + return TRUE; + } + } +} + +bool8 TripleKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + gUnknown_202F210++; + flag = HandleDamagingMove(pokemon, target, move, IntToF248_2(gUnknown_202F210), param_4) ? TRUE : FALSE; + return flag; +} + +bool8 MudWaterSportMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + if(move->id == MOVE_MUD_SPORT) + { + MudWaterSportEffect(0); + } + else + { + MudWaterSportEffect(1); + } + return TRUE; +} + +bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, 0)) + { + LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, FALSE); + } + } + return flag; +} + +bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + return ThiefAction(pokemon, target, move, param_4); +} + +bool8 AmnesiaMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50, 2); + return TRUE; +} + +bool8 GrowlMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, TRUE); + return TRUE; +} + +bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + s32 modifierInt; + s24_8 modifier; + + flag = FALSE; + if (GetEntInfo(target)->bideClassStatus.status == STATUS_DIVING) { + modifierInt = IntToF248_2(2).raw; + } + else { + modifierInt = IntToF248_2(1).raw; + } + modifier.raw = modifierInt; + if(HandleDamagingMove(pokemon,target,move,modifier,param_4) != 0) + flag = TRUE; + return flag; +} + +bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + EntityInfo * entityInfo; + EntityInfo * targetEntityInfo; + + entityInfo = GetEntInfo(pokemon); + targetEntityInfo = GetEntInfo(target); + if (AbilityIsActive(target, ABILITY_WONDER_GUARD)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC854); + return FALSE; + } + else + { + entityInfo->abilities[0] = targetEntityInfo->abilities[0]; + entityInfo->abilities[1] = targetEntityInfo->abilities[1]; + gDungeon->unkC = 1; + SetExpMultplier(entityInfo); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC81C); + EndAbilityImmuneStatus(pokemon, pokemon); + return TRUE; + } +} + +bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + gDungeon->weather.unkE267[WEATHER_SUNNY] = gMoveWeatherDuration; + if (sub_807EAA0(1,0) == 0) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCF7C); + } + return TRUE; +} + +bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, TRUE); + return TRUE; +} + +bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + WishStatusTarget(pokemon, target); + return TRUE; +} + +bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, gFakeOutSecondaryChance)) + { + CringeStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC730); + return FALSE; +} + +bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool32 flag; + Item item; + DungeonPos pos; + + flag = FALSE; + if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (RollSecondaryEffect(pokemon, 0) != 0) { + if (!EntityIsValid(target)) { + pos.x = 0; + pos.y = 0; + CreateItemWithStickyChance(&item,ITEM_POKE,2); + sub_805A7D4(pokemon,target,&item,&pos); + } + } + } + return flag; +} + +bool8 AssistMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC74C); + return FALSE; +} + +bool8 RestMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + NappingStatusTarget(pokemon, target, CalculateStatusTurns(target, gNappingTurnRange, FALSE)); + return TRUE; +} + +bool8 IngrainMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + IngrainedStatusTarget(pokemon, target); + return TRUE; +} + +bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + u8 *stockpileStage; + + stockpileStage = &GetEntInfo(target)->stockpileStage; + if (*stockpileStage != 0) { + HealTargetHP(pokemon,target,gStockpileHealHpValues[*stockpileStage],0,TRUE); + *stockpileStage = 0; + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC770); + } + return TRUE; +} + +bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + CurseStatusTarget(pokemon, target); + return TRUE; +} + +bool8 sub_805A568(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) ? TRUE : FALSE; + return flag; +} + +bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + u32 stat; + bool32 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,pokemon,0) != 0) { + stat = gUnknown_8106A4C; + LowerAttackStageTarget(pokemon,pokemon,stat,1,0,FALSE); + LowerDefenseStageTarget(pokemon,pokemon,stat,1,0,FALSE); + } + } + return flag; +} + +bool8 SteelWingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 param_5) +{ + EntityInfo *entityInfo; + bool32 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_5) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,pokemon,gSteelWingSecondaryChance) != 0) { + entityInfo = GetEntInfo(pokemon); + RaiseDefenseStageTarget(pokemon,pokemon,stat,1); + SetExpMultplier(entityInfo); + } + } + return flag; +} + +bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + u8 *stockpileStage; + + stockpileStage = &GetEntInfo(pokemon)->stockpileStage; + if (*stockpileStage != 0) { + HandleDamagingMove(pokemon,target,move,IntToF248_2(*stockpileStage),param_4); + *stockpileStage = 0; + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCA3C); + } + return TRUE; +} + +bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if(sub_805727C(pokemon, target, 0)) + { + ConfuseStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + EntityInfo *entityInfo; + EntityInfo *targetEntityInfo; + Item heldItem; + DungeonPos pos; + + entityInfo = GetEntInfo(pokemon); + targetEntityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); + if (AbilityIsActive(target, ABILITY_STICKY_HOLD)) + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCCE8); + return FALSE; + } + else if (HasHeldItem(target, ITEM_ALERT_SPECS)) + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD57C); + return FALSE; + } + else + { + heldItem = targetEntityInfo->heldItem; + if (!ItemExists(&heldItem)) + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD18C); + return FALSE; + } + else + { + ZeroOutItem(&targetEntityInfo->heldItem); + 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); + if (sub_80706A4(target, &target->pos) != 0) + { + WarpTarget(pokemon, target, 0, NULL); + } + return TRUE; + } + } +} + +static void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, + DungeonPos *pos) +{ + Entity stackEntity; + + stackEntity.type = ENTITY_ITEM; + stackEntity.unk24 = 0; + stackEntity.isVisible = TRUE; + stackEntity.unk22 = 0; + stackEntity.axObj.info.item = item; + stackEntity.pos.x = target->pos.x + pos->x; + stackEntity.pos.y = target->pos.y + pos->y; + SetEntityPixelPos(&stackEntity,(target->pos.x * 0x18 + 4) * 0x100, + (target->pos.y * 0x18 + 4) * 0x100); + stackEntity.spawnGenID = 0; + SubstitutePlaceholderStringTags(gFormatBuffer_Items[0],&stackEntity,0); + sub_804652C(pokemon,&stackEntity,item,1,0); +} + +bool8 SplashMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + int x; + int y; + int counter; + DungeonPos *r9; + DungeonPos pos1; + Move stackMove; + PixelPos pos2; + Tile *tile; + Entity *entity; + u8 check; + + + pos1 = target->pos; + sub_806CDD4(target,10,8); + + for(counter = 0; counter < 0x28; counter++) + { + x = DungeonRandInt(3); + y = DungeonRandInt(3); + x--; + y--; + if ((x != 0) || (y != 0)) { + pos1.x = target->pos.x + x; + pos1.y = target->pos.y + y; + if (sub_80705F0(target,&pos1) == 0) goto _0805A8C2; + } + } +_0805A8C2: + if (counter == 0x28) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEBDC); + return FALSE; + } + + pos2.x = (X_POS_TO_PIXELPOS(pos1.x) - target->pixelPos.x) / 0xc; + pos2.y = (Y_POS_TO_PIXELPOS(pos1.y) - target->pixelPos.y) / 0xc; + + if (((check = sub_803F428(&target->pos), r9 = &target->pos, check)) || (sub_803F428(&pos1))) { + for(counter = 0; counter < 0xC; counter++) + { + IncreaseEntityPixelPos(target,pos2.x,pos2.y); + DungeonRunFrameActions(0x2c); + } + } + tile = GetTileMut(pos1.x,pos1.y); + entity = tile->monster; + if (entity != NULL) { + if (GetEntityType(entity) == ENTITY_MONSTER) { + InitPokemonMove(&stackMove,MOVE_REGULAR_ATTACK); + if (sub_80571F0(entity,&stackMove) == 0) { + sub_806F370(pokemon,entity,gSplashDmgValue,0,0,TYPE_NONE,sub_8057600(move, param_4),0,1,0); + } + if ((sub_8044B28() == 0) && (EntityIsValid(pokemon))) { + sub_806F370(pokemon,pokemon,gSplashDmgValue,0,0,0,0x1fe,0,0,0); + if ((sub_8044B28() == 0) && (EntityIsValid(pokemon))) goto _0805A9FE; + } + } + else { +_0805A9FE: + if (EntityIsValid(target)) { + if ((sub_803F428(r9)) || (sub_803F428(&pos1))) { + for(counter = 0; counter < 0xC; counter++) + { + IncreaseEntityPixelPos(target, -pos2.x,-pos2.y); + DungeonRunFrameActions(0x2c); + } + } + goto _0805AA5E; + } + } + } + else + { + sub_80694C0(target,pos1.x,pos1.y,0); +_0805AA5E: + if (EntityIsValid(target)) { +#ifndef NOMATCHING + register DungeonPos *pos asm("r1"); +#else + DungeonPos *pos; +#endif + sub_804535C(target, NULL); + pos = r9; + if (sub_80706A4(target, pos)) { + WarpTarget(pokemon,target,0,0); + } + if (GetEntInfo(target)->isTeamLeader) { + sub_804AC20(r9); + sub_807EC28(FALSE); + } + sub_806A5B8(target); + sub_8075900(target,gDungeon->forceMonsterHouse); + } + } + return TRUE; +} + +bool8 sub_805AAD0(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + FixedDamageStatusTarget(pokemon, pokemon); + return TRUE; +} + +bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) +{ + EntityInfo *info; + bool8 flag; + + info = GetEntInfo(pokemon); + flag = FALSE; + if (FixedPointToInt(info->belly) > 1) { + RaiseAttackStageTarget(pokemon,target,gUnknown_8106A4C,99); + info->belly = IntToFixedPoint(1); + flag = TRUE; + } + else { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC5CC); + } + return flag; +} + +bool8 LightScreenMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + LightScreenStatusTarget(pokemon, target); + return TRUE; +} + +bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gSecretPowerSecondaryEffectChance) != 0) { + switch(gSecretPowerTable[gDungeon->tileset]) { + case 0: + PoisonedStatusTarget(pokemon,target,FALSE); + break; + case 1: + SleepStatusTarget(pokemon,target,CalculateStatusTurns(target,gSleepTurnRange,TRUE),FALSE); + break; + case 2: + LowerMovementSpeedTarget(pokemon,target,1,FALSE); + break; + case 3: + LowerAttackStageTarget(pokemon,target,gUnknown_8106A4C,1,1,FALSE); + break; + case 4: + LowerDefenseStageTarget(pokemon,target,gUnknown_8106A4C,1,1,FALSE); + break; + case 5: + LowerAccuracyStageTarget(pokemon,target,gUnknown_8106A4C,FALSE); + break; + case 6: + ConfuseStatusTarget(pokemon,target,FALSE); + break; + case 7: + CringeStatusTarget(pokemon,target,FALSE); + break; + case 8: + default: + ParalyzeStatusTarget(pokemon,target,FALSE); + break; + } + } + } + return flag; +} + +bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gDizzyPunchSecondaryChance) != 0) { + ConfuseStatusTarget(pokemon, target, FALSE); + } + } + return flag; +} + +bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + s32 stat = gUnknown_8106A4C; + RaiseAttackStageTarget(pokemon, target, stat, 1); + RaiseDefenseStageTarget(pokemon, target, stat, 1); + return TRUE; +} + +bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + PausedStatusTarget(pokemon, target, 1, CalculateStatusTurns(target, gObserverOrbPausedTurnRange, TRUE), TRUE); + return TRUE; +} + +bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C, 2, 1, TRUE); + return TRUE; +} + +bool32 BeatUpMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + s32 numPossibleTargets; + s32 i; + Entity **possibleTargets; + bool32 flag = FALSE; + EntityInfo *info = GetEntInfo(pokemon); + + if (info->isNotTeamMember) { + possibleTargets = gDungeon->wildPokemon; + numPossibleTargets = DUNGEON_MAX_WILD_POKEMON; + } + else { + possibleTargets = gDungeon->teamPokemon; + numPossibleTargets = MAX_TEAM_MEMBERS; + } + + for (i = 0; i < numPossibleTargets; i++) { + Entity *targetEntity = possibleTargets[i]; + if (EntityIsValid(targetEntity) + && pokemon != targetEntity + && GetTreatmentBetweenMonsters(pokemon,targetEntity,FALSE,FALSE) == TREATMENT_TREAT_AS_ALLY) + { + EntityInfo *targetInfo = GetEntInfo(targetEntity); + if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsExperienceLocked(targetInfo->joinedAt.id)) { + WarpTarget(pokemon,targetEntity,2,&target->pos); + flag = TRUE; + SetExpMultplier(info); + } + } + } + + if (!flag) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_81004EC); + } + return flag; +} + +bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +{ + bool8 flag; + + SendThawedMessage(pokemon, target); + flag = HandleDamagingMove(pokemon,target,move,IntToF248_2(2),param_4) != 0 ? TRUE : FALSE; + return flag; +} + +bool8 CrushClawMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gCrushClawSecondaryChance) != 0) { + LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, FALSE); + } + } + return flag; +} + +bool8 BlazeKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + flag = FALSE; + SendThawedMessage(pokemon, target); + if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gBlazeKickSecondaryChance) != 0) { + BurnedStatusTarget(pokemon, target, 0, FALSE); + } + } + return flag; +} + +bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + bool8 flag; + + s32 rand1 = DungeonRandInt(100); + s32 rand2 = rand1; + if (rand1 < 10) { + flag = (sub_8055864(pokemon,target,move,0x78,param_4) != 0); + return flag; + } + else { + if (rand1 < 30) { + HealTargetHP(pokemon,target,GetEntInfo(target)->maxHPStat/4,0, + TRUE); + return TRUE; + } + else if (rand2 >= 60) { + flag = (sub_8055864(pokemon,target,move,0x28,param_4) != 0); + return flag; + } + else { + flag = (sub_8055864(pokemon,target,move,0x50,param_4) != 0); + return flag; + } + } +} + +bool8 EruptionMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +{ + EntityInfo *entityInfo; + s32 maxHp; + s32 index; + bool8 flag; + SendThawedMessage(pokemon, target); + + entityInfo = GetEntInfo(pokemon); + maxHp = entityInfo->maxHPStat; + if (entityInfo->HP <= entityInfo->maxHPStat / 4) { + index = 0; + } + else if (entityInfo->HP <= maxHp / 2) { + index = 1; + } + else if (entityInfo->HP <= (maxHp * 3) / 4) { + index = 2; + } + else { + index = 3; + } + + flag = HandleDamagingMove(pokemon,target,move,gEruptionModifiers[index],param_4) ? TRUE : FALSE; + return flag; +} + +bool8 GlareMoveAction(Entity * pokemon,Entity * target,Move *move) +{ + ParalyzeStatusTarget(pokemon,target, TRUE); + return TRUE; +} + +bool8 TransformMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + if (IsBossFight()) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEFF4); + return FALSE; + } + else { + move->PP = 0; + TransformStatusTarget(pokemon,target); + return TRUE; + } +} + +bool8 PoisonTailMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + bool8 flag; + + flag = FALSE; + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gPoisonTailSecondaryChance) != 0) { + PoisonedStatusTarget(pokemon,target,FALSE); + } + } + return flag; +} + +bool8 RoarMoveAction(Entity * pokemon, Entity * target) +{ + BlowAwayTarget(pokemon, target, GetEntInfo(pokemon)->action.direction); + return TRUE; +} + +bool8 HandleColorChange(Entity * pokemon, Entity * target) +{ + u8 newType; + const char *typeString; + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(target); + newType = gDungeonCamouflageTypes[gDungeon->tileset]; + if (AbilityIsActive(target, ABILITY_FORECAST)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrForecastPreventsTypeSwitchMessage); + return FALSE; + } + else { + entityInfo->types[0] = newType; + entityInfo->types[1] = TYPE_NONE; + entityInfo->isColorChanged = TRUE; + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); + typeString = GetUnformattedTypeString(newType); + strcpy(gFormatBuffer_Items[0], typeString); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEB08); + return TRUE; + } +} + +bool8 TailGlowMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + RaiseAttackStageTarget(pokemon,target,gUnknown_8106A50, 2); + return TRUE; +} + +bool8 sub_805B17C(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + s32 uVar4; + bool8 flag; + + flag = FALSE; + if (move->id == MOVE_FIRE_SPIN) { + SendThawedMessage(pokemon,target); + uVar4 = 0x13c; + } + else { + uVar4 = 0x75; + if ((move->id != MOVE_CLAMP) && (uVar4 = 0xf1, move->id == MOVE_BIND)) { + uVar4 = 0x7e; + } + } + if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { + flag = TRUE; + if (sub_805727C(pokemon,target,gMovesConstrictionChance) != 0) { + SqueezedStatusTarget(pokemon,target,uVar4,0); + } + } + return flag; +} + +bool8 PerishSongMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) +{ + PerishSongTarget(pokemon, target); + return TRUE; +} + +bool8 WrapMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) +{ + WrapTarget(pokemon, target); + return TRUE; +} + +bool8 SpikesMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + bool8 trapLaid; + u8 uVar2; + bool8 isNotTeamMember; + + trapLaid = FALSE; + isNotTeamMember = GetEntInfo(pokemon)->isNotTeamMember; + uVar2 = 1; + + if (isNotTeamMember) { + uVar2 = 2; + } + if (LayTrap(&pokemon->pos,TRAP_SPIKE_TRAP,uVar2) != 0) { + trapLaid = TRUE; + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC5A8); // A trap can't be laid here! + } + sub_8049ED4(); + return trapLaid; +} + +const s32 gUnknown_8106A8C[] = {6, 12, 18, 20, 24, 30, 30}; + +bool8 MagnitudeMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) +{ + s32 r3; + bool8 r6; + s32 magnitudeDmgVal; + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(target); + r3 = gUnknown_202F224; + r6 = FALSE; + + gDungeon->unk181e8.unk18200 = gUnknown_8106A8C[r3]; + gDungeon->unk181e8.unk18204 = 0; + magnitudeDmgVal = gMagnitudeDmgValues[r3]; + if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { + magnitudeDmgVal *= 2; + } + r6 = sub_8055864(pokemon,target,move,magnitudeDmgVal,param_4) ? TRUE : FALSE; + return r6; +} + +bool8 MagicCoatMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) +{ + MagicCoatStatusTarget(pokemon, target); + return TRUE; +} + diff --git a/src/status_actions.c b/src/move_orb_actions_4.c similarity index 67% rename from src/status_actions.c rename to src/move_orb_actions_4.c index d702569e7..8c15430f5 100644 --- a/src/status_actions.c +++ b/src/move_orb_actions_4.c @@ -1,7 +1,7 @@ #include "global.h" +#include "globaldata.h" #include "status_actions.h" -#include "charge_move.h" -#include "code_8045A00.h" +#include "dungeon_move_util.h" #include "dungeon_message.h" #include "dungeon_move.h" #include "code_806CD90.h" @@ -14,27 +14,24 @@ #include "constants/targeting.h" #include "constants/type.h" #include "constants/weather.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_engine.h" +#include "dungeon_logic.h" +#include "run_dungeon.h" #include "dungeon_items.h" #include "dungeon_map_access.h" #include "dungeon_misc.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "move_util.h" #include "moves.h" #include "number_util.h" #include "pokemon.h" -#include "status_checks_1.h" #include "status.h" #include "structs/map.h" #include "structs/str_dungeon.h" #include "text_util.h" -#include "tile_types.h" #include "trap.h" #include "weather.h" #include "dungeon_config.h" +#include "dungeon_strings.h" extern void sub_807F43C(Entity *, Entity *); extern void HandleOneRoomOrb(Entity *, Entity *); @@ -47,8 +44,6 @@ extern void ShowWholeRevealedDungeonMap(void); extern void sub_80498A8(s32, s32); extern void sub_8042A54(DungeonPos *); extern void sub_8049BB0(s32, s32); -extern s16 sub_8057600(Move*, u32); -extern u32 sub_8055864(Entity *pokemon, Entity *target, Move *param_3, s32 param_4, s32 param_5); extern void HandleDroughtOrbAction(Entity *); extern void HandleLuminousOrbAction(Entity *pokemon); extern void HandleTrawlOrbAction(Entity *, Entity *); @@ -57,7 +52,6 @@ extern s16 sub_803D970(u32); extern bool8 sub_806AA0C(s32, u32); extern void sub_806BB6C(Entity *, s32); extern void HandleSwitcherOrb(Entity *, Entity *, u32); -extern u32 HandleDamagingMove(Entity *, Entity *, Move *, s24_8, u32); extern void sub_806A6E8(Entity *); // TODO include dungeon_ai.h when SqueezedStatusTarget is figured out @@ -78,232 +72,12 @@ extern void DealDamageToEntity(Entity *, s32, u32, u32); extern bool8 MoveRequiresCharging(Entity* pokemon,u16 moveID); extern void sub_80783C4(Entity *, Entity *, bool8); +extern u32 gUnknown_8106A50; +extern u32 gUnknown_8106A4C; // TODO The parameters don't match the function definition in pokemon_mid.h (u8*, s16). extern void CopyCyanMonsterNametoBuffer(u8 *buffer, s32 index); -extern u8 *gUnknown_80FDD00[]; -extern u8 *gUnknown_80FDCE4[]; -extern u32 gUnknown_8106A50; -extern u8 *gPtrSleepingTargetOnlyMessage[]; -extern u8 *gUnknown_80FAFF0[]; -extern u32 gUnknown_8106A4C; -extern u8 *gUnknown_80FD450[]; -extern u8 *gUnknown_80FD434[]; -extern u8 *gUnknown_80FF678[]; -extern u8 *gUnknown_80FD0B8[]; -extern u8 *gUnknown_80FD0B4[]; -extern u8 *gUnknown_80FD454[]; -extern u8 *gUnknown_81004F0[]; -extern u8 *gUnknown_80FD1CC[]; -extern u8 *gUnknown_80FD1B0[]; -extern u8 *gUnknown_80FD1EC[]; -extern u8 *gUnknown_80FD4C4[]; -extern u8 *gUnknown_80FD4DC[]; -extern u8 *gUnknown_80FC920[]; -extern u8 *gUnknown_80FC8F0[]; -extern u8 *gUnknown_80FC614[]; -extern u8 *gUnknown_80FC678[]; -extern u8 *gUnknown_80FC654[]; -extern u8 *gUnknown_80FD574[]; -extern u8 *gUnknown_80FD430[]; -extern u8 *gUnknown_80FD40C[]; -extern u8 *gUnknown_80FD3F0[]; -extern u32 gUnknown_8106A50; -extern u8 *gUnknown_80FDCA0[]; -extern u8 *gUnknown_80FDC9C[]; -extern u32 gUnknown_8106A8C[]; -extern u8 *gUnknown_80FC5A8[]; -extern u8 *gPtrForecastPreventsTypeSwitchMessage[]; -extern u8 *gUnknown_80FEB08[]; -extern u32 gMetronomeCalledArrayId; - -extern u8 *gUnknown_80FEFF4[]; - -bool8 EruptionMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) -{ - EntityInfo *entityInfo; - s32 maxHp; - s32 index; - bool8 flag; - SendThawedMessage(pokemon, target); - - entityInfo = GetEntInfo(pokemon); - maxHp = entityInfo->maxHPStat; - if (entityInfo->HP <= entityInfo->maxHPStat / 4) { - index = 0; - } - else if (entityInfo->HP <= maxHp / 2) { - index = 1; - } - else if (entityInfo->HP <= (maxHp * 3) / 4) { - index = 2; - } - else { - index = 3; - } - - flag = HandleDamagingMove(pokemon,target,move,gEruptionModifiers[index],param_4) ? TRUE : FALSE; - return flag; -} - -bool8 GlareMoveAction(Entity * pokemon,Entity * target,Move *move) -{ - ParalyzeStatusTarget(pokemon,target, TRUE); - return TRUE; -} - -bool8 TransformMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - if (IsBossFight()) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEFF4); - return FALSE; - } - else { - move->PP = 0; - TransformStatusTarget(pokemon,target); - return TRUE; - } -} - -bool8 PoisonTailMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - bool8 flag; - - flag = FALSE; - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gPoisonTailSecondaryChance) != 0) { - PoisonedStatusTarget(pokemon,target,FALSE); - } - } - return flag; -} - -bool8 RoarMoveAction(Entity * pokemon, Entity * target) -{ - BlowAwayTarget(pokemon, target, GetEntInfo(pokemon)->action.direction); - return TRUE; -} - -bool8 HandleColorChange(Entity * pokemon, Entity * target) -{ - u8 newType; - const char *typeString; - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(target); - newType = gDungeonCamouflageTypes[gDungeon->tileset]; - if (AbilityIsActive(target, ABILITY_FORECAST)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); - return FALSE; - } - else { - entityInfo->types[0] = newType; - entityInfo->types[1] = TYPE_NONE; - entityInfo->isColorChanged = TRUE; - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - typeString = GetUnformattedTypeString(newType); - strcpy(gFormatBuffer_Items[0], typeString); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB08); - return TRUE; - } -} - -bool8 TailGlowMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - RaiseAttackStageTarget(pokemon,target,gUnknown_8106A50, 2); - return TRUE; -} - -bool8 sub_805B17C(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - s32 uVar4; - bool8 flag; - - flag = FALSE; - if (move->id == MOVE_FIRE_SPIN) { - SendThawedMessage(pokemon,target); - uVar4 = 0x13c; - } - else { - uVar4 = 0x75; - if ((move->id != MOVE_CLAMP) && (uVar4 = 0xf1, move->id == MOVE_BIND)) { - uVar4 = 0x7e; - } - } - if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { - flag = TRUE; - if (sub_805727C(pokemon,target,gMovesConstrictionChance) != 0) { - SqueezedStatusTarget(pokemon,target,uVar4,0); - } - } - return flag; -} - -bool8 PerishSongMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) -{ - PerishSongTarget(pokemon, target); - return TRUE; -} - -bool8 WrapMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) -{ - WrapTarget(pokemon, target); - return TRUE; -} - -bool8 SpikesMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - bool8 trapLaid; - u8 uVar2; - bool8 isNotTeamMember; - - trapLaid = FALSE; - isNotTeamMember = GetEntInfo(pokemon)->isNotTeamMember; - uVar2 = 1; - - if (isNotTeamMember) { - uVar2 = 2; - } - if (LayTrap(&pokemon->pos,TRAP_SPIKE_TRAP,uVar2) != 0) { - trapLaid = TRUE; - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5A8); // A trap can't be laid here! - } - sub_8049ED4(); - return trapLaid; -} - -bool8 MagnitudeMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) -{ - s32 r3; - bool8 r6; - s32 magnitudeDmgVal; - EntityInfo *entityInfo; - - entityInfo = GetEntInfo(target); - r3 = gUnknown_202F224; - r6 = FALSE; - - gDungeon->unk181e8.unk18200 = gUnknown_8106A8C[r3]; - gDungeon->unk181e8.unk18204 = 0; - magnitudeDmgVal = gMagnitudeDmgValues[r3]; - if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { - magnitudeDmgVal *= 2; - } - r6 = sub_8055864(pokemon,target,move,magnitudeDmgVal,param_4) ? TRUE : FALSE; - return r6; -} - -bool8 MagicCoatMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) -{ - MagicCoatStatusTarget(pokemon, target); - return TRUE; -} - bool8 ProtectMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) { ProtectStatusTarget(pokemon, target); @@ -418,11 +192,11 @@ bool8 MimicMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4 SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); if (moveCounter != 0) { SetExpMultplier(entityInfo); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCE4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDCE4); mimicSuccess = TRUE; } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDD00); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDD00); } return mimicSuccess; } @@ -497,7 +271,7 @@ bool8 DreamEaterMoveAction(Entity * pokemon, Entity * target, Move *move, s32 pa } } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrSleepingTargetOnlyMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrSleepingTargetOnlyMessage); } return flag; } @@ -533,10 +307,10 @@ bool8 RecycleMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param } if (isTMRecycled) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC9C); // The Used TM was recharged! + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDC9C); // The Used TM was recharged! } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCA0); // But nothing happened! + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDCA0); // But nothing happened! } return isTMRecycled; } @@ -573,7 +347,7 @@ bool8 SkullBashMoveAction(Entity * pokemon, Entity * target, Move * move, s32 pa sub_8079764(pokemon); } else { - SetChargeStatusTarget(pokemon,target,STATUS_SKULL_BASH,move,*gUnknown_80FAFF0); + SetChargeStatusTarget(pokemon,target,STATUS_SKULL_BASH,move,gUnknown_80FAFF0); flag = TRUE; } return flag; @@ -625,14 +399,14 @@ bool8 RockSmashMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param bool8 flag = FALSE; if (sub_8069D18(&pos, target)) { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD430); // Can't use that diagonally! + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD430); // Can't use that diagonally! } else { flag = sub_804AD34(&pos); if (flag) - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD3F0); // It dug the wall in front! + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD3F0); // It dug the wall in front! else - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD40C); // Can't use that here! + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD40C); // Can't use that here! } return flag; @@ -668,18 +442,18 @@ bool8 ThiefAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) return TRUE; } else if (HasHeldItem(target, ITEM_ALERT_SPECS)) { - TryDisplayDungeonLoggableMessage3(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 = &pokemonInfo1->heldItem; targetItem = &targetInfo1->heldItem; if ((pokeItem->flags & ITEM_FLAG_EXISTS) != 0) { - TryDisplayDungeonLoggableMessage3(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) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC678); // $m1 doesn't have anything + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC678); // $m1 doesn't have anything return TRUE; } else { @@ -688,7 +462,7 @@ bool8 ThiefAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) sub_806A6E8(pokemon); sub_806A6E8(target); SetExpMultplier(pokemonInfo2); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC614); // Got $m1's item! + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC614); // Got $m1's item! } } } @@ -745,10 +519,10 @@ bool8 CleanseOrbAction(Entity * pokemon, Entity * target, Move *move, s32 param_ } if (isItemCleaned) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC8F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC8F0); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC920); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC920); } return isItemCleaned; } @@ -825,7 +599,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ oldID = entityInfo->id; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->monsterBehavior != BEHAVIOR_FIXED_ENEMY) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD450); return FALSE; } else @@ -837,11 +611,11 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ } } if ((r6 == 0x1e) || (entityInfo->id == targetID)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD450); } else { CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1], targetID); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD434); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD434); sub_806BB6C(target, targetID); didTransfer = TRUE; } @@ -849,7 +623,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ } else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD450); } return didTransfer; } @@ -888,10 +662,10 @@ bool8 EscapeOrbAction(Entity * pokemon, Entity * target, Move *move, s32 param_4 { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); if (gDungeon->unk644.unk2A != 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4DC); // $m0 can't escape! + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD4DC); // $m0 can't escape! } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4C4); // $m0 escaped! + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD4C4); // $m0 escaped! gDungeon->unk4 = 1; gDungeon->unk11 = 1; } @@ -917,7 +691,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ bool8 foundTrap = FALSE; tile = GetTileAtEntitySafe(target); if (IsBossFight()) { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD1EC); + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD1EC); return FALSE; } else @@ -949,12 +723,12 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ } } if (foundTrap) { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD1B0); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD1B0); ShowWholeRevealedDungeonMap(); sub_8049ED4(); } else { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD1CC); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD1CC); } } return foundTrap; @@ -986,7 +760,7 @@ bool8 RollcallOrbAction(Entity * pokemon, Entity *target, Move *move, s32 param_ } } if (!foundTarget) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_81004F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_81004F0); } return foundTarget; } @@ -1023,7 +797,7 @@ bool8 VacuumCutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param bool8 ReviverOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FD454); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD454); return FALSE; } @@ -1057,111 +831,3 @@ bool8 OneRoomOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) HandleOneRoomOrb(pokemon, target); return TRUE; } - -bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) -{ - Tile *tileToFill; - EntityInfo *targetInfo; - int y; - bool8 filledInTile; - int x; - DungeonPos tileCoords; - - filledInTile = FALSE; - targetInfo = GetEntInfo(target); - if (IsBossFight()) { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD0B8); - return FALSE; - } - else - { - // Calculate the coordinates of the tile in front of the user - tileCoords.x = target->pos.x + gAdjacentTileOffsets[targetInfo->action.direction].x; - tileCoords.y = target->pos.y + gAdjacentTileOffsets[targetInfo->action.direction].y; - - sub_8042A54(&tileCoords); - tileToFill = GetTileMut(tileCoords.x,tileCoords.y); - if ((tileToFill->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { - tileToFill->terrainType = (tileToFill->terrainType & ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) | TERRAIN_TYPE_NORMAL; - - for(y = -1; y < 2; y++) - for(x = -1; x < 2; x++) - sub_80498A8(tileCoords.x + x, tileCoords.y + y); - filledInTile = 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 (filledInTile) { - sub_8042A64(&tileCoords); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD0B4); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD0B8); - } - ShowWholeRevealedDungeonMap(); - sub_8049ED4(); - return filledInTile; - } -} - -bool8 TrapperOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - u32 var; - var = (GetEntInfo(target)->isNotTeamMember ? 2 : 1); - sub_807FC3C(&target->pos, NUM_TRAPS, var); - return TRUE; -} - -bool8 ItemizeOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - Item stack; - DungeonPos posStruct = target->pos; - - if(GetEntInfo(target)->monsterBehavior != BEHAVIOR_FIXED_ENEMY) - { - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678); - return FALSE; - } - else - { - target->isVisible = FALSE; - CreateItemWithStickyChance(&stack, GetRandomFloorItem(0), 0); - sub_80464C8(pokemon, &posStruct, &stack); - sub_8068FE0(target, 0x218, pokemon); - return TRUE; - } -} - -bool8 HurlOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - sub_807F43C(pokemon, target); - return TRUE; -} - -bool8 MobileOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - MobileStatusTarget(pokemon, target); - return TRUE; -} - -bool8 StairsOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - HandleStairsOrb(pokemon, target); - return TRUE; -} - -bool8 LongtossOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - LongTossStatusTarget(pokemon, target); - return TRUE; -} - -bool8 PierceOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) -{ - PierceStatusTarget(pokemon, target); - return TRUE; -} diff --git a/src/move_orb_actions_5.c b/src/move_orb_actions_5.c new file mode 100644 index 000000000..3fe3897e3 --- /dev/null +++ b/src/move_orb_actions_5.c @@ -0,0 +1,129 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon.h" +#include "dungeon_move_util.h" +#include "run_dungeon.h" +#include "dungeon_items.h" +#include "dungeon_map_access.h" +#include "dungeon_map.h" +#include "dungeon_message.h" +#include "dungeon_strings.h" +#include "dungeon_util.h" +#include "dungeon_misc.h" +#include "code_8077274_1.h" +#include "code_806CD90.h" +#include "status.h" + +extern void sub_807F43C(Entity *, Entity *); +extern u32 GetRandomFloorItem(u32); +extern void sub_807FC3C(DungeonPos *, u32, u32); +extern void sub_8042A54(DungeonPos *); +extern void sub_8042A64(DungeonPos *); + +bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) +{ + Tile *tileToFill; + EntityInfo *targetInfo; + int y; + bool8 filledInTile; + int x; + DungeonPos tileCoords; + + filledInTile = FALSE; + targetInfo = GetEntInfo(target); + if (IsBossFight()) { + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD0B8); + return FALSE; + } + else + { + // Calculate the coordinates of the tile in front of the user + tileCoords.x = target->pos.x + gAdjacentTileOffsets[targetInfo->action.direction].x; + tileCoords.y = target->pos.y + gAdjacentTileOffsets[targetInfo->action.direction].y; + + sub_8042A54(&tileCoords); + tileToFill = GetTileMut(tileCoords.x,tileCoords.y); + if ((tileToFill->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { + tileToFill->terrainType = (tileToFill->terrainType & ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) | TERRAIN_TYPE_NORMAL; + + for(y = -1; y < 2; y++) + for(x = -1; x < 2; x++) + sub_80498A8(tileCoords.x + x, tileCoords.y + y); + filledInTile = 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 (filledInTile) { + sub_8042A64(&tileCoords); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD0B4); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD0B8); + } + ShowWholeRevealedDungeonMap(); + sub_8049ED4(); + return filledInTile; + } +} + +bool8 TrapperOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + u32 var; + var = (GetEntInfo(target)->isNotTeamMember ? 2 : 1); + sub_807FC3C(&target->pos, NUM_TRAPS, var); + return TRUE; +} + +bool8 ItemizeOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + Item stack; + DungeonPos posStruct = target->pos; + + if(GetEntInfo(target)->monsterBehavior != BEHAVIOR_FIXED_ENEMY) + { + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FF678); + return FALSE; + } + else + { + target->isVisible = FALSE; + CreateItemWithStickyChance(&stack, GetRandomFloorItem(0), 0); + sub_80464C8(pokemon, &posStruct, &stack); + sub_8068FE0(target, 0x218, pokemon); + return TRUE; + } +} + +bool8 HurlOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + sub_807F43C(pokemon, target); + return TRUE; +} + +bool8 MobileOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + MobileStatusTarget(pokemon, target); + return TRUE; +} + +bool8 StairsOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + HandleStairsOrb(pokemon, target); + return TRUE; +} + +bool8 LongtossOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + LongTossStatusTarget(pokemon, target); + return TRUE; +} + +bool8 PierceOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +{ + PierceStatusTarget(pokemon, target); + return TRUE; +} diff --git a/src/move_effects_target.c b/src/move_orb_effects_1.c similarity index 61% rename from src/move_effects_target.c rename to src/move_orb_effects_1.c index 76c5a7286..6177cc583 100644 --- a/src/move_effects_target.c +++ b/src/move_orb_effects_1.c @@ -1,6 +1,6 @@ #include "global.h" +#include "globaldata.h" #include "move_effects_target.h" -#include "code_8045A00.h" #include "dungeon_message.h" #include "code_806CD90.h" #include "code_8077274_1.h" @@ -17,100 +17,25 @@ #include "dungeon_ai_attack.h" #include "dungeon_ai_items.h" #include "dungeon_ai_movement.h" -#include "dungeon_ai_targeting.h" -#include "dungeon_capabilities.h" #include "dungeon_items.h" #include "dungeon_leader.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util_1.h" #include "dungeon_util.h" -#include "dungeon_visibility.h" #include "pokemon.h" #include "status_checks.h" -#include "status_checks_1.h" #include "structs/map.h" #include "structs/str_dungeon.h" #include "dungeon_misc.h" -#include "tile_types.h" #include "dungeon_config.h" +#include "dungeon_strings.h" +#include "status.h" +#include "code_803E46C.h" -extern u8 *gUnknown_80FB380[]; -extern u8 *gUnknown_80FB384[]; -extern u8 *gUnknown_80FB338[]; -extern u8 *gUnknown_80FB318[]; -extern u8 *gUnknown_80FB35C[]; -extern u8 *gUnknown_80FD548[]; -extern u8 *gUnknown_80FCD88[]; -extern u8 *gUnknown_80FCD58[]; -extern u8 *gUnknown_80FCD54[]; -extern u8 *gUnknown_80FB3D0[]; -extern u8 *gUnknown_80FB3CC[]; -extern u8 *gUnknown_80FB3A4[]; -extern u8 *gUnknown_80FB360[]; -extern u8 *gUnknown_80FB31C[]; -extern u8 *gUnknown_80FB388[]; -extern u8 *gUnknown_80FB3E0[]; -extern u8 *gUnknown_80FB418[]; -extern u8 *gUnknown_80FB3F8[]; -extern u8 *gUnknown_80FB414[]; -extern u8 *gUnknown_80FB43C[]; -extern u8 *gUnknown_80FB41C[]; -extern u8 *gUnknown_80FB458[]; -extern u8 *gUnknown_80FB52C[]; -extern u8 *gUnknown_80FCC4C[]; -extern u8 *gUnknown_80FB50C[]; -extern u8 *gUnknown_80FF01C[]; -extern u8 *gUnknown_80FEBBC[]; -extern u8 *gUnknown_80FB564[]; -extern u8 *gUnknown_80FB548[]; -extern u8 *gUnknown_80FCE84[]; -extern u8 *gUnknown_80FCE5C[]; -extern u8 *gUnknown_80FD524[]; -extern u8 *gUnknown_80FCEDC[]; -extern u8 *gUnknown_80FCEB0[]; -extern u8 *gUnknown_80FB5D4[]; -extern u8 *gUnknown_80FB598[]; -extern u8 *gUnknown_80FB5F8[]; -extern u8 *gUnknown_80FB5B4[]; -extern u8 *gUnknown_80FCE34[]; -extern u8 *gUnknown_80FB610[]; -extern u8 *gUnknown_80FCDE0[]; -extern u8 *gUnknown_80FCE00[]; -extern u8 *gUnknown_80FA844[]; -extern u8 *gUnknown_80FB64C[]; -extern u8 *gUnknown_80FB628[]; -extern u8 *gUnknown_80FB4F0[]; -extern u8 *gUnknown_80FB4B0[]; -extern u8 *gUnknown_80FB480[]; -extern u8 *gUnknown_80FB4D4[]; -extern u8 *gUnknown_80FB668[]; -extern u8 *gUnknown_80FB688[]; -extern u8 *gUnknown_80FB6A4[]; -extern u8 *gUnknown_80FB6C0[]; -extern u8 *gUnknown_80FB6D8[]; -extern u8 *gUnknown_80FB6FC[]; -extern u8 *gUnknown_80FB718[]; -extern u8 *gUnknown_80FB7DC[]; -extern u8 *gUnknown_80FB7BC[]; -extern u8 *gUnknown_80FC0B8[]; -extern u8 *gUnknown_80FC0C8[]; -extern u8 *gUnknown_80FC0E4[]; -extern u8 *gUnknown_80FC0D4[]; -extern u8 *gUnknown_80FC274[]; -extern u8 *gUnknown_80FC15C[]; -extern u8 *gUnknown_80FCA60[]; -extern u8 *gUnknown_80FD550[]; -extern u8 *gUnknown_80FC0AC[]; -extern u8 *gUnknown_80FC158[]; -extern u8 *gUnknown_80FC248[]; -extern u8 *gUnknown_80FC09C[]; -extern u8 *gUnknown_80FC13C[]; -extern u8 *gUnknown_80FC270[]; -extern u8 *gUnknown_80FC138[]; -extern u8 *gUnknown_80FC21C[]; - +extern void sub_80420A0(Entity *); +extern void sub_8041C58(Entity *r0); extern void sub_8041F28(Entity *, s32); extern void sub_8041F4C(Entity *, s32); extern void sub_8041F70(Entity *, s32); @@ -133,21 +58,15 @@ extern void nullsub_72(Entity *); extern void nullsub_71(Entity *); extern void nullsub_70(Entity *); extern void nullsub_69(Entity *, Entity *); - - -void sub_8075BA4(Entity *param_1, u8 param_2) -{ - EntityInfo * entityInfo = GetEntInfo(param_1); - - if ((param_2 != 0) && (entityInfo->cringeClassStatus.status == STATUS_COWERING)) { - entityInfo->action.direction = (entityInfo->action.direction + 4) & DIRECTION_MASK; - TargetTileInFront(param_1); - } - else if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) { - entityInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); - TargetTileInFront(param_1); - } -} +extern void sub_8041CB8(Entity *r0); +extern void sub_8041C1C(Entity *r0); +extern void sub_8042060(Entity *, s32); +extern void sub_8041FB4(Entity *r0, u32 r1); +extern void sub_8041FD8(Entity *r0, u32 r1); +extern void sub_804201C(Entity *r0, u32 r1); +extern void sub_8041FFC(Entity *r0, u32 r1); +extern void sub_8041CCC(Entity *); +extern void sub_8042040(Entity *, s32); u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns) { @@ -190,11 +109,11 @@ void SleepStatusTarget(Entity * pokemon, Entity * target, s32 turns, u8 displayM sleep = GetEntInfo(target)->sleepClassStatus.status; if (sleep == STATUS_SLEEPLESS) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB380); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB380); } else if (sleep == STATUS_NAPPING) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB384); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB384); } else { sub_8041AF4(target); @@ -202,11 +121,11 @@ void SleepStatusTarget(Entity * pokemon, Entity * target, s32 turns, u8 displayM sub_806CE68(target,8); if (cVar2 == 1) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB338); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB338); else if (cVar2 == 2) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB35C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB35C); else - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB318); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB318); } } } @@ -220,25 +139,25 @@ bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMe } else if (IQSkillIsEnabled(target, IQ_NONSLEEPER)) { if (displayMessage) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD54); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCD54); } return TRUE; } else if (AbilityIsActive(target, ABILITY_INSOMNIA)) { if (displayMessage) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD58); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCD58); } return TRUE; } else if (AbilityIsActive(target, ABILITY_VITAL_SPIRIT)) { if (displayMessage) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD88); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCD88); } return TRUE; } else if (HasHeldItem(target, ITEM_INSOMNISCOPE)) { if (displayMessage) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD548); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD548); } return TRUE; } @@ -268,15 +187,15 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns) entityInfo->sleepClassStatus.status = STATUS_NIGHTMARE; sub_806CE68(target,8); if (hasNightmare) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3CC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3CC); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3A4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3A4); } } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3D0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3D0); } EntityUpdateStatusSprites(target); } @@ -305,15 +224,15 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns) entityInfo->sleepClassStatus.status = STATUS_NAPPING; sub_806CE68(target, 8); if (isSleeping) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB360); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB360); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB31C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB31C); } } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB388); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB388); } EntityUpdateStatusSprites(target); } @@ -332,19 +251,19 @@ void YawnedStatusTarget(Entity * pokemon, Entity * target, s32 turns) entityInfo->sleepClassStatus.turns = turns; nullsub_91(target); sub_806CE68(target, 8); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3E0); } else if (((entityInfo->sleepClassStatus.status == STATUS_SLEEP) || (entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE)) || (entityInfo->sleepClassStatus.status == STATUS_NAPPING)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB418); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB418); } else if (entityInfo->sleepClassStatus.status == STATUS_SLEEPLESS) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3F8); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3F8); } else { if (entityInfo->sleepClassStatus.status == STATUS_YAWNING) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB414); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB414); else - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3E0); } EntityUpdateStatusSprites(target); } @@ -374,12 +293,12 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target) sub_8041EE8(target); sub_806CE68(target,8); if(isAsleep) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB41C); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB458); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB41C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB458); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB43C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB43C); } EntityUpdateStatusSprites(target); } @@ -401,19 +320,19 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns entityInfo->cringeClassStatus.turns = turns + 1; nullsub_72(target); if (turns == 1) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB480); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB480); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB4D4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB4D4); } } else { if (turns == 1) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB4B0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB4B0); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB4F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB4F0); } } EntityUpdateStatusSprites(target); @@ -430,7 +349,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa if (AbilityIsActive(target,ABILITY_OBLIVIOUS)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC4C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCC4C); } } else @@ -440,10 +359,10 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa entityInfo->cringeClassStatus.status = STATUS_INFATUATED; entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gInfatuatedTurnRange,TRUE) + 1; sub_8041EF8(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB50C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB50C); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB52C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB52C); } EntityUpdateStatusSprites(target); } @@ -470,13 +389,13 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); if (AbilityIsActive(target, ABILITY_WATER_VEIL)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE5C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCE5C); } else { if (MonsterIsType(target, TYPE_FIRE)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE84); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCE84); } else { @@ -484,7 +403,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) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEBBC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FEBBC); } else { @@ -498,10 +417,10 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis if (param_3 != 0) { sub_8041C34(target); } - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB548); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB548); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB564); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB564); } EntityUpdateStatusSprites(target); @@ -525,7 +444,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis if (!hasSynchronized) { hasSynchronized = TRUE; SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FF01C); } if (sub_807167C(target,entity) == TREATMENT_TREAT_AS_ENEMY) { // Recurse with the new target @@ -557,19 +476,19 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); if (HasHeldItem(target, ITEM_PECHA_SCARF)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD524); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD524); } else { if (AbilityIsActive(target, ABILITY_IMMUNITY)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEB0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCEB0); } else { if(MonsterIsType(target, TYPE_POISON) || MonsterIsType(target, TYPE_STEEL)){ if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEDC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCEDC); } else { @@ -585,17 +504,17 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0; isNotPoisoned = FALSE; sub_8041C6C(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB598); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB598); sub_806CE94(target, 8); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5D4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB5D4); } } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5F8); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB5F8); } if ((AbilityIsActive(target, ABILITY_SYNCHRONIZE)) && !isNotPoisoned) @@ -612,7 +531,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag if (!hasSynchronized) { hasSynchronized = TRUE; SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FF01C); } if (sub_807167C(target,entity) == TREATMENT_TREAT_AS_ENEMY) { // Recurse with the new target @@ -646,19 +565,19 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); if (HasHeldItem(target, ITEM_PECHA_SCARF)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD524); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD524); } else { if (AbilityIsActive(target, ABILITY_IMMUNITY)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEB0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCEB0); } else { if(MonsterIsType(target, TYPE_POISON) || MonsterIsType(target, TYPE_STEEL)){ if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEDC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCEDC); } else { @@ -672,12 +591,12 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0; isNotBadlyPoisoned = FALSE; sub_8041C7C(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5B4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB5B4); sub_806CE94(target, 8); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5F8); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB5F8); } if ((AbilityIsActive(target, ABILITY_SYNCHRONIZE)) && !isNotBadlyPoisoned) @@ -694,7 +613,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM if (!hasSynchronized) { hasSynchronized = TRUE; SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FF01C); } if (sub_807167C(target,entity) == TREATMENT_TREAT_AS_ENEMY) { // Recurse with the new target @@ -725,13 +644,13 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) if ((entityInfo->frozenClassStatus.status != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { if (AbilityIsActive(target, ABILITY_MAGMA_ARMOR)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDE0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCDE0); } else { if (MonsterIsType(target, TYPE_ICE)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE00); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCE00); } else { @@ -739,7 +658,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) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE34); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCE34); } else { @@ -750,7 +669,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->frozenClassStatus.status = STATUS_FROZEN; entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gFreezeTurnRange,TRUE) + 1; entityInfo->frozenClassStatus.damageCountdown = 0; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB610); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB610); EntityUpdateStatusSprites(target); } } @@ -758,10 +677,10 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) } } -void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 displayMessage) +void SqueezedStatusTarget(Entity * pokemon, Entity * target, s32 param_3, bool32 displayMessage) { EntityInfo *entityInfo; - s32 param_3_s32 = param_3; + s32 param_3_s32 = (s16) param_3; bool8 displayMessage_u8 = displayMessage; if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage_u8))) { @@ -771,7 +690,7 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 } else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA844); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->frozenClassStatus.status != STATUS_CONSTRICTION) { @@ -780,11 +699,11 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 entityInfo->frozenClassStatus.damageCountdown = 0; entityInfo->frozenClassStatus.unk4 = param_3_s32; nullsub_71(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB628); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB628); sub_806CE94(target,8); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB64C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB64C); } EntityUpdateStatusSprites(target); } @@ -801,7 +720,7 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) } else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA844); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->frozenClassStatus.status != STATUS_SHADOW_HOLD) { @@ -809,11 +728,11 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gShadowHoldTurnRange,TRUE) + 1; entityInfo->frozenClassStatus.damageCountdown = 0; nullsub_70(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB668); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB668); sub_806CE94(target,8); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB688); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB688); } EntityUpdateStatusSprites(target); } @@ -834,10 +753,10 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target) entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gIngrainTurnRange,TRUE) + 1; entityInfo->frozenClassStatus.damageCountdown = 0; nullsub_90(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6A4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB6A4); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6C0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB6C0); } EntityUpdateStatusSprites(target); } @@ -876,7 +795,7 @@ void WrapTarget(Entity * pokemon, Entity * target) *piVar3 +=1; nullsub_69(pokemon, target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6D8); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB6D8); sub_806CE94(target,8); goto _08076C98; } @@ -884,19 +803,19 @@ void WrapTarget(Entity * pokemon, Entity * target) } if (pokemonEntityData->frozenClassStatus.status == STATUS_WRAP) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB6FC); } if (targetEntityInfo->frozenClassStatus.status == STATUS_WRAP) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB6FC); } if (pokemonEntityData->frozenClassStatus.status == STATUS_WRAPPED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB718); } if (targetEntityInfo->frozenClassStatus.status == STATUS_WRAPPED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB718); } _08076C98: EntityUpdateStatusSprites(target); @@ -947,11 +866,11 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) targetEntityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gPetrifiedTurnRange,TRUE) + 1; } targetEntityInfo->frozenClassStatus.damageCountdown = 0; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7BC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB7BC); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7DC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB7DC); } if (targetEntityInfo->isNotTeamMember) { for(index = 0; index < MAX_TEAM_MEMBERS; index++) @@ -981,10 +900,10 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de return; } if (index != STAT_STAGE_ATK) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0C8); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0C8); } else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0B8); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0B8); } if (param_5) { if (sub_8071728(pokemon,target,displayMessage)) { @@ -992,12 +911,12 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de } if (HasHeldItem(target, ITEM_TWIST_BAND)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD550); } else { if ((!AbilityIsActive(target, ABILITY_HYPER_CUTTER)) || (index != STAT_STAGE_ATK)) goto _08076EE4; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCA60); } } else { @@ -1006,10 +925,10 @@ _08076EE4: SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F28(target,index); if (decrement == 1) { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0E4); } else { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0D4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0D4); } attackStage = entityInfo->offensiveStages[index]; attackStage -= decrement; @@ -1018,10 +937,10 @@ _08076EE4: } if (entityInfo->offensiveStages[index] != attackStage) { entityInfo->offensiveStages[index] = attackStage; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC15C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC15C); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC274); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC274); } EntityUpdateStatusSprites(target); } @@ -1036,20 +955,20 @@ void LowerDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 d return; } if (index != STAT_STAGE_DEF) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0AC); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0AC); } else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC09C); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC09C); } if (!param_5 || !sub_8071728(pokemon,target,displayMessage)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F4C(target,index); if (decrement == 1) { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0E4); } else { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0D4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0D4); } defenseStage = entityInfo->defensiveStages[index]; defenseStage = defenseStage - decrement; @@ -1058,10 +977,10 @@ void LowerDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 d } if (entityInfo->defensiveStages[index] != defenseStage) { entityInfo->defensiveStages[index] = defenseStage; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC158); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC158); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC248); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC248); } EntityUpdateStatusSprites(target); } @@ -1079,17 +998,17 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F70(target,index); if (index != STAT_STAGE_ATK) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0C8); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0C8); } else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0B8); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0B8); } if (increment == 1) { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0E4); } else { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0D4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0D4); } attackStage = entityInfo->offensiveStages[index]; @@ -1099,10 +1018,10 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in } if (entityInfo->offensiveStages[index] != attackStage) { entityInfo->offensiveStages[index] = attackStage; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC13C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC13C); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC270); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC270); } EntityUpdateStatusSprites(target); } @@ -1119,17 +1038,17 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F94(target,index); if (index != STAT_STAGE_DEF) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0AC); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0AC); } else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC09C); + strcpy(gFormatBuffer_Items[0],gUnknown_80FC09C); } if (increment == 1) { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0E4); } else { - strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0D4); + strcpy(gFormatBuffer_Items[1],gUnknown_80FC0D4); } defenseStage = entityInfo->defensiveStages[index]; @@ -1139,10 +1058,409 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i } if (entityInfo->defensiveStages[index] != defenseStage) { entityInfo->defensiveStages[index] = defenseStage; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC138); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC138); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC21C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC21C); } EntityUpdateStatusSprites(target); } + +u8 GetFlashFireStatus(Entity *pokemon) +{ + if (!EntityIsValid(pokemon) || !AbilityIsActive(pokemon, ABILITY_FLASH_FIRE)) + { + return FLASH_FIRE_STATUS_NONE; + } + if (GetEntInfo(pokemon)->flashFireBoost > 1) + { + return FLASH_FIRE_STATUS_MAXED; + } + return FLASH_FIRE_STATUS_NOT_MAXED; +} + +static inline s32 UpdateFlashFireBoost_sub(EntityInfo * entityInfo) +{ + s32 flashFireBoost; + + flashFireBoost = entityInfo->flashFireBoost; + flashFireBoost++; + if (FLASH_FIRE_STATUS_MAXED < flashFireBoost) { + flashFireBoost = FLASH_FIRE_STATUS_NOT_MAXED; + } + return flashFireBoost; +} + +void UpdateFlashFireBoost(Entity * pokemon, Entity *target) +{ + EntityInfo * entityInfo; + s32 flashFireBoost; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + flashFireBoost = UpdateFlashFireBoost_sub(entityInfo); + if (entityInfo->flashFireBoost != flashFireBoost) { + entityInfo->flashFireBoost = flashFireBoost; + sub_8041C58(target); + } + EntityUpdateStatusSprites(target); + } +} + +void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage) +{ + EntityInfo *entityInfo; + s24_8 oldMulti; + + if (!EntityIsValid(target)) { + return; + } + + if (statStage != STAT_STAGE_ATK) { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0C8); + } + else { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0B8); + } + if (F248LessThanInt(param_4, 1) && sub_8071728(pokemon,target,displayMessage)) { + return; + } + + if ((HasHeldItem(target,ITEM_TWIST_BAND)) && F248LessThanInt(param_4, 1)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD550); + return; + } + + if (AbilityIsActive(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && F248LessThanInt(param_4, 1)) { + if (displayMessage) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCA60); + } + return; + } + + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + oldMulti = entityInfo->offensiveMultipliers[statStage]; + + if (F248LessThanInt(param_4, 1)) { + sub_8041FD8(target,statStage); + } + else { + sub_8041FB4(target,statStage); + } + + entityInfo->offensiveMultipliers[statStage] = s24_8_mul(entityInfo->offensiveMultipliers[statStage],param_4); + + if (F248LessThanFloat(entityInfo->offensiveMultipliers[statStage], 0.01)) { + entityInfo->offensiveMultipliers[statStage] = FloatToF248(0.01); + } + if (FloatLessThanF248(99.99, entityInfo->offensiveMultipliers[statStage])) { + entityInfo->offensiveMultipliers[statStage] = FloatToF248(99.99); + } + if (F248GreaterThan(oldMulti, entityInfo->offensiveMultipliers[statStage])) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC11C); + } + else if (F248LessThan(oldMulti, entityInfo->offensiveMultipliers[statStage])) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC118); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC184); + } + EntityUpdateStatusSprites(target); +} + +void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage) +{ + EntityInfo *entityInfo; + s24_8 oldMulti; + + if (!EntityIsValid(target)) { + return; + } + + if (statStage != STAT_STAGE_DEF) { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC0AC); + } + else { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC09C); + } + if (F248LessThanInt(param_4, 1) && sub_8071728(pokemon,target,displayMessage)) { + return; + } + + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + oldMulti = entityInfo->defensiveMultipliers[statStage]; + + if (F248LessThanInt(param_4, 1)) { + sub_804201C(target,statStage); + } + else { + sub_8041FFC(target,statStage); + } + + entityInfo->defensiveMultipliers[statStage] = s24_8_mul(entityInfo->defensiveMultipliers[statStage],param_4); + + if (F248LessThanFloat(entityInfo->defensiveMultipliers[statStage], 0.01)) { + entityInfo->defensiveMultipliers[statStage] = FloatToF248(0.01); + } + if (FloatLessThanF248(99.99, entityInfo->defensiveMultipliers[statStage])) { + entityInfo->defensiveMultipliers[statStage] = FloatToF248(99.99); + } + if (F248GreaterThan(oldMulti, entityInfo->defensiveMultipliers[statStage])) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC114); + } + else if (F248LessThan(oldMulti, entityInfo->defensiveMultipliers[statStage])) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC0FC); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC180); + } + EntityUpdateStatusSprites(target); +} + +void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + sub_8042040(target,statStage); + if (statStage != STAT_STAGE_ACCURACY) { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC090); + } + else { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC084); + } + if (entityInfo->hitChanceStages[statStage] < MAX_STAT_STAGE) { + entityInfo->hitChanceStages[statStage]++; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC1C4); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC218); + } + EntityUpdateStatusSprites(target); + } +} + +void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, bool8 displayMessage) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + if (statStage != STAT_STAGE_ACCURACY) { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC090); + } + else { + strcpy(gFormatBuffer_Items[0],gUnknown_80FC084); + } + if (!sub_8071728(pokemon,target,displayMessage)) { + if (AbilityIsActive(target, ABILITY_KEEN_EYE) && (statStage == STAT_STAGE_ACCURACY)){ + if(displayMessage) + { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCA64); + } + } + else { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + sub_8042060(target,statStage); + if (entityInfo->hitChanceStages[statStage] != 0) { + entityInfo->hitChanceStages[statStage]--; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC1A4); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC1F0); + } + EntityUpdateStatusSprites(target); + } + } + } +} + +void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + if (!HasSafeguardStatus(pokemon, target, displayMessage)) { + if (AbilityIsActive(target, ABILITY_INNER_FOCUS)){ + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if(displayMessage) + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCC18); + } + else { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if(entityInfo->cringeClassStatus.status != STATUS_CRINGE) + { + entityInfo->cringeClassStatus.status = STATUS_CRINGE; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target, gCringeTurnRange, TRUE) + 1; + sub_80420A0(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB2E0); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB300); + } + EntityUpdateStatusSprites(target); + } + } + } +} + +void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) +{ + const Tile *mapTile; + EntityInfo *entityInfo; + Entity *mapPokemonEntity; + int index; + bool8 bVar6; + bool8 bVar7; + + if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { + if (AbilityIsActive(target, ABILITY_LIMBER)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (displayMessage) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCBF8); + } + } + else + { + bVar6 = TRUE; + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->burnClassStatus.status != STATUS_PARALYSIS) { + entityInfo->burnClassStatus.status = STATUS_PARALYSIS; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gParalysisTurnRange,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0; + bVar6 = FALSE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB2AC); + sub_8041C1C(target); + CalcSpeedStage(target); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB2CC); + } + if ((AbilityIsActive(target, ABILITY_SYNCHRONIZE)) && (!bVar6)) { + bVar7 = FALSE; + + for(index = 0; index < NUM_DIRECTIONS; index++) + { + mapTile = GetTile(target->pos.x + gAdjacentTileOffsets[index].x,target->pos.y + gAdjacentTileOffsets[index].y); + mapPokemonEntity = mapTile->monster; + if ((EntityIsValid(mapPokemonEntity)) && (GetEntityType(mapPokemonEntity) == ENTITY_MONSTER)) { + if (!bVar7) { + bVar7 = TRUE; + SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FF01C); + } + if (sub_807167C(target,mapPokemonEntity) == 1) { + ParalyzeStatusTarget(pokemon, mapPokemonEntity, displayMessage); + } + } + } + } + EntityUpdateStatusSprites(target); + } + } +} + +void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage) +{ + s32 movSpeed; + s32 index; + s32 movSpeed_1; + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) { + return; + } + if (turns == 0) { + turns = CalculateStatusTurns(target,gSpeedRaiseTurnRange,FALSE) + 1; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + movSpeed = CalcSpeedStage(target); + if (movSpeed == MAX_SPEED_STAGE) { + if (displayMessage) + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2B8); + } + else { + for(index = 0; index < NUM_SPEED_COUNTERS; index++) + { + if(entityInfo->speedUpCounters[index] == 0) + { + entityInfo->speedUpCounters[index] = turns; + break; + } + } + movSpeed_1 = CalcSpeedStage(target); + if (movSpeed == movSpeed_1) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC298); + } + else + { + sub_8041CB8(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); + entityInfo->speedStageChanged = TRUE; + entityInfo->attacking = FALSE; + } + } + EntityUpdateStatusSprites(target); +} + +void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, bool8 displayMessage) +{ + s32 movSpeed; + s32 counter; + s32 index; + s32 movSpeed_1; + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) { + return; + } + if (HasSafeguardStatus(pokemon,target,displayMessage)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + movSpeed = CalcSpeedStage(target); + if (movSpeed == 0) { + if (displayMessage) + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2D8); + } + else { + for(counter = 0; counter < levels; counter++) + { + for(index = 0; index < NUM_SPEED_COUNTERS; index++) + { + if (entityInfo->speedDownCounters[index]== 0) { + entityInfo->speedDownCounters[index] = CalculateStatusTurns(target,gSpeedLowerTurnRange,TRUE) + 1; + break; + } + } + } + movSpeed_1 = CalcSpeedStage(target); + if (movSpeed == movSpeed_1) { + if (displayMessage) + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC298); + } + else + { + sub_8041CCC(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); + } + } + EntityUpdateStatusSprites(target); +} + diff --git a/src/status.c b/src/move_orb_effects_2.c similarity index 58% rename from src/status.c rename to src/move_orb_effects_2.c index e7aa3c0ce..0e2d836e0 100644 --- a/src/status.c +++ b/src/move_orb_effects_2.c @@ -1,7 +1,7 @@ #include "global.h" +#include "globaldata.h" #include "status.h" #include "code_803E46C.h" -#include "code_8045A00.h" #include "code_806CD90.h" #include "code_8077274_1.h" #include "code_808417C.h" @@ -9,113 +9,24 @@ #include "constants/status.h" #include "constants/type.h" #include "dungeon_ai_movement.h" -#include "dungeon_ai_targeting.h" +#include "dungeon_logic.h" #include "dungeon_items.h" #include "dungeon_map_access.h" #include "dungeon_message.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" #include "dungeon_util.h" #include "math.h" #include "move_effects_target.h" #include "number_util.h" -#include "status_checks_1.h" #include "structs/map.h" #include "structs/str_dungeon.h" #include "dungeon_config.h" +#include "moves.h" +#include "dungeon_strings.h" +#include "dungeon_random.h" +#include "dungeon_misc.h" +#include "pokemon_mid.h" -extern u8 *gUnknown_80FBD78[]; -extern u8 *gUnknown_80FBD9C[]; -extern u8 *gUnknown_80FBE40[]; -extern u8 *gUnknown_80FBE3C[]; -extern u8 *gUnknown_80FBE3C[]; -extern u8 *gUnknown_80FC084[]; -extern u8 *gUnknown_80FC090[]; -extern u8 *gUnknown_80FC1C4[]; -extern u8 *gUnknown_80FC218[]; -extern u8 *gUnknown_80FD550[]; -extern u8 *gUnknown_80FCA60[]; -extern u8 *gUnknown_80FC184[]; -extern u8 *gUnknown_80FC0B8[]; -extern u8 *gUnknown_80FC0C8[]; -extern u8 *gUnknown_80FC118[]; -extern u8 *gUnknown_80FC11C[]; -extern u8 *gUnknown_80FC114[]; -extern u8 *gUnknown_80FC180[]; -extern u8 *gUnknown_80FC0FC[]; -extern u8 *gUnknown_80FC0AC[]; -extern u8 *gUnknown_80FC09C[]; -extern u8 *gUnknown_80FC1F0[]; -extern u8 *gUnknown_80FC1A4[]; -extern u8 *gUnknown_80FCA64[]; -extern u8 *gUnknown_80FCC18[]; -extern u8 *gUnknown_80FB2E0[]; -extern u8 *gUnknown_80FB300[]; -extern u8 *gUnknown_80FB2CC[]; -extern u8 *gUnknown_80FB2AC[]; -extern u8 *gUnknown_80FF01C[]; -extern u8 *gUnknown_80FCBF8[]; -extern u8 *gUnknown_80FA124[]; -extern u8 *gUnknown_80FC2B8[]; -extern u8 *gUnknown_80FC298[]; -extern u8 *gUnknown_80FC2D8[]; -extern u8 *gUnknown_80FC298[]; -extern u8 *gUnknown_80FB27C[]; -extern u8 *gUnknown_80FB25C[]; -extern u8 *gUnknown_80FCDB4[]; -extern u8 *gUnknown_80FD500[]; -extern u8 *gUnknown_80FB960[]; -extern u8 *gUnknown_80FB940[]; -extern u8 *gUnknown_80FB204[]; -extern u8 *gUnknown_80FB240[]; -extern u8 *gUnknown_80FB1E0[]; -extern u8 *gUnknown_80FB1C4[]; -extern u8 *gUnknown_80FB21C[]; -extern u8 *gUnknown_80FAEA0[]; -extern u8 *gUnknown_80FAEF0[]; -extern u8 *gUnknown_80FAF3C[]; -extern u8 *gUnknown_80FAEC8[]; -extern u8 *gUnknown_80FAF1C[]; -extern u8 *gUnknown_80FAFAC[]; -extern u8 *gUnknown_80FAFD0[]; -extern u8 *gPtrCantLeechSeedSelfMessage[]; -extern u8 *gPtrCantLeechSeedMonMessage[]; -extern u8 *gUnknown_80FAA8C[]; -extern u8 *gUnknown_80FAE58[]; -extern u8 *gUnknown_80FAE7C[]; -extern u8 *gUnknown_80FBB4C[]; -extern u8 *gUnknown_80FBB78[]; -extern u8 *gUnknown_80FA79C[]; -extern u8 *gUnknown_80FB73C[]; -extern u8 *gUnknown_80FB764[]; -extern u8 *gUnknown_80FB780[]; -extern u8 *gUnknown_80FB7A0[]; -extern u8 *gUnknown_80FB8BC[]; -extern u8 *gUnknown_80FB8E4[]; -extern u8 *gUnknown_80FB900[]; -extern u8 *gUnknown_80FB924[]; -extern u8 *gUnknown_80FB994[]; -extern u8 *gUnknown_80FB978[]; -extern u8 *gUnknown_80FB004[]; extern u32 gUnknown_8106A4C; -extern u8 *gUnknown_80FB01C[]; -extern u8 *gUnknown_80FBA14[]; -extern u8 *gUnknown_80FB9F0[]; -extern u8 *gUnknown_80FBA38[]; -extern u8 *gUnknown_80FBA60[]; -extern u8 *gUnknown_80FBAA0[]; -extern u8 *gUnknown_80FBA80[]; -extern u8 *gUnknown_80FBB04[]; -extern u8 *gUnknown_80FBB28[]; -extern u8 *gUnknown_80FBBD4[]; -extern u8 *gUnknown_80FBBB8[]; -extern u8 *gUnknown_80FBB94[]; -extern u8 *gUnknown_80FBE84[]; -extern u8 *gUnknown_80FBEA0[]; -extern u8 *gUnknown_80FBE64[]; -extern u8 *gUnknown_80FBDF0[]; -extern u8 *gUnknown_80FBDC4[]; -extern u8 *gUnknown_80FBE14[]; extern void sub_8041D84(Entity *); extern void sub_804178C(u32); @@ -138,7 +49,45 @@ extern void nullsub_82(Entity *); extern void nullsub_83(Entity *); extern void nullsub_84(Entity *); extern void nullsub_85(Entity *); - +extern void ShowWholeRevealedDungeonMap(); +extern void EntityUpdateStatusSprites(Entity *); +extern void sub_8042A74(Entity *r0); +extern void sub_807EC28(bool8); +extern void DealDamageToEntity(Entity *, s16, u32, u32); +extern void ResetMonEntityData(EntityInfo *, u32); +extern void sub_80420C8(Entity *r0); +extern void nullsub_68(Entity *); +extern void nullsub_67(Entity *); +extern void nullsub_66(Entity *); +extern void nullsub_65(Entity *); +extern void nullsub_64(Entity *); +extern void nullsub_63(Entity *); +extern void nullsub_62(Entity *); +extern void nullsub_61(Entity *); +extern void nullsub_60(Entity *); +extern void nullsub_59(Entity *); +extern void nullsub_58(Entity *); +extern void nullsub_57(Entity *); +extern void sub_8041B34(Entity *); +void sub_8041BD0(Entity *r0, u8 r1); +void sub_8041EB4(Entity *); +void sub_8041EA4(Entity *); +extern void sub_8041E84(Entity *); +extern void sub_8041E94(Entity *); +extern void sub_8041E74(Entity *); +extern void sub_8041E60(Entity *); +extern void sub_8041E4C(Entity *); +extern void sub_8041E3C(Entity *); +extern void sub_803F580(u32); +extern void sub_8041E1C(Entity *); +extern void nullsub_89(Entity *); +extern void nullsub_88(Entity *); +extern void nullsub_87(Entity *); +extern void nullsub_86(Entity *); +extern void sub_8041E0C(Entity *); +extern void sub_8041DD8(Entity *r0, s32 r1); // NOTE: is s16 in another file +extern s32 sub_803D870(UnkDungeonGlobal_unk1CD98 *strPtr, s32 id); +extern bool8 sub_806AA0C(s32, u32); extern void sub_803F580(u32); extern void ShowWholeRevealedDungeonMap(void); extern void sub_8041D9C(Entity *); @@ -149,416 +98,7 @@ extern bool8 sub_8045888(Entity *r0); extern void sub_803ED30(s32, Entity *r0, u8, s32); extern void sub_8041BF8(Entity *); extern void sub_8041BE8(Entity *); -extern void sub_8041CCC(Entity *); -extern void sub_8041CB8(Entity *r0); -extern void sub_8041C1C(Entity *r0); -extern void sub_8042060(Entity *, s32); -extern void sub_8041FB4(Entity *r0, u32 r1); -extern void sub_8041FD8(Entity *r0, u32 r1); -extern void sub_804201C(Entity *r0, u32 r1); -extern void sub_8041FFC(Entity *r0, u32 r1); -extern void sub_8041C58(Entity *r0); extern void EntityUpdateStatusSprites(Entity *); -extern void sub_8042040(Entity *, s32); -extern void sub_80420A0(Entity *); - -u8 GetFlashFireStatus(Entity *pokemon) -{ - if (!EntityIsValid(pokemon) || !AbilityIsActive(pokemon, ABILITY_FLASH_FIRE)) - { - return FLASH_FIRE_STATUS_NONE; - } - if (GetEntInfo(pokemon)->flashFireBoost > 1) - { - return FLASH_FIRE_STATUS_MAXED; - } - return FLASH_FIRE_STATUS_NOT_MAXED; -} - -static inline s32 UpdateFlashFireBoost_sub(EntityInfo * entityInfo) -{ - s32 flashFireBoost; - - flashFireBoost = entityInfo->flashFireBoost; - flashFireBoost++; - if (FLASH_FIRE_STATUS_MAXED < flashFireBoost) { - flashFireBoost = FLASH_FIRE_STATUS_NOT_MAXED; - } - return flashFireBoost; -} - -void UpdateFlashFireBoost(Entity * pokemon, Entity *target) -{ - EntityInfo * entityInfo; - s32 flashFireBoost; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - flashFireBoost = UpdateFlashFireBoost_sub(entityInfo); - if (entityInfo->flashFireBoost != flashFireBoost) { - entityInfo->flashFireBoost = flashFireBoost; - sub_8041C58(target); - } - EntityUpdateStatusSprites(target); - } -} - -void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage) -{ - EntityInfo *entityInfo; - s24_8 oldMulti; - - if (!EntityIsValid(target)) { - return; - } - - if (statStage != STAT_STAGE_ATK) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0C8); - } - else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0B8); - } - if (F248LessThanInt(param_4, 1) && sub_8071728(pokemon,target,displayMessage)) { - return; - } - - if ((HasHeldItem(target,ITEM_TWIST_BAND)) && F248LessThanInt(param_4, 1)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); - return; - } - - if (AbilityIsActive(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && F248LessThanInt(param_4, 1)) { - if (displayMessage) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); - } - return; - } - - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - oldMulti = entityInfo->offensiveMultipliers[statStage]; - - if (F248LessThanInt(param_4, 1)) { - sub_8041FD8(target,statStage); - } - else { - sub_8041FB4(target,statStage); - } - - entityInfo->offensiveMultipliers[statStage] = s24_8_mul(entityInfo->offensiveMultipliers[statStage],param_4); - - if (F248LessThanFloat(entityInfo->offensiveMultipliers[statStage], 0.01)) { - entityInfo->offensiveMultipliers[statStage] = FloatToF248(0.01); - } - if (FloatLessThanF248(99.99, entityInfo->offensiveMultipliers[statStage])) { - entityInfo->offensiveMultipliers[statStage] = FloatToF248(99.99); - } - if (F248GreaterThan(oldMulti, entityInfo->offensiveMultipliers[statStage])) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC11C); - } - else if (F248LessThan(oldMulti, entityInfo->offensiveMultipliers[statStage])) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC118); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC184); - } - EntityUpdateStatusSprites(target); -} - -void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage) -{ - EntityInfo *entityInfo; - s24_8 oldMulti; - - if (!EntityIsValid(target)) { - return; - } - - if (statStage != STAT_STAGE_DEF) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0AC); - } - else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC09C); - } - if (F248LessThanInt(param_4, 1) && sub_8071728(pokemon,target,displayMessage)) { - return; - } - - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - oldMulti = entityInfo->defensiveMultipliers[statStage]; - - if (F248LessThanInt(param_4, 1)) { - sub_804201C(target,statStage); - } - else { - sub_8041FFC(target,statStage); - } - - entityInfo->defensiveMultipliers[statStage] = s24_8_mul(entityInfo->defensiveMultipliers[statStage],param_4); - - if (F248LessThanFloat(entityInfo->defensiveMultipliers[statStage], 0.01)) { - entityInfo->defensiveMultipliers[statStage] = FloatToF248(0.01); - } - if (FloatLessThanF248(99.99, entityInfo->defensiveMultipliers[statStage])) { - entityInfo->defensiveMultipliers[statStage] = FloatToF248(99.99); - } - if (F248GreaterThan(oldMulti, entityInfo->defensiveMultipliers[statStage])) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC114); - } - else if (F248LessThan(oldMulti, entityInfo->defensiveMultipliers[statStage])) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC0FC); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC180); - } - EntityUpdateStatusSprites(target); -} - -void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - sub_8042040(target,statStage); - if (statStage != STAT_STAGE_ACCURACY) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC090); - } - else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC084); - } - if (entityInfo->hitChanceStages[statStage] < MAX_STAT_STAGE) { - entityInfo->hitChanceStages[statStage]++; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC1C4); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC218); - } - EntityUpdateStatusSprites(target); - } -} - -void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, bool8 displayMessage) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - if (statStage != STAT_STAGE_ACCURACY) { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC090); - } - else { - strcpy(gFormatBuffer_Items[0],*gUnknown_80FC084); - } - if (!sub_8071728(pokemon,target,displayMessage)) { - if (AbilityIsActive(target, ABILITY_KEEN_EYE) && (statStage == STAT_STAGE_ACCURACY)){ - if(displayMessage) - { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA64); - } - } - else { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - sub_8042060(target,statStage); - if (entityInfo->hitChanceStages[statStage] != 0) { - entityInfo->hitChanceStages[statStage]--; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC1A4); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC1F0); - } - EntityUpdateStatusSprites(target); - } - } - } -} - -void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) -{ - EntityInfo *entityInfo; - - if (EntityIsValid(target)) { - if (!HasSafeguardStatus(pokemon, target, displayMessage)) { - if (AbilityIsActive(target, ABILITY_INNER_FOCUS)){ - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if(displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18); - } - else { - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if(entityInfo->cringeClassStatus.status != STATUS_CRINGE) - { - entityInfo->cringeClassStatus.status = STATUS_CRINGE; - entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target, gCringeTurnRange, TRUE) + 1; - sub_80420A0(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2E0); - } - else - { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB300); - } - EntityUpdateStatusSprites(target); - } - } - } -} - -void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) -{ - const Tile *mapTile; - EntityInfo *entityInfo; - Entity *mapPokemonEntity; - int index; - bool8 bVar6; - bool8 bVar7; - - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { - if (AbilityIsActive(target, ABILITY_LIMBER)) { - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (displayMessage) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBF8); - } - } - else - { - bVar6 = TRUE; - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->burnClassStatus.status != STATUS_PARALYSIS) { - entityInfo->burnClassStatus.status = STATUS_PARALYSIS; - entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gParalysisTurnRange,TRUE) + 1; - entityInfo->burnClassStatus.damageCountdown = 0; - entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0; - bVar6 = FALSE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2AC); - sub_8041C1C(target); - CalcSpeedStage(target); - } - else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2CC); - } - if ((AbilityIsActive(target, ABILITY_SYNCHRONIZE)) && (!bVar6)) { - bVar7 = FALSE; - - for(index = 0; index < NUM_DIRECTIONS; index++) - { - mapTile = GetTile(target->pos.x + gAdjacentTileOffsets[index].x,target->pos.y + gAdjacentTileOffsets[index].y); - mapPokemonEntity = mapTile->monster; - if ((EntityIsValid(mapPokemonEntity)) && (GetEntityType(mapPokemonEntity) == ENTITY_MONSTER)) { - if (!bVar7) { - bVar7 = TRUE; - SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF01C); - } - if (sub_807167C(target,mapPokemonEntity) == 1) { - ParalyzeStatusTarget(pokemon, mapPokemonEntity, displayMessage); - } - } - } - } - EntityUpdateStatusSprites(target); - } - } -} - -void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage) -{ - s32 movSpeed; - s32 index; - s32 movSpeed_1; - EntityInfo *entityInfo; - - if (!EntityIsValid(target)) { - return; - } - if (turns == 0) { - turns = CalculateStatusTurns(target,gSpeedRaiseTurnRange,FALSE) + 1; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - movSpeed = CalcSpeedStage(target); - if (movSpeed == MAX_SPEED_STAGE) { - if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC2B8); - } - else { - for(index = 0; index < NUM_SPEED_COUNTERS; index++) - { - if(entityInfo->speedUpCounters[index] == 0) - { - entityInfo->speedUpCounters[index] = turns; - break; - } - } - movSpeed_1 = CalcSpeedStage(target); - if (movSpeed == movSpeed_1) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC298); - } - else - { - sub_8041CB8(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); - entityInfo->speedStageChanged = TRUE; - entityInfo->attacking = FALSE; - } - } - EntityUpdateStatusSprites(target); -} - -void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, bool8 displayMessage) -{ - s32 movSpeed; - s32 counter; - s32 index; - s32 movSpeed_1; - EntityInfo *entityInfo; - - if (!EntityIsValid(target)) { - return; - } - if (HasSafeguardStatus(pokemon,target,displayMessage)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - movSpeed = CalcSpeedStage(target); - if (movSpeed == 0) { - if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC2D8); - } - else { - for(counter = 0; counter < levels; counter++) - { - for(index = 0; index < NUM_SPEED_COUNTERS; index++) - { - if (entityInfo->speedDownCounters[index]== 0) { - entityInfo->speedDownCounters[index] = CalculateStatusTurns(target,gSpeedLowerTurnRange,TRUE) + 1; - break; - } - } - } - movSpeed_1 = CalcSpeedStage(target); - if (movSpeed == movSpeed_1) { - if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC298); - } - else - { - sub_8041CCC(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); - } - } - EntityUpdateStatusSprites(target); -} void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) { @@ -575,13 +115,13 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (HasHeldItem(target,ITEM_PERSIM_BAND)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD500); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD500); } else { if (AbilityIsActive(target, ABILITY_OWN_TEMPO)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDB4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCDB4); } else { @@ -590,10 +130,10 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage if (entityInfo->cringeClassStatus.status != STATUS_CONFUSED) { entityInfo->cringeClassStatus.status = STATUS_CONFUSED; entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gConfusionTurnRange,TRUE) + 1; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB25C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB25C); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB27C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB27C); } EntityUpdateStatusSprites(target); } @@ -611,10 +151,10 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->cringeClassStatus.status = STATUS_COWERING; entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gCowerTurnRange,TRUE) + 1; sub_8041BF8(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB940); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB940); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB960); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB960); } EntityUpdateStatusSprites(target); } @@ -666,12 +206,12 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if ((HP == 0) && (maxHPStat == 0)) { if (displayMessage_u8) - TryDisplayDungeonLoggableMessage3(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) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB21C); // $m0 has full HP + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB21C); // $m0 has full HP } else { @@ -680,7 +220,7 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo if (sub_8045888(target)) { r8 = maxHPStat; } - TryDisplayDungeonLoggableMessage3(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)) { @@ -688,10 +228,10 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo } if (param_3 != 0) { if (entityInfo->maxHPStat == entityInfo->HP) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB1E0); // $m0 was fully healed + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB1E0); // $m0 was fully healed } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB1C4); // $m0 recovered {VALUE_0} HP + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB1C4); // $m0 recovered {VALUE_0} HP } } } @@ -704,14 +244,14 @@ void HandleScannerOrb(Entity* pokemon, Entity* target) { if (EntityIsValid(target)) { if (GetEntInfo(target)->scanning) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEF0); // Item locations are already known + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAEF0); // Item locations are already known } else { GetEntInfo(target)->scanning = TRUE; nullsub_75(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAEA0); // Item locations became evident sub_803F580(0); ShowWholeRevealedDungeonMap(); EntityUpdateStatusSprites(target); @@ -724,19 +264,19 @@ void HandleStairsOrb(Entity* pokemon, Entity* target) if (EntityIsValid(target)) { if(GetFloorType()) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF3C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAF3C); } else { if (GetEntInfo(target)->stairSpotter) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF1C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAF1C); } else { GetEntInfo(target)->stairSpotter = TRUE; nullsub_76(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAEC8); sub_803F580(0); ShowWholeRevealedDungeonMap(); EntityUpdateStatusSprites(target); @@ -749,14 +289,14 @@ void HandleRadarOrb(Entity* pokemon, Entity* target) { if (EntityIsValid(target)) { if (GetEntInfo(target)->powerEars != 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFD0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAFD0); } else { GetEntInfo(target)->powerEars = TRUE; nullsub_77(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAFAC); sub_803F580(0); ShowWholeRevealedDungeonMap(); EntityUpdateStatusSprites(target); @@ -775,7 +315,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) if (pokemon == target) { pokemon = target; if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedSelfMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrCantLeechSeedSelfMessage); } else { if (HasSafeguardStatus(pokemon,target,displayMessage)) { @@ -784,14 +324,14 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (MonsterIsType(target, TYPE_GRASS)) { if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedMonMessage); + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrCantLeechSeedMonMessage); } else { switch(entityInfo->leechSeedClassStatus.status) { case STATUS_DESTINY_BOND: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAA8C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAA8C); default: entityInfo->leechSeedClassStatus.status = STATUS_LEECH_SEED; entityInfo->leechSeedClassStatus.turns = CalculateStatusTurns(target, gLeechSeedTurnRange, TRUE) + 1; @@ -800,7 +340,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->leechSeedClassStatus.unk8 = 0xff; break; case STATUS_LEECH_SEED: - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE7C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAE7C); return; } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) @@ -811,7 +351,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->leechSeedClassStatus.unk4 = entityInfo2->unk98; } } - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE58); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAE58); EntityUpdateStatusSprites(target); } } @@ -831,7 +371,7 @@ void sub_8078084(Entity * pokemon) target = gDungeon->activePokemon[index]; if (EntityIsValid(target)) { entityInfo2 = GetEntInfo(target); - if((u8)(entityInfo2->leechSeedClassStatus.status - 1) <= 1) + if(entityInfo2->leechSeedClassStatus.status == STATUS_LEECH_SEED || entityInfo2->leechSeedClassStatus.status == STATUS_DESTINY_BOND) { if(entityInfo2->leechSeedClassStatus.unk4 == entityInfo->unk98) { @@ -856,7 +396,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->leechSeedClassStatus.status != STATUS_DESTINY_BOND) { if (entityInfo->leechSeedClassStatus.status == STATUS_LEECH_SEED) - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA79C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA79C); entityInfo->leechSeedClassStatus.status = STATUS_DESTINY_BOND; entityInfo->leechSeedClassStatus.turns = CalculateStatusTurns(target,gDestinyBondTurnRange,TRUE) + 1; @@ -866,7 +406,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB78); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBB78); return; } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) @@ -877,7 +417,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) entityInfo->leechSeedClassStatus.unk4 = entityInfo2->unk98; } } - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB4C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBB4C); EntityUpdateStatusSprites(target); } } @@ -893,10 +433,10 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) entityInfo->sureShotClassStatus.status = STATUS_SURE_SHOT; entityInfo->sureShotClassStatus.turns = turns + 1; sub_8041CDC(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB73C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB73C); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB764); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB764); } EntityUpdateStatusSprites(target); } @@ -913,10 +453,10 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) entityInfo->sureShotClassStatus.status = STATUS_WHIFFER; entityInfo->sureShotClassStatus.turns = turns + 1; sub_8041CEC(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB780); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB780); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7A0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB7A0); } EntityUpdateStatusSprites(target); } @@ -933,10 +473,10 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) entityInfo->sureShotClassStatus.status = STATUS_SET_DAMAGE; entityInfo->sureShotClassStatus.turns = CalculateStatusTurns(target, gSetDamageTurnRange, FALSE) + 1; nullsub_79(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB8BC); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB8BC); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB8E4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB8E4); } EntityUpdateStatusSprites(target); } @@ -953,10 +493,10 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) entityInfo->sureShotClassStatus.status = STATUS_FOCUS_ENERGY; entityInfo->sureShotClassStatus.turns = CalculateStatusTurns(target, gFocusEnergyTurnRange, FALSE) + 1; nullsub_80(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB900); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB900); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB924); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB924); } EntityUpdateStatusSprites(target); } @@ -975,7 +515,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) targetEntityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->curseClassStatus.status == STATUS_DECOY) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB994); } else { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) @@ -999,7 +539,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) targetEntityInfo->curseClassStatus.damageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); gDungeon->decoyIsActive = TRUE; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB978); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { @@ -1049,7 +589,7 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) targetEntityInfo->curseClassStatus.damageCountdown = 0; } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB004); } else { statStage = gUnknown_8106A4C; @@ -1089,7 +629,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) gDungeon->snatchPokemon = target; gDungeon->unk17B3C = targetEntityInfo->unk98; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB01C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB01C); EntityUpdateStatusSprites(target); } } @@ -1105,10 +645,10 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) entityInfo->cringeClassStatus.status = STATUS_TAUNTED; entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gTauntTurnRange,TRUE) + 1; nullsub_73(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9F0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB9F0); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA14); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBA14); } EntityUpdateStatusSprites(target); } @@ -1126,10 +666,10 @@ void HandleStockpile(Entity * pokemon, Entity * target) sub_804178C(1); sub_8041D5C(target); gFormatArgs[0] = entityInfo->stockpileStage; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA38); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBA38); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA60); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBA60); } EntityUpdateStatusSprites(target); } @@ -1149,10 +689,10 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) targetEntityInfo->invisibleClassStatus.status = STATUS_INVISIBLE; targetEntityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target,gInvisibleTurnRange,FALSE) + 1; sub_8041D84(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA80); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBA80); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAA0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBAA0); } EntityUpdateStatusSprites(target); } @@ -1168,10 +708,10 @@ void PerishSongTarget(Entity * pokemon, Entity * target) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->perishSongTurns == 0) { entityInfo->perishSongTurns = CalculateStatusTurns(target,gPerishSongTurnRange,FALSE) + 1; - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB04); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBB04); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB28); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBB28); } EntityUpdateStatusSprites(target); } @@ -1192,7 +732,7 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) } if ((index == MAX_MON_MOVES) && ((EntityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBD4); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBBD4); } else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); @@ -1200,10 +740,10 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) EntityInfo->cringeClassStatus.status = STATUS_ENCORE; EntityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gEncoreTurnRange,TRUE) + 1; nullsub_83(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB94); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBB94); } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBB8); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBBB8); } EntityUpdateStatusSprites(target); } @@ -1229,10 +769,10 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4) if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->maxBelly)) { sub_8041D9C(target); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBD9C); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBD9C); } else - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBE3C); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBE3C); } else { FixedPoint sp8 = IntToFixedPoint(param_3); @@ -1243,10 +783,10 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4) if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->belly)) { nullsub_84(target); - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBD78); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBD78); } else - TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBE40); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBE40); } EntityUpdateStatusSprites(target); @@ -1273,7 +813,7 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel } targetInfo = GetEntInfo(target); if ((!targetInfo->isTeamLeader) && (HasHeldItem(target,0x1b))) { - if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBEA0); + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBEA0); return; } bellySizeIncreased = FALSE; @@ -1298,16 +838,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)) { - TryDisplayDungeonLoggableMessage3(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)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (displayMessage) TryDisplayDungeonLoggableMessage3(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); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDC4); // m0's max belly size increased! + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBDC4); // m0's max belly size increased! } } else { @@ -1325,17 +865,459 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel nullsub_85(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (FixedPointToInt(oldBelly) == FixedPointToInt(*bellyPtr)) { - if (displayMessage) TryDisplayDungeonLoggableMessage3(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) TryDisplayDungeonLoggableMessage3(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) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE84); // $m0's belly was filled! + if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBE84); // $m0's belly was filled! } } } EntityUpdateStatusSprites(target); } + +void MuzzleTarget(Entity *pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->muzzled.muzzled != TRUE) { + entityInfo->muzzled.muzzled = TRUE; + entityInfo->muzzled.turns = CalculateStatusTurns(target,gMuzzledTurnRange, TRUE) + 1; + nullsub_86(target); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBF68); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBF84); + } + EntityUpdateStatusSprites(target); + } +} + +void TransformStatusTarget(Entity * pokemon, Entity * target) +{ + s16 species; + s32 iVar5; + s32 apparentID; + s16 apparentID_s16; + s32 index; + EntityInfo *entityInfo; + OpenedFile *sprite; + UnkDungeonGlobal_unk1CD98 auStack544[64]; + + if (!EntityIsValid(target)) + return; + + entityInfo = GetEntInfo(target); + + if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBF04); + else { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + iVar5 = sub_803D870(auStack544, 0); + + if (iVar5 == 0) + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBEE4); + else { + sprite = NULL; + + for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { + species = ExtractSpeciesIndex(&auStack544[DungeonRandInt(iVar5)]); + apparentID_s16 = GetMonsterApparentID(target, species); + apparentID = apparentID_s16; + + if (apparentID != entityInfo->apparentID && sub_806AA0C(apparentID, 1)) { + sprite = GetSpriteData(apparentID); + if (sprite != NULL) + break; + } + } + + if (index == DUNGEON_MAX_POKEMON || sprite == NULL) + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBEE4); + else { + entityInfo->apparentID = apparentID; + target->axObj.spriteFile = sprite; + entityInfo->invisibleClassStatus.status = STATUS_TRANSFORMED; + entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target, gTransformedTurnRange, TRUE) + 1; + sub_806CF98(target); + nullsub_87(target); + sub_806CCB4(target, sub_806CEBC(target)); + CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1], entityInfo->apparentID); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBEC0); + EntityUpdateStatusSprites(target); + } + } + } +} + +void MobileStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + + if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { + SendTransformEndMessage(pokemon,target); + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->invisibleClassStatus.status != STATUS_MOBILE) { + entityInfo->invisibleClassStatus.status = STATUS_MOBILE; + entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target,gMobileTurnRange, FALSE) + 1; + nullsub_88(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBF28); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBF50); + } + EntityUpdateStatusSprites(target); + } +} + +void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) +{ + EntityInfo *entityInfo; + s32 param_3_s16; + s32 param_3_s16_2; + bool32 flag; + bool32 flag2; + + param_3_s16 = param_3; + param_3_s16_2 = param_3_s16; + flag = FALSE; + flag2 = FALSE; + + if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->hitChanceStages[1] > 10) { + entityInfo->hitChanceStages[1] = 10; + flag = TRUE; + } + if(flag) + { + sub_8041DD8(target,param_3_s16); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC000); + flag2 = TRUE; + } + if (entityInfo->exposed) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBFB8); + } + else + { + if (!flag2) { + sub_8041DD8(target,param_3_s16_2); + } + if (!MonsterIsType(target, TYPE_GHOST)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBFD8); + } + else { + entityInfo->exposed = TRUE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBF9C); + } + EntityUpdateStatusSprites(target); + } + } +} + +void IdentityItemHolders(Entity *pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { + entityInfo = GetEntInfo(target); + if (!gDungeon->unk644.itemHoldersIdentified) { + nullsub_89(target); + gDungeon->unk644.itemHoldersIdentified = TRUE; + EntityUpdateStatusSprites(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC028); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC054); + } + } +} + +void BlindTarget(Entity *pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->blinkerClassStatus.status != STATUS_BLINKER) { + entityInfo->blinkerClassStatus.status = STATUS_BLINKER; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gBlinkerTurnRange, TRUE) + 1; + sub_8041E0C(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB7F4); + DungeonRunFrameActions(0x31); + sub_8049ED4(); + ShowWholeRevealedDungeonMap(); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB810); + } + EntityUpdateStatusSprites(target); + } +} + +void CrossEyeVisionTarget(Entity *pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + + if (EntityIsValid(target)) { + if(!HasSafeguardStatus(pokemon, target, TRUE)) + { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->blinkerClassStatus.status != STATUS_CROSS_EYED) { + sub_8041E1C(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB834); + entityInfo->blinkerClassStatus.status = STATUS_CROSS_EYED; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gCrossEyedTurnRange, TRUE) + 1; + sub_803F580(0x1); + sub_8049ED4(); + ShowWholeRevealedDungeonMap(); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB85C); + } + EntityUpdateStatusSprites(target); + } + } +} + +void RestoreVisionTarget(Entity *pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->blinkerClassStatus.status != STATUS_EYEDROPS) { + entityInfo->blinkerClassStatus.status = STATUS_EYEDROPS; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gEyedropsTurnRange, FALSE) + 1; + sub_8041E3C(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB880); + DungeonRunFrameActions(0x31); + sub_8049ED4(); + ShowWholeRevealedDungeonMap(); + } + else + { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB89C); + } + EntityUpdateStatusSprites(target); + } +} + +void RestorePPTarget(Entity * pokemon,Entity * target, s32 param_3) +{ + volatile s32 PP; + volatile s32 basePP; + Move *movePtr; + Move *movePtr1; + s32 index; + bool8 PPChanged; + EntityInfo *entityInfo; + + PPChanged = FALSE; + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + + for(index = 0; index < MAX_MON_MOVES; index++) + { + movePtr = &entityInfo->moves.moves[index]; + movePtr1 = movePtr; + if ((movePtr->moveFlags & MOVE_FLAG_EXISTS)) { + PP = movePtr->PP; + basePP = GetMoveBasePP(movePtr1); + if (PP < basePP) { + PP += param_3; + if (PP > basePP) { + PP = basePP; + } + movePtr->PP = PP; + PPChanged = TRUE; + } + } + } + if (PPChanged) { + sub_8041E4C(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDBD0); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDBF0); + } + EntityUpdateStatusSprites(target); + } +} + +void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) +{ + u32 oldStat; + u32 oldStat1; + s32 newStat; + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + + entityInfo = GetEntInfo(target); + oldStat = entityInfo->atk[0]; + oldStat1 = oldStat; + + newStat = entityInfo->atk[0] + increment; + if (0xfe < newStat) { + newStat = 0xff; + } + entityInfo->atk[0] = newStat; + if (oldStat1 < (u8)newStat) { + sub_8041E60(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC33C); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC360); + } + EntityUpdateStatusSprites(target); + } +} + +void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) +{ + u32 oldStat; + u32 oldStat1; + s32 newStat; + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + + entityInfo = GetEntInfo(target); + oldStat = entityInfo->atk[1]; + oldStat1 = oldStat; + + newStat = entityInfo->atk[1] + increment; + if (0xfe < newStat) { + newStat = 0xff; + } + entityInfo->atk[1] = newStat; + if (oldStat1 < (u8)newStat) { + sub_8041E74(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC388); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC3B4); + } + EntityUpdateStatusSprites(target); + } +} + +void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment) +{ + u32 oldStat; + u32 oldStat1; + s32 newStat; + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + + entityInfo = GetEntInfo(target); + oldStat = entityInfo->def[0]; + oldStat1 = oldStat; + + newStat = entityInfo->def[0] + increment; + if (0xfe < newStat) { + newStat = 0xff; + } + entityInfo->def[0] = newStat; + if (oldStat1 < (u8)newStat) { + sub_8041E84(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC3D8); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC3FC); + } + EntityUpdateStatusSprites(target); + } +} + +void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment) +{ + u32 oldStat; + u32 oldStat1; + s32 newStat; + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + + entityInfo = GetEntInfo(target); + oldStat = entityInfo->def[1]; + oldStat1 = oldStat; + + newStat = entityInfo->def[1] + increment; + if (0xfe < newStat) { + newStat = 0xff; + } + entityInfo->def[1] = newStat; + if (oldStat1 < (u8)newStat) { + sub_8041E94(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC428); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC454); + } + EntityUpdateStatusSprites(target); + } +} + +void LongTossStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); + if (entityInfo->longTossClassStatus.status != STATUS_LONG_TOSS) { + entityInfo->longTossClassStatus.status = STATUS_LONG_TOSS; + sub_8041EA4(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD20C); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD22C); + } + EntityUpdateStatusSprites(target); +} + +void PierceStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); + if (entityInfo->longTossClassStatus.status != STATUS_PIERCE) { + entityInfo->longTossClassStatus.status = STATUS_PIERCE; + sub_8041EB4(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD254); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD27C); + } + EntityUpdateStatusSprites(target); +} + diff --git a/src/move_orb_effects_3.c b/src/move_orb_effects_3.c new file mode 100644 index 000000000..95f0be70c --- /dev/null +++ b/src/move_orb_effects_3.c @@ -0,0 +1,113 @@ +#include "global.h" +#include "globaldata.h" +#include "code_803E46C.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "code_805D8C8.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_808417C.h" +#include "constants/ability.h" +#include "constants/item.h" +#include "constants/status.h" +#include "constants/type.h" +#include "dungeon_items.h" +#include "dungeon_logic.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "move_effects_target.h" +#include "moves.h" +#include "math.h" +#include "pokemon.h" +#include "pokemon_3.h" +#include "pokemon_mid.h" +#include "structs/dungeon_entity.h" +#include "structs/str_dungeon.h" +#include "dungeon_map_access.h" +#include "structs/str_806B7F8.h" +#include "dungeon_config.h" +#include "dungeon_strings.h" + +extern void sub_8041BD0(Entity *r0, u8 r1); +extern void EntityUpdateStatusSprites(Entity *); + +void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *move, const u8 *message) +{ + bool8 bVar2; + Move *movePtr; + s32 index; + bool8 uVar5; + s32 iVar7; + s32 iVar8; + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if ((entityInfo->bideClassStatus.status == newStatus) && (newStatus == STATUS_ENRAGED)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC074); + } + else { + entityInfo->bideClassStatus.status = newStatus; + + for(index = 0; index < MAX_MON_MOVES; index++) + { + movePtr = &entityInfo->moves.moves[index]; + if(movePtr == move) + { + entityInfo->bideClassStatus.moveSlot = index; + break; + } + } + entityInfo->unk14A = 1; + + uVar5 = FALSE; + if (newStatus == STATUS_FLYING || newStatus == STATUS_BOUNCING) { + entityInfo->unkFF = 1; + uVar5 = TRUE; + } + else if (newStatus == STATUS_DIVING || newStatus == STATUS_DIGGING) { + entityInfo->unkFF = 2; + } + if (newStatus == STATUS_BIDE) { + entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gBideTurnRange, FALSE) + 1; + entityInfo->unkA0 = 0; + } + if (newStatus == STATUS_ENRAGED) { + entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gEnragedTurnRange, FALSE) + 1; + } + sub_8041BD0(target,uVar5); + TryDisplayDungeonLoggableMessage3(pokemon,target,message); + EntityUpdateStatusSprites(target); + + // TODO: this could probably be cleaner.. + for (index = 0, iVar8 = 0xc7ff; index < 400; index++) { + bVar2 = TRUE; + if (entityInfo->unkFF == 1) + if(iVar7 = entityInfo->unk174.raw, bVar2 = FALSE, iVar7 > iVar8) // unk174 -> u32 to s32 + { + bVar2 = TRUE; + } + if (bVar2) { + break; + } + DungeonRunFrameActions(0x53); + } + } + } +} + +void sub_8079764(Entity * pokemon) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(pokemon)) { + entityInfo = GetEntInfo(pokemon); + if ((entityInfo->bideClassStatus.status != STATUS_BIDE) && (entityInfo->bideClassStatus.status != STATUS_ENRAGED)) { + entityInfo->bideClassStatus.status = STATUS_NONE; + entityInfo->unk14A = 0; + entityInfo->unkFF = 0; + } + EntityUpdateStatusSprites(pokemon); + } +} diff --git a/src/move_orb_effects_4.c b/src/move_orb_effects_4.c new file mode 100644 index 000000000..41ac68895 --- /dev/null +++ b/src/move_orb_effects_4.c @@ -0,0 +1,392 @@ +#include "global.h" +#include "globaldata.h" +#include "code_803E46C.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "code_805D8C8.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_808417C.h" +#include "constants/ability.h" +#include "constants/item.h" +#include "constants/status.h" +#include "constants/type.h" +#include "dungeon_items.h" +#include "dungeon_logic.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "move_effects_target.h" +#include "moves.h" +#include "math.h" +#include "pokemon.h" +#include "pokemon_3.h" +#include "pokemon_mid.h" +#include "structs/dungeon_entity.h" +#include "structs/str_dungeon.h" +#include "dungeon_map_access.h" +#include "structs/str_806B7F8.h" +#include "dungeon_config.h" +#include "dungeon_strings.h" + +extern void ShowWholeRevealedDungeonMap(); +extern void EntityUpdateStatusSprites(Entity *); +extern void sub_8042A74(Entity *r0); +extern void sub_807EC28(bool8); +extern s32 GetMonsterApparentID(Entity *param_1, s16 param_2); +extern void sub_806A898(Entity *, u32, u32); +extern void HealTargetHP(Entity *pokemon, Entity *r1, s16, s16, u32); +extern void DealDamageToEntity(Entity *, s16, u32, u32); +extern void ResetMonEntityData(EntityInfo *, u32); +extern void sub_80420C8(Entity *r0); +extern void nullsub_68(Entity *); +extern void nullsub_67(Entity *); +extern void nullsub_66(Entity *); +extern void nullsub_65(Entity *); +extern void nullsub_64(Entity *); +extern void nullsub_63(Entity *); +extern void nullsub_62(Entity *); +extern void nullsub_61(Entity *); +extern void nullsub_60(Entity *); +extern void nullsub_59(Entity *); +extern void nullsub_58(Entity *); +extern void nullsub_57(Entity *); +extern void sub_8041B34(Entity *); +void sub_8041BD0(Entity *r0, u8 r1); +void sub_8041EB4(Entity *); +void sub_8041EA4(Entity *); +extern void sub_8041E84(Entity *); +extern void sub_8041E94(Entity *); +extern void sub_8041E74(Entity *); +extern void sub_8041E60(Entity *); +extern void sub_8041E4C(Entity *); +extern void sub_8041E3C(Entity *); +extern void sub_803F580(u32); +extern void sub_8041E1C(Entity *); +extern void nullsub_89(Entity *); +extern void nullsub_88(Entity *); +extern void nullsub_87(Entity *); +extern void nullsub_86(Entity *); +extern void sub_8041E0C(Entity *); +extern void sub_8041DD8(Entity *r0, s32 r1); // NOTE: is s16 in another file +extern s32 sub_803D870(UnkDungeonGlobal_unk1CD98 *strPtr, s32 id); +extern bool8 sub_806AA0C(s32, u32); + +void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status == newStatus) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB10C); + } + else { + nullsub_57(target); + if ((entityInfo->reflectClassStatus.status != STATUS_COUNTER) && (entityInfo->reflectClassStatus.status != STATUS_MINI_COUNTER)) { + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target,gCounterTurnRange, FALSE) + 1; + } + entityInfo->reflectClassStatus.status = newStatus; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB0E0); + EntityUpdateStatusSprites(target); + } + } +} + +void SafeguardStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_SAFEGUARD) { + entityInfo->reflectClassStatus.status = STATUS_SAFEGUARD; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gSafeguardTurnRange, FALSE) + 1; + nullsub_58(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB048); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB074); + } + EntityUpdateStatusSprites(target); + } +} + +void MistStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_MIST) { + entityInfo->reflectClassStatus.status = STATUS_MIST; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMistTurnRange, FALSE) + 1; + nullsub_59(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB09C); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB0C4); + } + EntityUpdateStatusSprites(target); + } +} + +void WishStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_WISH) { + entityInfo->reflectClassStatus.status = STATUS_WISH; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gWishTurnRange, FALSE) + 1; + sub_8041B34(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAE1C); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAE3C); + } + EntityUpdateStatusSprites(target); + } +} + +void MagicCoatStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_MAGIC_COAT) { + entityInfo->reflectClassStatus.status = STATUS_MAGIC_COAT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMagicCoatTurnRange, FALSE) + 1; + nullsub_60(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAF5C); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAF8C); + } + EntityUpdateStatusSprites(target); + } +} + +void LightScreenStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_LIGHT_SCREEN) { + entityInfo->reflectClassStatus.status = STATUS_LIGHT_SCREEN; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gLightScreenTurnRange, FALSE) + 1; + nullsub_61(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB130); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB160); + } + EntityUpdateStatusSprites(target); + } +} + +void ReflectStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_REFLECT) { + entityInfo->reflectClassStatus.status = STATUS_REFLECT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gReflectTurnRange, FALSE) + 1; + nullsub_62(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB17C); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB1A8); + } + EntityUpdateStatusSprites(target); + } +} + +void ProtectStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + nullsub_63(target); + entityInfo = GetEntInfo(target); + if (entityInfo->reflectClassStatus.status != STATUS_PROTECT) { + entityInfo->reflectClassStatus.status = STATUS_PROTECT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gProtectTurnRange, FALSE) + 1; + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB9B0); + } + else { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB9D8); + } + EntityUpdateStatusSprites(target); + } +} + +void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_COAT) { + entityInfo->reflectClassStatus.status = STATUS_MIRROR_COAT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMirrorCoatTurnRange, FALSE) + 1; + nullsub_64(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBAC0); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBAE4); + } + EntityUpdateStatusSprites(target); + } +} + +void EndureStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_ENDURING) { + entityInfo->reflectClassStatus.status = STATUS_ENDURING; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gEnduringTurnRange, FALSE) + 1; + nullsub_65(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBBF0); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBC14); + } + EntityUpdateStatusSprites(target); + } +} + +void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_MOVE) { + entityInfo->reflectClassStatus.status = STATUS_MIRROR_MOVE; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gMirrorMoveTurnRange, FALSE) + 1; + nullsub_66(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBC38); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBC5C); + } + EntityUpdateStatusSprites(target); + } +} + +void Conversion2StatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + + if(AbilityIsActive(target, ABILITY_FORECAST)) + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrForecastPreventsConversion2Message); + else + { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_CONVERSION2) { + entityInfo->reflectClassStatus.status = STATUS_CONVERSION2; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gConversion2TurnRange, FALSE) + 1; + nullsub_67(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBC7C); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBCA4); + } + EntityUpdateStatusSprites(target); + } + } +} + +void VitalThrowStatusTarget(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->reflectClassStatus.status != STATUS_VITAL_THROW) { + entityInfo->reflectClassStatus.status = STATUS_VITAL_THROW; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gVitalThrowTurnRange, FALSE) + 1; + nullsub_68(target); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBCC8); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBCF0); + } + EntityUpdateStatusSprites(target); + } +} + +void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) +{ + bool8 statChanged; + EntityInfo *entityInfo; + s32 index; + + statChanged = FALSE; + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + + for(index = 0; index < 2; index++) + { + if (entityInfo->offensiveStages[index] != DEFAULT_STAT_STAGE) { + entityInfo->offensiveStages[index] = DEFAULT_STAT_STAGE; + statChanged = TRUE; + } + if (entityInfo->defensiveStages[index] != DEFAULT_STAT_STAGE) { + entityInfo->defensiveStages[index] = DEFAULT_STAT_STAGE; + statChanged = TRUE; + } + if (entityInfo->hitChanceStages[index] != DEFAULT_STAT_STAGE) { + entityInfo->hitChanceStages[index] = DEFAULT_STAT_STAGE; + statChanged = TRUE; + } + if (!F248EqualsInt(entityInfo->offensiveMultipliers[index], 1)) { + entityInfo->offensiveMultipliers[index] = F248_ONE; + statChanged = TRUE; + } + if (!F248EqualsInt(entityInfo->defensiveMultipliers[index], 1)) { + entityInfo->defensiveMultipliers[index] = F248_ONE; + statChanged = TRUE; + } + } + if (statChanged) { + sub_80420C8(target); + } + else if (param_3 != 0) { + sub_80420C8(target); + } + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (statChanged) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBD18); + } + else { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBD3C); + } + EntityUpdateStatusSprites(target); + } +} + diff --git a/src/move_orb_effects_5.c b/src/move_orb_effects_5.c new file mode 100644 index 000000000..6643ff8e8 --- /dev/null +++ b/src/move_orb_effects_5.c @@ -0,0 +1,619 @@ +#include "global.h" +#include "globaldata.h" +#include "code_803E46C.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "code_805D8C8.h" +#include "code_806CD90.h" +#include "code_8077274_1.h" +#include "code_808417C.h" +#include "constants/ability.h" +#include "constants/item.h" +#include "constants/status.h" +#include "constants/type.h" +#include "dungeon_items.h" +#include "dungeon_random.h" +#include "dungeon_util.h" +#include "move_effects_target.h" +#include "moves.h" +#include "math.h" +#include "pokemon.h" +#include "pokemon_3.h" +#include "pokemon_mid.h" +#include "structs/dungeon_entity.h" +#include "structs/str_dungeon.h" +#include "dungeon_map_access.h" +#include "structs/str_806B7F8.h" +#include "dungeon_config.h" +#include "dungeon_logic.h" +#include "dungeon_strings.h" + +extern void ShowWholeRevealedDungeonMap(); +extern void EntityUpdateStatusSprites(Entity *); +extern void sub_8042A74(Entity *r0); +extern void sub_807EC28(bool8); +extern s32 GetMonsterApparentID(Entity *param_1, s16 param_2); +extern void sub_806A898(Entity *, u32, u32); +extern void HealTargetHP(Entity *pokemon, Entity *r1, s16, s16, u32); +extern void DealDamageToEntity(Entity *, s16, u32, u32); +extern void ResetMonEntityData(EntityInfo *, u32); +extern void sub_80420C8(Entity *r0); +extern void nullsub_68(Entity *); +extern void nullsub_67(Entity *); +extern void nullsub_66(Entity *); +extern void nullsub_65(Entity *); +extern void nullsub_64(Entity *); +extern void nullsub_63(Entity *); +extern void nullsub_62(Entity *); +extern void nullsub_61(Entity *); +extern void nullsub_60(Entity *); +extern void nullsub_59(Entity *); +extern void nullsub_58(Entity *); +extern void nullsub_57(Entity *); +extern void sub_8041B34(Entity *); +void sub_8041BD0(Entity *r0, u8 r1); +void sub_8041EB4(Entity *); +void sub_8041EA4(Entity *); +extern void sub_8041E84(Entity *); +extern void sub_8041E94(Entity *); +extern void sub_8041E74(Entity *); +extern void sub_8041E60(Entity *); +extern void sub_8041E4C(Entity *); +extern void sub_8041E3C(Entity *); +extern void sub_803F580(u32); +extern void sub_8041E1C(Entity *); +extern void nullsub_89(Entity *); +extern void nullsub_88(Entity *); +extern void nullsub_87(Entity *); +extern void nullsub_86(Entity *); +extern void sub_8041E0C(Entity *); +extern void sub_8041DD8(Entity *r0, s32 r1); // NOTE: is s16 in another file +extern s32 sub_803D870(UnkDungeonGlobal_unk1CD98 *strPtr, s32 id); +extern bool8 sub_806AA0C(s32, u32); + +void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) +{ + bool8 moveUnsealed; // r9 + s32 moveSpeed; + Move *move; + EntityInfo *entityInfo; // r7 + bool8 bVar8; // r8 + s32 index; + + bVar8 = FALSE; + moveUnsealed = FALSE; + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + if (HasNegativeStatus(target)) { + bVar8 = TRUE; + EndSleepClassStatus(pokemon,target,0,0); + if (!EntityIsValid(target)) { + return; + } + EndBurnClassStatus(pokemon,target); + EndFrozenClassStatus(pokemon,target); + EndCringeClassStatus(pokemon,target); + EndCurseClassStatus(pokemon,target,0); + EndLeechSeedClassStatus(pokemon,target); + SendMoveEndMessage(pokemon,target); + SendEyesightEndMessage(pokemon,target); + SendMuzzledEndMessage(pokemon,target); + if (entityInfo->perishSongTurns != 0) { + entityInfo->perishSongTurns = 0; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_8100594); + } + if (entityInfo->exposed) { + entityInfo->exposed = FALSE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrExposedWoreOffMessage); + } + } + + moveSpeed = CalcSpeedStage(target); + for(index = 0; index < NUM_SPEED_COUNTERS; index++) + { + entityInfo->speedDownCounters[index] = 0; + } + + if (moveSpeed != CalcSpeedStage(target)) { + bVar8 = TRUE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[entityInfo->speedStage]); + } + + for(index = 0; index < MAX_MON_MOVES; index++) + { + move = &entityInfo->moves.moves[index]; + if ((move->moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags2 & MOVE_FLAG_EXISTS)) { + bVar8 = TRUE; + moveUnsealed = TRUE; + move->moveFlags2 &= ~(MOVE_FLAG_EXISTS); + } + } + + if (bVar8) { + if (param_3 != 0) { + sub_80420C8(target); + } + if (moveUnsealed) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrSealedMoveReleasedMessage); + } + } + else if (param_4 == 0) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_81004E8); + } + EntityUpdateStatusSprites(target); + } +} + +void sub_807A0CC(Entity * pokemon, Entity * target) +{ + Move *move; + EntityInfo *entityInfo; + s32 index; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + ResetMonEntityData(entityInfo,0); + entityInfo->perishSongTurns = 0; + entityInfo->exposed = FALSE; + + for(index = 0; index < MAX_MON_MOVES; index++) + { + move = &entityInfo->moves.moves[index]; + if ((move->moveFlags & MOVE_FLAG_EXISTS)) { + move->moveFlags2 &= ~(MOVE_FLAG_EXISTS); + } + } + EntityUpdateStatusSprites(target); + }; +} + +void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4) +{ + EntityInfo *entityInfo; + bool8 isAsleep; + + isAsleep = FALSE; + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->sleepClassStatus.status) { + case STATUS_NONE: + case 6: + break; + case STATUS_SLEEP: + isAsleep = TRUE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA6E8); + break; + case STATUS_SLEEPLESS: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA708); + break; + case STATUS_NIGHTMARE: + isAsleep = TRUE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA70C); + if (param_4) { + DealDamageToEntity(target,gNightmareDmgValue,8,0x20f); + } + break; + case STATUS_NAPPING: + isAsleep = TRUE; + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA710); + HealTargetHP(pokemon,target,gNappingHpHealValue, 0, FALSE); + entityInfo->sleepClassStatus.status = 0; + sub_8079F20(pokemon,target,1,1); + break; + case STATUS_YAWNING: + if (param_3) { + entityInfo->sleepClassStatus.status = STATUS_NONE; + SleepStatusTarget(pokemon,target,CalculateStatusTurns(target, gSleepFromYawnTurnRange, TRUE) + 1, TRUE); + return; + } + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA734); + break; + } + entityInfo->sleepClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); + if (isAsleep) { + sub_806CE68(target,8); + } +} + +void EndBurnClassStatus(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->burnClassStatus.status) { + case STATUS_NONE: + case 5: + break; + case STATUS_POISONED: + case STATUS_BADLY_POISONED: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA8A8); + break; + case STATUS_PARALYSIS: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA868); + break; + case STATUS_BURN: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA888); + break; + + } + entityInfo->burnClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); +} + +void EndFrozenClassStatus(Entity * pokemon, Entity *target) +{ + bool8 isFrozen; + EntityInfo *entityInfo; + + isFrozen = FALSE; + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->frozenClassStatus.status) { + case STATUS_NONE: + case 8: + break; + case STATUS_FROZEN: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA8BC); + isFrozen = TRUE; + break; + case STATUS_CONSTRICTION: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA820); + break; + case STATUS_SHADOW_HOLD: + case STATUS_INGRAIN: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA824); + break; + case STATUS_WRAP: + case STATUS_WRAPPED: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA81C); + sub_8076CB4(entityInfo->unk9C); + break; + case STATUS_PETRIFIED: + TryDisplayDungeonLoggableMessage3(pokemon,target, gPtrMonNoLongerPetrifiedMessage); + break; + } + entityInfo->frozenClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); + if (isFrozen) { + sub_8042A74(target); + } +} + +void EndCringeClassStatus(Entity * pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->cringeClassStatus.status) { + case STATUS_NONE: + case 8: + break; + case STATUS_CONFUSED: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA800); + break; + case STATUS_COWERING: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA97C); + break; + case STATUS_TAUNTED: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA9DC); + break; + case STATUS_PAUSED: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAC38); + break; + case STATUS_INFATUATED: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAB90); + break; + case STATUS_ENCORE: + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAAAC); + break; + case STATUS_CRINGE: + TryDisplayDungeonLoggableMessage3(pokemon,target, gPtrMonNoLongerCringingMessage); + break; + } + entityInfo->cringeClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); + CalcSpeedStage(target); +} + +void EndReflectClassStatus(Entity * pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->reflectClassStatus.status) { + case STATUS_NONE: + case 0xF: + break; + case STATUS_REFLECT: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA638); + break; + case STATUS_SAFEGUARD: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA69C); + break; + case STATUS_LIGHT_SCREEN: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA658); + break; + case STATUS_COUNTER: + case STATUS_MINI_COUNTER: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA67C); + break; + case STATUS_MAGIC_COAT: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA6BC); + break; + case STATUS_WISH: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA6D4); + break; + case STATUS_PROTECT: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA9C0); + break; + case STATUS_MIRROR_COAT: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FAA68); + break; + case STATUS_ENDURING: + LogMessageByIdWithPopupCheckUser(target, gPtrMonStoppedEnduringMessage); + break; + case STATUS_MIRROR_MOVE: + LogMessageByIdWithPopupCheckUser(target,gPtrMonMirrorMoveFadedMessage); + break; + case STATUS_CONVERSION2: + LogMessageByIdWithPopupCheckUser(target, gPtrMonConversion2FailedMessage); + break; + case STATUS_VITAL_THROW: + LogMessageByIdWithPopupCheckUser(target, gPtrMonGaveUpVitalThrowMessage); + break; + case STATUS_MIST: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FAB40); + break; + } + entityInfo->reflectClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); +} + +void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus) +{ + u32 uVar3; + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->curseClassStatus.status) { + case STATUS_NONE: + case 4: + break; + case STATUS_CURSED: + if (curseClassStatus != STATUS_CURSED) { + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA7BC); + } + break; + case STATUS_SNATCH: + if (curseClassStatus != STATUS_SNATCH) { + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA7DC); + } + gDungeon->snatchPokemon = NULL; + gDungeon->unk17B3C = 0; + break; + case STATUS_DECOY: + entityInfo->curseClassStatus.status = STATUS_NONE; + uVar3 = sub_806CEBC(target); + sub_806CCB4(target,uVar3); + gDungeon->decoyIsActive = FALSE; + if (curseClassStatus != STATUS_DECOY) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA9A0); + } + break; + } + entityInfo->curseClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); + } +} + +void EndLeechSeedClassStatus(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->leechSeedClassStatus.status) + { + case STATUS_NONE: + break; + case STATUS_LEECH_SEED: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA79C); + break; + case STATUS_DESTINY_BOND: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FAA8C); + break; + } + entityInfo->leechSeedClassStatus.status = STATUS_NONE; + entityInfo->leechSeedClassStatus.unk8 = 0xff; + EntityUpdateStatusSprites(target); + } +} + +void SendMoveEndMessage(Entity * pokemon, Entity * target) +{ + EntityInfo * entityInfo; + + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->sureShotClassStatus.status) { + case STATUS_NONE: + case 5: + break; + case STATUS_SURE_SHOT: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA8E0); + break; + case STATUS_WHIFFER: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA90C); + break; + case STATUS_SET_DAMAGE: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA934); + break; + case STATUS_FOCUS_ENERGY: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA95C); + break; + } + entityInfo->sureShotClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); +} + +void SendTransformEndMessage(Entity * pokemon, Entity *target) +{ + bool8 isInvisible; + EntityInfo *entityInfo; + u32 uVar3; + + isInvisible = FALSE; + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->invisibleClassStatus.status) { + case STATUS_NONE: + case 4: + break; + case STATUS_INVISIBLE: + isInvisible = TRUE; + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FA9F4); + break; + case STATUS_MOBILE: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FABBC); + break; + case STATUS_TRANSFORMED: + entityInfo->apparentID = GetMonsterApparentID(target, entityInfo->id); + target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID); + uVar3 = sub_806CEBC(target); + sub_806CCB4(target,uVar3); + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FAB6C); + break; + } + entityInfo->invisibleClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); + if (isInvisible) { + sub_807EC28(TRUE); + } +} + +void SendEyesightEndMessage(Entity * pokemon,Entity * target) +{ + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->blinkerClassStatus.status) { + case STATUS_NONE: + case 4: + break; + case STATUS_BLINKER: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FAA0C); + break; + case STATUS_CROSS_EYED: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FAA2C); + break; + case STATUS_EYEDROPS: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FAA48); + break; + } + entityInfo->blinkerClassStatus.status = STATUS_NONE; + EntityUpdateStatusSprites(target); + if (entityInfo->isTeamLeader) { + DungeonRunFrameActions(0x31); + sub_8049ED4(); + ShowWholeRevealedDungeonMap(); + } +} + +void SendMuzzledEndMessage(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) { + return; + } + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + switch(entityInfo->muzzled.muzzled) { + case FALSE: + case 2: + break; + case TRUE: + LogMessageByIdWithPopupCheckUser(target,gUnknown_80FABC0); + break; + } + entityInfo->muzzled.muzzled = FALSE; + EntityUpdateStatusSprites(target); +} + +bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target) +{ + EntityInfo *entityInfo = GetEntInfo(target); + bool32 msg = FALSE; + + if (entityInfo->frozenClassStatus.status == STATUS_PETRIFIED) { + EndFrozenClassStatus(pokemon, target); + msg = TRUE; + } + if (entityInfo->sleepClassStatus.status == STATUS_SLEEP && entityInfo->sleepClassStatus.turns == 0x7f) { + EndSleepClassStatus(pokemon,target, FALSE, TRUE); + msg = TRUE; + } + return msg; +} + +void WakeUpPokemon(Entity * pokemon) +{ + EntityInfo *entityInfo; + + entityInfo = GetEntInfo(pokemon); + entityInfo->sleepClassStatus.status = STATUS_NONE; + entityInfo->sleepClassStatus.turns = 0; + sub_806A898(pokemon, 1, 1); + EntityUpdateStatusSprites(pokemon); +} + +void SendThawedMessage(Entity *pokemon, Entity *target) +{ + EntityInfo *entityInfo; + + if (EntityIsValid(target)) { + entityInfo = GetEntInfo(target); + if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) { + entityInfo->frozenClassStatus.status = STATUS_NONE; + entityInfo->frozenClassStatus.turns = 0; + entityInfo->frozenClassStatus.damageCountdown = 0; + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA8BC); // $m0 thawed out! + EntityUpdateStatusSprites(target); + } + } +} + diff --git a/src/one_room_orb.c b/src/one_room_orb.c new file mode 100644 index 000000000..264d95f33 --- /dev/null +++ b/src/one_room_orb.c @@ -0,0 +1,149 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +void HandleOneRoomOrb(Entity *pokemon, Entity *target) +{ + bool8 bVar1; + Tile *tile; + s32 y; + Entity *entity; + s32 x; + s32 index; + bool8 isMonsterHouse; + + if (gDungeon->forceMonsterHouse != 0) { + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD3C8); + return; + } + + if (gDungeon->unk3A0B != 0) { + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD3CC); + return; + } + + if (IsBossFight()) { + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD3D0); + return; + } + isMonsterHouse = FALSE; + + for(x = 1; x < DUNGEON_MAX_SIZE_X - 1; x++) + { + for(y = 1; y < DUNGEON_MAX_SIZE_Y - 1; y++) + { + bVar1 = 0; + tile = GetTileMut(x,y); + tile->terrainType &= ~(TERRAIN_TYPE_UNK_x400); + tile->room = 0; + if ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) + { + if((tile->terrainType & TERRAIN_TYPE_UNBREAKABLE) == 0) { + tile->spawnOrVisibilityFlags |= SPAWN_FLAG_STAIRS | SPAWN_FLAG_ITEM; + tile->terrainType &= ~(TERRAIN_TYPE_NATURAL_JUNCTION); + if ((tile->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) { + isMonsterHouse = TRUE; + } + if (GetTerrainType(tile) != TERRAIN_TYPE_SECONDARY) + if((GetTerrainType(tile) != (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) { + if (((x == 1) || (((y == 1 || (x == DUNGEON_MAX_SIZE_X - 2)) || (y == DUNGEON_MAX_SIZE_Y - 2)))) && + ((tile->object == NULL && (gDungeon->unk644.unk2C == 0)))) { + bVar1 = TRUE; + } + if (bVar1) { + SetTerrainSecondary(tile); + } + else { + if (GetTerrainType(tile) == TERRAIN_TYPE_NORMAL) continue; + SetTerrainNormal(tile); + tile->terrainType |= TERRAIN_TYPE_UNK_x400; + } + } + } + } + } + } + + + if (StairsAlwaysReachable(gDungeon->stairsSpawn.x,gDungeon->stairsSpawn.y,TRUE)) { + for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) + { + for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) + { + tile = GetTileMut(x,y); + if (!(tile->terrainType & TERRAIN_TYPE_UNBREAKABLE)) + if(((tile->terrainType & (TERRAIN_TYPE_UNREACHABLE_FROM_STAIRS| TERRAIN_TYPE_UNK_x400)) == (TERRAIN_TYPE_UNREACHABLE_FROM_STAIRS| TERRAIN_TYPE_UNK_x400))) { + SetTerrainSecondary(tile); + } + } + } + } + if (isMonsterHouse) { + gDungeon->monsterHouseRoom = FALSE; + } + for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) + { + + for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) + { + if (isMonsterHouse) { + GetTileMut(x,y)->terrainType |= TERRAIN_TYPE_IN_MONSTER_HOUSE; + } + sub_8049BB0(x,y); + } + } + + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) + { + entity = gDungeon->activePokemon[index]; + if (EntityIsValid(entity)) { + entity->room = GetTile(entity->pos.x,entity->pos.y)->room; + } + } + sub_804EB30(); + sub_804AAD4(); + sub_8049884(); + sub_806CF60(); + ShowWholeRevealedDungeonMap(); + sub_8049ED4(); + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD3A0); + sub_803E708(0x28,0x2b); + sub_8075900(pokemon,1); + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) + { + entity = gDungeon->activePokemon[index]; + if (EntityIsValid(entity)) { + sub_806A5B8(entity); + if ((EntityIsValid(entity)) && (sub_80706A4(entity,&entity->pos))) { + WarpTarget(entity,entity,0,0); + } + } + } + gDungeon->forceMonsterHouse = TRUE; + sub_803E708(0x14,0x2b); +} diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 9c5f6142e..0e9450850 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -21,6 +21,7 @@ #include "strings.h" #include "text_1.h" #include "text_util.h" +#include "dungeon_data.h" struct UnusedOffenseStruct { @@ -50,11 +51,6 @@ extern u8 gUnknown_810778C[]; extern u8 gUnknown_8107790[]; extern u8 gUnknown_8107798[]; -// 2, 4, 6, 7, 8, 9, 8, 0xA, 0xD, 0xF, 0x11 -extern s32 gUnknown_810AC90[10]; - -#include "data/pokemon_3.h" - extern void WriteDungeonLocationBits(DataSerializer*, DungeonLocation*); extern void WritePoke1LevelBits(DataSerializer*, struct unkPokeSubStruct_C*); void ReadDungeonLocationBits(DataSerializer*, DungeonLocation*); diff --git a/src/pounce_orb.c b/src/pounce_orb.c new file mode 100644 index 000000000..c3ee387d8 --- /dev/null +++ b/src/pounce_orb.c @@ -0,0 +1,90 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +extern u8 sub_8045888(Entity *); +extern void sub_807EC28(u32); + +void HandlePounceOrbAction(Entity *pokemon, Entity *target, u8 r2) +{ + EntityInfo *info; + const Tile *tile; + DungeonPos pos; + u32 direction = r2; + info = GetEntInfo(target); + if(AbilityIsActive(target, ABILITY_SUCTION_CUPS)) + { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCB98); + return; + } + if(IsCurrentFixedRoomBossFight()) + { + TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC9C0); + return; + } + if(direction == NUM_DIRECTIONS) + direction = info->action.direction; + sub_806CDD4(target, 6, direction); + + + while (1) + { + pos.x = target->pos.x + gAdjacentTileOffsets[direction].x; + pos.y = target->pos.y + gAdjacentTileOffsets[direction].y; + + if(pos.x <= 0 || pos.y <= 0 || pos.x > DUNGEON_MAX_SIZE_X - 2 || pos.y > DUNGEON_MAX_SIZE_Y - 2) break; + + tile = GetTile(pos.x, pos.y); + + if(tile->monster) break; + if(GetTerrainType(tile) == TERRAIN_TYPE_WALL) break; + + sub_80694C0(target, pos.x, pos.y, 0); + + sub_804535C(target, 0); + if(!sub_8045888(target)) continue; + DungeonRunFrameActions(0x3A); + } + + sub_806A5B8(target); + if(sub_80706A4(target, &target->pos)) + WarpTarget(target, target, 0, 0); + if(EntityIsValid(target)) + { + sub_806CE68(target, 8); + if(info->isTeamLeader) + { + sub_804AC20(&target->pos); + sub_807EC28(0); + } + sub_806A5B8(target); + + sub_8075900(target, gDungeon->forceMonsterHouse); + } +} diff --git a/src/code_8042B34.c b/src/run_dungeon.c similarity index 83% rename from src/code_8042B34.c rename to src/run_dungeon.c index 561a67977..e8ae65257 100644 --- a/src/code_8042B34.c +++ b/src/run_dungeon.c @@ -1,10 +1,11 @@ #include "global.h" +#include "globaldata.h" +#include "run_dungeon.h" #include "constants/dungeon.h" #include "constants/monster.h" #include "constants/trap.h" #include "structs/rgb.h" #include "structs/sprite_oam.h" -#include "structs/str_dungeon_8042F6C.h" #include "bg_control.h" #include "bg_palette_buffer.h" #include "code_800558C.h" @@ -17,7 +18,6 @@ #include "code_803E46C.h" #include "code_803E668.h" #include "code_803E724.h" -#include "code_8042B34.h" #include "code_805D8C8.h" #include "code_8094F88.h" #include "code_8099360.h" @@ -32,229 +32,29 @@ #include "dungeon_map.h" #include "dungeon_map_access.h" #include "dungeon_message.h" +#include "dungeon_message_log.h" #include "dungeon_misc.h" #include "dungeon_music.h" #include "dungeon_random.h" +#include "dungeon_strings.h" #include "dungeon_serializer.h" #include "dungeon_util.h" -#include "dungeon_util_1.h" #include "exclusive_pokemon.h" #include "file_system.h" -#include "memory.h" #include "moves.h" #include "pokemon.h" #include "random.h" #include "sprite.h" #include "text_1.h" #include "text_3.h" -#include "tile_types.h" #include "weather.h" -extern void sub_800F15C(s32); - -struct UnkStruct_203B414 -{ - s32 unk0; - s32 unk4; - s32 unk8; - s32 unkC[16]; - s32 unk4C[16]; - struct DungeonPos unk8C[16]; -}; - -EWRAM_INIT DungeonPos gPlayerDotMapPosition = {100, 100}; -static EWRAM_INIT struct UnkStruct_203B414 *sUnknown_203B414 = NULL; +EWRAM_INIT struct UnkStruct_203B414 *gUnknown_203B414 = NULL; EWRAM_INIT Dungeon *gDungeon = NULL; EWRAM_INIT u8 *gSerializedData_203B41C = NULL; -struct UnkStruct_80F6624 -{ - s16 unk0; - s32 unk4; -}; - -extern const struct UnkStruct_80F6624 gUnknown_80F6624[][3]; - -extern const unkStruct_2039DB0 gUnknown_80F683C; - -void sub_8042B34(s32 a0, s32 a1, s32 a2) -{ - unkStruct_80416E0 spStruct; - unkStruct_2039DB0 stack1C; - s32 i; - s32 r8 = 0; - Entity *leader = xxx_call_GetLeader(); - sUnknown_203B414 = MemoryAlloc(sizeof(*sUnknown_203B414), 7); - - sUnknown_203B414->unk0 = a0; - sUnknown_203B414->unk8 = (a1 + 1) * 4; - sub_800EE5C(gUnknown_80F6624[a0][0].unk0); - sub_800EF64(); - DungeonRunFrameActions(0x46); - sUnknown_203B414->unk4 = a2; - for (i = 0; i < sUnknown_203B414->unk8; i++) { - s32 rnd; - - spStruct.unk0 = gUnknown_80F6624[sUnknown_203B414->unk0][r8].unk0; - spStruct.unk4 = i; - spStruct.dir = 0; - spStruct.x = leader->pixelPos.x / 256; - spStruct.y = leader->pixelPos.y / 256; - - rnd = RandInt(2); - sUnknown_203B414->unk4C[i] = (gUnknown_80F6624[sUnknown_203B414->unk0][r8].unk4 * 2) + rnd; - sUnknown_203B414->unk8C[i].x = RandInt(240) + 152; - sUnknown_203B414->unk8C[i].y = RandInt(8 + (i * 2)) - (((i - (i / 4 * 4)) * 40) - 24); - - spStruct.unk10 = sUnknown_203B414->unk8C[i].x; - spStruct.unk12 = sUnknown_203B414->unk8C[i].y; - spStruct.unk14 = 4; - spStruct.unk18 = 0xFFFF; - stack1C = gUnknown_80F683C; - sUnknown_203B414->unkC[i] = sub_800E890(&spStruct); - - r8++; - if (r8 >= 3 || gUnknown_80F6624[sUnknown_203B414->unk0][r8].unk0 == 0) { - r8 = 0; - } - - sub_800F15C(sub_800ECA4(spStruct.unk0)->effectId); - } -} - -bool8 sub_8042CC0(void) -{ - s32 i; - bool8 ret = FALSE; - - if (sUnknown_203B414->unk4 != 0) { - ret = TRUE; - sUnknown_203B414->unk4--; - } - - for (i = 0; i < sUnknown_203B414->unk8; i++) { - sUnknown_203B414->unk8C[i].x -= sUnknown_203B414->unk4C[i]; - if (sUnknown_203B414->unk8C[i].x <= -152) { - if (sUnknown_203B414->unk4 > 0) { - sUnknown_203B414->unk8C[i].x = 152; - } - else { - sUnknown_203B414->unk8C[i].x = -152; - } - } - else { - ret = TRUE; - } - sub_800E8AC(sUnknown_203B414->unkC[i], NULL, &sUnknown_203B414->unk8C[i], 0, NULL); - } - - sub_800E90C(&gDungeon->unk181e8.cameraPixelPos); - return ret; -} - -void sub_8042D7C(void) -{ - s32 i; - - if (sUnknown_203B414 == NULL) - return; - - for (i = 0; i < sUnknown_203B414->unk8; i++) { - if (sub_800E9A8(sUnknown_203B414->unkC[i])) { - sub_800DC14(sUnknown_203B414->unkC[i]); - } - } - sub_800DBBC(); - MemoryFree(sUnknown_203B414); - sUnknown_203B414 = NULL; -} - -extern s32 sub_800E6D8(s32); - -// TODO: Figure out if a new file should start here -void sub_8042DD4(s32 a0, Entity *a1, s32 a2) -{ - s32 i; - - for (i = 0; i < 3; i++) { - struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; - if (strPtr->unk0 == -1) { - strPtr->unk0 = a0; - strPtr->unkC = a1; - strPtr->unk4 = a2; - strPtr->unk8 = sub_800E6D8(a0); - return; - } - } -} - -UNUSED bool32 sub_8042E1C(void) -{ - s32 i; - - for (i = 0; i < 3; i++) { - struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; - if (strPtr->unk0 != -1 && sub_800E9A8(strPtr->unk0)) { - return TRUE; - } - } - - return FALSE; -} - -void sub_8042E5C(void) -{ - s32 i; - - for (i = 0; i < 3; i++) { - struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; - if (strPtr->unk0 >= 0 && !sub_800E9A8(strPtr->unk0)) { - strPtr->unk0 = -1; - strPtr->unkC = NULL; - } - } -} - -void sub_8042E98(void) -{ - s32 i; - - for (i = 0; i < 3; i++) { - struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; - strPtr->unk0 = -1; - strPtr->unk4 = 0; - strPtr->unkC = NULL; - } -} - -extern void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, - s32 param_4, s32 param_5); - -void sub_8042EC8(Entity *a0, s32 a1) -{ - s32 i; - - for (i = 0; i < 3; i++) { - struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; - if (strPtr->unk0 >= 0 && strPtr->unkC == a0) { - DungeonPos sp8 = {a0->pixelPos.x / 256, a0->pixelPos.y / 256}; - DungeonPos sp4 = {0}; - EntityInfo *entInfo = GetEntInfo(a0); - - if (strPtr->unk8 != -1) { - sub_800569C(&sp4, - &a0->axObj, - strPtr->unk8); - } - - sub_800EB24(strPtr->unk0, &sp8, &sp4,a1, entInfo->action.direction); - } - } -} - extern u8 gUnknown_203B40C; - extern void sub_8040094(u8 r0); extern void sub_8068BDC(u8 r0); extern s16 GetTurnLimit(u8 dungeon); @@ -311,6 +111,7 @@ extern void sub_807FA18(void); extern void sub_806A974(void); extern void sub_806CF60(void); extern void sub_8068F80(void); +extern void sub_8042E98(void); extern bool8 sub_8044B28(void); extern bool8 sub_8043ED0(bool8); extern void sub_806A914(bool8 a0, bool8 a1, bool8 showRunAwayEffect); @@ -329,20 +130,14 @@ void EnforceMaxItemsAndMoney(void); static void sub_8043FD0(void); void sub_806B404(void); u8 GetFloorType(void); - -extern const u8 *gUnknown_80FEC48; -extern const u8 *gUnknown_80FEC7C; -extern const u8 *gUnknown_81002B8; -extern const u8 *gPtrFinalChanceMessage; -extern const u8 *gPtrClientFaintedMessage; -extern const u8 *const gUnknown_80F89B4; -extern const u8 *const gUnknown_80F89D4; -extern const u8 *const gUnknown_80F89D8; - -extern const s16 gUnknown_80F6850[4]; +u8 GetFloorType(void); extern OpenedFile *gDungeonNameBannerPalette; +// These functions are not part of dungeon's overlay5 and connect, in a way, overworld with dungeon. + +static const s16 sDeoxysForms[4] = {MONSTER_DEOXYS_NORMAL, MONSTER_DEOXYS_ATTACK, MONSTER_DEOXYS_DEFENSE, MONSTER_DEOXYS_SPEED}; + // This functions is the main 'loop' when the player is in a Dungeon. It runs from the moment the player enters a dungeon, until they leave(by completing or by fainting). // arm9.bin::0206A848 void RunDungeon_Async(UnkStruct_RunDungeon *r8) @@ -502,10 +297,10 @@ void RunDungeon_Async(UnkStruct_RunDungeon *r8) s32 rnd; gDungeon->decoyIsActive = FALSE; - rnd = DungeonRandInt(4); + rnd = DungeonRandInt(ARRAY_COUNT(sDeoxysForms)); gDungeon->unk37FD = 0; gDungeon->deoxysDefeat = FALSE; - gDungeon->deoxysForm = gUnknown_80F6850[rnd]; + gDungeon->deoxysForm = sDeoxysForms[rnd]; gDungeon->unk37FF = 0; gDungeon->unk644.unk31 = 0; } @@ -1141,3 +936,29 @@ void EnforceMaxItemsAndMoney(void) gTeamInventoryRef->teamMoney = 0; } } + +bool8 IsBossFight(void) +{ + if (gDungeon->fixedRoomNumber != 0 && gDungeon->fixedRoomNumber <= 0x31) + { + return TRUE; + } + return FALSE; +} + +bool8 IsCurrentFixedRoomBossFight(void) +{ + if (gDungeon->tileset > DUNGEON_OUT_ON_RESCUE) + { + return TRUE; + } + return FALSE; +} + +bool8 IsMakuhitaTrainingMaze(void) +{ + if (DUNGEON_IS_MAZE(gDungeon->unk644.dungeonLocation.id)) + return TRUE; + else + return FALSE; +} diff --git a/src/status_checks.c b/src/status_checks.c index 27f51831e..783c83a04 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -1,8 +1,8 @@ #include "global.h" +#include "globaldata.h" #include "status_checks.h" #include "dungeon_util.h" -#include "charge_move.h" -#include "code_8045A00.h" +#include "dungeon_move_util.h" #include "dungeon_message.h" #include "code_8077274_1.h" #include "constants/direction.h" @@ -10,8 +10,8 @@ #include "constants/status.h" #include "dungeon_action.h" #include "dungeon_ai_attack.h" -#include "dungeon_capabilities.h" #include "dungeon_random.h" +#include "dungeon_logic.h" extern const char *gPtrFrozenMessage[]; extern const char *gPtrWrappedAroundMessage[]; diff --git a/src/status_checks_1.c b/src/status_checks_1.c deleted file mode 100644 index 7628f487a..000000000 --- a/src/status_checks_1.c +++ /dev/null @@ -1,193 +0,0 @@ -#include "global.h" -#include "status_checks_1.h" - -#include "code_800D090.h" -#include "dungeon_message.h" -#include "constants/ability.h" -#include "constants/iq_skill.h" -#include "constants/status.h" -#include "constants/weather.h" -#include "dungeon_engine.h" -#include "dungeon_items.h" -#include "dungeon_map_access.h" -#include "dungeon_movement.h" -#include "dungeon_pokemon_attributes.h" -#include "dungeon_util.h" -#include "pokemon_mid.h" -#include "pokemon.h" -#include "structs/str_dungeon.h" -#include "weather.h" - -extern void sub_80429B4(Entity *r0); - -extern u8 *gUnknown_80FEE80[]; -extern u8 *gUnknown_80F8974[]; -extern u8 *gUnknown_80F8994[]; -extern u8 *gUnknown_80F8968[]; -extern u8 *gUnknown_80F8988[]; -extern u8 gUnknown_8106FA4[]; - -s32 sub_8070828(Entity *pokemon, bool8 displayMessage) -{ - bool8 flag; - - flag = FALSE; - if (!EntityIsValid(pokemon)) { - return 0; - } - else { - if ((AbilityIsActive(pokemon, ABILITY_SWIFT_SWIM)) && (GetApparentWeather(pokemon) == WEATHER_RAIN)) { - flag = TRUE; - } - if ((AbilityIsActive(pokemon, ABILITY_CHLOROPHYLL)) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { - flag = TRUE; - } - if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) { - sub_80429B4(pokemon); - LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FEE80); - } - if (flag) { - return 2; - } - else { - return 1; - } - } -} - -void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) -{ - if (((gDungeon->unk181e8.blinded || - gDungeon->unk181e8.hallucinating) || - (param_2->invisibleClassStatus.status == STATUS_INVISIBLE)) && - (param_2->isNotTeamMember)) - { - strcpy(buffer, *gUnknown_80F8988); - } - else - { - if (param_2->curseClassStatus.status == STATUS_DECOY) { - strcpy(buffer, *gUnknown_80F8968); - } - else - { - if (param_2->isNotTeamMember) { - if ((param_2->joinedAt.id == 0x4A) || (param_2->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { - CopyYellowMonsterNametoBuffer(buffer, param_2->apparentID); - } - else - CopyCyanMonsterNametoBuffer(buffer, param_2->apparentID); - } - else - { - sub_808D9DC(buffer, &gRecruitedPokemonRef->pokemon2[param_2->teamIndex],colorNum); - } - } - } -} - -void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum) -{ - if (entityInfo->curseClassStatus.status == STATUS_DECOY) { - sprintfStatic(buffer, gUnknown_8106FA4, colorNum + 0x30, *gUnknown_80F8974); - } - else if (entityInfo->isNotTeamMember) { - CopyCyanMonsterNametoBuffer(buffer, entityInfo->apparentID); - } - else { - sub_808D9DC(buffer, &gRecruitedPokemonRef->pokemon2[entityInfo->teamIndex], colorNum); - } -} - -void sub_80709C8(u8 *buffer, EntityInfo *entityInfo) -{ - if (((gDungeon->unk181e8.blinded || - gDungeon->unk181e8.hallucinating) || - (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE)) && - (entityInfo->isNotTeamMember)) - { - strcpy(buffer, *gUnknown_80F8994); - } - else - { - if (entityInfo->curseClassStatus.status == STATUS_DECOY) { - strcpy(buffer, *gUnknown_80F8974); - } - else - { - if (entityInfo->isNotTeamMember) { - CopyMonsterNameToBuffer(buffer, entityInfo->apparentID); - } - else - { - sub_808DA0C(buffer, &gRecruitedPokemonRef->pokemon2[entityInfo->teamIndex]); - } - } - } -} - -bool8 HasNegativeStatus(Entity *pokemon) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - s32 i; - if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || - pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE || - pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || - pokemonInfo->burnClassStatus.status != STATUS_NONE || - (pokemonInfo->frozenClassStatus.status != STATUS_INGRAIN && pokemonInfo->frozenClassStatus.status != STATUS_NONE) || - pokemonInfo->cringeClassStatus.status != STATUS_NONE || - pokemonInfo->curseClassStatus.status == STATUS_CURSED || - pokemonInfo->curseClassStatus.status == STATUS_DECOY || - pokemonInfo->leechSeedClassStatus.status == STATUS_LEECH_SEED || - pokemonInfo->sureShotClassStatus.status == STATUS_WHIFFER || - pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER || - pokemonInfo->blinkerClassStatus.status == STATUS_CROSS_EYED || - pokemonInfo->muzzled.muzzled == TRUE || - pokemonInfo->exposed || - pokemonInfo->perishSongTurns != 0) - { - return TRUE; - } - for (i = 0; i < MAX_MON_MOVES; i++) - { - Move *moves = pokemonInfo->moves.moves; - if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags2 & MOVE_FLAG_SEALED) - { - return TRUE; - } - } - for (i = 0; i < NUM_SPEED_COUNTERS; i++) - { - if (pokemonInfo->speedDownCounters[i] != 0) - { - return TRUE; - } - } - return FALSE; -} - -bool8 IsSleeping(Entity *pokemon) -{ - if (GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_SLEEP && - GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NAPPING && - GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NIGHTMARE) - { - return FALSE; - } - return TRUE; -} - -bool8 HasLowHealth(Entity *pokemon) -{ - EntityInfo *pokemonInfo = GetEntInfo(pokemon); - s32 maxHPStat = pokemonInfo->maxHPStat; - if (maxHPStat < 0) - { - maxHPStat += 3; - } - if (pokemonInfo->HP <= maxHPStat >> 2) - { - return TRUE; - } - return FALSE; -} diff --git a/src/switcher_orb.c b/src/switcher_orb.c new file mode 100644 index 000000000..fa799511e --- /dev/null +++ b/src/switcher_orb.c @@ -0,0 +1,80 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +extern void sub_807EC28(bool8); +extern void nullsub_93(DungeonPos *); + +void HandleSwitcherOrb(Entity *pokemon,Entity *target) +{ + DungeonPos pokemonPos; + DungeonPos targetPos; + + + if (AbilityIsActive(pokemon, ABILITY_SUCTION_CUPS)) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCAC0); // $m0 is anchored! It won't switch places + } + else if(AbilityIsActive(target, ABILITY_SUCTION_CUPS)) + { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCAC0); // $m0 is anchored! It won't switch places + } + else + { + pokemonPos.x = pokemon->pos.x; + pokemonPos.y = pokemon->pos.y; + targetPos.x = target->pos.x; + targetPos.y = target->pos.y; + nullsub_93(&pokemonPos); + nullsub_93(&targetPos); + sub_80694C0(pokemon,targetPos.x,targetPos.y,1); + sub_80694C0(target,pokemonPos.x,pokemonPos.y,1); + sub_804535C(pokemon,NULL); + sub_804535C(target,NULL); + + if (EntityIsValid(pokemon)) { + if (GetEntInfo(pokemon)->isTeamLeader) { + sub_804AC20(&pokemon->pos); + sub_807EC28(FALSE); + } + sub_806A5B8(pokemon); + sub_8075900(pokemon,gDungeon->forceMonsterHouse); + } + + if (EntityIsValid(target)) { + if (GetEntInfo(target)->isTeamLeader) { + sub_804AC20(&target->pos); + sub_807EC28(FALSE); + } + sub_806A5B8(target); + sub_8075900(target,gDungeon->forceMonsterHouse); + } + } +} + diff --git a/src/targeting_flags.c b/src/targeting_flags.c deleted file mode 100644 index e55617ecf..000000000 --- a/src/targeting_flags.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "global.h" -#include "targeting_flags.h" - -#include "constants/move_id.h" -#include "constants/type.h" -#include "dungeon_pokemon_attributes.h" -#include "moves.h" - -s16 GetMoveTargetAndRangeForPokemon(Entity *pokemon, Move *move, bool32 isAI) -{ - if (move->id == MOVE_CURSE && !isAI && !MonsterIsType(pokemon, TYPE_GHOST)) - { - return TARGETING_FLAG_BOOST_SELF | TARGETING_FLAG_TARGET_SELF; - } - return GetMoveTargetAndRange(move, isAI); -} diff --git a/src/text_util.c b/src/text_util.c index 3a06bd797..e31e86eac 100644 --- a/src/text_util.c +++ b/src/text_util.c @@ -1,9 +1,7 @@ #include "global.h" #include "text_util.h" #include "strings.h" - -extern u8 gIsTypePhysicalTable[]; -extern u8 gUnknown_810AC6A[]; +#include "dungeon_data.h" extern u32 gUnknown_810983C[26]; // TODO: verify size later @@ -87,7 +85,7 @@ u8 IsTypePhysical(u8 index) u8 sub_8092364(u8 index) { - return gUnknown_810AC6A[index]; + return gBestResistTypeTable[index]; } void CopyAbilityNametoBuffer(char *buffer, u8 index) diff --git a/src/tile_types.c b/src/tile_types.c deleted file mode 100644 index de3da2c1c..000000000 --- a/src/tile_types.c +++ /dev/null @@ -1,246 +0,0 @@ -#include "global.h" -#include "tile_types.h" -#include "code_806CD90.h" -#include "structs/str_dungeon.h" -#include "dungeon_map.h" -#include "dungeon_map_access.h" -#include "dungeon_util.h" - -const u8 gDungeonWaterType[76] = { - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_WATER, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_WATER, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_LAVA, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_LAVA, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_LAVA, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_LAVA, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, - DUNGEON_WATER_TYPE_NONE, -}; - -extern void sub_8049BB0(s32, s32); -void sub_8042A14(DungeonPos *); - -bool8 PosHasItem(DungeonPos *pos) -{ - const Tile *tile; - Entity *entity; - - tile = GetTile(pos->x,pos->y); - entity = tile->object; - if ((entity != NULL) && (GetEntityType(entity) == ENTITY_ITEM)) { - return TRUE; - } - return FALSE; -} - -Entity *GetMonsterAtPos(DungeonPos *pos) -{ - const Tile *tile; - Entity *entity; - - tile = GetTile(pos->x,pos->y); - entity = tile->monster; - if ((entity != NULL) && (entity->type == ENTITY_MONSTER)) { - return entity; - } - return NULL; -} - -bool8 sub_804AD34(DungeonPos *pos) -{ - Tile *tile; - s32 x; - Entity * entity; - s32 y; - bool8 iVar8; - s32 index; - - iVar8 = 0; - tile = GetTileMut(pos->x,pos->y); - if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) - if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))){ - iVar8 = 1; - tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL; - - for(y = -1; y < 2; y++) - { - for(x = -1; x < 2; x++) - { - sub_80498A8(x + pos->x, y + pos->y); - sub_8049BB0(x + pos->x, y + pos->y); - ShowDungeonMapAtPos(x + pos->x, y + pos->y); - } - } - } - if (iVar8 != 0) { - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) - { - entity = gDungeon->activePokemon[index]; - if (EntityIsValid(entity)) { - sub_806CF98(entity); - } - } - sub_8049ED4(); - sub_8042A14(pos); - } - return iVar8; -} - -bool8 sub_804AE08(DungeonPos *pos) -{ - Tile *tile; - s32 x; - s32 y; - bool8 uVar6; - - uVar6 = FALSE; - tile = GetTileMut(pos->x,pos->y); - - if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) - if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))) { - uVar6 = TRUE; - tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL; - tile->spawnOrVisibilityFlags = tile->spawnOrVisibilityFlags | 0x10; - - for(y = -1; y < 2; y++) - { - for(x = -1; x < 2; x++) - { - sub_8049BB0(x + pos->x, y + pos->y); - } - } - } - return uVar6; -} - -void sub_804AE84(DungeonPos *pos) -{ - Tile *tile; - s32 x; - Entity * entity; - s32 index; - s32 y; - - tile = GetTileMut(pos->x,pos->y); - if ((tile->spawnOrVisibilityFlags & 0x10) != 0) { - tile->spawnOrVisibilityFlags &= 0xffef; - - for(y = -1; y < 2; y++) - { - for(x = -1; x < 2; x++) - { - sub_80498A8(x + pos->x, y + pos->y); - ShowDungeonMapAtPos(x + pos->x, y + pos->y); - } - } - - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) - { - entity = gDungeon->activePokemon[index]; - if (EntityIsValid(entity)) { - sub_806CF98(entity); - } - } - sub_8049ED4(); - sub_8042A14(pos); - } -} - -bool8 IsTileGround(Tile *tile) -{ - bool8 isGround = FALSE; - if (IsWaterTileset()) - { - if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) - { - isGround = TRUE; - } - } - else if ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_SECONDARY || - gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA) - { - isGround = TRUE; - } - return isGround; -} - -bool8 IsWaterTileset() -{ - if (gDungeon->tileset == 0 || - gDungeon->tileset == 0x31 || - gDungeon->tileset == 0x20 || - gDungeon->tileset == 0x21 || - gDungeon->tileset == 0x36) - { - return TRUE; - } - return FALSE; -} diff --git a/src/trap.c b/src/trap.c index c511807fa..5da4a52ba 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,10 +1,9 @@ #include "global.h" +#include "globaldata.h" #include "trap.h" #include "code_803E668.h" #include "code_803E724.h" -#include "code_80450F8.h" #include "code_8041AD0.h" -#include "code_8045A00.h" #include "dungeon_message.h" #include "code_8077274_1.h" #include "code_807CD9C.h" @@ -12,11 +11,11 @@ #include "code_806CD90.h" #include "constants/trap.h" #include "constants/type.h" -#include "dungeon_engine.h" +#include "run_dungeon.h" #include "dungeon_items.h" #include "dungeon_map.h" #include "dungeon_map_access.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_random.h" #include "dungeon_util.h" #include "items.h" @@ -28,35 +27,12 @@ #include "structs/str_806B7F8.h" #include "dungeon_config.h" #include "dungeon_misc.h" - -extern u8 *gTrapNames[]; -extern u8 *gUnknown_80FC5FC[]; -extern u8 *gUnknown_80FC5F8[]; -extern u8 *gUnknown_80FDB5C[]; -extern u8 *gUnknown_80FDB7C[]; -extern u8 *gUnknown_80FD7F4[]; -extern u8 *gUnknown_80FD7F8[]; -extern u8 *gUnknown_80FDC18[]; -extern u8 *gUnknown_80FDC40[]; -extern u8 *gUnknown_80FDC7C[]; -extern u8 *gUnknown_80FD7AC[]; -extern u8 *gUnknown_80FD788[]; -extern u8 *gUnknown_80FD7D4[]; -extern u8 *gUnknown_80F970C[]; -extern u8 *gUnknown_80F9728[]; -extern u8 *gUnknown_80FED00[]; -extern u8 *gUnknown_80FED04[]; -extern u8 *gUnknown_80FED0C[]; -extern u8 *gUnknown_80FDAA0[]; -extern u8 *gUnknown_80FDA80[]; -extern u8 *gUnknown_80FDB04[]; -extern u8 *gUnknown_80FDB2C[]; -extern u8 *gUnknown_80FDAE4[]; -extern u8 *gUnknown_80FDACC[]; -extern u8 *gUnknown_80FED08[]; +#include "dungeon_strings.h" +#include "sprite.h" extern u32 gUnknown_8106A4C; extern u32 gUnknown_8106A50; +extern SpriteOAM gUnknown_202EDC0; s16 sub_803D970(u32); bool8 sub_806AA0C(s32, s32); @@ -73,6 +49,79 @@ u8 sub_803D6FC(void); Entity *sub_8045684(u8, DungeonPos *, u8); extern void HandleExplosion(Entity *pokemon, Entity *target, DungeonPos *pos, u32, u8 moveType, s16); +void sub_807FA18(void) +{ + s32 x, y; + + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { + for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { + Tile *tile = GetTileMut(x, y); + + if (tile->spawnOrVisibilityFlags & SPAWN_FLAG_TRAP) { + s32 trapId; + DungeonPos pos = {x, y}; + + if (tile->spawnOrVisibilityFlags & SPAWN_FLAG_UNK6) { + trapId = TRAP_WARP_TRAP; + } + else { + trapId = sub_803D6FC(); + } + + if (trapId == TRAP_WONDER_TILE) { + Entity *trap = SpawnTrap(trapId, &pos, 2); + if (trap != NULL) { + tile->object = trap; + trap->isVisible = TRUE; + } + } + else { + Entity *trap = SpawnTrap(trapId, &pos, 0); + if (trap != NULL) { + tile->object = trap; + trap->isVisible = FALSE; + } + } + } + } + } +} + +void sub_807FA9C(void) +{ + s32 x, y; + bool8 showInvisibles = gDungeon->unk181e8.showInvisibleTrapsMonsters; + + for (y = gDungeon->unk181e8.cameraPos.y - 5; y < gDungeon->unk181e8.cameraPos.y + 5; y++) { + for (x = gDungeon->unk181e8.cameraPos.x - 6; x < gDungeon->unk181e8.cameraPos.x + 6; x++) { + bool8 r6 = FALSE; + const Tile *tile = GetTile(x, y); + + if (tile->object != NULL && GetEntityType(tile->object) == ENTITY_TRAP && (tile->object->isVisible || showInvisibles)) { + r6 = TRUE; + } + if (tile->terrainType & TERRAIN_TYPE_STAIRS) { + r6 = TRUE; + } + + if (r6) { + s32 spriteX = (x * 24) - gDungeon->unk181e8.cameraPixelPos.x; + s32 spriteY = (y * 24) - gDungeon->unk181e8.cameraPixelPos.y; + if (spriteX >= -32 && spriteY >= -32 && spriteX <= 272 && spriteY <= 192) { + SpriteSetObjMode(&gUnknown_202EDC0, 0); + SpriteSetY(&gUnknown_202EDC0, spriteY); + SpriteSetX(&gUnknown_202EDC0, spriteX); + SpriteSetPriority(&gUnknown_202EDC0, 3); + SpriteSetPalNum(&gUnknown_202EDC0, 10); + SpriteSetTileNum(&gUnknown_202EDC0, 0x1FC); + + AddSprite(&gUnknown_202EDC0, 0, NULL, NULL); + } + } + } + } +} + void sub_807FC3C(DungeonPos *pos, u32 trapID, u32 param_3) { gDungeon->trapPos.x = pos->x; @@ -158,10 +207,10 @@ bool8 sub_807FD84(Entity *entity) gDungeon->unk13570 = 0; flag = LayTrap(&gDungeon->trapPos,gDungeon->trapID,gDungeon->unk13579); if (flag) { - TryDisplayDungeonLoggableMessage5(entity,&gDungeon->trapPos,*gUnknown_80FC5F8); // A trap was laid! + TryDisplayDungeonLoggableMessage5(entity,&gDungeon->trapPos,gUnknown_80FC5F8); // A trap was laid! } else { - TryDisplayDungeonLoggableMessage5(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(); } @@ -218,7 +267,7 @@ void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4) s32 rand; Trap *trapData; Entity *target; - u8 *text; + const u8 *text; tile = GetTileMut(pos->x,pos->y); entity = tile->object; @@ -241,13 +290,13 @@ void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4) rand = DungeonRandInt(100); text = NULL; if (HasHeldItem(target, ITEM_TRAP_SCARF)) { - text = *gUnknown_80FDB5C; + text = gUnknown_80FDB5C; } if ((flag == TRUE) || (gDungeon->unk181e8.showInvisibleTrapsMonsters != 0)) { - if (rand < 0) text = *gUnknown_80FDB7C; + if (rand < 0) text = gUnknown_80FDB7C; } else if (rand < 0xf) { - text = *gUnknown_80FDB7C; + text = gUnknown_80FDB7C; } if (text != NULL) { if (sub_803F428(pos)) { @@ -264,10 +313,10 @@ void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4) sub_8049ED4(); sub_804225C(pokemon,pos,trapData->id); if (gDungeon->unk181e8.blinded) { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD7F4); + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD7F4); } else { - LogMessageByIdWithPopupCheckUser(pokemon,(gUnknown_80FD7F8)[trapData->id]); + LogMessageByIdWithPopupCheckUser(pokemon,gSteppedOnTrapStrings[trapData->id]); } } if (target != NULL) { @@ -387,7 +436,7 @@ void HandleStickyTrap(Entity *pokemon,Entity *target) info = GetEntInfo(target); if (HasHeldItem(target,0xe)) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC7C); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDC7C); } else { @@ -409,14 +458,14 @@ void HandleStickyTrap(Entity *pokemon,Entity *target) } if (itemCount == 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC40); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDC40); } else { newIndex = DungeonRandInt(itemCount); sub_8045BF8(gFormatBuffer_Items[0], itemStack[newIndex]); itemStack[newIndex]->flags |= ITEM_FLAG_STICKY; sub_80421C0(target, 0x192); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDC18); + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDC18); } } } @@ -503,14 +552,14 @@ void HandleGrimyTrap(Entity *pokemon, Entity *target) } } if (badFoodCount == 1) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD788); // A food item went bad. + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD788); // A food item went bad. } else if (badFoodCount == 0) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD7D4); // Nothing particularly bad happened. + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD7D4); // Nothing particularly bad happened. } else { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD7AC); // Several food items went bad + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD7AC); // Several food items went bad } } } @@ -523,7 +572,7 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) flag = FALSE; if (target != NULL) { if (IsBossFight()) { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED0C); // But nothing happened... + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FED0C); // But nothing happened... } else { @@ -543,16 +592,16 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) gDungeon->unk2 = 2; return; } - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80F9728); + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80F9728); } else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (info->isNotTeamMember) { - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F970C); // $m0 fell into the pitfall! + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80F970C); // $m0 fell into the pitfall! } else { - DisplayDungeonLoggableMessageTrue(pokemon,*gUnknown_80F970C); // $m0 fell into the pitfall! + DisplayDungeonLoggableMessageTrue(pokemon,gUnknown_80F970C); // $m0 fell into the pitfall! } sub_8068FE0(target,0x215,pokemon); } @@ -604,11 +653,11 @@ void HandleSummonTrap(Entity *pokemon,DungeonPos *pos) sub_80421EC(pos,0x194); if (pokemonSummonCount == 0) { _ret: - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED04); + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FED04); } else { - LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED00); + LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FED00); } } } @@ -645,9 +694,9 @@ void HandlePPZeroTrap(Entity *param_1,Entity *param_2) flag = TRUE; } if(flag) - TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDA80); + TryDisplayDungeonLoggableMessage3(param_1,param_2,gUnknown_80FDA80); else - TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDAA0); + TryDisplayDungeonLoggableMessage3(param_1,param_2,gUnknown_80FDAA0); } } @@ -685,9 +734,9 @@ void HandleSealTrap(Entity *param_1,Entity *param_2) flag = TRUE; } if(flag) - TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDB04); + TryDisplayDungeonLoggableMessage3(param_1,param_2,gUnknown_80FDB04); else - TryDisplayDungeonLoggableMessage3(param_1,param_2,*gUnknown_80FDB2C); + TryDisplayDungeonLoggableMessage3(param_1,param_2,gUnknown_80FDB2C); } } @@ -711,7 +760,7 @@ void HandlePokemonTrap(Entity *param_1,DungeonPos *pos) s32 range = gDungeon->unk181e8.visibilityRange; if (IsBossFight()) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FED08); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80FED08); return; } @@ -773,10 +822,10 @@ void HandlePokemonTrap(Entity *param_1,DungeonPos *pos) } if (counter != 0) { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FDACC); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80FDACC); } else { - LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FDAE4); + LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80FDAE4); } } diff --git a/src/trawl_orb.c b/src/trawl_orb.c new file mode 100644 index 000000000..29faad793 --- /dev/null +++ b/src/trawl_orb.c @@ -0,0 +1,168 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +extern void sub_807EC28(u32); +extern const DungeonPos gUnknown_80F4468[]; + +void HandleTrawlOrbAction(Entity *user, Entity *target) +{ + Entity itemEntities[25]; + Item itemInfo[25]; + DungeonPos targetTilePos[25]; + PixelPos itemVelocity[25]; + bool8 targetTileUsed[30]; + s32 i; + s32 itemsCount; + bool8 hasTrawled; + bool8 hallucinating; + Entity *currItemEntity; + + hasTrawled = FALSE; + itemsCount = 0; + currItemEntity = &itemEntities[0]; + + for (i = 0; i < gDungeon->numItems; i++) { + Entity *dungeonItem = gDungeon->items[i]; + if (EntityIsValid(dungeonItem)) { + if (itemsCount >= 25) + break; + + if ((abs(dungeonItem->pos.x - user->pos.x) > 2 || abs(dungeonItem->pos.y - user->pos.y) > 2) + && GetTerrainType(GetTile(dungeonItem->pos.x, dungeonItem->pos.y)) != TERRAIN_TYPE_WALL) + { + currItemEntity->type = ENTITY_ITEM; + currItemEntity->axObj.info.item = &itemInfo[itemsCount]; + currItemEntity->pos = dungeonItem->pos; + SetEntityPixelPos(currItemEntity, (dungeonItem->pos.x * 24 + 4) * 256, (dungeonItem->pos.y * 24 + 4) * 256); + currItemEntity->spawnGenID = 0; + currItemEntity->isVisible = TRUE; + currItemEntity->unk22 = 0; + currItemEntity->unk1C = IntToF248_2(0); + itemInfo[itemsCount] = gDungeon->unk3804[i]; + currItemEntity++; + itemsCount++; + } + } + } + + if (itemsCount == 0) { + LogMessageByIdWithPopupCheckUser(user, gUnknown_80FE034); + } + else { + s32 var; + s32 i; + s32 unkAngle; + s32 animFrame; + + for (i = 0; i < 30; i++) { + targetTileUsed[i] = FALSE; + } + for (i = 0; i < itemsCount; i++) { + s32 j = 0; + bool8 foundTile = FALSE; + DungeonPos pos; + + pos.x = user->pos.x; + pos.y = user->pos.y; + + for (j = 0; j < 30; j++) { + if (gUnknown_80F4468[j].x == 99) + break; + if (!targetTileUsed[j]) { + const Tile *tile; + + pos.x = user->pos.x + gUnknown_80F4468[j].x; + pos.y = user->pos.y + gUnknown_80F4468[j].y; + + tile = GetTile(pos.x, pos.y); + if (GetTerrainType(tile) == TERRAIN_TYPE_NORMAL && !(tile->terrainType & TERRAIN_TYPE_STAIRS) && tile->object == NULL) { + targetTilePos[i] = pos; + targetTileUsed[j] = TRUE; + foundTile = TRUE; + break; + } + } + } + + if (!foundTile) { + itemEntities[i].type = ENTITY_NOTHING; + targetTilePos[i].x = -1; + targetTilePos[i].y = -1; + } + } + + for (i = 0; i < itemsCount; i++) { + if (EntityIsValid(&itemEntities[i])) { + RemoveItemFromDungeonAt(&itemEntities[i].pos, 1); + ShowDungeonMapAtPos(itemEntities[i].pos.x, itemEntities[i].pos.y); + itemVelocity[i].x = (((targetTilePos[i].x * 24 + 4) * 256) - itemEntities[i].pixelPos.x) / 60; + itemVelocity[i].y = (((targetTilePos[i].y * 24 + 4) * 256) - itemEntities[i].pixelPos.y) / 60; + } + } + + sub_80421C0(user, 0x1A2); + + var = 0; + hallucinating = gDungeon->unk181e8.hallucinating; + unkAngle = 0; + for (animFrame = 0; animFrame < 60; animFrame++) { + for (i = 0; i < itemsCount; i++) { + if (EntityIsValid(&itemEntities[i])) { + IncreaseEntityPixelPos(&itemEntities[i], itemVelocity[i].x, itemVelocity[i].y); + itemEntities[i].unk1C.raw = sin_4096(unkAngle) * 0xC; + sub_80462AC(&itemEntities[i], hallucinating, 0, var, 0); + } + } + + DungeonRunFrameActions(0x13); + unkAngle += 0x22; + if (!(animFrame & 3)) { + var++; + } + var &= 7; + } + + for (i = 0; i < itemsCount; i++) { + if (targetTilePos[i].x >= 0) { + AddItemToDungeonAt(&targetTilePos[i], GetItemData(&itemEntities[i]), 1); + ShowDungeonMapAtPos(targetTilePos[i].x, targetTilePos[i].y); + hasTrawled = TRUE; + } + } + + if (hasTrawled) { + LogMessageByIdWithPopupCheckUser(user, gUnknown_80FE060); + } + else { + LogMessageByIdWithPopupCheckUser(user, gUnknown_80FE034); + } + sub_807EC28(1); + } +} + diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index e43b46c60..f3a88d6de 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -5,399 +5,12 @@ #include "constants/weather.h" #include "structs/str_dungeon.h" #include "dungeon_message.h" -#include "dungeon_pokemon_attributes.h" +#include "dungeon_logic.h" #include "dungeon_util.h" #include "math.h" #include "status.h" #include "dungeon_config.h" -#include "weather.h" -u32 gUnknown_8106EFC[] = { 0x00, 0x00 }; -s48_16 gUnknown_8106F04 = { 0x0, 0x10000 }; -s48_16 gUnknown_8106F0C = { 0x0, 0x20000 }; -s48_16 gUnknown_8106F14 = { 0x0, 0x18000 }; -s48_16 gUnknown_8106F1C = { 0x0, 0x8000 }; -u8 gUnknown_8106F24[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x01, 0x00 }; -s48_16 gUnknown_8106F3C = {0x0, 0x8000}; -s48_16 gUnknown_8106F44 = {0x0, 0xE666}; -s48_16 gUnknown_8106F4C = {0x0, 0x18000}; -struct dumb_struct -{ - s48_16 *unk0[NUM_EFFECTIVENESS]; -}; - -struct dumb_struct gUnknown_8106F54 = { - &gUnknown_8106F3C, // IMMUNE - &gUnknown_8106F44, // RESIST - &gUnknown_8106F04, // NEUTRAL - &gUnknown_8106F4C, // SUPER -}; - -s48_16 gUnknown_8106F64 = {0x0, 0xC000}; -u32 gTypeEffectivenessMultipliers[] = {0, 1, 2, 4}; - - -struct unkStruct_806D010 -{ - s32 unk0; - u32 unk4; - u32 effectiveness; - u8 unkC; - u8 unkD; - u8 unkE; - u8 unkF; -}; - -extern u8 *gUnknown_80FEDE8[]; -extern u8 *gUnknown_80FEDC8[]; -extern u8 *gUnknown_80FEDA8[]; -extern u8 *gUnknown_80FED88[]; - -void sub_80428D8(Entity *); -void sub_8042978(Entity *); -void sub_804298C(Entity *); -void sub_80428EC(Entity *); - -bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, struct unkStruct_806D010 *param_5) -{ - bool8 torrentFlag; - bool8 overgrowFlag; - bool8 swarmFlag; - bool8 blazeFlag; - bool8 torrentVisualFlag; - bool8 overgrowVisualFlag; - bool8 swarmVisualFlag; - bool8 blazeVisualFlag; - bool8 bVar4; - EntityInfo *targetInfo; - s32 effectiveness; - s32 index; - struct dumb_struct local_48; - s32 local_38 [2]; - s32 hasWonderGuard; - s32 normalOrFightingType; - EntityInfo *pokemonInfo; - u8 weather; - s32 temp; - - bVar4 = FALSE; - normalOrFightingType = FALSE; - pokemonInfo = GetEntInfo(pokemon); - targetInfo = GetEntInfo(target); - FP48_16_FromS32(param_1, 1); - param_5->unkD = 0; - param_5->unkE = 0; - hasWonderGuard = FALSE; - if (!EntityIsValid(target)) { - return TRUE; - } - else { - if ((type == TYPE_NORMAL) || (type == TYPE_FIGHTING)) { - normalOrFightingType = TRUE; - } - if ((AbilityIsActive(target, ABILITY_WONDER_GUARD)) && (type != TYPE_NONE)) { - hasWonderGuard = TRUE; - } - param_5->effectiveness = EFFECTIVENESS_NEUTRAL; - for (index = 0; index < 2; index++) { - local_48 = gUnknown_8106F54; - if (F48_16_IsZero(param_1)) break; - if (((normalOrFightingType) && (targetInfo->types[index] == TYPE_GHOST)) && (targetInfo->exposed == FALSE)) { - effectiveness = EFFECTIVENESS_IMMUNE; - gDungeon->unk134.pokemonExposed = TRUE; - } - else { - effectiveness = gTypeEffectivenessChart[type][targetInfo->types[index]]; - } - if (effectiveness != EFFECTIVENESS_NEUTRAL) { - F48_16_SMul(param_1,param_1,local_48.unk0[effectiveness]); - } - local_38[index] = effectiveness; - gDungeon->unk134.unk13C[index] = effectiveness; - } - - param_5->effectiveness = gEffectivenessChart[local_38[0]][local_38[1]]; - bVar4 = TRUE; - if ((param_5->effectiveness != EFFECTIVENESS_SUPER) && (bVar4 = FALSE, hasWonderGuard)) { - temp = gUnknown_8106EFC[1]; - param_1->hi = gUnknown_8106EFC[0]; - param_1->lo = temp; - } - - if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (AbilityIsActive(target,ABILITY_THICK_FAT))) { - gDungeon->unk134.unk16D = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); - } - if ((type == TYPE_FIRE) && (GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE)) { - gDungeon->unk134.fill16E[0] = TRUE; - FP48_16_FromS32(param_1,0); - param_5->effectiveness = EFFECTIVENESS_IMMUNE; - param_5->unkD = 0; - param_5->unkE = 1; - bVar4 = FALSE; - } - if ((type == TYPE_GROUND) && (AbilityIsActive(target, ABILITY_LEVITATE))) { - gDungeon->unk134.fill16E[1] = TRUE; - FP48_16_FromS32(param_1,0); - param_5->effectiveness = EFFECTIVENESS_IMMUNE; - param_5->unkD = 0; - param_5->unkE = 1; - bVar4 = FALSE; - } - if ((type == TYPE_WATER) && (AbilityIsActive(pokemon, ABILITY_TORRENT))) { - torrentFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; - torrentVisualFlag = SetVisualFlags(pokemonInfo,0x80,torrentFlag); - if (torrentFlag) { - gDungeon->unk134.fill16E[2] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); - } - if (torrentVisualFlag) { - sub_80428EC(pokemon); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDA8); - } - } - if ((type == TYPE_GRASS) && (AbilityIsActive(pokemon, ABILITY_OVERGROW))) { - overgrowFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; - overgrowVisualFlag = SetVisualFlags(pokemonInfo,2,overgrowFlag); - if (overgrowFlag) { - gDungeon->unk134.fill16E[3] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); - } - if (overgrowVisualFlag) { - sub_80428D8(pokemon); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FED88); - } - } - if ((type == TYPE_BUG) && (AbilityIsActive(pokemon, ABILITY_SWARM))) { - swarmFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; - swarmVisualFlag = SetVisualFlags(pokemonInfo,0x10,swarmFlag); - if (swarmFlag) { - gDungeon->unk134.fill16E[4] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); - } - if (swarmVisualFlag) { - sub_8042978(pokemon); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDC8); - } - } - if ((type == TYPE_FIRE) && (AbilityIsActive(pokemon, ABILITY_BLAZE))) { - blazeFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; - blazeVisualFlag = SetVisualFlags(pokemonInfo,0x20,blazeFlag); - if (blazeFlag) { - gDungeon->unk134.fill16E[5] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); - } - if (blazeVisualFlag) { - sub_804298C(pokemon); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDE8); - } - } - if (!(F48_16_IsZero(param_1)) && (MonsterIsType(pokemon, type))) { - gDungeon->unk134.fill16E[6] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F14); - } - weather = GetApparentWeather(pokemon); - if (weather == WEATHER_SUNNY) { - if (type == TYPE_FIRE) { - gDungeon->unk134.unk16C = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F14); - } - else if (type == TYPE_WATER) { - gDungeon->unk134.unk16C = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); - } - } - if (weather == WEATHER_RAIN) { - if (type == TYPE_FIRE) { - gDungeon->unk134.unk16B = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); - } - else if (type == TYPE_WATER) { - gDungeon->unk134.unk16B = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F14); - } - } - if ((weather == WEATHER_CLOUDY) && (type != TYPE_NORMAL)) { - F48_16_SMul(param_1,param_1, &gUnknown_8106F64); - gDungeon->unk134.unk16A = TRUE; - } - if (((gDungeon->weather.mudSportTurns != 0) || (weather == WEATHER_FOG)) && (type == TYPE_ELECTRIC)) { - gDungeon->unk134.fill16E[7] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); - } - if ((gDungeon->weather.waterSportTurns != 0) && (type == TYPE_FIRE)) { - gDungeon->unk134.fill16E[8] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); - } - if ((type == TYPE_ELECTRIC) && (pokemonInfo->bideClassStatus.status == STATUS_CHARGING)) { - gDungeon->unk134.fill16E[9] = TRUE; - F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); - } - } - return bVar4; -} - -s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) -{ - s32 weight = 1; - bool8 checkExposed = FALSE; - EntityInfo *userData; - EntityInfo *targetData; - u8 *targetTypes; - u8 *targetType; - u32 moveTypeOffset; - if (!EntityIsValid(target)) - { - return 1; - } - if (moveType == TYPE_NORMAL || moveType == TYPE_FIGHTING) - { - checkExposed = TRUE; - } - userData = GetEntInfo(user); - targetData = GetEntInfo(target); - if (moveType == TYPE_FIRE && GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE) - { - return 0; - } - if (moveType == TYPE_ELECTRIC && AbilityIsActive(target, ABILITY_VOLT_ABSORB)) - { - return 0; - } - if (moveType == TYPE_WATER && AbilityIsActive(target, ABILITY_WATER_ABSORB)) - { - return 0; - } - if (moveType == TYPE_GROUND && AbilityIsActive(target, ABILITY_LEVITATE)) - { - return 1; - } - targetTypes = targetData->types; - moveTypeOffset = moveType * NUM_TYPES * sizeof(s16); - targetType = targetData->types; - do - { - s32 effectiveness; - u32 typeEffectivenessMultipliers[NUM_EFFECTIVENESS]; - memcpy(typeEffectivenessMultipliers, gTypeEffectivenessMultipliers, NUM_EFFECTIVENESS * sizeof(u32)); - if (checkExposed && *targetType == TYPE_GHOST && !targetData->exposed) - { - effectiveness = 0; - gDungeon->unk134.pokemonExposed = TRUE; - } - else - { - effectiveness = gTypeEffectivenessChart[moveType][*targetType]; - // Used to swap variable initialization order at the loop start. - effectiveness = *(s16*)(((s8*) gTypeEffectivenessChart) + moveTypeOffset + *targetType * 2); - } - if (weight == 0) - { - goto breakLoop; - } - weight *= typeEffectivenessMultipliers[effectiveness]; - weight /= 2; - if (weight == 0) - { - // BUG: If the Pokémon's first type resists the move, the second type is ignored. - // This calculates type effectiveness incorrectly if the first type resists the move and the second type is weak to the move. - // For example, a Fire-type move is considered not very effective against a Rock/Bug-type like Anorith. - return 2; - } - } while ((s32)(++targetType) <= (s32)(targetTypes + 1)); - breakLoop: - if ((moveType == TYPE_FIRE || moveType == TYPE_ICE) && AbilityIsActive(target, ABILITY_THICK_FAT)) - { - return 2; - } - if (moveType == TYPE_WATER && AbilityIsActive(user, ABILITY_TORRENT)) - { - s32 maxHPStat = userData->maxHPStat; - if (maxHPStat < 0) - { - maxHPStat += 3; - } - if (maxHPStat >> 2 >= userData->HP) - { - weight *= 2; - } - } - if (moveType == TYPE_GRASS && AbilityIsActive(user, ABILITY_OVERGROW)) - { - s32 maxHPStat = userData->maxHPStat; - if (maxHPStat < 0) - { - maxHPStat += 3; - } - if (maxHPStat >> 2 >= userData->HP) - { - weight *= 2; - } - } - if (moveType == TYPE_BUG && AbilityIsActive(user, ABILITY_SWARM)) - { - s32 maxHPStat = userData->maxHPStat; - if (maxHPStat < 0) - { - maxHPStat += 3; - } - if (maxHPStat >> 2 >= userData->HP) - { - weight *= 2; - } - } - if (moveType == TYPE_FIRE && AbilityIsActive(user, ABILITY_BLAZE)) - { - s32 maxHPStat = userData->maxHPStat; - if (maxHPStat < 0) - { - maxHPStat += 3; - } - if (maxHPStat >> 2 >= userData->HP) - { - weight *= 2; - } - } - if (weight == 0) - { - return 2; - } - if (MonsterIsType(user, moveType)) - { - weight *= 2; - } - targetTypes = targetData->types; - if (GetApparentWeather(user) == WEATHER_SUNNY) - { - if (moveType == TYPE_FIRE) - { - weight *= 2; - } - else if (moveType == TYPE_WATER) - { - return 2; - } - } - if (gDungeon->weather.mudSportTurns != 0 && moveType == TYPE_ELECTRIC) - { - return 2; - } - if (gDungeon->weather.waterSportTurns != 0 && moveType == TYPE_FIRE) - { - return 2; - } - if (moveType == TYPE_ELECTRIC && userData->bideClassStatus.status == STATUS_CHARGING) - { - weight *= 2; - } - if (weight > 2) - { - weight = 3; - } - return weight + 2; -} diff --git a/src/warp_target.c b/src/warp_target.c new file mode 100644 index 000000000..6f5e08d0b --- /dev/null +++ b/src/warp_target.c @@ -0,0 +1,154 @@ +#include "global.h" +#include "globaldata.h" +#include "constants/ability.h" +#include "constants/weather.h" +#include "code_803E46C.h" +#include "dungeon_message.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "structs/str_dungeon.h" +#include "code_8077274_1.h" +#include "dungeon_ai.h" +#include "run_dungeon.h" +#include "dungeon_generation.h" +#include "dungeon_logic.h" +#include "dungeon_map.h" +#include "dungeon_map_access.h" +#include "dungeon_util.h" +#include "math.h" +#include "move_effects_target.h" +#include "moves.h" +#include "move_util.h" +#include "code_8041AD0.h" +#include "code_803E668.h" +#include "weather.h" +#include "dungeon_config.h" +#include "dungeon_misc.h" +#include "dungeon_items.h" +#include "dungeon_strings.h" + +extern u32 gDungeonFramesCounter; + +void sub_804EB30(); +bool8 ExposeTrap(s32 x, s32 y); +void ShowWholeRevealedDungeonMap(); +void sub_8049ED4(); +void sub_806A5B8(Entity *); +u8 sub_8045888(Entity *); +void sub_807EC28(u32); +u8 sub_8044B28(void); +extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); +void sub_80421AC(Entity * pokemon, Entity * target); +void sub_807BB78(Entity *pokemon); +extern void sub_803F580(u32); +bool8 sub_808384C(DungeonPos *, DungeonPos *); +u8 sub_8083660(DungeonPos *); + +void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) +{ + EntityInfo *info; + u32 direction; + DungeonPos local_2c; + bool8 flag; + + info = GetEntInfo(target); + flag = FALSE; + + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (AbilityIsActive(target,ABILITY_SUCTION_CUPS)) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCAE8); + return; + } + if (IsCurrentFixedRoomBossFight()) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC97C); + return; + } + if (param_3 == 1) + { + DungeonPos stairsPosition = gDungeon->stairsSpawn; + if(stairsPosition.x == target->pos.x && stairsPosition.y == target->pos.y) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC9A0); // It's already on the stairs! + PetrifiedStatusTarget(pokemon,target); + return; + } + } + + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC584); // $m0 warped! + TrySendImmobilizeSleepEndMsg(target,target); + sub_80421AC(pokemon,target); + if (sub_8045888(target)) { + direction = (info->action).direction; + target->unk1C.raw += + 0x800; + while ( target->unk1C.raw < 0xa000) { + if ((gDungeonFramesCounter & 3) == 0) { + direction = (direction + 1) & DIRECTION_MASK; + info->action.direction = direction & DIRECTION_MASK; + sub_806CE68(target,direction); + } + DungeonRunFrameActions(0x22); + target->unk1C.raw += 0x800; + } + } + + + switch(param_3) + { + default: + case 0: + if (!sub_8083660(&local_2c)) { + local_2c = target->pos; + flag = TRUE; + } + break; + case 1: + if (!sub_808384C(&local_2c,&gDungeon->stairsSpawn)) { + local_2c = target->pos; + flag = TRUE; + } + break; + case 2: + if (!sub_808384C(&local_2c,pos)) { + local_2c = target->pos; + flag = TRUE; + } + break; + case 3: + local_2c = *pos; + break; + + } + + sub_80694C0(target,local_2c.x,local_2c.y,1); + sub_804535C(target,0); + sub_807BB78(target); + sub_803F580(1); + if (sub_8045888(target)) { + direction = (info->action).direction; + target->unk1C.raw = 0x9c00; + do { + if ((gDungeonFramesCounter & 3) == 0) { + direction = (direction + 1) & DIRECTION_MASK; + info->action.direction = direction & DIRECTION_MASK; + sub_806CE68(target,direction); + } + DungeonRunFrameActions(0x22); + target->unk1C.raw -= 0x400; + } while (0 < target->unk1C.raw); + } + target->unk1C = IntToF248_2(0); + DungeonRunFrameActions(0x22); + if (flag) { + TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCB14); // But it dropped back at the same spot! + } + if (param_3 == 1) { + PetrifiedStatusTarget(pokemon,target); + } + if (info->isTeamLeader) { + sub_804AC20(&target->pos); + gDungeon->unk1 = 0; + gDungeon->unk5C0 = -1; + sub_807EC28(0); + } + sub_806A5B8(target); + sub_8075900(target,gDungeon->forceMonsterHouse); +} diff --git a/src/weather.c b/src/weather.c index 80069ab39..1e666aedd 100644 --- a/src/weather.c +++ b/src/weather.c @@ -1,16 +1,55 @@ #include "global.h" +#include "globaldata.h" #include "weather.h" - #include "constants/item.h" #include "constants/move_id.h" #include "constants/weather.h" #include "structs/str_dungeon.h" -#include "dungeon_items.h" -#include "dungeon_random.h" +#include "code_804267C.h" +#include "code_803E46C.h" +#include "dungeon.h" +#include "dungeon_config.h" +#include "dungeon_leader.h" +#include "dungeon_music.h" #include "dungeon_util.h" +#include "pokemon.h" +#include "structs/map.h" +#include "dungeon_message.h" +#include "string_format.h" +#include "dungeon_logic.h" +#include "dungeon_map_access.h" +#include "position_util.h" +#include "dungeon_ai.h" +#include "code_806CD90.h" +#include "code_807CD9C.h" +#include "dungeon_random.h" +#include "code_805D8C8.h" +#include "code_803E668.h" +#include "dungeon_items.h" +#include "move_util.h" +#include "moves.h" +#include "math.h" +#include "constants/ability.h" +#include "constants/monster.h" +#include "constants/type.h" +#include "dungeon_misc.h" +#include "code_807E5AC.h" +#include "sprite.h" +#include "dungeon_strings.h" extern void TriggerWeatherAbilities(void); -extern void sub_807EAA0(u32, u32); +extern void sub_804178C(u32); +extern void sub_803E874(bool8 r10, s32 r9); +extern s32 CalculateStatusTurns(Entity *target, const s16 *turnRange, bool8 factorCurerSkills); +extern void sub_80429D8(Entity *r0); +extern void sub_80838EC(u8 *a); + +extern OpenedFile *gUnknown_202ECA0; + +void sub_807E7FC(bool8 arg0); +void sub_807E8F0(Entity *pokemon); +void GetWeatherName(u8 *buffer, u8 weather); +bool8 sub_807EAA0(bool8 arg0, bool8 arg1); u8 GetApparentWeather(Entity *pokemon) { @@ -56,3 +95,232 @@ void sub_807E5E4(u8 weather) gDungeon->colorRamp[index].b = index; } } + +// Note: gUnknown_202ECA0 file's 2d array is read as 1d array in functions below, be careful! +void sub_807E698(bool8 arg0) +{ + s32 i, j; + s32 weatherArrId = GetApparentWeather(NULL) * COLOR_RAMP_COUNT; + RGB *fileData = (void *) gUnknown_202ECA0->data; + u8 savedByte; + + sub_8042818(GetApparentWeather(NULL), arg0); + DungeonRunFrameActions(0x25); + sub_804178C(1); + savedByte = gUnknown_203B40D; + gUnknown_203B40D = 1; + + for (i = 0; i < 64; i++) { + bool8 r7 = FALSE; + + DungeonRunFrameActions(0x25); + for (j = 0; j < COLOR_RAMP_COUNT; j++) { + if (abs(gDungeon->colorRamp[j].r - fileData[weatherArrId + j].r) < 10) { + gDungeon->colorRamp[j].r = fileData[weatherArrId + j].r; + } + else { + r7 = TRUE; + if (gDungeon->colorRamp[j].r < fileData[weatherArrId + j].r) { + gDungeon->colorRamp[j].r += 10; + } + else if (gDungeon->colorRamp[j].r > fileData[weatherArrId + j].r) { + gDungeon->colorRamp[j].r -= 10; + } + } + + if (abs(gDungeon->colorRamp[j].g - fileData[weatherArrId + j].g) < 10) { + gDungeon->colorRamp[j].g = fileData[weatherArrId + j].g; + } + else { + r7 = TRUE; + if (gDungeon->colorRamp[j].g < fileData[weatherArrId + j].g) { + gDungeon->colorRamp[j].g += 10; + } + else if (gDungeon->colorRamp[j].g > fileData[weatherArrId + j].g) { + gDungeon->colorRamp[j].g -= 10; + } + } + + if (abs(gDungeon->colorRamp[j].b - fileData[weatherArrId + j].b) < 10) { + gDungeon->colorRamp[j].b = fileData[weatherArrId + j].b; + } + else { + r7 = TRUE; + if (gDungeon->colorRamp[j].b < fileData[weatherArrId + j].b) { + gDungeon->colorRamp[j].b += 10; + } + else if (gDungeon->colorRamp[j].b > fileData[weatherArrId + j].b) { + gDungeon->colorRamp[j].b -= 10; + } + } + } + + sub_803E874(FALSE, 0); + if (!r7) + break; + } + + gUnknown_203B40D = savedByte; + sub_807E7FC(arg0); +} + +void sub_807E7FC(bool8 r0) +{ + s32 i; + + Entity *cameraTarget = gDungeon->unk181e8.cameraTarget; + if (cameraTarget == NULL) { + cameraTarget = GetLeader(); + } + + if (r0) { + if (gDungeon->unk1356C == 0) { + GetWeatherName(gFormatBuffer_Monsters[0], GetApparentWeather(NULL)); + LogMessageByIdWithPopupCheckUser(cameraTarget, gUnknown_80FC5E0); // Weather: {ARG_POKEMON_0} + } + } + + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + Entity *pokemon = gDungeon->activePokemon[i]; + if (EntityIsValid(pokemon)) { + sub_807E8F0(pokemon); + } + } +} + +void sub_807E88C(void) +{ + s32 i; + s32 weatherArrId = GetApparentWeather(0) * COLOR_RAMP_COUNT; + RGB *fileData = (void *) gUnknown_202ECA0->data; + + for (i = 0; i < COLOR_RAMP_COUNT; i++) { + gDungeon->colorRamp[i].r = fileData[weatherArrId + i].r; + gDungeon->colorRamp[i].g = fileData[weatherArrId + i].g; + gDungeon->colorRamp[i].b = fileData[weatherArrId + i].b; + } + + sub_803E874(0, 0); +} + +void sub_807E8F0(Entity *pokemon) +{ + u8 oldTypes[2]; + bool8 flag = FALSE; + + if (EntityIsValid(pokemon)) { + EntityInfo *info = GetEntInfo(pokemon); + s32 previousApparentId = info->apparentID; + oldTypes[0] = info->types[0]; + oldTypes[1] = info->types[1]; + CalcSpeedStage(pokemon); + if (AbilityIsActive(pokemon, ABILITY_FORECAST)) { + info->types[0] = gCastformByWeather[GetApparentWeather(pokemon)].type; + info->types[1] = TYPE_NONE; + } + else if ((info->reflectClassStatus.status != STATUS_CONVERSION2) && (info->isColorChanged == FALSE)){ + info->types[0] = GetPokemonType(info->id, 0); + info->types[1] = GetPokemonType(info->id, 1); + } + + if ((oldTypes[0] != info->types[0]) || (oldTypes[1] != info->types[1])) { + flag = TRUE; + } + + if (IS_CASTFORM_FORM_MONSTER(info->id) || info->id == MONSTER_CASTFORM) { + if (AbilityIsActive(pokemon, ABILITY_FORECAST)) { + info->apparentID = GetMonsterApparentID(pokemon, info->id); + } + else { + info->apparentID = MONSTER_CASTFORM; + } + if (info->apparentID != previousApparentId) { + pokemon->axObj.spriteFile = GetSpriteData(info->apparentID); + sub_806CCB4(pokemon,sub_806CEBC(pokemon)); + flag = TRUE; + } + } + if (flag) { + sub_80429D8(pokemon); + } + } +} + +void GetWeatherName(u8 *buffer, u8 weather) +{ + strcpy(buffer, gWeatherNames[weather]); +} + +void MudWaterSportEffect(u8 which) +{ + if (which == 0) { + gDungeon->weather.mudSportTurns = CalculateStatusTurns(0, gMudWaterSportTurnRange, FALSE); + LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FAD8C); + } + else { + gDungeon->weather.waterSportTurns =CalculateStatusTurns(0, gMudWaterSportTurnRange, FALSE); + LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FADB0); + } +} + +bool8 sub_807EAA0(bool8 arg0, bool8 arg1) +{ + s32 i; + s32 var = 0; + s32 index = -1; + bool8 ret = FALSE; + s32 weatherBefore = GetApparentWeather(NULL); + + for (i = 0; i < 8; i++) { + if (gDungeon->weather.unkE267[i] < gDungeon->weather.naturalWeather[i]) { + gDungeon->weather.unkE267[i] = gDungeon->weather.naturalWeather[i]; + } + else if (gDungeon->weather.unkE267[i] > gDungeon->weather.naturalWeather[i]) { + sub_80838EC(&gDungeon->weather.unkE267[i]); + } + + if (var < gDungeon->weather.unkE267[i]) { + var = gDungeon->weather.unkE267[i]; + index = i; + } + } + + if (index < 0) { + gDungeon->weather.weather = gDungeon->weather.unkE265; + } + else { + gDungeon->weather.weather = index; + } + + if (gDungeon->weather.nullifyWeather) { + gDungeon->weather.weather = 0; + } + + if (weatherBefore != GetApparentWeather(NULL) || arg1) { + ret = TRUE; + sub_807E698(arg0); + } + + if (gDungeon->weather.weatherDamageCounter != 0) { + gDungeon->weather.weatherDamageCounter--; + } + else { + gDungeon->weather.weatherDamageCounter = 9; + } + + if (gDungeon->weather.mudSportTurns != 0) { + sub_80838EC(&gDungeon->weather.mudSportTurns); + if (gDungeon->weather.mudSportTurns == 0) { + LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FA778); + } + } + if (gDungeon->weather.waterSportTurns != 0) { + sub_80838EC(&gDungeon->weather.waterSportTurns); + if (gDungeon->weather.waterSportTurns == 0) { + LogMessageByIdWithPopupCheckUser(GetLeader(), gUnknown_80FA758); + } + } + + return ret; +} + diff --git a/sym_ewram.txt b/sym_ewram.txt index fc7b31345..7630506ff 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -138,6 +138,7 @@ gUnknown_202EE76: /* 202EE76 (sub_804513C - sub_8082A08) */ .include "src/dungeon_map_access.o" .include "src/dungeon_generation.o" .include "src/dungeon_message.o" + .include "src/dungeon_message_log.o" .include "src/dungeon_move.o" .include "src/dungeon_main.o" .space 0x4 @@ -150,7 +151,8 @@ gUnknown_202EE76: /* 202EE76 (sub_804513C - sub_8082A08) */ .include "src/dungeon_menu_others.o" .include "src/dungeon_menu_recruitment.o" .include "src/code_8066D04.o" - .include "src/dungeon_movement.o" + .include "src/dungeon_8067A80.o" + .include "src/dungeon_logic.o" .include "src/code_80718D8.o" gUnknown_202F32C: /* 202F32C (xxx_dungeon_8042F6C - sub_8072CF4) */ @@ -160,6 +162,7 @@ gUnknown_202F32D: /* 202F32D (sub_8072CF4 - UseAttack) */ .include "src/dungeon_ai_items.o" .include "src/code_8073CF0.o" + .include "src/code_8075708.o" .space 0x4 .include "src/dungeon_ai_attack.o" .include "src/code_80869E4.o" diff --git a/sym_ewram_init.txt b/sym_ewram_init.txt index 5f717cdca..1048a3c5c 100644 --- a/sym_ewram_init.txt +++ b/sym_ewram_init.txt @@ -110,15 +110,17 @@ .include "src/personality_test2.o" .include "src/code_803D0D8.o" .include "src/code_803E46C.o" -.include "src/code_8042B34.o" +.include "src/dungeon_map.o" +.include "src/run_dungeon.o" .include "src/dungeon_items.o" .include "src/dungeon_map_access.o" .include "src/dungeon_message.o" .include "src/dungeon_move.o" +.include "src/dungeon_move_util.o" .include "src/dungeon_main.o" .include "src/dungeon_menu_recruitment.o" .include "src/dungeon_ai_items.o" -.include "src/code_807CD9C.o" +.include "src/explosion.o" .include "src/dungeon_leader.o" .include "src/dungeon_random.o" .include "src/dungeon_music.o"