summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick12115 <115201185+Patrick12115@users.noreply.github.com>2025-09-30 15:16:26 -0400
committerGitHub <noreply@github.com>2025-09-30 12:16:26 -0700
commit11a73f88ae97ea781dfe7b6c746dc3c3beb67337 (patch)
tree97604911cb178ab13628842738ae9b81f3168cc9
parentdbbbe0f727236019d5cf2e2f6e2e1e26a9670f4c (diff)
[Enhancement] Allow Slingshot and Bow to break randomized beehives (#5793)
* Add slingshot and bow damage checks * Move to Rando and add Logic, hopefully * Missing spacing
-rw-r--r--soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp5
-rw-r--r--soh/soh/Enhancements/randomizer/logic.cpp3
-rw-r--r--soh/soh/Enhancements/randomizer/option_descriptions.cpp2
-rw-r--r--soh/soh/Enhancements/randomizer/randomizerTypes.h1
-rw-r--r--soh/soh/Enhancements/randomizer/settings.cpp9
5 files changed, 18 insertions, 2 deletions
diff --git a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp
index eccfc3dc3..c5a8b8534 100644
--- a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp
+++ b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp
@@ -55,7 +55,10 @@ void ObjComb_RandomizerWait(ObjComb* objComb, PlayState* play) {
if ((objComb->collider.base.acFlags & AC_HIT) != 0) {
objComb->collider.base.acFlags &= ~AC_HIT;
s32 dmgFlags = objComb->collider.elements[0].info.acHitInfo->toucher.dmgFlags;
- if (dmgFlags & 0x4001F866) {
+
+ bool slingBowDmg = RAND_GET_OPTION(RSK_SLINGBOW_BREAK_BEEHIVES) && (dmgFlags & (DMG_ARROW | DMG_SLINGSHOT));
+
+ if ((dmgFlags & 0x4001F866) && !slingBowDmg) {
objComb->unk_1B0 = 1500;
} else {
ObjComb_Break(objComb, play);
diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp
index df0e0a928..90fe83ce9 100644
--- a/soh/soh/Enhancements/randomizer/logic.cpp
+++ b/soh/soh/Enhancements/randomizer/logic.cpp
@@ -1257,7 +1257,8 @@ bool Logic::CanGetNightTimeGS() {
}
bool Logic::CanBreakUpperBeehives() {
- return HookshotOrBoomerang() || (ctx->GetTrickOption(RT_BOMBCHU_BEEHIVES) && CanUse(RG_BOMBCHU_5));
+ return HookshotOrBoomerang() || (ctx->GetTrickOption(RT_BOMBCHU_BEEHIVES) && CanUse(RG_BOMBCHU_5)) ||
+ (ctx->GetOption(RSK_SLINGBOW_BREAK_BEEHIVES) && (CanUse(RG_FAIRY_BOW) || CanUse(RG_FAIRY_SLINGSHOT)));
}
bool Logic::CanBreakLowerBeehives() {
diff --git a/soh/soh/Enhancements/randomizer/option_descriptions.cpp b/soh/soh/Enhancements/randomizer/option_descriptions.cpp
index bd19b3dcb..ce612001b 100644
--- a/soh/soh/Enhancements/randomizer/option_descriptions.cpp
+++ b/soh/soh/Enhancements/randomizer/option_descriptions.cpp
@@ -743,6 +743,8 @@ void Settings::CreateOptionDescriptions() {
mOptionDescriptions[RSK_SUNLIGHT_ARROWS] =
"Light Arrows can be used to light up the sun switches instead of using the Mirror Shield. "
"Item placement logic will respect this option, so it might be required to use this to progress.";
+ mOptionDescriptions[RSK_SLINGBOW_BREAK_BEEHIVES] =
+ "Allows Slingshot and Bow to break beehives when Beehive Shuffle is turned on.";
mOptionDescriptions[RSK_LOGIC_RULES] =
"Glitchless - No glitches are required, but may require some minor tricks. Additional tricks may be enabled "
"and disabled below.\n"
diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h
index 90cf6c8e1..9f105f400 100644
--- a/soh/soh/Enhancements/randomizer/randomizerTypes.h
+++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h
@@ -5990,6 +5990,7 @@ typedef enum {
RSK_MERCHANT_PRICES_AFFORDABLE,
RSK_BLUE_FIRE_ARROWS,
RSK_SUNLIGHT_ARROWS,
+ RSK_SLINGBOW_BREAK_BEEHIVES,
RSK_ENABLE_BOMBCHU_DROPS,
RSK_BOMBCHU_BAG,
RSK_LINKS_POCKET,
diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp
index fe513dcf0..fc1e95d49 100644
--- a/soh/soh/Enhancements/randomizer/settings.cpp
+++ b/soh/soh/Enhancements/randomizer/settings.cpp
@@ -305,6 +305,7 @@ void Settings::CreateOptions() {
OPT_BOOL(RSK_SUNLIGHT_ARROWS, "Sunlight Arrows", CVAR_RANDOMIZER_SETTING("SunlightArrows"), mOptionDescriptions[RSK_SUNLIGHT_ARROWS]);
OPT_U8(RSK_INFINITE_UPGRADES, "Infinite Upgrades", {"Off", "Progressive", "Condensed Progressive"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("InfiniteUpgrades"), mOptionDescriptions[RSK_INFINITE_UPGRADES]);
OPT_BOOL(RSK_SKELETON_KEY, "Skeleton Key", CVAR_RANDOMIZER_SETTING("SkeletonKey"), mOptionDescriptions[RSK_SKELETON_KEY]);
+ OPT_BOOL(RSK_SLINGBOW_BREAK_BEEHIVES, "Slingshot/Bow Can Break Beehives", CVAR_RANDOMIZER_SETTING("SlingBowBeehives"), mOptionDescriptions[RSK_SLINGBOW_BREAK_BEEHIVES]);
OPT_U8(RSK_ITEM_POOL, "Item Pool", {"Plentiful", "Balanced", "Scarce", "Minimal"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ItemPool"), mOptionDescriptions[RSK_ITEM_POOL], WidgetType::Combobox, RO_ITEM_POOL_BALANCED);
OPT_U8(RSK_ICE_TRAPS, "Ice Traps", {"Off", "Normal", "Extra", "Mayhem", "Onslaught"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("IceTraps"), mOptionDescriptions[RSK_ICE_TRAPS], WidgetType::Combobox, RO_ICE_TRAPS_NORMAL);
// TODO: Remove Double Defense, Progressive Goron Sword
@@ -1399,6 +1400,7 @@ void Settings::CreateOptions() {
&mOptions[RSK_SUNLIGHT_ARROWS],
&mOptions[RSK_INFINITE_UPGRADES],
&mOptions[RSK_SKELETON_KEY],
+ &mOptions[RSK_SLINGBOW_BREAK_BEEHIVES],
},
WidgetContainerType::COLUMN);
mOptionGroups[RSG_GAMEPLAY_IMGUI_TABLE] =
@@ -1665,6 +1667,7 @@ void Settings::CreateOptions() {
&mOptions[RSK_SUNLIGHT_ARROWS],
&mOptions[RSK_INFINITE_UPGRADES],
&mOptions[RSK_SKELETON_KEY],
+ &mOptions[RSK_SLINGBOW_BREAK_BEEHIVES],
});
mOptionGroups[RSG_ITEM_POOL] = OptionGroup(
"Item Pool Settings", std::initializer_list<Option*>({ &mOptions[RSK_ITEM_POOL], &mOptions[RSK_ICE_TRAPS] }));
@@ -2542,6 +2545,12 @@ void Settings::UpdateOptionProperties() {
} else {
mOptions[RSK_BIG_POES_HINT].Enable();
}
+ if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleBeehives"), RO_GENERIC_OFF)) {
+ mOptions[RSK_SLINGBOW_BREAK_BEEHIVES].Enable();
+ } else {
+ mOptions[RSK_SLINGBOW_BREAK_BEEHIVES].Disable(
+ "This option is disabled because Shuffle Beehives is not enabled.");
+ }
}
void Context::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocations,