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

52 lines
1.3 KiB
C
Raw Normal View History

2019-08-25 06:46:40 +02:00
// thwomp.c.inc
void ActionGrindelThwomp4(void) {
if (o->oTimer == 0)
2019-10-05 21:08:05 +02:00
o->oThwompUnkF4 = RandomFloat() * 10.0f + 20.0f;
if (o->oTimer > o->oThwompUnkF4)
2019-08-25 06:46:40 +02: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) {
2020-01-03 16:38:57 +01:00
ShakeScreen(SHAKE_POS_SMALL);
2019-10-05 21:08:05 +02:00
PlaySound2(SOUND_OBJ_THWOMP);
2019-08-25 06:46:40 +02:00
}
if (o->oTimer > 9)
o->oAction = 4;
}
void ActionGrindelThwomp1(void) {
if (o->oTimer == 0)
2019-10-05 21:08:05 +02:00
o->oThwompUnkF4 = RandomFloat() * 30.0f + 10.0f;
if (o->oTimer > o->oThwompUnkF4)
2019-08-25 06:46:40 +02: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);
}