Disabled many timestops

This commit is contained in:
MysterD 2020-08-10 18:10:04 -07:00
parent 8fcf1728bd
commit aaf521659e
11 changed files with 39 additions and 24 deletions

View file

@ -378,7 +378,7 @@ void bobomb_buddy_cannon_dialog(s16 dialogFirstText, s16 dialogSecondText) {
void bobomb_buddy_act_talk(void) { void bobomb_buddy_act_talk(void) {
if (set_mario_npc_dialog(&gMarioStates[0], 1) == 2) { if (set_mario_npc_dialog(&gMarioStates[0], 1) == 2) {
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
switch (o->oBobombBuddyRole) { switch (o->oBobombBuddyRole) {
case BOBOMB_BUDDY_ROLE_ADVICE: case BOBOMB_BUDDY_ROLE_ADVICE:

View file

@ -189,7 +189,7 @@ void hoot_action_loop(void) {
//set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS); //set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS);
if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_045)) { if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_045)) {
//clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS); clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS);
o->oAction = HOOT_ACT_TIRED; o->oAction = HOOT_ACT_TIRED;
} }

View file

@ -240,7 +240,7 @@ void bhv_mips_held(void) {
dialogID = DIALOG_162; dialogID = DIALOG_162;
if (set_mario_npc_dialog(&gMarioState[0], 1) == 2) { if (set_mario_npc_dialog(&gMarioState[0], 1) == 2) {
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, dialogID)) { if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, dialogID)) {
o->oInteractionSubtype |= INT_SUBTYPE_DROP_IMMEDIATELY; o->oInteractionSubtype |= INT_SUBTYPE_DROP_IMMEDIATELY;
o->activeFlags &= ~ACTIVE_FLAG_INITIATED_TIME_STOP; o->activeFlags &= ~ACTIVE_FLAG_INITIATED_TIME_STOP;

View file

@ -71,8 +71,8 @@ void bhv_spawned_star_loop(void) {
if (o->oAction == 0) { if (o->oAction == 0) {
if (o->oTimer == 0) { if (o->oTimer == 0) {
cutscene_object(CUTSCENE_STAR_SPAWN, o); cutscene_object(CUTSCENE_STAR_SPAWN, o);
set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS); //set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS);
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
o->oAngleVelYaw = 0x800; o->oAngleVelYaw = 0x800;
if (o->oBehParams2ndByte == 0) if (o->oBehParams2ndByte == 0)
set_home_to_mario(); set_home_to_mario();

View file

@ -47,8 +47,8 @@ void bhv_star_spawn_init(void) {
else else
cutscene_object(CUTSCENE_RED_COIN_STAR_SPAWN, o); cutscene_object(CUTSCENE_RED_COIN_STAR_SPAWN, o);
set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS); //set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS);
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
cur_obj_become_intangible(); cur_obj_become_intangible();
} }

View file

@ -76,7 +76,7 @@ void yoshi_talk_loop(void) {
if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario) { if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario) {
cur_obj_init_animation(0); cur_obj_init_animation(0);
if (set_mario_npc_dialog(&gMarioState[0], 1) == 2) { if (set_mario_npc_dialog(&gMarioState[0], 1) == 2) {
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_161)) { if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_161)) {
o->activeFlags &= ~ACTIVE_FLAG_INITIATED_TIME_STOP; o->activeFlags &= ~ACTIVE_FLAG_INITIATED_TIME_STOP;
o->oInteractStatus = 0; o->oInteractStatus = 0;

View file

@ -9092,7 +9092,7 @@ BAD_RETURN(s32) cutscene_dialog_set_flag(UNUSED struct Camera *c) {
BAD_RETURN(s32) cutscene_dialog_end(struct Camera *c) { BAD_RETURN(s32) cutscene_dialog_end(struct Camera *c) {
sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE;
c->cutscene = 0; c->cutscene = 0;
//clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG); clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG);
} }
/** /**
@ -9150,7 +9150,7 @@ BAD_RETURN(s32) cutscene_read_message(struct Camera *c) {
retrieve_info_star(c); retrieve_info_star(c);
transition_next_state(c, 15); transition_next_state(c, 15);
sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE;
//clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG); clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG);
// Retrieve previous state // Retrieve previous state
sCUpCameraPitch = sCutsceneVars[1].angle[0]; sCUpCameraPitch = sCutsceneVars[1].angle[0];
sModeOffsetYaw = sCutsceneVars[1].angle[1]; sModeOffsetYaw = sCutsceneVars[1].angle[1];

View file

@ -1112,7 +1112,8 @@ s32 play_mode_change_area(void) {
sTransitionTimer -= 1; sTransitionTimer -= 1;
} }
//! If sTransitionTimer is -1, this will miss. if (sTransitionTimer < 0) { sTransitionTimer = 0; }
if (sTransitionTimer == 0) { if (sTransitionTimer == 0) {
sTransitionUpdate = NULL; sTransitionUpdate = NULL;
set_play_mode(PLAY_MODE_NORMAL); set_play_mode(PLAY_MODE_NORMAL);

View file

@ -487,7 +487,7 @@ s32 act_reading_automatic_dialog(struct MarioState *m) {
} }
// finished action // finished action
else if (m->actionState == 25) { else if (m->actionState == 25) {
//disable_time_stop(); disable_time_stop();
if (gShouldNotPlayCastleMusic) { if (gShouldNotPlayCastleMusic) {
gShouldNotPlayCastleMusic = FALSE; gShouldNotPlayCastleMusic = FALSE;
play_cutscene_music(SEQUENCE_ARGS(0, SEQ_LEVEL_INSIDE_CASTLE)); play_cutscene_music(SEQUENCE_ARGS(0, SEQ_LEVEL_INSIDE_CASTLE));
@ -540,7 +540,7 @@ s32 act_reading_sign(struct MarioState *m) {
case 2: case 2:
// dialog finished // dialog finished
if (gCamera->cutscene == 0) { if (gCamera->cutscene == 0) {
//disable_time_stop(); disable_time_stop();
set_mario_action(m, ACT_IDLE, 0); set_mario_action(m, ACT_IDLE, 0);
} }
break; break;
@ -633,7 +633,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
if ((m->actionArg & 1) == 0) { if ((m->actionArg & 1) == 0) {
level_trigger_warp(m, WARP_OP_STAR_EXIT); level_trigger_warp(m, WARP_OP_STAR_EXIT);
} else { } else {
enable_time_stop(); //enable_time_stop();
create_dialog_box_with_response(gLastCompletedStarNum == 7 ? DIALOG_013 : DIALOG_014); create_dialog_box_with_response(gLastCompletedStarNum == 7 ? DIALOG_013 : DIALOG_014);
m->actionState = 1; m->actionState = 1;
} }
@ -1118,7 +1118,7 @@ s32 act_exit_land_save_dialog(struct MarioState *m) {
if (m == &gMarioStates[0] && is_anim_past_end(m)) { if (m == &gMarioStates[0] && is_anim_past_end(m)) {
if (gLastCompletedCourseNum != COURSE_BITDW if (gLastCompletedCourseNum != COURSE_BITDW
&& gLastCompletedCourseNum != COURSE_BITFS) { && gLastCompletedCourseNum != COURSE_BITFS) {
enable_time_stop(); //enable_time_stop();
} }
set_menu_mode(RENDER_COURSE_DONE_SCREEN); set_menu_mode(RENDER_COURSE_DONE_SCREEN);
@ -1628,7 +1628,7 @@ s32 act_putting_on_cap(struct MarioState *m) {
s32 animFrame = set_mario_animation(m, MARIO_ANIM_PUT_CAP_ON); s32 animFrame = set_mario_animation(m, MARIO_ANIM_PUT_CAP_ON);
if (animFrame == 0) { if (animFrame == 0) {
enable_time_stop(); //enable_time_stop();
} }
if (animFrame == 28) { if (animFrame == 28) {

View file

@ -2653,7 +2653,7 @@ s32 cur_obj_update_dialog(struct MarioState* m, s32 actionArg, s32 dialogFlags,
// Wait for Mario to be ready to speak, and then enable time stop // Wait for Mario to be ready to speak, and then enable time stop
if (mario_ready_to_speak(m) || m->action == ACT_READING_NPC_DIALOG) { if (mario_ready_to_speak(m) || m->action == ACT_READING_NPC_DIALOG) {
//gTimeStopState |= TIME_STOP_ENABLED; //gTimeStopState |= TIME_STOP_ENABLED;
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
o->oDialogState++; o->oDialogState++;
} else { } else {
break; break;
@ -2719,8 +2719,8 @@ s32 cur_obj_update_dialog_with_cutscene(struct MarioState* m, s32 actionArg, s32
// allows us to move during time stop as long as Mario never enters // allows us to move during time stop as long as Mario never enters
// an action that can be interrupted with text. // an action that can be interrupted with text.
if (m->health >= 0x0100) { if (m->health >= 0x0100) {
gTimeStopState |= TIME_STOP_ENABLED; //gTimeStopState |= TIME_STOP_ENABLED;
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
o->oDialogState++; o->oDialogState++;
o->oDialogResponse = 0; o->oDialogResponse = 0;
} }
@ -2730,7 +2730,7 @@ s32 cur_obj_update_dialog_with_cutscene(struct MarioState* m, s32 actionArg, s32
// Wait for Mario to be ready to speak, and then enable time stop // Wait for Mario to be ready to speak, and then enable time stop
if (mario_ready_to_speak(m) || m->action == ACT_READING_NPC_DIALOG) { if (mario_ready_to_speak(m) || m->action == ACT_READING_NPC_DIALOG) {
//gTimeStopState |= TIME_STOP_ENABLED; //gTimeStopState |= TIME_STOP_ENABLED;
o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; //o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP;
o->oDialogState++; o->oDialogState++;
o->oDialogResponse = 0; o->oDialogResponse = 0;
} else { } else {

View file

@ -2,6 +2,7 @@
#include "../network.h" #include "../network.h"
#include "src/game/level_update.h" #include "src/game/level_update.h"
#include "src/game/area.h" #include "src/game/area.h"
#include "sm64.h"
int matchCount = 0; int matchCount = 0;
@ -16,6 +17,22 @@ void network_send_level_warp(void) {
network_send(&p); network_send(&p);
} }
static void force_well_behaved_state(void) {
/*
gDialogBoxState = DIALOG_STATE_OPENING;
gCourseDoneMenuTimer = 0;
gCourseCompleteCoins = 0;
gCourseCompleteCoinsEqual = 0;
gHudFlash = 0;
*/
level_set_transition(0, 0);
gMenuMode = -1;
gPauseScreenMode = 1;
gSaveOptSelectIndex = 0;
gMarioStates[0].action = (gMarioStates[0].pos[1] <= (gMarioStates[0].waterLevel - 100)) ? ACT_WATER_IDLE : ACT_IDLE;
gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN;
}
void network_receive_level_warp(struct Packet* p) { void network_receive_level_warp(struct Packet* p) {
s16 remotePlayMode; s16 remotePlayMode;
struct WarpDest remoteWarpDest; struct WarpDest remoteWarpDest;
@ -29,10 +46,7 @@ void network_receive_level_warp(struct Packet* p) {
if (remoteWarpDest.type == WARP_TYPE_NOT_WARPING) { return; } if (remoteWarpDest.type == WARP_TYPE_NOT_WARPING) { return; }
sCurrPlayMode = PLAY_MODE_SYNC_LEVEL; sCurrPlayMode = PLAY_MODE_SYNC_LEVEL;
sWarpDest = remoteWarpDest; sWarpDest = remoteWarpDest;
gMenuMode = -1; force_well_behaved_state();
gPauseScreenMode = 1;
if (sTransitionTimer < 1) { sTransitionTimer = 1; }
gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN;
network_send_level_warp(); network_send_level_warp();
return; return;
} }