Core: fix single player item links (#3721)
* fix single player item links * Make a variable and fix weird spacing * use advancement instead of classification --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
parent
ee12dda361
commit
ce42e42af7
|
@ -342,6 +342,8 @@ class MultiWorld():
|
||||||
region = Region("Menu", group_id, self, "ItemLink")
|
region = Region("Menu", group_id, self, "ItemLink")
|
||||||
self.regions.append(region)
|
self.regions.append(region)
|
||||||
locations = region.locations
|
locations = region.locations
|
||||||
|
# ensure that progression items are linked first, then non-progression
|
||||||
|
self.itempool.sort(key=lambda item: item.advancement)
|
||||||
for item in self.itempool:
|
for item in self.itempool:
|
||||||
count = common_item_count.get(item.player, {}).get(item.name, 0)
|
count = common_item_count.get(item.player, {}).get(item.name, 0)
|
||||||
if count:
|
if count:
|
||||||
|
|
20
Fill.py
20
Fill.py
|
@ -475,28 +475,26 @@ def distribute_items_restrictive(multiworld: MultiWorld,
|
||||||
nonlocal lock_later
|
nonlocal lock_later
|
||||||
lock_later.append(location)
|
lock_later.append(location)
|
||||||
|
|
||||||
|
single_player = multiworld.players == 1 and not multiworld.groups
|
||||||
|
|
||||||
if prioritylocations:
|
if prioritylocations:
|
||||||
# "priority fill"
|
# "priority fill"
|
||||||
fill_restrictive(multiworld, multiworld.state, prioritylocations, progitempool,
|
fill_restrictive(multiworld, multiworld.state, prioritylocations, progitempool,
|
||||||
single_player_placement=multiworld.players == 1, swap=False, on_place=mark_for_locking,
|
single_player_placement=single_player, swap=False, on_place=mark_for_locking, name="Priority")
|
||||||
name="Priority")
|
|
||||||
accessibility_corrections(multiworld, multiworld.state, prioritylocations, progitempool)
|
accessibility_corrections(multiworld, multiworld.state, prioritylocations, progitempool)
|
||||||
defaultlocations = prioritylocations + defaultlocations
|
defaultlocations = prioritylocations + defaultlocations
|
||||||
|
|
||||||
if progitempool:
|
if progitempool:
|
||||||
# "advancement/progression fill"
|
# "advancement/progression fill"
|
||||||
if panic_method == "swap":
|
if panic_method == "swap":
|
||||||
fill_restrictive(multiworld, multiworld.state, defaultlocations, progitempool,
|
fill_restrictive(multiworld, multiworld.state, defaultlocations, progitempool, swap=True,
|
||||||
swap=True,
|
name="Progression", single_player_placement=single_player)
|
||||||
name="Progression", single_player_placement=multiworld.players == 1)
|
|
||||||
elif panic_method == "raise":
|
elif panic_method == "raise":
|
||||||
fill_restrictive(multiworld, multiworld.state, defaultlocations, progitempool,
|
fill_restrictive(multiworld, multiworld.state, defaultlocations, progitempool, swap=False,
|
||||||
swap=False,
|
name="Progression", single_player_placement=single_player)
|
||||||
name="Progression", single_player_placement=multiworld.players == 1)
|
|
||||||
elif panic_method == "start_inventory":
|
elif panic_method == "start_inventory":
|
||||||
fill_restrictive(multiworld, multiworld.state, defaultlocations, progitempool,
|
fill_restrictive(multiworld, multiworld.state, defaultlocations, progitempool, swap=False,
|
||||||
swap=False, allow_partial=True,
|
allow_partial=True, name="Progression", single_player_placement=single_player)
|
||||||
name="Progression", single_player_placement=multiworld.players == 1)
|
|
||||||
if progitempool:
|
if progitempool:
|
||||||
for item in progitempool:
|
for item in progitempool:
|
||||||
logging.debug(f"Moved {item} to start_inventory to prevent fill failure.")
|
logging.debug(f"Moved {item} to start_inventory to prevent fill failure.")
|
||||||
|
|
Loading…
Reference in New Issue