|
7 | 7 |
|
8 | 8 | from Item import Item, ItemInfo, ItemFactory |
9 | 9 | from Location import DisableType |
| 10 | +import StartingItems |
10 | 11 |
|
11 | 12 | if TYPE_CHECKING: |
12 | 13 | from Plandomizer import ItemPoolRecord |
@@ -1019,6 +1020,7 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]: |
1019 | 1020 | world.randomized_starting_items[selected_item] = world.randomized_starting_items.get(selected_item, 0) + 1 |
1020 | 1021 | pool.remove(selected_item) |
1021 | 1022 | pool.extend(get_junk_item()) |
| 1023 | + add_random_starting_items_ammo(world.randomized_starting_items) |
1022 | 1024 | for item, count in world.randomized_starting_items.items(): |
1023 | 1025 | item = ItemFactory(item, world) |
1024 | 1026 | for _ in range(count): |
@@ -1108,4 +1110,11 @@ def configure_random_starting_items_pool(world: World, pool: list[str]) -> list[ |
1108 | 1110 | if 'junk' in world.settings.random_starting_items_exclude: |
1109 | 1111 | exclude_list.extend(ItemInfo.junk_weight) |
1110 | 1112 |
|
1111 | | - return sorted({item for item in pool if item not in exclude_list}) # give each item the same weight regardless of how many copies there are |
| 1113 | + return sorted({item for item in pool if item not in exclude_list and ItemInfo.items[item].type != 'Shop'}) # give each item the same weight regardless of how many copies there are |
| 1114 | + |
| 1115 | + |
| 1116 | +def add_random_starting_items_ammo(randomized_starting_items: dict[str, int]) -> None: |
| 1117 | + for item in StartingItems.inventory.values(): |
| 1118 | + if item.item_name in randomized_starting_items and item.ammo: |
| 1119 | + for ammo, qty in item.ammo.items(): |
| 1120 | + randomized_starting_items[ammo] = qty[randomized_starting_items[item.item_name] - 1] |
0 commit comments