summaryrefslogtreecommitdiff
path: root/src/d/d_a_leaflift_static.cpp
blob: 55afb2453fb7cf33022320c85314812a563ca35c (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
43
44
45
46
47
48
49
//
// Generated by dtk
// Translation Unit: d_a_leaflift_static.cpp
//

#include "d/dolzel.h" // IWYU pragma: keep
#include "d/actor/d_a_leaflift.h"
#include "d/d_com_inf_game.h"
#include "dolphin/types.h"

const f32 daLlift_c::m_height = 560.0f;
const f32 daLlift_c::m_max_speed = 10.0f;
const f32 daLlift_c::m_min_speed = 5.0f;

/* 800690E4-80069100       .text checkEndDownLift__9daLlift_cFv */
BOOL daLlift_c::checkEndDownLift() {
    return (current.pos.y <= home.pos.y);
}

/* 80069100-800692C4       .text MoveUpLift__9daLlift_cFv */
BOOL daLlift_c::MoveUpLift() {
    f32 max_speed = m_max_speed;
    f32 min_speed = m_min_speed;
    cXyz upLiftPos;
    bool res = FALSE;
    mEmitterTimer++;
    if (current.pos.y != home.pos.y + m_height) {
        m43D = TRUE;
    }
    f32 upVel = cLib_addCalc(&current.pos.y, home.pos.y + m_height, 0.1f, max_speed, min_speed);
    if (upVel == 0.0f) {
        mbIsAscending = FALSE;
        res = TRUE;
    }
    else if ((upVel != 0.0f) && (mbIsAscending == FALSE)) {
        fopAcM_seStart(this, JA_SE_OBJ_LOTUS_LIFT_UP, 0);
        mbIsAscending = TRUE;
        mEmitter1 = dComIfGp_particle_set(dPa_name::ID_IT_SN_DEKLIFT_MIZUPOTA00, &current.pos, &current.angle);
        mEmitter2 = NULL;
        upLiftPos = current.pos;
        upLiftPos.y = mWaterY;
        mEmitter4 = dComIfGp_particle_set(dPa_name::ID_IT_SN_DEKLIFT_HAMONB00, &upLiftPos, &current.angle);
        mEmitterTimer = 0;
        if (mEmitter3) {
            mEmitter3->stopCreateParticle();
        }
    }
    return res;
}