diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..d8bc7d9 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VERSION b/VERSION index 5e008de..2c854bc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v3.0.1 \ No newline at end of file +v3.0.2 \ No newline at end of file diff --git a/include/dialog_ids.h b/include/dialog_ids.h index 05f49a0..7319148 100644 --- a/include/dialog_ids.h +++ b/include/dialog_ids.h @@ -178,6 +178,7 @@ enum DialogId { DIALOG_172, DIALOG_173, DIALOG_174, + DIALOG_175, DIALOG_COUNT }; diff --git a/src/audio/external.c b/src/audio/external.c index 7a6a8e4..eaab82b 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -114,7 +114,7 @@ u8 sDialogSpeaker[] = { /*14*/ _, _, _, _, _, _, _, _, _, _, /*15*/ WIGLR, WIGLR, WIGLR, _, _, _, _, _, _, _, /*16*/ _, YOSHI, _, _, _, _, _, _, WIGLR, _, - /*NW*/ _, _, TUXIE, TUXIE, _ + /*NW*/ _, _, TUXIE, TUXIE, _, _ }; #undef _ STATIC_ASSERT(ARRAY_COUNT(sDialogSpeaker) == DIALOG_COUNT, diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index 15f4ac7..6b89738 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -991,11 +991,11 @@ void cur_obj_update(void) { } else if ((objFlags & OBJ_FLAG_COMPUTE_DIST_TO_MARIO) && gCurrentObject->collisionData == NULL) { if (!(objFlags & OBJ_FLAG_ACTIVE_FROM_AFAR)) { if (configDrawDistanceMultiplier <= 0.0f) { - if (distanceFromMario <= gCurrentObject->oDrawingDistance && gCurrentObject->oHeldState == HELD_FREE) - { - gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; - gCurrentObject->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY; - } + if (distanceFromMario <= gCurrentObject->oDrawingDistance && gCurrentObject->oHeldState == HELD_FREE) + { + gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; + gCurrentObject->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY; + } } else { // If the object has a render distance, check if it should be shown. @@ -1011,4 +1011,4 @@ void cur_obj_update(void) { } } } -} +} \ No newline at end of file diff --git a/src/game/behaviors/donut_platform.inc.c b/src/game/behaviors/donut_platform.inc.c index f1503a0..e536e89 100644 --- a/src/game/behaviors/donut_platform.inc.c +++ b/src/game/behaviors/donut_platform.inc.c @@ -28,7 +28,7 @@ void bhv_donut_platform_spawner_update(void) { marioSqDist = dx * dx + dy * dy + dz * dz; // dist > 1000 and dist < 2000 - if (marioSqDist > 1000000.0f && marioSqDist < 4000000.0f) { + if (marioSqDist > 1000000.0f && ((marioSqDist < 4000000.0f * configDrawDistanceMultiplier) || configDrawDistanceMultiplier <= 0.0)) { if (spawn_object_relative(i, sDonutPlatformPositions[i][0], sDonutPlatformPositions[i][1], sDonutPlatformPositions[i][2], o, MODEL_RR_DONUT_PLATFORM, bhvDonutPlatform) @@ -41,12 +41,14 @@ void bhv_donut_platform_spawner_update(void) { } void bhv_donut_platform_update(void) { - if (o->oTimer != 0 && ((o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) || o->oDistanceToMario > 2500.0f)) { + f32 dist = 2500.0f * configDrawDistanceMultiplier; + + if (o->oTimer != 0 && ((o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) || (o->oDistanceToMario > dist && configDrawDistanceMultiplier > 0.0))) { o->parentObj->oDonutPlatformSpawnerSpawnedPlatforms = o->parentObj->oDonutPlatformSpawnerSpawnedPlatforms & ((1 << o->oBehParams2ndByte) ^ 0xFFFFFFFF); - if (o->oDistanceToMario > 2500.0f) { + if (o->oDistanceToMario > dist && configDrawDistanceMultiplier > 0.0) { obj_mark_for_deletion(o); } else { obj_explode_and_spawn_coins(150.0f, 1); @@ -70,4 +72,4 @@ void bhv_donut_platform_update(void) { load_object_collision_model(); } -} +} \ No newline at end of file diff --git a/src/game/mario.c b/src/game/mario.c index 94ccec5..96cc77a 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1567,7 +1567,7 @@ void update_mario_health(struct MarioState *m) { // Play a noise to alert the player when Mario is close to drowning. if (((m->action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED) && (m->health < 0x300) && (!(save_file_get_flags() & SAVE_FLAG_DAREDEVIL_MODE)) && (!mario_has_improved_metal_cap(m))) { play_sound(SOUND_MOVING_ALMOST_DROWNING, gGlobalSoundSource); -#ifdef ENABLE_RUMBLE +#if ENABLE_RUMBLE if (!gRumblePakTimer) { gRumblePakTimer = 36; if (is_rumble_finished_and_queue_empty()) { diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index 56747da..4ab7b27 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -92,7 +92,7 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) { if (!configDisableFallDamage) { m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 16 : 24; } -#ifdef ENABLE_RUMBLE +#if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif set_camera_shake_from_hit(SHAKE_FALL_DAMAGE); @@ -2328,4 +2328,4 @@ s32 mario_execute_airborne_action(struct MarioState *m) { } return cancel; -} +} \ No newline at end of file diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index 591622a..5d5c051 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -615,8 +615,13 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { } // We will be extending the cap timer artificially for this star. if (configStayInCourse && gCollectedStar == 5 && gCurrLevelNum == LEVEL_DDD) { - m->flags |= MARIO_VANISH_CAP | MARIO_METAL_CAP | MARIO_CAP_ON_HEAD; - m->capTimer = 300; + + if (m->flags & MARIO_CAP_ON_HEAD) { + m->flags |= MARIO_VANISH_CAP; + } + if (m->capTimer < 300) { + m->capTimer = 300; + } } break; @@ -635,7 +640,18 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { } else { // Ugly code ahead! - // This is the most readable I could make the code without overcomplicating it + // This is the most readable I could make the code without overcomplicating it + + // First let's get if we have all the stars + s32 i; + u8 starCount = 0; + u8 flag = 1; + u8 starFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1); + for (i = 0; i < 7; i++, flag <<= 1) { + if (!(starFlags & flag)) { + starCount++; + } + } // If we set it to ask if (configStayInCourse > 0 && @@ -650,6 +666,11 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { create_dialog_box_with_response(gLastCompletedStarNum == 7 ? DIALOG_171 : DIALOG_170); m->actionState = 1; } + else if (configStayInCourse == 2 && starCount >= 7) { + enable_time_stop(); + create_dialog_box_with_response(gLastCompletedStarNum == 7 ? DIALOG_171 : DIALOG_175); + m->actionState = 1; + } // If it's automatic else if (configStayInCourse == 3) { if ((gLastCompletedStarNum == 7) || diff --git a/src/game/settings.c b/src/game/settings.c index a739c5b..1e67e91 100644 --- a/src/game/settings.c +++ b/src/game/settings.c @@ -303,7 +303,7 @@ unsigned int configButtonCLeft = 0; unsigned int configButtonCRight = 0; unsigned int gControllerLeftDeadzone = 512; unsigned int gControllerRightDeadzone = 512; -float configRumbleStrength = 0.5f; +float configRumbleStrength = 0.25f; unsigned int configKeyA = DIK_L; unsigned int configKeyB = DIK_COMMA; diff --git a/src/pc/controller/controller_sdl2.c b/src/pc/controller/controller_sdl2.c index ff8ccaf..15e3cc8 100644 --- a/src/pc/controller/controller_sdl2.c +++ b/src/pc/controller/controller_sdl2.c @@ -45,7 +45,7 @@ static SDL_Haptic *controller_sdl_init_haptics(const int joy) { if (!haptics_enabled) return NULL; SDL_Haptic *hap = SDL_HapticOpen(joy); - if (!hap) return NULL; + if (hap == NULL) return NULL; if (SDL_HapticRumbleSupported(hap) != SDL_TRUE) { SDL_HapticClose(hap); diff --git a/text/us/dialogs.h b/text/us/dialogs.h index 89bd997..d30032b 100644 --- a/text/us/dialogs.h +++ b/text/us/dialogs.h @@ -2150,5 +2150,12 @@ and run circles around\n\ the fountain exactly\n\ 2401 times Luigi will\n\ come to visit you!\n\ -Now could please leave me\n\ -alone?")) \ No newline at end of file +Now could you please\n\ +leave me alone?")) + +DEFINE_DIALOG(DIALOG_175, 1, 5, 30, 200, _("\ +Wow! That's all 7 Power\n\ +Stars! Do you want to\n\ +keep playing this level?\n\ +\n\ +//You Bet//Not Now")) \ No newline at end of file