diff --git a/asm/dark.s b/asm/dark.s index d3f44db0b4..bb46b0fa9a 100644 --- a/asm/dark.s +++ b/asm/dark.s @@ -25,7 +25,7 @@ sub_81136E8: @ 81136E8 movs r0, 0x52 bl SetGpuReg adds r0, r4, 0 - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -208,7 +208,7 @@ sub_8113888: @ 8113888 bl SetGpuReg ldr r0, =gBattleAnimAttacker ldrb r0, [r0] - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -643,7 +643,7 @@ _08113C1E: strh r0, [r5, 0x18] ldr r0, =gBattleAnimAttacker ldrb r0, [r0] - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0xE] @@ -962,7 +962,7 @@ _08113EBC: _08113EF8: ldr r0, =gBattleAnimTarget ldrb r0, [r0] - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0xE] @@ -1561,7 +1561,7 @@ sub_81143C0: @ 81143C0 mov r10, r0 ldr r6, =gBattleAnimAttacker ldrb r0, [r6] - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -1638,7 +1638,7 @@ sub_8114470: @ 8114470 lsrs r6, r0, 24 ldr r4, =gBattleAnimAttacker ldrb r0, [r4] - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 movs r1, 0x1 diff --git a/asm/flying.s b/asm/flying.s index dd6ca32ae7..c8010106ab 100644 --- a/asm/flying.s +++ b/asm/flying.s @@ -10,7 +10,7 @@ sub_810DE70: @ 810DE70 push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80A6980 + bl InitSpritePosToAnimTarget ldrh r0, [r4, 0x22] adds r0, 0x14 strh r0, [r4, 0x22] @@ -163,7 +163,7 @@ sub_810DFA8: @ 810DFA8 push {r4-r6,lr} adds r6, r0, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -216,7 +216,7 @@ _0810DFC8: sub_810E028: @ 810E028 push {r4,lr} adds r4, r0, 0 - bl TranslateAnimLinear + bl AnimTranslateLinear lsls r0, 24 cmp r0, 0 beq _0810E03C @@ -342,7 +342,7 @@ sub_810E13C: @ 810E13C push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] @@ -471,7 +471,7 @@ sub_810E24C: @ 810E24C movs r0, 0x1 strh r0, [r4, 0x2E] adds r0, r4, 0 - bl TranslateAnimLinear + bl AnimTranslateLinear ldrh r1, [r4, 0x34] lsrs r0, r1, 8 cmp r0, 0xC8 @@ -655,7 +655,7 @@ _0810E354: cmp r0, 0 bne _0810E3F0 adds r0, r6, 0 - bl sub_80A8328 + bl GetBattlerSpriteBGPriority lsls r0, 24 lsrs r0, 24 adds r0, 0x1 @@ -672,7 +672,7 @@ _0810E354: .pool _0810E3F0: adds r0, r6, 0 - bl sub_80A8328 + bl GetBattlerSpriteBGPriority movs r1, 0x3 ands r1, r0 lsls r1, 2 @@ -718,7 +718,7 @@ _0810E408: b _0810E4A2 _0810E44A: adds r0, r6, 0 - bl sub_80A8328 + bl GetBattlerSpriteBGPriority movs r1, 0x3 ands r1, r0 lsls r1, 2 @@ -1535,7 +1535,7 @@ sub_810EA4C: @ 810EA4C adds r4, r0, 0 ldr r0, =gBattleAnimTarget ldrb r0, [r0] - bl sub_80A8328 + bl GetBattlerSpriteBGPriority movs r1, 0x3 ands r1, r0 lsls r1, 2 @@ -1577,13 +1577,13 @@ sub_810EAA0: @ 810EAA0 bne _0810EABC adds r0, r5, 0 movs r1, 0 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker b _0810EAC4 .pool _0810EABC: adds r0, r5, 0 movs r1, 0 - bl sub_80A6980 + bl InitSpritePosToAnimTarget _0810EAC4: ldr r4, =gBattleAnimArgs movs r2, 0x4 @@ -1771,7 +1771,7 @@ sub_810EC34: @ 810EC34 _0810EC46: adds r0, r4, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker movs r0, 0 bl GetAnimBattlerSpriteId ldr r2, =gSprites @@ -1891,7 +1891,7 @@ sub_810ED28: @ 810ED28 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] diff --git a/asm/ice.s b/asm/ice.s index 3187d3110e..c882d22458 100644 --- a/asm/ice.s +++ b/asm/ice.s @@ -370,7 +370,7 @@ sub_810B8EC: @ 810B8EC push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker ldr r0, =gBattleAnimTarget ldrb r0, [r0] movs r1, 0x2 @@ -432,7 +432,7 @@ sub_810B974: @ 810B974 bne _0810B990 adds r0, r4, 0 movs r1, 0x1 - bl sub_80A6980 + bl InitSpritePosToAnimTarget b _0810B9C6 .pool _0810B990: @@ -513,7 +513,7 @@ sub_810BA24: @ 810BA24 sub sp, 0x10 adds r5, r0, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker ldr r6, =gBattleAnimArgs ldrh r0, [r6, 0x8] strh r0, [r5, 0x2E] @@ -586,7 +586,7 @@ _0810BAC0: cmp r4, 0 bge _0810BAC0 adds r0, r5, 0 - bl sub_80A7160 + bl InitAnimFastLinearTranslationWithSpeed ldrh r0, [r5, 0x30] movs r1, 0x1 eors r0, r1 @@ -598,7 +598,7 @@ _0810BAE2: movs r0, 0x1 strh r0, [r5, 0x2E] adds r0, r5, 0 - bl sub_80A70E8 + bl AnimFastTranslateLinear movs r0, 0x20 ldrsh r1, [r5, r0] movs r2, 0x24 @@ -775,7 +775,7 @@ sub_810BC4C: @ 810BC4C movs r0, 0x1 strh r0, [r4, 0x2E] adds r0, r4, 0 - bl sub_80A70E8 + bl AnimFastTranslateLinear movs r1, 0x20 ldrsh r0, [r4, r1] movs r2, 0x24 @@ -814,7 +814,7 @@ sub_810BC94: @ 810BC94 sub sp, 0x10 adds r5, r0, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x8] strh r0, [r5, 0x2E] @@ -877,7 +877,7 @@ _0810BD26: adds r0, r1 strh r0, [r5, 0x36] adds r0, r5, 0 - bl sub_80A7160 + bl InitAnimFastLinearTranslationWithSpeed adds r7, r5, 0 adds r7, 0x2E adds r2, r7, 0 @@ -902,7 +902,7 @@ _0810BD5A: movs r0, 0x1 strh r0, [r5, 0x2E] adds r0, r5, 0 - bl sub_80A70E8 + bl AnimFastTranslateLinear movs r2, 0x20 ldrsh r1, [r5, r2] movs r2, 0x24 @@ -965,7 +965,7 @@ _0810BDAE: sub_810BDD8: @ 810BDD8 push {r4,lr} adds r4, r0, 0 - bl sub_80A70E8 + bl AnimFastTranslateLinear movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0 @@ -1036,7 +1036,7 @@ sub_810BE48: @ 810BE48 bne _0810BE6C adds r0, r4, 0 movs r1, 0 - bl sub_80A6980 + bl InitSpritePosToAnimTarget b _0810BEA2 .pool _0810BE6C: @@ -1103,7 +1103,7 @@ sub_810BED0: @ 810BED0 bne _0810BEF4 adds r0, r5, 0 movs r1, 0 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker b _0810BF32 .pool _0810BEF4: @@ -1147,7 +1147,7 @@ _0810BF40: bne _0810BF52 adds r0, r5, 0 movs r1, 0 - bl sub_80A6980 + bl InitSpritePosToAnimTarget b _0810BF8E _0810BF52: ldr r4, =gBattleAnimTarget @@ -1240,7 +1240,7 @@ _0810BFCC: sub_810C008: @ 810C008 push {r4,lr} adds r4, r0, 0 - bl TranslateAnimLinear + bl AnimTranslateLinear lsls r0, 24 cmp r0, 0 bne _0810C092 @@ -1269,7 +1269,7 @@ sub_810C008: @ 810C008 ldrh r0, [r4, 0x3C] lsls r0, 24 lsrs r0, 24 - bl sub_80A8328 + bl GetBattlerSpriteBGPriority movs r1, 0x3 ands r1, r0 lsls r1, 2 @@ -1284,7 +1284,7 @@ _0810C064: ldrh r0, [r4, 0x3C] lsls r0, 24 lsrs r0, 24 - bl sub_80A8328 + bl GetBattlerSpriteBGPriority lsls r0, 24 lsrs r0, 24 adds r0, 0x1 @@ -1985,7 +1985,7 @@ _0810C684: adds r0, r6 strh r0, [r5, 0x36] ldrb r0, [r4] - bl sub_80A8328 + bl GetBattlerSpriteBGPriority lsls r0, 24 lsrs r0, 16 ldrh r1, [r5, 0x3C] @@ -2037,7 +2037,7 @@ _0810C6F4: b _0810C90C _0810C6F6: adds r0, r4, 0 - bl TranslateAnimLinear + bl AnimTranslateLinear ldr r1, =gSineTable movs r2, 0x38 ldrsh r0, [r4, r2] @@ -2131,7 +2131,7 @@ _0810C78E: .pool _0810C7BC: adds r0, r4, 0 - bl TranslateAnimLinear + bl AnimTranslateLinear ldr r1, =gSineTable movs r2, 0x38 ldrsh r0, [r4, r2] @@ -2267,7 +2267,7 @@ _0810C8B6: .pool _0810C8D0: adds r0, r4, 0 - bl TranslateAnimLinear + bl AnimTranslateLinear lsls r0, 24 cmp r0, 0 beq _0810C90C @@ -2762,7 +2762,7 @@ _0810CCA6: bl StartSpriteAffineAnim adds r0, r5, 0 movs r1, 0x1 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker ldr r6, =gBattleAnimArgs ldrh r0, [r6, 0x8] strh r0, [r5, 0x2E] @@ -2845,7 +2845,7 @@ sub_810CD4C: @ 810CD4C strh r0, [r4, 0x4] adds r0, r4, 0 movs r1, 0x1 - bl sub_80A6980 + bl InitSpritePosToAnimTarget bl Random2 movs r5, 0xFF ands r5, r0 diff --git a/asm/psychic.s b/asm/psychic.s index 0a39ea8568..a900d3fccc 100644 --- a/asm/psychic.s +++ b/asm/psychic.s @@ -46,7 +46,7 @@ _0810F22E: lsrs r4, r0, 24 adds r7, r4, 0 adds r0, r4, 0 - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -423,7 +423,7 @@ sub_810F524: @ 810F524 lsls r0, 24 lsrs r0, 24 adds r4, r0, 0 - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -514,13 +514,13 @@ _0810F5EE: bne _0810F608 adds r0, r4, 0 adds r1, r6, 0 - bl InitAnimSpritePos + bl InitSpritePosToAnimAttacker b _0810F610 .pool _0810F608: adds r0, r4, 0 adds r1, r6, 0 - bl sub_80A6980 + bl InitSpritePosToAnimTarget _0810F610: ldrh r0, [r4, 0x2E] adds r0, 0x1 @@ -1572,7 +1572,7 @@ _0810FE86: _0810FE92: ldr r0, =gBattleAnimTarget ldrb r0, [r0] - bl sub_80A8364 + bl GetBattlerSpriteBGPriorityRank lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 014aa20488..6552dd9dab 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -5443,54 +5443,54 @@ SolarBeamSetUp: blendoff goto SolarBeamEnd SolarBeamSetUp1: - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 40, 40, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 40, 40, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -40, -40, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -40, -40, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 0, 40, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 0, 40, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 0, -40, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 0, -40, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 40, -20, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 40, -20, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 40, 20, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 40, 20, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -40, -20, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -40, -20, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -40, 20, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -40, 20, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -20, 30, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -20, 30, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 20, -30, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 20, -30, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -20, -30, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -20, -30, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 20, 30, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 20, 30, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -40, 0, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -40, 0, 16 delay 2 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 40, 0, 16 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 40, 0, 16 delay 2 return SolarBeamUnleash: call SetSolarbeamBg panse_1B SE_W076, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 - createvisualtask sub_80FEA58, 5 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 0 + createvisualtask AnimTask_CreateSmallSolarbeamOrbs, 5 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 0 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 1 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 1 delay 4 createvisualtask sub_8116620, 10, 4, 1, 0, 10, RGB(25, 31, 0) - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 2 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 2 delay 4 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 65, 1 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 3 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 3 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 4 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 4 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 5 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 5 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 6 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 6 delay 4 call SolarBeamUnleash1 call SolarBeamUnleash1 @@ -5499,19 +5499,19 @@ SolarBeamUnleash: call UnsetSolarbeamBg goto SolarBeamEnd SolarBeamUnleash1: - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 0 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 0 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 1 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 1 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 2 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 2 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 3 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 3 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 4 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 4 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 5 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 5 delay 4 - createsprite gUnknown_085921F8, ANIM_TARGET, 3, 15, 0, 20, 6 + createsprite gSolarbeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 6 delay 4 return @@ -5717,28 +5717,28 @@ Move_ABSORB: AbsorbEffect: playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 delay 4 playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 delay 4 playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 delay 4 playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, -15, -16, 36 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, -15, -16, 36 delay 4 playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 delay 4 playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 delay 4 playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 20, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 20, 39 delay 4 playsewithpan SE_W152, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 5, -18, -20, 35 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 5, -18, -20, 35 delay 4 return @@ -5770,36 +5770,36 @@ Move_MEGA_DRAIN: MegaDrainEffect: playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 5, -18, -20, 35 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 5, -18, -20, 35 delay 4 playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 20, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 20, 39 delay 4 playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 delay 4 playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, -15, -16, 36 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, -15, -16, 36 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 delay 4 playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, -15, -16, 36 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, -15, -16, 36 delay 4 playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 delay 4 playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 20, 39 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 20, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 delay 4 playsewithpan SE_W145C, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 5, -18, -20, 35 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 5, -18, -20, 35 delay 4 return @@ -5831,44 +5831,44 @@ Move_GIGA_DRAIN: GigaDrainEffect: playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 5, -18, -40, 35 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 20, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 5, -18, -40, 35 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 20, 39 delay 4 playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 28, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 40, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 28, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 40, 39 delay 4 playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -32, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -32, 26 delay 4 playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, -15, -16, 36 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, -15, -16, 36 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 delay 4 playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, -15, -16, 36 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, -15, -16, 36 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 delay 4 playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -40, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -40, 26 delay 4 playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 36, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 20, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 36, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 20, 39 delay 4 playsewithpan SE_W202, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 5, -18, -20, 35 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 5, -18, -20, 35 delay 4 return @@ -6749,11 +6749,11 @@ Move_COTTON_SPORE: end CottonSpore1: - createsprite gUnknown_085922EC, ANIM_ATTACKER, 2, 0, -20, 85, 80, 0 + createsprite gSporeParticleSpriteTemplate, ANIM_ATTACKER, 2, 0, -20, 85, 80, 0 delay 12 - createsprite gUnknown_085922EC, ANIM_ATTACKER, 2, 0, -10, 170, 80, 0 + createsprite gSporeParticleSpriteTemplate, ANIM_ATTACKER, 2, 0, -10, 170, 80, 0 delay 12 - createsprite gUnknown_085922EC, ANIM_ATTACKER, 2, 0, -15, 0, 80, 0 + createsprite gSporeParticleSpriteTemplate, ANIM_ATTACKER, 2, 0, -15, 0, 80, 0 delay 12 return @@ -6761,7 +6761,7 @@ Move_SPORE: loadspritegfx ANIM_TAG_SPORE monbg ANIM_DEF_PARTNER setalpha 12, 8 - createvisualtask sub_80FEE1C, 2 + createvisualtask AnimTask_SporeDoubleBattle, 2 loopsewithpan SE_W077, SOUND_PAN_TARGET, 16, 11 call Spore1 call Spore1 @@ -6773,11 +6773,11 @@ Move_SPORE: end Spore1: - createsprite gUnknown_085922EC, ANIM_TARGET, 2, 0, -20, 85, 80, 1 + createsprite gSporeParticleSpriteTemplate, ANIM_TARGET, 2, 0, -20, 85, 80, 1 delay 12 - createsprite gUnknown_085922EC, ANIM_TARGET, 2, 0, -10, 170, 80, 1 + createsprite gSporeParticleSpriteTemplate, ANIM_TARGET, 2, 0, -10, 170, 80, 1 delay 12 - createsprite gUnknown_085922EC, ANIM_TARGET, 2, 0, -15, 0, 80, 1 + createsprite gSporeParticleSpriteTemplate, ANIM_TARGET, 2, 0, -15, 0, 80, 1 delay 12 return @@ -6788,23 +6788,23 @@ Move_PETAL_DANCE: setalpha 12, 8 playsewithpan SE_W080, SOUND_PAN_ATTACKER createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 6, 6, 3 - createsprite gUnknown_0859231C, ANIM_ATTACKER, 2, 0, -24, 8, 140 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, 16, -24, 8, 100 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, -16, -24, 8, 100 + createsprite gPetalDanceBigFlowerSpriteTemplate, ANIM_ATTACKER, 2, 0, -24, 8, 140 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, 16, -24, 8, 100 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, -16, -24, 8, 100 delay 15 - createsprite gUnknown_0859231C, ANIM_ATTACKER, 2, 0, -24, 8, 140 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, 32, -24, 8, 100 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, -32, -24, 8, 100 + createsprite gPetalDanceBigFlowerSpriteTemplate, ANIM_ATTACKER, 2, 0, -24, 8, 140 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, 32, -24, 8, 100 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, -32, -24, 8, 100 delay 15 - createsprite gUnknown_0859231C, ANIM_ATTACKER, 2, 0, -24, 8, 140 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, 24, -24, 8, 100 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, -24, -24, 8, 100 + createsprite gPetalDanceBigFlowerSpriteTemplate, ANIM_ATTACKER, 2, 0, -24, 8, 140 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, 24, -24, 8, 100 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, -24, -24, 8, 100 delay 30 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, 16, -24, 0, 100 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, -16, -24, 0, 100 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, 16, -24, 0, 100 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, -16, -24, 0, 100 delay 30 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, 20, -16, 14, 80 - createsprite gUnknown_08592334, ANIM_ATTACKER, 2, -20, -14, 16, 80 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, 20, -16, 14, 80 + createsprite gPetalDanceSmallFlowerSpriteTemplate, ANIM_ATTACKER, 2, -20, -14, 16, 80 waitforvisualfinish createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 24, 0, 0, 5 delay 3 @@ -6827,29 +6827,29 @@ Move_RAZOR_LEAF: setalpha 12, 8 delay 1 loopsewithpan SE_W077, SOUND_PAN_ATTACKER, 10, 5 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -3, -2, 10 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -2, 10 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -1, -1, 15 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -1, -1, 15 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -4, -4, 7 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -4, -4, 7 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 3, -3, 11 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 3, -3, 11 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -1, -6, 8 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -1, -6, 8 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 2, -1, 12 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 2, -1, 12 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -3, -4, 13 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -4, 13 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 4, -5, 7 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 4, -5, 7 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 2, -6, 11 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 2, -6, 11 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -3, -5, 8 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -5, 8 delay 60 playsewithpan SE_W013B, SOUND_PAN_ATTACKER - createsprite gUnknown_085923D8, ANIM_TARGET, 3, 20, -10, 20, 0, 22, 20, 1 - createsprite gUnknown_085923D8, ANIM_TARGET, 3, 20, -10, 20, 0, 22, -20, 1 + createsprite gRazorLeafCutterSpriteTemplate, ANIM_TARGET, 3, 20, -10, 20, 0, 22, 20, 1 + createsprite gRazorLeafCutterSpriteTemplate, ANIM_TARGET, 3, 20, -10, 20, 0, 22, -20, 1 delay 20 playsewithpan SE_W013, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1 @@ -7025,44 +7025,44 @@ Move_DREAM_EATER: end DreamEaterEffect: playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 5, -18, -40, 35 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 20, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 5, -18, -40, 35 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 20, 39 delay 4 playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 28, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 40, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 28, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 40, 39 delay 4 playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -32, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -32, 26 delay 4 playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, -15, -16, 36 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, -15, -16, 36 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 delay 4 playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, -15, -16, 36 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, -15, -16, 36 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 delay 4 playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 16, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -40, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 16, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -40, 26 delay 4 playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -5, 15, 36, 33 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 10, -5, -8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, -10, 20, 20, 39 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -5, 15, 36, 33 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 10, -5, -8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, -10, 20, 20, 39 delay 4 playsewithpan SE_W207, SOUND_PAN_TARGET - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 0, 5, 8, 26 - createsprite gUnknown_08592270, ANIM_ATTACKER, 3, 5, -18, -20, 35 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 0, 5, 8, 26 + createsprite gAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 3, 5, -18, -20, 35 delay 4 return @@ -7573,19 +7573,19 @@ Move_RECOVER: end Recover1: - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 40, -10, 13 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 40, -10, 13 delay 3 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -35, -10, 13 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -35, -10, 13 delay 3 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 15, -40, 13 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 15, -40, 13 delay 3 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -10, -32, 13 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -10, -32, 13 delay 3 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 25, -20, 13 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 25, -20, 13 delay 3 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, -40, -20, 13 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -40, -20, 13 delay 3 - createsprite gUnknown_085921E0, ANIM_ATTACKER, 2, 5, -40, 13 + createsprite gPowerAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 5, -40, 13 delay 3 return @@ -7597,7 +7597,7 @@ Move_MIMIC: panse_1B SE_W107, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0 createvisualtask sub_80FF458, 5, 128, 24 delay 15 - createsprite gUnknown_085924DC, ANIM_TARGET, 2, -12, 24 + createsprite gMimicOrbSpriteTemplate, ANIM_TARGET, 2, -12, 24 delay 10 setarg 7, -1 waitforvisualfinish @@ -7611,12 +7611,12 @@ Move_MIMIC: Move_CONSTRICT: loadspritegfx ANIM_TAG_TENDRILS loopsewithpan SE_W010, SOUND_PAN_TARGET, 6, 4 - createsprite gUnknown_08592494, ANIM_TARGET, 4, 0, 16, 0, 2 + createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 4, 0, 16, 0, 2 delay 7 - createsprite gUnknown_08592494, ANIM_TARGET, 3, 0, 0, 0, 2 - createsprite gUnknown_08592494, ANIM_TARGET, 2, 0, 8, 1, 2 + createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 3, 0, 0, 0, 2 + createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 2, 0, 8, 1, 2 delay 7 - createsprite gUnknown_08592494, ANIM_TARGET, 3, 0, -8, 1, 2 + createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 3, 0, -8, 1, 2 delay 8 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 6, 1 delay 20 @@ -7824,28 +7824,28 @@ Move_FURY_SWIPES: Move_INGRAIN: loadspritegfx ANIM_TAG_ROOTS loadspritegfx ANIM_TAG_ORBS - createsprite gUnknown_0859254C, ANIM_ATTACKER, 2, 16, 26, -1, 2, 150 + createsprite gIngrainRootSpriteTemplate, ANIM_ATTACKER, 2, 16, 26, -1, 2, 150 playsewithpan SE_W010, SOUND_PAN_ATTACKER delay 10 - createsprite gUnknown_0859254C, ANIM_ATTACKER, 2, -32, 20, 1, 1, 140 + createsprite gIngrainRootSpriteTemplate, ANIM_ATTACKER, 2, -32, 20, 1, 1, 140 playsewithpan SE_W010, SOUND_PAN_ATTACKER delay 10 - createsprite gUnknown_0859254C, ANIM_ATTACKER, 2, 32, 22, 1, 0, 130 + createsprite gIngrainRootSpriteTemplate, ANIM_ATTACKER, 2, 32, 22, 1, 0, 130 playsewithpan SE_W010, SOUND_PAN_ATTACKER delay 10 - createsprite gUnknown_0859254C, ANIM_ATTACKER, 2, -16, 25, -1, 3, 120 + createsprite gIngrainRootSpriteTemplate, ANIM_ATTACKER, 2, -16, 25, -1, 3, 120 playsewithpan SE_W010, SOUND_PAN_ATTACKER delay 40 - createsprite gUnknown_0859258C, ANIM_ATTACKER, 3, 32, 26, -1, 3, 30 + createsprite gIngrainOrbSpriteTemplate, ANIM_ATTACKER, 3, 32, 26, -1, 3, 30 delay 5 playsewithpan SE_W145C, SOUND_PAN_ATTACKER delay 5 - createsprite gUnknown_0859258C, ANIM_ATTACKER, 3, -48, 20, 1, 2, 30 + createsprite gIngrainOrbSpriteTemplate, ANIM_ATTACKER, 3, -48, 20, 1, 2, 30 playsewithpan SE_W145C, SOUND_PAN_ATTACKER delay 5 playsewithpan SE_W145C, SOUND_PAN_ATTACKER delay 5 - createsprite gUnknown_0859258C, ANIM_ATTACKER, 3, 48, 26, -2, 3, 18 + createsprite gIngrainOrbSpriteTemplate, ANIM_ATTACKER, 3, 48, 26, -2, 3, 18 playsewithpan SE_W145C, SOUND_PAN_ATTACKER delay 10 waitforvisualfinish @@ -7854,7 +7854,7 @@ Move_INGRAIN: Move_PRESENT: loadspritegfx ANIM_TAG_ITEM_BAG createvisualtask AnimTask_IsHealingMove, 2 - createsprite gUnknown_08592610, ANIM_TARGET, 2, 0, -5, 10, 2, -1 + createsprite gPresentSpriteTemplate, ANIM_TARGET, 2, 0, -5, 10, 2, -1 playsewithpan SE_W039, SOUND_PAN_ATTACKER delay 14 playsewithpan SE_W145B, SOUND_PAN_ATTACKER @@ -7889,23 +7889,23 @@ PresentHeal: loadspritegfx ANIM_TAG_GREEN_SPARKLE loadspritegfx ANIM_TAG_BLUE_STAR playsewithpan SE_W234, SOUND_PAN_TARGET - createsprite gUnknown_08592658, ANIM_TARGET, 4, -16, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, -16, 32, -3, 1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, 16, 32, -3, -1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, 16, 32, -3, -1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, 32, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, 32, 32, -3, 1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, -32, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, -32, 32, -3, 1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, 0, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, 0, 32, -3, 1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, -8, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, -8, 32, -3, 1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, -8, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, -8, 32, -3, 1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, 24, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, 24, 32, -3, 1 delay 3 - createsprite gUnknown_08592658, ANIM_TARGET, 4, -24, 32, -3, 1 + createsprite gPresentHealParticleSpriteTemplate, ANIM_TARGET, 4, -24, 32, -3, 1 waitforvisualfinish waitsound call HealingEffect2 @@ -8115,8 +8115,8 @@ Move_ENCORE: Move_TRICK: loadspritegfx ANIM_TAG_ITEM_BAG loadspritegfx ANIM_TAG_SPEED_DUST - createsprite gUnknown_085926E8, ANIM_ATTACKER, 2, -40, 80 - createsprite gUnknown_085926E8, ANIM_ATTACKER, 2, -40, 208 + createsprite gTrickBagSpriteTemplate, ANIM_ATTACKER, 2, -40, 80 + createsprite gTrickBagSpriteTemplate, ANIM_ATTACKER, 2, -40, 208 delay 16 playsewithpan SE_W166, 0 createvisualtask sub_8106020, 3 @@ -8167,21 +8167,21 @@ Move_STOCKPILE: createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 12, 0, RGB_WHITE end Stockpile1: - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, 55, 55, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 55, 55, 13 delay 1 - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, -55, -55, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -55, -55, 13 delay 1 - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, 0, 55, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 0, 55, 13 delay 1 - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, 0, -55, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 0, -55, 13 delay 1 - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, 55, -34, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 55, -34, 13 delay 1 - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, 55, 34, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 55, 34, 13 delay 1 - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, -55, -34, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -55, -34, 13 delay 1 - createsprite gUnknown_08592244, ANIM_ATTACKER, 2, -55, 34, 13 + createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, -55, 34, 13 delay 1 return @@ -8392,8 +8392,8 @@ Move_HYPER_BEAM: createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 16, 0, RGB_BLACK end HyperBeam1: - createsprite gUnknown_08592288, ANIM_TARGET, 2 - createsprite gUnknown_08592288, ANIM_TARGET, 2 + createsprite gHyperBeamOrbSpriteTemplate, ANIM_TARGET, 2 + createsprite gHyperBeamOrbSpriteTemplate, ANIM_TARGET, 2 delay 1 return @@ -8790,31 +8790,31 @@ Move_FRENZY_PLANT: setalpha 12, 8 createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 2, 0, 5, RGB_BLACK waitforvisualfinish - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 10, 8, 2, 0, 0, 100 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 10, 8, 2, 0, 0, 100 playsewithpan SE_W010, SOUND_PAN_ATTACKER delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 20, -8, -2, 0, 1, 95 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 20, -8, -2, 0, 1, 95 playsewithpan SE_W010, -43 delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 30, 8, -4, 0, 0, 90 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 30, 8, -4, 0, 0, 90 playsewithpan SE_W010, -22 delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 40, -8, 4, 0, 1, 85 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 40, -8, 4, 0, 1, 85 playsewithpan SE_W010, 0 delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 50, 8, 0, 0, 0, 85 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 50, 8, 0, 0, 0, 85 playsewithpan SE_W010, +21 delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 60, -8, -2, 0, 1, 85 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 60, -8, -2, 0, 1, 85 playsewithpan SE_W010, +42 delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 75, 8, 0, 0, 0, 85 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 75, 8, 0, 0, 0, 85 playsewithpan SE_W010, SOUND_PAN_TARGET delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 85, 16, 6, 0, 3, 80 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 85, 16, 6, 0, 3, 80 playsewithpan SE_W010, SOUND_PAN_TARGET delay 5 - createsprite gUnknown_08592564, ANIM_ATTACKER, 2, 85, -16, -6, 0, 2, 75 + createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 85, -16, -6, 0, 2, 75 playsewithpan SE_W010, SOUND_PAN_TARGET delay 5 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, -10, -10, 1, 3 @@ -9649,26 +9649,26 @@ Move_TWISTER: monbg ANIM_DEF_PARTNER monbgprio_28 ANIM_TARGET playsewithpan SE_W239, SOUND_PAN_TARGET - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 120, 70, 5, 70, 30 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 120, 70, 5, 70, 30 delay 1 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 115, 55, 6, 60, 25 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 115, 55, 6, 60, 25 delay 1 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 115, 60, 7, 60, 30 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 115, 55, 10, 60, 30 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 115, 60, 7, 60, 30 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 115, 55, 10, 60, 30 delay 3 createsprite gUnknown_08596CC8, ANIM_TARGET, 2, 100, 50, 4, 50, 26 delay 1 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 105, 25, 8, 60, 20 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 105, 25, 8, 60, 20 delay 1 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 115, 40, 10, 48, 30 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 115, 40, 10, 48, 30 delay 3 createsprite gUnknown_08596CC8, ANIM_TARGET, 2, 120, 30, 6, 45, 25 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 115, 35, 10, 60, 30 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 115, 35, 10, 60, 30 delay 3 createsprite gUnknown_08596CC8, ANIM_TARGET, 2, 105, 20, 8, 40, 0 delay 3 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 20, 255, 15, 32, 0 - createsprite gUnknown_085923A8, ANIM_TARGET, 2, 110, 10, 8, 32, 20 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 20, 255, 15, 32, 0 + createsprite gTwisterLeafParticleSpriteTemplate, ANIM_TARGET, 2, 110, 10, 8, 32, 20 waitforvisualfinish createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, -32, -16, 1, 3 playsewithpan SE_W004, SOUND_PAN_TARGET @@ -9697,29 +9697,29 @@ Move_MAGICAL_LEAF: delay 1 loopsewithpan SE_W077, SOUND_PAN_ATTACKER, 10, 5 createvisualtask sub_81007C4, 5 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -3, -2, 10 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -2, 10 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -1, -1, 15 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -1, -1, 15 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -4, -4, 7 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -4, -4, 7 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 3, -3, 11 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 3, -3, 11 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -1, -6, 8 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -1, -6, 8 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 2, -1, 12 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 2, -1, 12 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -3, -4, 13 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -4, 13 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 4, -5, 7 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 4, -5, 7 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, 2, -6, 11 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, 2, -6, 11 delay 2 - createsprite gUnknown_08592390, ANIM_ATTACKER, 2, -3, -5, 8 + createsprite gRazorLeafParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -5, 8 delay 60 playsewithpan SE_W013B, SOUND_PAN_ATTACKER - createsprite gUnknown_085923D8, ANIM_TARGET, 3, 20, -10, 20, 0, 32, 20, 0 - createsprite gUnknown_085923D8, ANIM_TARGET, 3, 20, -10, 20, 0, 32, -20, 0 + createsprite gRazorLeafCutterSpriteTemplate, ANIM_TARGET, 3, 20, -10, 20, 0, 32, 20, 0 + createsprite gRazorLeafCutterSpriteTemplate, ANIM_TARGET, 3, 20, -10, 20, 0, 32, -20, 0 delay 30 playsewithpan SE_W013, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, -10, -4, 1, 2 @@ -10344,7 +10344,7 @@ General_PokeblockThrow: General_ItemKnockoff: loadspritegfx ANIM_TAG_ITEM_BAG - createsprite gBattleAnimSpriteTemplate_8592628, ANIM_TARGET, 2 + createsprite gKnockOffItemSpriteTemplate, ANIM_TARGET, 2 end General_TurnTrap: @@ -10357,9 +10357,9 @@ General_TurnTrap: Status_BindWrap: loadspritegfx ANIM_TAG_TENDRILS loopsewithpan SE_W010, SOUND_PAN_TARGET, 6, 2 - createsprite gUnknown_08592494, ANIM_TARGET, 4, 0, 16, 0, 1 + createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 4, 0, 16, 0, 1 delay 7 - createsprite gUnknown_08592494, ANIM_TARGET, 2, 0, 8, 1, 1 + createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 2, 0, 8, 1, 1 delay 3 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1 delay 20 @@ -10537,7 +10537,7 @@ General_ItemSteal: createvisualtask sub_8117F30, 2 createvisualtask sub_8172ED0, 2 delay 1 - createsprite gUnknown_08592670, ANIM_ATTACKER, 2, 0, -5, 10, 2, -1 + createsprite gItemStealSpriteTemplate, ANIM_ATTACKER, 2, 0, -5, 10, 2, -1 end General_SnatchMove: diff --git a/include/battle_anim.h b/include/battle_anim.h index 5b62e594b1..1c2093da95 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -75,14 +75,14 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_80A5C6C.s void sub_80A6450(struct Sprite *sprite); -void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y); +void SetAverageBattlerPositions(u8 battlerId, bool8 respectMonPicOffsets, s16 *x, s16 *y); void DestroySpriteAndMatrix(struct Sprite *sprite); -void TranslateAnimLinearSimple(struct Sprite *sprite); -void InitAnimSpritePos(struct Sprite *sprite, u8 a2); -void sub_80A6980(struct Sprite *sprite, bool8 a2); +void AnimTranslateLinearSimple(struct Sprite *sprite); +void InitSpritePosToAnimAttacker(struct Sprite *sprite, u8 a2); +void InitSpritePosToAnimTarget(struct Sprite *sprite, bool8 a2); void StartAnimLinearTranslation(struct Sprite *sprite); void InitAnimArcTranslation(struct Sprite *sprite); -bool8 TranslateAnimLinear(struct Sprite *sprite); +bool8 AnimTranslateLinear(struct Sprite *sprite); void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite); void sub_80A8EE4(struct Sprite *sprite); u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); @@ -93,14 +93,14 @@ void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite); void sub_80A66DC(struct Sprite *sprite); void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite); void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite); -void sub_80A6864(struct Sprite *sprite, s16 a2); +void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 a2); s16 sub_80A861C(u8 battlerId, u8 a2); u8 GetBattlerYCoordWithElevation(u8 battlerId); void WaitAnimForDuration(struct Sprite *sprite); void sub_80A7938(struct Sprite *sprite); void InitAnimLinearTranslation(struct Sprite *sprite); void sub_80A6F98(struct Sprite *sprite); -u8 sub_80A8328(u8 battlerId); +u8 GetBattlerSpriteBGPriority(u8 battlerId); void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void sub_80A8278(void); @@ -132,9 +132,9 @@ u8 sub_80A80C8(struct Task *task); void sub_80A8EE4(struct Sprite *); void sub_80A67F4(struct Sprite *); void sub_80A6D48(u32 bgId, const void *src); -void sub_80A7160(struct Sprite *sprite); -bool8 sub_80A70E8(struct Sprite *sprite); -void sub_80A70C0(struct Sprite *sprite); +void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite); +bool8 AnimFastTranslateLinear(struct Sprite *sprite); +void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite); void TranslateMonBGUntil(struct Sprite *sprite); void TranslateSpriteOverDuration(struct Sprite *sprite); void sub_80A77C8(struct Sprite *sprite); @@ -166,7 +166,7 @@ void sub_80A6C68(u32 arg0); u8 GetAnimBattlerSpriteId(u8 wantedBattler); bool8 IsDoubleBattle(void); u8 sub_80A6D94(void); -u8 sub_80A8364(u8 battlerId); +u8 GetBattlerSpriteBGPriorityRank(u8 battlerId); void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*)); void oamt_add_pos2_onto_pos1(struct Sprite *sprite); u8 GetBattlerSpriteDefault_Y(u8 battlerId); diff --git a/src/battle_anim.c b/src/battle_anim.c index 88c5482086..1e1219800b 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1671,7 +1671,11 @@ static void ScriptCmd_createsprite(void) if (subpriority < 3) subpriority = 3; - CreateSpriteAndAnimate(template, GetBattlerSpriteCoord(gBattleAnimTarget, 2), GetBattlerSpriteCoord(gBattleAnimTarget, 3), subpriority); + CreateSpriteAndAnimate( + template, + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2), + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET), + subpriority); gAnimVisualTaskCount++; } @@ -3029,12 +3033,12 @@ static void ScriptCmd_doublebattle_2D(void) { if (wantedBattler == ANIM_ATTACKER) { - r4 = sub_80A8364(gBattleAnimAttacker); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); } else { - r4 = sub_80A8364(gBattleAnimTarget); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); } if (spriteId != 0xFF) @@ -3064,12 +3068,12 @@ static void ScriptCmd_doublebattle_2E(void) { if (wantedBattler == ANIM_ATTACKER) { - r4 = sub_80A8364(gBattleAnimAttacker); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); } else { - r4 = sub_80A8364(gBattleAnimTarget); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); } diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index 15a4d2b632..e17dde0789 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -568,7 +568,7 @@ void TranslateSpriteOverDuration(struct Sprite *sprite) } } -void TranslateAnimLinearSimple(struct Sprite *sprite) +void AnimTranslateLinearSimple(struct Sprite *sprite) { if (sprite->data[0] > 0) { @@ -716,7 +716,9 @@ void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite) sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } -void sub_80A6864(struct Sprite *sprite, s16 xOffset) +// Sets the initial x offset of the anim sprite depending on the horizontal orientation +// of the two involved mons. +void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 xOffset) { u16 attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); u16 targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); @@ -749,7 +751,7 @@ void InitAnimArcTranslation(struct Sprite *sprite) bool8 TranslateAnimArc(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) return TRUE; sprite->data[7] += sprite->data[6]; sprite->pos2.y += Sin((u8)(sprite->data[7] >> 8), sprite->data[5]); @@ -758,7 +760,7 @@ bool8 TranslateAnimArc(struct Sprite *sprite) bool8 sub_80A6934(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) return TRUE; sprite->data[7] += sprite->data[6]; sprite->pos2.x += Sin((u8)(sprite->data[7] >> 8), sprite->data[5]); @@ -773,18 +775,20 @@ void oamt_add_pos2_onto_pos1(struct Sprite *sprite) sprite->pos2.y = 0; } -void sub_80A6980(struct Sprite *sprite, bool8 a2) +void InitSpritePosToAnimTarget(struct Sprite *sprite, bool8 respectMonPicOffsets) { - if (!a2) + // Battle anim sprites are automatically created at the anim target's center, which + // is why there is no else clause for the "respectMonPicOffsets" check. + if (!respectMonPicOffsets) { sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_X); sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_Y); } - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } -void InitAnimSpritePos(struct Sprite *sprite, u8 respectMonPicOffsets) +void InitSpritePosToAnimAttacker(struct Sprite *sprite, u8 respectMonPicOffsets) { if (!respectMonPicOffsets) { @@ -796,7 +800,7 @@ void InitAnimSpritePos(struct Sprite *sprite, u8 respectMonPicOffsets) sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } @@ -917,7 +921,7 @@ void sub_80A6BFC(struct UnknownAnimStruct2 *unk, u8 unused) unk->tilesOffset = 0; unk->unkC = 0; } - else if (sub_80A8364(gBattleAnimAttacker) == 1) + else if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) { unk->unk8 = 8; unk->bgId = 1; @@ -1058,7 +1062,7 @@ void sub_80A6F14(struct Sprite *sprite) sprite->callback(sprite); } -bool8 TranslateAnimLinear(struct Sprite *sprite) +bool8 AnimTranslateLinear(struct Sprite *sprite) { u16 v1, v2, x, y; @@ -1090,14 +1094,14 @@ bool8 TranslateAnimLinear(struct Sprite *sprite) void sub_80A6F98(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); } void sub_80A6FB4(struct Sprite *sprite) { sub_8039E9C(sprite); - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); } @@ -1117,14 +1121,14 @@ void sub_80A7000(struct Sprite *sprite) sprite->callback(sprite); } -void sub_80A7028(struct Sprite *sprite) +static void InitAnimFastLinearTranslation(struct Sprite *sprite) { - int x = sprite->data[2] - sprite->data[1]; - int y = sprite->data[4] - sprite->data[3]; - bool8 x_sign = x < 0; - bool8 y_sign = y < 0; - u16 x2 = abs(x) << 4; - u16 y2 = abs(y) << 4; + int xDiff = sprite->data[2] - sprite->data[1]; + int yDiff = sprite->data[4] - sprite->data[3]; + bool8 x_sign = xDiff < 0; + bool8 y_sign = yDiff < 0; + u16 x2 = abs(xDiff) << 4; + u16 y2 = abs(yDiff) << 4; x2 /= sprite->data[0]; y2 /= sprite->data[0]; @@ -1145,16 +1149,16 @@ void sub_80A7028(struct Sprite *sprite) sprite->data[3] = 0; } -void sub_80A70C0(struct Sprite *sprite) +void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sub_80A7028(sprite); + InitAnimFastLinearTranslation(sprite); sprite->callback = sub_80A7144; sprite->callback(sprite); } -bool8 sub_80A70E8(struct Sprite *sprite) +bool8 AnimFastTranslateLinear(struct Sprite *sprite) { u16 v1, v2, x, y; @@ -1186,22 +1190,22 @@ bool8 sub_80A70E8(struct Sprite *sprite) void sub_80A7144(struct Sprite *sprite) { - if (sub_80A70E8(sprite)) + if (AnimFastTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); } -void sub_80A7160(struct Sprite *sprite) +void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite) { - int v1 = abs(sprite->data[2] - sprite->data[1]) << 4; - sprite->data[0] = v1 / sprite->data[0]; - sub_80A7028(sprite); + int xDiff = abs(sprite->data[2] - sprite->data[1]) << 4; + sprite->data[0] = xDiff / sprite->data[0]; + InitAnimFastLinearTranslation(sprite); } void sub_80A718C(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sub_80A7160(sprite); + InitAnimFastLinearTranslationWithSpeed(sprite); sprite->callback = sub_80A7144; sprite->callback(sprite); } @@ -1471,9 +1475,9 @@ void sub_80A77C8(struct Sprite *sprite) else var = FALSE; if (!gBattleAnimArgs[2]) - InitAnimSpritePos(sprite, var); + InitSpritePosToAnimAttacker(sprite, var); else - sub_80A6980(sprite, var); + InitSpritePosToAnimTarget(sprite, var); sprite->data[0]++; } @@ -1506,7 +1510,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) else coordType = BATTLER_COORD_Y; - InitAnimSpritePos(sprite, v1); + InitSpritePosToAnimAttacker(sprite, v1); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -1519,7 +1523,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) void sub_80A78AC(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); if (GetBattlerSide(gBattleAnimAttacker)) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; @@ -1553,17 +1557,17 @@ void sub_80A7938(struct Sprite *sprite) } if (!gBattleAnimArgs[5]) { - InitAnimSpritePos(sprite, r4); + InitSpritePosToAnimAttacker(sprite, r4); battlerId = gBattleAnimAttacker; } else { - sub_80A6980(sprite, r4); + InitSpritePosToAnimTarget(sprite, r4); battlerId = gBattleAnimTarget; } if (GetBattlerSide(gBattleAnimAttacker)) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; - sub_80A6980(sprite, r4); + InitSpritePosToAnimTarget(sprite, r4); sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = GetBattlerSpriteCoord(battlerId, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(battlerId, attributeId) + gBattleAnimArgs[3]; @@ -2006,7 +2010,7 @@ u8 GetBattlerSpriteSubpriority(u8 battlerId) return subpriority; } -u8 sub_80A8328(u8 battlerId) +u8 GetBattlerSpriteBGPriority(u8 battlerId) { u8 position = GetBattlerPosition(battlerId); @@ -2018,7 +2022,7 @@ u8 sub_80A8328(u8 battlerId) return GetAnimBgAttribute(1, BG_ANIM_PRIORITY); } -u8 sub_80A8364(u8 battlerId) +u8 GetBattlerSpriteBGPriorityRank(u8 battlerId) { if (!IsContest()) { @@ -2229,36 +2233,38 @@ s16 sub_80A861C(u8 battlerId, u8 a2) } } -void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y) +void SetAverageBattlerPositions(u8 battlerId, bool8 respectMonPicOffsets, s16 *x, s16 *y) { - u8 v1, v2; - s16 v3, v4; - s16 v5, v6; + u8 xCoordType, yCoordType; + s16 battlerX, battlerY; + s16 partnerX, partnerY; - if (!a2) + if (!respectMonPicOffsets) { - v1 = 0; - v2 = 1; + xCoordType = BATTLER_COORD_X; + yCoordType = BATTLER_COORD_Y; } else { - v1 = 2; - v2 = 3; + xCoordType = BATTLER_COORD_X_2; + yCoordType = BATTLER_COORD_Y_PIC_OFFSET; } - v3 = GetBattlerSpriteCoord(battlerId, v1); - v4 = GetBattlerSpriteCoord(battlerId, v2); + + battlerX = GetBattlerSpriteCoord(battlerId, xCoordType); + battlerY = GetBattlerSpriteCoord(battlerId, yCoordType); if (IsDoubleBattle() && !IsContest()) { - v5 = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), v1); - v6 = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), v2); + partnerX = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), xCoordType); + partnerY = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), yCoordType); } else { - v5 = v3; - v6 = v4; + partnerX = battlerX; + partnerY = battlerY; } - *x = (v3 + v5) / 2; - *y = (v4 + v6) / 2; + + *x = (battlerX + partnerX) / 2; + *y = (battlerY + partnerY) / 2; } u8 sub_80A89C8(int battlerId, u8 spriteId, int species) diff --git a/src/battle_anim_8170478.c b/src/battle_anim_8170478.c index 34898899c1..32214b58d8 100755 --- a/src/battle_anim_8170478.c +++ b/src/battle_anim_8170478.c @@ -1971,7 +1971,7 @@ void sub_8172D98(u8 taskId) switch (gTasks[taskId].data[15]) { case 0: - if (sub_80A8364(gBattleAnimAttacker) == B_POSITION_OPPONENT_LEFT) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == B_POSITION_OPPONENT_LEFT) SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); else SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); @@ -2188,7 +2188,7 @@ void sub_81732E4(u8 taskId) static void sub_817330C(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); sprite->data[0] = 30; sprite->data[2] = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), 0) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), 1) + gBattleAnimArgs[3]; diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 3b1b49e349..e37d2b5b83 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -19,28 +19,28 @@ EWRAM_DATA s16 gUnknown_0203A0F8[4] = {0}; void AnimMovePowderParticle(struct Sprite *); -void sub_80FE8E0(struct Sprite *); -void sub_80FE930(struct Sprite *); -void sub_80FE988(struct Sprite *); -void sub_80FEAD8(struct Sprite *); -void sub_80FEB44(struct Sprite *); -void sub_80FED28(struct Sprite *); -void sub_80FEE78(struct Sprite *); -void sub_80FEF44(struct Sprite *); -void sub_80FEFFC(struct Sprite *); +void AnimPowerAbsorptionOrb(struct Sprite *); +void AnimSolarbeamBigOrb(struct Sprite *); +void AnimSolarbeamSmallOrb(struct Sprite *); +void AnimAbsorptionOrb(struct Sprite *); +void AnimHyperBeamOrb(struct Sprite *); +void AnimSporeParticle(struct Sprite *); +void AnimPetalDanceBigFlower(struct Sprite *); +void AnimPetalDanceSmallFlower(struct Sprite *); +void AnimRazorLeafParticle(struct Sprite *); void AnimLeechSeed(struct Sprite *); void AnimTranslateLinearSingleSineWave(struct Sprite *); void AnimMoveTwisterParticle(struct Sprite *); -void sub_80FF374(struct Sprite *); -void sub_80FF698(struct Sprite *); -void sub_80FF768(struct Sprite *); -void sub_80FF7EC(struct Sprite *); -void sub_80FF934(struct Sprite *); -void sub_80FFB18(struct Sprite *); -void sub_80FFBF4(struct Sprite *); -void sub_80FFC70(struct Sprite *); -void sub_80FFCB4(struct Sprite *); -void sub_80FFDBC(struct Sprite *); +void AnimConstrictBinding(struct Sprite *); +void AnimMimicOrb(struct Sprite *); +void AnimIngrainRoot(struct Sprite *); +void AnimFrenzyPlantRoot(struct Sprite *); +void AnimIngrainOrb(struct Sprite *); +void AnimPresent(struct Sprite *); +void AnimKnockOffItem(struct Sprite *); +void AnimPresentHealParticle(struct Sprite *); +void AnimItemSteal(struct Sprite *); +void AnimTrickBag(struct Sprite *); void sub_8100640(struct Sprite *); void sub_8100898(struct Sprite *); void sub_81009F8(struct Sprite *); @@ -79,27 +79,27 @@ void sub_8103208(struct Sprite *); void sub_8103284(struct Sprite *); void sub_8103390(struct Sprite *); static void AnimMovePowderParticleStep(struct Sprite *); -static void sub_80FE9E4(struct Sprite *); -static void sub_80FEB28(struct Sprite *); -static void sub_80FEBFC(struct Sprite *); +static void AnimSolarbeamSmallOrbStep(struct Sprite *); +static void AnimAbsorptionOrbStep(struct Sprite *); +static void AnimHyperBeamOrbStep(struct Sprite *); static void AnimLeechSeedStep(struct Sprite *); static void AnimLeechSeedSprouts(struct Sprite *); -static void sub_80FED74(struct Sprite *); -static void sub_80FEECC(struct Sprite *); -static void sub_80FEF98(struct Sprite *); -static void sub_80FF044(struct Sprite *); -static void sub_80FF090(struct Sprite *); +static void AnimSporeParticleStep(struct Sprite *); +static void AnimPetalDanceBigFlowerStep(struct Sprite *); +static void AnimPetalDanceSmallFlowerStep(struct Sprite *); +static void AnimRazorLeafParticleStep1(struct Sprite *); +static void AnimRazorLeafParticleStep2(struct Sprite *); static void AnimTranslateLinearSingleSineWaveStep(struct Sprite *); static void AnimMoveTwisterParticleStep(struct Sprite *); -static void sub_80FF3B0(struct Sprite *); -static void sub_80FF3EC(struct Sprite *); +static void AnimConstrictBindingStep1(struct Sprite *); +static void AnimConstrictBindingStep2(struct Sprite *); static void sub_80FF53C(u8); static void sub_80FF5CC(u8); -static void sub_80FFD2C(struct Sprite *); -static void sub_80FF8DC(struct Sprite *); -static void sub_80FFE58(struct Sprite *); -static void sub_80FFEC4(struct Sprite *); -static void sub_80FFF7C(struct Sprite *); +static void AnimItemStealStep(struct Sprite *); +static void AnimRootFlickerOut(struct Sprite *); +static void AnimTrickBagStep1(struct Sprite *); +static void AnimTrickBagStep2(struct Sprite *); +static void AnimTrickBagStep3(struct Sprite *); static void sub_8100128(u8); static s16 sub_8100504(struct Sprite *); static void sub_8100524(struct Task *, u8); @@ -285,7 +285,7 @@ const union AffineAnimCmd *const gUnknown_085921DC[] = { gUnknown_085921CC, }; -const struct SpriteTemplate gUnknown_085921E0 = +const struct SpriteTemplate gPowerAbsorptionOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -293,10 +293,10 @@ const struct SpriteTemplate gUnknown_085921E0 = .anims = gUnknown_085921C8, .images = NULL, .affineAnims = gUnknown_085921DC, - .callback = sub_80FE8E0, + .callback = AnimPowerAbsorptionOrb, }; -const struct SpriteTemplate gUnknown_085921F8 = +const struct SpriteTemplate gSolarbeamBigOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -304,10 +304,10 @@ const struct SpriteTemplate gUnknown_085921F8 = .anims = gUnknown_085921A8, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FE930, + .callback = AnimSolarbeamBigOrb, }; -const struct SpriteTemplate gUnknown_08592210 = +const struct SpriteTemplate gSolarbeamSmallOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -315,7 +315,7 @@ const struct SpriteTemplate gUnknown_08592210 = .anims = gUnknown_085921C4, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FE988, + .callback = AnimSolarbeamSmallOrb, }; const union AffineAnimCmd gUnknown_08592228[] = { @@ -328,7 +328,7 @@ const union AffineAnimCmd *const gUnknown_08592240[] = { gUnknown_08592228, }; -const struct SpriteTemplate gUnknown_08592244 = +const struct SpriteTemplate gStockpileAbsorptionOrbSpriteTemplate = { .tileTag = ANIM_TAG_GRAY_ORB, .paletteTag = ANIM_TAG_GRAY_ORB, @@ -336,7 +336,7 @@ const struct SpriteTemplate gUnknown_08592244 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gUnknown_08592240, - .callback = sub_80FE8E0, + .callback = AnimPowerAbsorptionOrb, }; const union AffineAnimCmd gUnknown_0859225C[] = { @@ -348,7 +348,7 @@ const union AffineAnimCmd *const gUnknown_0859226C[] = { gUnknown_0859225C, }; -const struct SpriteTemplate gUnknown_08592270 = +const struct SpriteTemplate gAbsorptionOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -356,10 +356,10 @@ const struct SpriteTemplate gUnknown_08592270 = .anims = gUnknown_085921C8, .images = NULL, .affineAnims = gUnknown_0859226C, - .callback = sub_80FEAD8, + .callback = AnimAbsorptionOrb, }; -const struct SpriteTemplate gUnknown_08592288 = +const struct SpriteTemplate gHyperBeamOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -367,7 +367,7 @@ const struct SpriteTemplate gUnknown_08592288 = .anims = gUnknown_085921A8, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEB44, + .callback = AnimHyperBeamOrb, }; const union AnimCmd gUnknown_085922A0[] = @@ -418,7 +418,7 @@ const union AnimCmd *const gUnknown_085922E4[] = gUnknown_085922DC, }; -const struct SpriteTemplate gUnknown_085922EC = +const struct SpriteTemplate gSporeParticleSpriteTemplate = { .tileTag = ANIM_TAG_SPORE, .paletteTag = ANIM_TAG_SPORE, @@ -426,7 +426,7 @@ const struct SpriteTemplate gUnknown_085922EC = .anims = gUnknown_085922E4, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FED28, + .callback = AnimSporeParticle, }; const union AnimCmd gUnknown_08592304[] = @@ -451,7 +451,7 @@ const union AnimCmd *const gUnknown_08592318[] = gUnknown_0859230C, }; -const struct SpriteTemplate gUnknown_0859231C = +const struct SpriteTemplate gPetalDanceBigFlowerSpriteTemplate = { .tileTag = ANIM_TAG_FLOWER, .paletteTag = ANIM_TAG_FLOWER, @@ -459,10 +459,10 @@ const struct SpriteTemplate gUnknown_0859231C = .anims = gUnknown_08592314, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEE78, + .callback = AnimPetalDanceBigFlower, }; -const struct SpriteTemplate gUnknown_08592334 = +const struct SpriteTemplate gPetalDanceSmallFlowerSpriteTemplate = { .tileTag = ANIM_TAG_FLOWER, .paletteTag = ANIM_TAG_FLOWER, @@ -470,7 +470,7 @@ const struct SpriteTemplate gUnknown_08592334 = .anims = gUnknown_08592318, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEF44, + .callback = AnimPetalDanceSmallFlower, }; const union AnimCmd gUnknown_0859234C[] = @@ -502,7 +502,7 @@ const union AnimCmd *const gUnknown_08592388[] = gUnknown_08592378, }; -const struct SpriteTemplate gUnknown_08592390 = +const struct SpriteTemplate gRazorLeafParticleSpriteTemplate = { .tileTag = ANIM_TAG_LEAF, .paletteTag = ANIM_TAG_LEAF, @@ -510,10 +510,10 @@ const struct SpriteTemplate gUnknown_08592390 = .anims = gUnknown_08592388, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEFFC, + .callback = AnimRazorLeafParticle, }; -const struct SpriteTemplate gUnknown_085923A8 = +const struct SpriteTemplate gTwisterLeafParticleSpriteTemplate = { .tileTag = ANIM_TAG_LEAF, .paletteTag = ANIM_TAG_LEAF, @@ -538,7 +538,7 @@ const union AnimCmd *const gUnknown_085923D4[] = gUnknown_085923C0, }; -const struct SpriteTemplate gUnknown_085923D8 = +const struct SpriteTemplate gRazorLeafCutterSpriteTemplate = { .tileTag = ANIM_TAG_RAZOR_LEAF, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -594,14 +594,14 @@ const union AnimCmd *const gUnknown_08592444[] = }; const union AffineAnimCmd gUnknown_0859244C[] = { - AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(-11, 0, 0, 6), AFFINEANIMCMD_FRAME(11, 0, 0, 6), AFFINEANIMCMD_END, }; const union AffineAnimCmd gUnknown_0859246C[] = { - AFFINEANIMCMD_FRAME(-256, 256, 0, 0), + AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(11, 0, 0, 6), AFFINEANIMCMD_FRAME(-11, 0, 0, 6), AFFINEANIMCMD_END, @@ -612,7 +612,7 @@ const union AffineAnimCmd *const gUnknown_0859248C[] = { gUnknown_0859246C, }; -const struct SpriteTemplate gUnknown_08592494 = +const struct SpriteTemplate gConstrictBindingSpriteTemplate = { .tileTag = ANIM_TAG_TENDRILS, .paletteTag = ANIM_TAG_TENDRILS, @@ -620,7 +620,7 @@ const struct SpriteTemplate gUnknown_08592494 = .anims = gUnknown_08592444, .images = NULL, .affineAnims = gUnknown_0859248C, - .callback = sub_80FF374, + .callback = AnimConstrictBinding, }; const union AffineAnimCmd gUnknown_085924AC[] = { @@ -639,7 +639,7 @@ const union AffineAnimCmd *const gUnknown_085924D4[] = { gUnknown_085924C4, }; -const struct SpriteTemplate gUnknown_085924DC = +const struct SpriteTemplate gMimicOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -647,7 +647,7 @@ const struct SpriteTemplate gUnknown_085924DC = .anims = gUnknown_085921C8, .images = NULL, .affineAnims = gUnknown_085924D4, - .callback = sub_80FF698, + .callback = AnimMimicOrb, }; const union AnimCmd gUnknown_085924F4[] = @@ -692,7 +692,7 @@ const union AnimCmd *const gUnknown_0859253C[] = gUnknown_0859252C, }; -const struct SpriteTemplate gUnknown_0859254C = +const struct SpriteTemplate gIngrainRootSpriteTemplate = { .tileTag = ANIM_TAG_ROOTS, .paletteTag = ANIM_TAG_ROOTS, @@ -700,10 +700,10 @@ const struct SpriteTemplate gUnknown_0859254C = .anims = gUnknown_0859253C, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FF768, + .callback = AnimIngrainRoot, }; -const struct SpriteTemplate gUnknown_08592564 = +const struct SpriteTemplate gFrenzyPlantRootSpriteTemplate = { .tileTag = ANIM_TAG_ROOTS, .paletteTag = ANIM_TAG_ROOTS, @@ -711,7 +711,7 @@ const struct SpriteTemplate gUnknown_08592564 = .anims = gUnknown_0859253C, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FF7EC, + .callback = AnimFrenzyPlantRoot, }; const union AnimCmd gUnknown_0859257C[] = @@ -726,7 +726,7 @@ const union AnimCmd *const gUnknown_08592588[] = gUnknown_0859257C, }; -const struct SpriteTemplate gUnknown_0859258C = +const struct SpriteTemplate gIngrainOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -734,7 +734,7 @@ const struct SpriteTemplate gUnknown_0859258C = .anims = gUnknown_08592588, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FF934, + .callback = AnimIngrainOrb, }; const union AnimCmd gUnknown_085925A4[] = @@ -770,7 +770,7 @@ const union AffineAnimCmd *const gUnknown_08592608[] = { gUnknown_085925D0, }; -const struct SpriteTemplate gUnknown_08592610 = +const struct SpriteTemplate gPresentSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -778,10 +778,10 @@ const struct SpriteTemplate gUnknown_08592610 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_08592608, - .callback = sub_80FFB18, + .callback = AnimPresent, }; -const struct SpriteTemplate gBattleAnimSpriteTemplate_8592628 = +const struct SpriteTemplate gKnockOffItemSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -789,7 +789,7 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_8592628 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_08592608, - .callback = sub_80FFBF4, + .callback = AnimKnockOffItem, }; const union AnimCmd gUnknown_08592640[] = @@ -806,7 +806,7 @@ const union AnimCmd *const gUnknown_08592654[] = gUnknown_08592640, }; -const struct SpriteTemplate gUnknown_08592658 = +const struct SpriteTemplate gPresentHealParticleSpriteTemplate = { .tileTag = ANIM_TAG_GREEN_SPARKLE, .paletteTag = ANIM_TAG_GREEN_SPARKLE, @@ -814,10 +814,10 @@ const struct SpriteTemplate gUnknown_08592658 = .anims = gUnknown_08592654, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FFC70, + .callback = AnimPresentHealParticle, }; -const struct SpriteTemplate gUnknown_08592670 = +const struct SpriteTemplate gItemStealSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -825,7 +825,7 @@ const struct SpriteTemplate gUnknown_08592670 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_08592608, - .callback = sub_80FFCB4, + .callback = AnimItemSteal, }; const union AffineAnimCmd gUnknown_08592688[] = { @@ -851,7 +851,7 @@ const union AffineAnimCmd *const gUnknown_085926D8[] = { gUnknown_085925D0, }; -const struct SpriteTemplate gUnknown_085926E8 = +const struct SpriteTemplate gTrickBagSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -859,7 +859,7 @@ const struct SpriteTemplate gUnknown_085926E8 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_085926D8, - .callback = sub_80FFDBC, + .callback = AnimTrickBag, }; const s8 gUnknown_08592700[][3] = @@ -2219,44 +2219,59 @@ static void AnimMovePowderParticleStep(struct Sprite* sprite) } } -void sub_80FE8E0(struct Sprite* sprite) +// Moves an energy orb towards the center of the mon. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration +void AnimPowerAbsorptionOrb(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } -void sub_80FE930(struct Sprite* sprite) +// Moves an orb in a straight line towards the target mon. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration +// arg 3: sprite anim number +void AnimSolarbeamBigOrb(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[3]); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_80FE988(struct Sprite* sprite) +// Moves a small orb in a wavy pattern towards the target mon. +// The small orb "circles" the big orbs in AnimSolarbeamBigOrb. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration +// arg 3: initial wave offset +void AnimSolarbeamSmallOrb(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); sprite->data[5] = gBattleAnimArgs[3]; - sprite->callback = sub_80FE9E4; + sprite->callback = AnimSolarbeamSmallOrbStep; sprite->callback(sprite); } -static void sub_80FE9E4(struct Sprite* sprite) +static void AnimSolarbeamSmallOrbStep(struct Sprite* sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { DestroySprite(sprite); } @@ -2273,10 +2288,12 @@ static void sub_80FE9E4(struct Sprite* sprite) } } -void sub_80FEA58(u8 taskId) +// Creates 15 small secondary orbs used in the solarbeam anim effect. +// There is a 7-frame delay between each of them. +// No args. +void AnimTask_CreateSmallSolarbeamOrbs(u8 taskId) { - gTasks[taskId].data[0]--; - if (gTasks[taskId].data[0] == -1) + if (--gTasks[taskId].data[0] == -1) { gTasks[taskId].data[1]++; gTasks[taskId].data[0] = 6; @@ -2284,63 +2301,66 @@ void sub_80FEA58(u8 taskId) gBattleAnimArgs[1] = 0; gBattleAnimArgs[2] = 80; gBattleAnimArgs[3] = 0; - CreateSpriteAndAnimate(&gUnknown_08592210, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1); + CreateSpriteAndAnimate(&gSolarbeamSmallOrbSpriteTemplate, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1); } if (gTasks[taskId].data[1] == 15) DestroyAnimVisualTask(taskId); } -void sub_80FEAD8(struct Sprite* sprite) +// Moves an orb from the target mon to the attacking mon in an arc-like fashion. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: wave amplitude +// arg 3: wave period (lower means faster wave) +void AnimAbsorptionOrb(struct Sprite* sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[5] = gBattleAnimArgs[2]; InitAnimArcTranslation(sprite); - sprite->callback = sub_80FEB28; + sprite->callback = AnimAbsorptionOrbStep; } -static void sub_80FEB28(struct Sprite* sprite) +static void AnimAbsorptionOrbStep(struct Sprite* sprite) { if (TranslateAnimArc(sprite)) DestroyAnimSprite(sprite); } -void sub_80FEB44(struct Sprite* sprite) +// Moves an orb in a wave-like fashion towards the target mon. The wave's +// properties and the sprite anim are randomly determined. +void AnimHyperBeamOrb(struct Sprite* sprite) { - u16 a = Random2(); - u16 b; + u16 speed; + u16 animNum = Random2(); - StartSpriteAnim(sprite, a & 7); - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); - if (GetBattlerSide(gBattleAnimAttacker)) - { + StartSpriteAnim(sprite, animNum % 8); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) sprite->pos1.x -= 20; - } else - { sprite->pos1.x += 20; - } - b = Random2(); - sprite->data[0] = (b & 31) + 64; + speed = Random2(); + sprite->data[0] = (speed & 31) + 64; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - sub_80A7160(sprite); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + InitAnimFastLinearTranslationWithSpeed(sprite); sprite->data[5] = Random2() & 0xFF; sprite->data[6] = sprite->subpriority; - sprite->callback = sub_80FEBFC; + sprite->callback = AnimHyperBeamOrbStep; sprite->callback(sprite); } -static void sub_80FEBFC(struct Sprite* sprite) +static void AnimHyperBeamOrbStep(struct Sprite* sprite) { - if (sub_80A70E8(sprite)) + if (AnimFastTranslateLinear(sprite)) { DestroyAnimSprite(sprite); } @@ -2352,7 +2372,8 @@ static void sub_80FEBFC(struct Sprite* sprite) else sprite->subpriority = sprite->data[6] + 1; - sprite->data[5] = (sprite->data[5] + 24) & 0xFF; + sprite->data[5] += 24; + sprite->data[5] &= 0xFF; } } @@ -2366,13 +2387,13 @@ static void sub_80FEBFC(struct Sprite* sprite) // arg 5: wave amplitude void AnimLeechSeed(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); - if (GetBattlerSide(gBattleAnimAttacker)) + InitSpritePosToAnimAttacker(sprite, TRUE); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[2]; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[3]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[5]; InitAnimArcTranslation(sprite); sprite->callback = AnimLeechSeedStep; @@ -2398,42 +2419,54 @@ static void AnimLeechSeedSprouts(struct Sprite* sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_80FED28(struct Sprite* sprite) +// Moves a spore particle in a halo around the target mon. +// The sprite's priority is updated to give the effect of going +// behind the mon's sprite. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: initial wave offset +// arg 3: duration +// arg 4: blend (0 = off, 1 = on) +void AnimSporeParticle(struct Sprite* sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[4]); if (gBattleAnimArgs[4] == 1) sprite->oam.objMode = ST_OAM_OBJ_BLEND; sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[2]; - sprite->callback = sub_80FED74; + sprite->callback = AnimSporeParticleStep; sprite->callback(sprite); } -static void sub_80FED74(struct Sprite* sprite) +static void AnimSporeParticleStep(struct Sprite* sprite) { sprite->pos2.x = Sin(sprite->data[1], 32); sprite->pos2.y = Cos(sprite->data[1], -3) + ((sprite->data[2] += 24) >> 8); if ((u16)(sprite->data[1] - 0x40) < 0x80) { - sprite->oam.priority = (sub_80A8328(gBattleAnimTarget) & 3); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); } else { - u8 priority = sub_80A8328(gBattleAnimTarget) + 1; + u8 priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) + 1; if (priority > 3) priority = 3; sprite->oam.priority = priority; } - sprite->data[1] = (sprite->data[1] + 2) & 0xFF; + sprite->data[1] += 2; + sprite->data[1] &= 0xFF; if (--sprite->data[0] == -1) DestroyAnimSprite(sprite); } -void sub_80FEE1C(u8 taskId) +// In a double battle, Updates the mon sprite background priorities to allow +// the circling effect controlled by AnimSporeParticle. +// No args. +void AnimTask_SporeDoubleBattle(u8 taskId) { if (IsContest() || !IsDoubleBattle()) { @@ -2441,7 +2474,7 @@ void sub_80FEE1C(u8 taskId) } else { - if (sub_80A8364(gBattleAnimTarget) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimTarget) == 1) SetAnimBgAttribute(2, BG_ANIM_PRIORITY, 3); else SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); @@ -2450,23 +2483,29 @@ void sub_80FEE1C(u8 taskId) } } -void sub_80FEE78(struct Sprite* sprite) +// Rotates a big flower around the attacking mon, and slowly floats +// downward. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target y pixel offset +// arg 3: duration +void AnimPetalDanceBigFlower(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; InitAnimLinearTranslation(sprite); sprite->data[5] = 0x40; - sprite->callback = sub_80FEECC; + sprite->callback = AnimPetalDanceBigFlowerStep; sprite->callback(sprite); } -static void sub_80FEECC(struct Sprite* sprite) +static void AnimPetalDanceBigFlowerStep(struct Sprite* sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[5], 32); sprite->pos2.y += Cos(sprite->data[5], -5); @@ -2483,9 +2522,14 @@ static void sub_80FEECC(struct Sprite* sprite) } } -void sub_80FEF44(struct Sprite* sprite) +// Slowly floats a small flower downard, while swaying from right to left. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target y pixel offset +// arg 3: duration +void AnimPetalDanceSmallFlower(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = sprite->pos1.x; @@ -2493,19 +2537,20 @@ void sub_80FEF44(struct Sprite* sprite) sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; InitAnimLinearTranslation(sprite); sprite->data[5] = 0x40; - sprite->callback = sub_80FEF98; + sprite->callback = AnimPetalDanceSmallFlowerStep; sprite->callback(sprite); } -static void sub_80FEF98(struct Sprite* sprite) +static void AnimPetalDanceSmallFlowerStep(struct Sprite* sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[5], 8); if ((u16)(sprite->data[5] - 59) < 5 || (u16)(sprite->data[5] - 187) < 5) - sprite->oam.matrixNum ^= 0x8; + sprite->oam.matrixNum ^= 0x8; // horizontal flip - sprite->data[5] = (sprite->data[5] + 5) & 0xFF; + sprite->data[5] += 5; + sprite->data[5] &= 0xFF; } else { @@ -2513,17 +2558,21 @@ static void sub_80FEF98(struct Sprite* sprite) } } -void sub_80FEFFC(struct Sprite* sprite) +// Shoots a leaf upward, then floats it downward while swaying back and forth. +// arg 0: upward x delta per frame +// arg 1: upward y delta per frame +// arg 2: upward duration +void AnimRazorLeafParticle(struct Sprite* sprite) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = gBattleAnimArgs[0]; sprite->data[1] = gBattleAnimArgs[1]; sprite->data[2] = gBattleAnimArgs[2]; - sprite->callback = sub_80FF044; + sprite->callback = AnimRazorLeafParticleStep1; } -static void sub_80FF044(struct Sprite* sprite) +static void AnimRazorLeafParticleStep1(struct Sprite* sprite) { if (!sprite->data[2]) { @@ -2535,11 +2584,11 @@ static void sub_80FF044(struct Sprite* sprite) } else { - sprite->data[0] = sprite->data[1] & 1; - sprite->data[1] = sprite->data[1] & 1; - sprite->data[2] = sprite->data[1] & 1; + sprite->data[0] = 0; + sprite->data[1] = 0; + sprite->data[2] = 0; } - sprite->callback = sub_80FF090; + sprite->callback = AnimRazorLeafParticleStep2; } else { @@ -2549,14 +2598,15 @@ static void sub_80FF044(struct Sprite* sprite) } } -static void sub_80FF090(struct Sprite* sprite) +static void AnimRazorLeafParticleStep2(struct Sprite* sprite) { if (GetBattlerSide(gBattleAnimAttacker)) sprite->pos2.x = -Sin(sprite->data[0], 25); else sprite->pos2.x = Sin(sprite->data[0], 25); - sprite->data[0] = (sprite->data[0] + 2) & 0xFF; + sprite->data[0] += 2; + sprite->data[0] &= 0xFF; sprite->data[1]++; if (!(sprite->data[1] & 1)) sprite->pos2.y++; @@ -2577,19 +2627,19 @@ static void sub_80FF090(struct Sprite* sprite) // arg 6: target between double battle opponents (boolean) void AnimTranslateLinearSingleSineWave(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; if (!gBattleAnimArgs[6]) { - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3]; } else { - SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]); + SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->data[2], &sprite->data[4]); sprite->data[2] += gBattleAnimArgs[2]; sprite->data[4] += gBattleAnimArgs[3]; } @@ -2676,38 +2726,45 @@ static void AnimMoveTwisterParticleStep(struct Sprite* sprite) sprite->pos2.x = Cos(sprite->data[5], sprite->data[3]); sprite->pos2.y = Sin(sprite->data[5], 5); if (sprite->data[5] < 0x80) - sprite->oam.priority = sub_80A8328(gBattleAnimTarget) - 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) - 1; else - sprite->oam.priority = sub_80A8328(gBattleAnimTarget) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) + 1; if (--sprite->data[0] == 0) DestroyAnimSprite(sprite); } -void sub_80FF374(struct Sprite* sprite) +// Squeezes a constricting "rope" several times via affine animations. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: affine anim num +// arg 3: num squeezes +void AnimConstrictBinding(struct Sprite* sprite) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->affineAnimPaused = 1; StartSpriteAffineAnim(sprite, gBattleAnimArgs[2]); sprite->data[6] = gBattleAnimArgs[2]; sprite->data[7] = gBattleAnimArgs[3]; - sprite->callback = sub_80FF3B0; + sprite->callback = AnimConstrictBindingStep1; } -static void sub_80FF3B0(struct Sprite* sprite) +static void AnimConstrictBindingStep1(struct Sprite* sprite) { + u8 spriteId; + if ((u16)gBattleAnimArgs[7] == 0xFFFF) { sprite->affineAnimPaused = 0; - GetAnimBattlerSpriteId(1); + spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); sprite->data[0] = 0x100; - sprite->callback = sub_80FF3EC; + sprite->callback = AnimConstrictBindingStep2; } } -static void sub_80FF3EC(struct Sprite* sprite) +static void AnimConstrictBindingStep2(struct Sprite* sprite) { - GetAnimBattlerSpriteId(1); + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); if (!sprite->data[2]) sprite->data[0] += 11; else @@ -2739,23 +2796,23 @@ void sub_80FF458(u8 taskId) { PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND); gTasks[taskId].data[14] = gSprites[spriteId].oam.priority; - gSprites[spriteId].oam.priority = sub_80A8328(gBattleAnimTarget); + gSprites[spriteId].oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER); gTasks[taskId].data[15] = gSprites[spriteId].oam.priority; - gSprites[spriteId].oam.priority = sub_80A8328(BATTLE_PARTNER(gBattleAnimTarget)); + gSprites[spriteId].oam.priority = GetBattlerSpriteBGPriority(BATTLE_PARTNER(gBattleAnimTarget)); gTasks[taskId].data[0] = gBattleAnimArgs[0]; gTasks[taskId].data[1] = gBattleAnimArgs[1]; - gTasks[taskId].data[11] = 256; + gTasks[taskId].data[11] = 0x100; gTasks[taskId].func = sub_80FF53C; } } static void sub_80FF53C(u8 taskId) { - u8 spriteId = GetAnimBattlerSpriteId(1); + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); gTasks[taskId].data[10] += gTasks[taskId].data[0]; gSprites[spriteId].pos2.x = gTasks[taskId].data[10] >> 8; - if (GetBattlerSide(gBattleAnimTarget)) + if (GetBattlerSide(gBattleAnimTarget) != B_SIDE_PLAYER) gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; gTasks[taskId].data[11] += 16; @@ -2796,7 +2853,10 @@ static void sub_80FF5CC(u8 taskId) DestroyAnimVisualTask(taskId); } -void sub_80FF698(struct Sprite* sprite) +// Moves an orb from the target mon to the attacking mon. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +void AnimMimicOrb(struct Sprite* sprite) { switch (sprite->data[0]) { @@ -2804,8 +2864,8 @@ void sub_80FF698(struct Sprite* sprite) if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) gBattleAnimArgs[0] *= -1; - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[0]; - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[1]; sprite->invisible = 1; sprite->data[0]++; break; @@ -2815,21 +2875,27 @@ void sub_80FF698(struct Sprite* sprite) { ChangeSpriteAffineAnim(sprite, 1); sprite->data[0] = 25; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); - sprite->callback = sub_80A70C0; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + sprite->callback = InitAndRunAnimFastLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); break; } } } -void sub_80FF768(struct Sprite* sprite) +// Animates a root that flickers away after some time. +// arg 0: x pixel offset +// arg 1: y pixel offset +// arg 2: sprite subpriority offset +// arg 3: sprite anim num +// arg 4: duration +void AnimIngrainRoot(struct Sprite* sprite) { if (!sprite->data[0]) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); sprite->pos2.x = gBattleAnimArgs[0]; sprite->pos2.y = gBattleAnimArgs[1]; sprite->subpriority = gBattleAnimArgs[2] + 30; @@ -2839,33 +2905,40 @@ void sub_80FF768(struct Sprite* sprite) if (sprite->pos1.y + sprite->pos2.y > 120) sprite->pos1.y += sprite->pos2.y + sprite->pos1.y - 120; } - sprite->callback = sub_80FF8DC; + sprite->callback = AnimRootFlickerOut; } -void sub_80FF7EC(struct Sprite *sprite) +// Places a root on the path to the target mon that flickers away after some time. +// arg 0: percent along the path to the target mon +// arg 1: x pixel offset +// arg 2: y pixel offset +// arg 3: sprite subpriority offset +// arg 4: sprite anum num +// arg 5: duration +void AnimFrenzyPlantRoot(struct Sprite *sprite) { - s16 p1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - s16 p2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); - s16 e1 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - s16 e2 = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + s16 attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + s16 attackerY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + s16 targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + s16 targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); - e1 -= p1; - e2 -= p2; - sprite->pos1.x = p1 + e1 * gBattleAnimArgs[0] / 100; - sprite->pos1.y = p2 + e2 * gBattleAnimArgs[0] / 100; + targetX -= attackerX; + targetY -= attackerY; + sprite->pos1.x = attackerX + targetX * gBattleAnimArgs[0] / 100; + sprite->pos1.y = attackerY + targetY * gBattleAnimArgs[0] / 100; sprite->pos2.x = gBattleAnimArgs[1]; sprite->pos2.y = gBattleAnimArgs[2]; sprite->subpriority = gBattleAnimArgs[3] + 30; StartSpriteAnim(sprite, gBattleAnimArgs[4]); sprite->data[2] = gBattleAnimArgs[5]; - sprite->callback = sub_80FF8DC; + sprite->callback = AnimRootFlickerOut; gUnknown_0203A0F8[0] = sprite->pos1.x; gUnknown_0203A0F8[1] = sprite->pos1.y; - gUnknown_0203A0F8[2] = e1; - gUnknown_0203A0F8[3] = e2; + gUnknown_0203A0F8[2] = targetX; + gUnknown_0203A0F8[3] = targetY; } -static void sub_80FF8DC(struct Sprite* sprite) +static void AnimRootFlickerOut(struct Sprite* sprite) { if (++sprite->data[0] > (sprite->data[2] - 10)) sprite->invisible = sprite->data[0] % 2; @@ -2874,7 +2947,13 @@ static void sub_80FF8DC(struct Sprite* sprite) DestroyAnimSprite(sprite); } -void sub_80FF934(struct Sprite* sprite) +// Moves an orb in a fast wavy path. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: horizontal velocity +// arg 3: wave amplitude +// arg 4: duration +void AnimIngrainOrb(struct Sprite* sprite) { if (!sprite->data[0]) { @@ -2892,11 +2971,11 @@ void sub_80FF934(struct Sprite* sprite) DestroyAnimSprite(sprite); } -void sub_80FF9B8(struct Sprite* sprite, s16 c) +static void sub_80FF9B8(struct Sprite* sprite, s16 c) { - s32 a = (sprite->pos1.x * 256) | sprite->pos1.y; - s32 b = (sprite->data[6] * 256) | sprite->data[7]; - c *= 256; + int a = (sprite->pos1.x << 8) | sprite->pos1.y; + int b = (sprite->data[6] << 8) | sprite->data[7]; + c <<= 8; sprite->data[5] = a; sprite->data[6] = b; sprite->data[7] = c; @@ -2961,24 +3040,24 @@ static void sub_80FFAB4(struct Sprite* sprite) } } -void sub_80FFB18(struct Sprite* sprite) +void AnimPresent(struct Sprite* sprite) { - s16 e1; - s16 e2; - InitAnimSpritePos(sprite, 0); - e1 = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - e2 = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + s16 targetX; + s16 targetY; + InitSpritePosToAnimAttacker(sprite, FALSE); + targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget) { - sprite->data[6] = e1; - sprite->data[7] = e2 + 10; + sprite->data[6] = targetX; + sprite->data[7] = targetY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 1; } else { - sprite->data[6] = e1; - sprite->data[7] = e2 + 10; + sprite->data[6] = targetX; + sprite->data[7] = targetY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 3; } @@ -3007,37 +3086,42 @@ static void sub_80FFB90(struct Sprite* sprite) } } -void sub_80FFBF4(struct Sprite* sprite) +void AnimKnockOffItem(struct Sprite* sprite) { - s16 e = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + s16 targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) { sprite->data[6] = 0; - sprite->data[7] = e + 10; + sprite->data[7] = targetY + 10; sub_80FF9B8(sprite, 40); sprite->data[3] = 3; - sprite->data[4] = 0x3C; + sprite->data[4] = 60; sprite->callback = sub_80FFAB4; } else { sprite->data[6] = 255; - sprite->data[7] = e + 10; + sprite->data[7] = targetY + 10; if (IsContest()) sprite->data[6] = 0; sub_80FF9B8(sprite, 40); sprite->data[3] = 3; - sprite->data[4] = 0x3C; + sprite->data[4] = 60; sprite->callback = sub_80FFB90; } } -void sub_80FFC70(struct Sprite* sprite) +// Animates a heal particle upward. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: vertical velocity +// arg 3: unused +void AnimPresentHealParticle(struct Sprite* sprite) { - if (sprite->data[0] == 0) + if (!sprite->data[0]) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->data[1] = gBattleAnimArgs[2]; } @@ -3047,33 +3131,33 @@ void sub_80FFC70(struct Sprite* sprite) DestroyAnimSprite(sprite); } -void sub_80FFCB4(struct Sprite* sprite) +void AnimItemSteal(struct Sprite* sprite) { - s16 p1; - s16 p2; - sub_80A6980(sprite, FALSE); - p1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - p2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + s16 attackerX; + s16 attackerY; + InitSpritePosToAnimTarget(sprite, FALSE); + attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + attackerY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); if (BATTLE_PARTNER(gBattleAnimTarget) == gBattleAnimAttacker) { - sprite->data[6] = p1; - sprite->data[7] = p2 + 10; + sprite->data[6] = attackerX; + sprite->data[7] = attackerY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 1; } else { - sprite->data[6] = p1; - sprite->data[7] = p2 + 10; + sprite->data[6] = attackerX; + sprite->data[7] = attackerY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 3; } sprite->data[4] = 60; - sprite->callback = sub_80FFD2C; + sprite->callback = AnimItemStealStep; } -static void sub_80FFD2C(struct Sprite* sprite) +static void AnimItemStealStep(struct Sprite* sprite) { int zero; sprite->data[0] += ((sprite->data[3] * 128) / sprite->data[4]); @@ -3097,7 +3181,10 @@ static void sub_80FFD2C(struct Sprite* sprite) } } -void sub_80FFDBC(struct Sprite* sprite) +// Moves a bag in a circular motion. +// arg 0: y position +// arg 1: initial wave offset +void AnimTrickBag(struct Sprite* sprite) { int a; int b; @@ -3126,7 +3213,7 @@ void sub_80FFDBC(struct Sprite* sprite) sprite->data[4] = 20; sprite->pos2.x = Cos(sprite->data[1], 60); sprite->pos2.y = Sin(sprite->data[1], 20); - sprite->callback = sub_80FFE58; + sprite->callback = AnimTrickBagStep1; if (sprite->data[1] > 0 && sprite->data[1] < 192) sprite->subpriority = 31; else @@ -3134,7 +3221,7 @@ void sub_80FFDBC(struct Sprite* sprite) } } -static void sub_80FFE58(struct Sprite* sprite) +static void AnimTrickBagStep1(struct Sprite* sprite) { switch (sprite->data[3]) { @@ -3158,20 +3245,20 @@ static void sub_80FFE58(struct Sprite* sprite) { sprite->data[0] = 0; sprite->data[2] = 0; - sprite->callback = sub_80FFEC4; + sprite->callback = AnimTrickBagStep2; } break; } } -static void sub_80FFEC4(struct Sprite* sprite) +static void AnimTrickBagStep2(struct Sprite* sprite) { if (sprite->data[2] == gUnknown_08592700[sprite->data[0]][1]) { if (gUnknown_08592700[sprite->data[0]][2] == 127) { sprite->data[0] = 0; - sprite->callback = sub_80FFF7C; + sprite->callback = AnimTrickBagStep3; } sprite->data[2] = 0; @@ -3194,7 +3281,7 @@ static void sub_80FFEC4(struct Sprite* sprite) } } -static void sub_80FFF7C(struct Sprite* sprite) +static void AnimTrickBagStep3(struct Sprite* sprite) { if (sprite->data[0] > 20) DestroyAnimSprite(sprite); @@ -3493,20 +3580,20 @@ void sub_8100640(struct Sprite* sprite) { case 0: sprite->pos1.y = gBattleAnimArgs[0]; - sprite->oam.priority = sub_80A8328(battler); + sprite->oam.priority = GetBattlerSpriteBGPriority(battler); break; case 1: sprite->pos1.y = gBattleAnimArgs[0]; - sprite->oam.priority = sub_80A8328(battler) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; break; case 2: sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[0]; - sprite->oam.priority = sub_80A8328(battler); + sprite->oam.priority = GetBattlerSpriteBGPriority(battler); break; case 3: sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[0]; GetAnimBattlerSpriteId(ANIM_TARGET); - sprite->oam.priority = sub_80A8328(battler) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; break; } @@ -3665,7 +3752,7 @@ void sub_8100A50(struct Sprite* sprite) StartSpriteAnim(sprite, 1); sprite->callback = sub_81009DC; - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } @@ -3858,9 +3945,9 @@ void sub_8100EF0(struct Sprite* sprite) sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, 0) + gBattleAnimArgs[0]; sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, 1) + gBattleAnimArgs[1]; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER || IsContest()) - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker) + 1; else - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[2] = (IndexOfSpritePaletteTag(ANIM_TAG_PROTECT) << 4) + 0x100; @@ -4028,13 +4115,13 @@ void sub_810130C(struct Sprite* sprite) if (!gBattleAnimArgs[2]) SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[0] = gBattleAnimArgs[5]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; } void sub_810135C(struct Sprite* sprite) @@ -4048,7 +4135,7 @@ void sub_810135C(struct Sprite* sprite) if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler))) { SetAverageBattlerPositions(battler, gBattleAnimArgs[6], &sprite->pos1.x, &sprite->pos1.y); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } else @@ -4064,14 +4151,14 @@ void sub_810135C(struct Sprite* sprite) sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[1]; } - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); } sprite->data[0] = gBattleAnimArgs[5]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; } void sub_8101440(struct Sprite* sprite) @@ -4782,7 +4869,7 @@ void sub_81022D4(u8 taskId) void sub_810234C(struct Sprite* sprite) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->animPaused = 1; sprite->data[0] = gBattleAnimArgs[2]; sprite->callback = sub_810237C; @@ -5094,7 +5181,7 @@ void sub_81029B4(u8 taskId) } task->func = sub_8102AE0; - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON); else ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); @@ -5105,7 +5192,7 @@ static void sub_8102AE0(u8 taskId) struct Task* task = &gTasks[taskId]; if (!task->data[3]) { - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON); else SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); @@ -5345,7 +5432,7 @@ void sub_8103028(struct Sprite* sprite) static void sub_81030B0(struct Sprite* sprite) { - if (TranslateAnimLinear(sprite) == 0) + if (AnimTranslateLinear(sprite) == 0) { s16 xDiff; xDiff = Sin(sprite->data[5], 8); diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 244823d13f..8acbf62d4a 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -1257,7 +1257,7 @@ const struct SpriteTemplate gUnknown_08593C64 = void sub_8103448(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[4]; @@ -1339,7 +1339,7 @@ void sub_810358C(struct Sprite *sprite) void sub_8103620(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[4]; @@ -1451,7 +1451,7 @@ void Anim_KinesisZapEnergy(struct Sprite *sprite) // arg 1: y pixel offset void Anim_SwordsDanceBlade(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->callback = RunStoredCallbackWhenAffineAnimEnds; StoreSpriteCallbackInData6(sprite, Anim_SwordsDanceBladeStep); } @@ -1489,7 +1489,7 @@ void AnimSonicBoomProjectile(struct Sprite *sprite) gBattleAnimArgs[3] = -gBattleAnimArgs[3]; } - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); targetXPos = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; targetYPos = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; rotation = ArcTan2Neg(targetXPos - sprite->pos1.x, targetYPos - sprite->pos1.y); @@ -1732,7 +1732,7 @@ void sub_8103CF0(u8 taskId) void sub_8103FE8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4); sprite->callback = sub_8104018; } @@ -1828,7 +1828,7 @@ void sub_8104088(struct Sprite *sprite) s16 r7; u16 var; - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); r6 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); r7 = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -1872,7 +1872,7 @@ static void sub_8104154(struct Sprite *sprite) void sub_81041C4(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = 20; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); @@ -1931,7 +1931,7 @@ static void sub_81042A0(struct Sprite *sprite) // arg 6: duration void Anim_RazorWindTornado(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) sprite->pos1.y += 16; @@ -2009,7 +2009,7 @@ void Anim_GuillotinePincer(struct Sprite *sprite) static void Anim_GuillotinePincerStep1(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite) && sprite->animEnded) + if (AnimTranslateLinear(sprite) && sprite->animEnded) { SeekSpriteAnim(sprite, 0); sprite->animPaused = 1; @@ -2049,7 +2049,7 @@ static void Anim_GuillotinePincerStep2(struct Sprite *sprite) static void Anim_GuillotinePincerStep3(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) DestroyAnimSprite(sprite); } @@ -2318,7 +2318,7 @@ void Anim_BreathPuff(struct Sprite *sprite) sprite->data[3] = 0; sprite->data[4] = 0; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; } // Animates an "angry" mark above a mon's head. @@ -2448,7 +2448,7 @@ void sub_8104E74(u8 taskId) task->data[5] = 0; task->data[15] = sub_80A861C(gBattleAnimTarget, 0); - if (sub_80A8364(gBattleAnimTarget) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimTarget) == 1) { task->data[6] = gBattle_BG1_X; params.dmaDest = (u16 *)REG_ADDR_BG1HOFS; @@ -2628,7 +2628,7 @@ void sub_81051C4(struct Sprite *sprite) void sub_8105284(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { FreeSpriteOamMatrix(sprite); DestroyAnimSprite(sprite); @@ -2736,7 +2736,7 @@ void sub_81054E8(struct Sprite *sprite) void sub_8105538(struct Sprite *sprite) { s16 r1; - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); r1 = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? -160 : 160; sprite->data[0] = 0x380; sprite->data[1] = r1; @@ -3098,7 +3098,7 @@ static void sub_8105D88(struct Sprite *sprite, u8 a, u8 b) void sub_8105DE8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -3113,7 +3113,7 @@ void sub_8105DE8(struct Sprite *sprite) void sub_8105E60(struct Sprite *sprite) { if (++sprite->data[0] == 1) - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->pos2.x = Sin(sprite->data[1], 8); sprite->pos2.y = sprite->data[2] >> 8; @@ -3218,7 +3218,7 @@ void sub_81060B0(u8 taskId) void sub_8106140(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = 95; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -3230,7 +3230,7 @@ void sub_8106140(struct Sprite *sprite) static void sub_810618C(struct Sprite *sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.y += Sin(sprite->data[5], 14); sprite->data[5] = (sprite->data[5] + 4) & 0xFF; @@ -3550,7 +3550,7 @@ static void sub_810699C(struct Sprite *sprite) void sub_81069B8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->callback = sub_810699C; } diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 5f65cb31fb..d887eeabf5 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1225,7 +1225,7 @@ void sub_815A254(struct Sprite *sprite) u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); rotation = ArcTan2Neg(sprite->pos1.x - x, sprite->pos1.y - y); rotation += 0x6000; @@ -1406,7 +1406,7 @@ void sub_815A6C4(struct Sprite *sprite) u16 x; u16 y; - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -1444,7 +1444,7 @@ static void sub_815A76C(struct Sprite *sprite) void sub_815A7B0(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -1458,7 +1458,7 @@ void sub_815A7EC(struct Sprite *sprite) if (sprite->data[0] == 0) { SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); if (!IsContest()) { if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) @@ -1528,7 +1528,7 @@ void sub_815A934(struct Sprite *sprite) SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->oam.objMode = ST_OAM_OBJ_WINDOW; sprite->invisible = 1; @@ -1745,12 +1745,12 @@ void sub_815ADB0(u8 taskId) if (!gBattleAnimArgs[0]) { var0 = GetBattlerYCoordWithElevation(gBattleAnimAttacker); - toBG2 = sub_80A8364(gBattleAnimAttacker); + toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); } else { var0 = GetBattlerYCoordWithElevation(gBattleAnimTarget); - toBG2 = sub_80A8364(gBattleAnimTarget); + toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); } task->data[0] = var0 + 36; @@ -2000,7 +2000,7 @@ static void sub_815B23C(struct Sprite *sprite) void sub_815B27C(struct Sprite *sprite) { if (sprite->data[0] == 0) - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); if (++sprite->data[0] < 40) { @@ -2204,7 +2204,7 @@ void sub_815B70C(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[1] = 0x900; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->data[0]++; @@ -2246,7 +2246,7 @@ void sub_815B7D0(u8 taskId) { case 0: SetGpuReg(REG_OFFSET_MOSAIC, 0); - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 1); else SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 1); @@ -2326,7 +2326,7 @@ void sub_815B7D0(u8 taskId) break; case 4: SetGpuReg(REG_OFFSET_MOSAIC, 0); - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 0); else SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 0); @@ -2666,7 +2666,7 @@ void sub_815C400(struct Sprite *sprite) { if (sprite->data[0] == 0) { - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); sprite->data[0]++; } else if (sprite->data[0]++ > 20) @@ -3064,7 +3064,7 @@ void sub_815CC94(struct Sprite *sprite) SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); sprite->data[0] = gBattleAnimArgs[2]; - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->oam.objMode = ST_OAM_OBJ_WINDOW; sprite->invisible = 1; sprite->callback = sub_815CD0C; @@ -3166,7 +3166,7 @@ void sub_815CED8(u8 taskId) otId = gContestResources->field_18->unkC; species = gContestResources->field_18->unk2; xOffset = 20; - priority = sub_80A8328(gBattleAnimAttacker); + priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } else { @@ -3188,7 +3188,7 @@ void sub_815CED8(u8 taskId) } xOffset = 20; - priority = sub_80A8328(gBattleAnimAttacker); + priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } else { @@ -3208,7 +3208,7 @@ void sub_815CED8(u8 taskId) } xOffset = -20; - priority = sub_80A8328(gBattleAnimAttacker); + priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } } @@ -3290,7 +3290,7 @@ void sub_815D240(u8 taskId) task->data[14] = task->data[13] + 66; task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - if (sub_80A8364(battler) == 1) + if (GetBattlerSpriteBGPriorityRank(battler) == 1) { scanlineParams.dmaDest = ®_BG1HOFS; SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); @@ -3333,7 +3333,7 @@ static void sub_815D398(u8 taskId) s16 var3; task = &gTasks[taskId]; - if (sub_80A8364(task->data[5]) == 1) + if (GetBattlerSpriteBGPriorityRank(task->data[5]) == 1) { bgX = gBattle_BG1_X; bgY = gBattle_BG1_Y; @@ -4009,7 +4009,7 @@ void sub_815E444(struct Sprite *sprite) sprite->data[4] = gBattleAnimArgs[3]; sprite->data[0] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A70C0; + sprite->callback = InitAndRunAnimFastLinearTranslation; } void sub_815E47C(u8 taskId) @@ -4452,7 +4452,7 @@ void sub_815EE84(struct Sprite *sprite) { if (gBattleAnimArgs[0] == 0) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[7] = gBattleAnimAttacker; } else @@ -4463,7 +4463,7 @@ void sub_815EE84(struct Sprite *sprite) if (GetBattlerSide(sprite->data[7]) == B_SIDE_OPPONENT) sprite->oam.matrixNum = 8; - sprite->oam.priority = sub_80A8328(sprite->data[7]); + sprite->oam.priority = GetBattlerSpriteBGPriority(sprite->data[7]); sprite->oam.objMode = ST_OAM_OBJ_BLEND; sprite->callback = sub_815EF08; } @@ -4517,7 +4517,7 @@ static void sub_815EF08(struct Sprite *sprite) sprite->data[5]++; break; case 1: - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { switch (sprite->data[6]) { diff --git a/src/bug.c b/src/bug.c index 535e8946a9..31d1a97405 100644 --- a/src/bug.c +++ b/src/bug.c @@ -252,7 +252,7 @@ void sub_81104E4(struct Sprite *sprite) if (IsContest()) gBattleAnimArgs[2] /= 2; - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; @@ -274,7 +274,7 @@ void sub_81104E4(struct Sprite *sprite) static void sub_811057C(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { DestroyAnimSprite(sprite); return; @@ -389,7 +389,7 @@ void AnimTranslateStinger(struct Sprite *sprite) } } - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); lVarX = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; lVarY = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; @@ -414,7 +414,7 @@ void AnimTranslateStinger(struct Sprite *sprite) // arg 5: wave amplitude void AnimMissileArc(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); if (GetBattlerSide(gBattleAnimAttacker)) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; diff --git a/src/dragon.c b/src/dragon.c index 156d10ce13..68577988ed 100644 --- a/src/dragon.c +++ b/src/dragon.c @@ -251,7 +251,7 @@ void sub_81131B4(struct Sprite *sprite) sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); } - sub_80A6864(sprite, gBattleAnimArgs[1]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[1]); sprite->pos1.y += gBattleAnimArgs[2]; sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); @@ -329,7 +329,7 @@ void sub_81133E8(u8 taskId) struct Task *task = &gTasks[taskId]; u16 i; u8 r1; - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) { sp.dmaDest = ®_BG1HOFS; task->data[2] = gBattle_BG1_X; diff --git a/src/electric.c b/src/electric.c index 5d772e0421..ed495fa593 100644 --- a/src/electric.c +++ b/src/electric.c @@ -556,7 +556,7 @@ static void sub_810A308(struct Sprite *sprite) sprite->pos2.y = (gSineTable[gBattleAnimArgs[0] + 64] * gBattleAnimArgs[1]) >> 8; if (gBattleAnimArgs[6] & 1) - sprite->oam.priority = sub_80A8328(battler) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; matrixNum = sprite->oam.matrixNum; sineVal = gSineTable[gBattleAnimArgs[2]]; @@ -571,7 +571,7 @@ static void sub_810A308(struct Sprite *sprite) static void sub_810A46C(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); @@ -588,7 +588,7 @@ static void sub_810A46C(struct Sprite *sprite) static void sub_810A4F4(struct Sprite *sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[7], sprite->data[5]); sprite->pos2.y += Cos(sprite->data[7], sprite->data[5]); @@ -665,7 +665,7 @@ static void sub_810A6EC(struct Sprite *sprite) static void sub_810A75C(struct Sprite *sprite) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->oam.tileNum += gBattleAnimArgs[3] * 4; if (gBattleAnimArgs[3] == 1) @@ -1073,7 +1073,7 @@ void sub_810AB78(u8 taskId) static void sub_810AC8C(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { gTasks[sprite->data[5]].data[7]--; DestroySprite(sprite); diff --git a/src/fight.c b/src/fight.c index fb1c01b783..b7ca2e87a7 100644 --- a/src/fight.c +++ b/src/fight.c @@ -416,7 +416,7 @@ const struct SpriteTemplate gUnknown_08596104 = void unc_080B08A0(struct Sprite *sprite) { - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[0] = 15; sprite->callback = WaitAnimForDuration; @@ -459,9 +459,9 @@ void AnimBasicFistOrFoot(struct Sprite *sprite) StartSpriteAnim(sprite, gBattleAnimArgs[4]); if (gBattleAnimArgs[3] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->callback = WaitAnimForDuration; @@ -534,7 +534,7 @@ static void sub_810D0B8(struct Sprite *sprite) void sub_810D10C(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = 30; if (gBattleAnimArgs[2] == 0) @@ -574,7 +574,7 @@ void sub_810D1B4(struct Sprite *sprite) if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget && GetBattlerPosition(gBattleAnimTarget) < B_POSITION_PLAYER_RIGHT) gBattleAnimArgs[0] *= -1; - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -596,7 +596,7 @@ void sub_810D1B4(struct Sprite *sprite) static void sub_810D240(struct Sprite *sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.y += Sin(sprite->data[7] >> 8, sprite->data[5]); sprite->data[7] += sprite->data[6]; @@ -615,7 +615,7 @@ static void sub_810D240(struct Sprite *sprite) // arg 3: spin duration void AnimSpinningKickOrPunch(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[2]); sprite->data[0] = gBattleAnimArgs[3]; @@ -639,7 +639,7 @@ static void AnimSpinningKickOrPunchFinish(struct Sprite *sprite) // arg 2: initial wait duration void AnimStompFoot(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->callback = AnimStompFootStep; @@ -670,7 +670,7 @@ void sub_810D37C(struct Sprite *sprite) { if (sprite->data[0] == 0) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; sprite->data[0]++; @@ -800,12 +800,12 @@ void sub_810D608(struct Sprite *sprite) { sprite->pos1.x = GetBattlerSpriteCoord(gBattlerAttacker, 2); sprite->pos1.y = GetBattlerSpriteCoord(gBattlerAttacker, 3); - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); sprite->data[7] = gBattleAnimTarget; } else { - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->data[7] = gBattleAnimAttacker; } @@ -903,12 +903,12 @@ void sub_810D874(struct Sprite *sprite) sprite->pos1.x = GetBattlerSpriteCoord(gBattlerAttacker, 2); sprite->pos1.y = GetBattlerSpriteCoord(gBattlerAttacker, 3); battler = gBattleAnimTarget; - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } else { battler = gBattleAnimAttacker; - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); } if (IsContest()) @@ -965,9 +965,9 @@ void sub_810D984(struct Sprite *sprite) void sub_810DA10(struct Sprite *sprite) { if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); else - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); if (IsContest()) { diff --git a/src/fire.c b/src/fire.c index 18ec7b95ca..2d8a0fbe5c 100644 --- a/src/fire.c +++ b/src/fire.c @@ -472,14 +472,14 @@ static void sub_8108EC8(struct Sprite *sprite) static void sub_8108F08(struct Sprite *sprite) { - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[0] = gBattleAnimArgs[4]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -644,7 +644,7 @@ static void sub_8109200(struct Sprite *sprite) //void AnimFireRing(struct Sprite *sprite) void AnimFireRing(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[7] = gBattleAnimArgs[2]; sprite->data[0] = 0; @@ -672,7 +672,7 @@ static void AnimFireRingStep1(struct Sprite *sprite) static void AnimFireRingStep2(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { sprite->data[0] = 0; @@ -731,7 +731,7 @@ static void AnimFireCross(struct Sprite *sprite) static void sub_81093A4(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[1] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[3]; @@ -1054,7 +1054,7 @@ static void sub_8109AFC(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); StartSpriteAnim(sprite, gBattleAnimArgs[2]); sprite->data[7] = gBattleAnimArgs[2]; @@ -1067,7 +1067,7 @@ static void sub_8109AFC(struct Sprite *sprite) sprite->data[4] = -4; } - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->data[0]++; break; case 1: @@ -1119,7 +1119,7 @@ static void sub_8109C4C(struct Sprite *sprite) s16 initialData5; s16 newData5; - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[5], 16); initialData5 = sprite->data[5]; @@ -1157,9 +1157,9 @@ void sub_8109CB0(struct Sprite *sprite) if (!IsContest()) { if (sprite->data[1] < 64 || sprite->data[1] > 195) - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); else - sprite->oam.priority = sub_80A8328(gBattleAnimTarget) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) + 1; } else { diff --git a/src/ghost.c b/src/ghost.c index d4f6512a85..a755783b77 100644 --- a/src/ghost.c +++ b/src/ghost.c @@ -217,7 +217,7 @@ const struct SpriteTemplate gUnknown_08596E48 = static void sub_811160C(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -235,7 +235,7 @@ static void sub_8111674(struct Sprite *sprite) s16 r0; s16 r2; sub_8111764(sprite); - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { sprite->callback = sub_81116E8; return; @@ -258,7 +258,7 @@ static void sub_81116E8(struct Sprite *sprite) s16 r2; s16 r0; sprite->data[0] = 1; - TranslateAnimLinear(sprite); + AnimTranslateLinear(sprite); sprite->pos2.x += Sin(sprite->data[5], 10); sprite->pos2.y += Cos(sprite->data[5], 15); @@ -313,7 +313,7 @@ static void sub_8111764(struct Sprite *sprite) static void sub_81117F4(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = sub_8111814; sprite->callback(sprite); } @@ -461,7 +461,7 @@ static void AnimShadowBallStep(struct Sprite *sprite) static void sub_8111B9C(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = sub_8111BB4; } @@ -536,7 +536,7 @@ void sub_8111C50(u8 taskId) gSprites[task->data[0]].data[3] = 0; gSprites[task->data[0]].data[4] = 0; StoreSpriteCallbackInData6(&gSprites[task->data[0]], SpriteCallbackDummy); - gSprites[task->data[0]].callback = TranslateAnimLinearSimple; + gSprites[task->data[0]].callback = AnimTranslateLinearSimple; task->func = sub_8111D78; } @@ -590,7 +590,7 @@ static void sub_8111E78(u8 taskId) { s16 startLine; struct Task *task = &gTasks[taskId]; - u8 position = sub_80A8364(gBattleAnimTarget); + u8 position = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); switch (task->data[15]) { @@ -698,7 +698,7 @@ static void sub_81120DC(u8 taskId) static void sub_8112170(u8 taskId) { struct Task *task = &gTasks[taskId]; - u8 position = sub_80A8364(gBattleAnimTarget); + u8 position = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); switch (task->data[15]) { @@ -1026,7 +1026,7 @@ static void sub_81129F0(struct Sprite *sprite) s16 xDelta; s16 xDelta2; - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) { xDelta = 24; @@ -1170,7 +1170,7 @@ void sub_8112C6C(u8 taskId) task->data[10] = GetBattlerYCoordWithElevation(gBattleAnimAttacker); task->data[11] = (sub_80A861C(gBattleAnimAttacker, 1) / 2) + 8; task->data[7] = 0; - task->data[5] = sub_80A8328(gBattleAnimAttacker); + task->data[5] = GetBattlerSpriteBGPriority(gBattleAnimAttacker); task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 2; task->data[3] = 0; task->data[4] = 16; diff --git a/src/ground.c b/src/ground.c index 77acd3919c..807205ad82 100644 --- a/src/ground.c +++ b/src/ground.c @@ -183,7 +183,7 @@ static void AnimBonemerangProjectileEnd(struct Sprite *sprite) // arg 4: duration void AnimBoneHitProjectile(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -205,7 +205,7 @@ void AnimDirtScatter(struct Sprite *sprite) u8 targetXPos, targetYPos; s16 xOffset, yOffset; - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); targetXPos = GetBattlerSpriteCoord2(gBattleAnimTarget, 2); targetYPos = GetBattlerSpriteCoord2(gBattleAnimTarget, 3); @@ -306,7 +306,7 @@ static void sub_8114CFC(u8 taskId) { case 0: task->data[10] = GetAnimBattlerSpriteId(0); - task->data[11] = sub_80A8364(gBattleAnimAttacker); + task->data[11] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); if (task->data[11] == 1) { task->data[12] = gBattle_BG1_X; @@ -375,7 +375,7 @@ static void sub_8114EB4(u8 taskId) gSprites[spriteId].pos2.x = 0; gSprites[spriteId].pos2.y = 0; - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) gBattle_BG1_Y = 0; else gBattle_BG2_Y = 0; @@ -422,7 +422,7 @@ static void sub_8114FD8(u8 taskId) { case 0: task->data[10] = GetAnimBattlerSpriteId(0); - task->data[11] = sub_80A8364(gBattleAnimAttacker); + task->data[11] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); if (task->data[11] == 1) task->data[12] = gBattle_BG1_X; else diff --git a/src/normal.c b/src/normal.c index e20f745888..95c99d29e8 100644 --- a/src/normal.c +++ b/src/normal.c @@ -880,9 +880,9 @@ void sub_8116388(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = RunStoredCallbackWhenAffineAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -892,9 +892,9 @@ static void sub_81163D0(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[4]; sprite->callback = RunStoredCallbackWhenAffineAnimEnds; @@ -916,9 +916,9 @@ void sub_8116458(struct Sprite *sprite) StartSpriteAffineAnim(sprite, gBattleAnimArgs[1]); if (gBattleAnimArgs[0] == 0) - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); else - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->pos2.x += (Random2() % 48) - 24; sprite->pos2.y += (Random2() % 24) - 12; @@ -942,9 +942,9 @@ void sub_81164F0(struct Sprite *sprite) void sub_8116560(struct Sprite *sprite) { if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -955,9 +955,9 @@ void sub_81165A8(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = sub_81165E4; } diff --git a/src/poison.c b/src/poison.c index c52299e3a7..a72aab1116 100644 --- a/src/poison.c +++ b/src/poison.c @@ -194,7 +194,7 @@ void sub_810DBAC(struct Sprite *sprite) if (!gBattleAnimArgs[3]) StartSpriteAnim(sprite, 2); - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -218,7 +218,7 @@ void sub_810DC2C(struct Sprite *sprite) if (!gBattleAnimArgs[3]) StartSpriteAnim(sprite, 2); - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); SetAverageBattlerPositions(gBattleAnimTarget, 1, &l1, &l2); if (GetBattlerSide(gBattleAnimAttacker)) @@ -258,7 +258,7 @@ void sub_810DCD0(struct Sprite *sprite) static void sub_810DD24(struct Sprite *sprite) { - TranslateAnimLinearSimple(sprite); + AnimTranslateLinearSimple(sprite); sprite->data[1] -= sprite->data[5]; sprite->data[2] -= sprite->data[6]; @@ -295,7 +295,7 @@ void AnimBubbleEffect(struct Sprite *sprite) { if (!gBattleAnimArgs[2]) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); } else { diff --git a/src/pokeball.c b/src/pokeball.c index 82d2f2ceab..aa29b020f4 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -922,7 +922,7 @@ static void SpriteCB_PlayerMonSendOut_2(struct Sprite *sprite) StartSpriteAffineAnim(sprite, 4); } r4 = sprite->data[0]; - TranslateAnimLinear(sprite); + AnimTranslateLinear(sprite); sprite->data[7] += sprite->sBattler / 3; sprite->pos2.y += Sin(HIBYTE(sprite->data[7]), sprite->data[5]); sprite->oam.affineParam += 0x100; diff --git a/src/rock.c b/src/rock.c index 20d4ea7386..ff3840fb35 100644 --- a/src/rock.c +++ b/src/rock.c @@ -367,16 +367,16 @@ void sub_8110AB4(struct Sprite *sprite) sprite->data[3] = 0; sprite->data[4] = 0; - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } void sub_8110B38(struct Sprite *sprite) { if (gBattleAnimArgs[6] == 0) - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); else - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[2]; @@ -555,7 +555,7 @@ void AnimDirtParticleAcrossScreen(struct Sprite *sprite) void AnimRaiseSprite(struct Sprite *sprite) { StartSpriteAnim(sprite, gBattleAnimArgs[4]); - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[2] = sprite->pos1.x; diff --git a/src/water.c b/src/water.c index fd31b324a0..42ab1d67fe 100644 --- a/src/water.c +++ b/src/water.c @@ -563,7 +563,7 @@ void sub_8107380(struct Sprite *sprite) u16 trigIndex = gSprites[otherSpriteId].data[3]; sprite->data[0] = 1; - TranslateAnimLinear(sprite); + AnimTranslateLinear(sprite); sprite->pos2.x += Sin(trigIndex >> 8, gSprites[otherSpriteId].data[0]); sprite->pos2.y += Cos(trigIndex >> 8, gSprites[otherSpriteId].data[1]); gSprites[otherSpriteId].data[3] = trigIndex + gSprites[otherSpriteId].data[2]; @@ -596,7 +596,7 @@ void sub_810744C(struct Sprite *sprite) { s16 unkArg; - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) unkArg = -gBattleAnimArgs[2]; else @@ -619,7 +619,7 @@ void sub_81074E4(struct Sprite *sprite) StartSpriteAnim(sprite, 1); sprite->affineAnimPaused = FALSE; } - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) DestroyAnimSprite(sprite); } @@ -727,7 +727,7 @@ void sub_81075EC(struct Sprite *sprite) { u16 retArg; - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = 30; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -752,7 +752,7 @@ void sub_81075EC(struct Sprite *sprite) void sub_8107674(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) DestroyAnimSprite(sprite); sprite->pos2.y += Sin(sprite->data[6] >> 8, sprite->data[7]); if ((sprite->data[6] + sprite->data[5]) >> 8 > 127) @@ -833,7 +833,7 @@ void sub_81077C0(struct Sprite *sprite) coordType = 3; else coordType = 1; - InitAnimSpritePos(sprite, animType); + InitSpritePosToAnimAttacker(sprite, animType); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; @@ -845,7 +845,7 @@ void sub_81077C0(struct Sprite *sprite) void sub_8107894(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[2]; sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[4]; @@ -856,9 +856,9 @@ void sub_8107894(struct Sprite *sprite) void sub_81078D0(struct Sprite *sprite) { if (gBattleAnimArgs[3]) - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); else - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[7] = gBattleAnimArgs[2]; sprite->callback = sub_810790C; } @@ -1887,7 +1887,7 @@ void sub_8108034(struct Sprite *sprite) s16 randData2; sprite->oam.tileNum += 8; - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); randData = (Random2() & 0xFF) | 256; randData2 = (Random2() & 0x1FF); if (randData2 > 255) @@ -2387,7 +2387,7 @@ void sub_8108C54(struct Sprite *sprite) void sub_8108C94(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->data[3] = gBattleAnimArgs[2];