summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEblo <7004497+Eblo@users.noreply.github.com>2026-06-30 17:02:45 -0400
committerGitHub <noreply@github.com>2026-06-30 17:02:45 -0400
commited0eb99b0e476e7eea55617f67e220082a345a9d (patch)
treebb49e4974cb79df33918e259093bbf81878d1d2f
parentf8e213ced0c6c8ba65f1aee72fe51c988129c34a (diff)
Add restoration to re-bottle soil patch bugs (#1756)
-rw-r--r--mm/2s2h/BenGui/BenMenu.cpp4
-rw-r--r--mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp3
-rw-r--r--mm/2s2h/Enhancements/Restorations/SoilPatch.cpp38
-rw-r--r--mm/2s2h/GameInteractor/GameInteractor_VanillaBehavior.h8
-rw-r--r--mm/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c3
5 files changed, 53 insertions, 3 deletions
diff --git a/mm/2s2h/BenGui/BenMenu.cpp b/mm/2s2h/BenGui/BenMenu.cpp
index 72b0edaff..c8dacb690 100644
--- a/mm/2s2h/BenGui/BenMenu.cpp
+++ b/mm/2s2h/BenGui/BenMenu.cpp
@@ -1708,6 +1708,10 @@ void BenMenu::AddEnhancements() {
.CVar("gEnhancements.Restorations.BonkCollision")
.Options(
CheckboxOptions().Tooltip("Corrects rolls to allow bonking trees near the end of the roll, as in OoT."));
+ AddWidget(path, "Soil Patch Burrowed Bugs", WIDGET_CVAR_CHECKBOX)
+ .CVar("gEnhancements.Restorations.SoilPatch")
+ .Options(CheckboxOptions().Tooltip("Removes the cutscene lock when bugs burrow into a Skulltula soil patch, "
+ "allowing the player to re-bottle them, as in OoT."));
AddWidget(path, "Simulated Input Lag", WIDGET_CVAR_SLIDER_INT)
.CVar(CVAR_SIMULATED_INPUT_LAG)
.Options(IntSliderOptions()
diff --git a/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp b/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp
index a8da00ceb..aea5f1626 100644
--- a/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp
+++ b/mm/2s2h/Enhancements/Cutscenes/SkipOnePointCutscenes.cpp
@@ -51,8 +51,7 @@ void RegisterSkipOnePointCutscenes() {
*should = false;
}
break;
- case ACTOR_OBJ_BEAN: // Bean Patch
- case ACTOR_OBJ_MAKEKINSUTA: // Bean Patch
+ case ACTOR_OBJ_BEAN: // Bean Patch
case ACTOR_OBJ_SPIDERTENT:
actor->csId = -1;
*should = false;
diff --git a/mm/2s2h/Enhancements/Restorations/SoilPatch.cpp b/mm/2s2h/Enhancements/Restorations/SoilPatch.cpp
new file mode 100644
index 000000000..d751c4b48
--- /dev/null
+++ b/mm/2s2h/Enhancements/Restorations/SoilPatch.cpp
@@ -0,0 +1,38 @@
+#include <libultraship/bridge/consolevariablebridge.h>
+#include "2s2h/GameInteractor/GameInteractor.h"
+#include "2s2h/ShipInit.hpp"
+
+extern "C" {
+#include "overlays/actors/ovl_Obj_Bean/z_obj_bean.h"
+}
+
+#define CVAR_NAME "gEnhancements.Restorations.SoilPatch"
+#define CVAR CVarGetInteger(CVAR_NAME, 0)
+
+static void RegisterSoilPatchRestoration() {
+ COND_VB_SHOULD(VB_START_CUTSCENE, CVAR, {
+ s16* csId = va_arg(args, s16*);
+ Actor* actor = va_arg(args, Actor*);
+
+ if (*csId == -1 || actor == NULL) {
+ return;
+ }
+
+ if (actor->id == ACTOR_OBJ_MAKEKINSUTA) { // Soil patch Skulltula spawner
+ actor->csId = -1;
+ *should = false;
+ }
+ });
+
+ COND_VB_SHOULD(VB_COUNT_BURROWED_BUGS, CVAR, {
+ ObjBean* bean = va_arg(args, ObjBean*);
+ if (*should) {
+ if (bean->unk_1E4 == 2 && bean->unk_1E0 < 2) {
+ bean->unk_1E0 = 2;
+ }
+ *should = false;
+ }
+ });
+}
+
+static RegisterShipInitFunc initFunc(RegisterSoilPatchRestoration, { CVAR_NAME });
diff --git a/mm/2s2h/GameInteractor/GameInteractor_VanillaBehavior.h b/mm/2s2h/GameInteractor/GameInteractor_VanillaBehavior.h
index bbca5d857..cafdb1f59 100644
--- a/mm/2s2h/GameInteractor/GameInteractor_VanillaBehavior.h
+++ b/mm/2s2h/GameInteractor/GameInteractor_VanillaBehavior.h
@@ -328,6 +328,14 @@ typedef enum {
// #### `result`
// ```c
+ // (bean->unk_1E4 == 2) || (bean->unk_1E4 == 1)
+ // ```
+ // #### `args`
+ // - `ObjBean*`
+ VB_COUNT_BURROWED_BUGS,
+
+ // #### `result`
+ // ```c
// gHorsePlayedEponasSong
// ```
// #### `args`
diff --git a/mm/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/mm/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c
index 8e59bfb55..39d87334d 100644
--- a/mm/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c
+++ b/mm/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c
@@ -6,6 +6,7 @@
#include "overlays/actors/ovl_Obj_Bean/z_obj_bean.h"
#include "z_en_mushi2.h"
+#include "2s2h/GameInteractor/GameInteractor.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -721,7 +722,7 @@ s32 func_80A6A094(EnMushi2* this) {
if (this->unk_34C != NULL) {
ObjBean* bean = this->unk_34C;
- if ((bean->unk_1E4 == 2) || (bean->unk_1E4 == 1)) {
+ if (GameInteractor_Should(VB_COUNT_BURROWED_BUGS, (bean->unk_1E4 == 2) || (bean->unk_1E4 == 1), bean)) {
bean->unk_1E4 = 4;
return true;
}