diff --git a/ItemPool.py b/ItemPool.py index d858ce25e..af10c6521 100644 --- a/ItemPool.py +++ b/ItemPool.py @@ -13,7 +13,7 @@ from World import World -plentiful_items: list[str] = ([ +plentiful_items: list[str] = [ 'Biggoron Sword', 'Boomerang', 'Lens of Truth', @@ -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 @@ -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, @@ -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: @@ -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)