Skip to content

Commit e6fc843

Browse files
committed
Merge 'Fix Randomized Starting Items' (#2485)
2 parents e2482ab + fc67e14 commit e6fc843

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

ItemPool.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from Item import Item, ItemInfo, ItemFactory
99
from Location import DisableType
10+
import StartingItems
1011

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

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]

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '8.3.56'
1+
__version__ = '8.3.57'
22

33
# This is a supplemental version number for branches based off of main dev.
44
supplementary_version = 0

0 commit comments

Comments
 (0)