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

44 lines
1.3 KiB
C
Raw Normal View History

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) {
2019-10-05 19:08:05 +00:00
PlaySound2(SOUND_OBJ_THWOMP);
2019-08-25 04:46:40 +00:00
o->oHorizontalGrindelOnGround = TRUE;
func_8027F440(1, o->oPosX, o->oPosY, o->oPosZ);
o->oHorizontalGrindelDistToHome = obj_lateral_dist_to_home();
o->oForwardVel = 0.0f;
o->oTimer = 0;
}
if (obj_rotate_yaw_toward(o->oHorizontalGrindelTargetYaw, 0x400)) {
if (o->oTimer > 60) {
if (o->oHorizontalGrindelDistToHome > 300.0f) {
o->oHorizontalGrindelTargetYaw += 0x8000;
o->oHorizontalGrindelDistToHome = 0.0f;
} else {
2019-10-05 19:08:05 +00:00
PlaySound2(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;
obj_move_standard(78);
}