mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Mystery: weights can now specify a default value for convenience, eg:
dungeon_items: full startinventory: Pegasus Boots: on
This commit is contained in:
@@ -110,6 +110,10 @@ def get_weights(path):
|
||||
|
||||
def roll_settings(weights):
|
||||
def get_choice(option, root=weights):
|
||||
if type(root[option]) is not dict:
|
||||
return root[option]
|
||||
if not root[option]:
|
||||
return None
|
||||
return random.choices(list(root[option].keys()), weights=list(map(int,root[option].values())))[0].replace('"','').replace("'",'')
|
||||
|
||||
ret = argparse.Namespace()
|
||||
|
Reference in New Issue
Block a user