From e90e0b5b2a9ac7cae74be89a847687dac89a35fb Mon Sep 17 00:00:00 2001 From: TheLynk Date: Sat, 24 May 2025 05:08:18 +0200 Subject: [PATCH] Add Ocarina Item Glitch Great Fairy HC (1/6) --- .../location_access/overworld/castle_grounds.cpp | 2 +- soh/soh/Enhancements/randomizer/logic.cpp | 12 ++++++++++++ soh/soh/Enhancements/randomizer/logic.h | 2 ++ soh/soh/Enhancements/randomizer/randomizerTypes.h | 1 + soh/soh/Enhancements/randomizer/settings.cpp | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp b/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp index fb9676f50..7ce8da355 100644 --- a/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp +++ b/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp @@ -50,7 +50,7 @@ void RegionTable_Init_CastleGrounds() { areaTable[RR_HC_GREAT_FAIRY_FOUNTAIN] = Region("HC Great Fairy Fountain", "HC Great Fairy Fountain", {}, NO_DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_HC_GREAT_FAIRY_REWARD, logic->CanUse(RG_ZELDAS_LULLABY)), + LOCATION(RC_HC_GREAT_FAIRY_REWARD, (logic->CanUse(RG_ZELDAS_LULLABY) || (ctx->GetTrickOption(RT_OCARINA_ITEMS_GLITCH_GREAT_FAIRY) && logic->OcarinaItemGlitchZeldasLullaby()))), }, { //Exits Entrance(RR_CASTLE_GROUNDS, []{return true;}), diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index ca52009ac..b151e0bf6 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -1043,6 +1043,18 @@ bool Logic::HasBottle() { return BottleCount() >= 1; } +bool Logic::OcarinaItemGlitch() { + return ((CanUse(RG_BOTTLE_WITH_BUGS) || CanUse(RG_BOTTLE_WITH_FISH)) && + (CanUseSword() || CanUse(RG_STICKS) || CanUse(RG_NUTS) || CanUse(RG_BOMB_BAG) || CanUse(RG_FAIRY_BOW) || + CanUse(RG_FAIRY_SLINGSHOT) || CanUse(RG_BOMBCHU_BAG) || CanUse(RG_HOOKSHOT) || CanUse(RG_LONGSHOT) || + CanUse(RG_BOOMERANG) || CanUse(RG_MEGATON_HAMMER))); +} + +bool Logic::OcarinaItemGlitchZeldasLullaby() { + return OcarinaItemGlitch() && HasItem(RG_ZELDAS_LULLABY) && HasItem(RG_OCARINA_C_LEFT_BUTTON) && + HasItem(RG_OCARINA_C_RIGHT_BUTTON) && HasItem(RG_OCARINA_C_UP_BUTTON); +} + bool Logic::CanUseSword() { return CanUse(RG_KOKIRI_SWORD) || CanUse(RG_MASTER_SWORD) || CanUse(RG_BIGGORON_SWORD); } diff --git a/soh/soh/Enhancements/randomizer/logic.h b/soh/soh/Enhancements/randomizer/logic.h index 19d7e173e..3ad4cd0ff 100644 --- a/soh/soh/Enhancements/randomizer/logic.h +++ b/soh/soh/Enhancements/randomizer/logic.h @@ -203,6 +203,8 @@ class Logic { uint8_t BottleCount(); uint8_t OcarinaButtons(); bool HasBottle(); + bool OcarinaItemGlitch(); + bool OcarinaItemGlitchZeldasLullaby(); bool CanUseSword(); bool CanJumpslashExceptHammer(); bool CanJumpslash(); diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index 941402dbb..aacfba238 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -3491,6 +3491,7 @@ typedef enum { RT_HOVER_BOOST_SIMPLE, RT_BOMBCHU_BEEHIVES, RT_BLUE_FIRE_MUD_WALLS, + RT_OCARINA_ITEMS_GLITCH_GREAT_FAIRY, RT_KF_ADULT_GS, // -- location tricks RT_LW_BRIDGE, RT_LW_MIDO_BACKFLIP, diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index d94df9ae5..4ca28d0d0 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -401,6 +401,9 @@ void Settings::CreateOptions() { "Allows exploding beehives with Bombchus."); OPT_TRICK(RT_BLUE_FIRE_MUD_WALLS, RCQUEST_BOTH, RA_NONE, { Tricks::Tag::NOVICE }, "Break Mud Walls with Blue Fire", "Use Blue Fire to break mud walls."); + OPT_TRICK(RT_OCARINA_ITEMS_GLITCH_GREAT_FAIRY, RCQUEST_BOTH, RA_NONE, { Tricks::Tag::NOVICE }, + "Ocarina Items Glitch for Great Fairy", + "Access the rewards of the Great Fairy with Ocarina Items Glitch."); OPT_TRICK(RT_KF_ADULT_GS, RCQUEST_BOTH, RA_KOKIRI_FOREST, { Tricks::Tag::NOVICE }, "Adult Kokiri Forest GS with Hover Boots", "Can be obtained without Hookshot by using the Hover Boots off of one of the roots.");