Skip to content

Commit 1d37ea6

Browse files
committed
Separate settings for Open Deku and Open Forest
1 parent 9076069 commit 1d37ea6

9 files changed

Lines changed: 77 additions & 62 deletions

File tree

EntranceShuffle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def shuffle_random_entrances(worlds):
401401
# The fill algorithm will already make sure gohma is reachable, however it can end up putting
402402
# a forest escape via the hands of spirit on Deku leading to Deku on spirit in logic. This is
403403
# not really a closed forest anymore, so specifically remove Deku Tree from closed forest.
404-
if worlds[0].settings.open_forest == 'closed':
404+
if not worlds[0].settings.open_forest:
405405
entrance_pools['Dungeon'].remove(world.get_entrance('KF Outside Deku Tree -> Deku Tree Lobby'))
406406

407407
if worlds[0].shuffle_interior_entrances:

Patches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ def patch_rom(spoiler:Spoiler, world:World, rom:Rom):
686686
# Change Pokey to check DT complete flag
687687
rom.write_bytes(0xE5400A, [0x8C, 0x4C])
688688
rom.write_bytes(0xE5400E, [0xB4, 0xA4])
689-
if world.settings.open_forest != 'closed':
689+
if world.settings.open_forest:
690690
rom.write_bytes(0xE5401C, [0x14, 0x0B])
691691

692692
# Fix Shadow Temple to check for different rewards for scene
@@ -1191,7 +1191,7 @@ def set_entrance_updates(entrances):
11911191
else:
11921192
rom.write_int32(symbol, 0)
11931193

1194-
if world.settings.open_forest == 'open':
1194+
if world.settings.open_deku:
11951195
save_context.write_bits(0xED5, 0x10) # "Showed Mido Sword & Shield"
11961196

11971197
if world.settings.open_door_of_time:

SettingsList.py

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,48 +2076,48 @@ def __init__(self, name, gui_text, min, max, default, step=1,
20762076
},
20772077
shared = True,
20782078
),
2079-
Combobox(
2080-
name = 'open_forest',
2081-
gui_text = 'Forest',
2082-
default = 'closed',
2083-
choices = {
2084-
'open': 'Open Forest',
2085-
'closed_deku': 'Closed Deku',
2086-
'closed': 'Closed Forest',
2087-
},
2079+
Checkbutton(
2080+
name = 'open_deku',
2081+
gui_text = 'Open Deku Tree',
20882082
gui_tooltip = '''\
2089-
'Open Forest': Mido no longer blocks the path to the
2090-
Deku Tree, and the Kokiri boy no longer blocks the path
2091-
out of the forest.
2092-
2093-
'Closed Deku': The Kokiri boy no longer blocks the path
2094-
out of the forest, but Mido still blocks the path to the
2095-
Deku Tree, requiring Kokiri Sword and Deku Shield to access
2096-
the Deku Tree.
2097-
2098-
'Closed Forest': Beating Deku Tree is logically required
2099-
to leave the forest area (Kokiri Forest/Lost Woods/Sacred Forest
2100-
Meadow/Deku Tree), while the Kokiri Sword and a Deku Shield are
2101-
required to access the Deku Tree. Items needed for this will be
2102-
guaranteed inside the forest area. This setting is incompatible
2103-
with starting as adult, and so Starting Age will be locked to Child.
2104-
With either "Shuffle Interior Entrances" set to "All", "Shuffle
2105-
Overworld Entrances" on, "Randomize Warp Song Destinations" on
2106-
or "Randomize Overworld Spawns" on, Closed Forest will instead
2107-
be treated as Closed Deku with starting age Child and WILL NOT
2108-
guarantee that these items are available in the forest area.
2083+
In the child era, Mido no longer blocks the path
2084+
to the Deku Tree, so you can access the area without
2085+
requiring Kokiri Sword and Deku Shield.
2086+
2087+
If "Shuffle Dungeon Entrances" is enabled, the
2088+
Deku Tree's mouth is also open in the adult era.
21092089
''',
21102090
shared = True,
2091+
gui_params = {
2092+
'randomize_key': 'randomize_settings',
2093+
},
2094+
),
2095+
Checkbutton(
2096+
name = 'open_forest',
2097+
gui_text = 'Open Forest',
2098+
gui_tooltip = '''\
2099+
'Open Forest': The Kokiri boy no longer blocks the path out
2100+
of the forest.
2101+
2102+
'Closed Forest': Beating Deku Tree is logically required to
2103+
leave the forest area (Kokiri Forest/Lost Woods/Sacred
2104+
Forest Meadow/Deku Tree). Items needed for this will be
2105+
guaranteed inside the forest area. This setting is
2106+
incompatible with starting as adult, and so Starting Age
2107+
will be locked to Child. With either "Shuffle Interior
2108+
Entrances" set to "All", "Shuffle Overworld Entrances" on,
2109+
"Randomize Warp Song Destinations" on, or "Randomize
2110+
Overworld Spawns" on, "Open Forest" is automatically
2111+
enabled and WILL NOT guarantee that these items are
2112+
available in the forest area.
2113+
''',
2114+
disabled_default = True,
2115+
shared = True,
21112116
disable = {
2112-
'closed' : {'settings' : ['starting_age']}
2117+
False : {'settings' : ['starting_age', 'shuffle_interior_entrances', 'shuffle_overworld_entrances', 'warp_songs', 'spawn_positions']}
21132118
},
21142119
gui_params = {
21152120
'randomize_key': 'randomize_settings',
2116-
'distribution': [
2117-
('open', 1),
2118-
('closed_deku', 1),
2119-
('closed', 1),
2120-
],
21212121
},
21222122
),
21232123
Combobox(
@@ -2991,6 +2991,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
29912991
When shuffling any interior entrances, trade quest timers are disabled
29922992
and items never revert, even when dying or loading a save.
29932993
''',
2994+
disable = {
2995+
'all' : {'settings': ['open_forest']},
2996+
},
29942997
shared = True,
29952998
gui_params = {
29962999
'randomize_key': 'randomize_settings',
@@ -3049,6 +3052,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
30493052
''',
30503053
default = False,
30513054
shared = True,
3055+
disable = {
3056+
True : {'settings': ['open_forest']},
3057+
},
30523058
gui_params = {
30533059
'randomize_key': 'randomize_settings',
30543060
},
@@ -3075,6 +3081,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
30753081
''',
30763082
default = False,
30773083
shared = True,
3084+
disable = {
3085+
True : {'settings': ['open_forest']},
3086+
},
30783087
gui_params = {
30793088
'randomize_key': 'randomize_settings',
30803089
},
@@ -3091,6 +3100,9 @@ def __init__(self, name, gui_text, min, max, default, step=1,
30913100
''',
30923101
default = False,
30933102
shared = True,
3103+
disable = {
3104+
True : {'settings': ['open_forest']},
3105+
},
30943106
gui_params = {
30953107
'randomize_key': 'randomize_settings',
30963108
},

World.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ def __init__(self, id, settings, resolveRandomizedSettings=True):
6262
self.ensure_tod_access = self.shuffle_interior_entrances or settings.shuffle_overworld_entrances or settings.spawn_positions
6363
self.disable_trade_revert = self.shuffle_interior_entrances or settings.shuffle_overworld_entrances
6464

65-
if settings.open_forest == 'closed' and (self.shuffle_special_interior_entrances or settings.shuffle_overworld_entrances or
66-
settings.warp_songs or settings.spawn_positions):
67-
self.settings.open_forest = 'closed_deku'
68-
6965
if settings.triforce_goal_per_world > settings.triforce_count_per_world:
7066
raise ValueError("Triforces required cannot be more than the triforce count.")
7167
self.triforce_goal = settings.triforce_goal_per_world * settings.world_count
@@ -335,11 +331,7 @@ def resolve_random_settings(self):
335331
if (self.settings.starting_age == 'random'
336332
and ('starting_age' not in dist_keys
337333
or self.distribution.distribution.src_dict['_settings']['starting_age'] == 'random')):
338-
if self.settings.open_forest == 'closed':
339-
# adult is not compatible
340-
self.settings.starting_age = 'child'
341-
else:
342-
self.settings.starting_age = random.choice(['child', 'adult'])
334+
self.settings.starting_age = random.choice(['child', 'adult'])
343335
self.randomized_list.append('starting_age')
344336
if self.settings.chicken_count_random and 'chicken_count' not in dist_keys:
345337
self.settings.chicken_count = random.randint(0, 7)

data/Glitched World/Overworld.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"region_name": "Kokiri Forest",
3030
"hint": "Kokiri Forest",
3131
"events": {
32-
"Showed Mido Sword & Shield": "open_forest == 'open' or (is_child and Kokiri_Sword and Buy_Deku_Shield)"
32+
"Showed Mido Sword & Shield": "open_deku or (is_child and Kokiri_Sword and Buy_Deku_Shield)"
3333
},
3434
"locations": {
3535
"KF Kokiri Sword Chest": "is_child",

data/LogicHelpers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"can_child_damage": "is_child and (Slingshot or Sticks or Kokiri_Sword or has_explosives or can_use(Dins_Fire))",
4343
"can_cut_shrubs": "is_adult or Sticks or Kokiri_Sword or Boomerang or has_explosives",
4444
"can_dive": "Progressive_Scale",
45-
"can_leave_forest": "open_forest != 'closed' or is_adult or is_glitched or Deku_Tree_Clear",
45+
"can_leave_forest": "open_forest or is_adult or is_glitched or Deku_Tree_Clear",
4646
"can_plant_bugs": "is_child and Bugs",
4747
"can_ride_epona": "is_adult and Epona and (can_play(Eponas_Song) or (is_glitched and can_hover))",
4848
"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/Overworld.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"KF House of Twins": "True",
102102
"KF Know It All House": "True",
103103
"KF Kokiri Shop": "True",
104-
"KF Outside Deku Tree": "is_adult or open_forest == 'open' or 'Showed Mido Sword & Shield'",
104+
"KF Outside Deku Tree": "is_adult or open_deku or 'Showed Mido Sword & Shield'",
105105
"Lost Woods": "True",
106106
"LW Bridge From Forest": "can_leave_forest",
107107
"KF Storms Grotto": "can_open_storm_grotto"
@@ -128,8 +128,8 @@
128128
"exits": {
129129
"Deku Tree Lobby": "
130130
is_child or
131-
(shuffle_dungeon_entrances and (open_forest == 'open' or 'Showed Mido Sword & Shield'))",
132-
"Kokiri Forest": "is_adult or open_forest == 'open' or 'Showed Mido Sword & Shield'"
131+
(shuffle_dungeon_entrances and (open_deku or 'Showed Mido Sword & Shield'))",
132+
"Kokiri Forest": "is_adult or open_deku or 'Showed Mido Sword & Shield'"
133133
}
134134
},
135135
{

data/presets_default.json

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"world_count": 1,
55
"randomize_settings": false,
66
"logic_rules": "glitchless",
7-
"open_forest": "closed",
7+
"open_deku": false,
8+
"open_forest": false,
89
"open_kakariko": "open",
910
"open_door_of_time": true,
1011
"zora_fountain": "closed",
@@ -90,7 +91,8 @@
9091
"world_count": 1,
9192
"create_spoiler": true,
9293
"randomize_settings": false,
93-
"open_forest": "closed_deku",
94+
"open_deku": false,
95+
"open_forest": true,
9496
"open_kakariko": "open",
9597
"open_door_of_time": true,
9698
"zora_fountain": "closed",
@@ -198,7 +200,8 @@
198200
"world_count": 1,
199201
"create_spoiler": true,
200202
"randomize_settings": false,
201-
"open_forest": "open",
203+
"open_deku": true,
204+
"open_forest": true,
202205
"open_kakariko": "open",
203206
"open_door_of_time": true,
204207
"zora_fountain": "closed",
@@ -306,7 +309,8 @@
306309
"world_count": 1,
307310
"create_spoiler": true,
308311
"randomize_settings": false,
309-
"open_forest": "open",
312+
"open_deku": true,
313+
"open_forest": true,
310314
"open_kakariko": "closed",
311315
"open_door_of_time": true,
312316
"zora_fountain": "closed",
@@ -409,7 +413,8 @@
409413
"world_count": 1,
410414
"randomize_settings": false,
411415
"logic_rules": "glitchless",
412-
"open_forest": "open",
416+
"open_deku": true,
417+
"open_forest": true,
413418
"open_kakariko": "open",
414419
"open_door_of_time": true,
415420
"zora_fountain": "closed",
@@ -522,7 +527,8 @@
522527
"world_count": 3,
523528
"create_spoiler": true,
524529
"randomize_settings": false,
525-
"open_forest": "open",
530+
"open_deku": true,
531+
"open_forest": true,
526532
"open_kakariko": "open",
527533
"open_door_of_time": true,
528534
"zora_fountain": "closed",
@@ -634,7 +640,8 @@
634640
"world_count": 1,
635641
"randomize_settings": false,
636642
"logic_rules": "glitchless",
637-
"open_forest": "closed_deku",
643+
"open_deku": false,
644+
"open_forest": true,
638645
"open_kakariko": "closed",
639646
"open_door_of_time": false,
640647
"zora_fountain": "closed",
@@ -856,7 +863,8 @@
856863
"world_count": 1,
857864
"create_spoiler": true,
858865
"randomize_settings": false,
859-
"open_forest": "open",
866+
"open_deku": true,
867+
"open_forest": true,
860868
"open_kakariko": "closed",
861869
"open_door_of_time": true,
862870
"zora_fountain": "closed",
@@ -954,7 +962,8 @@
954962
"world_count": 1,
955963
"create_spoiler": false,
956964
"randomize_settings": false,
957-
"open_forest": "open",
965+
"open_deku": true,
966+
"open_forest": true,
958967
"open_kakariko": "open",
959968
"open_door_of_time": true,
960969
"zora_fountain": "closed",
@@ -1056,7 +1065,8 @@
10561065
"world_count": 1,
10571066
"create_spoiler": false,
10581067
"randomize_settings": false,
1059-
"open_forest": "open",
1068+
"open_deku": true,
1069+
"open_forest": true,
10601070
"open_kakariko": "open",
10611071
"open_door_of_time": true,
10621072
"zora_fountain": "closed",

data/settings_mapping.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
"text": "Open",
155155
"row_span": [6,6,9],
156156
"settings": [
157+
"open_deku",
157158
"open_forest",
158159
"open_kakariko",
159160
"open_door_of_time",

0 commit comments

Comments
 (0)