[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
This commit is contained in:
Patrick12115
2025-09-30 15:16:26 -04:00
committed by GitHub
parent dbbbe0f727
commit 11a73f88ae
5 changed files with 18 additions and 2 deletions

View File

@@ -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);

View File

@@ -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() {

View File

@@ -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"

View File

@@ -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,

View File

@@ -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,