feat: PreferredLocationGroup support updated
This commit is contained in:
6
Fill.py
6
Fill.py
@@ -493,7 +493,7 @@ def config_sort(world):
|
||||
if world.item_pool_config.verify:
|
||||
config_sort_helper(world, world.item_pool_config.verify)
|
||||
elif world.item_pool_config.preferred:
|
||||
config_sort_helper(world, world.item_pool_config.preferred)
|
||||
config_sort_helper_random(world, world.item_pool_config.preferred)
|
||||
|
||||
|
||||
def config_sort_helper(world, sort_dict):
|
||||
@@ -503,6 +503,10 @@ def config_sort_helper(world, sort_dict):
|
||||
if (i.name, i.player) in sort_dict else 0)
|
||||
|
||||
|
||||
def config_sort_helper_random(world, sort_dict):
|
||||
world.itempool.sort(key=lambda i: 1 if (i.name, i.player) in sort_dict else 0)
|
||||
|
||||
|
||||
def calc_trash_locations(world, player):
|
||||
total_count, gt_count = 0, 0
|
||||
for loc in world.get_locations():
|
||||
|
||||
16
ItemList.py
16
ItemList.py
@@ -1468,11 +1468,17 @@ def fill_specific_items(world):
|
||||
item_name = item_parts[0]
|
||||
world.item_pool_config.restricted[(item_name, item_player)] = placement['locations']
|
||||
elif placement['type'] == 'PreferredLocationGroup':
|
||||
item = placement['item']
|
||||
item_parts = item.split('#')
|
||||
item_player = player if len(item_parts) < 2 else int(item_parts[1])
|
||||
item_name = item_parts[0]
|
||||
world.item_pool_config.preferred[(item_name, item_player)] = placement['locations']
|
||||
items = []
|
||||
if 'item' in placement:
|
||||
items.append(placement['item'])
|
||||
elif 'items' in placement:
|
||||
items.extend(placement['items'])
|
||||
for item in items:
|
||||
item_parts = item.split('#')
|
||||
item_player = player if len(item_parts) < 2 else int(item_parts[1])
|
||||
item_name = item_parts[0]
|
||||
world.item_pool_config.preferred[(item_name, item_player)] = placement['locations']
|
||||
world.item_pool_config.reserved_locations[player].update(placement['locations'])
|
||||
elif placement['type'] == 'Verification':
|
||||
item = placement['item']
|
||||
item_parts = item.split('#')
|
||||
|
||||
@@ -146,6 +146,7 @@ These are now independent of retro mode and have three options: None, Random, an
|
||||
* Back of Tavern Shuffle now on by default
|
||||
* Enemizer: Wallmasters banned from tiles where spiral staircases are. (Softlock issue)
|
||||
* Packaged build of unstable now available
|
||||
* Customizer: New PreferredLocationGroup for putting a set of items in a set of locations. See customizer docs.
|
||||
* Customizer: Fixed an issue with starting with `Ocarina` and flute_mode is active
|
||||
* Fix: HC Big Key drop doesn't count on Basic Doors
|
||||
* Fix: Small Key for this dungeon in Hera Basement doesn't count twice for the key counter
|
||||
|
||||
@@ -77,7 +77,7 @@ You may list each location for a player and the item you wish to place there. A
|
||||
|
||||
This must be defined by player. Each player number should be listed with the appropriate section. Each section is a list of placement rules. Each placement rule has a specific type.
|
||||
|
||||
Supported Types: PlacementGroup, NotPlacmentGroup
|
||||
Supported Types: PlacementGroup, NotPlacmentGroup, PreferredLocationGroup
|
||||
|
||||
#### PlacementGroup
|
||||
|
||||
@@ -85,7 +85,11 @@ You may define an item, and a list of locations. The locations may be weighted i
|
||||
|
||||
#### NotPlacementGroup
|
||||
|
||||
You may define an item and a list of locations that an item should not be placed at. This will apply to all items of that type. The logic is considered for this. If it is otherwise impossible, the item will be considered for the listed locations. This is important for small key layouts mostly, but it will try other locations first.
|
||||
You may define an item and a list of locations that an item should not be placed at. This will apply to all items of that type. The logic is considered for this. If it is otherwise impossible, the item will be considered for the listed locations. This is important for small key layouts mostly, but it will try other locations first.
|
||||
|
||||
#### PreferredPlacementGroup
|
||||
|
||||
You may define a list of items and a list of locations. Those items will be considered first for placements and the logic will attempt to place those items in those locations first. If there are more item than locations or vice versa, the leftover items or location will be treated normally. (Although, the leftover items will be placed earlier by the algorithm than those not listed)
|
||||
|
||||
### entrances
|
||||
|
||||
|
||||
Reference in New Issue
Block a user