Keep player control of camera for chain-chomp cutscene

Fixes #54
This commit is contained in:
MysterD 2020-09-10 20:02:16 -07:00
parent 86c9bbf672
commit 5146308ba6
1 changed files with 6 additions and 20 deletions

View File

@ -270,8 +270,7 @@ static void chain_chomp_released_trigger_cutscene(void) {
//! Can delay this if we get into a cutscene-unfriendly action after the //! Can delay this if we get into a cutscene-unfriendly action after the
// last post ground pound and before this // last post ground pound and before this
if (set_mario_npc_dialog(&gMarioStates[0], 2) == 2 && (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
&& cutscene_object(CUTSCENE_STAR_SPAWN, o) == 1) {
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND; o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND;
o->oTimer = 0; o->oTimer = 0;
} }
@ -286,24 +285,14 @@ static void chain_chomp_released_lunge_around(void) {
// Finish bounce // Finish bounce
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) { if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
struct Object* player = nearest_player_to_object(o);
int angleToPlayer = obj_angle_to_object(o, player);
// Before first bounce, turn toward mario and wait 2 seconds
if (o->oChainChompNumLunges == 0) { if (o->oChainChompNumLunges == 0) {
if (cur_obj_rotate_yaw_toward(angleToPlayer, 0x320)) { o->oChainChompNumLunges += 1;
if (o->oTimer > 60) { // enable wall collision
o->oChainChompNumLunges += 1; o->oWallHitboxRadius = 200.0f;
// enable wall collision
o->oWallHitboxRadius = 200.0f;
}
} else {
o->oTimer = 0;
}
} else { } else {
if (++o->oChainChompNumLunges <= 5) { if (++o->oChainChompNumLunges <= 5) {
cur_obj_play_sound_2(SOUND_GENERAL_CHAIN_CHOMP1); cur_obj_play_sound_2(SOUND_GENERAL_CHAIN_CHOMP1);
o->oMoveAngleYaw = angleToPlayer + random_sign() * 0x2000; o->oMoveAngleYaw = cur_obj_angle_to_home() + random_sign() * 0x2000;
o->oForwardVel = 30.0f; o->oForwardVel = 30.0f;
o->oVelY = 50.0f; o->oVelY = 50.0f;
} else { } else {
@ -358,10 +347,7 @@ static void chain_chomp_released_jump_away(void) {
* Release mario and transition to the unload chain action. * Release mario and transition to the unload chain action.
*/ */
static void chain_chomp_released_end_cutscene(void) { static void chain_chomp_released_end_cutscene(void) {
if (cutscene_object(CUTSCENE_STAR_SPAWN, o) == -1) { o->oAction = CHAIN_CHOMP_ACT_UNLOAD_CHAIN;
set_mario_npc_dialog(&gMarioStates[0], 0);
o->oAction = CHAIN_CHOMP_ACT_UNLOAD_CHAIN;
}
} }
/** /**