Merge branch 'master' of https://github.com/pret/pokeemerald into decompile_party_menu

This commit is contained in:
golem galvanize 2018-12-18 05:31:39 -05:00
commit c259ee46d3
45 changed files with 5467 additions and 11783 deletions

View File

@ -253,7 +253,7 @@ _0815A2B2:
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0 movs r1, 0
adds r2, r3, 0 adds r2, r3, 0
bl sub_80A73E0 bl TrySetSpriteRotScale
ldr r0, =gBattleAnimArgs ldr r0, =gBattleAnimArgs
ldrh r0, [r0, 0x4] ldrh r0, [r0, 0x4]
strh r0, [r5, 0x2E] strh r0, [r5, 0x2E]
@ -879,7 +879,7 @@ _0815A7AC:
sub_815A7B0: @ 815A7B0 sub_815A7B0: @ 815A7B0
push {r4,r5,lr} push {r4,r5,lr}
adds r4, r0, 0 adds r4, r0, 0
bl sub_80A6838 bl SetSpriteCoordsToAnimAttackerCoords
ldr r5, =gBattleAnimArgs ldr r5, =gBattleAnimArgs
movs r0, 0 movs r0, 0
ldrsh r1, [r5, r0] ldrsh r1, [r5, r0]
@ -889,7 +889,7 @@ sub_815A7B0: @ 815A7B0
ldrh r1, [r4, 0x22] ldrh r1, [r4, 0x22]
adds r0, r1 adds r0, r1
strh r0, [r4, 0x22] strh r0, [r4, 0x22]
ldr r0, =sub_80A67D8 ldr r0, =RunStoredCallbackWhenAnimEnds
str r0, [r4, 0x1C] str r0, [r4, 0x1C]
ldr r1, =DestroyAnimSprite ldr r1, =DestroyAnimSprite
adds r0, r4, 0 adds r0, r4, 0
@ -909,7 +909,7 @@ sub_815A7EC: @ 815A7EC
cmp r0, 0 cmp r0, 0
bne _0815A84C bne _0815A84C
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A6838 bl SetSpriteCoordsToAnimAttackerCoords
ldr r5, =gBattleAnimArgs ldr r5, =gBattleAnimArgs
movs r2, 0 movs r2, 0
ldrsh r1, [r5, r2] ldrsh r1, [r5, r2]
@ -2050,7 +2050,7 @@ _0815B138:
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE2A0 ldr r2, =gUnknown_085CE2A0
adds r0, r6, 0 adds r0, r6, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldrh r0, [r6, 0xA] ldrh r0, [r6, 0xA]
adds r0, 0x1 adds r0, 0x1
strh r0, [r6, 0xA] strh r0, [r6, 0xA]
@ -2059,7 +2059,7 @@ _0815B138:
.pool .pool
_0815B160: _0815B160:
adds r0, r6, 0 adds r0, r6, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
cmp r0, 0 cmp r0, 0
@ -2326,7 +2326,7 @@ _0815B35C:
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE350 ldr r2, =gUnknown_085CE350
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldrh r0, [r4, 0x8] ldrh r0, [r4, 0x8]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0x8] strh r0, [r4, 0x8]
@ -2334,7 +2334,7 @@ _0815B35C:
.pool .pool
_0815B37C: _0815B37C:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _0815B38E bne _0815B38E
@ -2385,7 +2385,7 @@ _0815B3BE:
strh r0, [r5, 0x22] strh r0, [r5, 0x22]
adds r0, r6, 0 adds r0, r6, 0
movs r1, 0 movs r1, 0
bl sub_80A7270 bl PrepareBattlerSpriteForRotScale
movs r0, 0x80 movs r0, 0x80
lsls r0, 1 lsls r0, 1
strh r0, [r5, 0x30] strh r0, [r5, 0x30]
@ -2405,7 +2405,7 @@ _0815B3F4:
ldrsh r2, [r5, r0] ldrsh r2, [r5, r0]
adds r0, r6, 0 adds r0, r6, 0
movs r3, 0 movs r3, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r5, 0x34] ldrh r0, [r5, 0x34]
adds r0, 0x1 adds r0, 0x1
strh r0, [r5, 0x34] strh r0, [r5, 0x34]
@ -2429,7 +2429,7 @@ _0815B424:
ldrsh r2, [r5, r0] ldrsh r2, [r5, r0]
adds r0, r6, 0 adds r0, r6, 0
movs r3, 0 movs r3, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r5, 0x34] ldrh r0, [r5, 0x34]
adds r0, 0x1 adds r0, 0x1
strh r0, [r5, 0x34] strh r0, [r5, 0x34]
@ -2450,7 +2450,7 @@ _0815B424:
orrs r1, r2 orrs r1, r2
strb r1, [r0] strb r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl sub_80A7344 bl ResetSpriteRotScale
_0815B46C: _0815B46C:
ldrh r0, [r5, 0x2E] ldrh r0, [r5, 0x2E]
adds r0, 0x1 adds r0, 0x1
@ -2734,7 +2734,7 @@ sub_815B65C: @ 815B65C
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE3B8 ldr r2, =gUnknown_085CE3B8
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldrh r0, [r4, 0x8] ldrh r0, [r4, 0x8]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0x8] strh r0, [r4, 0x8]
@ -2742,7 +2742,7 @@ sub_815B65C: @ 815B65C
.pool .pool
_0815B69C: _0815B69C:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _0815B6AE bne _0815B6AE
@ -2776,7 +2776,7 @@ sub_815B6B4: @ 815B6B4
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE3E0 ldr r2, =gUnknown_085CE3E0
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldrh r0, [r4, 0x8] ldrh r0, [r4, 0x8]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0x8] strh r0, [r4, 0x8]
@ -2784,7 +2784,7 @@ sub_815B6B4: @ 815B6B4
.pool .pool
_0815B6F4: _0815B6F4:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _0815B706 bne _0815B706
@ -2874,7 +2874,7 @@ sub_815B778: @ 815B778
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE430 ldr r2, =gUnknown_085CE430
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldrh r0, [r4, 0x8] ldrh r0, [r4, 0x8]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0x8] strh r0, [r4, 0x8]
@ -2882,7 +2882,7 @@ sub_815B778: @ 815B778
.pool .pool
_0815B7B8: _0815B7B8:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _0815B7CA bne _0815B7CA
@ -4278,7 +4278,7 @@ sub_815C3A8: @ 815C3A8
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE4B0 ldr r2, =gUnknown_085CE4B0
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldrh r0, [r4, 0x8] ldrh r0, [r4, 0x8]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0x8] strh r0, [r4, 0x8]
@ -4286,7 +4286,7 @@ sub_815C3A8: @ 815C3A8
.pool .pool
_0815C3E8: _0815C3E8:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _0815C3FA bne _0815C3FA
@ -4452,7 +4452,7 @@ _0815C528:
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0 movs r1, 0
bl sub_80A7270 bl PrepareBattlerSpriteForRotScale
ldr r0, =sub_815C548 ldr r0, =sub_815C548
str r0, [r4] str r0, [r4]
_0815C538: _0815C538:
@ -4513,11 +4513,11 @@ _0815C57C:
lsls r2, 1 lsls r2, 1
ldrh r3, [r4, 0xC] ldrh r3, [r4, 0xC]
adds r1, r2, 0 adds r1, r2, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A73A0 bl SetBattlerSpriteYOffsetFromRotation
ldrh r0, [r4, 0xA] ldrh r0, [r4, 0xA]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0xA] strh r0, [r4, 0xA]
@ -4553,11 +4553,11 @@ _0815C5D0:
lsls r2, 1 lsls r2, 1
ldrh r3, [r4, 0xC] ldrh r3, [r4, 0xC]
adds r1, r2, 0 adds r1, r2, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A73A0 bl SetBattlerSpriteYOffsetFromRotation
ldrh r1, [r4, 0xA] ldrh r1, [r4, 0xA]
adds r1, 0x1 adds r1, 0x1
strh r1, [r4, 0xA] strh r1, [r4, 0xA]
@ -4596,11 +4596,11 @@ _0815C628:
lsls r2, 1 lsls r2, 1
ldrh r3, [r4, 0xC] ldrh r3, [r4, 0xC]
adds r1, r2, 0 adds r1, r2, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A73A0 bl SetBattlerSpriteYOffsetFromRotation
ldrh r0, [r4, 0xA] ldrh r0, [r4, 0xA]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0xA] strh r0, [r4, 0xA]
@ -4630,7 +4630,7 @@ _0815C698:
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A7344 bl ResetSpriteRotScale
adds r0, r5, 0 adds r0, r5, 0
bl DestroyAnimVisualTask bl DestroyAnimVisualTask
_0815C6A8: _0815C6A8:
@ -4763,7 +4763,7 @@ sub_815C770: @ 815C770
lsrs r0, 24 lsrs r0, 24
strh r0, [r4, 0x26] strh r0, [r4, 0x26]
movs r1, 0 movs r1, 0
bl sub_80A7270 bl PrepareBattlerSpriteForRotScale
ldr r0, =sub_815C7C4 ldr r0, =sub_815C7C4
str r0, [r4] str r0, [r4]
pop {r4} pop {r4}
@ -4907,7 +4907,7 @@ _0815C8C8:
ldrh r0, [r7, 0x26] ldrh r0, [r7, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A7344 bl ResetSpriteRotScale
adds r0, r4, 0 adds r0, r4, 0
bl DestroyAnimVisualTask bl DestroyAnimVisualTask
b _0815C950 b _0815C950
@ -4919,11 +4919,11 @@ _0815C8DA:
lsls r2, 1 lsls r2, 1
ldrh r3, [r7, 0xC] ldrh r3, [r7, 0xC]
adds r1, r2, 0 adds r1, r2, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r7, 0x26] ldrh r0, [r7, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A73A0 bl SetBattlerSpriteYOffsetFromRotation
ldr r2, =gSprites ldr r2, =gSprites
movs r0, 0x26 movs r0, 0x26
ldrsh r1, [r7, r0] ldrsh r1, [r7, r0]
@ -5121,7 +5121,7 @@ _0815CA5E:
strh r5, [r6, 0x1C] strh r5, [r6, 0x1C]
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0 movs r1, 0
bl sub_80A7270 bl PrepareBattlerSpriteForRotScale
mov r2, r8 mov r2, r8
movs r3, 0x2 movs r3, 0x2
ldrsh r0, [r2, r3] ldrsh r0, [r2, r3]
@ -5145,9 +5145,9 @@ _0815CAA8:
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0xE0 movs r1, 0xE0
movs r3, 0 movs r3, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
adds r0, r5, 0 adds r0, r5, 0
bl sub_80A7E6C bl SetBattlerSpriteYOffsetFromYScale
lsls r2, r5, 4 lsls r2, r5, 4
b _0815CB08 b _0815CB08
_0815CAC0: _0815CAC0:
@ -5164,9 +5164,9 @@ _0815CACA:
_0815CAD2: _0815CAD2:
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0xD0 movs r1, 0xD0
bl obj_id_set_rotscale bl SetSpriteRotScale
adds r0, r5, 0 adds r0, r5, 0
bl sub_80A7E6C bl SetBattlerSpriteYOffsetFromYScale
bl IsContest bl IsContest
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
@ -5230,7 +5230,7 @@ _0815CB50:
cmp r0, 0xD cmp r0, 0xD
bne _0815CB78 bne _0815CB78
adds r0, r5, 0 adds r0, r5, 0
bl sub_80A7344 bl ResetSpriteRotScale
ldr r1, =gSprites ldr r1, =gSprites
lsls r0, r5, 4 lsls r0, r5, 4
adds r0, r5 adds r0, r5
@ -5588,14 +5588,14 @@ sub_815CDFC: @ 815CDFC
_0815CE36: _0815CE36:
ldr r0, =gBattleAnimAttacker ldr r0, =gBattleAnimAttacker
ldrb r0, [r0] ldrb r0, [r0]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
subs r0, 0x1 subs r0, 0x1
b _0815CE52 b _0815CE52
.pool .pool
_0815CE48: _0815CE48:
ldr r0, =gBattleAnimAttacker ldr r0, =gBattleAnimAttacker
ldrb r0, [r0] ldrb r0, [r0]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
adds r0, 0x1 adds r0, 0x1
_0815CE52: _0815CE52:
adds r1, r4, 0 adds r1, r4, 0
@ -6034,7 +6034,7 @@ sub_815D1BC: @ 815D1BC
str r4, [sp] str r4, [sp]
adds r0, r6, 0 adds r0, r6, 0
movs r1, 0x1 movs r1, 0x1
bl sub_80A73E0 bl TrySetSpriteRotScale
ldrh r0, [r5, 0x20] ldrh r0, [r5, 0x20]
adds r0, 0x1 adds r0, 0x1
strh r0, [r5, 0x20] strh r0, [r5, 0x20]
@ -6569,7 +6569,7 @@ sub_815D64C: @ 815D64C
strh r1, [r4, 0x26] strh r1, [r4, 0x26]
ldr r2, =gUnknown_085CE5F0 ldr r2, =gUnknown_085CE5F0
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldr r0, =sub_815D694 ldr r0, =sub_815D694
str r0, [r4] str r0, [r4]
pop {r4} pop {r4}
@ -6638,7 +6638,7 @@ _0815D708:
adds r0, r4 adds r0, r4
lsls r0, 3 lsls r0, 3
adds r0, r6 adds r0, r6
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _0815D720 bne _0815D720
@ -6731,7 +6731,7 @@ sub_815D7B4: @ 815D7B4
adds r4, r0, 0 adds r4, r0, 0
ldrh r6, [r4, 0x20] ldrh r6, [r4, 0x20]
ldrh r5, [r4, 0x22] ldrh r5, [r4, 0x22]
bl sub_80A6838 bl SetSpriteCoordsToAnimAttackerCoords
ldr r0, =gBattleAnimArgs ldr r0, =gBattleAnimArgs
ldrb r1, [r0] ldrb r1, [r0]
adds r0, r4, 0 adds r0, r4, 0
@ -6810,7 +6810,7 @@ sub_815D804: @ 815D804
cmp r0, 0x3 cmp r0, 0x3
ble _0815D86A ble _0815D86A
adds r0, r5, 0 adds r0, r5, 0
bl move_anim_8074EE0 bl DestroySpriteAndMatrix
_0815D86A: _0815D86A:
pop {r4,r5} pop {r4,r5}
pop {r0} pop {r0}
@ -7393,7 +7393,7 @@ _0815DCEA:
lsrs r0, 24 lsrs r0, 24
strh r0, [r5, 0x12] strh r0, [r5, 0x12]
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
strh r0, [r5, 0x14] strh r0, [r5, 0x14]
@ -7406,7 +7406,7 @@ _0815DCEA:
strh r1, [r5, 0x26] strh r1, [r5, 0x26]
ldr r2, =gUnknown_085CE74C ldr r2, =gUnknown_085CE74C
adds r0, r5, 0 adds r0, r5, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldr r0, =sub_815DD48 ldr r0, =sub_815DD48
str r0, [r5] str r0, [r5]
pop {r4,r5} pop {r4,r5}
@ -7454,7 +7454,7 @@ _0815DD82:
bl sub_815DDE0 bl sub_815DDE0
_0815DD92: _0815DD92:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
lsrs r1, r0, 24 lsrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -7476,7 +7476,7 @@ _0815DDB4:
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE74C ldr r2, =gUnknown_085CE74C
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
b _0815DDDA b _0815DDDA
.pool .pool
_0815DDCC: _0815DDCC:
@ -8395,7 +8395,7 @@ _0815E4EE:
ldrsh r6, [r7, r1] ldrsh r6, [r7, r1]
mov r1, r8 mov r1, r8
ldrb r0, [r1] ldrb r0, [r1]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
adds r3, r0, 0 adds r3, r0, 0
subs r3, 0x5 subs r3, 0x5
lsls r3, 24 lsls r3, 24
@ -8834,7 +8834,7 @@ _0815E85C:
strh r1, [r4, 0x26] strh r1, [r4, 0x26]
ldr r2, =gUnknown_085CE87C ldr r2, =gUnknown_085CE87C
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldr r0, =sub_815E898 ldr r0, =sub_815E898
str r0, [r4] str r0, [r4]
_0815E884: _0815E884:
@ -8891,7 +8891,7 @@ _0815E8F0:
strh r1, [r0, 0x24] strh r1, [r0, 0x24]
_0815E8F2: _0815E8F2:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
lsrs r5, r0, 24 lsrs r5, r0, 24
cmp r5, 0 cmp r5, 0
@ -8919,7 +8919,7 @@ _0815E8F2:
lsls r1, 24 lsls r1, 24
lsrs r1, 24 lsrs r1, 24
ldr r2, =gUnknown_085CE87C ldr r2, =gUnknown_085CE87C
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
strh r5, [r4, 0xA] strh r5, [r4, 0xA]
strh r5, [r4, 0xC] strh r5, [r4, 0xC]
b _0815E94E b _0815E94E
@ -10075,7 +10075,7 @@ AnimTask_MonToSubstitute: @ 815F20C
bne _0815F254 bne _0815F254
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0 movs r1, 0
bl sub_80A7270 bl PrepareBattlerSpriteForRotScale
movs r0, 0x80 movs r0, 0x80
lsls r0, 1 lsls r0, 1
strh r0, [r4, 0xA] strh r0, [r4, 0xA]
@ -10097,7 +10097,7 @@ _0815F254:
ldrsh r2, [r4, r0] ldrsh r2, [r4, r0]
adds r0, r5, 0 adds r0, r5, 0
movs r3, 0 movs r3, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r4, 0xE] ldrh r0, [r4, 0xE]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0xE] strh r0, [r4, 0xE]
@ -10108,7 +10108,7 @@ _0815F254:
movs r0, 0 movs r0, 0
strh r0, [r4, 0xE] strh r0, [r4, 0xE]
adds r0, r5, 0 adds r0, r5, 0
bl sub_80A7344 bl ResetSpriteRotScale
ldr r1, =gSprites ldr r1, =gSprites
lsls r0, r5, 4 lsls r0, r5, 4
adds r0, r5 adds r0, r5
@ -10367,7 +10367,7 @@ sub_815F48C: @ 815F48C
cmp r0, 0 cmp r0, 0
bne _0815F4B8 bne _0815F4B8
ldrb r0, [r4] ldrb r0, [r4]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
subs r0, 0x2 subs r0, 0x2
adds r1, r5, 0 adds r1, r5, 0
adds r1, 0x43 adds r1, 0x43
@ -10377,7 +10377,7 @@ sub_815F48C: @ 815F48C
.pool .pool
_0815F4B8: _0815F4B8:
ldrb r0, [r4] ldrb r0, [r4]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
adds r0, 0x2 adds r0, 0x2
adds r1, r5, 0 adds r1, r5, 0
adds r1, 0x43 adds r1, 0x43
@ -10566,7 +10566,7 @@ sub_815F620: @ 815F620
cmp r7, 0 cmp r7, 0
bne _0815F66E bne _0815F66E
movs r0, 0x1 movs r0, 0x1
bl duplicate_obj_of_side_rel2move_in_transparent_mode bl CloneBattlerSpriteWithBlend
lsls r0, 16 lsls r0, 16
lsrs r1, r0, 16 lsrs r1, r0, 16
mov r10, r1 mov r10, r1
@ -10574,7 +10574,7 @@ sub_815F620: @ 815F620
cmp r6, 0 cmp r6, 0
blt _0815F66E blt _0815F66E
movs r0, 0x1 movs r0, 0x1
bl duplicate_obj_of_side_rel2move_in_transparent_mode bl CloneBattlerSpriteWithBlend
lsls r0, 16 lsls r0, 16
lsrs r1, r0, 16 lsrs r1, r0, 16
mov r9, r1 mov r9, r1
@ -11038,7 +11038,7 @@ _0815F9F4:
ldrh r6, [r0] ldrh r6, [r0]
ldr r0, =gBattleAnimAttacker ldr r0, =gBattleAnimAttacker
ldrb r0, [r0] ldrb r0, [r0]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
movs r7, 0 movs r7, 0
@ -12329,7 +12329,7 @@ _081604DA:
b _081604E8 b _081604E8
_081604E2: _081604E2:
adds r0, r4, 0 adds r0, r4, 0
bl move_anim_8074EE0 bl DestroySpriteAndMatrix
_081604E8: _081604E8:
pop {r4} pop {r4}
pop {r0} pop {r0}
@ -12403,7 +12403,7 @@ sub_8160544: @ 8160544
strh r1, [r4, 0x26] strh r1, [r4, 0x26]
ldr r2, =gUnknown_085CE9C8 ldr r2, =gUnknown_085CE9C8
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldr r0, =sub_816058C ldr r0, =sub_816058C
str r0, [r4] str r0, [r4]
pop {r4} pop {r4}
@ -12472,7 +12472,7 @@ _08160600:
adds r0, r4 adds r0, r4
lsls r0, 3 lsls r0, 3
adds r0, r6 adds r0, r6
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _08160618 bne _08160618

File diff suppressed because it is too large Load Diff

View File

@ -447,7 +447,7 @@ sub_8113A58: @ 8113A58
cmp r0, 0 cmp r0, 0
bne _08113A8A bne _08113A8A
adds r0, r3, 0 adds r0, r3, 0
bl move_anim_8074EE0 bl DestroySpriteAndMatrix
_08113A8A: _08113A8A:
pop {r0} pop {r0}
bx r0 bx r0
@ -581,7 +581,7 @@ sub_8113B90: @ 8113B90
cmp r0, 0 cmp r0, 0
beq _08113BA4 beq _08113BA4
adds r0, r4, 0 adds r0, r4, 0
bl move_anim_8074EE0 bl DestroySpriteAndMatrix
_08113BA4: _08113BA4:
pop {r4} pop {r4}
pop {r0} pop {r0}
@ -1684,7 +1684,7 @@ sub_81144BC: @ 81144BC
ldrb r1, [r1, 0x4] ldrb r1, [r1, 0x4]
adds r0, r4, 0 adds r0, r4, 0
bl StartSpriteAnim bl StartSpriteAnim
ldr r0, =sub_80A67D8 ldr r0, =RunStoredCallbackWhenAnimEnds
str r0, [r4, 0x1C] str r0, [r4, 0x1C]
ldr r1, =DestroyAnimSprite ldr r1, =DestroyAnimSprite
adds r0, r4, 0 adds r0, r4, 0
@ -1895,7 +1895,7 @@ _0811465C:
bne _08114708 bne _08114708
adds r0, r1, 0 adds r0, r1, 0
movs r1, 0 movs r1, 0
bl sub_80A750C bl SetGreyscaleOrOriginalPalette
b _08114714 b _08114714
.pool .pool
_08114708: _08114708:
@ -1984,7 +1984,7 @@ _08114776:
bne _081147B8 bne _081147B8
adds r0, r1, 0 adds r0, r1, 0
movs r1, 0x1 movs r1, 0x1
bl sub_80A750C bl SetGreyscaleOrOriginalPalette
_081147B8: _081147B8:
movs r0, 0x8 movs r0, 0x8
ldrsh r1, [r4, r0] ldrsh r1, [r4, r0]
@ -2159,7 +2159,7 @@ _0811492E:
adds r0, 0x10 adds r0, 0x10
ldr r1, =gBattleAnimArgs ldr r1, =gBattleAnimArgs
ldrb r1, [r1, 0x2] ldrb r1, [r1, 0x2]
bl sub_80A750C bl SetGreyscaleOrOriginalPalette
_0811494A: _0811494A:
adds r0, r5, 0 adds r0, r5, 0
bl DestroyAnimVisualTask bl DestroyAnimVisualTask

File diff suppressed because it is too large Load Diff

View File

@ -201,7 +201,7 @@ _0810DFC8:
strh r0, [r6, 0x36] strh r0, [r6, 0x36]
adds r0, r6, 0 adds r0, r6, 0
bl InitAnimLinearTranslation bl InitAnimLinearTranslation
ldr r0, =sub_80A67BC ldr r0, =RunStoredCallbackWhenAffineAnimEnds
str r0, [r6, 0x1C] str r0, [r6, 0x1C]
ldr r1, =sub_810E028 ldr r1, =sub_810E028
adds r0, r6, 0 adds r0, r6, 0
@ -2056,7 +2056,7 @@ _0810EE42:
str r0, [sp] str r0, [sp]
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0 movs r1, 0
bl sub_80A73E0 bl TrySetSpriteRotScale
ldrh r0, [r5, 0x2E] ldrh r0, [r5, 0x2E]
adds r0, 0x1 adds r0, 0x1
strh r0, [r5, 0x2E] strh r0, [r5, 0x2E]
@ -2085,7 +2085,7 @@ _0810EE92:
ldrsh r3, [r5, r0] ldrsh r3, [r5, r0]
str r1, [sp] str r1, [sp]
adds r0, r5, 0 adds r0, r5, 0
bl sub_80A73E0 bl TrySetSpriteRotScale
ldrb r1, [r5, 0x3] ldrb r1, [r5, 0x3]
lsls r1, 26 lsls r1, 26
lsrs r1, 27 lsrs r1, 27
@ -2409,7 +2409,7 @@ sub_810F084: @ 810F084
mov r0, r8 mov r0, r8
movs r1, 0x1 movs r1, 0x1
adds r2, r3, 0 adds r2, r3, 0
bl sub_80A73E0 bl TrySetSpriteRotScale
ldr r0, =sub_810F140 ldr r0, =sub_810F140
mov r2, r8 mov r2, r8
str r0, [r2, 0x1C] str r0, [r2, 0x1C]
@ -2456,7 +2456,7 @@ sub_810F140: @ 810F140
bge _0810F180 bge _0810F180
_0810F17A: _0810F17A:
adds r0, r2, 0 adds r0, r2, 0
bl move_anim_8074EE0 bl DestroySpriteAndMatrix
_0810F180: _0810F180:
pop {r0} pop {r0}
bx r0 bx r0

View File

@ -355,7 +355,7 @@ sub_810B8AC: @ 810B8AC
ldr r1, =DestroyAnimSprite ldr r1, =DestroyAnimSprite
adds r0, r4, 0 adds r0, r4, 0
bl StoreSpriteCallbackInData6 bl StoreSpriteCallbackInData6
ldr r1, =sub_80A634C ldr r1, =TranslateSpriteInGrowingCircleOverDuration
str r1, [r4, 0x1C] str r1, [r4, 0x1C]
adds r0, r4, 0 adds r0, r4, 0
bl _call_via_r1 bl _call_via_r1
@ -466,7 +466,7 @@ _0810B9C6:
ldr r1, =sub_810B9E8 ldr r1, =sub_810B9E8
adds r0, r4, 0 adds r0, r4, 0
bl StoreSpriteCallbackInData6 bl StoreSpriteCallbackInData6
ldr r0, =sub_80A67BC ldr r0, =RunStoredCallbackWhenAffineAnimEnds
str r0, [r4, 0x1C] str r0, [r4, 0x1C]
pop {r4,r5} pop {r4,r5}
pop {r0} pop {r0}
@ -501,7 +501,7 @@ sub_810B9E8: @ 810B9E8
cmp r0, 0x14 cmp r0, 0x14
bne _0810BA1E bne _0810BA1E
adds r0, r3, 0 adds r0, r3, 0
bl move_anim_8074EE0 bl DestroySpriteAndMatrix
_0810BA1E: _0810BA1E:
pop {r0} pop {r0}
bx r0 bx r0
@ -2816,7 +2816,7 @@ sub_810CD1C: @ 810CD1C
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x1 movs r1, 0x1
bl StartSpriteAnim bl StartSpriteAnim
ldr r0, =sub_80A67D8 ldr r0, =RunStoredCallbackWhenAnimEnds
str r0, [r4, 0x1C] str r0, [r4, 0x1C]
ldr r1, =DestroyAnimSprite ldr r1, =DestroyAnimSprite
adds r0, r4, 0 adds r0, r4, 0

View File

@ -535,7 +535,7 @@ _0810F618:
cmp r0, 0 cmp r0, 0
beq _0810F62C beq _0810F62C
adds r0, r4, 0 adds r0, r4, 0
bl move_anim_8074EE0 bl DestroySpriteAndMatrix
_0810F62C: _0810F62C:
pop {r4-r6} pop {r4-r6}
pop {r0} pop {r0}
@ -589,7 +589,7 @@ _0810F692:
ldr r1, =DestroyAnimSprite ldr r1, =DestroyAnimSprite
adds r0, r5, 0 adds r0, r5, 0
bl StoreSpriteCallbackInData6 bl StoreSpriteCallbackInData6
ldr r0, =sub_80A67D8 ldr r0, =RunStoredCallbackWhenAnimEnds
str r0, [r5, 0x1C] str r0, [r5, 0x1C]
pop {r4,r5} pop {r4,r5}
pop {r0} pop {r0}
@ -656,7 +656,7 @@ _0810F722:
ldr r1, =sub_810F740 ldr r1, =sub_810F740
adds r0, r5, 0 adds r0, r5, 0
bl StoreSpriteCallbackInData6 bl StoreSpriteCallbackInData6
ldr r0, =sub_80A67D8 ldr r0, =RunStoredCallbackWhenAnimEnds
str r0, [r5, 0x1C] str r0, [r5, 0x1C]
pop {r4-r7} pop {r4-r7}
pop {r0} pop {r0}
@ -760,7 +760,7 @@ sub_810F7D4: @ 810F7D4
strh r1, [r4, 0x8] strh r1, [r4, 0x8]
ldr r2, =gUnknown_0859675C ldr r2, =gUnknown_0859675C
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldr r0, =sub_810F810 ldr r0, =sub_810F810
str r0, [r4] str r0, [r4]
pop {r4} pop {r4}
@ -779,7 +779,7 @@ sub_810F810: @ 810F810
lsls r0, 3 lsls r0, 3
ldr r1, =gTasks ldr r1, =gTasks
adds r0, r1 adds r0, r1
bl sub_80A7D34 bl RunAffineAnimFromTaskData
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _0810F830 bne _0810F830
@ -823,7 +823,7 @@ _0810F870:
ldrb r1, [r4, 0x8] ldrb r1, [r4, 0x8]
ldr r2, =gUnknown_0859677C ldr r2, =gUnknown_0859677C
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7CFC bl PrepareAffineAnimInTaskData
ldr r0, =sub_810F898 ldr r0, =sub_810F898
str r0, [r4] str r0, [r4]
pop {r4} pop {r4}
@ -852,7 +852,7 @@ sub_810F898: @ 810F898
.pool .pool
_0810F8BC: _0810F8BC:
adds r0, r4, 0 adds r0, r4, 0
bl sub_80A7D34 bl RunAffineAnimFromTaskData
ldrh r0, [r4, 0xC] ldrh r0, [r4, 0xC]
adds r0, 0x1 adds r0, 0x1
strh r0, [r4, 0xC] strh r0, [r4, 0xC]
@ -907,7 +907,7 @@ _0810F900:
lsls r1, 1 lsls r1, 1
strh r1, [r0, 0x20] strh r1, [r0, 0x20]
ldrb r0, [r4, 0x8] ldrb r0, [r4, 0x8]
bl sub_80A7344 bl ResetSpriteRotScale
adds r0, r5, 0 adds r0, r5, 0
bl DestroyAnimVisualTask bl DestroyAnimVisualTask
_0810F936: _0810F936:
@ -1805,7 +1805,7 @@ sub_8110034: @ 8110034
_0811006C: _0811006C:
ldr r1, =gBattleAnimArgs ldr r1, =gBattleAnimArgs
ldrb r0, [r1] ldrb r0, [r1]
bl duplicate_obj_of_side_rel2move_in_transparent_mode bl CloneBattlerSpriteWithBlend
lsls r0, 16 lsls r0, 16
lsrs r1, r0, 16 lsrs r1, r0, 16
mov r9, r1 mov r9, r1
@ -1860,7 +1860,7 @@ _08110094:
lsls r2, 1 lsls r2, 1
adds r1, r2, 0 adds r1, r2, 0
movs r3, 0 movs r3, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrb r3, [r4, 0x1] ldrb r3, [r4, 0x1]
lsrs r1, r3, 6 lsrs r1, r3, 6
ldrb r2, [r4, 0x3] ldrb r2, [r4, 0x3]
@ -1942,14 +1942,14 @@ _08110166:
ldrsh r2, [r4, r1] ldrsh r2, [r4, r1]
adds r1, r2, 0 adds r1, r2, 0
movs r3, 0 movs r3, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldrh r1, [r4, 0x22] ldrh r1, [r4, 0x22]
lsls r1, 24 lsls r1, 24
lsrs r1, 24 lsrs r1, 24
bl sub_80A7EC0 bl SetBattlerSpriteYOffsetFromOtherYScale
movs r2, 0xA movs r2, 0xA
ldrsh r0, [r4, r2] ldrsh r0, [r4, r2]
cmp r0, 0x30 cmp r0, 0x30
@ -1980,14 +1980,14 @@ _081101B8:
ldrsh r2, [r4, r1] ldrsh r2, [r4, r1]
adds r1, r2, 0 adds r1, r2, 0
movs r3, 0 movs r3, 0
bl obj_id_set_rotscale bl SetSpriteRotScale
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldrh r1, [r4, 0x22] ldrh r1, [r4, 0x22]
lsls r1, 24 lsls r1, 24
lsrs r1, 24 lsrs r1, 24
bl sub_80A7EC0 bl SetBattlerSpriteYOffsetFromOtherYScale
movs r2, 0xA movs r2, 0xA
ldrsh r0, [r4, r2] ldrsh r0, [r4, r2]
cmp r0, 0 cmp r0, 0

View File

@ -315,7 +315,7 @@ sub_8107408: @ 8107408
negs r1, r1 negs r1, r1
ands r1, r2 ands r1, r2
strb r1, [r3] strb r1, [r3]
ldr r1, =sub_80A67D8 ldr r1, =RunStoredCallbackWhenAnimEnds
str r1, [r0, 0x1C] str r1, [r0, 0x1C]
ldr r1, =sub_8107430 ldr r1, =sub_8107430
bl StoreSpriteCallbackInData6 bl StoreSpriteCallbackInData6
@ -331,7 +331,7 @@ sub_8107430: @ 8107430
strh r1, [r0, 0x2E] strh r1, [r0, 0x2E]
ldr r1, =WaitAnimForDuration ldr r1, =WaitAnimForDuration
str r1, [r0, 0x1C] str r1, [r0, 0x1C]
ldr r1, =move_anim_8074EE0 ldr r1, =DestroySpriteAndMatrix
bl StoreSpriteCallbackInData6 bl StoreSpriteCallbackInData6
pop {r0} pop {r0}
bx r0 bx r0
@ -711,7 +711,7 @@ sub_8107730: @ 8107730
ldr r6, =0x0000fff6 ldr r6, =0x0000fff6
strh r6, [r4, 0x26] strh r6, [r4, 0x26]
ldrb r0, [r7] ldrb r0, [r7]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
lsls r0, 24 lsls r0, 24
lsrs r5, r0, 24 lsrs r5, r0, 24
bl IsContest bl IsContest
@ -1906,7 +1906,7 @@ sub_81080E4: @ 81080E4
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0 movs r1, 0
bl sub_80A7270 bl PrepareBattlerSpriteForRotScale
ldr r0, =sub_8108140 ldr r0, =sub_8108140
str r0, [r4] str r0, [r4]
pop {r4} pop {r4}
@ -2026,7 +2026,7 @@ _08108222:
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A7E6C bl SetBattlerSpriteYOffsetFromYScale
ldr r2, =gSprites ldr r2, =gSprites
movs r0, 0x26 movs r0, 0x26
ldrsh r1, [r4, r0] ldrsh r1, [r4, r0]
@ -2166,7 +2166,7 @@ _08108320:
ldrh r0, [r4, 0x26] ldrh r0, [r4, 0x26]
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
bl sub_80A7344 bl ResetSpriteRotScale
movs r0, 0x26 movs r0, 0x26
ldrsh r1, [r4, r0] ldrsh r1, [r4, r0]
lsls r0, r1, 4 lsls r0, r1, 4
@ -2286,7 +2286,7 @@ sub_8108408: @ 8108408
lsrs r6, r0, 24 lsrs r6, r0, 24
movs r5, 0xAC movs r5, 0xAC
ldrb r0, [r4] ldrb r0, [r4]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
subs r0, 0x1 subs r0, 0x1
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -3517,7 +3517,7 @@ _08108DE2:
strh r0, [r4, 0x30] strh r0, [r4, 0x30]
ldr r0, =gBattleAnimAttacker ldr r0, =gBattleAnimAttacker
ldrb r0, [r0] ldrb r0, [r0]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
subs r0, 0x1 subs r0, 0x1
adds r1, r4, 0 adds r1, r4, 0
adds r1, 0x43 adds r1, 0x43
@ -3572,7 +3572,7 @@ _08108E58:
strh r0, [r4, 0x30] strh r0, [r4, 0x30]
ldr r0, =gBattleAnimAttacker ldr r0, =gBattleAnimAttacker
ldrb r0, [r0] ldrb r0, [r0]
bl sub_80A82E4 bl GetBattlerSpriteSubpriority
subs r0, 0x1 subs r0, 0x1
adds r1, r4, 0 adds r1, r4, 0
adds r1, 0x43 adds r1, 0x43

View File

@ -1326,7 +1326,7 @@ Move_SWORDS_DANCE:
setalpha 12, 8 setalpha 12, 8
playsewithpan SE_W014, SOUND_PAN_ATTACKER playsewithpan SE_W014, SOUND_PAN_ATTACKER
createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 16, 6, 1, 4 createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 16, 6, 1, 4
createsprite gBattleAnimSpriteTemplate_8593380, ANIM_ATTACKER, 2, 0, 0 createsprite gSwordsDanceBladeSpriteTemplate, ANIM_ATTACKER, 2, 0, 0
delay 22 delay 22
createvisualtask sub_8115D94, 2, ANIM_TAG_SWORD, 2, 2, RGB(18, 31, 31), 16, 0, 0 createvisualtask sub_8115D94, 2, ANIM_TAG_SWORD, 2, 2, RGB(18, 31, 31), 16, 0, 0
waitforvisualfinish waitforvisualfinish
@ -1712,10 +1712,10 @@ Frustration_Strongest:
waitforvisualfinish waitforvisualfinish
delay 20 delay 20
playsewithpan SE_W207B, SOUND_PAN_ATTACKER playsewithpan SE_W207B, SOUND_PAN_ATTACKER
createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28
waitforvisualfinish waitforvisualfinish
playsewithpan SE_W207B, SOUND_PAN_ATTACKER playsewithpan SE_W207B, SOUND_PAN_ATTACKER
createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28
waitforvisualfinish waitforvisualfinish
delay 10 delay 10
createvisualtask AnimTask_SwayMon, 5, 0, 16, 6144, 8, ANIM_ATTACKER createvisualtask AnimTask_SwayMon, 5, 0, 16, 6144, 8, ANIM_ATTACKER
@ -1748,7 +1748,7 @@ Frustration_Strong:
waitforvisualfinish waitforvisualfinish
delay 20 delay 20
playsewithpan SE_W207B, SOUND_PAN_ATTACKER playsewithpan SE_W207B, SOUND_PAN_ATTACKER
createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28
waitforvisualfinish waitforvisualfinish
delay 5 delay 5
createvisualtask sub_815C3A8, 5 createvisualtask sub_815C3A8, 5
@ -1769,7 +1769,7 @@ Frustration_Strong:
goto Frustration_Continue goto Frustration_Continue
Frustration_Medium: Frustration_Medium:
playsewithpan SE_W207B, SOUND_PAN_ATTACKER playsewithpan SE_W207B, SOUND_PAN_ATTACKER
createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28
waitforvisualfinish waitforvisualfinish
delay 5 delay 5
createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 4 createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 4
@ -1843,8 +1843,8 @@ Move_VICE_GRIP:
monbg ANIM_DEF_PARTNER monbg ANIM_DEF_PARTNER
setalpha 12, 8 setalpha 12, 8
playsewithpan SE_W011, SOUND_PAN_TARGET playsewithpan SE_W011, SOUND_PAN_TARGET
createsprite gUnknown_08593590, ANIM_ATTACKER, 2, 0 createsprite gViceGripSpriteTemplate, ANIM_ATTACKER, 2, 0
createsprite gUnknown_08593590, ANIM_ATTACKER, 2, 1 createsprite gViceGripSpriteTemplate, ANIM_ATTACKER, 2, 1
delay 9 delay 9
createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 1, 0, 0, 1, 2 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 1, 0, 0, 1, 2
createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 5, 1 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 5, 1
@ -1861,8 +1861,8 @@ Move_GUILLOTINE:
fadetobgfromset BG_GUILLOTINE_OPPONENT, BG_GUILLOTINE_PLAYER, BG_GUILLOTINE_CONTESTS fadetobgfromset BG_GUILLOTINE_OPPONENT, BG_GUILLOTINE_PLAYER, BG_GUILLOTINE_CONTESTS
waitbgfadein waitbgfadein
playsewithpan SE_W011, SOUND_PAN_TARGET playsewithpan SE_W011, SOUND_PAN_TARGET
createsprite gUnknown_085935D0, ANIM_ATTACKER, 2, 0 createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 0
createsprite gUnknown_085935D0, ANIM_ATTACKER, 2, 1 createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 1
createvisualtask sub_8116620, 10, 4, 2, 0, 16, RGB_BLACK createvisualtask sub_8116620, 10, 4, 2, 0, 16, RGB_BLACK
delay 9 delay 9
createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 23, 1 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 23, 1
@ -2750,10 +2750,10 @@ Move_RAGE:
monbg ANIM_TARGET monbg ANIM_TARGET
setalpha 12, 8 setalpha 12, 8
createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_ATTACKER, RGB_RED, 10, 0, 2 createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_ATTACKER, RGB_RED, 10, 0, 2
createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, -20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, -20, -28
playsewithpan SE_W207B, SOUND_PAN_ATTACKER playsewithpan SE_W207B, SOUND_PAN_ATTACKER
delay 20 delay 20
createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28
playsewithpan SE_W207B, SOUND_PAN_ATTACKER playsewithpan SE_W207B, SOUND_PAN_ATTACKER
waitforvisualfinish waitforvisualfinish
createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 6 createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 6
@ -2803,7 +2803,7 @@ Move_DOUBLE_TEAM:
Move_MINIMIZE: Move_MINIMIZE:
setalpha 10, 8 setalpha 10, 8
createvisualtask sub_8104674, 2 createvisualtask AnimTask_Minimize, 2
loopsewithpan SE_W107, SOUND_PAN_ATTACKER, 34, 3 loopsewithpan SE_W107, SOUND_PAN_ATTACKER, 34, 3
waitforvisualfinish waitforvisualfinish
blendoff blendoff
@ -2872,8 +2872,8 @@ Move_KINESIS:
playsewithpan SE_W060, SOUND_PAN_ATTACKER playsewithpan SE_W060, SOUND_PAN_ATTACKER
call SetPsychicBackground call SetPsychicBackground
createsprite gUnknown_085966DC, ANIM_ATTACKER, 20 createsprite gUnknown_085966DC, ANIM_ATTACKER, 20
createsprite gUnknown_08593344, ANIM_ATTACKER, 19, 32, -8, 0 createsprite gKinesisZapEnergySpriteTemplate, ANIM_ATTACKER, 19, 32, -8, 0
createsprite gUnknown_08593344, ANIM_ATTACKER, 19, 32, 16, 1 createsprite gKinesisZapEnergySpriteTemplate, ANIM_ATTACKER, 19, 32, 16, 1
loopsewithpan SE_W109, SOUND_PAN_ATTACKER, 21, 2 loopsewithpan SE_W109, SOUND_PAN_ATTACKER, 21, 2
delay 60 delay 60
playsewithpan SE_W146, SOUND_PAN_ATTACKER playsewithpan SE_W146, SOUND_PAN_ATTACKER
@ -2987,7 +2987,7 @@ Move_FLASH:
end end
Move_SPLASH: Move_SPLASH:
createvisualtask sub_8104938, 2, 0, 3 createvisualtask AnimTask_Splash, 2, 0, 3
delay 8 delay 8
loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 38, 3 loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 38, 3
waitforvisualfinish waitforvisualfinish
@ -3066,7 +3066,7 @@ Move_SKETCH:
createsprite gUnknown_085936D4, ANIM_TARGET, 2 createsprite gUnknown_085936D4, ANIM_TARGET, 2
waitforvisualfinish waitforvisualfinish
clearmonbg ANIM_TARGET clearmonbg ANIM_TARGET
createvisualtask sub_8104938, 2, 0, 2 createvisualtask AnimTask_Splash, 2, 0, 2
loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 38, 2 loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 38, 2
end end
@ -3278,17 +3278,17 @@ Move_FALSE_SWIPE:
Move_SWAGGER: Move_SWAGGER:
loadspritegfx ANIM_TAG_BREATH loadspritegfx ANIM_TAG_BREATH
loadspritegfx ANIM_TAG_ANGER loadspritegfx ANIM_TAG_ANGER
createvisualtask sub_8104AB4, 2 createvisualtask AnimTask_GrowAndShrink, 2
playsewithpan SE_W207, SOUND_PAN_ATTACKER playsewithpan SE_W207, SOUND_PAN_ATTACKER
waitforvisualfinish waitforvisualfinish
createsprite gUnknown_08593658, ANIM_ATTACKER, 2 createsprite gBreathPuffSpriteTemplate, ANIM_ATTACKER, 2
loopsewithpan SE_W207, SOUND_PAN_ATTACKER, 4, 2 loopsewithpan SE_W207, SOUND_PAN_ATTACKER, 4, 2
waitforvisualfinish waitforvisualfinish
delay 24 delay 24
createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, -20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, -20, -28
playsewithpan SE_W207B, SOUND_PAN_TARGET playsewithpan SE_W207B, SOUND_PAN_TARGET
delay 12 delay 12
createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, 20, -28
playsewithpan SE_W207B, SOUND_PAN_TARGET playsewithpan SE_W207B, SOUND_PAN_TARGET
waitforvisualfinish waitforvisualfinish
end end
@ -3496,10 +3496,10 @@ Move_TORMENT:
createvisualtask sub_815AFF0, 2 createvisualtask sub_815AFF0, 2
waitforvisualfinish waitforvisualfinish
createvisualtask AnimTask_BlendMonInAndOut, 2, ANIM_TARGET, RGB_RED, 10, 1, 1 createvisualtask AnimTask_BlendMonInAndOut, 2, ANIM_TARGET, RGB_RED, 10, 1, 1
createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, -20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, -20, -28
playsewithpan SE_W207B, SOUND_PAN_TARGET playsewithpan SE_W207B, SOUND_PAN_TARGET
delay 20 delay 20
createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, 20, -28
playsewithpan SE_W207B, SOUND_PAN_TARGET playsewithpan SE_W207B, SOUND_PAN_TARGET
end end
@ -3606,11 +3606,11 @@ Move_TAUNT:
loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 16, 2 loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 16, 2
waitforvisualfinish waitforvisualfinish
delay 8 delay 8
createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, -20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, -20, -28
playsewithpan SE_W207B, SOUND_PAN_TARGET playsewithpan SE_W207B, SOUND_PAN_TARGET
waitforvisualfinish waitforvisualfinish
delay 12 delay 12
createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, 20, -28 createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, 20, -28
playsewithpan SE_W207B, SOUND_PAN_TARGET playsewithpan SE_W207B, SOUND_PAN_TARGET
end end
@ -4008,7 +4008,7 @@ Move_TEETER_DANCE:
Move_MUD_SPORT: Move_MUD_SPORT:
loadspritegfx ANIM_TAG_MUD_SAND loadspritegfx ANIM_TAG_MUD_SAND
createvisualtask sub_8104938, 2, 0, 6 createvisualtask AnimTask_Splash, 2, 0, 6
delay 24 delay 24
createsprite gUnknown_085971E4, ANIM_TARGET, 2, 0, -4, -16 createsprite gUnknown_085971E4, ANIM_TARGET, 2, 0, -4, -16
createsprite gUnknown_085971E4, ANIM_TARGET, 2, 0, 4, -12 createsprite gUnknown_085971E4, ANIM_TARGET, 2, 0, 4, -12
@ -4381,10 +4381,10 @@ Move_HOWL:
Move_BULK_UP: Move_BULK_UP:
loadspritegfx ANIM_TAG_BREATH loadspritegfx ANIM_TAG_BREATH
createvisualtask sub_8104AB4, 2 createvisualtask AnimTask_GrowAndShrink, 2
playsewithpan SE_W207, SOUND_PAN_ATTACKER playsewithpan SE_W207, SOUND_PAN_ATTACKER
waitforvisualfinish waitforvisualfinish
createsprite gUnknown_08593658, ANIM_ATTACKER, 2 createsprite gBreathPuffSpriteTemplate, ANIM_ATTACKER, 2
loopsewithpan SE_W207, SOUND_PAN_ATTACKER, 4, 2 loopsewithpan SE_W207, SOUND_PAN_ATTACKER, 4, 2
waitforvisualfinish waitforvisualfinish
end end
@ -5386,7 +5386,7 @@ IceBeam1:
Move_WITHDRAW: Move_WITHDRAW:
playsewithpan SE_W029, SOUND_PAN_ATTACKER playsewithpan SE_W029, SOUND_PAN_ATTACKER
createvisualtask sub_81036A0, 5 createvisualtask AnimTask_Withdraw, 5
waitforvisualfinish waitforvisualfinish
end end
@ -7509,9 +7509,9 @@ RazorWindContinue:
RazorWindSetUp: RazorWindSetUp:
loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_GUST
playsewithpan SE_W016, SOUND_PAN_ATTACKER playsewithpan SE_W016, SOUND_PAN_ATTACKER
createsprite gUnknown_08593550, ANIM_ATTACKER, 2, 32, 0, 16, 16, 0, 7, 40 createsprite gRazorWindTornadoSpriteTemplate, ANIM_ATTACKER, 2, 32, 0, 16, 16, 0, 7, 40
createsprite gUnknown_08593550, ANIM_ATTACKER, 2, 32, 0, 16, 16, 85, 7, 40 createsprite gRazorWindTornadoSpriteTemplate, ANIM_ATTACKER, 2, 32, 0, 16, 16, 85, 7, 40
createsprite gUnknown_08593550, ANIM_ATTACKER, 2, 32, 0, 16, 16, 170, 7, 40 createsprite gRazorWindTornadoSpriteTemplate, ANIM_ATTACKER, 2, 32, 0, 16, 16, 170, 7, 40
waitforvisualfinish waitforvisualfinish
playsewithpan SE_W016B, SOUND_PAN_ATTACKER playsewithpan SE_W016B, SOUND_PAN_ATTACKER
goto RazorWindContinue goto RazorWindContinue
@ -7546,7 +7546,7 @@ Move_DISABLE:
playsewithpan SE_W197, SOUND_PAN_ATTACKER playsewithpan SE_W197, SOUND_PAN_ATTACKER
createsprite gUnknown_0853EE84, ANIM_ATTACKER, 13, 24, -16 createsprite gUnknown_0853EE84, ANIM_ATTACKER, 13, 24, -16
waitforvisualfinish waitforvisualfinish
createvisualtask sub_81045B0, 5 createvisualtask AnimTask_GrowAndGreyscale, 5
loopsewithpan SE_W020, SOUND_PAN_TARGET, 15, 4 loopsewithpan SE_W020, SOUND_PAN_TARGET, 15, 4
waitforvisualfinish waitforvisualfinish
delay 1 delay 1

View File

@ -623,7 +623,7 @@ struct BattleHealthboxInfo
u8 battlerBounceSpriteId; u8 battlerBounceSpriteId;
u8 animationState; u8 animationState;
u8 field_5; u8 field_5;
u8 field_6; u8 matrixNum;
u8 shadowSpriteId; u8 shadowSpriteId;
u8 field_8; u8 field_8;
u8 field_9; u8 field_9;

View File

@ -76,8 +76,8 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId);
// battle_anim_80A5C6C.s // battle_anim_80A5C6C.s
void sub_80A6450(struct Sprite *sprite); void sub_80A6450(struct Sprite *sprite);
void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y); void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y);
void move_anim_8074EE0(struct Sprite *sprite); void DestroySpriteAndMatrix(struct Sprite *sprite);
void sub_80A656C(struct Sprite *sprite); void TranslateAnimLinearSimple(struct Sprite *sprite);
void InitAnimSpritePos(struct Sprite *sprite, u8 a2); void InitAnimSpritePos(struct Sprite *sprite, u8 a2);
void sub_80A6980(struct Sprite *sprite, bool8 a2); void sub_80A6980(struct Sprite *sprite, bool8 a2);
void StartAnimLinearTranslation(struct Sprite *sprite); void StartAnimLinearTranslation(struct Sprite *sprite);
@ -88,11 +88,11 @@ void sub_80A8EE4(struct Sprite *sprite);
u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId);
void sub_80A6FD4(struct Sprite *sprite); void sub_80A6FD4(struct Sprite *sprite);
u16 ArcTan2Neg(s16 a, s16 b); u16 ArcTan2Neg(s16 a, s16 b);
void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation); void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation);
void sub_80A67BC(struct Sprite *sprite); void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite);
void sub_80A66DC(struct Sprite *sprite); void sub_80A66DC(struct Sprite *sprite);
void sub_80A6838(struct Sprite *sprite); void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite);
void sub_80A67D8(struct Sprite *sprite); void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite);
void sub_80A6864(struct Sprite *sprite, s16 a2); void sub_80A6864(struct Sprite *sprite, s16 a2);
s16 sub_80A861C(u8 battlerId, u8 a2); s16 sub_80A861C(u8 battlerId, u8 a2);
u8 GetBattlerYCoordWithElevation(u8 battlerId); u8 GetBattlerYCoordWithElevation(u8 battlerId);
@ -101,32 +101,32 @@ void sub_80A7938(struct Sprite *sprite);
void InitAnimLinearTranslation(struct Sprite *sprite); void InitAnimLinearTranslation(struct Sprite *sprite);
void sub_80A6F98(struct Sprite *sprite); void sub_80A6F98(struct Sprite *sprite);
u8 sub_80A8328(u8 battlerId); u8 sub_80A8328(u8 battlerId);
void *sub_80A8050(s16 bottom, s16 top); void *LoadPointerFromVars(s16 bottom, s16 top);
void sub_80A8048(s16 *bottom, s16 *top, const void *ptr); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
void sub_80A8278(void); void sub_80A8278(void);
void sub_80A6B30(struct UnknownAnimStruct2*); void sub_80A6B30(struct UnknownAnimStruct2*);
void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1); void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1);
u8 sub_80A82E4(u8 battlerId); u8 GetBattlerSpriteSubpriority(u8 battlerId);
bool8 TranslateAnimArc(struct Sprite *sprite); bool8 TranslateAnimArc(struct Sprite *sprite);
void sub_80A6630(struct Sprite *sprite); void sub_80A6630(struct Sprite *sprite);
void sub_80A6680(struct Sprite *sprite); void sub_80A6680(struct Sprite *sprite);
void sub_80A7344(u8 spriteId); void ResetSpriteRotScale(u8 spriteId);
void obj_id_set_rotscale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation);
void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void InitSpriteDataForLinearTranslation(struct Sprite *sprite);
void sub_80A7270(u8 spriteId, u8 objMode); void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode);
void sub_80A73A0(u8 spriteId); void SetBattlerSpriteYOffsetFromRotation(u8 spriteId);
u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7);
u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4); u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4);
u8 sub_80A77AC(u8 a1); u8 sub_80A77AC(u8 a1);
s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8); s16 CloneBattlerSpriteWithBlend(u8);
void obj_delete_but_dont_free_vram(struct Sprite*); void obj_delete_but_dont_free_vram(struct Sprite*);
u8 sub_80A89C8(int, u8, int); u8 sub_80A89C8(int, u8, int);
void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32); void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32);
void sub_80A6CC0(u32, const void*, u32); void sub_80A6CC0(u32, const void*, u32);
void sub_80A6DAC(bool8); void sub_80A6DAC(bool8);
void sub_80A634C(struct Sprite *); void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *);
void sub_80A653C(struct Sprite *); void sub_80A653C(struct Sprite *);
void sub_80A7E6C(u8 spriteId); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId);
void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
u8 sub_80A80C8(struct Task *task); u8 sub_80A80C8(struct Task *task);
void sub_80A8EE4(struct Sprite *); void sub_80A8EE4(struct Sprite *);
@ -138,14 +138,20 @@ void sub_80A70C0(struct Sprite *sprite);
void TranslateMonBGUntil(struct Sprite *sprite); void TranslateMonBGUntil(struct Sprite *sprite);
void TranslateSpriteOverDuration(struct Sprite *sprite); void TranslateSpriteOverDuration(struct Sprite *sprite);
void sub_80A77C8(struct Sprite *sprite); void sub_80A77C8(struct Sprite *sprite);
void sub_80A7000(struct Sprite *sprite);
void TranslateSpriteInCircleOverDuration(struct Sprite *sprite);
void SetGreyscaleOrOriginalPalette(u16 a1, bool8 a2);
void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds);
bool8 RunAffineAnimFromTaskData(struct Task *task);
void sub_80A78AC(struct Sprite *sprite);
enum enum
{ {
BATTLER_COORD_X, BATTLER_COORD_X,
BATTLER_COORD_Y, BATTLER_COORD_Y,
BATTLER_COORD_X_2, BATTLER_COORD_X_2,
BATTLER_COORD_3, BATTLER_COORD_Y_PIC_OFFSET,
BATTLER_COORD_4, BATTLER_COORD_Y_PIC_OFFSET_DEFAULT,
}; };
u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId); u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId);
@ -159,7 +165,6 @@ u8 sub_80A8364(u8 battlerId);
void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*)); void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*));
void oamt_add_pos2_onto_pos1(struct Sprite *sprite); void oamt_add_pos2_onto_pos1(struct Sprite *sprite);
u8 GetBattlerSpriteDefault_Y(u8 battlerId); u8 GetBattlerSpriteDefault_Y(u8 battlerId);
u8 sub_80A82E4(u8 battlerId);
u8 GetSubstituteSpriteDefault_Y(u8 battlerId); u8 GetSubstituteSpriteDefault_Y(u8 battlerId);
// battle_anim_80A9C70.s // battle_anim_80A9C70.s

View File

@ -416,7 +416,6 @@ extern struct ContestResources *gContestResources;
#define eContestAI (gContestResources->field_C) #define eContestAI (gContestResources->field_C)
#define shared19328 (*gContestResources->field_10) #define shared19328 (*gContestResources->field_10)
#define shared19338 (*gContestResources->field_14) #define shared19338 (*gContestResources->field_14)
#define shared19348 (*gContestResources->field_18)
#define shared15800 (gHeap + 0x18000) #define shared15800 (gHeap + 0x18000)
#define shared18000 (*(struct Shared18000 *)(gHeap + 0x1a000)) #define shared18000 (*(struct Shared18000 *)(gHeap + 0x1a000))

View File

@ -4377,6 +4377,9 @@ extern const u32 gBattleAnimSpriteSheet_280[];
extern const u32 gBattleAnimSpriteSheet_281[]; extern const u32 gBattleAnimSpriteSheet_281[];
extern const u32 gBattleAnimSpriteSheet_282[]; extern const u32 gBattleAnimSpriteSheet_282[];
extern const u32 gBattleAnimSpriteSheet_283[]; extern const u32 gBattleAnimSpriteSheet_283[];
extern const u32 gBattleAnimBackgroundTilemap_ScaryFacePlayer[];
extern const u32 gBattleAnimBackgroundTilemap_ScaryFaceOpponent[];
extern const u32 gBattleAnimBackgroundTilemap_ScaryFaceContest[];
extern const u32 gBattleAnimSpriteSheet_284[]; extern const u32 gBattleAnimSpriteSheet_284[];
extern const u32 gBattleAnimSpriteSheet_285[]; extern const u32 gBattleAnimSpriteSheet_285[];
@ -4589,10 +4592,15 @@ extern const u32 gBattleAnimSpritePalette_209[];
extern const u32 gBattleAnimSpritePalette_210[]; extern const u32 gBattleAnimSpritePalette_210[];
extern const u32 gBattleAnimSpritePalette_211[]; extern const u32 gBattleAnimSpritePalette_211[];
extern const u32 gBattleAnimSpritePalette_215[]; extern const u32 gBattleAnimSpritePalette_215[];
extern const u32 gUnknown_08C249D0[];
extern const u32 gUnknown_08C249F8[];
extern const u32 gBattleAnimSpritePalette_216[]; extern const u32 gBattleAnimSpritePalette_216[];
extern const u32 gBattleAnimSpritePalette_217[]; extern const u32 gBattleAnimSpritePalette_217[];
extern const u32 gBattleAnimSpritePalette_218[]; extern const u32 gBattleAnimSpritePalette_218[];
extern const u32 gBattleAnimSpritePalette_219[]; extern const u32 gBattleAnimSpritePalette_219[];
extern const u32 gUnknown_08C232E0;
extern const u32 gUnknown_08C23D50;
extern const u32 gUnknown_08C23D78;
extern const u32 gBattleAnimSpritePalette_220[]; extern const u32 gBattleAnimSpritePalette_220[];
extern const u32 gBattleAnimSpritePalette_221[]; extern const u32 gBattleAnimSpritePalette_221[];
extern const u32 gBattleAnimSpritePalette_222[]; extern const u32 gBattleAnimSpritePalette_222[];

14
include/math_util.h Executable file
View File

@ -0,0 +1,14 @@
#ifndef GUARD_MATH_UTIL_H
#define GUARD_MATH_UTIL_H
s16 sub_8151534(s16 x, s16 y);
s16 sub_8151550(u8 s, s16 x, s16 y);
s32 sub_8151574(s32 x, s32 y);
s16 sub_81515B0(s16 x, s16 y);
s16 sub_81515D4(u8 s, s16 x, s16 y);
s32 sub_81515FC(s32 x, s32 y);
s16 sub_8151624(s16 y);
s16 sub_815163C(u8 s, s16 y);
s32 sub_815165C(s32 y);
#endif // GUARD_MATH_UTIL_H

View File

@ -158,10 +158,10 @@ SECTIONS {
asm/contest_link_80FC4F4.o(.text); asm/contest_link_80FC4F4.o(.text);
src/item_use.o(.text); src/item_use.o(.text);
src/battle_anim_effects_1.o(.text); src/battle_anim_effects_1.o(.text);
asm/battle_anim_effects_2.o(.text); src/battle_anim_effects_2.o(.text);
asm/water.o(.text); asm/water.o(.text);
src/fire.o(.text); src/fire.o(.text);
asm/electric.o(.text); src/electric.o(.text);
asm/ice.o(.text); asm/ice.o(.text);
src/fight.o(.text); src/fight.o(.text);
src/poison.o(.text); src/poison.o(.text);
@ -485,7 +485,7 @@ SECTIONS {
src/rotating_gate.o(.rodata); src/rotating_gate.o(.rodata);
src/item_use.o(.rodata); src/item_use.o(.rodata);
src/battle_anim_effects_1.o(.rodata); src/battle_anim_effects_1.o(.rodata);
src/effects_2.o(.rodata); src/battle_anim_effects_2.o(.rodata);
src/water.o(.rodata); src/water.o(.rodata);
src/fire.o(.rodata); src/fire.o(.rodata);
src/electric.o(.rodata); src/electric.o(.rodata);

View File

@ -1656,7 +1656,7 @@ static void ScriptCmd_createsprite(void)
else else
argVar *= -1; argVar *= -1;
subpriority = sub_80A82E4(gBattleAnimTarget) + (s8)(argVar); subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (s8)(argVar);
} }
else else
{ {
@ -1665,7 +1665,7 @@ static void ScriptCmd_createsprite(void)
else else
argVar *= -1; argVar *= -1;
subpriority = sub_80A82E4(gBattleAnimAttacker) + (s8)(argVar); subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + (s8)(argVar);
} }
if (subpriority < 3) if (subpriority < 3)

View File

@ -40,18 +40,17 @@ void sub_80A7144(struct Sprite *sprite);
void sub_80A791C(struct Sprite *sprite); void sub_80A791C(struct Sprite *sprite);
void sub_80A8DFC(struct Sprite *sprite); void sub_80A8DFC(struct Sprite *sprite);
void sub_80A8E88(struct Sprite *sprite); void sub_80A8E88(struct Sprite *sprite);
void sub_80A7E6C(u8 spriteId); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId);
u16 sub_80A7F18(u8 spriteId); u16 GetBattlerYDeltaFromSpriteId(u8 spriteId);
void AnimTask_BlendMonInAndOutSetup(struct Task *task); void AnimTask_BlendMonInAndOutSetup(struct Task *task);
void sub_80A7AFC(u8 taskId); void sub_80A7AFC(u8 taskId);
void sub_80A8CAC(u8 taskId); void sub_80A8CAC(u8 taskId);
void AnimTask_BlendMonInAndOutStep(u8 taskId); void AnimTask_BlendMonInAndOutStep(u8 taskId);
bool8 sub_80A7238(void); bool8 sub_80A7238(void);
u8 sub_80A82E4(u8 battlerId);
void sub_80A8D78(struct Task *task, u8 taskId); void sub_80A8D78(struct Task *task, u8 taskId);
// EWRAM vars // EWRAM vars
EWRAM_DATA static union AffineAnimCmd *gUnknown_02038444 = NULL; EWRAM_DATA static union AffineAnimCmd *gAnimTaskAffineAnim = NULL;
// Const rom data // Const rom data
static const struct UCoords8 sBattlerCoords[][4] = static const struct UCoords8 sBattlerCoords[][4] =
@ -124,8 +123,7 @@ static const struct SpriteSheet sUnknown_08525FC0[] =
{ gMiscBlank_Gfx, 0x800, 55126, }, { gMiscBlank_Gfx, 0x800, 55126, },
}; };
// code u8 GetBattlerSpriteCoord(u8 battlerId, u8 coordType)
u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId)
{ {
u8 retVal; u8 retVal;
u16 species; u16 species;
@ -133,11 +131,11 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId)
if (IsContest()) if (IsContest())
{ {
if (attributeId == BATTLER_COORD_3 && battlerId == 3) if (coordType == BATTLER_COORD_Y_PIC_OFFSET && battlerId == 3)
attributeId = BATTLER_COORD_Y; coordType = BATTLER_COORD_Y;
} }
switch (attributeId) switch (coordType)
{ {
case BATTLER_COORD_X: case BATTLER_COORD_X:
case BATTLER_COORD_X_2: case BATTLER_COORD_X_2:
@ -146,15 +144,15 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId)
case BATTLER_COORD_Y: case BATTLER_COORD_Y:
retVal = sBattlerCoords[IS_DOUBLE_BATTLE()][GetBattlerPosition(battlerId)].y; retVal = sBattlerCoords[IS_DOUBLE_BATTLE()][GetBattlerPosition(battlerId)].y;
break; break;
case BATTLER_COORD_3: case BATTLER_COORD_Y_PIC_OFFSET:
case BATTLER_COORD_4: case BATTLER_COORD_Y_PIC_OFFSET_DEFAULT:
default: default:
if (IsContest()) if (IsContest())
{ {
if (shared19348.unk4_0) if (gContestResources->field_18->unk4_0)
species = shared19348.unk2; species = gContestResources->field_18->unk2;
else else
species = shared19348.species; species = gContestResources->field_18->species;
} }
else else
{ {
@ -175,7 +173,7 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId)
species = spriteInfo[battlerId].transformSpecies; species = spriteInfo[battlerId].transformSpecies;
} }
} }
if (attributeId == BATTLER_COORD_3) if (coordType == BATTLER_COORD_Y_PIC_OFFSET)
retVal = GetBattlerSpriteFinal_Y(battlerId, species, TRUE); retVal = GetBattlerSpriteFinal_Y(battlerId, species, TRUE);
else else
retVal = GetBattlerSpriteFinal_Y(battlerId, species, FALSE); retVal = GetBattlerSpriteFinal_Y(battlerId, species, FALSE);
@ -199,10 +197,10 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species)
{ {
if (IsContest()) if (IsContest())
{ {
if (shared19348.unk4_0) if (gContestResources->field_18->unk4_0)
personality = shared19348.unk10; personality = gContestResources->field_18->unk10;
else else
personality = shared19348.unk8; personality = gContestResources->field_18->unk8;
} }
else else
{ {
@ -307,19 +305,19 @@ u8 GetBattlerSpriteFinal_Y(u8 battlerId, u16 species, bool8 a3)
return y; return y;
} }
u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId) u8 GetBattlerSpriteCoord2(u8 battlerId, u8 coordType)
{ {
u16 species; u16 species;
struct BattleSpriteInfo *spriteInfo; struct BattleSpriteInfo *spriteInfo;
if (attributeId == BATTLER_COORD_3 || attributeId == BATTLER_COORD_4) if (coordType == BATTLER_COORD_Y_PIC_OFFSET || coordType == BATTLER_COORD_Y_PIC_OFFSET_DEFAULT)
{ {
if (IsContest()) if (IsContest())
{ {
if (shared19348.unk4_0) if (gContestResources->field_18->unk4_0)
species = shared19348.unk2; species = gContestResources->field_18->unk2;
else else
species = shared19348.species; species = gContestResources->field_18->species;
} }
else else
{ {
@ -329,20 +327,20 @@ u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId)
else else
species = spriteInfo[battlerId].transformSpecies; species = spriteInfo[battlerId].transformSpecies;
} }
if (attributeId == BATTLER_COORD_3) if (coordType == BATTLER_COORD_Y_PIC_OFFSET)
return GetBattlerSpriteFinal_Y(battlerId, species, TRUE); return GetBattlerSpriteFinal_Y(battlerId, species, TRUE);
else else
return GetBattlerSpriteFinal_Y(battlerId, species, FALSE); return GetBattlerSpriteFinal_Y(battlerId, species, FALSE);
} }
else else
{ {
return GetBattlerSpriteCoord(battlerId, attributeId); return GetBattlerSpriteCoord(battlerId, coordType);
} }
} }
u8 GetBattlerSpriteDefault_Y(u8 battlerId) u8 GetBattlerSpriteDefault_Y(u8 battlerId)
{ {
return GetBattlerSpriteCoord(battlerId, BATTLER_COORD_4); return GetBattlerSpriteCoord(battlerId, BATTLER_COORD_Y_PIC_OFFSET_DEFAULT);
} }
u8 GetSubstituteSpriteDefault_Y(u8 battlerId) u8 GetSubstituteSpriteDefault_Y(u8 battlerId)
@ -386,11 +384,11 @@ u8 GetBattlerYCoordWithElevation(u8 battlerId)
return y; return y;
} }
u8 GetAnimBattlerSpriteId(u8 which) u8 GetAnimBattlerSpriteId(u8 animBattler)
{ {
u8 *sprites; u8 *sprites;
if (which == ANIM_ATTACKER) if (animBattler == ANIM_ATTACKER)
{ {
if (IsBattlerSpritePresent(gBattleAnimAttacker)) if (IsBattlerSpritePresent(gBattleAnimAttacker))
{ {
@ -402,7 +400,7 @@ u8 GetAnimBattlerSpriteId(u8 which)
return 0xff; return 0xff;
} }
} }
else if (which == ANIM_TARGET) else if (animBattler == ANIM_TARGET)
{ {
if (IsBattlerSpritePresent(gBattleAnimTarget)) if (IsBattlerSpritePresent(gBattleAnimTarget))
{ {
@ -414,7 +412,7 @@ u8 GetAnimBattlerSpriteId(u8 which)
return 0xff; return 0xff;
} }
} }
else if (which == ANIM_ATK_PARTNER) else if (animBattler == ANIM_ATK_PARTNER)
{ {
if (!IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) if (!IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
return 0xff; return 0xff;
@ -442,7 +440,7 @@ void SetCallbackToStoredInData6(struct Sprite *sprite)
sprite->callback = (void (*)(struct Sprite *))callback; sprite->callback = (void (*)(struct Sprite *))callback;
} }
void sub_80A62EC(struct Sprite *sprite) void TranslateSpriteInCircleOverDuration(struct Sprite *sprite)
{ {
if (sprite->data[3]) if (sprite->data[3])
{ {
@ -461,7 +459,7 @@ void sub_80A62EC(struct Sprite *sprite)
} }
} }
void sub_80A634C(struct Sprite *sprite) void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *sprite)
{ {
if (sprite->data[3]) if (sprite->data[3])
{ {
@ -570,7 +568,7 @@ void TranslateSpriteOverDuration(struct Sprite *sprite)
} }
} }
void sub_80A656C(struct Sprite *sprite) void TranslateAnimLinearSimple(struct Sprite *sprite)
{ {
if (sprite->data[0] > 0) if (sprite->data[0] > 0)
{ {
@ -665,7 +663,7 @@ void sub_80A66DC(struct Sprite *sprite)
} }
} }
void move_anim_8074EE0(struct Sprite *sprite) void DestroySpriteAndMatrix(struct Sprite *sprite)
{ {
FreeSpriteOamMatrix(sprite); FreeSpriteOamMatrix(sprite);
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -683,16 +681,16 @@ void sub_80A6760(struct Sprite *sprite)
void sub_80A67A4(struct Sprite *sprite) void sub_80A67A4(struct Sprite *sprite)
{ {
ResetPaletteStructByUid(sprite->data[5]); ResetPaletteStructByUid(sprite->data[5]);
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
void sub_80A67BC(struct Sprite *sprite) void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite)
{ {
if (sprite->affineAnimEnded) if (sprite->affineAnimEnded)
SetCallbackToStoredInData6(sprite); SetCallbackToStoredInData6(sprite);
} }
void sub_80A67D8(struct Sprite *sprite) void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite)
{ {
if (sprite->animEnded) if (sprite->animEnded)
SetCallbackToStoredInData6(sprite); SetCallbackToStoredInData6(sprite);
@ -712,31 +710,31 @@ void sub_80A6814(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
void sub_80A6838(struct Sprite *sprite) void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
} }
void sub_80A6864(struct Sprite *sprite, s16 a2) void sub_80A6864(struct Sprite *sprite, s16 xOffset)
{ {
u16 v1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); u16 attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X);
u16 v2 = GetBattlerSpriteCoord(gBattleAnimTarget, 0); u16 targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
if (v1 > v2) if (attackerX > targetX)
{ {
sprite->pos1.x -= a2; sprite->pos1.x -= xOffset;
} }
else if (v1 < v2) else if (attackerX < targetX)
{ {
sprite->pos1.x += a2; sprite->pos1.x += xOffset;
} }
else else
{ {
if (GetBattlerSide(gBattleAnimAttacker) != 0) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
sprite->pos1.x -= a2; sprite->pos1.x -= xOffset;
else else
sprite->pos1.x += a2; sprite->pos1.x += xOffset;
} }
} }
@ -779,24 +777,24 @@ void sub_80A6980(struct Sprite *sprite, bool8 a2)
{ {
if (!a2) if (!a2)
{ {
sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimTarget, 0); sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_X);
sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimTarget, 1); sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_Y);
} }
sub_80A6864(sprite, gBattleAnimArgs[0]); sub_80A6864(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
} }
void InitAnimSpritePos(struct Sprite *sprite, u8 a2) void InitAnimSpritePos(struct Sprite *sprite, u8 respectMonPicOffsets)
{ {
if (!a2) if (!respectMonPicOffsets)
{ {
sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, 0); sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_X);
sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, 1); sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_Y);
} }
else else
{ {
sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, 3); sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
} }
sub_80A6864(sprite, gBattleAnimArgs[0]); sub_80A6864(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -1208,7 +1206,7 @@ void sub_80A718C(struct Sprite *sprite)
sprite->callback(sprite); sprite->callback(sprite);
} }
void obj_id_set_rotscale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation) void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation)
{ {
int i; int i;
struct ObjAffineSrcData src; struct ObjAffineSrcData src;
@ -1242,7 +1240,7 @@ bool8 sub_80A7238(void)
} }
} }
void sub_80A7270(u8 spriteId, u8 objMode) void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode)
{ {
u8 battlerId = gSprites[spriteId].data[0]; u8 battlerId = gSprites[spriteId].data[0];
@ -1251,32 +1249,34 @@ void sub_80A7270(u8 spriteId, u8 objMode)
gSprites[spriteId].oam.objMode = objMode; gSprites[spriteId].oam.objMode = objMode;
gSprites[spriteId].affineAnimPaused = TRUE; gSprites[spriteId].affineAnimPaused = TRUE;
if (!IsContest() && !gSprites[spriteId].oam.affineMode) if (!IsContest() && !gSprites[spriteId].oam.affineMode)
gSprites[spriteId].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[battlerId].field_6; gSprites[spriteId].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[battlerId].matrixNum;
gSprites[spriteId].oam.affineMode = 3; gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE;
CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode);
} }
void sub_80A7344(u8 spriteId) void ResetSpriteRotScale(u8 spriteId)
{ {
obj_id_set_rotscale(spriteId, 0x100, 0x100, 0); SetSpriteRotScale(spriteId, 0x100, 0x100, 0);
gSprites[spriteId].oam.affineMode = 1; gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteId].oam.objMode = 0; gSprites[spriteId].oam.objMode = 0;
gSprites[spriteId].affineAnimPaused = FALSE; gSprites[spriteId].affineAnimPaused = FALSE;
CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode);
} }
void sub_80A73A0(u8 spriteId) // Sets the sprite's y offset equal to the y displacement caused by the
// matrix's rotation.
void SetBattlerSpriteYOffsetFromRotation(u8 spriteId)
{ {
u16 matrix = gSprites[spriteId].oam.matrixNum; u16 matrixNum = gSprites[spriteId].oam.matrixNum;
s16 c = gOamMatrices[matrix].c; // The "c" component of the battler sprite matrix contains the sine of the rotation angle divided by some scale amount.
s16 c = gOamMatrices[matrixNum].c;
if (c < 0) if (c < 0)
c = -c; c = -c;
gSprites[spriteId].pos2.y = c >> 3; gSprites[spriteId].pos2.y = c >> 3;
} }
// related to obj_id_set_rotscale void TrySetSpriteRotScale(struct Sprite *sprite, bool8 recalcCenterVector, s16 xScale, s16 yScale, u16 rotation)
void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation)
{ {
int i; int i;
struct ObjAffineSrcData src; struct ObjAffineSrcData src;
@ -1285,7 +1285,7 @@ void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 ro
if (sprite->oam.affineMode & 1) if (sprite->oam.affineMode & 1)
{ {
sprite->affineAnimPaused = TRUE; sprite->affineAnimPaused = TRUE;
if (a2) if (recalcCenterVector)
CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode);
src.xScale = xScale; src.xScale = xScale;
src.yScale = yScale; src.yScale = yScale;
@ -1303,7 +1303,7 @@ void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 ro
void sub_80A749C(struct Sprite *sprite) void sub_80A749C(struct Sprite *sprite)
{ {
sub_80A73E0(sprite, TRUE, 0x100, 0x100, 0); TrySetSpriteRotScale(sprite, TRUE, 0x100, 0x100, 0);
sprite->affineAnimPaused = FALSE; sprite->affineAnimPaused = FALSE;
CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode);
} }
@ -1319,32 +1319,32 @@ u16 ArcTan2Neg(s16 a, s16 b)
return -var; return -var;
} }
void sub_80A750C(u16 a1, bool8 a2) void SetGreyscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor)
{ {
int i; int i;
struct PlttData *c; struct PlttData *originalColor;
struct PlttData *c2; struct PlttData *destColor;
u16 average; u16 average;
a1 *= 0x10; paletteNum *= 16;
if (!a2) if (!restoreOriginalColor)
{ {
for (i = 0; i < 0x10; i++) for (i = 0; i < 16; i++)
{ {
c = (struct PlttData *)&gPlttBufferUnfaded[a1 + i]; originalColor = (struct PlttData *)&gPlttBufferUnfaded[paletteNum + i];
average = c->r + c->g + c->b; average = originalColor->r + originalColor->g + originalColor->b;
average /= 3; average /= 3;
c2 = (struct PlttData *)&gPlttBufferFaded[a1 + i]; destColor = (struct PlttData *)&gPlttBufferFaded[paletteNum + i];
c2->r = average; destColor->r = average;
c2->g = average; destColor->g = average;
c2->b = average; destColor->b = average;
} }
} }
else else
{ {
CpuCopy32(&gPlttBufferUnfaded[a1], &gPlttBufferFaded[a1], 0x20); CpuCopy32(&gPlttBufferUnfaded[paletteNum], &gPlttBufferFaded[paletteNum], 32);
} }
} }
@ -1479,7 +1479,7 @@ void sub_80A77C8(struct Sprite *sprite)
} }
else if (sprite->animEnded || sprite->affineAnimEnded) else if (sprite->animEnded || sprite->affineAnimEnded)
{ {
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
} }
@ -1494,7 +1494,7 @@ void sub_80A77C8(struct Sprite *sprite)
void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite)
{ {
bool8 v1; bool8 v1;
u8 attributeId; u8 coordType;
if (!(gBattleAnimArgs[5] & 0xff00)) if (!(gBattleAnimArgs[5] & 0xff00))
v1 = TRUE; v1 = TRUE;
@ -1502,9 +1502,9 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite)
v1 = FALSE; v1 = FALSE;
if (!(gBattleAnimArgs[5] & 0xff)) if (!(gBattleAnimArgs[5] & 0xff))
attributeId = BATTLER_COORD_3; coordType = BATTLER_COORD_Y_PIC_OFFSET;
else else
attributeId = BATTLER_COORD_Y; coordType = BATTLER_COORD_Y;
InitAnimSpritePos(sprite, v1); InitAnimSpritePos(sprite, v1);
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
@ -1512,7 +1512,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite)
sprite->data[0] = gBattleAnimArgs[4]; sprite->data[0] = gBattleAnimArgs[4];
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2];
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, attributeId) + gBattleAnimArgs[3]; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, coordType) + gBattleAnimArgs[3];
sprite->callback = StartAnimLinearTranslation; sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
@ -1544,7 +1544,7 @@ void sub_80A7938(struct Sprite *sprite)
if (!gBattleAnimArgs[6]) if (!gBattleAnimArgs[6])
{ {
r4 = TRUE; r4 = TRUE;
attributeId = BATTLER_COORD_3; attributeId = BATTLER_COORD_Y_PIC_OFFSET;
} }
else else
{ {
@ -1571,19 +1571,19 @@ void sub_80A7938(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8 whichBattler) s16 CloneBattlerSpriteWithBlend(u8 animBattler)
{ {
u16 i; u16 i;
u8 spriteId = GetAnimBattlerSpriteId(whichBattler); u8 spriteId = GetAnimBattlerSpriteId(animBattler);
if (spriteId != 0xff) if (spriteId != 0xFF)
{ {
for (i = 0; i < MAX_SPRITES; i++) for (i = 0; i < MAX_SPRITES; i++)
{ {
if (!gSprites[i].inUse) if (!gSprites[i].inUse)
{ {
gSprites[i] = gSprites[spriteId]; gSprites[i] = gSprites[spriteId];
gSprites[i].oam.objMode = 1; gSprites[i].oam.objMode = ST_OAM_OBJ_BLEND;
gSprites[i].invisible = FALSE; gSprites[i].invisible = FALSE;
return i; return i;
} }
@ -1730,49 +1730,49 @@ void sub_80A7CB4(u8 task)
AnimTask_BlendMonInAndOutSetup(&gTasks[task]); AnimTask_BlendMonInAndOutSetup(&gTasks[task]);
} }
void sub_80A7CFC(struct Task *task, u8 a2, const void *a3) void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds)
{ {
task->data[7] = 0; task->data[7] = 0;
task->data[8] = 0; task->data[8] = 0;
task->data[9] = 0; task->data[9] = 0;
task->data[15] = a2; task->data[15] = spriteId;
task->data[10] = 0x100; task->data[10] = 0x100;
task->data[11] = 0x100; task->data[11] = 0x100;
task->data[12] = 0; task->data[12] = 0;
sub_80A8048(&task->data[13], &task->data[14], a3); StorePointerInVars(&task->data[13], &task->data[14], affineAnimCmds);
sub_80A7270(a2, 0); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
} }
bool8 sub_80A7D34(struct Task *task) bool8 RunAffineAnimFromTaskData(struct Task *task)
{ {
gUnknown_02038444 = sub_80A8050(task->data[13], task->data[14]) + (task->data[7] << 3); gAnimTaskAffineAnim = LoadPointerFromVars(task->data[13], task->data[14]) + (task->data[7] << 3);
switch (gUnknown_02038444->type) switch (gAnimTaskAffineAnim->type)
{ {
default: default:
if (!gUnknown_02038444->frame.duration) if (!gAnimTaskAffineAnim->frame.duration)
{ {
task->data[10] = gUnknown_02038444->frame.xScale; task->data[10] = gAnimTaskAffineAnim->frame.xScale;
task->data[11] = gUnknown_02038444->frame.yScale; task->data[11] = gAnimTaskAffineAnim->frame.yScale;
task->data[12] = gUnknown_02038444->frame.rotation; task->data[12] = gAnimTaskAffineAnim->frame.rotation;
task->data[7]++; task->data[7]++;
gUnknown_02038444++; gAnimTaskAffineAnim++;
} }
task->data[10] += gUnknown_02038444->frame.xScale; task->data[10] += gAnimTaskAffineAnim->frame.xScale;
task->data[11] += gUnknown_02038444->frame.yScale; task->data[11] += gAnimTaskAffineAnim->frame.yScale;
task->data[12] += gUnknown_02038444->frame.rotation; task->data[12] += gAnimTaskAffineAnim->frame.rotation;
obj_id_set_rotscale(task->data[15], task->data[10], task->data[11], task->data[12]); SetSpriteRotScale(task->data[15], task->data[10], task->data[11], task->data[12]);
sub_80A7E6C(task->data[15]); SetBattlerSpriteYOffsetFromYScale(task->data[15]);
if (++task->data[8] >= gUnknown_02038444->frame.duration) if (++task->data[8] >= gAnimTaskAffineAnim->frame.duration)
{ {
task->data[8] = 0; task->data[8] = 0;
task->data[7]++; task->data[7]++;
} }
break; break;
case AFFINEANIMCMDTYPE_JUMP: case AFFINEANIMCMDTYPE_JUMP:
task->data[7] = gUnknown_02038444->jump.target; task->data[7] = gAnimTaskAffineAnim->jump.target;
break; break;
case AFFINEANIMCMDTYPE_LOOP: case AFFINEANIMCMDTYPE_LOOP:
if (gUnknown_02038444->loop.count) if (gAnimTaskAffineAnim->loop.count)
{ {
if (task->data[9]) if (task->data[9])
{ {
@ -1784,7 +1784,7 @@ bool8 sub_80A7D34(struct Task *task)
} }
else else
{ {
task->data[9] = gUnknown_02038444->loop.count; task->data[9] = gAnimTaskAffineAnim->loop.count;
} }
if (!task->data[7]) if (!task->data[7])
{ {
@ -1793,8 +1793,8 @@ bool8 sub_80A7D34(struct Task *task)
for (;;) for (;;)
{ {
task->data[7]--; task->data[7]--;
gUnknown_02038444--; gAnimTaskAffineAnim--;
if (gUnknown_02038444->type == AFFINEANIMCMDTYPE_LOOP) if (gAnimTaskAffineAnim->type == AFFINEANIMCMDTYPE_LOOP)
{ {
task->data[7]++; task->data[7]++;
return TRUE; return TRUE;
@ -1807,36 +1807,40 @@ bool8 sub_80A7D34(struct Task *task)
break; break;
case AFFINEANIMCMDTYPE_END: case AFFINEANIMCMDTYPE_END:
gSprites[task->data[15]].pos2.y = 0; gSprites[task->data[15]].pos2.y = 0;
sub_80A7344(task->data[15]); ResetSpriteRotScale(task->data[15]);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
void sub_80A7E6C(u8 spriteId) // Sets the sprite's y offset equal to the y displacement caused by the
// matrix's scale in the y dimension.
void SetBattlerSpriteYOffsetFromYScale(u8 spriteId)
{ {
int var = 0x40 - sub_80A7F18(spriteId) * 2; int var = 64 - GetBattlerYDeltaFromSpriteId(spriteId) * 2;
u16 matrix = gSprites[spriteId].oam.matrixNum; u16 matrix = gSprites[spriteId].oam.matrixNum;
int var2 = (var << 8) / gOamMatrices[matrix].d; int var2 = (var << 8) / gOamMatrices[matrix].d;
if (var2 > 0x80) if (var2 > 128)
var2 = 0x80; var2 = 128;
gSprites[spriteId].pos2.y = (var - var2) / 2; gSprites[spriteId].pos2.y = (var - var2) / 2;
} }
void sub_80A7EC0(u8 spriteId, u8 spriteId2) // Sets the sprite's y offset equal to the y displacement caused by another sprite
// matrix's scale in the y dimension.
void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId)
{ {
int var = 0x40 - sub_80A7F18(spriteId2) * 2; int var = 64 - GetBattlerYDeltaFromSpriteId(otherSpriteId) * 2;
u16 matrix = gSprites[spriteId].oam.matrixNum; u16 matrix = gSprites[spriteId].oam.matrixNum;
int var2 = (var << 8) / gOamMatrices[matrix].d; int var2 = (var << 8) / gOamMatrices[matrix].d;
if (var2 > 0x80) if (var2 > 128)
var2 = 0x80; var2 = 128;
gSprites[spriteId].pos2.y = (var - var2) / 2; gSprites[spriteId].pos2.y = (var - var2) / 2;
} }
u16 sub_80A7F18(u8 spriteId) u16 GetBattlerYDeltaFromSpriteId(u8 spriteId)
{ {
struct BattleSpriteInfo *spriteInfo; struct BattleSpriteInfo *spriteInfo;
u8 battlerId = gSprites[spriteId].data[0]; u8 battlerId = gSprites[spriteId].data[0];
@ -1849,7 +1853,7 @@ u16 sub_80A7F18(u8 spriteId)
{ {
if (IsContest()) if (IsContest())
{ {
species = shared19348.species; species = gContestResources->field_18->species;
return gMonBackPicCoords[species].y_offset; return gMonBackPicCoords[species].y_offset;
} }
else else
@ -1883,18 +1887,18 @@ u16 sub_80A7F18(u8 spriteId)
} }
} }
} }
return 0x40; return 64;
} }
void sub_80A8048(s16 *bottom, s16 *top, const void *ptr) void StorePointerInVars(s16 *lo, s16 *hi, const void *ptr)
{ {
*bottom = ((intptr_t) ptr) & 0xffff; *lo = ((intptr_t) ptr) & 0xffff;
*top = (((intptr_t) ptr) >> 16) & 0xffff; *hi = (((intptr_t) ptr) >> 16) & 0xffff;
} }
void *sub_80A8050(s16 bottom, s16 top) void *LoadPointerFromVars(s16 lo, s16 hi)
{ {
return (void *)((u16)bottom | ((u16)top << 16)); return (void *)((u16)lo | ((u16)hi << 16));
} }
void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7) void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7)
@ -1924,9 +1928,9 @@ u8 sub_80A80C8(struct Task *task)
task->data[9] = task->data[13]; task->data[9] = task->data[13];
task->data[10] = task->data[14]; task->data[10] = task->data[14];
} }
obj_id_set_rotscale(task->data[15], task->data[9], task->data[10], 0); SetSpriteRotScale(task->data[15], task->data[9], task->data[10], 0);
if (task->data[8]) if (task->data[8])
sub_80A7E6C(task->data[15]); SetBattlerSpriteYOffsetFromYScale(task->data[15]);
else else
gSprites[task->data[15]].pos2.y = 0; gSprites[task->data[15]].pos2.y = 0;
return task->data[8]; return task->data[8];
@ -1968,16 +1972,16 @@ void sub_80A8278(void)
{ {
if (IsBattlerSpriteVisible(i)) if (IsBattlerSpriteVisible(i))
{ {
gSprites[gBattlerSpriteIds[i]].subpriority = sub_80A82E4(i); gSprites[gBattlerSpriteIds[i]].subpriority = GetBattlerSpriteSubpriority(i);
gSprites[gBattlerSpriteIds[i]].oam.priority = 2; gSprites[gBattlerSpriteIds[i]].oam.priority = 2;
} }
} }
} }
u8 sub_80A82E4(u8 battlerId) u8 GetBattlerSpriteSubpriority(u8 battlerId)
{ {
u8 position; u8 position;
u8 ret; u8 subpriority;
if (IsContest()) if (IsContest())
{ {
@ -1990,15 +1994,16 @@ u8 sub_80A82E4(u8 battlerId)
{ {
position = GetBattlerPosition(battlerId); position = GetBattlerPosition(battlerId);
if (position == B_POSITION_PLAYER_LEFT) if (position == B_POSITION_PLAYER_LEFT)
ret = 30; subpriority = 30;
else if (position == B_POSITION_PLAYER_RIGHT) else if (position == B_POSITION_PLAYER_RIGHT)
ret = 20; subpriority = 20;
else if (position == B_POSITION_OPPONENT_LEFT) else if (position == B_POSITION_OPPONENT_LEFT)
ret = 40; subpriority = 40;
else else
ret = 50; subpriority = 50;
} }
return ret;
return subpriority;
} }
u8 sub_80A8328(u8 battlerId) u8 sub_80A8328(u8 battlerId)
@ -2100,15 +2105,15 @@ s16 sub_80A861C(u8 battlerId, u8 a2)
if (IsContest()) if (IsContest())
{ {
if (shared19348.unk4_0) if (gContestResources->field_18->unk4_0)
{ {
species = shared19348.unk2; species = gContestResources->field_18->unk2;
personality = shared19348.unk10; personality = gContestResources->field_18->unk10;
} }
else else
{ {
species = shared19348.species; species = gContestResources->field_18->species;
personality = shared19348.unk8; personality = gContestResources->field_18->unk8;
} }
if (species == SPECIES_UNOWN) if (species == SPECIES_UNOWN)
{ {
@ -2270,7 +2275,7 @@ u8 sub_80A89C8(int battlerId, u8 spriteId, int species)
void sub_80A8A6C(struct Sprite *sprite) void sub_80A8A6C(struct Sprite *sprite)
{ {
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker)) if (GetBattlerSide(gBattleAnimAttacker))
{ {
sprite->pos1.x -= gBattleAnimArgs[0]; sprite->pos1.x -= gBattleAnimArgs[0];
@ -2286,7 +2291,7 @@ void sub_80A8A6C(struct Sprite *sprite)
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->data[3] = gBattleAnimArgs[4]; sprite->data[3] = gBattleAnimArgs[4];
sprite->data[5] = gBattleAnimArgs[5]; sprite->data[5] = gBattleAnimArgs[5];
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A66DC; sprite->callback = sub_80A66DC;
} }
@ -2307,19 +2312,19 @@ void sub_80A8AEC(struct Sprite *sprite)
sprite->data[3] = gBattleAnimArgs[4]; sprite->data[3] = gBattleAnimArgs[4];
sprite->data[5] = gBattleAnimArgs[5]; sprite->data[5] = gBattleAnimArgs[5];
StartSpriteAnim(sprite, gBattleAnimArgs[6]); StartSpriteAnim(sprite, gBattleAnimArgs[6]);
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A66DC; sprite->callback = sub_80A66DC;
} }
void sub_80A8B64(struct Sprite *sprite) void sub_80A8B64(struct Sprite *sprite)
{ {
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker)) if (GetBattlerSide(gBattleAnimAttacker))
sprite->pos1.x -= gBattleAnimArgs[0]; sprite->pos1.x -= gBattleAnimArgs[0];
else else
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
@ -2339,7 +2344,7 @@ void sub_80A8BC4(u8 taskId)
dest = (task->data[4] + 0x10) * 0x10; dest = (task->data[4] + 0x10) * 0x10;
src = (gSprites[task->data[0]].oam.paletteNum + 0x10) * 0x10; src = (gSprites[task->data[0]].oam.paletteNum + 0x10) * 0x10;
task->data[6] = sub_80A82E4(gBattleAnimAttacker); task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
if (task->data[6] == 20 || task->data[6] == 40) if (task->data[6] == 20 || task->data[6] == 40)
task->data[6] = 2; task->data[6] = 2;
else else
@ -2384,7 +2389,7 @@ void sub_80A8CAC(u8 taskId)
void sub_80A8D78(struct Task *task, u8 taskId) void sub_80A8D78(struct Task *task, u8 taskId)
{ {
s16 spriteId = duplicate_obj_of_side_rel2move_in_transparent_mode(0); s16 spriteId = CloneBattlerSpriteWithBlend(0);
if (spriteId >= 0) if (spriteId >= 0)
{ {
gSprites[spriteId].oam.priority = task->data[6]; gSprites[spriteId].oam.priority = task->data[6];
@ -2410,7 +2415,7 @@ void sub_80A8DFC(struct Sprite *sprite)
void sub_80A8E30(struct Sprite *sprite) void sub_80A8E30(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_3); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
if (!GetBattlerSide(gBattleAnimAttacker)) if (!GetBattlerSide(gBattleAnimAttacker))
sprite->data[0] = 5; sprite->data[0] = 5;
else else

View File

@ -175,7 +175,7 @@ static void sub_80A9E78(struct Sprite *sprite)
void sub_80A9EF4(u8 taskId) void sub_80A9EF4(u8 taskId)
{ {
s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 32; s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 32;
s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_3) - 36; s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) - 36;
u8 spriteId; u8 spriteId;
if (IsContest()) if (IsContest())

View File

@ -834,7 +834,7 @@ void AnimTask_ScaleMonAndRestore(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[3]); spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[3]);
sub_80A7270(spriteId, gBattleAnimArgs[4]); PrepareBattlerSpriteForRotScale(spriteId, gBattleAnimArgs[4]);
gTasks[taskId].data[0] = gBattleAnimArgs[0]; gTasks[taskId].data[0] = gBattleAnimArgs[0];
gTasks[taskId].data[1] = gBattleAnimArgs[1]; gTasks[taskId].data[1] = gBattleAnimArgs[1];
gTasks[taskId].data[2] = gBattleAnimArgs[2]; gTasks[taskId].data[2] = gBattleAnimArgs[2];
@ -851,7 +851,7 @@ void AnimTask_ScaleMonAndRestoreStep(u8 taskId)
gTasks[taskId].data[10] += gTasks[taskId].data[0]; gTasks[taskId].data[10] += gTasks[taskId].data[0];
gTasks[taskId].data[11] += gTasks[taskId].data[1]; gTasks[taskId].data[11] += gTasks[taskId].data[1];
spriteId = gTasks[taskId].data[4]; spriteId = gTasks[taskId].data[4];
obj_id_set_rotscale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[11], 0); SetSpriteRotScale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[11], 0);
if (--gTasks[taskId].data[2] == 0) if (--gTasks[taskId].data[2] == 0)
{ {
if (gTasks[taskId].data[3] > 0) if (gTasks[taskId].data[3] > 0)
@ -863,7 +863,7 @@ void AnimTask_ScaleMonAndRestoreStep(u8 taskId)
} }
else else
{ {
sub_80A7344(spriteId); ResetSpriteRotScale(spriteId);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
return; return;
} }
@ -874,7 +874,7 @@ void sub_80D6134(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]); spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]);
sub_80A7270(spriteId, 0); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
gTasks[taskId].data[1] = 0; gTasks[taskId].data[1] = 0;
gTasks[taskId].data[2] = gBattleAnimArgs[0]; gTasks[taskId].data[2] = gBattleAnimArgs[0];
if (gBattleAnimArgs[3] != 1) if (gBattleAnimArgs[3] != 1)
@ -918,7 +918,7 @@ void sub_80D622C(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]); spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]);
sub_80A7270(spriteId, 0); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
gTasks[taskId].data[1] = 0; gTasks[taskId].data[1] = 0;
gTasks[taskId].data[2] = gBattleAnimArgs[0]; gTasks[taskId].data[2] = gBattleAnimArgs[0];
if (gBattleAnimArgs[2] == 0) if (gBattleAnimArgs[2] == 0)
@ -955,17 +955,17 @@ void sub_80D622C(u8 taskId)
void sub_80D6308(u8 taskId) void sub_80D6308(u8 taskId)
{ {
gTasks[taskId].data[3] += gTasks[taskId].data[4]; gTasks[taskId].data[3] += gTasks[taskId].data[4];
obj_id_set_rotscale(gTasks[taskId].data[5], 0x100, 0x100, gTasks[taskId].data[3]); SetSpriteRotScale(gTasks[taskId].data[5], 0x100, 0x100, gTasks[taskId].data[3]);
if (gTasks[taskId].data[7]) if (gTasks[taskId].data[7])
{ {
sub_80A73A0(gTasks[taskId].data[5]); SetBattlerSpriteYOffsetFromRotation(gTasks[taskId].data[5]);
} }
if (++gTasks[taskId].data[1] >= gTasks[taskId].data[2]) if (++gTasks[taskId].data[1] >= gTasks[taskId].data[2])
{ {
switch (gTasks[taskId].data[6]) switch (gTasks[taskId].data[6])
{ {
case 1: case 1:
sub_80A7344(gTasks[taskId].data[5]); ResetSpriteRotScale(gTasks[taskId].data[5]);
case 0: case 0:
default: default:
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);

View File

@ -604,19 +604,19 @@ void sub_8170B04(u8 taskId)
switch (gTasks[taskId].data[0]) switch (gTasks[taskId].data[0])
{ {
case 0: case 0:
sub_80A7270(spriteId, 0); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
gTasks[taskId].data[10] = 0x100; gTasks[taskId].data[10] = 0x100;
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;
case 1: case 1:
gTasks[taskId].data[10] += 0x30; gTasks[taskId].data[10] += 0x30;
obj_id_set_rotscale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0); SetSpriteRotScale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0);
sub_80A7E6C(spriteId); SetBattlerSpriteYOffsetFromYScale(spriteId);
if (gTasks[taskId].data[10] >= 0x2D0) if (gTasks[taskId].data[10] >= 0x2D0)
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;
case 2: case 2:
sub_80A7344(spriteId); ResetSpriteRotScale(spriteId);
gSprites[spriteId].invisible = 1; gSprites[spriteId].invisible = 1;
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
break; break;
@ -756,7 +756,7 @@ void sub_8170F2C(u8 taskId)
} }
ballId = ItemIdToBallId(gLastUsedItem); ballId = ItemIdToBallId(gLastUsedItem);
subpriority = sub_80A82E4(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) + 1; subpriority = GetBattlerSpriteSubpriority(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) + 1;
spriteId = CreateSprite(&gBallSpriteTemplates[ballId], x + 32, y | 80, subpriority); spriteId = CreateSprite(&gBallSpriteTemplates[ballId], x + 32, y | 80, subpriority);
gSprites[spriteId].data[0] = 34; gSprites[spriteId].data[0] = 34;
gSprites[spriteId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 0); gSprites[spriteId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 0);
@ -862,7 +862,7 @@ static void sub_8171240(struct Sprite *sprite)
switch (gTasks[taskId].data[0]) switch (gTasks[taskId].data[0])
{ {
case 0: case 0:
sub_80A7270(spriteId, 0); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
gTasks[taskId].data[10] = 256; gTasks[taskId].data[10] = 256;
gUnknown_030062DC = 28; gUnknown_030062DC = 28;
gUnknown_030062E4 = (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) - (sprite->pos1.y + sprite->pos2.y); gUnknown_030062E4 = (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) - (sprite->pos1.y + sprite->pos2.y);
@ -872,14 +872,14 @@ static void sub_8171240(struct Sprite *sprite)
break; break;
case 1: case 1:
gTasks[taskId].data[10] += 0x20; gTasks[taskId].data[10] += 0x20;
obj_id_set_rotscale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0); SetSpriteRotScale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0);
gTasks[taskId].data[3] += gTasks[taskId].data[2]; gTasks[taskId].data[3] += gTasks[taskId].data[2];
gSprites[spriteId].pos2.y = -gTasks[taskId].data[3] >> 8; gSprites[spriteId].pos2.y = -gTasks[taskId].data[3] >> 8;
if (gTasks[taskId].data[10] >= 0x480) if (gTasks[taskId].data[10] >= 0x480)
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;
case 2: case 2:
sub_80A7344(spriteId); ResetSpriteRotScale(spriteId);
gSprites[spriteId].invisible = 1; gSprites[spriteId].invisible = 1;
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;

View File

@ -1,9 +1,15 @@
#include "global.h" #include "global.h"
#include "alloc.h"
#include "battle_anim.h" #include "battle_anim.h"
#include "battle_interface.h" #include "battle_interface.h"
#include "decompress.h"
#include "gpu_regs.h" #include "gpu_regs.h"
#include "graphics.h"
#include "main.h"
#include "math_util.h"
#include "palette.h" #include "palette.h"
#include "random.h" #include "random.h"
#include "scanline_effect.h"
#include "sound.h" #include "sound.h"
#include "trig.h" #include "trig.h"
#include "util.h" #include "util.h"
@ -2220,7 +2226,7 @@ void sub_80FE8E0(struct Sprite* sprite)
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->callback = StartAnimLinearTranslation; sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
} }
void sub_80FE930(struct Sprite* sprite) void sub_80FE930(struct Sprite* sprite)
@ -2257,9 +2263,9 @@ static void sub_80FE9E4(struct Sprite* sprite)
else else
{ {
if (sprite->data[5] > 0x7F) if (sprite->data[5] > 0x7F)
sprite->subpriority = sub_80A82E4(gBattleAnimTarget) + 1; sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1;
else else
sprite->subpriority = sub_80A82E4(gBattleAnimTarget) + 6; sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 6;
sprite->pos2.x += Sin(sprite->data[5], 5); sprite->pos2.x += Sin(sprite->data[5], 5);
sprite->pos2.y += Cos(sprite->data[5], 14); sprite->pos2.y += Cos(sprite->data[5], 14);
@ -2278,7 +2284,7 @@ void sub_80FEA58(u8 taskId)
gBattleAnimArgs[1] = 0; gBattleAnimArgs[1] = 0;
gBattleAnimArgs[2] = 80; gBattleAnimArgs[2] = 80;
gBattleAnimArgs[3] = 0; gBattleAnimArgs[3] = 0;
CreateSpriteAndAnimate(&gUnknown_08592210, 0, 0, sub_80A82E4(gBattleAnimTarget) + 1); CreateSpriteAndAnimate(&gUnknown_08592210, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1);
} }
if (gTasks[taskId].data[1] == 15) if (gTasks[taskId].data[1] == 15)
@ -2465,9 +2471,9 @@ static void sub_80FEECC(struct Sprite* sprite)
sprite->pos2.x += Sin(sprite->data[5], 32); sprite->pos2.x += Sin(sprite->data[5], 32);
sprite->pos2.y += Cos(sprite->data[5], -5); sprite->pos2.y += Cos(sprite->data[5], -5);
if ((u16)(sprite->data[5] - 0x40) < 0x80) if ((u16)(sprite->data[5] - 0x40) < 0x80)
sprite->subpriority = sub_80A82E4(gBattleAnimAttacker) - 1; sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
else else
sprite->subpriority = sub_80A82E4(gBattleAnimAttacker) + 1; sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + 1;
sprite->data[5] = (sprite->data[5] + 5) & 0xFF; sprite->data[5] = (sprite->data[5] + 5) & 0xFF;
} }
@ -2731,7 +2737,7 @@ void sub_80FF458(u8 taskId)
} }
else else
{ {
sub_80A7270(spriteId, 1); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND);
gTasks[taskId].data[14] = gSprites[spriteId].oam.priority; gTasks[taskId].data[14] = gSprites[spriteId].oam.priority;
gSprites[spriteId].oam.priority = sub_80A8328(gBattleAnimTarget); gSprites[spriteId].oam.priority = sub_80A8328(gBattleAnimTarget);
spriteId = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER); spriteId = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER);
@ -2753,8 +2759,8 @@ static void sub_80FF53C(u8 taskId)
gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x;
gTasks[taskId].data[11] += 16; gTasks[taskId].data[11] += 16;
obj_id_set_rotscale(spriteId, gTasks[taskId].data[11], gTasks[taskId].data[11], 0); SetSpriteRotScale(spriteId, gTasks[taskId].data[11], gTasks[taskId].data[11], 0);
sub_80A7E6C(spriteId); SetBattlerSpriteYOffsetFromYScale(spriteId);
if (--gTasks[taskId].data[1] == 0) if (--gTasks[taskId].data[1] == 0)
{ {
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
@ -2769,7 +2775,7 @@ static void sub_80FF5CC(u8 taskId)
if (gTasks[taskId].data[0] == 0) if (gTasks[taskId].data[0] == 0)
{ {
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
sub_80A7344(spriteId); ResetSpriteRotScale(spriteId);
gSprites[spriteId].pos2.x = 0; gSprites[spriteId].pos2.x = 0;
gSprites[spriteId].pos2.y = 0; gSprites[spriteId].pos2.y = 0;
gSprites[spriteId].oam.priority = gTasks[taskId].data[14]; gSprites[spriteId].oam.priority = gTasks[taskId].data[14];
@ -2795,7 +2801,6 @@ void sub_80FF698(struct Sprite* sprite)
switch (sprite->data[0]) switch (sprite->data[0])
{ {
case 0: case 0:
{
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
gBattleAnimArgs[0] *= -1; gBattleAnimArgs[0] *= -1;
@ -2804,9 +2809,7 @@ void sub_80FF698(struct Sprite* sprite)
sprite->invisible = 1; sprite->invisible = 1;
sprite->data[0]++; sprite->data[0]++;
break; break;
}
case 1: case 1:
{
sprite->invisible = 0; sprite->invisible = 0;
if (sprite->affineAnimEnded) if (sprite->affineAnimEnded)
{ {
@ -2819,7 +2822,6 @@ void sub_80FF698(struct Sprite* sprite)
break; break;
} }
} }
}
} }
void sub_80FF768(struct Sprite* sprite) void sub_80FF768(struct Sprite* sprite)
@ -3205,7 +3207,7 @@ void sub_80FFFC0(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
task->data[4] = sub_80A82E4(gBattleAnimTarget) - 1; task->data[4] = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 1;
task->data[6] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); task->data[6] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
task->data[7] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); task->data[7] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
task->data[10] = sub_80A861C(gBattleAnimTarget, 1); task->data[10] = sub_80A861C(gBattleAnimTarget, 1);
@ -3529,7 +3531,7 @@ static void sub_810074C(struct Sprite* sprite)
return; return;
} }
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
void sub_81007C4(u8 taskId) void sub_81007C4(u8 taskId)
@ -3613,7 +3615,7 @@ void sub_8100898(struct Sprite* sprite)
if (IsContest()) if (IsContest())
c -= 0x8000; c -= 0x8000;
sub_80A73E0(sprite, 0, 0x100, 0x100, c); TrySetSpriteRotScale(sprite, 0, 0x100, 0x100, c);
sprite->callback = sub_81009A0; sprite->callback = sub_81009A0;
} }
} }
@ -3630,7 +3632,7 @@ static void sub_81009A0(struct Sprite* sprite)
} }
else else
{ {
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
} }
@ -3653,7 +3655,7 @@ void sub_81009F8(struct Sprite* sprite)
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
} }
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
@ -3676,7 +3678,7 @@ void sub_8100A94(struct Sprite* sprite)
sprite->data[3] = gBattleAnimArgs[4]; sprite->data[3] = gBattleAnimArgs[4];
sprite->data[5] = gBattleAnimArgs[5]; sprite->data[5] = gBattleAnimArgs[5];
StartSpriteAffineAnim(sprite, gBattleAnimArgs[6]); StartSpriteAffineAnim(sprite, gBattleAnimArgs[6]);
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A66DC; sprite->callback = sub_80A66DC;
} }
@ -4024,7 +4026,7 @@ static void sub_8101298(struct Sprite* sprite, int unk1, int unk2)
void sub_810130C(struct Sprite* sprite) void sub_810130C(struct Sprite* sprite)
{ {
if (!gBattleAnimArgs[2]) if (!gBattleAnimArgs[2])
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
sub_80A6864(sprite, gBattleAnimArgs[0]); sub_80A6864(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -4032,7 +4034,7 @@ void sub_810130C(struct Sprite* sprite)
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[4]; sprite->data[2] = gBattleAnimArgs[4];
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = sub_80A656C; sprite->callback = TranslateAnimLinearSimple;
} }
void sub_810135C(struct Sprite* sprite) void sub_810135C(struct Sprite* sprite)
@ -4069,13 +4071,13 @@ void sub_810135C(struct Sprite* sprite)
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[4]; sprite->data[2] = gBattleAnimArgs[4];
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = sub_80A656C; sprite->callback = TranslateAnimLinearSimple;
} }
void sub_8101440(struct Sprite* sprite) void sub_8101440(struct Sprite* sprite)
{ {
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker) == 0) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
{ {
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -4105,7 +4107,7 @@ static void sub_81014A0(struct Sprite* sprite)
void sub_81014F4(struct Sprite* sprite) void sub_81014F4(struct Sprite* sprite)
{ {
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
{ {
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
@ -4130,7 +4132,7 @@ static void sub_8101560(struct Sprite* sprite)
sprite->data[4] += sprite->data[3] * 2; sprite->data[4] += sprite->data[3] * 2;
sprite->data[0] += sprite->data[1]; sprite->data[0] += sprite->data[1];
if (++sprite->data[1] > 60) if (++sprite->data[1] > 60)
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
void sub_81015AC(struct Sprite* sprite) void sub_81015AC(struct Sprite* sprite)
@ -4347,14 +4349,14 @@ static void sub_81019E8(struct Sprite* sprite)
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
sprite->data[3] = gBattlerSpriteIds[gBattleAnimAttacker]; sprite->data[3] = gBattlerSpriteIds[gBattleAnimAttacker];
sub_80A7270(sprite->data[3], 0); PrepareBattlerSpriteForRotScale(sprite->data[3], ST_OAM_OBJ_NORMAL);
sprite->data[4] = (sprite->data[6] = GetBattlerSide(gBattleAnimAttacker)) ? 0x300 : 0xFFFFFD00; sprite->data[4] = (sprite->data[6] = GetBattlerSide(gBattleAnimAttacker)) ? 0x300 : 0xFFFFFD00;
sprite->data[5] = 0; sprite->data[5] = 0;
} }
sprite->data[5] += sprite->data[4]; sprite->data[5] += sprite->data[4];
obj_id_set_rotscale(sprite->data[3], 0x100, 0x100, sprite->data[5]); SetSpriteRotScale(sprite->data[3], 0x100, 0x100, sprite->data[5]);
sub_80A73A0(sprite->data[3]); SetBattlerSpriteYOffsetFromRotation(sprite->data[3]);
if (++sprite->data[0] > 3) if (++sprite->data[0] > 3)
{ {
sprite->data[0] = 0; sprite->data[0] = 0;
@ -4400,11 +4402,11 @@ static void sub_8101AE8(struct Sprite* sprite)
} }
sprite->data[5] += sprite->data[4]; sprite->data[5] += sprite->data[4];
obj_id_set_rotscale(sprite->data[3], 0x100, 0x100, sprite->data[5]); SetSpriteRotScale(sprite->data[3], 0x100, 0x100, sprite->data[5]);
sub_80A73A0(sprite->data[3]); SetBattlerSpriteYOffsetFromRotation(sprite->data[3]);
if (++sprite->data[0] > 2) if (++sprite->data[0] > 2)
{ {
sub_80A7344(sprite->data[3]); ResetSpriteRotScale(sprite->data[3]);
sprite->callback = sub_8101B84; sprite->callback = sub_8101B84;
} }
} }
@ -4430,13 +4432,13 @@ static void sub_8101BA0(struct Sprite *sprite)
sprite->data[3] = GetBattlerSide(gBattleAnimAttacker); sprite->data[3] = GetBattlerSide(gBattleAnimAttacker);
sprite->data[4] = (sprite->data[3] != B_SIDE_PLAYER) ? 0x200 : -0x200; sprite->data[4] = (sprite->data[3] != B_SIDE_PLAYER) ? 0x200 : -0x200;
sprite->data[5] = 0; sprite->data[5] = 0;
sub_80A7270(sprite->data[2], 0); PrepareBattlerSpriteForRotScale(sprite->data[2], ST_OAM_OBJ_NORMAL);
sprite->data[0]++; sprite->data[0]++;
// fall through // fall through
case 1: case 1:
sprite->data[5] += sprite->data[4]; sprite->data[5] += sprite->data[4];
obj_id_set_rotscale(sprite->data[2], 0x100, 0x100, sprite->data[5]); SetSpriteRotScale(sprite->data[2], 0x100, 0x100, sprite->data[5]);
sub_80A73A0(sprite->data[2]); SetBattlerSpriteYOffsetFromRotation(sprite->data[2]);
if (++sprite->data[1] > 3) if (++sprite->data[1] > 3)
{ {
sprite->data[1] = 0; sprite->data[1] = 0;
@ -4446,11 +4448,11 @@ static void sub_8101BA0(struct Sprite *sprite)
break; break;
case 2: case 2:
sprite->data[5] += sprite->data[4]; sprite->data[5] += sprite->data[4];
obj_id_set_rotscale(sprite->data[2], 0x100, 0x100, sprite->data[5]); SetSpriteRotScale(sprite->data[2], 0x100, 0x100, sprite->data[5]);
sub_80A73A0(sprite->data[2]); SetBattlerSpriteYOffsetFromRotation(sprite->data[2]);
if (++sprite->data[1] > 3) if (++sprite->data[1] > 3)
{ {
sub_80A7344(sprite->data[2]); ResetSpriteRotScale(sprite->data[2]);
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
break; break;
@ -4512,7 +4514,7 @@ static void sub_8101D2C(u8 taskId)
task->data[3] = 8; task->data[3] = 8;
task->data[4] = 0; task->data[4] = 0;
task->data[5] = (task->data[1] == 0) ? -0xC0 : 0xC0; task->data[5] = (task->data[1] == 0) ? -0xC0 : 0xC0;
sub_80A7270(task->data[0], 0); PrepareBattlerSpriteForRotScale(task->data[0], ST_OAM_OBJ_NORMAL);
task->data[2]++; task->data[2]++;
} }
break; break;
@ -4520,8 +4522,8 @@ static void sub_8101D2C(u8 taskId)
if (task->data[3]) if (task->data[3])
{ {
task->data[4] += task->data[5]; task->data[4] += task->data[5];
obj_id_set_rotscale(task->data[0], 0x100, 0x100, task->data[4]); SetSpriteRotScale(task->data[0], 0x100, 0x100, task->data[4]);
sub_80A73A0(task->data[0]); SetBattlerSpriteYOffsetFromRotation(task->data[0]);
task->data[3]--; task->data[3]--;
} }
else else
@ -4592,13 +4594,13 @@ static void sub_8101EEC(u8 taskId)
if (task->data[3]) if (task->data[3])
{ {
task->data[4] -= task->data[5]; task->data[4] -= task->data[5];
obj_id_set_rotscale(task->data[0], 0x100, 0x100, task->data[4]); SetSpriteRotScale(task->data[0], 0x100, 0x100, task->data[4]);
sub_80A73A0(task->data[0]); SetBattlerSpriteYOffsetFromRotation(task->data[0]);
task->data[3]--; task->data[3]--;
} }
else else
{ {
sub_80A7344(task->data[0]); ResetSpriteRotScale(task->data[0]);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
} }
@ -4619,7 +4621,7 @@ void sub_8101F40(struct Sprite* sprite)
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->data[1] = 0; sprite->data[1] = 0;
StoreSpriteCallbackInData6(sprite, sub_810208C); StoreSpriteCallbackInData6(sprite, sub_810208C);
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
} }
void sub_8101FA8(struct Sprite* sprite) void sub_8101FA8(struct Sprite* sprite)
@ -4627,7 +4629,7 @@ void sub_8101FA8(struct Sprite* sprite)
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + 0xFFD0; sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + 0xFFD0;
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
StoreSpriteCallbackInData6(sprite, sub_8102044); StoreSpriteCallbackInData6(sprite, sub_8102044);
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
} }
void sub_8101FF0(struct Sprite* sprite) void sub_8101FF0(struct Sprite* sprite)
@ -4914,7 +4916,7 @@ void sub_81025C0(u8 taskId)
gTasks[taskId].data[9] = 15; gTasks[taskId].data[9] = 15;
b = sub_80A76C4(1, 1, 1, 1); b = sub_80A76C4(1, 1, 1, 1);
c = a | b; c = a | b;
sub_80A8048(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c); StorePointerInVars(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c);
b = b | (0x10000 << IndexOfSpritePaletteTag(ANIM_TAG_MOON)); b = b | (0x10000 << IndexOfSpritePaletteTag(ANIM_TAG_MOON));
d = IndexOfSpritePaletteTag(ANIM_TAG_GREEN_SPARKLE); d = IndexOfSpritePaletteTag(ANIM_TAG_GREEN_SPARKLE);
BeginNormalPaletteFade((0x10000 << d) | b, 0, 0, 16, RGB(27, 29, 31)); BeginNormalPaletteFade((0x10000 << d) | b, 0, 0, 16, RGB(27, 29, 31));
@ -4989,7 +4991,7 @@ void sub_81026A8(u8 taskId)
case 2: case 2:
if (++task->data[1] > 30) if (++task->data[1] > 30)
{ {
BeginNormalPaletteFade((u32)sub_80A8050(task->data[14], task->data[15]), 0, 16, 0, RGB(27, 29, 31)); BeginNormalPaletteFade((u32)LoadPointerFromVars(task->data[14], task->data[15]), 0, 16, 0, RGB(27, 29, 31));
task->data[0]++; task->data[0]++;
} }
break; break;
@ -5080,7 +5082,7 @@ void sub_81029B4(u8 taskId)
BlendPalette(r3, 16, 11, RGB(0, 0, 0)); BlendPalette(r3, 16, 11, RGB(0, 0, 0));
task->data[3] = 0; task->data[3] = 0;
i = 0; i = 0;
while (i < 2 && (obj = duplicate_obj_of_side_rel2move_in_transparent_mode(0)) >= 0) while (i < 2 && (obj = CloneBattlerSpriteWithBlend(0)) >= 0)
{ {
gSprites[obj].oam.paletteNum = task->data[1]; gSprites[obj].oam.paletteNum = task->data[1];
gSprites[obj].data[0] = 0; gSprites[obj].data[0] = 0;
@ -5138,7 +5140,7 @@ static void sub_8102B3C(struct Sprite* sprite)
void sub_8102BCC(struct Sprite* sprite) void sub_8102BCC(struct Sprite* sprite)
{ {
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
} }
void sub_8102BE8(u8 taskId) void sub_8102BE8(u8 taskId)
@ -5183,7 +5185,7 @@ void sub_8102CD4(struct Sprite* sprite)
u8 index; u8 index;
u8 a; u8 a;
u8 b; u8 b;
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
StartSpriteAnim(sprite, gBattleAnimArgs[0]); StartSpriteAnim(sprite, gBattleAnimArgs[0]);
if ((index = IndexOfSpritePaletteTag(gUnknown_08593020[gBattleAnimArgs[1]][0])) != 0xFF) if ((index = IndexOfSpritePaletteTag(gUnknown_08593020[gBattleAnimArgs[1]][0])) != 0xFF)
sprite->oam.paletteNum = index; sprite->oam.paletteNum = index;
@ -5242,7 +5244,7 @@ static void sub_8102DE4(struct Sprite* sprite)
if ((u32)((c + 16) << 16) > (0x110) << 16 || a < -16 || a > 0x80) if ((u32)((c + 16) << 16) > (0x110) << 16 || a < -16 || a > 0x80)
{ {
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
else else
{ {
@ -5296,7 +5298,7 @@ static void sub_8102F40(struct Sprite* sprite)
} }
if (++sprite->data[0] == 48) if (++sprite->data[0] == 48)
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
void sub_8102FB8(struct Sprite* sprite) void sub_8102FB8(struct Sprite* sprite)
@ -5323,7 +5325,7 @@ void sub_8103028(struct Sprite* sprite)
{ {
s16 xDiff; s16 xDiff;
u8 index; u8 index;
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
sprite->pos1.y += 8; sprite->pos1.y += 8;
StartSpriteAnim(sprite, gBattleAnimArgs[1]); StartSpriteAnim(sprite, gBattleAnimArgs[1]);
index = IndexOfSpritePaletteTag(gUnknown_08593020[gBattleAnimArgs[2]][0]); index = IndexOfSpritePaletteTag(gUnknown_08593020[gBattleAnimArgs[2]][0]);
@ -5385,7 +5387,7 @@ void sub_8103164(struct Sprite* sprite)
sprite->data[1] = a + 2; sprite->data[1] = a + 2;
StartSpriteAnim(sprite, a); StartSpriteAnim(sprite, a);
StoreSpriteCallbackInData6(sprite, sub_81031D0); StoreSpriteCallbackInData6(sprite, sub_81031D0);
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
} }
static void sub_81031D0(struct Sprite* sprite) static void sub_81031D0(struct Sprite* sprite)
@ -5394,7 +5396,7 @@ static void sub_81031D0(struct Sprite* sprite)
{ {
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
StartSpriteAnim(sprite, sprite->data[1]); StartSpriteAnim(sprite, sprite->data[1]);
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
} }
} }
@ -5409,7 +5411,7 @@ void sub_8103208(struct Sprite* sprite)
sub_810310C(battler, sprite); sub_810310C(battler, sprite);
sprite->data[0] = 0; sprite->data[0] = 0;
StoreSpriteCallbackInData6(sprite, sub_8103250); StoreSpriteCallbackInData6(sprite, sub_8103250);
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }
static void sub_8103250(struct Sprite* sprite) static void sub_8103250(struct Sprite* sprite)
@ -5417,8 +5419,8 @@ static void sub_8103250(struct Sprite* sprite)
if (++sprite->data[0] > 16) if (++sprite->data[0] > 16)
{ {
StartSpriteAffineAnim(sprite, 1); StartSpriteAffineAnim(sprite, 1);
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }
} }
@ -5441,7 +5443,7 @@ void sub_8103284(struct Sprite* sprite)
sprite->data[3] = sprite->subpriority + 4; sprite->data[3] = sprite->subpriority + 4;
sprite->data[4] = 0; sprite->data[4] = 0;
StoreSpriteCallbackInData6(sprite, sub_8103300); StoreSpriteCallbackInData6(sprite, sub_8103300);
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }
static void sub_8103300(struct Sprite* sprite) static void sub_8103300(struct Sprite* sprite)
@ -5509,7 +5511,7 @@ static void sub_81033F0(struct Sprite* sprite)
sprite->data[1] = 0; sprite->data[1] = 0;
StartSpriteAnim(sprite, sprite->data[0]); StartSpriteAnim(sprite, sprite->data[0]);
StoreSpriteCallbackInData6(sprite, sub_810342C); StoreSpriteCallbackInData6(sprite, sub_810342C);
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
} }
} }

3884
src/battle_anim_effects_2.c Executable file

File diff suppressed because it is too large Load Diff

View File

@ -236,7 +236,7 @@ static void sub_81169F8(u8 taskId)
} }
else else
{ {
task->data[6] = duplicate_obj_of_side_rel2move_in_transparent_mode(task->data[0]); task->data[6] = CloneBattlerSpriteWithBlend(task->data[0]);
if (task->data[6] >= 0) if (task->data[6] >= 0)
{ {
gSprites[task->data[6]].oam.priority = task->data[0] ? 1 : 2; gSprites[task->data[6]].oam.priority = task->data[0] ? 1 : 2;

View File

@ -1136,7 +1136,7 @@ static void LinkOpponentHandleLoadMonSprite(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteCoord(gActiveBattler, 2),
GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteDefault_Y(gActiveBattler),
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
@ -1170,7 +1170,7 @@ static void sub_8066494(u8 battlerId, bool8 dontClearSubstituteBit)
&gMultiuseSpriteTemplate, &gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId];
gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId;
@ -1302,7 +1302,7 @@ static void LinkOpponentHandleDrawTrainerPic(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
xPos, xPos,
(8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40,
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2;

View File

@ -1024,7 +1024,7 @@ static void LinkPartnerHandleLoadMonSprite(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteCoord(gActiveBattler, 2),
GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteDefault_Y(gActiveBattler),
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
@ -1055,7 +1055,7 @@ static void sub_814CC98(u8 battlerId, bool8 dontClearSubstituteBit)
&gMultiuseSpriteTemplate, &gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId];
gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId;
@ -1143,7 +1143,7 @@ static void LinkPartnerHandleDrawTrainerPic(void)
DecompressTrainerBackPic(trainerPicId, gActiveBattler); DecompressTrainerBackPic(trainerPicId, gActiveBattler);
SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler));
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerBackPicCoords[trainerPicId].coords) * 4 + 80, sub_80A82E4(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerBackPicCoords[trainerPicId].coords) * 4 + 80, GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240;

View File

@ -1128,7 +1128,7 @@ static void OpponentHandleLoadMonSprite(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteCoord(gActiveBattler, 2),
GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteDefault_Y(gActiveBattler),
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
@ -1163,7 +1163,7 @@ static void sub_80613DC(u8 battlerId, bool8 dontClearSubstituteBit)
gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId;
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
@ -1293,7 +1293,7 @@ static void OpponentHandleDrawTrainerPic(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
xPos, xPos,
(8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40,
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2;

View File

@ -2200,7 +2200,7 @@ static void sub_805B258(u8 battlerId, bool8 dontClearSubstituteBit)
&gMultiuseSpriteTemplate, &gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId];
gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId;
@ -2314,7 +2314,7 @@ static void PlayerHandleDrawTrainerPic(void)
trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender); trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender);
DecompressTrainerFrontPic(trainerPicId, gActiveBattler); DecompressTrainerFrontPic(trainerPicId, gActiveBattler);
SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler)); SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler));
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, sub_80A82E4(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240;
@ -2329,7 +2329,7 @@ static void PlayerHandleDrawTrainerPic(void)
{ {
DecompressTrainerBackPic(trainerPicId, gActiveBattler); DecompressTrainerBackPic(trainerPicId, gActiveBattler);
SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler));
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, sub_80A82E4(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240;

View File

@ -1211,7 +1211,7 @@ static void PlayerPartnerHandleLoadMonSprite(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteCoord(gActiveBattler, 2),
GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteDefault_Y(gActiveBattler),
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
@ -1242,7 +1242,7 @@ static void sub_81BD0E4(u8 battlerId, bool8 dontClearSubstituteBit)
&gMultiuseSpriteTemplate, &gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId];
gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId;
@ -1322,7 +1322,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void)
{ {
DecompressTrainerBackPic(trainerPicId, gActiveBattler); DecompressTrainerBackPic(trainerPicId, gActiveBattler);
SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler));
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, sub_80A82E4(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240;
@ -1333,7 +1333,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void)
{ {
DecompressTrainerFrontPic(trainerPicId, gActiveBattler); DecompressTrainerFrontPic(trainerPicId, gActiveBattler);
SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler)); SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler));
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, sub_80A82E4(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240;

View File

@ -1119,9 +1119,7 @@ static void RecordedOpponentHandleLoadMonSprite(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteCoord(gActiveBattler, 2),
GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteDefault_Y(gActiveBattler),
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
@ -1154,7 +1152,7 @@ static void sub_81885D8(u8 battlerId, bool8 dontClearSubstituteBit)
gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId];
gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId;
@ -1251,7 +1249,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
xPos, xPos,
(8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40,
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2;

View File

@ -1105,7 +1105,7 @@ static void RecordedPlayerHandleLoadMonSprite(void)
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteCoord(gActiveBattler, 2),
GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteDefault_Y(gActiveBattler),
sub_80A82E4(gActiveBattler)); GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
@ -1136,7 +1136,7 @@ static void sub_818BA6C(u8 battlerId, bool8 dontClearSubstituteBit)
&gMultiuseSpriteTemplate, &gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId];
gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId;
@ -1236,7 +1236,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void)
trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender); trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender);
DecompressTrainerFrontPic(trainerPicId, gActiveBattler); DecompressTrainerFrontPic(trainerPicId, gActiveBattler);
SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler)); SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler));
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, sub_80A82E4(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240;
@ -1250,7 +1250,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void)
{ {
DecompressTrainerBackPic(trainerPicId, gActiveBattler); DecompressTrainerBackPic(trainerPicId, gActiveBattler);
SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler));
gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, sub_80A82E4(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler));
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240;

View File

@ -1464,7 +1464,7 @@ static void sub_816AA80(u8 battlerId)
gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate,
GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteCoord(battlerId, 2),
GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteDefault_Y(battlerId),
sub_80A82E4(battlerId)); GetBattlerSpriteSubpriority(battlerId));
gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId];
gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId;

View File

@ -1097,14 +1097,14 @@ void sub_805EB9C(u8 affineMode)
if (IsBattlerSpritePresent(i)) if (IsBattlerSpritePresent(i))
{ {
gSprites[gBattlerSpriteIds[i]].oam.affineMode = affineMode; gSprites[gBattlerSpriteIds[i]].oam.affineMode = affineMode;
if (affineMode == 0) if (affineMode == ST_OAM_AFFINE_OFF)
{ {
gBattleSpritesDataPtr->healthBoxesData[i].field_6 = gSprites[gBattlerSpriteIds[i]].oam.matrixNum; gBattleSpritesDataPtr->healthBoxesData[i].matrixNum = gSprites[gBattlerSpriteIds[i]].oam.matrixNum;
gSprites[gBattlerSpriteIds[i]].oam.matrixNum = 0; gSprites[gBattlerSpriteIds[i]].oam.matrixNum = 0;
} }
else else
{ {
gSprites[gBattlerSpriteIds[i]].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[i].field_6; gSprites[gBattlerSpriteIds[i]].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[i].matrixNum;
} }
} }
} }

View File

@ -395,7 +395,7 @@ void AnimTranslateStinger(struct Sprite *sprite)
lVarY = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; lVarY = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3];
rot = ArcTan2Neg(lVarX - sprite->pos1.x, lVarY - sprite->pos1.y); rot = ArcTan2Neg(lVarX - sprite->pos1.x, lVarY - sprite->pos1.y);
rot += 0xC000; rot += 0xC000;
sub_80A73E0(sprite, FALSE, 0x100, 0x100, rot); TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rot);
sprite->data[0] = gBattleAnimArgs[4]; sprite->data[0] = gBattleAnimArgs[4];
sprite->data[2] = lVarX; sprite->data[2] = lVarX;
@ -458,7 +458,7 @@ static void AnimMissileArcStep(struct Sprite *sprite)
u16 rotation = ArcTan2Neg(sprite->pos1.x + sprite->pos2.x - x2, u16 rotation = ArcTan2Neg(sprite->pos1.x + sprite->pos2.x - x2,
sprite->pos1.y + sprite->pos2.y - y2); sprite->pos1.y + sprite->pos2.y - y2);
rotation += 0xC000; rotation += 0xC000;
sub_80A73E0(sprite, FALSE, 0x100, 0x100, rotation); TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation);
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
data[i] = tempData[i]; data[i] = tempData[i];
@ -479,6 +479,6 @@ void sub_8110994(struct Sprite *sprite)
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + 18; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + 18;
} }
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }

View File

@ -2520,7 +2520,7 @@ u8 sub_80DB174(u16 species, u32 otId, u32 personality, u32 index)
spriteId = CreateSprite(&gMultiuseSpriteTemplate, 0x70, GetBattlerSpriteFinal_Y(2, species, FALSE), 30); spriteId = CreateSprite(&gMultiuseSpriteTemplate, 0x70, GetBattlerSpriteFinal_Y(2, species, FALSE), 30);
gSprites[spriteId].oam.paletteNum = 2; gSprites[spriteId].oam.paletteNum = 2;
gSprites[spriteId].oam.priority = 2; gSprites[spriteId].oam.priority = 2;
gSprites[spriteId].subpriority = sub_80A82E4(2); gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(2);
gSprites[spriteId].callback = SpriteCallbackDummy; gSprites[spriteId].callback = SpriteCallbackDummy;
gSprites[spriteId].data[0] = gSprites[spriteId].oam.paletteNum; gSprites[spriteId].data[0] = gSprites[spriteId].oam.paletteNum;
gSprites[spriteId].data[2] = species; gSprites[spriteId].data[2] = species;

View File

@ -208,13 +208,13 @@ void sub_8113064(struct Sprite *sprite)
sprite->data[3] = gBattleAnimArgs[4]; sprite->data[3] = gBattleAnimArgs[4];
sprite->data[5] = gBattleAnimArgs[5]; sprite->data[5] = gBattleAnimArgs[5];
sprite->invisible = 1; sprite->invisible = 1;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A66DC; sprite->callback = sub_80A66DC;
} }
static void sub_8113100(struct Sprite *sprite) static void sub_8113100(struct Sprite *sprite)
{ {
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
@ -235,7 +235,7 @@ static void sub_8113100(struct Sprite *sprite)
sprite->data[0] = gBattleAnimArgs[4]; sprite->data[0] = gBattleAnimArgs[4];
sprite->callback = StartAnimLinearTranslation; sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
} }
void sub_81131B4(struct Sprite *sprite) void sub_81131B4(struct Sprite *sprite)
@ -253,8 +253,8 @@ void sub_81131B4(struct Sprite *sprite)
sub_80A6864(sprite, gBattleAnimArgs[1]); sub_80A6864(sprite, gBattleAnimArgs[1]);
sprite->pos1.y += gBattleAnimArgs[2]; sprite->pos1.y += gBattleAnimArgs[2];
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
} }
void sub_8113224(struct Sprite *sprite) void sub_8113224(struct Sprite *sprite)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -828,7 +828,7 @@ static void sub_810D6A8(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(sprite->data[7], 3); sprite->data[4] = GetBattlerSpriteCoord(sprite->data[7], 3);
InitAnimLinearTranslation(sprite); InitAnimLinearTranslation(sprite);
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A6F98; sprite->callback = sub_80A6F98;
} }
} }
@ -839,7 +839,7 @@ void sub_810D714(struct Sprite *sprite)
sprite->pos1.y = 120; sprite->pos1.y = 120;
sprite->data[0] = gBattleAnimArgs[3]; sprite->data[0] = gBattleAnimArgs[3];
sub_80A8048(&sprite->data[4], &sprite->data[5], (void *)(sprite->pos1.y << 8)); StorePointerInVars(&sprite->data[4], &sprite->data[5], (void *)(sprite->pos1.y << 8));
sprite->data[6] = gBattleAnimArgs[1]; sprite->data[6] = gBattleAnimArgs[1];
sprite->oam.tileNum += gBattleAnimArgs[2] * 4; sprite->oam.tileNum += gBattleAnimArgs[2] * 4;
@ -853,9 +853,9 @@ static void sub_810D770(struct Sprite *sprite)
if (sprite->data[0] != 0) if (sprite->data[0] != 0)
{ {
var0 = sub_80A8050(sprite->data[4], sprite->data[5]); var0 = LoadPointerFromVars(sprite->data[4], sprite->data[5]);
var0 -= sprite->data[6]; var0 -= sprite->data[6];
sub_80A8048(&sprite->data[4], &sprite->data[5], var0); StorePointerInVars(&sprite->data[4], &sprite->data[5], var0);
var0 = (void *)(((intptr_t)var0) >> 8); var0 = (void *)(((intptr_t)var0) >> 8);
sprite->pos1.y = (intptr_t)var0; sprite->pos1.y = (intptr_t)var0;
@ -978,7 +978,7 @@ void sub_810DA10(struct Sprite *sprite)
StartSpriteAnim(sprite, 1); StartSpriteAnim(sprite, 1);
} }
sprite->callback = sub_80A67D8; sprite->callback = RunStoredCallbackWhenAnimEnds;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }

View File

@ -466,7 +466,7 @@ static void sub_8108EC8(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = sub_80A634C; sprite->callback = TranslateSpriteInGrowingCircleOverDuration;
sprite->callback(sprite); sprite->callback(sprite);
} }
@ -479,13 +479,13 @@ static void sub_8108F08(struct Sprite *sprite)
sprite->data[1] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[2];
sprite->data[2] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[3];
sprite->callback = sub_80A656C; sprite->callback = TranslateAnimLinearSimple;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
static void sub_8108F4C(struct Sprite *sprite) static void sub_8108F4C(struct Sprite *sprite)
{ {
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker)) if (GetBattlerSide(gBattleAnimAttacker))
{ {
@ -538,12 +538,12 @@ static void sub_8109028(struct Sprite *sprite)
} }
if (sprite->data[0] == sprite->data[1]) if (sprite->data[0] == sprite->data[1])
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
static void sub_8109064(struct Sprite *sprite) static void sub_8109064(struct Sprite *sprite)
{ {
sub_80A6838(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker)) if (GetBattlerSide(gBattleAnimAttacker))
{ {
@ -588,7 +588,7 @@ static void sub_81090D8(struct Sprite *sprite)
} }
else else
{ {
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
} }
} }
@ -779,7 +779,7 @@ void sub_8109460(u8 taskId) // initialize animation task for Move_ERUPTION?
task->data[5] = GetBattlerSide(gBattleAnimAttacker); task->data[5] = GetBattlerSide(gBattleAnimAttacker);
task->data[6] = 0; task->data[6] = 0;
sub_80A7270(task->data[15], 0); PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL);
task->func = sub_81094D0; task->func = sub_81094D0;
} }
@ -816,7 +816,7 @@ static void sub_81094D0(u8 taskId) // animate Move_ERUPTION?
if(!sub_80A80C8(task)) if(!sub_80A80C8(task))
{ {
sub_80A7E6C(task->data[15]); SetBattlerSpriteYOffsetFromYScale(task->data[15]);
gSprites[task->data[15]].pos2.x = 0; gSprites[task->data[15]].pos2.x = 0;
task->data[1] = 0; task->data[1] = 0;
@ -879,7 +879,7 @@ static void sub_81094D0(u8 taskId) // animate Move_ERUPTION?
if (!sub_80A80C8(task)) if (!sub_80A80C8(task))
{ {
gSprites[task->data[15]].pos1.y = task->data[4]; gSprites[task->data[15]].pos1.y = task->data[4];
sub_80A7344(task->data[15]); ResetSpriteRotScale(task->data[15]);
task->data[2] = 0; task->data[2] = 0;
task->data[0]++; task->data[0]++;

View File

@ -342,8 +342,8 @@ void sub_811188C(u8 taskId)
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0x10)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0x10));
spriteId = GetAnimBattlerSpriteId(0); spriteId = GetAnimBattlerSpriteId(0);
sub_80A7270(spriteId, 1); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND);
obj_id_set_rotscale(spriteId, 128, 128, 0); SetSpriteRotScale(spriteId, 128, 128, 0);
gSprites[spriteId].invisible = FALSE; gSprites[spriteId].invisible = FALSE;
gTasks[taskId].data[0] = 128; gTasks[taskId].data[0] = 128;
gTasks[taskId].data[1] = *gBattleAnimArgs; gTasks[taskId].data[1] = *gBattleAnimArgs;
@ -381,11 +381,11 @@ static void sub_811196C(u8 taskId)
gTasks[taskId].data[0] += 8; gTasks[taskId].data[0] += 8;
if (gTasks[taskId].data[0] <= 0xFF) if (gTasks[taskId].data[0] <= 0xFF)
{ {
obj_id_set_rotscale(spriteId, gTasks[taskId].data[0], gTasks[taskId].data[0], 0); SetSpriteRotScale(spriteId, gTasks[taskId].data[0], gTasks[taskId].data[0], 0);
} }
else else
{ {
sub_80A7344(spriteId); ResetSpriteRotScale(spriteId);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0);
@ -454,7 +454,7 @@ static void AnimShadowBallStep(struct Sprite *sprite)
sprite->data[0] += 1; sprite->data[0] += 1;
break; break;
case 3: case 3:
move_anim_8074EE0(sprite); DestroySpriteAndMatrix(sprite);
break; break;
} }
} }
@ -510,7 +510,7 @@ void sub_8111C50(u8 taskId)
struct Task *task; struct Task *task;
task = &gTasks[taskId]; task = &gTasks[taskId];
task->data[0] = duplicate_obj_of_side_rel2move_in_transparent_mode(1); task->data[0] = CloneBattlerSpriteWithBlend(1);
if (task->data[0] < 0) if (task->data[0] < 0)
{ {
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
@ -536,7 +536,7 @@ void sub_8111C50(u8 taskId)
gSprites[task->data[0]].data[3] = 0; gSprites[task->data[0]].data[3] = 0;
gSprites[task->data[0]].data[4] = 0; gSprites[task->data[0]].data[4] = 0;
StoreSpriteCallbackInData6(&gSprites[task->data[0]], SpriteCallbackDummy); StoreSpriteCallbackInData6(&gSprites[task->data[0]], SpriteCallbackDummy);
gSprites[task->data[0]].callback = sub_80A656C; gSprites[task->data[0]].callback = TranslateAnimLinearSimple;
task->func = sub_8111D78; task->func = sub_8111D78;
} }
@ -602,7 +602,7 @@ static void sub_8111E78(u8 taskId)
} }
else else
{ {
task->data[0] = duplicate_obj_of_side_rel2move_in_transparent_mode(1); task->data[0] = CloneBattlerSpriteWithBlend(1);
if (task->data[0] < 0) if (task->data[0] < 0)
{ {
FreeSpritePaletteByTag(0x2771); FreeSpritePaletteByTag(0x2771);
@ -1171,7 +1171,7 @@ void sub_8112C6C(u8 taskId)
task->data[11] = (sub_80A861C(gBattleAnimAttacker, 1) / 2) + 8; task->data[11] = (sub_80A861C(gBattleAnimAttacker, 1) / 2) + 8;
task->data[7] = 0; task->data[7] = 0;
task->data[5] = sub_80A8328(gBattleAnimAttacker); task->data[5] = sub_80A8328(gBattleAnimAttacker);
task->data[6] = sub_80A82E4(gBattleAnimAttacker) - 2; task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 2;
task->data[3] = 0; task->data[3] = 0;
task->data[4] = 16; task->data[4] = 16;
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
@ -1322,6 +1322,6 @@ static void sub_8112FB8(struct Sprite *sprite)
gSprites[sprite->data[5]].pos2.x = 0; gSprites[sprite->data[5]].pos2.x = 0;
gSprites[sprite->data[5]].pos2.y = 0; gSprites[sprite->data[5]].pos2.y = 0;
gSprites[sprite->data[5]].pos1.y -= 8; gSprites[sprite->data[5]].pos1.y -= 8;
sprite->callback = move_anim_8074EE0; sprite->callback = DestroySpriteAndMatrix;
} }
} }

View File

@ -221,7 +221,7 @@ void AnimDirtScatter(struct Sprite *sprite)
sprite->data[2] = targetXPos + xOffset; sprite->data[2] = targetXPos + xOffset;
sprite->data[4] = targetYPos + yOffset; sprite->data[4] = targetYPos + yOffset;
sprite->callback = StartAnimLinearTranslation; sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
} }
// Moves a particle of dirt in the Mud Sport animation. // Moves a particle of dirt in the Mud Sport animation.

View File

@ -410,8 +410,8 @@ void sub_81159B4(struct Sprite *sprite)
sprite->data[3] = 40; sprite->data[3] = 40;
sprite->data[4] = 112; sprite->data[4] = 112;
sprite->data[5] = 0; sprite->data[5] = 0;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A634C; sprite->callback = TranslateSpriteInGrowingCircleOverDuration;
sprite->callback(sprite); sprite->callback(sprite);
} }
@ -884,7 +884,7 @@ void sub_8116388(struct Sprite *sprite)
else else
sub_80A6980(sprite, TRUE); sub_80A6980(sprite, TRUE);
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
@ -897,7 +897,7 @@ static void sub_81163D0(struct Sprite *sprite)
sub_80A6980(sprite, TRUE); sub_80A6980(sprite, TRUE);
sprite->data[0] = gBattleAnimArgs[4]; sprite->data[0] = gBattleAnimArgs[4];
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
StoreSpriteCallbackInData6(sprite, sub_810E2C8); StoreSpriteCallbackInData6(sprite, sub_810E2C8);
} }
@ -923,8 +923,8 @@ void sub_8116458(struct Sprite *sprite)
sprite->pos2.x += (Random2() % 48) - 24; sprite->pos2.x += (Random2() % 48) - 24;
sprite->pos2.y += (Random2() % 24) - 12; sprite->pos2.y += (Random2() % 24) - 12;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }
void sub_81164F0(struct Sprite *sprite) void sub_81164F0(struct Sprite *sprite)
@ -935,8 +935,8 @@ void sub_81164F0(struct Sprite *sprite)
sprite->pos2.x = gBattleAnimArgs[1]; sprite->pos2.x = gBattleAnimArgs[1];
sprite->pos2.y = gBattleAnimArgs[2]; sprite->pos2.y = gBattleAnimArgs[2];
StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]);
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A67BC; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }
void sub_8116560(struct Sprite *sprite) void sub_8116560(struct Sprite *sprite)

View File

@ -258,7 +258,7 @@ void sub_810DCD0(struct Sprite *sprite)
static void sub_810DD24(struct Sprite *sprite) static void sub_810DD24(struct Sprite *sprite)
{ {
sub_80A656C(sprite); TranslateAnimLinearSimple(sprite);
sprite->data[1] -= sprite->data[5]; sprite->data[1] -= sprite->data[5];
sprite->data[2] -= sprite->data[6]; sprite->data[2] -= sprite->data[6];

View File

@ -226,7 +226,7 @@ static void CreateBattlerSprite(u8 battler)
return; return;
SetMultiuseSpriteTemplateToPokemon(GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler)); SetMultiuseSpriteTemplateToPokemon(GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler));
gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, sub_80A82E4(battler)); gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, GetBattlerSpriteSubpriority(battler));
gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler;
gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy;
gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[0] = battler;
@ -241,7 +241,7 @@ static void CreateBattlerSprite(u8 battler)
SetMultiuseSpriteTemplateToTrainerBack(gSaveBlock2Ptr->playerGender, GetBattlerPosition(B_POSITION_PLAYER_LEFT)); SetMultiuseSpriteTemplateToTrainerBack(gSaveBlock2Ptr->playerGender, GetBattlerPosition(B_POSITION_PLAYER_LEFT));
gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, 0x50, gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, 0x50,
(8 - gTrainerBackPicCoords[gSaveBlock2Ptr->playerGender].coords) * 4 + 80, (8 - gTrainerBackPicCoords[gSaveBlock2Ptr->playerGender].coords) * 4 + 80,
sub_80A82E4(0)); GetBattlerSpriteSubpriority(0));
gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler;
gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy;
gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[0] = battler;
@ -251,7 +251,7 @@ static void CreateBattlerSprite(u8 battler)
SetMultiuseSpriteTemplateToTrainerBack(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(0)); SetMultiuseSpriteTemplateToTrainerBack(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(0));
gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, 0x50, gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, 0x50,
(8 - gTrainerBackPicCoords[TRAINER_BACK_PIC_WALLY].coords) * 4 + 80, (8 - gTrainerBackPicCoords[TRAINER_BACK_PIC_WALLY].coords) * 4 + 80,
sub_80A82E4(0)); GetBattlerSpriteSubpriority(0));
gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler;
gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy;
gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[0] = battler;
@ -262,7 +262,7 @@ static void CreateBattlerSprite(u8 battler)
return; return;
SetMultiuseSpriteTemplateToPokemon(GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler)); SetMultiuseSpriteTemplateToPokemon(GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler));
gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, sub_80A82E4(battler)); gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, GetBattlerSpriteSubpriority(battler));
gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler;
gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy;
gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[0] = battler;

View File

@ -340,7 +340,7 @@ static void sub_8110A70(struct Sprite *sprite)
sprite->data[3] = 32; sprite->data[3] = 32;
sprite->data[4] = -24; sprite->data[4] = -24;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A6450; sprite->callback = sub_80A6450;
sprite->callback(sprite); sprite->callback(sprite);
} }
@ -367,8 +367,8 @@ void sub_8110AB4(struct Sprite *sprite)
sprite->data[3] = 0; sprite->data[3] = 0;
sprite->data[4] = 0; sprite->data[4] = 0;
sprite->callback = sub_80A656C; sprite->callback = TranslateAnimLinearSimple;
StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
} }
void sub_8110B38(struct Sprite *sprite) void sub_8110B38(struct Sprite *sprite)