Skip to content

Commit

Permalink
Combine shuffled fortress PoH into container in Plentiful/Ludicrous
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Apr 1, 2024
1 parent b67e835 commit 2798013
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions ItemPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from World import World


plentiful_items: list[str] = ([
plentiful_items: list[str] = [
'Biggoron Sword',
'Boomerang',
'Lens of Truth',
Expand All @@ -36,14 +36,8 @@
'Bow',
'Slingshot',
'Bomb Bag',
'Double Defense'] +
['Heart Container'] * 8
)

# Ludicrous replaces all health upgrades with heart containers
# as done in plentiful. The item list is used separately to
# dynamically replace all junk with even levels of each item.
ludicrous_health: list[str] = ['Heart Container'] * 8
'Double Defense',
]

# List of items that can be multiplied in ludicrous mode.
# Used to filter the pre-plando pool for candidates instead
Expand Down Expand Up @@ -210,12 +204,8 @@
)

item_difficulty_max: dict[str, dict[str, int]] = {
'ludicrous': {
'Piece of Heart': 3,
},
'plentiful': {
'Piece of Heart': 3,
},
'ludicrous': {},
'plentiful': {},
'balanced': {},
'scarce': {
'Bombchus (5)': 1,
Expand Down Expand Up @@ -512,9 +502,6 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]:
if world.settings.shuffle_individual_ocarina_notes:
pending_junk_pool.extend(['Ocarina A Button', 'Ocarina C up Button', 'Ocarina C left Button', 'Ocarina C down Button', 'Ocarina C right Button'])

if world.settings.item_pool_value == 'ludicrous':
pending_junk_pool.extend(ludicrous_health)

if world.settings.triforce_hunt:
pending_junk_pool.extend(['Triforce Piece'] * world.settings.triforce_count_per_world)
if world.settings.shuffle_individual_ocarina_notes:
Expand Down Expand Up @@ -902,6 +889,13 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]:

for item, maximum in item_difficulty_max[world.settings.item_pool_value].items():
replace_max_item(pool, item, maximum)
# Dynamically condense regular heart pieces into heart containers depending on how many are in the pool
# (which varies based on the Shuffle Gerudo Fortress Heart Piece setting)
if world.settings.item_pool_value in ('plentiful', 'ludicrous'):
indices = [items_idx for items_idx, val in enumerate(pool) if val == 'Piece of Heart']
num_full_hearts = (len(indices) // 4) * 4
for hearts_idx, items_idx in enumerate(indices[:num_full_hearts]):
pool[items_idx] = 'Heart Container' if hearts_idx % 4 == 0 else get_junk_item()[0]

world.distribution.alter_pool(world, pool)

Expand Down

0 comments on commit 2798013

Please sign in to comment.