You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Clean up rumble ifdefs + add unused controller args
This commit is contained in:
@@ -236,9 +236,7 @@ void handle_vblank(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_RUMBLE
|
||||
rumble_thread_update_vi();
|
||||
#endif
|
||||
|
||||
// Notify the game loop about the vblank.
|
||||
if (gVblankHandler1 != NULL) osSendMesg(gVblankHandler1->queue, gVblankHandler1->msg, OS_MESG_NOBLOCK);
|
||||
@@ -356,9 +354,9 @@ void check_stack_validity(void) {
|
||||
gThread6Stack[0]++;
|
||||
gThread6Stack[THREAD6_STACK - 1]++;
|
||||
assert(gThread6Stack[0] == gThread6Stack[THREAD6_STACK - 1], "Thread 6 stack overflow.")
|
||||
#endif
|
||||
#endif // ENABLE_RUMBLE
|
||||
}
|
||||
#endif
|
||||
#endif // DEBUG
|
||||
|
||||
|
||||
extern void crash_screen_init(void);
|
||||
@@ -416,8 +414,8 @@ void thread3_main(UNUSED void *arg) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
gThread6Stack[0] = 0;
|
||||
gThread6Stack[THREAD6_STACK - 1] = 0;
|
||||
#endif
|
||||
#endif
|
||||
#endif // ENABLE_RUMBLE
|
||||
#endif // DEBUG
|
||||
|
||||
create_thread(&gSoundThread, THREAD_4_SOUND, thread4_sound, NULL, gThread4Stack + THREAD4_STACK, 20);
|
||||
osStartThread(&gSoundThread);
|
||||
|
||||
@@ -48,9 +48,7 @@ void cap_switch_act_being_pressed(void) {
|
||||
cur_obj_shake_screen(SHAKE_POS_SMALL);
|
||||
spawn_mist_particles();
|
||||
spawn_triangle_break_particles(60, MODEL_CARTOON_STAR, 0.3f, o->oBehParams2ndByte);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(gMarioState->controller, 5, 80);
|
||||
}
|
||||
} else {
|
||||
//! Neither of these flags are defined in this function so they do nothing.
|
||||
|
||||
@@ -81,9 +81,7 @@ void controllable_platform_hit_wall(s8 nextDirection) {
|
||||
sControllablePlatformDirectionState = 5;
|
||||
|
||||
cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(50, 80);
|
||||
#endif
|
||||
queue_rumble_data(gMarioState->controller, 50, 80);
|
||||
}
|
||||
|
||||
void controllable_platform_check_walls(s8 nextDirection, s8 wallDisplacement[3], Vec3f dist1, UNUSED Vec3f dist2, Vec3f dist3) {
|
||||
|
||||
@@ -94,9 +94,7 @@ void exclamation_box_act_active(void) {
|
||||
o->oGravity = -8.0f;
|
||||
o->oFloorHeight = o->oPosY;
|
||||
o->oAction = EXCLAMATION_BOX_ACT_SCALING;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(gMarioState->controller, 5, 80);
|
||||
}
|
||||
load_object_collision_model();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
void bhv_1up_interact(void) {
|
||||
if (obj_check_if_collided_with_object(o, gMarioObject)) {
|
||||
play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource);
|
||||
queue_rumble_data(gMarioState->controller, 5, 80);
|
||||
#ifdef MUSHROOMS_HEAL
|
||||
gMarioState->healCounter = 31;
|
||||
#ifdef BREATH_METER
|
||||
@@ -13,9 +14,6 @@ void bhv_1up_interact(void) {
|
||||
gMarioState->numLives++;
|
||||
#endif
|
||||
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,7 @@ void bhv_purple_switch_loop(void) {
|
||||
cur_obj_play_sound_2(SOUND_GENERAL2_PURPLE_SWITCH);
|
||||
o->oAction = PURPLE_SWITCH_ACT_TICKING;
|
||||
cur_obj_shake_screen(SHAKE_POS_SMALL);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(gMarioState->controller, 5, 80);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -24,9 +24,7 @@ void bhv_star_door_loop(void) {
|
||||
case STAR_DOOR_ACT_OPENING:
|
||||
if (o->oTimer == 0 && (s16) o->oMoveAngleYaw >= 0) {
|
||||
cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_OPEN);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(35, 30);
|
||||
#endif
|
||||
queue_rumble_data(gMarioState->controller, 35, 30);
|
||||
}
|
||||
cur_obj_become_intangible();
|
||||
o->oLeftVel = -8.0f;
|
||||
@@ -45,9 +43,7 @@ void bhv_star_door_loop(void) {
|
||||
case STAR_DOOR_ACT_CLOSING:
|
||||
if (o->oTimer == 0 && (s16) o->oMoveAngleYaw >= 0) {
|
||||
cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_CLOSE);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(35, 30);
|
||||
#endif
|
||||
queue_rumble_data(gMarioState->controller, 35, 30);
|
||||
}
|
||||
o->oLeftVel = 8.0f;
|
||||
star_door_update_pos();
|
||||
|
||||
@@ -137,9 +137,7 @@ void bhv_treasure_chest_ship_loop(void) {
|
||||
gEnvironmentRegions[6] = -335;
|
||||
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
|
||||
}
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_vibrate(2);
|
||||
#endif
|
||||
reset_rumble_timers_vibrate(gMarioState->controller, 2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -46,9 +46,8 @@ void water_level_pillar_undrained(void) {
|
||||
(s32) approach_f32_symmetric(gEnvironmentLevels[2], -2450.0f, 5.0f);
|
||||
gEnvironmentLevels[0] =
|
||||
(s32) approach_f32_symmetric(gEnvironmentLevels[0], -2450.0f, 5.0f);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_vibrate(2);
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_vibrate(gMarioState->controller, 2);
|
||||
} else {
|
||||
o->oAction++;
|
||||
}
|
||||
|
||||
@@ -49,9 +49,8 @@ void bhv_water_level_diamond_loop(void) {
|
||||
cur_obj_play_sound_1(SOUND_ENV_WATER_DRAIN);
|
||||
}
|
||||
o->oAngleVelYaw = 0x800;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_vibrate(2);
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_vibrate(gMarioState->controller, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -166,31 +166,27 @@ void assign_controllers_by_player_num(void) {
|
||||
* Read raw controller input data.
|
||||
*/
|
||||
static void poll_controller_inputs(OSMesg* mesg) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
block_until_rumble_pak_free();
|
||||
#endif
|
||||
|
||||
osContStartReadDataEx(&gSIEventMesgQueue);
|
||||
osRecvMesg(&gSIEventMesgQueue, mesg, OS_MESG_BLOCK);
|
||||
osContGetReadDataEx(gControllerPads);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
|
||||
release_rumble_pak_control();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for new controller data on all ports.
|
||||
*/
|
||||
static void poll_controller_statuses(OSMesg* mesg) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
block_until_rumble_pak_free();
|
||||
#endif
|
||||
|
||||
osContSetCh(MAXCONTROLLERS);
|
||||
osContStartQuery(&gSIEventMesgQueue);
|
||||
osRecvMesg(&gSIEventMesgQueue, mesg, OS_MESG_BLOCK);
|
||||
osContGetQueryEx(&gControllerBits, gControllerStatuses);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
|
||||
release_rumble_pak_control();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,9 +199,7 @@ void start_controller_status_polling(void) {
|
||||
bzero(gPortInfo, sizeof(gPortInfo));
|
||||
bzero(gControllers, sizeof(gControllers));
|
||||
bzero(gControllerStatuses, sizeof(gControllerStatuses));
|
||||
#ifdef ENABLE_RUMBLE
|
||||
cancel_rumble();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,9 +215,7 @@ void stop_controller_status_polling(void) {
|
||||
? osEepromProbeVC(&gSIEventMesgQueue)
|
||||
: osEepromProbe (&gSIEventMesgQueue);
|
||||
#endif
|
||||
#ifdef ENABLE_RUMBLE
|
||||
cancel_rumble();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -687,9 +687,7 @@ u32 take_damage_from_interact_object(struct MarioState *m) {
|
||||
|
||||
m->hurtCounter += 4 * damage;
|
||||
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
set_camera_shake_from_hit(shake);
|
||||
|
||||
return damage;
|
||||
@@ -742,11 +740,10 @@ u32 interact_coin(struct MarioState *m, UNUSED u32 interactType, struct Object *
|
||||
g100CoinStarSpawned = TRUE;
|
||||
}
|
||||
#endif
|
||||
#ifdef ENABLE_RUMBLE
|
||||
|
||||
if (obj->oDamageOrCoinValue >= 2) {
|
||||
queue_rumble_data(5, 80);
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -777,9 +774,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
|
||||
|
||||
if (m->health >= 0x100) {
|
||||
mario_stop_riding_and_holding(m);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
#ifdef POWER_STARS_HEAL
|
||||
m->hurtCounter = 0;
|
||||
@@ -893,20 +888,13 @@ u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object *
|
||||
m->interactObj = obj;
|
||||
m->usedObj = obj;
|
||||
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (obj->collisionData == segmented_to_virtual(warp_pipe_seg3_collision_03009AC8)) {
|
||||
play_sound(SOUND_MENU_ENTER_PIPE, m->marioObj->header.gfx.cameraToObject);
|
||||
queue_rumble_data(15, 80);
|
||||
queue_rumble_data(m->controller, 15, 80);
|
||||
} else {
|
||||
play_sound(SOUND_MENU_ENTER_HOLE, m->marioObj->header.gfx.cameraToObject);
|
||||
queue_rumble_data(12, 80);
|
||||
queue_rumble_data(m->controller, 12, 80);
|
||||
}
|
||||
#else
|
||||
play_sound(obj->collisionData == segmented_to_virtual(warp_pipe_seg3_collision_03009AC8)
|
||||
? SOUND_MENU_ENTER_PIPE
|
||||
: SOUND_MENU_ENTER_HOLE,
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
|
||||
mario_stop_riding_object(m);
|
||||
return set_mario_action(m, ACT_DISAPPEARED, (WARP_OP_WARP_OBJECT << 16) + 2);
|
||||
@@ -1093,9 +1081,8 @@ u32 interact_tornado(struct MarioState *m, UNUSED u32 interactType, struct Objec
|
||||
marioObj->oMarioTornadoPosY = m->pos[1] - obj->oPosY;
|
||||
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(30, 60);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 30, 60);
|
||||
|
||||
return set_mario_action(m, ACT_TORNADO_TWIRLING, m->action == ACT_TWIRLING);
|
||||
}
|
||||
|
||||
@@ -1116,9 +1103,8 @@ u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Obj
|
||||
marioObj->oMarioWhirlpoolPosY = m->pos[1] - obj->oPosY;
|
||||
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(30, 60);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 30, 60);
|
||||
|
||||
return set_mario_action(m, ACT_CAUGHT_IN_WHIRLPOOL, 0);
|
||||
}
|
||||
|
||||
@@ -1148,11 +1134,11 @@ u32 interact_strong_wind(struct MarioState *m, UNUSED u32 interactType, struct O
|
||||
u32 interact_flame(struct MarioState *m, UNUSED u32 interactType, struct Object *obj) {
|
||||
u32 burningAction = ACT_BURNING_JUMP;
|
||||
|
||||
if (!sInvulnerable && !(m->flags & MARIO_METAL_CAP) && !(m->flags & MARIO_VANISH_CAP)
|
||||
&& !(obj->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
if (!sInvulnerable
|
||||
&& !(m->flags & (MARIO_METAL_CAP | MARIO_VANISH_CAP))
|
||||
&& !(obj->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) {
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
obj->oInteractStatus = INT_STATUS_INTERACTED;
|
||||
m->interactObj = obj;
|
||||
|
||||
@@ -1227,9 +1213,7 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object
|
||||
m->interactObj = obj;
|
||||
|
||||
if (interaction & INT_ATTACK_NOT_FROM_BELOW) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
push_mario_out_of_object(m, obj, 5.0f);
|
||||
|
||||
m->forwardVel = -16.0f;
|
||||
@@ -1250,9 +1234,8 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object
|
||||
|
||||
push_mario_out_of_object(m, obj, 5.0f);
|
||||
drop_and_set_mario_action(m, bully_knock_back_mario(m), 0);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1269,9 +1252,7 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object
|
||||
|
||||
take_damage_from_interact_object(m);
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(70, 60);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 70, 60);
|
||||
|
||||
if (m->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) {
|
||||
return drop_and_set_mario_action(m, ACT_WATER_SHOCKED, 0);
|
||||
@@ -1316,9 +1297,7 @@ u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struc
|
||||
}
|
||||
|
||||
if (interaction & INT_ANY_ATTACK) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
attack_object(obj, interaction);
|
||||
bounce_back_from_attack(m, interaction);
|
||||
|
||||
@@ -1356,9 +1335,7 @@ u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Ob
|
||||
}
|
||||
|
||||
if (interaction & INT_ATTACK_NOT_FROM_BELOW) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
attack_object(obj, interaction);
|
||||
bounce_back_from_attack(m, interaction);
|
||||
|
||||
@@ -1476,9 +1453,8 @@ u32 check_object_grab_mario(struct MarioState *m, UNUSED u32 interactType, struc
|
||||
|
||||
update_mario_sound_and_camera(m);
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
return set_mario_action(m, ACT_GRABBED, 0);
|
||||
}
|
||||
}
|
||||
@@ -1525,9 +1501,8 @@ u32 interact_pole(struct MarioState *m, UNUSED u32 interactType, struct Object *
|
||||
m->angleVel[1] = 0x1000;
|
||||
#endif
|
||||
reset_mario_pitch(m);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
return set_mario_action(m, ACT_GRAB_POLE_FAST, 0);
|
||||
}
|
||||
}
|
||||
@@ -1551,10 +1526,9 @@ u32 interact_hoot(struct MarioState *m, UNUSED u32 interactType, struct Object *
|
||||
m->interactObj = obj;
|
||||
m->usedObj = obj;
|
||||
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
update_mario_sound_and_camera(m);
|
||||
|
||||
return set_mario_action(m, ACT_RIDING_HOOT, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -694,10 +694,9 @@ void initiate_painting_warp(void) {
|
||||
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
fadeout_music(398);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(80, 70);
|
||||
queue_rumble_decay(1);
|
||||
#endif
|
||||
|
||||
queue_rumble_data(gMarioState->controller, 80, 70);
|
||||
queue_rumble_decay(gMarioState->controller, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1022,9 +1021,7 @@ s32 play_mode_normal(void) {
|
||||
set_play_mode(PLAY_MODE_CHANGE_AREA);
|
||||
} else if (pressed_pause()) {
|
||||
lower_background_noise(1);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
cancel_rumble();
|
||||
#endif
|
||||
gCameraMovementFlags |= CAM_MOVE_PAUSE_SCREEN;
|
||||
set_play_mode(PLAY_MODE_PAUSED);
|
||||
}
|
||||
@@ -1249,11 +1246,10 @@ s32 init_level(void) {
|
||||
set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0);
|
||||
}
|
||||
}
|
||||
#ifdef ENABLE_RUMBLE
|
||||
|
||||
if (gCurrDemoInput == NULL) {
|
||||
cancel_rumble();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gMarioState->action == ACT_INTRO_CUTSCENE) {
|
||||
sound_banks_disable(SEQ_PLAYER_SFX, SOUND_BANKS_DISABLED_DURING_INTRO_CUTSCENE);
|
||||
|
||||
@@ -1471,15 +1471,15 @@ void update_mario_health(struct MarioState *m) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (gRumblePakTimer == 0) {
|
||||
gRumblePakTimer = 36;
|
||||
if (is_rumble_finished_and_queue_empty()) {
|
||||
queue_rumble_data(3, 30);
|
||||
if (is_rumble_finished_and_queue_empty(m->controller)) {
|
||||
queue_rumble_data(m->controller, 3, 30);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gRumblePakTimer = 0;
|
||||
#endif
|
||||
#endif // ENABLE_RUMBLE
|
||||
}
|
||||
#endif
|
||||
#endif // BREATH_METER
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1494,13 +1494,13 @@ void update_mario_breath(struct MarioState *m) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (gRumblePakTimer == 0) {
|
||||
gRumblePakTimer = 36;
|
||||
if (is_rumble_finished_and_queue_empty()) {
|
||||
queue_rumble_data(3, 30);
|
||||
if (is_rumble_finished_and_queue_empty(m->controller)) {
|
||||
queue_rumble_data(m->controller, 3, 30);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gRumblePakTimer = 0;
|
||||
#endif
|
||||
#endif // ENABLE_RUMBLE
|
||||
}
|
||||
} else if (!(m->input & INPUT_IN_POISON_GAS)) {
|
||||
m->breath += 0x1A;
|
||||
@@ -1687,14 +1687,14 @@ UNUSED static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u
|
||||
#ifdef ENABLE_RUMBLE
|
||||
void queue_rumble_particles(struct MarioState *m) {
|
||||
if (m->particleFlags & PARTICLE_HORIZONTAL_STAR) {
|
||||
queue_rumble_data(5, 80);
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
} else if (m->particleFlags & PARTICLE_VERTICAL_STAR) {
|
||||
queue_rumble_data(5, 80);
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
} else if (m->particleFlags & PARTICLE_TRIANGLE) {
|
||||
queue_rumble_data(5, 80);
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
}
|
||||
if (m->heldObj && m->heldObj->behavior == segmented_to_virtual(bhvBobomb)) {
|
||||
reset_rumble_timers_slip();
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -72,18 +72,15 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
|
||||
if (m->vel[1] < -55.0f) {
|
||||
if (fallHeight > FALL_DAMAGE_HEIGHT_LARGE) {
|
||||
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 16 : 24;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
set_camera_shake_from_hit(SHAKE_FALL_DAMAGE);
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
|
||||
return drop_and_set_mario_action(m, hardFallAction, 4);
|
||||
} else if (fallHeight > damageHeight && !mario_floor_is_slippery(m)) {
|
||||
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 8 : 12;
|
||||
m->squishTimer = 30;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
set_camera_shake_from_hit(SHAKE_FALL_DAMAGE);
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
@@ -127,9 +124,8 @@ s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) {
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
m->particleFlags |= PARTICLE_MIST_CIRCLE;
|
||||
drop_and_set_mario_action(m, ACT_FEET_STUCK_IN_GROUND, 0);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -372,9 +368,8 @@ u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation,
|
||||
set_mario_animation(m, animation);
|
||||
|
||||
if (m->forwardVel > 16.0f) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 40);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 40);
|
||||
|
||||
mario_bonk_reflection(m, FALSE);
|
||||
m->faceAngle[1] += 0x8000;
|
||||
|
||||
@@ -487,11 +482,11 @@ s32 act_triple_jump(struct MarioState *m) {
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0);
|
||||
|
||||
common_air_action_step(m, ACT_TRIPLE_JUMP_LAND, MARIO_ANIM_TRIPLE_JUMP, 0);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
|
||||
if (m->action == ACT_TRIPLE_JUMP_LAND) {
|
||||
queue_rumble_data(5, 40);
|
||||
queue_rumble_data(m->controller, 5, 40);
|
||||
}
|
||||
#endif
|
||||
|
||||
play_flip_sounds(m, 2, 8, 20);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -503,12 +498,13 @@ s32 act_backflip(struct MarioState *m) {
|
||||
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAH_WAH_HOO);
|
||||
common_air_action_step(m, ACT_BACKFLIP_LAND, MARIO_ANIM_BACKFLIP, 0);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
|
||||
if (m->action == ACT_BACKFLIP_LAND) {
|
||||
queue_rumble_data(5, 40);
|
||||
queue_rumble_data(m->controller, 5, 40);
|
||||
}
|
||||
#endif
|
||||
|
||||
play_flip_sounds(m, 2, 3, 17);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -636,11 +632,11 @@ s32 act_long_jump(struct MarioState *m) {
|
||||
}
|
||||
|
||||
common_air_action_step(m, ACT_LONG_JUMP_LAND, animation, AIR_STEP_CHECK_LEDGE_GRAB);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
|
||||
if (m->action == ACT_LONG_JUMP_LAND) {
|
||||
queue_rumble_data(5, 40);
|
||||
queue_rumble_data(m->controller, 5, 40);
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -713,9 +709,9 @@ s32 act_twirling(struct MarioState *m) {
|
||||
}
|
||||
|
||||
m->marioObj->header.gfx.angle[1] += m->twirlYaw;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -750,9 +746,7 @@ s32 act_dive(struct MarioState *m) {
|
||||
|
||||
case AIR_STEP_LANDED:
|
||||
if (should_get_stuck_in_ground(m) && m->faceAngle[0] == -DEGREES(60)) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
m->particleFlags |= PARTICLE_MIST_CIRCLE;
|
||||
drop_and_set_mario_action(m, ACT_HEAD_STUCK_IN_GROUND, 0);
|
||||
@@ -942,9 +936,7 @@ s32 act_ground_pound(struct MarioState *m) {
|
||||
stepResult = perform_air_step(m, 0);
|
||||
if (stepResult == AIR_STEP_LANDED) {
|
||||
if (should_get_stuck_in_ground(m)) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
m->particleFlags |= PARTICLE_MIST_CIRCLE;
|
||||
set_mario_action(m, ACT_BUTT_STUCK_IN_GROUND, 0);
|
||||
@@ -992,9 +984,9 @@ s32 act_burning_jump(struct MarioState *m) {
|
||||
if (m->health < 0x100) {
|
||||
m->health = 0xFF;
|
||||
}
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1014,9 +1006,9 @@ s32 act_burning_fall(struct MarioState *m) {
|
||||
if (m->health < 0x100) {
|
||||
m->health = 0xFF;
|
||||
}
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1065,9 +1057,7 @@ s32 act_crazy_box_bounce(struct MarioState *m) {
|
||||
m->heldObj = NULL;
|
||||
set_mario_action(m, ACT_STOMACH_SLIDE, 0);
|
||||
}
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
m->particleFlags |= PARTICLE_MIST_CIRCLE;
|
||||
break;
|
||||
|
||||
@@ -1097,11 +1087,10 @@ u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFall
|
||||
break;
|
||||
|
||||
case AIR_STEP_LANDED:
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (m->action != ACT_SOFT_BONK) {
|
||||
queue_rumble_data(5, 40);
|
||||
queue_rumble_data(m->controller, 5, 40);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!check_fall_damage_or_get_stuck(m, hardFallAction)) {
|
||||
if (m->action == ACT_THROWN_FORWARD || m->action == ACT_THROWN_BACKWARD) {
|
||||
set_mario_action(m, landAction, m->hurtCounter);
|
||||
@@ -1463,14 +1452,10 @@ s32 act_hold_butt_slide_air(struct MarioState *m) {
|
||||
}
|
||||
|
||||
s32 act_lava_boost(struct MarioState *m) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) {
|
||||
#endif
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(m->input & INPUT_NONZERO_ANALOG)) {
|
||||
m->forwardVel = approach_f32(m->forwardVel, 0.0f, 0.35f, 0.35f);
|
||||
@@ -1487,9 +1472,7 @@ s32 act_lava_boost(struct MarioState *m) {
|
||||
}
|
||||
m->vel[1] = 84.0f;
|
||||
play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
} else {
|
||||
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
|
||||
if (m->actionState < ACT_STATE_LAVA_BOOST_SET_LANDING_ACTION && m->vel[1] < 0.0f) {
|
||||
@@ -1525,9 +1508,9 @@ s32 act_lava_boost(struct MarioState *m) {
|
||||
}
|
||||
|
||||
m->marioBodyState->eyeState = MARIO_EYES_DEAD;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1635,9 +1618,7 @@ s32 act_shot_from_cannon(struct MarioState *m) {
|
||||
set_mario_action(m, ACT_DIVE_SLIDE, 0);
|
||||
m->faceAngle[0] = 0;
|
||||
set_camera_mode(m->area->camera, m->area->camera->defMode, 1);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
break;
|
||||
|
||||
case AIR_STEP_HIT_WALL:
|
||||
@@ -1669,9 +1650,9 @@ s32 act_shot_from_cannon(struct MarioState *m) {
|
||||
if (m->vel[1] > 0.0f) {
|
||||
m->particleFlags |= PARTICLE_DUST;
|
||||
}
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1734,9 +1715,7 @@ s32 act_flying(struct MarioState *m) {
|
||||
|
||||
m->faceAngle[0] = 0;
|
||||
set_camera_mode(m->area->camera, m->area->camera->defMode, 1);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 60);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 60);
|
||||
break;
|
||||
|
||||
case AIR_STEP_HIT_WALL:
|
||||
@@ -1787,9 +1766,7 @@ s32 act_flying(struct MarioState *m) {
|
||||
play_sound(SOUND_ACTION_FLYING_FAST, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16),
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(50, 40);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 50, 40);
|
||||
}
|
||||
|
||||
play_sound(SOUND_MOVING_FLYING, m->marioObj->header.gfx.cameraToObject);
|
||||
@@ -1803,9 +1780,8 @@ s32 act_riding_hoot(struct MarioState *m) {
|
||||
m->usedObj->oHootMarioReleaseTime = gGlobalTimer;
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(4, 40);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 4, 40);
|
||||
|
||||
return set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
||||
@@ -1851,9 +1827,8 @@ s32 act_flying_triple_jump(struct MarioState *m) {
|
||||
|
||||
if (is_anim_past_end(m)) {
|
||||
set_mario_animation(m, MARIO_ANIM_FORWARD_SPINNING);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(8, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 8, 80);
|
||||
|
||||
m->actionState = ACT_STATE_FLYING_TRIPLE_JUMP_SPIN;
|
||||
}
|
||||
}
|
||||
@@ -1914,9 +1889,7 @@ s32 act_vertical_wind(struct MarioState *m) {
|
||||
set_mario_animation(m, MARIO_ANIM_FORWARD_SPINNING_FLIP);
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame == 1) {
|
||||
play_sound(SOUND_ACTION_SPIN, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(8, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 8, 80);
|
||||
}
|
||||
|
||||
if (is_anim_past_end(m)) {
|
||||
|
||||
@@ -133,9 +133,9 @@ s32 act_holding_pole(struct MarioState *m) {
|
||||
|
||||
add_tree_leaf_particles(m);
|
||||
play_climbing_sounds(m, 2);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
set_sound_moving_speed(SOUND_BANK_MOVING, m->angleVel[1] / 0x100 * 2);
|
||||
} else {
|
||||
m->angleVel[1] = 0;
|
||||
@@ -356,13 +356,9 @@ void update_hang_stationary(struct MarioState *m) {
|
||||
}
|
||||
|
||||
s32 act_start_hanging(struct MarioState *m) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (m->actionTimer++ == 0) {
|
||||
queue_rumble_data(5, 80);
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
}
|
||||
#else
|
||||
m->actionTimer++;
|
||||
#endif
|
||||
#ifdef BETTER_HANGING
|
||||
// immediately go into hanging if controller stick is pointed far enough in
|
||||
// any direction, and it has been at least a frame
|
||||
@@ -481,9 +477,7 @@ s32 act_hang_moving(struct MarioState *m) {
|
||||
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame == 12) {
|
||||
play_sound(SOUND_ACTION_HANGING_STEP, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(1, 30);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 1, 30);
|
||||
}
|
||||
|
||||
#ifdef BETTER_HANGING
|
||||
@@ -675,12 +669,10 @@ s32 act_grabbed(struct MarioState *m) {
|
||||
|
||||
m->faceAngle[1] = m->usedObj->oMoveAngleYaw;
|
||||
vec3f_copy(m->pos, m->marioObj->header.gfx.pos);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 60);
|
||||
#endif
|
||||
|
||||
return set_mario_action(m, (m->forwardVel >= 0.0f) ? ACT_THROWN_FORWARD : ACT_THROWN_BACKWARD,
|
||||
thrown);
|
||||
queue_rumble_data(m->controller, 5, 60);
|
||||
|
||||
return set_mario_action(m, (m->forwardVel >= 0.0f) ? ACT_THROWN_FORWARD : ACT_THROWN_BACKWARD, thrown);
|
||||
}
|
||||
|
||||
set_mario_animation(m, MARIO_ANIM_BEING_GRABBED);
|
||||
@@ -747,16 +739,14 @@ s32 act_in_cannon(struct MarioState *m) {
|
||||
marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
|
||||
|
||||
set_mario_action(m, ACT_SHOT_FROM_CANNON, 0);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(60, 70);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 60, 70);
|
||||
|
||||
m->usedObj->oAction = OPENED_CANNON_ACT_SHOOT;
|
||||
return FALSE;
|
||||
} else if (m->faceAngle[0] != startFacePitch || m->faceAngle[1] != startFaceYaw) {
|
||||
play_sound(SOUND_MOVING_AIM_CANNON, marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_vibrate(0);
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_vibrate(m->controller, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -841,9 +831,8 @@ s32 act_tornado_twirling(struct MarioState *m) {
|
||||
|
||||
vec3f_copy(marioObj->header.gfx.pos, m->pos);
|
||||
vec3s_set(marioObj->header.gfx.angle, 0, m->faceAngle[1] + m->twirlYaw, 0);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1175,9 +1175,7 @@ s32 act_death_exit(struct MarioState *m) {
|
||||
if (15 < m->actionTimer++
|
||||
&& launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, -32.0f)) {
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
#ifdef ENABLE_LIVES
|
||||
m->numLives--;
|
||||
#endif
|
||||
@@ -1212,9 +1210,7 @@ s32 act_unused_death_exit(struct MarioState *m) {
|
||||
s32 act_falling_death_exit(struct MarioState *m) {
|
||||
if (launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, 0.0f)) {
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
#ifdef ENABLE_LIVES
|
||||
m->numLives--;
|
||||
#endif
|
||||
@@ -1267,9 +1263,7 @@ s32 act_special_death_exit(struct MarioState *m) {
|
||||
}
|
||||
|
||||
if (launch_mario_until_land(m, ACT_HARD_BACKWARD_GROUND_KB, MARIO_ANIM_BACKWARD_AIR_KB, -24.0f)) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
#ifdef ENABLE_LIVES
|
||||
m->numLives--;
|
||||
#endif
|
||||
@@ -1355,9 +1349,7 @@ s32 act_bbh_enter_spin(struct MarioState *m) {
|
||||
m->flags &= ~MARIO_JUMPING;
|
||||
if (perform_air_step(m, 0) == AIR_STEP_LANDED) {
|
||||
level_trigger_warp(m, WARP_OP_SPIN_SHRINK);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(15, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 15, 80);
|
||||
m->actionState = ACT_STATE_BBH_ENTER_SPIN_END;
|
||||
}
|
||||
if (m->actionState == ACT_STATE_BBH_ENTER_SPIN_WAIT_FOR_ANIM) {
|
||||
@@ -1419,12 +1411,10 @@ s32 act_teleport_fade_out(struct MarioState *m) {
|
||||
set_mario_animation(m, m->prevAction == ACT_CROUCHING ? MARIO_ANIM_CROUCHING
|
||||
: MARIO_ANIM_FIRST_PERSON);
|
||||
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (m->actionTimer == 0) {
|
||||
queue_rumble_data(30, 70);
|
||||
queue_rumble_decay(2);
|
||||
queue_rumble_data(m->controller, 30, 70);
|
||||
queue_rumble_decay(m->controller, 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
m->flags |= MARIO_TELEPORTING;
|
||||
|
||||
@@ -1445,12 +1435,10 @@ s32 act_teleport_fade_in(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_TELEPORT, MARIO_ACTION_SOUND_PLAYED);
|
||||
set_mario_animation(m, MARIO_ANIM_FIRST_PERSON);
|
||||
|
||||
#ifdef ENABLE_RUMBLE
|
||||
if (m->actionTimer == 0) {
|
||||
queue_rumble_data(30, 70);
|
||||
queue_rumble_decay(2);
|
||||
queue_rumble_data(m->controller, 30, 70);
|
||||
queue_rumble_decay(m->controller, 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m->actionTimer < 32) {
|
||||
m->flags |= MARIO_TELEPORTING;
|
||||
@@ -1535,9 +1523,9 @@ s32 act_squished(struct MarioState *m) {
|
||||
}
|
||||
|
||||
vec3f_set(m->marioObj->header.gfx.scale, 1.8f, 0.05f, 1.8f);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(10, 80);
|
||||
#endif
|
||||
|
||||
queue_rumble_data(m->controller, 10, 80);
|
||||
|
||||
m->actionState = ACT_STATE_SQUISHED_CHECK_HEIGHT;
|
||||
}
|
||||
break;
|
||||
@@ -1639,9 +1627,7 @@ void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFra
|
||||
if (animFrame == -1) {
|
||||
play_sound_and_spawn_particles(m, SOUND_ACTION_TERRAIN_STUCK_IN_GROUND, 1);
|
||||
} else if (animFrame == unstuckFrame) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
play_sound_and_spawn_particles(m, SOUND_ACTION_UNSTUCK_FROM_GROUND, 1);
|
||||
} else if (animFrame == target2 || animFrame == target3) {
|
||||
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING);
|
||||
|
||||
@@ -1235,9 +1235,9 @@ s32 act_riding_shell_ground(struct MarioState *m) {
|
||||
}
|
||||
|
||||
adjust_sound_for_speed(m);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1339,9 +1339,9 @@ s32 act_burning_ground(struct MarioState *m) {
|
||||
}
|
||||
|
||||
m->marioBodyState->eyeState = MARIO_EYES_DEAD;
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1358,9 +1358,7 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32
|
||||
vec3f_copy(pos, m->pos);
|
||||
play_sound(SOUND_MOVING_TERRAIN_SLIDE + m->terrainSoundAddend, m->marioObj->header.gfx.cameraToObject);
|
||||
|
||||
#ifdef ENABLE_RUMBLE
|
||||
reset_rumble_timers_slip();
|
||||
#endif
|
||||
reset_rumble_timers_slip(m->controller);
|
||||
|
||||
adjust_sound_for_speed(m);
|
||||
|
||||
@@ -1475,9 +1473,8 @@ s32 act_crouch_slide(struct MarioState *m) {
|
||||
|
||||
s32 act_slide_kick_slide(struct MarioState *m) {
|
||||
if (m->input & INPUT_A_PRESSED) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
return set_jumping_action(m, ACT_FORWARD_ROLLOUT, 0);
|
||||
}
|
||||
|
||||
@@ -1507,9 +1504,8 @@ s32 act_slide_kick_slide(struct MarioState *m) {
|
||||
s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s32 animation) {
|
||||
if (m->actionTimer == 5) {
|
||||
if (!(m->input & INPUT_ABOVE_SLIDE) && (m->input & (INPUT_A_PRESSED | INPUT_B_PRESSED))) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
return drop_and_set_mario_action(
|
||||
m, m->forwardVel >= 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, 0);
|
||||
}
|
||||
@@ -1539,11 +1535,9 @@ s32 act_hold_stomach_slide(struct MarioState *m) {
|
||||
|
||||
s32 act_dive_slide(struct MarioState *m) {
|
||||
if (!(m->input & INPUT_ABOVE_SLIDE) && (m->input & (INPUT_A_PRESSED | INPUT_B_PRESSED))) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
return set_mario_action(m, m->forwardVel > 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT,
|
||||
0);
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
|
||||
return set_mario_action(m, m->forwardVel > 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, 0);
|
||||
}
|
||||
|
||||
play_mario_landing_sound_once(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
|
||||
|
||||
@@ -271,11 +271,9 @@ s32 act_throwing(struct MarioState *m) {
|
||||
|
||||
if (++m->actionTimer == 7) {
|
||||
mario_throw_held_object(m);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(3, 50);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 3, 50);
|
||||
}
|
||||
|
||||
animated_stationary_ground_step(m, MARIO_ANIM_GROUND_THROW, ACT_IDLE);
|
||||
@@ -293,11 +291,9 @@ s32 act_heavy_throw(struct MarioState *m) {
|
||||
|
||||
if (++m->actionTimer == 13) {
|
||||
mario_drop_held_object(m);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(3, 50);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 3, 50);
|
||||
}
|
||||
|
||||
animated_stationary_ground_step(m, MARIO_ANIM_HEAVY_THROW, ACT_IDLE);
|
||||
@@ -327,9 +323,7 @@ s32 act_picking_up_bowser(struct MarioState *m) {
|
||||
m->angleVel[1] = 0;
|
||||
m->marioBodyState->grabPos = GRAB_POS_BOWSER;
|
||||
mario_grab_used_object(m);
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 80);
|
||||
play_sound(SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
@@ -391,15 +385,11 @@ s32 act_holding_bowser(struct MarioState *m) {
|
||||
|
||||
// play sound on overflow
|
||||
if (m->angleVel[1] <= -0x100 && spin < m->faceAngle[1]) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(4, 20);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 4, 20);
|
||||
play_sound(SOUND_OBJ_BOWSER_SPINNING, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
if (m->angleVel[1] >= 0x100 && spin > m->faceAngle[1]) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(4, 20);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 4, 20);
|
||||
play_sound(SOUND_OBJ_BOWSER_SPINNING, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
@@ -416,14 +406,10 @@ s32 act_holding_bowser(struct MarioState *m) {
|
||||
s32 act_releasing_bowser(struct MarioState *m) {
|
||||
if (++m->actionTimer == 1) {
|
||||
if (m->actionArg == 0) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 50);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 5, 50);
|
||||
mario_throw_held_object(m);
|
||||
} else {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(4, 50);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 4, 50);
|
||||
mario_drop_held_object(m);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,16 +765,14 @@ s32 act_stop_crawling(struct MarioState *m) {
|
||||
|
||||
s32 act_shockwave_bounce(struct MarioState *m) {
|
||||
if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_SHOCKWAVE) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(70, 40);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 70, 40);
|
||||
|
||||
return hurt_and_set_mario_action(m, ACT_SHOCKED, 0, 4);
|
||||
}
|
||||
|
||||
if (m->actionTimer == 0) {
|
||||
#ifdef ENABLE_RUMBLE
|
||||
queue_rumble_data(70, 40);
|
||||
#endif
|
||||
queue_rumble_data(m->controller, 70, 40);
|
||||
|
||||
if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_KNOCKBACK_DMG) {
|
||||
return hurt_and_set_mario_action(m, ACT_BACKWARD_GROUND_KB, 0, 0xc);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user