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

44 lines
1.4 KiB
C
Raw Normal View History

2019-08-25 06:46:40 +02: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 04:42:52 +01:00
cur_obj_play_sound_2(SOUND_OBJ_THWOMP);
2019-08-25 06:46:40 +02:00
o->oHorizontalGrindelOnGround = TRUE;
2020-01-03 16:38:57 +01:00
set_camera_shake_from_point(SHAKE_POS_SMALL, o->oPosX, o->oPosY, o->oPosZ);
2019-08-25 06:46:40 +02:00
2020-03-02 04:42:52 +01:00
o->oHorizontalGrindelDistToHome = cur_obj_lateral_dist_to_home();
2019-08-25 06:46:40 +02:00
o->oForwardVel = 0.0f;
o->oTimer = 0;
}
2020-03-02 04:42:52 +01:00
if (cur_obj_rotate_yaw_toward(o->oHorizontalGrindelTargetYaw, 0x400)) {
2019-08-25 06:46:40 +02:00
if (o->oTimer > 60) {
if (o->oHorizontalGrindelDistToHome > 300.0f) {
o->oHorizontalGrindelTargetYaw += 0x8000;
o->oHorizontalGrindelDistToHome = 0.0f;
} else {
2020-03-02 04:42:52 +01:00
cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB_JUMP);
2019-08-25 06:46:40 +02: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 04:42:52 +01:00
cur_obj_move_standard(78);
2019-08-25 06:46:40 +02:00
}