blob: d2d22602a638f2c3ae0c60cd4a7d330e1807a07f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include "global.h"
#include "rom_8077ABC.h"
#include "trig.h"
#include "battle_anim.h"
#include "sound.h"
extern s16 gBattleAnimArgs[];
extern u8 gAnimBankAttacker;
extern u8 gAnimBankTarget;
static void sub_80D2094(struct Sprite* sprite);
// flying_hearts (hearts float upward from the bottom of the screen.)
// Used in Attract.
void sub_80D2064(struct Sprite* sprite)
{
sprite->pos1.x = gBattleAnimArgs[0];
sprite->pos1.y = 0xA0;
sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gBattleAnimArgs[1];
sprite->callback = sub_80782D8;
StoreSpriteCallbackInData(sprite, sub_80D2094);
}
void sub_80D2094(struct Sprite* sprite)
{
s16 y;
sprite->data[2] += sprite->data[1];
sprite->pos2.y = -((u16)sprite->data[2] >> 8);
sprite->pos2.x = Sin(sprite->data[3], 4);
sprite->data[3] = (sprite->data[3] + 3) & 0xFF;
y = sprite->pos1.y + sprite->pos2.y;
if (y <= 0x48)
{
sprite->invisible = sprite->data[3] % 2;
if (y <= 0x40)
DestroyAnimSprite(sprite);
}
}
|