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

115 lines
3.0 KiB
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// bomp.c.inc
void bhv_small_bomp_init(void) {
o->oFaceAngleYaw -= 0x4000;
o->oSmallBompInitX = o->oPosX;
2020-04-03 18:57:26 +00:00
o->oTimer = random_float() * 100.0f;
2019-08-25 04:46:40 +00:00
}
void bhv_small_bomp_loop(void) {
switch (o->oAction) {
case BOMP_ACT_WAIT:
if (o->oTimer >= 101) {
o->oAction = BOMP_ACT_POKE_OUT;
o->oForwardVel = 30.0f;
}
break;
case BOMP_ACT_POKE_OUT:
if (o->oPosX > 3450.0f) {
o->oPosX = 3450.0f;
o->oForwardVel = 0;
}
if (o->oTimer == 15.0) {
o->oAction = BOMP_ACT_EXTEND;
o->oForwardVel = 40.0f;
2020-03-02 03:42:52 +00:00
cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
2019-08-25 04:46:40 +00:00
}
break;
case BOMP_ACT_EXTEND:
if (o->oPosX > 3830.0f) {
o->oPosX = 3830.0f;
o->oForwardVel = 0;
}
if (o->oTimer == 60) {
o->oAction = BOMP_ACT_RETRACT;
o->oForwardVel = 10.0f;
o->oMoveAngleYaw -= 0x8000;
2020-03-02 03:42:52 +00:00
cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
2019-08-25 04:46:40 +00:00
}
break;
case BOMP_ACT_RETRACT:
if (o->oPosX < 3330.0f) {
o->oPosX = 3330.0f;
o->oForwardVel = 0;
}
if (o->oTimer == 90) {
o->oAction = BOMP_ACT_POKE_OUT;
o->oForwardVel = 25.0f;
o->oMoveAngleYaw -= 0x8000;
}
break;
}
}
void bhv_large_bomp_init(void) {
o->oMoveAngleYaw += 0x4000;
2020-04-03 18:57:26 +00:00
o->oTimer = random_float() * 100.0f;
2019-08-25 04:46:40 +00:00
}
void bhv_large_bomp_loop(void) {
switch (o->oAction) {
case BOMP_ACT_WAIT:
if (o->oTimer >= 101) {
o->oAction = BOMP_ACT_POKE_OUT;
o->oForwardVel = 30.0f;
}
break;
case BOMP_ACT_POKE_OUT:
if (o->oPosX > 3450.0f) {
o->oPosX = 3450.0f;
o->oForwardVel = 0;
}
if (o->oTimer == 15.0) {
o->oAction = BOMP_ACT_EXTEND;
o->oForwardVel = 10.0f;
2020-03-02 03:42:52 +00:00
cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
2019-08-25 04:46:40 +00:00
}
break;
case BOMP_ACT_EXTEND:
if (o->oPosX > 3830.0f) {
o->oPosX = 3830.0f;
o->oForwardVel = 0;
}
if (o->oTimer == 60) {
o->oAction = BOMP_ACT_RETRACT;
o->oForwardVel = 10.0f;
o->oMoveAngleYaw -= 0x8000;
2020-03-02 03:42:52 +00:00
cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
2019-08-25 04:46:40 +00:00
}
break;
case BOMP_ACT_RETRACT:
if (o->oPosX < 3330.0f) {
o->oPosX = 3330.0f;
o->oForwardVel = 0;
}
if (o->oTimer == 90) {
o->oAction = BOMP_ACT_POKE_OUT;
o->oForwardVel = 25.0f;
o->oMoveAngleYaw -= 0x8000;
}
break;
}
}