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

115 lines
2.9 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;
o->oTimer = RandomFloat() * 100.0f;
}
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;
2019-10-05 19:08:05 +00:00
PlaySound2(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;
2019-10-05 19:08:05 +00:00
PlaySound2(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;
o->oTimer = RandomFloat() * 100.0f;
}
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;
2019-10-05 19:08:05 +00:00
PlaySound2(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;
2019-10-05 19:08:05 +00:00
PlaySound2(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;
}
}