Put Linked options before name roll. (#74)

This commit is contained in:
CaitSith2 2020-04-24 20:49:59 -07:00 committed by GitHub
parent 53cfc6cc0a
commit 8f91e86223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -227,16 +227,16 @@ def handle_name(name: str):
def roll_settings(weights):
ret = argparse.Namespace()
ret.name = get_choice('name', weights)
if ret.name:
ret.name = handle_name(ret.name)
if "linked_options" in weights:
weights = weights.copy() # make sure we don't write back to other weights sets in same_settings
for option_set in weights["linked_options"]:
if random.random() < (option_set["percentage"] / 100):
weights.update(option_set["options"])
ret.name = get_choice('name', weights)
if ret.name:
ret.name = handle_name(ret.name)
glitches_required = get_choice('glitches_required', weights)
if glitches_required not in ['none', 'no_logic', 'overworld_glitches']:
logging.warning("Only NMG, OWG and No Logic supported")