summaryrefslogtreecommitdiff
path: root/src/REL/d/t/d_t_rock_boat.cpp
blob: 3955550e119b254e4d0e2abba0b679f7e71fe39b (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
#include "d/t/d_t_rock_boat.h"

#include "d/a/obj/d_a_obj_base.h"

SPECIAL_ACTOR_PROFILE(TAG_ROCK_BOAT, dTgRockBoat_c, fProfile::TAG_ROCK_BOAT, 0x173, 0, 3);

STATE_DEFINE(dTgRockBoat_c, Wait);

int dTgRockBoat_c::create() {
    mStateMgr.changeState(StateID_Wait);
    cooldown = 1;
    return SUCCEEDED;
}

int dTgRockBoat_c::doDelete() {
    return SUCCEEDED;
}

int dTgRockBoat_c::actorExecute() {
    mStateMgr.executeState();
    return SUCCEEDED;
}

int dTgRockBoat_c::draw() {
    return SUCCEEDED;
}

void dTgRockBoat_c::initializeState_Wait() {}
void dTgRockBoat_c::executeState_Wait() {
    if (cooldown > 0 && --cooldown == 0) {
        dAcObjBase_c::create(fProfile::OBJ_ROCK_BOAT, mRoomID, (boatNum << 0x1c) | 0xff, &mPosition, 0, 0, -1);
        cooldown = 0x259;
        if (++boatNum == 0xf) {
            boatNum = 0;
        }
    }
}
void dTgRockBoat_c::finalizeState_Wait() {}