Adding new GUI/CLI option for Keep Similar Together

This commit is contained in:
codemann8
2021-04-26 15:20:42 -05:00
parent 48bf44001d
commit ae1af5e038
9 changed files with 26 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ class World(object):
self.players = players
self.teams = 1
self.owShuffle = owShuffle.copy()
self.owKeepSimilar = True
self.shuffle = shuffle.copy()
self.doorShuffle = doorShuffle.copy()
self.intensity = {}
@@ -2109,6 +2110,7 @@ class Spoiler(object):
'weapons': self.world.swords,
'goal': self.world.goal,
'ow_shuffle': self.world.owShuffle,
'ow_keepsimilar': self.world.owKeepSimilar,
'shuffle': self.world.shuffle,
'door_shuffle': self.world.doorShuffle,
'intensity': self.world.intensity,
@@ -2187,6 +2189,7 @@ class Spoiler(object):
outfile.write('Difficulty:'.ljust(line_width) + '%s\n' % self.metadata['item_pool'][player])
outfile.write('Item Functionality:'.ljust(line_width) + '%s\n' % self.metadata['item_functionality'][player])
outfile.write('Overworld Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['ow_shuffle'][player])
outfile.write('Keep OW Edges Together:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['ow_keepsimilar'][player] else 'No'))
outfile.write('Entrance Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['shuffle'][player])
outfile.write('Door Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['door_shuffle'][player])
outfile.write('Intensity:'.ljust(line_width) + '%s\n' % self.metadata['intensity'][player])

3
CLI.py
View File

@@ -94,7 +94,7 @@ def parse_cli(argv, no_defaults=False):
for player in range(1, multiargs.multi + 1):
playerargs = parse_cli(shlex.split(getattr(ret, f"p{player}")), True)
for name in ['logic', 'mode', 'swords', 'goal', 'difficulty', 'item_functionality', 'ow_shuffle',
for name in ['logic', 'mode', 'swords', 'goal', 'difficulty', 'item_functionality', 'ow_shuffle', 'ow_keepsimilar',
'shuffle', 'door_shuffle', 'intensity', 'crystals_ganon', 'crystals_gt', 'openpyramid',
'mapshuffle', 'compassshuffle', 'keyshuffle', 'bigkeyshuffle', 'startinventory',
'triforce_pool_min', 'triforce_pool_max', 'triforce_goal_min', 'triforce_goal_max',
@@ -143,6 +143,7 @@ def parse_settings():
"openpyramid": False,
"shuffleganon": True,
"ow_shuffle": "vanilla",
"ow_keepsimilar": True,
"shuffle": "vanilla",
"shufflepots": False,

View File

@@ -153,6 +153,7 @@ def roll_settings(weights):
overworld_shuffle = get_choice('overworld_shuffle')
ret.ow_shuffle = overworld_shuffle if overworld_shuffle != 'none' else 'vanilla'
ret.ow_keepsimilar = get_choice('ow_keepsimilar')
entrance_shuffle = get_choice('entrance_shuffle')
ret.shuffle = entrance_shuffle if entrance_shuffle != 'none' else 'vanilla'
door_shuffle = get_choice('door_shuffle')

View File

@@ -42,7 +42,7 @@ Alternatively, run ```Gui.py``` for a simple graphical user interface. (WIP)
Only extra settings are found here. All door and entrance randomizer settings are supported. See their [readme](https://github.com/Aerinon/ALttPDoorRandomizer/blob/master/README.md)
## Overworld Shuffle (--owShuffle)
## Overworld Shuffle (--ow_shuffle)
### Full
@@ -66,3 +66,9 @@ Show the help message and exit.
```
For specifying the overworld shuffle you want as above. (default: vanilla)
```
--ow_keepsimilar
```
This keeps similar edge transitions paired together with other pairs of transitions

View File

@@ -116,6 +116,10 @@
"crossed"
]
},
"ow_keepsimilar": {
"action": "store_true",
"type": "bool"
},
"shuffle": {
"choices": [
"vanilla",

View File

@@ -203,6 +203,7 @@
" overworld screens from the same world.",
"Crossed: Overworld screen transitions can lead to any other overworld screen."
],
"ow_keepsimilar": [ "This keeps similar edge transitions together. ie. the two west edges on Potion Shop will be paired with another similar pair." ],
"door_shuffle": [
"Select Door Shuffling Algorithm. (default: %(default)s)",
"Basic: Doors are mixed within a single dungeon.",

View File

@@ -114,6 +114,8 @@
"randomizer.overworld.overworldshuffle.simple": "Simple",
"randomizer.overworld.overworldshuffle.full": "Full",
"randomizer.overworld.overworldshuffle.crossed": "Crossed",
"randomizer.overworld.keepsimilar": "Keep Similar Edges Together",
"randomizer.entrance.openpyramid": "Pre-open Pyramid Hole",
"randomizer.entrance.shuffleganon": "Include Ganon's Tower and Pyramid Hole in shuffle pool",

View File

@@ -7,6 +7,10 @@
"vanilla",
"full"
]
},
"keepsimilar": {
"type": "checkbox",
"default": true
}
}
}

View File

@@ -71,7 +71,8 @@ SETTINGSTOPROCESS = {
"sortingalgo": "algorithm"
},
"overworld": {
"overworldshuffle": "ow_shuffle"
"overworldshuffle": "ow_shuffle",
"keepsimilar": "ow_keepsimilar"
},
"entrance": {
"openpyramid": "openpyramid",