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)
if not world.options.key_items_only:
if "Player's House 2F - Player's PC" in world.options.exclude_locations:
acceptable_item = lambda item: item.excludable
elif "Player's House 2F - Player's PC" in world.options.priority_locations:
acceptable_item = lambda item: item.advancement
else:
acceptable_item = lambda item: True
def acceptable_item(item):
return ("Badge" not in item.name and "Trap" not in item.name and item.name != "Pokedex"
and "Coins" not in item.name and "Progressive" not in item.name
and ("Player's House 2F - Player's PC" not in world.options.exclude_locations or item.excludable)
and ("Player's House 2F - Player's PC" in world.options.exclude_locations or
"Player's House 2F - Player's PC" not in world.options.priority_locations or item.advancement))
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)
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] \
+ [item.name for item in world.multiworld.precollected_items[world.player] if