diff --git a/docs/Customizer.md b/docs/Customizer.md index f7d53421..5d5e083d 100644 --- a/docs/Customizer.md +++ b/docs/Customizer.md @@ -253,6 +253,14 @@ someDescription: - Stone Bridge WS* ``` +### ow-grid + +`grid` contains additional options that only have an effect when `ow_layout` is set to `grid`. + +#### wrap_horizontal / wrap_vertical + +Set these to `true` to allow for overworld edge transitions to wrap from one side of a world to the opposite side. With `wrap_horizontal`, there can be east transitions on the eastern edge of the world map that send the player to the western edge of the world. With `wrap_vertical`, there can be south transitions on the southern edge of the world map that send the player to the northern edge of the world. + ### ow-crossed This must be defined by player. Each player number should be listed with the appropriate sections and each of these players MUST have `ow_crossed` enabled in the `settings` section in order for any values here to take effect. This section has four primary subsections: `force_crossed`, `force_noncrossed`, `limit_crossed`, and `undefined_chance`. There are also diff --git a/source/classes/CustomSettings.py b/source/classes/CustomSettings.py index a425b5db..653f8758 100644 --- a/source/classes/CustomSettings.py +++ b/source/classes/CustomSettings.py @@ -263,6 +263,11 @@ class CustomSettings(object): return self.file_source['ow-edges'] return None + def get_owgrid(self): + if 'ow-grid' in self.file_source: + return self.file_source['ow-grid'] + return None + def get_owcrossed(self): if 'ow-crossed' in self.file_source: return self.file_source['ow-crossed'] diff --git a/source/overworld/LayoutGenerator.py b/source/overworld/LayoutGenerator.py index 598212f9..467941ab 100644 --- a/source/overworld/LayoutGenerator.py +++ b/source/overworld/LayoutGenerator.py @@ -8,7 +8,7 @@ from OverworldShuffle import connect_two_way, validate_layout ENABLE_KEEP_SIMILAR_SPECIAL_HANDLING = False PREVENT_WRAPPED_LARGE_SCREENS = False -DRAW_IMAGE = True +DRAW_IMAGE = False large_screen_ids = [0x00, 0x03, 0x05, 0x18, 0x1B, 0x1E, 0x30, 0x35] + [0x40, 0x43, 0x45, 0x58, 0x5B, 0x5E, 0x70, 0x75] @@ -1330,14 +1330,23 @@ def generate_random_grid_layout(world: World, player: int, connected_edges: List """Main execution function""" import time + horizontal_wrap = False + vertical_wrap = False + if world.customizer: + grid_options = world.customizer.get_owgrid() + if grid_options and player in grid_options: + grid_options = grid_options[player] + horizontal_wrap = 'wrap_horizontal' in grid_options and grid_options['wrap_horizontal'] == True + vertical_wrap = 'wrap_vertical' in grid_options and grid_options['wrap_vertical'] == True + first_ignore_bonus = 2 if not world.owParallel[player]: first_ignore_bonus *= 2 if world.owCrossed[player] == 'unrestricted': first_ignore_bonus *= 2 options = LayoutGeneratorOptions( - horizontal_wrap=False, - vertical_wrap=False, + horizontal_wrap=horizontal_wrap, + vertical_wrap=vertical_wrap, large_screen_pool=False, distortion_chance=0.0, random_order=6 if world.owParallel[player] else 12,