Fix some settings being mandatory in weight files
This commit is contained in:
52
Mystery.py
52
Mystery.py
@@ -128,10 +128,11 @@ def roll_settings(weights):
|
|||||||
ret = argparse.Namespace()
|
ret = argparse.Namespace()
|
||||||
|
|
||||||
glitches_required = get_choice('glitches_required')
|
glitches_required = get_choice('glitches_required')
|
||||||
if glitches_required not in ['none', 'no_logic']:
|
if glitches_required is not None:
|
||||||
print("Only NMG and No Logic supported")
|
if glitches_required not in ['none', 'no_logic']:
|
||||||
glitches_required = 'none'
|
print("Only NMG and No Logic supported")
|
||||||
ret.logic = {'none': 'noglitches', 'no_logic': 'nologic'}[glitches_required]
|
glitches_required = 'none'
|
||||||
|
ret.logic = {'none': 'noglitches', 'no_logic': 'nologic'}[glitches_required]
|
||||||
|
|
||||||
item_placement = get_choice('item_placement')
|
item_placement = get_choice('item_placement')
|
||||||
# not supported in ER
|
# not supported in ER
|
||||||
@@ -163,26 +164,27 @@ def roll_settings(weights):
|
|||||||
ret.standardize_palettes = get_choice('standardize_palettes') if 'standardize_palettes' in weights else 'standardize'
|
ret.standardize_palettes = get_choice('standardize_palettes') if 'standardize_palettes' in weights else 'standardize'
|
||||||
|
|
||||||
goal = get_choice('goals')
|
goal = get_choice('goals')
|
||||||
ret.goal = {'ganon': 'ganon',
|
if goal is not None:
|
||||||
'fast_ganon': 'crystals',
|
ret.goal = {'ganon': 'ganon',
|
||||||
'dungeons': 'dungeons',
|
'fast_ganon': 'crystals',
|
||||||
'pedestal': 'pedestal',
|
'dungeons': 'dungeons',
|
||||||
'triforce-hunt': 'triforcehunt'
|
'pedestal': 'pedestal',
|
||||||
}[goal]
|
'triforce-hunt': 'triforcehunt'
|
||||||
|
}[goal]
|
||||||
ret.openpyramid = goal == 'fast_ganon' if ret.shuffle in ['vanilla', 'dungeonsfull', 'dungeonssimple'] else False
|
ret.openpyramid = goal == 'fast_ganon' if ret.shuffle in ['vanilla', 'dungeonsfull', 'dungeonssimple'] else False
|
||||||
|
|
||||||
ret.crystals_gt = get_choice('tower_open')
|
ret.crystals_gt = get_choice('tower_open')
|
||||||
|
|
||||||
ret.crystals_ganon = get_choice('ganon_open')
|
ret.crystals_ganon = get_choice('ganon_open')
|
||||||
|
|
||||||
if ret.goal == 'triforcehunt':
|
goal_min = get_choice_default('triforce_goal_min', default=20)
|
||||||
goal_min = get_choice_default('triforce_goal_min', default=20)
|
goal_max = get_choice_default('triforce_goal_max', default=20)
|
||||||
goal_max = get_choice_default('triforce_goal_max', default=20)
|
pool_min = get_choice_default('triforce_pool_min', default=30)
|
||||||
pool_min = get_choice_default('triforce_pool_min', default=30)
|
pool_max = get_choice_default('triforce_pool_max', default=30)
|
||||||
pool_max = get_choice_default('triforce_pool_max', default=30)
|
ret.triforce_goal = random.randint(int(goal_min), int(goal_max))
|
||||||
ret.triforce_goal = random.randint(int(goal_min), int(goal_max))
|
min_diff = get_choice_default('triforce_min_difference', default=10)
|
||||||
min_diff = get_choice_default('triforce_min_difference', default=10)
|
ret.triforce_pool = random.randint(max(int(pool_min), ret.triforce_goal + int(min_diff)), int(pool_max))
|
||||||
ret.triforce_pool = random.randint(max(int(pool_min), ret.triforce_goal + int(min_diff)), int(pool_max))
|
|
||||||
ret.mode = get_choice('world_state')
|
ret.mode = get_choice('world_state')
|
||||||
if ret.mode == 'retro':
|
if ret.mode == 'retro':
|
||||||
ret.mode = 'open'
|
ret.mode = 'open'
|
||||||
@@ -193,11 +195,13 @@ def roll_settings(weights):
|
|||||||
|
|
||||||
ret.hints = get_choice('hints') == 'on'
|
ret.hints = get_choice('hints') == 'on'
|
||||||
|
|
||||||
ret.swords = {'randomized': 'random',
|
swords = get_choice('weapons')
|
||||||
'assured': 'assured',
|
if swords is not None:
|
||||||
'vanilla': 'vanilla',
|
ret.swords = {'randomized': 'random',
|
||||||
'swordless': 'swordless'
|
'assured': 'assured',
|
||||||
}[get_choice('weapons')]
|
'vanilla': 'vanilla',
|
||||||
|
'swordless': 'swordless'
|
||||||
|
}[swords]
|
||||||
|
|
||||||
ret.difficulty = get_choice('item_pool')
|
ret.difficulty = get_choice('item_pool')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user