make world-local items available as a general option

This commit is contained in:
Fabian Dill
2020-06-03 22:13:58 +02:00
parent 38cbcc662f
commit e55726efca
7 changed files with 53 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ from Utils import parse_yaml
from Rom import get_sprite_from_name
from EntranceRandomizer import parse_arguments
from Main import main as ERmain
from Items import item_name_groups, item_table
@@ -355,11 +356,22 @@ def roll_settings(weights):
startitems.append(item)
elif itemvalue:
startitems.append(item)
ret.glitch_boots = get_choice('glitch_boots', weights) if 'glitch_boots' in weights else True
ret.startinventory = ','.join(startitems)
ret.glitch_boots = get_choice('glitch_boots', weights) if 'glitch_boots' in weights else True
ret.remote_items = get_choice('remote_items', weights) if 'remote_items' in weights else False
ret.local_items = set()
for item_name in weights.get('local_items', []):
items = item_name_groups.get(item_name, {item_name})
for item in items:
if item in item_table:
ret.local_items.add(item)
else:
logging.warning(f"Could not force item {item} to be world-local, as it was not recognized.")
ret.local_items = ",".join(ret.local_items)
if 'rom' in weights:
romweights = weights['rom']
ret.sprite = get_choice('sprite', romweights)