summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchez <Archez@users.noreply.github.com>2024-09-08 18:27:36 -0400
committerGitHub <noreply@github.com>2024-09-08 18:27:36 -0400
commit466a716222eda597bd8e702f09e7163d4ef2e42e (patch)
tree84da2d858bccf3bb4c8b278588e9f29ff553b9aa
parent185e761f78a05ba7ac1e9988d3c09362b9ef4a11 (diff)
Add restoration for woodfall mountain cleared state (#765)
* Add restoration for woodfall mountain cleared state * enum
-rw-r--r--mm/2s2h/BenGui/BenMenuBar.cpp8
-rw-r--r--mm/2s2h/Enhancements/Enhancements.cpp1
-rw-r--r--mm/2s2h/Enhancements/Enhancements.h1
-rw-r--r--mm/2s2h/Enhancements/Restorations/Restorations.h6
-rw-r--r--mm/2s2h/Enhancements/Restorations/WoodfallMountainAppearance.cpp31
5 files changed, 47 insertions, 0 deletions
diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp
index 75251fccf..009f6c075 100644
--- a/mm/2s2h/BenGui/BenMenuBar.cpp
+++ b/mm/2s2h/BenGui/BenMenuBar.cpp
@@ -656,6 +656,14 @@ void DrawEnhancementsMenu() {
UIWidgets::CVarCheckbox("Tatl ISG", "gEnhancements.Restorations.TatlISG",
{ .tooltip = "Restores Navi ISG from OOT, but now with Tatl." });
+ if (UIWidgets::CVarCheckbox(
+ "Woodfall Mountain Appearance", "gEnhancements.Restorations.WoodfallMountainAppearance",
+ { .tooltip = "Restores the appearance of Woodfall mountain to not look poisoned "
+ "when viewed from Termina Field after clearing Woodfall Temple\n\n"
+ "Requires a scene reload to take effect" })) {
+ RegisterWoodfallMountainAppearance();
+ }
+
ImGui::EndMenu();
}
diff --git a/mm/2s2h/Enhancements/Enhancements.cpp b/mm/2s2h/Enhancements/Enhancements.cpp
index 6d14e8388..0e014d318 100644
--- a/mm/2s2h/Enhancements/Enhancements.cpp
+++ b/mm/2s2h/Enhancements/Enhancements.cpp
@@ -62,6 +62,7 @@ void InitEnhancements() {
RegisterSideRoll();
RegisterTatlISG();
RegisterVariableFlipHop();
+ RegisterWoodfallMountainAppearance();
// Cutscenes
RegisterCutscenes();
diff --git a/mm/2s2h/Enhancements/Enhancements.h b/mm/2s2h/Enhancements/Enhancements.h
index 84ad3b1f5..4e51dfac7 100644
--- a/mm/2s2h/Enhancements/Enhancements.h
+++ b/mm/2s2h/Enhancements/Enhancements.h
@@ -25,6 +25,7 @@
#include "Cutscenes/Cutscenes.h"
#include "Restorations/FlipHopVariable.h"
#include "Restorations/PowerCrouchStab.h"
+#include "Restorations/Restorations.h"
#include "Restorations/SideRoll.h"
#include "Restorations/TatlISG.h"
#include "Graphics/3DItemDrops.h"
diff --git a/mm/2s2h/Enhancements/Restorations/Restorations.h b/mm/2s2h/Enhancements/Restorations/Restorations.h
new file mode 100644
index 000000000..8b2a722e6
--- /dev/null
+++ b/mm/2s2h/Enhancements/Restorations/Restorations.h
@@ -0,0 +1,6 @@
+#ifndef ENHANCEMENTS_RESTORATIONS_H
+#define ENHANCEMENTS_RESTORATIONS_H
+
+void RegisterWoodfallMountainAppearance();
+
+#endif // ENHANCEMENTS_RESTORATIONS_H
diff --git a/mm/2s2h/Enhancements/Restorations/WoodfallMountainAppearance.cpp b/mm/2s2h/Enhancements/Restorations/WoodfallMountainAppearance.cpp
new file mode 100644
index 000000000..12a546d26
--- /dev/null
+++ b/mm/2s2h/Enhancements/Restorations/WoodfallMountainAppearance.cpp
@@ -0,0 +1,31 @@
+
+#include <libultraship/bridge.h>
+#include "2s2h/Enhancements/GameInteractor/GameInteractor.h"
+
+extern "C" {
+#include "z64save.h"
+#include "overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h"
+}
+
+typedef enum {
+ /* 2 */ BGBREAKWALL_F_2 = 3, // Poisoned Woodfall Mountain
+ /* 3 */ BGBREAKWALL_F_3 = 3, // Spring Woodfall Mountain
+} BgBreakwallParamEx;
+
+void RegisterWoodfallMountainAppearance() {
+ static HOOK_ID breakwallInitID = 0;
+ GameInteractor::Instance->UnregisterGameHookForID<GameInteractor::OnActorInit>(breakwallInitID);
+ breakwallInitID = 0;
+
+ if (!CVarGetInteger("gEnhancements.Restorations.WoodfallMountainAppearance", 0)) {
+ return;
+ }
+
+ breakwallInitID = GameInteractor::Instance->RegisterGameHookForID<GameInteractor::OnActorInit>(
+ ACTOR_BG_BREAKWALL, [](Actor* actor) {
+ if (BGBREAKWALL_GET_F(actor) == BGBREAKWALL_F_2 &&
+ CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
+ actor->params = (actor->params & 0xFFF0) | BGBREAKWALL_F_3;
+ }
+ });
+}