Using main item fill to place followers
This commit is contained in:
29
ItemList.py
29
ItemList.py
@@ -1695,9 +1695,11 @@ def set_event_item(world, player, location_name, item_name=None):
|
|||||||
|
|
||||||
def shuffle_event_items(world, player):
|
def shuffle_event_items(world, player):
|
||||||
if world.shuffle_followers[player]:
|
if world.shuffle_followers[player]:
|
||||||
|
all_state = world.get_all_state(keys=True)
|
||||||
available_quests = follower_quests.copy()
|
available_quests = follower_quests.copy()
|
||||||
available_pickups = [quests[0] for quests in available_quests.values()]
|
available_pickups = [quests[0] for quests in available_quests.values()]
|
||||||
|
|
||||||
|
# finalize customizer followers first
|
||||||
for loc_name in follower_quests.keys():
|
for loc_name in follower_quests.keys():
|
||||||
loc = world.get_location(loc_name, player)
|
loc = world.get_location(loc_name, player)
|
||||||
if loc.item:
|
if loc.item:
|
||||||
@@ -1705,7 +1707,6 @@ def shuffle_event_items(world, player):
|
|||||||
available_quests.pop(loc_name)
|
available_quests.pop(loc_name)
|
||||||
available_pickups.remove(loc.item.name)
|
available_pickups.remove(loc.item.name)
|
||||||
|
|
||||||
|
|
||||||
if world.mode[player] == 'standard' and 'Zelda Herself' in available_pickups:
|
if world.mode[player] == 'standard' and 'Zelda Herself' in available_pickups:
|
||||||
zelda_dropoff = 'Zelda Pickup'
|
zelda_dropoff = 'Zelda Pickup'
|
||||||
if world.default_zelda_region[player] == 'Thieves Blind\'s Cell':
|
if world.default_zelda_region[player] == 'Thieves Blind\'s Cell':
|
||||||
@@ -1715,20 +1716,22 @@ def shuffle_event_items(world, player):
|
|||||||
available_pickups.remove(zelda_pickup)
|
available_pickups.remove(zelda_pickup)
|
||||||
set_event_item(world, player, zelda_dropoff, zelda_pickup)
|
set_event_item(world, player, zelda_dropoff, zelda_pickup)
|
||||||
|
|
||||||
random.shuffle(available_pickups)
|
# randomize the follower pickups, but ensure that the last items are the unrestrictive ones
|
||||||
|
unrestrictive_pickups = [p for p in ['Zelda Herself', 'Sign Vandalized'] if p in available_pickups]
|
||||||
|
restrictive_pickups = [p for p in available_pickups if p not in unrestrictive_pickups]
|
||||||
|
random.shuffle(restrictive_pickups)
|
||||||
|
random.shuffle(unrestrictive_pickups)
|
||||||
|
available_pickups = restrictive_pickups + unrestrictive_pickups
|
||||||
|
|
||||||
restricted_pickups = { 'Get Frog': 'Dark Blacksmith Ruins'}
|
pickup_items = ItemFactory(available_pickups, player)
|
||||||
for pickup in restricted_pickups:
|
follower_locations = [world.get_location(loc_name, player) for loc_name in available_quests.keys()]
|
||||||
restricted_quests = [q for q in available_quests.keys() if q not in restricted_pickups[pickup]]
|
random.shuffle(follower_locations)
|
||||||
random.shuffle(restricted_quests)
|
|
||||||
quest = restricted_quests.pop()
|
|
||||||
available_quests.pop(quest)
|
|
||||||
available_pickups.remove(pickup)
|
|
||||||
set_event_item(world, player, quest, pickup)
|
|
||||||
|
|
||||||
for pickup in available_pickups:
|
fill_restrictive(world, all_state, follower_locations, pickup_items, single_player_placement=True)
|
||||||
quest, _ = available_quests.popitem()
|
for loc_name in available_quests.keys():
|
||||||
set_event_item(world, player, quest, pickup)
|
loc = world.get_location(loc_name, player)
|
||||||
|
if loc.item:
|
||||||
|
set_event_item(world, player, loc_name)
|
||||||
|
|
||||||
|
|
||||||
def get_item_and_event_flag(item, world, player, dungeon_pool, prize_set, prize_pool):
|
def get_item_and_event_flag(item, world, player, dungeon_pool, prize_set, prize_pool):
|
||||||
|
|||||||
Reference in New Issue
Block a user