Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ItemPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from Item import Item, ItemInfo, ItemFactory
from Location import DisableType
import StartingItems

if TYPE_CHECKING:
from Plandomizer import ItemPoolRecord
Expand Down Expand Up @@ -1019,6 +1020,7 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]:
world.randomized_starting_items[selected_item] = world.randomized_starting_items.get(selected_item, 0) + 1
pool.remove(selected_item)
pool.extend(get_junk_item())
add_random_starting_items_ammo(world.randomized_starting_items)
for item, count in world.randomized_starting_items.items():
item = ItemFactory(item, world)
for _ in range(count):
Expand Down Expand Up @@ -1108,4 +1110,11 @@ def configure_random_starting_items_pool(world: World, pool: list[str]) -> list[
if 'junk' in world.settings.random_starting_items_exclude:
exclude_list.extend(ItemInfo.junk_weight)

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
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


def add_random_starting_items_ammo(randomized_starting_items: dict[str, int]) -> None:
for item in StartingItems.inventory.values():
if item.item_name in randomized_starting_items and item.ammo:
for ammo, qty in item.ammo.items():
randomized_starting_items[ammo] = qty[randomized_starting_items[item.item_name] - 1]