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

52 lines
1.3 KiB
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// thwomp.c.inc
void ActionGrindelThwomp4(void) {
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;
}
void ActionGrindelThwomp2(void) {
o->oVelY += -4.0f;
o->oPosY += o->oVelY;
if (o->oPosY < o->oHomeY) {
o->oPosY = o->oHomeY;
o->oVelY = 0;
o->oAction = 3;
}
}
void ActionGrindelThwomp3(void) {
if (o->oTimer == 0)
if (o->oDistanceToMario < 1500.0f) {
ShakeScreen(1);
2019-10-05 19:08:05 +00:00
PlaySound2(SOUND_OBJ_THWOMP);
2019-08-25 04:46:40 +00:00
}
if (o->oTimer > 9)
o->oAction = 4;
}
void ActionGrindelThwomp1(void) {
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;
}
void ActionGrindelThwomp0(void) {
if (o->oBehParams2ndByte + 40 < o->oTimer) {
o->oAction = 1;
o->oPosY += 5.0f;
} else
o->oPosY += 10.0f;
}
void (*sGrindelThwompActions[])(void) = { ActionGrindelThwomp0, ActionGrindelThwomp1,
ActionGrindelThwomp2, ActionGrindelThwomp3,
ActionGrindelThwomp4 };
void bhv_grindel_thwomp_loop(void) {
obj_call_action_function(sGrindelThwompActions);
}