sm64pc/src/game/behaviors/express_elevator.inc.c

28 lines
796 B
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// express_elevator.c.inc
void bhv_wdw_express_elevator_loop(void) {
o->oVelY = 0.0f;
if (o->oAction == 0) {
2020-03-02 03:42:52 +00:00
if (cur_obj_is_mario_on_platform())
2019-08-25 04:46:40 +00:00
o->oAction++;
} else if (o->oAction == 1) {
o->oVelY = -20.0f;
o->oPosY += o->oVelY;
2020-03-02 03:42:52 +00:00
cur_obj_play_sound_1(SOUND_ENV_ELEVATOR4);
2019-08-25 04:46:40 +00:00
if (o->oTimer > 132)
o->oAction++;
} else if (o->oAction == 2) {
if (o->oTimer > 110)
o->oAction++;
} else if (o->oAction == 3) {
o->oVelY = 10.0f;
o->oPosY += o->oVelY;
2020-03-02 03:42:52 +00:00
cur_obj_play_sound_1(SOUND_ENV_ELEVATOR4);
2019-08-25 04:46:40 +00:00
if (o->oPosY >= o->oHomeY) {
o->oPosY = o->oHomeY;
o->oAction++;
}
2020-03-02 03:42:52 +00:00
} else if (!cur_obj_is_mario_on_platform())
2019-08-25 04:46:40 +00:00
o->oAction = 0;
}