Skip to content

Commit de84817

Browse files
committed
Make logically requiring Gohma in Closed Forest a setting
1 parent 819b83a commit de84817

10 files changed

Lines changed: 70 additions & 48 deletions

File tree

EntranceShuffle.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def assume_entrance_pool(entrance_pool):
4646

4747

4848
def build_one_way_targets(world, types_to_include, exclude=(), target_region_names=()):
49+
if world.settings.open_forest == 'closed':
50+
# The logic assumes that this entrance places Link outside the circle on which the Kokiri boy moves,
51+
# but this is not the case if you spawn or warp here.
52+
exclude = ('LW Bridge -> Kokiri Forest', *exclude)
4953
one_way_entrances = []
5054
for pool_type in types_to_include:
5155
one_way_entrances += world.get_shufflable_entrances(type=pool_type)
@@ -515,8 +519,8 @@ def shuffle_random_entrances(worlds):
515519
entrance_pools['Dungeon'] = world.get_shufflable_entrances(type='Dungeon', only_primary=True)
516520
# The fill algorithm will already make sure gohma is reachable, however it can end up putting
517521
# a forest escape via the hands of spirit on Deku leading to Deku on spirit in logic. This is
518-
# not really a closed forest anymore, so specifically remove Deku Tree from closed forest.
519-
if worlds[0].settings.open_forest == 'closed':
522+
# contrary to the idea of Require Gohma, so specifically place Deku Tree in its vanilla location.
523+
if worlds[0].settings.require_gohma:
520524
entrance_pools['Dungeon'].remove(world.get_entrance('KF Outside Deku Tree -> Deku Tree Lobby'))
521525
if worlds[0].shuffle_special_dungeon_entrances:
522526
entrance_pools['Dungeon'] += world.get_shufflable_entrances(type='DungeonSpecial', only_primary=True)

SettingsList.py

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ def __init__(self, name, gui_text, min, max, default, step=1,
622622
'tooltip' : '''\
623623
A precise jump can be used to skip
624624
needing to use the Slingshot to go
625-
around B1 of the Deku Tree. If used
626-
with the "Closed Forest" setting, a
625+
around B1 of the Deku Tree. If using
626+
"Closed Forest Requires Gohma", a
627627
Slingshot will not be guaranteed to
628628
exist somewhere inside the Forest.
629629
This trick applies to both Vanilla
@@ -3163,30 +3163,28 @@ def __init__(self, name, gui_text, min, max, default, step=1,
31633163
'closed': 'Closed Forest',
31643164
},
31653165
gui_tooltip = '''\
3166-
'Open Forest': Mido no longer blocks the path to the
3167-
Deku Tree, and the Kokiri boy no longer blocks the path
3168-
out of the forest.
3166+
'Closed Forest': In the child era, Mido blocks the path
3167+
to the Deku Tree, requiring Kokiri Sword and Deku Shield
3168+
to access the Deku Tree, and another Kokiri boy blocks
3169+
the path out of the forest until Queen Gohma is defeated.
3170+
It may be logically required to "escape" the forest
3171+
(via one of the shortcuts in the Lost Woods, for example);
3172+
the setting "Closed Forest Requires Gohma" in the Detailed
3173+
Logic tab can be used to prevent this.
31693174
31703175
'Closed Deku': The Kokiri boy no longer blocks the path
31713176
out of the forest, but Mido still blocks the path to the
31723177
Deku Tree, requiring Kokiri Sword and Deku Shield to access
31733178
the Deku Tree.
31743179
3175-
'Closed Forest': Beating Deku Tree is logically required
3176-
to leave the forest area (Kokiri Forest/Lost Woods/Sacred Forest
3177-
Meadow/Deku Tree), while the Kokiri Sword and a Deku Shield are
3178-
required to access the Deku Tree. Items needed for this will be
3179-
guaranteed inside the forest area. This setting is incompatible
3180-
with starting as adult, and so Starting Age will be locked to Child.
3181-
With either "Shuffle Interior Entrances" set to "All", "Shuffle
3182-
Overworld Entrances" on, "Randomize Warp Song Destinations" on
3183-
or "Randomize Overworld Spawns" on, Closed Forest will instead
3184-
be treated as Closed Deku with starting age Child and WILL NOT
3185-
guarantee that these items are available in the forest area.
3180+
'Open Forest': Mido no longer blocks the path to the
3181+
Deku Tree, and the Kokiri boy no longer blocks the path
3182+
out of the forest.
31863183
''',
31873184
shared = True,
31883185
disable = {
3189-
'closed' : {'settings' : ['starting_age']}
3186+
'!closed': {'settings': ['require_gohma']},
3187+
'closed': {'settings': ['starting_age']},
31903188
},
31913189
gui_params = {
31923190
'randomize_key': 'randomize_settings',
@@ -3197,6 +3195,28 @@ def __init__(self, name, gui_text, min, max, default, step=1,
31973195
],
31983196
},
31993197
),
3198+
Checkbutton(
3199+
name = 'require_gohma',
3200+
gui_text = 'Closed Forest Requires Gohma',
3201+
gui_tooltip = '''\
3202+
Defeating Queen Gohma is logically required to leave the forest
3203+
area (Kokiri Forest/Lost Woods/Sacred Forest Meadow/Deku Tree).
3204+
Items needed for this will be guaranteed inside the forest area,
3205+
and "Shuffle Dungeon Entrances" does not affect the Deku Tree.
3206+
This setting is incompatible with starting as adult, and so
3207+
Starting Age will be locked to Child. With either "Shuffle
3208+
Interior Entrances" set to "All", "Shuffle Overworld Entrances"
3209+
on, "Randomize Warp Song Destinations" on, or "Randomize Overworld
3210+
Spawns" on, this setting is automatically disabled and WILL NOT
3211+
guarantee that these items are available in the forest area.
3212+
''',
3213+
default = True,
3214+
disabled_default = False,
3215+
shared = True,
3216+
disable = {
3217+
True : {'settings' : ['open_forest', 'shuffle_interior_entrances', 'shuffle_bosses', 'shuffle_overworld_entrances', 'warp_songs', 'spawn_positions']}
3218+
},
3219+
),
32003220
Combobox(
32013221
name = 'open_kakariko',
32023222
gui_text = 'Kakariko Gate',
@@ -3585,6 +3605,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
35853605
When shuffling any interior entrances, trade quest timers are disabled
35863606
and items never revert, even when dying or loading a save.
35873607
''',
3608+
disable = {
3609+
'all' : {'settings': ['require_gohma']},
3610+
},
35883611
shared = True,
35893612
gui_params = {
35903613
'randomize_key': 'randomize_settings',
@@ -3657,6 +3680,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
36573680
'limited': 'Age-Restricted',
36583681
'full': 'Full',
36593682
},
3683+
disable = {
3684+
'!off' : {'settings': ['require_gohma']},
3685+
},
36603686
shared = True,
36613687
gui_params = {
36623688
'randomize_key': 'randomize_settings',
@@ -3681,6 +3707,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
36813707
even when dying or loading a save.
36823708
''',
36833709
default = False,
3710+
disable = {
3711+
True : {'settings': ['require_gohma']},
3712+
},
36843713
shared = True,
36853714
gui_params = {
36863715
'randomize_key': 'randomize_settings',
@@ -3720,6 +3749,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
37203749
Randomize where each of the 6 warp songs leads to.
37213750
''',
37223751
default = False,
3752+
disable = {
3753+
True : {'settings': ['require_gohma']},
3754+
},
37233755
shared = True,
37243756
gui_params = {
37253757
'randomize_key': 'randomize_settings',

World.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,6 @@ def __init__(self, id, settings, resolveRandomizedSettings=True):
7171
self.selected_adult_trade_item = ''
7272
self.adult_trade_starting_inventory = ''
7373

74-
if (
75-
settings.open_forest == 'closed'
76-
and (
77-
self.shuffle_special_interior_entrances or settings.shuffle_overworld_entrances
78-
or settings.warp_songs or settings.spawn_positions
79-
)
80-
):
81-
self.settings.open_forest = 'closed_deku'
82-
8374
if settings.triforce_goal_per_world > settings.triforce_count_per_world:
8475
raise ValueError("Triforces required cannot be more than the triforce count.")
8576
self.triforce_goal = settings.triforce_goal_per_world * settings.world_count
@@ -419,11 +410,7 @@ def resolve_random_settings(self):
419410
if (self.settings.starting_age == 'random'
420411
and ('starting_age' not in dist_keys
421412
or self.distribution.distribution.src_dict['_settings']['starting_age'] == 'random')):
422-
if self.settings.open_forest == 'closed':
423-
# adult is not compatible
424-
self.settings.starting_age = 'child'
425-
else:
426-
self.settings.starting_age = random.choice(['child', 'adult'])
413+
self.settings.starting_age = random.choice(['child', 'adult'])
427414
self.randomized_list.append('starting_age')
428415
if self.settings.chicken_count_random and 'chicken_count' not in dist_keys:
429416
self.settings.chicken_count = random.randint(0, 7)

data/Glitched World/Deku Tree MQ.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
"region_name": "Deku Tree Boss Room",
3232
"dungeon": "Deku Tree",
3333
"events": {
34-
"Deku Tree Clear": "Deku_Shield and (Kokiri_Sword or Sticks)"
34+
"Defeat Gohma": "Deku_Shield and (Kokiri_Sword or Sticks)"
3535
},
3636
"locations": {
3737
"Deku Tree MQ Before Spinning Log Chest": "True",
3838
"Deku Tree MQ After Spinning Log Chest": "can_play(Song_of_Time)",
3939
"Deku Tree MQ GS Basement Graves Room": "Boomerang and can_play(Song_of_Time)",
4040
"Deku Tree MQ GS Basement Back Room": "Boomerang",
4141
"Deku Tree MQ Deku Scrub": "True",
42-
"Deku Tree Queen Gohma Heart": "Deku_Shield and (Kokiri_Sword or Sticks)",
43-
"Queen Gohma": "Deku_Shield and (Kokiri_Sword or Sticks)"
42+
"Deku Tree Queen Gohma Heart": "'Defeat Gohma'",
43+
"Queen Gohma": "'Defeat Gohma'"
4444
},
4545
"exits": {
4646
"Deku Tree Lobby": "True"

data/Glitched World/Deku Tree.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@
4949
"region_name": "Queen Gohma Boss Room",
5050
"dungeon": "Deku Tree",
5151
"events": {
52-
"Deku Tree Clear": "(Nuts or can_use(Slingshot) or has_bombchus or can_use(Hookshot) or can_use(Bow) or can_use(Boomerang)) and
52+
"Defeat Gohma": "(Nuts or can_use(Slingshot) or has_bombchus or can_use(Hookshot) or can_use(Bow) or can_use(Boomerang)) and
5353
((here(has_shield or can_use(Megaton_Hammer)) and (is_adult or Kokiri_Sword or Sticks)) or is_adult)"
5454
},
5555
"locations": {
56-
"Deku Tree Queen Gohma Heart": "(Nuts or can_use(Slingshot) or has_bombchus or can_use(Hookshot) or can_use(Bow) or can_use(Boomerang)) and
57-
((here(has_shield or can_use(Megaton_Hammer)) and (is_adult or Kokiri_Sword or Sticks)) or is_adult)",
58-
"Queen Gohma": "(Nuts or can_use(Slingshot) or has_bombchus or can_use(Hookshot) or can_use(Bow) or can_use(Boomerang)) and
59-
((here(has_shield or can_use(Megaton_Hammer)) and (is_adult or Kokiri_Sword or Sticks)) or is_adult)"
56+
"Deku Tree Queen Gohma Heart": "'Defeat Gohma'",
57+
"Queen Gohma": "'Defeat Gohma'"
6058
},
6159
"exits": {
6260
"Deku Tree Lobby": "True"

data/Glitched World/Overworld.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"KF Kokiri Shop": "True",
5454
"KF Outside Deku Tree": "'Showed Mido Sword & Shield' or Sticks or is_adult",
5555
"Lost Woods": "True",
56-
"LW Bridge": "can_leave_forest",
56+
"LW Bridge": "open_forest != 'closed' or is_adult or 'Defeat Gohma'",
5757
"KF Storms Grotto": "can_play(Song_of_Storms)"
5858
}
5959
},
@@ -192,7 +192,7 @@
192192
"LW Gift from Saria": "True"
193193
},
194194
"exits": {
195-
"Kokiri Forest": "True",
195+
"Kokiri Forest": "True", # Walking through this entrance places Link past the Kokiri guard, so there are no restrictions for Closed Forest here
196196
"Hyrule Field": "True"
197197
}
198198
},

data/LogicHelpers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"can_child_damage": "is_child and (Slingshot or Sticks or Kokiri_Sword or has_explosives or can_use(Dins_Fire))",
4444
"can_cut_shrubs": "is_adult or Sticks or Kokiri_Sword or Boomerang or has_explosives",
4545
"can_dive": "Progressive_Scale",
46-
"can_leave_forest": "open_forest != 'closed' or is_adult or is_glitched or Deku_Tree_Clear",
46+
"can_leave_forest": "is_adult or 'Defeat Gohma' or not require_gohma",
4747
"can_plant_bugs": "is_child and Bugs",
4848
"can_ride_epona": "is_adult and Epona and (can_play(Eponas_Song) or (is_glitched and can_hover))",
4949
"can_stun_deku": "is_adult or (Slingshot or Boomerang or Sticks or Kokiri_Sword or has_explosives or can_use(Dins_Fire) or Nuts or Deku_Shield)",

data/World/Bosses.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"Deku Tree Clear": "(Nuts or can_use(Slingshot)) and can_jumpslash"
2323
},
2424
"locations": {
25-
"Deku Tree Queen Gohma Heart": "'Deku Tree Clear'",
26-
"Queen Gohma": "'Deku Tree Clear'"
25+
"Deku Tree Queen Gohma Heart": "'Defeat Gohma'",
26+
"Queen Gohma": "'Defeat Gohma'"
2727
},
2828
"exits": {
2929
"Deku Tree Boss Door": "True"

data/World/Overworld.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"KF Kokiri Shop": "True",
121121
"KF Outside Deku Tree": "is_adult or open_forest == 'open' or 'Showed Mido Sword & Shield'",
122122
"Lost Woods": "True",
123-
"LW Bridge From Forest": "can_leave_forest",
123+
"LW Bridge From Forest": "open_forest != 'closed' or is_adult or 'Defeat Gohma'",
124124
"KF Storms Grotto": "can_open_storm_grotto"
125125
}
126126
},
@@ -376,7 +376,7 @@
376376
"scene": "Lost Woods",
377377
"hint": "LOST_WOODS",
378378
"exits": {
379-
"Kokiri Forest": "True",
379+
"Kokiri Forest": "True", # Walking through this entrance places Link past the Kokiri guard, so there are no restrictions for Closed Forest here
380380
"Hyrule Field": "True",
381381
"Lost Woods": "can_use(Longshot)"
382382
}

data/settings_mapping.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"row_span": [6,6,9],
137137
"settings": [
138138
"open_forest",
139+
"require_gohma",
139140
"open_kakariko",
140141
"open_door_of_time",
141142
"zora_fountain",

0 commit comments

Comments
 (0)