From 1ae4ed4a440f34a80a5f98a3afd6f401acb06e74 Mon Sep 17 00:00:00 2001 From: t3hf1gm3nt <59876300+t3hf1gm3nt@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:37:04 -0500 Subject: [PATCH] TLOZ: Try accounting for non_local_items with the pool of starting weapons It was brought up that if you attempt to non_local any of the starting weapons, there is still a chance for it to get chosen as your starting weapon if you are on a StartingPosition value lower than very_dangerous. This fix will attempt to build the starting weapons list accounting for non_local items, but if all possible weapons have been set to non_local, force one of them to be your starting weapon anyway since the player is still expecting a starting weapon in their world if they have chosen one of the lower StartingPosition values. --- worlds/tloz/ItemPool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worlds/tloz/ItemPool.py b/worlds/tloz/ItemPool.py index 7773accd8d7c..456598edecef 100644 --- a/worlds/tloz/ItemPool.py +++ b/worlds/tloz/ItemPool.py @@ -93,7 +93,11 @@ def get_pool_core(world): # Starting Weapon start_weapon_locations = starting_weapon_locations.copy() - starting_weapon = random.choice(starting_weapons) + final_starting_weapons = [weapon for weapon in starting_weapons + if weapon not in world.multiworld.non_local_items[world.player]] + if not final_starting_weapons: + final_starting_weapons = starting_weapons + starting_weapon = random.choice(final_starting_weapons) if world.multiworld.StartingPosition[world.player] == StartingPosition.option_safe: placed_items[start_weapon_locations[0]] = starting_weapon elif world.multiworld.StartingPosition[world.player] in \