Skip to content

Commit

Permalink
Merge pull request #1 from fenhl/ganon-er-fixes
Browse files Browse the repository at this point in the history
Quick Ganon ER fixes
  • Loading branch information
Jaybone25 authored Jun 1, 2022
2 parents 4433a6d + 72b9e1b commit 0672e9d
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 48 deletions.
8 changes: 4 additions & 4 deletions EntranceShuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def build_one_way_targets(world, types_to_include, exclude=(), target_region_nam
('Dungeon', ('Gerudo Fortress -> Gerudo Training Ground Lobby', { 'index': 0x0008 }),
('Gerudo Training Ground Lobby -> Gerudo Fortress', { 'index': 0x03A8 })),
('DungeonSpecial', ('Ganons Castle Grounds -> Ganons Castle Lobby', { 'index': 0x0467 }),
('Ganons Castle Lobby -> Castle Grounds', { 'index': 0x023D })),
('Ganons Castle Lobby -> Castle Grounds', { 'index': 0x023D })),

('Interior', ('Kokiri Forest -> KF Midos House', { 'index': 0x0433 }),
('KF Midos House -> Kokiri Forest', { 'index': 0x0443 })),
Expand Down Expand Up @@ -395,10 +395,10 @@ def shuffle_random_entrances(worlds):
# In glitchless, there aren't any other ways to access these areas
one_way_priorities['Bolero'] = priority_entrance_table['Bolero']
one_way_priorities['Nocturne'] = priority_entrance_table['Nocturne']
if not worlds[0].settings.shuffle_dungeon_entrances and not worlds[0].settings.shuffle_overworld_entrances:
if not worlds[0].shuffle_dungeon_entrances and not worlds[0].settings.shuffle_overworld_entrances:
one_way_priorities['Requiem'] = priority_entrance_table['Requiem']

if worlds[0].settings.shuffle_dungeon_entrances:
if worlds[0].shuffle_dungeon_entrances:
entrance_pools['Dungeon'] = world.get_shufflable_entrances(type='Dungeon', only_primary=True)
# The fill algorithm will already make sure gohma is reachable, however it can end up putting
# a forest escape via the hands of spirit on Deku leading to Deku on spirit in logic. This is
Expand Down Expand Up @@ -656,7 +656,7 @@ def place_one_way_priority_entrance(worlds, world, priority_name, allowed_region
if priority_name != 'Nocturne' or entrance.world.settings.hints == "mask":
continue
# If not shuffling dungeons, Nocturne requires adult access.
if not entrance.world.settings.shuffle_dungeon_entrances and priority_name == 'Nocturne':
if not entrance.world.shuffle_dungeon_entrances and priority_name == 'Nocturne':
if entrance.type != 'WarpSong' and entrance.parent_region.name != 'Adult Spawn':
continue
for target in one_way_target_entrance_pools[entrance.type]:
Expand Down
4 changes: 2 additions & 2 deletions Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def set_entrance_updates(entrances):
rom.write_int16(0xACAA2E, 0x0138) # 1st Impa escort
rom.write_int16(0xD12D6E, 0x0138) # 2nd+ Impa escort

if world.settings.shuffle_dungeon_entrances:
if world.shuffle_dungeon_entrances:
rom.write_byte(rom.sym('DUNGEONS_SHUFFLED'), 1)

# Connect lake hylia fill exit to revisit exit
Expand All @@ -903,7 +903,7 @@ def set_entrance_updates(entrances):
# Purge temp flags on entrance to spirit from colossus through the front door.
rom.write_byte(0x021862E3, 0xC2)

if world.settings.shuffle_overworld_entrances or world.settings.shuffle_dungeon_entrances:
if world.settings.shuffle_overworld_entrances or world.shuffle_dungeon_entrances:
# Remove deku sprout and drop player at SFM after forest completion
rom.write_int16(0xAC9F96, 0x0608)

Expand Down
28 changes: 15 additions & 13 deletions SettingsList.py
Original file line number Diff line number Diff line change
Expand Up @@ -3021,21 +3021,23 @@ def __init__(self, name, gui_text, min, max, default, step=1,
Combobox(
name = 'shuffle_dungeon_entrances',
gui_text = 'Shuffle Dungeon Entrances',
default = 'off',
choices = {
'off': 'Off',
'simple': 'Dungeon',
'all': 'Dungeon and Ganon',
default = 'off',
choices = {
'off': 'Off',
'simple': 'Dungeon',
'all': 'Dungeon and Ganon',
},
gui_tooltip = '''\
Dungeon Shuffle will the pool of dungeon entrances, including
Bottom of the Well, Ice Cavern, and Gerudo Training Ground.
With Dungeon and Ganon selected, all dungeon's including Ganons
castle will be shuffled.
Additionally, the entrances of Deku Tree, Fire Temple and
Shuffle the pool of dungeon entrances, including Bottom
of the Well, Ice Cavern, and Gerudo Training Ground.
Additionally, the entrances of Deku Tree, Fire Temple and
Bottom of the Well are opened for both adult and child.
With Dungeon and Ganon selected, all dungeons including Ganon's
castle will be shuffled.
Thieves' Hideout is not shuffled.
''',
shared = True,
gui_params = {
Expand All @@ -3044,7 +3046,7 @@ def __init__(self, name, gui_text, min, max, default, step=1,
('off', 2),
('simple', 1),
('all', 1),
]
],
},
),
Checkbutton(
Expand Down
4 changes: 2 additions & 2 deletions World.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ def __init__(self, id, settings, resolveRandomizedSettings=True):

self.shuffle_special_interior_entrances = settings.shuffle_interior_entrances == 'all'
self.shuffle_interior_entrances = settings.shuffle_interior_entrances in ['simple', 'all']

self.shuffle_special_dungeon_entrances = settings.shuffle_dungeon_entrances == 'all'
self.shuffle_dungeon_entrances = settings.shuffle_dungeon_entrances in ['simple', 'all']

self.entrance_shuffle = self.shuffle_interior_entrances or settings.shuffle_grotto_entrances or settings.shuffle_dungeon_entrances or \
self.entrance_shuffle = self.shuffle_interior_entrances or settings.shuffle_grotto_entrances or self.shuffle_dungeon_entrances or \
settings.shuffle_overworld_entrances or settings.owl_drops or settings.warp_songs or settings.spawn_positions

self.ensure_tod_access = self.shuffle_interior_entrances or settings.shuffle_overworld_entrances or settings.spawn_positions
Expand Down
8 changes: 3 additions & 5 deletions data/World/Ganons Castle MQ.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[
{
{
"region_name": "Ganons Castle Lobby",
"dungeon": "Ganons Castle",
"exits": {
"Castle Grounds": "True",
"Ganons Castle Main": "here(is_adult or (Kokiri_Sword and (Sticks or has_explosives or Nuts or Boomerang)) or (has_explosives and (Sticks or ((Nuts or Boomerang) and Slingshot))))"
}
},
{
{
"region_name": "Ganons Castle Main",
"dungeon": "Ganons Castle",
"exits": {
Expand All @@ -27,8 +27,6 @@
"Ganons Castle Deku Scrubs": "logic_lens_castle_mq or can_use(Lens_of_Truth)"
}
},


{
"region_name": "Ganons Castle Deku Scrubs",
"dungeon": "Ganons Castle",
Expand Down Expand Up @@ -136,4 +134,4 @@
"Ganons Castle MQ Light Trial Lullaby Chest": "can_play(Zeldas_Lullaby)"
}
}
]
]
4 changes: 2 additions & 2 deletions data/World/Ganons Castle.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"Forest Trial Clear": "can_use(Light_Arrows) and (Fire_Arrows or Dins_Fire)"
},
"locations": {
"Ganons Castle Forest Trial Chest": "is_adult or (is_child and (Slingshot or Sticks or
"Ganons Castle Forest Trial Chest": "is_adult or (is_child and (Slingshot or Sticks or
Kokiri_Sword or can_use(Dins_Fire)))"
}
},
Expand Down Expand Up @@ -121,4 +121,4 @@
can_play(Zeldas_Lullaby) and (Small_Key_Ganons_Castle, 1)"
}
}
]
]
Loading

0 comments on commit 0672e9d

Please sign in to comment.