diff --git a/asm/trainer_card.s b/asm/trainer_card.s deleted file mode 100644 index d0f26e0e1..000000000 --- a/asm/trainer_card.s +++ /dev/null @@ -1,8438 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_80C2690 -sub_80C2690: @ 80C2690 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - bl sub_80C48C8 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080C26C0 - ldr r1, =0x040000d4 - ldr r0, =gScanlineEffectRegBuffers - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_080C26C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2690 - - thumb_func_start sub_80C26D4 -sub_80C26D4: @ 80C26D4 - push {r4,lr} - ldr r4, =0x04000208 - ldrh r3, [r4] - movs r0, 0 - strh r0, [r4] - ldr r1, =gScanlineEffectRegBuffers - ldr r0, =0x04000006 - ldrh r2, [r0] - movs r0, 0xFF - ands r0, r2 - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000012 - strh r1, [r0] - strh r3, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C26D4 - - thumb_func_start sub_80C2710 -sub_80C2710: @ 80C2710 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_80C2710 - - thumb_func_start sub_80C2728 -sub_80C2728: @ 80C2728 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_02039CE8 - ldr r0, [r5] - movs r1, 0xA6 - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - bl SetMainCallback2 - bl FreeAllWindowBuffers - ldr r0, [r5] - bl Free - movs r0, 0 - str r0, [r5] - adds r0, r4, 0 - bl DestroyTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2728 - - thumb_func_start sub_80C2760 -sub_80C2760: @ 80C2760 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gUnknown_02039CE8 - ldr r0, [r1] - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x10 - bls _080C2776 - b _080C2ACA -_080C2776: - lsls r0, 2 - ldr r1, =_080C2788 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2788: - .4byte _080C27CC - .4byte _080C27E2 - .4byte _080C27F0 - .4byte _080C27F8 - .4byte _080C280C - .4byte _080C2820 - .4byte _080C2830 - .4byte _080C2836 - .4byte _080C289C - .4byte _080C28C8 - .4byte _080C28E4 - .4byte _080C299C - .4byte _080C2970 - .4byte _080C2AAA - .4byte _080C2A98 - .4byte _080C2A2C - .4byte _080C2A68 -_080C27CC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _080C27D8 - b _080C2ACA -_080C27D8: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - b _080C28D4 -_080C27E2: - bl sub_80C3438 - lsls r0, 24 - cmp r0, 0 - bne _080C27EE - b _080C2ACA -_080C27EE: - b _080C28D4 -_080C27F0: - movs r0, 0x1 - bl sub_80C438C - b _080C28D4 -_080C27F8: - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - bl sub_80C4FF0 - movs r0, 0x2 - bl sub_80C438C - b _080C28D4 -_080C280C: - ldr r0, [r4] - ldr r1, =0x00000ef8 - adds r0, r1 - bl sub_80C4550 - ldr r1, [r4] - b _080C28D8 - .pool -_080C2820: - ldr r0, [r4] - movs r2, 0xB3 - lsls r2, 3 - adds r0, r2 - bl sub_80C45C0 - ldr r1, [r4] - b _080C28D8 -_080C2830: - bl sub_80C4630 - b _080C28D4 -_080C2836: - ldr r0, =gWirelessCommType - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C2852 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C2852 - bl sub_800E0E8 - movs r0, 0xE6 - movs r1, 0x96 - bl CreateWirelessStatusIndicatorSprite -_080C2852: - movs r6, 0x1 - negs r6, r6 - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - ldr r5, =0x0000052c - adds r0, r5 - ldrh r2, [r0] - adds r0, r6, 0 - movs r1, 0x10 - bl BlendPalettes - ldr r0, [r4] - adds r0, r5 - ldrh r0, [r0] - str r0, [sp] - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_80C2690 - bl SetVBlankCallback - ldr r1, [r4] - b _080C28D8 - .pool -_080C289C: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - beq _080C28A8 - b _080C2ACA -_080C28A8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _080C28B4 - b _080C2ACA -_080C28B4: - movs r0, 0xFB - bl PlaySE - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xA - strb r0, [r1] - b _080C2ACA - .pool -_080C28C8: - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - beq _080C28D4 - b _080C2ACA -_080C28D4: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] -_080C28D8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C2ACA - .pool -_080C28E4: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r5, [r0] - cmp r5, 0 - bne _080C290A - ldr r0, [r4] - ldr r1, =0x00000529 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C290A - bl sub_80C3880 - movs r0, 0x1 - bl sub_80C438C - ldr r0, [r4] - ldr r2, =0x00000529 - adds r0, r2 - strb r5, [r0] -_080C290A: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C293C - bl sub_80C4918 - movs r0, 0xF9 - bl PlaySE - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xC - strb r0, [r1] - b _080C2ACA - .pool -_080C293C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080C2946 - b _080C2ACA -_080C2946: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C2960 - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C2960 - bl InUnionRoom - cmp r0, 0x1 - beq _080C2A14 -_080C2960: - movs r0, 0x1 - negs r0, r0 - ldr r4, =gUnknown_02039CE8 - b _080C2A74 - .pool -_080C2970: - bl sub_80C4940 - lsls r0, 24 - cmp r0, 0 - bne _080C297C - b _080C2ACA -_080C297C: - bl sub_8087598 - cmp r0, 0x1 - bne _080C2986 - b _080C2ACA -_080C2986: - movs r0, 0xFB - bl PlaySE - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xB - strb r0, [r1] - b _080C2ACA - .pool -_080C299C: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C29F4 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C29DC - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C29C0 - bl InUnionRoom - cmp r0, 0x1 - beq _080C2A14 -_080C29C0: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C29DC - movs r0, 0x1 - negs r0, r0 - ldr r4, =gUnknown_02039CE8 - b _080C2A74 - .pool -_080C29DC: - bl sub_80C4918 - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xD - strb r0, [r1] - movs r0, 0xF9 - bl PlaySE - b _080C2ACA - .pool -_080C29F4: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C2ACA - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C2A20 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C2A20 - bl InUnionRoom - cmp r0, 0x1 - bne _080C2A20 -_080C2A14: - ldr r1, [r4] - movs r0, 0xF - strb r0, [r1] - b _080C2ACA - .pool -_080C2A20: - movs r0, 0x1 - negs r0, r0 - ldr r4, =gUnknown_02039CE8 - b _080C2A74 - .pool -_080C2A2C: - bl sub_800AC34 - movs r0, 0 - movs r1, 0x1 - bl NewMenuHelpers_DrawDialogueFrame - ldr r2, =gText_WaitingTrainerFinishReading - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0x10 - strb r0, [r1] - b _080C2ACA - .pool -_080C2A68: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - bne _080C2ACA - movs r0, 0x1 - negs r0, r0 -_080C2A74: - ldr r1, [r4] - ldr r2, =0x0000052c - adds r1, r2 - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, [r4] - movs r0, 0xE - strb r0, [r1] - b _080C2ACA - .pool -_080C2A98: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _080C2ACA - adds r0, r5, 0 - bl sub_80C2728 - b _080C2ACA -_080C2AAA: - bl sub_80C4940 - lsls r0, 24 - cmp r0, 0 - beq _080C2ACA - bl sub_8087598 - cmp r0, 0x1 - beq _080C2ACA - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xA - strb r0, [r1] - movs r0, 0xFB - bl PlaySE -_080C2ACA: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2760 - - thumb_func_start sub_80C2AD8 -sub_80C2AD8: @ 80C2AD8 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - cmp r0, 0x5 - bls _080C2AE6 - b _080C2C64 -_080C2AE6: - lsls r0, 2 - ldr r1, =_080C2AF8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2AF8: - .4byte _080C2B10 - .4byte _080C2B44 - .4byte _080C2B78 - .4byte _080C2BD0 - .4byte _080C2C04 - .4byte _080C2C38 -_080C2B10: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2B34 - ldr r0, =gUnknown_08DD1F78 - ldr r2, =0x00000ef8 - b _080C2C4A - .pool -_080C2B34: - ldr r0, =gUnknown_08DD2AE0 - ldr r2, =0x00000ef8 - b _080C2C4A - .pool -_080C2B44: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2B68 - ldr r0, =gUnknown_08DD21B0 - ldr r2, =0x00000a48 - b _080C2C4A - .pool -_080C2B68: - ldr r0, =gUnknown_08DD2D30 - ldr r2, =0x00000a48 - b _080C2C4A - .pool -_080C2B78: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - bne _080C2BAC - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BA0 - ldr r0, =gUnknown_08DD2010 - adds r2, 0x6E - b _080C2C4A - .pool -_080C2BA0: - ldr r0, =gUnknown_08DD2B78 - movs r2, 0xB3 - lsls r2, 3 - b _080C2C4A - .pool -_080C2BAC: - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BC4 - ldr r0, =gUnknown_08DD228C - adds r2, 0x6E - b _080C2C4A - .pool -_080C2BC4: - ldr r0, =gUnknown_08DD2E5C - movs r2, 0xB3 - lsls r2, 3 - b _080C2C4A - .pool -_080C2BD0: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BF4 - ldr r0, =gUnknown_0856F5CC - ldr r2, =0x000013a8 - b _080C2C4A - .pool -_080C2BF4: - ldr r0, =gUnknown_0856F814 - ldr r2, =0x000013a8 - b _080C2C4A - .pool -_080C2C04: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2C28 - ldr r0, =gEmeraldTrainerCard_Gfx - ldr r2, =0x000019a8 - b _080C2C4A - .pool -_080C2C28: - ldr r0, =gFireRedTrainerCard_Gfx - ldr r2, =0x000019a8 - b _080C2C4A - .pool -_080C2C38: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C2C6C - ldr r0, =gUnknown_0856F018 - ldr r2, =0x000017a8 -_080C2C4A: - adds r1, r2 - bl LZ77UnCompWram - b _080C2C6C - .pool -_080C2C64: - movs r0, 0 - strb r0, [r1, 0x2] - movs r0, 0x1 - b _080C2C78 -_080C2C6C: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - movs r0, 0 -_080C2C78: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C2AD8 - - thumb_func_start sub_80C2C80 -sub_80C2C80: @ 80C2C80 - push {lr} - sub sp, 0x8 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0xA - bls _080C2C96 - b _080C2DD8 -_080C2C96: - lsls r0, 2 - ldr r1, =_080C2CA8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2CA8: - .4byte _080C2CD4 - .4byte _080C2CEC - .4byte _080C2D14 - .4byte _080C2D50 - .4byte _080C2D6A - .4byte _080C2D74 - .4byte _080C2D88 - .4byte _080C2D8E - .4byte _080C2DA0 - .4byte _080C2DA6 - .4byte _080C2DB8 -_080C2CD4: - bl sub_80C334C - bl sub_80C3414 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2CEC: - movs r1, 0xE0 - lsls r1, 19 - movs r0, 0 - str r0, [sp] - ldr r0, =0x040000d4 - mov r2, sp - str r2, [r0] - str r1, [r0, 0x4] - ldr r1, =0x85000100 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - movs r0, 0x87 - lsls r0, 3 - adds r1, r3, r0 - b _080C2DCC - .pool -_080C2D14: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052c - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080C2D36 - movs r2, 0xA0 - lsls r2, 19 - add r1, sp, 0x4 - strh r0, [r1] - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x81000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] -_080C2D36: - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _080C2DCC - .pool -_080C2D50: - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetPaletteFade - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C2D6A: - bl sub_80C3388 - b _080C2DC4 - .pool -_080C2D74: - bl sub_80C41D8 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2D88: - bl sub_80C2AD8 - b _080C2DBC -_080C2D8E: - bl sub_80C4330 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2DA0: - bl sub_80C3278 - b _080C2DC4 -_080C2DA6: - bl sub_80C3548 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2DB8: - bl sub_80C43A8 -_080C2DBC: - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080C2DDC -_080C2DC4: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_080C2DCC: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C2DDC - .pool -_080C2DD8: - bl sub_80C3404 -_080C2DDC: - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_80C2C80 - - thumb_func_start sav12_xor_get_clamped_above -sav12_xor_get_clamped_above: @ 80C2DE4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetGameStat - cmp r0, r4 - bls _080C2DF6 - adds r0, r4, 0 -_080C2DF6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav12_xor_get_clamped_above - - thumb_func_start sub_80C2DFC -sub_80C2DFC: @ 80C2DFC - push {r4,r5,lr} - movs r5, 0 -_080C2E00: - lsls r4, r5, 1 - ldr r1, =0x000008c4 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C2E1E - ldr r1, =0x000008c5 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080C2E2C -_080C2E1E: - movs r0, 0 - b _080C2E38 - .pool -_080C2E2C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C2E00 - movs r0, 0x1 -_080C2E38: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80C2DFC - - thumb_func_start sub_80C2E40 -sub_80C2E40: @ 80C2E40 - push {r4,lr} - movs r0, 0xA - bl GetGameStat - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - bl sub_80C08E4 - lsls r0, 16 - cmp r0, 0 - beq _080C2E5A - adds r4, 0x1 -_080C2E5A: - bl sub_80F8940 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080C2E6C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080C2E6C: - bl sub_80C2DFC - lsls r0, 24 - cmp r0, 0 - beq _080C2E7C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080C2E7C: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C2E40 - - thumb_func_start sub_80C2E84 -sub_80C2E84: @ 80C2E84 - push {lr} - adds r1, r0, 0 - movs r2, 0 - ldrh r0, [r1, 0x6] - cmp r0, 0 - bne _080C2E96 - ldr r0, [r1, 0x8] - cmp r0, 0 - beq _080C2E98 -_080C2E96: - movs r2, 0x1 -_080C2E98: - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _080C2EA4 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EA4: - ldrh r0, [r1, 0x1A] - cmp r0, 0x31 - bls _080C2EB0 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EB0: - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _080C2EBC - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EBC: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80C2E84 - - thumb_func_start sub_80C2EC4 -sub_80C2EC4: @ 80C2EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - ldrb r0, [r1, 0x8] - strb r0, [r5] - ldrh r0, [r1, 0xE] - strh r0, [r5, 0x10] - ldrb r0, [r1, 0x10] - strh r0, [r5, 0x12] - movs r0, 0x1 - bl GetGameStat - adds r4, r0, 0 - movs r0, 0xA - bl GetGameStat - cmp r0, 0 - bne _080C2EF6 - movs r4, 0 -_080C2EF6: - lsrs r0, r4, 16 - strh r0, [r5, 0x6] - lsrs r1, r4, 8 - movs r2, 0xFF - ands r1, r2 - strh r1, [r5, 0x8] - ands r4, r2 - strh r4, [r5, 0xA] - ldr r1, =0x000003e7 - cmp r0, r1 - bls _080C2F14 - strh r1, [r5, 0x6] - movs r0, 0x3B - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] -_080C2F14: - ldr r0, =0x00000861 - bl FlagGet - strb r0, [r5, 0x2] - bl sub_80C08E4 - strb r0, [r5, 0x3] - bl sub_80C376C - strh r0, [r5, 0xC] - ldr r0, [r6] - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - strh r0, [r5, 0xE] - ldr r4, =0x0000270f - movs r0, 0x17 - adds r1, r4, 0 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x14] - movs r0, 0x18 - adds r1, r4, 0 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x16] - ldr r1, =0x0000ffff - movs r0, 0x15 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x20] - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl GetMoney - str r0, [r5, 0x24] - movs r2, 0 - adds r7, r5, 0 - adds r7, 0x30 - adds r6, r5, 0 - adds r6, 0x28 - ldr r0, [r4] - ldr r1, =0x00002bb0 - adds r3, r0, r1 -_080C2F74: - lsls r0, r2, 1 - adds r1, r6, r0 - adds r0, r3, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080C2F74 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r7, 0 - bl StringCopy - mov r0, r8 - cmp r0, 0x1 - beq _080C3004 - cmp r0, 0x1 - bgt _080C2FC0 - cmp r0, 0 - beq _080C2FCC - b _080C3014 - .pool -_080C2FC0: - mov r1, r8 - cmp r1, 0x2 - bne _080C3014 - movs r0, 0 - strh r0, [r5, 0x18] - strh r0, [r5, 0x1A] -_080C2FCC: - ldr r1, =0x000003e7 - movs r0, 0x23 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x1C] - ldr r1, =0x0000ffff - movs r0, 0x22 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x1E] - bl sub_80F8940 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080C2FF0 - movs r0, 0x1 - strb r0, [r5, 0x4] -_080C2FF0: - adds r0, r5, 0 - bl sub_80C2E84 - strb r0, [r5, 0x1] - b _080C3014 - .pool -_080C3004: - movs r1, 0 - movs r0, 0 - strh r0, [r5, 0x18] - strh r0, [r5, 0x1A] - strh r0, [r5, 0x1C] - strh r0, [r5, 0x1E] - strb r1, [r5, 0x4] - strb r1, [r5, 0x1] -_080C3014: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C2EC4 - - thumb_func_start sub_80C3020 -sub_80C3020: @ 80C3020 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x64 - bl memset - adds r1, r4, 0 - adds r1, 0x38 - movs r0, 0x3 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80C2EC4 - bl sub_80C2DFC - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r1, 0x60 - strh r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000eba - adds r0, r2 - ldrh r0, [r0] - adds r2, r4, 0 - adds r2, 0x62 - strh r0, [r2] - ldrh r0, [r1] - cmp r0, 0 - beq _080C3066 - ldrb r0, [r4, 0x1] - adds r0, 0x1 - strb r0, [r4, 0x1] -_080C3066: - ldrb r0, [r4] - cmp r0, 0x1 - bne _080C3084 - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 - adds r0, 0x8 - b _080C308C - .pool -_080C3084: - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 -_080C308C: - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r0, 0x4F - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3020 - - thumb_func_start TrainerCard_GenerateCardForPlayer -TrainerCard_GenerateCardForPlayer: @ 80C30A4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x60 - bl memset - adds r1, r4, 0 - adds r1, 0x38 - movs r0, 0x3 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80C2EC4 - bl sub_80C2DFC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x3A] - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000eba - adds r1, r2 - ldrh r1, [r1] - strh r1, [r4, 0x3C] - cmp r0, 0 - beq _080C30E0 - ldrb r0, [r4, 0x1] - adds r0, 0x1 - strb r0, [r4, 0x1] -_080C30E0: - ldrb r0, [r4] - cmp r0, 0x1 - bne _080C3100 - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 - adds r0, 0x8 - b _080C3108 - .pool -_080C3100: - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 -_080C3108: - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r0, 0x4F - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end TrainerCard_GenerateCardForPlayer - - thumb_func_start sub_80C3120 -sub_80C3120: @ 80C3120 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - movs r1, 0 - movs r2, 0x64 - bl memset - adds r0, r5, 0 - adds r0, 0x38 - strb r4, [r0] - adds r0, r4, 0 - bl sub_80C4FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080C3162 - cmp r0, 0x1 - bgt _080C3150 - cmp r0, 0 - beq _080C3156 - b _080C318A -_080C3150: - cmp r0, 0x2 - beq _080C316E - b _080C318A -_080C3156: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x60 - bl memcpy - b _080C318A -_080C3162: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x38 - bl memcpy - b _080C318A -_080C316E: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x60 - bl memcpy - movs r0, 0 - str r0, [r5, 0x3C] - ldrh r1, [r6, 0x3A] - adds r0, r5, 0 - adds r0, 0x60 - strh r1, [r0] - ldrh r1, [r6, 0x3C] - adds r0, 0x2 - strh r1, [r0] -_080C318A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C3120 - - thumb_func_start sub_80C3190 -sub_80C3190: @ 80C3190 - push {r4,r5,lr} - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0 - strb r1, [r0, 0xA] - ldr r0, [r4] - strb r1, [r0, 0xB] - ldr r0, [r4] - strb r1, [r0, 0xC] - ldr r0, [r4] - strb r1, [r0, 0xD] - ldr r0, [r4] - strb r1, [r0, 0xE] - ldr r0, [r4] - strb r1, [r0, 0xF] - ldr r0, [r4] - strb r1, [r0, 0x10] - ldr r0, [r4] - adds r0, 0x11 - movs r2, 0x8 - bl memset - ldr r1, [r4] - ldr r2, =0x00000536 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C31CE - ldrb r0, [r1, 0xA] - adds r0, 0x1 - strb r0, [r1, 0xA] -_080C31CE: - ldr r1, [r4] - ldr r3, =0x0000053a - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - bne _080C31E4 - ldr r2, =0x0000053c - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C31EA -_080C31E4: - ldrb r0, [r1, 0xB] - adds r0, 0x1 - strb r0, [r1, 0xB] -_080C31EA: - ldr r2, =gUnknown_02039CE8 - ldr r1, [r2] - movs r3, 0xA9 - lsls r3, 3 - adds r0, r1, r3 - ldr r0, [r0] - cmp r0, 0 - beq _080C3200 - ldrb r0, [r1, 0xC] - adds r0, 0x1 - strb r0, [r1, 0xC] -_080C3200: - ldr r1, [r2] - ldr r3, =0x00000554 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080C3212 - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] -_080C3212: - ldr r1, [r2] - ldr r2, =0x0000054c - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C3224 - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] -_080C3224: - movs r5, 0 - ldr r4, =0x00000867 -_080C3228: - lsls r0, r4, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C3244 - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - adds r1, 0x11 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C3244: - adds r4, 0x1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0000086e - cmp r4, r0 - bls _080C3228 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3190 - - thumb_func_start sub_80C3278 -sub_80C3278: @ 80C3278 - push {lr} - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0xC1 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x1E - bl SetGpuReg - movs r0, 0x44 - movs r1, 0xA0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C32E0 - movs r0, 0xC7 - bl EnableInterrupts - b _080C32E6 - .pool -_080C32E0: - movs r0, 0x3 - bl EnableInterrupts -_080C32E6: - pop {r0} - bx r0 - thumb_func_end sub_80C3278 - - thumb_func_start sub_80C32EC -sub_80C32EC: @ 80C32EC - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x28 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x4 - bgt _080C3306 - movs r2, 0 -_080C3306: - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0xA5 - lsls r1, 3 - adds r0, r1 - strb r2, [r0] - ldr r0, [r4] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x54 - bl SetGpuReg - ldr r0, [r4] - ldr r1, =0x00007ca8 - adds r0, r1 - ldrh r2, [r0] - lsls r1, r2, 8 - movs r0, 0xA0 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C32EC - - thumb_func_start sub_80C334C -sub_80C334C: @ 80C334C - push {lr} - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_80C334C - - thumb_func_start sub_80C3388 -sub_80C3388: @ 80C3388 - push {lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0856FAB4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =gUnknown_0856FAC4 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3388 - - thumb_func_start sub_80C3404 -sub_80C3404: @ 80C3404 - push {lr} - ldr r0, =sub_80C2710 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3404 - - thumb_func_start sub_80C3414 -sub_80C3414: @ 80C3414 - push {lr} - bl ResetTasks - bl ScanlineEffect_Stop - ldr r0, =sub_80C2760 - movs r1, 0 - bl CreateTask - bl sub_80C4EE4 - bl sub_80C3190 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3414 - - thumb_func_start sub_80C3438 -sub_80C3438: @ 80C3438 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - cmp r0, 0x5 - bhi _080C3494 - lsls r0, 2 - ldr r1, =_080C3458 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C3458: - .4byte _080C3470 - .4byte _080C3476 - .4byte _080C347C - .4byte _080C3482 - .4byte _080C3488 - .4byte _080C348E -_080C3470: - bl sub_80C3574 - b _080C349C -_080C3476: - bl sub_80C3608 - b _080C349C -_080C347C: - bl sub_80C3684 - b _080C349C -_080C3482: - bl sub_80C378C - b _080C349C -_080C3488: - bl sub_80C3880 - b _080C349C -_080C348E: - bl sub_80C3A18 - b _080C349C -_080C3494: - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _080C34A8 -_080C349C: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0 -_080C34A8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C3438 - - thumb_func_start sub_80C34B0 -sub_80C34B0: @ 80C34B0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - cmp r0, 0x7 - bhi _080C352C - lsls r0, 2 - ldr r1, =_080C34D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C34D0: - .4byte _080C34F0 - .4byte _080C34F6 - .4byte _080C34FC - .4byte _080C3502 - .4byte _080C3508 - .4byte _080C3512 - .4byte _080C351C - .4byte _080C3526 -_080C34F0: - bl sub_80C3B50 - b _080C3534 -_080C34F6: - bl sub_80C3CCC - b _080C3534 -_080C34FC: - bl sub_80C3D60 - b _080C3534 -_080C3502: - bl sub_80C3DF0 - b _080C3534 -_080C3508: - bl sub_80C3E58 - bl sub_80C3F64 - b _080C3534 -_080C3512: - bl sub_80C3ED4 - bl sub_80C3FE0 - b _080C3534 -_080C351C: - bl sub_80C4140 - bl sub_80C40CC - b _080C3534 -_080C3526: - bl sub_80C42A4 - b _080C3534 -_080C352C: - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _080C3540 -_080C3534: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0 -_080C3540: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C34B0 - - thumb_func_start sub_80C3548 -sub_80C3548: @ 80C3548 - push {lr} - bl sub_80C3AF0 - bl sub_80C3BC4 - bl sub_80C3CF4 - bl sub_80C3DC0 - bl sub_80C3E20 - bl sub_80C3E98 - bl sub_80C3F14 - bl sub_80C3FA4 - bl sub_80C4020 - pop {r0} - bx r0 - thumb_func_end sub_80C3548 - - thumb_func_start sub_80C3574 -sub_80C3574: @ 80C3574 - push {r4,r5,lr} - sub sp, 0x2C - ldr r1, =gText_TrainerCardName - add r0, sp, 0xC - bl StringCopy - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r0, =0x00000564 - adds r1, r0 - adds r0, r5, 0 - bl StringCopy - ldr r0, [r4] - ldr r1, =0x00007caa - adds r0, r1 - ldrb r1, [r0] - adds r0, r5, 0 - bl ConvertInternationalString - ldr r0, [r4] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C35E0 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x1C - bl AddTextPrinterParameterized3 - b _080C35FA - .pool -_080C35E0: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x21 - bl AddTextPrinterParameterized3 -_080C35FA: - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3574 - - thumb_func_start sub_80C3608 -sub_80C3608: @ 80C3608 - push {r4,lr} - sub sp, 0x2C - ldr r1, =gText_TrainerCardIDNo - add r0, sp, 0xC - bl StringCopy - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x00000542 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3650 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x50 - bl GetStringCenterAlignXOffset - adds r0, 0x84 - b _080C365C - .pool -_080C3650: - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x60 - bl GetStringCenterAlignXOffset - adds r0, 0x78 -_080C365C: - movs r3, 0x9 - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 - add sp, 0x2C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3608 - - thumb_func_start sub_80C3684 -sub_80C3684: @ 80C3684 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C36C4 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardMoney - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x38 - bl AddTextPrinterParameterized3 - b _080C36DE - .pool -_080C36C4: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardMoney - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x39 - bl AddTextPrinterParameterized3 -_080C36DE: - ldr r0, =gStringVar1 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r2, 0xAB - lsls r2, 3 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gText_PokedollarVar1 - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r0, [r4] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3734 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x90 - bl GetStringRightAlignXOffset - movs r3, 0x38 - b _080C3740 - .pool -_080C3734: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringRightAlignXOffset - movs r3, 0x39 -_080C3740: - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gStringVar4 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3684 - - thumb_func_start sub_80C376C -sub_80C376C: @ 80C376C - push {lr} - bl IsNationalPokedexEnabled - cmp r0, 0 - bne _080C377E - movs r0, 0x1 - bl GetHoennPokedexCount - b _080C3784 -_080C377E: - movs r0, 0x1 - bl GetNationalPokedexCount -_080C3784: - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80C376C - - thumb_func_start sub_80C378C -sub_80C378C: @ 80C378C - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x00000861 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C386E - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C37DC - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardPokedex - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x48 - bl AddTextPrinterParameterized3 - b _080C37F6 - .pool -_080C37DC: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardPokedex - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x49 - bl AddTextPrinterParameterized3 -_080C37F6: - ldr r5, =gStringVar4 - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 3 - adds r0, r1 - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gText_EmptyString6 - bl StringCopy - ldr r0, [r4] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3848 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x90 - bl GetStringRightAlignXOffset - movs r3, 0x48 - b _080C3854 - .pool -_080C3848: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringRightAlignXOffset - movs r3, 0x49 -_080C3854: - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gStringVar4 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 -_080C386E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C378C - - thumb_func_start sub_80C3880 -sub_80C3880: @ 80C3880 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C38C8 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardTime - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x58 - bl AddTextPrinterParameterized3 - b _080C38E2 - .pool -_080C38C8: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardTime - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x59 - bl AddTextPrinterParameterized3 -_080C38E2: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080C390C - ldr r2, =0x00000544 - adds r0, r1, r2 - ldrh r5, [r0] - adds r2, 0x2 - adds r0, r1, r2 - ldrh r6, [r0] - b _080C3914 - .pool -_080C390C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrh r5, [r0, 0xE] - ldrb r6, [r0, 0x10] -_080C3914: - ldr r0, =0x000003e7 - cmp r5, r0 - bls _080C391C - adds r5, r0, 0 -_080C391C: - cmp r6, 0x3B - bls _080C3922 - movs r6, 0x3B -_080C3922: - ldr r1, =gText_Colon2 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - mov r10, r0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3958 - movs r7, 0x90 - movs r4, 0x58 - b _080C395C - .pool -_080C3958: - movs r7, 0x80 - movs r4, 0x59 -_080C395C: - mov r0, r10 - adds r0, 0x1E - subs r7, r0 - lsls r2, r7, 16 - lsrs r2, 16 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - adds r3, r4, 0 - bl FillWindowPixelRect - ldr r2, =gStringVar4 - mov r9, r2 - mov r0, r9 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - lsls r2, r7, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - mov r8, r0 - str r0, [sp] - movs r5, 0x1 - negs r5, r5 - str r5, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - adds r7, 0x12 - lsls r2, r7, 24 - lsrs r2, 24 - ldr r1, =gUnknown_0856FB40 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x7] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp] - str r5, [sp, 0x4] - ldr r0, =gText_Colon2 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - add r7, r10 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - lsls r2, r7, 24 - lsrs r2, 24 - mov r0, r8 - str r0, [sp] - str r5, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3880 - - thumb_func_start sub_80C3A18 -sub_80C3A18: @ 80C3A18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r7, =gUnknown_02039CE8 - ldr r1, [r7] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080C3ACE - ldr r0, =gUnknown_0856FB48 - mov r8, r0 - ldr r4, =0x0000052b - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - ldr r6, =gUnknown_0856FB0C - str r6, [sp] - movs r5, 0x1 - negs r5, r5 - str r5, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x19 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x8 - bl AddTextPrinterParameterized3 - ldr r1, [r7] - adds r1, 0x19 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - adds r2, 0xE - lsls r2, 24 - lsrs r2, 24 - ldr r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x26 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 - ldr r0, =gUnknown_0856FB4A - mov r8, r0 - ldr r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x33 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x8 - bl AddTextPrinterParameterized3 - ldr r1, [r7] - adds r1, 0x33 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - adds r2, 0xE - lsls r2, 24 - lsrs r2, 24 - ldr r1, [r7] - adds r4, r1, r4 - ldrb r0, [r4] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x40 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 -_080C3ACE: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3A18 - - thumb_func_start sub_80C3AF0 -sub_80C3AF0: @ 80C3AF0 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4D - ldr r2, =0x00000564 - adds r1, r2 - bl StringCopy - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4D - ldr r2, =0x00007caa - adds r1, r2 - ldrb r1, [r1] - bl ConvertInternationalString - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3B30 - ldr r0, =gStringVar1 - adds r1, 0x4D - bl StringCopy - ldr r0, [r4] - adds r0, 0x4D - ldr r1, =gText_Var1sTrainerCard - bl StringExpandPlaceholders -_080C3B30: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3AF0 - - thumb_func_start sub_80C3B50 -sub_80C3B50: @ 80C3B50 - push {r4,lr} - sub sp, 0xC - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x0000052b - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3B8C - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x88 - movs r3, 0x9 - bl AddTextPrinterParameterized3 - b _080C3BB6 - .pool -_080C3B8C: - adds r1, 0x4D - movs r0, 0x1 - movs r2, 0xD8 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, [r4] - adds r0, 0x4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x9 - bl AddTextPrinterParameterized3 -_080C3BB6: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3B50 - - thumb_func_start sub_80C3BC4 -sub_80C3BC4: @ 80C3BC4 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldrb r0, [r1, 0xB] - cmp r0, 0 - beq _080C3C0E - ldr r0, =gStringVar1 - ldr r2, =0x0000053a - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, =gStringVar2 - ldr r1, [r4] - ldr r2, =0x0000053c - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r0, =gStringVar3 - ldr r1, [r4] - ldr r2, =0x0000053e - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x93 - ldr r1, =gUnknown_0856FB4C - bl StringExpandPlaceholders -_080C3C0E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3BC4 - - thumb_func_start sub_80C3C34 -sub_80C3C34: @ 80C3C34 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0xC - adds r4, r0, 0 - mov r9, r2 - mov r10, r3 - ldr r2, =gUnknown_0856FB55 - ldr r6, =gUnknown_02039CE8 - ldr r0, [r6] - ldr r5, =0x0000052b - adds r0, r5 - ldrb r0, [r0] - adds r0, r2 - ldrb r2, [r0] - lsls r4, 28 - movs r0, 0x84 - lsls r0, 22 - adds r4, r0 - lsrs r4, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - ldr r1, =gUnknown_0856FB57 - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - movs r0, 0x1 - mov r1, r9 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - mov r0, r10 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3C34 - - thumb_func_start sub_80C3CCC -sub_80C3CCC: @ 80C3CCC - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldrb r0, [r2, 0xB] - cmp r0, 0 - beq _080C3CE4 - ldr r1, =gText_HallOfFameDebut - adds r2, 0x93 - ldr r3, =gUnknown_0856FB0F - movs r0, 0 - bl sub_80C3C34 -_080C3CE4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3CCC - - thumb_func_start sub_80C3CF4 -sub_80C3CF4: @ 80C3CF4 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - cmp r0, 0 - beq _080C3D40 - adds r0, r1, 0 - adds r0, 0xD9 - ldr r2, =gUnknown_0856FB5C - ldr r3, =0x0000052a - adds r1, r3 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r1, [r4] - ldr r2, =0x00000165 - adds r0, r1, r2 - movs r3, 0xA9 - lsls r3, 3 - adds r1, r3 - ldrh r1, [r1] - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r1, [r4] - ldr r2, =0x000001ab - adds r0, r1, r2 - ldr r3, =0x0000054a - adds r1, r3 - ldrh r1, [r1] - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalStringN -_080C3D40: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3CF4 - - thumb_func_start sub_80C3D60 -sub_80C3D60: @ 80C3D60 - push {r4,r5,lr} - ldr r5, =gUnknown_02039CE8 - ldr r1, [r5] - ldrb r0, [r1, 0xC] - cmp r0, 0 - beq _080C3D9A - ldr r0, =gStringVar1 - ldr r2, =0x00000165 - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - ldr r1, [r5] - ldr r2, =0x000001ab - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gText_WinsLosses - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r1, [r5] - adds r1, 0xD9 - ldr r3, =gUnknown_0856FB0C - movs r0, 0x1 - adds r2, r4, 0 - bl sub_80C3C34 -_080C3D9A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3D60 - - thumb_func_start sub_80C3DC0 -sub_80C3DC0: @ 80C3DC0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C3DDE - ldr r2, =0x00000237 - adds r0, r1, r2 - ldr r2, =0x00000554 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3DDE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3DC0 - - thumb_func_start sub_80C3DF0 -sub_80C3DF0: @ 80C3DF0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0 - beq _080C3E0A - ldr r1, =gText_PokemonTrades - ldr r0, =0x00000237 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x2 - bl sub_80C3C34 -_080C3E0A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3DF0 - - thumb_func_start sub_80C3E20 -sub_80C3E20: @ 80C3E20 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3E48 - movs r3, 0xAE - lsls r3, 3 - adds r0, r2, r3 - ldr r1, [r0] - cmp r1, 0 - beq _080C3E48 - ldr r3, =0x000002c3 - adds r0, r2, r3 - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3E48: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E20 - - thumb_func_start sub_80C3E58 -sub_80C3E58: @ 80C3E58 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3E80 - adds r1, 0x46 - adds r0, r2, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C3E80 - ldr r1, =gText_BerryCrush - ldr r0, =0x000002c3 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x4 - bl sub_80C3C34 -_080C3E80: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E58 - - thumb_func_start sub_80C3E98 -sub_80C3E98: @ 80C3E98 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3EBE - ldr r3, =0x00000574 - adds r0, r2, r3 - ldr r1, [r0] - cmp r1, 0 - beq _080C3EBE - ldr r3, =0x0000034f - adds r0, r2, r3 - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3EBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E98 - - thumb_func_start sub_80C3ED4 -sub_80C3ED4: @ 80C3ED4 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3EFC - adds r1, 0x4A - adds r0, r2, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C3EFC - ldr r1, =gText_UnionTradesAndBattles - ldr r0, =0x0000034f - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x3 - bl sub_80C3C34 -_080C3EFC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3ED4 - - thumb_func_start sub_80C3F14 -sub_80C3F14: @ 80C3F14 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3F46 - ldr r0, =0x00000552 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080C3F46 - ldr r0, =gStringVar1 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x00000395 - adds r0, r1 - ldr r1, =gText_Var1DarkGreyShadowLightGrey - bl StringExpandPlaceholders -_080C3F46: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3F14 - - thumb_func_start sub_80C3F64 -sub_80C3F64: @ 80C3F64 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3F8C - adds r1, 0x28 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C3F8C - ldr r1, =gText_PokeblocksWithFriends - ldr r0, =0x00000395 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x3 - bl sub_80C3C34 -_080C3F8C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3F64 - - thumb_func_start sub_80C3FA4 -sub_80C3FA4: @ 80C3FA4 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3FCE - movs r3, 0xAA - lsls r3, 3 - adds r2, r1, r3 - ldrh r0, [r2] - cmp r0, 0 - beq _080C3FCE - ldr r3, =0x000003db - adds r0, r1, r3 - ldrh r1, [r2] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3FCE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3FA4 - - thumb_func_start sub_80C3FE0 -sub_80C3FE0: @ 80C3FE0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C4008 - adds r1, 0x26 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C4008 - ldr r1, =gText_WonContestsWFriends - ldr r0, =0x000003db - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x4 - bl sub_80C3C34 -_080C4008: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3FE0 - - thumb_func_start sub_80C4020 -sub_80C4020: @ 80C4020 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C4044 - cmp r0, 0x1 - ble _080C40B6 - cmp r0, 0x2 - beq _080C4094 - b _080C40B6 - .pool -_080C4044: - ldrb r0, [r1, 0xD] - cmp r0, 0 - beq _080C40B6 - ldr r0, =gStringVar1 - ldr r2, =0x0000054c - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r0, =gStringVar2 - ldr r1, [r4] - ldr r2, =0x0000054e - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x00000421 - adds r0, r1 - ldr r1, =gText_WSlashStraightSlash - bl StringExpandPlaceholders - b _080C40B6 - .pool -_080C4094: - ldr r2, =0x00000596 - adds r1, r2 - ldrh r0, [r1] - cmp r0, 0 - beq _080C40B6 - ldr r0, =gStringVar1 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x00000421 - adds r0, r1 - ldr r1, =gText_Var1DarkLightGreyBP - bl StringExpandPlaceholders -_080C40B6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4020 - - thumb_func_start sub_80C40CC -sub_80C40CC: @ 80C40CC - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C40F0 - cmp r0, 0x1 - ble _080C412C - cmp r0, 0x2 - beq _080C4114 - b _080C412C - .pool -_080C40F0: - ldrb r0, [r2, 0xD] - cmp r0, 0 - beq _080C412C - ldr r1, =gText_BattleTower - ldr r0, =0x00000421 - adds r2, r0 - ldr r3, =gUnknown_0856FB0C - movs r0, 0x5 - bl sub_80C3C34 - b _080C412C - .pool -_080C4114: - ldr r1, =0x00000596 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C412C - ldr r1, =gText_BattlePtsWon - ldr r0, =0x00000421 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x5 - bl sub_80C3C34 -_080C412C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C40CC - - thumb_func_start sub_80C4140 -sub_80C4140: @ 80C4140 - push {r4,r5,lr} - sub sp, 0x20 - ldr r1, =gUnknown_0856FB68 - add r0, sp, 0x10 - movs r2, 0x6 - bl memcpy - add r4, sp, 0x18 - ldr r1, =gUnknown_0856FB6E - adds r0, r4, 0 - movs r2, 0x6 - bl memcpy - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - adds r5, r4, 0 - cmp r0, 0 - bne _080C41C0 - movs r4, 0 -_080C416C: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - lsls r1, r4, 1 - movs r2, 0xB1 - lsls r2, 3 - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _080C41B6 - bl sub_80D30A0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 20 - movs r2, 0xE0 - lsls r2, 16 - adds r1, r2 - lsrs r1, 16 - adds r2, r5, r4 - ldrb r2, [r2] - adds r2, 0x3 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0x4 - str r3, [sp] - str r3, [sp, 0x4] - add r0, sp - adds r0, 0x10 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x3 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer -_080C41B6: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080C416C -_080C41C0: - add sp, 0x20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4140 - - thumb_func_start sub_80C41D8 -sub_80C41D8: @ 80C41D8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =gMonIconPalettes - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r5, 0x8D - lsls r5, 3 - adds r1, r5 - movs r2, 0x60 - bl CpuSet - ldr r4, [r4] - ldr r1, =0x00000582 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C4214 - cmp r0, 0x1 - ble _080C424A - cmp r0, 0x2 - beq _080C422A - cmp r0, 0x3 - beq _080C4242 - b _080C424A - .pool -_080C4214: - movs r2, 0x8D - lsls r2, 3 - adds r0, r4, r2 - movs r1, 0 - str r1, [sp] - movs r1, 0x60 - movs r2, 0 - movs r3, 0 - bl TintPalette_CustomTone - b _080C424A -_080C422A: - adds r0, r4, r5 - movs r2, 0xFA - lsls r2, 1 - movs r3, 0xA5 - lsls r3, 1 - movs r1, 0x9B - lsls r1, 1 - str r1, [sp] - movs r1, 0x60 - bl TintPalette_CustomTone - b _080C424A -_080C4242: - adds r0, r4, r5 - movs r1, 0x60 - bl TintPalette_SepiaTone -_080C424A: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - movs r1, 0x8D - lsls r1, 3 - adds r0, r1 - movs r1, 0x50 - movs r2, 0xC0 - bl LoadPalette - movs r4, 0 -_080C425E: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - lsls r1, r4, 1 - movs r2, 0xB1 - lsls r2, 3 - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _080C428E - movs r1, 0 - bl GetMonIconTiles - adds r1, r0, 0 - lsls r3, r4, 20 - movs r0, 0x80 - lsls r0, 14 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x80 - lsls r2, 2 - bl LoadBgTiles -_080C428E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080C425E - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C41D8 - - thumb_func_start sub_80C42A4 -sub_80C42A4: @ 80C42A4 - push {r4,lr} - sub sp, 0x14 - ldr r1, =gUnknown_0856FB74 - add r0, sp, 0x10 - movs r2, 0x4 - bl memcpy - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C4316 - adds r2, 0x56 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C4316 - movs r4, 0 -_080C42CC: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x00000584 - adds r0, r1 - adds r0, r4 - ldrb r3, [r0] - cmp r3, 0 - beq _080C430C - lsls r1, r4, 18 - movs r2, 0xA0 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - lsls r2, r4, 1 - adds r2, r4 - adds r2, 0x2 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - subs r0, r3, 0x1 - add r0, sp - adds r0, 0x10 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x3 - movs r3, 0x2 - bl WriteSequenceToBgTilemapBuffer -_080C430C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C42CC -_080C4316: - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C42A4 - - thumb_func_start sub_80C4330 -sub_80C4330: @ 80C4330 - push {lr} - ldr r0, =gUnknown_0856F54C - movs r1, 0xB0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0856F56C - movs r1, 0xC0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0856F58C - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0856F5AC - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r0, =0x000017a8 - adds r1, r0 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x3 - movs r3, 0x80 - bl LoadBgTiles - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4330 - - thumb_func_start sub_80C438C -sub_80C438C: @ 80C438C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C438C - - thumb_func_start sub_80C43A8 -sub_80C43A8: @ 80C43A8 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0x4 - bls _080C43B8 - b _080C4532 -_080C43B8: - lsls r0, 2 - ldr r1, =_080C43CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C43CC: - .4byte _080C43E0 - .4byte _080C43F8 - .4byte _080C4418 - .4byte _080C44D8 - .4byte _080C4500 -_080C43E0: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r0, =0x000013a8 - adds r1, r0 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x3 - b _080C4406 - .pool -_080C43F8: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r3, =0x000019a8 - adds r1, r3 - movs r2, 0xC0 - lsls r2, 5 - movs r0, 0 -_080C4406: - movs r3, 0 - bl LoadBgTiles - b _080C4536 - .pool -_080C4418: - ldr r4, =gUnknown_02039CE8 - ldr r2, [r4] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C447C - ldr r1, =gEmeraldTrainerCardStarPals - ldr r3, =0x00000535 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_0856F4EC - movs r1, 0x30 - movs r2, 0x20 - bl LoadPalette - ldr r0, [r4] - ldr r1, =0x00000534 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C44B2 - ldr r0, =gUnknown_0856F4AC - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette - b _080C44B2 - .pool -_080C447C: - ldr r1, =gFireRedTrainerCardStarPals - ldr r3, =0x00000535 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_0856F50C - movs r1, 0x30 - movs r2, 0x20 - bl LoadPalette - ldr r0, [r4] - ldr r1, =0x00000534 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C44B2 - ldr r0, =gUnknown_0856F4CC - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette -_080C44B2: - ldr r0, =gUnknown_0856F52C - movs r1, 0x40 - movs r2, 0x20 - bl LoadPalette - b _080C4536 - .pool -_080C44D8: - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r3, =0x00003ca8 - adds r1, r3 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00005ca8 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - b _080C4536 - .pool -_080C4500: - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 -_080C4532: - movs r0, 0x1 - b _080C4542 -_080C4536: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - movs r0, 0 -_080C4542: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C43A8 - - thumb_func_start sub_80C4550 -sub_80C4550: @ 80C4550 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x00005ca8 - adds r6, r0, r1 - movs r1, 0 -_080C455E: - movs r2, 0 - lsls r5, r1, 16 - asrs r1, r5, 16 - lsls r3, r1, 5 - lsls r0, r1, 4 - subs r0, r1 - lsls r4, r0, 1 -_080C456C: - lsls r0, r2, 16 - asrs r1, r0, 16 - adds r2, r0, 0 - cmp r1, 0x1D - bgt _080C4590 - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - adds r1, r4, r1 - lsls r1, 1 - adds r1, r7 - ldrh r1, [r1] - b _080C4598 - .pool -_080C4590: - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r7] -_080C4598: - strh r1, [r0] - movs r1, 0x80 - lsls r1, 9 - adds r0, r2, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x1F - ble _080C456C - adds r0, r5, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080C455E - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C4550 - - thumb_func_start sub_80C45C0 -sub_80C45C0: @ 80C45C0 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x00003ca8 - adds r6, r0, r1 - movs r1, 0 -_080C45CE: - movs r2, 0 - lsls r5, r1, 16 - asrs r1, r5, 16 - lsls r3, r1, 5 - lsls r0, r1, 4 - subs r0, r1 - lsls r4, r0, 1 -_080C45DC: - lsls r0, r2, 16 - asrs r1, r0, 16 - adds r2, r0, 0 - cmp r1, 0x1D - bgt _080C4600 - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - adds r1, r4, r1 - lsls r1, 1 - adds r1, r7 - ldrh r1, [r1] - b _080C4608 - .pool -_080C4600: - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r7] -_080C4608: - strh r1, [r0] - movs r1, 0x80 - lsls r1, 9 - adds r0, r2, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x1F - ble _080C45DC - adds r0, r5, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080C45CE - movs r0, 0 - bl CopyBgTilemapBufferToVram - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C45C0 - - thumb_func_start sub_80C4630 -sub_80C4630: @ 80C4630 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0xC0 - mov r8, r0 - movs r2, 0x3 - mov r10, r2 - ldr r2, =gUnknown_0856FB78 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r3, =0x0000052b - adds r0, r1, r3 - ldrb r0, [r0] - adds r0, r2 - ldrb r3, [r0] - ldr r0, =0x00000535 - adds r1, r0 - ldrb r0, [r1] - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x4 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8F - movs r2, 0xF - bl FillBgTilemapBufferRect - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - bne _080C4724 - movs r2, 0x4 - mov r9, r2 - movs r2, 0 - movs r6, 0x1 -_080C467E: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - lsls r0, r2, 16 - asrs r7, r0, 16 - adds r1, 0x11 - adds r1, r7 - ldrb r0, [r1] - cmp r0, 0 - beq _080C4700 - mov r3, r9 - lsls r5, r3, 24 - lsrs r5, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - movs r0, 0x3 - mov r1, r8 - adds r2, r5, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - mov r4, r9 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - movs r0, 0x3 - adds r2, r4, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x10 - lsls r1, 16 - lsrs r1, 16 - str r6, [sp] - str r6, [sp, 0x4] - mov r3, r10 - str r3, [sp, 0x8] - movs r0, 0x3 - adds r2, r5, 0 - movs r3, 0x10 - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x11 - lsls r1, 16 - lsrs r1, 16 - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - movs r0, 0x3 - adds r2, r4, 0 - movs r3, 0x10 - bl FillBgTilemapBufferRect -_080C4700: - adds r0, r7, 0x1 - lsls r0, 16 - mov r1, r8 - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - mov r2, r9 - lsls r1, r2, 16 - movs r3, 0xC0 - lsls r3, 10 - adds r1, r3 - lsrs r1, 16 - mov r9, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080C467E -_080C4724: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4630 - - thumb_func_start sub_80C474C -sub_80C474C: @ 80C474C - push {r4-r6,lr} - sub sp, 0xC - ldr r6, =gUnknown_02039CE8 - ldr r1, [r6] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C4800 - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C478A - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0x9 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C478A: - ldr r0, [r6] - movs r1, 0xAE - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C47BE - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x15 - movs r3, 0xD - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x15 - movs r3, 0xE - bl FillBgTilemapBufferRect -_080C47BE: - ldr r0, [r6] - ldr r2, =0x00000574 - adds r0, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C48B8 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0xB - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xC - bl FillBgTilemapBufferRect - b _080C48B8 - .pool -_080C4800: - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C482E - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0x9 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C482E: - ldr r0, [r6] - movs r1, 0xAA - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C4864 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0xD - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xE - bl FillBgTilemapBufferRect -_080C4864: - ldr r0, [r6] - ldrb r0, [r0, 0xD] - cmp r0, 0 - beq _080C48B8 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x11 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x11 - movs r3, 0x10 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8C - movs r2, 0x1B - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9C - movs r2, 0x1B - movs r3, 0x10 - bl FillBgTilemapBufferRect -_080C48B8: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C474C - - thumb_func_start sub_80C48C8 -sub_80C48C8: @ 80C48C8 - push {lr} - ldr r3, =gUnknown_02039CE8 - ldr r1, [r3] - ldrb r0, [r1, 0x6] - adds r0, 0x1 - strb r0, [r1, 0x6] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3C - bls _080C48F6 - ldr r1, [r3] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r2, [r3] - ldrb r0, [r2, 0x7] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2, 0x7] - ldr r0, [r3] - ldr r1, =0x00000529 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080C48F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C48C8 - - thumb_func_start sub_80C4904 -sub_80C4904: @ 80C4904 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTrainerCards - movs r1, 0x64 - muls r0, r1 - adds r0, r2 - ldrb r0, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_80C4904 - - thumb_func_start sub_80C4918 -sub_80C4918: @ 80C4918 - push {r4,lr} - ldr r4, =sub_80C4960 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - ldr r0, =sub_80C26D4 - bl SetHBlankCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4918 - - thumb_func_start sub_80C4940 -sub_80C4940: @ 80C4940 - push {lr} - ldr r0, =sub_80C4960 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080C4958 - movs r0, 0 - b _080C495A - .pool -_080C4958: - movs r0, 0x1 -_080C495A: - pop {r1} - bx r1 - thumb_func_end sub_80C4940 - - thumb_func_start sub_80C4960 -sub_80C4960: @ 80C4960 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0856FB28 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080C4972: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _080C4972 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4960 - - thumb_func_start sub_80C4998 -sub_80C4998: @ 80C4998 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl ScanlineEffect_Stop - bl ScanlineEffect_Clear - movs r1, 0 - ldr r0, =gScanlineEffectRegBuffers - movs r2, 0 - movs r3, 0xF0 - lsls r3, 3 - adds r0, r3 -_080C49BC: - strh r2, [r0] - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - bls _080C49BC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4998 - - thumb_func_start sub_80C49D8 -sub_80C49D8: @ 80C49D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x9] - mov r0, r8 - ldrh r1, [r0, 0xA] - movs r2, 0xA - ldrsh r0, [r0, r2] - cmp r0, 0x4C - ble _080C4A08 - movs r0, 0x4D - mov r3, r8 - strh r0, [r3, 0xA] - b _080C4A0E - .pool -_080C4A08: - adds r0, r1, 0x7 - mov r4, r8 - strh r0, [r4, 0xA] -_080C4A0E: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - mov r2, r8 - ldrh r1, [r2, 0xA] - ldr r3, =0x00007ca8 - adds r0, r3 - strh r1, [r0] - ldrh r0, [r2, 0xA] - bl sub_80C32EC - mov r4, r8 - movs r0, 0xA - ldrsh r7, [r4, r0] - movs r0, 0xA0 - subs r0, r7 - mov r9, r0 - subs r4, r0, r7 - negs r0, r7 - lsls r6, r0, 16 - movs r0, 0xA0 - lsls r0, 16 - adds r1, r4, 0 - bl __udivsi3 - adds r5, r0, 0 - ldr r1, =0xffff0000 - adds r5, r1 - adds r0, r5, 0 - muls r0, r4 - adds r0, r6, r0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - bl __udivsi3 - mov r10, r0 - lsls r5, 1 - movs r2, 0 - cmp r2, r7 - bcs _080C4A78 - ldr r3, =gScanlineEffectRegBuffers -_080C4A60: - lsls r0, r2, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r3 - negs r2, r0 - strh r2, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, r7 - bcc _080C4A60 -_080C4A78: - lsls r1, r2, 16 - mov r3, r9 - lsls r0, r3, 16 - asrs r3, r0, 16 - ldr r4, =gUnknown_02039CE8 - mov r9, r4 - ldr r4, [sp] - lsrs r7, r4, 16 - cmp r1, r0 - bge _080C4AB0 - ldr r0, =gScanlineEffectRegBuffers - mov r12, r0 - adds r4, r3, 0 -_080C4A92: - lsrs r3, r6, 16 - adds r6, r5 - mov r2, r10 - subs r5, r2 - asrs r0, r1, 16 - lsls r1, r0, 1 - add r1, r12 - strh r3, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r4 - blt _080C4A92 -_080C4AB0: - adds r3, r7, 0 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _080C4ACE - ldr r2, =gScanlineEffectRegBuffers -_080C4ABC: - asrs r0, r1, 16 - lsls r1, r0, 1 - adds r1, r2 - strh r3, [r1] - adds r0, 0x1 - lsls r1, r0, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _080C4ABC -_080C4ACE: - mov r3, r9 - ldr r0, [r3] - movs r1, 0x1 - strb r1, [r0, 0x9] - mov r4, r8 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x4C - ble _080C4AE6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080C4AE6: - movs r0, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C49D8 - - thumb_func_start sub_80C4B08 -sub_80C4B08: @ 80C4B08 - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x9] - bl sub_8087598 - adds r2, r4, 0 - cmp r0, 0x1 - beq _080C4C08 -_080C4B20: - ldr r3, [r2] - ldrb r0, [r3, 0x4] - cmp r0, 0x4 - bhi _080C4BE4 - lsls r0, 2 - ldr r1, =_080C4B3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C4B3C: - .4byte _080C4B50 - .4byte _080C4B6C - .4byte _080C4B8C - .4byte _080C4BB0 - .4byte _080C4BCE -_080C4B50: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - b _080C4BF6 -_080C4B6C: - ldr r0, [r2] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080C4B80 - bl sub_80C34B0 - lsls r0, 24 - cmp r0, 0 - bne _080C4BF6 - b _080C4C08 -_080C4B80: - bl sub_80C3438 - lsls r0, 24 - cmp r0, 0 - bne _080C4BF6 - b _080C4C08 -_080C4B8C: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x8] - cmp r0, 0 - bne _080C4BA8 - ldr r2, =0x00000a48 - adds r0, r1, r2 - bl sub_80C45C0 - b _080C4BF6 - .pool -_080C4BA8: - movs r0, 0x1 - bl sub_80C438C - b _080C4BF6 -_080C4BB0: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080C4BC4 - bl sub_80C474C - b _080C4BF6 - .pool -_080C4BC4: - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - b _080C4BF6 -_080C4BCE: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C4BF6 - bl sub_80C4FF0 - b _080C4BF6 - .pool -_080C4BE4: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x8] - movs r0, 0x1 - strb r0, [r3, 0x9] - ldr r0, [r2] - strb r1, [r0, 0x4] - b _080C4C08 -_080C4BF6: - ldr r2, =gUnknown_02039CE8 - ldr r1, [r2] - ldrb r0, [r1, 0x4] - adds r0, 0x1 - strb r0, [r1, 0x4] - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C4B20 -_080C4C08: - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4B08 - - thumb_func_start sub_80C4C1C -sub_80C4C1C: @ 80C4C1C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x9] - ldr r0, [r4] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C4C50 - movs r0, 0x2 - bl sub_80C438C - ldr r0, [r4] - ldr r1, =0x00000ef8 - adds r0, r1 - bl sub_80C4550 - ldr r0, [r4] - movs r1, 0xB3 - lsls r1, 3 - adds r0, r1 - bl sub_80C45C0 - bl sub_80C4630 -_080C4C50: - movs r0, 0x1 - bl sub_80C438C - ldr r2, [r4] - ldrb r0, [r2, 0x8] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2, 0x8] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x9] - movs r0, 0xFA - bl PlaySE - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4C1C - - thumb_func_start sub_80C4C84 -sub_80C4C84: @ 80C4C84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - movs r2, 0 - strb r2, [r0, 0x9] - mov r0, r8 - ldrh r1, [r0, 0xA] - movs r3, 0xA - ldrsh r0, [r0, r3] - cmp r0, 0x5 - bgt _080C4CB0 - mov r4, r8 - strh r2, [r4, 0xA] - b _080C4CB6 - .pool -_080C4CB0: - subs r0, r1, 0x5 - mov r1, r8 - strh r0, [r1, 0xA] -_080C4CB6: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - mov r2, r8 - ldrh r1, [r2, 0xA] - ldr r3, =0x00007ca8 - adds r0, r3 - strh r1, [r0] - ldrh r0, [r2, 0xA] - bl sub_80C32EC - mov r4, r8 - movs r0, 0xA - ldrsh r7, [r4, r0] - movs r0, 0xA0 - subs r0, r7 - mov r9, r0 - subs r4, r0, r7 - negs r0, r7 - lsls r6, r0, 16 - movs r0, 0xA0 - lsls r0, 16 - adds r1, r4, 0 - bl __udivsi3 - adds r5, r0, 0 - ldr r1, =0xffff0000 - adds r5, r1 - adds r0, r5, 0 - muls r0, r4 - adds r0, r6, r0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - bl __udivsi3 - mov r10, r0 - lsrs r5, 1 - movs r2, 0 - cmp r2, r7 - bcs _080C4D20 - ldr r3, =gScanlineEffectRegBuffers -_080C4D08: - lsls r0, r2, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r3 - negs r2, r0 - strh r2, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, r7 - bcc _080C4D08 -_080C4D20: - lsls r1, r2, 16 - mov r3, r9 - lsls r0, r3, 16 - asrs r3, r0, 16 - ldr r4, =gUnknown_02039CE8 - mov r9, r4 - ldr r4, [sp] - lsrs r7, r4, 16 - cmp r1, r0 - bge _080C4D56 - ldr r0, =gScanlineEffectRegBuffers - mov r12, r0 - adds r4, r3, 0 -_080C4D3A: - lsrs r3, r6, 16 - adds r6, r5 - add r5, r10 - asrs r0, r1, 16 - lsls r1, r0, 1 - add r1, r12 - strh r3, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r4 - blt _080C4D3A -_080C4D56: - adds r3, r7, 0 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _080C4D74 - ldr r2, =gScanlineEffectRegBuffers -_080C4D62: - asrs r0, r1, 16 - lsls r1, r0, 1 - adds r1, r2 - strh r3, [r1] - adds r0, 0x1 - lsls r1, r0, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _080C4D62 -_080C4D74: - mov r1, r9 - ldr r0, [r1] - movs r1, 0x1 - strb r1, [r0, 0x9] - mov r2, r8 - movs r3, 0xA - ldrsh r0, [r2, r3] - cmp r0, 0 - bgt _080C4D8C - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_080C4D8C: - movs r0, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4C84 - - thumb_func_start sub_80C4DB0 -sub_80C4DB0: @ 80C4DB0 - push {lr} - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0 - bl SetHBlankCallback - ldr r0, =sub_80C4960 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4DB0 - - thumb_func_start sub_80C4DDC -sub_80C4DDC: @ 80C4DDC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r0, =0x00007cac - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4] - movs r2, 0xA6 - lsls r2, 3 - adds r0, r1, r2 - str r5, [r0] - ldr r0, =sub_80C5868 - cmp r5, r0 - bne _080C4E18 - ldr r0, =0x0000052c - adds r1, r0 - ldr r0, =0x00007fff - b _080C4E1E - .pool -_080C4E18: - ldr r2, =0x0000052c - adds r1, r2 - movs r0, 0 -_080C4E1E: - strh r0, [r1] - bl InUnionRoom - adds r3, r0, 0 - cmp r3, 0x1 - bne _080C4E3C - ldr r1, =gUnknown_02039CE8 - ldr r0, [r1] - strb r3, [r0, 0x5] - adds r2, r1, 0 - b _080C4E44 - .pool -_080C4E3C: - ldr r2, =gUnknown_02039CE8 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x5] -_080C4E44: - ldr r0, [r2] - ldr r1, =0x00007caa - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00000534 - adds r0, r2 - bl sub_80C3020 - ldr r0, =sub_80C2C80 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4DDC - - thumb_func_start TrainerCard_ShowLinkCard -TrainerCard_ShowLinkCard: @ 80C4E74 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_02039CE8 - ldr r0, =0x00007cac - bl AllocZeroed - str r0, [r5] - movs r2, 0xA6 - lsls r2, 3 - adds r1, r0, r2 - str r6, [r1] - movs r1, 0x1 - strb r1, [r0, 0x5] - ldr r0, [r5] - ldr r1, =0x00000534 - adds r0, r1 - ldr r2, =gTrainerCards - movs r1, 0x64 - muls r1, r4 - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r1, [r5] - ldr r2, =gLinkPlayers - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x1A] - ldr r2, =0x00007caa - adds r1, r2 - strb r0, [r1] - ldr r0, =sub_80C2C80 - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end TrainerCard_ShowLinkCard - - thumb_func_start sub_80C4EE4 -sub_80C4EE4: @ 80C4EE4 - push {r4,r5,lr} - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0 - strb r1, [r0] - ldr r2, [r4] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x12] - strb r0, [r2, 0x6] - ldr r0, [r4] - strb r1, [r0, 0x7] - ldr r0, [r4] - strb r1, [r0, 0x8] - ldr r0, [r4] - movs r2, 0xA5 - lsls r2, 3 - adds r0, r2 - strb r1, [r0] - bl sub_80C4F50 - ldr r1, [r4] - ldr r3, =0x0000052a - adds r1, r3 - strb r0, [r1] - movs r5, 0 -_080C4F18: - movs r0, 0xD - muls r0, r5 - adds r0, 0x19 - ldr r1, [r4] - adds r0, r1, r0 - lsls r2, r5, 1 - ldr r3, =0x0000055c - adds r1, r3 - adds r1, r2 - ldrh r1, [r1] - bl CopyEasyChatWord - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080C4F18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4EE4 - - thumb_func_start sub_80C4F50 -sub_80C4F50: @ 80C4F50 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - cmp r1, 0 - bne _080C4F7C - ldr r0, =gGameVersion - ldrb r1, [r0] - subs r0, r1, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4F74 - movs r0, 0 - b _080C4FC2 - .pool -_080C4F74: - cmp r1, 0x3 - beq _080C4FC0 - movs r0, 0x1 - b _080C4FC2 -_080C4F7C: - ldr r2, =0x0000056c - adds r0, r1, r2 - ldrb r2, [r0] - subs r0, r2, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4FA0 - ldr r0, =0x0000052b - adds r1, r0 - movs r0, 0 - strb r0, [r1] - b _080C4FC2 - .pool -_080C4FA0: - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _080C4FB8 - ldr r2, =0x0000052b - adds r1, r2 - movs r0, 0x1 - strb r0, [r1] - b _080C4FC2 - .pool -_080C4FB8: - ldr r0, =0x0000052b - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] -_080C4FC0: - movs r0, 0x2 -_080C4FC2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4F50 - - thumb_func_start sub_80C4FCC -sub_80C4FCC: @ 80C4FCC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFC - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4FE2 - movs r0, 0 - b _080C4FEC -_080C4FE2: - cmp r1, 0x3 - beq _080C4FEA - movs r0, 0x1 - b _080C4FEC -_080C4FEA: - movs r0, 0x2 -_080C4FEC: - pop {r1} - bx r1 - thumb_func_end sub_80C4FCC - - thumb_func_start sub_80C4FF0 -sub_80C4FF0: @ 80C4FF0 - push {r4-r6,lr} - sub sp, 0x8 - bl InUnionRoom - cmp r0, 0x1 - bne _080C5060 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C5060 - ldr r5, =gUnknown_02039CE8 - ldr r0, [r5] - ldr r1, =0x00000583 - adds r0, r1 - ldrb r0, [r0] - bl FacilityClassToPicIndex - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gUnknown_0856FB18 - ldr r1, [r5] - ldr r3, =0x00000534 - adds r2, r1, r3 - ldrb r3, [r2] - lsls r3, 1 - ldr r2, =0x0000052b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r3, r1 - adds r1, r3, r4 - ldrb r2, [r1] - adds r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r1, 0x8 - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D938 - b _080C50AE - .pool -_080C5060: - ldr r2, =gUnknown_0856FB20 - ldr r6, =gUnknown_02039CE8 - ldr r0, [r6] - ldr r5, =0x00000534 - adds r1, r0, r5 - ldr r3, =0x0000052a - adds r0, r3 - ldrb r0, [r0] - lsls r0, 1 - ldrb r1, [r1] - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] - bl FacilityClassToPicIndex - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gUnknown_0856FB18 - ldr r1, [r6] - adds r5, r1, r5 - ldrb r3, [r5] - lsls r3, 1 - ldr r2, =0x0000052b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r3, r1 - adds r1, r3, r4 - ldrb r2, [r1] - adds r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r1, 0x8 - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D938 -_080C50AE: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4FF0 - - thumb_func_start sub_80C50D0 -sub_80C50D0: @ 80C50D0 - push {lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - mov r1, sp - movs r0, 0 - strh r0, [r1] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x0100c000 - mov r0, sp - bl CpuSet - movs r0, 0 - str r0, [sp, 0x4] - add r0, sp, 0x4 - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x05000100 - bl CpuSet - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C50D0 - - thumb_func_start sub_80C51C4 -sub_80C51C4: @ 80C51C4 - push {lr} - bl sub_80C51F0 - ldr r0, =sub_80C544C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C51C4 - - thumb_func_start sub_80C51D8 -sub_80C51D8: @ 80C51D8 - push {lr} - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldr r0, [r0] - bl SetMainCallback2 - bl sub_80C52E4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C51D8 - - thumb_func_start sub_80C51F0 -sub_80C51F0: @ 80C51F0 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_02039CEC - ldr r0, [r5] - cmp r0, 0 - beq _080C5204 - movs r0, 0x1 - b _080C52C8 - .pool -_080C5204: - movs r0, 0x18 - bl AllocZeroed - str r0, [r5] - cmp r0, 0 - bne _080C5214 - movs r0, 0x2 - b _080C52C8 -_080C5214: - str r4, [r0] - bl GetCurrentRegionMapSectionId - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3A - beq _080C5232 - cmp r4, 0xCA - beq _080C5232 - ldr r0, [r5] - movs r1, 0xB0 - strh r1, [r0, 0x8] - movs r1, 0x68 - strh r1, [r0, 0xA] - b _080C5240 -_080C5232: - ldr r2, =gUnknown_02039CEC - ldr r1, [r2] - movs r0, 0xB0 - strh r0, [r1, 0x8] - movs r0, 0x30 - strh r0, [r1, 0xA] - adds r5, r2, 0 -_080C5240: - ldr r1, [r5] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000eb8 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1, 0x6] - bl CanCopyRecordedBattleSaveData - ldr r3, [r5] - movs r1, 0x1 - ands r0, r1 - ldrb r2, [r3, 0xE] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xE] - ldr r2, [r5] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - bl sub_80C2E40 - ldr r3, [r5] - lsls r0, 4 - ldrb r2, [r3, 0xE] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xE] - movs r4, 0 - adds r6, r5, 0 -_080C5286: - lsls r5, r4, 1 - ldr r1, =0x000008c4 - adds r0, r5, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C52A2 - ldr r1, [r6] - adds r1, 0xF - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C52A2: - ldr r2, =0x000008c5 - adds r0, r5, r2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C52BC - ldr r1, [r6] - adds r1, 0xF - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C52BC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080C5286 - movs r0, 0 -_080C52C8: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C51F0 - - thumb_func_start sub_80C52E4 -sub_80C52E4: @ 80C52E4 - push {r4,lr} - ldr r4, =gUnknown_02039CEC - ldr r0, [r4] - cmp r0, 0 - beq _080C5308 - movs r1, 0 - movs r2, 0x18 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - b _080C530A - .pool -_080C5308: - movs r0, 0x1 -_080C530A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C52E4 - - thumb_func_start sub_80C5310 -sub_80C5310: @ 80C5310 - push {r4,lr} - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - cmp r0, 0 - beq _080C5324 - movs r0, 0x1 - b _080C533A - .pool -_080C5324: - ldr r0, =0x00002434 - bl AllocZeroed - str r0, [r4] - cmp r0, 0 - beq _080C5338 - movs r0, 0 - b _080C533A - .pool -_080C5338: - movs r0, 0x2 -_080C533A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C5310 - - thumb_func_start sub_80C5340 -sub_80C5340: @ 80C5340 - push {r4,lr} - bl FreeAllWindowBuffers - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - cmp r0, 0 - bne _080C5358 - movs r0, 0x1 - b _080C53A0 - .pool -_080C5358: - ldr r0, [r0, 0x28] - cmp r0, 0 - beq _080C5368 - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x28] -_080C5368: - ldr r0, [r4] - ldr r0, [r0, 0x24] - cmp r0, 0 - beq _080C537A - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x24] -_080C537A: - ldr r0, [r4] - ldr r0, [r0, 0x20] - cmp r0, 0 - beq _080C538C - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x20] -_080C538C: - ldr r0, [r4] - ldr r2, =0x00002434 - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_080C53A0: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C5340 - - thumb_func_start pokemon_details -pokemon_details: @ 80C53AC - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =gUnknown_02039CF0 - ldr r6, [r0] - adds r0, r6, 0 - adds r0, 0x2C - ldrb r0, [r0] - cmp r0, 0 - beq _080C5416 - ldr r3, =gUnknown_085713E0 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r4, [r0, 0xE] - lsls r4, 28 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r0, r3 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r1, 8 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r5, r3, 0x2 - adds r0, r5 - movs r7, 0 - ldrsh r2, [r0, r7] - lsls r2, 8 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r0, r3 - movs r7, 0 - ldrsh r3, [r0, r7] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - adds r4, r5 - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp] - movs r7, 0x2E - ldrsh r0, [r6, r7] - str r0, [sp, 0x4] - movs r4, 0x30 - ldrsh r0, [r6, r4] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine -_080C5416: - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_details - - thumb_func_start sub_80C5438 -sub_80C5438: @ 80C5438 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - pop {r0} - bx r0 - thumb_func_end sub_80C5438 - - thumb_func_start sub_80C544C -sub_80C544C: @ 80C544C - push {lr} - bl sub_80C5484 - cmp r0, 0 - beq _080C5464 - ldr r0, =sub_80C5A48 - movs r1, 0 - bl CreateTask - ldr r0, =sub_80C5438 - bl SetMainCallback2 -_080C5464: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C544C - - thumb_func_start sub_80C5470 -sub_80C5470: @ 80C5470 - push {lr} - bl sub_80C570C - cmp r0, 0 - beq _080C547E - bl sub_80C51D8 -_080C547E: - pop {r0} - bx r0 - thumb_func_end sub_80C5470 - - thumb_func_start sub_80C5484 -sub_80C5484: @ 80C5484 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp, 0x8] - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0xA - bls _080C5498 - b _080C56F4 -_080C5498: - lsls r0, 2 - ldr r1, =_080C54AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C54AC: - .4byte _080C54D8 - .4byte _080C54EE - .4byte _080C54F4 - .4byte _080C550A - .4byte _080C5510 - .4byte _080C5560 - .4byte _080C5570 - .4byte _080C55D0 - .4byte _080C5624 - .4byte _080C5684 - .4byte _080C56D0 -_080C54D8: - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - movs r0, 0x2 - bl DisableInterrupts - b _080C56F4 -_080C54EE: - bl sub_80C50D0 - b _080C56F4 -_080C54F4: - bl ResetTasks - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetPaletteFade - bl reset_temp_tile_data_buffers - b _080C56F4 -_080C550A: - bl sub_80C5310 - b _080C56F4 -_080C5510: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085713E8 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_02039CF0 - ldr r1, [r4] - adds r1, 0x32 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001032 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00002032 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0x1 - bl SetBgAttribute - b _080C56F4 - .pool -_080C5560: - ldr r0, =gUnknown_08571400 - bl InitWindows - bl DeactivateAllTextPrinters - b _080C56F4 - .pool -_080C5570: - ldr r0, =gUnknown_085712F8 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r4, =gUnknown_02039CF0 - ldr r1, [r4] - str r0, [r1, 0x20] - ldr r0, =gUnknown_08571060 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r1, [r4] - str r0, [r1, 0x24] - ldr r0, =gUnknown_085712C0 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r1, [r4] - str r0, [r1, 0x28] - ldr r1, =gUnknown_08DE08C8 - movs r4, 0 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DE2084 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _080C56F4 - .pool -_080C55D0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _080C55DC - b _080C56FE -_080C55DC: - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080C56F4 -_080C5624: - ldr r4, =gUnknown_08DE07C8 - movs r2, 0xD0 - lsls r2, 1 - adds r0, r4, 0 - movs r1, 0 - bl LoadPalette - ldr r5, =gUnknown_02039CEC - ldr r0, [r5] - ldrb r0, [r0, 0xE] - lsrs r0, 4 - lsls r0, 5 - adds r4, 0x20 - adds r0, r4 - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette - movs r0, 0 - bl stdpal_get - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - bl sub_80C629C - ldr r1, [r5] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 - ldr r5, [r5] - ldrb r0, [r5, 0xE] - movs r1, 0xE - ands r1, r0 - cmp r1, 0x2 - beq _080C5674 - cmp r1, 0x4 - bne _080C56F4 -_080C5674: - movs r0, 0 - strh r0, [r5, 0x4] - movs r0, 0x1 - b _080C5700 - .pool -_080C5684: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - bl sub_80C62DC - ldr r0, =pokemon_details - bl SetVBlankCallback - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _080C56F4 - .pool -_080C56D0: - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C56FE - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - strh r1, [r0, 0x4] - movs r0, 0x1 - b _080C5700 - .pool -_080C56F4: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C56FE: - movs r0, 0 -_080C5700: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C5484 - - thumb_func_start sub_80C570C -sub_80C570C: @ 80C570C - push {lr} - sub sp, 0x4 - ldr r1, =gUnknown_02039CEC - ldr r0, [r1] - ldrh r0, [r0, 0x4] - adds r2, r1, 0 - cmp r0, 0x5 - bhi _080C57E4 - lsls r0, 2 - ldr r1, =_080C5730 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C5730: - .4byte _080C5748 - .4byte _080C5770 - .4byte _080C577C - .4byte _080C57A6 - .4byte _080C57AC - .4byte _080C57BE -_080C5748: - ldr r0, [r2] - ldrb r0, [r0, 0xE] - movs r1, 0xE - ands r1, r0 - cmp r1, 0x2 - beq _080C576A - cmp r1, 0x4 - beq _080C576A - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _080C57E4 -_080C576A: - ldr r1, [r2] - movs r0, 0x2 - b _080C57EC -_080C5770: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - beq _080C57E4 - b _080C57EE -_080C577C: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - b _080C57E4 -_080C57A6: - bl sub_80C63FC - b _080C57E4 -_080C57AC: - bl sub_80C50D0 - bl ResetTasks - bl ResetSpriteData - bl FreeAllSpritePalettes - b _080C57E4 -_080C57BE: - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - bl sub_80C5340 - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x4] - movs r0, 0x1 - b _080C57F0 - .pool -_080C57E4: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 -_080C57EC: - strh r0, [r1, 0x4] -_080C57EE: - movs r0, 0 -_080C57F0: - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C570C - - thumb_func_start sub_80C57FC -sub_80C57FC: @ 80C57FC - push {r4-r7,lr} - lsls r0, 16 - lsrs r6, r0, 16 - movs r4, 0 - ldr r7, =gUnknown_08571454 - lsls r1, 16 - asrs r5, r1, 16 -_080C580A: - lsls r0, r4, 3 - adds r3, r0, r7 - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, r5 - bgt _080C5854 - movs r1, 0x2 - ldrsh r0, [r3, r1] - cmp r0, r5 - blt _080C5854 - movs r0, 0x4 - ldrsh r1, [r3, r0] - lsls r0, r6, 16 - asrs r2, r0, 16 - cmp r1, r2 - bgt _080C5854 - movs r1, 0x6 - ldrsh r0, [r3, r1] - cmp r0, r2 - blt _080C5854 - cmp r4, 0x5 - bls _080C5842 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080C585E -_080C5842: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _080C5860 - .pool -_080C5854: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xC - bls _080C580A -_080C585E: - movs r0, 0 -_080C5860: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80C57FC - - thumb_func_start sub_80C5868 -sub_80C5868: @ 80C5868 - push {lr} - bl sub_80C5484 - cmp r0, 0 - beq _080C58C6 - ldr r1, =gUnknown_02039CEC - ldr r0, [r1] - ldrb r0, [r0, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x1 - blt _080C58AC - cmp r0, 0x2 - bgt _080C58AC - ldr r0, =sub_80C5BD8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - b _080C58C0 - .pool -_080C58AC: - ldr r2, [r1] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - ldr r0, =sub_80C5A48 - movs r1, 0 - bl CreateTask -_080C58C0: - ldr r0, =sub_80C5438 - bl SetMainCallback2 -_080C58C6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5868 - - thumb_func_start sub_80C58D4 -sub_80C58D4: @ 80C58D4 - push {r4,lr} - ldr r4, =gUnknown_02039CF8 - ldr r0, [r4] - bl sub_80C51F0 - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r4, 0x4] - strh r0, [r1, 0x8] - ldrh r0, [r4, 0x6] - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x8 - bl memset - bl InBattlePyramid - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080C5914 - cmp r0, 0x2 - beq _080C591C - bl Overworld_PlaySpecialMapMusic - b _080C5924 - .pool -_080C5914: - ldr r0, =0x000001cd - b _080C5920 - .pool -_080C591C: - movs r0, 0xE7 - lsls r0, 1 -_080C5920: - bl PlayBGM -_080C5924: - ldr r0, =sub_80C5868 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C58D4 - - thumb_func_start sub_80C5934 -sub_80C5934: @ 80C5934 - push {lr} - bl sub_80C570C - cmp r0, 0 - beq _080C599A - ldr r0, =gUnknown_02039CEC - ldr r2, [r0] - ldrb r0, [r2, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x2 - beq _080C5994 - cmp r0, 0x2 - bgt _080C595C - cmp r0, 0x1 - beq _080C5962 - b _080C599A - .pool -_080C595C: - cmp r0, 0x3 - beq _080C5970 - b _080C599A -_080C5962: - ldr r0, =sub_80C5868 - bl sub_80C6454 - b _080C599A - .pool -_080C5970: - ldr r1, =gUnknown_02039CF8 - ldr r0, [r2] - str r0, [r1] - ldrh r0, [r2, 0x8] - strh r0, [r1, 0x4] - ldrh r0, [r2, 0xA] - strh r0, [r1, 0x6] - bl sub_80C52E4 - ldr r0, =sub_80C58D4 - bl PlayRecordedBattle - b _080C599A - .pool -_080C5994: - ldr r0, =sub_80C5868 - bl sub_80C4DDC -_080C599A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5934 - - thumb_func_start sub_80C59A4 -sub_80C59A4: @ 80C59A4 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, r3, 0 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x1 - blt _080C59CC - cmp r1, 0x2 - ble _080C59F4 - cmp r1, 0x3 - bne _080C59CC - ldr r0, =gUnknown_02039CEC - ldr r2, [r0] - ldrb r1, [r2, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080C59D4 -_080C59CC: - movs r0, 0 - b _080C5A30 - .pool -_080C59D4: - movs r0, 0xF - negs r0, r0 - ands r0, r1 - movs r1, 0x6 - orrs r0, r1 - strb r0, [r2, 0xE] - adds r0, r3, 0 - bl DestroyTask - ldr r0, =sub_80C5934 - bl SetMainCallback2 - b _080C5A1A - .pool -_080C59F4: - ldr r0, =gUnknown_02039CEC - ldr r3, [r0] - movs r0, 0x7 - ands r2, r0 - lsls r2, 1 - ldrb r1, [r3, 0xE] - subs r0, 0x16 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0xE] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80C5BD8 - str r1, [r0] - movs r1, 0 - strh r1, [r0, 0x8] -_080C5A1A: - ldr r0, =gUnknown_02039CEC - ldr r2, [r0] - ldr r0, =gUnknown_02039CF0 - ldr r1, [r0] - ldr r0, [r1] - ldrh r0, [r0, 0x20] - strh r0, [r2, 0x8] - ldr r0, [r1] - ldrh r0, [r0, 0x22] - strh r0, [r2, 0xA] - movs r0, 0x1 -_080C5A30: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C59A4 - - thumb_func_start sub_80C5A48 -sub_80C5A48: @ 80C5A48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r2, =gMain - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C5A80 - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x22] - movs r7, 0x22 - ldrsh r0, [r1, r7] - cmp r0, 0x8 - ble _080C5A80 - subs r0, r3, 0x2 - strh r0, [r1, 0x22] - ldr r1, [r4] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x7 - bgt _080C5A7E - movs r0, 0x2 - strh r0, [r1, 0x22] -_080C5A7E: - movs r5, 0x1 -_080C5A80: - ldrh r1, [r2, 0x2C] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C5AAE - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x22] - movs r7, 0x22 - ldrsh r0, [r1, r7] - cmp r0, 0x87 - bgt _080C5AAE - adds r0, r3, 0x2 - strh r0, [r1, 0x22] - ldr r1, [r4] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x88 - ble _080C5AAC - movs r0, 0x88 - strh r0, [r1, 0x22] -_080C5AAC: - movs r5, 0x1 -_080C5AAE: - ldrh r1, [r2, 0x2C] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080C5ADC - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x20] - movs r7, 0x20 - ldrsh r0, [r1, r7] - cmp r0, 0x5 - ble _080C5ADC - subs r0, r3, 0x2 - strh r0, [r1, 0x20] - ldr r1, [r4] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x4 - bgt _080C5ADA - movs r0, 0x5 - strh r0, [r1, 0x20] -_080C5ADA: - movs r5, 0x1 -_080C5ADC: - ldrh r1, [r2, 0x2C] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080C5B0A - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x20] - movs r7, 0x20 - ldrsh r0, [r1, r7] - cmp r0, 0xE7 - bgt _080C5B0A - adds r0, r3, 0x2 - strh r0, [r1, 0x20] - ldr r1, [r4] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0xE8 - ble _080C5B08 - movs r0, 0xE8 - strh r0, [r1, 0x20] -_080C5B08: - movs r5, 0x1 -_080C5B0A: - cmp r5, 0 - bne _080C5B88 - ldr r4, =gUnknown_02039CEC - ldr r0, [r4] - ldrb r3, [r0, 0xC] - cmp r3, 0 - beq _080C5B5E - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C5B5E - cmp r3, 0x3 - bhi _080C5B48 - movs r0, 0x5 - bl PlaySE - ldr r0, [r4] - ldrb r1, [r0, 0xC] - adds r0, r6, 0 - bl sub_80C59A4 - cmp r0, 0 - bne _080C5BCA - b _080C5B5E - .pool -_080C5B48: - cmp r3, 0x4 - bne _080C5B5E - movs r0, 0x3 - bl PlaySE - ldr r0, =sub_80C5470 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_080C5B5E: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C5BCA - movs r0, 0x3 - bl PlaySE - ldr r0, =sub_80C5470 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask - b _080C5BCA - .pool -_080C5B88: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0] - ldrh r0, [r1, 0x20] - subs r0, 0x5 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r1, 0x22] - adds r1, 0x5 - lsls r1, 16 - asrs r1, 16 - bl sub_80C57FC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_02039CEC - ldr r0, [r4] - ldrb r0, [r0, 0xC] - cmp r0, r5 - beq _080C5BCA - adds r0, r5, 0 - bl sub_80C5ED0 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - strb r0, [r1, 0xD] - ldr r0, [r4] - strb r5, [r0, 0xC] - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 -_080C5BCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5A48 - - thumb_func_start sub_80C5BD8 -sub_80C5BD8: @ 80C5BD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r5, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 - adds r6, r5, r0 - ldr r7, =gUnknown_02039CEC - ldr r0, [r7] - ldrh r0, [r0, 0x4] - cmp r0, 0x1 - beq _080C5CD4 - cmp r0, 0x1 - bgt _080C5C0C - cmp r0, 0 - beq _080C5C14 - b _080C5D9C - .pool -_080C5C0C: - cmp r0, 0x2 - bne _080C5C12 - b _080C5D2A -_080C5C12: - b _080C5D9C -_080C5C14: - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5C4C - movs r0, 0x1 - movs r1, 0 - bl sub_80C5F58 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r6, 0x2] - strh r0, [r6, 0x4] - movs r0, 0x15 - strh r0, [r6, 0x6] - strh r0, [r6, 0x8] - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _080C5CA4 - .pool -_080C5C4C: - movs r1, 0xFE - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r6, 0x2] - strh r0, [r6, 0x4] - movs r1, 0x15 - negs r1, r1 - adds r0, r1, 0 - strh r0, [r6, 0x6] - strh r0, [r6, 0x8] - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - bl sub_80C62DC - ldr r0, =pokemon_details - bl SetVBlankCallback - movs r5, 0x1 - negs r5, r5 - ldr r4, =0x00007fff - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r4, 0 - bl BlendPalettes - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_080C5CA4: - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - adds r0, 0x2C - movs r1, 0x1 - strb r1, [r0] - movs r1, 0x2 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x2E] - movs r1, 0x4 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x30] - b _080C5D9C - .pool -_080C5CD4: - bl UpdatePaletteFade - ldrh r0, [r6, 0x6] - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r6, 0x2] - ldrh r0, [r6, 0x8] - ldrh r1, [r6, 0x4] - adds r0, r1 - strh r0, [r6, 0x4] - movs r1, 0x2 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r4, =gUnknown_02039CF0 - ldr r1, [r4] - strh r0, [r1, 0x2E] - movs r1, 0x4 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x30] - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5D1C - movs r0, 0x2 - ldrsh r1, [r6, r0] - movs r0, 0xFE - lsls r0, 1 - cmp r1, r0 - ble _080C5DA6 - b _080C5D9C - .pool -_080C5D1C: - movs r0, 0x2 - ldrsh r1, [r6, r0] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _080C5DA6 - b _080C5D9C -_080C5D2A: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x2C - ldrb r0, [r1] - cmp r0, 0 - beq _080C5D3C - movs r0, 0 - strb r0, [r1] -_080C5D3C: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _080C5DA6 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5D64 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =sub_80C5934 - bl SetMainCallback2 - b _080C5D82 - .pool -_080C5D64: - movs r0, 0 - movs r1, 0 - bl sub_80C5F58 - ldr r2, [r7] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - mov r0, r8 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_80C5A48 - str r1, [r0] -_080C5D82: - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0 - bl SetBgAttribute - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - movs r0, 0 - b _080C5DA4 - .pool -_080C5D9C: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 -_080C5DA4: - strh r0, [r1, 0x4] -_080C5DA6: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5BD8 - - thumb_func_start sub_80C5DB8 -sub_80C5DB8: @ 80C5DB8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r4, 0 -_080C5DC2: - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080C5DC2 - ldr r4, =gText_SymbolsEarned - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r6, =gUnknown_08571448 - str r6, [sp] - movs r0, 0 - mov r8, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x5 - bl AddTextPrinterParameterized3 - ldr r4, =gText_BattleRecord - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x5 - bl AddTextPrinterParameterized3 - str r6, [sp] - mov r0, r8 - str r0, [sp, 0x4] - ldr r0, =gText_BattlePoints - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x8 - movs r2, 0x5 - movs r3, 0x4 - bl AddTextPrinterParameterized3 - ldr r4, =gStringVar4 - ldr r5, =gUnknown_02039CEC - ldr r0, [r5] - ldrh r1, [r0, 0x6] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - movs r0, 0x8 - adds r1, r4, 0 - movs r2, 0x5B - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x8 - movs r3, 0x10 - bl AddTextPrinterParameterized3 - ldr r1, [r5] - ldrh r0, [r1, 0x8] - subs r0, 0x5 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r1, 0xA] - adds r1, 0x5 - lsls r1, 16 - asrs r1, 16 - bl sub_80C57FC - ldr r1, [r5] - strb r0, [r1, 0xC] - ldr r0, [r5] - mov r1, r8 - strb r1, [r0, 0xD] - ldr r0, [r5] - ldrb r0, [r0, 0xC] - bl sub_80C5ED0 - movs r4, 0 -_080C5E92: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080C5E92 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5DB8 - - thumb_func_start sub_80C5ED0 -sub_80C5ED0: @ 80C5ED0 - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0x3 - bne _080C5F18 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r0, [r0, 0xE] - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _080C5F18 - ldr r0, =gUnknown_0857144B - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_08571614 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0 - bl AddTextPrinterParameterized3 - b _080C5F3A - .pool -_080C5F18: - cmp r4, 0 - beq _080C5F3A - ldr r0, =gUnknown_0857144B - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r1, =gUnknown_08571614 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0 - bl AddTextPrinterParameterized3 -_080C5F3A: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5ED0 - - thumb_func_start sub_80C5F58 -sub_80C5F58: @ 80C5F58 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r0, [r0, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x1 - beq _080C5F80 - cmp r0, 0x2 - beq _080C5FC2 - b _080C60EE - .pool -_080C5F80: - cmp r2, 0 - beq _080C5FA8 - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x20] - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C6004 - .pool -_080C5FA8: - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x10 - movs r3, 0x3 - bl FillBgTilemapBufferRect - b _080C6004 -_080C5FC2: - cmp r2, 0 - beq _080C5FEC - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x20] - adds r1, 0x54 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r2, 0x10 - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C6004 - .pool -_080C5FEC: - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x10 - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C6004: - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - cmp r7, 0 - beq _080C6084 - movs r4, 0xFE - lsls r4, 1 - adds r0, r4, 0 - bl sub_8151624 - adds r6, r0, 0 - lsls r6, 16 - asrs r6, 16 - adds r0, r4, 0 - bl sub_8151624 - lsls r0, 16 - asrs r0, 16 - ldr r5, =gUnknown_085713E0 - ldr r1, =gUnknown_02039CEC - ldr r1, [r1] - ldrb r4, [r1, 0xE] - lsls r4, 28 - lsrs r1, r4, 29 - subs r1, 0x1 - lsls r1, 2 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r1, 8 - lsrs r2, r4, 29 - subs r2, 0x1 - lsls r2, 2 - adds r3, r5, 0x2 - mov r8, r3 - add r2, r8 - movs r3, 0 - ldrsh r2, [r2, r3] - lsls r2, 8 - lsrs r3, r4, 29 - subs r3, 0x1 - lsls r3, 2 - adds r3, r5 - movs r5, 0 - ldrsh r3, [r3, r5] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - add r4, r8 - movs r5, 0 - ldrsh r4, [r4, r5] - str r4, [sp] - str r6, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine - b _080C60EE - .pool -_080C6084: - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - bl sub_8151624 - adds r6, r0, 0 - lsls r6, 16 - asrs r6, 16 - adds r0, r4, 0 - bl sub_8151624 - lsls r0, 16 - asrs r0, 16 - ldr r5, =gUnknown_085713E0 - ldr r1, =gUnknown_02039CEC - ldr r1, [r1] - ldrb r4, [r1, 0xE] - lsls r4, 28 - lsrs r1, r4, 29 - subs r1, 0x1 - lsls r1, 2 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r1, 8 - lsrs r2, r4, 29 - subs r2, 0x1 - lsls r2, 2 - adds r3, r5, 0x2 - mov r8, r3 - add r2, r8 - movs r3, 0 - ldrsh r2, [r2, r3] - lsls r2, 8 - lsrs r3, r4, 29 - subs r3, 0x1 - lsls r3, 2 - adds r3, r5 - movs r5, 0 - ldrsh r3, [r3, r5] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - add r4, r8 - movs r5, 0 - ldrsh r4, [r4, r5] - str r4, [sp] - str r6, [sp, 0x4] - str r0, [sp, 0x8] - str r7, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine -_080C60EE: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5F58 - - thumb_func_start sub_80C6104 -sub_80C6104: @ 80C6104 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r5, 0x2 - beq _080C614C - cmp r5, 0x2 - bgt _080C611E - cmp r5, 0x1 - beq _080C6128 - b _080C61C4 -_080C611E: - cmp r5, 0x3 - beq _080C6170 - cmp r5, 0x4 - beq _080C61A4 - b _080C61C4 -_080C6128: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C614C: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xA8 - lsls r0, 1 - adds r1, r0 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - b _080C6192 - .pool -_080C6170: - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C61C4 - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x28] - movs r0, 0xC - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x2 -_080C6192: - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C61A4: - ldr r1, =gUnknown_08DE3350 - movs r0, 0x9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x15 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C61C4: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080C6294 -_080C61CE: - cmp r4, 0x2 - beq _080C620C - cmp r4, 0x2 - bgt _080C61DC - cmp r4, 0x1 - beq _080C61E6 - b _080C6284 -_080C61DC: - cmp r4, 0x3 - beq _080C6230 - cmp r4, 0x4 - beq _080C6264 - b _080C6284 -_080C61E6: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - adds r1, 0xA8 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C620C: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xFC - lsls r0, 1 - adds r1, r0 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - b _080C6254 - .pool -_080C6230: - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C6294 - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x28] - adds r1, 0x48 - movs r0, 0xC - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x2 -_080C6254: - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C6264: - ldr r1, =gUnknown_08DE3374 - movs r0, 0x9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x15 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C6284: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080C6294 -_080C628E: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_080C6294: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80C6104 - - thumb_func_start sub_80C629C -sub_80C629C: @ 80C629C - push {r4,lr} - ldr r1, =gUnknown_08DE3060 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r4, =gUnknown_02039CEC - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 - ldr r0, [r4] - ldrb r1, [r0, 0xE] - lsls r1, 28 - lsrs r1, 29 - movs r0, 0x1 - bl sub_80C5F58 - bl sub_80C5DB8 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C629C - - thumb_func_start sub_80C62DC -sub_80C62DC: @ 80C62DC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - movs r5, 0 - bl FreeAllSpritePalettes - bl ResetAffineAnimData - ldr r0, =gUnknown_085714E4 - bl LoadSpritePalettes - ldr r4, =gUnknown_085714BC - adds r0, r4, 0 - bl LoadCompressedSpriteSheet - adds r4, 0x10 - adds r0, r4, 0 - bl LoadCompressedSpriteSheet - ldr r0, =gUnknown_085715B4 - ldr r1, =gUnknown_02039CEC - ldr r2, [r1] - movs r3, 0x8 - ldrsh r1, [r2, r3] - movs r6, 0xA - ldrsh r2, [r2, r6] - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_02039CF0 - ldr r2, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - str r1, [r2] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - mov r8, sp - mov r9, r3 -_080C633C: - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - adds r0, 0xF - adds r2, r0, r5 - ldrb r0, [r2] - adds r4, r5, 0x1 - cmp r0, 0 - beq _080C63C2 - mov r1, sp - ldr r0, =gUnknown_085715E4 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - mov r7, r8 - ldrh r0, [r7, 0x2] - ldr r1, =0x0000ffff - adds r0, r1 - ldrb r2, [r2] - adds r0, r2 - strh r0, [r7, 0x2] - ldr r1, =gUnknown_08571454 - adds r0, r5, 0x6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x4] - adds r1, 0x8 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r0] - adds r2, 0x6 - lsls r2, 16 - asrs r2, 16 - lsls r3, r4, 24 - lsrs r3, 24 - mov r0, sp - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r3, r9 - ldr r2, [r3] - lsls r3, r5, 2 - adds r2, 0x4 - adds r2, r3 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - str r1, [r2] - ldrb r2, [r1, 0x5] - movs r6, 0xD - negs r6, r6 - adds r0, r6, 0 - ands r2, r0 - movs r0, 0x8 - orrs r2, r0 - strb r2, [r1, 0x5] - mov r7, r9 - ldr r0, [r7] - adds r0, 0x4 - adds r0, r3 - ldr r0, [r0] - adds r1, r5, 0 - bl StartSpriteAnim -_080C63C2: - lsls r0, r4, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C633C - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C62DC - - thumb_func_start sub_80C63FC -sub_80C63FC: @ 80C63FC - push {r4-r6,lr} - movs r5, 0 - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - ldr r0, [r0] - bl DestroySprite - ldr r0, [r4] - str r5, [r0] - adds r6, r4, 0 -_080C6410: - ldr r0, [r6] - lsls r4, r5, 2 - adds r0, 0x4 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080C642C - bl DestroySprite - ldr r0, [r6] - adds r0, 0x4 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080C642C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C6410 - bl FreeAllSpritePalettes - movs r0, 0x2 - bl FreeSpriteTilesByTag - movs r0, 0 - bl FreeSpriteTilesByTag - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C63FC - - thumb_func_start nullsub_39 -nullsub_39: @ 80C6450 - bx lr - thumb_func_end nullsub_39 - - thumb_func_start sub_80C6454 -sub_80C6454: @ 80C6454 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_02039CF4 - ldr r0, [r5] - cmp r0, 0 - beq _080C6466 - adds r0, r4, 0 - bl SetMainCallback2 -_080C6466: - ldr r0, =0x00003014 - bl AllocZeroed - str r0, [r5] - str r4, [r0] - bl ResetTasks - ldr r0, =sub_80C67BC - movs r1, 0 - bl CreateTask - ldr r0, =sub_80C5438 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6454 - - thumb_func_start sub_80C6498 -sub_80C6498: @ 80C6498 - push {r4,lr} - bl ResetTasks - ldr r4, =gUnknown_02039CF4 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - ldr r2, =0x00003014 - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6498 - - thumb_func_start sub_80C64CC -sub_80C64CC: @ 80C64CC - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0x7 - bls _080C64DC - b _080C6694 -_080C64DC: - lsls r0, 2 - ldr r1, =_080C64F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C64F0: - .4byte _080C6510 - .4byte _080C6520 - .4byte _080C6526 - .4byte _080C6538 - .4byte _080C65C0 - .4byte _080C65E8 - .4byte _080C6628 - .4byte _080C6678 -_080C6510: - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - b _080C6694 -_080C6520: - bl sub_80C50D0 - b _080C6694 -_080C6526: - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetPaletteFade - bl reset_temp_tile_data_buffers - b _080C6694 -_080C6538: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085713F4 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_02039CF4 - ldr r1, [r4] - adds r1, 0x12 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001012 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00002012 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _080C6618 - .pool -_080C65C0: - ldr r0, =gUnknown_08571428 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_80C6B94 - ldr r1, =gUnknown_0856FBBC - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _080C6694 - .pool -_080C65E8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _080C669E - ldr r0, =gUnknown_08DE07C8 - movs r2, 0xD0 - lsls r2, 1 - movs r1, 0 - bl LoadPalette - movs r0, 0 - bl stdpal_get - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r1, =gUnknown_08570E00 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer -_080C6618: - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080C6694 - .pool -_080C6628: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - bl sub_80C6974 - ldr r0, =pokemon_details - bl SetVBlankCallback - movs r5, 0x1 - negs r5, r5 - ldr r4, =0x00007fff - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r4, 0 - bl BlendPalettes - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _080C6694 - .pool -_080C6678: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C669E - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - strh r1, [r0, 0x4] - movs r0, 0x1 - b _080C66A0 - .pool -_080C6694: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C669E: - movs r0, 0 -_080C66A0: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C64CC - - thumb_func_start sub_80C66AC -sub_80C66AC: @ 80C66AC - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0x5 - bhi _080C67A4 - lsls r0, 2 - ldr r1, =_080C66CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C66CC: - .4byte _080C66E4 - .4byte _080C66FC - .4byte _080C6722 - .4byte _080C6732 - .4byte _080C6774 - .4byte _080C6782 -_080C66E4: - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _080C67A4 - .pool -_080C66FC: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _080C67AE - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - b _080C67A4 -_080C6722: - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - b _080C67A4 -_080C6732: - ldr r4, =gUnknown_02039CF4 - ldr r0, [r4] - ldr r0, [r0, 0x4] - cmp r0, 0 - beq _080C6746 - bl DestroySprite - movs r0, 0 - bl FreeSpriteTilesByTag -_080C6746: - ldr r0, [r4] - ldr r0, [r0, 0xC] - cmp r0, 0 - beq _080C6758 - bl DestroySprite - movs r0, 0x1 - bl FreeSpriteTilesByTag -_080C6758: - ldr r0, [r4] - ldr r0, [r0, 0x8] - cmp r0, 0 - beq _080C676A - bl DestroySprite - movs r0, 0x4 - bl FreeSpriteTilesByTag -_080C676A: - bl FreeAllWindowBuffers - b _080C67A4 - .pool -_080C6774: - bl sub_80C50D0 - bl ResetSpriteData - bl FreeAllSpritePalettes - b _080C67A4 -_080C6782: - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x4] - movs r0, 0x1 - b _080C67B0 - .pool -_080C67A4: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C67AE: - movs r0, 0 -_080C67B0: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C66AC - - thumb_func_start sub_80C67BC -sub_80C67BC: @ 80C67BC - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _080C67D6 - b _080C68DA -_080C67D6: - lsls r0, 2 - ldr r1, =_080C67E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C67E8: - .4byte _080C6800 - .4byte _080C6806 - .4byte _080C686C - .4byte _080C6894 - .4byte _080C68C4 - .4byte _080C68CE -_080C6800: - bl sub_80C64CC - b _080C68C8 -_080C6806: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r2, 0x2 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _080C6824 - movs r0, 0x3 - bl PlaySE - movs r0, 0x4 - b _080C68DE - .pool -_080C6824: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C6848 - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x5 - bls _080C6844 - movs r0, 0 - bl sub_80C6C70 - b _080C68E0 - .pool -_080C6844: - strh r2, [r4] - b _080C68E0 -_080C6848: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C68E0 - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _080C6868 - movs r0, 0x1 - bl sub_80C6C70 - b _080C68E0 - .pool -_080C6868: - movs r0, 0x3 - b _080C68DE -_080C686C: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080C6882 - movs r0, 0 - bl sub_80C6C70 - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x1 - b _080C68DE -_080C6882: - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrh r0, [r1, 0x22] - adds r0, 0x4 - b _080C68B4 - .pool -_080C6894: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080C68AA - movs r0, 0x1 - bl sub_80C6C70 - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x1 - b _080C68DE -_080C68AA: - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrh r0, [r1, 0x22] - subs r0, 0x4 -_080C68B4: - strh r0, [r1, 0x22] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - b _080C68E0 - .pool -_080C68C4: - bl sub_80C66AC -_080C68C8: - cmp r0, 0 - bne _080C68DA - b _080C68E0 -_080C68CE: - adds r0, r2, 0 - bl DestroyTask - bl sub_80C6498 - b _080C68E0 -_080C68DA: - ldrh r0, [r4] - adds r0, 0x1 -_080C68DE: - strh r0, [r4] -_080C68E0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C67BC - - thumb_func_start sub_80C68E8 -sub_80C68E8: @ 80C68E8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xfffb0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x3 - bls _080C6904 - adds r0, r1, 0 - subs r0, 0xF - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C690C -_080C6904: - movs r0, 0x1 - b _080C696E - .pool -_080C690C: - adds r0, r1, 0 - subs r0, 0x12 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bhi _080C691C - movs r0, 0x2 - b _080C696E -_080C691C: - adds r0, r1, 0 - subs r0, 0x16 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C692C - movs r0, 0x3 - b _080C696E -_080C692C: - adds r0, r1, 0 - subs r0, 0x1C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C693C - movs r0, 0x4 - b _080C696E -_080C693C: - adds r0, r1, 0 - subs r0, 0x1F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C694C - movs r0, 0x5 - b _080C696E -_080C694C: - adds r0, r1, 0 - subs r0, 0x22 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _080C695C - movs r0, 0x6 - b _080C696E -_080C695C: - adds r0, r1, 0 - subs r0, 0x19 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080C696C - movs r0, 0 - b _080C696E -_080C696C: - movs r0, 0x7 -_080C696E: - pop {r1} - bx r1 - thumb_func_end sub_80C68E8 - - thumb_func_start sub_80C6974 -sub_80C6974: @ 80C6974 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - movs r7, 0 - bl FreeAllSpritePalettes - ldr r0, =gUnknown_085714E4 - bl LoadSpritePalettes - ldr r6, =gUnknown_085714BC - adds r0, r6, 0 - bl LoadCompressedSpriteSheet - ldr r0, =gUnknown_085715B4 - mov r8, r0 - ldr r4, =gUnknown_02039CF4 - ldr r0, [r4] - ldrb r2, [r0, 0x10] - lsls r2, 4 - adds r2, 0x8 - mov r0, r8 - movs r1, 0x9B - movs r3, 0x2 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - ldr r2, =gSprites - mov r9, r2 - add r1, r9 - str r1, [r0, 0x4] - ldrb r2, [r1, 0x5] - movs r5, 0xD - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r4] - ldr r1, [r0, 0x4] - adds r1, 0x3F - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r4] - ldr r0, [r0, 0x4] - movs r1, 0x1 - bl StartSpriteAnim - adds r6, 0x8 - adds r0, r6, 0 - bl LoadCompressedSpriteSheet - movs r3, 0x18 - add r8, r3 - ldr r6, =gUnknown_08571650 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r0, r6 - movs r2, 0x8 - ldrsh r1, [r0, r2] - movs r3, 0xA - ldrsh r2, [r0, r3] - mov r0, r8 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, [r4] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - add r0, r9 - str r0, [r1, 0xC] - ldrb r1, [r0, 0x5] - ands r5, r1 - strb r5, [r0, 0x5] - ldr r1, [r4] - ldr r0, [r1, 0xC] - ldrb r1, [r1, 0x10] - lsls r1, 4 - adds r1, r6 - ldrb r1, [r1, 0xC] - bl StartSpriteAnim - bl GetCurrentRegionMapSectionId - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3A - beq _080C6A40 - cmp r5, 0xCA - beq _080C6A40 - b _080C6B7A -_080C6A40: - ldr r4, =gSaveBlock1Ptr - ldr r2, [r4] - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r0, 0x4 - beq _080C6A52 - cmp r0, 0xE - bne _080C6A98 - movs r7, 0x37 -_080C6A52: - lsls r0, r7, 16 - asrs r0, 16 - ldrh r6, [r2] - adds r0, r6 - ldrh r4, [r2, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6A66 - adds r0, 0x7 -_080C6A66: - lsls r0, 13 - lsrs r7, r0, 16 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6A74 - adds r0, 0x7 -_080C6A74: - lsls r0, 13 - lsrs r4, r0, 16 - movs r5, 0 - b _080C6AF2 - .pool -_080C6A98: - lsls r0, 16 - lsrs r0, 16 - bl sub_80C68E8 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080C6AB4 - subs r0, r5, 0x1 - lsls r0, 4 - adds r0, r6 - ldrh r7, [r0, 0x8] - ldrh r4, [r0, 0xA] - b _080C6AF2 -_080C6AB4: - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x25 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xE - bne _080C6ACE - ldrh r0, [r1, 0x28] - adds r0, 0x37 - lsls r0, 16 - lsrs r7, r0, 16 - b _080C6AD0 -_080C6ACE: - ldrh r7, [r1, 0x28] -_080C6AD0: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r4, [r0, 0x2A] - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6AE0 - adds r0, 0x7 -_080C6AE0: - lsls r0, 13 - lsrs r7, r0, 16 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6AEE - adds r0, 0x7 -_080C6AEE: - lsls r0, 13 - lsrs r4, r0, 16 -_080C6AF2: - ldr r0, =gUnknown_085714D4 - bl LoadCompressedSpriteSheet - mov r1, sp - ldr r0, =gUnknown_085715FC - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r1, sp - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - adds r0, 0x4 - strh r0, [r1, 0x2] - cmp r5, 0 - beq _080C6B2C - lsls r1, r7, 16 - asrs r1, 16 - lsls r2, r4, 16 - b _080C6B3E - .pool -_080C6B2C: - lsls r1, r7, 19 - lsls r2, r4, 19 - movs r0, 0xA0 - lsls r0, 13 - adds r1, r0 - asrs r1, 16 - movs r3, 0x90 - lsls r3, 14 - adds r2, r3 -_080C6B3E: - asrs r2, 16 - mov r0, sp - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - ldr r4, =gUnknown_02039CF4 - ldr r2, [r4] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - str r1, [r2, 0x8] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C6B7A - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r1, 0x1 - bl StartSpriteAnim -_080C6B7A: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6974 - - thumb_func_start sub_80C6B94 -sub_80C6B94: @ 80C6B94 - push {r4-r6,lr} - sub sp, 0xC - movs r4, 0 -_080C6B9A: - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6B9A - movs r4, 0 - movs r6, 0 - ldr r5, =gUnknown_08571650 -_080C6BB8: - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r4, r0 - bne _080C6BF0 - lsls r1, r4, 4 - adds r3, r1, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0857144E - str r0, [sp] - str r6, [sp, 0x4] - adds r1, r5 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 - b _080C6C0E - .pool -_080C6BF0: - lsls r1, r4, 4 - adds r3, r1, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0857144B - str r0, [sp] - str r6, [sp, 0x4] - adds r1, r5 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 -_080C6C0E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080C6BB8 - ldr r0, =gUnknown_08571448 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r1, =gUnknown_08571650 - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0 - bl AddTextPrinterParameterized3 - movs r4, 0 -_080C6C40: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6C40 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6B94 - - thumb_func_start sub_80C6C70 -sub_80C6C70: @ 80C6C70 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - lsls r0, 24 - cmp r0, 0 - beq _080C6C8C - ldr r0, =gUnknown_02039CF4 - ldr r4, [r0] - ldrb r5, [r4, 0x10] - adds r0, r5, 0x6 - b _080C6C94 - .pool -_080C6C8C: - ldr r0, =gUnknown_02039CF4 - ldr r4, [r0] - ldrb r5, [r4, 0x10] - adds r0, r5, 0x1 -_080C6C94: - movs r1, 0x7 - bl __modsi3 - strb r0, [r4, 0x10] - lsls r0, r5, 4 - adds r3, r0, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r6, =gUnknown_0857144B - str r6, [sp] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x4] - ldr r4, =gUnknown_08571650 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 - ldr r5, =gUnknown_02039CF4 - ldr r1, [r5] - ldrb r3, [r1, 0x10] - lsls r3, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0x3 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 - ldr r1, [r5] - ldr r2, [r1, 0x4] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, 0x8 - strh r0, [r2, 0x22] - ldr r0, [r1, 0xC] - ldrb r1, [r1, 0x10] - lsls r1, 4 - adds r1, r4 - ldrb r1, [r1, 0xC] - bl StartSpriteAnim - ldr r1, [r5] - ldr r2, [r1, 0xC] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0, 0x8] - strh r0, [r2, 0x20] - ldr r2, [r1, 0xC] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0, 0xA] - strh r0, [r2, 0x22] - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - subs r6, 0x3 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - ldr r0, [r5] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r4, 0x4 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0 - bl AddTextPrinterParameterized3 - movs r4, 0 -_080C6D4A: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6D4A - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x6C - bl PlaySE - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6C70 - - thumb_func_start sub_80C6D80 -sub_80C6D80: @ 80C6D80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r0, [sp, 0x24] - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x28] - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x1C] - str r1, [sp, 0x20] - ldr r1, =0x00ffffff - ldr r0, [sp, 0x1C] - ands r0, r1 - movs r1, 0xC0 - lsls r1, 21 - orrs r0, r1 - str r0, [sp, 0x1C] - ldr r1, =0xffffff00 - add r5, sp, 0x1C - ldr r0, [r5, 0x4] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [r5, 0x4] - adds r0, r5, 0 - bl AddWindow - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r4, r0, 24 - lsrs r4, 24 - mov r0, r9 - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r6, r0, 0 - ldrb r0, [r5, 0x3] - lsls r0, 5 - adds r0, r6 - mov r8, r0 - ldr r1, [sp, 0x28] - cmp r1, 0 - bne _080C6E04 - add r0, sp, 0x14 - b _080C6E08 - .pool -_080C6E04: - add r0, sp, 0x14 - mov r1, r9 -_080C6E08: - strb r1, [r0] - add r1, sp, 0x14 - movs r2, 0 - movs r0, 0xF - strb r0, [r1, 0x1] - movs r0, 0xE - strb r0, [r1, 0x2] - mov r0, r10 - lsls r4, r0, 24 - lsrs r0, r4, 24 - str r2, [sp] - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0xC] - ldr r1, [sp, 0x24] - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParameterized4 - ldr r0, [sp, 0x4C] - mov r10, r4 - cmp r0, 0x6 - bls _080C6E3E - movs r0, 0x6 -_080C6E3E: - ldr r4, [sp, 0x4C] - subs r4, 0x6 - cmp r0, 0 - ble _080C6E70 - adds r5, r0, 0 -_080C6E48: - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x40 - bl CpuSet - adds r1, r7, 0 - adds r1, 0x80 - mov r0, r8 - movs r2, 0x40 - bl CpuSet - adds r6, 0x80 - movs r2, 0x80 - add r8, r2 - movs r0, 0x80 - lsls r0, 1 - adds r7, r0 - subs r5, 0x1 - cmp r5, 0 - bne _080C6E48 -_080C6E70: - cmp r4, 0 - ble _080C6E90 - add r0, sp, 0x18 - mov r2, r9 - lsls r1, r2, 4 - orrs r1, r2 - strh r1, [r0] - lsls r2, r4, 7 - ldr r1, =0x001fffff - ands r2, r1 - movs r1, 0x80 - lsls r1, 17 - orrs r2, r1 - adds r1, r7, 0 - bl CpuSet -_080C6E90: - mov r1, r10 - lsrs r0, r1, 24 - bl RemoveWindow - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6D80 - - thumb_func_start sub_80C6EAC -sub_80C6EAC: @ 80C6EAC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r0, [sp, 0x20] - str r1, [sp, 0x24] - adds r6, r3, 0 - ldr r0, [sp, 0x4C] - mov r9, r0 - ldr r1, [sp, 0x50] - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x28] - lsls r6, 24 - lsrs r6, 24 - mov r2, r9 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - ldr r0, [sp, 0x20] - bl StringLength_Multibyte - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp, 0x18] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x18] - ldr r1, =0xffffff00 - add r2, sp, 0x18 - mov r8, r2 - ldr r0, [r2, 0x4] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [r2, 0x4] - ldr r5, [sp, 0x18] - lsrs r5, 24 - lsls r5, 5 - mov r0, r8 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, r6, 4 - orrs r1, r6 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r7, r0, 0 - mov r0, r8 - ldrb r0, [r0, 0x3] - lsls r0, 5 - mov r8, r0 - add r8, r7 - add r0, sp, 0x14 - movs r1, 0 - strb r6, [r0] - mov r2, r9 - strb r2, [r0, 0x1] - mov r2, r10 - strb r2, [r0, 0x2] - str r1, [sp] - str r1, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - ldr r0, [sp, 0x20] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x2 - bl AddTextPrinterParameterized4 - lsrs r5, 1 - adds r0, r7, 0 - ldr r1, [sp, 0x24] - adds r2, r5, 0 - bl CpuSet - ldr r2, [sp, 0x24] - ldr r0, [sp, 0x28] - adds r1, r2, r0 - mov r0, r8 - adds r2, r5, 0 - bl CpuSet - adds r0, r4, 0 - bl RemoveWindow - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6EAC - - .align 2, 0 @ Don't pad with nop. diff --git a/data/event_scripts.s b/data/event_scripts.s index 67dbd9516..1da2a016f 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1262,7 +1262,7 @@ VerdanturfTown_PokemonCenter_1F_EventScript_27191E:: @ 827191E lock faceplayer setvar VAR_0x8004, 0 - specialvar VAR_RESULT, sub_80C2E40 + specialvar VAR_RESULT, CountPlayerTrainerStars compare VAR_RESULT, 4 goto_if_eq OldaleTown_PokemonCenter_1F_EventScript_271A68 msgbox gUnknown_082726EB, MSGBOX_YESNO diff --git a/data/maps/LilycoveCity/scripts.inc b/data/maps/LilycoveCity/scripts.inc index 02319e8cf..c1cec509f 100644 --- a/data/maps/LilycoveCity/scripts.inc +++ b/data/maps/LilycoveCity/scripts.inc @@ -157,7 +157,7 @@ LilycoveCity_EventScript_1E2D11:: @ 81E2D11 LilycoveCity_EventScript_1E2D1A:: @ 81E2D1A lockall - specialvar VAR_0x8004, sub_80F8940 + specialvar VAR_0x8004, CountPlayerContestPaintings switch VAR_0x8004 case 0, LilycoveCity_EventScript_1E2D3A msgbox LilycoveCity_Text_1E4571, MSGBOX_DEFAULT diff --git a/data/maps/LilycoveCity_ContestLobby/scripts.inc b/data/maps/LilycoveCity_ContestLobby/scripts.inc index 74bee15d3..42ce7beeb 100644 --- a/data/maps/LilycoveCity_ContestLobby/scripts.inc +++ b/data/maps/LilycoveCity_ContestLobby/scripts.inc @@ -100,7 +100,7 @@ LilycoveCity_ContestLobby_EventScript_21A314:: @ 821A314 return LilycoveCity_ContestLobby_EventScript_21A360:: @ 821A360 - specialvar VAR_0x8004, sub_80F8940 + specialvar VAR_0x8004, CountPlayerContestPaintings switch VAR_0x8004 case 1, LilycoveCity_ContestLobby_EventScript_21A3A2 case 2, LilycoveCity_ContestLobby_EventScript_21A3A6 diff --git a/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc b/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc index f7fd5f453..03ac733f9 100644 --- a/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc +++ b/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc @@ -6,7 +6,7 @@ LilycoveCity_CoveLilyMotel_2F_EventScript_2186D3:: @ 82186D3 faceplayer call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_2186F9 call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_21870F - specialvar VAR_RESULT, sub_80C08E4 + specialvar VAR_RESULT, HasAllHoennMons compare VAR_RESULT, 1 goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_218702 release diff --git a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc index da39ee655..f73fbf092 100644 --- a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc +++ b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc @@ -92,7 +92,7 @@ LilycoveCity_LilycoveMuseum_2F_Movement_219863: @ 8219863 LilycoveCity_LilycoveMuseum_2F_EventScript_219866:: @ 8219866 lockall goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_219921 - specialvar VAR_0x8004, sub_80F8940 + specialvar VAR_0x8004, CountPlayerContestPaintings switch VAR_0x8004 case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA diff --git a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc index 8568a72ef..1f65beda3 100644 --- a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc +++ b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc @@ -16,7 +16,7 @@ LittlerootTown_ProfessorBirchsLab_MapScript1_1F9CA1: @ 81F9CA1 end LittlerootTown_ProfessorBirchsLab_EventScript_1F9CCD:: @ 81F9CCD - specialvar VAR_RESULT, sub_80C08E4 + specialvar VAR_RESULT, HasAllHoennMons compare VAR_RESULT, 1 goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_1F9CE9 setobjectmovementtype 3, 3 diff --git a/data/pokenav/unk_struct_1.bin b/data/pokenav/unk_struct_1.bin deleted file mode 100644 index 18a696cf4..000000000 Binary files a/data/pokenav/unk_struct_1.bin and /dev/null differ diff --git a/data/pokenav/unk_struct_2.bin b/data/pokenav/unk_struct_2.bin deleted file mode 100644 index a3547fbbb..000000000 Binary files a/data/pokenav/unk_struct_2.bin and /dev/null differ diff --git a/data/pokenav/unk_struct_3.bin b/data/pokenav/unk_struct_3.bin deleted file mode 100644 index 93273aae2..000000000 Binary files a/data/pokenav/unk_struct_3.bin and /dev/null differ diff --git a/data/pokenav/unk_struct_4.bin b/data/pokenav/unk_struct_4.bin deleted file mode 100644 index 569193acd..000000000 Binary files a/data/pokenav/unk_struct_4.bin and /dev/null differ diff --git a/data/rom_81D1C44.s b/data/rom_81D1C44.s index d393580b8..9a012a6a7 100644 --- a/data/rom_81D1C44.s +++ b/data/rom_81D1C44.s @@ -249,15 +249,3 @@ gUnknown_0862608C:: @ 862608C gUnknown_0862609C:: @ 862609C .incbin "data/unknown_jp_62609C.bin" - -gUnknown_08626814:: @ 8626814 - .incbin "data/pokenav/unk_struct_1.bin" - -gUnknown_086276FC:: @ 86276FC - .incbin "data/pokenav/unk_struct_2.bin" - -gUnknown_086285E4:: @ 86285E4 - .incbin "data/pokenav/unk_struct_3.bin" - -gUnknown_086294CC:: @ 86294CC - .incbin "data/pokenav/unk_struct_4.bin" diff --git a/data/specials.inc b/data/specials.inc index a5f272dc9..b3ca15ed1 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -148,7 +148,7 @@ gSpecials:: @ 81DBA64 def_special sub_80F88E8 def_special sub_80F88DC def_special sub_80F8864 - def_special sub_80F8940 + def_special CountPlayerContestPaintings def_special ShowContestWinner def_special MauvilleGymSpecial2 def_special MauvilleGymSpecial1 @@ -345,7 +345,7 @@ gSpecials:: @ 81DBA64 def_special sub_80B05B4 def_special SetPacifidlogTMReceivedDay def_special GetDaysUntilPacifidlogTMAvailable - def_special sub_80C08E4 + def_special HasAllHoennMons def_special MonOTNameMatchesPlayer def_special BufferLottoTicketNumber def_special sub_81653CC @@ -481,7 +481,7 @@ gSpecials:: @ 81DBA64 def_special sub_813B7D8 def_special sub_81C72A4 def_special sp106_CreateStartMenu - def_special sub_80C2E40 + def_special CountPlayerTrainerStars def_special sub_813AC7C def_special sub_813ADB8 def_special sub_813ADD4 diff --git a/data/trainer_card.s b/data/trainer_card.s deleted file mode 100644 index f57973200..000000000 --- a/data/trainer_card.s +++ /dev/null @@ -1,402 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -.macro unk_trainer_card_struct text1, text2, short1, short2, short3, short4 - .4byte \text1 - .4byte \text2 - .2byte \short1 - .2byte \short2 - .2byte \short3 - .2byte \short4 -.endm - - .align 2 -gUnknown_0856F018:: @ 856F018 - .incbin "graphics/trainer_card/stickers_fr.4bpp.lz" - - .align 2 -gUnknown_0856F18C:: @ 856F18C - .incbin "graphics/trainer_card/unknown_56F18C.gbapal" - - .align 2 -gEmeraldTrainerCard1Star_Pal:: @ 856F1AC - .incbin "graphics/trainer_card/one_star.gbapal" - - .align 2 -gFireRedTrainerCard1Star_Pal:: @ 856F20C - .incbin "graphics/trainer_card/one_star_fr.gbapal" - - .align 2 -gEmeraldTrainerCard2Star_Pal:: @ 856F26C - .incbin "graphics/trainer_card/two_stars.gbapal" - - .align 2 -gFireRedTrainerCard2Star_Pal:: @ 856F2CC - .incbin "graphics/trainer_card/two_stars_fr.gbapal" - - .align 2 -gEmeraldTrainerCard3Star_Pal:: @ 856F32C - .incbin "graphics/trainer_card/three_stars.gbapal" - - .align 2 -gFireRedTrainerCard3Star_Pal:: @ 856F38C - .incbin "graphics/trainer_card/three_stars_fr.gbapal" - - .align 2 -gEmeraldTrainerCard4Star_Pal:: @ 856F3EC - .incbin "graphics/trainer_card/four_stars.gbapal" - - .align 2 -gFireRedTrainerCard4Star_Pal:: @ 856F44C - .incbin "graphics/trainer_card/four_stars_fr.gbapal" - - .align 2 -gUnknown_0856F4AC:: @ 856F4AC - .incbin "graphics/trainer_card/female_bg.gbapal" - - .align 2 -gUnknown_0856F4CC:: @ 856F4CC - .incbin "graphics/trainer_card/female_bg_fr.gbapal" - - .align 2 -gUnknown_0856F4EC:: @ 856F4EC - .incbin "graphics/trainer_card/badges.gbapal" - - .align 2 -gUnknown_0856F50C:: @ 856F50C - .incbin "graphics/trainer_card/badges_fr.gbapal" - - .align 2 -gUnknown_0856F52C:: @ 856F52C - .incbin "graphics/trainer_card/gold.gbapal" - - .align 2 -gUnknown_0856F54C:: @ 856F54C - .incbin "graphics/trainer_card/stickers_fr1.gbapal" - - .align 2 -gUnknown_0856F56C:: @ 856F56C - .incbin "graphics/trainer_card/stickers_fr2.gbapal" - - .align 2 -gUnknown_0856F58C:: @ 856F58C - .incbin "graphics/trainer_card/stickers_fr3.gbapal" - - .align 2 -gUnknown_0856F5AC:: @ 856F5AC - .incbin "graphics/trainer_card/stickers_fr4.gbapal" - - .align 2 -gUnknown_0856F5CC:: @ 856F5CC - .incbin "graphics/trainer_card/badges.4bpp.lz" - - .align 2 -gUnknown_0856F814:: @ 856F814 - .incbin "graphics/trainer_card/badges_fr.4bpp.lz" - - .align 2 -gUnknown_0856FAB4:: @ 856FAB4 - .4byte 0x000025b0, 0x000001d9, 0x000031e2, 0x003011f3 - - .align 2 -gUnknown_0856FAC4:: @ 856FAC4 - window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0253 - window_template 0x01, 0x01, 0x01, 0x1c, 0x12, 0x0f, 0x0001 - window_template 0x03, 0x13, 0x05, 0x09, 0x0a, 0x08, 0x0150 - null_window_template - - .align 2 -gEmeraldTrainerCardStarPals:: @ 856FAE4 - .4byte gEmeraldTrainerCard0Star_Pal - .4byte gEmeraldTrainerCard1Star_Pal - .4byte gEmeraldTrainerCard2Star_Pal - .4byte gEmeraldTrainerCard3Star_Pal - .4byte gEmeraldTrainerCard4Star_Pal - - .align 2 -gFireRedTrainerCardStarPals:: @ 856FAF8 - .4byte gFireRedTrainerCard0Star_Pal - .4byte gFireRedTrainerCard1Star_Pal - .4byte gFireRedTrainerCard2Star_Pal - .4byte gFireRedTrainerCard3Star_Pal - .4byte gFireRedTrainerCard4Star_Pal - -gUnknown_0856FB0C:: @ 856FB0C - .byte 0x00, 0x02, 0x03 - -gUnknown_0856FB0F:: @ 856FB0F - .byte 0x00, 0x04, 0x05 - -gUnknown_0856FB12:: @ 856FB12 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -gUnknown_0856FB18:: @ 856FB18 - .byte 0x0d, 0x04, 0x0d, 0x04, 0x01, 0x00, 0x01, 0x00 - -gUnknown_0856FB20:: @ 856FB20 - .byte 0x4e, 0x4f, 0x50, 0x51, 0x3c, 0x3f - - .align 2 -gUnknown_0856FB28:: @ 856FB28 - .4byte sub_80C4998 - .4byte sub_80C49D8 - .4byte sub_80C4B08 - .4byte sub_80C4C1C - .4byte sub_80C4C84 - .4byte sub_80C4DB0 - - .align 2 -gUnknown_0856FB40:: @ 856FB40 - .4byte gUnknown_0856FB0C - .4byte gUnknown_0856FB12 - -gUnknown_0856FB48:: @ 856FB48 - .byte 0x71, 0x68 - -gUnknown_0856FB4A:: @ 856FB4A - .byte 0x81, 0x78 - -gUnknown_0856FB4C:: @ 856FB4C - .byte 0xfd, 0x02, 0xf0, 0xfd, 0x03, 0xf0, 0xfd, 0x04, 0xff - -gUnknown_0856FB55:: @ 856FB55 - .byte 0x08, 0x10 - -gUnknown_0856FB57:: @ 856FB57 - .byte 0xd8, 0xd8 - - .align 2 -gUnknown_0856FB5C:: @ 856FB5C - .4byte gText_LinkBattles - .4byte gText_LinkCableBattles - .4byte gText_LinkBattles - -gUnknown_0856FB68:: @ 856FB68 - .byte 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a - -gUnknown_0856FB6E:: @ 856FB6E - .byte 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14 - -gUnknown_0856FB74:: @ 856FB74 - .byte 0x0b, 0x0c, 0x0d, 0x0e - -gUnknown_0856FB78:: @ 856FB78 - .byte 0x07, 0x07 - - .align 2 -gUnknown_0856FB7C:: @ 856FB7C - .incbin "graphics/frontier_pass/map_heads.gbapal" - - .align 2 -gUnknown_0856FB9C:: @ 856FB9C - .incbin "graphics/frontier_pass/map_heads_female.gbapal" - - .align 2 -gUnknown_0856FBBC:: @ 856FBBC - .incbin "graphics/frontier_pass/map_screen.4bpp.lz" - - .align 2 -gFrontierPassCursor_Gfx:: @ 8570BA8 - .incbin "graphics/frontier_pass/cursor.4bpp.lz" - - .align 2 -gUnknown_08570C44:: @ 8570C44 - .incbin "graphics/frontier_pass/map_heads.4bpp.lz" - - .align 2 -gFrontierPassMapCursor_Gfx:: @ 8570D00 - .incbin "graphics/frontier_pass/map_cursor.4bpp.lz" - - .align 2 -gUnknown_08570E00:: @ 8570E00 - .incbin "graphics/frontier_pass/map_screen.bin.lz" - - .align 2 -gUnknown_08571060:: @ 8571060 - .incbin "graphics/frontier_pass/small_map_and_card.bin.lz" - - .align 2 -gUnknown_08571298:: @ 8571298 - .incbin "graphics/frontier_pass/unknown_571298.bin" - - .align 2 -gUnknown_085712C0:: @ 85712C0 - .incbin "graphics/frontier_pass/record_frame.bin.lz" - - .align 2 -gUnknown_085712F8:: @ 85712F8 - .incbin "graphics/frontier_pass/small_map_and_card_affine.bin.lz" - -gUnknown_085713E0:: @ 85713E0 - .2byte 0x00d8, 0x0020, 0x00d8, 0x0080 - - .align 2 -gUnknown_085713E8:: @ 85713E8 - .4byte 0x000011f8, 0x000021e1, 0x00000bd6 - - .align 2 -gUnknown_085713F4:: @ 85713F4 - .4byte 0x000001f8, 0x000011e1, 0x000021d2 - - .align 2 -gUnknown_08571400:: @ 8571400 - window_template 0x00, 0x02, 0x03, 0x0c, 0x03, 0x0f, 0x0001 - window_template 0x00, 0x02, 0x0a, 0x0c, 0x03, 0x0f, 0x0026 - window_template 0x00, 0x02, 0x0d, 0x0c, 0x04, 0x0f, 0x004b - window_template 0x00, 0x00, 0x12, 0x1e, 0x03, 0x0f, 0x007c - window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 - - .align 2 -gUnknown_08571428:: @ 8571428 - window_template 0x00, 0x00, 0x01, 0x0f, 0x05, 0x0f, 0x0001 - window_template 0x00, 0x14, 0x01, 0x0a, 0x0e, 0x0f, 0x004d - window_template 0x00, 0x02, 0x10, 0x1a, 0x04, 0x0f, 0x00da - window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 - -gUnknown_08571448:: @ 8571448 - .byte 0x00, 0x02, 0x03 - -gUnknown_0857144B:: @ 857144B - .byte 0x00, 0x01, 0x09 - -gUnknown_0857144E:: @ 857144E - .byte 0x00, 0x04, 0x05 - - .align 2 -gUnknown_08571454:: @ 8571454 - .2byte 0x001c, 0x004c, 0x0084, 0x00dc, 0x0054, 0x0084, 0x0084, 0x00dc, 0x0050, 0x0066, 0x0014, 0x006c, 0x0000, 0x0010, 0x0098, 0x00f0 - .2byte 0x006c, 0x0086, 0x0014, 0x006c, 0x0018, 0x0030, 0x0014, 0x006c, 0x0032, 0x0042, 0x0014, 0x0024, 0x0042, 0x0052, 0x0020, 0x0030 - .2byte 0x0032, 0x0042, 0x002c, 0x003c, 0x0042, 0x0052, 0x0038, 0x0048, 0x0032, 0x0042, 0x0044, 0x0054, 0x0042, 0x0052, 0x0050, 0x0060 - .2byte 0x0032, 0x0042, 0x005c, 0x006c - - .align 2 -gUnknown_085714BC:: @ 85714BC - obj_tiles gFrontierPassCursor_Gfx, 0x100, 0 - obj_tiles gFrontierPassMapCursor_Gfx, 0x400, 1 - obj_tiles gFrontierPassMedals_Gfx, 0x380, 2 - - .align 2 -gUnknown_085714D4:: @ 85714D4 - obj_tiles gUnknown_08570C44, 0x100, 4 - null_obj_tiles - - .align 2 -gUnknown_085714E4:: @ 85714E4 - obj_pal gFrontierPassCursor_Pal, 0 - obj_pal gFrontierPassMapCursor_Pal, 1 - obj_pal gFrontierPassMedalsSilver_Pal, 2 - obj_pal gFrontierPassMedalsGold_Pal, 3 - obj_pal gUnknown_0856FB7C, 4 - obj_pal gUnknown_0856FB9C, 5 - null_obj_pal - - .align 2 -gSpriteAnim_857151C:: @ 857151C - .2byte 0x0000, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571524:: @ 8571524 - .2byte 0x0000, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857152C:: @ 857152C - .2byte 0x0004, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571534:: @ 8571534 - .2byte 0x0008, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857153C:: @ 857153C - .2byte 0x000c, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571544:: @ 8571544 - .2byte 0x0010, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857154C:: @ 857154C - .2byte 0x0014, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571554:: @ 8571554 - .2byte 0x0018, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857155C:: @ 857155C - .2byte 0x0000, 0x002d, 0x0008, 0x002d, 0xfffe, 0x0000 - - .align 2 -gSpriteAnim_8571568:: @ 8571568 - .2byte 0x0010, 0x002d, 0x0018, 0x002d, 0xfffe, 0x0000 - - .align 2 -gSpriteAnimTable_08571574:: @ 8571574 - .4byte gSpriteAnim_8571524 - .4byte gSpriteAnim_857152C - - .align 2 -gSpriteAnimTable_0857157C:: @ 857157C - .4byte gSpriteAnim_8571524 - .4byte gSpriteAnim_857152C - .4byte gSpriteAnim_8571534 - .4byte gSpriteAnim_857153C - .4byte gSpriteAnim_8571544 - .4byte gSpriteAnim_857154C - .4byte gSpriteAnim_8571554 - - .align 2 -gSpriteAnimTable_08571598:: @ 8571598 - .4byte gSpriteAnim_857155C - .4byte gSpriteAnim_8571568 - - .align 2 -gSpriteAffineAnim_085715A0:: @ 85715A0 - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gSpriteAffineAnimTable_085715B0:: @ 85715B0 - .4byte gSpriteAffineAnim_085715A0 - - .align 2 -gUnknown_085715B4:: @ 85715B4 - spr_template 0, 0, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - spr_template 1, 1, gUnknown_08524934, gSpriteAnimTable_08571598, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_085715E4:: @ 85715E4 - spr_template 2, 2, gUnknown_0852490C, gSpriteAnimTable_0857157C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_085715FC:: @ 85715FC - spr_template 4, 4, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, nullsub_39 - - .align 2 -gUnknown_08571614:: @ 8571614 - .4byte gUnknown_085EDA96 - .4byte gUnknown_085ED932 - .4byte gUnknown_085ED94D - .4byte gUnknown_085ED961 - .4byte gUnknown_085ED977 - .4byte gUnknown_085ED993 - .4byte gUnknown_085ED9AF - .4byte gUnknown_085ED9C7 - .4byte gUnknown_085ED9E5 - .4byte gUnknown_085EDA02 - .4byte gUnknown_085EDA21 - .4byte gUnknown_085EDA3C - .4byte gUnknown_085EDA5E - .4byte gUnknown_085EDA78 - .4byte gUnknown_085ED931 - - .align 2 -gUnknown_08571650:: @ 8571650 - unk_trainer_card_struct gUnknown_085EDAB1, gUnknown_085EDB0F, 0x59, 0x28, 1, 0 - unk_trainer_card_struct gUnknown_085EDABE, gUnknown_085EDB4E, 0x21, 0x2A, 1, 0 - unk_trainer_card_struct gUnknown_085EDACA, gUnknown_085EDB8B, 0x78, 0x56, 0, 0 - unk_trainer_card_struct gUnknown_085EDAD8, gUnknown_085EDBC2, 0x72, 0x3B, 0, 0 - unk_trainer_card_struct gUnknown_085EDAE5, gUnknown_085EDC00, 0x19, 0x43, 0, 0 - unk_trainer_card_struct gUnknown_085EDAF4, gUnknown_085EDC45, 0x39, 0x39, 1, 0 - unk_trainer_card_struct gUnknown_085EDB00, gUnknown_085EDC84, 0x86, 0x29, 1, 0 diff --git a/include/bg.h b/include/bg.h index 1366923f1..ad5acd0ae 100644 --- a/include/bg.h +++ b/include/bg.h @@ -61,7 +61,7 @@ s32 GetBgX(u8 bg); s32 ChangeBgY(u8 bg, s32 value, u8 op); s32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op); s32 GetBgY(u8 bg); -void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); +void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); void SetBgTilemapBuffer(u8 bg, void *tilemap); void UnsetBgTilemapBuffer(u8 bg); diff --git a/include/frontier_pass.h b/include/frontier_pass.h new file mode 100644 index 000000000..bdfc1996f --- /dev/null +++ b/include/frontier_pass.h @@ -0,0 +1,7 @@ +#ifndef GUARD_FRONTIER_PASS_H +#define GUARD_FRONTIER_PASS_H + +void ShowFrontierPass(void (*callback)(void)); +void CB2_ReshowFrontierPass(void); + +#endif // GUARD_FRONTIER_PASS_H diff --git a/include/graphics.h b/include/graphics.h index 29719d1a0..cfe73c6c3 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4846,4 +4846,32 @@ extern const u16 gUnknown_08DC64E8[]; extern const u16 gUnknown_08DC64FC[]; extern const u16 gUnknown_08DC6510[]; +// Trainer Card. +extern const u16 gEmeraldTrainerCard0Star_Pal[]; +extern const u32 gEmeraldTrainerCard_Gfx[]; +extern const u16 gFireRedTrainerCard0Star_Pal[]; +extern const u32 gFireRedTrainerCard_Gfx[]; +extern const u32 gUnknown_08DD2AE0[]; +extern const u32 gUnknown_08DD21B0[]; +extern const u32 gUnknown_08DD2D30[]; +extern const u32 gUnknown_08DD2010[]; +extern const u32 gUnknown_08DD2B78[]; +extern const u32 gUnknown_08DD228C[]; +extern const u32 gUnknown_08DD2E5C[]; +extern const u32 gUnknown_08DD1F78[]; + +// Frontier Pass +extern const u32 gUnknown_08DE08C8[]; +extern const u32 gUnknown_08DE2084[]; +extern const u32 gUnknown_08DE3350[]; +extern const u32 gUnknown_08DE3374[]; +extern const u32 gUnknown_08DE3060[]; +extern const u32 gFrontierPassMedals_Gfx[]; +extern const u16 gUnknown_08DE07C8[][16]; +extern const u16 gFrontierPassCursor_Pal[]; +extern const u16 gFrontierPassMedalsGold_Pal[]; +extern const u16 gFrontierPassMedalsSilver_Pal[]; +extern const u16 gFrontierPassMapCursor_Pal[]; + + #endif //GUARD_GRAPHICS_H diff --git a/include/palette.h b/include/palette.h index 540452f3d..e24da3e00 100644 --- a/include/palette.h +++ b/include/palette.h @@ -63,8 +63,12 @@ void TintPlttBuffer(u32, s8, s8, s8); void UnfadePlttBuffer(u32); void BeginFastPaletteFade(u8); void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); -void BlendPalettes(u32, u8, u16); +void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7); +void TintPalette_GrayScale(u16 *palette, u16 count); +void TintPalette_GrayScale2(u16 *palette, u16 count); +void TintPalette_SepiaTone(u16 *palette, u16 count); +void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone); #endif // GUARD_PALETTE_H diff --git a/include/pokedex.h b/include/pokedex.h index b6d323fd3..91e9e37d4 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -41,5 +41,6 @@ u16 GetHoennPokedexCount(u8); u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality); s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16); +bool16 HasAllHoennMons(void); #endif // GUARD_POKEDEX_H diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index a85ee5ff4..4c319e59d 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -25,6 +25,7 @@ struct PokemonStorage extern struct PokemonStorage *gPokemonStoragePtr; +void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4); u8 CountMonsInBox(u8 boxId); s16 GetFirstFreeBoxSpot(u8 boxId); u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore); diff --git a/include/script_pokemon_util_80F87D8.h b/include/script_pokemon_util_80F87D8.h index 02a35ecba..7d8d99628 100644 --- a/include/script_pokemon_util_80F87D8.h +++ b/include/script_pokemon_util_80F87D8.h @@ -4,5 +4,6 @@ u16 sub_80F903C(void); void ReducePlayerPartyToSelectedMons(void); void HealPlayerParty(void); +u8 CountPlayerContestPaintings(void); #endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H diff --git a/include/string_util.h b/include/string_util.h index d7a005ec5..b921d2391 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -34,7 +34,7 @@ u8 *StringFill(u8 *dest, u8 c, u16 n); u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n); u8 *StringFillWithTerminator(u8 *dest, u16 n); u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); -u32 StringLength_Multibyte(u8 *str); +u32 StringLength_Multibyte(const u8 *str); u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); bool32 IsStringJapanese(u8 *str); bool32 sub_800924C(u8 *str, s32 n); diff --git a/include/strings.h b/include/strings.h index ff0d08195..74f3ca727 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2222,4 +2222,65 @@ extern const u8 gText_PreliminaryResults[]; extern const u8 gText_Round2Results[]; extern const u8 gText_Var1sVar2Won[]; -#endif //GUARD_STRINGS_H +// Trainer Card +extern const u8 gText_LinkCableBattles[]; +extern const u8 gText_LinkBattles[]; +extern const u8 gText_WaitingTrainerFinishReading[]; +extern const u8 gText_TrainerCardName[]; +extern const u8 gText_TrainerCardIDNo[]; +extern const u8 gText_TrainerCardMoney[]; +extern const u8 gText_PokedollarVar1[]; +extern const u8 gText_EmptyString6[]; +extern const u8 gText_TrainerCardPokedex[]; +extern const u8 gText_TrainerCardTime[]; +extern const u8 gText_Colon2[]; +extern const u8 gText_Var1sTrainerCard[]; +extern const u8 gText_HallOfFameDebut[]; +extern const u8 gText_WinsLosses[]; +extern const u8 gText_PokemonTrades[]; +extern const u8 gText_BerryCrush[]; +extern const u8 gText_UnionTradesAndBattles[]; +extern const u8 gText_Var1DarkGreyShadowLightGrey[]; +extern const u8 gText_PokeblocksWithFriends[]; +extern const u8 gText_WonContestsWFriends[]; +extern const u8 gText_WSlashStraightSlash[]; +extern const u8 gText_Var1DarkLightGreyBP[]; +extern const u8 gText_BattleTower[]; +extern const u8 gText_BattlePtsWon[]; + +// Frontier Pass +extern const u8 gText_SymbolsEarned[]; +extern const u8 gText_BattleRecord[]; +extern const u8 gText_BattlePoints[]; +extern const u8 gUnknown_085EDA96[]; +extern const u8 gUnknown_085ED932[]; +extern const u8 gUnknown_085ED94D[]; +extern const u8 gUnknown_085ED961[]; +extern const u8 gUnknown_085ED977[]; +extern const u8 gUnknown_085ED993[]; +extern const u8 gUnknown_085ED9AF[]; +extern const u8 gUnknown_085ED9C7[]; +extern const u8 gUnknown_085ED9E5[]; +extern const u8 gUnknown_085EDA02[]; +extern const u8 gUnknown_085EDA21[]; +extern const u8 gUnknown_085EDA3C[]; +extern const u8 gUnknown_085EDA5E[]; +extern const u8 gUnknown_085EDA78[]; +extern const u8 gUnknown_085ED931[]; +extern const u8 gUnknown_085EDAB1[]; +extern const u8 gUnknown_085EDB0F[]; +extern const u8 gUnknown_085EDABE[]; +extern const u8 gUnknown_085EDB4E[]; +extern const u8 gUnknown_085EDACA[]; +extern const u8 gUnknown_085EDB8B[]; +extern const u8 gUnknown_085EDAD8[]; +extern const u8 gUnknown_085EDBC2[]; +extern const u8 gUnknown_085EDAE5[]; +extern const u8 gUnknown_085EDC00[]; +extern const u8 gUnknown_085EDAF4[]; +extern const u8 gUnknown_085EDC45[]; +extern const u8 gUnknown_085EDB00[]; +extern const u8 gUnknown_085EDC84[]; + + +#endif // GUARD_STRINGS_H diff --git a/include/trainer_card.h b/include/trainer_card.h index 1af247d8a..1cadbd8fc 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -6,38 +6,47 @@ struct TrainerCard /*0x00*/ u8 gender; /*0x01*/ u8 stars; /*0x02*/ bool8 hasPokedex; - /*0x03*/ bool8 var_3; - /*0x04*/ bool8 var_4; - /*0x05*/ u8 var_5; - /*0x06*/ u16 firstHallOfFameA; - /*0x08*/ u16 firstHallOfFameB; - /*0x0A*/ u16 firstHallOfFameC; - /*0x0C*/ u16 pokedexSeen; + /*0x03*/ bool8 caughtAllHoenn; + /*0x04*/ bool8 hasAllPaintings; + /*0x06*/ u16 hofDebutHours; + /*0x08*/ u16 hofDebutMinutes; + /*0x0A*/ u16 hofDebutSeconds; + /*0x0C*/ u16 caughtMonsCount; /*0x0E*/ u16 trainerId; /*0x10*/ u16 playTimeHours; /*0x12*/ u16 playTimeMinutes; /*0x14*/ u16 linkBattleWins; /*0x16*/ u16 linkBattleLosses; /*0x18*/ u16 battleTowerWins; - /*0x1A*/ u16 battleTowerLosses; + /*0x1A*/ u16 battleTowerStraightWins; /*0x1C*/ u16 contestsWithFriends; /*0x1E*/ u16 pokeblocksWithFriends; /*0x20*/ u16 pokemonTrades; - /*0x22*/ u16 var_22; /*0x24*/ u32 money; /*0x28*/ u16 var_28[4]; - /*0x30*/ u8 playerName[8]; - /*0x38*/ u8 emeraldAddedUnknownFields[0x54-0x38]; - /*0x54*/ u16 monSpecies[2]; - /*0x58*/ u8 emeraldAddedUnknownFields2[0x64-0x58]; + /*0x30*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; + /*0x38*/ u8 version; + /*0x3A*/ u16 var_3A; + /*0x3C*/ u32 berryCrushPoints; + /*0x40*/ u32 unionRoomNum; + /*0x44*/ u8 filler44[0x8]; + /*0x4C*/ u8 var_4C; + /*0x4D*/ u8 var_4D; + /*0x4E*/ u8 var_4E; + /*0x4F*/ u8 var_4F; + /*0x50*/ u8 var_50[0x4]; + /*0x54*/ u16 monSpecies[PARTY_SIZE]; + /*0x60*/ bool16 hasAllSymbols; + /*0x62*/ u16 frontierBP; }; extern struct TrainerCard gTrainerCards[4]; -void sub_80C3120(struct TrainerCard *arg0, u16 *arg1, u8 gameVersion); -void TrainerCard_ShowLinkCard(u8 arg0, void (*callback)(void)); +u32 CountPlayerTrainerStars(void); +u8 sub_80C4904(u8 cardId); +void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion); +void ShowPlayerTrainerCard(void (*callback)(void)); +void ShowTrainerCardInLink(u8 arg0, void (*callback)(void)); void TrainerCard_GenerateCardForPlayer(struct TrainerCard *); -u8 sub_80C4904(u8); -void sub_80C6D80(const u8 *, u8 *, u8, u8, u8); #endif // GUARD_TRAINER_CARD_H diff --git a/ld_script.txt b/ld_script.txt index c1f7a1972..844c64fb5 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -124,7 +124,8 @@ SECTIONS { src/scanline_effect.o(.text); src/option_menu.o(.text); src/pokedex.o(.text); - asm/trainer_card.o(.text); + src/trainer_card.o(.text); + src/frontier_pass.o(.text); src/pokemon_storage_system.o(.text); src/pokemon_icon.o(.text); src/script_movement.o(.text); @@ -457,7 +458,8 @@ SECTIONS { src/field_effect.o(.rodata); src/option_menu.o(.rodata); src/pokedex.o(.rodata); - data/trainer_card.o(.rodata); + src/trainer_card.o(.rodata); + src/frontier_pass.o(.rodata); src/pokemon_storage_system.o(.rodata); src/pokemon_icon.o(.rodata); src/fldeff_cut.o(.rodata); diff --git a/src/bg.c b/src/bg.c index 54ec3b347..f73f5998d 100644 --- a/src/bg.c +++ b/src/bg.c @@ -246,7 +246,7 @@ void SetTextModeAndHideBgs(void) SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) & ~DISPCNT_ALL_BG_AND_MODE_BITS); } -static void SetBgAffineInternal(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) +static void SetBgAffineInternal(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) { struct BgAffineSrcData src; struct BgAffineDstData dest; @@ -777,7 +777,7 @@ s32 GetBgY(u8 bg) return sGpuBgConfigs2[bg].bg_y; } -void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) +void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) { SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle); } diff --git a/src/cable_club.c b/src/cable_club.c index 784426d53..ce9b9db05 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -498,7 +498,7 @@ static void sub_80B2C30(u8 taskId) for (index = 0; index < GetLinkPlayerCount(); index++) { - sub_80C3120(&gTrainerCards[index], gBlockRecvBuffer[index], gLinkPlayers[index].version); + CopyTrainerCardData(&gTrainerCards[index], gBlockRecvBuffer[index], gLinkPlayers[index].version); } SetSuppressLinkErrorMessage(FALSE); @@ -1176,7 +1176,7 @@ static void sub_80B39A4(void) void sp02A_crash_sound(void) { - TrainerCard_ShowLinkCard(gSpecialVar_0x8006, CB2_ReturnToFieldContinueScriptPlayMapMusic); + ShowTrainerCardInLink(gSpecialVar_0x8006, CB2_ReturnToFieldContinueScriptPlayMapMusic); } bool32 sub_80B39D4(u8 linkPlayerIndex) diff --git a/src/data/battle_frontier/trainer_hill.h b/src/data/battle_frontier/trainer_hill.h new file mode 100644 index 000000000..ca0d623e9 --- /dev/null +++ b/src/data/battle_frontier/trainer_hill.h @@ -0,0 +1,4857 @@ +#define TRAINER_HILL_OTID 0x10000000 + +static const struct TrHillTag sDataTagNormal = +{ + .unkField_0 = 8, + .unused1 = 2, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 5, + .unused5 = 30, + .unused6 = 5, + .floors = + { + [0] = + { + .unk0 = 0x11, + .unk1 = 0x12, + .trainers = + { + [0] = + { + .name = _("ALAINA"), + .facilityClass = FACILITY_CLASS_HEX_MANIAC, + .unused = 0, + .speechBefore = {EC_WORD_YOU, EC_WORD_CAN, EC_WORD_CHOOSE, EC_WORD_NOT, EC_WORD_TO, EC_WORD_BELIEVE}, + .speechWin = {EC_WORD_A, EC_WORD_SUPER, EC_WORD_NATURAL, EC_WORD_POWER, EC_WORD_HAS, EC_WORD_COME}, + .speechLose = {EC_WORD_THIS, EC_WORD_MUST_BE, EC_WORD_A, EC_MOVE(NIGHTMARE), EC_WORD_EXCL, 0xFFFF}, + .speechAfter = {EC_WORD_I, EC_WORD_WILL, EC_WORD_DISAPPEAR, EC_WORD_IN, EC_WORD_THE, EC_WORD_DARK}, + .mons = + { + [0] = + { + .species = SPECIES_MISDREAVUS, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SHADOW_BALL, MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .attackEV = 155, + .speedEV = 255, + .spAttackEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0x0, + .nickname = _("MISDREAVUS"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SOLROCK, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PSYCHIC, MOVE_FLAMETHROWER, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 100, + .spAttackEV = 110, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0xF, + .nickname = _("SOLROCK"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_CLAYDOL, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_EARTHQUAKE, MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_ICE_BEAM}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 135, + .spDefenseEV = 120, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0xC, + .nickname = _("CLAYDOL"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_WEEZING, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_FRUSTRATION, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .attackEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0x80, + .nickname = _("WEEZING"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_LUNATONE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PSYCHIC, MOVE_ICE_BEAM, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 100, + .spAttackEV = 110, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0xF, + .nickname = _("LUNATONE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_FLYGON, + .heldItem = ITEM_CHOICE_BAND, + .moves = {MOVE_EARTHQUAKE, MOVE_DRAGON_CLAW, MOVE_CRUNCH, MOVE_FLAMETHROWER}, + .level = 0, + .ppBonuses = 0, + .attackEV = 155, + .speedEV = 255, + .spAttackEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0x83, + .nickname = _("FLYGON"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("ALFONSO"), + .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_NEVER, EC_WORD_TAKE, EC_WORD_A, EC_WORD_TRAIN, 0xFFFF}, + .speechWin = {EC_WORD_I_AM, EC_WORD_FEELING, EC_MOVE2(SUPERSONIC), EC_WORD_ON, EC_WORD_MY, EC_WORD_BIKE}, + .speechLose = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_EXCL, EC_WORD_YOU_VE, EC_WORD_DESTROYED, EC_WORD_IT}, + .speechAfter = {EC_WORD_A, EC_WORD_BIKE, EC_WORD_OVER, EC_WORD_ANY, EC_WORD_TRAIN, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SEALEO, + .heldItem = ITEM_NEVER_MELT_ICE, + .moves = {MOVE_BLIZZARD, MOVE_ICE_BALL, MOVE_ENCORE, MOVE_HAIL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("SEALEO"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_AMPHAROS, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_THUNDER_WAVE, MOVE_COTTON_SPORE, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("AMPHAROS"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_MACHOKE, + .heldItem = ITEM_BLACK_BELT, + .moves = {MOVE_DYNAMIC_PUNCH, MOVE_MUD_SLAP, MOVE_COUNTER, MOVE_SCARY_FACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x4E, + .nickname = _("MACHOKE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_FLAREON, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_FIRE_BLAST, MOVE_BITE, MOVE_QUICK_ATTACK, MOVE_SAND_ATTACK}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("FLAREON"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_MAGNETON, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_ZAP_CANNON, MOVE_THUNDER_WAVE, MOVE_SCREECH, MOVE_METAL_SOUND}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x0, + .nickname = _("MAGNETON"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_PINSIR, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_GUILLOTINE, MOVE_BRICK_BREAK, MOVE_SWAGGER, MOVE_FAINT_ATTACK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 155, + .spDefenseEV = 155, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x85, + .nickname = _("PINSIR"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x8, 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x35, 0x3B, 0x35, 0x35, 0x3B, 0x8, 0x33, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x2C, 0x2B, 0x3B, 0x8, 0x33, 0x35, 0x3B, 0x3B, 0x3B, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x8, 0x34, 0x2C, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x2B, 0x32, 0x30, 0x2C, 0x3B, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x35, 0x3B, 0x2C, 0x3B, 0x3B, 0x35, 0x2C, 0x3B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x35, 0x3B, 0x2B, 0x32, 0x21, 0x30, 0x2C, 0x2C, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x2C, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2B, 0x3B, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x8, 0x31, 0x35, 0x35, 0x35, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x2B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2B, 0x2C, 0x2C, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x8, 0x31, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x3B, 0x3B, 0x2C, 0x32, 0x30, 0x2C, 0x32, 0x30, 0x3B, 0x35, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x3FE5, 0x401, 0xBDED, 0x8425, 0xDFBD, 0x221, 0x7E7F, 0x941, 0x7F7D, 0x911, 0x7FF7, 0x4101, 0x79F9, 0x803, 0xFFFF}, + .coords = {27, 45}, + .direction = 0x21, + .range = 0x21, + }, + [1] = + { + .unk0 = 0x13, + .unk1 = 0x14, + .trainers = + { + [0] = + { + .name = _("THEODORE"), + .facilityClass = FACILITY_CLASS_BLACK_BELT, + .unused = 0, + .speechBefore = {EC_WORD_MY, EC_WORD_POWER, EC_WORD_WILL, EC_MOVE2(STOMP), EC_WORD_YOU, EC_WORD_EXCL}, + .speechWin = {EC_WORD_WAAAH, EC_WORD_HAHAHA, EC_WORD_EXCL, EC_WORD_WAAAH, EC_WORD_HAHAHA, EC_WORD_EXCL_EXCL}, + .speechLose = {EC_WORD_I, EC_WORD_WENT, EC_WORD_AT, EC_WORD_IT, EC_WORD_TOO, EC_WORD_HARD}, + .speechAfter = {EC_WORD_YES_SIR_EXCL, EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_NICE, EC_WORD_AND, EC_WORD_GUTSY}, + .mons = + { + [0] = + { + .species = SPECIES_MEDITITE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x80, + .nickname = _("MEDITITE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_HERACROSS, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 1, + .personality = 0x80, + .nickname = _("HERACROSS"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_HITMONTOP, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONTOP"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MACHOP, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x4E, + .nickname = _("MACHOP"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PINSIR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x80, + .nickname = _("PINSIR"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_HITMONCHAN, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONCHAN"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("JAYDEN"), + .facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F, + .unused = 0, + .speechBefore = {EC_WORD_SOME, EC_WORD_THINGS, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_DO, EC_WORD_ALONE}, + .speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, 0xFFFF}, + .speechLose = {EC_WORD_WE, EC_WORD_COULDN_T, EC_WORD_WIN, EC_WORD_TOGETHER, EC_WORD_QUES, 0xFFFF}, + .speechAfter = {EC_WORD_MAYBE, EC_WORD_I, EC_WORD_NEED, EC_WORD_A, EC_WORD_BOY, EC_WORD_FRIEND}, + .mons = + { + [0] = + { + .species = SPECIES_VULPIX, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_WILL_O_WISP, MOVE_CONFUSE_RAY, MOVE_TAIL_WHIP, MOVE_OVERHEAT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("VULPIX"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MINUN, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_THUNDER_WAVE, MOVE_CHARM, MOVE_ENCORE, MOVE_SPARK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("MINUN"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_ROSELIA, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_TOXIC, MOVE_LEECH_SEED, MOVE_SWEET_SCENT, MOVE_GIGA_DRAIN}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("ROSELIA"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MR_MIME, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_SAFEGUARD, MOVE_REFLECT, MOVE_LIGHT_SCREEN, MOVE_PSYCHIC}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x82, + .nickname = _("MR. MIME"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PLUSLE, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_RAIN_DANCE, MOVE_LIGHT_SCREEN, MOVE_HELPING_HAND, MOVE_THUNDER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x5, + .nickname = _("PLUSLE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_TOGEPI, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_LIGHT_SCREEN, MOVE_REFLECT, MOVE_FOLLOW_ME, MOVE_METRONOME}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x37, + .nickname = _("TOGEPI"), + .friendship = 255, + }, + }, + }, + }, + .data = {0xD1, 0xD5, 0xD5, 0xD5, 0xD9, 0xD9, 0x1B, 0x1C, 0x1D, 0xC5, 0xC6, 0xCE, 0xD5, 0xDB, 0xD5, 0x8, 0xD1, 0xCB, 0xC4, 0xC4, 0xDB, 0xDB, 0xC4, 0xC4, 0xC4, 0xCC, 0xCC, 0xCC, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xDB, 0x17, 0x17, 0x17, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xD5, 0x17, 0x17, 0x17, 0xD5, 0xD5, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0x17, 0x17, 0x1F, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xC4, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDB, 0xC4, 0xC4, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xC4, 0xC4, 0xDB, 0xC4, 0xC4, 0xC4, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0xDB, 0xD5, 0xD5, 0xD5, 0xCB, 0x8, 0xD1, 0xC4, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x8, 0xD1, 0xDB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x8, 0xD1, 0xDB, 0xDB, 0xC4, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xC4, 0xC4, 0xC4, 0xC4, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x73FB, 0x400B, 0x400B, 0x51EB, 0x538B, 0x51BB, 0x518B, 0x51EB, 0x518B, 0x51BB, 0x5003, 0x501F, 0x101F, 0x101F, 0xFFFF}, + .coords = {180, 233}, + .direction = 0x3, + .range = 0x35, + }, + [2] = + { + .unk0 = 0x15, + .unk1 = 0x16, + .trainers = + { + [0] = + { + .name = _("SALVADORE"), + .facilityClass = FACILITY_CLASS_PKMN_BREEDER_M, + .unused = 0, + .speechBefore = {EC_WORD_LET_S, EC_MOVE2(WRAP), EC_WORD_THINGS, EC_WORD_UP, EC_WORD_HERE, EC_WORD_HEY_QUES}, + .speechWin = {EC_WORD_WOULD, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_QUES}, + .speechLose = {EC_WORD_I, EC_WORD_WILL, EC_WORD_MAKE, EC_WORD_YOU, EC_WORD_SORRY, EC_WORD_FRIEND}, + .speechAfter = {EC_WORD_HAVEN_T, EC_WORD_YOU, EC_WORD_DONE, EC_WORD_ENOUGH, EC_WORD_QUES, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_VAPOREON, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_HAZE, MOVE_HELPING_HAND, MOVE_TICKLE, MOVE_WATER_PULSE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x37, + .nickname = _("VAPOREON"), + .friendship = 0, + }, + [1] = + { + .species = SPECIES_DODRIO, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_HAZE, MOVE_TRI_ATTACK, MOVE_TAUNT, MOVE_TORMENT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8A, + .nickname = _("DODRIO"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_OMASTAR, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_HAZE, MOVE_HYDRO_PUMP, MOVE_TICKLE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x14, + .nickname = _("OMASTAR"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_LICKITUNG, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8, + .nickname = _("LICKITUNG"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_SLOWBRO, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_BELLY_DRUM, MOVE_MUD_SLAP, MOVE_SWAGGER, MOVE_AMNESIA}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x94, + .nickname = _("SLOWBRO"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_LINOONE, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8, + .nickname = _("LINOONE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("VERONICA"), + .facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F, + .unused = 0, + .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_STRONG, EC_WORD_BEAUTY, EC_WORD_AROUND, EC_WORD_HERE}, + .speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_I_AM, EC_WORD_TIRED, EC_WORD_TODAY, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_WHY, EC_WORD_YES, EC_WORD_I_AM, EC_WORD_ANGRY, EC_WORD_THANK_YOU, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SKITTY, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PSYCH_UP, MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_IRON_TAIL}, + .level = 0, + .ppBonuses = 0, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xCB, + .nickname = _("SKITTY"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MEDICHAM, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_PSYCH_UP, MOVE_HI_JUMP_KICK, MOVE_MEGA_KICK, MOVE_ROCK_SLIDE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("MEDICHAM"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_STANTLER, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_PSYCH_UP, MOVE_RETURN, MOVE_EARTHQUAKE, MOVE_SHADOW_BALL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("STANTLER"), + .friendship = 0, + }, + [3] = + { + .species = SPECIES_NIDOQUEEN, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_SUPERPOWER, MOVE_BITE, MOVE_CHARM, MOVE_FLATTER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 20, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("NIDOQUEEN"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_NINETALES, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_OVERHEAT, MOVE_QUICK_ATTACK, MOVE_SPITE, MOVE_TAIL_WHIP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD7, + .nickname = _("NINETALES"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_CHARIZARD, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_OVERHEAT, MOVE_BEAT_UP, MOVE_SCARY_FACE, MOVE_GROWL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("CHARIZARD"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x8, 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x43, 0x41, 0x40, 0x41, 0x42, 0x41, 0x41, 0x4A, 0x42, 0x41, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x43, 0x4B, 0x43, 0x43, 0x41, 0x42, 0x42, 0x40, 0x41, 0x40, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x42, 0x42, 0x41, 0x41, 0x42, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x42, 0x41, 0x43, 0x4B, 0x41, 0x41, 0x41, 0x40, 0x43, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x43, 0x41, 0x42, 0x42, 0x41, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x64, 0x73, 0x8, 0x69, 0x43, 0x43, 0x41, 0x42, 0x42, 0x41, 0x43, 0x41, 0x41, 0x40, 0x42, 0x41, 0x42, 0x73, 0x8, 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x8}, + .unk3A0 = {0x381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1}, + .coords = {37, 41}, + .direction = 0x23, + .range = 0x33, + }, + [3] = + { + .unk0 = 0x17, + .unk1 = 0x18, + .trainers = + { + [0] = + { + .name = _("KEENAN"), + .facilityClass = FACILITY_CLASS_PSYCHIC_M, + .unused = 0, + .speechBefore = {EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_HURRIED, 0xFFFF, 0xFFFF}, + .speechWin = {EC_WORD_TOO, EC_WORD_BAD, 0xFFFF, EC_WORD_TIME, EC_WORD_IS, EC_WORD_UP}, + .speechLose = {EC_WORD_DOES, EC_WORD_THE, EC_WORD_TIME, EC_WORD_WORRY, EC_WORD_YOU, EC_WORD_QUES}, + .speechAfter = {EC_WORD_YOU, EC_WORD_DON_T, EC_WORD_HAVE, EC_WORD_TIME, EC_WORD_TO, EC_WORD_CHAT}, + .mons = + { + [0] = + { + .species = SPECIES_ALAKAZAM, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_SKILL_SWAP, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH, MOVE_REFLECT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x41, + .nickname = _("ALAKAZAM"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_BLISSEY, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_SKILL_SWAP, MOVE_EGG_BOMB, MOVE_THUNDERBOLT, MOVE_SING}, + .level = 0, + .ppBonuses = 0, + .defenseEV = 255, + .spAttackEV = 155, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xF, + .nickname = _("BLISSEY"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_GRUMPIG, + .heldItem = ITEM_TWISTED_SPOON, + .moves = {MOVE_SKILL_SWAP, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_REST}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spAttackEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("GRUMPIG"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_GARDEVOIR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_SKILL_SWAP, MOVE_DREAM_EATER, MOVE_HYPNOSIS, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xF, + .nickname = _("GARDEVOIR"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_VENOMOTH, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SKILL_SWAP, MOVE_SIGNAL_BEAM, MOVE_SLEEP_POWDER, MOVE_TOXIC}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x80, + .nickname = _("VENOMOTH"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ESPEON, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_SKILL_SWAP, MOVE_PSYBEAM, MOVE_SWIFT, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ESPEON"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("KRISTINA"), + .facilityClass = FACILITY_CLASS_AROMA_LADY, + .unused = 0, + .speechBefore = {EC_WORD_IT_S, EC_WORD_HOT, EC_WORD_ELLIPSIS, EC_WORD_WHAT, EC_WORD_A, EC_WORD_STENCH}, + .speechWin = {EC_WORD_I, EC_WORD_REALLY, EC_WORD_LIKE, EC_WORD_AN, EC_WORD_OFFENSIVE, EC_WORD_STENCH}, + .speechLose = {EC_WORD_I, EC_MOVE2(COVET), EC_WORD_ANY, EC_WORD_STRONG, EC_WORD_STENCH, 0xFFFF}, + .speechAfter = {EC_WORD_MY, EC_WORD_SENSE, EC_WORD_OF, EC_WORD_SMELL, EC_WORD_ISN_T, EC_WORD_NORMAL}, + .mons = + { + [0] = + { + .species = SPECIES_WEEZING, + .heldItem = ITEM_POISON_BARB, + .moves = {MOVE_TOXIC, MOVE_SLUDGE_BOMB, MOVE_SMOKESCREEN, MOVE_HAZE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("WEEZING"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_GLOOM, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_PETAL_DANCE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("GLOOM"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_MUK, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SCREECH, MOVE_DISABLE, MOVE_SLUDGE_BOMB, MOVE_ACID_ARMOR}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("MUK"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_TROPIUS, + .heldItem = ITEM_WHITE_HERB, + .moves = {MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM, MOVE_SWEET_SCENT, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 120, + .speedEV = 255, + .spAttackEV = 135, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x83, + .nickname = _("TROPIUS"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_BELLOSSOM, + .heldItem = ITEM_MENTAL_HERB, + .moves = {MOVE_SWEET_SCENT, MOVE_PETAL_DANCE, MOVE_STUN_SPORE, MOVE_SLUDGE_BOMB}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x6, + .nickname = _("BELLOSSOM"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_MEGANIUM, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_RAZOR_LEAF, MOVE_BODY_SLAM, MOVE_LEECH_SEED, MOVE_SYNTHESIS}, + .level = 0, + .ppBonuses = 0, + .attackEV = 200, + .speedEV = 110, + .spAttackEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x1F, + .nickname = _("MEGANIUM"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x35, 0x35, 0x3B, 0x35, 0x35, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x8, 0x33, 0x17, 0x1F, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x34, 0x17, 0x2C, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x35, 0x1F, 0x17, 0x17, 0x1F, 0x17, 0x8, 0x34, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x3B, 0x3B, 0x2B, 0x17, 0x8, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x2C, 0x17, 0x8, 0x1F, 0x17, 0x17, 0x2C, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x1F, 0x3B, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x2B, 0x3B, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x35, 0x35, 0x35, 0x2B, 0x17, 0x3B, 0x2C, 0x3B, 0x17, 0x8, 0x34, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x401, 0x1, 0x8401, 0x8465, 0x445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF}, + .coords = {71, 167}, + .direction = 0x1, + .range = 0x33, + }, + }, +}; +static const struct TrHillTag sDataTagVariety = +{ + .unkField_0 = 8, + .unused1 = 1, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 21, + .unused5 = 76, + .unused6 = 5, + .floors = + { + [0] = + { + .unk0 = 0x29, + .unk1 = 0x2A, + .trainers = + { + [0] = + { + .name = _("TERRANCE"), + .facilityClass = FACILITY_CLASS_GENTLEMAN, + .unused = 0, + .speechBefore = {EC_WORD_GOOD, EC_WORD_CHILDREN, EC_WORD_WILL, EC_WORD_GET, EC_WORD_A, EC_MOVE2(PRESENT)}, + .speechWin = {EC_WORD_THANK_YOU, EC_WORD_MY, EC_WORD_VICTORY, EC_WORD_IS, EC_WORD_YOUR, EC_MOVE2(PRESENT)}, + .speechLose = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_MOVE2(PRESENT), EC_WORD_TO, EC_WORD_YOU, 0xFFFF}, + .speechAfter = {EC_WORD_WELL_THEN, EC_WORD_CONGRATS, EC_WORD_MY, EC_WORD_FRIEND, 0xFFFF, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_DELIBIRD, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_SPLASH, MOVE_HAIL, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8A, + .nickname = _("DELIBIRD"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_CLEFAIRY, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_COSMIC_POWER, MOVE_LIGHT_SCREEN, MOVE_MOONLIGHT}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("CLEFAIRY"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_PIKACHU, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_GROWL, MOVE_TAIL_WHIP, MOVE_AGILITY}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("PIKACHU"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MARILL, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_DEFENSE_CURL, MOVE_TAIL_WHIP, MOVE_ENDURE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8A, + .nickname = _("MARILL"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_JIGGLYPUFF, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_SING, MOVE_DISABLE, MOVE_REST}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("JIGGLYPUFF"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_TOGETIC, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_CHARM, MOVE_SWEET_KISS, MOVE_WISH}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x26, + .nickname = _("TOGETIC"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("ELIZABETH"), + .facilityClass = FACILITY_CLASS_LADY, + .unused = 0, + .speechBefore = {EC_WORD_CAN, EC_WORD_YOU, EC_WORD_SENSE, EC_WORD_ME, EC_MOVE(FOCUS_ENERGY), EC_WORD_QUES}, + .speechWin = {EC_WORD_THAT_S, EC_WORD_ABOUT, EC_WORD_RIGHT, EC_WORD_I, EC_WORD_WOULD, EC_WORD_THINK}, + .speechLose = {EC_WORD_THINGS, EC_WORD_DON_T, EC_WORD_ALWAYS, EC_WORD_WORK, EC_WORD_OUT, 0xFFFF}, + .speechAfter = {EC_WORD_I_AM, EC_WORD_FEELING, EC_WORD_LONESOME, EC_WORD_AND, EC_WORD_SAD, EC_WORD_NOW}, + .mons = + { + [0] = + { + .species = SPECIES_WIGGLYTUFF, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_ROLLOUT, MOVE_DEFENSE_CURL, MOVE_SING, MOVE_DREAM_EATER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xC1, + .nickname = _("WIGGLYTUFF"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SABLEYE, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_ASTONISH, MOVE_FAINT_ATTACK, MOVE_DETECT, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x87, + .nickname = _("SABLEYE"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_GRUMPIG, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_PSYBEAM, MOVE_MAGIC_COAT, MOVE_BOUNCE, MOVE_FUTURE_SIGHT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("GRUMPIG"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_CORSOLA, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_BUBBLE_BEAM, MOVE_ROCK_BLAST, MOVE_REFLECT, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x12, + .nickname = _("CORSOLA"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_CLAMPERL, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_WHIRLPOOL, MOVE_IRON_DEFENSE, MOVE_ENDURE, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("CLAMPERL"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_STARMIE, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_DIVE, MOVE_ICY_WIND, MOVE_SWIFT, MOVE_SKILL_SWAP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("STARMIE"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x42, 0x42, 0x42, 0xFB, 0x41, 0x8, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x43, 0x43, 0xFB, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0xFB, 0x43, 0x41, 0x42, 0x40, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x40, 0x43, 0x43, 0x43, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x42, 0x41, 0xFE, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x42, 0x41, 0x43, 0x43, 0x43, 0x41, 0x40, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 0xFB, 0x40, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x8, 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x8}, + .unk3A0 = {0x381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}, + .coords = {133, 137}, + .direction = 0x23, + .range = 0x33, + }, + [1] = + { + .unk0 = 0x2B, + .unk1 = 0x2C, + .trainers = + { + [0] = + { + .name = _("ANNABELL"), + .facilityClass = FACILITY_CLASS_PARASOL_LADY, + .unused = 0, + .speechBefore = {EC_WORD_HI, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_UPBEAT, EC_WORD_QUES}, + .speechWin = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_WELL, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_I, EC_WORD_CAN, EC_WORD_SEE, EC_WORD_YOU_RE, EC_WORD_FEELING, EC_WORD_GREAT}, + .speechAfter = {EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_LOOK, EC_WORD_READY, EC_WORD_TO, EC_WORD_HUSTLE}, + .mons = + { + [0] = + { + .species = SPECIES_JIGGLYPUFF, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SING, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x0, + .nickname = _("JIGGLYPUFF"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_JYNX, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_PERISH_SONG, MOVE_FAKE_TEARS, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x0, + .nickname = _("JYNX"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_EXPLOUD, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HOWL, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x96, + .nickname = _("EXPLOUD"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_ABSOL, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SWORDS_DANCE, MOVE_SLASH, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x96, + .nickname = _("ABSOL"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PIDGEOTTO, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_FEATHER_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x96, + .nickname = _("PIDGEOTTO"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ALTARIA, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_DRAGON_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x0, + .nickname = _("ALTARIA"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("COLEMAN"), + .facilityClass = FACILITY_CLASS_COLLECTOR, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_SEEK, EC_WORD_SOMEONE, EC_WORD_AS, EC_WORD_MY, EC_WORD_IDOL}, + .speechWin = {EC_WORD_DID, EC_WORD_MY, EC_WORD_IDOL, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES}, + .speechLose = {EC_WORD_YOU_RE, EC_WORD_LIKE, EC_WORD_A, EC_MOVE(HEAL_BELL), EC_WORD_TO_ME, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_I_VE, EC_WORD_DECIDED, EC_WORD_I_CHOOSE_YOU, EC_WORD_AS, EC_WORD_MY, EC_WORD_IDOL}, + .mons = + { + [0] = + { + .species = SPECIES_CHIMECHO, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xD, + .nickname = _("CHIMECHO"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_WHISMUR, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xD, + .nickname = _("WHISMUR"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_YANMA, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("YANMA"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_ILLUMISE, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("ILLUMISE"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_SPHEAL, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("SPHEAL"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_VIGOROTH, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x87, + .nickname = _("VIGOROTH"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x9B, 0x9C, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x8, 0x9C, 0x9B, 0x96, 0x40, 0xDB, 0xDB, 0x40, 0x96, 0x40, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x8, 0x91, 0x96, 0x40, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9C, 0x8, 0x91, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x9B, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x8, 0x91, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x8, 0x91, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9C, 0x8, 0x9C, 0x9B, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x8, 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9C, 0x96, 0x8, 0xD6, 0x96, 0x9C, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x9C, 0xD6, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0xD6, 0x9C, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, + .coords = {131, 139}, + .direction = 0x23, + .range = 0x77, + }, + [2] = + { + .unk0 = 0x2D, + .unk1 = 0x2E, + .trainers = + { + [0] = + { + .name = _("ENRIQUE"), + .facilityClass = FACILITY_CLASS_RICH_BOY, + .unused = 0, + .speechBefore = {EC_WORD_GET, EC_WORD_READY, EC_WORD_FOR, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_TIME}, + .speechWin = {EC_WORD_HEY, EC_WORD_HEY, EC_WORD_EXCL, EC_WORD_WHAT_S_UP_QUES, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_AWW, EC_WORD_COULDN_T, EC_WORD_YOU, EC_WORD_LET_ME_WIN, EC_WORD_QUES, 0xFFFF}, + .speechAfter = {EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_MY, EC_WORD_SKILL, EC_WORD_QUES}, + .mons = + { + [0] = + { + .species = SPECIES_WOOPER, + .heldItem = ITEM_FIGY_BERRY, + .moves = {MOVE_RAIN_DANCE, MOVE_YAWN, MOVE_SURF, MOVE_HAZE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("WOOPER"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_POLIWAG, + .heldItem = ITEM_WIKI_BERRY, + .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_MIST, MOVE_HYPNOSIS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x3, + .nickname = _("POLIWAG"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_PSYDUCK, + .heldItem = ITEM_AGUAV_BERRY, + .moves = {MOVE_HYPNOSIS, MOVE_SURF, MOVE_DISABLE, MOVE_SEISMIC_TOSS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("PSYDUCK"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_RHYDON, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x96, + .nickname = _("RHYDON"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_RHYHORN, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("RHYHORN"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_CUBONE, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_EARTHQUAKE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x80, + .nickname = _("CUBONE"), + .friendship = 0, + }, + }, + }, + [1] = + { + .name = _("COLLEEN"), + .facilityClass = FACILITY_CLASS_LADY, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_WOULD, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_ROCK, EC_WORD_OUT}, + .speechWin = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_ROCK, EC_WORD_THING, EC_WORD_EXCL}, + .speechLose = {EC_WORD_GO_AHEAD, EC_WORD_AND, EC_WORD_CRUSH, EC_WORD_MY, EC_WORD_DREAM, EC_WORD_ELLIPSIS}, + .speechAfter = {EC_WORD_I, EC_WORD_WANT, EC_WORD_TO, EC_WORD_GO, EC_WORD_WILD, EC_WORD_SOMETIME}, + .mons = + { + [0] = + { + .species = SPECIES_MAGNEMITE, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_ZAP_CANNON, MOVE_SPARK, MOVE_THUNDER_SHOCK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("MAGNEMITE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ELECTABUZZ, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_THUNDER_PUNCH, MOVE_SHOCK_WAVE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x41, + .nickname = _("ELECTABUZZ"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_FLAAFFY, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_SHOCK_WAVE, MOVE_THUNDER_SHOCK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .spAttackEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x0, + .nickname = _("FLAAFFY"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_BALTOY, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("BALTOY"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_PINECO, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("PINECO"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_VOLTORB, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x80, + .nickname = _("VOLTORB"), + .friendship = 0, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x1C, 0x1D, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x84, 0x84, 0x84, 0x9A, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x17, 0xBB, 0xBB, 0x8}, + .unk3A0 = {0x381, 0x381, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1}, + .coords = {25, 30}, + .direction = 0x23, + .range = 0x44, + }, + [3] = + { + .unk0 = 0x2F, + .unk1 = 0x30, + .trainers = + { + [0] = + { + .name = _("KIMBERLY"), + .facilityClass = FACILITY_CLASS_POKEFAN_F, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_WORKING, EC_WORD_AT, EC_WORD_MY, EC_WORD_OWN_TEMPO}, + .speechWin = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_BAD, EC_WORD_YOU, EC_WORD_THINK, EC_WORD_QUES}, + .speechLose = {EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_MEAN, EC_WORD_KID, EC_WORD_IT, EC_WORD_SEEMS}, + .speechAfter = {EC_WORD_MY, EC_WORD_OWN_TEMPO, EC_WORD_IS, EC_WORD_RIGHT, EC_WORD_FOR, EC_WORD_ME}, + .mons = + { + [0] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 31, + .defenseIV = 30, + .speedIV = 31, + .spAttackIV = 30, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x202, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_MYSTIC_WATER, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 30, + .spAttackIV = 30, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x10001, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_BLACK_BELT, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 30, + .defenseIV = 30, + .speedIV = 30, + .spAttackIV = 30, + .spDefenseIV = 30, + .altAbility = 0, + .personality = 0x102, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_SPINDA, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x88FE980F, + .nickname = _("SPINDA"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PLUSLE, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("PLUSLE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_VOLBEAT, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_HELPING_HAND, MOVE_SIGNAL_BEAM, MOVE_SOLAR_BEAM, MOVE_MOONLIGHT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("VOLBEAT"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("FRANCISCO"), + .facilityClass = FACILITY_CLASS_POKEFAN_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_STUDY, EC_WORD_EVERY, EC_WORD_DAY, EC_WORD_TOO, 0xFFFF}, + .speechWin = {EC_WORD_SO, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_LOSE, 0xFFFF}, + .speechLose = {EC_WORD_NO, EC_WORD_WONDER, EC_WORD_I, EC_WORD_COULDN_T, EC_WORD_BEAT, EC_WORD_YOU}, + .speechAfter = {EC_WORD_YES, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_THANK_YOU, 0xFFFF, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_SPINDA, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xE2880098, + .nickname = _("SPINDA"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MINUN, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("MINUN"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_ILLUMISE, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_HELPING_HAND, MOVE_WISH, MOVE_THUNDERBOLT, MOVE_MOONLIGHT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ILLUMISE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 31, + .defenseIV = 30, + .speedIV = 30, + .spAttackIV = 30, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x302, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 30, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 30, + .spDefenseIV = 30, + .altAbility = 0, + .personality = 0x203, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_TWISTED_SPOON, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 30, + .speedIV = 30, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x301, + .nickname = _("UNOWN"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x65, 0x40, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x42, 0x73, 0x41, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x43, 0x73, 0x43, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x43, 0x6D, 0x41, 0x73, 0x43, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x40, 0x73, 0x8, 0x6C, 0x73, 0x40, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF}, + .coords = {42, 46}, + .direction = 0x23, + .range = 0x33, + }, + }, +}; +static const struct TrHillTag sDataTagUnique = +{ + .unkField_0 = 8, + .unused1 = 3, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 243, + .unused5 = 82, + .unused6 = 6, + .floors = + { + [0] = + { + .unk0 = 0x31, + .unk1 = 0x32, + .trainers = + { + [0] = + { + .name = _("MEREDITH"), + .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, + .unused = 0, + .speechBefore = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechWin = {EC_WORD_OH, EC_WORD_EXCL, 0xFFFF, EC_WORD_UM, EC_WORD_ELLIPSIS, EC_WORD_YAY}, + .speechLose = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_WAAAH, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechAfter = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_ELLIPSIS}, + .mons = + { + [0] = + { + .species = SPECIES_SUNFLORA, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_PETAL_DANCE, MOVE_GRASS_WHISTLE, MOVE_LIGHT_SCREEN, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 155, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x0, + .nickname = _("SUNFLORA"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_TANGELA, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_GIGA_DRAIN, MOVE_SLEEP_POWDER, MOVE_AMNESIA, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spDefenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x91, + .nickname = _("TANGELA"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_VENUSAUR, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_SOLAR_BEAM, MOVE_EARTHQUAKE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 100, + .attackEV = 110, + .defenseEV = 100, + .spAttackEV = 100, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x1F, + .nickname = _("VENUSAUR"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_LANTURN, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_SPARK, MOVE_WATER_PULSE, MOVE_CONFUSE_RAY, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("LANTURN"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_MANECTRIC, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_THUNDERBOLT, MOVE_HEADBUTT, MOVE_BITE, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("MANECTRIC"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_RAIKOU, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_THUNDER, MOVE_CRUNCH, MOVE_ROAR, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("RAIKOU"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("BERNARD"), + .facilityClass = FACILITY_CLASS_KINDLER, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_LOSE, EC_WORD_THIS, EC_WORD_HOT, EC_WORD_BATTLE}, + .speechWin = {EC_WORD_DID, EC_WORD_I, EC_WORD_COOL, EC_WORD_YOU, EC_WORD_DOWN, EC_WORD_QUES}, + .speechLose = {EC_WORD_AIYEEH, EC_WORD_EXCL, EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_TERRIBLE, EC_WORD_PERSON}, + .speechAfter = {EC_WORD_YOUR, EC_WORD_HEART, EC_WORD_MUST_BE, EC_WORD_ICE, EC_WORD_COLD, EC_WORD_ELLIPSIS}, + .mons = + { + [0] = + { + .species = SPECIES_RELICANTH, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_ANCIENT_POWER, MOVE_WATER_PULSE, MOVE_MUD_SPORT, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 155, + .defenseEV = 100, + .spDefenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x2F, + .nickname = _("RELICANTH"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_GOLDUCK, + .heldItem = ITEM_LAX_INCENSE, + .moves = {MOVE_SURF, MOVE_PSYBEAM, MOVE_BRICK_BREAK, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("GOLDUCK"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_BLASTOISE, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_HYDRO_PUMP, MOVE_BITE, MOVE_MIRROR_COAT, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("BLASTOISE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MAGCARGO, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_HEAT_WAVE, MOVE_ROCK_SLIDE, MOVE_PROTECT, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spDefenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x93, + .nickname = _("MAGCARGO"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_RAPIDASH, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_FIRE_BLAST, MOVE_BOUNCE, MOVE_QUICK_ATTACK, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("RAPIDASH"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_MOLTRES, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SKY_ATTACK, MOVE_AERIAL_ACE, MOVE_ROAR, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("MOLTRES"), + .friendship = 255, + }, + }, + }, + }, + .data = {0xF1, 0xF5, 0xFB, 0xF5, 0xE6, 0xE6, 0x1B, 0x14, 0x15, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xF9, 0xE6, 0xEE, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0x9B, 0x9B, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0x9B, 0xDB, 0xDB, 0x9B, 0xEC, 0xFB, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xF5, 0x95, 0x95, 0xF5, 0xF5, 0xF5, 0xEB, 0xEC, 0xEB, 0xFB, 0xEB, 0x8, 0xED, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x8, 0xF4, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xF5, 0xFB, 0x8, 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x5E01, 0x50FF, 0x5083, 0x503B, 0x5FEB, 0xC02B, 0x5FEB, 0x5009, 0x57FD, 0x1005, 0x7FF5, 0x15, 0x7FF5, 0x1, 0xFFFF}, + .coords = {52, 55}, + .direction = 0x23, + .range = 0x22, + }, + [1] = + { + .unk0 = 0x33, + .unk1 = 0x34, + .trainers = + { + [0] = + { + .name = _("ABRAHAM"), + .facilityClass = FACILITY_CLASS_RUIN_MANIAC, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_POKEMON, EC_WORD_THE, EC_WORD_BEST}, + .speechWin = {EC_WORD_WHAT, EC_WORD_A, EC_WORD_GREAT, EC_WORD_POKEMON, EC_WORD_IT, EC_WORD_IS}, + .speechLose = {EC_WORD_I, EC_WORD_CONFUSED, EC_WORD_A, EC_WORD_MOVE, EC_WORD_WITH, EC_WORD_ANOTHER}, + .speechAfter = {EC_WORD_I, EC_WORD_WANT, EC_WORD_A, EC_MOVE(SKETCH), EC_WORD_OF, EC_WORD_YOU}, + .mons = + { + [0] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_EARTHQUAKE, MOVE_SHADOW_BALL, MOVE_AERIAL_ACE, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_REST, MOVE_THUNDER_WAVE, MOVE_FLAMETHROWER, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x87, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_EXPLOSION}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xA, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_TOXIC, MOVE_PROTECT, MOVE_WILL_O_WISP, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xA, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("LUC"), + .facilityClass = FACILITY_CLASS_TUBER_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_HAVE, EC_WORD_A, EC_WORD_COOL, EC_WORD_RARE, EC_WORD_MOVE}, + .speechWin = {EC_WORD_MY, EC_WORD_RARE, EC_WORD_MOVE, EC_WORD_IS, EC_WORD_COOL, EC_WORD_ISN_T_IT_QUES}, + .speechLose = {EC_WORD_DIDN_T, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_MY, EC_WORD_MOVE, EC_WORD_QUES}, + .speechAfter = {EC_WORD_I_AM, EC_WORD_SMART, EC_WORD_BUT, EC_WORD_ALSO, EC_WORD_WEAK, EC_WORD_ELLIPSIS}, + .mons = + { + [0] = + { + .species = SPECIES_STARYU, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_CAMOUFLAGE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xA, + .nickname = _("STARYU"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MEOWTH, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_PAY_DAY, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xD, + .nickname = _("MEOWTH"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_BLAZIKEN, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_BLAZE_KICK, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x28, + .nickname = _("BLAZIKEN"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_CUBONE, + .heldItem = ITEM_THICK_CLUB, + .moves = {MOVE_BONEMERANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0x16, + .nickname = _("CUBONE"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_BEEDRILL, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_TWINEEDLE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("BEEDRILL"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_RATICATE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_SUPER_FANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xD, + .nickname = _("RATICATE"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x94, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x8, 0x8D, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8C, 0x8, 0x94, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x9B, 0x9B, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x9B, 0x95, 0x8F, 0x9B, 0x8, 0x91, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x95, 0x97, 0x95, 0x97, 0x8C, 0x9B, 0x8C, 0x97, 0x95, 0x8, 0x91, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x87, 0x95, 0x87, 0x8C, 0x8, 0x8D, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8, 0x94, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x8, 0x91, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x95, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x95, 0x8F, 0x8B, 0x8F, 0x8C, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8, 0x91, 0x97, 0x8C, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8B, 0x97, 0x9B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8C, 0x9B, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7C1, 0x8AA1, 0x209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF}, + .coords = {105, 109}, + .direction = 0x23, + .range = 0x33, + }, + [2] = + { + .unk0 = 0x35, + .unk1 = 0x36, + .trainers = + { + [0] = + { + .name = _("BREYDEN"), + .facilityClass = FACILITY_CLASS_YOUNGSTER, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_CARE, EC_WORD_FOR, EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_A_LOT}, + .speechWin = {EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_CAN, EC_WORD_DO, EC_WORD_IT, EC_WORD_ALL}, + .speechLose = {EC_WORD_IT_S, EC_WORD_NOT, EC_WORD_LIKE, EC_WORD_WE, EC_WORD_ALWAYS, EC_WORD_WIN}, + .speechAfter = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THE, EC_WORD_BEGINNING, EC_WORD_POKEMON, EC_WORD_BEST}, + .mons = + { + [0] = + { + .species = SPECIES_CHARMELEON, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_FIRE_SPIN, MOVE_DRAGON_RAGE, MOVE_FLAMETHROWER, MOVE_SLASH}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x32, + .nickname = _("CHARMELEON"), + .friendship = 100, + }, + [1] = + { + .species = SPECIES_WARTORTLE, + .heldItem = ITEM_MYSTIC_WATER, + .moves = {MOVE_HYDRO_PUMP, MOVE_SKULL_BASH, MOVE_RAIN_DANCE, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x0, + .nickname = _("WARTORTLE"), + .friendship = 100, + }, + [2] = + { + .species = SPECIES_IVYSAUR, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_SOLAR_BEAM, MOVE_SYNTHESIS, MOVE_GROWTH, MOVE_SWEET_SCENT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x0, + .nickname = _("IVYSAUR"), + .friendship = 100, + }, + [3] = + { + .species = SPECIES_BAYLEEF, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_SOLAR_BEAM, MOVE_SAFEGUARD, MOVE_LIGHT_SCREEN, MOVE_BODY_SLAM}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .attackEV = 130, + .spAttackEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x32, + .nickname = _("BAYLEEF"), + .friendship = 100, + }, + [4] = + { + .species = SPECIES_CROCONAW, + .heldItem = ITEM_MYSTIC_WATER, + .moves = {MOVE_SCARY_FACE, MOVE_SLASH, MOVE_HYDRO_PUMP, MOVE_SCREECH}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x3, + .nickname = _("CROCONAW"), + .friendship = 100, + }, + [5] = + { + .species = SPECIES_QUILAVA, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_QUICK_ATTACK, MOVE_FLAMETHROWER, MOVE_FLAME_WHEEL, MOVE_SWIFT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("QUILAVA"), + .friendship = 100, + }, + }, + }, + [1] = + { + .name = _("ANIYA"), + .facilityClass = FACILITY_CLASS_TUBER_F, + .unused = 0, + .speechBefore = {EC_WORD_SOMEONE, EC_WORD_GOT, EC_WORD_ME, EC_WORD_A_LITTLE, EC_WORD_POKEMON, EC_WORD_EGG}, + .speechWin = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_NEW, EC_WORD_AT, EC_WORD_THIS, EC_WORD_EXCL}, + .speechLose = {EC_WORD_OH, EC_WORD_BUT, EC_WORD_ELLIPSIS, EC_WORD_WHY, EC_WORD_WHY, EC_WORD_QUES_EXCL}, + .speechAfter = {EC_WORD_YOU_RE, EC_WORD_BUSY, EC_WORD_QUES, EC_WORD_DON_T, EC_WORD_GIVE_UP, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SMOOCHUM, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_ICE_BEAM, MOVE_PSYCHIC, MOVE_SWEET_KISS, MOVE_FAKE_TEARS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x32, + .nickname = _("SMOOCHUM"), + .friendship = 50, + }, + [1] = + { + .species = SPECIES_AZURILL, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_SURF, MOVE_SING, MOVE_RAIN_DANCE, MOVE_BLIZZARD}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xC8, + .nickname = _("AZURILL"), + .friendship = 50, + }, + [2] = + { + .species = SPECIES_ELEKID, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_FIRE_PUNCH, MOVE_THUNDER, MOVE_ICE_PUNCH, MOVE_THUNDER_WAVE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("ELEKID"), + .friendship = 50, + }, + [3] = + { + .species = SPECIES_CLEFFA, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_MEGA_KICK, MOVE_SWEET_KISS, MOVE_SING, MOVE_METRONOME}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("CLEFFA"), + .friendship = 50, + }, + [4] = + { + .species = SPECIES_WYNAUT, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_ENCORE, MOVE_COUNTER, MOVE_MIRROR_COAT, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x84, + .nickname = _("WYNAUT"), + .friendship = 50, + }, + [5] = + { + .species = SPECIES_MAGBY, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_FIRE_BLAST, MOVE_CONFUSE_RAY, MOVE_THUNDER_PUNCH, MOVE_BARRIER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("MAGBY"), + .friendship = 50, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x8, 0x69, 0x46, 0x7A, 0x73, 0x73, 0x73, 0x79, 0x73, 0x73, 0x73, 0x7D, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x73, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x7B, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x7A, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7A, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x73, 0x73, 0x73, 0x7D, 0x7C, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0xF1, 0x46, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7A, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7C, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xFB, 0x8, 0x7C, 0xFB, 0x7B, 0xFB, 0x7A, 0xFB, 0x79, 0xFB, 0xB3, 0xFB, 0x7D, 0xFB, 0x7E, 0xFB, 0x7D, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 0x4443, 0x7EFF, 0x4001, 0x7FFD, 0x1, 0xFFFF}, + .coords = {150, 152}, + .direction = 0x23, + .range = 0x11, + }, + [3] = + { + .unk0 = 0x38, + .unk1 = 0x37, + .trainers = + { + [0] = + { + .name = _("DANE"), + .facilityClass = FACILITY_CLASS_BIRD_KEEPER, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_GOT, EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_ON, EC_WORD_VACATION}, + .speechWin = {EC_WORD_IT_S, EC_WORD_GREAT, EC_WORD_TO, EC_WORD_TRAVEL, EC_WORD_AND, EC_WORD_BATTLE}, + .speechLose = {EC_WORD_WAAAH, EC_WORD_EXCL, EC_WORD_MY, EC_WORD_RARE, EC_WORD_POKEMON, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_OFF, EC_WORD_ON, EC_WORD_ANOTHER, EC_WORD_VACATION, EC_WORD_I, EC_WORD_GO}, + .mons = + { + [0] = + { + .species = SPECIES_SUDOWOODO, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_ROCK_SLIDE, MOVE_BLOCK, MOVE_TOXIC, MOVE_EXPLOSION}, + .level = 0, + .ppBonuses = 0, + .hpEV = 100, + .attackEV = 255, + .spDefenseEV = 155, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x80, + .nickname = _("SUDOWOODO"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SLOWKING, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_BLIZZARD, MOVE_DISABLE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8C, + .nickname = _("SLOWKING"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_ENTEI, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_FLAMETHROWER, MOVE_CALM_MIND, MOVE_FIRE_SPIN, MOVE_ROAR}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ENTEI"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_HITMONCHAN, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_MEGA_PUNCH, MOVE_DETECT, MOVE_COUNTER, MOVE_SKY_UPPERCUT}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONCHAN"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_MANTINE, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_SURF, MOVE_CONFUSE_RAY, MOVE_ATTRACT, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x6, + .nickname = _("MANTINE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ZAPDOS, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_THUNDERBOLT, MOVE_DRILL_PECK, MOVE_THUNDER_WAVE, MOVE_AGILITY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x18, + .nickname = _("ZAPDOS"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("STEPHANIE"), + .facilityClass = FACILITY_CLASS_SWIMMING_TRIATHLETE_F, + .unused = 0, + .speechBefore = {EC_WORD_THIS, EC_WORD_IS, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_WIN, EC_WORD_EXCL}, + .speechWin = {EC_WORD_DO, EC_WORD_YOU, EC_WORD_UNDERSTAND, EC_WORD_HOW, EC_WORD_NOW, EC_WORD_QUES}, + .speechLose = {EC_WORD_YES, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_DO, EC_WORD_IT}, + .speechAfter = {EC_WORD_YOU, EC_WORD_BEAT, EC_WORD_ME, EC_WORD_GOOD, EC_WORD_FOR, EC_WORD_YOU}, + .mons = + { + [0] = + { + .species = SPECIES_HITMONLEE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_MEGA_KICK, MOVE_MIND_READER, MOVE_FOCUS_ENERGY, MOVE_HI_JUMP_KICK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONLEE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_PORYGON2, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_LOCK_ON, MOVE_BLIZZARD, MOVE_CONVERSION_2, MOVE_PSYCHIC}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("PORYGON2"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_SUICUNE, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_SURF, MOVE_CALM_MIND, MOVE_MIRROR_COAT, MOVE_MIST}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("SUICUNE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_HOUNDOOM, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_FLAMETHROWER, MOVE_CRUNCH, MOVE_ROAR, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("HOUNDOOM"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_STANTLER, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_CONFUSE_RAY, MOVE_SWAGGER, MOVE_PSYCH_UP, MOVE_TAKE_DOWN}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("STANTLER"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ARTICUNO, + .heldItem = ITEM_NEVER_MELT_ICE, + .moves = {MOVE_BLIZZARD, MOVE_SHEER_COLD, MOVE_MIST, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ARTICUNO"), + .friendship = 255, + }, + }, + }, + }, + .data = {0xF1, 0xFB, 0xFB, 0xFB, 0xF9, 0xF9, 0x1B, 0x1C, 0x1D, 0xE5, 0xE6, 0xEE, 0xF5, 0xFB, 0xFB, 0x8, 0xED, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x8, 0xF4, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xF5, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0x8, 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x3F9, 0xF041, 0x41, 0x7F5F, 0x4401, 0x4541, 0x5579, 0x5541, 0x555F, 0x5541, 0x5541, 0x557D, 0x1101, 0x1101, 0xFFFF}, + .coords = {40, 91}, + .direction = 0x21, + .range = 0x33, + }, + }, +}; +static const struct TrHillTag sDataTagExpert = +{ + .unkField_0 = 8, + .unused1 = 1, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 63, + .unused5 = 31, + .unused6 = 6, + .floors = + { + [0] = + { + .unk0 = 0x39, + .unk1 = 0x3A, + .trainers = + { + [0] = + { + .name = _("ALFRED"), + .facilityClass = FACILITY_CLASS_COOLTRAINER_M, + .unused = 0, + .speechBefore = {EC_WORD_WE, EC_WORD_CAN, EC_WORD_TAKE, EC_WORD_ON, EC_WORD_ANY, EC_WORD_TYPE}, + .speechWin = {EC_WORD_WE, EC_WORD_DID, EC_WORD_BETTER, EC_WORD_THAN, EC_WORD_OKAY, EC_WORD_EXCL}, + .speechLose = {EC_WORD_OUR, EC_WORD_STRATEGY, EC_WORD_ISN_T, EC_WORD_ANY, EC_WORD_GOOD, EC_WORD_ELLIPSIS}, + .speechAfter = {EC_WORD_WE, EC_WORD_NEED, EC_WORD_TO, EC_WORD_TRAIN, EC_WORD_A_LOT, EC_WORD_MORE}, + .mons = + { + [0] = + { + .species = SPECIES_SNORLAX, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_EARTHQUAKE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .defenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x35, + .nickname = _("SNORLAX"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MILTANK, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_MILK_DRINK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("MILTANK"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_URSARING, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_DOUBLE_EDGE, MOVE_CRUNCH, MOVE_BRICK_BREAK, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x7F, + .nickname = _("URSARING"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_SLAKING, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_HYPER_BEAM, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_REST}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("SLAKING"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_KANGASKHAN, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_FAKE_OUT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("KANGASKHAN"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ZANGOOSE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_CRUSH_CLAW, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_ROAR}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("ZANGOOSE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("EDIE"), + .facilityClass = FACILITY_CLASS_PSYCHIC_F, + .unused = 0, + .speechBefore = {EC_WORD_WE, EC_WORD_WILL_BE_HERE, EC_WORD_FOR, EC_WORD_ANY, EC_WORD_TRAINER, EC_WORD_CHALLENGE}, + .speechWin = {EC_WORD_MY, EC_WORD_STRATEGY, EC_WORD_WORKS, EC_WORD_TO, EC_WORD_PERFECTION, EC_WORD_EXCL}, + .speechLose = {EC_WORD_NO, EC_WORD_NO, EC_WORD_ELLIPSIS, EC_WORD_THAT, EC_WORD_WON_T, EC_WORD_DO}, + .speechAfter = {EC_WORD_THERE, EC_WORD_SHOULD, EC_WORD_BE, EC_WORD_A, EC_WORD_TRAINER, EC_WORD_SCHOOL}, + .mons = + { + [0] = + { + .species = SPECIES_SLOWKING, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_ICE_BEAM, MOVE_SKILL_SWAP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 110, + .spAttackEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xF, + .nickname = _("SLOWKING"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ESPEON, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_BITE, MOVE_CALM_MIND, MOVE_REFLECT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x28, + .nickname = _("ESPEON"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_STARMIE, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_ICE_BEAM}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xF, + .nickname = _("STARMIE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("GENGAR"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_GARDEVOIR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_MAGICAL_LEAF, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("GARDEVOIR"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ALAKAZAM, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_RECOVER, MOVE_THUNDER_WAVE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ALAKAZAM"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x3B, 0x8, 0x69, 0x73, 0x8, 0x4D, 0x4D, 0x4D, 0x4D, 0xD1, 0x4D, 0x4D, 0x4D, 0x4D, 0x8, 0x69, 0x73, 0x8, 0x40, 0x3B, 0x8, 0x55, 0x55, 0x55, 0x55, 0xD1, 0x55, 0x55, 0x55, 0x55, 0x8, 0x31, 0x41, 0x8, 0x69, 0x41, 0x8, 0xC5, 0xD9, 0xD9, 0xD9, 0x9A, 0xD9, 0xD9, 0xD9, 0xC6, 0x8, 0x41, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x8, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xCD, 0x9B, 0x73, 0x73, 0x44, 0x73, 0x73, 0x9B, 0xD5, 0x8, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x8, 0x31, 0x73, 0x8, 0x69, 0x41, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xDB, 0xDB, 0xDB, 0x8, 0x41, 0x73, 0x8, 0x40, 0x3B, 0x8, 0x8, 0xC7, 0xC7, 0xDB, 0xDB, 0xDB, 0xC7, 0xC7, 0x8, 0x8, 0x31, 0x41, 0x8, 0x69, 0x3B, 0x4D, 0x4D, 0x67, 0x67, 0xDB, 0xDB, 0xDB, 0x67, 0x67, 0x4D, 0x4D, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x55, 0x55, 0xD7, 0xD7, 0xD1, 0xDB, 0xDB, 0xD7, 0xD7, 0x55, 0x55, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x73, 0x8, 0x69, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x201, 0x3EF9, 0x3EF9, 0x3EF9, 0x2009, 0x3019, 0x2009, 0x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF}, + .coords = {116, 122}, + .direction = 0x23, + .range = 0x55, + }, + [1] = + { + .unk0 = 0x3B, + .unk1 = 0x3C, + .trainers = + { + [0] = + { + .name = _("RODERICK"), + .facilityClass = FACILITY_CLASS_COOLTRAINER_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_CAN, EC_WORD_WIN, EC_WORD_WITHOUT, EC_WORD_A, EC_MOVE2(HELPING_HAND)}, + .speechWin = {EC_WORD_IT_S, EC_WORD_ONLY, EC_WORD_NATURAL, EC_WORD_THAT, EC_WORD_I, EC_WORD_WIN}, + .speechLose = {EC_WORD_LOSING, EC_WORD_HAS, EC_WORD_ME, EC_WORD_FEELING, EC_WORD_SMALL, EC_WORD_ELLIPSIS}, + .speechAfter = {EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_A, EC_WORD_GOOD, EC_WORD_TEACHER, EC_WORD_QUES}, + .mons = + { + [0] = + { + .species = SPECIES_SWELLOW, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_AERIAL_ACE, MOVE_AGILITY, MOVE_FACADE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("SWELLOW"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MACHAMP, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_LOW_KICK, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("MACHAMP"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_URSARING, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_PROTECT, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("URSARING"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_KINGLER, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_RETURN, MOVE_PROTECT, MOVE_CRABHAMMER, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("KINGLER"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_TYRANITAR, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_ROCK_SLIDE, MOVE_CRUNCH, MOVE_EARTHQUAKE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .defenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("TYRANITAR"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_DRAGONITE, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_BODY_SLAM, MOVE_THUNDER_WAVE, MOVE_EARTHQUAKE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("DRAGONITE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("ALICIA"), + .facilityClass = FACILITY_CLASS_COOLTRAINER_F, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_NEED, EC_WORD_A, EC_MOVE2(HELPING_HAND), EC_WORD_EXCL}, + .speechWin = {EC_WORD_SORRY, EC_WORD_EXCL, EC_WORD_TOO, EC_WORD_BAD, EC_WORD_FOR, EC_WORD_YOU}, + .speechLose = {EC_WORD_WHAT, EC_WORD_AN, EC_WORD_UNBELIEVABLE, EC_MOVE2(STRUGGLE), EC_WORD_THAT_WAS, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_I, EC_WORD_CAN, EC_WORD_BE, EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_TEACHER}, + .mons = + { + [0] = + { + .species = SPECIES_JOLTEON, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_ATTRACT, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xA, + .nickname = _("JOLTEON"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ALAKAZAM, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_PSYCHIC, MOVE_ICE_PUNCH, MOVE_ATTRACT, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xA, + .nickname = _("ALAKAZAM"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_STARMIE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xA, + .nickname = _("STARMIE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_DUSCLOPS, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_PURSUIT, MOVE_PROTECT, MOVE_ATTRACT, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x82, + .nickname = _("DUSCLOPS"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_NINETALES, + .heldItem = ITEM_WHITE_HERB, + .moves = {MOVE_OVERHEAT, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xD2, + .nickname = _("NINETALES"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_BANETTE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_SHADOW_BALL, MOVE_FAINT_ATTACK, MOVE_ATTRACT, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x85, + .nickname = _("BANETTE"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x8, 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x8, 0x91, 0x46, 0x7D, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0xB3, 0x9B, 0x9B, 0x9B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x9B, 0x8, 0x91, 0x46, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x8, 0x91, 0x46, 0x9B, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xB3, 0x8, 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x8, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0x8, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, + .coords = {167, 231}, + .direction = 0x1, + .range = 0x33, + }, + [2] = + { + .unk0 = 0x3D, + .unk1 = 0x3E, + .trainers = + { + [0] = + { + .name = _("TERRENCE"), + .facilityClass = FACILITY_CLASS_EXPERT_M, + .unused = 0, + .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_THIS, EC_WORD_MATCH, EC_WORD_IS, EC_WORD_FOR, EC_WORD_YOU}, + .speechWin = {EC_WORD_OH_DEAR, EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES}, + .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SORRY, 0xFFFF, 0xFFFF}, + .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDMOTHER, EC_WORD_STRONG, EC_WORD_QUES, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_WOBBUFFET, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_MIRROR_COAT, MOVE_COUNTER, MOVE_SAFEGUARD, MOVE_ENCORE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x94, + .nickname = _("WOBBUFFET"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_EXPLOUD, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_HYPER_VOICE, MOVE_COUNTER, MOVE_REST, MOVE_ROCK_SLIDE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x85, + .nickname = _("EXPLOUD"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_CROBAT, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_AERIAL_ACE, MOVE_TOXIC}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("CROBAT"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_DUGTRIO, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_DOUBLE_TEAM, MOVE_PROTECT, MOVE_RETURN, MOVE_SLUDGE_BOMB}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xD, + .nickname = _("DUGTRIO"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_ELECTRODE, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_TORMENT, MOVE_MIRROR_COAT, MOVE_THUNDERBOLT, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x5, + .nickname = _("ELECTRODE"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_CONFUSE_RAY, MOVE_MEAN_LOOK, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x14, + .nickname = _("GENGAR"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("CARLOTTA"), + .facilityClass = FACILITY_CLASS_EXPERT_F, + .unused = 0, + .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_I, EC_WORD_WILL, EC_WORD_WIN, EC_WORD_FOR, EC_WORD_YOU}, + .speechWin = {EC_WORD_OH_DEAR, EC_WORD_WE, EC_WORD_HAVE, EC_WORD_A, EC_WORD_PARTY, EC_WORD_LATER}, + .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_TO, EC_WORD_DISAPPOINT, EC_WORD_YOU}, + .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDFATHER, EC_WORD_COOL, EC_WORD_QUES, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_LAPRAS, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_PERISH_SONG, MOVE_SING}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x82, + .nickname = _("LAPRAS"), + .friendship = 0, + }, + [1] = + { + .species = SPECIES_ABSOL, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PERISH_SONG, MOVE_DOUBLE_EDGE, MOVE_PROTECT, MOVE_TORMENT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("ABSOL"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_ALTARIA, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_PERISH_SONG, MOVE_PROTECT, MOVE_DRAGON_CLAW, MOVE_FIRE_BLAST}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .spAttackEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("ALTARIA"), + .friendship = 0, + }, + [3] = + { + .species = SPECIES_DEWGONG, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_ICE_BEAM, MOVE_SIGNAL_BEAM, MOVE_REST, MOVE_PERISH_SONG}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x14, + .nickname = _("DEWGONG"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_POLITOED, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HYDRO_PUMP, MOVE_BLIZZARD, MOVE_MIND_READER, MOVE_PERISH_SONG}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .spAttackEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0x14, + .nickname = _("POLITOED"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_MAROWAK, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_PERISH_SONG, MOVE_EARTHQUAKE, MOVE_COUNTER, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0x17, + .nickname = _("MAROWAK"), + .friendship = 0, + }, + }, + }, + }, + .data = {0xD1, 0xDB, 0xDB, 0xDB, 0xD9, 0xD9, 0x1B, 0x14, 0x15, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xD5, 0xD5, 0xC3, 0xF9, 0x86, 0x8E, 0x95, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x8, 0xD1, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x8, 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xCC, 0xCC, 0xFB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCC, 0xCC, 0xCC, 0xCC, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xD5, 0xD5, 0xD5, 0xD5, 0xFB, 0xEC, 0xFB, 0xEC, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xF5, 0xF5, 0xFB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x8, 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xCC, 0xCC, 0xCB, 0xFB, 0x8C, 0x8C, 0x8C, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCC, 0xFB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8}, + .unk3A0 = {0x381, 0x201, 0xEE1, 0x1EF1, 0x3EF9, 0x3EF9, 0x7E7D, 0x783D, 0x2BD, 0x783D, 0x7E7D, 0x3E79, 0x3EF9, 0x1EF1, 0xEE1, 0x201}, + .coords = {103, 167}, + .direction = 0x1, + .range = 0x33, + }, + [3] = + { + .unk0 = 0x3F, + .unk1 = 0x40, + .trainers = + { + [0] = + { + .name = _("NORA"), + .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, + .unused = 0, + .speechBefore = {EC_WORD_WAAAH, EC_WORD_THIS, EC_WORD_IS, EC_WORD_SO, EC_WORD_EXCITING, EC_WORD_EXCL}, + .speechWin = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_HAPPY, EC_WORD_I, EC_WORD_WON}, + .speechLose = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SAD, EC_WORD_I, EC_WORD_LOST}, + .speechAfter = {EC_WORD_WAAAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_GO, EC_WORD_AWAY, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_FORRETRESS, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_EXPLOSION, MOVE_EARTHQUAKE, MOVE_ATTRACT, MOVE_SPIKES}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .attackEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("FORRETRESS"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ELECTRODE, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_EXPLOSION, MOVE_THUNDERBOLT, MOVE_SWIFT, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xC, + .nickname = _("ELECTRODE"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_EXEGGUTOR, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_EXPLOSION, MOVE_HYPNOSIS, MOVE_PSYCHIC, MOVE_SOLAR_BEAM}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x7F, + .nickname = _("EXEGGUTOR"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_DUSCLOPS, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_ICE_BEAM, MOVE_EARTHQUAKE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x93, + .nickname = _("DUSCLOPS"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_NINETALES, + .heldItem = ITEM_WHITE_HERB, + .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_OVERHEAT, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("NINETALES"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_BANETTE, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_THUNDERBOLT, MOVE_THUNDER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x96, + .nickname = _("BANETTE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("GAV"), + .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, + .unused = 0, + .speechBefore = {EC_WORD_WAHAHAHA, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_STOP, EC_WORD_ME, EC_WORD_EXCL}, + .speechWin = {EC_WORD_WOWEE, EC_WORD_EXCL, 0xFFFF, EC_WORD_I_AM, EC_WORD_AWESOME, EC_WORD_COOL}, + .speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_COOL, EC_WORD_AT, EC_WORD_ALL, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_HEHEHE, EC_WORD_THAT_WAS, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_BATTLE, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SALAMENCE, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_ROCK_SLIDE, MOVE_FLAMETHROWER, MOVE_DRAGON_CLAW, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x95, + .nickname = _("SALAMENCE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("GENGAR"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_GYARADOS, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_DRAGON_DANCE, MOVE_HYPER_BEAM, MOVE_BITE, MOVE_EARTHQUAKE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("GYARADOS"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_EXPLOSION, MOVE_MEAN_LOOK, MOVE_SHADOW_BALL, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("GENGAR"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_DUSCLOPS, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_SHADOW_BALL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x14, + .nickname = _("DUSCLOPS"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_MISDREAVUS, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_PERISH_SONG, MOVE_SHADOW_BALL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 180, + .defenseEV = 180, + .spDefenseEV = 150, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x85, + .nickname = _("MISDREAVUS"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0x96, 0x9B, 0x9B, 0x9B, 0x9B, 0xD6, 0xD6, 0x96, 0xD6, 0xD6, 0xDB, 0x9B, 0x9B, 0x9B, 0x96, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8}, + .unk3A0 = {0x381, 0x101, 0x101, 0x6C1, 0x821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x821, 0x6C1, 0x101, 0x101}, + .coords = {103, 167}, + .direction = 0x1, + .range = 0x33, + }, + }, +}; diff --git a/src/frontier_pass.c b/src/frontier_pass.c new file mode 100644 index 000000000..0db546c4d --- /dev/null +++ b/src/frontier_pass.c @@ -0,0 +1,1709 @@ +#include "global.h" +#include "gpu_regs.h" +#include "main.h" +#include "trainer_card.h" +#include "battle_anim.h" +#include "event_data.h" +#include "recorded_battle.h" +#include "alloc.h" +#include "sprite.h" +#include "scanline_effect.h" +#include "text_window.h" +#include "task.h" +#include "graphics.h" +#include "strings.h" +#include "frontier_pass.h" +#include "international_string_util.h" +#include "palette.h" +#include "window.h" +#include "decompress.h" +#include "menu_helpers.h" +#include "menu.h" +#include "bg.h" +#include "sound.h" +#include "string_util.h" +#include "battle_pyramid.h" +#include "overworld.h" +#include "math_util.h" +#include "constants/battle_frontier.h" +#include "constants/maps.h" +#include "constants/rgb.h" +#include "constants/region_map_sections.h" +#include "constants/songs.h" + +// All windows displayed in the frontier pass. +enum +{ + WINDOW_EARNED_SYMBOLS, + WINDOW_BATTLE_RECORD, + WINDOW_BATTLE_POINTS, + WINDOW_DESCRIPTION, + WINDOW_4, + WINDOW_COUNT +}; + +// Windows displayed in the facilities map view. +enum +{ + MAP_WINDOW_0, + MAP_WINDOW_NAME, + MAP_WINDOW_DESCRIPTION, + MAP_WINDOW_COUNT +}; + +enum +{ + CURSOR_AREA_NOTHING, + CURSOR_AREA_MAP, + CURSOR_AREA_CARD, + CURSOR_AREA_RECORD, + CURSOR_AREA_CANCEL, + CURSOR_AREA_POINTS, + CURSOR_AREA_EARNED_SYMBOLS, // The window. + CURSOR_AREA_SYMBOL, // All 7 symbols. + CURSOR_AREA_COUNT = CURSOR_AREA_SYMBOL + NUM_FRONTIER_FACILITIES, +}; + +struct FrontierPassData +{ + void (*callback)(void); + u16 state; + u16 battlePoints; + s16 cursorX; + s16 cursorY; + u8 cursorArea; + u8 previousCursorArea; + u8 hasBattleRecord:1; + u8 unkE:3; + u8 trainerStars:4; + u8 facilitySymbols[NUM_FRONTIER_FACILITIES]; +}; + +struct FrontierPassGfx +{ + struct Sprite *cursorSprite; + struct Sprite *symbolSprites[NUM_FRONTIER_FACILITIES]; + u8 *unk20; + u8 *unk24; + u8 *unk28; + bool8 setAffine; + s16 unk2E; + s16 unk30; + u8 tilemapBuff1[0x1000]; + u8 tilemapBuff2[0x1000]; + u8 tilemapBuff3[0x400]; +}; + +struct FrontierPassSaved +{ + void (*callback)(void); + s16 cursorX; + s16 cursorY; +}; + +struct FrontierMapData +{ + void (*callback)(void); + struct Sprite *cursorSprite; + struct Sprite *playerHeadSprite; + struct Sprite *mapIndicatorSprite; + u8 cursorPos; + u8 unused; + u8 tilemapBuff0[0x1000]; + u8 tilemapBuff1[0x1000]; + u8 tilemapBuff2[0x1000]; +}; + +static EWRAM_DATA struct FrontierPassData *sPassData = NULL; +static EWRAM_DATA struct FrontierPassGfx *sPassGfx = NULL; +static EWRAM_DATA struct FrontierMapData *sMapData = NULL; +static EWRAM_DATA struct FrontierPassSaved sSavedPassData = {0}; + +// This file's functions. +static u32 AllocateFrontierPassData(void (*callback)(void)); +static void ShowFrontierMap(void (*callback)(void)); +static void CB2_InitFrontierPass(void); +static void sub_80C629C(void); +static void FreeCursorAndSymbolSprites(void); +static void LoadCursorAndSymbolSprites(void); +static u32 FreeFrontierPassData(void); +static bool32 InitFrontierPass(void); +static bool32 HideFrontierPass(void); +static void Task_HandleFrontierPassInput(u8 taskId); +static void Task_DoFadeEffect(u8 taskId); +static void sub_80C6104(u8 cursorArea, u8 previousCursorArea); +static void PrintAreaDescription(u8 cursorArea); +static void sub_80C5F58(bool8 arg0, bool8 arg1); +static void SpriteCb_Dummy(struct Sprite *sprite); + +// Const rom data. +static const u16 sMaleHeadPalette[] = INCBIN_U16("graphics/frontier_pass/map_heads.gbapal"); +static const u16 sFemaleHeadPalette[] = INCBIN_U16("graphics/frontier_pass/map_heads_female.gbapal"); +static const u32 gUnknown_0856FBBC[] = INCBIN_U32("graphics/frontier_pass/map_screen.4bpp.lz"); +static const u32 sCursorGfx[] = INCBIN_U32("graphics/frontier_pass/cursor.4bpp.lz"); +static const u32 sHeadsGfx[] = INCBIN_U32("graphics/frontier_pass/map_heads.4bpp.lz"); +static const u32 sMapCursorGfx[] = INCBIN_U32("graphics/frontier_pass/map_cursor.4bpp.lz"); +static const u32 gUnknown_08570E00[] = INCBIN_U32("graphics/frontier_pass/map_screen.bin.lz"); +static const u32 gUnknown_08571060[] = INCBIN_U32("graphics/frontier_pass/small_map_and_card.bin.lz"); +static const u32 gUnknown_08571298[] = INCBIN_U32("graphics/frontier_pass/unknown_571298.bin"); +static const u32 gUnknown_085712C0[] = INCBIN_U32("graphics/frontier_pass/record_frame.bin.lz"); +static const u32 gUnknown_085712F8[] = INCBIN_U32("graphics/frontier_pass/small_map_and_card_affine.bin.lz"); + +static const s16 gUnknown_085713E0[][2] = {{216, 32}, {216, 128}}; + +static const struct BgTemplate sPassBgTemplates[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 1, + .mapBaseIndex = 29, + .screenSize = 1, + .paletteMode = 1, + .priority = 0, + .baseTile = 0 + }, +}; + +static const struct BgTemplate sMapBgTemplates[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, +}; + +static const struct WindowTemplate sPassWindowTemplates[] = +{ + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 3, + .width = 12, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 10, + .width = 12, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x26, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 13, + .width = 12, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x4B, + }, + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 18, + .width = 30, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x7C, + }, + DUMMY_WIN_TEMPLATE +}; + +static const struct WindowTemplate sMapWindowTemplates[] = +{ + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 1, + .width = 15, + .height = 5, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 0, + .tilemapLeft = 20, + .tilemapTop = 1, + .width = 10, + .height = 14, + .paletteNum = 15, + .baseBlock = 0x4D, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 16, + .width = 26, + .height = 4, + .paletteNum = 15, + .baseBlock = 0xDA, + }, + DUMMY_WIN_TEMPLATE +}; + +static const u8 sTextColors[][3] = +{ + {0, 2, 3}, + {0, 1, 9}, + {0, 4, 5}, +}; + +struct +{ + s16 yStart; + s16 yEnd; + s16 xStart; + s16 xEnd; +} +static const sPassAreasLayout[] = +{ + {28, 76, 132, 220}, + {84, 132, 132, 220}, + {80, 102, 20, 108}, + {0, 16, 152, 240}, + {108, 134, 20, 108}, + {24, 48, 20, 108}, + {50, 66, 20, 36}, + {66, 82, 32, 48}, + {50, 66, 44, 60}, + {66, 82, 56, 72}, + {50, 66, 68, 84}, + {66, 82, 80, 96}, + {50, 66, 92, 108}, +}; + +static const struct CompressedSpriteSheet sCursorSpriteSheets[] = +{ + {sCursorGfx, 0x100, 0}, + {sMapCursorGfx, 0x400, 1}, + {gFrontierPassMedals_Gfx, 0x380, 2}, +}; + +static const struct CompressedSpriteSheet sHeadsSpriteSheet[] = +{ + {sHeadsGfx, 0x100, 4}, + {} +}; + +static const struct SpritePalette sSpritePalettes[] = +{ + {gFrontierPassCursor_Pal, 0}, + {gFrontierPassMapCursor_Pal, 1}, + {gFrontierPassMedalsSilver_Pal, 2}, + {gFrontierPassMedalsGold_Pal, 3}, + {sMaleHeadPalette, 4}, + {sFemaleHeadPalette, 5}, + {} +}; + +static const union AnimCmd sSpriteAnim_857151C[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571524[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857152C[] = +{ + ANIMCMD_FRAME(4, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571534[] = +{ + ANIMCMD_FRAME(8, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857153C[] = +{ + ANIMCMD_FRAME(12, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571544[] = +{ + ANIMCMD_FRAME(16, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857154C[] = +{ + ANIMCMD_FRAME(20, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571554[] = +{ + ANIMCMD_FRAME(24, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857155C[] = +{ + ANIMCMD_FRAME(0, 45), + ANIMCMD_FRAME(8, 45), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_8571568[] = +{ + ANIMCMD_FRAME(16, 45), + ANIMCMD_FRAME(24, 45), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const sSpriteAnimTable_8571574[] = +{ + sSpriteAnim_8571524, + sSpriteAnim_857152C +}; + +static const union AnimCmd *const sSpriteAnimTable_857157C[] = +{ + sSpriteAnim_8571524, + sSpriteAnim_857152C, + sSpriteAnim_8571534, + sSpriteAnim_857153C, + sSpriteAnim_8571544, + sSpriteAnim_857154C, + sSpriteAnim_8571554 +}; + +static const union AnimCmd *const sSpriteAnimTable_8571598[] = +{ + sSpriteAnim_857155C, + sSpriteAnim_8571568 +}; + +static const union AffineAnimCmd sSpriteAffineAnim_85715A0[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const sSpriteAffineAnimTable_85715B0[] = +{ + sSpriteAffineAnim_85715A0 +}; + +static const struct SpriteTemplate sSpriteTemplates_Cursors[] = +{ + { + .tileTag = 0, + .paletteTag = 0, + .oam = &gUnknown_0852490C, + .anims = sSpriteAnimTable_8571574, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, + { + .tileTag = 1, + .paletteTag = 1, + .oam = &gUnknown_08524934, + .anims = sSpriteAnimTable_8571598, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, +}; + +static const struct SpriteTemplate sSpriteTemplate_Medal = +{ + .tileTag = 2, + .paletteTag = 2, + .oam = &gUnknown_0852490C, + .anims = sSpriteAnimTable_857157C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct SpriteTemplate sSpriteTemplate_Head = +{ + .tileTag = 4, + .paletteTag = 4, + .oam = &gUnknown_0852490C, + .anims = sSpriteAnimTable_8571574, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCb_Dummy, +}; + +static const u8 *const sPassAreaDescriptions[] = +{ + gUnknown_085EDA96, + gUnknown_085ED932, + gUnknown_085ED94D, + gUnknown_085ED961, + gUnknown_085ED977, + gUnknown_085ED993, + gUnknown_085ED9AF, + gUnknown_085ED9C7, + gUnknown_085ED9E5, + gUnknown_085EDA02, + gUnknown_085EDA21, + gUnknown_085EDA3C, + gUnknown_085EDA5E, + gUnknown_085EDA78, + gUnknown_085ED931, +}; + +struct +{ + const u8 *name; + const u8 *description; + s16 x; + s16 y; + u8 animNum; +} static const sMapLandmarks[] = +{ + {gUnknown_085EDAB1, gUnknown_085EDB0F, 0x59, 0x28, 1}, + {gUnknown_085EDABE, gUnknown_085EDB4E, 0x21, 0x2A, 1}, + {gUnknown_085EDACA, gUnknown_085EDB8B, 0x78, 0x56, 0}, + {gUnknown_085EDAD8, gUnknown_085EDBC2, 0x72, 0x3B, 0}, + {gUnknown_085EDAE5, gUnknown_085EDC00, 0x19, 0x43, 0}, + {gUnknown_085EDAF4, gUnknown_085EDC45, 0x39, 0x39, 1}, + {gUnknown_085EDB00, gUnknown_085EDC84, 0x86, 0x29, 1}, +}; + +// code +static void ResetGpuRegsAndBgs(void) +{ + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BG3CNT, 0); + SetGpuReg(REG_OFFSET_BG2CNT, 0); + SetGpuReg(REG_OFFSET_BG1CNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_WIN0H, 0); + SetGpuReg(REG_OFFSET_WIN0V, 0); + SetGpuReg(REG_OFFSET_WIN1H, 0); + SetGpuReg(REG_OFFSET_WIN1V, 0); + SetGpuReg(REG_OFFSET_WININ, 0); + SetGpuReg(REG_OFFSET_WINOUT, 0); + CpuFill16(0, (void *)VRAM, VRAM_SIZE); + CpuFill32(0, (void *)OAM, OAM_SIZE); +} + +void ShowFrontierPass(void (*callback)(void)) +{ + AllocateFrontierPassData(callback); + SetMainCallback2(CB2_InitFrontierPass); +} + +static void LeaveFrontierPass(void) +{ + SetMainCallback2(sPassData->callback); + FreeFrontierPassData(); +} + +static u32 AllocateFrontierPassData(void (*callback)(void)) +{ + u8 i; + + if (sPassData != NULL) + return 1; + + sPassData = AllocZeroed(sizeof(*sPassData)); + if (sPassData == NULL) + return 2; + + sPassData->callback = callback; + i = GetCurrentRegionMapSectionId(); + if (i != MAPSEC_BATTLE_FRONTIER && i != MAPSEC_ARTISAN_CAVE) + { + sPassData->cursorX = 176; + sPassData->cursorY = 104; + } + else + { + sPassData->cursorX = 176; + sPassData->cursorY = 48; + } + + sPassData->battlePoints = gSaveBlock2Ptr->frontier.battlePoints; + sPassData->hasBattleRecord = CanCopyRecordedBattleSaveData(); + sPassData->unkE = 0; + sPassData->trainerStars = CountPlayerTrainerStars(); + for (i = 0; i < 7; i++) + { + if (FlagGet(FLAG_SYS_TOWER_SILVER + i * 2)) + sPassData->facilitySymbols[i]++; + if (FlagGet(FLAG_SYS_TOWER_GOLD + i * 2)) + sPassData->facilitySymbols[i]++; + } + + return 0; +} + +static u32 FreeFrontierPassData(void) +{ + if (sPassData == NULL) + return 1; + + memset(sPassData, 0, sizeof(*sPassData)); // Why clear data, if it's going to be freed anyway? + FREE_AND_SET_NULL(sPassData); + return 0; +} + +static u32 AllocateFrontierPassGfx(void) +{ + if (sPassGfx != NULL) + return 1; + + sPassGfx = AllocZeroed(sizeof(*sPassGfx)); + if (sPassGfx == NULL) + return 2; + + return 0; +} + +static u32 FreeFrontierPassGfx(void) +{ + FreeAllWindowBuffers(); + if (sPassGfx == NULL) + return 1; + + if (sPassGfx->unk28 != NULL) + FREE_AND_SET_NULL(sPassGfx->unk28); + if (sPassGfx->unk24 != NULL) + FREE_AND_SET_NULL(sPassGfx->unk24); + if (sPassGfx->unk20 != NULL) + FREE_AND_SET_NULL(sPassGfx->unk20); + + memset(sPassGfx, 0, sizeof(*sPassGfx)); // Why clear data, if it's going to be freed anyway? + FREE_AND_SET_NULL(sPassGfx); + return 0; +} + +static void VblankCb_FrontierPass(void) +{ + if (sPassGfx->setAffine) + { + SetBgAffine(2, + gUnknown_085713E0[sPassData->unkE - 1][0] << 8, + gUnknown_085713E0[sPassData->unkE - 1][1] << 8, + gUnknown_085713E0[sPassData->unkE - 1][0], + gUnknown_085713E0[sPassData->unkE - 1][1], + sPassGfx->unk2E, + sPassGfx->unk30, + 0); + } + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +static void CB2_FrontierPass(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); +} + +static void CB2_InitFrontierPass(void) +{ + if (InitFrontierPass()) + { + CreateTask(Task_HandleFrontierPassInput, 0); + SetMainCallback2(CB2_FrontierPass); + } +} + +static void CB2_HideFrontierPass(void) +{ + if (HideFrontierPass()) + LeaveFrontierPass(); +} + +static bool32 InitFrontierPass(void) +{ + u32 sizeOut = 0; + + switch (sPassData->state) + { + case 0: + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + DisableInterrupts(INTR_FLAG_HBLANK); + break; + case 1: + ResetGpuRegsAndBgs(); + break; + case 2: + ResetTasks(); + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetPaletteFade(); + reset_temp_tile_data_buffers(); + break; + case 3: + AllocateFrontierPassGfx(); + break; + case 4: + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(1, sPassBgTemplates, ARRAY_COUNT(sPassBgTemplates)); + SetBgTilemapBuffer(1, sPassGfx->tilemapBuff1); + SetBgTilemapBuffer(2, sPassGfx->tilemapBuff2); + SetBgTilemapBuffer(3, sPassGfx->tilemapBuff3); + SetBgAttribute(2, BG_ATTR_WRAPAROUND, 1); + break; + case 5: + InitWindows(sPassWindowTemplates); + DeactivateAllTextPrinters(); + break; + case 6: + sPassGfx->unk20 = malloc_and_decompress(gUnknown_085712F8, &sizeOut); + sPassGfx->unk24 = malloc_and_decompress(gUnknown_08571060, &sizeOut); + sPassGfx->unk28 = malloc_and_decompress(gUnknown_085712C0, &sizeOut); + decompress_and_copy_tile_data_to_vram(1, gUnknown_08DE08C8, 0, 0, 0); + decompress_and_copy_tile_data_to_vram(2, gUnknown_08DE2084, 0, 0, 0); + break; + case 7: + if (free_temp_tile_data_buffers_if_possible()) + return FALSE; + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + CopyBgTilemapBufferToVram(1); + CopyBgTilemapBufferToVram(2); + break; + case 8: + LoadPalette(gUnknown_08DE07C8[0], 0, 0x1A0); + LoadPalette(gUnknown_08DE07C8[1 + sPassData->trainerStars], 0x10, 0x20); + LoadPalette(stdpal_get(0), 0xF0, 0x20); + sub_80C629C(); + sub_80C6104(sPassData->cursorArea, sPassData->previousCursorArea); + if (sPassData->unkE == 1 || sPassData->unkE == 2) + { + sPassData->state = 0; + return TRUE; + } + break; + case 9: + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + LoadCursorAndSymbolSprites(); + SetVBlankCallback(VblankCb_FrontierPass); + BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + break; + case 10: + AnimateSprites(); + BuildOamBuffer(); + if (UpdatePaletteFade()) + return FALSE; + + sPassData->state = 0; + return TRUE; + } + + sPassData->state++; + return FALSE; +} + +static bool32 HideFrontierPass(void) +{ + switch (sPassData->state) + { + case 0: + if (sPassData->unkE != 1 && sPassData->unkE != 2) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + } + else + { + sPassData->state = 2; + return FALSE; + } + break; + case 1: + if (UpdatePaletteFade()) + return FALSE; + break; + case 2: + SetGpuReg(REG_OFFSET_DISPCNT, 0); + HideBg(0); + HideBg(1); + HideBg(2); + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + break; + case 3: + FreeCursorAndSymbolSprites(); + break; + case 4: + ResetGpuRegsAndBgs(); + ResetTasks(); + ResetSpriteData(); + FreeAllSpritePalettes(); + break; + case 5: + UnsetBgTilemapBuffer(0); + UnsetBgTilemapBuffer(1); + UnsetBgTilemapBuffer(2); + FreeFrontierPassGfx(); + sPassData->state = 0; + return TRUE; + } + + sPassData->state++; + return FALSE; +} + +static u8 GetCursorAreaFromCoords(s16 x, s16 y) +{ + u8 i; + + // Minus/Plus 1, because the table doesn't take into account the nothing field. + for (i = 0; i < CURSOR_AREA_COUNT - 1; i++) + { + if (sPassAreasLayout[i].yStart <= y && sPassAreasLayout[i].yEnd >= y + && sPassAreasLayout[i].xStart <= x && sPassAreasLayout[i].xEnd >= x) + { + if (i >= CURSOR_AREA_SYMBOL - 1 && sPassData->facilitySymbols[i - CURSOR_AREA_SYMBOL + 1] == 0) + break; + + return i + 1; + } + } + + return 0; +} + +void CB2_ReshowFrontierPass(void) +{ + u8 taskId; + + if (!InitFrontierPass()) + return; + + switch (sPassData->unkE) + { + case 1: + case 2: + taskId = CreateTask(Task_DoFadeEffect, 0); + gTasks[taskId].data[0] = TRUE; + break; + case 3: + default: + sPassData->unkE = 0; + taskId = CreateTask(Task_HandleFrontierPassInput, 0); + break; + } + + SetMainCallback2(CB2_FrontierPass); +} + +static void CB2_ReturnFromRecord(void) +{ + AllocateFrontierPassData(sSavedPassData.callback); + sPassData->cursorX = sSavedPassData.cursorX; + sPassData->cursorY = sSavedPassData.cursorY; + memset(&sSavedPassData, 0, sizeof(sSavedPassData)); + switch (InBattlePyramid()) + { + case 1: + PlayBGM(MUS_PYRAMID); + break; + case 2: + PlayBGM(MUS_PYRAMID_TOP); + break; + default: + Overworld_PlaySpecialMapMusic(); + break; + } + + SetMainCallback2(CB2_ReshowFrontierPass); +} + +static void CB2_ShowFrontierPassFeature(void) +{ + if (!HideFrontierPass()) + return; + + switch (sPassData->unkE) + { + case 1: + ShowFrontierMap(CB2_ReshowFrontierPass); + break; + case 3: + sSavedPassData.callback = sPassData->callback; + sSavedPassData.cursorX = sPassData->cursorX; + sSavedPassData.cursorY = sPassData->cursorY; + FreeFrontierPassData(); + PlayRecordedBattle(CB2_ReturnFromRecord); + break; + case 2: + ShowPlayerTrainerCard(CB2_ReshowFrontierPass); + break; + } +} + +static bool32 TryCallPassAreaFunction(u8 taskId, u8 cursorArea) +{ + switch (cursorArea) + { + case CURSOR_AREA_RECORD: + if (!sPassData->hasBattleRecord) + return FALSE; + sPassData->unkE = 3; + DestroyTask(taskId); + SetMainCallback2(CB2_ShowFrontierPassFeature); + break; + case CURSOR_AREA_MAP: + case CURSOR_AREA_CARD: + sPassData->unkE = cursorArea; + gTasks[taskId].func = Task_DoFadeEffect; + gTasks[taskId].data[0] = FALSE; + break; + default: + return FALSE; + } + + sPassData->cursorX = sPassGfx->cursorSprite->pos1.x; + sPassData->cursorY = sPassGfx->cursorSprite->pos1.y; + return TRUE; +} + +static void Task_HandleFrontierPassInput(u8 taskId) +{ + u8 var = FALSE; // Reused, first informs whether the cursor moves, then used as the new cursor area. + + if (gMain.heldKeys & DPAD_UP && sPassGfx->cursorSprite->pos1.y >= 9) + { + sPassGfx->cursorSprite->pos1.y -= 2; + if (sPassGfx->cursorSprite->pos1.y <= 7) + sPassGfx->cursorSprite->pos1.y = 2; + var = TRUE; + } + if (gMain.heldKeys & DPAD_DOWN && sPassGfx->cursorSprite->pos1.y <= 135) + { + sPassGfx->cursorSprite->pos1.y += 2; + if (sPassGfx->cursorSprite->pos1.y >= 137) + sPassGfx->cursorSprite->pos1.y = 136; + var = TRUE; + } + + if (gMain.heldKeys & DPAD_LEFT && sPassGfx->cursorSprite->pos1.x >= 6) + { + sPassGfx->cursorSprite->pos1.x -= 2; + if (sPassGfx->cursorSprite->pos1.x <= 4) + sPassGfx->cursorSprite->pos1.x = 5; + var = TRUE; + } + if (gMain.heldKeys & DPAD_RIGHT && sPassGfx->cursorSprite->pos1.x <= 231) + { + sPassGfx->cursorSprite->pos1.x += 2; + if (sPassGfx->cursorSprite->pos1.x >= 233) + sPassGfx->cursorSprite->pos1.x = 232; + var = TRUE; + } + + if (!var) // Cursor did not change. + { + if (sPassData->cursorArea != CURSOR_AREA_NOTHING && gMain.newKeys & A_BUTTON) + { + if (sPassData->cursorArea <= CURSOR_AREA_RECORD) // Map, Card, Record + { + PlaySE(SE_SELECT); + if (TryCallPassAreaFunction(taskId, sPassData->cursorArea)) + return; + } + else if (sPassData->cursorArea == CURSOR_AREA_CANCEL) + { + PlaySE(SE_PC_OFF); + SetMainCallback2(CB2_HideFrontierPass); + DestroyTask(taskId); + // BUG. The function should return here. Otherwise, it can play the same sound twice and destroy the same task twice. + } + } + + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_PC_OFF); + SetMainCallback2(CB2_HideFrontierPass); + DestroyTask(taskId); + } + } + else + { + var = GetCursorAreaFromCoords(sPassGfx->cursorSprite->pos1.x - 5, sPassGfx->cursorSprite->pos1.y + 5); + if (sPassData->cursorArea != var) + { + PrintAreaDescription(var); + sPassData->previousCursorArea = sPassData->cursorArea; + sPassData->cursorArea = var; + sub_80C6104(sPassData->cursorArea, sPassData->previousCursorArea); + } + } +} + +static void Task_DoFadeEffect(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (sPassData->state) + { + case 0: + if (!data[0]) + { + sub_80C5F58(TRUE, FALSE); + data[1] = 0x100; + data[2] = 0x100; + data[3] = 0x15; + data[4] = 0x15; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE); + } + else + { + data[1] = 0x1FC; + data[2] = 0x1FC; + data[3] = -0x15; + data[4] = -0x15; + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + LoadCursorAndSymbolSprites(); + SetVBlankCallback(VblankCb_FrontierPass); + BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); + } + sPassGfx->setAffine = TRUE; + sPassGfx->unk2E = sub_8151624(data[1]); + sPassGfx->unk30 = sub_8151624(data[2]); + break; + case 1: + UpdatePaletteFade(); + data[1] += data[3]; + data[2] += data[4]; + sPassGfx->unk2E = sub_8151624(data[1]); + sPassGfx->unk30 = sub_8151624(data[2]); + if (!data[0]) + { + if (data[1] <= 0x1FC) + return; + } + else + { + if (data[1] != 0x100) + return; + } + break; + case 2: + if (sPassGfx->setAffine) // Nonsensical check. + sPassGfx->setAffine = FALSE; + if (UpdatePaletteFade()) + return; + if (!data[0]) + { + DestroyTask(taskId); + SetMainCallback2(CB2_ShowFrontierPassFeature); + } + else + { + sub_80C5F58(FALSE, FALSE); + sPassData->unkE = 0; + gTasks[taskId].func = Task_HandleFrontierPassInput; + } + SetBgAttribute(2, BG_ATTR_WRAPAROUND, 0); + sPassData->state = 0; + return; + } + + sPassData->state++; +} + +static void ShowAndPrintWindows(void) +{ + s32 x; + u8 i; + + for (i = 0; i < WINDOW_COUNT; i++) + { + PutWindowTilemap(i); + FillWindowPixelBuffer(i, 0); + } + + x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 96); + AddTextPrinterParameterized3(WINDOW_EARNED_SYMBOLS, 1, x, 5, sTextColors[0], 0, gText_SymbolsEarned); + + x = GetStringCenterAlignXOffset(1, gText_BattleRecord, 96); + AddTextPrinterParameterized3(WINDOW_BATTLE_RECORD, 1, x, 5, sTextColors[0], 0, gText_BattleRecord); + + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, 5, 4, sTextColors[0], 0, gText_BattlePoints); + ConvertIntToDecimalStringN(gStringVar4, sPassData->battlePoints, STR_CONV_MODE_LEFT_ALIGN, 5); + x = GetStringRightAlignXOffset(8, gStringVar4, 91); + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, x, 16, sTextColors[0], 0, gStringVar4); + + sPassData->cursorArea = GetCursorAreaFromCoords(sPassData->cursorX - 5, sPassData->cursorY + 5); + sPassData->previousCursorArea = CURSOR_AREA_NOTHING; + PrintAreaDescription(sPassData->cursorArea); + + for (i = 0; i < WINDOW_COUNT; i++) + CopyWindowToVram(i, 3); + + CopyBgTilemapBufferToVram(0); +} + +static void PrintAreaDescription(u8 cursorArea) +{ + FillWindowPixelBuffer(WINDOW_DESCRIPTION, 0); + if (cursorArea == CURSOR_AREA_RECORD && !sPassData->hasBattleRecord) + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[0]); + else if (cursorArea != CURSOR_AREA_NOTHING) + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[cursorArea]); + + CopyWindowToVram(WINDOW_DESCRIPTION, 3); + CopyBgTilemapBufferToVram(0); +} + +static void sub_80C5F58(bool8 arg0, bool8 arg1) +{ + switch (sPassData->unkE) + { + case 1: + if (arg0) + CopyToBgTilemapBufferRect_ChangePalette(2, sPassGfx->unk20, 16, 3, 12, 7, 16); + else + FillBgTilemapBufferRect(2, 0, 16, 3, 12, 7, 16); + break; + case 2: + if (arg0) + CopyToBgTilemapBufferRect_ChangePalette(2, sPassGfx->unk20 + 84, 16, 10, 12, 7, 16); + else + FillBgTilemapBufferRect(2, 0, 16, 10, 12, 7, 16); + break; + default: + return; + } + + CopyBgTilemapBufferToVram(2); + if (arg1) + { + SetBgAffine(2, + gUnknown_085713E0[sPassData->unkE - 1][0] << 8, + gUnknown_085713E0[sPassData->unkE - 1][1] << 8, + gUnknown_085713E0[sPassData->unkE - 1][0], + gUnknown_085713E0[sPassData->unkE - 1][1], + sub_8151624(0x1FC), + sub_8151624(0x1FC), + 0); + } + else + { + SetBgAffine(2, + gUnknown_085713E0[sPassData->unkE - 1][0] << 8, + gUnknown_085713E0[sPassData->unkE - 1][1] << 8, + gUnknown_085713E0[sPassData->unkE - 1][0], + gUnknown_085713E0[sPassData->unkE - 1][1], + sub_8151624(0x100), + sub_8151624(0x100), + 0); + } +} + +static void sub_80C6104(u8 cursorArea, u8 previousCursorArea) +{ + bool32 var; + + switch (previousCursorArea) + { + case CURSOR_AREA_MAP: + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24, 16, 3, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_CARD: + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24 + 336, 16, 10, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_RECORD: + if (!sPassData->hasBattleRecord) + { + var = FALSE; + } + else + { + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk28, 2, 10, 12, 3, 17); + var = TRUE; + } + break; + case CURSOR_AREA_CANCEL: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_08DE3350, 21, 0, 9, 2, 17); + var = TRUE; + break; + default: + var = FALSE; + break; + } + + if (!var) + { + if (cursorArea == CURSOR_AREA_NOTHING || cursorArea > CURSOR_AREA_CANCEL) + return; + } + + switch (cursorArea) + { + case CURSOR_AREA_MAP: + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24 + 168, 16, 3, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_CARD: + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24 + 504, 16, 10, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_RECORD: + if (!sPassData->hasBattleRecord) + return; + + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk28 + 72, 2, 10, 12, 3, 17); + var = TRUE; + break; + case CURSOR_AREA_CANCEL: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_08DE3374, 21, 0, 9, 2, 17); + var = TRUE; + break; + default: + var = FALSE; + break; + } + + if (!var) + { + asm("":::"r4"); + if (previousCursorArea == CURSOR_AREA_NOTHING || previousCursorArea > CURSOR_AREA_CANCEL) + return; + } + + CopyBgTilemapBufferToVram(1); +} + +static void sub_80C629C(void) +{ + CopyToBgTilemapBuffer(1, gUnknown_08DE3060, 0, 0); + sub_80C6104(sPassData->cursorArea, sPassData->previousCursorArea); + sub_80C5F58(TRUE, sPassData->unkE); + ShowAndPrintWindows(); + CopyBgTilemapBufferToVram(1); +} + +static void LoadCursorAndSymbolSprites(void) +{ + u8 spriteId; + u8 i = 0; + + FreeAllSpritePalettes(); + ResetAffineAnimData(); + LoadSpritePalettes(sSpritePalettes); + LoadCompressedSpriteSheet(&sCursorSpriteSheets[0]); + LoadCompressedSpriteSheet(&sCursorSpriteSheets[2]); + spriteId = CreateSprite(&sSpriteTemplates_Cursors[0], sPassData->cursorX, sPassData->cursorY, 0); + sPassGfx->cursorSprite = &gSprites[spriteId]; + sPassGfx->cursorSprite->oam.priority = 0; + + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) + { + if (sPassData->facilitySymbols[i] != 0) + { + struct SpriteTemplate sprite = sSpriteTemplate_Medal; + + sprite.paletteTag += sPassData->facilitySymbols[i] - 1; + spriteId = CreateSprite(&sprite, sPassAreasLayout[i + CURSOR_AREA_SYMBOL - 1].xStart + 8, sPassAreasLayout[i + CURSOR_AREA_SYMBOL - 1].yStart + 6, i + 1); + sPassGfx->symbolSprites[i] = &gSprites[spriteId]; + sPassGfx->symbolSprites[i]->oam.priority = 2; + StartSpriteAnim(sPassGfx->symbolSprites[i], i); + } + } +} + +static void FreeCursorAndSymbolSprites(void) +{ + u8 i = 0; + + DestroySprite(sPassGfx->cursorSprite); + sPassGfx->cursorSprite = NULL; + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) + { + if (sPassGfx->symbolSprites[i] != NULL) + { + DestroySprite(sPassGfx->symbolSprites[i]); + sPassGfx->symbolSprites[i] = NULL; + } + } + FreeAllSpritePalettes(); + FreeSpriteTilesByTag(2); + FreeSpriteTilesByTag(0); +} + +static void SpriteCb_Dummy(struct Sprite *sprite) +{ + +} + +// Frontier Map code. + +// Forward declarations. +static void Task_HandleFrontierMap(u8 taskId); +static void PrintOnFrontierMap(void); +static void InitFrontierMapSprites(void); +static void HandleFrontierMapCursorMove(u8 direction); + +static void ShowFrontierMap(void (*callback)(void)) +{ + if (sMapData != NULL) + SetMainCallback2(callback); // This line doesn't make sense at all, since it gets overwritten later anyway. + + sMapData = AllocZeroed(sizeof(*sMapData)); + sMapData->callback = callback; + ResetTasks(); + CreateTask(Task_HandleFrontierMap, 0); + SetMainCallback2(CB2_FrontierPass); +} + +static void FreeFrontierMap(void) +{ + ResetTasks(); + SetMainCallback2(sMapData->callback); + memset(sMapData, 0, sizeof(*sMapData)); // Pointless memory clear. + FREE_AND_SET_NULL(sMapData); +} + +static bool32 InitFrontierMap(void) +{ + switch (sPassData->state) + { + case 0: + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + break; + case 1: + ResetGpuRegsAndBgs(); + break; + case 2: + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetPaletteFade(); + reset_temp_tile_data_buffers(); + break; + case 3: + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, sMapBgTemplates, ARRAY_COUNT(sMapBgTemplates)); + SetBgTilemapBuffer(0, sMapData->tilemapBuff0); + SetBgTilemapBuffer(1, sMapData->tilemapBuff1); + SetBgTilemapBuffer(2, sMapData->tilemapBuff2); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + CopyBgTilemapBufferToVram(1); + CopyBgTilemapBufferToVram(2); + break; + case 4: + InitWindows(sMapWindowTemplates); + DeactivateAllTextPrinters(); + PrintOnFrontierMap(); + decompress_and_copy_tile_data_to_vram(1, gUnknown_0856FBBC, 0, 0, 0); + break; + case 5: + if (free_temp_tile_data_buffers_if_possible()) + return FALSE; + LoadPalette(gUnknown_08DE07C8[0], 0, 0x1A0); + LoadPalette(stdpal_get(0), 0xF0, 0x20); + CopyToBgTilemapBuffer(2, gUnknown_08570E00, 0, 0); + CopyBgTilemapBufferToVram(2); + break; + case 6: + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + InitFrontierMapSprites(); + SetVBlankCallback(VblankCb_FrontierPass); + BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); + break; + case 7: + if (UpdatePaletteFade()) + return FALSE; + sPassData->state = 0; + return TRUE; + } + + sPassData->state++; + return FALSE; +} + +static bool32 ExitFrontierMap(void) +{ + switch (sPassData->state) + { + case 0: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE); + break; + case 1: + if (UpdatePaletteFade()) + return FALSE; + SetGpuReg(REG_OFFSET_DISPCNT, 0); + HideBg(0); + HideBg(1); + HideBg(2); + break; + case 2: + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + break; + case 3: + if (sMapData->cursorSprite != NULL) + { + DestroySprite(sMapData->cursorSprite); + FreeSpriteTilesByTag(0); + } + if (sMapData->mapIndicatorSprite != NULL) + { + DestroySprite(sMapData->mapIndicatorSprite); + FreeSpriteTilesByTag(1); + } + if (sMapData->playerHeadSprite != NULL) + { + DestroySprite(sMapData->playerHeadSprite); + FreeSpriteTilesByTag(4); + } + FreeAllWindowBuffers(); + break; + case 4: + ResetGpuRegsAndBgs(); + ResetSpriteData(); + FreeAllSpritePalettes(); + break; + case 5: + UnsetBgTilemapBuffer(0); + UnsetBgTilemapBuffer(1); + UnsetBgTilemapBuffer(2); + sPassData->state = 0; + return TRUE; + } + + sPassData->state++; + return FALSE; +} + +static void Task_HandleFrontierMap(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + if (InitFrontierMap()) + break; + return; + case 1: + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_PC_OFF); + data[0] = 4; + } + else if (gMain.newKeys & DPAD_DOWN) + { + if (sMapData->cursorPos >= NUM_FRONTIER_FACILITIES - 1) + HandleFrontierMapCursorMove(0); + else + data[0] = 2; + } + else if (gMain.newKeys & DPAD_UP) + { + if (sMapData->cursorPos == 0) + HandleFrontierMapCursorMove(1); + else + data[0] = 3; + } + return; + case 2: + if (data[1] > 3) + { + HandleFrontierMapCursorMove(0); + data[1] = 0; + data[0] = 1; + } + else + { + sMapData->cursorSprite->pos1.y += 4; + data[1]++; + } + return; + case 3: + if (data[1] > 3) + { + HandleFrontierMapCursorMove(1); + data[1] = 0; + data[0] = 1; + } + else + { + sMapData->cursorSprite->pos1.y -= 4; + data[1]++; + } + return; + case 4: + if (ExitFrontierMap()) + break; + return; + case 5: + DestroyTask(taskId); + FreeFrontierMap(); + return; + } + + data[0]++; +} + +static u8 MapNumToFrontierFacilityId(u16 mapNum) // id + 1, zero means not a frontier map number +{ + if ((mapNum >= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_LOBBY) && mapNum <= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM)) + || (mapNum >= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM) && mapNum <= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM2))) + return FRONTIER_FACILITY_TOWER + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM)) + return FRONTIER_FACILITY_DOME + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PALACE_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM)) + return FRONTIER_FACILITY_PALACE + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_ARENA_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM)) + return FRONTIER_FACILITY_ARENA + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM)) + return FRONTIER_FACILITY_FACTORY + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM1) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM2) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM3)) + return FRONTIER_FACILITY_PIKE + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PYRAMID_TOP)) + return FRONTIER_FACILITY_PYRAMID + 1; + else + return 0; +} + +static void InitFrontierMapSprites(void) +{ + struct SpriteTemplate sprite; + u8 spriteId; + u8 id; + s16 x = 0, y; + + FreeAllSpritePalettes(); + LoadSpritePalettes(sSpritePalettes); + + LoadCompressedSpriteSheet(&sCursorSpriteSheets[0]); + spriteId = CreateSprite(&sSpriteTemplates_Cursors[0], 155, (sMapData->cursorPos * 16) + 8, 2); + sMapData->cursorSprite = &gSprites[spriteId]; + sMapData->cursorSprite->oam.priority = 0; + sMapData->cursorSprite->hFlip = TRUE; + StartSpriteAnim(sMapData->cursorSprite, 1); + + LoadCompressedSpriteSheet(&sCursorSpriteSheets[1]); + spriteId = CreateSprite(&sSpriteTemplates_Cursors[1], sMapLandmarks[sMapData->cursorPos].x, sMapLandmarks[sMapData->cursorPos].y, 1); + sMapData->mapIndicatorSprite = &gSprites[spriteId]; + sMapData->mapIndicatorSprite->oam.priority = 0; + StartSpriteAnim(sMapData->mapIndicatorSprite, sMapLandmarks[sMapData->cursorPos].animNum); + + // Create player indicator head sprite only if it's in vicinity of battle frontier. + id = GetCurrentRegionMapSectionId(); + if (id == MAPSEC_BATTLE_FRONTIER || id == MAPSEC_ARTISAN_CAVE) + { + s8 mapNum = gSaveBlock1Ptr->location.mapNum; + + if (mapNum == MAP_NUM(BATTLE_FRONTIER_OUTSIDE_WEST) + || (mapNum == MAP_NUM(BATTLE_FRONTIER_OUTSIDE_EAST) && (x = 55))) + { + x += gSaveBlock1Ptr->pos.x; + y = gSaveBlock1Ptr->pos.y; + + x /= 8; + y /= 8; + + id = 0; + } + else + { + id = MapNumToFrontierFacilityId(mapNum); + if (id != 0) + { + x = sMapLandmarks[id - 1].x; + y = sMapLandmarks[id - 1].y; + } + else + { + // Handle Artisan Cave. + if (gSaveBlock1Ptr->escapeWarp.mapNum == MAP_NUM(BATTLE_FRONTIER_OUTSIDE_EAST)) + x = gSaveBlock1Ptr->escapeWarp.x + 55; + else + x = gSaveBlock1Ptr->escapeWarp.x; + + y = gSaveBlock1Ptr->escapeWarp.y; + + x /= 8; + y /= 8; + } + } + + LoadCompressedSpriteSheet(sHeadsSpriteSheet); + sprite = sSpriteTemplate_Head; + sprite.paletteTag = gSaveBlock2Ptr->playerGender + 4; + if (id != 0) + { + spriteId = CreateSprite(&sprite, x, y, 0); + } + else + { + x *= 8; + y *= 8; + spriteId = CreateSprite(&sprite, x + 20, y + 36, 0); + } + + sMapData->playerHeadSprite = &gSprites[spriteId]; + sMapData->playerHeadSprite->oam.priority = 0; + if (gSaveBlock2Ptr->playerGender != MALE) + StartSpriteAnim(sMapData->playerHeadSprite, 1); + } +} + +static void PrintOnFrontierMap(void) +{ + u8 i; + + for (i = 0; i < MAP_WINDOW_COUNT; i++) + { + PutWindowTilemap(i); + FillWindowPixelBuffer(i, 0); + } + + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) + { + if (i == sMapData->cursorPos) + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, sTextColors[2], 0, sMapLandmarks[i].name); + else + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, sTextColors[1], 0, sMapLandmarks[i].name); + } + + AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); + + for (i = 0; i < MAP_WINDOW_COUNT; i++) + CopyWindowToVram(i, 3); + + CopyBgTilemapBufferToVram(0); +} + +static void HandleFrontierMapCursorMove(u8 direction) +{ + u8 oldCursorPos, i; + + if (direction) + { + oldCursorPos = sMapData->cursorPos; + sMapData->cursorPos = (oldCursorPos + 6) % NUM_FRONTIER_FACILITIES; + } + else + { + oldCursorPos = sMapData->cursorPos; + sMapData->cursorPos = (oldCursorPos + 1) % NUM_FRONTIER_FACILITIES; + } + + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (oldCursorPos * 16) + 1, sTextColors[1], 0, sMapLandmarks[oldCursorPos].name); + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (sMapData->cursorPos * 16) + 1, sTextColors[2], 0, sMapLandmarks[sMapData->cursorPos].name); + + sMapData->cursorSprite->pos1.y = (sMapData->cursorPos * 16) + 8; + + StartSpriteAnim(sMapData->mapIndicatorSprite, sMapLandmarks[sMapData->cursorPos].animNum); + sMapData->mapIndicatorSprite->pos1.x = sMapLandmarks[sMapData->cursorPos].x; + sMapData->mapIndicatorSprite->pos1.y = sMapLandmarks[sMapData->cursorPos].y; + FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, 0); + AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); + + for (i = 0; i < 3; i++) + CopyWindowToVram(i, 3); + + CopyBgTilemapBufferToVram(0); + PlaySE(SE_Z_SCROLL); +} diff --git a/src/graphics.c b/src/graphics.c index 10efd5043..287a1f5d6 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1590,7 +1590,7 @@ const u32 gUnknown_08DE0644[] = INCBIN_U32("graphics/title_screen/title_screen2. // more trainer card stuff -const u16 gUnknown_08DE07C8[] = INCBIN_U16("graphics/frontier_pass/tiles.gbapal");// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well +const u16 gUnknown_08DE07C8[][16] = INCBIN_U16("graphics/frontier_pass/tiles.gbapal");// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well const u32 gUnknown_08DE08C8[] = INCBIN_U32("graphics/frontier_pass/tiles.4bpp.lz"); const u32 gUnknown_08DE2084[] = INCBIN_U32("graphics/frontier_pass/tiles2.8bpp.lz"); const u32 gUnknown_08DE3060[] = INCBIN_U32("graphics/frontier_pass/tiles.bin.lz"); diff --git a/src/pokedex.c b/src/pokedex.c index 8c6ed3159..f99a8226a 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4271,46 +4271,46 @@ s8 GetSetPokedexFlag(u16 nationalDexNo, u8 caseID) retVal = 0; switch (caseID) { - case FLAG_GET_SEEN: - if (gSaveBlock2Ptr->pokedex.seen[index] & mask) + case FLAG_GET_SEEN: + if (gSaveBlock2Ptr->pokedex.seen[index] & mask) + { + if ((gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) + && (gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) + retVal = 1; + else { - if ((gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) - && (gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) - retVal = 1; - else - { - gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; - gSaveBlock1Ptr->seen1[index] &= ~mask; - gSaveBlock1Ptr->seen2[index] &= ~mask; - retVal = 0; - } + gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; + gSaveBlock1Ptr->seen1[index] &= ~mask; + gSaveBlock1Ptr->seen2[index] &= ~mask; + retVal = 0; } - break; - case FLAG_GET_CAUGHT: - if (gSaveBlock2Ptr->pokedex.owned[index] & mask) + } + break; + case FLAG_GET_CAUGHT: + if (gSaveBlock2Ptr->pokedex.owned[index] & mask) + { + if ((gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock2Ptr->pokedex.seen[index] & mask) + && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) + && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) + retVal = 1; + else { - if ((gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock2Ptr->pokedex.seen[index] & mask) - && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) - && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) - retVal = 1; - else - { - gSaveBlock2Ptr->pokedex.owned[index] &= ~mask; - gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; - gSaveBlock1Ptr->seen1[index] &= ~mask; - gSaveBlock1Ptr->seen2[index] &= ~mask; - retVal = 0; - } + gSaveBlock2Ptr->pokedex.owned[index] &= ~mask; + gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; + gSaveBlock1Ptr->seen1[index] &= ~mask; + gSaveBlock1Ptr->seen2[index] &= ~mask; + retVal = 0; } - break; - case FLAG_SET_SEEN: - gSaveBlock2Ptr->pokedex.seen[index] |= mask; - gSaveBlock1Ptr->seen1[index] |= mask; - gSaveBlock1Ptr->seen2[index] |= mask; - break; - case FLAG_SET_CAUGHT: - gSaveBlock2Ptr->pokedex.owned[index] |= mask; - break; + } + break; + case FLAG_SET_SEEN: + gSaveBlock2Ptr->pokedex.seen[index] |= mask; + gSaveBlock1Ptr->seen1[index] |= mask; + gSaveBlock1Ptr->seen2[index] |= mask; + break; + case FLAG_SET_CAUGHT: + gSaveBlock2Ptr->pokedex.owned[index] |= mask; + break; } return retVal; } @@ -4324,14 +4324,14 @@ u16 GetNationalPokedexCount(u8 caseID) { switch (caseID) { - case FLAG_GET_SEEN: - if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN)) - count++; - break; - case FLAG_GET_CAUGHT: - if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) - count++; - break; + case FLAG_GET_SEEN: + if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN)) + count++; + break; + case FLAG_GET_CAUGHT: + if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) + count++; + break; } } return count; @@ -4346,14 +4346,14 @@ u16 GetHoennPokedexCount(u8 caseID) { switch (caseID) { - case FLAG_GET_SEEN: - if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_SEEN)) - count++; - break; - case FLAG_GET_CAUGHT: - if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) - count++; - break; + case FLAG_GET_SEEN: + if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_SEEN)) + count++; + break; + case FLAG_GET_CAUGHT: + if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) + count++; + break; } } return count; @@ -4381,7 +4381,7 @@ u16 sub_80C089C(u8 caseID) return count; } -bool8 sub_80C08E4(void) +bool16 HasAllHoennMons(void) { u16 i; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 36ed78a54..78fec2fc5 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -463,8 +463,6 @@ EWRAM_DATA static u8 sMovingMonOrigBoxId = 0; EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sCanOnlyMove = 0; -extern void sub_80C6D80(u8 *arg0, void *arg1, u8 arg2, u8 arg3, s32 arg4); - extern const struct CompressedSpriteSheet gMonFrontPicTable[]; // This file's functions. @@ -1543,6 +1541,76 @@ static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cu static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); // code +void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4) +{ + s32 i, val, val2; + u16 windowId; + u8 txtColor[3]; + u8 *tileData1, *tileData2; + struct WindowTemplate winTemplate = {0}; + + winTemplate.width = 24; + winTemplate.height = 2; + windowId = AddWindow(&winTemplate); + FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3); + tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); + tileData2 = (winTemplate.width * 32) + tileData1; + + if (!arg2) + txtColor[0] = 0; + else + txtColor[0] = arg3; + txtColor[1] = 0xF; + txtColor[2] = 0xE; + AddTextPrinterParameterized4(windowId, 1, 0, 1, 0, 0, txtColor, -1, string); + + val = arg4; + if (val > 6u) + val = 6; + val2 = arg4 - 6; + if (val > 0) + { + for (i = val; i != 0; i--) + { + CpuCopy16(tileData1, dst, 0x80); + CpuCopy16(tileData2, dst + 0x80, 0x80); + tileData1 += 0x80; + tileData2 += 0x80; + dst += 0x100; + } + } + + if (val2 > 0) + CpuFill16((arg3 << 4) | arg3, dst, (u32)(val2) * 0x100); + + RemoveWindow(windowId); +} + +// Unused +void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr3) +{ + u32 var; + u8 windowId; + u8 txtColor[3]; + u8 *tileData1, *tileData2; + struct WindowTemplate winTemplate = {0}; + + winTemplate.width = StringLength_Multibyte(string); + winTemplate.height = 2; + var = winTemplate.width * 32; + windowId = AddWindow(&winTemplate); + FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3); + tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); + tileData2 = (winTemplate.width * 32) + tileData1; + txtColor[0] = arg3; + txtColor[1] = clr2; + txtColor[2] = clr3; + AddTextPrinterParameterized4(windowId, 1, 0, 2, 0, 0, txtColor, -1, string); + CpuCopy16(tileData1, dst, var); + CpuCopy16(tileData2, dst + arg2, var); + RemoveWindow(windowId); +} + u8 CountMonsInBox(u8 boxId) { u16 i, count; diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 813d143d2..41f7eeee7 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -1577,7 +1577,7 @@ void sub_80140E0(u8 taskId) for (i = 0; i < GetLinkPlayerCount(); i++) { recvBuff = gBlockRecvBuffer[i]; - sub_80C3120(&gTrainerCards[i], recvBuff, gLinkPlayers[i].version); + CopyTrainerCardData(&gTrainerCards[i], recvBuff, gLinkPlayers[i].version); } if (GetLinkPlayerCount() == 2) @@ -1607,7 +1607,7 @@ void sub_80141A4(void) break; case 1: if (!FuncIsActiveTask(sub_80140E0)) - TrainerCard_ShowLinkCard(GetMultiplayerId() ^ 1, CB2_ReturnToField); + ShowTrainerCardInLink(GetMultiplayerId() ^ 1, CB2_ReturnToField); break; } diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c index f3eaa7161..cade00b50 100755 --- a/src/script_pokemon_util_80F87D8.c +++ b/src/script_pokemon_util_80F87D8.c @@ -128,18 +128,18 @@ void sub_80F88E8(void) } } -u8 sub_80F8940(void) +u8 CountPlayerContestPaintings(void) { int i; - u8 var0 = 0; + u8 count = 0; for (i = 0; i < 5; i++) { if (gSaveBlock1Ptr->contestWinners[8 + i].species) - var0++; + count++; } - return var0; + return count; } void sub_80F8970(void) diff --git a/src/start_menu.c b/src/start_menu.c index 0f608b1d2..5c7e5365d 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -9,6 +9,8 @@ #include "strings.h" #include "bg.h" #include "field_effect.h" +#include "party_menu.h" +#include "frontier_pass.h" #include "task.h" #include "overworld.h" #include "link.h" @@ -30,6 +32,7 @@ #include "scanline_effect.h" #include "text_window.h" #include "load_save.h" +#include "trainer_card.h" #include "international_string_util.h" #include "constants/songs.h" #include "field_player_avatar.h" @@ -89,11 +92,7 @@ extern void var_800D_set_xB(void); extern void sub_808B864(void); extern void CB2_Pokedex(void); extern void PlayRainSoundEffect(void); -extern void CB2_PartyMenuFromStartMenu(void); extern void CB2_PokeNav(void); -extern void sub_80C4DDC(void (*)(void)); -extern void sub_80C51C4(void (*)(void)); -extern void TrainerCard_ShowLinkCard(u8, void (*)(void)); extern void ScriptUnfreezeEventObjects(void); extern void sub_81A9EC8(void); extern void save_serialize_map(void); @@ -422,16 +421,19 @@ static bool32 PrintStartMenuActions(s8 *pIndex, u32 count) do { - if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback) { + if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback) + { PrintPlayerNameOnWindow(GetStartMenuWindowId(), sStartMenuItems[sCurrentStartMenuActions[index]].text, 8, (index << 4) + 9); } - else { + else + { StringExpandPlaceholders(gStringVar4, sStartMenuItems[sCurrentStartMenuActions[index]].text); AddTextPrinterParameterized(GetStartMenuWindowId(), 1, gStringVar4, 8, (index << 4) + 9, 0xFF, NULL); } index++; - if (index >= sNumStartMenuActions) { + if (index >= sNumStartMenuActions) + { *pIndex = index; return TRUE; } @@ -465,21 +467,14 @@ static bool32 InitStartMenuStep(void) break; case 3: if (GetSafariZoneFlag()) - { ShowSafariBallsWindow(); - } if (InBattlePyramid()) - { ShowPyramidFloorWindow(); - } sUnknown_02037619[0]++; break; case 4: - if (!PrintStartMenuActions(&sUnknown_02037619[1], 2)) - { - break; - } - sUnknown_02037619[0]++; + if (PrintStartMenuActions(&sUnknown_02037619[1], 2)) + sUnknown_02037619[0]++; break; case 5: sStartMenuCursorPos = sub_81983AC(GetStartMenuWindowId(), 1, 0, 9, 16, sNumStartMenuActions, sStartMenuCursorPos); @@ -494,15 +489,14 @@ static void InitStartMenu(void) { sUnknown_02037619[0] = 0; sUnknown_02037619[1] = 0; - while (!InitStartMenuStep()); + while (!InitStartMenuStep()) + ; } static void StartMenuTask(u8 taskId) { if (InitStartMenuStep() == TRUE) - { SwitchTaskToFollowupFunc(taskId); - } } static void CreateStartMenuTask(TaskFunc followupFunc) @@ -541,18 +535,14 @@ void sub_809FA34(u8 taskId) // Referenced in field_screen.s and rom_8011DC0.s { case 0: if (InUnionRoom() == TRUE) - { var_800D_set_xB(); - } gMenuCallback = HandleStartMenuInput; task->data[0]++; break; case 1: if (gMenuCallback() == TRUE) - { DestroyTask(taskId); - } break; } } @@ -588,9 +578,8 @@ static bool8 HandleStartMenuInput(void) PlaySE(SE_SELECT); if (sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void == StartMenuPokedexCallback) { - if (GetNationalPokedexCount(0) == 0) { + if (GetNationalPokedexCount(0) == 0) return FALSE; - } } gMenuCallback = sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void; @@ -686,17 +675,11 @@ static bool8 StartMenuPlayerNameCallback(void) CleanupOverworldWindowsAndTilemaps(); if (is_c1_link_related_active() || InUnionRoom()) - { - sub_80C4DDC(CB2_ReturnToFieldWithOpenMenu); // Display trainer card - } + ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card else if (FlagGet(FLAG_SYS_FRONTIER_PASS)) - { - sub_80C51C4(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass - } + ShowFrontierPass(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass else - { - sub_80C4DDC(CB2_ReturnToFieldWithOpenMenu); // Display trainer card - } + ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card return TRUE; } @@ -707,9 +690,7 @@ static bool8 StartMenuPlayerNameCallback(void) static bool8 StartMenuSaveCallback(void) { if (InBattlePyramid()) - { RemoveExtraStartMenuWindows(); - } gMenuCallback = SaveStartCallback; // Display save menu @@ -755,7 +736,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void) { PlayRainSoundEffect(); CleanupOverworldWindowsAndTilemaps(); - TrainerCard_ShowLinkCard(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu); + ShowTrainerCardInLink(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu); return TRUE; } diff --git a/src/string_util.c b/src/string_util.c index 8ce9a97ed..39d235ab8 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -587,7 +587,7 @@ u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n) return dest; } -u32 StringLength_Multibyte(u8 *str) +u32 StringLength_Multibyte(const u8 *str) { u32 length = 0; diff --git a/src/trade.c b/src/trade.c index 7af1e19c9..70b57fbc7 100644 --- a/src/trade.c +++ b/src/trade.c @@ -26,6 +26,7 @@ #include "pokedex.h" #include "pokemon_icon.h" #include "pokemon_summary_screen.h" +#include "pokemon_storage_system.h" #include "random.h" #include "rom_8011DC0.h" #include "save.h" diff --git a/src/trainer_card.c b/src/trainer_card.c new file mode 100755 index 000000000..b7bd5cc1d --- /dev/null +++ b/src/trainer_card.c @@ -0,0 +1,1856 @@ +#include "global.h" +#include "scanline_effect.h" +#include "palette.h" +#include "task.h" +#include "main.h" +#include "window.h" +#include "alloc.h" +#include "link.h" +#include "bg.h" +#include "sound.h" +#include "frontier_pass.h" +#include "overworld.h" +#include "menu.h" +#include "text.h" +#include "event_data.h" +#include "easy_chat.h" +#include "money.h" +#include "strings.h" +#include "string_util.h" +#include "trainer_card.h" +#include "gpu_regs.h" +#include "international_string_util.h" +#include "pokedex.h" +#include "graphics.h" +#include "pokemon_icon.h" +#include "trainer_pokemon_sprites.h" +#include "script_pokemon_util_80F87D8.h" +#include "constants/songs.h" +#include "constants/flags.h" +#include "constants/game_stat.h" +#include "constants/battle_frontier.h" + +enum +{ + CARD_TYPE_FRLG, + CARD_TYPE_RS, + CARD_TYPE_EMERALD, +}; + +struct TrainerCardData +{ + u8 var_0; + u8 printState; + u8 gfxLoadState; + u8 bgPalLoadState; + u8 var_4; + bool8 isLink; + u8 var_6; + u8 var_7; + u8 var_8; + bool8 allowDMACopy; + bool8 hasPokedex; + bool8 hasHofResult; + bool8 hasLinkResults; + bool8 hasBattleTowerWins; + u8 var_E; + u8 var_F; + bool8 hasTrades; + u8 badgeCount[8]; + u8 var_19[4][0xD]; + u8 var_4D[0x46]; + u8 var_93[0x46]; + u8 var_D9[0x8C]; + u8 var_165[0x46]; + u8 var_1AB[0x8C]; + u8 var_237[0x8C]; + u8 var_2C3[0x8C]; + u8 var_34F[0x46]; + u8 var_395[0x46]; + u8 var_3DB[0x46]; + u8 var_421[0x46]; + u16 var_468[0x60]; + s8 var_528; + u8 var_529; + u8 cardType; + bool8 isHoenn; + u16 var_52C; + void (*callback2)(void); + struct TrainerCard trainerCard; + u16 var_598[0x4B0 / 2]; + u16 var_A48[0x4B0 / 2]; + u16 var_EF8[0x4B0 / 2]; + u8 var_13A8[0x400]; + u8 var_17A8[0x200]; + u8 var_19A8[0x2300]; + u16 var_3CA8[0x2000 / 2]; + u16 var_5CA8[0x2000 / 2]; + u16 var_7CA8; + u8 language; +}; + +//external functions +extern u8 sub_80D30A0(u16); + +// EWRAM +EWRAM_DATA static struct TrainerCardData *sData = NULL; + +//this file's functions +static void VblankCb_TrainerCard(void); +static void HblankCb_TrainerCard(void); +static void sub_80C48C8(void); +static void CB2_TrainerCard(void); +static void CloseTrainerCard(u8 task); +static bool8 PrintAllOnCardPage1(void); +static void sub_80C438C(u8); +static void sub_80C4FF0(void); +static void sub_80C4550(u16*); +static void sub_80C45C0(u16*); +static void sub_80C4630(void); +static void PrintTimeOnCard(void); +static void sub_80C4918(void); +static bool8 sub_80C4940(void); +static bool8 LoadCardGfx(void); +static void CB2_InitTrainerCard(void); +static u32 GetCappedGameStat(u8 statId, u32 maxValue); +static bool8 HasAllFrontierSymbols(void); +static u8 GetRubyTrainerStars(struct TrainerCard*); +static u16 GetCaughtMonsCount(void); +static void SetPlayerCardData(struct TrainerCard*, u8); +static void sub_80C3020(struct TrainerCard*); +static u8 VersionToCardType(u8); +static void SetDataFromTrainerCard(void); +static void HandleGpuRegs(void); +static void ResetGpuRegs(void); +static void InitBgsAndWindows(void); +static void SetTrainerCardCb2(void); +static void sub_80C3414(void); +static void sub_80C4EE4(void); +static u8 GetSetCardType(void); +static void PrintNameOnCard(void); +static void PrintIdOnCard(void); +static void PrintMoneyOnCard(void); +static void PrintPokedexOnCard(void); +static void PrintProfilePhraseOnCard(void); +static bool8 PrintStringsOnCardPage2(void); +static void sub_80C3B50(void); +static void PrintHofDebutStringOnCard(void); +static void PrintWinsLossesStringOnCard(void); +static void PrintTradesStringOnCard(void); +static void PrintBerryCrushStringOnCard(void); +static void PrintPokeblockStringOnCard(void); +static void PrintUnionStringOnCard(void); +static void PrintContestStringOnCard(void); +static void sub_80C4140(void); +static void PrintBattleFacilityStringOnCard(void); +static void sub_80C42A4(void); +static void PrintAllVariableNumsOnCardPage2(void); +static void PrintNameOnCard2(void); +static void PrintHofTimeOnCard(void); +static void PrintLinkResultsNumsOnCard(void); +static void PrintTradesNumOnCard(void); +static void PrintBerryCrushNumOnCard(void); +static void PrintUnionNumOnCard(void); +static void PrintPokeblocksNumOnCard(void); +static void PrintContestNumOnCard(void); +static void PrintBattleFacilityNumsOnCard(void); +static void PrintString(u8 top, const u8* str1, u8* str2, const u8* color); +static void sub_80C4330(void); +static u8 SetCardBgsAndPals(void); +static void sub_80C474C(void); +static void sub_80C4960(u8); +static bool8 sub_80C4998(struct Task* task); +static bool8 sub_80C49D8(struct Task* task); +static bool8 sub_80C4B08(struct Task* task); +static bool8 sub_80C4C1C(struct Task* task); +static bool8 sub_80C4C84(struct Task* task); +static bool8 sub_80C4DB0(struct Task* task); +static void sub_80C32EC(u16); +static void sub_80C41D8(void); + +// const rom data +static const u32 gUnknown_0856F018[] = INCBIN_U32("graphics/trainer_card/stickers_fr.4bpp.lz"); +static const u16 gUnknown_0856F18C[] = INCBIN_U16("graphics/trainer_card/unknown_56F18C.gbapal"); +static const u16 gEmeraldTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star.gbapal"); +static const u16 gFireRedTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star_fr.gbapal"); +static const u16 gEmeraldTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars.gbapal"); +static const u16 gFireRedTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars_fr.gbapal"); +static const u16 gEmeraldTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars.gbapal"); +static const u16 gFireRedTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars_fr.gbapal"); +static const u16 gEmeraldTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars.gbapal"); +static const u16 gFireRedTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars_fr.gbapal"); +static const u16 gUnknown_0856F4AC[] = INCBIN_U16("graphics/trainer_card/female_bg.gbapal"); +static const u16 gUnknown_0856F4CC[] = INCBIN_U16("graphics/trainer_card/female_bg_fr.gbapal"); +static const u16 gUnknown_0856F4EC[] = INCBIN_U16("graphics/trainer_card/badges.gbapal"); +static const u16 gUnknown_0856F50C[] = INCBIN_U16("graphics/trainer_card/badges_fr.gbapal"); +static const u16 gUnknown_0856F52C[] = INCBIN_U16("graphics/trainer_card/gold.gbapal"); +static const u16 gUnknown_0856F54C[] = INCBIN_U16("graphics/trainer_card/stickers_fr1.gbapal"); +static const u16 gUnknown_0856F56C[] = INCBIN_U16("graphics/trainer_card/stickers_fr2.gbapal"); +static const u16 gUnknown_0856F58C[] = INCBIN_U16("graphics/trainer_card/stickers_fr3.gbapal"); +static const u16 gUnknown_0856F5AC[] = INCBIN_U16("graphics/trainer_card/stickers_fr4.gbapal"); +static const u32 gUnknown_0856F5CC[] = INCBIN_U32("graphics/trainer_card/badges.4bpp.lz"); +static const u32 gUnknown_0856F814[] = INCBIN_U32("graphics/trainer_card/badges_fr.4bpp.lz"); + +static const struct BgTemplate gUnknown_0856FAB4[4] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 27, + .screenSize = 2, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 0, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 192 + }, +}; + +static const struct WindowTemplate gUnknown_0856FAC4[] = +{ + { + .bg = 1, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x253, + }, + { + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 28, + .height = 18, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 3, + .tilemapLeft = 19, + .tilemapTop = 5, + .width = 9, + .height = 10, + .paletteNum = 8, + .baseBlock = 0x150, + }, + DUMMY_WIN_TEMPLATE +}; + +static const u16 *const gEmeraldTrainerCardStarPals[] = +{ + gEmeraldTrainerCard0Star_Pal, + gEmeraldTrainerCard1Star_Pal, + gEmeraldTrainerCard2Star_Pal, + gEmeraldTrainerCard3Star_Pal, + gEmeraldTrainerCard4Star_Pal, +}; + +static const u16 *const gFireRedTrainerCardStarPals[] = +{ + gFireRedTrainerCard0Star_Pal, + gFireRedTrainerCard1Star_Pal, + gFireRedTrainerCard2Star_Pal, + gFireRedTrainerCard3Star_Pal, + gFireRedTrainerCard4Star_Pal, +}; + +static const u8 gUnknown_0856FB0C[] = {0, 2, 3}; +static const u8 gUnknown_0856FB0F[] = {0, 4, 5}; +static const u8 gUnknown_0856FB12[6] = {0}; + +static const u8 gUnknown_0856FB18[][2][2] = +{ + {{0xD, 4}, {0xD, 4}}, + {{1, 0}, {1, 0}}, +}; + +static const u8 gUnknown_0856FB20[][2] = {{0x4E, 0x4F}, {0x50, 0x51}, {0x3C, 0x3F}}; + +static bool8 (*const gUnknown_0856FB28[])(struct Task *) = +{ + sub_80C4998, + sub_80C49D8, + sub_80C4B08, + sub_80C4C1C, + sub_80C4C84, + sub_80C4DB0, +}; + +// code +static void VblankCb_TrainerCard(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); + sub_80C48C8(); + if (sData->allowDMACopy) + DmaCopy16(3, &gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 0x140); +} + +static void HblankCb_TrainerCard(void) +{ + u16 backup; + u16 bgVOffset; + + backup = REG_IME; + REG_IME = 0; + bgVOffset = gScanlineEffectRegBuffers[1][REG_VCOUNT & 0xFF]; + REG_BG0VOFS = bgVOffset; + REG_IME = backup; +} + +static void CB2_TrainerCard(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); +} + +static void CloseTrainerCard(u8 taskId) +{ + SetMainCallback2(sData->callback2); + FreeAllWindowBuffers(); + FREE_AND_SET_NULL(sData); + DestroyTask(taskId); +} + +static void sub_80C2760(u8 taskId) +{ + switch (sData->var_0) + { + case 0: + if (!IsDma3ManagerBusyWithBgCopy()) + { + FillWindowPixelBuffer(1, 0); + sData->var_0++; + } + break; + case 1: + if (PrintAllOnCardPage1()) + sData->var_0++; + break; + case 2: + sub_80C438C(1); + sData->var_0++; + break; + case 3: + FillWindowPixelBuffer(2, 0); + sub_80C4FF0(); + sub_80C438C(2); + sData->var_0++; + break; + case 4: + sub_80C4550(sData->var_EF8); + sData->var_0++; + break; + case 5: + sub_80C45C0(sData->var_598); + sData->var_0++; + break; + case 6: + sub_80C4630(); + sData->var_0++; + break; + case 7: + if (gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE) + { + sub_800E0E8(); + CreateWirelessStatusIndicatorSprite(230, 150); + } + BlendPalettes(0xFFFFFFFF, 16, sData->var_52C); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, sData->var_52C); + SetVBlankCallback(VblankCb_TrainerCard); + sData->var_0++; + break; + case 8: + if (!UpdatePaletteFade() && !IsDma3ManagerBusyWithBgCopy()) + { + PlaySE(SE_RG_CARD3); + sData->var_0 = 10; + } + break; + case 9: + if (!IsSEPlaying()) + sData->var_0++; + break; + case 10: + if (!gReceivedRemoteLinkPlayers && sData->var_529) + { + PrintTimeOnCard(); + sub_80C438C(1); + sData->var_529 = 0; + } + if (gMain.newKeys & A_BUTTON) + { + sub_80C4918(); + PlaySE(SE_RG_CARD1); + sData->var_0 = 12; + } + else if (gMain.newKeys & B_BUTTON) + { + if (gReceivedRemoteLinkPlayers && sData->isLink && InUnionRoom() == TRUE) + { + sData->var_0 = 15; + } + else + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; + } + } + break; + case 12: + if (sub_80C4940() && sub_8087598() != TRUE) + { + PlaySE(SE_RG_CARD3); + sData->var_0 = 11; + } + break; + case 11: + if (gMain.newKeys & B_BUTTON) + { + if (gReceivedRemoteLinkPlayers && sData->isLink && InUnionRoom() == TRUE) + { + sData->var_0 = 15; + } + else if (gReceivedRemoteLinkPlayers) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; + } + else + { + sub_80C4918(); + sData->var_0 = 13; + PlaySE(SE_RG_CARD1); + } + } + else if (gMain.newKeys & A_BUTTON) + { + if (gReceivedRemoteLinkPlayers && sData->isLink && InUnionRoom() == TRUE) + { + sData->var_0 = 15; + } + else + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; + } + } + break; + case 15: + sub_800AC34(); + NewMenuHelpers_DrawDialogueFrame(0, 1); + AddTextPrinterParameterized(0, 1, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); + CopyWindowToVram(0, 3); + sData->var_0 = 16; + break; + case 16: + if (!gReceivedRemoteLinkPlayers) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; + } + break; + case 14: + if (!UpdatePaletteFade()) + CloseTrainerCard(taskId); + break; + case 13: + if (sub_80C4940() && sub_8087598() != TRUE) + { + sData->var_0 = 10; + PlaySE(SE_RG_CARD3); + } + break; + } +} + +static bool8 LoadCardGfx(void) +{ + switch (sData->gfxLoadState) + { + case 0: + if (sData->cardType != CARD_TYPE_FRLG) + LZ77UnCompWram(gUnknown_08DD1F78, sData->var_EF8); + else + LZ77UnCompWram(gUnknown_08DD2AE0, sData->var_EF8); + break; + case 1: + if (sData->cardType != CARD_TYPE_FRLG) + LZ77UnCompWram(gUnknown_08DD21B0, sData->var_A48); + else + LZ77UnCompWram(gUnknown_08DD2D30, sData->var_A48); + break; + case 2: + if (!sData->isLink) + { + if (sData->cardType != CARD_TYPE_FRLG) + LZ77UnCompWram(gUnknown_08DD2010, sData->var_598); + else + LZ77UnCompWram(gUnknown_08DD2B78, sData->var_598); + } + else + { + if (sData->cardType != CARD_TYPE_FRLG) + LZ77UnCompWram(gUnknown_08DD228C, sData->var_598); + else + LZ77UnCompWram(gUnknown_08DD2E5C, sData->var_598); + } + break; + case 3: + if (sData->cardType != CARD_TYPE_FRLG) + LZ77UnCompWram(gUnknown_0856F5CC, sData->var_13A8); + else + LZ77UnCompWram(gUnknown_0856F814, sData->var_13A8); + break; + case 4: + if (sData->cardType != CARD_TYPE_FRLG) + LZ77UnCompWram(gEmeraldTrainerCard_Gfx, sData->var_19A8); + else + LZ77UnCompWram(gFireRedTrainerCard_Gfx, sData->var_19A8); + break; + case 5: + if (sData->cardType == CARD_TYPE_FRLG) + LZ77UnCompWram(gUnknown_0856F018, sData->var_17A8); + break; + default: + sData->gfxLoadState = 0; + return TRUE; + } + sData->gfxLoadState++; + return FALSE; +} + +static void CB2_InitTrainerCard(void) +{ + switch (gMain.state) + { + case 0: + ResetGpuRegs(); + sub_80C3414(); + gMain.state++; + break; + case 1: + DmaClear32(3, (void *)OAM, OAM_SIZE); + gMain.state++; + break; + case 2: + if (!sData->var_52C) + DmaClear16(3, (void *)PLTT, PLTT_SIZE); + gMain.state++; + break; + case 3: + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetPaletteFade(); + gMain.state++; + case 4: + InitBgsAndWindows(); + gMain.state++; + break; + case 5: + sub_80C41D8(); + gMain.state++; + break; + case 6: + if (LoadCardGfx() == TRUE) + gMain.state++; + break; + case 7: + sub_80C4330(); + gMain.state++; + break; + case 8: + HandleGpuRegs(); + gMain.state++; + break; + case 9: + PrintAllVariableNumsOnCardPage2(); + gMain.state++; + break; + case 10: + if (SetCardBgsAndPals() == TRUE) + gMain.state++; + break; + default: + SetTrainerCardCb2(); + break; + } +} + +static u32 GetCappedGameStat(u8 statId, u32 maxValue) +{ + u32 statValue = GetGameStat(statId); + + return min(maxValue, statValue); +} + +static bool8 HasAllFrontierSymbols(void) +{ + u8 i; + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) + { + if (!FlagGet(FLAG_SYS_TOWER_SILVER + 2 * i) || !FlagGet(FLAG_SYS_TOWER_GOLD + 2 * i)) + return FALSE; + } + return TRUE; +} + +u32 CountPlayerTrainerStars(void) +{ + u8 stars = 0; + + if (GetGameStat(GAME_STAT_ENTERED_HOF)) + stars++; + if (HasAllHoennMons()) + stars++; + if (CountPlayerContestPaintings() > 4) + stars++; + if (HasAllFrontierSymbols()) + stars++; + + return stars; +} + +static u8 GetRubyTrainerStars(struct TrainerCard *trainerCard) +{ + u8 stars = 0; + + if (trainerCard->hofDebutHours || trainerCard->hofDebutMinutes || trainerCard->hofDebutSeconds) + stars++; + if (trainerCard->caughtAllHoenn) + stars++; + if (trainerCard->battleTowerStraightWins > 49) + stars++; + if (trainerCard->hasAllPaintings) + stars++; + + return stars; +} + +static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType) +{ + u32 playTime; + u8 i; + + trainerCard->gender = gSaveBlock2Ptr->playerGender; + trainerCard->playTimeHours = gSaveBlock2Ptr->playTimeHours; + trainerCard->playTimeMinutes = gSaveBlock2Ptr->playTimeMinutes; + + playTime = GetGameStat(GAME_STAT_FIRST_HOF_PLAY_TIME); + if (!GetGameStat(GAME_STAT_ENTERED_HOF)) + playTime = 0; + + trainerCard->hofDebutHours = playTime >> 16; + trainerCard->hofDebutMinutes = (playTime >> 8) & 0xFF; + trainerCard->hofDebutSeconds = playTime & 0xFF; + if ((playTime >> 16) > 999) + { + trainerCard->hofDebutHours = 999; + trainerCard->hofDebutMinutes = 59; + trainerCard->hofDebutSeconds = 59; + } + + trainerCard->hasPokedex = FlagGet(FLAG_SYS_POKEDEX_GET); + trainerCard->caughtAllHoenn = HasAllHoennMons(); + trainerCard->caughtMonsCount = GetCaughtMonsCount(); + + trainerCard->trainerId = (gSaveBlock2Ptr->playerTrainerId[1] << 8) | gSaveBlock2Ptr->playerTrainerId[0]; + + trainerCard->linkBattleWins = GetCappedGameStat(GAME_STAT_LINK_BATTLE_WINS, 9999); + trainerCard->linkBattleLosses = GetCappedGameStat(GAME_STAT_LINK_BATTLE_LOSSES, 9999); + + trainerCard->pokemonTrades = GetCappedGameStat(GAME_STAT_POKEMON_TRADES, 0xFFFF); + + trainerCard->money = GetMoney(&gSaveBlock1Ptr->money); + + for (i = 0; i < 4; i++) + trainerCard->var_28[i] = gSaveBlock1Ptr->unk2BB0[i]; + + StringCopy(trainerCard->playerName, gSaveBlock2Ptr->playerName); + + switch (cardType) + { + case CARD_TYPE_EMERALD: + trainerCard->battleTowerWins = 0; + trainerCard->battleTowerStraightWins = 0; + // Seems like GF got CARD_TYPE_FRLG and CARD_TYPE_RS wrong. + case CARD_TYPE_FRLG: + trainerCard->contestsWithFriends = GetCappedGameStat(GAME_STAT_WON_LINK_CONTEST, 999); + trainerCard->pokeblocksWithFriends = GetCappedGameStat(GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 0xFFFF); + if (CountPlayerContestPaintings() > 4) + trainerCard->hasAllPaintings = TRUE; + trainerCard->stars = GetRubyTrainerStars(trainerCard); + break; + case CARD_TYPE_RS: + trainerCard->battleTowerWins = 0; + trainerCard->battleTowerStraightWins = 0; + trainerCard->contestsWithFriends = 0; + trainerCard->pokeblocksWithFriends = 0; + trainerCard->hasAllPaintings = 0; + trainerCard->stars = 0; + break; + } +} + +static void sub_80C3020(struct TrainerCard *trainerCard) +{ + memset(trainerCard, 0, sizeof(struct TrainerCard)); + trainerCard->version = GAME_VERSION; + SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD); + trainerCard->hasAllSymbols = HasAllFrontierSymbols(); + trainerCard->frontierBP = gSaveBlock2Ptr->frontier.field_EBA; + if (trainerCard->hasAllSymbols) + trainerCard->stars++; + + if (trainerCard->gender == FEMALE) + trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8]; + else + trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8]; +} + +void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) +{ + memset(trainerCard, 0, 0x60); + trainerCard->version = GAME_VERSION; + SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD); + trainerCard->var_3A = HasAllFrontierSymbols(); + *((u16*)&trainerCard->berryCrushPoints) = gSaveBlock2Ptr->frontier.field_EBA; + if (trainerCard->var_3A) + trainerCard->stars++; + + if (trainerCard->gender == FEMALE) + trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8]; + else + trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8]; +} + +void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion) +{ + memset(dst, 0, sizeof(struct TrainerCard)); + dst->version = gameVersion; + + switch (VersionToCardType(gameVersion)) + { + case CARD_TYPE_FRLG: + memcpy(dst, src, 0x60); + break; + case CARD_TYPE_RS: + memcpy(dst, src, 0x38); + break; + case CARD_TYPE_EMERALD: + memcpy(dst, src, 0x60); + dst->berryCrushPoints = 0; + dst->hasAllSymbols = src[29]; + dst->frontierBP = src[30]; + break; + } +} + +static void SetDataFromTrainerCard(void) +{ + u8 i; + u32 badgeFlag; + + sData->hasPokedex = FALSE; + sData->hasHofResult = FALSE; + sData->hasLinkResults = FALSE; + sData->hasBattleTowerWins = FALSE; + sData->var_E = 0; + sData->var_F = 0; + sData->hasTrades = FALSE; + memset(sData->badgeCount, 0, sizeof(sData->badgeCount)); + if (sData->trainerCard.hasPokedex) + sData->hasPokedex++; + + if (sData->trainerCard.hofDebutHours + || sData->trainerCard.hofDebutMinutes + || sData->trainerCard.hofDebutSeconds) + sData->hasHofResult++; + + if (sData->trainerCard.linkBattleWins || sData->trainerCard.linkBattleLosses) + sData->hasLinkResults++; + if (sData->trainerCard.pokemonTrades) + sData->hasTrades++; + if (sData->trainerCard.battleTowerWins || sData->trainerCard.battleTowerStraightWins) + sData->hasBattleTowerWins++; + + for (i = 0, badgeFlag = FLAG_BADGE01_GET; badgeFlag <= FLAG_BADGE08_GET; badgeFlag++, i++) + { + if (FlagGet(badgeFlag)) + sData->badgeCount[i]++; + } +} + +static void HandleGpuRegs(void) +{ + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + ShowBg(3); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_DARKEN); + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ); + SetGpuReg(REG_OFFSET_WIN0V, 160); + SetGpuReg(REG_OFFSET_WIN0H, 240); + if (gReceivedRemoteLinkPlayers) + EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL); + else + EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK); +} + +static void sub_80C32EC(u16 arg0) +{ + s8 quotient = (arg0 + 40) / 10; + + if (quotient <= 4) + quotient = 0; + sData->var_528 = quotient; + SetGpuReg(REG_OFFSET_BLDY, sData->var_528); + SetGpuReg(REG_OFFSET_WIN0V, (sData->var_7CA8 * 256) | (160 - sData->var_7CA8)); +} + +static void ResetGpuRegs(void) +{ + SetVBlankCallback(NULL); + SetHBlankCallback(NULL); + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + SetGpuReg(REG_OFFSET_BG1CNT, 0); + SetGpuReg(REG_OFFSET_BG2CNT, 0); + SetGpuReg(REG_OFFSET_BG3CNT, 0); +} + +static void InitBgsAndWindows(void) +{ + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_0856FAB4, ARRAY_COUNT(gUnknown_0856FAB4)); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); + InitWindows(gUnknown_0856FAC4); + DeactivateAllTextPrinters(); + sub_81973A4(); +} + +static void SetTrainerCardCb2(void) +{ + SetMainCallback2(CB2_TrainerCard); +} + +static void sub_80C3414(void) +{ + ResetTasks(); + ScanlineEffect_Stop(); + CreateTask(sub_80C2760, 0); + sub_80C4EE4(); + SetDataFromTrainerCard(); +} + +static bool8 PrintAllOnCardPage1(void) +{ + switch (sData->printState) + { + case 0: + PrintNameOnCard(); + break; + case 1: + PrintIdOnCard(); + break; + case 2: + PrintMoneyOnCard(); + break; + case 3: + PrintPokedexOnCard(); + break; + case 4: + PrintTimeOnCard(); + break; + case 5: + PrintProfilePhraseOnCard(); + break; + default: + sData->printState = 0; + return TRUE; + } + sData->printState++; + return FALSE; +} + +static bool8 PrintStringsOnCardPage2(void) +{ + switch (sData->printState) + { + case 0: + sub_80C3B50(); + break; + case 1: + PrintHofDebutStringOnCard(); + break; + case 2: + PrintWinsLossesStringOnCard(); + break; + case 3: + PrintTradesStringOnCard(); + break; + case 4: + PrintBerryCrushStringOnCard(); + PrintPokeblockStringOnCard(); + break; + case 5: + PrintUnionStringOnCard(); + PrintContestStringOnCard(); + break; + case 6: + sub_80C4140(); + PrintBattleFacilityStringOnCard(); + break; + case 7: + sub_80C42A4(); + break; + default: + sData->printState = 0; + return TRUE; + } + sData->printState++; + return FALSE; +} + +static void PrintAllVariableNumsOnCardPage2(void) +{ + PrintNameOnCard2(); + PrintHofTimeOnCard(); + PrintLinkResultsNumsOnCard(); + PrintTradesNumOnCard(); + PrintBerryCrushNumOnCard(); + PrintUnionNumOnCard(); + PrintPokeblocksNumOnCard(); + PrintContestNumOnCard(); + PrintBattleFacilityNumsOnCard(); +} + +static void PrintNameOnCard(void) +{ + u8 buffer[32]; + u8* txtPtr; + txtPtr = StringCopy(buffer, gText_TrainerCardName); + StringCopy(txtPtr, sData->trainerCard.playerName); + ConvertInternationalString(txtPtr, sData->language); + if (sData->cardType == CARD_TYPE_FRLG) + AddTextPrinterParameterized3(1, 1, 20, 28, gUnknown_0856FB0C, TEXT_SPEED_FF, buffer); + else + AddTextPrinterParameterized3(1, 1, 16, 33, gUnknown_0856FB0C, TEXT_SPEED_FF, buffer); +} + +static void PrintIdOnCard(void) +{ + u8 buffer[32]; + u8* txtPtr; + s32 xPos; + u32 top; + txtPtr = StringCopy(buffer, gText_TrainerCardIDNo); + ConvertIntToDecimalStringN(txtPtr, sData->trainerCard.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5); + if (sData->cardType == CARD_TYPE_FRLG) + { + xPos = GetStringCenterAlignXOffset(1, buffer, 80) + 132; + top = 9; + } + else + { + xPos = GetStringCenterAlignXOffset(1, buffer, 96) + 120; + top = 9; + } + + AddTextPrinterParameterized3(1, 1, xPos, top, gUnknown_0856FB0C, TEXT_SPEED_FF, buffer); +} + +static void PrintMoneyOnCard(void) +{ + s32 xOffset; + u8 top; + + if (!sData->isHoenn) + AddTextPrinterParameterized3(1, 1, 20, 56, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardMoney); + else + AddTextPrinterParameterized3(1, 1, 16, 57, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardMoney); + + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.money, 0, 6); + StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); + if (!sData->isHoenn) + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); + top = 56; + } + else + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); + top = 57; + } + AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); +} + +static u16 GetCaughtMonsCount(void) +{ + if (IsNationalPokedexEnabled()) + return GetNationalPokedexCount(FLAG_GET_CAUGHT); + else + return GetHoennPokedexCount(FLAG_GET_CAUGHT); +} + +static void PrintPokedexOnCard(void) +{ + s32 xOffset; + u8 top; + if (FlagGet(FLAG_SYS_POKEDEX_GET)) + { + if (!sData->isHoenn) + AddTextPrinterParameterized3(1, 1, 20, 72, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardPokedex); + else + AddTextPrinterParameterized3(1, 1, 16, 73, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardPokedex); + StringCopy(ConvertIntToDecimalStringN(gStringVar4, sData->trainerCard.caughtMonsCount, 0, 3), gText_EmptyString6); + if (!sData->isHoenn) + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); + top = 72; + } + else + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); + top = 73; + } + AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); + } +} + +static const u8 *const gUnknown_0856FB40[] = {gUnknown_0856FB0C, gUnknown_0856FB12}; + +static void PrintTimeOnCard(void) +{ + u16 hours; + u16 minutes; + s32 width; + u32 r7, r4, r10; + + if (!sData->isHoenn) + AddTextPrinterParameterized3(1, 1, 20, 88, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardTime); + else + AddTextPrinterParameterized3(1, 1, 16, 89, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardTime); + + if (sData->isLink) + { + hours = sData->trainerCard.playTimeHours; + minutes = sData->trainerCard.playTimeMinutes; + } + else + { + hours = gSaveBlock2Ptr->playTimeHours; + minutes = gSaveBlock2Ptr->playTimeMinutes; + } + + if (hours > 999) + hours = 999; + if (minutes > 59) + minutes = 59; + width = GetStringWidth(1, gText_Colon2, 0); + + if (!sData->isHoenn) + { + r7 = 144; + r4 = 88; + } + else + { + r7 = 128; + r4 = 89; + } + r10 = width + 30; + r7 -= r10; + + FillWindowPixelRect(1, 0, r7, r4, r10, 15); + ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); + r7 += 18; + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB40[sData->var_7], TEXT_SPEED_FF, gText_Colon2); + r7 += width; + ConvertIntToDecimalStringN(gStringVar4, minutes, 2, 2); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); +} + +static const u8 gUnknown_0856FB48[] = {0x71, 0x68}; +static const u8 gUnknown_0856FB4A[] = {0x81, 0x78}; + +static void PrintProfilePhraseOnCard(void) +{ + if (sData->isLink) + { + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[0]); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[0], 0) + 14, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[1]); + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[2]); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[2], 0) + 14, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[3]); + } +} + +static void PrintNameOnCard2(void) +{ + StringCopy(sData->var_4D, sData->trainerCard.playerName); + ConvertInternationalString(sData->var_4D, sData->language); + if (sData->cardType != CARD_TYPE_FRLG) + { + StringCopy(gStringVar1, sData->var_4D); + StringExpandPlaceholders(sData->var_4D, gText_Var1sTrainerCard); + } +} + +static void sub_80C3B50(void) +{ + if (!sData->isHoenn) + AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_4D); + else + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, sData->var_4D, 216), 9, gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_4D); +} + +static const u8 gUnknown_0856FB4C[] = {0xfd, 0x02, 0xf0, 0xfd, 0x03, 0xf0, 0xfd, 0x04, 0xff}; + +static void PrintHofTimeOnCard(void) +{ + if (sData->hasHofResult) + { + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.hofDebutHours, 1, 3); + ConvertIntToDecimalStringN(gStringVar2, sData->trainerCard.hofDebutMinutes, 2, 2); + ConvertIntToDecimalStringN(gStringVar3, sData->trainerCard.hofDebutSeconds, 2, 2); + StringExpandPlaceholders(sData->var_93, gUnknown_0856FB4C); + } +} + +static const u8 gUnknown_0856FB55[] = {0x08, 0x10}; +static const u8 gUnknown_0856FB57[] = {0xd8, 0xd8}; + +static void PrintString(u8 top, const u8* str1, u8* str2, const u8* color) +{ + AddTextPrinterParameterized3(1, 1, gUnknown_0856FB55[sData->isHoenn], top * 16 + 33, gUnknown_0856FB0C, TEXT_SPEED_FF, str1); + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[sData->isHoenn]), top * 16 + 33, color, TEXT_SPEED_FF, str2); +} + +static void PrintHofDebutStringOnCard(void) +{ + if (sData->hasHofResult) + PrintString(0, gText_HallOfFameDebut, sData->var_93, gUnknown_0856FB0F); +} + +static const u8 *const gUnknown_0856FB5C[] = {gText_LinkBattles, gText_LinkCableBattles, gText_LinkBattles}; + +static void PrintLinkResultsNumsOnCard(void) +{ + if (sData->hasLinkResults) + { + StringCopy(sData->var_D9, gUnknown_0856FB5C[sData->cardType]); + ConvertIntToDecimalStringN(sData->var_165, sData->trainerCard.linkBattleWins, 0, 4); + ConvertIntToDecimalStringN(sData->var_1AB, sData->trainerCard.linkBattleLosses, 0, 4); + } +} + +static void PrintWinsLossesStringOnCard(void) +{ + if (sData->hasLinkResults) + { + StringCopy(gStringVar1, sData->var_165); + StringCopy(gStringVar2, sData->var_1AB); + StringExpandPlaceholders(gStringVar4, gText_WinsLosses); + PrintString(1, sData->var_D9, gStringVar4, gUnknown_0856FB0C); + } +} + +static void PrintTradesNumOnCard(void) +{ + if (sData->hasTrades) + ConvertIntToDecimalStringN(sData->var_237, sData->trainerCard.pokemonTrades, 1, 5); +} + +static void PrintTradesStringOnCard(void) +{ + if (sData->hasTrades) + PrintString(2, gText_PokemonTrades, sData->var_237, gUnknown_0856FB0F); +} + +static void PrintBerryCrushNumOnCard(void) +{ + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.berryCrushPoints) + ConvertIntToDecimalStringN(sData->var_2C3, sData->trainerCard.berryCrushPoints, 1, 5); +} + +static void PrintBerryCrushStringOnCard(void) +{ + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.berryCrushPoints) + PrintString(4, gText_BerryCrush, sData->var_2C3, gUnknown_0856FB0F); +} + +static void PrintUnionNumOnCard(void) +{ + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.unionRoomNum) + ConvertIntToDecimalStringN(sData->var_34F, sData->trainerCard.unionRoomNum, 1, 5); +} + +static void PrintUnionStringOnCard(void) +{ + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.unionRoomNum) + PrintString(3, gText_UnionTradesAndBattles, sData->var_34F, gUnknown_0856FB0F); +} + +static void PrintPokeblocksNumOnCard(void) +{ + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.pokeblocksWithFriends) + { + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.pokeblocksWithFriends, 1, 5); + StringExpandPlaceholders(sData->var_395, gText_Var1DarkGreyShadowLightGrey); + } +} + +static void PrintPokeblockStringOnCard(void) +{ + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.pokeblocksWithFriends) + PrintString(3, gText_PokeblocksWithFriends, sData->var_395, gUnknown_0856FB0F); +} + +static void PrintContestNumOnCard(void) +{ + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.contestsWithFriends) + ConvertIntToDecimalStringN(sData->var_3DB, sData->trainerCard.contestsWithFriends, 1, 5); +} + +static void PrintContestStringOnCard(void) +{ + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.contestsWithFriends) + PrintString(4, gText_WonContestsWFriends, sData->var_3DB, gUnknown_0856FB0F); +} + +static void PrintBattleFacilityNumsOnCard(void) +{ + switch (sData->cardType) + { + case CARD_TYPE_RS: + if (sData->hasBattleTowerWins) + { + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.battleTowerWins, 1, 4); + ConvertIntToDecimalStringN(gStringVar2, sData->trainerCard.battleTowerStraightWins, 1, 4); + StringExpandPlaceholders(sData->var_421, gText_WSlashStraightSlash); + } + break; + case CARD_TYPE_EMERALD: + if (sData->trainerCard.frontierBP) + { + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.frontierBP, 1, 5); + StringExpandPlaceholders(sData->var_421, gText_Var1DarkLightGreyBP); + } + break; + case CARD_TYPE_FRLG: + break; + } +} + +static void PrintBattleFacilityStringOnCard(void) +{ + switch (sData->cardType) + { + case CARD_TYPE_RS: + if (sData->hasBattleTowerWins) + PrintString(5, gText_BattleTower, sData->var_421, gUnknown_0856FB0C); + break; + case CARD_TYPE_EMERALD: + if (sData->trainerCard.frontierBP) + PrintString(5, gText_BattlePtsWon, sData->var_421, gUnknown_0856FB0F); + break; + case CARD_TYPE_FRLG: + break; + } +} + +static void sub_80C4140(void) +{ + u8 i; + u8 buffer[] = {0x05, 0x06, 0x07, 0x08, 0x09, 0x0a}; + u8 buffer2[] = {0x00, 0x04, 0x08, 0x0c, 0x10, 0x14}; + + if (sData->cardType == CARD_TYPE_FRLG) + { + for (i = 0; i < 6; i++) + { + if (sData->trainerCard.monSpecies[i]) + { + u8 monSpecies = sub_80D30A0(sData->trainerCard.monSpecies[i]); + WriteSequenceToBgTilemapBuffer(3, 16 * i + 224, buffer2[i] + 3, 15, 4, 4, buffer[monSpecies], 1); + } + } + } +} + +static void sub_80C41D8(void) +{ + u8 i; + + CpuSet(gMonIconPalettes, sData->var_468, 0x60); + switch (sData->trainerCard.var_4E) + { + case 0: + break; + case 1: + TintPalette_CustomTone(sData->var_468, 96, 0, 0, 0); + break; + case 2: + TintPalette_CustomTone(sData->var_468, 96, 500, 330, 310); + break; + case 3: + TintPalette_SepiaTone(sData->var_468, 96); + break; + } + LoadPalette(sData->var_468, 80, 192); + + for (i = 0; i < 6; i++) + { + if (sData->trainerCard.monSpecies[i]) + LoadBgTiles(3, GetMonIconTiles(sData->trainerCard.monSpecies[i], 0), 512, 16 * i + 32); + } +} + +static void sub_80C42A4(void) +{ + u8 i; + u8 buffer[4] = {0x0b, 0x0c, 0x0d, 0x0e}; + + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.var_4C == 1) + { + for (i = 0; i < 3; i++) + { + u8 var_50 = sData->trainerCard.var_50[i]; + if (sData->trainerCard.var_50[i]) + WriteSequenceToBgTilemapBuffer(3, i * 4 + 320, i * 3 + 2, 2, 2, 2, buffer[var_50 - 1], 1); + } + } +} + +static void sub_80C4330(void) +{ + LoadPalette(gUnknown_0856F54C, 176, 32); + LoadPalette(gUnknown_0856F56C, 192, 32); + LoadPalette(gUnknown_0856F58C, 208, 32); + LoadPalette(gUnknown_0856F5AC, 224, 32); + LoadBgTiles(3, sData->var_17A8, 1024, 128); +} + +static void sub_80C438C(u8 windowId) +{ + PutWindowTilemap(windowId); + CopyWindowToVram(windowId, 3); +} + +static u8 SetCardBgsAndPals(void) +{ + switch (sData->bgPalLoadState) + { + case 0: + LoadBgTiles(3, sData->var_13A8, 1024, 0); + break; + case 1: + LoadBgTiles(0, sData->var_19A8, 6144, 0); + break; + case 2: + if (sData->cardType != CARD_TYPE_FRLG) + { + LoadPalette(gEmeraldTrainerCardStarPals[sData->trainerCard.stars], 0, 96); + LoadPalette(gUnknown_0856F4EC, 48, 32); + if (sData->trainerCard.gender) + LoadPalette(gUnknown_0856F4AC, 16, 32); + } + else + { + LoadPalette(gFireRedTrainerCardStarPals[sData->trainerCard.stars], 0, 96); + LoadPalette(gUnknown_0856F50C, 48, 32); + if (sData->trainerCard.gender) + LoadPalette(gUnknown_0856F4CC, 16, 32); + } + LoadPalette(gUnknown_0856F52C, 64, 32); + break; + case 3: + SetBgTilemapBuffer(0, sData->var_3CA8); + SetBgTilemapBuffer(2, sData->var_5CA8); + break; + case 4: + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 32, 32); + FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 32, 32); + default: + return 1; + } + sData->bgPalLoadState++; + return 0; +} + +static void sub_80C4550(u16 *ptr) +{ + s16 i, j; + u16 *dst = sData->var_5CA8; + + for (i = 0; i < 20; i++) + { + for (j = 0; j < 32; j++) + { + if (j < 30) + dst[32 * i + j] = ptr[30 * i + j]; + else + dst[32 * i + j] = ptr[0]; + } + } + CopyBgTilemapBufferToVram(2); +} + +static void sub_80C45C0(u16* ptr) +{ + s16 i, j; + u16 *dst = sData->var_3CA8; + + for (i = 0; i < 20; i++) + { + for (j = 0; j < 32; j++) + { + if (j < 30) + dst[32 * i + j] = ptr[30 * i + j]; + else + dst[32 * i + j] = ptr[0]; + } + } + CopyBgTilemapBufferToVram(0); +} + +static const u8 gUnknown_0856FB78[] = {7, 7}; + +static void sub_80C4630(void) +{ + s16 i, x; + u16 tileNum = 192; + u8 palNum = 3; + + FillBgTilemapBufferRect(3, 143, 15, gUnknown_0856FB78[sData->isHoenn], sData->trainerCard.stars, 1, 4); + if (!sData->isLink) + { + x = 4; + for (i = 0; i < 8; i++, tileNum += 2, x += 3) + { + if (sData->badgeCount[i]) + { + FillBgTilemapBufferRect(3, tileNum, x, 15, 1, 1, palNum); + FillBgTilemapBufferRect(3, tileNum + 1, x + 1, 15, 1, 1, palNum); + FillBgTilemapBufferRect(3, tileNum + 16, x, 16, 1, 1, palNum); + FillBgTilemapBufferRect(3, tileNum + 17, x + 1, 16, 1, 1, palNum); + } + } + } + CopyBgTilemapBufferToVram(3); +} + +static void sub_80C474C(void) +{ + if (sData->cardType == CARD_TYPE_FRLG) + { + if (sData->hasTrades) + { + FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 1); + FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 1); + } + if (sData->trainerCard.berryCrushPoints) + { + FillBgTilemapBufferRect(3, 141, 21, 13, 1, 1, 1); + FillBgTilemapBufferRect(3, 157, 21, 14, 1, 1, 1); + } + if (sData->trainerCard.unionRoomNum) + { + FillBgTilemapBufferRect(3, 141, 27, 11, 1, 1, 1); + FillBgTilemapBufferRect(3, 157, 27, 12, 1, 1, 1); + } + } + else + { + if (sData->hasTrades) + { + FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 0); + FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 0); + } + if (sData->trainerCard.contestsWithFriends) + { + FillBgTilemapBufferRect(3, 141, 27, 13, 1, 1, 0); + FillBgTilemapBufferRect(3, 157, 27, 14, 1, 1, 0); + } + if (sData->hasBattleTowerWins) + { + FillBgTilemapBufferRect(3, 141, 17, 15, 1, 1, 0); + FillBgTilemapBufferRect(3, 157, 17, 16, 1, 1, 0); + FillBgTilemapBufferRect(3, 140, 27, 15, 1, 1, 0); + FillBgTilemapBufferRect(3, 156, 27, 16, 1, 1, 0); + } + } + CopyBgTilemapBufferToVram(3); +} + +static void sub_80C48C8(void) +{ + if (++sData->var_6 > 60) + { + sData->var_6 = 0; + sData->var_7 ^= 1; + sData->var_529 = 1; + } +} + +u8 sub_80C4904(u8 cardId) +{ + struct TrainerCard* trainerCards = gTrainerCards; + return trainerCards[cardId].stars; +} + +static void sub_80C4918(void) +{ + u8 taskId = CreateTask(sub_80C4960, 0); + sub_80C4960(taskId); + SetHBlankCallback(HblankCb_TrainerCard); +} + +static bool8 sub_80C4940(void) +{ + if (FindTaskIdByFunc(sub_80C4960) == 0xFF) + return TRUE; + else + return FALSE; +} + +static void sub_80C4960(u8 taskId) +{ + while(gUnknown_0856FB28[gTasks[taskId].data[0]](&gTasks[taskId])) + ; +} + +static bool8 sub_80C4998(struct Task* task) +{ + u32 i; + + HideBg(1); + HideBg(3); + ScanlineEffect_Stop(); + ScanlineEffect_Clear(); + for (i = 0; i < 160; i++) + gScanlineEffectRegBuffers[1][i] = 0; + task->data[0]++; + return FALSE; +} + +static bool8 sub_80C49D8(struct Task* task) +{ + u32 r4, r5, r10, r7, r6, var_24, r9, var; + s16 i; + + sData->allowDMACopy = FALSE; + if (task->data[1] >= 77) + task->data[1] = 77; + else + task->data[1] += 7; + + sData->var_7CA8 = task->data[1]; + sub_80C32EC(task->data[1]); + + // ??? + r7 = task->data[1]; + r9 = 160 - r7; + r4 = r9 - r7; + r6 = -r7 << 16; + r5 = 0xA00000 / r4; + r5 += 0xFFFF0000; + var_24 = r6; + var_24 += r5 * r4; + r10 = r5 / r4; + r5 *= 2; + + for (i = 0; i < r7; i++) + gScanlineEffectRegBuffers[0][i] = -i; + for (; i < (s16)(r9); i++) + { + var = r6 >> 16; + r6 += r5; + r5 -= r10; + gScanlineEffectRegBuffers[0][i] = var; + } + var = var_24 >> 16; + for (; i < 160; i++) + gScanlineEffectRegBuffers[0][i] = var; + + sData->allowDMACopy = TRUE; + if (task->data[1] >= 77) + task->data[0]++; + + return FALSE; +} + +static bool8 sub_80C4B08(struct Task* task) +{ + sData->allowDMACopy = FALSE; + if (sub_8087598() == TRUE) + return FALSE; + + do + { + switch (sData->var_4) + { + case 0: + FillWindowPixelBuffer(1, 0); + FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 0x20, 0x20); + break; + case 1: + if (!sData->var_8) + { + if (!PrintStringsOnCardPage2()) + return FALSE; + } + else + { + if (!PrintAllOnCardPage1()) + return FALSE; + } + break; + case 2: + if (!sData->var_8) + sub_80C45C0(sData->var_A48); + else + sub_80C438C(1); + break; + case 3: + if (!sData->var_8) + sub_80C474C(); + else + FillWindowPixelBuffer(2, 0); + break; + case 4: + if (sData->var_8) + sub_80C4FF0(); + break; + default: + task->data[0]++; + sData->allowDMACopy = TRUE; + sData->var_4 = 0; + return FALSE; + } + sData->var_4++; + } while (gReceivedRemoteLinkPlayers == 0); + + return FALSE; +} + +static bool8 sub_80C4C1C(struct Task* task) +{ + sData->allowDMACopy = FALSE; + if (sData->var_8) + { + sub_80C438C(2); + sub_80C4550(sData->var_EF8); + sub_80C45C0(sData->var_598); + sub_80C4630(); + } + sub_80C438C(1); + sData->var_8 ^= 1; + task->data[0]++; + sData->allowDMACopy = TRUE; + PlaySE(SE_RG_CARD2); + return FALSE; +} + +static bool8 sub_80C4C84(struct Task* task) +{ + u32 r4, r5, r10, r7, r6, var_24, r9, var; + s16 i; + + sData->allowDMACopy = FALSE; + if (task->data[1] <= 5) + task->data[1] = 0; + else + task->data[1] -= 5; + + sData->var_7CA8 = task->data[1]; + sub_80C32EC(task->data[1]); + + // ??? + r7 = task->data[1]; + r9 = 160 - r7; + r4 = r9 - r7; + r6 = -r7 << 16; + r5 = 0xA00000 / r4; + r5 += 0xFFFF0000; + var_24 = r6; + var_24 += r5 * r4; + r10 = r5 / r4; + r5 /= 2; + + for (i = 0; i < r7; i++) + gScanlineEffectRegBuffers[0][i] = -i; + for (; i < (s16)(r9); i++) + { + var = r6 >> 16; + r6 += r5; + r5 += r10; + gScanlineEffectRegBuffers[0][i] = var; + } + var = var_24 >> 16; + for (; i < 160; i++) + gScanlineEffectRegBuffers[0][i] = var; + + sData->allowDMACopy = TRUE; + if (task->data[1] <= 0) + task->data[0]++; + + return FALSE; +} + +static bool8 sub_80C4DB0(struct Task *task) +{ + ShowBg(1); + ShowBg(3); + SetHBlankCallback(NULL); + DestroyTask(FindTaskIdByFunc(sub_80C4960)); + return FALSE; +} + +void ShowPlayerTrainerCard(void (*callback)(void)) +{ + sData = AllocZeroed(sizeof(*sData)); + sData->callback2 = callback; + if (callback == CB2_ReshowFrontierPass) + sData->var_52C = 0x7FFF; + else + sData->var_52C = 0; + + if (InUnionRoom() == TRUE) + sData->isLink = TRUE; + else + sData->isLink = FALSE; + + sData->language = GAME_LANGUAGE; + sub_80C3020(&sData->trainerCard); + SetMainCallback2(CB2_InitTrainerCard); +} + +void ShowTrainerCardInLink(u8 cardId, void (*callback)(void)) +{ + sData = AllocZeroed(sizeof(*sData)); + sData->callback2 = callback; + sData->isLink = TRUE; + sData->trainerCard = gTrainerCards[cardId]; + sData->language = gLinkPlayers[cardId].language; + SetMainCallback2(CB2_InitTrainerCard); +} + +static void sub_80C4EE4(void) +{ + u8 i; + + sData->var_0 = 0; + sData->var_6 = gSaveBlock2Ptr->playTimeVBlanks; + sData->var_7 = 0; + sData->var_8 = 0; + sData->var_528 = 0; + sData->cardType = GetSetCardType(); + for (i = 0; i < 4; i++) + CopyEasyChatWord(sData->var_19[i], sData->trainerCard.var_28[i]); +} + +static u8 GetSetCardType(void) +{ + if (sData == NULL) + { + if (gGameVersion == VERSION_FIRE_RED || gGameVersion == VERSION_LEAF_GREEN) + return CARD_TYPE_FRLG; + else if (gGameVersion == VERSION_EMERALD) + return CARD_TYPE_EMERALD; + else + return CARD_TYPE_RS; + } + else + { + if (sData->trainerCard.version == VERSION_FIRE_RED || sData->trainerCard.version == VERSION_LEAF_GREEN) + { + sData->isHoenn = FALSE; + return CARD_TYPE_FRLG; + } + else if (sData->trainerCard.version == VERSION_EMERALD) + { + sData->isHoenn = TRUE; + return CARD_TYPE_EMERALD; + } + else + { + sData->isHoenn = TRUE; + return CARD_TYPE_RS; + } + } +} + +static u8 VersionToCardType(u8 version) +{ + if (version == VERSION_FIRE_RED || version == VERSION_LEAF_GREEN) + return CARD_TYPE_FRLG; + else if (version == VERSION_EMERALD) + return CARD_TYPE_EMERALD; + else + return CARD_TYPE_RS; +} + +static void sub_80C4FF0(void) +{ + if (InUnionRoom() == TRUE && gReceivedRemoteLinkPlayers == 1) + { + sub_818D938(FacilityClassToPicIndex(sData->trainerCard.var_4F), + TRUE, + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][0], + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][1], + 8, + 2); + } + else + { + sub_818D938(FacilityClassToPicIndex(gUnknown_0856FB20[sData->cardType][sData->trainerCard.gender]), + TRUE, + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][0], + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][1], + 8, + 2); + } +} diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 7ec6865fd..e0a236286 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -24,8 +24,11 @@ #include "constants/event_object_movement_constants.h" #include "constants/event_objects.h" #include "constants/items.h" +#include "constants/moves.h" #include "constants/maps.h" +#include "constants/species.h" #include "constants/trainers.h" +#include "constants/easy_chat.h" extern bool32 sub_81D3B34(void); @@ -118,11 +121,7 @@ static void sub_81D642C(struct Pokemon *mon, u8 level); static u16 sub_81D6640(void); // const data -// I will decompile these soon, no worries :) -extern const struct TrHillTag gUnknown_08626814; -extern const struct TrHillTag gUnknown_086276FC; -extern const struct TrHillTag gUnknown_086285E4; -extern const struct TrHillTag gUnknown_086294CC; +#include "data/battle_frontier/trainer_hill.h" struct { @@ -246,10 +245,10 @@ static const u8 sRecordWinColors[] = {0, 2, 3}; static const struct TrHillTag *const sDataPerTag[] = { - &gUnknown_08626814, - &gUnknown_086276FC, - &gUnknown_086285E4, - &gUnknown_086294CC, + &sDataTagNormal, + &sDataTagVariety, + &sDataTagUnique, + &sDataTagExpert, }; // Unused. diff --git a/sym_ewram.txt b/sym_ewram.txt index 7b5b6663e..9e836d0fe 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -153,21 +153,8 @@ gUnknown_02039B6E: @ 2039B6E gUnknown_02039B88: @ 2039B88 .space 0x160 -gUnknown_02039CE8: @ 2039CE8 - .space 0x4 - -gUnknown_02039CEC: @ 2039CEC - .space 0x4 - -gUnknown_02039CF0: @ 2039CF0 - .space 0x4 - -gUnknown_02039CF4: @ 2039CF4 - .space 0x4 - -gUnknown_02039CF8: @ 2039CF8 - .space 0x8 - + .include "src/trainer_card.o" + .include "src/frontier_pass.o" .include "src/pokemon_storage_system.o" .include "src/script_movement.o" .include "src/fldeff_cut.o"