mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 01:14:19 +01:00
Energy Ball animation
This commit is contained in:
parent
5c44f44ad2
commit
79fec8a38d
@ -1652,6 +1652,21 @@ Move_FOCUS_BLAST:
|
||||
end
|
||||
|
||||
Move_ENERGY_BALL:
|
||||
loadspritegfx ANIM_TAG_ENERGY_BALL
|
||||
monbg ANIM_TARGET
|
||||
setalpha 12, 8
|
||||
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 8, RGB_BLACK
|
||||
waitforvisualfinish
|
||||
delay 15
|
||||
createsoundtask sub_8158C58, SE_W054, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 5, 0, 5
|
||||
createsprite gEnergyBallSpriteTemplate, ANIM_TARGET, 2, 12, 4, 8
|
||||
waitforvisualfinish
|
||||
playsewithpan SE_W028, SOUND_PAN_TARGET
|
||||
createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 8, 1
|
||||
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 8, 0, RGB_BLACK
|
||||
waitforvisualfinish
|
||||
clearmonbg ANIM_TARGET
|
||||
blendoff
|
||||
end
|
||||
|
||||
Move_BRAVE_BIRD:
|
||||
|
39
src/ghost.c
39
src/ghost.c
@ -98,6 +98,17 @@ const struct SpriteTemplate gUnknown_08596D58 =
|
||||
.callback = InitAnimShadowBall,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gEnergyBallSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_ENERGY_BALL,
|
||||
.paletteTag = ANIM_TAG_ENERGY_BALL,
|
||||
.oam = &gUnknown_08524974,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gUnknown_08596D54,
|
||||
.callback = InitAnimShadowBall,
|
||||
};
|
||||
|
||||
const union AnimCmd gUnknown_08596D70[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 2),
|
||||
@ -261,20 +272,20 @@ static void sub_81116E8(struct Sprite *sprite)
|
||||
AnimTranslateLinear(sprite);
|
||||
sprite->pos2.x += Sin(sprite->data[5], 10);
|
||||
sprite->pos2.y += Cos(sprite->data[5], 15);
|
||||
|
||||
|
||||
r2 = sprite->data[5];
|
||||
sprite->data[5] = (sprite->data[5] + 5) & 0xFF;
|
||||
r0 = sprite->data[5];
|
||||
|
||||
|
||||
if (r2 == 0 || r2 > 196)
|
||||
{
|
||||
if (r0 > 0)
|
||||
PlaySE(SE_W109);
|
||||
}
|
||||
|
||||
|
||||
if (sprite->data[6] == 0)
|
||||
{
|
||||
sprite->invisible = TRUE;
|
||||
sprite->invisible = TRUE;
|
||||
sprite->callback = DestroyAnimSpriteAndDisableBlend;
|
||||
}
|
||||
else
|
||||
@ -283,18 +294,18 @@ static void sub_81116E8(struct Sprite *sprite)
|
||||
|
||||
static void sub_8111764(struct Sprite *sprite)
|
||||
{
|
||||
|
||||
s16 r0;
|
||||
|
||||
s16 r0;
|
||||
if (sprite->data[6] > 0xFF)
|
||||
{
|
||||
if (++sprite->data[6] == 0x10d)
|
||||
sprite->data[6] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
r0 = sprite->data[7];
|
||||
sprite->data[7]++;
|
||||
|
||||
|
||||
if ((r0 & 0xFF) == 0)
|
||||
{
|
||||
sprite->data[7] &= 0xff00;
|
||||
@ -392,8 +403,8 @@ static void sub_811196C(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
// Spins a sprite towards the target, pausing in the middle.
|
||||
// Used in Shadow Ball.
|
||||
// Spins a sprite towards the target, pausing in the middle.
|
||||
// Used in Shadow Ball.
|
||||
// arg 0: duration step 1 (attacker -> center)
|
||||
// arg 1: duration step 2 (spin center)
|
||||
// arg 2: duration step 3 (center -> target)
|
||||
@ -466,7 +477,7 @@ static void sub_8111B9C(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
static void sub_8111BB4(struct Sprite *sprite) {
|
||||
|
||||
|
||||
s8 r5 = FALSE;
|
||||
bool8 r6 = FALSE;
|
||||
if(sprite->animEnded)
|
||||
@ -508,7 +519,7 @@ static void sub_8111BB4(struct Sprite *sprite) {
|
||||
void sub_8111C50(u8 taskId)
|
||||
{
|
||||
struct Task *task;
|
||||
|
||||
|
||||
task = &gTasks[taskId];
|
||||
task->data[0] = CloneBattlerSpriteWithBlend(1);
|
||||
if (task->data[0] < 0)
|
||||
@ -886,7 +897,7 @@ static void sub_81125E0(u8 taskId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (task->data[10])
|
||||
task->data[10]--;
|
||||
else if (task->data[6])
|
||||
@ -1120,7 +1131,7 @@ static void sub_8112B78(struct Sprite *sprite)
|
||||
sprite->pos2.x = Sin(sprite->data[0], 12);
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
sprite->pos2.x = -sprite->pos2.x;
|
||||
|
||||
|
||||
sprite->data[0] = (sprite->data[0] + 6) & 0xFF;
|
||||
sprite->data[1] += 0x100;
|
||||
sprite->pos2.y = -(sprite->data[1] >> 8);
|
||||
|
Loading…
x
Reference in New Issue
Block a user