sprite data fields to array

This commit is contained in:
DizzyEggg 2017-12-02 21:44:50 +01:00
parent 2fe25da65a
commit ce6e97fa0b
24 changed files with 759 additions and 766 deletions

View File

@ -1620,7 +1620,7 @@ void CB2_QuitRecordedBattle(void)
void sub_8038528(struct Sprite* sprite)
{
sprite->data0 = 0;
sprite->data[0] = 0;
sprite->callback = sub_8038538;
}
@ -1628,42 +1628,42 @@ static void sub_8038538(struct Sprite *sprite)
{
u16 *arr = (u16*)(gDecompressionBuffer);
switch (sprite->data0)
switch (sprite->data[0])
{
case 0:
sprite->data0++;
sprite->data1 = 0;
sprite->data2 = 0x281;
sprite->data3 = 0;
sprite->data4 = 1;
sprite->data[0]++;
sprite->data[1] = 0;
sprite->data[2] = 0x281;
sprite->data[3] = 0;
sprite->data[4] = 1;
// fall through
case 1:
sprite->data4--;
if (sprite->data4 == 0)
sprite->data[4]--;
if (sprite->data[4] == 0)
{
s32 i;
s32 r2;
s32 r0;
sprite->data4 = 2;
r2 = sprite->data1 + sprite->data3 * 32;
r0 = sprite->data2 - sprite->data3 * 32;
sprite->data[4] = 2;
r2 = sprite->data[1] + sprite->data[3] * 32;
r0 = sprite->data[2] - sprite->data[3] * 32;
for (i = 0; i < 29; i += 2)
{
arr[r2 + i] = 0x3D;
arr[r0 + i] = 0x3D;
}
sprite->data3++;
if (sprite->data3 == 21)
sprite->data[3]++;
if (sprite->data[3] == 21)
{
sprite->data0++;
sprite->data1 = 32;
sprite->data[0]++;
sprite->data[1] = 32;
}
}
break;
case 2:
sprite->data1--;
if (sprite->data1 == 20)
sprite->data[1]--;
if (sprite->data[1] == 20)
SetMainCallback2(CB2_InitBattle);
break;
}
@ -1824,12 +1824,12 @@ void nullsub_17(void)
static void sub_8038B04(struct Sprite *sprite)
{
if (sprite->data0 != 0)
sprite->pos1.x = sprite->data1 + ((sprite->data2 & 0xFF00) >> 8);
if (sprite->data[0] != 0)
sprite->pos1.x = sprite->data[1] + ((sprite->data[2] & 0xFF00) >> 8);
else
sprite->pos1.x = sprite->data1 - ((sprite->data2 & 0xFF00) >> 8);
sprite->pos1.x = sprite->data[1] - ((sprite->data[2] & 0xFF00) >> 8);
sprite->data2 += 0x180;
sprite->data[2] += 0x180;
if (sprite->affineAnimEnded)
{
@ -2382,8 +2382,8 @@ u32 sub_80397C4(u32 setId, u32 tableId)
return gUnknown_0831ABA0[setId][tableId].width * 8;
}
#define tBank data0
#define tSpeciesId data2
#define tBank data[0]
#define tSpeciesId data[2]
void oac_poke_opponent(struct Sprite *sprite)
{
@ -2431,20 +2431,20 @@ void SpriteCallbackDummy_2(struct Sprite *sprite)
static void sub_80398BC(struct Sprite *sprite) // unused?
{
sprite->data3 = 6;
sprite->data4 = 1;
sprite->data[3] = 6;
sprite->data[4] = 1;
sprite->callback = sub_80398D0;
}
static void sub_80398D0(struct Sprite *sprite)
{
sprite->data4--;
if (sprite->data4 == 0)
sprite->data[4]--;
if (sprite->data[4] == 0)
{
sprite->data4 = 8;
sprite->data[4] = 8;
sprite->invisible ^= 1;
sprite->data3--;
if (sprite->data3 == 0)
sprite->data[3]--;
if (sprite->data[3] == 0)
{
sprite->invisible = FALSE;
sprite->callback = SpriteCallbackDummy_2;
@ -2495,8 +2495,8 @@ void sub_8039934(struct Sprite *sprite)
yOffset = gMonFrontPicCoords[species].y_offset;
}
sprite->data3 = 8 - yOffset / 8;
sprite->data4 = 1;
sprite->data[3] = 8 - yOffset / 8;
sprite->data[4] = 1;
sprite->callback = sub_8039A48;
}
@ -2504,20 +2504,20 @@ static void sub_8039A48(struct Sprite *sprite)
{
s32 i;
sprite->data4--;
if (sprite->data4 == 0)
sprite->data[4]--;
if (sprite->data[4] == 0)
{
sprite->data4 = 2;
sprite->data[4] = 2;
sprite->pos2.y += 8;
sprite->data3--;
if (sprite->data3 < 0)
sprite->data[3]--;
if (sprite->data[3] < 0)
{
FreeSpriteOamMatrix(sprite);
DestroySprite(sprite);
}
else
{
u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankIdentity(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data3 << 8);
u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankIdentity(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data[3] << 8);
for (i = 0; i < 0x100; i++)
*(dst++) = 0;
@ -2529,25 +2529,25 @@ static void sub_8039A48(struct Sprite *sprite)
void sub_8039AD8(struct Sprite *sprite)
{
sprite->data3 = 8;
sprite->data4 = sprite->invisible;
sprite->data[3] = 8;
sprite->data[4] = sprite->invisible;
sprite->callback = sub_8039AF4;
}
static void sub_8039AF4(struct Sprite *sprite)
{
sprite->data3--;
if (sprite->data3 == 0)
sprite->data[3]--;
if (sprite->data[3] == 0)
{
sprite->invisible ^= 1;
sprite->data3 = 8;
sprite->data[3] = 8;
}
}
void sub_8039B2C(struct Sprite *sprite)
{
sprite->invisible = sprite->data4;
sprite->data4 = FALSE;
sprite->invisible = sprite->data[4];
sprite->data[4] = FALSE;
sprite->callback = SpriteCallbackDummy_2;
}
@ -2577,7 +2577,7 @@ static void oac_poke_ally_(struct Sprite *sprite)
if (sprite->pos2.x == 0)
{
sprite->callback = SpriteCallbackDummy_3;
sprite->data1 = 0;
sprite->data[1] = 0;
}
}
}
@ -2595,8 +2595,8 @@ void sub_8039C00(struct Sprite *sprite)
{
if (!(gUnknown_020243FC & 1))
{
sprite->pos2.x += sprite->data1;
sprite->pos2.y += sprite->data2;
sprite->pos2.x += sprite->data[1];
sprite->pos2.y += sprite->data[2];
}
}
@ -2622,19 +2622,19 @@ void dp11b_obj_instanciate(u8 bank, u8 b, s8 c, s8 d)
spriteId2 = gHealthBoxesIds[bank];
gBattleSpritesDataPtr->healthBoxesData[bank].field_2 = bounceHealthBoxSpriteId;
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2 = 1;
gSprites[bounceHealthBoxSpriteId].data0 = 0x80;
gSprites[bounceHealthBoxSpriteId].data[0] = 0x80;
}
else
{
spriteId2 = gBankSpriteIds[bank];
gBattleSpritesDataPtr->healthBoxesData[bank].field_3 = bounceHealthBoxSpriteId;
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4 = 1;
gSprites[bounceHealthBoxSpriteId].data0 = 0xC0;
gSprites[bounceHealthBoxSpriteId].data[0] = 0xC0;
}
gSprites[bounceHealthBoxSpriteId].data1 = c;
gSprites[bounceHealthBoxSpriteId].data2 = d;
gSprites[bounceHealthBoxSpriteId].data3 = spriteId2;
gSprites[bounceHealthBoxSpriteId].data4 = b;
gSprites[bounceHealthBoxSpriteId].data[1] = c;
gSprites[bounceHealthBoxSpriteId].data[2] = d;
gSprites[bounceHealthBoxSpriteId].data[3] = spriteId2;
gSprites[bounceHealthBoxSpriteId].data[4] = b;
gSprites[spriteId2].pos2.x = 0;
gSprites[spriteId2].pos2.y = 0;
}
@ -2648,7 +2648,7 @@ void dp11b_obj_free(u8 bank, bool8 b)
if (!gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2)
return;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2].data3;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2].data[3];
DestroySprite(&gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2]);
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2 = 0;
}
@ -2657,7 +2657,7 @@ void dp11b_obj_free(u8 bank, bool8 b)
if (!gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4)
return;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3].data3;
r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3].data[3];
DestroySprite(&gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3]);
gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4 = 0;
}
@ -2667,16 +2667,16 @@ void dp11b_obj_free(u8 bank, bool8 b)
static void SpriteCB_HealthBoxBounce(struct Sprite *sprite)
{
u8 spriteId = sprite->data3;
u8 spriteId = sprite->data[3];
s32 var;
if (sprite->data4 == 1)
var = sprite->data0;
if (sprite->data[4] == 1)
var = sprite->data[0];
else
var = sprite->data0;
var = sprite->data[0];
gSprites[spriteId].pos2.y = Sin(var, sprite->data2) + sprite->data2;
sprite->data0 = (sprite->data0 + sprite->data1) & 0xFF;
gSprites[spriteId].pos2.y = Sin(var, sprite->data[2]) + sprite->data[2];
sprite->data[0] = (sprite->data[0] + sprite->data[1]) & 0xFF;
}
void sub_8039E44(struct Sprite *sprite)

View File

@ -465,18 +465,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
LinkOpponentBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -1168,7 +1168,7 @@ static void LinkOpponentHandleLoadMonSprite(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
@ -1201,11 +1201,11 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit)
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1213,7 +1213,7 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
}
static void LinkOpponentHandleReturnMonToBall(void)
@ -1334,7 +1334,7 @@ static void LinkOpponentHandleDrawTrainerPic(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1357,7 +1357,7 @@ static void LinkOpponentHandleTrainerSlide(void)
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96;
gSprites[gBankSpriteIds[gActiveBank]].pos1.x += 32;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1369,9 +1369,9 @@ static void LinkOpponentHandleTrainerSlide(void)
static void LinkOpponentHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_8064470;
@ -1670,7 +1670,7 @@ static void LinkOpponentHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1731,9 +1731,9 @@ static void LinkOpponentHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_80676FC);

View File

@ -352,18 +352,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
LinkPartnerBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -1053,7 +1053,7 @@ static void LinkPartnerHandleLoadMonSprite(void)
GetBankSpriteDefault_Y(gActiveBank),
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
gBattleBankFunc[gActiveBank] = sub_814B290;
@ -1084,11 +1084,11 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit)
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1096,7 +1096,7 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void LinkPartnerHandleReturnMonToBall(void)
@ -1174,7 +1174,7 @@ static void LinkPartnerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy;
@ -1188,9 +1188,9 @@ static void LinkPartnerHandleTrainerSlide(void)
static void LinkPartnerHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_814AF54;
@ -1211,8 +1211,8 @@ static void LinkPartnerHandleFaintAnimation(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0;
HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 5;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00;
gBattleBankFunc[gActiveBank] = sub_814B340;
}
@ -1492,7 +1492,7 @@ static void LinkPartnerHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1554,11 +1554,11 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);

View File

@ -453,18 +453,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
OpponentBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -1156,8 +1156,8 @@ static void OpponentHandleLoadMonSprite(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data2 = species;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = species;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
@ -1190,11 +1190,11 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit)
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
@ -1203,7 +1203,7 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
}
static void OpponentHandleReturnMonToBall(void)
@ -1321,7 +1321,7 @@ static void OpponentHandleDrawTrainerPic(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1391,7 +1391,7 @@ static void OpponentHandleTrainerSlide(void)
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96;
gSprites[gBankSpriteIds[gActiveBank]].pos1.x += 32;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1402,9 +1402,9 @@ static void OpponentHandleTrainerSlide(void)
static void OpponentHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_805F240;
@ -1815,7 +1815,7 @@ static void OpponentHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1876,9 +1876,9 @@ static void OpponentHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_806280C);

View File

@ -1431,18 +1431,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
PlayerBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -2241,11 +2241,11 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit)
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -2253,7 +2253,7 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void PlayerHandleReturnMonToBall(void)
@ -2358,7 +2358,7 @@ static void PlayerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].pos2.y = 48;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gSprites[gBankSpriteIds[gActiveBank]].oam.affineMode = 0;
gSprites[gBankSpriteIds[gActiveBank]].hFlip = 1;
@ -2372,7 +2372,7 @@ static void PlayerHandleDrawTrainerPic(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
}
@ -2411,7 +2411,7 @@ static void PlayerHandleTrainerSlide(void)
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -96;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy2;
@ -2420,9 +2420,9 @@ static void PlayerHandleTrainerSlide(void)
static void PlayerHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);
@ -2444,8 +2444,8 @@ static void PlayerHandleFaintAnimation(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0;
HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER);
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 5;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00;
gBattleBankFunc[gActiveBank] = sub_80596A8;
}
@ -2902,7 +2902,7 @@ static void PlayerHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -2963,11 +2963,11 @@ static void PlayerHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);
@ -2988,7 +2988,7 @@ static void PlayerHandleIntroTrainerBallThrow(void)
void sub_805CC00(struct Sprite *sprite)
{
u8 bank = sprite->data5;
u8 bank = sprite->data[5];
FreeSpriteOamMatrix(sprite);
FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum));

View File

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

View File

@ -449,18 +449,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
RecordedOpponentBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -1155,7 +1155,7 @@ static void RecordedOpponentHandleLoadMonSprite(void)
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]);
@ -1187,11 +1187,11 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit)
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
@ -1199,7 +1199,7 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit)
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT);
}
static void RecordedOpponentHandleReturnMonToBall(void)
@ -1285,7 +1285,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void)
sub_80A82E4(gActiveBank));
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag);
gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
@ -1301,9 +1301,9 @@ static void RecordedOpponentHandleTrainerSlide(void)
static void RecordedOpponentHandleTrainerSlideBack(void)
{
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy);
gBattleBankFunc[gActiveBank] = sub_81865C8;
@ -1614,7 +1614,7 @@ static void RecordedOpponentHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1675,9 +1675,9 @@ static void RecordedOpponentHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 35;
gSprites[gBankSpriteIds[gActiveBank]].data2 = 280;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_818962C);

View File

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

View File

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

View File

@ -396,18 +396,18 @@ static void DoHitAnimBlinkSpriteEffect(void)
{
u8 spriteId = gBankSpriteIds[gActiveBank];
if (gSprites[spriteId].data1 == 32)
if (gSprites[spriteId].data[1] == 32)
{
gSprites[spriteId].data1 = 0;
gSprites[spriteId].data[1] = 0;
gSprites[spriteId].invisible = 0;
gDoingBattleAnim = FALSE;
WallyBufferExecCompleted();
}
else
{
if ((gSprites[spriteId].data1 % 4) == 0)
if ((gSprites[spriteId].data[1] % 4) == 0)
gSprites[spriteId].invisible ^= 1;
gSprites[spriteId].data1++;
gSprites[spriteId].data[1]++;
}
}
@ -1073,7 +1073,7 @@ static void WallyHandleDrawTrainerPic(void)
30);
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy;
}
@ -1088,7 +1088,7 @@ static void WallyHandleTrainerSlide(void)
30);
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -96;
gSprites[gBankSpriteIds[gActiveBank]].data0 = 2;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy2;
}
@ -1408,7 +1408,7 @@ static void WallyHandleHitAnimation(void)
else
{
gDoingBattleAnim = TRUE;
gSprites[gBankSpriteIds[gActiveBank]].data1 = 0;
gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0;
DoHitAnimHealthboxEffect(gActiveBank);
gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect;
}
@ -1462,11 +1462,11 @@ static void WallyHandleIntroTrainerBallThrow(void)
oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]);
gSprites[gBankSpriteIds[gActiveBank]].data0 = 50;
gSprites[gBankSpriteIds[gActiveBank]].data2 = -40;
gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50;
gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40;
gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC;
gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank;
StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00);
StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1);
@ -1499,17 +1499,17 @@ static void sub_816AA80(u8 bank)
GetBankSpriteDefault_Y(bank),
sub_80A82E4(bank));
gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data2 = bank;
gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank];
gSprites[gUnknown_03005D7C[bank]].data[2] = bank;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = species;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = species;
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
gSprites[gBankSpriteIds[bank]].invisible = TRUE;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);
}
static void sub_816AC04(u8 taskId)

View File

@ -332,7 +332,7 @@ static u16 BattlePalaceGetTargetRetValue(void)
void sub_805D714(struct Sprite *sprite)
{
u8 spriteId = sprite->data1;
u8 spriteId = sprite->data[1];
if (!gSprites[spriteId].affineAnimEnded)
return;
@ -367,7 +367,7 @@ void sub_805D7AC(struct Sprite *sprite)
{
if (!(gUnknown_020243FC & 1))
{
sprite->pos2.x += sprite->data0;
sprite->pos2.x += sprite->data[0];
if (sprite->pos2.x == 0)
{
if (sprite->pos2.y != 0)
@ -1134,7 +1134,7 @@ void sub_805EB9C(u8 affineMode)
}
}
#define tBank data0
#define tBank data[0]
void LoadAndCreateEnemyShadowSprites(void)
{
@ -1144,13 +1144,13 @@ void LoadAndCreateEnemyShadowSprites(void)
bank = GetBankByIdentity(IDENTITY_OPPONENT_MON1);
gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8);
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank;
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank;
if (IsDoubleBattle())
{
bank = GetBankByIdentity(IDENTITY_OPPONENT_MON2);
gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8);
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank;
gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank;
}
}

View File

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

View File

@ -6782,8 +6782,8 @@ static bool8 sub_804F344(void)
return (gBattle_BG2_X != 0x1A0);
}
#define sDestroy data0
#define sSavedLvlUpBoxXPosition data1
#define sDestroy data[0]
#define sSavedLvlUpBoxXPosition data[1]
static void PutMonIconOnLvlUpBox(void)
{

View File

@ -1002,35 +1002,35 @@ static void sub_807FAC8(void)
static void sub_807FD08(struct Sprite* sprite)
{
sprite->data1 += sprite->data6;
sprite->data2 -= sprite->data4;
sprite->data2 += sprite->data7;
sprite->data0 += sprite->data7;
sprite->data4--;
sprite->data[1] += sprite->data[6];
sprite->data[2] -= sprite->data[4];
sprite->data[2] += sprite->data[7];
sprite->data[0] += sprite->data[7];
sprite->data[4]--;
if (sprite->data0 < sprite->data2)
if (sprite->data[0] < sprite->data[2])
{
sprite->data3 = sprite->data4 = sprite->data3 - 1;
sprite->data[3] = sprite->data[4] = sprite->data[3] - 1;
if (++sprite->data5 > 3)
if (++sprite->data[5] > 3)
DestroySprite(sprite);
else
PlaySE(SE_TB_KARA);
}
sprite->pos1.x = sprite->data1;
sprite->pos1.y = sprite->data2;
sprite->pos1.x = sprite->data[1];
sprite->pos1.y = sprite->data[2];
}
static void sub_807FD64(struct Sprite* sprite, s16 a2, s16 a3, s16 a4, s16 a5, s16 a6)
{
sprite->data0 = a3;
sprite->data1 = a2;
sprite->data2 = a3;
sprite->data3 = a4;
sprite->data4 = 10;
sprite->data5 = 0;
sprite->data6 = a5;
sprite->data7 = a6;
sprite->data[0] = a3;
sprite->data[1] = a2;
sprite->data[2] = a3;
sprite->data[3] = a4;
sprite->data[4] = 10;
sprite->data[5] = 0;
sprite->data[6] = a5;
sprite->data[7] = a6;
sprite->callback = sub_807FD08;
}
@ -2909,10 +2909,10 @@ static void BerryBlender_SetBackgroundsPos(void)
static void sub_8082E3C(struct Sprite* sprite)
{
sprite->data2 += sprite->data0;
sprite->data3 += sprite->data1;
sprite->pos2.x = sprite->data2 / 8;
sprite->pos2.y = sprite->data3 / 8;
sprite->data[2] += sprite->data[0];
sprite->data[3] += sprite->data[1];
sprite->pos2.x = sprite->data[2] / 8;
sprite->pos2.y = sprite->data[3] / 8;
if (sprite->animEnded)
DestroySprite(sprite);
@ -2935,8 +2935,8 @@ static void sub_8082E84(void)
y = gSineTable[(rand & 0xFF)] / 4;
spriteId = CreateSprite(&sUnknown_08339BE0, x + 120, y + 80, 1);
gSprites[spriteId].data0 = 16 - (Random() % 32);
gSprites[spriteId].data1 = 16 - (Random() % 32);
gSprites[spriteId].data[0] = 16 - (Random() % 32);
gSprites[spriteId].data[1] = 16 - (Random() % 32);
gSprites[spriteId].callback = sub_8082E3C;
}
@ -2944,8 +2944,8 @@ static void sub_8082E84(void)
static void sub_8082F68(struct Sprite* sprite)
{
sprite->data0++;
sprite->pos2.y = -(sprite->data0 / 3);
sprite->data[0]++;
sprite->pos2.y = -(sprite->data[0] / 3);
if (sprite->animEnded)
DestroySprite(sprite);
@ -2953,8 +2953,8 @@ static void sub_8082F68(struct Sprite* sprite)
static void sub_8082F9C(struct Sprite* sprite)
{
sprite->data0++;
sprite->pos2.y = -(sprite->data0 * 2);
sprite->data[0]++;
sprite->pos2.y = -(sprite->data[0] * 2);
if (sprite->pos2.y < -12)
sprite->pos2.y = -12;
@ -2970,68 +2970,68 @@ static void Blender_SetBankBerryData(u8 bank, u16 itemId)
static void sub_8083010(struct Sprite* sprite)
{
switch (sprite->data0)
switch (sprite->data[0])
{
case 0:
sprite->data1 += 8;
if (sprite->data1 > 88)
sprite->data[1] += 8;
if (sprite->data[1] > 88)
{
sprite->data1 = 88;
sprite->data0++;
sprite->data[1] = 88;
sprite->data[0]++;
PlaySE(SE_KON);
}
break;
case 1:
sprite->data2 += 1;
if (sprite->data2 > 20)
sprite->data[2] += 1;
if (sprite->data[2] > 20)
{
sprite->data0++;
sprite->data2 = 0;
sprite->data[0]++;
sprite->data[2] = 0;
}
break;
case 2:
sprite->data1 += 4;
if (sprite->data1 > 176)
sprite->data[1] += 4;
if (sprite->data[1] > 176)
{
if (++sprite->data3 == 3)
if (++sprite->data[3] == 3)
{
DestroySprite(sprite);
CreateSprite(&sUnknown_08339C60, 120, -20, 2);
}
else
{
sprite->data0 = 0;
sprite->data1 = -16;
StartSpriteAnim(sprite, sprite->data3);
sprite->data[0] = 0;
sprite->data[1] = -16;
StartSpriteAnim(sprite, sprite->data[3]);
}
}
break;
}
sprite->pos2.y = sprite->data1;
sprite->pos2.y = sprite->data[1];
}
static void sub_80830C0(struct Sprite* sprite)
{
switch (sprite->data0)
switch (sprite->data[0])
{
case 0:
sprite->data1 += 8;
if (sprite->data1 > 92)
sprite->data[1] += 8;
if (sprite->data[1] > 92)
{
sprite->data1 = 92;
sprite->data0++;
sprite->data[1] = 92;
sprite->data[0]++;
PlaySE(SE_PIN);
}
break;
case 1:
sprite->data2 += 1;
if (sprite->data2 > 20)
sprite->data0++;
sprite->data[2] += 1;
if (sprite->data[2] > 20)
sprite->data[0]++;
break;
case 2:
sprite->data1 += 4;
if (sprite->data1 > 176)
sprite->data[1] += 4;
if (sprite->data[1] > 176)
{
sBerryBlenderData->mainState++;
DestroySprite(sprite);
@ -3039,7 +3039,7 @@ static void sub_80830C0(struct Sprite* sprite)
break;
}
sprite->pos2.y = sprite->data1;
sprite->pos2.y = sprite->data[1];
}
static void sub_8083140(u16 a0, u16 a1)

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -263,8 +263,8 @@ static void CreateBankSprite(u8 bank)
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM)
@ -278,7 +278,7 @@ static void CreateBankSprite(u8 bank)
sub_80A82E4(0));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
}
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
{
@ -288,7 +288,7 @@ static void CreateBankSprite(u8 bank)
sub_80A82E4(0));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data[0] = bank;
}
else
{
@ -299,8 +299,8 @@ static void CreateBankSprite(u8 bank)
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
gSprites[gBankSpriteIds[bank]].data[0] = bank;
gSprites[gBankSpriteIds[bank]].data[2] = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM)

View File

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

View File

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