diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index 6ccd8d505..32d9de82c 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -153,19 +153,19 @@ .byte \param4 .endm - .macro loopsewithpan se:req, param1:req, param2:req, param3:req + .macro loopsewithpan se:req, pan:req, wait:req, times:req .byte 0x1c .2byte \se - .byte \param1 - .byte \param2 - .byte \param3 + .byte \pan + .byte \wait + .byte \times .endm - .macro waitplaysewithpan se:req, param1:req, param2:req + .macro waitplaysewithpan se:req, pan:req, wait:req .byte 0x1d .2byte \se - .byte \param1 - .byte \param2 + .byte \pan + .byte \wait .endm .macro setbldcnt param0:req diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index e7a7e89b6..5a19061d0 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1515,7 +1515,7 @@ Move_VINE_WHIP: createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 6 delay 6 playsewithpan SE_W010, SOUND_PAN_TARGET - createsprite gUnknown_085928E8, ANIM_TARGET, 2, 0, 0 + createsprite gVineWhipSpriteTemplate, ANIM_TARGET, 2, 0, 0 delay 6 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 6, 1 end @@ -1656,12 +1656,12 @@ Explosion1: Move_DEFENSE_CURL: loadspritegfx ANIM_TAG_ECLIPSING_ORB loopsewithpan SE_W161, SOUND_PAN_ATTACKER, 18, 3 - createvisualtask sub_811489C, 5, 0, 0 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 0 createvisualtask sub_815B338, 5 waitforvisualfinish createsprite gUnknown_085CE338, ANIM_ATTACKER, 2, 0, 6, 0, 1 waitforvisualfinish - createvisualtask sub_811489C, 5, 0, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 1 waitforvisualfinish end @@ -2003,7 +2003,7 @@ Move_ATTRACT: createsprite gBattleAnimSpriteTemplate_85939B8, ANIM_TARGET, 3, -384, -31 waitforvisualfinish waitplaysewithpan SE_W213B, 0, 15 - createvisualtask sub_81062E8, 5 + createvisualtask AnimTask_HeartsBackground, 5 createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 16, 256, 0 createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 224, 240, 15 createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 126, 272, 30 @@ -2012,7 +2012,7 @@ Move_ATTRACT: createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 40, 256, 75 createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 112, 256, 90 createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 200, 272, 90 - delay 0x4B + delay 75 createvisualtask sub_8115A04, 2, 4, 4, 4, 0, 10, RGB(31, 25, 27) end @@ -3220,13 +3220,13 @@ EndureEffect: Move_CHARM: loadspritegfx ANIM_TAG_MAGENTA_HEART createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 0, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 0, 20 playsewithpan SE_W204, SOUND_PAN_ATTACKER delay 15 - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, -20, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, -20, 20 playsewithpan SE_W204, SOUND_PAN_ATTACKER delay 15 - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 20, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 20, 20 playsewithpan SE_W204, SOUND_PAN_ATTACKER waitforvisualfinish end @@ -4358,7 +4358,7 @@ Move_AERIAL_ACE: Move_IRON_DEFENSE: loopsewithpan SE_REAPOKE, SOUND_PAN_ATTACKER, 28, 2 - createvisualtask sub_81144F8, 5, 0, 0, 0 + createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0 createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 8, 2, RGB_WHITEALPHA, 14, -1, 0 waitforvisualfinish end @@ -4393,13 +4393,13 @@ Move_COVET: loadspritegfx ANIM_TAG_MAGENTA_HEART loadspritegfx ANIM_TAG_ITEM_BAG createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 0, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 0, 20 playsewithpan SE_W204, SOUND_PAN_ATTACKER delay 15 - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, -20, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, -20, 20 playsewithpan SE_W204, SOUND_PAN_ATTACKER delay 15 - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 20, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 20, 20 playsewithpan SE_W204, SOUND_PAN_ATTACKER waitforvisualfinish createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1 @@ -4570,7 +4570,7 @@ Move_SHOCK_WAVE: Move_HARDEN: loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2 - createvisualtask sub_81144F8, 5, 0, 0, 0 + createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0 waitforvisualfinish end @@ -7213,7 +7213,7 @@ Move_STEEL_WING: loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_IMPACT loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2 - createvisualtask sub_81144F8, 5, 0, 0, 0 + createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0 waitforvisualfinish monbg ANIM_DEF_PARTNER monbgprio_28 ANIM_TARGET @@ -7239,7 +7239,7 @@ Move_STEEL_WING: Move_IRON_TAIL: loadspritegfx ANIM_TAG_IMPACT loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2 - createvisualtask sub_81144F8, 5, 1, 0, 0 + createvisualtask AnimTask_MetallicShine, 5, 1, 0, 0 waitforvisualfinish monbg ANIM_TARGET setalpha 12, 8 @@ -7249,7 +7249,7 @@ Move_IRON_TAIL: createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_W233B, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask sub_811489C, 5, 0, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 1 clearmonbg ANIM_TARGET blendoff waitforvisualfinish @@ -7259,7 +7259,7 @@ Move_POISON_TAIL: loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_POISON_BUBBLE loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2 - createvisualtask sub_81144F8, 5, 1, 1, RGB(24, 6, 23) + createvisualtask AnimTask_MetallicShine, 5, 1, 1, RGB(24, 6, 23) waitforvisualfinish monbg ANIM_TARGET setalpha 12, 8 @@ -7269,7 +7269,7 @@ Move_POISON_TAIL: createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_W233B, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask sub_811489C, 5, 0, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 1 clearmonbg ANIM_TARGET blendoff call PoisonBubblesEffect @@ -7279,7 +7279,7 @@ Move_POISON_TAIL: Move_METAL_CLAW: loadspritegfx ANIM_TAG_CLAW_SLASH loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2 - createvisualtask sub_81144F8, 5, 0, 0, 0 + createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0 waitforvisualfinish createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 6, 4 delay 2 @@ -7459,7 +7459,7 @@ Move_STRING_SHOT: end StringShot1: - createsprite gUnknown_085969E0, ANIM_TARGET, 2, 20, 0, 512, 20, 1 + createsprite gWebThreadSpriteTemplate, ANIM_TARGET, 2, 20, 0, 512, 20, 1 delay 1 return @@ -7488,7 +7488,7 @@ Move_SPIDER_WEB: call SpiderWeb1 waitforvisualfinish playsewithpan SE_W081B, SOUND_PAN_TARGET - createsprite gUnknown_08596A2C, ANIM_ATTACKER, 2 + createsprite gSpiderWebSpriteTemplate, ANIM_ATTACKER, 2 waitforvisualfinish clearmonbg ANIM_DEF_PARTNER delay 1 @@ -7496,7 +7496,7 @@ Move_SPIDER_WEB: end SpiderWeb1: - createsprite gUnknown_085969E0, ANIM_TARGET, 2, 20, 0, 512, 20, 0 + createsprite gWebThreadSpriteTemplate, ANIM_TARGET, 2, 20, 0, 512, 20, 0 delay 1 return @@ -7941,16 +7941,16 @@ Move_PERISH_SONG: panse_1B SE_W195, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 delay 80 createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 16, RGB_BLACK - createvisualtask sub_811489C, 5, 4, 0 - createvisualtask sub_811489C, 5, 5, 0 - createvisualtask sub_811489C, 5, 6, 0 - createvisualtask sub_811489C, 5, 7, 0 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 4, 0 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 5, 0 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 6, 0 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 7, 0 delay 100 createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_BLACK - createvisualtask sub_811489C, 5, 4, 1 - createvisualtask sub_811489C, 5, 5, 1 - createvisualtask sub_811489C, 5, 6, 1 - createvisualtask sub_811489C, 5, 7, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 4, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 5, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 6, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 7, 1 waitforvisualfinish end @@ -9570,7 +9570,7 @@ Move_DOOM_DESIRE: createvisualtask sub_8114960, 2 delay 1 monbg ANIM_ATK_PARTNER - createvisualtask sub_811489C, 5, 1, 0 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_TARGET, 0 createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB_BLACK waitforvisualfinish setalpha 8, 8 @@ -9578,7 +9578,7 @@ Move_DOOM_DESIRE: createvisualtask AnimTask_ScaleMonAndRestore, 5, -4, -4, 15, ANIM_ATTACKER, 1 waitforvisualfinish delay 20 - createvisualtask sub_811489C, 5, 1, 1 + createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_TARGET, 1 createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_ATK_PARTNER @@ -10237,13 +10237,13 @@ Burn1: Status_Infatuation: loadspritegfx ANIM_TAG_MAGENTA_HEART playsewithpan SE_W204, SOUND_PAN_ATTACKER - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 0, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 0, 20 delay 15 playsewithpan SE_W204, SOUND_PAN_ATTACKER - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, -20, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, -20, 20 delay 15 playsewithpan SE_W204, SOUND_PAN_ATTACKER - createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 20, 20 + createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 20, 20 end Status_Sleep: diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index f14e502f3..af4bc19ec 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -1093,7 +1093,7 @@ const struct SpriteTemplate gUnknown_085928D0 = .callback = sub_8100A50, }; -const struct SpriteTemplate gUnknown_085928E8 = +const struct SpriteTemplate gVineWhipSpriteTemplate = { .tileTag = ANIM_TAG_WHIP_HIT, .paletteTag = ANIM_TAG_WHIP_HIT, @@ -2336,7 +2336,7 @@ void AnimHyperBeamOrb(struct Sprite* sprite) { u16 speed; u16 animNum = Random2(); - + StartSpriteAnim(sprite, animNum % 8); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); @@ -2660,7 +2660,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite) s16 a = sprite->data[0]; s16 b = sprite->data[7]; s16 r0; - + sprite->data[0] = 1; TranslateAnimHorizontalArc(sprite); r0 = sprite->data[7]; @@ -2675,7 +2675,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite) if (sprite->oam.affineParam == 30) destroy = TRUE; } - + if (sprite->pos1.x + sprite->pos2.x > 256 || sprite->pos1.x + sprite->pos2.x < -16 || sprite->pos1.y + sprite->pos2.y > 160 @@ -3748,7 +3748,7 @@ void sub_81009F8(struct Sprite* sprite) void sub_8100A50(struct Sprite* sprite) { - if (GetBattlerSide(gBattleAnimAttacker) == 0) + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) StartSpriteAnim(sprite, 1); sprite->callback = sub_81009DC; @@ -3770,7 +3770,7 @@ void sub_8100A94(struct Sprite* sprite) } // Moves the sprite in a diagonally slashing motion across the target mon. -// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE. +// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE. // arg 0: initial x pixel offset // arg 1: initial y pixel offset // arg 2: slice direction; 0 = right-to-left, 1 = left-to-right @@ -5350,10 +5350,10 @@ static void sub_8102DE4(struct Sprite* sprite) void sub_8102EB0(struct Sprite* sprite) { - int a; + int a; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) { - a = gBattleAnimArgs[1]; + a = gBattleAnimArgs[1]; (u16)gBattleAnimArgs[1] = -a; } diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 80b3258b4..e3295acb8 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -889,7 +889,7 @@ const struct SpriteTemplate gUnknown_08593958 = .callback = sub_8105DE8, }; -const struct SpriteTemplate gUnknown_08593970 = +const struct SpriteTemplate gMagentaHeartSpriteTemplate = { .tileTag = ANIM_TAG_MAGENTA_HEART, .paletteTag = ANIM_TAG_MAGENTA_HEART, @@ -3286,7 +3286,7 @@ static void sub_810627C(struct Sprite *sprite) } } -void sub_81062E8(u8 taskId) +void AnimTask_HeartsBackground(u8 taskId) { struct BattleAnimBgData animBg; diff --git a/src/bug.c b/src/bug.c index 88f93a3d5..4fa6a5bb6 100644 --- a/src/bug.c +++ b/src/bug.c @@ -6,7 +6,7 @@ void sub_8110368(struct Sprite *); void sub_8110438(struct Sprite *); -void sub_81104E4(struct Sprite *); +void AnimTranslateWebThread(struct Sprite *); void sub_81105B4(struct Sprite *); void sub_811067C(struct Sprite *); void AnimTranslateStinger(struct Sprite *); @@ -90,7 +90,7 @@ const struct SpriteTemplate gUnknown_085969C8 = .callback = sub_8110438, }; -const struct SpriteTemplate gUnknown_085969E0 = +const struct SpriteTemplate gWebThreadSpriteTemplate = { .tileTag = ANIM_TAG_WEB_THREAD, .paletteTag = ANIM_TAG_WEB_THREAD, @@ -98,7 +98,7 @@ const struct SpriteTemplate gUnknown_085969E0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81104E4, + .callback = AnimTranslateWebThread, }; const struct SpriteTemplate gUnknown_085969F8 = @@ -124,7 +124,7 @@ const union AffineAnimCmd *const gUnknown_08596A28[] = gUnknown_08596A10, }; -const struct SpriteTemplate gUnknown_08596A2C = +const struct SpriteTemplate gSpiderWebSpriteTemplate = { .tileTag = ANIM_TAG_SPIDER_WEB, .paletteTag = ANIM_TAG_SPIDER_WEB, @@ -247,12 +247,19 @@ void sub_8110438(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_81104E4(struct Sprite *sprite) +// Creates a single web thread that travels from attacker to target. +// Used by MOVE_STRING_SHOT and MOVE_SPIDER_WEB in their first move phase. +// arg 0: x +// arg 1: y +// arg 2: controls the left-to-right movement +// arg 3: amplitude +// arg 4: if targets both opponents +void AnimTranslateWebThread(struct Sprite *sprite) { if (IsContest()) gBattleAnimArgs[2] /= 2; - InitSpritePosToAnimAttacker(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; diff --git a/src/dark.c b/src/dark.c index 80ce61800..482c09c04 100644 --- a/src/dark.c +++ b/src/dark.c @@ -803,17 +803,23 @@ void sub_81144BC(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_81144F8(u8 taskId) +// Makes the attacker metallic and shining. +// Used by MOVE_HARDEN and MOVE_IRON_DEFENSE. +// arg0: if true won't change battler's palette back +// arg1: if true, use custom color +// arg2: custom color +// Custom color argument is used in MOVE_POISON_TAIL to make the mon turn purplish/pinkish as if became cloaked in poison. +void AnimTask_MetallicShine(u8 taskId) { u16 species; u8 spriteId; u8 newSpriteId; u16 paletteNum; struct BattleAnimBgData animBg; - int var0 = 0; + bool32 priorityChanged = FALSE; - gBattle_WIN0H = var0; - gBattle_WIN0V = var0; + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG0 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); @@ -832,7 +838,7 @@ void sub_81144F8(u8 taskId) { gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority--; SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); - var0 = 1; + priorityChanged = TRUE; } } } @@ -861,7 +867,7 @@ void sub_81144F8(u8 taskId) gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32; paletteNum = 16 + gSprites[spriteId].oam.paletteNum; - if (gBattleAnimArgs[1] == 0) + if (gBattleAnimArgs[1] == 0) SetGreyscaleOrOriginalPalette(paletteNum, FALSE); else BlendPalette(paletteNum * 16, 16, 11, gBattleAnimArgs[2]); @@ -870,7 +876,7 @@ void sub_81144F8(u8 taskId) gTasks[taskId].data[1] = gBattleAnimArgs[0]; gTasks[taskId].data[2] = gBattleAnimArgs[1]; gTasks[taskId].data[3] = gBattleAnimArgs[2]; - gTasks[taskId].data[6] = var0; + gTasks[taskId].data[6] = priorityChanged; gTasks[taskId].func = sub_8114748; } @@ -879,29 +885,28 @@ static void sub_8114748(u8 taskId) struct BattleAnimBgData animBg; u16 paletteNum; u8 spriteId; - u8 taskIdCopy = taskId; - gTasks[taskIdCopy].data[10] += 4; + gTasks[taskId].data[10] += 4; gBattle_BG1_X -= 4; - if (gTasks[taskIdCopy].data[10] == 128) + if (gTasks[taskId].data[10] == 128) { - gTasks[taskIdCopy].data[10] = 0; + gTasks[taskId].data[10] = 0; gBattle_BG1_X += 128; - gTasks[taskIdCopy].data[11]++; - if (gTasks[taskIdCopy].data[11] == 2) + gTasks[taskId].data[11]++; + if (gTasks[taskId].data[11] == 2) { spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); paletteNum = 16 + gSprites[spriteId].oam.paletteNum; - if (gTasks[taskIdCopy].data[1] == 0) + if (gTasks[taskId].data[1] == 0) SetGreyscaleOrOriginalPalette(paletteNum, 1); - DestroySprite(&gSprites[gTasks[taskIdCopy].data[0]]); + DestroySprite(&gSprites[gTasks[taskId].data[0]]); sub_80A6B30(&animBg); sub_80A6C68(animBg.bgId); - if (gTasks[taskIdCopy].data[6] == 1) + if (gTasks[taskId].data[6] == 1) gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++; } - else if (gTasks[taskIdCopy].data[11] == 3) + else if (gTasks[taskId].data[11] == 3) { gBattle_WIN0H = 0; gBattle_WIN0V = 0; @@ -918,7 +923,10 @@ static void sub_8114748(u8 taskId) } } -void sub_811489C(u8 taskId) +// Changes battler's palette to either greyscale or original. +// arg0: which battler +// arg1: 0 grayscale, 1 original +void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId) { u8 spriteId; u8 battler;