AutoWorld: add "Everything" item_name_group to all worlds
This commit is contained in:
parent
28201a6c38
commit
43ff476d98
|
@ -1,7 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import typing
|
||||
from enum import Enum, unique
|
||||
import logging
|
||||
import json
|
||||
|
@ -198,7 +197,7 @@ class MultiWorld():
|
|||
|
||||
return new_id, new_group
|
||||
|
||||
def get_player_groups(self, player) -> typing.Set[int]:
|
||||
def get_player_groups(self, player) -> Set[int]:
|
||||
return {group_id for group_id, group in self.groups.items() if player in group["players"]}
|
||||
|
||||
def set_seed(self, seed: Optional[int] = None, secure: bool = False, name: Optional[str] = None):
|
||||
|
|
5
Main.py
5
Main.py
|
@ -153,11 +153,14 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
|
|||
"game": world.game[player]
|
||||
}
|
||||
|
||||
for item_link in item_links.values():
|
||||
for name, item_link in item_links.items():
|
||||
current_item_name_groups = AutoWorld.AutoWorldRegister.world_types[item_link["game"]].item_name_groups
|
||||
pool = set()
|
||||
for item in item_link["item_pool"]:
|
||||
pool |= current_item_name_groups.get(item, {item})
|
||||
unknown_items = pool - AutoWorld.AutoWorldRegister.world_types[item_link["game"]].item_names
|
||||
if unknown_items:
|
||||
raise Exception(f"Unknown item in ItemLink({name}): {''.join(unknown_items)}")
|
||||
item_link["item_pool"] = pool
|
||||
|
||||
for group_name, item_link in item_links.items():
|
||||
|
|
|
@ -20,6 +20,8 @@ class AutoWorldRegister(type):
|
|||
|
||||
# build rest
|
||||
dct["item_names"] = frozenset(dct["item_name_to_id"])
|
||||
dct["item_name_groups"] = dct.get("item_name_groups", {})
|
||||
dct["item_name_groups"]["Everything"] = dct["item_names"]
|
||||
dct["location_names"] = frozenset(dct["location_name_to_id"])
|
||||
dct["all_item_and_group_names"] = frozenset(dct["item_names"] | set(dct.get("item_name_groups", {})))
|
||||
|
||||
|
|
|
@ -274,8 +274,8 @@ for basename, substring in _simple_groups:
|
|||
del (_simple_groups)
|
||||
|
||||
progression_items = {name for name, data in item_table.items() if type(data.item_code) == int and data.advancement}
|
||||
item_name_groups['Everything'] = {name for name, data in item_table.items() if type(data.item_code) == int}
|
||||
everything = {name for name, data in item_table.items() if type(data.item_code) == int}
|
||||
item_name_groups['Progression Items'] = progression_items
|
||||
item_name_groups['Non Progression Items'] = item_name_groups['Everything'] - progression_items
|
||||
item_name_groups['Non Progression Items'] = everything - progression_items
|
||||
|
||||
trap_replaceable = item_name_groups['Rupees'] | {'Arrows (10)', 'Single Bomb', 'Bombs (3)', 'Bombs (10)', 'Nothing'}
|
||||
|
|
Loading…
Reference in New Issue