Pokemon Red and Blue: PC Item Fix (#4835)

* Pokemon Red and Blue PC Item fix

* Respect non_local_items for PC Item

* prefer exclude if also in priority locations

---------

Co-authored-by: alchav <alchav@jalchavware.com>
This commit is contained in:
Alchav
2025-04-09 13:20:56 -04:00
committed by GitHub
parent e211dfa1c2
commit f93734f9e3

View File

@@ -1580,16 +1580,22 @@ def create_regions(world):
world.random.shuffle(world.item_pool) world.random.shuffle(world.item_pool)
if not world.options.key_items_only: if not world.options.key_items_only:
if "Player's House 2F - Player's PC" in world.options.exclude_locations: def acceptable_item(item):
acceptable_item = lambda item: item.excludable return ("Badge" not in item.name and "Trap" not in item.name and item.name != "Pokedex"
elif "Player's House 2F - Player's PC" in world.options.priority_locations: and "Coins" not in item.name and "Progressive" not in item.name
acceptable_item = lambda item: item.advancement and ("Player's House 2F - Player's PC" not in world.options.exclude_locations or item.excludable)
else: and ("Player's House 2F - Player's PC" in world.options.exclude_locations or
acceptable_item = lambda item: True "Player's House 2F - Player's PC" not in world.options.priority_locations or item.advancement))
for i, item in enumerate(world.item_pool): for i, item in enumerate(world.item_pool):
if acceptable_item(item): if acceptable_item(item) and (item.name not in world.options.non_local_items.value):
world.pc_item = world.item_pool.pop(i) world.pc_item = world.item_pool.pop(i)
break break
else:
for i, item in enumerate(world.item_pool):
if acceptable_item(item):
world.pc_item = world.item_pool.pop(i)
break
advancement_items = [item.name for item in world.item_pool if item.advancement] \ advancement_items = [item.name for item in world.item_pool if item.advancement] \
+ [item.name for item in world.multiworld.precollected_items[world.player] if + [item.name for item in world.multiworld.precollected_items[world.player] if