Restore vanilla chain chomp cutscene

This commit is contained in:
Agent X 2024-11-12 17:45:06 -05:00
parent b730f7e58b
commit d66cbf6dfc
2 changed files with 19 additions and 4 deletions

View file

@ -251,6 +251,10 @@ static void chain_chomp_sub_act_lunge(void) {
}
}
static u8 chain_chomp_released_trigger_cutscene_continue_dialog(void) {
return (o->oChainChompReleaseStatus != CHAIN_CHOMP_RELEASED_END_CUTSCENE);
}
/**
* Fall to the ground and interrupt mario into a cutscene action.
*/
@ -260,9 +264,20 @@ static void chain_chomp_released_trigger_cutscene(void) {
//! Can delay this if we get into a cutscene-unfriendly action after the
// last post ground pound and before this
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND;
o->oTimer = 0;
// hack: get the nearest wooden post, this will work properly 99% of the time
struct Object* woodenPost = cur_obj_nearest_object_with_behavior(bhvWoodenPost);
struct MarioState* marioState = nearest_mario_state_to_object(woodenPost);
if (&gMarioStates[0] == marioState) {
if (set_mario_npc_dialog(&gMarioStates[0], 2, chain_chomp_released_trigger_cutscene_continue_dialog) == 2
&& (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) && cutscene_object(CUTSCENE_STAR_SPAWN, o) == 1) {
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND;
o->oTimer = 0;
}
} else {
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND;
o->oTimer = 0;
}
}
}

View file

@ -389,7 +389,7 @@ u8 should_start_or_continue_dialog(struct MarioState* m, struct Object* object)
// 0 = not in dialog
// 1 = starting dialog
// 2 = speaking
s32 set_mario_npc_dialog(struct MarioState* m, s32 actionArg, UNUSED u8 (*inContinueDialogFunction)(void)) {
s32 set_mario_npc_dialog(struct MarioState* m, s32 actionArg, u8 (*inContinueDialogFunction)(void)) {
if (!m) { return 0; }
s32 dialogState = 0;