summaryrefslogtreecommitdiff
path: root/src/battle/anim/sunlight.c
blob: f9ef843c257e8b8bdc68d5e1278105cfcf86ba44 (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
41
42
#include "global.h"
#include "battle_anim.h"
#include "rom_8077ABC.h"

void sub_80D517C(struct Sprite *sprite);

// sunlight (creates sunlight orbs)
// Used in Sunny Day

const union AffineAnimCmd gSpriteAffineAnim_83D9594[] =
{
    AFFINEANIMCMD_FRAME(0x50, 0x50, 0, 0),
    AFFINEANIMCMD_FRAME(0x2, 0x2, 10, 1),
    AFFINEANIMCMD_JUMP(1),
};

const union AffineAnimCmd *const gSpriteAffineAnimTable_83D95AC[] =
{
    gSpriteAffineAnim_83D9594,
};

const struct SpriteTemplate gBattleAnimSpriteTemplate_83D95B0 =
{
    .tileTag = ANIM_TAG_SUNLIGHT,
    .paletteTag = ANIM_TAG_SUNLIGHT,
    .oam = &gOamData_837E0B4,
    .anims = gDummySpriteAnimTable,
    .images = NULL,
    .affineAnims = gSpriteAffineAnimTable_83D95AC,
    .callback = sub_80D517C,
};

void sub_80D517C(struct Sprite *sprite)
{
    sprite->x = 0;
    sprite->y = 0;
    sprite->data[0] = 60;
    sprite->data[2] = 140;
    sprite->data[4] = 80;
    sprite->callback = StartAnimLinearTranslation;
    StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}