TLOZ: Try accounting for non_local_items with the pool of starting weapons (#2620)

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.
This commit is contained in:
t3hf1gm3nt 2023-12-28 08:17:23 -05:00 committed by GitHub
parent 8e708f829d
commit c7617f92dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -93,7 +93,11 @@ def get_pool_core(world):
# Starting Weapon # Starting Weapon
start_weapon_locations = starting_weapon_locations.copy() 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: if world.multiworld.StartingPosition[world.player] == StartingPosition.option_safe:
placed_items[start_weapon_locations[0]] = starting_weapon placed_items[start_weapon_locations[0]] = starting_weapon
elif world.multiworld.StartingPosition[world.player] in \ elif world.multiworld.StartingPosition[world.player] in \