Skip to content

Commit 311e63c

Browse files
committed
Merge "Added option to force Rauru's reward to be a dungeon reward even when dungeon rewards are shuffled" (#2459)
# Conflicts: # ItemPool.py
2 parents 726c1c5 + 37a53b5 commit 311e63c

16 files changed

Lines changed: 62 additions & 27 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Dev
22

33
* New hint distribution field `boss_goal_names` can be set to `false` to force dungeon reward names to be used for goal text instead of boss names even if dungeon rewards are on bosses.
4+
* The `Free Reward from Rauru` has a new `Yes (Forced)` option which forces the check to be a dungeon reward even if these are otherwise shuffled.
45

56
# 9.0
67

Goals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def replace_goal_names(worlds: list[World]) -> None:
153153
location
154154
for location in world.get_filled_locations()
155155
if location.type == 'Boss'
156-
and (location.name != 'ToT Reward from Rauru' or not world.settings.skip_reward_from_rauru)
156+
and (location.name != 'ToT Reward from Rauru' or world.settings.skip_reward_from_rauru == 'not_free')
157157
]
158158
for category in world.goal_categories.values():
159159
for goal in category.goals:

ItemPool.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from Item import Item, ItemInfo, ItemFactory
99
from Location import DisableType
10+
from LocationList import location_groups
1011
import StartingItems
1112

1213
if TYPE_CHECKING:
@@ -549,6 +550,7 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]:
549550

550551
# Use the vanilla items in the world's locations when appropriate.
551552
vanilla_items_processed = Counter()
553+
rauru_random_location = None
552554
for location in world.get_locations():
553555
if location.vanilla_item is None:
554556
continue
@@ -810,11 +812,25 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]:
810812
if world.settings.shuffle_dungeon_rewards in ('vanilla', 'reward'):
811813
pass # handled in World.fill_bosses
812814
else:
813-
shuffle_item = True
815+
if world.settings.skip_reward_from_rauru != 'free_forced':
816+
shuffle_item = True
817+
else:
818+
if world.settings.shuffle_dungeon_rewards in ('any_dungeon', 'overworld', 'anywhere'):
819+
# Rauru is currently considered a "Boss" by location, may need to change this in the future.
820+
boss_locations = location_groups['Boss']
821+
rauru_random_location: str = random.choice(boss_locations)
822+
item = world.get_location(rauru_random_location).vanilla_item
823+
world.push_item(location, ItemFactory(item, world))
824+
else:
825+
item = location.vanilla_item
826+
world.push_item(location, ItemFactory(item, world))
814827
elif location.type == 'Boss':
815828
if world.settings.shuffle_dungeon_rewards in ('vanilla', 'reward'):
816829
pass # handled in World.fill_bosses
817830
elif world.settings.shuffle_dungeon_rewards in ('any_dungeon', 'overworld', 'regional', 'anywhere'):
831+
# We swap with the dungeon reward that rauru became if it is a guaranteed dungeon reward then shuffle like usual
832+
if rauru_random_location == location.name:
833+
item = world.get_location('ToT Reward from Rauru').vanilla_item
818834
shuffle_item = True
819835
else:
820836
dungeon = Dungeon.from_vanilla_reward(ItemFactory(location.vanilla_item, world))

Plandomizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ def configure_effective_starting_items(self, worlds: list[World], world: World)
10901090

10911091
for iter_world in worlds:
10921092
skipped_locations: list[Location] = []
1093-
if iter_world.settings.skip_reward_from_rauru:
1093+
if iter_world.settings.skip_reward_from_rauru in ('free', 'free_forced'):
10941094
skipped_locations.append(iter_world.get_location('ToT Reward from Rauru'))
10951095
if iter_world.skip_child_zelda:
10961096
skipped_locations += [iter_world.get_location('HC Zeldas Letter'), iter_world.get_location('Song from Impa')]

SaveContext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ def write_settings_dependent_save_context_flags(save_context: SaveContext, world
16941694
save_context.write_permanent_flag(Scenes.DEATH_MOUNTAIN_TRAIL, FlagType.SWITCH, 0x3, 0x40) # Plant Death Mountain Trail bean
16951695
save_context.write_permanent_flag(Scenes.DEATH_MOUNTAIN_CRATER, FlagType.SWITCH, 0x3, 0x08) # Plant Death Mountain Crater bean
16961696

1697-
if world.settings.skip_reward_from_rauru:
1697+
if world.settings.skip_reward_from_rauru in ('free', 'free_forced'):
16981698
save_context.write_bits(0x0EDD, 0x20) # "Pulled Master Sword from Pedestal"
16991699

17001700
if world.settings.ruto_already_f1_jabu and not world.dungeon_mq['Jabu Jabus Belly']:

SettingsList.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3340,12 +3340,30 @@ class SettingInfos:
33403340

33413341
# Other
33423342

3343-
skip_reward_from_rauru = Checkbutton(
3343+
skip_reward_from_rauru = Combobox(
33443344
gui_text = 'Free Reward from Rauru',
3345+
default = 'not_free',
3346+
choices = {
3347+
'not_free': 'No',
3348+
'free': 'Yes',
3349+
'free_forced': 'Yes (Forced)',
3350+
},
33453351
gui_tooltip = '''\
33463352
The item given by Rauru beyond the Door of Time
33473353
(the Light Medallion in the vanilla game) is
33483354
given as a starting item instead.
3355+
3356+
'No': Rauru gives reward when you go beyond
3357+
the Door of Time.
3358+
3359+
'Yes': You begin the game with the reward Rauru
3360+
normally gives beyond the Door of Time. If dungeon
3361+
rewards are shuffled then this will be as well.
3362+
3363+
'Yes (Forced)': You begin the game with the
3364+
reward Rauru normally gives beyond the Door of Time,
3365+
if dungeon rewards are shuffled you will still
3366+
get a random Spiritual Stone or Medallion.
33493367
''',
33503368
shared = True,
33513369
)

data/Glitched World/Overworld.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exits": {
1212
"Root Exits": "is_starting_age or Time_Travel",
1313
"HC Garden Skippable Locations": "skip_child_zelda",
14-
"Beyond Door of Time Skippable Locations": "skip_reward_from_rauru",
14+
"Beyond Door of Time Skippable Locations": "skip_reward_from_rauru != 'not_free'",
1515
# Hack to make ALR work if hideout entrances are unshuffled
1616
"GF Above Jail Child Locations": "shuffle_gerudo_fortress_heart_piece == 'remove' or not shuffle_hideout_entrances"
1717
}

data/World/Overworld.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exits": {
1212
"Root Exits": "is_starting_age or Time_Travel",
1313
"HC Garden Skippable Locations": "skip_child_zelda",
14-
"Beyond Door of Time Skippable Locations": "skip_reward_from_rauru",
14+
"Beyond Door of Time Skippable Locations": "skip_reward_from_rauru != 'not_free'",
1515
# Hack to make ALR work if hideout entrances are unshuffled
1616
"GF Above Jail Child Locations": "shuffle_gerudo_fortress_heart_piece == 'remove' or not shuffle_hideout_entrances"
1717
}

data/presets_default.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"start_with_consumables": true,
128128
"start_with_rupees": true,
129129
"starting_hearts": 3,
130-
"skip_reward_from_rauru": true,
130+
"skip_reward_from_rauru": "free",
131131
"no_escape_sequence": true,
132132
"no_guard_stealth": true,
133133
"no_epona_race": true,
@@ -361,7 +361,7 @@
361361
"start_with_consumables": true,
362362
"start_with_rupees": false,
363363
"starting_hearts": 3,
364-
"skip_reward_from_rauru": true,
364+
"skip_reward_from_rauru": "free",
365365
"no_escape_sequence": true,
366366
"no_guard_stealth": true,
367367
"no_epona_race": true,
@@ -584,7 +584,7 @@
584584
"start_with_consumables": true,
585585
"start_with_rupees": false,
586586
"starting_hearts": 3,
587-
"skip_reward_from_rauru": true,
587+
"skip_reward_from_rauru": "free",
588588
"no_escape_sequence": true,
589589
"no_guard_stealth": true,
590590
"no_epona_race": true,
@@ -799,7 +799,7 @@
799799
"start_with_consumables": false,
800800
"start_with_rupees": false,
801801
"starting_hearts": 3,
802-
"skip_reward_from_rauru": true,
802+
"skip_reward_from_rauru": "free",
803803
"no_escape_sequence": true,
804804
"no_guard_stealth": true,
805805
"no_epona_race": true,
@@ -1037,7 +1037,7 @@
10371037
"start_with_consumables": true,
10381038
"start_with_rupees": false,
10391039
"starting_hearts": 3,
1040-
"skip_reward_from_rauru": true,
1040+
"skip_reward_from_rauru": "free",
10411041
"no_escape_sequence": true,
10421042
"no_guard_stealth": true,
10431043
"no_epona_race": true,
@@ -1258,7 +1258,7 @@
12581258
"start_with_consumables": true,
12591259
"start_with_rupees": true,
12601260
"starting_hearts": 3,
1261-
"skip_reward_from_rauru": true,
1261+
"skip_reward_from_rauru": "free",
12621262
"no_escape_sequence": true,
12631263
"no_guard_stealth": true,
12641264
"no_epona_race": true,
@@ -1489,7 +1489,7 @@
14891489
"start_with_consumables": true,
14901490
"start_with_rupees": false,
14911491
"starting_hearts": 3,
1492-
"skip_reward_from_rauru": true,
1492+
"skip_reward_from_rauru": "free",
14931493
"no_escape_sequence": true,
14941494
"no_guard_stealth": true,
14951495
"no_epona_race": true,
@@ -1896,7 +1896,7 @@
18961896
"start_with_consumables": false,
18971897
"start_with_rupees": false,
18981898
"starting_hearts": 3,
1899-
"skip_reward_from_rauru": false,
1899+
"skip_reward_from_rauru": "not_free",
19001900
"no_escape_sequence": false,
19011901
"no_guard_stealth": false,
19021902
"no_epona_race": false,
@@ -2099,7 +2099,7 @@
20992099
"start_with_consumables": false,
21002100
"start_with_rupees": false,
21012101
"starting_hearts": 3,
2102-
"skip_reward_from_rauru": true,
2102+
"skip_reward_from_rauru": "free",
21032103
"no_escape_sequence": true,
21042104
"no_guard_stealth": false,
21052105
"no_epona_race": false,
@@ -2322,7 +2322,7 @@
23222322
"start_with_consumables": true,
23232323
"start_with_rupees": true,
23242324
"starting_hearts": 3,
2325-
"skip_reward_from_rauru": true,
2325+
"skip_reward_from_rauru": "free",
23262326
"no_escape_sequence": true,
23272327
"no_guard_stealth": true,
23282328
"no_epona_race": true,
@@ -2550,7 +2550,7 @@
25502550
"start_with_consumables": true,
25512551
"start_with_rupees": true,
25522552
"starting_hearts": 3,
2553-
"skip_reward_from_rauru": true,
2553+
"skip_reward_from_rauru": "free",
25542554
"no_escape_sequence": true,
25552555
"no_guard_stealth": true,
25562556
"no_epona_race": true,
@@ -2742,7 +2742,7 @@
27422742
"start_with_consumables": false,
27432743
"start_with_rupees": true,
27442744
"starting_hearts": 3,
2745-
"skip_reward_from_rauru": true,
2745+
"skip_reward_from_rauru": "free",
27462746
"no_escape_sequence": true,
27472747
"no_guard_stealth": true,
27482748
"no_epona_race": true,
@@ -3016,7 +3016,7 @@
30163016
"start_with_consumables": false,
30173017
"start_with_rupees": false,
30183018
"starting_hearts": 3,
3019-
"skip_reward_from_rauru": true,
3019+
"skip_reward_from_rauru": "free",
30203020
"no_escape_sequence": true,
30213021
"no_guard_stealth": true,
30223022
"no_epona_race": true,

tests/plando/one-hint-per-goal-dungeons.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"tokensanity": "all",
2020
"mq_dungeons_mode": "vanilla",
2121
"disabled_locations": [],
22-
"skip_reward_from_rauru": true,
22+
"skip_reward_from_rauru": "free_forced",
2323
"hint_dist_user": {
2424
"name": "goal_coverage_unit_test",
2525
"gui_name": "Goal Coverage Unit Test",

0 commit comments

Comments
 (0)