From b0e2f7915ccaad6a08f1b13dc253a6e8f0b30837 Mon Sep 17 00:00:00 2001 From: jdflyer Date: Wed, 26 Aug 2026 00:03:43 -0600 Subject: [PATCH] Entrance Randomizer: Fix edge cases --- .../generator/data/entrance_shuffle_data.yaml | 35 +++++++++---------- .../randomizer/generator/data/startflags.yaml | 6 ++-- mods/randomizer/src/randomizer_context.cpp | 13 +++++++ 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/mods/randomizer/generator/data/entrance_shuffle_data.yaml b/mods/randomizer/generator/data/entrance_shuffle_data.yaml index 6dc3fac36a..f4cb547d6d 100644 --- a/mods/randomizer/generator/data/entrance_shuffle_data.yaml +++ b/mods/randomizer/generator/data/entrance_shuffle_data.yaml @@ -1553,24 +1553,23 @@ Parameters: "F01F" State: -1 -# Leave Disabled for now: The Spawn point changes based on progression -# - Type: Interior -# Forward: -# Connection: Castle Town West -> Castle Town STAR Game -# Stage: 74 -# Room: 7 -# Spawn: 3 -# Spawn Type: "10" -# Parameters: "F090" -# State: -1 -# Return: -# Connection: Castle Town STAR Game -> Castle Town West -# Stage: 53 -# Room: 2 -# Spawn: 1 -# Spawn Type: "10" -# Parameters: "F01F" -# State: -1 +- Type: Interior + Forward: + Connection: Castle Town West -> Castle Town STAR Game + Stage: 74 + Room: 7 + Spawn: 3 + Spawn Type: "10" + Parameters: "F090" + State: -1 + Return: + Connection: Castle Town STAR Game -> Castle Town West + Stage: 53 + Room: 2 + Spawn: 1 + Spawn Type: "10" + Parameters: "F01F" + State: -1 - Type: Interior Entrance Couple Tag: Castle Town Goron House diff --git a/mods/randomizer/generator/data/startflags.yaml b/mods/randomizer/generator/data/startflags.yaml index b58890e45d..25e8918d20 100644 --- a/mods/randomizer/generator/data/startflags.yaml +++ b/mods/randomizer/generator/data/startflags.yaml @@ -59,7 +59,6 @@ EventFlags: - 0x5E10 # Midna text after beating Forest Temple. - 0x1D40 # Listened to Fyer at drained lake. - 0x2201 # Plumm initial CS watched. - - 0x2310 # STAR initial CS watched. - 0x2602 # Talked to Yeto on Snowpeak. - 0x2840 # Used Ooccoo for the first time. - 0x3704 # Postman twilight text. @@ -73,6 +72,8 @@ EventFlags: - 0x5940 # Met Postman for the first time. - 0x5D40 # Midna text after Kargarok flight. - 0x2502 # Watched cutscene with Yeto on top of mountain + - Skip_Minor_Cutscenes == On or Randomize_Interior_Entrances == On: + - 0x2310 # STAR initial CS watched. - Faron_Woods_Logic == Open: - 0x0602 # Forest Temple Story Flag - 0x0C40 # Talked to Farone after clearing Forest Temple @@ -305,8 +306,9 @@ RegionFlags: - 0x7E # Jovani Chest CS - 0x50 # Set flag for Midna breaking Barrier CS. - 0xBC # Spawn Gengle by default as his actor interferes with the poe soul - - Skip_Minor_Cutscenes == On: + - Skip_Minor_Cutscenes == On or Randomize_Interior_Entrances == On: - 0x55 # STAR Tent intro CS. + - Skip_Minor_Cutscenes == On: - 0x7D # Jovani House intro CS. - Ilia_Memory_Quest >= Statue: - 0x56 # Remove invisible wall from Doctor diff --git a/mods/randomizer/src/randomizer_context.cpp b/mods/randomizer/src/randomizer_context.cpp index 9a22c53896..b2ea347695 100644 --- a/mods/randomizer/src/randomizer_context.cpp +++ b/mods/randomizer/src/randomizer_context.cpp @@ -914,6 +914,19 @@ void randomizer_checkAndOverrideEntranceData(const char*& stageName, s8& roomNo, lastMode = (lastMode&0xFFFFFFF0); } + // Check if we are going through a randomized entrance with epona, reset the lastMode + // Todo: Create a list of entrances where epona is allowed and don't reset the lastMode if + // Epona can be rode there + if ((lastMode&0xF) == 2 || (lastMode&0xF) == 8) { + lastMode = (lastMode&0xFFFFFFF0); + } + + // Override the spawn link will go to if we are going through the Telma's bar entrance during + // Lanayru twilight. The door is ajar in this layer, so going through the normal spawn doesn't work. + if (!dComIfGs_isDarkClearLV(2) && newOverride.stageId == 53 && roomNo == 3 && pointNo == 1) { + pointNo = 30; + } + // mods::log::info("New Stage:{}, {}, {}, {}",stageName,roomNo,pointNo,mapLayer); } }