diff --git a/BaseClasses.py b/BaseClasses.py index 82966c37..a4df783d 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -166,6 +166,7 @@ class MultiWorld(): getattr(self, option_key)[new_id] = option(option.default) self.worlds[new_id] = world_type(self, new_id) + self.worlds[new_id].collect_item = classmethod(AutoWorld.World.collect_item).__get__(self.worlds[new_id]) self.player_name[new_id] = name new_group = self.groups[new_id] = Group(name=name, game=game, players=players, diff --git a/Generate.py b/Generate.py index 0364bcde..4a1e3dd6 100644 --- a/Generate.py +++ b/Generate.py @@ -502,9 +502,7 @@ def roll_settings(weights: dict, plando_options: typing.Set[str] = frozenset(("b roll_alttp_settings(ret, game_weights, plando_options) else: raise Exception(f"Unsupported game {ret.game}") - # not meant to stay here, intended to be removed when itemlinks are stable - if not "item_links" in plando_options: - ret.item_links.value = [] + return ret diff --git a/Main.py b/Main.py index b789bf72..7044e821 100644 --- a/Main.py +++ b/Main.py @@ -141,9 +141,6 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No # temporary home for item links, should be moved out of Main for group_id, group in world.groups.items(): - # TODO: remove when LttP options are transitioned over - world.difficulty_requirements[group_id] = world.difficulty_requirements[next(iter(group["players"]))] - def find_common_pool(players: Set[int], shared_pool: Set[str]): advancement = set() counters = {player: {name: 0 for name in shared_pool} for player in players} @@ -164,10 +161,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No return counters, advancement common_item_count, common_advancement_items = find_common_pool(group["players"], group["item_pool"]) - # TODO: fix logic - if common_advancement_items: - logger.warning(f"Logical requirements for {', '.join(common_advancement_items)} in group {group['name']} " - f"will be incorrect.") + new_itempool = [] for item_name, item_count in next(iter(common_item_count.values())).items(): advancement = item_name in common_advancement_items @@ -184,7 +178,9 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No if count: loc = Location(group_id, f"Item Link: {item.name} -> {world.player_name[item.player]} {count}", None, region) - loc.access_rule = lambda state: state.has(item.name, group_id, count) + loc.access_rule = lambda state, item_name = item.name, group_id_ = group_id, count_ = count: \ + state.has(item_name, group_id_, count_) + locations.append(loc) loc.place_locked_item(item) common_item_count[item.player][item.name] -= 1