@@ -261,6 +261,7 @@ def set_item_links(self):
261261 "local_items" : set (item_link .get ("local_items" , [])),
262262 "non_local_items" : set (item_link .get ("non_local_items" , [])),
263263 "link_replacement" : replacement_prio .index (item_link ["link_replacement" ]),
264+ "skip_if_solo" : item_link .get ("skip_if_solo" , False ),
264265 }
265266
266267 for _name , item_link in item_links .items ():
@@ -284,6 +285,8 @@ def set_item_links(self):
284285
285286 for group_name , item_link in item_links .items ():
286287 game = item_link ["game" ]
288+ if item_link ["skip_if_solo" ] and len (item_link ["players" ]) == 1 :
289+ continue
287290 group_id , group = self .add_group (group_name , game , set (item_link ["players" ]))
288291
289292 group ["item_pool" ] = item_link ["item_pool" ]
@@ -1343,8 +1346,7 @@ def get_connecting_entrance(self, is_main_entrance: Callable[[Entrance], bool])
13431346 for entrance in self .entrances : # BFS might be better here, trying DFS for now.
13441347 return entrance .parent_region .get_connecting_entrance (is_main_entrance )
13451348
1346- def add_locations (self , locations : Dict [str , Optional [int ]],
1347- location_type : Optional [type [Location ]] = None ) -> None :
1349+ def add_locations (self , locations : Mapping [str , int | None ], location_type : type [Location ] | None = None ) -> None :
13481350 """
13491351 Adds locations to the Region object, where location_type is your Location class and locations is a dict of
13501352 location names to address.
@@ -1432,16 +1434,16 @@ def create_er_target(self, name: str) -> Entrance:
14321434 entrance .connect (self )
14331435 return entrance
14341436
1435- def add_exits (self , exits : Union [ Iterable [str ], Dict [str , Optional [ str ]] ],
1436- rules : Dict [str , Callable [[CollectionState ], bool ]] = None ) -> List [Entrance ]:
1437+ def add_exits (self , exits : Iterable [str ] | Mapping [str , str | None ],
1438+ rules : Mapping [str , Callable [[CollectionState ], bool ]] | None = None ) -> List [Entrance ]:
14371439 """
14381440 Connects current region to regions in exit dictionary. Passed region names must exist first.
14391441
14401442 :param exits: exits from the region. format is {"connecting_region": "exit_name"}. if a non dict is provided,
14411443 created entrances will be named "self.name -> connecting_region"
14421444 :param rules: rules for the exits from this region. format is {"connecting_region": rule}
14431445 """
1444- if not isinstance (exits , Dict ):
1446+ if not isinstance (exits , Mapping ):
14451447 exits = dict .fromkeys (exits )
14461448 return [
14471449 self .connect (
@@ -1855,6 +1857,9 @@ def write_option(option_key: str, option_obj: Options.AssembleOptions) -> None:
18551857 Utils .__version__ , self .multiworld .seed ))
18561858 outfile .write ('Filling Algorithm: %s\n ' % self .multiworld .algorithm )
18571859 outfile .write ('Players: %d\n ' % self .multiworld .players )
1860+ if self .multiworld .players > 1 :
1861+ loc_count = len ([loc for loc in self .multiworld .get_locations () if not loc .is_event ])
1862+ outfile .write ('Total Location Count: %d\n ' % loc_count )
18581863 outfile .write (f'Plando Options: { self .multiworld .plando_options } \n ' )
18591864 AutoWorld .call_stage (self .multiworld , "write_spoiler_header" , outfile )
18601865
@@ -1863,6 +1868,9 @@ def write_option(option_key: str, option_obj: Options.AssembleOptions) -> None:
18631868 outfile .write ('\n Player %d: %s\n ' % (player , self .multiworld .get_player_name (player )))
18641869 outfile .write ('Game: %s\n ' % self .multiworld .game [player ])
18651870
1871+ loc_count = len ([loc for loc in self .multiworld .get_locations (player ) if not loc .is_event ])
1872+ outfile .write ('Location Count: %d\n ' % loc_count )
1873+
18661874 for f_option , option in self .multiworld .worlds [player ].options_dataclass .type_hints .items ():
18671875 write_option (f_option , option )
18681876
0 commit comments