diff options
| author | Eblo <7004497+Eblo@users.noreply.github.com> | 2025-09-03 08:38:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-03 08:38:51 -0400 |
| commit | 47771de011abced823d9b699fffc8832fedff1b7 (patch) | |
| tree | 04078e987e23512b25a05575ad142443361cbfa9 | |
| parent | 78b824b99bb6d82609e1ec171b593b26ff02b3aa (diff) | |
Merge develop-rena -> develop (#1258)
* add health check preventing hop counter reset on death (#1214)
* Fix rando refills for Chateau Romani (#1216)
* Allow access to smithy checks without a sword (#1208)
* Fix float slider labels (#1210)
* Do not allow gameover audio to be changed (#1225)
* Fix slider labels where position is None (#1227)
* Fix BSoDT bugs with audio and early day change (#1228)
* Properly configure INCLUDE_MPQ_SUPPORT (#1243)
* Check previousBankValue in custom bank thresholds (#1232)
* Restore vertices after geometry seams patch (#1237)
* Fix softlock with Magic Hag's Blue Potion (#1252)
* Revert "Fix cracking/buzzing with streamed audio (#1153)" (#1233)
This reverts commit 120c657607dc3c7b5d8e063d457744733bb5b668.
* [Rando] Reset cycle collectible flags on cycle save (#1254)
* bump to Rena Bravo (#1257)
---------
Co-authored-by: mckinlee <mckinlee@ymail.com>
Co-authored-by: balloondude2 <55861555+balloondude2@users.noreply.github.com>
| -rw-r--r-- | .github/workflows/main.yml | 6 | ||||
| -rw-r--r-- | CMakeLists.txt | 8 | ||||
| -rw-r--r-- | mm/2s2h/BenGui/BenMenu.cpp | 4 | ||||
| -rw-r--r-- | mm/2s2h/BenGui/UIWidgets.cpp | 8 | ||||
| -rw-r--r-- | mm/2s2h/Enhancements/Audio/AudioCollection.cpp | 2 | ||||
| -rw-r--r-- | mm/2s2h/Enhancements/DifficultyOptions/CustomBankRewardThresholds.cpp | 9 | ||||
| -rw-r--r-- | mm/2s2h/Enhancements/GfxPatcher/AuthenticGfxPatches.cpp | 28 | ||||
| -rw-r--r-- | mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp | 4 | ||||
| -rw-r--r-- | mm/2s2h/Enhancements/Songs/BetterSongOfDoubleTime.cpp | 5 | ||||
| -rw-r--r-- | mm/2s2h/GameInteractor/GameInteractor.h | 1 | ||||
| -rw-r--r-- | mm/2s2h/Rando/ActorBehavior/EnKgy.cpp | 3 | ||||
| -rw-r--r-- | mm/2s2h/Rando/ActorBehavior/EnTrt.cpp | 3 | ||||
| -rw-r--r-- | mm/2s2h/Rando/ConvertItem.cpp | 6 | ||||
| -rw-r--r-- | mm/2s2h/Rando/MiscBehavior/OnCycleSave.cpp | 13 | ||||
| -rw-r--r-- | mm/2s2h/Rando/StaticData/Checks.cpp | 2 | ||||
| -rw-r--r-- | mm/src/audio/lib/synthesis.c | 5 | ||||
| -rw-r--r-- | mm/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c | 9 | ||||
| -rw-r--r-- | mm/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 5 |
18 files changed, 77 insertions, 44 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb5807118..7b67de5a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,7 +130,7 @@ jobs: - name: Build 2Ship run: | export PATH="/usr/lib/ccache:/opt/homebrew/opt/ccache/libexec:/usr/local/opt/ccache/libexec:$PATH" - cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DINCLUDE_MPQ_SUPPORT=1 + cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" cmake --build build-cmake --config Release --parallel 10 (cd build-cmake && cpack) @@ -229,7 +229,7 @@ jobs: - name: Build 2Ship run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1 -DINCLUDE_MPQ_SUPPORT=1 + cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1 cmake --build build-cmake --config Release -j3 (cd build-cmake && cpack -G External) @@ -296,7 +296,7 @@ jobs: VCPKG_ROOT: ${{github.workspace}}/vcpkg run: | set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" - cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DINCLUDE_MPQ_SUPPORT=1 + cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build build-windows --config Release --parallel 10 (cd build-windows && cpack) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2999bd5f7..dbbe38d4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,10 +5,10 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version") set(GAME_STR "MM") -project(2s2h VERSION 2.0.0 LANGUAGES C CXX) +project(2s2h VERSION 2.0.1 LANGUAGES C CXX) include(CMake/2ship-cvars.cmake) include(CMake/lus-cvars.cmake) -set(PROJECT_BUILD_NAME "Rena Alfa" CACHE STRING "" FORCE) +set(PROJECT_BUILD_NAME "Rena Bravo" CACHE STRING "" FORCE) set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE) execute_process( @@ -70,6 +70,9 @@ set(GBI_UCODE F3DEX_GBI_2) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") +# Enable MPQ and OTR support +set(INCLUDE_MPQ_SUPPORT ON) + ################################################################################ # Set target arch type if empty. Visual studio solution generator provides it. ################################################################################ @@ -153,6 +156,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Sub-projects ################################################################################ add_subdirectory(libultraship ${CMAKE_BINARY_DIR}/libultraship) +target_compile_definitions(libultraship PUBLIC INCLUDE_MPQ_SUPPORT) add_subdirectory(ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD) add_subdirectory(OTRExporter) add_subdirectory(mm) diff --git a/mm/2s2h/BenGui/BenMenu.cpp b/mm/2s2h/BenGui/BenMenu.cpp index 389977e9c..c8dd6ad03 100644 --- a/mm/2s2h/BenGui/BenMenu.cpp +++ b/mm/2s2h/BenGui/BenMenu.cpp @@ -537,7 +537,7 @@ void BenMenu::AddSettings() { .Tooltip("Which corner of the screen notifications appear in.") .ComboVec(¬ificationPosition) .DefaultIndex(3)); - AddWidget(path, "Duration: %.0f seconds", WIDGET_CVAR_SLIDER_FLOAT) + AddWidget(path, "Duration: %.1f seconds", WIDGET_CVAR_SLIDER_FLOAT) .CVar("gNotifications.Duration") .Options(FloatSliderOptions() .Tooltip("How long notifications are displayed for.") @@ -580,7 +580,7 @@ void BenMenu::AddSettings() { AddWidget(path, "Hide Window Background", WIDGET_CVAR_CHECKBOX) .CVar("gDisplayOverlay.Background") .Options(CheckboxOptions().Tooltip("Hides the background of the Display Overlay window.")); - AddWidget(path, "Scale: %.0fx", WIDGET_CVAR_SLIDER_FLOAT) + AddWidget(path, "Scale: %.1fx", WIDGET_CVAR_SLIDER_FLOAT) .CVar("gDisplayOverlay.Scale") .Options(FloatSliderOptions() .Tooltip("Adjust the Scale for the Display Overlay window.") diff --git a/mm/2s2h/BenGui/UIWidgets.cpp b/mm/2s2h/BenGui/UIWidgets.cpp index c553b3b1b..d7971fdf8 100644 --- a/mm/2s2h/BenGui/UIWidgets.cpp +++ b/mm/2s2h/BenGui/UIWidgets.cpp @@ -573,7 +573,7 @@ bool SliderInt(const char* label, int32_t* value, const IntSliderOptions& option if (options.labelPosition == LabelPosition::Near) { ImGui::SameLine(); ImGui::Text(label, *value); - } else if (options.labelPosition == LabelPosition::Far || options.labelPosition == LabelPosition::None) { + } else if (options.labelPosition == LabelPosition::Far) { ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x + ImGui::GetStyle().ItemSpacing.x); ImGui::Text(label, *value); @@ -652,7 +652,7 @@ bool SliderFloat(const char* label, float* value, const FloatSliderOptions& opti } ImGui::AlignTextToFramePadding(); if (options.alignment == ComponentAlignment::Right) { - ImGui::Text(label, *value); + ImGui::Text(label, valueToDisplay); if (options.labelPosition == LabelPosition::Above) { ImGui::NewLine(); ImGui::SameLine(ImGui::GetContentRegionAvail().x - width); @@ -665,7 +665,7 @@ bool SliderFloat(const char* label, float* value, const FloatSliderOptions& opti } } else if (options.alignment == ComponentAlignment::Left) { if (options.labelPosition == LabelPosition::Above) { - ImGui::Text(label, *value); + ImGui::Text(label, valueToDisplay); } } float buttonsWidth = 0; @@ -716,7 +716,7 @@ bool SliderFloat(const char* label, float* value, const FloatSliderOptions& opti if (options.labelPosition == LabelPosition::Near) { ImGui::SameLine(); ImGui::Text(label, *value); - } else if (options.labelPosition == LabelPosition::Far || options.labelPosition == LabelPosition::None) { + } else if (options.labelPosition == LabelPosition::Far) { ImGui::SameLine(ImGui::GetContentRegionAvail().x - labelSpacing); ImGui::Text(label, *value); } diff --git a/mm/2s2h/Enhancements/Audio/AudioCollection.cpp b/mm/2s2h/Enhancements/Audio/AudioCollection.cpp index 0d29b900f..66d41c155 100644 --- a/mm/2s2h/Enhancements/Audio/AudioCollection.cpp +++ b/mm/2s2h/Enhancements/Audio/AudioCollection.cpp @@ -61,7 +61,7 @@ AudioCollection::AudioCollection() { "NA_BGM_CLOCK_TOWN_MAIN_SEQUENCE", SEQ_BGM_WORLD, false, false), SEQUENCE_MAP_ENTRY(NA_BGM_OPENING, "Opening", "NA_BGM_OPENING", SEQ_BGM_WORLD, true, true), SEQUENCE_MAP_ENTRY(NA_BGM_INSIDE_A_HOUSE, "Inside House", "NA_BGM_INSIDE_A_HOUSE", SEQ_BGM_WORLD, true, true), - SEQUENCE_MAP_ENTRY(NA_BGM_GAME_OVER, "Game Over", "NA_BGM_GAME_OVER", SEQ_BGM_EVENT, true, true), + SEQUENCE_MAP_ENTRY(NA_BGM_GAME_OVER, "Game Over", "NA_BGM_GAME_OVER", SEQ_BGM_EVENT, false, true), SEQUENCE_MAP_ENTRY(NA_BGM_CLEAR_BOSS, "Clear Boss", "NA_BGM_CLEAR_BOSS", SEQ_BGM_BATTLE, true, true), SEQUENCE_MAP_ENTRY(NA_BGM_GET_ITEM, "Get Item", "NA_BGM_GET_ITEM", SEQ_FANFARE, true, true), SEQUENCE_MAP_ENTRY(NA_BGM_CLOCK_TOWN_DAY_2_PTR, "Clock Town Day 2 (Alt)", "NA_BGM_CLOCK_TOWN_DAY_2_PTR", diff --git a/mm/2s2h/Enhancements/DifficultyOptions/CustomBankRewardThresholds.cpp b/mm/2s2h/Enhancements/DifficultyOptions/CustomBankRewardThresholds.cpp index 48be6d964..b08615e84 100644 --- a/mm/2s2h/Enhancements/DifficultyOptions/CustomBankRewardThresholds.cpp +++ b/mm/2s2h/Enhancements/DifficultyOptions/CustomBankRewardThresholds.cpp @@ -19,13 +19,15 @@ void RegisterCustomBankRewardThresholds() { COND_VB_SHOULD(VB_PASS_FIRST_BANK_THRESHOLD, CVAR, { EnGinkoMan* enGinkoMan = va_arg(args, EnGinkoMan*); - *should = (HS_GET_BANK_RUPEES() >= FIRST_BANK_THRESHOLD) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_10_08); + *should = (HS_GET_BANK_RUPEES() >= FIRST_BANK_THRESHOLD) && + (enGinkoMan->previousBankValue < FIRST_BANK_THRESHOLD) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_10_08); }); COND_VB_SHOULD(VB_PASS_INTEREST_BANK_THRESHOLD, CVAR, { EnGinkoMan* enGinkoMan = va_arg(args, EnGinkoMan*); - *should = (HS_GET_BANK_RUPEES() >= INTEREST_BANK_THRESHOLD); + *should = (HS_GET_BANK_RUPEES() >= INTEREST_BANK_THRESHOLD && + enGinkoMan->previousBankValue < INTEREST_BANK_THRESHOLD); }); COND_VB_SHOULD(VB_PASS_SECOND_BANK_THRESHOLD, CVAR, { @@ -39,7 +41,8 @@ void RegisterCustomBankRewardThresholds() { COND_VB_SHOULD(VB_PASS_SECOND_BANK_THRESHOLD_ALT, CVAR, { EnGinkoMan* enGinkoMan = va_arg(args, EnGinkoMan*); - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_59_08) && HS_GET_BANK_RUPEES() >= SECOND_BANK_THRESHOLD) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_59_08) && HS_GET_BANK_RUPEES() >= SECOND_BANK_THRESHOLD && + enGinkoMan->previousBankValue < SECOND_BANK_THRESHOLD) { *should = true; } }); diff --git a/mm/2s2h/Enhancements/GfxPatcher/AuthenticGfxPatches.cpp b/mm/2s2h/Enhancements/GfxPatcher/AuthenticGfxPatches.cpp index 4e7de426c..cd3b79e17 100644 --- a/mm/2s2h/Enhancements/GfxPatcher/AuthenticGfxPatches.cpp +++ b/mm/2s2h/Enhancements/GfxPatcher/AuthenticGfxPatches.cpp @@ -14,6 +14,7 @@ void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int ind void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); char* ResourceMgr_LoadTexOrDListByName(const char* path); Gfx* ResourceMgr_LoadGfxByName(const char* path); +char* ResourceMgr_LoadVtxArrayByName(const char* path); } #define dgameplay_keep_Tex_00CA30_Overflow "__OTR__objects/gameplay_keep/gameplay_keep_Tex_00CA30_Overflow" @@ -317,22 +318,23 @@ Vtx southClockTownRampVtx[5] = { { { { -640, 100, -1253 }, 0, { 1253, 1024 }, { 208, 118, 0, 255 } } }, }; -Gfx southClockTownRampDL[] = { - gsSPVertex(southClockTownRampVtx + 0, 5, 0), - gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), - gsSP1Triangle(3, 4, 2, 0), - gsSPEndDisplayList(), -}; - void PatchGeometrySeams() { + static Gfx southClockTownRampDL[] = { + gsSPVertex(southClockTownRampVtx + 0, 5, 0), + gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), + gsSP1Triangle(3, 4, 2, 0), + // Restore the unmodified vertices after the seam patch + gsSPVertex( + (Vtx*)ResourceMgr_LoadVtxArrayByName("__OTR__scenes/nonmq/Z2_CLOCKTOWER/Z2_CLOCKTOWER_room_00Vtx_002A90") + + 14, + 32, 0), + gsSPEndDisplayList(), + }; if (CVarGetInteger("gEnhancements.Graphics.FixSceneGeometrySeams", 0)) { - ResourceMgr_PatchGfxByName("scenes/nonmq/Z2_CLOCKTOWER/Z2_CLOCKTOWER_room_00DL_0032D0", "clockTownRampSeam1", - 49, gsSPDisplayList(southClockTownRampDL)); - ResourceMgr_PatchGfxByName("scenes/nonmq/Z2_CLOCKTOWER/Z2_CLOCKTOWER_room_00DL_0032D0", "clockTownRampSeam2", - 50, gsSPNoOp()); + ResourceMgr_PatchGfxByName("scenes/nonmq/Z2_CLOCKTOWER/Z2_CLOCKTOWER_room_00DL_0032D0", "clockTownRampSeam", 49, + gsSPDisplayList(southClockTownRampDL)); } else { - ResourceMgr_UnpatchGfxByName("scenes/nonmq/Z2_CLOCKTOWER/Z2_CLOCKTOWER_room_00DL_0032D0", "clockTownRampSeam1"); - ResourceMgr_UnpatchGfxByName("scenes/nonmq/Z2_CLOCKTOWER/Z2_CLOCKTOWER_room_00DL_0032D0", "clockTownRampSeam2"); + ResourceMgr_UnpatchGfxByName("scenes/nonmq/Z2_CLOCKTOWER/Z2_CLOCKTOWER_room_00DL_0032D0", "clockTownRampSeam"); } } diff --git a/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp b/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp index 7f13b840b..ee1dd67e4 100644 --- a/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp +++ b/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp @@ -13,7 +13,9 @@ void RegisterInfiniteDekuHopping() { COND_VB_SHOULD(VB_DEKU_LINK_SPIN_ON_LAST_HOP, CVAR, { if (*should) { Player* player = GET_PLAYER(gPlayState); - player->remainingHopsCounter = 5; + if (gSaveContext.save.saveInfo.playerData.health != 0) { + player->remainingHopsCounter = 5; + } } }); diff --git a/mm/2s2h/Enhancements/Songs/BetterSongOfDoubleTime.cpp b/mm/2s2h/Enhancements/Songs/BetterSongOfDoubleTime.cpp index ceb19e3ee..5f04c790e 100644 --- a/mm/2s2h/Enhancements/Songs/BetterSongOfDoubleTime.cpp +++ b/mm/2s2h/Enhancements/Songs/BetterSongOfDoubleTime.cpp @@ -136,7 +136,7 @@ void OnPlayerUpdate(Actor* actor) { gSaveContext.respawnFlag = 2; // Stop BGM so that new day sequences can play - gSaveContext.seqId = (u8)NA_BGM_DISABLED; + gSaveContext.seqId = NA_BGM_DISABLED; GameInteractor::Instance->UnregisterGameHookForID<GameInteractor::OnActorKill>(onEnTest6KillHookId); onEnTest6KillHookId = 0; @@ -226,7 +226,8 @@ void OnPlayerUpdate(Actor* actor) { sSelectedTime = newTime; } else if (adjustMode == ADJUST_DIRECTION_REVERSE) { // Reverse time u16 newTime = sSelectedTime - interval; - if (sSelectedDay == sOriginalDay && CLOCK_TIME_NORMALIZED(newTime) < CLOCK_TIME_NORMALIZED(sOriginalTime)) { + if (sSelectedDay == sOriginalDay && (CLOCK_TIME_NORMALIZED(newTime) < CLOCK_TIME_NORMALIZED(sOriginalTime) || + interval > CLOCK_TIME_NORMALIZED(sSelectedTime))) { newTime = sOriginalTime; } // Day decrementing diff --git a/mm/2s2h/GameInteractor/GameInteractor.h b/mm/2s2h/GameInteractor/GameInteractor.h index c2eb32905..83729fa6c 100644 --- a/mm/2s2h/GameInteractor/GameInteractor.h +++ b/mm/2s2h/GameInteractor/GameInteractor.h @@ -147,6 +147,7 @@ typedef enum { VB_DEKU_GUARD_SHOW_SEARCH_BALLS, VB_DISPLAY_SONG_OF_DOUBLE_TIME_PROMPT, VB_SMITHY_START_UPGRADING_SWORD, + VB_SMITHY_CHECK_FOR_SWORD, VB_SMITHY_CHECK_FOR_RAZOR_SWORD, VB_SMITHY_CHECK_FOR_GILDED_SWORD, VB_HAVE_BLAST_MASK, diff --git a/mm/2s2h/Rando/ActorBehavior/EnKgy.cpp b/mm/2s2h/Rando/ActorBehavior/EnKgy.cpp index b45a90936..b6de69fd0 100644 --- a/mm/2s2h/Rando/ActorBehavior/EnKgy.cpp +++ b/mm/2s2h/Rando/ActorBehavior/EnKgy.cpp @@ -28,6 +28,9 @@ void Rando::ActorBehavior::InitEnKgyBehavior() { *should = false; }); + // Allow player to get checks without a sword + COND_VB_SHOULD(VB_SMITHY_CHECK_FOR_SWORD, IS_RANDO, { *should = false; }); + COND_VB_SHOULD(VB_SMITHY_CHECK_FOR_RAZOR_SWORD, IS_RANDO, { RandoSaveCheck& randoRazorSwordSaveCheck = RANDO_SAVE_CHECKS[RC_MOUNTAIN_VILLAGE_SMITHY_RAZOR_SWORD]; *should = randoRazorSwordSaveCheck.cycleObtained; diff --git a/mm/2s2h/Rando/ActorBehavior/EnTrt.cpp b/mm/2s2h/Rando/ActorBehavior/EnTrt.cpp index e1478464c..ec32cb306 100644 --- a/mm/2s2h/Rando/ActorBehavior/EnTrt.cpp +++ b/mm/2s2h/Rando/ActorBehavior/EnTrt.cpp @@ -31,7 +31,8 @@ void Rando::ActorBehavior::InitEnTrtBehavior() { return; } if (!RANDO_SAVE_CHECKS[RC_HAGS_POTION_SHOP_KOTAKE].shuffled || - RANDO_SAVE_CHECKS[RC_HAGS_POTION_SHOP_KOTAKE].cycleObtained) { + RANDO_SAVE_CHECKS[RC_HAGS_POTION_SHOP_KOTAKE].cycleObtained || + (*item != GI_POTION_RED_BOTTLE && *item != GI_POTION_RED)) { return; } diff --git a/mm/2s2h/Rando/ConvertItem.cpp b/mm/2s2h/Rando/ConvertItem.cpp index 6cb753b94..771878052 100644 --- a/mm/2s2h/Rando/ConvertItem.cpp +++ b/mm/2s2h/Rando/ConvertItem.cpp @@ -547,11 +547,15 @@ RandoItemId Rando::ConvertItem(RandoItemId randoItemId, RandoCheckId randoCheckI } break; case RI_BOTTLE_MILK: - case RI_BOTTLE_CHATEAU_ROMANI: if (Inventory_HasEmptyBottle()) { return RI_MILK_REFILL; } break; + case RI_BOTTLE_CHATEAU_ROMANI: + if (Inventory_HasEmptyBottle()) { + return RI_CHATEAU_ROMANI_REFILL; + } + break; case RI_BOTTLE_RED_POTION: if (Inventory_HasEmptyBottle()) { return RI_RED_POTION_REFILL; diff --git a/mm/2s2h/Rando/MiscBehavior/OnCycleSave.cpp b/mm/2s2h/Rando/MiscBehavior/OnCycleSave.cpp index 7d5be88b8..40823778b 100644 --- a/mm/2s2h/Rando/MiscBehavior/OnCycleSave.cpp +++ b/mm/2s2h/Rando/MiscBehavior/OnCycleSave.cpp @@ -103,8 +103,17 @@ void Rando::MiscBehavior::AfterEndOfCycleSave() { ~(1 << (randoStaticCheck.flag & 0x1F)); } break; - // most of the others are handled by the game, with the exception of PERSISTENT_CYCLE_FLAGS_SET, not - // sure if any of these cases affect us yet so ignoring for now + case FLAG_CYCL_SCENE_COLLECTIBLE: + // Clear the flag without triggering hook + if (gPlayState->sceneId == randoStaticCheck.sceneId) { + gPlayState->actorCtx.sceneFlags.collectible[(randoStaticCheck.flag & ~0x1F) >> 5] &= + ~(1 << (randoStaticCheck.flag & 0x1F)); + } + gSaveContext.save.saveInfo.permanentSceneFlags[randoStaticCheck.sceneId].collectible &= + ~(1 << (randoStaticCheck.flag & 0x1F)); + gSaveContext.cycleSceneFlags[randoStaticCheck.sceneId].collectible &= + ~(1 << (randoStaticCheck.flag & 0x1F)); + break; } } diff --git a/mm/2s2h/Rando/StaticData/Checks.cpp b/mm/2s2h/Rando/StaticData/Checks.cpp index b10ebaee9..130c3320b 100644 --- a/mm/2s2h/Rando/StaticData/Checks.cpp +++ b/mm/2s2h/Rando/StaticData/Checks.cpp @@ -51,7 +51,7 @@ std::map<RandoCheckId, RandoStaticCheck> Checks = { RC(RC_CLOCK_TOWN_GREAT_FAIRY_ALT, RCTYPE_NPC, SCENE_YOUSEI_IZUMI, FLAG_NONE, 0x00, RI_MASK_GREAT_FAIRY), RC(RC_CLOCK_TOWN_GREAT_FAIRY, RCTYPE_NPC, SCENE_YOUSEI_IZUMI, FLAG_NONE, 0x00, RI_PROGRESSIVE_MAGIC), RC(RC_CLOCK_TOWN_LAUNDRY_GURU_GURU, RCTYPE_NPC, SCENE_ALLEY, FLAG_WEEK_EVENT_REG, WEEKEVENTREG_38_40, RI_MASK_BREMEN), - RC(RC_CLOCK_TOWN_NORTH_BOMB_LADY, RCTYPE_NPC, SCENE_BACKTOWN, FLAG_CYCL_SCENE_COLLECTIBLE, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK, RI_MASK_BLAST), + RC(RC_CLOCK_TOWN_NORTH_BOMB_LADY, RCTYPE_NPC, SCENE_BACKTOWN, FLAG_WEEK_EVENT_REG, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK, RI_MASK_BLAST), RC(RC_CLOCK_TOWN_NORTH_TINGLE_MAP_01, RCTYPE_TINGLE_SHOP, SCENE_BACKTOWN, FLAG_NONE, 0x00, RI_TINGLE_MAP_CLOCK_TOWN), RC(RC_CLOCK_TOWN_NORTH_TINGLE_MAP_02, RCTYPE_TINGLE_SHOP, SCENE_BACKTOWN, FLAG_NONE, 0x00, RI_TINGLE_MAP_WOODFALL), RC(RC_CLOCK_TOWN_NORTH_TREE_PIECE_OF_HEART, RCTYPE_HEART, SCENE_BACKTOWN, FLAG_CYCL_SCENE_COLLECTIBLE, 0x0A, RI_HEART_PIECE), diff --git a/mm/src/audio/lib/synthesis.c b/mm/src/audio/lib/synthesis.c index a2e4d5845..89cb0e8ba 100644 --- a/mm/src/audio/lib/synthesis.c +++ b/mm/src/audio/lib/synthesis.c @@ -1157,9 +1157,8 @@ Acmd* AudioSynth_ProcessSample(s32 noteIndex, NoteSampleState* sampleState, Note numSamplesProcessed += numSamplesToLoadAdj; dmemUncompressedAddrOffset1 = numSamplesToLoadAdj; - if (((synthState->samplePosInt * 2) + (numSamplesToLoadAdj + 16) * SAMPLE_SIZE) < - sample->size) { - bytesToRead = (numSamplesToLoadAdj + 16) * SAMPLE_SIZE; + if (((synthState->samplePosInt * 2) + (numSamplesToLoadAdj)*SAMPLE_SIZE) < sample->size) { + bytesToRead = (numSamplesToLoadAdj)*SAMPLE_SIZE; } else { bytesToRead = sample->size - (synthState->samplePosInt * 2); } diff --git a/mm/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c b/mm/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c index 41a55bff2..fa40faf88 100644 --- a/mm/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c +++ b/mm/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c @@ -6,6 +6,7 @@ #include "z_en_kbt.h" #include "BenPort.h" +#include "2s2h/GameInteractor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) @@ -330,9 +331,11 @@ void func_80B34314(EnKbt* this, PlayState* play) { } else if (this->actor.xzDistToPlayer < 250.0f) { if ((this->unk_278 != NULL) && (this->unk_278->xzDistToPlayer < 250.0f)) { if (this->unk_27C & 4) { - if ((GET_PLAYER_FORM != PLAYER_FORM_HUMAN) || ((CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_KOKIRI) && - (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_RAZOR) && - (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_GILDED))) { + if ((GET_PLAYER_FORM != PLAYER_FORM_HUMAN) || + GameInteractor_Should(VB_SMITHY_CHECK_FOR_SWORD, + ((CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_KOKIRI) && + (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_RAZOR) && + (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_GILDED)))) { this->actor.textId = 0xC38; } else if (CURRENT_DAY == 3) { this->actor.textId = 0xC39; diff --git a/mm/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/mm/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index bb7e528b5..477e81c6e 100644 --- a/mm/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/mm/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -390,8 +390,9 @@ void func_80B413C8(EnKgy* this) { s32 func_80B41460(void) { if ((GET_PLAYER_FORM != PLAYER_FORM_HUMAN) || - ((CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_KOKIRI) && (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_RAZOR) && - (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_GILDED))) { + GameInteractor_Should(VB_SMITHY_CHECK_FOR_SWORD, ((CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_KOKIRI) && + (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_RAZOR) && + (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_GILDED)))) { return 0xC38; } |
