2019-08-25 04:46:40 +00:00
|
|
|
|
|
|
|
void bhv_horizontal_grindel_init(void) {
|
|
|
|
o->oHorizontalGrindelTargetYaw = o->oMoveAngleYaw;
|
|
|
|
}
|
|
|
|
|
|
|
|
void bhv_horizontal_grindel_update(void) {
|
|
|
|
if (o->oMoveFlags & 0x00000003) {
|
|
|
|
if (!o->oHorizontalGrindelOnGround) {
|
2020-03-02 03:42:52 +00:00
|
|
|
cur_obj_play_sound_2(SOUND_OBJ_THWOMP);
|
2019-08-25 04:46:40 +00:00
|
|
|
o->oHorizontalGrindelOnGround = TRUE;
|
2020-01-03 15:38:57 +00:00
|
|
|
set_camera_shake_from_point(SHAKE_POS_SMALL, o->oPosX, o->oPosY, o->oPosZ);
|
2019-08-25 04:46:40 +00:00
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
o->oHorizontalGrindelDistToHome = cur_obj_lateral_dist_to_home();
|
2019-08-25 04:46:40 +00:00
|
|
|
o->oForwardVel = 0.0f;
|
|
|
|
o->oTimer = 0;
|
|
|
|
}
|
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
if (cur_obj_rotate_yaw_toward(o->oHorizontalGrindelTargetYaw, 0x400)) {
|
2019-08-25 04:46:40 +00:00
|
|
|
if (o->oTimer > 60) {
|
|
|
|
if (o->oHorizontalGrindelDistToHome > 300.0f) {
|
|
|
|
o->oHorizontalGrindelTargetYaw += 0x8000;
|
|
|
|
o->oHorizontalGrindelDistToHome = 0.0f;
|
|
|
|
} else {
|
2020-03-02 03:42:52 +00:00
|
|
|
cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB_JUMP);
|
2019-08-25 04:46:40 +00:00
|
|
|
o->oForwardVel = 11.0f;
|
|
|
|
o->oVelY = 70.0f;
|
|
|
|
o->oGravity = -4.0f;
|
|
|
|
o->oMoveFlags = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
o->oTimer = 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
o->oHorizontalGrindelOnGround = FALSE;
|
|
|
|
if (o->oVelY < 0.0f) {
|
|
|
|
o->oGravity = -16.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
o->oFaceAngleYaw = o->oMoveAngleYaw + 0x4000;
|
2020-03-02 03:42:52 +00:00
|
|
|
cur_obj_move_standard(78);
|
2019-08-25 04:46:40 +00:00
|
|
|
}
|