Skip to content

Commit 64bfb19

Browse files
Alchavalchav
authored andcommitted
Pokemon Red and Blue: PC Item Fix (ArchipelagoMW#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>
1 parent 39733b4 commit 64bfb19

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

worlds/pokemon_rb/regions.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,16 +1580,22 @@ def create_regions(world):
15801580

15811581
world.random.shuffle(world.item_pool)
15821582
if not world.options.key_items_only:
1583-
if "Player's House 2F - Player's PC" in world.options.exclude_locations:
1584-
acceptable_item = lambda item: item.excludable
1585-
elif "Player's House 2F - Player's PC" in world.options.priority_locations:
1586-
acceptable_item = lambda item: item.advancement
1587-
else:
1588-
acceptable_item = lambda item: True
1583+
def acceptable_item(item):
1584+
return ("Badge" not in item.name and "Trap" not in item.name and item.name != "Pokedex"
1585+
and "Coins" not in item.name and "Progressive" not in item.name
1586+
and ("Player's House 2F - Player's PC" not in world.options.exclude_locations or item.excludable)
1587+
and ("Player's House 2F - Player's PC" in world.options.exclude_locations or
1588+
"Player's House 2F - Player's PC" not in world.options.priority_locations or item.advancement))
15891589
for i, item in enumerate(world.item_pool):
1590-
if acceptable_item(item):
1590+
if acceptable_item(item) and (item.name not in world.options.non_local_items.value):
15911591
world.pc_item = world.item_pool.pop(i)
15921592
break
1593+
else:
1594+
for i, item in enumerate(world.item_pool):
1595+
if acceptable_item(item):
1596+
world.pc_item = world.item_pool.pop(i)
1597+
break
1598+
15931599

15941600
advancement_items = [item.name for item in world.item_pool if item.advancement] \
15951601
+ [item.name for item in world.multiworld.precollected_items[world.player] if

0 commit comments

Comments
 (0)