Skip to content

Commit

Permalink
Merge branch 'blue-warp-tod-logic' into dev-fenhl
Browse files Browse the repository at this point in the history
# Conflicts:
#	ASM/build/asm_symbols.txt
#	ASM/build/bundle.o
#	ASM/build/c_symbols.txt
#	EntranceShuffle.py
#	World.py
#	data/generated/rom_patch.txt
#	data/generated/symbols.json
  • Loading branch information
fenhl committed Sep 1, 2024
2 parents b4eb1e2 + 4f2c975 commit 0c9f9ed
Show file tree
Hide file tree
Showing 13 changed files with 34,872 additions and 34,817 deletions.
1,370 changes: 685 additions & 685 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
1,384 changes: 692 additions & 692 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

29 changes: 18 additions & 11 deletions ASM/c/blue_warp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ int32_t DoorWarp1_PlayerInRange_Overwrite(z64_actor_t* actor, z64_game_t* game)
}
extended_savectx.collected_dungeon_rewards[boss_idx] = true;
}
// set time of day each time the blue warp is taken to reduce nonrepeatable access
if (boss_idx == 5) { // Morpha
z64_file.skybox_time = z64_file.day_time = 0x4800; // CLOCK_TIME(6, 45)
} else {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
}
// reset heat timer after Volvagia
if (boss_idx == 4) {
z64_file.timer_1_state = 0;
}
// immediately activate the blue warp. Queued item will be given after the warp
return true;
}
Expand All @@ -57,38 +67,35 @@ int32_t DoorWarp1_IsShadowRewardObtained(void) {
}

void DoorWarp1_KokiriEmerald_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Queen Gohma blue warp is taken
}

void DoorWarp1_GoronRuby_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the King Dodongo blue warp is taken
}

void DoorWarp1_ZoraSapphire_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Barinade blue warp is taken
}

void DoorWarp1_ForestMedallion_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Phantom Ganon blue warp is taken
}

void DoorWarp1_FireMedallion_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Volvagia blue warp is taken
z64_file.event_chk_inf[2] |= 1 << 15; // DMT cloud circle no longer fire
z64_file.timer_1_state = 0; // reset heat timer
}

void DoorWarp1_WaterMedallion_Overwrite(void) {
z64_file.skybox_time = z64_file.day_time = 0x4800; // CLOCK_TIME(6, 45)
// code to run the first time the Morpha blue warp is taken
z64_file.event_chk_inf[6] |= 1 << 9; // Lake Hylia water raised
}

void DoorWarp1_SpiritMedallion_Overwrite(void) {
extended_savectx.collected_dungeon_rewards[6] = true;
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Twinrova blue warp is taken
}

void DoorWarp1_ShadowMedallion_Overwrite(void) {
extended_savectx.collected_dungeon_rewards[7] = true;
z64_file.skybox_time = z64_file.day_time = 0x8000; // CLOCK_TIME(12, 00)
// code to run the first time the Bongo Bongo blue warp is taken
}
52 changes: 26 additions & 26 deletions EntranceShuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,14 @@ def build_one_way_targets(world: World, types_to_include: Iterable[str], types_t
('WarpSong', ('Nocturne of Shadow Warp -> Graveyard Warp Pad Region', { 'index': 0x0568, 'addresses': [0xBF0244] })),
('WarpSong', ('Prelude of Light Warp -> Temple of Time', { 'index': 0x05F4, 'addresses': [0xBF0246] })),

('BlueWarp', ('Queen Gohma Boss Room -> KF Outside Deku Tree', { 'index': 0x0457, 'addresses': [0xAC93A2, 0xCA3142, 0xCA316A], 'forest': True, 'deku': True })),
('BlueWarp', ('King Dodongo Boss Room -> Death Mountain', { 'index': 0x047A, 'addresses': [0xAC9336, 0xCA30CA, 0xCA30EA] })),
('BlueWarp', ('Barinade Boss Room -> Zoras Fountain', { 'index': 0x010E, 'addresses': [0xAC936A, 0xCA31B2, 0xCA3702] })),
('BlueWarp', ('Phantom Ganon Boss Room -> Sacred Forest Meadow', { 'index': 0x0608, 'addresses': [0xAC9F96, 0xCA3D66, 0xCA3D5A, 0xCA3D32], 'child_index': 0x0600 })),
('BlueWarp', ('Volvagia Boss Room -> DMC Central Local', { 'index': 0x0564, 'addresses': [0xACA516, 0xCA3DF2, 0xCA3DE6, 0xCA3DBE], 'child_index': 0x04F6 })),
('BlueWarp', ('Morpha Boss Room -> Lake Hylia', { 'index': 0x060C, 'addresses': [0xAC995A, 0xCA3E82, 0xCA3E76, 0xCA3E4A], 'child_index': 0x0604 })),
('BlueWarp', ('Bongo Bongo Boss Room -> Graveyard Warp Pad Region', { 'index': 0x0580, 'addresses': [0xACA496, 0xCA3FA2, 0xCA3F96, 0xCA3F6A], 'child_index': 0x0568 })),
('BlueWarp', ('Twinrova Boss Room -> Desert Colossus', { 'index': 0x0610, 'addresses': [0xACA402, 0xCA3F12, 0xCA3F06, 0xCA3EDA], 'child_index': 0x01F1 })),
('BlueWarp', ('Queen Gohma Blue Warp -> KF Outside Deku Tree', { 'index': 0x0457, 'addresses': [0xAC93A2, 0xCA3142, 0xCA316A], 'forest': True, 'deku': True })),
('BlueWarp', ('King Dodongo Blue Warp -> Death Mountain', { 'index': 0x047A, 'addresses': [0xAC9336, 0xCA30CA, 0xCA30EA] })),
('BlueWarp', ('Barinade Blue Warp -> Zoras Fountain', { 'index': 0x010E, 'addresses': [0xAC936A, 0xCA31B2, 0xCA3702] })),
('BlueWarp', ('Phantom Ganon Blue Warp -> Sacred Forest Meadow', { 'index': 0x0608, 'addresses': [0xAC9F96, 0xCA3D66, 0xCA3D5A, 0xCA3D32], 'child_index': 0x0600 })),
('BlueWarp', ('Volvagia Blue Warp -> DMC Central Local', { 'index': 0x0564, 'addresses': [0xACA516, 0xCA3DF2, 0xCA3DE6, 0xCA3DBE], 'child_index': 0x04F6 })),
('BlueWarp', ('Morpha Blue Warp -> Lake Hylia', { 'index': 0x060C, 'addresses': [0xAC995A, 0xCA3E82, 0xCA3E76, 0xCA3E4A], 'child_index': 0x0604 })),
('BlueWarp', ('Bongo Bongo Blue Warp -> Graveyard Warp Pad Region', { 'index': 0x0580, 'addresses': [0xACA496, 0xCA3FA2, 0xCA3F96, 0xCA3F6A], 'child_index': 0x0568 })),
('BlueWarp', ('Twinrova Blue Warp -> Desert Colossus', { 'index': 0x0610, 'addresses': [0xACA402, 0xCA3F12, 0xCA3F06, 0xCA3EDA], 'child_index': 0x01F1 })),

('Extra', ('ZD Eyeball Frog Timeout -> Zoras Domain', { 'index': 0x0153 })),
('Extra', ('ZR Top of Waterfall -> Zora River', { 'index': 0x0199 })),
Expand Down Expand Up @@ -649,7 +649,7 @@ def shuffle_random_entrances(worlds: list[World]) -> None:
valid_target_types_reverse = ('ChildBoss', 'AdultBoss', 'SpecialBoss', *valid_target_types_reverse)
else:
# Restrict spawn entrances from linking to regions with no or extremely specific glitchless itemless escapes.
exclude.extend(('Volvagia Boss Room -> DMC Central Local', 'Bolero of Fire Warp -> DMC Central Local', 'Queen Gohma Boss Room -> KF Outside Deku Tree'))
exclude.extend(('Volvagia Blue Warp -> DMC Central Local', 'Bolero of Fire Warp -> DMC Central Local', 'Queen Gohma Blue Warp -> KF Outside Deku Tree'))
one_way_target_entrance_pools[pool_type] = build_one_way_targets(world, valid_target_types, valid_target_types_reverse, exclude=exclude)
elif pool_type == 'AdultSpawn':
valid_target_types = ('ChildSpawn', 'AdultSpawn', 'WarpSong', 'BlueWarp', 'OwlDrop', 'OverworldOneWay', 'Overworld', 'Interior', 'SpecialInterior', 'Extra')
Expand All @@ -664,7 +664,7 @@ def shuffle_random_entrances(worlds: list[World]) -> None:
valid_target_types_reverse = ('ChildBoss', 'AdultBoss', 'SpecialBoss', *valid_target_types_reverse)
else:
# Restrict spawn entrances from linking to regions with no or extremely specific glitchless itemless escapes.
exclude.extend(('Volvagia Boss Room -> DMC Central Local', 'Bolero of Fire Warp -> DMC Central Local', 'Queen Gohma Boss Room -> KF Outside Deku Tree'))
exclude.extend(('Volvagia Blue Warp -> DMC Central Local', 'Bolero of Fire Warp -> DMC Central Local', 'Queen Gohma Blue Warp -> KF Outside Deku Tree'))
one_way_target_entrance_pools[pool_type] = build_one_way_targets(world, valid_target_types, valid_target_types_reverse, exclude=exclude)
elif pool_type == 'WarpSong':
valid_target_types = ('ChildSpawn', 'AdultSpawn', 'WarpSong', 'BlueWarp', 'OwlDrop', 'OverworldOneWay', 'Overworld', 'Interior', 'SpecialInterior', 'Extra')
Expand Down Expand Up @@ -833,25 +833,25 @@ def shuffle_random_entrances(worlds: list[World]) -> None:
}
# if a boss room is inside a dungeon entrance (or inside a dungeon which is inside a dungeon entrance), make the blue warp go to that dungeon's blue warp target
dungeon_exits = {
'Deku Tree Lobby -> KF Outside Deku Tree': world.get_entrance('Queen Gohma Boss Room -> KF Outside Deku Tree'),
'Dodongos Cavern Beginning -> Death Mountain': world.get_entrance('King Dodongo Boss Room -> Death Mountain'),
'Jabu Jabus Belly Beginning -> Zoras Fountain': world.get_entrance('Barinade Boss Room -> Zoras Fountain'),
'Forest Temple Lobby -> SFM Forest Temple Entrance Ledge': world.get_entrance('Phantom Ganon Boss Room -> Sacred Forest Meadow'),
'Fire Temple Lower -> DMC Fire Temple Entrance': world.get_entrance('Volvagia Boss Room -> DMC Central Local'),
'Water Temple Lobby -> Lake Hylia': world.get_entrance('Morpha Boss Room -> Lake Hylia'),
'Shadow Temple Entryway -> Graveyard Warp Pad Region': world.get_entrance('Bongo Bongo Boss Room -> Graveyard Warp Pad Region'),
'Spirit Temple Lobby -> Desert Colossus From Spirit Lobby': world.get_entrance('Twinrova Boss Room -> Desert Colossus'),
'Deku Tree Lobby -> KF Outside Deku Tree': world.get_entrance('Queen Gohma Blue Warp -> KF Outside Deku Tree'),
'Dodongos Cavern Beginning -> Death Mountain': world.get_entrance('King Dodongo Blue Warp -> Death Mountain'),
'Jabu Jabus Belly Beginning -> Zoras Fountain': world.get_entrance('Barinade Blue Warp -> Zoras Fountain'),
'Forest Temple Lobby -> SFM Forest Temple Entrance Ledge': world.get_entrance('Phantom Ganon Blue Warp -> Sacred Forest Meadow'),
'Fire Temple Lower -> DMC Fire Temple Entrance': world.get_entrance('Volvagia Blue Warp -> DMC Central Local'),
'Water Temple Lobby -> Lake Hylia': world.get_entrance('Morpha Blue Warp -> Lake Hylia'),
'Shadow Temple Entryway -> Graveyard Warp Pad Region': world.get_entrance('Bongo Bongo Blue Warp -> Graveyard Warp Pad Region'),
'Spirit Temple Lobby -> Desert Colossus From Spirit Lobby': world.get_entrance('Twinrova Blue Warp -> Desert Colossus'),
}

for (blue_warp, boss_door_exit) in (
(world.get_entrance('Queen Gohma Boss Room -> KF Outside Deku Tree'), world.get_entrance('Queen Gohma Boss Room -> Deku Tree Before Boss')),
(world.get_entrance('King Dodongo Boss Room -> Death Mountain'), world.get_entrance('King Dodongo Boss Room -> Dodongos Cavern Mouth')),
(world.get_entrance('Barinade Boss Room -> Zoras Fountain'), world.get_entrance('Barinade Boss Room -> Jabu Jabus Belly Before Boss')),
(world.get_entrance('Phantom Ganon Boss Room -> Sacred Forest Meadow'), world.get_entrance('Phantom Ganon Boss Room -> Forest Temple Before Boss')),
(world.get_entrance('Volvagia Boss Room -> DMC Central Local'), world.get_entrance('Volvagia Boss Room -> Fire Temple Before Boss')),
(world.get_entrance('Morpha Boss Room -> Lake Hylia'), world.get_entrance('Morpha Boss Room -> Water Temple Before Boss')),
(world.get_entrance('Bongo Bongo Boss Room -> Graveyard Warp Pad Region'), world.get_entrance('Bongo Bongo Boss Room -> Shadow Temple Before Boss')),
(world.get_entrance('Twinrova Boss Room -> Desert Colossus'), world.get_entrance('Twinrova Boss Room -> Spirit Temple Before Boss')),
(world.get_entrance('Queen Gohma Blue Warp -> KF Outside Deku Tree'), world.get_entrance('Queen Gohma Boss Room -> Deku Tree Before Boss')),
(world.get_entrance('King Dodongo Blue Warp -> Death Mountain'), world.get_entrance('King Dodongo Boss Room -> Dodongos Cavern Mouth')),
(world.get_entrance('Barinade Blue Warp -> Zoras Fountain'), world.get_entrance('Barinade Boss Room -> Jabu Jabus Belly Before Boss')),
(world.get_entrance('Phantom Ganon Blue Warp -> Sacred Forest Meadow'), world.get_entrance('Phantom Ganon Boss Room -> Forest Temple Before Boss')),
(world.get_entrance('Volvagia Blue Warp -> DMC Central Local'), world.get_entrance('Volvagia Boss Room -> Fire Temple Before Boss')),
(world.get_entrance('Morpha Blue Warp -> Lake Hylia'), world.get_entrance('Morpha Boss Room -> Water Temple Before Boss')),
(world.get_entrance('Bongo Bongo Blue Warp -> Graveyard Warp Pad Region'), world.get_entrance('Bongo Bongo Boss Room -> Shadow Temple Before Boss')),
(world.get_entrance('Twinrova Blue Warp -> Desert Colossus'), world.get_entrance('Twinrova Boss Room -> Spirit Temple Before Boss')),
):
target = boss_door_exit.replaces or boss_door_exit
if not world.settings.decouple_entrances:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Differences between `dev-fenhl` and [`Dev-R`](https://github.com/Roman971/OoT-Ra
* The GUI tweaks made by [`Dev-R`](https://github.com/Roman971/OoT-Randomizer) are further adjusted to balance consistency with [main `Dev`](https://github.com/OoTRandomizer/OoT-Randomizer) and ease of use.
* The Lens of Truth can be in a foolish area if Treasure Chest Game keys are shuffled and all relevant “lensless” tricks are enabled.
* Bug fixes:
* Blue warps now set time of day even on repeated use (based on [#2287](https://github.com/OoTRandomizer/OoT-Randomizer/pull/2287))
* The randomizer no longer silently ignores the `Decompress` program failing ([#2229](https://github.com/OoTRandomizer/OoT-Randomizer/pull/2229))
* A trade item obtained from a skipped location is no longer lost upon obtaining a different item from the same trade quest ([#2217](https://github.com/OoTRandomizer/OoT-Randomizer/pull/2217))
* The ocarina buttons required to play the Song of Time are now included on the path of time ([#2203](https://github.com/OoTRandomizer/OoT-Randomizer/pull/2203))
Expand Down
5 changes: 5 additions & 0 deletions SettingsList.py
Original file line number Diff line number Diff line change
Expand Up @@ -2785,6 +2785,11 @@ class SettingInfos:
Randomize where the the blue warps that appear
after defeating bosses lead to.
Note that unlike in the vanilla game, blue warps in the
randomizer set the time of day to noon (or morning in
Morpha's case) even on repeated use, and logic may
require you to take advantage of this.
'Vanilla':
The blue warps always lead to their vanilla locations,
regardless of where the boss room is. For example, the
Expand Down
4 changes: 2 additions & 2 deletions World.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,8 @@ def load_regions_from_json(self, file_path: str) -> list[tuple[Entrance, str]]:
if 'time_passes' in region:
new_region.time_passes = region['time_passes']
new_region.provides_time = TimeOfDay.ALL
if new_region.name in ('Ganons Castle Grounds', 'Ganons Castle Ledge'):
new_region.provides_time = TimeOfDay.DAMPE
if 'provides_time' in region:
new_region.provides_time = getattr(TimeOfDay, region['provides_time'])
if 'locations' in region:
for location, rule in region['locations'].items():
new_location = LocationFactory(location)
Expand Down
80 changes: 72 additions & 8 deletions data/World/Bosses.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
},
"exits": {
"Deku Tree Before Boss": "True",
"KF Outside Deku Tree": "'Defeat Queen Gohma'"
"Queen Gohma Blue Warp": "'Defeat Queen Gohma'"
}
},
{
"region_name": "Queen Gohma Blue Warp",
"scene": "Deku Tree Boss",
"provides_time": "DAY",
"exits": {
"KF Outside Deku Tree": "at_day"
}
},
{
Expand All @@ -39,7 +47,15 @@
},
"exits": {
"Dodongos Cavern Mouth": "True",
"Death Mountain": "'Defeat King Dodongo'"
"King Dodongo Blue Warp": "'Defeat King Dodongo'"
}
},
{
"region_name": "King Dodongo Blue Warp",
"scene": "Dodongos Cavern Boss",
"provides_time": "DAY",
"exits": {
"Death Mountain": "at_day"
}
},
{
Expand All @@ -62,7 +78,15 @@
},
"exits": {
"Jabu Jabus Belly Before Boss": "False",
"Zoras Fountain": "'Defeat Barinade'"
"Barinade Blue Warp": "'Defeat Barinade'"
}
},
{
"region_name": "Barinade Blue Warp",
"scene": "Jabu Jabus Belly Boss",
"provides_time": "DAY",
"exits": {
"Zoras Fountain": "at_day"
}
},
{
Expand All @@ -80,7 +104,15 @@
},
"exits": {
"Forest Temple Before Boss": "False",
"Sacred Forest Meadow": "'Defeat Phantom Ganon'"
"Phantom Ganon Blue Warp": "'Defeat Phantom Ganon'"
}
},
{
"region_name": "Phantom Ganon Blue Warp",
"scene": "Forest Temple Boss",
"provides_time": "DAY",
"exits": {
"Sacred Forest Meadow": "at_day"
}
},
{
Expand All @@ -97,7 +129,15 @@
},
"exits": {
"Fire Temple Before Boss": "False",
"DMC Central Local": "'Defeat Volvagia'"
"Volvagia Blue Warp": "'Defeat Volvagia'"
}
},
{
"region_name": "Volvagia Blue Warp",
"scene": "Fire Temple Boss",
"provides_time": "DAY",
"exits": {
"DMC Central Local": "at_day"
}
},
{
Expand All @@ -117,7 +157,15 @@
},
"exits": {
"Water Temple Before Boss": "False",
"Lake Hylia": "'Defeat Morpha'"
"Morpha Blue Warp": "'Defeat Morpha'"
}
},
{
"region_name": "Morpha Blue Warp",
"scene": "Water Temple Boss",
"provides_time": "DAY",
"exits": {
"Lake Hylia": "at_day"
}
},
{
Expand All @@ -137,7 +185,15 @@
},
"exits": {
"Shadow Temple Before Boss": "False",
"Graveyard Warp Pad Region": "'Defeat Bongo Bongo'"
"Bongo Bongo Blue Warp": "'Defeat Bongo Bongo'"
}
},
{
"region_name": "Bongo Bongo Blue Warp",
"scene": "Shadow Temple Boss",
"provides_time": "DAY",
"exits": {
"Graveyard Warp Pad Region": "at_day"
}
},
{
Expand All @@ -154,7 +210,15 @@
},
"exits": {
"Spirit Temple Before Boss": "False",
"Desert Colossus": "'Defeat Twinrova'"
"Twinrova Blue Warp": "'Defeat Twinrova'"
}
},
{
"region_name": "Twinrova Blue Warp",
"scene": "Spirit Temple Boss",
"provides_time": "DAY",
"exits": {
"Desert Colossus": "at_day"
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions data/World/Overworld.json
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,7 @@
"region_name": "Ganons Castle Grounds",
"scene": "Castle Grounds",
"hint": "OUTSIDE_GANONS_CASTLE",
"provides_time": "DAMPE",
"locations": {
"OGC GS": "True"
},
Expand All @@ -1439,6 +1440,7 @@
"region_name": "Ganons Castle Ledge",
"scene": "Castle Grounds",
"hint": "OUTSIDE_GANONS_CASTLE",
"provides_time": "DAMPE",
"exits": {
"Ganons Castle Grounds": "can_build_rainbow_bridge",
"Ganons Castle Lobby": "at_dampe_time"
Expand Down
Loading

0 comments on commit 0c9f9ed

Please sign in to comment.