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

48 lines
1.5 KiB
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// bowser_key_cutscene.inc.c
2020-03-02 03:42:52 +00:00
Gfx *geo_scale_bowser_key(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
2019-08-25 04:46:40 +00:00
struct Object *sp4;
if (run == TRUE) {
sp4 = (struct Object *) gCurGraphNodeObject;
2019-10-05 19:08:05 +00:00
((struct GraphNodeScale *) node->next)->scale = sp4->oBowserKeyScale;
2019-08-25 04:46:40 +00:00
}
return 0;
}
void bhv_bowser_key_unlock_door_loop(void) {
s32 animTimer;
animTimer = o->header.gfx.unk38.animFrame;
2020-03-02 03:42:52 +00:00
cur_obj_init_animation_with_sound(0);
2019-08-25 04:46:40 +00:00
if (animTimer < 38)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 0.0f;
2019-08-25 04:46:40 +00:00
else if (animTimer < 49)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 0.2f;
2019-08-25 04:46:40 +00:00
else if (animTimer < 58)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = (animTimer - 53) * 0.11875f + 0.2; // 0.11875?
2019-08-25 04:46:40 +00:00
else if (animTimer < 59)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 1.1f;
2019-08-25 04:46:40 +00:00
else if (animTimer < 60)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 1.05f;
2019-08-25 04:46:40 +00:00
else
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 1.0f;
2019-08-25 04:46:40 +00:00
if (o->oTimer > 150)
2020-03-02 03:42:52 +00:00
obj_mark_for_deletion(o);
2019-08-25 04:46:40 +00:00
}
void bhv_bowser_key_course_exit_loop(void) {
s32 animTimer = o->header.gfx.unk38.animFrame;
2020-03-02 03:42:52 +00:00
cur_obj_init_animation_with_sound(1);
2019-08-25 04:46:40 +00:00
if (animTimer < 38)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 0.2f;
2019-08-25 04:46:40 +00:00
else if (animTimer < 52)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = (animTimer - 42) * 0.042857f + 0.2; // TODO 3/70?
2019-08-25 04:46:40 +00:00
else if (animTimer < 94)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 0.8f;
2019-08-25 04:46:40 +00:00
else if (animTimer < 101)
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = (101 - animTimer) * 0.085714f + 0.2; // TODO 6/70?
2019-08-25 04:46:40 +00:00
else
2019-10-05 19:08:05 +00:00
o->oBowserKeyScale = 0.2f;
2019-08-25 04:46:40 +00:00
if (o->oTimer > 138)
2020-03-02 03:42:52 +00:00
obj_mark_for_deletion(o);
2019-08-25 04:46:40 +00:00
}