From f93734f9e3b7b805bff4edacc204fbf31559e345 Mon Sep 17 00:00:00 2001 From: Alchav <59858495+Alchav@users.noreply.github.com> Date: Wed, 9 Apr 2025 13:20:56 -0400 Subject: [PATCH] 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 --- worlds/pokemon_rb/regions.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/worlds/pokemon_rb/regions.py b/worlds/pokemon_rb/regions.py index a7c0b6d533..84c9b25735 100644 --- a/worlds/pokemon_rb/regions.py +++ b/worlds/pokemon_rb/regions.py @@ -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