2019-08-25 04:46:40 +00:00
|
|
|
// thwomp.c.inc
|
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
void grindel_thwomp_act_4(void) {
|
2019-08-25 04:46:40 +00:00
|
|
|
if (o->oTimer == 0)
|
2019-10-05 19:08:05 +00:00
|
|
|
o->oThwompUnkF4 = RandomFloat() * 10.0f + 20.0f;
|
|
|
|
if (o->oTimer > o->oThwompUnkF4)
|
2019-08-25 04:46:40 +00:00
|
|
|
o->oAction = 0;
|
|
|
|
}
|
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
void grindel_thwomp_act_2(void) {
|
2019-08-25 04:46:40 +00:00
|
|
|
o->oVelY += -4.0f;
|
|
|
|
o->oPosY += o->oVelY;
|
|
|
|
if (o->oPosY < o->oHomeY) {
|
|
|
|
o->oPosY = o->oHomeY;
|
|
|
|
o->oVelY = 0;
|
|
|
|
o->oAction = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
void grindel_thwomp_act_3(void) {
|
2019-08-25 04:46:40 +00:00
|
|
|
if (o->oTimer == 0)
|
|
|
|
if (o->oDistanceToMario < 1500.0f) {
|
2020-03-02 03:42:52 +00:00
|
|
|
cur_obj_shake_screen(SHAKE_POS_SMALL);
|
|
|
|
cur_obj_play_sound_2(SOUND_OBJ_THWOMP);
|
2019-08-25 04:46:40 +00:00
|
|
|
}
|
|
|
|
if (o->oTimer > 9)
|
|
|
|
o->oAction = 4;
|
|
|
|
}
|
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
void grindel_thwomp_act_1(void) {
|
2019-08-25 04:46:40 +00:00
|
|
|
if (o->oTimer == 0)
|
2019-10-05 19:08:05 +00:00
|
|
|
o->oThwompUnkF4 = RandomFloat() * 30.0f + 10.0f;
|
|
|
|
if (o->oTimer > o->oThwompUnkF4)
|
2019-08-25 04:46:40 +00:00
|
|
|
o->oAction = 2;
|
|
|
|
}
|
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
void grindel_thwomp_act_0(void) {
|
2019-08-25 04:46:40 +00:00
|
|
|
if (o->oBehParams2ndByte + 40 < o->oTimer) {
|
|
|
|
o->oAction = 1;
|
|
|
|
o->oPosY += 5.0f;
|
|
|
|
} else
|
|
|
|
o->oPosY += 10.0f;
|
|
|
|
}
|
|
|
|
|
2020-03-02 03:42:52 +00:00
|
|
|
void (*sGrindelThwompActions[])(void) = { grindel_thwomp_act_0, grindel_thwomp_act_1,
|
|
|
|
grindel_thwomp_act_2, grindel_thwomp_act_3,
|
|
|
|
grindel_thwomp_act_4 };
|
2019-08-25 04:46:40 +00:00
|
|
|
|
|
|
|
void bhv_grindel_thwomp_loop(void) {
|
2020-03-02 03:42:52 +00:00
|
|
|
cur_obj_call_action_function(sGrindelThwompActions);
|
2019-08-25 04:46:40 +00:00
|
|
|
}
|