Path: blob/master/src/game/behaviors/capswitch.inc.c
7861 views
// capswitch.c.inc12UNUSED u8 sCapSwitchText[] = { DIALOG_010, DIALOG_011, DIALOG_012 };34void cap_switch_act_0(void) {5o->oAnimState = o->oBehParams2ndByte;6cur_obj_scale(0.5f);7o->oPosY += 71.0f;8spawn_object_relative_with_scale(0, 0, -71, 0, 0.5f, o, MODEL_CAP_SWITCH_BASE, bhvCapSwitchBase);9if (gCurrLevelNum != LEVEL_UNKNOWN_32) {10if (save_file_get_flags() & sCapSaveFlags[o->oBehParams2ndByte]) {11o->oAction = 3;12o->header.gfx.scale[1] = 0.1f;13} else14o->oAction = 1;15} else16o->oAction = 1;17}1819void cap_switch_act_1(void) {20if (cur_obj_is_mario_on_platform()) {21save_file_set_flags(sCapSaveFlags[o->oBehParams2ndByte]);22o->oAction = 2;23cur_obj_play_sound_2(SOUND_GENERAL_ACTIVATE_CAP_SWITCH);24}25}2627void cap_switch_act_2(void) {28s32 sp1C;29if (o->oTimer < 5) {30cur_obj_scale_over_time(2, 4, 0.5f, 0.1f);31if (o->oTimer == 4) {32cur_obj_shake_screen(SHAKE_POS_SMALL);33spawn_mist_particles();34spawn_triangle_break_particles(60, MODEL_CARTOON_STAR, 0.3f, o->oBehParams2ndByte);35#if ENABLE_RUMBLE36queue_rumble_data(5, 80);37#endif38}39} else {40//! Neither of these flags are defined in this function so they do nothing.41// On an extra note, there's a specific check for this cutscene and42// there's no dialog defined since the cutscene itself calls the dialog.43sp1C = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_FRONT,44(DIALOG_FLAG_TEXT_RESPONSE | DIALOG_FLAG_UNK_CAPSWITCH), CUTSCENE_CAP_SWITCH_PRESS, 0);45if (sp1C)46o->oAction = 3;47}48}4950void cap_switch_act_3(void) {51} // dead function5253void (*sCapSwitchActions[])(void) = { cap_switch_act_0, cap_switch_act_1,54cap_switch_act_2, cap_switch_act_3 };5556void bhv_cap_switch_loop(void) {57cur_obj_call_action_function(sCapSwitchActions);58}596061