summaryrefslogtreecommitdiff
path: root/src/object/lilypadLargeFalling.c
blob: 4a918c59bff71482823507bbd996ae6aae706fc2 (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
/**
 * @file lilypadLargeFalling.c
 * @ingroup Objects
 *
 * @brief LilypadLargeFalling object
 */
#include "entity.h"
#include "functions.h"
#include "global.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 {
        int position = 0x120 - parent->z.HALF.HI;
        SetAffineInfo(this, position, position, parent->field_0x7c.HALF_U.HI);
    }
}