diff --git a/BaseClasses.py b/BaseClasses.py index ca717b60..855efc60 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -261,6 +261,7 @@ class MultiWorld(): "local_items": set(item_link.get("local_items", [])), "non_local_items": set(item_link.get("non_local_items", [])), "link_replacement": replacement_prio.index(item_link["link_replacement"]), + "skip_if_solo": item_link.get("skip_if_solo", False), } for _name, item_link in item_links.items(): @@ -284,6 +285,8 @@ class MultiWorld(): for group_name, item_link in item_links.items(): game = item_link["game"] + if item_link["skip_if_solo"] and len(item_link["players"]) == 1: + continue group_id, group = self.add_group(group_name, game, set(item_link["players"])) group["item_pool"] = item_link["item_pool"] diff --git a/Options.py b/Options.py index 47d6c2d3..dc1e8c90 100644 --- a/Options.py +++ b/Options.py @@ -1446,6 +1446,7 @@ class ItemLinks(OptionList): Optional("local_items"): [And(str, len)], Optional("non_local_items"): [And(str, len)], Optional("link_replacement"): Or(None, bool), + Optional("skip_if_solo"): Or(None, bool), } ]) diff --git a/worlds/generic/docs/advanced_settings_en.md b/worlds/generic/docs/advanced_settings_en.md index db93981b..25943076 100644 --- a/worlds/generic/docs/advanced_settings_en.md +++ b/worlds/generic/docs/advanced_settings_en.md @@ -214,12 +214,13 @@ Timespinner: progression_balancing: 50 item_links: # Share part of your item pool with other players. - name: TSAll - item_pool: + item_pool: - Everything local_items: - Twin Pyramid Key - Timespinner Wheel replacement_item: null + skip_if_solo: true ``` #### This is a fully functional yaml file that will do all the following things: @@ -262,7 +263,7 @@ Timespinner: * For `Timespinner` all players in the `TSAll` item link group will share their entire item pool and the `Twin Pyramid Key` and `Timespinner Wheel` will be forced among the worlds of those in the group. The `null` replacement item will, instead of forcing a specific chosen item, allow the generator to randomly pick a filler item to replace the - player items. + player items. This item link will only be created if there are at least two players in the group. * `triggers` allows us to define a trigger such that if our `smallkey_shuffle` option happens to roll the `any_world` result it will also ensure that `bigkey_shuffle`, `map_shuffle`, and `compass_shuffle` are also forced to the `any_world` result. More information on triggers can be found in the