summaryrefslogtreecommitdiff
path: root/src/object/lilypadLargeFalling.c
blob: 791f13dd0b44be035e1a2f818586723177fd8fd7 (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
/**
 * @file lilypadLargeFalling.c
 * @ingroup Objects
 *
 * @brief LilypadLargeFalling object
 */
#include "entity.h"
#include "object/lilypadLarge.h"

void LilypadLargeFalling(Entity* this) {
    Entity* parent;

    if (this->action == 0) {
        this->action = 1;
        this->z.WORD = 0;
        this->spriteRendering.b3 = 3;
        InitializeAnimation(this, 9);
    }

    parent = this->parent;
    if (parent->z.WORD == 0) {
        DeleteThisEntity();
    } else {
        s32 position = 0x120 - parent->z.HALF.HI;
        SetAffineInfo(this, position, position, ((LilypadLargeEntity*)parent)->unk_7c.HALF_U.HI);
    }
}