mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Add local and non_local items to item_links (#506)
* Add local and non_local items to item_links * Whoops, don't pass list of list to verify_items. * Give a did you mean result in the exception.
This commit is contained in:
@@ -12,6 +12,20 @@ else:
|
||||
ItemRule = typing.Callable[[object], bool]
|
||||
|
||||
|
||||
def group_locality_rules(world):
|
||||
for group_id, group in world.groups.items():
|
||||
if set(world.player_ids) == set(group["players"]):
|
||||
continue
|
||||
if group["local_items"]:
|
||||
for location in world.get_locations():
|
||||
if location.player not in group["players"]:
|
||||
forbid_items_for_player(location, group["local_items"], group_id)
|
||||
if group["non_local_items"]:
|
||||
for location in world.get_locations():
|
||||
if location.player in group["players"]:
|
||||
forbid_items_for_player(location, group["non_local_items"], group_id)
|
||||
|
||||
|
||||
def locality_rules(world, player: int):
|
||||
if world.local_items[player].value:
|
||||
for location in world.get_locations():
|
||||
|
Reference in New Issue
Block a user