From a72997f12b3275e7c68660e5b1c357dda395da0d Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Tue, 9 May 2023 23:41:45 -0400 Subject: [PATCH] RANDO: Fix logic with OGC and mixed entrance pools (#2830) * RANDO: Fix logic with OGC and mixed entrance pools Adds a `GANONS_CASTLE_LEDGE` area and a `BuiltRainbowBridge` logic var. Added an event to `GANONS_CASTLE_GROUNDS` that sets `BuiltRainbowBridge` to true. Adds Entrances for `GANONS_CASTLE_LEDGE` to `GANONS_CASTLE_GROUNDS` when `IsAdult` and `BuiltRainbowBridge` (or the glitched logic that lets you skip the rainbow bridge) are true, `HYRULE_CASTLE_GROUNDS` when `IsChild` is true, and `GANONS_CASTLE_ENTRYWAY` When IsAdult is true (if child enters `GANONS_CASTLE_LEDGE` in game they are in `HYRULE_CASTLE_GROUNDS` and thus cannot go back into GANONS_CASTLE_ENTRYWAY). Adds Entrance for `GANONS_CASTLE_GROUNDS` to `GANONS_CASTLE_LEDGE` when `BuiltRainbowBridge` is true, or when the glitched logic that lets you skip the Rainbow Bridge is true. * Adds intermediate area for age-gating * Fixes the logic for actually killing the skulltula * Adds hammer crouch stab as a way to kill OGC_GS --- .../randomizer/3drando/entrance.cpp | 6 ++--- .../Enhancements/randomizer/3drando/keys.hpp | 2 ++ .../location_access/locacc_castle_town.cpp | 23 ++++++++++++++++--- .../location_access/locacc_ganons_castle.cpp | 2 +- .../Enhancements/randomizer/3drando/logic.cpp | 2 ++ .../Enhancements/randomizer/3drando/logic.hpp | 1 + 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/entrance.cpp b/soh/soh/Enhancements/randomizer/3drando/entrance.cpp index e1eeb69d9..71cba408b 100644 --- a/soh/soh/Enhancements/randomizer/3drando/entrance.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/entrance.cpp @@ -333,7 +333,7 @@ static bool ValidateWorld(Entrance* entrancePlaced) { // This means we need to hard check that none of the relevant entrances are ever reachable as that age // This is mostly relevant when mixing entrance pools or shuffling special interiors (such as windmill or kak potion shop) // Warp Songs and Overworld Spawns can also end up inside certain indoors so those need to be handled as well - std::array childForbidden = {"OGC Great Fairy Fountain -> Castle Grounds", "GV Carpenter Tent -> GV Fortress Side"}; + std::array childForbidden = {"OGC Great Fairy Fountain -> Castle Grounds", "GV Carpenter Tent -> GV Fortress Side", "Ganon's Castle Entryway -> Castle Grounds From Ganon's Castle"}; std::array adultForbidden = {"HC Great Fairy Fountain -> Castle Grounds", "HC Storms Grotto -> Castle Grounds"}; auto allShuffleableEntrances = GetShuffleableEntrances(EntranceType::All, false); @@ -711,8 +711,8 @@ int ShuffleAllEntrances() { {EntranceType::Dungeon, ICE_CAVERN_ENTRYWAY, ZORAS_FOUNTAIN, 0x03D4}}, {{EntranceType::Dungeon, GERUDO_FORTRESS, GERUDO_TRAINING_GROUNDS_ENTRYWAY, 0x0008}, {EntranceType::Dungeon, GERUDO_TRAINING_GROUNDS_ENTRYWAY, GERUDO_FORTRESS, 0x03A8}}, - {{EntranceType::GanonDungeon, GANONS_CASTLE_GROUNDS, GANONS_CASTLE_ENTRYWAY, 0x0467}, - {EntranceType::GanonDungeon, GANONS_CASTLE_ENTRYWAY, GANONS_CASTLE_GROUNDS, 0x023D}}, + {{EntranceType::GanonDungeon, GANONS_CASTLE_LEDGE, GANONS_CASTLE_ENTRYWAY, 0x0467}, + {EntranceType::GanonDungeon, GANONS_CASTLE_ENTRYWAY, CASTLE_GROUNDS_FROM_GANONS_CASTLE, 0x023D}}, {{EntranceType::Interior, KOKIRI_FOREST, KF_MIDOS_HOUSE, 0x0433}, {EntranceType::Interior, KF_MIDOS_HOUSE, KOKIRI_FOREST, 0x0443}}, diff --git a/soh/soh/Enhancements/randomizer/3drando/keys.hpp b/soh/soh/Enhancements/randomizer/3drando/keys.hpp index cc72e6235..29f5f32fa 100644 --- a/soh/soh/Enhancements/randomizer/3drando/keys.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/keys.hpp @@ -1171,12 +1171,14 @@ typedef enum { TEMPLE_OF_TIME, TOT_BEYOND_DOOR_OF_TIME, CASTLE_GROUNDS, + CASTLE_GROUNDS_FROM_GANONS_CASTLE, HYRULE_CASTLE_GROUNDS, HC_GARDEN, HC_GREAT_FAIRY_FOUNTAIN, HC_STORMS_GROTTO, GANONS_CASTLE_GROUNDS, OGC_GREAT_FAIRY_FOUNTAIN, + GANONS_CASTLE_LEDGE, KAKARIKO_VILLAGE, KAK_CARPENTER_BOSS_HOUSE, KAK_HOUSE_OF_SKULLTULA, diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_castle_town.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_castle_town.cpp index aeb2ddbbf..918c74021 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_castle_town.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_castle_town.cpp @@ -135,14 +135,17 @@ void AreaTable_Init_CastleTown() { Entrance(CASTLE_GROUNDS, {[]{return true;}}), }); - areaTable[GANONS_CASTLE_GROUNDS] = Area("Ganon's Castle Grounds", "Castle Grounds", OUTSIDE_GANONS_CASTLE, NO_DAY_NIGHT_CYCLE, {}, { + areaTable[GANONS_CASTLE_GROUNDS] = Area("Ganon's Castle Grounds", "Castle Grounds", OUTSIDE_GANONS_CASTLE, NO_DAY_NIGHT_CYCLE, { + EventAccess(&BuiltRainbowBridge, {[]{return CanBuildRainbowBridge;}}), + }, { //Locations //the terrain was lowered such that you can't get this GS with a simple sword slash - LocationAccess(OGC_GS, {[]{return HasExplosives || (IsAdult && (LogicOutsideGanonsGS || Bow || HookshotOrBoomerang || CanUse(DINS_FIRE)));}}), + LocationAccess(OGC_GS, {[]{return CanJumpslash || CanUseProjectile + || (CanShield && CanUse(MEGATON_HAMMER)) || CanUse(DINS_FIRE);}}), }, { //Exits Entrance(CASTLE_GROUNDS, {[]{return AtNight;}}), Entrance(OGC_GREAT_FAIRY_FOUNTAIN, {[]{return CanUse(GOLDEN_GAUNTLETS) && AtNight;}}), - Entrance(GANONS_CASTLE_ENTRYWAY, {[]{return CanBuildRainbowBridge;}, + Entrance(GANONS_CASTLE_LEDGE, {[]{return BuiltRainbowBridge;}, /*Glitched*/[]{return (HasBombchus && CanDoGlitch(GlitchType::BombHover, GlitchDifficulty::NOVICE)) || CanDoGlitch(GlitchType::HoverBoost, GlitchDifficulty::ADVANCED) || (HoverBoots && CanShield && Bombs && CanDoGlitch(GlitchType::SuperSlide, GlitchDifficulty::EXPERT)) || (HoverBoots && CanDoGlitch(GlitchType::Megaflip, GlitchDifficulty::ADVANCED));}}), }); @@ -155,6 +158,20 @@ void AreaTable_Init_CastleTown() { Entrance(CASTLE_GROUNDS, {[]{return true;}}), }); + areaTable[CASTLE_GROUNDS_FROM_GANONS_CASTLE] = Area("Castle Grounds From Ganon's Castle", "Castle Grounds From Ganon's Castle", NONE, NO_DAY_NIGHT_CYCLE, {}, {}, { + // Exits + Entrance(HYRULE_CASTLE_GROUNDS, { [] { return IsChild; }}), + Entrance(GANONS_CASTLE_LEDGE, { [] { return IsAdult; }}), + }); + + areaTable[GANONS_CASTLE_LEDGE] = Area("Ganon's Castle Ledge", "OGC Ganon's Castle Ledge", NONE, NO_DAY_NIGHT_CYCLE, + {}, {}, { + // Exits + Entrance(GANONS_CASTLE_GROUNDS, {[]{return BuiltRainbowBridge;}, + /*Glitched*/[]{return (HasBombchus && CanDoGlitch(GlitchType::BombHover, GlitchDifficulty::NOVICE)) || CanDoGlitch(GlitchType::HoverBoost, GlitchDifficulty::ADVANCED) || (HoverBoots && CanShield && Bombs && CanDoGlitch(GlitchType::SuperSlide, GlitchDifficulty::EXPERT)) || (HoverBoots && CanDoGlitch(GlitchType::Megaflip, GlitchDifficulty::ADVANCED));}}), + Entrance(GANONS_CASTLE_ENTRYWAY, {[]{return IsAdult;}}), + }); + areaTable[MARKET_GUARD_HOUSE] = Area("Market Guard House", "Market Guard House", NONE, NO_DAY_NIGHT_CYCLE, {}, { //Locations LocationAccess(MARKET_10_BIG_POES, {[]{return IsAdult && BigPoeKill;}}), diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp index 7b3bb11fa..890a50b74 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp @@ -15,7 +15,7 @@ void AreaTable_Init_GanonsCastle() { //Exits Entrance(GANONS_CASTLE_LOBBY, {[]{return Dungeon::GanonsCastle.IsVanilla();}}), Entrance(GANONS_CASTLE_MQ_LOBBY, {[]{return Dungeon::GanonsCastle.IsMQ();}}), - Entrance(GANONS_CASTLE_GROUNDS, {[]{return true;}}), + Entrance(CASTLE_GROUNDS_FROM_GANONS_CASTLE, {[]{return true;}}), }); /*-------------------------- diff --git a/soh/soh/Enhancements/randomizer/3drando/logic.cpp b/soh/soh/Enhancements/randomizer/3drando/logic.cpp index a6ab83c77..9eb219cf1 100644 --- a/soh/soh/Enhancements/randomizer/3drando/logic.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/logic.cpp @@ -298,6 +298,7 @@ namespace Logic { bool HasAllStones = false; bool HasAllMedallions = false; bool CanBuildRainbowBridge = false; + bool BuiltRainbowBridge = false; bool CanTriggerLACS = false; //Other @@ -1171,6 +1172,7 @@ namespace Logic { HasAllStones = false; HasAllMedallions = false; CanBuildRainbowBridge = false; + BuiltRainbowBridge = false; CanTriggerLACS = false; //Other diff --git a/soh/soh/Enhancements/randomizer/3drando/logic.hpp b/soh/soh/Enhancements/randomizer/3drando/logic.hpp index f847fb7d7..f6b1f8e06 100644 --- a/soh/soh/Enhancements/randomizer/3drando/logic.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/logic.hpp @@ -286,6 +286,7 @@ extern bool CanUseMagicArrow; extern bool HasAllStones; extern bool HasAllMedallions; extern bool CanBuildRainbowBridge; +extern bool BuiltRainbowBridge; extern bool CanTriggerLACS; // Other