HK: add item name groups

This commit is contained in:
Fabian Dill 2022-04-04 00:15:16 +02:00 committed by Hussein Farran
parent 0eb37883ca
commit 66bd793306
2 changed files with 6 additions and 1 deletions

View File

@ -18,3 +18,7 @@ lookup_id_to_name: Dict[int, str] = {data.id: item_name for item_name, data in i
lookup_type_to_names: Dict[str, Set[str]] = {}
for item, item_data in item_table.items():
lookup_type_to_names.setdefault(item_data.type, set()).add(item)
item_name_groups = {group: lookup_type_to_names[group] for group in ("Skill", "Charm", "Mask", "Vessel",
"Relic", "Root", "Map", "Stag", "Cocoon",
"Soul", "DreamWarrior", "DreamBoss")}

View File

@ -6,7 +6,7 @@ from collections import Counter
logger = logging.getLogger("Hollow Knight")
from .Items import item_table, lookup_type_to_names
from .Items import item_table, lookup_type_to_names, item_name_groups
from .Regions import create_regions
from .Rules import set_rules
from .Options import hollow_knight_options, hollow_knight_randomize_options, disabled
@ -88,6 +88,7 @@ class HKWorld(World):
item_name_to_id = {name: data.id for name, data in item_table.items()}
location_name_to_id = {location_name: location_id for location_id, location_name in
enumerate(locations, start=0x1000000)}
item_name_groups = item_name_groups
ranges: typing.Dict[str, typing.Tuple[int, int]]
shops = {"Egg_Shop": "egg", "Grubfather": "grub", "Seer": "essence", "Salubra_(Requires_Charms)": "charm"}