fix merge conflicts

This commit is contained in:
camthesaxman 2017-12-05 12:42:30 -06:00
commit 19fbf024ff
100 changed files with 3456 additions and 5378 deletions

View File

@ -5,8 +5,8 @@
.text
thumb_func_start sub_80A5C6C
sub_80A5C6C: @ 80A5C6C
thumb_func_start GetBankPosition
GetBankPosition: @ 80A5C6C
push {r4,r5,lr}
lsls r0, 24
lsrs r5, r0, 24
@ -154,7 +154,7 @@ _080A5DB0:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80A5C6C
thumb_func_end GetBankPosition
thumb_func_start sub_80A5DB8
sub_80A5DB8: @ 80A5DB8
@ -577,7 +577,7 @@ _080A611C:
_080A6126:
adds r0, r4, 0
adds r1, r5, 0
bl sub_80A5C6C
bl GetBankPosition
_080A612E:
lsls r0, 24
lsrs r0, 24
@ -592,7 +592,7 @@ GetBankSpriteDefault_Y: @ 80A6138
lsls r0, 24
lsrs r0, 24
movs r1, 0x4
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
pop {r1}
@ -611,7 +611,7 @@ GetSubstituteSpriteDefault_Y: @ 80A614C
beq _080A6170
adds r0, r4, 0
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 8
movs r1, 0x80
@ -620,7 +620,7 @@ GetSubstituteSpriteDefault_Y: @ 80A614C
_080A6170:
adds r0, r4, 0
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 8
movs r1, 0x88
@ -642,7 +642,7 @@ sub_80A6190: @ 80A6190
lsrs r5, r0, 24
adds r0, r5, 0
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r6, r0, 24
bl IsContest
@ -1245,13 +1245,13 @@ sub_80A65EC: @ 80A65EC
ldr r5, =gAnimBankTarget
ldrb r0, [r5]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x32]
ldrb r0, [r5]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x36]
@ -1442,13 +1442,13 @@ sub_80A6760: @ 80A6760
ldr r5, =gAnimBankAttacker
ldrb r0, [r5]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x32]
ldrb r0, [r5]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x36]
@ -1550,13 +1550,13 @@ sub_80A6838: @ 80A6838
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x20]
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x22]
@ -1578,13 +1578,13 @@ sub_80A6864: @ 80A6864
ldr r7, =gAnimBankAttacker
ldrb r0, [r7]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r6, r0, 24
ldr r0, =gAnimBankTarget
ldrb r0, [r0]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
cmp r6, r0
@ -1646,8 +1646,8 @@ sub_80A68D4: @ 80A68D4
bx r0
thumb_func_end sub_80A68D4
thumb_func_start sub_80A6900
sub_80A6900: @ 80A6900
thumb_func_start AnimateBallThrow
AnimateBallThrow: @ 80A6900
push {r4,lr}
adds r4, r0, 0
bl sub_80A6F3C
@ -1674,7 +1674,7 @@ _080A692E:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_80A6900
thumb_func_end AnimateBallThrow
thumb_func_start sub_80A6934
sub_80A6934: @ 80A6934
@ -3685,7 +3685,7 @@ _080A785C:
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r1, [r6, 0x4]
@ -3693,7 +3693,7 @@ _080A785C:
strh r0, [r5, 0x32]
ldrb r0, [r4]
adds r1, r7, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r6, [r6, 0x6]
@ -3733,7 +3733,7 @@ _080A78CC:
ldr r5, =gAnimBankTarget
ldrb r0, [r5]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r1, [r4, 0x4]
@ -3741,7 +3741,7 @@ _080A78CC:
strh r0, [r6, 0x32]
ldrb r0, [r5]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r1, [r4, 0x6]
@ -3763,7 +3763,7 @@ _080A78CC:
sub_80A791C: @ 80A791C
push {r4,lr}
adds r4, r0, 0
bl sub_80A6900
bl AnimateBallThrow
lsls r0, 24
cmp r0, 0
beq _080A7930
@ -3828,7 +3828,7 @@ _080A798E:
strh r0, [r5, 0x2E]
adds r0, r6, 0
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r2, [r4, 0x4]
@ -3836,7 +3836,7 @@ _080A798E:
strh r0, [r5, 0x32]
adds r0, r6, 0
adds r1, r7, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r4, [r4, 0x6]
@ -5713,7 +5713,7 @@ _080A88A6:
_080A88AE:
mov r0, r8
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrb r1, [r4]
@ -5722,7 +5722,7 @@ _080A88AE:
_080A88C0:
mov r0, r8
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrb r1, [r4]
@ -5731,7 +5731,7 @@ _080A88C0:
_080A88D2:
mov r0, r8
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrb r2, [r4]
@ -5744,7 +5744,7 @@ _080A88E4:
_080A88EA:
mov r0, r8
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrb r2, [r4]
@ -5757,7 +5757,7 @@ _080A88FC:
_080A8902:
mov r0, r8
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r0, 0x1F
@ -5798,13 +5798,13 @@ _080A8942:
_080A8946:
adds r0, r4, 0
adds r1, r5, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
mov r8, r0
adds r0, r4, 0
adds r1, r6, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r7, r0, 24
bl IsDoubleBattle
@ -5819,12 +5819,12 @@ _080A8946:
eors r4, r0
adds r0, r4, 0
adds r1, r5, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r5, r0, 24
adds r0, r4, 0
adds r1, r6, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r3, r0, 24
mov r0, r8
@ -6392,13 +6392,13 @@ sub_80A8E30: @ 80A8E30
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x20]
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x22]

View File

@ -334,7 +334,7 @@ sub_80A9EF4: @ 80A9EF4
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 8
ldr r1, =0xffe00000
@ -342,7 +342,7 @@ sub_80A9EF4: @ 80A9EF4
lsrs r5, r0, 16
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 8
ldr r1, =0xffdc0000

File diff suppressed because it is too large Load Diff

View File

@ -90,7 +90,7 @@ sub_815A160: @ 815A160
ldr r6, =gAnimBankTarget
ldrb r0, [r6]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
lsls r4, 24
lsrs r4, 8
@ -100,7 +100,7 @@ sub_815A160: @ 815A160
asrs r4, 16
ldrb r0, [r6]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 8
@ -210,13 +210,13 @@ sub_815A254: @ 815A254
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r7, r0, 0
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r6, r0, 0
@ -816,7 +816,7 @@ _0815A6F8:
sub_815A73C: @ 815A73C
push {r4,lr}
adds r4, r0, 0
bl sub_80A6900
bl AnimateBallThrow
lsls r0, 24
cmp r0, 0
beq _0815A75E
@ -1254,13 +1254,13 @@ sub_815AAA4: @ 815AAA4
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x20]
ldrb r0, [r4]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x22]
@ -1510,7 +1510,7 @@ _0815ACEC:
_0815ACEE:
ldrb r0, [r4]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r6, [r6, 0x2]
@ -1518,7 +1518,7 @@ _0815ACEE:
strh r0, [r5, 0x20]
ldrb r0, [r4]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x22]
@ -1906,13 +1906,13 @@ sub_815AFF0: @ 815AFF0
ldr r6, =gAnimBankAttacker
ldrb r0, [r6]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0xC]
ldrb r0, [r6]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0xE]
@ -2281,13 +2281,13 @@ _0815B2D8:
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x32]
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x36]
@ -2373,13 +2373,13 @@ _0815B3BE:
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x20]
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x22]
@ -2817,7 +2817,7 @@ _0815B71E:
ldr r0, =gAnimBankAttacker
ldrb r0, [r0]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x32]
@ -3624,14 +3624,14 @@ _0815BE2E:
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r0, r5
strh r0, [r7, 0x20]
ldrb r0, [r4]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r0, 0x20
@ -4994,13 +4994,13 @@ sub_815C95C: @ 815C95C
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x20]
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x22]
@ -5531,13 +5531,13 @@ sub_815CDB4: @ 815CDB4
ldr r5, =gAnimBankAttacker
ldrb r0, [r5]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x20]
ldrb r0, [r5]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x22]
@ -5842,13 +5842,13 @@ _0815D05A:
ldr r5, =gAnimBankAttacker
ldrb r0, [r5]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
ldrb r0, [r5]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
mov r2, r10
lsls r1, r2, 16
@ -6840,7 +6840,7 @@ _0815D896:
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r1, [r6, 0x2]
@ -6848,7 +6848,7 @@ _0815D896:
strh r0, [r5, 0x20]
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r6, [r6, 0x4]
@ -7382,13 +7382,13 @@ _0815DCEA:
ldrb r4, [r0]
adds r0, r4, 0
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x10]
adds r0, r4, 0
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x12]
@ -7789,7 +7789,7 @@ sub_815E01C: @ 815E01C
_0815E038:
ldrb r0, [r6]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
ldr r4, =gBattleAnimArgs
lsrs r0, 24
@ -7798,7 +7798,7 @@ _0815E038:
strh r0, [r5, 0x20]
ldrb r0, [r6]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r1, [r4, 0x2]
@ -7931,7 +7931,7 @@ _0815E14E:
bne _0815E188
ldrb r0, [r5]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
ldrb r0, [r5]
movs r1, 0
@ -7951,7 +7951,7 @@ _0815E17C:
_0815E188:
ldrb r0, [r5]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
ldrb r0, [r5]
movs r1, 0
@ -7971,7 +7971,7 @@ _0815E1AC:
ldr r5, =gAnimBankAttacker
ldrb r0, [r5]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
ldrb r0, [r5]
movs r1, 0
@ -7990,13 +7990,13 @@ _0815E1D0:
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r6, 0x22]
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r6, 0x24]
@ -8349,14 +8349,14 @@ sub_815E47C: @ 815E47C
mov r10, r0
ldrb r0, [r0]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r7, 0x1E]
mov r1, r10
ldrb r0, [r1]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r7, 0x20]
@ -8364,14 +8364,14 @@ sub_815E47C: @ 815E47C
mov r8, r0
ldrb r0, [r0]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r7, 0x22]
mov r1, r8
ldrb r0, [r1]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
mov r1, r8
ldrb r0, [r1]
@ -8524,7 +8524,7 @@ _0815E5FE:
lsls r0, 2
ldr r1, =gSprites
adds r0, r1
bl sub_80A6900
bl AnimateBallThrow
ldrh r0, [r4, 0xC]
adds r0, 0x1
strh r0, [r4, 0xC]
@ -8542,7 +8542,7 @@ _0815E634:
lsls r0, 2
ldr r1, =gSprites
adds r0, r1
bl sub_80A6900
bl AnimateBallThrow
lsls r0, 24
cmp r0, 0
beq _0815E6D2
@ -8659,7 +8659,7 @@ _0815E724:
strh r1, [r4, 0x3C]
adds r0, r5, 0
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x22]
@ -8950,7 +8950,7 @@ _0815E970:
_0815E972:
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x20]
@ -9342,7 +9342,7 @@ sub_815EC48: @ 815EC48
ldr r5, =gAnimBankAttacker
ldrb r0, [r5]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@ -9350,7 +9350,7 @@ sub_815EC48: @ 815EC48
movs r0, 0x2
eors r0, r1
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -9771,14 +9771,14 @@ _0815EFEC:
lsls r0, 24
lsrs r0, 24
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r5, r0, 24
ldrh r0, [r4, 0x3C]
lsls r0, 24
lsrs r0, 24
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r1, r0, 24
_0815F00C:
@ -9994,10 +9994,10 @@ sub_815F18C: @ 815F18C
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
ldrb r0, [r4]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
ldrb r0, [r4]
bl GetBankSide
lsls r0, 24
@ -10387,7 +10387,7 @@ _0815F4C8:
ldr r0, =gAnimBankTarget
ldrb r0, [r0]
movs r1, 0x3
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x22]
@ -11180,7 +11180,7 @@ _0815FB50:
ldr r0, =gAnimBankTarget
ldrb r0, [r0]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
lsls r3, r5, 16
@ -11318,7 +11318,7 @@ _0815FC56:
ldr r0, =gAnimBankTarget
ldrb r0, [r0]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -11331,7 +11331,7 @@ _0815FCB4:
ldr r0, =gAnimBankTarget
ldrb r0, [r0]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -11469,7 +11469,7 @@ _0815FD8C:
mov r1, r10
ldrb r0, [r1]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r3, r5, 0
@ -11499,7 +11499,7 @@ _0815FE0C:
mov r2, r10
ldrb r0, [r2]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r3, r5, 0
@ -11566,7 +11566,7 @@ _0815FE92:
ldr r0, =gAnimBankTarget
ldrb r0, [r0]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r0, 0x10
@ -11724,14 +11724,14 @@ _08160008:
ldr r0, =gAnimBankAttacker
ldrb r0, [r0]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r5, r0, 0
ldr r0, =gAnimBankTarget
ldrb r0, [r0]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
adds r2, r0, 0
@ -12169,7 +12169,7 @@ sub_81603A8: @ 81603A8
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
movs r1, 0x2
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x20]

View File

@ -886,7 +886,7 @@ _08170C08:
bl GetMonData
lsls r0, 16
lsrs r0, 16
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
lsls r0, 24
lsrs r0, 24
mov r8, r0
@ -907,13 +907,13 @@ _08170C44:
ldr r5, =gAnimBankAttacker
ldrb r0, [r5]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
ldrb r0, [r5]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
adds r1, r0, 0
lsls r1, 24
ldr r2, =gSprites
@ -934,7 +934,7 @@ _08170C44:
mov r0, r8
str r0, [sp]
adds r0, r4, 0
bl sub_8171D98
bl LaunchBallStarsTask
lsls r0, 24
lsrs r0, 24
strh r0, [r6, 0x1C]
@ -950,7 +950,7 @@ _08170C44:
ldrb r1, [r5]
movs r0, 0
mov r3, r8
bl sub_81729E8
bl LaunchBallFadeMonTask
lsls r0, 24
lsrs r0, 24
strh r0, [r6, 0x1E]
@ -998,10 +998,10 @@ sub_8170CFC: @ 8170CFC
lsrs r4, 24
ldr r0, =gLastUsedItem
ldrh r0, [r0]
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
lsls r0, 24
lsrs r0, 24
bl sub_8076A78
bl LoadBallGfx
adds r0, r4, 0
bl DestroyAnimVisualTask
pop {r4}
@ -1018,10 +1018,10 @@ sub_8170D24: @ 8170D24
lsrs r4, 24
ldr r0, =gLastUsedItem
ldrh r0, [r0]
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
lsls r0, 24
lsrs r0, 24
bl sub_8076AE8
bl FreeBallGfx
adds r0, r4, 0
bl DestroyAnimVisualTask
pop {r4}
@ -1057,8 +1057,8 @@ _08170D74:
.pool
thumb_func_end sub_8170D4C
thumb_func_start ball_number_to_ball_processing_index
ball_number_to_ball_processing_index: @ 8170D84
thumb_func_start ItemIdToBallId
ItemIdToBallId: @ 8170D84
push {lr}
lsls r0, 16
lsrs r0, 16
@ -1123,7 +1123,7 @@ _08170DFC:
_08170DFE:
pop {r1}
bx r1
thumb_func_end ball_number_to_ball_processing_index
thumb_func_end ItemIdToBallId
thumb_func_start sub_8170E04
sub_8170E04: @ 8170E04
@ -1138,14 +1138,14 @@ sub_8170E04: @ 8170E04
mov r10, r0
ldr r0, =gLastUsedItem
ldrh r0, [r0]
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
lsls r0, r1, 1
adds r0, r1
lsls r0, 3
ldr r1, =gUnknown_0832C588
ldr r1, =gBallSpriteTemplates
adds r0, r1
movs r1, 0x20
movs r2, 0x50
@ -1166,14 +1166,14 @@ sub_8170E04: @ 8170E04
mov r8, r2
ldrb r0, [r2]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r6, 0x30]
mov r1, r8
ldrb r0, [r1]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
subs r0, 0x10
@ -1278,7 +1278,7 @@ _08170F50:
_08170F54:
ldr r0, =gLastUsedItem
ldrh r0, [r0]
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@ -1294,7 +1294,7 @@ _08170F54:
lsls r0, r4, 1
adds r0, r4
lsls r0, 3
ldr r1, =gUnknown_0832C588
ldr r1, =gBallSpriteTemplates
adds r0, r1
adds r1, r6, 0
adds r1, 0x20
@ -1317,14 +1317,14 @@ _08170F54:
mov r8, r1
ldrb r0, [r1]
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r6, 0x30]
mov r1, r8
ldrb r0, [r1]
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
subs r0, 0x10
@ -1487,7 +1487,7 @@ sub_8171134: @ 8171134
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
bl sub_80A6900
bl AnimateBallThrow
lsls r0, 24
cmp r0, 0
beq _081711D2
@ -1532,7 +1532,7 @@ _08171188:
str r0, [r4, 0x1C]
ldr r0, =gLastUsedItem
ldrh r0, [r0]
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0xB
@ -1549,13 +1549,13 @@ _08171188:
str r5, [sp]
movs r2, 0x1
movs r3, 0x1C
bl sub_8171D98
bl LaunchBallStarsTask
ldr r0, =gAnimBankTarget
ldrb r1, [r0]
movs r0, 0
movs r2, 0xE
adds r3, r5, 0
bl sub_81729E8
bl LaunchBallFadeMonTask
_081711D2:
add sp, 0x4
pop {r4,r5}
@ -2671,7 +2671,7 @@ sub_8171AAC: @ 8171AAC
orrs r0, r1
strb r0, [r3]
adds r0, r4, 0
bl sub_80A6900
bl AnimateBallThrow
lsls r0, 24
cmp r0, 0
beq _08171ADC
@ -2697,7 +2697,7 @@ sub_8171AE4: @ 8171AE4
str r0, [r4, 0x1C]
ldr r0, =gLastUsedItem
ldrh r0, [r0]
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0xB
@ -2714,13 +2714,13 @@ sub_8171AE4: @ 8171AE4
str r5, [sp]
movs r2, 0x1
movs r3, 0x1C
bl sub_8171D98
bl LaunchBallStarsTask
ldr r0, =gAnimBankTarget
ldrb r1, [r0]
movs r0, 0x1
movs r2, 0xE
adds r3, r5, 0
bl sub_81729E8
bl LaunchBallFadeMonTask
_08171B36:
ldr r6, =gSprites
ldr r5, =gBankSpriteIds
@ -3007,8 +3007,8 @@ _08171D86:
.pool
thumb_func_end sub_8171D60
thumb_func_start sub_8171D98
sub_8171D98: @ 8171D98
thumb_func_start LaunchBallStarsTask
LaunchBallStarsTask: @ 8171D98
push {r4-r6,lr}
mov r6, r10
mov r5, r9
@ -3070,7 +3070,7 @@ sub_8171D98: @ 8171D98
pop {r1}
bx r1
.pool
thumb_func_end sub_8171D98
thumb_func_end LaunchBallStarsTask
thumb_func_start sub_8171E20
sub_8171E20: @ 8171E20
@ -4476,8 +4476,8 @@ _081729E2:
bx r0
thumb_func_end sub_8172944
thumb_func_start sub_81729E8
sub_81729E8: @ 81729E8
thumb_func_start LaunchBallFadeMonTask
LaunchBallFadeMonTask: @ 81729E8
push {r4-r7,lr}
mov r7, r9
mov r6, r8
@ -4563,7 +4563,7 @@ _08172A7E:
pop {r1}
bx r1
.pool
thumb_func_end sub_81729E8
thumb_func_end LaunchBallFadeMonTask
thumb_func_start sub_8172AB0
sub_8172AB0: @ 8172AB0
@ -5234,12 +5234,12 @@ _0817303A:
ldrb r0, [r4, 0x8]
mov r8, r0
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r5, r0, 24
mov r0, r8
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r2, r0, 24
movs r1, 0x1E
@ -5579,7 +5579,7 @@ sub_817330C: @ 817330C
lsls r0, 24
lsrs r0, 24
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
ldr r5, =gBattleAnimArgs
lsrs r0, 24
@ -5591,7 +5591,7 @@ sub_817330C: @ 817330C
lsls r0, 24
lsrs r0, 24
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
ldrh r5, [r5, 0x6]
@ -5652,7 +5652,7 @@ _081733C0:
sub_81733D4: @ 81733D4
push {r4,lr}
adds r4, r0, 0
bl sub_80A6900
bl AnimateBallThrow
lsls r0, 24
cmp r0, 0
beq _081733F6

View File

@ -13829,13 +13829,13 @@ sub_80DEA5C: @ 80DEA5C
strh r0, [r4, 0x26]
movs r0, 0x3
movs r1, 0
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x20]
movs r0, 0x3
movs r1, 0x1
bl sub_80A5C6C
bl GetBankPosition
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x22]

View File

@ -68,8 +68,8 @@ GPIOPortReadEnable: @ 80000C8
.4byte gAbilityDescriptionPointers
.4byte gItems
.4byte gBattleMoves
.4byte gUnknown_0832C400
.4byte gUnknown_0832C460
.4byte gBallSpriteSheets
.4byte gBallSpritePalettes
.4byte 0x000000a8, 0x00000864, 0x0000089b

View File

@ -1,323 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_80F9568
sub_80F9568: @ 80F9568
push {lr}
movs r1, 0x41
bl GetMonData
lsls r0, 16
lsrs r1, r0, 16
cmp r1, 0
beq _080F9580
movs r0, 0xCE
lsls r0, 1
cmp r1, r0
bne _080F9584
_080F9580:
movs r0, 0
b _080F9586
_080F9584:
movs r0, 0x1
_080F9586:
pop {r1}
bx r1
thumb_func_end sub_80F9568
thumb_func_start sub_80F958C
sub_80F958C: @ 80F958C
push {r4,r5,lr}
ldr r4, =gPlayerParty
movs r5, 0
_080F9592:
adds r0, r4, 0
bl sub_80F9568
cmp r0, 0
beq _080F95B0
adds r0, r4, 0
movs r1, 0x39
bl GetMonData
cmp r0, 0
beq _080F95B0
movs r0, 0
b _080F95BA
.pool
_080F95B0:
adds r5, 0x1
adds r4, 0x64
cmp r5, 0x5
ble _080F9592
movs r0, 0x1
_080F95BA:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80F958C
thumb_func_start sub_80F95C0
sub_80F95C0: @ 80F95C0
push {r4,r5,lr}
sub sp, 0x4
lsls r0, 24
lsrs r0, 24
movs r1, 0x64
adds r4, r0, 0
muls r4, r1
ldr r0, =gPlayerParty
adds r4, r0
movs r0, 0
str r0, [sp]
adds r0, r4, 0
movs r1, 0x7
bl AdjustFriendship
adds r0, r4, 0
movs r1, 0x37
mov r2, sp
bl SetMonData
ldr r5, =gStringVar1
adds r0, r4, 0
movs r1, 0x2
adds r2, r5, 0
bl GetMonData
adds r0, r5, 0
bl StringGetEnd10
add sp, 0x4
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_80F95C0
thumb_func_start sub_80F960C
sub_80F960C: @ 80F960C
push {r4,lr}
lsls r0, 24
lsrs r0, 24
movs r1, 0x64
muls r1, r0
ldr r0, =gPlayerParty
adds r4, r1, r0
adds r0, r4, 0
bl sub_80F9568
cmp r0, 0
beq _080F964C
adds r0, r4, 0
movs r1, 0x39
bl GetMonData
cmp r0, 0
bne _080F964C
adds r0, r4, 0
movs r1, 0x37
bl GetMonData
bl pokemon_ailments_get_primary
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _080F964C
movs r0, 0x1
b _080F964E
.pool
_080F964C:
movs r0, 0
_080F964E:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_80F960C
thumb_func_start sub_80F9654
sub_80F9654: @ 80F9654
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
lsls r0, r6, 2
adds r0, r6
lsls r0, 3
ldr r1, =gTasks + 0x8
adds r4, r0, r1
movs r0, 0
ldrsh r5, [r4, r0]
cmp r5, 0x1
beq _080F96AE
cmp r5, 0x1
bgt _080F967C
cmp r5, 0
beq _080F9682
b _080F9722
.pool
_080F967C:
cmp r5, 0x2
beq _080F96C0
b _080F9722
_080F9682:
ldrh r1, [r4, 0x2]
movs r2, 0x2
ldrsh r0, [r4, r2]
cmp r0, 0x5
bgt _080F96A8
_080F968C:
lsls r0, r1, 24
lsrs r0, 24
bl sub_80F960C
cmp r0, 0
bne _080F96FC
ldrh r0, [r4, 0x2]
adds r0, 0x1
strh r0, [r4, 0x2]
adds r1, r0, 0
lsls r0, 16
asrs r0, 16
cmp r0, 0x5
ble _080F968C
_080F96A8:
movs r0, 0x2
strh r0, [r4]
b _080F9722
_080F96AE:
bl IsFieldMessageBoxHidden
lsls r0, 24
cmp r0, 0
beq _080F9722
ldrh r0, [r4]
subs r0, 0x1
strh r0, [r4]
b _080F9722
_080F96C0:
bl sub_80F958C
adds r1, r0, 0
cmp r1, 0
beq _080F9714
bl InBattlePyramid
adds r4, r0, 0
bl InBattlePike
orrs r4, r0
lsls r4, 24
cmp r4, 0
bne _080F96E6
bl sub_81D5C18
lsls r0, 24
cmp r0, 0
beq _080F96F0
_080F96E6:
ldr r0, =gSpecialVar_Result
strh r5, [r0]
b _080F9718
.pool
_080F96F0:
ldr r1, =gSpecialVar_Result
movs r0, 0x1
strh r0, [r1]
b _080F9718
.pool
_080F96FC:
ldrb r0, [r4, 0x2]
bl sub_80F95C0
ldr r0, =gText_PkmnFainted3
bl ShowFieldMessage
ldrh r0, [r4]
adds r0, 0x1
strh r0, [r4]
b _080F9722
.pool
_080F9714:
ldr r0, =gSpecialVar_Result
strh r1, [r0]
_080F9718:
bl EnableBothScriptContexts
adds r0, r6, 0
bl DestroyTask
_080F9722:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_80F9654
thumb_func_start sub_80F972C
sub_80F972C: @ 80F972C
push {lr}
ldr r0, =sub_80F9654
movs r1, 0x50
bl CreateTask
bl ScriptContext1_Stop
pop {r0}
bx r0
.pool
thumb_func_end sub_80F972C
thumb_func_start overworld_poison
overworld_poison: @ 80F9744
push {r4-r7,lr}
sub sp, 0x4
ldr r4, =gPlayerParty
movs r7, 0
movs r6, 0
movs r5, 0x5
_080F9750:
adds r0, r4, 0
movs r1, 0x5
bl GetMonData
cmp r0, 0
beq _080F9794
adds r0, r4, 0
movs r1, 0x37
bl GetMonData
bl pokemon_ailments_get_primary
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _080F9794
adds r0, r4, 0
movs r1, 0x39
bl GetMonData
str r0, [sp]
cmp r0, 0
beq _080F9786
subs r0, 0x1
str r0, [sp]
cmp r0, 0
bne _080F9788
_080F9786:
adds r6, 0x1
_080F9788:
adds r0, r4, 0
movs r1, 0x39
mov r2, sp
bl SetMonData
adds r7, 0x1
_080F9794:
adds r4, 0x64
subs r5, 0x1
cmp r5, 0
bge _080F9750
cmp r6, 0
bne _080F97A4
cmp r7, 0
beq _080F97A8
_080F97A4:
bl overworld_posion_effect
_080F97A8:
cmp r6, 0
beq _080F97B4
movs r0, 0x2
b _080F97BE
.pool
_080F97B4:
cmp r7, 0
bne _080F97BC
movs r0, 0
b _080F97BE
_080F97BC:
movs r0, 0x1
_080F97BE:
add sp, 0x4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end overworld_poison
.align 2, 0 @ Don't pad with nop.

View File

@ -2200,8 +2200,8 @@ _080FAE2A:
.pool
thumb_func_end sub_80FADE4
thumb_func_start task50_overworld_posion_effect
task50_overworld_posion_effect: @ 80FAE38
thumb_func_start task50_overworld_poison_effect
task50_overworld_poison_effect: @ 80FAE38
push {lr}
lsls r0, 24
lsrs r2, r0, 24
@ -2260,25 +2260,25 @@ _080FAE92:
_080FAEA2:
pop {r0}
bx r0
thumb_func_end task50_overworld_posion_effect
thumb_func_end task50_overworld_poison_effect
thumb_func_start overworld_posion_effect
overworld_posion_effect: @ 80FAEA8
thumb_func_start overworld_poison_effect
overworld_poison_effect: @ 80FAEA8
push {lr}
movs r0, 0x4F
bl PlaySE
ldr r0, =task50_overworld_posion_effect
ldr r0, =task50_overworld_poison_effect
movs r1, 0x50
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end overworld_posion_effect
thumb_func_end overworld_poison_effect
thumb_func_start c3_80A0DD8_is_running
c3_80A0DD8_is_running: @ 80FAEC0
push {lr}
ldr r0, =task50_overworld_posion_effect
ldr r0, =task50_overworld_poison_effect
bl FuncIsActiveTask
lsls r0, 24
lsrs r0, 24

View File

@ -422,10 +422,10 @@
.byte \bank
.endm
.macro switchinanim bank, param1
.macro switchinanim bank, dontclearsubstitutebit
.byte 0x4e
.byte \bank
.byte \param1
.byte \dontclearsubstitutebit
.endm
.macro jumpifcantswitch bank, param1
@ -1387,3 +1387,15 @@
.macro jumpifnostatus3 bank, status, jumpptr
jumpifstatus3condition \bank, \status, 0x1, \jumpptr
.endm
.macro jumpifmovehadnoeffect jumpptr
jumpifbyte COMMON_BITS, gBattleMoveFlags, MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED, \jumpptr
.endm
.macro jumpifbattletype flags, jumpptr
jumpifword COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
.endm
.macro jumpifnotbattletype flags, jumpptr
jumpifword NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
.endm

View File

@ -2215,7 +2215,7 @@ sub_8030A70: @ 8030A70
str r2, [sp, 0x10]
movs r2, 0x70
movs r3, 0x3A
bl sub_8076438
bl CreatePokeballSpriteToReleaseMon
lsls r0, r4, 2
adds r0, r4
lsls r0, 3

File diff suppressed because it is too large Load Diff

View File

@ -1424,16 +1424,16 @@ sub_81C4A08: @ 81C4A08
bl GetMonData
lsls r0, 16
lsrs r0, 16
bl ball_number_to_ball_processing_index
bl ItemIdToBallId
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
adds r0, r4, 0
bl sub_8076A78
bl LoadBallGfx
lsls r0, r4, 1
adds r0, r4
lsls r0, 3
ldr r1, =gUnknown_0832C588
ldr r1, =gBallSpriteTemplates
adds r0, r1
movs r1, 0x10
movs r2, 0x88

View File

@ -10445,7 +10445,7 @@ _0807CD1C:
str r2, [sp, 0x10]
movs r2, 0x78
movs r3, 0x54
bl sub_8076438
bl CreatePokeballSpriteToReleaseMon
ldr r0, [r7]
adds r0, 0xD3
ldrb r1, [r0]
@ -12550,7 +12550,7 @@ _0807E168:
str r2, [sp, 0x10]
movs r2, 0x78
movs r3, 0x54
bl sub_8076438
bl CreatePokeballSpriteToReleaseMon
ldr r0, [r7]
adds r0, 0xD3
ldrb r1, [r0]

View File

@ -18,7 +18,7 @@
.set ANIM_ITEM_STEAL, 0x10
.set ANIM_SNATCH_MOVE, 0x11
.set ANIM_FUTURE_SIGHT_HIT, 0x12
.set ANIM_x13, 0x13
.set ANIM_DOOM_DESIRE_HIT, 0x13
.set ANIM_x14, 0x14
.set ANIM_INGRAIN_HEAL, 0x15
.set ANIM_WISH_HEAL, 0x16
@ -146,8 +146,8 @@
.equiv sANIM_ARG2, gBattleScripting + 0x11
.equiv sTRIPLE_KICK_POWER, gBattleScripting + 0x12
.equiv sMOVEEND_STATE, gBattleScripting + 0x14
.equiv sFIELD_15, gBattleScripting + 0x15
.equiv sFIELD_16, gBattleScripting + 0x16
.equiv sBANK_WITH_ABILITY, gBattleScripting + 0x15
.equiv sMULTIHIT_EFFECT, gBattleScripting + 0x16
.equiv sBANK, gBattleScripting + 0x17
.equiv sANIM_TURN, gBattleScripting + 0x18
.equiv sANIM_TARGETS_HIT, gBattleScripting + 0x19

File diff suppressed because it is too large Load Diff

View File

@ -24,13 +24,13 @@ gBattlescriptsForBallThrow:: @ 82DBD08
.4byte BattleScript_BallThrow
.align 2
gUnknown_082DBD3C:: @ 82DBD3C
.4byte BattleScript_82DBE12
.4byte BattleScript_82DBE1C
.4byte BattleScript_82DBE1C
.4byte BattleScript_82DBE4B
.4byte BattleScript_82DBE6F
.4byte BattleScript_82DBE91
gBattlescriptsForUsingItem:: @ 82DBD3C
.4byte BattleScript_PlayerUsesItem
.4byte BattleScript_OpponentUsesHealItem
.4byte BattleScript_OpponentUsesHealItem
.4byte BattleScript_OpponentUsesStatusCureItem
.4byte BattleScript_OpponentUsesXItem
.4byte BattleScript_OpponentUsesGuardSpecs
.align 2
gBattlescriptsForRunningByItem:: @ 82DBD54
@ -58,27 +58,27 @@ BattleScript_SafariBallThrow::
handleballthrow
BattleScript_SuccessBallThrow::
jumpifhalfword EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_82DBD92
jumpifhalfword EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
incrementgamestat 0xB
BattleScript_82DBD92::
BattleScript_PrintCaughtMonInfo::
printstring STRINGID_GOTCHAPKMNCAUGHT
trysetcaughtmondexflags BattleScript_82DBDA5
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
printstring STRINGID_PKMNDATAADDEDTODEX
waitstate
setbyte gBattleCommunication, 0x0
displaydexinfo
BattleScript_82DBDA5::
BattleScript_TryNicknameCaughtMon::
printstring STRINGID_GIVENICKNAMECAPTURED
waitstate
setbyte gBattleCommunication, 0x0
trygivecaughtmonnick BattleScript_82DBDC2
trygivecaughtmonnick BattleScript_GiveCaughtMonEnd
givecaughtmon
printfromtable gCaughtMonStringIds
waitmessage 0x40
goto BattleScript_82DBDC3
BattleScript_82DBDC2::
goto BattleScript_SuccessBallThrowEnd
BattleScript_GiveCaughtMonEnd::
givecaughtmon
BattleScript_82DBDC3::
BattleScript_SuccessBallThrowEnd::
setbyte gBattleOutcome, CAUGHT
finishturn
@ -90,12 +90,12 @@ BattleScript_WallyBallThrow::
BattleScript_ShakeBallThrow::
printfromtable gBallEscapeStringIds
waitmessage 0x40
jumpifword NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_82DBE01
jumpifbyte NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_82DBE01
jumpifword NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
jumpifbyte NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd
printstring STRINGID_OUTOFSAFARIBALLS
waitmessage 0x40
setbyte gBattleOutcome, OUT_OF_BALLS
BattleScript_82DBE01::
BattleScript_ShakeBallThrowEnd::
finishaction
BattleScript_TrainerBallBlock::
@ -106,12 +106,12 @@ BattleScript_TrainerBallBlock::
waitmessage 0x40
finishaction
BattleScript_82DBE12::
BattleScript_PlayerUsesItem::
setbyte sMOVEEND_STATE, 0xF
moveend 0x1, 0x0
end
BattleScript_82DBE1C::
BattleScript_OpponentUsesHealItem::
printstring STRINGID_EMPTYSTRING3
pause 0x30
playse SE_KAIFUKU
@ -128,7 +128,7 @@ BattleScript_82DBE1C::
moveend 0x1, 0x0
finishaction
BattleScript_82DBE4B::
BattleScript_OpponentUsesStatusCureItem::
printstring STRINGID_EMPTYSTRING3
pause 0x30
playse SE_KAIFUKU
@ -142,7 +142,7 @@ BattleScript_82DBE4B::
moveend 0x1, 0x0
finishaction
BattleScript_82DBE6F::
BattleScript_OpponentUsesXItem::
printstring STRINGID_EMPTYSTRING3
pause 0x30
playse SE_KAIFUKU
@ -155,7 +155,7 @@ BattleScript_82DBE6F::
moveend 0x1, 0x0
finishaction
BattleScript_82DBE91::
BattleScript_OpponentUsesGuardSpecs::
printstring STRINGID_EMPTYSTRING3
pause 0x30
playse SE_KAIFUKU

View File

@ -16,12 +16,108 @@ gUnknown_08C00524:: @ 8C00524
.incbin "baserom.gba", 0xc00c10, 0xa34
gUnknown_08C01644:: @ 8C01644
.incbin "baserom.gba", 0xc01644, 0xE0
.incbin "baserom.gba", 0xc01644, 0xe0
gUnknown_08C01724:: @ 8C01724
.incbin "baserom.gba", 0xc01724, 0xBDC
.incbin "baserom.gba", 0xc01724, 0x18
gUnknown_08C02300:: @ 8C02300
.align 2
gInterfaceGfx_PokeBall::
.incbin "graphics/interface/ball/poke.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_PokeBall::
.incbin "graphics/interface/ball/poke.gbapal.lz"
.align 2
gInterfaceGfx_GreatBall::
.incbin "graphics/interface/ball/great.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_GreatBall::
.incbin "graphics/interface/ball/great.gbapal.lz"
.align 2
gInterfaceGfx_SafariBall::
.incbin "graphics/interface/ball/safari.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_SafariBall::
.incbin "graphics/interface/ball/safari.gbapal.lz"
.align 2
gInterfaceGfx_UltraBall::
.incbin "baserom.gba", 0xC019E0, 0xB4
.align 2
gInterfacePal_UltraBall::
.incbin "baserom.gba", 0xC01A94, 0x20
.align 2
gInterfaceGfx_MasterBall::
.incbin "graphics/interface/ball/master.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_MasterBall::
.incbin "graphics/interface/ball/master.gbapal.lz"
.align 2
gInterfaceGfx_NetBall::
.incbin "graphics/interface/ball/net.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_NetBall::
.incbin "graphics/interface/ball/net.gbapal.lz"
.align 2
gInterfaceGfx_DiveBall::
.incbin "graphics/interface/ball/dive.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_DiveBall::
.incbin "graphics/interface/ball/dive.gbapal.lz"
.align 2
gInterfaceGfx_NestBall::
.incbin "graphics/interface/ball/nest.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_NestBall::
.incbin "graphics/interface/ball/nest.gbapal.lz"
.align 2
gInterfaceGfx_RepeatBall::
.incbin "graphics/interface/ball/repeat.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_RepeatBall::
.incbin "graphics/interface/ball/repeat.gbapal.lz"
.align 2
gInterfaceGfx_TimerBall::
.incbin "graphics/interface/ball/timer.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_TimerBall::
.incbin "graphics/interface/ball/timer.gbapal.lz"
.align 2
gInterfaceGfx_LuxuryBall::
.incbin "graphics/interface/ball/luxury.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_LuxuryBall::
.incbin "graphics/interface/ball/luxury.gbapal.lz"
.align 2
gInterfaceGfx_PremierBall::
.incbin "graphics/interface/ball/premier.4bpp.lz" @ 0xBC
.align 2
gInterfacePal_PremierBall::
.incbin "graphics/interface/ball/premier.gbapal.lz"
gOpenPokeballGfx:: @ 8C02300
.incbin "baserom.gba", 0xc02300, 0x7c
gUnknown_08C0237C:: @ 8C0237C

View File

@ -1,14 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2, 0
gUnknown_0832C400:: @ 832C400
.incbin "baserom.gba", 0x32c400, 0x60
gUnknown_0832C460:: @ 832C460
.incbin "baserom.gba", 0x32c460, 0x128
gUnknown_0832C588:: @ 832C588
.incbin "baserom.gba", 0x32c588, 0x138

View File

@ -4,6 +4,9 @@
.section .rodata
.align 2, 0
gUnknown_0832C6A8:: @ 832C6A8
.incbin "baserom.gba", 0x32C6A8, 0x18
gUnknown_0832C6C0:: @ 832C6C0
.incbin "baserom.gba", 0x32c6c0, 0x1fe

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

View File

@ -86,8 +86,9 @@
#define BATTLE_FORFEITED 0x9
#define BATTLE_OPPONENT_TELEPORTED 0xA
#define BATTLE_OUTCOME_BIT_x80 0x80
#define OUTCOME_LINK_BATTLE_RUN 0x80
#define STATUS_NONE 0x0
#define STATUS_SLEEP 0x7
#define STATUS_POISON 0x8
#define STATUS_BURN 0x10
@ -615,10 +616,10 @@ struct BattleStruct
u8 focusPunchBank;
u8 field_49;
u8 moneyMultiplier;
u8 field_4B;
u8 savedTurnActionNumber;
u8 switchInAbilitiesCounter;
u8 field_4D;
u8 field_4E;
u8 faintedActionsState;
u8 faintedActionsBank;
u8 field_4F;
u16 expValue;
u8 field_52;
@ -690,8 +691,8 @@ struct BattleStruct
u8 field_182;
u8 field_183;
struct BattleEnigmaBerry battleEnigmaBerry;
u8 field_1A0;
u8 field_1A1;
u8 wishPerishSongState;
u8 wishPerishSongBank;
bool8 overworldWeatherDone;
u8 atkCancellerTracker;
u8 field_1A4[96];
@ -800,7 +801,7 @@ extern struct BattleStruct* gBattleStruct;
#define B_ANIM_ITEM_STEAL 0x10
#define B_ANIM_SNATCH_MOVE 0x11
#define B_ANIM_FUTURE_SIGHT_HIT 0x12
#define B_ANIM_x13 0x13
#define B_ANIM_DOOM_DESIRE_HIT 0x13
#define B_ANIM_x14 0x14
#define B_ANIM_INGRAIN_HEAL 0x15
#define B_ANIM_WISH_HEAL 0x16
@ -845,8 +846,8 @@ struct BattleScripting
u8 animArg2;
u16 tripleKickPower;
u8 atk49_state;
u8 field_15;
u8 field_16;
u8 bankWithAbility;
u8 multihitMoveEffect;
u8 bank;
u8 animTurn;
u8 animTargetsHit;
@ -932,7 +933,7 @@ struct BattleHealthboxInfo
u8 flag_x1 : 1;
u8 flag_x2 : 1;
u8 flag_x4 : 1;
u8 flag_x8 : 1;
u8 ballAnimActive : 1; // 0x8
u8 statusAnimActive : 1; // x10
u8 animFromTableActive : 1; // x20
u8 specialAnimActive : 1; //x40

View File

@ -79,11 +79,22 @@ void HandleIntroSlide(u8 terrainId);
// battle_anim_80A5C6C.s
void sub_80A6EEC(struct Sprite *sprite);
void sub_80A68D4(struct Sprite *sprite);
void sub_80A6F3C(struct Sprite *sprite);
void sub_80A8278(void);
void sub_80A6B30(struct UnknownAnimStruct2*);
void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1);
u8 sub_80A82E4(u8 bank);
u8 sub_80A5C6C(u8 bank, u8 attributeId);
bool8 AnimateBallThrow(struct Sprite *sprite);
enum
{
BANK_X_POS,
BANK_Y_POS,
};
u8 GetBankPosition(u8 bank, u8 attributeId);
bool8 IsBankSpritePresent(u8 bank);
void sub_80A6C68(u8 arg0);
u8 GetAnimBankSpriteId(u8 wantedBank);
@ -99,4 +110,9 @@ u8 GetSubstituteSpriteDefault_Y(u8 bank);
// battle_anim_80A9C70.s
void LaunchStatusAnimation(u8 bank, u8 statusAnimId);
// battle_anim_8170478.s
u8 ItemIdToBallId(u16 itemId);
u8 LaunchBallStarsTask(u8 x, u8 y, u8 kindOfStars, u8 arg3, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 bank, u32 arg2, u8 ballId);
#endif // GUARD_BATTLE_ANIM_H

View File

@ -5,5 +5,6 @@ void sub_81A8934(u8);
void sub_81A895C(void);
u16 sub_81A89A0(u8);
void sub_81A8AF8(void);
bool8 InBattlePike(void);
#endif // GUARD_BATTLE_FRONTIER_2_H

View File

@ -1,356 +1,22 @@
#ifndef GUARD_BATTLE_SCRIPTS_H
#define GUARD_BATTLE_SCRIPTS_H
extern const u8 BattleScript_EffectHit[];
extern const u8 BattleScript_HitFromAtkCanceler[];
extern const u8 BattleScript_HitFromAccCheck[];
extern const u8 BattleScript_HitFromAtkString[];
extern const u8 BattleScript_HitFromCritCalc[];
extern const u8 BattleScript_HitFromAtkAnimation[];
extern const u8 BattleScript_MoveEnd[];
extern const u8 BattleScript_MakeMoveMissed[];
extern const u8 BattleScript_PrintMoveMissed[];
extern const u8 BattleScript_MoveMissedPause[];
extern const u8 BattleScript_MoveMissed[];
extern const u8 BattleScript_EffectSleep[];
extern const u8 BattleScript_AlreadyAsleep[];
extern const u8 BattleScript_WasntAffected[];
extern const u8 BattleScript_CantMakeAsleep[];
extern const u8 BattleScript_EffectPoisonHit[];
extern const u8 BattleScript_EffectAbsorb[];
extern const u8 BattleScript_82D8B26[];
extern const u8 BattleScript_82D8B2E[];
extern const u8 BattleScript_82D8B45[];
extern const u8 BattleScript_EffectBurnHit[];
extern const u8 BattleScript_EffectFreezeHit[];
extern const u8 BattleScript_EffectParalyzeHit[];
extern const u8 BattleScript_EffectExplosion[];
extern const u8 BattleScript_82D8B94[];
extern const u8 BattleScript_82D8B96[];
extern const u8 BattleScript_82D8BCF[];
extern const u8 BattleScript_82D8BEA[];
extern const u8 BattleScript_EffectDreamEater[];
extern const u8 BattleScript_82D8C0E[];
extern const u8 BattleScript_82D8C18[];
extern const u8 BattleScript_82D8C56[];
extern const u8 BattleScript_EffectMirrorMove[];
extern const u8 BattleScript_EffectAttackUp[];
extern const u8 BattleScript_EffectDefenseUp[];
extern const u8 BattleScript_EffectSpecialAttackUp[];
extern const u8 BattleScript_EffectEvasionUp[];
extern const u8 BattleScript_EffectStatUp[];
extern const u8 BattleScript_EffectStatUpAfterAtkCanceler[];
extern const u8 BattleScript_StatUpAttackAnim[];
extern const u8 BattleScript_StatUpDoAnim[];
extern const u8 BattleScript_StatUpPrintString[];
extern const u8 BattleScript_StatUpEnd[];
extern const u8 BattleScript_StatUp[];
extern const u8 BattleScript_EffectAttackDown[];
extern const u8 BattleScript_EffectDefenseDown[];
extern const u8 BattleScript_EffectSpeedDown[];
extern const u8 BattleScript_EffectAccuracyDown[];
extern const u8 BattleScript_EffectEvasionDown[];
extern const u8 BattleScript_EffectStatDown[];
extern const u8 BattleScript_StatDownDoAnim[];
extern const u8 BattleScript_StatDownPrintString[];
extern const u8 BattleScript_82D8D60[];
extern const u8 BattleScript_StatDown[];
extern const u8 BattleScript_EffectHaze[];
extern const u8 BattleScript_EffectBide[];
extern const u8 BattleScript_EffectRampage[];
extern const u8 BattleScript_82D8DAE[];
extern const u8 BattleScript_EffectRoar[];
extern const u8 BattleScript_EffectMultiHit[];
extern const u8 BattleScript_82D8DFD[];
extern const u8 BattleScript_82D8E1F[];
extern const u8 BattleScript_82D8E71[];
extern const u8 BattleScript_82D8E74[];
extern const u8 BattleScript_82D8E93[];
extern const u8 BattleScript_EffectConversion[];
extern const u8 BattleScript_EffectFlinchHit[];
extern const u8 BattleScript_EffectRestoreHp[];
extern const u8 BattleScript_EffectToxic[];
extern const u8 BattleScript_AlreadyPoisoned[];
extern const u8 BattleScript_ImmunityProtected[];
extern const u8 BattleScript_EffectPayDay[];
extern const u8 BattleScript_EffectLightScreen[];
extern const u8 BattleScript_EffectTriAttack[];
extern const u8 BattleScript_EffectRest[];
extern const u8 BattleScript_RestCantSleep[];
extern const u8 BattleScript_RestIsAlreadyAsleep[];
extern const u8 BattleScript_EffectOHKO[];
extern const u8 BattleScript_KOFail[];
extern const u8 BattleScript_EffectRazorWind[];
extern const u8 BattleScript_TwoTurnMovesSecondTurn[];
extern const u8 BattleScriptFirstChargingTurn[];
extern const u8 BattleScript_EffectSuperFang[];
extern const u8 BattleScript_EffectDragonRage[];
extern const u8 BattleScript_EffectTrap[];
extern const u8 BattleScript_DoWrapEffect[];
extern const u8 BattleScript_EffectDoubleHit[];
extern const u8 BattleScript_EffectRecoilIfMiss[];
extern const u8 BattleScript_82D9135[];
extern const u8 BattleScript_EffectMist[];
extern const u8 BattleScript_EffectFocusEnergy[];
extern const u8 BattleScript_EffectRecoil[];
extern const u8 BattleScript_EffectConfuse[];
extern const u8 BattleScript_AlreadyConfused[];
extern const u8 BattleScript_EffectAttackUp2[];
extern const u8 BattleScript_EffectDefenseUp2[];
extern const u8 BattleScript_EffectSpeedUp2[];
extern const u8 BattleScript_EffectSpecialAttackUp2[];
extern const u8 BattleScript_EffectSpecialDefenseUp2[];
extern const u8 BattleScript_EffectTransform[];
extern const u8 BattleScript_EffectAttackDown2[];
extern const u8 BattleScript_EffectDefenseDown2[];
extern const u8 BattleScript_EffectSpeedDown2[];
extern const u8 BattleScript_EffectSpecialDefenseDown2[];
extern const u8 BattleScript_EffectReflect[];
extern const u8 BattleScript_PrintReflectLightScreenSafeguardString[];
extern const u8 BattleScript_EffectPoison[];
extern const u8 BattleScript_EffectParalyze[];
extern const u8 BattleScript_AlreadyParalyzed[];
extern const u8 BattleScript_LimberProtected[];
extern const u8 BattleScript_EffectAttackDownHit[];
extern const u8 BattleScript_EffectDefenseDownHit[];
extern const u8 BattleScript_EffectSpeedDownHit[];
extern const u8 BattleScript_EffectSpecialAttackDownHit[];
extern const u8 BattleScript_EffectSpecialDefenseDownHit[];
extern const u8 BattleScript_EffectAccuracyDownHit[];
extern const u8 BattleScript_EffectSkyAttack[];
extern const u8 BattleScript_EffectConfuseHit[];
extern const u8 BattleScript_EffectTwineedle[];
extern const u8 BattleScript_EffectSubstitute[];
extern const u8 BattleScript_SubstituteAnim[];
extern const u8 BattleScript_SubstituteString[];
extern const u8 BattleScript_AlreadyHasSubstitute[];
extern const u8 BattleScript_EffectRecharge[];
extern const u8 BattleScript_MoveUsedMustRecharge[];
extern const u8 BattleScript_EffectRage[];
extern const u8 BattleScript_RageMiss[];
extern const u8 BattleScript_EffectMimic[];
extern const u8 BattleScript_EffectMetronome[];
extern const u8 BattleScript_EffectLeechSeed[];
extern const u8 BattleScript_DoLeechSeed[];
extern const u8 BattleScript_EffectSplash[];
extern const u8 BattleScript_EffectDisable[];
extern const u8 BattleScript_EffectLevelDamage[];
extern const u8 BattleScript_EffectPsywave[];
extern const u8 BattleScript_EffectCounter[];
extern const u8 BattleScript_EffectEncore[];
extern const u8 BattleScript_EffectPainSplit[];
extern const u8 BattleScript_EffectSnore[];
extern const u8 BattleScript_SnoreIsAsleep[];
extern const u8 BattleScript_DoSnore[];
extern const u8 BattleScript_EffectConversion2[];
extern const u8 BattleScript_EffectLockOn[];
extern const u8 BattleScript_EffectSketch[];
extern const u8 BattleScript_EffectSleepTalk[];
extern const u8 BattleScript_SleepTalkIsAsleep[];
extern const u8 BattleScript_SleepTalkUsingMove[];
extern const u8 BattleScript_EffectDestinyBond[];
extern const u8 BattleScript_EffectFlail[];
extern const u8 BattleScript_EffectSpite[];
extern const u8 BattleScript_EffectHealBell[];
extern const u8 BattleScript_CheckHealBellMon2Unaffected[];
extern const u8 BattleScript_PartyHealEnd[];
extern const u8 BattleScript_EffectTripleKick[];
extern const u8 BattleScript_TripleKickLoop[];
extern const u8 BattleScript_DoTripleKickAttack[];
extern const u8 BattleScript_TripleKickNoMoreHits[];
extern const u8 BattleScript_TripleKickPrintStrings[];
extern const u8 BattleScript_TripleKickEnd[];
extern const u8 BattleScript_EffectThief[];
extern const u8 BattleScript_EffectMeanLook[];
extern const u8 BattleScript_EffectNightmare[];
extern const u8 BattleScript_NightmareWorked[];
extern const u8 BattleScript_EffectMinimize[];
extern const u8 BattleScript_EffectCurse[];
extern const u8 BattleScript_CurseTrySpeed[];
extern const u8 BattleScript_CurseTryAttack[];
extern const u8 BattleScript_CurseTryDefence[];
extern const u8 BattleScript_CurseEnd[];
extern const u8 BattleScript_GhostCurse[];
extern const u8 BattleScript_DoGhostCurse[];
extern const u8 BattleScript_EffectProtect[];
extern const u8 BattleScript_EffectSpikes[];
extern const u8 BattleScript_EffectForesight[];
extern const u8 BattleScript_EffectPerishSong[];
extern const u8 BattleScript_PerishSongLoop[];
extern const u8 BattleScript_PerishSongLoopIncrement[];
extern const u8 BattleScript_PerishSongNotAffected[];
extern const u8 BattleScript_EffectSandstorm[];
extern const u8 BattleScript_EffectRollout[];
extern const u8 BattleScript_RolloutCheckAccuracy[];
extern const u8 BattleScript_RolloutHit[];
extern const u8 BattleScript_EffectSwagger[];
extern const u8 BattleScript_SwaggerTryConfuse[];
extern const u8 BattleScript_EffectFuryCutter[];
extern const u8 BattleScript_FuryCutterHit[];
extern const u8 BattleScript_EffectAttract[];
extern const u8 BattleScript_EffectReturn[];
extern const u8 BattleScript_EffectPresent[];
extern const u8 BattleScript_EffectSafeguard[];
extern const u8 BattleScript_EffectThawHit[];
extern const u8 BattleScript_EffectMagnitude[];
extern const u8 BattleScript_EffectBatonPass[];
extern const u8 BattleScript_EffectRapidSpin[];
extern const u8 BattleScript_EffectSonicboom[];
extern const u8 BattleScript_EffectMorningSun[];
extern const u8 BattleScript_EffectHiddenPower[];
extern const u8 BattleScript_EffectRainDance[];
extern const u8 BattleScript_MoveWeatherChange[];
extern const u8 BattleScript_EffectSunnyDay[];
extern const u8 BattleScript_EffectDefenseUpHit[];
extern const u8 BattleScript_EffectAttackUpHit[];
extern const u8 BattleScript_EffectAllStatsUpHit[];
extern const u8 BattleScript_EffectBellyDrum[];
extern const u8 BattleScript_EffectPsychUp[];
extern const u8 BattleScript_EffectMirrorCoat[];
extern const u8 BattleScript_EffectSkullBash[];
extern const u8 BattleScript_SkullBashEnd[];
extern const u8 BattleScript_EffectTwister[];
extern const u8 BattleScript_FlinchEffect[];
extern const u8 BattleScript_EffectEarthquake[];
extern const u8 BattleScript_82D9C44[];
extern const u8 BattleScript_82D9C64[];
extern const u8 BattleScript_82D9C73[];
extern const u8 BattleScript_82D9CAC[];
extern const u8 BattleScript_EffectFutureSight[];
extern const u8 BattleScript_EffectGust[];
extern const u8 BattleScript_EffectStomp[];
extern const u8 BattleScript_EffectSolarbeam[];
extern const u8 BattleScript_SolarbeamDecideTurn[];
extern const u8 BattleScript_SolarbeamOnFirstTurn[];
extern const u8 BattleScript_EffectThunder[];
extern const u8 BattleScript_EffectTeleport[];
extern const u8 BattleScript_EffectBeatUp[];
extern const u8 BattleScript_BeatUpLoop[];
extern const u8 BattleScript_BeatUpAttack[];
extern const u8 BattleScript_BeatUpEnd[];
extern const u8 BattleScript_EffectSemiInvulnerable[];
extern const u8 BattleScript_FirstTurnBounce[];
extern const u8 BattleScript_FirstTurnDive[];
extern const u8 BattleScript_FirstTurnFly[];
extern const u8 BattleScript_FirstTurnSemiInvulnerable[];
extern const u8 BattleScript_SecondTurnSemiInvulnerable[];
extern const u8 BattleScript_SemiInvulnerableTryHit[];
extern const u8 BattleScript_SemiInvulnerableMiss[];
extern const u8 BattleScript_EffectDefenseCurl[];
extern const u8 BattleScript_DefenseCurlDoStatUpAnim[];
extern const u8 BattleScript_EffectSoftboiled[];
extern const u8 BattleScript_PresentHealTarget[];
extern const u8 BattleScript_AlreadyAtFullHp[];
extern const u8 BattleScript_EffectFakeOut[];
extern const u8 BattleScript_ButItFailedAtkStringPpReduce[];
extern const u8 BattleScript_ButItFailedPpReduce[];
extern const u8 BattleScript_ButItFailed[];
extern const u8 BattleScript_NotAffected[];
extern const u8 BattleScript_EffectUproar[];
extern const u8 BattleScript_UproarHit[];
extern const u8 BattleScript_EffectStockpile[];
extern const u8 BattleScript_EffectSpitUp[];
extern const u8 BattleScript_SpitUpFail[];
extern const u8 BattleScript_82D9FA2[];
extern const u8 BattleScript_EffectSwallow[];
extern const u8 BattleScript_SwallowFail[];
extern const u8 BattleScript_EffectHail[];
extern const u8 BattleScript_EffectTorment[];
extern const u8 BattleScript_EffectFlatter[];
extern const u8 BattleScript_FlatterTryConfuse[];
extern const u8 BattleScript_EffectWillOWisp[];
extern const u8 BattleScript_WaterVeilPrevents[];
extern const u8 BattleScript_AlreadyBurned[];
extern const u8 BattleScript_EffectMemento[];
extern const u8 BattleScript_82DA119[];
extern const u8 BattleScript_82DA13C[];
extern const u8 BattleScript_82DA148[];
extern const u8 BattleScript_82DA153[];
extern const u8 BattleScript_82DA15A[];
extern const u8 BattleScript_EffectFacade[];
extern const u8 BattleScript_FacadeDoubleDmg[];
extern const u8 BattleScript_EffectFocusPunch[];
extern const u8 BattleScript_EffectSmellingsalt[];
extern const u8 BattleScript_82DA1BA[];
extern const u8 BattleScript_EffectFollowMe[];
extern const u8 BattleScript_EffectNaturePower[];
extern const u8 BattleScript_EffectCharge[];
extern const u8 BattleScript_EffectTaunt[];
extern const u8 BattleScript_EffectHelpingHand[];
extern const u8 BattleScript_EffectTrick[];
extern const u8 BattleScript_EffectRolePlay[];
extern const u8 BattleScript_EffectWish[];
extern const u8 BattleScript_EffectAssist[];
extern const u8 BattleScript_EffectIngrain[];
extern const u8 BattleScript_EffectSuperpower[];
extern const u8 BattleScript_EffectMagicCoat[];
extern const u8 BattleScript_EffectRecycle[];
extern const u8 BattleScript_EffectRevenge[];
extern const u8 BattleScript_EffectBrickBreak[];
extern const u8 BattleScript_82DA306[];
extern const u8 BattleScript_82DA319[];
extern const u8 BattleScript_EffectYawn[];
extern const u8 BattleScript_82DA378[];
extern const u8 BattleScript_82DA382[];
extern const u8 BattleScript_EffectKnockOff[];
extern const u8 BattleScript_EffectEndeavor[];
extern const u8 BattleScript_EffectEruption[];
extern const u8 BattleScript_EffectSkillSwap[];
extern const u8 BattleScript_EffectImprison[];
extern const u8 BattleScript_EffectRefresh[];
extern const u8 BattleScript_EffectGrudge[];
extern const u8 BattleScript_EffectSnatch[];
extern const u8 BattleScript_EffectLowKick[];
extern const u8 BattleScript_EffectSecretPower[];
extern const u8 BattleScript_EffectDoubleEdge[];
extern const u8 BattleScript_EffectTeeterDance[];
extern const u8 BattleScript_82DA47B[];
extern const u8 BattleScript_82DA4C7[];
extern const u8 BattleScript_82DA4D0[];
extern const u8 BattleScript_82DA4E5[];
extern const u8 BattleScript_82DA4F3[];
extern const u8 BattleScript_82DA501[];
extern const u8 BattleScript_82DA50F[];
extern const u8 BattleScript_82DA520[];
extern const u8 BattleScript_EffectMudSport[];
extern const u8 BattleScript_EffectPoisonFang[];
extern const u8 BattleScript_EffectWeatherBall[];
extern const u8 BattleScript_EffectOverheat[];
extern const u8 BattleScript_EffectTickle[];
extern const u8 BattleScript_TickleDoMoveAnim[];
extern const u8 BattleScript_TickleTryLowerDef[];
extern const u8 BattleScript_TickleEnd[];
extern const u8 BattleScript_CantLowerMultipleStats[];
extern const u8 BattleScript_EffectCosmicPower[];
extern const u8 BattleScript_CosmicPowerDoMoveAnim[];
extern const u8 BattleScript_CosmicPowerTrySpDef[];
extern const u8 BattleScript_CosmicPowerEnd[];
extern const u8 BattleScript_EffectSkyUppercut[];
extern const u8 BattleScript_EffectBulkUp[];
extern const u8 BattleScript_BulkUpDoMoveAnim[];
extern const u8 BattleScript_BulkUpTryDef[];
extern const u8 BattleScript_BulkUpEnd[];
extern const u8 BattleScript_EffectCalmMind[];
extern const u8 BattleScript_CalmMindDoMoveAnim[];
extern const u8 BattleScript_CalmMindTrySpDef[];
extern const u8 BattleScript_CalmMindEnd[];
extern const u8 BattleScript_CantRaiseMultipleStats[];
extern const u8 BattleScript_EffectDragonDance[];
extern const u8 BattleScript_DragonDanceDoMoveAnim[];
extern const u8 BattleScript_DragonDanceTrySpeed[];
extern const u8 BattleScript_DragonDanceEnd[];
extern const u8 BattleScript_EffectCamouflage[];
extern const u8 BattleScript_StatUp[];
extern const u8 BattleScript_StatDown[];
extern const u8 BattleScript_AlreadyAtFullHp[];
extern const u8 BattleScript_PresentHealTarget[];
extern const u8 BattleScript_MoveUsedMustRecharge[];
extern const u8 BattleScript_FaintAttacker[];
extern const u8 BattleScript_FaintTarget[];
extern const u8 BattleScript_82DA7C4[];
extern const u8 BattleScript_82DA7CD[];
extern const u8 BattleScript_82DA816[];
extern const u8 BattleScript_82DA8D0[];
extern const u8 BattleScript_82DA8F5[];
extern const u8 BattleScript_82DA8F6[];
extern const u8 BattleScript_82DA8FC[];
extern const u8 BattleScript_82DA908[];
extern const u8 BattleScript_82DA92C[];
extern const u8 BattleScript_GiveExp[];
extern const u8 BattleScript_HandleFaintedMon[];
extern const u8 BattleScript_LocalTrainerBattleWon[];
extern const u8 BattleScript_LocalTwoTrainersDefeated[];
extern const u8 BattleScript_LocalBattleWonLoseTexts[];
@ -360,13 +26,9 @@ extern const u8 BattleScript_LocalBattleLost[];
extern const u8 BattleScript_LocalBattleLostPrintWhiteOut[];
extern const u8 BattleScript_LocalBattleLostEnd[];
extern const u8 BattleScript_CheckDomeDrew[];
extern const u8 BattleScript_LocalBattleLostPrintTrainersWinText[];
extern const u8 BattleScript_LocalBattleLostDoTrainer2WinText[];
extern const u8 BattleScript_LocalBattleLostEnd_[];
extern const u8 BattleScript_82DAA0B[];
extern const u8 BattleScript_82DAA31[];
extern const u8 BattleScript_LinkBattleWonOrLost[];
extern const u8 BattleScript_LinkBattleWonOrLostWaitEnd[];
extern const u8 BattleScript_82DAA5C[];
extern const u8 BattleScript_82DAA83[];
extern const u8 BattleScript_FrontierTrainerBattleWon[];
@ -390,17 +52,8 @@ extern const u8 BattleScript_82DAB77[];
extern const u8 BattleScript_82DABB8[];
extern const u8 BattleScript_Pausex20[];
extern const u8 BattleScript_LevelUp[];
extern const u8 BattleScript_TryLearnMoveLoop[];
extern const u8 BattleScript_AskToLearnMove[];
extern const u8 BattleScript_ForgotAndLearnedNewMove[];
extern const u8 BattleScript_LearnedNewMove[];
extern const u8 BattleScript_LearnMoveReturn[];
extern const u8 BattleScript_RainContinuesOrEnds[];
extern const u8 BattleScript_RainContinuesOrEndsEnd[];
extern const u8 BattleScript_DamagingWeatherContinues[];
extern const u8 BattleScript_DamagingWeatherLoop[];
extern const u8 BattleScript_DamagingWeatherLoopIncrement[];
extern const u8 BattleScript_DamagingWeatherContinuesEnd[];
extern const u8 BattleScript_SandStormHailEnds[];
extern const u8 BattleScript_SunlightContinues[];
extern const u8 BattleScript_SunlightFaded[];
@ -414,15 +67,15 @@ extern const u8 BattleScript_82DAD4D[];
extern const u8 BattleScript_BideStoringEnergy[];
extern const u8 BattleScript_BideAttack[];
extern const u8 BattleScript_BideNoEnergyToAttack[];
extern const u8 BattleScript_82DADD8[];
extern const u8 BattleScript_SuccessForceOut[];
extern const u8 BattleScript_82DADF1[];
extern const u8 BattleScript_MistProtected[];
extern const u8 BattleScript_RageIsBuilding[];
extern const u8 BattleScript_MoveUsedIsDisabled[];
extern const u8 BattleScript_SelectingDisabledMove[];
extern const u8 BattleScript_DisabledNoMore[];
extern const u8 BattleScript_82DAE2A[];
extern const u8 BattleScript_82DAE2D[];
extern const u8 BattleScript_SelectingDisabledMoveInPalace[];
extern const u8 BattleScript_SelectingUnusableMoveInPalace[];
extern const u8 BattleScript_EncoredNoMore[];
extern const u8 BattleScript_DestinyBondTakesLife[];
extern const u8 BattleScript_SpikesOnAttacker[];
@ -456,22 +109,20 @@ extern const u8 BattleScript_NoMovesLeft[];
extern const u8 BattleScript_SelectingMoveWithNoPP[];
extern const u8 BattleScript_NoPPForMove[];
extern const u8 BattleScript_SelectingTormentedMove[];
extern const u8 BattleScript_82DB08D[];
extern const u8 BattleScript_82DB098[];
extern const u8 BattleScript_MoveUsedIsTormented[];
extern const u8 BattleScript_SelectingTormentedMoveInPalace[];
extern const u8 BattleScript_SelectingNotAllowedMoveTaunt[];
extern const u8 BattleScript_MoveUsedIsTaunted[];
extern const u8 BattleScript_82DB0AF[];
extern const u8 BattleScript_SelectingNotAllowedMoveTauntInPalace[];
extern const u8 BattleScript_WishComesTrue[];
extern const u8 BattleScript_82DB0DE[];
extern const u8 BattleScript_IngrainTurnHeal[];
extern const u8 BattleScript_82DB109[];
extern const u8 BattleScript_AtkDefDown[];
extern const u8 BattleScript_82DB144[];
extern const u8 BattleScript_82DB167[];
extern const u8 BattleScript_KnockedOff[];
extern const u8 BattleScript_MoveUsedIsImprisoned[];
extern const u8 BattleScript_SelectingImprisionedMove[];
extern const u8 BattleScript_82DB185[];
extern const u8 BattleScript_SelectingImprisionedMoveInPalace[];
extern const u8 BattleScript_GrudgeTakesPp[];
extern const u8 BattleScript_MagicCoatBounce[];
extern const u8 BattleScript_SnatchedMove[];
@ -550,7 +201,6 @@ extern const u8 BattleScript_MonMadeMoveUseless_PPLoss[];
extern const u8 BattleScript_MonMadeMoveUseless[];
extern const u8 BattleScript_FlashFireBoost_PPLoss[];
extern const u8 BattleScript_FlashFireBoost[];
extern const u8 BattleScript_82DB5B9[];
extern const u8 BattleScript_AbilityNoStatLoss[];
extern const u8 BattleScript_BRNPrevention[];
extern const u8 BattleScript_PRLZPrevention[];
@ -612,8 +262,8 @@ extern const u8 BattleScript_82DB8F3[];
extern const u8 BattleScript_82DB973[];
extern const u8 BattleScript_82DB992[];
extern const u8 BattleScript_AskIfWantsToForfeitMatch[];
extern const u8 BattleScript_82DB9C1[];
extern const u8 BattleScript_82DB9C8[];
extern const u8 BattleScript_PrintPlayerForfeited[];
extern const u8 BattleScript_PrintPlayerForfeitedLinkBattle[];
extern const u8 BattleScript_BallThrow[];
extern const u8 BattleScript_BallThrowByWally[];
extern const u8 BattleScript_SafariBallThrow[];

View File

@ -66,8 +66,8 @@ bool8 AreAllMovesUnusable(void);
u8 GetImprisonedMovesCount(u8 bank, u16 move);
u8 UpdateTurnCounters(void);
u8 TurnBasedEffects(void);
bool8 sub_8041364(void);
bool8 sub_8041728(void);
bool8 HandleWishPerishSongOnTurnEnd(void);
bool8 HandleFaintedMonActions(void);
void TryClearRageStatuses(void);
u8 AtkCanceller_UnableToUseMove(void);
bool8 sub_80423F4(u8 bank, u8 r1, u8 r2);
@ -79,6 +79,6 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn);
void ClearFuryCutterDestinyBondGrudge(u8 bank);
void HandleAction_RunBattleScript(void);
u8 GetMoveTarget(u16 move, u8 useMoveTarget);
u8 IsPokeDisobedient(void);
u8 IsMonDisobedient(void);
#endif // GUARD_BATTLE_UTIL_H

19
include/field_poison.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef GUARD_FIELD_POISON_H
#define GUARD_FIELD_POISON_H
// Exported type declarations
// Exported RAM declarations
// Exported ROM declarations
enum {
FLDPSN_NONE,
FLDPSN_PSN,
FLDPSN_FNT
};
void sub_80F972C(void);
unsigned int overworld_poison(void);
#endif //GUARD_FIELD_POISON_H

View File

@ -9,5 +9,6 @@
void sub_80FA5E4(s16 id, s16 x, s16 y);
void sub_80FA794(s16 x, s16 y);
void overworld_poison_effect(void);
#endif //GUARD_FLDEFF_80F9BCC_H

View File

@ -5,6 +5,32 @@
#ifndef GUARD_GRAPHICS_H
#define GUARD_GRAPHICS_H
extern const u8 gInterfaceGfx_PokeBall[];
extern const u8 gInterfacePal_PokeBall[];
extern const u8 gInterfaceGfx_GreatBall[];
extern const u8 gInterfacePal_GreatBall[];
extern const u8 gInterfaceGfx_SafariBall[];
extern const u8 gInterfacePal_SafariBall[];
extern const u8 gInterfaceGfx_UltraBall[];
extern const u8 gInterfacePal_UltraBall[];
extern const u8 gInterfaceGfx_MasterBall[];
extern const u8 gInterfacePal_MasterBall[];
extern const u8 gInterfaceGfx_NetBall[];
extern const u8 gInterfacePal_NetBall[];
extern const u8 gInterfaceGfx_DiveBall[];
extern const u8 gInterfacePal_DiveBall[];
extern const u8 gInterfaceGfx_NestBall[];
extern const u8 gInterfacePal_NestBall[];
extern const u8 gInterfaceGfx_RepeatBall[];
extern const u8 gInterfacePal_RepeatBall[];
extern const u8 gInterfaceGfx_TimerBall[];
extern const u8 gInterfacePal_TimerBall[];
extern const u8 gInterfaceGfx_LuxuryBall[];
extern const u8 gInterfacePal_LuxuryBall[];
extern const u8 gInterfaceGfx_PremierBall[];
extern const u8 gInterfacePal_PremierBall[];
extern const u8 gOpenPokeballGfx[];
extern const u8 gItemIcon_QuestionMark[];
extern const u8 gItemIconPalette_QuestionMark[];
extern const u8 gUnknown_08DB7AA0[];

View File

@ -1,8 +1,18 @@
#ifndef GUARD_PARTY_MENU_H
#define GUARD_PARTY_MENU_H
enum {
AILMENT_NONE,
AILMENT_PSN,
AILMENT_PRZ,
AILMENT_SLP,
AILMENT_FRZ,
AILMENT_BRN
};
bool8 pokemon_has_move(struct Pokemon *, u16);
void sub_81B58A8(void);
void DoWallyTutorialBagMenu(void);
u8 pokemon_ailments_get_primary(u32 status);
#endif // GUARD_PARTY_MENU_H

View File

@ -1,8 +1,32 @@
#ifndef GUARD_POKEBALL_H
#define GUARD_POKEBALL_H
u8 sub_80753E8(u16, u8);
enum
{
BALL_POKE,
BALL_GREAT,
BALL_SAFARI,
BALL_ULTRA,
BALL_MASTER,
BALL_NET,
BALL_DIVE,
BALL_NEST,
BALL_REPEAT,
BALL_TIMER,
BALL_LUXURY,
BALL_PREMIER,
POKEBALL_COUNT
};
#define POKEBALL_PLAYER_SENDOUT 0xFF
#define POKEBALL_OPPONENT_SENDOUT 0xFE
u8 DoPokeballSendOutAnimation(s16 pan, u8 kindOfThrow);
void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 bank, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species);
u8 sub_807671C(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h);
void sub_8076918(u8 bank);
void DoHitAnimHealthboxEffect(u8 bank);
void LoadBallGfx(u8 ballId);
void FreeBallGfx(u8 ballId);
#endif // GUARD_POKEBALL_H

6
include/pokenav.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_POKENAV_H
#define GUARD_POKENAV_H
bool8 sub_81D5C18(void);
#endif //GUARD_POKENAV_H

View File

@ -1,5 +1,5 @@
#ifndef GUARD_RNG_H
#define GUARD_RNG_H
#ifndef GUARD_RANDOM_H
#define GUARD_RANDOM_H
extern u32 gRngValue;
extern u32 gRng2Value;
@ -15,4 +15,4 @@ u16 Random2(void);
void SeedRng(u16 seed);
void SeedRng2(u16 seed);
#endif // GUARD_RNG_H
#endif // GUARD_RANDOM_H

View File

@ -195,14 +195,7 @@ struct Sprite
/*0x2D*/ u8 animLoopCounter;
// general purpose data fields
/*0x2E*/ s16 data0;
/*0x30*/ s16 data1;
/*0x32*/ s16 data2;
/*0x34*/ s16 data3;
/*0x36*/ s16 data4;
/*0x38*/ s16 data5;
/*0x3A*/ s16 data6;
/*0x3C*/ s16 data7;
/*0x2E*/ s16 data[8];
/*0x3E*/ u16 inUse:1; //1
u16 coordOffsetEnabled:1; //2

View File

@ -82,6 +82,7 @@ extern const u8 gText_NoRegistry[];
extern const u8 gText_OkayToDeleteFromRegistry[];
extern const u8 gText_RegisteredDataDeleted[];
extern const u8 gUnknown_085EA79D[];
extern const u8 gText_PkmnFainted3[];
extern const u8 gText_Coins[];
#endif //GUARD_STRINGS_H

View File

@ -74,20 +74,20 @@ SECTIONS {
src/pokemon_3.o(.text);
asm/pokemon_3.o(.text);
src/trig.o(.text);
src/rng.o(.text);
src/random.o(.text);
src/util.o(.text);
src/blend_palette.o(.text);
src/daycare.o(.text);
src/egg_hatch.o(.text);
src/battle_interface.o(.text);
asm/smokescreen.o(.text);
asm/pokeball.o(.text);
src/pokeball.o(.text);
src/load_save.o(.text);
asm/trade.o(.text);
src/berry_blender.o(.text);
src/play_time.o(.text);
src/new_game.o(.text);
asm/rom4.o(.text);
asm/overworld.o(.text);
asm/fieldmap.o(.text);
src/metatile_behavior.o(.text);
asm/field_camera.o(.text);
@ -151,7 +151,7 @@ SECTIONS {
src/tv.o(.text);
asm/contest_link_80F57C4.o(.text);
asm/script_pokemon_util_80F87D8.o(.text);
asm/field_poison.o(.text);
src/field_poison.o(.text);
src/pokemon_size_record.o(.text);
asm/fldeff_80F9BCC.o(.text);
src/field_special_scene.o(.text);
@ -345,11 +345,11 @@ SECTIONS {
src/egg_hatch.o(.rodata);
src/battle_gfx_sfx_util.o(.rodata);
src/battle_interface.o(.rodata);
data/pokeball.o(.rodata);
src/pokeball.o(.rodata);
data/trade.o(.rodata);
src/berry_blender.o(.rodata);
src/new_game.o(.rodata);
data/rom4.o(.rodata);
data/overworld.o(.rodata);
data/tilesets.o(.rodata);
data/maps.o(.rodata);
data/fieldmap.o(.rodata);

View File

@ -25,7 +25,7 @@
#include "event_data.h"
#include "m4a.h"
#include "window.h"
#include "rng.h"
#include "random.h"
#include "songs.h"
#include "sound.h"
#include "battle_message.h"
@ -160,7 +160,7 @@ extern const u8 gStatStageRatios[][2];
extern const u8 * const gBattleScriptsForMoveEffects[];
extern const u8 * const gBattlescriptsForBallThrow[];
extern const u8 * const gBattlescriptsForRunningByItem[];
extern const u8 * const gUnknown_082DBD3C[];
extern const u8 * const gBattlescriptsForUsingItem[];
extern const u8 * const gBattlescriptsForSafariActions[];
// strings
@ -1620,7 +1620,7 @@ void CB2_QuitRecordedBattle(void)
void sub_8038528(struct Sprite* sprite)
{
sprite->data0 = 0;
sprite->data[0] = 0;
sprite->callback = sub_8038538;
}
@ -1628,42 +1628,42 @@ static void sub_8038538(struct Sprite *sprite)
{
u16 *arr = (u16*)(gDecompressionBuffer);
switch (sprite->data0)
switch (sprite->data[0])
{
case 0:
sprite->data0++;
sprite->data1 = 0;
sprite->data2 = 0x281;
sprite->data3 = 0;
sprite->data4 = 1;
sprite->data[0]++;
sprite->data[1] = 0;
sprite->data[2] = 0x281;
sprite->data[3] = 0;
sprite->data[4] = 1;
// fall through
case 1:
sprite->data4--;
if (sprite->data4 == 0)
sprite->data[4]--;
if (sprite->data[4] == 0)
{
s32 i;
s32 r2;
s32 r0;
sprite->data4 = 2;
r2 = sprite->data1 + sprite->data3 * 32;
r0 = sprite->data2 - sprite->data3 * 32;
sprite->data[4] = 2;
r2 = sprite->data[1] + sprite->data[3] * 32;
r0 = sprite->data[2] - sprite->data[3] * 32;
for (i = 0; i < 29; i += 2)
{
arr[r2 + i] = 0x3D;
arr[r0 + i] = 0x3D;
}
sprite->data3++;
if (sprite->data3 == 21)
sprite->data[3]++;
if (sprite->data[3] == 21)
{
sprite->data0++;
sprite->data1 = 32;
sprite->data[0]++;
sprite->data[1] = 32;
}
}
break;
case 2:
sprite->data1--;
if (sprite->data1 == 20)
sprite->data[1]--;
if (sprite->data[1] == 20)
SetMainCallback2(CB2_InitBattle);
break;
}
@ -1824,12 +1824,12 @@ void nullsub_17(void)
static void sub_8038B04(struct Sprite *sprite)
{
if (sprite->data0 != 0)
sprite->pos1.x = sprite->data1 + ((sprite->data2 & 0xFF00) >> 8);
if (sprite->data[0] != 0)
sprite->pos1.x = sprite->data[1] + ((sprite->data[2] & 0xFF00) >> 8);
else
sprite->pos1.x = sprite->data1 - ((sprite->data2 & 0xFF00) >> 8);
sprite->pos1.x = sprite->data[1] - ((sprite->data[2] & 0xFF00) >> 8);
sprite->data2 += 0x180;
sprite->data[2] += 0x180;
if (sprite->affineAnimEnded)
{
@ -2382,8 +2382,8 @@ u32 sub_80397C4(u32 setId, u32 tableId)
return gUnknown_0831ABA0[setId][tableId].width * 8;
}
#define tBank data0
#define tSpeciesId data2
#define tBank data[0]
#define tSpeciesId data[2]
void oac_poke_opponent(struct Sprite *sprite)
{
@ -2431,20 +2431,20 @@ void SpriteCallbackDummy_2(struct Sprite *sprite)
static void sub_80398BC(struct Sprite *sprite) // unused?
{
sprite->data3 = 6;
sprite->data4 = 1;
sprite->data[3] = 6;
sprite->data[4] = 1;
sprite->callback = sub_80398D0;
}
static void sub_80398D0(struct Sprite *sprite)
{
sprite->data4--;
if (sprite->data4 == 0)
sprite->data[4]--;
if (sprite->data[4] == 0)
{
sprite->data4 = 8;
sprite->data[4] = 8;
sprite->invisible ^= 1;
sprite->data3--;
if (sprite->data3 == 0)
sprite->data[3]--;
if (sprite->data[3] == 0)
{
sprite->invisible = FALSE;
sprite->callback = SpriteCallbackDummy_2;
@ -2495,8 +2495,8 @@ void sub_8039934(struct Sprite *sprite)
yOffset = gMonFrontPicCoords[species].y_offset;
}
sprite->data3 = 8 - yOffset / 8;
sprite->data4 = 1;
sprite->data[3] = 8 - yOffset / 8;
sprite->data[4] = 1;
sprite->callback = sub_8039A48;
}
@ -2504,20 +2504,20 @@ static void sub_8039A48(struct Sprite *sprite)
{
s32 i;
sprite->data4--;
if (sprite->data4 == 0)
sprite->data[4]--;
if (sprite->data[4] == 0)
{
sprite->data4 = 2;
sprite->data[4] = 2;
sprite->pos2.y += 8;
sprite->data3--;
if (sprite->data3 < 0)
sprite->data[3]--;
if (sprite->data[3] < 0)
{
FreeSpriteOamMatrix(sprite);
DestroySprite(sprite);
}
else
{
u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankIdentity(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data3 << 8);
u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankIdentity(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data[3] << 8);
for (i = 0; i < 0x100; i++)
*(dst++) = 0;
@ -2529,25 +2529,25 @@ static void sub_8039A48(struct Sprite *sprite)
void sub_8039AD8(struct Sprite *sprite)
{
sprite->data3 = 8;
sprite->data4 = sprite->invisible;
sprite->data[3] = 8;
sprite->data[4] = sprite->invisible;
sprite->callback = sub_8039AF4;
}
static void sub_8039AF4(struct Sprite *sprite)
{
sprite->data3--;
if (sprite->data3 == 0)
sprite->data[3]--;
if (sprite->data[3] == 0)
{
sprite->invisible ^= 1;
sprite->data3 = 8;
sprite->data[3] = 8;
}
}
void sub_8039B2C(struct Sprite *sprite)
{
sprite->invisible = sprite->data4;
sprite->data4 = FALSE;
sprite->invisible = sprite->data[4];
sprite->data[4] = FALSE;
sprite->callback = SpriteCallbackDummy_2;
}
@ -2577,7 +2577,7 @@ static void oac_poke_ally_(struct Sprite *sprite)
if (sprite->pos2.x == 0)
{
sprite->callback = SpriteCallbackDummy_3;
sprite->data1 = 0;
sprite->data[1] = 0;
}
}
}
@ -2595,8 +2595,8 @@ void sub_8039C00(struct Sprite *sprite)
{
if (!(gUnknown_020243FC & 1))
{
sprite->pos2.x += sprite->data1;
sprite->pos2.y += sprite->data2;
sprite->pos2.x += sprite->data[1];
sprite->pos2.y += sprite->data[2];
}
}
@ -2622,19 +2622,19 @@ void dp11b_obj_instanciate(u8 bank, u8 b, s8 c, s8 d)
spriteId2 = gHealthBoxesIds[bank];
gBattleSpritesDataPtr->healthBoxesData[bank].field_2 = bounceHealthBoxSpriteId;
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2 = 1;
gSprites[bounceHealthBoxSpriteId].data0 = 0x80;
gSprites[bounceHealthBoxSpriteId].data[0] = 0x80;
}
else
{
spriteId2 = gBankSpriteIds[bank];
gBattleSpritesDataPtr->healthBoxesData[bank].field_3 = bounceHealthBoxSpriteId;
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4 = 1;
gSprites[bounceHealthBoxSpriteId].data0 = 0xC0;
gSprites[bounceHealthBoxSpriteId].data[0] = 0xC0;
}
gSprites[bounceHealthBoxSpriteId].data1 = c;
gSprites[bounceHealthBoxSpriteId].data2 = d;
gSprites[bounceHealthBoxSpriteId].data3 = spriteId2;
gSprites[bounceHealthBoxSpriteId].data4 = b;
gSprites[bounceHealthBoxSpriteId].data[1] = c;
gSprites[bounceHealthBoxSpriteId].data[2] = d;
gSprites[bounceHealthBoxSpriteId].data[3] = spriteId2;
gSprites[bounceHealthBoxSpriteId].data[4] = b;
gSprites[spriteId2].pos2.x = 0;
gSprites[spriteId2].pos2.y = 0;
}
@ -2648,7 +2648,7 @@ void dp11b_obj_free(u8 bank, bool8 b)
if (!gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2)
return;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2].data3;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2].data[3];
DestroySprite(&gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2]);
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2 = 0;
}
@ -2657,7 +2657,7 @@ void dp11b_obj_free(u8 bank, bool8 b)
if (!gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4)
return;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3].data3;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3].data[3];
DestroySprite(&gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3]);
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4 = 0;
}
@ -2667,16 +2667,16 @@ void dp11b_obj_free(u8 bank, bool8 b)
static void SpriteCB_HealthBoxBounce(struct Sprite *sprite)
{
u8 spriteId = sprite->data3;
u8 spriteId = sprite->data[3];
s32 var;
if (sprite->data4 == 1)
var = sprite->data0;
if (sprite->data[4] == 1)
var = sprite->data[0];
else
var = sprite->data0;
var = sprite->data[0];
gSprites[spriteId].pos2.y = Sin(var, sprite->data2) + sprite->data2;
sprite->data0 = (sprite->data0 + sprite->data1) & 0xFF;
gSprites[spriteId].pos2.y = Sin(var, sprite->data[2]) + sprite->data[2];
sprite->data[0] = (sprite->data[0] + sprite->data[1]) & 0xFF;
}
void sub_8039E44(struct Sprite *sprite)
@ -2872,7 +2872,7 @@ void SwitchInClearSetData(void)
&& (gStatuses3[i] & STATUS3_ALWAYS_HITS) != 0
&& (gDisableStructs[i].bankWithSureHit == gActiveBank))
{
gStatuses3[i] &= ~STATUS3_ALWAYS_HITS;
gStatuses3[i] &= ~(STATUS3_ALWAYS_HITS);
gStatuses3[i] |= 0x10;
}
}
@ -3668,10 +3668,10 @@ static void TryDoEventsBeforeFirstTurn(void)
*(&gBattleStruct->turnEffectsTracker) = 0;
*(&gBattleStruct->turnEffectsBank) = 0;
*(&gBattleStruct->field_1A0) = 0;
*(&gBattleStruct->field_1A1) = 0;
*(&gBattleStruct->wishPerishSongState) = 0;
*(&gBattleStruct->wishPerishSongBank) = 0;
gBattleScripting.atk49_state = 0;
gBattleStruct->field_4D = 0;
gBattleStruct->faintedActionsState = 0;
gBattleStruct->turncountersTracker = 0;
gBattleMoveFlags = 0;
@ -3701,8 +3701,8 @@ static void HandleEndTurn_ContinueBattle(void)
}
gBattleStruct->turnEffectsTracker = 0;
gBattleStruct->turnEffectsBank = 0;
gBattleStruct->field_1A0 = 0;
gBattleStruct->field_1A1 = 0;
gBattleStruct->wishPerishSongState = 0;
gBattleStruct->wishPerishSongBank = 0;
gBattleStruct->turncountersTracker = 0;
gBattleMoveFlags = 0;
}
@ -3720,10 +3720,10 @@ void BattleTurnPassed(void)
if (TurnBasedEffects() != 0)
return;
}
if (sub_8041728() != 0)
if (HandleFaintedMonActions() != 0)
return;
gBattleStruct->field_4D = 0;
if (sub_8041364() != 0)
gBattleStruct->faintedActionsState = 0;
if (HandleWishPerishSongOnTurnEnd() != 0)
return;
TurnValuesCleanUp(FALSE);
@ -4692,7 +4692,7 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void)
gBattleMainFunc = RunTurnActionsFunctions;
gBattleCommunication[3] = 0;
gBattleCommunication[4] = 0;
gBattleScripting.field_16 = 0;
gBattleScripting.multihitMoveEffect = 0;
gBattleResources->battleScriptsStack->size = 0;
}
@ -4701,7 +4701,7 @@ static void RunTurnActionsFunctions(void)
if (gBattleOutcome != 0)
gCurrentActionFuncId = 12;
*(&gBattleStruct->field_4B) = gCurrentTurnActionNumber;
*(&gBattleStruct->savedTurnActionNumber) = gCurrentTurnActionNumber;
sTurnActionsFuncsTable[gCurrentActionFuncId]();
if (gCurrentTurnActionNumber >= gNoOfAllBanks) // everyone did their actions, turn finished
@ -4711,7 +4711,7 @@ static void RunTurnActionsFunctions(void)
}
else
{
if (gBattleStruct->field_4B != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another bank
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another bank
{
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
@ -4729,7 +4729,7 @@ static void HandleEndTurn_BattleWon(void)
gBattleTextBuff1[0] = gBattleOutcome;
gBankAttacker = GetBankByIdentity(IDENTITY_PLAYER_MON1);
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
gBattleOutcome &= ~(BATTLE_OUTCOME_BIT_x80);
gBattleOutcome &= ~(OUTCOME_LINK_BATTLE_RUN);
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_x4000000 | BATTLE_TYPE_EREADER_TRAINER))
@ -4785,16 +4785,16 @@ static void HandleEndTurn_BattleLost(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
if (gBattleOutcome & BATTLE_OUTCOME_BIT_x80)
if (gBattleOutcome & OUTCOME_LINK_BATTLE_RUN)
{
gBattlescriptCurrInstr = BattleScript_82DB9C8;
gBattleOutcome &= ~(BATTLE_OUTCOME_BIT_x80);
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeitedLinkBattle;
gBattleOutcome &= ~(OUTCOME_LINK_BATTLE_RUN);
gSaveBlock2Ptr->field_CA9_b = 1;
}
else
{
gBattlescriptCurrInstr = BattleScript_82DAA0B;
gBattleOutcome &= ~(BATTLE_OUTCOME_BIT_x80);
gBattleOutcome &= ~(OUTCOME_LINK_BATTLE_RUN);
}
}
else
@ -4802,7 +4802,7 @@ static void HandleEndTurn_BattleLost(void)
gBattleTextBuff1[0] = gBattleOutcome;
gBankAttacker = GetBankByIdentity(IDENTITY_PLAYER_MON1);
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
gBattleOutcome &= ~(BATTLE_OUTCOME_BIT_x80);
gBattleOutcome &= ~(OUTCOME_LINK_BATTLE_RUN);
}
}
else
@ -4819,13 +4819,13 @@ static void HandleEndTurn_RanFromBattle(void)
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER && gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{
gBattlescriptCurrInstr = BattleScript_82DB9C1;
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeited;
gBattleOutcome = BATTLE_FORFEITED;
gSaveBlock2Ptr->field_CA9_b = 1;
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
{
gBattlescriptCurrInstr = BattleScript_82DB9C1;
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeited;
gBattleOutcome = BATTLE_FORFEITED;
}
else
@ -5276,7 +5276,7 @@ static void HandleAction_UseItem(void)
}
else if (GetBankSide(gBankAttacker) == SIDE_PLAYER)
{
gBattlescriptCurrInstr = gUnknown_082DBD3C[0];
gBattlescriptCurrInstr = gBattlescriptsForUsingItem[0];
}
else
{
@ -5332,7 +5332,7 @@ static void HandleAction_UseItem(void)
break;
}
gBattlescriptCurrInstr = gUnknown_082DBD3C[*(gBattleStruct->AI_itemType + gBankAttacker / 2)];
gBattlescriptCurrInstr = gBattlescriptsForUsingItem[*(gBattleStruct->AI_itemType + gBankAttacker / 2)];
}
gCurrentActionFuncId = ACTION_RUN_BATTLESCRIPT;
}
@ -5439,7 +5439,7 @@ static void HandleAction_Run(void)
}
}
gBattleOutcome |= BATTLE_OUTCOME_BIT_x80;
gBattleOutcome |= OUTCOME_LINK_BATTLE_RUN;
gSaveBlock2Ptr->field_CA9_b = 1;
}
else
@ -5565,9 +5565,9 @@ static void HandleAction_Action9(void)
static void HandleAction_Action11(void)
{
if (!sub_8041728())
if (!HandleFaintedMonActions())
{
gBattleStruct->field_4D = 0;
gBattleStruct->faintedActionsState = 0;
gCurrentActionFuncId = ACTION_FINISHED;
}
}
@ -5607,6 +5607,6 @@ static void HandleAction_ActionFinished(void)
gBattleScripting.atk49_state = 0;
gBattleCommunication[3] = 0;
gBattleCommunication[4] = 0;
gBattleScripting.field_16 = 0;
gBattleScripting.multihitMoveEffect = 0;
gBattleResources->battleScriptsStack->size = 0;
}

View File

@ -4,7 +4,7 @@
#include "battle.h"
#include "species.h"
#include "constants/abilities.h"
#include "rng.h"
#include "random.h"
#include "item.h"
#include "constants/battle_move_effects.h"
#include "moves.h"
@ -12,7 +12,6 @@
#define AIScriptRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24)
#define AIScriptRead16(ptr) ((ptr)[0] | (ptr)[1] << 8)
#define AIScriptRead8(ptr) ((ptr)[0])
#define AIScriptReadPtr(ptr) (const u8*) AIScriptRead32(ptr)
#define AI_ACTION_DONE 0x0001

View File

@ -5,7 +5,7 @@
#include "moves.h"
#include "pokemon.h"
#include "species.h"
#include "rng.h"
#include "random.h"
#include "util.h"
#include "constants/items.h"
#include "pokemon_item_effects.h"

View File

@ -423,7 +423,7 @@ static void ScriptCmd_createsprite(void)
if (subpriority < 3)
subpriority = 3;
CreateSpriteAndAnimate(template, sub_80A5C6C(gAnimBankTarget, 2), sub_80A5C6C(gAnimBankTarget, 3), subpriority);
CreateSpriteAndAnimate(template, GetBankPosition(gAnimBankTarget, 2), GetBankPosition(gAnimBankTarget, 3), subpriority);
gAnimVisualTaskCount++;
}

View File

@ -310,14 +310,14 @@ static void sub_8064734(void)
{
bool32 r10 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x1)
{
sub_8172EF0(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]);
}
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].field_1_x1)
{
@ -325,7 +325,7 @@ static void sub_8064734(void)
}
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x80)
{
@ -465,18 +465,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
LinkOpponentBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -527,14 +527,14 @@ static void sub_8064E50(void)
static void sub_8064F40(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80)
{
sub_8172EF0(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBank]]);
SetBankEnemyShadowSpriteCallback(gActiveBank, GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES));
@ -1163,12 +1163,12 @@ static void LinkOpponentHandleLoadMonSprite(void)
sub_806A068(species, GetBankIdentity(gActiveBank));
gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(gActiveBank, 2),
GetBankPosition(gActiveBank, 2),
GetBankSpriteDefault_Y(gActiveBank),
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
@ -1197,15 +1197,15 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit)
gBankSpriteIds[bank] = CreateSprite(
&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1213,7 +1213,7 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFE);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
}
static void LinkOpponentHandleReturnMonToBall(void)
@ -1334,7 +1334,7 @@ static void LinkOpponentHandleDrawTrainerPic(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1357,7 +1357,7 @@ static void LinkOpponentHandleTrainerSlide(void)
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96;
gSprites[gBankSpriteIds[gActiveBank]].pos1.x += 32;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1369,9 +1369,9 @@ static void LinkOpponentHandleTrainerSlide(void)
static void LinkOpponentHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_8064470;
@ -1670,7 +1670,7 @@ static void LinkOpponentHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1731,9 +1731,9 @@ static void LinkOpponentHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_80676FC);

View File

@ -267,8 +267,8 @@ static void sub_814B004(void)
static void sub_814B0E8(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive
&& gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy
&& ++gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_9 != 1)
@ -352,18 +352,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
LinkPartnerBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -412,13 +412,13 @@ static void sub_814B5A8(void)
static void sub_814B69C(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
sub_8172EF0(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBank]]);
gBattleBankFunc[gActiveBank] = sub_814B5A8;
@ -1049,11 +1049,11 @@ static void LinkPartnerHandleLoadMonSprite(void)
sub_806A068(species, GetBankIdentity(gActiveBank));
gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(gActiveBank, 2),
GetBankPosition(gActiveBank, 2),
GetBankSpriteDefault_Y(gActiveBank),
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
gBattleBankFunc[gActiveBank] = sub_814B290;
@ -1080,15 +1080,15 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit)
gBankSpriteIds[bank] = CreateSprite(
&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1096,7 +1096,7 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFF);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void LinkPartnerHandleReturnMonToBall(void)
@ -1174,7 +1174,7 @@ static void LinkPartnerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy;
@ -1188,9 +1188,9 @@ static void LinkPartnerHandleTrainerSlide(void)
static void LinkPartnerHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_814AF54;
@ -1211,8 +1211,8 @@ static void LinkPartnerHandleFaintAnimation(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0;
HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 5;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00;
gBattleBankFunc[gActiveBank] = sub_814B340;
}
@ -1492,7 +1492,7 @@ static void LinkPartnerHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1554,11 +1554,11 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);

View File

@ -23,7 +23,7 @@
#include "string_util.h"
#include "bg.h"
#include "reshow_battle_screen.h"
#include "rng.h"
#include "random.h"
#include "pokeball.h"
#include "data2.h"
@ -318,11 +318,11 @@ static void sub_805F560(void)
bool32 sp = FALSE;
bool32 r10 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x1)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x1)
sub_8172EF0(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]);
if (!(gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) && !(gBattleTypeFlags & BATTLE_TYPE_MULTI) && IsDoubleBattle() && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].field_1_x1)
if (!(gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) && !(gBattleTypeFlags & BATTLE_TYPE_MULTI) && IsDoubleBattle() && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].field_1_x1)
sub_8172EF0(gActiveBank ^ BIT_MON, &gEnemyParty[gBattlePartyID[gActiveBank ^ BIT_MON]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x80)
{
@ -453,18 +453,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
OpponentBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -509,11 +509,11 @@ static void sub_805FD00(void)
static void sub_805FDF0(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
sub_8172EF0(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]);
if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBank]]);
SetBankEnemyShadowSpriteCallback(gActiveBank, GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES));
@ -1151,13 +1151,13 @@ static void OpponentHandleLoadMonSprite(void)
sub_806A068(species, GetBankIdentity(gActiveBank));
gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(gActiveBank, 2),
GetBankPosition(gActiveBank, 2),
GetBankSpriteDefault_Y(gActiveBank),
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data2 = species;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = species;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
@ -1186,15 +1186,15 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit)
sub_806A068(species, GetBankIdentity(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
@ -1203,7 +1203,7 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFE);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
}
static void OpponentHandleReturnMonToBall(void)
@ -1321,7 +1321,7 @@ static void OpponentHandleDrawTrainerPic(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1391,7 +1391,7 @@ static void OpponentHandleTrainerSlide(void)
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96;
gSprites[gBankSpriteIds[gActiveBank]].pos1.x += 32;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1402,9 +1402,9 @@ static void OpponentHandleTrainerSlide(void)
static void OpponentHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_805F240;
@ -1815,7 +1815,7 @@ static void OpponentHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1876,9 +1876,9 @@ static void OpponentHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_806280C);

View File

@ -22,7 +22,7 @@
#include "string_util.h"
#include "bg.h"
#include "reshow_battle_screen.h"
#include "rng.h"
#include "random.h"
#include "pokeball.h"
#include "data2.h"
@ -1023,12 +1023,12 @@ static void sub_8058B40(void)
bool32 r9 = FALSE;
bool32 r8 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
sub_8172EF0(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
sub_8172EF0(gActiveBank ^ BIT_MON, &gPlayerParty[gBattlePartyID[gActiveBank ^ BIT_MON]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x80)
{
@ -1127,13 +1127,13 @@ static void sub_8058FC0(void)
static void sub_805902C(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
sub_8172EF0(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBank]]);
UpdateHealthboxAttribute(gHealthBoxesIds[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], HEALTHBOX_ALL);
@ -1431,18 +1431,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
PlayerBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -2237,15 +2237,15 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit)
gBankSpriteIds[bank] = CreateSprite(
&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -2253,7 +2253,7 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFF);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void PlayerHandleReturnMonToBall(void)
@ -2358,7 +2358,7 @@ static void PlayerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].pos2.y = 48;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gSprites[gBankSpriteIds[gActiveBank]].oam.affineMode = 0;
gSprites[gBankSpriteIds[gActiveBank]].hFlip = 1;
@ -2372,7 +2372,7 @@ static void PlayerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
}
@ -2411,7 +2411,7 @@ static void PlayerHandleTrainerSlide(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -96;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy2;
@ -2420,9 +2420,9 @@ static void PlayerHandleTrainerSlide(void)
static void PlayerHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);
@ -2444,8 +2444,8 @@ static void PlayerHandleFaintAnimation(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0;
HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 5;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00;
gBattleBankFunc[gActiveBank] = sub_80596A8;
}
@ -2902,7 +2902,7 @@ static void PlayerHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -2963,11 +2963,11 @@ static void PlayerHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);
@ -2988,7 +2988,7 @@ static void PlayerHandleIntroTrainerBallThrow(void)
void sub_805CC00(struct Sprite *sprite)
{
u8 bank = sprite->data5;
u8 bank = sprite->data[5];
FreeSpriteOamMatrix(sprite);
FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum));

View File

@ -282,8 +282,8 @@ static void sub_81BAF48(void)
static void sub_81BB02C(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive
&& gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy
&& ++gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_9 != 1)
@ -539,18 +539,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
PlayerPartnerBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -599,13 +599,13 @@ static void sub_81BB9F4(void)
static void sub_81BBAE8(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
sub_8172EF0(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBank]]);
gBattleBankFunc[gActiveBank] = sub_81BB9F4;
@ -1236,11 +1236,11 @@ static void PlayerPartnerHandleLoadMonSprite(void)
sub_806A068(species, GetBankIdentity(gActiveBank));
gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(gActiveBank, 2),
GetBankPosition(gActiveBank, 2),
GetBankSpriteDefault_Y(gActiveBank),
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
gBattleBankFunc[gActiveBank] = sub_81BB1D4;
@ -1267,15 +1267,15 @@ static void sub_81BD0E4(u8 bank, bool8 dontClearSubstituteBit)
gBankSpriteIds[bank] = CreateSprite(
&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1283,7 +1283,7 @@ static void sub_81BD0E4(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFF);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void PlayerPartnerHandleReturnMonToBall(void)
@ -1353,7 +1353,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
}
else // otherwise use front sprite
@ -1365,7 +1365,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].pos2.y = 48;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gSprites[gBankSpriteIds[gActiveBank]].oam.affineMode = 0;
gSprites[gBankSpriteIds[gActiveBank]].hFlip = 1;
@ -1382,9 +1382,9 @@ static void PlayerPartnerHandleTrainerSlide(void)
static void PlayerPartnerHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_81BAE98;
@ -1405,8 +1405,8 @@ static void PlayerPartnerHandleFaintAnimation(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0;
HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 5;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00;
gBattleBankFunc[gActiveBank] = sub_81BB78C;
}
@ -1745,7 +1745,7 @@ static void PlayerPartnerHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1806,11 +1806,11 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);

View File

@ -298,12 +298,12 @@ static void sub_818686C(void)
bool32 r9 = FALSE;
bool32 r8 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
sub_8172EF0(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
sub_8172EF0(gActiveBank ^ BIT_MON, &gEnemyParty[gBattlePartyID[gActiveBank ^ BIT_MON]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x80)
{
@ -449,18 +449,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
RecordedOpponentBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -512,14 +512,14 @@ static void sub_8186F94(void)
static void sub_8187084(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80)
{
sub_8172EF0(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBank]]);
SetBankEnemyShadowSpriteCallback(gActiveBank, GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES));
@ -1148,14 +1148,14 @@ static void RecordedOpponentHandleLoadMonSprite(void)
sub_806A068(species, GetBankIdentity(gActiveBank));
gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(gActiveBank, 2),
GetBankPosition(gActiveBank, 2),
GetBankSpriteDefault_Y(gActiveBank),
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
@ -1183,15 +1183,15 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit)
sub_806A068(species, GetBankIdentity(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1199,7 +1199,7 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFE);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
}
static void RecordedOpponentHandleReturnMonToBall(void)
@ -1285,7 +1285,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1301,9 +1301,9 @@ static void RecordedOpponentHandleTrainerSlide(void)
static void RecordedOpponentHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_81865C8;
@ -1614,7 +1614,7 @@ static void RecordedOpponentHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1675,9 +1675,9 @@ static void RecordedOpponentHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_818962C);

View File

@ -314,19 +314,19 @@ static void sub_8189D40(void)
if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
sub_8172EF0(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]);
}
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
{
sub_8172EF0(gActiveBank ^ BIT_MON, &gPlayerParty[gBattlePartyID[gActiveBank ^ BIT_MON]]);
}
}
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x80)
{
@ -437,18 +437,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
RecordedPlayerBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -497,13 +497,13 @@ static void sub_818A37C(void)
static void sub_818A470(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
sub_8172EF0(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
{
DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBank]]);
gBattleBankFunc[gActiveBank] = sub_818A37C;
@ -1134,11 +1134,11 @@ static void RecordedPlayerHandleLoadMonSprite(void)
sub_806A068(species, GetBankIdentity(gActiveBank));
gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(gActiveBank, 2),
GetBankPosition(gActiveBank, 2),
GetBankSpriteDefault_Y(gActiveBank),
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
gBattleBankFunc[gActiveBank] = sub_818A064;
@ -1165,15 +1165,15 @@ static void sub_818BA6C(u8 bank, bool8 dontClearSubstituteBit)
gBankSpriteIds[bank] = CreateSprite(
&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1181,7 +1181,7 @@ static void sub_818BA6C(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFF);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void RecordedPlayerHandleReturnMonToBall(void)
@ -1272,7 +1272,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].pos2.y = 48;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gSprites[gBankSpriteIds[gActiveBank]].oam.affineMode = 0;
gSprites[gBankSpriteIds[gActiveBank]].hFlip = 1;
@ -1285,7 +1285,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
}
@ -1300,9 +1300,9 @@ static void RecordedPlayerHandleTrainerSlide(void)
static void RecordedPlayerHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_81899F0;
@ -1323,8 +1323,8 @@ static void RecordedPlayerHandleFaintAnimation(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0;
HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
PlaySE12WithPanning(SE_POKE_DEAD, -64);
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 5;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00;
gBattleBankFunc[gActiveBank] = sub_818A114;
}
@ -1633,7 +1633,7 @@ static void RecordedPlayerHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1695,11 +1695,11 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);

View File

@ -384,7 +384,7 @@ static void SafariHandleDrawTrainerPic(void)
30);
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy;
}

View File

@ -22,7 +22,7 @@
#include "string_util.h"
#include "bg.h"
#include "reshow_battle_screen.h"
#include "rng.h"
#include "random.h"
#include "pokeball.h"
#include "data2.h"
#include "party_menu.h"
@ -321,13 +321,13 @@ static void CompleteOnChosenItem(void)
static void sub_816864C(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive)
sub_8172EF0(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive)
sub_8172EF0(gActiveBank ^ BIT_MON, &gPlayerParty[gBattlePartyID[gActiveBank ^ BIT_MON]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x8
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x8
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].ballAnimActive
&& gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy
&& gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy)
{
@ -396,18 +396,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
WallyBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -1073,7 +1073,7 @@ static void WallyHandleDrawTrainerPic(void)
30);
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy;
}
@ -1088,7 +1088,7 @@ static void WallyHandleTrainerSlide(void)
30);
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -96;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy2;
}
@ -1408,7 +1408,7 @@ static void WallyHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1462,11 +1462,11 @@ static void WallyHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);
@ -1495,21 +1495,21 @@ static void sub_816AA80(u8 bank)
gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714);
sub_806A068(species, GetBankIdentity(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C,
sub_80A5C6C(bank, 2),
GetBankPosition(bank, 2),
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = sub_80753E8(0, 0xFF);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void sub_816AC04(u8 taskId)

View File

@ -6,7 +6,7 @@
#include "battle_interface.h"
#include "main.h"
#include "malloc.h"
#include "rng.h"
#include "random.h"
#include "util.h"
#include "pokemon.h"
#include "moves.h"
@ -332,7 +332,7 @@ static u16 BattlePalaceGetTargetRetValue(void)
void sub_805D714(struct Sprite *sprite)
{
u8 spriteId = sprite->data1;
u8 spriteId = sprite->data[1];
if (!gSprites[spriteId].affineAnimEnded)
return;
@ -367,7 +367,7 @@ void sub_805D7AC(struct Sprite *sprite)
{
if (!(gUnknown_020243FC & 1))
{
sprite->pos2.x += sprite->data0;
sprite->pos2.x += sprite->data[0];
if (sprite->pos2.x == 0)
{
if (sprite->pos2.y != 0)
@ -1134,7 +1134,7 @@ void sub_805EB9C(u8 affineMode)
}
}
#define tBank data0
#define tBank data[0]
void LoadAndCreateEnemyShadowSprites(void)
{
@ -1143,14 +1143,14 @@ void LoadAndCreateEnemyShadowSprites(void)
LoadCompressedObjectPic(&gSpriteSheet_EnemyShadow);
bank = GetBankByIdentity(IDENTITY_OPPONENT_MON1);
gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, sub_80A5C6C(bank, 0), sub_80A5C6C(bank, 1) + 29, 0xC8);
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank;
gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8);
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank;
if (IsDoubleBattle())
{
bank = GetBankByIdentity(IDENTITY_OPPONENT_MON2);
gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, sub_80A5C6C(bank, 0), sub_80A5C6C(bank, 1) + 29, 0xC8);
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank;
gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8);
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank;
}
}

View File

@ -927,7 +927,7 @@ u8 CreateBankHealthboxSprites(u8 bank)
data6 = 2;
}
gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2;
gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].callback = sub_8072924;
}
else
@ -939,7 +939,7 @@ u8 CreateBankHealthboxSprites(u8 bank)
gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2;
gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].oam.tileNum += 32;
gSprites[healthboxSpriteId_2].callback = sub_8072924;
@ -952,7 +952,7 @@ u8 CreateBankHealthboxSprites(u8 bank)
gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2;
gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].oam.tileNum += 32;
gSprites[healthboxSpriteId_2].callback = sub_8072924;
@ -968,14 +968,14 @@ u8 CreateBankHealthboxSprites(u8 bank)
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void*)(OBJ_VRAM0 + unkSpritePtr->oam.tileNum * 32), 64);
gSprites[healthboxSpriteId_1].data5 = unkSpriteId;
gSprites[healthboxSpriteId_1].data6 = bank;
gSprites[healthboxSpriteId_1].data[5] = unkSpriteId;
gSprites[healthboxSpriteId_1].data[6] = bank;
gSprites[healthboxSpriteId_1].invisible = 1;
gSprites[healthboxSpriteId_2].invisible = 1;
unkSpritePtr->data5 = healthboxSpriteId_1;
unkSpritePtr->data6 = data6;
unkSpritePtr->data[5] = healthboxSpriteId_1;
unkSpritePtr->data[6] = data6;
unkSpritePtr->invisible = 1;
return healthboxSpriteId_1;
@ -994,7 +994,7 @@ u8 CreateSafariPlayerHealthboxSprites(void)
gSprites[healthboxSpriteId_2].oam.tileNum += 64;
gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2;
gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1;
gSprites[healthboxSpriteId_2].callback = sub_8072924;
@ -1008,9 +1008,9 @@ static const u8 *GetHealthboxElementGfxPtr(u8 elementId)
static void sub_80728B4(struct Sprite *sprite)
{
u8 var = sprite->data5;
u8 var = sprite->data[5];
switch (sprite->data6)
switch (sprite->data[6])
{
case 0:
sprite->pos1.x = gSprites[var].pos1.x + 16;
@ -1033,7 +1033,7 @@ static void sub_80728B4(struct Sprite *sprite)
static void sub_8072924(struct Sprite *sprite)
{
u8 otherSpriteId = sprite->data5;
u8 otherSpriteId = sprite->data[5];
sprite->pos1.x = gSprites[otherSpriteId].pos1.x + 64;
sprite->pos1.y = gSprites[otherSpriteId].pos1.y;
@ -1054,14 +1054,14 @@ void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal,
void SetHealthboxSpriteInvisible(u8 healthboxSpriteId)
{
gSprites[healthboxSpriteId].invisible = 1;
gSprites[gSprites[healthboxSpriteId].data5].invisible = 1;
gSprites[gSprites[healthboxSpriteId].data[5]].invisible = 1;
gSprites[gSprites[healthboxSpriteId].oam.affineParam].invisible = 1;
}
void SetHealthboxSpriteVisible(u8 healthboxSpriteId)
{
gSprites[healthboxSpriteId].invisible = 0;
gSprites[gSprites[healthboxSpriteId].data5].invisible = 0;
gSprites[gSprites[healthboxSpriteId].data[5]].invisible = 0;
gSprites[gSprites[healthboxSpriteId].oam.affineParam].invisible = 0;
}
@ -1074,7 +1074,7 @@ static void UpdateSpritePos(u8 spriteId, s16 x, s16 y)
void DestoryHealthboxSprite(u8 healthboxSpriteId)
{
DestroySprite(&gSprites[gSprites[healthboxSpriteId].oam.affineParam]);
DestroySprite(&gSprites[gSprites[healthboxSpriteId].data5]);
DestroySprite(&gSprites[gSprites[healthboxSpriteId].data[5]]);
DestroySprite(&gSprites[healthboxSpriteId]);
}
@ -1091,7 +1091,7 @@ void UpdateOamPriorityInAllHealthboxes(u8 priority)
{
u8 healthboxSpriteId_1 = gHealthBoxesIds[i];
u8 healthboxSpriteId_2 = gSprites[gHealthBoxesIds[i]].oam.affineParam;
u8 healthboxSpriteId_3 = gSprites[gHealthBoxesIds[i]].data5;
u8 healthboxSpriteId_3 = gSprites[gHealthBoxesIds[i]].data[5];
gSprites[healthboxSpriteId_1].oam.priority = priority;
gSprites[healthboxSpriteId_2].oam.priority = priority;
@ -1156,7 +1156,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl)
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, xPos, 3, 2, &windowId);
spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * 32;
if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER)
if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER)
{
objVram = (void*)(OBJ_VRAM0);
if (!IsDoubleBattle())
@ -1180,7 +1180,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent)
u8 text[32];
void *objVram;
if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER && !IsDoubleBattle())
if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER && !IsDoubleBattle())
{
spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * 32;
if (maxOrCurrent != HP_CURRENT) // singles, max
@ -1213,7 +1213,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent)
u8 bank;
memcpy(text, sUnknown_0832C3C4, sizeof(sUnknown_0832C3C4));
bank = gSprites[healthboxSpriteId].data6;
bank = gSprites[healthboxSpriteId].data[6];
if (IsDoubleBattle() == TRUE || GetBankSide(bank) == SIDE_OPPONENT)
{
UpdateHpTextInHealthboxInDoubles(healthboxSpriteId, value, maxOrCurrent);
@ -1223,7 +1223,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent)
u32 var;
u8 i;
if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER)
if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER)
{
if (maxOrCurrent == HP_CURRENT)
var = 29;
@ -1258,11 +1258,11 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
u8 text[32];
void *objVram;
if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER)
if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER)
{
if (gBattleSpritesDataPtr->bankData[gSprites[healthboxSpriteId].data6].hpNumbersNoBars) // don't print text if only bars are visible
if (gBattleSpritesDataPtr->bankData[gSprites[healthboxSpriteId].data[6]].hpNumbersNoBars) // don't print text if only bars are visible
{
spriteTileNum = gSprites[gSprites[healthboxSpriteId].data5].oam.tileNum * 32;
spriteTileNum = gSprites[gSprites[healthboxSpriteId].data[5]].oam.tileNum * 32;
objVram = (void*)(OBJ_VRAM0) + spriteTileNum;
if (maxOrCurrent != HP_CURRENT) // doubles, max hp
@ -1292,7 +1292,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
u8 bank;
memcpy(text, sUnknown_0832C3D8, sizeof(sUnknown_0832C3D8));
bank = gSprites[healthboxSpriteId].data6;
bank = gSprites[healthboxSpriteId].data[6];
if (gBattleSpritesDataPtr->bankData[bank].hpNumbersNoBars) // don't print text if only bars are visible
{
@ -1304,7 +1304,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
if (maxOrCurrent == HP_CURRENT)
var = 0;
r7 = gSprites[healthboxSpriteId].data5;
r7 = gSprites[healthboxSpriteId].data[5];
txtPtr = ConvertIntToDecimalStringN(text + 6, value, STR_CONV_MODE_RIGHT_ALIGN, 3);
if (!maxOrCurrent)
StringCopy(txtPtr, gText_Slash);
@ -1354,7 +1354,7 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon)
u8 i, var, nature, healthboxSpriteId_2;
memcpy(text, sUnknown_0832C3C4, sizeof(sUnknown_0832C3C4));
barFontGfx = &gMonSpritesGfxPtr->barFontGfx[0x520 + (GetBankIdentity(gSprites[healthboxSpriteId].data6) * 384)];
barFontGfx = &gMonSpritesGfxPtr->barFontGfx[0x520 + (GetBankIdentity(gSprites[healthboxSpriteId].data[6]) * 384)];
var = 5;
nature = GetNature(mon);
StringCopy(text + 6, gNatureNamePointers[nature]);
@ -1385,7 +1385,7 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon)
barFontGfx += 0x20;
}
healthboxSpriteId_2 = gSprites[healthboxSpriteId].data5;
healthboxSpriteId_2 = gSprites[healthboxSpriteId].data[5];
ConvertIntToDecimalStringN(text + 6, gBattleStruct->field_7C, STR_CONV_MODE_RIGHT_ALIGN, 2);
ConvertIntToDecimalStringN(text + 9, gBattleStruct->field_7B, STR_CONV_MODE_RIGHT_ALIGN, 2);
text[5] = CHAR_SPACE;
@ -1434,7 +1434,7 @@ void SwapHpBarsWithHpText(void)
if (noBars == TRUE) // bars to text
{
spriteId = gSprites[gHealthBoxesIds[i]].data5;
spriteId = gSprites[gHealthBoxesIds[i]].data[5];
CpuFill32(0, (void*)(OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * 32), 0x100);
UpdateHpTextInHealthboxInDoubles(gHealthBoxesIds[i], GetMonData(&gPlayerParty[gBattlePartyID[i]], MON_DATA_HP), HP_CURRENT);
@ -1457,7 +1457,7 @@ void SwapHpBarsWithHpText(void)
}
else
{
spriteId = gSprites[gHealthBoxesIds[i]].data5;
spriteId = gSprites[gHealthBoxesIds[i]].data[5];
CpuFill32(0, (void *)(OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * 32), 0x100);
UpdateHpTextInHealthboxInDoubles(gHealthBoxesIds[i], GetMonData(&gEnemyParty[gBattlePartyID[i]], MON_DATA_HP), HP_CURRENT);
@ -1472,7 +1472,7 @@ void SwapHpBarsWithHpText(void)
UpdateHealthboxAttribute(gHealthBoxesIds[i], &gEnemyParty[gBattlePartyID[i]], HEALTHBOX_NICK);
}
}
gSprites[gHealthBoxesIds[i]].data7 ^= 1;
gSprites[gHealthBoxesIds[i]].data[7] ^= 1;
}
}
}
@ -1524,7 +1524,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar
barSpriteId = CreateSprite(&sStatusSummaryBarSpriteTemplates[isOpponent], bar_X, bar_Y, 10);
SetSubspriteTables(&gSprites[barSpriteId], sStatusSummaryBar_SubspriteTable);
gSprites[barSpriteId].pos2.x = bar_pos2_X;
gSprites[barSpriteId].data0 = bar_data0;
gSprites[barSpriteId].data[0] = bar_data0;
if (isOpponent)
{
@ -1549,22 +1549,22 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar
gSprites[ballIconSpritesIds[i]].pos2.y = 0;
}
gSprites[ballIconSpritesIds[i]].data0 = barSpriteId;
gSprites[ballIconSpritesIds[i]].data[0] = barSpriteId;
if (!isOpponent)
{
gSprites[ballIconSpritesIds[i]].pos1.x += 10 * i + 24;
gSprites[ballIconSpritesIds[i]].data1 = i * 7 + 10;
gSprites[ballIconSpritesIds[i]].data[1] = i * 7 + 10;
gSprites[ballIconSpritesIds[i]].pos2.x = 120;
}
else
{
gSprites[ballIconSpritesIds[i]].pos1.x -= 10 * (5 - i) + 24;
gSprites[ballIconSpritesIds[i]].data1 = (6 - i) * 7 + 10;
gSprites[ballIconSpritesIds[i]].data[1] = (6 - i) * 7 + 10;
gSprites[ballIconSpritesIds[i]].pos2.x = -120;
}
gSprites[ballIconSpritesIds[i]].data2 = isOpponent;
gSprites[ballIconSpritesIds[i]].data[2] = isOpponent;
}
if (GetBankSide(bank) == SIDE_PLAYER)
@ -1576,7 +1576,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar
if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[i]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[i]].data7 = 1;
gSprites[ballIconSpritesIds[i]].data[7] = 1;
}
else if (partyInfo[i].hp == 0) // fainted mon
{
@ -1595,7 +1595,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar
if (partyInfo[j].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[var]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[var]].data7 = 1;
gSprites[ballIconSpritesIds[var]].data[7] = 1;
var--;
continue;
}
@ -1624,7 +1624,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar
if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[var]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[var]].data7 = 1;
gSprites[ballIconSpritesIds[var]].data[7] = 1;
}
else if (partyInfo[i].hp == 0) // fainted mon
{
@ -1644,7 +1644,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar
if (partyInfo[j].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[i]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[i]].data7 = 1;
gSprites[ballIconSpritesIds[i]].data[7] = 1;
i++;
continue;
}
@ -1714,21 +1714,21 @@ void sub_8073C30(u8 taskId)
{
if (GetBankSide(bank) != SIDE_PLAYER)
{
gSprites[sp[5 - i]].data1 = 7 * i;
gSprites[sp[5 - i]].data3 = 0;
gSprites[sp[5 - i]].data4 = 0;
gSprites[sp[5 - i]].data[1] = 7 * i;
gSprites[sp[5 - i]].data[3] = 0;
gSprites[sp[5 - i]].data[4] = 0;
gSprites[sp[5 - i]].callback = sub_8074158;
}
else
{
gSprites[sp[i]].data1 = 7 * i;
gSprites[sp[i]].data3 = 0;
gSprites[sp[i]].data4 = 0;
gSprites[sp[i]].data[1] = 7 * i;
gSprites[sp[i]].data[3] = 0;
gSprites[sp[i]].data[4] = 0;
gSprites[sp[i]].callback = sub_8074158;
}
}
gSprites[r10].data0 /= 2;
gSprites[r10].data1 = 0;
gSprites[r10].data[0] /= 2;
gSprites[r10].data[1] = 0;
gSprites[r10].callback = sub_8074090;
SetSubspriteTables(&gSprites[r10], sUnknown_0832C2CC);
gTasks[taskId].func = sub_8073E08;
@ -1831,17 +1831,17 @@ static void sub_8073F98(u8 taskId)
static void SpriteCB_StatusSummaryBar(struct Sprite *sprite)
{
if (sprite->pos2.x != 0)
sprite->pos2.x += sprite->data0;
sprite->pos2.x += sprite->data[0];
}
static void sub_8074090(struct Sprite *sprite)
{
sprite->data1 += 32;
if (sprite->data0 > 0)
sprite->pos2.x += sprite->data1 >> 4;
sprite->data[1] += 32;
if (sprite->data[0] > 0)
sprite->pos2.x += sprite->data[1] >> 4;
else
sprite->pos2.x -= sprite->data1 >> 4;
sprite->data1 &= 0xF;
sprite->pos2.x -= sprite->data[1] >> 4;
sprite->data[1] &= 0xF;
}
static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite)
@ -1850,16 +1850,16 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite)
u16 var2;
s8 pan;
if (sprite->data1 > 0)
if (sprite->data[1] > 0)
{
sprite->data1--;
sprite->data[1]--;
return;
}
var1 = sprite->data2;
var2 = sprite->data3;
var1 = sprite->data[2];
var2 = sprite->data[3];
var2 += 56;
sprite->data3 = var2 & 0xFFF0;
sprite->data[3] = var2 & 0xFFF0;
if (var1 != 0)
{
@ -1880,7 +1880,7 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite)
if (var1 != 0)
pan = PAN_SIDE_PLAYER;
if (sprite->data7 != 0)
if (sprite->data[7] != 0)
PlaySE2WithPanning(SE_TB_KARA, pan);
else
PlaySE1WithPanning(SE_TB_KON, pan);
@ -1894,15 +1894,15 @@ static void sub_8074158(struct Sprite *sprite)
u8 var1;
u16 var2;
if (sprite->data1 > 0)
if (sprite->data[1] > 0)
{
sprite->data1--;
sprite->data[1]--;
return;
}
var1 = sprite->data2;
var2 = sprite->data3;
var1 = sprite->data[2];
var2 = sprite->data[3];
var2 += 56;
sprite->data3 = var2 & 0xFFF0;
sprite->data[3] = var2 & 0xFFF0;
if (var1 != 0)
sprite->pos2.x += var2 >> 4;
else
@ -1917,7 +1917,7 @@ static void sub_8074158(struct Sprite *sprite)
static void SpriteCB_StatusSummaryBallsOnSwitchout(struct Sprite *sprite)
{
u8 barSpriteId = sprite->data0;
u8 barSpriteId = sprite->data[0];
sprite->pos2.x = gSprites[barSpriteId].pos2.x;
sprite->pos2.y = gSprites[barSpriteId].pos2.y;
@ -1964,7 +1964,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * 32;
if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER)
if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER)
{
sub_8075198((void*)(0x6010040 + spriteTileNum), windowTileData, 6);
ptr = (void*)(OBJ_VRAM0);
@ -1991,13 +1991,13 @@ static void TryAddPokeballIconToHealthbox(u8 healthboxSpriteId, bool8 noStatus)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
return;
bank = gSprites[healthboxSpriteId].data6;
bank = gSprites[healthboxSpriteId].data[6];
if (GetBankSide(bank) == SIDE_PLAYER)
return;
if (!GetSetPokedexFlag(SpeciesToNationalPokedexNum(GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES)), FLAG_GET_CAUGHT))
return;
healthboxSpriteId_2 = gSprites[healthboxSpriteId].data5;
healthboxSpriteId_2 = gSprites[healthboxSpriteId].data[5];
if (noStatus)
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_70), (void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId_2].oam.tileNum + 8) * 32), 32);
@ -2014,8 +2014,8 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId)
s16 tileNumAdder;
u8 statusPalId;
bank = gSprites[healthboxSpriteId].data6;
healthboxSpriteId_2 = gSprites[healthboxSpriteId].data5;
bank = gSprites[healthboxSpriteId].data[6];
healthboxSpriteId_2 = gSprites[healthboxSpriteId].data[5];
if (GetBankSide(bank) == SIDE_PLAYER)
{
status = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_STATUS);
@ -2178,12 +2178,12 @@ static void UpdateLeftNoOfBallsTextOnHealthbox(u8 healthboxSpriteId)
void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId)
{
s32 maxHp, currHp;
u8 bank = gSprites[healthboxSpriteId].data6;
u8 bank = gSprites[healthboxSpriteId].data[6];
if (elementId == HEALTHBOX_ALL && !IsDoubleBattle())
GetBankSide(bank); // pointless function call
if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER)
if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER)
{
u8 isDoubles;
@ -2308,7 +2308,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar)
}
for (i = 0; i < 6; i++)
{
u8 healthboxSpriteId_2 = gSprites[gBattleSpritesDataPtr->battleBars[bank].healthboxSpriteId].data5;
u8 healthboxSpriteId_2 = gSprites[gBattleSpritesDataPtr->battleBars[bank].healthboxSpriteId].data[5];
if (i < 2)
CpuCopy32(GetHealthboxElementGfxPtr(barElementId) + array[i] * 32,
(void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId_2].oam.tileNum + 2 + i) * 32), 32);

View File

@ -1632,9 +1632,9 @@ void BufferStringBattle(u16 stringID)
stringPtr = gText_AttackerUsedX;
break;
case STRINGID_BATTLEEND: // battle end
if (gBattleTextBuff1[0] & BATTLE_OUTCOME_BIT_x80)
if (gBattleTextBuff1[0] & OUTCOME_LINK_BATTLE_RUN)
{
gBattleTextBuff1[0] &= ~(BATTLE_OUTCOME_BIT_x80);
gBattleTextBuff1[0] &= ~(OUTCOME_LINK_BATTLE_RUN);
if (GetBankSide(gActiveBank) == SIDE_OPPONENT && gBattleTextBuff1[0] != BATTLE_DREW)
gBattleTextBuff1[0] ^= (BATTLE_LOST | BATTLE_WON);

View File

@ -12,7 +12,7 @@
#include "util.h"
#include "pokemon.h"
#include "calculate_base_damage.h"
#include "rng.h"
#include "random.h"
#include "battle_controllers.h"
#include "battle_interface.h"
#include "species.h"
@ -1053,7 +1053,7 @@ static void atk00_attackcanceler(void)
if (!(gHitMarker & HITMARKER_OBEYS) && !(gBattleMons[gBankAttacker].status2 & STATUS2_MULTIPLETURNS))
{
i = IsPokeDisobedient(); // why use the 'i' variable...?
i = IsMonDisobedient(); // why use the 'i' variable...?
switch (i)
{
case 0:
@ -3040,7 +3040,7 @@ static void atk15_seteffectwithchance(void)
}
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
gBattleScripting.field_16 = 0;
gBattleScripting.multihitMoveEffect = 0;
}
static void atk16_seteffectprimary(void)
@ -3064,7 +3064,7 @@ static void atk18_clearstatusfromeffect(void)
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
gBattlescriptCurrInstr += 2;
gBattleScripting.field_16 = 0;
gBattleScripting.multihitMoveEffect = 0;
}
static void atk19_tryfaintmon(void)
@ -3221,7 +3221,7 @@ static void atk1E_jumpifability(void)
gLastUsedAbility = ability;
gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(bank - 1, gLastUsedAbility);
gBattleScripting.field_15 = bank - 1;
gBattleScripting.bankWithAbility = bank - 1;
}
else
gBattlescriptCurrInstr += 7;
@ -3234,7 +3234,7 @@ static void atk1E_jumpifability(void)
gLastUsedAbility = ability;
gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(bank - 1, gLastUsedAbility);
gBattleScripting.field_15 = bank - 1;
gBattleScripting.bankWithAbility = bank - 1;
}
else
gBattlescriptCurrInstr += 7;
@ -3247,7 +3247,7 @@ static void atk1E_jumpifability(void)
gLastUsedAbility = ability;
gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(bank, gLastUsedAbility);
gBattleScripting.field_15 = bank;
gBattleScripting.bankWithAbility = bank;
}
else
gBattlescriptCurrInstr += 7;
@ -6383,7 +6383,7 @@ static void atk62(void)
static void atk63_jumptorandomattack(void)
{
if (gBattlescriptCurrInstr[1] != 0)
if (gBattlescriptCurrInstr[1])
gCurrentMove = gRandomMove;
else
gChosenMove = gCurrentMove = gRandomMove;
@ -6782,8 +6782,8 @@ static bool8 sub_804F344(void)
return (gBattle_BG2_X != 0x1A0);
}
#define sDestroy data0
#define sSavedLvlUpBoxXPosition data1
#define sDestroy data[0]
#define sSavedLvlUpBoxXPosition data[1]
static void PutMonIconOnLvlUpBox(void)
{
@ -7790,7 +7790,7 @@ static void atk8E_initmultihitstring(void)
gBattlescriptCurrInstr++;
}
static bool8 sub_8051064(void)
static bool8 TryDoForceSwitchOut(void)
{
if (gBattleMons[gBankAttacker].level >= gBattleMons[gBankTarget].level)
{
@ -7807,7 +7807,7 @@ static bool8 sub_8051064(void)
*(gBattleStruct->field_58 + gBankTarget) = gBattlePartyID[gBankTarget];
}
gBattlescriptCurrInstr = BattleScript_82DADD8;
gBattlescriptCurrInstr = BattleScript_SuccessForceOut;
return TRUE;
}
@ -7935,7 +7935,7 @@ static void atk8F_forcerandomswitch(void)
}
else
{
if (sub_8051064())
if (TryDoForceSwitchOut())
{
do
{
@ -7968,7 +7968,7 @@ static void atk8F_forcerandomswitch(void)
}
else
{
sub_8051064();
TryDoForceSwitchOut();
}
}
@ -9306,7 +9306,7 @@ static void atkBA_jumpifnopursuitswitchdmg(void)
gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON2);
}
if (gActionForBanks[gBankTarget] == 0
if (gActionForBanks[gBankTarget] == ACTION_USE_MOVE
&& gBankAttacker == *(gBattleStruct->moveTarget + gBankTarget)
&& !(gBattleMons[gBankTarget].status1 & (STATUS_SLEEP | STATUS_FREEZE))
&& gBattleMons[gBankAttacker].hp

View File

@ -10,7 +10,7 @@
#include "util.h"
#include "constants/battle_move_effects.h"
#include "battle_scripts.h"
#include "rng.h"
#include "random.h"
#include "text.h"
#include "string_util.h"
#include "battle_message.h"
@ -364,7 +364,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
gCurrentMove = move;
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_82DAE2A;
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_SelectingDisabledMoveInPalace;
gProtectStructs[gActiveBank].flag_x10 = 1;
}
else
@ -379,7 +379,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
CancelMultiTurnMoves(gActiveBank);
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_82DB098;
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_SelectingTormentedMoveInPalace;
gProtectStructs[gActiveBank].flag_x10 = 1;
}
else
@ -394,7 +394,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
gCurrentMove = move;
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_82DB0AF;
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_SelectingNotAllowedMoveTauntInPalace;
gProtectStructs[gActiveBank].flag_x10 = 1;
}
else
@ -409,7 +409,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
gCurrentMove = move;
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_82DB185;
gPalaceSelectionBattleScripts[gActiveBank] = BattleScript_SelectingImprisionedMoveInPalace;
gProtectStructs[gActiveBank].flag_x10 = 1;
}
else
@ -1113,23 +1113,23 @@ u8 TurnBasedEffects(void)
return 0;
}
bool8 sub_8041364(void)
bool8 HandleWishPerishSongOnTurnEnd(void)
{
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
switch (gBattleStruct->field_1A0)
switch (gBattleStruct->wishPerishSongState)
{
case 0:
while (gBattleStruct->field_1A1 < gNoOfAllBanks)
while (gBattleStruct->wishPerishSongBank < gNoOfAllBanks)
{
gActiveBank = gBattleStruct->field_1A1;
gActiveBank = gBattleStruct->wishPerishSongBank;
if (gAbsentBankFlags & gBitTable[gActiveBank])
{
gBattleStruct->field_1A1++;
gBattleStruct->wishPerishSongBank++;
continue;
}
gBattleStruct->field_1A1++;
gBattleStruct->wishPerishSongBank++;
if (gWishFutureKnock.futureSightCounter[gActiveBank] != 0
&& --gWishFutureKnock.futureSightCounter[gActiveBank] == 0
&& gBattleMons[gActiveBank].hp != 0)
@ -1157,21 +1157,21 @@ bool8 sub_8041364(void)
}
// Why do I have to keep doing this to match?
{
u8* var = &gBattleStruct->field_1A0;
*var = 1;
gBattleStruct->field_1A1 = 0;
u8 *state = &gBattleStruct->wishPerishSongState;
*state = 1;
gBattleStruct->wishPerishSongBank = 0;
}
// fall through
case 1:
while (gBattleStruct->field_1A1 < gNoOfAllBanks)
while (gBattleStruct->wishPerishSongBank < gNoOfAllBanks)
{
gActiveBank = gBankAttacker = gBanksByTurnOrder[gBattleStruct->field_1A1];
gActiveBank = gBankAttacker = gBanksByTurnOrder[gBattleStruct->wishPerishSongBank];
if (gAbsentBankFlags & gBitTable[gActiveBank])
{
gBattleStruct->field_1A1++;
gBattleStruct->wishPerishSongBank++;
continue;
}
gBattleStruct->field_1A1++;
gBattleStruct->wishPerishSongBank++;
if (gStatuses3[gActiveBank] & STATUS3_PERISH_SONG)
{
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gActiveBank].perishSongTimer1);
@ -1192,9 +1192,9 @@ bool8 sub_8041364(void)
}
// Hm...
{
u8* var = &gBattleStruct->field_1A0;
*var = 2;
gBattleStruct->field_1A1 = 0;
u8 *state = &gBattleStruct->wishPerishSongState;
*state = 2;
gBattleStruct->wishPerishSongBank = 0;
}
// fall through
case 2:
@ -1209,7 +1209,7 @@ bool8 sub_8041364(void)
gBattlescriptCurrInstr = BattleScript_82DB8F3;
BattleScriptExecute(BattleScript_82DB8F3);
gBattleStruct->field_1A0++;
gBattleStruct->wishPerishSongState++;
return TRUE;
}
break;
@ -1220,20 +1220,20 @@ bool8 sub_8041364(void)
return FALSE;
}
#define sub_8041728_MAX_CASE 7
#define FAINTED_ACTIONS_MAX_CASE 7
bool8 sub_8041728(void)
bool8 HandleFaintedMonActions(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
return FALSE;
do
{
int i;
switch (gBattleStruct->field_4D)
switch (gBattleStruct->faintedActionsState)
{
case 0:
gBattleStruct->field_4E = 0;
gBattleStruct->field_4D++;
gBattleStruct->faintedActionsBank = 0;
gBattleStruct->faintedActionsState++;
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gAbsentBankFlags & gBitTable[i] && !sub_80423F4(i, 6, 6))
@ -1243,58 +1243,58 @@ bool8 sub_8041728(void)
case 1:
do
{
gBank1 = gBankTarget = gBattleStruct->field_4E;
if (gBattleMons[gBattleStruct->field_4E].hp == 0
&& !(gBattleStruct->field_DF & gBitTable[gBattlePartyID[gBattleStruct->field_4E]])
&& !(gAbsentBankFlags & gBitTable[gBattleStruct->field_4E]))
gBank1 = gBankTarget = gBattleStruct->faintedActionsBank;
if (gBattleMons[gBattleStruct->faintedActionsBank].hp == 0
&& !(gBattleStruct->field_DF & gBitTable[gBattlePartyID[gBattleStruct->faintedActionsBank]])
&& !(gAbsentBankFlags & gBitTable[gBattleStruct->faintedActionsBank]))
{
BattleScriptExecute(BattleScript_82DA7C4);
gBattleStruct->field_4D = 2;
BattleScriptExecute(BattleScript_GiveExp);
gBattleStruct->faintedActionsState = 2;
return TRUE;
}
} while (++gBattleStruct->field_4E != gNoOfAllBanks);
gBattleStruct->field_4D = 3;
} while (++gBattleStruct->faintedActionsBank != gNoOfAllBanks);
gBattleStruct->faintedActionsState = 3;
break;
case 2:
sub_803F9EC(gBank1);
if (++gBattleStruct->field_4E == gNoOfAllBanks)
gBattleStruct->field_4D = 3;
if (++gBattleStruct->faintedActionsBank == gNoOfAllBanks)
gBattleStruct->faintedActionsState = 3;
else
gBattleStruct->field_4D = 1;
gBattleStruct->faintedActionsState = 1;
break;
case 3:
gBattleStruct->field_4E = 0;
gBattleStruct->field_4D++;
gBattleStruct->faintedActionsBank = 0;
gBattleStruct->faintedActionsState++;
// fall through
case 4:
do
{
gBank1 = gBankTarget = gBattleStruct->field_4E;
if (gBattleMons[gBattleStruct->field_4E].hp == 0
&& !(gAbsentBankFlags & gBitTable[gBattleStruct->field_4E]))
gBank1 = gBankTarget = gBattleStruct->faintedActionsBank;
if (gBattleMons[gBattleStruct->faintedActionsBank].hp == 0
&& !(gAbsentBankFlags & gBitTable[gBattleStruct->faintedActionsBank]))
{
BattleScriptExecute(BattleScript_82DA7CD);
gBattleStruct->field_4D = 5;
BattleScriptExecute(BattleScript_HandleFaintedMon);
gBattleStruct->faintedActionsState = 5;
return TRUE;
}
} while (++gBattleStruct->field_4E != gNoOfAllBanks);
gBattleStruct->field_4D = 6;
} while (++gBattleStruct->faintedActionsBank != gNoOfAllBanks);
gBattleStruct->faintedActionsState = 6;
break;
case 5:
if (++gBattleStruct->field_4E == gNoOfAllBanks)
gBattleStruct->field_4D = 6;
if (++gBattleStruct->faintedActionsBank == gNoOfAllBanks)
gBattleStruct->faintedActionsState = 6;
else
gBattleStruct->field_4D = 4;
gBattleStruct->faintedActionsState = 4;
break;
case 6:
if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) || AbilityBattleEffects(ABILITYEFFECT_TRACE, 0, 0, 0, 0) || ItemBattleEffects(1, 0, 1) || AbilityBattleEffects(ABILITYEFFECT_FORECAST, 0, 0, 0, 0))
return TRUE;
gBattleStruct->field_4D++;
gBattleStruct->faintedActionsState++;
break;
case 7:
case FAINTED_ACTIONS_MAX_CASE:
break;
}
} while (gBattleStruct->field_4D != sub_8041728_MAX_CASE);
} while (gBattleStruct->faintedActionsState != FAINTED_ACTIONS_MAX_CASE);
return FALSE;
}
@ -3182,7 +3182,7 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn)
&& gBattleMoves[gCurrentMove].flags & FLAG_KINGSROCK_AFFECTED
&& gBattleMons[gBankTarget].hp)
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 8;
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_FLINCH;
BattleScriptPushCursor();
SetMoveEffect(0, 0);
BattleScriptPop();
@ -3318,7 +3318,7 @@ static bool32 HasObedientBitSet(u8 bank)
return GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_OBEDIENCE, NULL);
}
u8 IsPokeDisobedient(void)
u8 IsMonDisobedient(void)
{
s32 rnd;
s32 calc;

View File

@ -5,7 +5,8 @@
#include "pokemon.h"
#include "event_data.h"
#include "constants/abilities.h"
#include "rng.h"
#include "random.h"
#include "battle_scripts.h"
extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT];
extern u16 gBattlePartyID[BATTLE_BANKS_COUNT];
@ -14,11 +15,6 @@ extern const u8* gBattlescriptCurrInstr;
extern u8 gBattleCommunication[];
extern u8 gActiveBank;
extern const u8 BattleScript_MoveUsedWokeUp[];
extern const u8 BattleScript_MoveUsedIsFrozen[];
extern const u8 BattleScript_MoveUsedUnfroze[];
extern const u8 BattleScript_MoveUsedIsAsleep[];
extern void sub_81D55D0(void);
extern void sub_81D5694(void);
extern u8 pokemon_order_func(u8);

View File

@ -4,7 +4,7 @@
#include "item.h"
#include "constants/items.h"
#include "text.h"
#include "rng.h"
#include "random.h"
#include "event_data.h"
#include "fieldmap.h"

View File

@ -25,7 +25,7 @@
#include "constants/items.h"
#include "string_util.h"
#include "international_string_util.h"
#include "rng.h"
#include "random.h"
#include "menu.h"
#include "pokeblock.h"
#include "trig.h"
@ -1004,35 +1004,35 @@ static void sub_807FAC8(void)
static void sub_807FD08(struct Sprite* sprite)
{
sprite->data1 += sprite->data6;
sprite->data2 -= sprite->data4;
sprite->data2 += sprite->data7;
sprite->data0 += sprite->data7;
sprite->data4--;
sprite->data[1] += sprite->data[6];
sprite->data[2] -= sprite->data[4];
sprite->data[2] += sprite->data[7];
sprite->data[0] += sprite->data[7];
sprite->data[4]--;
if (sprite->data0 < sprite->data2)
if (sprite->data[0] < sprite->data[2])
{
sprite->data3 = sprite->data4 = sprite->data3 - 1;
sprite->data[3] = sprite->data[4] = sprite->data[3] - 1;
if (++sprite->data5 > 3)
if (++sprite->data[5] > 3)
DestroySprite(sprite);
else
PlaySE(SE_TB_KARA);
}
sprite->pos1.x = sprite->data1;
sprite->pos1.y = sprite->data2;
sprite->pos1.x = sprite->data[1];
sprite->pos1.y = sprite->data[2];
}
static void sub_807FD64(struct Sprite* sprite, s16 a2, s16 a3, s16 a4, s16 a5, s16 a6)
{
sprite->data0 = a3;
sprite->data1 = a2;
sprite->data2 = a3;
sprite->data3 = a4;
sprite->data4 = 10;
sprite->data5 = 0;
sprite->data6 = a5;
sprite->data7 = a6;
sprite->data[0] = a3;
sprite->data[1] = a2;
sprite->data[2] = a3;
sprite->data[3] = a4;
sprite->data[4] = 10;
sprite->data[5] = 0;
sprite->data[6] = a5;
sprite->data[7] = a6;
sprite->callback = sub_807FD08;
}
@ -2911,10 +2911,10 @@ static void BerryBlender_SetBackgroundsPos(void)
static void sub_8082E3C(struct Sprite* sprite)
{
sprite->data2 += sprite->data0;
sprite->data3 += sprite->data1;
sprite->pos2.x = sprite->data2 / 8;
sprite->pos2.y = sprite->data3 / 8;
sprite->data[2] += sprite->data[0];
sprite->data[3] += sprite->data[1];
sprite->pos2.x = sprite->data[2] / 8;
sprite->pos2.y = sprite->data[3] / 8;
if (sprite->animEnded)
DestroySprite(sprite);
@ -2937,8 +2937,8 @@ static void sub_8082E84(void)
y = gSineTable[(rand & 0xFF)] / 4;
spriteId = CreateSprite(&sUnknown_08339BE0, x + 120, y + 80, 1);
gSprites[spriteId].data0 = 16 - (Random() % 32);
gSprites[spriteId].data1 = 16 - (Random() % 32);
gSprites[spriteId].data[0] = 16 - (Random() % 32);
gSprites[spriteId].data[1] = 16 - (Random() % 32);
gSprites[spriteId].callback = sub_8082E3C;
}
@ -2946,8 +2946,8 @@ static void sub_8082E84(void)
static void sub_8082F68(struct Sprite* sprite)
{
sprite->data0++;
sprite->pos2.y = -(sprite->data0 / 3);
sprite->data[0]++;
sprite->pos2.y = -(sprite->data[0] / 3);
if (sprite->animEnded)
DestroySprite(sprite);
@ -2955,8 +2955,8 @@ static void sub_8082F68(struct Sprite* sprite)
static void sub_8082F9C(struct Sprite* sprite)
{
sprite->data0++;
sprite->pos2.y = -(sprite->data0 * 2);
sprite->data[0]++;
sprite->pos2.y = -(sprite->data[0] * 2);
if (sprite->pos2.y < -12)
sprite->pos2.y = -12;
@ -2972,68 +2972,68 @@ static void Blender_SetBankBerryData(u8 bank, u16 itemId)
static void sub_8083010(struct Sprite* sprite)
{
switch (sprite->data0)
switch (sprite->data[0])
{
case 0:
sprite->data1 += 8;
if (sprite->data1 > 88)
sprite->data[1] += 8;
if (sprite->data[1] > 88)
{
sprite->data1 = 88;
sprite->data0++;
sprite->data[1] = 88;
sprite->data[0]++;
PlaySE(SE_KON);
}
break;
case 1:
sprite->data2 += 1;
if (sprite->data2 > 20)
sprite->data[2] += 1;
if (sprite->data[2] > 20)
{
sprite->data0++;
sprite->data2 = 0;
sprite->data[0]++;
sprite->data[2] = 0;
}
break;
case 2:
sprite->data1 += 4;
if (sprite->data1 > 176)
sprite->data[1] += 4;
if (sprite->data[1] > 176)
{
if (++sprite->data3 == 3)
if (++sprite->data[3] == 3)
{
DestroySprite(sprite);
CreateSprite(&sUnknown_08339C60, 120, -20, 2);
}
else
{
sprite->data0 = 0;
sprite->data1 = -16;
StartSpriteAnim(sprite, sprite->data3);
sprite->data[0] = 0;
sprite->data[1] = -16;
StartSpriteAnim(sprite, sprite->data[3]);
}
}
break;
}
sprite->pos2.y = sprite->data1;
sprite->pos2.y = sprite->data[1];
}
static void sub_80830C0(struct Sprite* sprite)
{
switch (sprite->data0)
switch (sprite->data[0])
{
case 0:
sprite->data1 += 8;
if (sprite->data1 > 92)
sprite->data[1] += 8;
if (sprite->data[1] > 92)
{
sprite->data1 = 92;
sprite->data0++;
sprite->data[1] = 92;
sprite->data[0]++;
PlaySE(SE_PIN);
}
break;
case 1:
sprite->data2 += 1;
if (sprite->data2 > 20)
sprite->data0++;
sprite->data[2] += 1;
if (sprite->data[2] > 20)
sprite->data[0]++;
break;
case 2:
sprite->data1 += 4;
if (sprite->data1 > 176)
sprite->data[1] += 4;
if (sprite->data[1] > 176)
{
sBerryBlenderData->mainState++;
DestroySprite(sprite);
@ -3041,7 +3041,7 @@ static void sub_80830C0(struct Sprite* sprite)
break;
}
sprite->pos2.y = sprite->data1;
sprite->pos2.y = sprite->data[1];
}
static void sub_8083140(u16 a0, u16 a1)

View File

@ -7,7 +7,7 @@
#include "mail.h"
#include "pokemon_storage_system.h"
#include "event_data.h"
#include "rng.h"
#include "random.h"
#include "main.h"
#include "moves.h"
#include "egg_hatch.h"

View File

@ -1303,7 +1303,7 @@ void sub_8128060(u8 taskId)
void ConfigureCameraObjectForPlacingDecoration(struct PlaceDecorationGraphicsDataBuffer *data, u8 decor)
{
sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data0;
sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data[0];
gUnknown_03005DD0.unk4 = gpu_pal_decompress_alloc_tag_and_upload(data, decor);
gSprites[gUnknown_03005DD0.unk4].oam.priority = 1;
gSprites[gUnknown_03005DD0.unk4].callback = sub_81292D0;
@ -1384,8 +1384,8 @@ void sub_812826C(u8 taskId)
void sub_81283BC(u8 taskId)
{
gTasks[taskId].data[10] = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 1;
gSprites[sDecor_CameraSpriteObjectIdx2].data7 = 1;
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 1;
gSprites[sDecor_CameraSpriteObjectIdx2].data[7] = 1;
sub_8128DE0();
sub_8128950(taskId);
}
@ -1393,8 +1393,8 @@ void sub_81283BC(u8 taskId)
void sub_8128414(u8 taskId)
{
gTasks[taskId].data[10] = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 1;
gSprites[sDecor_CameraSpriteObjectIdx2].data7 = 1;
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 1;
gSprites[sDecor_CameraSpriteObjectIdx2].data[7] = 1;
sub_8128DE0();
StringExpandPlaceholders(gStringVar4, gText_CancelDecorating);
DisplayItemMessageOnField(taskId, gStringVar4, sub_8128B80);
@ -1770,8 +1770,8 @@ bool8 sub_8128DB4(void)
void sub_8128DE0(void)
{
sDecorationLastDirectionMoved = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 0;
}
void sub_8128E18(u8 taskId)
@ -1779,7 +1779,7 @@ void sub_8128E18(u8 taskId)
s16 *data;
data = gTasks[taskId].data;
if (!gSprites[sDecor_CameraSpriteObjectIdx1].data4)
if (!gSprites[sDecor_CameraSpriteObjectIdx1].data[4])
{
if (data[10] == 1)
{
@ -1793,29 +1793,29 @@ void sub_8128E18(u8 taskId)
if ((gMain.heldKeys & 0x0F0) == DPAD_UP)
{
sDecorationLastDirectionMoved = DIR_SOUTH;
gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data3 = -2;
gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = -2;
data[1]--;
}
if ((gMain.heldKeys & 0x0F0) == DPAD_DOWN)
{
sDecorationLastDirectionMoved = DIR_NORTH;
gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 2;
gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 2;
data[1]++;
}
if ((gMain.heldKeys & 0x0F0) == DPAD_LEFT)
{
sDecorationLastDirectionMoved = DIR_WEST;
gSprites[sDecor_CameraSpriteObjectIdx1].data2 = -2;
gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = -2;
gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 0;
data[0]--;
}
if ((gMain.heldKeys & 0x0F0) == DPAD_RIGHT)
{
sDecorationLastDirectionMoved = DIR_EAST;
gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 2;
gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 2;
gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 0;
data[0]++;
}
if (!sub_8128DB4() || !sub_8128D10(taskId))
@ -1825,8 +1825,8 @@ void sub_8128E18(u8 taskId)
}
if (sDecorationLastDirectionMoved)
{
gSprites[sDecor_CameraSpriteObjectIdx1].data4++;
gSprites[sDecor_CameraSpriteObjectIdx1].data4 &= 7;
gSprites[sDecor_CameraSpriteObjectIdx1].data[4]++;
gSprites[sDecor_CameraSpriteObjectIdx1].data[4] &= 7;
}
if (!data[10])
{
@ -1844,7 +1844,7 @@ void sub_8128E18(u8 taskId)
void sub_8128FD8(u8 taskId)
{
sub_8197434(0, 1);
gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0;
gTasks[taskId].data[10] = 0;
gTasks[taskId].func = sub_8128E18;
}
@ -1955,20 +1955,20 @@ void SetDecorSelectionBoxOamAttributes(u8 decorShape)
void sub_81292D0(struct Sprite *sprite)
{
sprite->data2 = 0;
sprite->data3 = 0;
sprite->data4 = 0;
sprite->data5 = 0;
sprite->data6 = 0;
sprite->data7 = 0;
sprite->data[2] = 0;
sprite->data[3] = 0;
sprite->data[4] = 0;
sprite->data[5] = 0;
sprite->data[6] = 0;
sprite->data[7] = 0;
sprite->callback = sub_81292E8;
}
void sub_81292E8(struct Sprite *sprite)
{
if (sprite->data7 == 0)
if (sprite->data[7] == 0)
{
if (sprite->data6 < 15)
if (sprite->data[6] < 15)
{
sprite->invisible = FALSE;
}
@ -1976,8 +1976,8 @@ void sub_81292E8(struct Sprite *sprite)
{
sprite->invisible = TRUE;
}
sprite->data6 ++;
sprite->data6 &= 0x1F;
sprite->data[6] ++;
sprite->data[6] &= 0x1F;
}
else
{
@ -2249,7 +2249,7 @@ bool8 sub_81299AC(u8 taskId)
void SetUpPuttingAwayDecorationPlayerAvatar(void)
{
player_get_direction_lower_nybble();
sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data0;
sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data[0];
sub_812A39C();
gUnknown_03005DD0.unk4 = CreateSprite(&gUnknown_085A7404, 0x78, 0x50, 0);
if (gSaveBlock2Ptr->playerGender == MALE)
@ -2300,7 +2300,7 @@ void sub_8129ABC(u8 taskId)
void sub_8129B34(u8 taskId)
{
sub_8197434(0, 1);
gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0;
gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE;
gSprites[sDecor_CameraSpriteObjectIdx1].callback = sub_812A36C;
gSprites[sDecor_CameraSpriteObjectIdx2].pos1.x = 0x88;
@ -2720,9 +2720,9 @@ void sub_812A334(void)
void sub_812A36C(struct Sprite *sprite)
{
sprite->data0 ++;
sprite->data0 &= 0x1F;
if (sprite->data0 > 15)
sprite->data[0] ++;
sprite->data[0] &= 0x1F;
if (sprite->data[0] > 15)
{
sprite->invisible = TRUE;
}

View File

@ -16,7 +16,7 @@
#include "string_util.h"
#include "menu.h"
#include "trig.h"
#include "rng.h"
#include "random.h"
#include "malloc.h"
#include "dma3.h"
#include "gpu_regs.h"
@ -709,16 +709,16 @@ static void CB2_EggHatch_1(void)
static void SpriteCB_Egg_0(struct Sprite* sprite)
{
if (++sprite->data0 > 20)
if (++sprite->data[0] > 20)
{
sprite->callback = SpriteCB_Egg_1;
sprite->data0 = 0;
sprite->data[0] = 0;
}
else
{
sprite->data1 = (sprite->data1 + 20) & 0xFF;
sprite->pos2.x = Sin(sprite->data1, 1);
if (sprite->data0 == 15)
sprite->data[1] = (sprite->data[1] + 20) & 0xFF;
sprite->pos2.x = Sin(sprite->data[1], 1);
if (sprite->data[0] == 15)
{
PlaySE(SE_BOWA);
StartSpriteAnim(sprite, 1);
@ -729,19 +729,19 @@ static void SpriteCB_Egg_0(struct Sprite* sprite)
static void SpriteCB_Egg_1(struct Sprite* sprite)
{
if (++sprite->data2 > 30)
if (++sprite->data[2] > 30)
{
if (++sprite->data0 > 20)
if (++sprite->data[0] > 20)
{
sprite->callback = SpriteCB_Egg_2;
sprite->data0 = 0;
sprite->data2 = 0;
sprite->data[0] = 0;
sprite->data[2] = 0;
}
else
{
sprite->data1 = (sprite->data1 + 20) & 0xFF;
sprite->pos2.x = Sin(sprite->data1, 2);
if (sprite->data0 == 15)
sprite->data[1] = (sprite->data[1] + 20) & 0xFF;
sprite->pos2.x = Sin(sprite->data[1], 2);
if (sprite->data[0] == 15)
{
PlaySE(SE_BOWA);
StartSpriteAnim(sprite, 2);
@ -752,30 +752,30 @@ static void SpriteCB_Egg_1(struct Sprite* sprite)
static void SpriteCB_Egg_2(struct Sprite* sprite)
{
if (++sprite->data2 > 30)
if (++sprite->data[2] > 30)
{
if (++sprite->data0 > 38)
if (++sprite->data[0] > 38)
{
u16 species;
sprite->callback = SpriteCB_Egg_3;
sprite->data0 = 0;
sprite->data[0] = 0;
species = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_SPECIES);
gSprites[sEggHatchData->pokeSpriteID].pos2.x = 0;
gSprites[sEggHatchData->pokeSpriteID].pos2.y = 0;
}
else
{
sprite->data1 = (sprite->data1 + 20) & 0xFF;
sprite->pos2.x = Sin(sprite->data1, 2);
if (sprite->data0 == 15)
sprite->data[1] = (sprite->data[1] + 20) & 0xFF;
sprite->pos2.x = Sin(sprite->data[1], 2);
if (sprite->data[0] == 15)
{
PlaySE(SE_BOWA);
StartSpriteAnim(sprite, 2);
CreateRandomEggShardSprite();
CreateRandomEggShardSprite();
}
if (sprite->data0 == 30)
if (sprite->data[0] == 30)
PlaySE(SE_BOWA);
}
}
@ -783,60 +783,60 @@ static void SpriteCB_Egg_2(struct Sprite* sprite)
static void SpriteCB_Egg_3(struct Sprite* sprite)
{
if (++sprite->data0 > 50)
if (++sprite->data[0] > 50)
{
sprite->callback = SpriteCB_Egg_4;
sprite->data0 = 0;
sprite->data[0] = 0;
}
}
static void SpriteCB_Egg_4(struct Sprite* sprite)
{
s16 i;
if (sprite->data0 == 0)
if (sprite->data[0] == 0)
BeginNormalPaletteFade(-1, -1, 0, 0x10, 0xFFFF);
if (sprite->data0 < 4u)
if (sprite->data[0] < 4u)
{
for (i = 0; i <= 3; i++)
CreateRandomEggShardSprite();
}
sprite->data0++;
sprite->data[0]++;
if (!gPaletteFade.active)
{
PlaySE(SE_TAMAGO);
sprite->invisible = 1;
sprite->callback = SpriteCB_Egg_5;
sprite->data0 = 0;
sprite->data[0] = 0;
}
}
static void SpriteCB_Egg_5(struct Sprite* sprite)
{
if (sprite->data0 == 0)
if (sprite->data[0] == 0)
{
gSprites[sEggHatchData->pokeSpriteID].invisible = 0;
StartSpriteAffineAnim(&gSprites[sEggHatchData->pokeSpriteID], 1);
}
if (sprite->data0 == 8)
if (sprite->data[0] == 8)
BeginNormalPaletteFade(-1, -1, 0x10, 0, 0xFFFF);
if (sprite->data0 <= 9)
if (sprite->data[0] <= 9)
gSprites[sEggHatchData->pokeSpriteID].pos1.y -= 1;
if (sprite->data0 > 40)
if (sprite->data[0] > 40)
sprite->callback = SpriteCallbackDummy;
sprite->data0++;
sprite->data[0]++;
}
static void SpriteCB_EggShard(struct Sprite* sprite)
{
sprite->data4 += sprite->data1;
sprite->data5 += sprite->data2;
sprite->data[4] += sprite->data[1];
sprite->data[5] += sprite->data[2];
sprite->pos2.x = sprite->data4 / 256;
sprite->pos2.y = sprite->data5 / 256;
sprite->pos2.x = sprite->data[4] / 256;
sprite->pos2.y = sprite->data[5] / 256;
sprite->data2 += sprite->data3;
sprite->data[2] += sprite->data[3];
if (sprite->pos1.y + sprite->pos2.y > sprite->pos1.y + 20 && sprite->data2 > 0)
if (sprite->pos1.y + sprite->pos2.y > sprite->pos1.y + 20 && sprite->data[2] > 0)
DestroySprite(sprite);
}
@ -854,9 +854,9 @@ static void CreateRandomEggShardSprite(void)
static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 spriteAnimIndex)
{
u8 spriteID = CreateSprite(&sSpriteTemplate_EggShard, x, y, 4);
gSprites[spriteID].data1 = data1;
gSprites[spriteID].data2 = data2;
gSprites[spriteID].data3 = data3;
gSprites[spriteID].data[1] = data1;
gSprites[spriteID].data[2] = data2;
gSprites[spriteID].data[3] = data3;
StartSpriteAnim(&gSprites[spriteID], spriteAnimIndex);
}

View File

@ -2,7 +2,7 @@
#include "evolution_graphics.h"
#include "sprite.h"
#include "trig.h"
#include "rng.h"
#include "random.h"
#include "decompress.h"
#include "task.h"
#include "sound.h"
@ -112,18 +112,18 @@ static void SpriteCB_PreEvoSparkleSet1(struct Sprite* sprite)
{
u8 matrixNum;
sprite->pos1.y = 88 - (sprite->data7 * sprite->data7) / 80;
sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5) / 4;
sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5);
sprite->data6 += 4;
if (sprite->data7 & 1)
sprite->data5--;
sprite->data7++;
sprite->pos1.y = 88 - (sprite->data[7] * sprite->data[7]) / 80;
sprite->pos2.y = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4;
sprite->pos2.x = Cos((u8)(sprite->data[6]), sprite->data[5]);
sprite->data[6] += 4;
if (sprite->data[7] & 1)
sprite->data[5]--;
sprite->data[7]++;
if (sprite->pos2.y > 0)
sprite->subpriority = 1;
else
sprite->subpriority = 20;
matrixNum = sprite->data5 / 4 + 20;
matrixNum = sprite->data[5] / 4 + 20;
if (matrixNum > 31)
matrixNum = 31;
sprite->oam.matrixNum = matrixNum;
@ -137,9 +137,9 @@ static void CreatePreEvoSparkleSet1(u8 arg0)
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 88, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data5 = 48;
gSprites[spriteID].data6 = arg0;
gSprites[spriteID].data7 = 0;
gSprites[spriteID].data[5] = 48;
gSprites[spriteID].data[6] = arg0;
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].callback = SpriteCB_PreEvoSparkleSet1;
@ -150,11 +150,11 @@ static void SpriteCB_PreEvoSparkleSet2(struct Sprite* sprite)
{
if (sprite->pos1.y < 88)
{
sprite->pos1.y = 8 + (sprite->data7 * sprite->data7) / 5;
sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5) / 4;
sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5);
sprite->data5 = 8 + Sin((u8)(sprite->data7 * 4), 40);
sprite->data7++;
sprite->pos1.y = 8 + (sprite->data[7] * sprite->data[7]) / 5;
sprite->pos2.y = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4;
sprite->pos2.x = Cos((u8)(sprite->data[6]), sprite->data[5]);
sprite->data[5] = 8 + Sin((u8)(sprite->data[7] * 4), 40);
sprite->data[7]++;
}
else
DestroySprite(sprite);
@ -165,9 +165,9 @@ static void CreatePreEvoSparkleSet2(u8 arg0)
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 8, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data5 = 8;
gSprites[spriteID].data6 = arg0;
gSprites[spriteID].data7 = 0;
gSprites[spriteID].data[5] = 8;
gSprites[spriteID].data[6] = arg0;
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 25;
gSprites[spriteID].subpriority = 1;
@ -177,12 +177,12 @@ static void CreatePreEvoSparkleSet2(u8 arg0)
static void SpriteCB_PostEvoSparkleSet1(struct Sprite* sprite)
{
if (sprite->data5 > 8)
if (sprite->data[5] > 8)
{
sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5);
sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5);
sprite->data5 -= sprite->data3;
sprite->data6 += 4;
sprite->pos2.y = Sin((u8)(sprite->data[6]), sprite->data[5]);
sprite->pos2.x = Cos((u8)(sprite->data[6]), sprite->data[5]);
sprite->data[5] -= sprite->data[3];
sprite->data[6] += 4;
}
else
DestroySprite(sprite);
@ -193,10 +193,10 @@ static void CreatePostEvoSparkleSet1(u8 arg0, u8 arg1)
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data3 = arg1;
gSprites[spriteID].data5 = 120;
gSprites[spriteID].data6 = arg0;
gSprites[spriteID].data7 = 0;
gSprites[spriteID].data[3] = arg1;
gSprites[spriteID].data[5] = 120;
gSprites[spriteID].data[6] = arg0;
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].subpriority = 1;
@ -206,29 +206,29 @@ static void CreatePostEvoSparkleSet1(u8 arg0, u8 arg1)
static void SpriteCB_PostEvoSparkleSet2(struct Sprite* sprite)
{
if (!(sprite->data7 & 3))
if (!(sprite->data[7] & 3))
sprite->pos1.y++;
if (sprite->data6 < 128)
if (sprite->data[6] < 128)
{
u8 matrixNum;
sprite->pos2.y = -Sin((u8)(sprite->data6), sprite->data5);
sprite->pos1.x = 120 + (sprite->data3 * sprite->data7) / 3;
sprite->data6++;
matrixNum = 31 - (sprite->data6 * 12 / 128);
if (sprite->data6 > 64)
sprite->pos2.y = -Sin((u8)(sprite->data[6]), sprite->data[5]);
sprite->pos1.x = 120 + (sprite->data[3] * sprite->data[7]) / 3;
sprite->data[6]++;
matrixNum = 31 - (sprite->data[6] * 12 / 128);
if (sprite->data[6] > 64)
sprite->subpriority = 1;
else
{
sprite->invisible = 0;
sprite->subpriority = 20;
if (sprite->data6 > 112 && sprite->data6 & 1)
if (sprite->data[6] > 112 && sprite->data[6] & 1)
sprite->invisible = 1;
}
if (matrixNum < 20)
matrixNum = 20;
sprite->oam.matrixNum = matrixNum;
sprite->data7++;
sprite->data[7]++;
}
else
DestroySprite(sprite);
@ -239,9 +239,9 @@ static void CreatePostEvoSparkleSet2(u8 arg0)
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data3 = 3 - (Random() % 7);
gSprites[spriteID].data5 = 48 + (Random() & 0x3F);
gSprites[spriteID].data7 = 0;
gSprites[spriteID].data[3] = 3 - (Random() % 7);
gSprites[spriteID].data[5] = 48 + (Random() & 0x3F);
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].subpriority = 20;

View File

@ -21,6 +21,7 @@
#include "songs.h"
#include "overworld.h"
#include "battle_message.h"
#include "battle_string_ids.h"
#include "gpu_regs.h"
#include "bg.h"
#include "link.h"
@ -771,7 +772,7 @@ static void Task_EvolutionScene(u8 taskID)
{
BufferMoveToLearnIntoBattleTextBuff2();
PlayFanfare(BGM_FANFA1);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[3]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
gTasks[taskID].tState++;
@ -788,7 +789,7 @@ static void Task_EvolutionScene(u8 taskID)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BufferMoveToLearnIntoBattleTextBuff2();
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[4]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE1 - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tLearnMoveState++;
}
@ -796,7 +797,7 @@ static void Task_EvolutionScene(u8 taskID)
case 1:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[5]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE2 - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tLearnMoveState++;
}
@ -804,7 +805,7 @@ static void Task_EvolutionScene(u8 taskID)
case 2:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[6]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE3 - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tData7 = 5;
gTasks[taskID].tData8 = 10;
@ -881,7 +882,7 @@ static void Task_EvolutionScene(u8 taskID)
u16 move = GetMonData(mon, var + MON_DATA_MOVE1);
if (IsHMMove2(move))
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[307]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_HMMOVESCANTBEFORGOTTEN - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tLearnMoveState = 12;
}
@ -897,14 +898,14 @@ static void Task_EvolutionScene(u8 taskID)
}
break;
case 7:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[207]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_123POOF - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tLearnMoveState++;
break;
case 8:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[7]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNFORGOTMOVE - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tLearnMoveState++;
}
@ -912,20 +913,20 @@ static void Task_EvolutionScene(u8 taskID)
case 9:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[208]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_ANDELLIPSIS - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tState = 20;
}
break;
case 10:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[8]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_STOPLEARNINGMOVE - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tData7 = 11;
gTasks[taskID].tData8 = 0;
gTasks[taskID].tLearnMoveState = 3;
break;
case 11:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[9]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_DIDNOTLEARNMOVE - BATTLESTRINGS_ID_ADDER]);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gTasks[taskID].tState = 15;
break;
@ -1116,7 +1117,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
{
BufferMoveToLearnIntoBattleTextBuff2();
PlayFanfare(BGM_FANFA1);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[3]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
gTasks[taskID].tState++;
@ -1133,7 +1134,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BufferMoveToLearnIntoBattleTextBuff2();
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[4]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE1 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
@ -1141,7 +1142,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
case 1:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[5]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE2 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
@ -1149,7 +1150,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
case 2:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[6]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE3 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tData7 = 5;
gTasks[taskID].tData8 = 9;
@ -1170,7 +1171,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
{
case 0:
sEvoCursorPos = 0;
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[292]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_EMPTYSTRING3 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState = gTasks[taskID].tData7;
if (gTasks[taskID].tLearnMoveState == 5)
@ -1179,7 +1180,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
case 1:
case -1:
sEvoCursorPos = 1;
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[292]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_EMPTYSTRING3 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState = gTasks[taskID].tData8;
break;
@ -1215,7 +1216,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
u16 move = GetMonData(mon, var + MON_DATA_MOVE1);
if (IsHMMove2(move))
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[307]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_HMMOVESCANTBEFORGOTTEN - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState = 11;
}
@ -1225,7 +1226,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
RemoveMonPPBonus(mon, var);
SetMonMoveSlot(mon, gMoveToLearn, var);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[207]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_123POOF - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
@ -1235,7 +1236,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
case 7:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[7]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNFORGOTMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
@ -1243,20 +1244,20 @@ static void Task_TradeEvolutionScene(u8 taskID)
case 8:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[208]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_ANDELLIPSIS - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tState = 18;
}
break;
case 9:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[8]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_STOPLEARNINGMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tData7 = 10;
gTasks[taskID].tData8 = 0;
gTasks[taskID].tLearnMoveState = 3;
break;
case 10:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[9]);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_DIDNOTLEARNMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
gTasks[taskID].tState = 13;
break;

File diff suppressed because it is too large Load Diff

148
src/field_poison.c Normal file
View File

@ -0,0 +1,148 @@
#include "global.h"
#include "string_util.h"
#include "party_menu.h"
#include "species.h"
#include "task.h"
#include "field_message_box.h"
#include "strings.h"
#include "rom_818CFC8.h"
#include "battle_frontier_2.h"
#include "pokenav.h"
#include "event_data.h"
#include "script.h"
#include "battle.h"
#include "fldeff_80F9BCC.h"
#include "field_poison.h"
static bool32 sub_80F9568(struct Pokemon *pokemon)
{
u16 species = GetMonData(pokemon, MON_DATA_SPECIES2);
if (species == SPECIES_NONE || species == SPECIES_EGG)
{
return FALSE;
}
return TRUE;
}
static bool32 sub_80F958C(void)
{
int i;
struct Pokemon *pokemon;
for (pokemon = gPlayerParty, i = 0; i < PARTY_SIZE; i++, pokemon++)
{
if (sub_80F9568(pokemon) && GetMonData(pokemon, MON_DATA_HP) != 0)
{
return FALSE;
}
}
return TRUE;
}
static void sub_80F95C0(u8 partyIdx)
{
struct Pokemon *pokemon = gPlayerParty + partyIdx;
unsigned int status = STATUS_NONE;
AdjustFriendship(pokemon, 0x07);
SetMonData(pokemon, MON_DATA_STATUS, &status);
GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1);
StringGetEnd10(gStringVar1);
}
static bool32 sub_80F960C(u8 partyIdx)
{
struct Pokemon *pokemon = gPlayerParty + partyIdx;
if (sub_80F9568(pokemon) && GetMonData(pokemon, MON_DATA_HP) == 0 && pokemon_ailments_get_primary(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN)
{
return TRUE;
}
return FALSE;
}
static void sub_80F9654(u8 taskId)
{
s16 *data = gTasks[taskId].data;
switch (data[0])
{
case 0:
for (; data[1] < PARTY_SIZE; data[1]++)
{
if (sub_80F960C(data[1]))
{
sub_80F95C0(data[1]);
ShowFieldMessage(gText_PkmnFainted3);
data[0]++;
return;
}
}
data[0] = 2;
break;
case 1:
if (IsFieldMessageBoxHidden())
{
data[0]--;
}
break;
case 2:
if (sub_80F958C())
{
if (InBattlePyramid() | InBattlePike() || sub_81D5C18())
{
gSpecialVar_Result = 2;
}
else
{
gSpecialVar_Result = 1;
}
}
else
{
gSpecialVar_Result = 0;
}
EnableBothScriptContexts();
DestroyTask(taskId);
break;
}
}
void sub_80F972C(void)
{
CreateTask(sub_80F9654, 80);
ScriptContext1_Stop();
}
unsigned int overworld_poison(void)
{
int i;
unsigned int hp;
struct Pokemon *pokemon = gPlayerParty;
unsigned int numPoisoned = 0;
unsigned int numFainted = 0;
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(pokemon, MON_DATA_SANITY_BIT2) && pokemon_ailments_get_primary(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN)
{
hp = GetMonData(pokemon, MON_DATA_HP);
if (hp == 0 || --hp == 0)
{
numFainted++;
}
SetMonData(pokemon, MON_DATA_HP, &hp);
numPoisoned++;
}
pokemon++;
}
if (numFainted != 0 || numPoisoned != 0)
{
overworld_poison_effect();
}
if (numFainted != 0)
{
return FLDPSN_FNT;
}
if (numPoisoned != 0)
{
return FLDPSN_PSN;
}
return FLDPSN_NONE;
}

View File

@ -22,7 +22,7 @@
#include "international_string_util.h"
#include "unknown_task.h"
#include "trig.h"
#include "rng.h"
#include "random.h"
#include "event_data.h"
#include "overworld.h"
@ -581,9 +581,9 @@ static void Task_Hof_SetMonDisplayTask(u8 taskId)
gTasks[taskId].func = Task_Hof_DisplayMon;
}
#define tDestinationX data1
#define tDestinationY data2
#define tSpecies data7
#define tDestinationX data[1]
#define tDestinationY data[2]
#define tSpecies data[7]
static void Task_Hof_DisplayMon(u8 taskId)
{
@ -614,7 +614,7 @@ static void Task_Hof_DisplayMon(u8 taskId)
spriteId = sub_818D3E4(currMon->species, currMon->tid, currMon->personality, 1, xPos, yPos, currMonId, 0xFFFF);
gSprites[spriteId].tDestinationX = field4;
gSprites[spriteId].tDestinationY = field6;
gSprites[spriteId].data0 = 0;
gSprites[spriteId].data[0] = 0;
gSprites[spriteId].tSpecies = currMon->species;
gSprites[spriteId].callback = SpriteCB_GetOnScreenAndAnimate;
gTasks[taskId].tMonSpriteId(currMonId) = spriteId;
@ -1405,13 +1405,13 @@ static void sub_81751A4(struct Sprite* sprite)
u8 tableID;
sprite->pos2.y++;
sprite->pos2.y += sprite->data1;
sprite->pos2.y += sprite->data[1];
tableID = sprite->data0;
tableID = sprite->data[0];
rand = (Random() % 4) + 8;
sprite->pos2.x = rand * gSineTable[tableID] / 256;
sprite->data0 += 4;
sprite->data[0] += 4;
}
}
@ -1429,9 +1429,9 @@ static bool8 sub_81751FC(void)
StartSpriteAnim(sprite, Random() % 17);
if (Random() & 3)
sprite->data1 = 0;
sprite->data[1] = 0;
else
sprite->data1 = 1;
sprite->data[1] = 1;
return FALSE;
}

View File

@ -8,7 +8,7 @@
#include "rom6.h"
#include "event_data.h"
#include "script.h"
#include "rng.h"
#include "random.h"
#include "string_util.h"
#include "item.h"
#include "constants/items.h"

View File

@ -3,7 +3,7 @@
#include "load_save.h"
#include "main.h"
#include "pokemon.h"
#include "rng.h"
#include "random.h"
extern void* gUnknown_0203CF5C;

View File

@ -3,7 +3,7 @@
#include "event_data.h"
#include "pokemon.h"
#include "constants/items.h"
#include "rng.h"
#include "random.h"
#include "species.h"
#include "string_util.h"
#include "text.h"

View File

@ -2,7 +2,7 @@
#include "main.h"
#include "m4a.h"
#include "rtc.h"
#include "rng.h"
#include "random.h"
#include "dma3.h"
#include "gba/flash_internal.h"
#include "battle.h"

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "new_game.h"
#include "rng.h"
#include "random.h"
#include "pokemon.h"
#include "roamer.h"
#include "pokemon_size_record.h"

1282
src/pokeball.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "pokemon.h"
#include "rng.h"
#include "random.h"
#include "main.h"
#include "constants/items.h"
#include "string_util.h"

View File

@ -2,7 +2,7 @@
#include "pokemon.h"
#include "battle.h"
#include "event_data.h"
#include "rng.h"
#include "random.h"
#include "sprite.h"
#include "species.h"
#include "text.h"

View File

@ -10,7 +10,7 @@
#include "species.h"
#include "link.h"
#include "constants/hold_effects.h"
#include "rng.h"
#include "random.h"
#include "trainer_classes.h"
#include "trainer_ids.h"
#include "songs.h"

View File

@ -937,7 +937,7 @@ void sub_81C0704(u8 taskId)
gUnknown_0203CF1C->unk40D3 = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &data[1]);
if (gUnknown_0203CF1C->unk40D3 == 0xFF)
return;
gSprites[gUnknown_0203CF1C->unk40D3].data2 = 1;
gSprites[gUnknown_0203CF1C->unk40D3].data[2] = 1;
sub_81C0E24();
data[1] = 0;
break;
@ -952,7 +952,7 @@ void sub_81C0704(u8 taskId)
sub_81C2524();
break;
case 12:
gSprites[gUnknown_0203CF1C->unk40D3].data2 = 0;
gSprites[gUnknown_0203CF1C->unk40D3].data[2] = 0;
break;
default:
if (sub_81221EC() == 0 && FuncIsActiveTask(sub_81C20F0) == 0)

View File

@ -1,5 +1,5 @@
#include "global.h"
#include "rng.h"
#include "random.h"
// The number 1103515245 comes from the example implementation of rand and srand
// in the ISO C standard.

View File

@ -3,7 +3,7 @@
#include "recorded_battle.h"
#include "main.h"
#include "pokemon.h"
#include "rng.h"
#include "random.h"
#include "event_data.h"
#include "link.h"
#include "string_util.h"

View File

@ -1332,9 +1332,9 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag)
gRegionMap->cursorSprite->pos1.x = 8 * gRegionMap->cursorPosX + 4;
gRegionMap->cursorSprite->pos1.y = 8 * gRegionMap->cursorPosY + 4;
}
gRegionMap->cursorSprite->data1 = 2;
gRegionMap->cursorSprite->data2 = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101;
gRegionMap->cursorSprite->data3 = TRUE;
gRegionMap->cursorSprite->data[1] = 2;
gRegionMap->cursorSprite->data[2] = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101;
gRegionMap->cursorSprite->data[3] = TRUE;
}
}
@ -1350,12 +1350,12 @@ static void FreeRegionMapCursorSprite(void)
void sub_8124268(void)
{
gRegionMap->cursorSprite->data3 = TRUE;
gRegionMap->cursorSprite->data[3] = TRUE;
}
void sub_8124278(void)
{
gRegionMap->cursorSprite->data3 = FALSE;
gRegionMap->cursorSprite->data[3] = FALSE;
}
void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag)
@ -1429,17 +1429,17 @@ static void RegionMapPlayerIconSpriteCallback_Zoomed(struct Sprite *sprite)
{
sprite->pos2.x = -2 * gRegionMap->scrollX;
sprite->pos2.y = -2 * gRegionMap->scrollY;
sprite->data0 = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY;
sprite->data1 = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX;
if (sprite->data0 < -8 || sprite->data0 > 0xa8 || sprite->data1 < -8 || sprite->data1 > 0xf8)
sprite->data[0] = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY;
sprite->data[1] = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX;
if (sprite->data[0] < -8 || sprite->data[0] > 0xa8 || sprite->data[1] < -8 || sprite->data[1] > 0xf8)
{
sprite->data2 = FALSE;
sprite->data[2] = FALSE;
}
else
{
sprite->data2 = TRUE;
sprite->data[2] = TRUE;
}
if (sprite->data2 == TRUE)
if (sprite->data[2] == TRUE)
{
RegionMapPlayerIconSpriteCallback(sprite);
}
@ -1458,9 +1458,9 @@ static void RegionMapPlayerIconSpriteCallback(struct Sprite *sprite)
{
if (gRegionMap->blinkPlayerIcon)
{
if (++sprite->data7 > 16)
if (++sprite->data[7] > 16)
{
sprite->data7 = 0;
sprite->data[7] = 0;
sprite->invisible = sprite->invisible ? FALSE : TRUE;
}
}
@ -1790,7 +1790,7 @@ static void sub_8124AD4(void)
shape += 3;
}
StartSpriteAnim(&gSprites[spriteId], shape);
gSprites[spriteId].data0 = i;
gSprites[spriteId].data[0] = i;
}
canFlyFlag++;
}
@ -1820,7 +1820,7 @@ static void sub_8124BE4(void)
gSprites[spriteId].oam.size = 1;
gSprites[spriteId].callback = sub_8124CBC;
StartSpriteAnim(&gSprites[spriteId], 6);
gSprites[spriteId].data0 = mapSecId;
gSprites[spriteId].data[0] = mapSecId;
}
}
}
@ -1828,17 +1828,17 @@ static void sub_8124BE4(void)
static void sub_8124CBC(struct Sprite *sprite)
{
if (gUnknown_0203A148->regionMap.mapSecId == sprite->data0)
if (gUnknown_0203A148->regionMap.mapSecId == sprite->data[0])
{
if (++sprite->data1 > 16)
if (++sprite->data[1] > 16)
{
sprite->data1 = 0;
sprite->data[1] = 0;
sprite->invisible = sprite->invisible ? FALSE : TRUE;
}
}
else
{
sprite->data1 = 16;
sprite->data[1] = 16;
sprite->invisible = FALSE;
}
}

View File

@ -42,7 +42,7 @@ extern u8 GetBankSpriteDefault_Y(u8 bank);
extern u8 sub_80A82E4(u8 bank);
extern void sub_806A068(u16 species, u8 bankIdentity);
extern void sub_806A12C(u16 backPicId, u8 bankIdentity);
extern u8 sub_80A5C6C(u8 bank, u8 caseId);
extern u8 GetBankPosition(u8 bank, u8 caseId);
// this file's functions
static void CB2_ReshowBattleScreenAfterMenu(void);
@ -260,11 +260,11 @@ static void CreateBankSprite(u8 bank)
return;
sub_806A068(GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(bank, 2), posY, sub_80A82E4(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM)
@ -278,7 +278,7 @@ static void CreateBankSprite(u8 bank)
sub_80A82E4(0));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
}
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
{
@ -288,7 +288,7 @@ static void CreateBankSprite(u8 bank)
sub_80A82E4(0));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
}
else
{
@ -296,11 +296,11 @@ static void CreateBankSprite(u8 bank)
return;
sub_806A068(GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(bank, 2), posY, sub_80A82E4(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM)

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "roamer.h"
#include "pokemon.h"
#include "rng.h"
#include "random.h"
#include "species.h"
#include "event_data.h"

View File

@ -34,7 +34,7 @@
#include "party_menu.h"
#include "pokemon_3.h"
#include "pokemon_storage_system.h"
#include "rng.h"
#include "random.h"
#include "overworld.h"
#include "rtc.h"
#include "script.h"

View File

@ -168,14 +168,7 @@ static const struct Sprite sDummySprite =
.animPaused = 0,
.affineAnimPaused = 0,
.animLoopCounter = 0,
.data0 = 0,
.data1 = 0,
.data2 = 0,
.data3 = 0,
.data4 = 0,
.data5 = 0,
.data6 = 0,
.data7 = 0,
.data = {0, 0, 0, 0, 0, 0, 0},
.inUse = 0,
.coordOffsetEnabled = 0,
.invisible = 0,
@ -1075,7 +1068,7 @@ void BeginAffineAnim(struct Sprite *sprite)
ApplyAffineAnimFrame(matrixNum, &frameCmd);
sAffineAnimStates[matrixNum].delayCounter = frameCmd.duration;
if (sprite->flags_f)
obj_update_pos2(sprite, sprite->data6, sprite->data7);
obj_update_pos2(sprite, sprite->data[6], sprite->data[7]);
}
}
@ -1101,7 +1094,7 @@ void ContinueAffineAnim(struct Sprite *sprite)
sAffineAnimCmdFuncs[funcIndex](matrixNum, sprite);
}
if (sprite->flags_f)
obj_update_pos2(sprite, sprite->data6, sprite->data7);
obj_update_pos2(sprite, sprite->data[6], sprite->data[7]);
}
}
@ -1197,8 +1190,8 @@ u8 GetSpriteMatrixNum(struct Sprite *sprite)
void sub_8007E18(struct Sprite* sprite, s16 a2, s16 a3)
{
sprite->data6 = a2;
sprite->data7 = a3;
sprite->data[6] = a2;
sprite->data[7] = a3;
sprite->flags_f = 1;
}

View File

@ -170,20 +170,20 @@ void CB2_ChooseStarter(void)
// Create hand sprite
spriteId = CreateSprite(&sSpriteTemplate_Hand, 120, 56, 2);
gSprites[spriteId].data0 = taskId;
gSprites[spriteId].data[0] = taskId;
// Create three Pokeball sprites
spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[0][0], sPokeballCoords[0][1], 2);
gSprites[spriteId].data0 = taskId;
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[0] = taskId;
gSprites[spriteId].data[1] = 0;
spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[1][0], sPokeballCoords[1][1], 2);
gSprites[spriteId].data0 = taskId;
gSprites[spriteId].data1 = 1;
gSprites[spriteId].data[0] = taskId;
gSprites[spriteId].data[1] = 1;
spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[2][0], sPokeballCoords[2][1], 2);
gSprites[spriteId].data0 = taskId;
gSprites[spriteId].data1 = 2;
gSprites[spriteId].data[0] = taskId;
gSprites[spriteId].data[1] = 2;
sStarterChooseWindowId = 0xFF;
}
@ -363,15 +363,15 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y)
static void sub_81346DC(struct Sprite *sprite)
{
sprite->pos1.x = gUnknown_085B1E28[gTasks[sprite->data0].tStarterSelection][0];
sprite->pos1.y = gUnknown_085B1E28[gTasks[sprite->data0].tStarterSelection][1];
sprite->pos2.y = Sin(sprite->data1, 8);
sprite->data1 = (u8)(sprite->data1) + 4;
sprite->pos1.x = gUnknown_085B1E28[gTasks[sprite->data[0]].tStarterSelection][0];
sprite->pos1.y = gUnknown_085B1E28[gTasks[sprite->data[0]].tStarterSelection][1];
sprite->pos2.y = Sin(sprite->data[1], 8);
sprite->data[1] = (u8)(sprite->data[1]) + 4;
}
static void sub_813473C(struct Sprite *sprite)
{
if (gTasks[sprite->data0].tStarterSelection == sprite->data1)
if (gTasks[sprite->data[0]].tStarterSelection == sprite->data[1])
StartSpriteAnimIfDifferent(sprite, 1);
else
StartSpriteAnimIfDifferent(sprite, 0);

View File

@ -4,7 +4,7 @@
#include "rtc.h"
#include "overworld.h"
#include "constants/maps.h"
#include "rng.h"
#include "random.h"
#include "event_data.h"
#include "fieldmap.h"
#include "field_camera.h"

View File

@ -4,7 +4,7 @@
#include "species.h"
#include "metatile_behavior.h"
#include "fieldmap.h"
#include "rng.h"
#include "random.h"
#include "constants/maps.h"
#include "field_player_avatar.h"
#include "constants/abilities.h"

View File

@ -12,7 +12,7 @@
.include "src/egg_hatch.o"
.include "src/berry_blender.o"
.include "src/play_time.o"
.include "src/rom4.o"
.include "src/overworld.o"
.include "src/field_camera.o"
.include "src/script.o"
.include "src/scrcmd.o"

View File

@ -543,7 +543,7 @@ gUnknown_0202499C: @ 202499C
gUnknown_020249B4: @ 20249B4
.space 0x8
.include "src/rng.o"
.include "src/random.o"
.include "src/daycare.o"
.include "src/load_save.o"