LADX: Stabilize Item Pool Option ()

Co-authored-by: Scipio Wright <scipiowright@gmail.com>
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
threeandthreee 2025-01-15 21:42:19 -05:00 committed by GitHub
parent b7621a0923
commit 902d03d447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 5 deletions

View File

@ -68,10 +68,12 @@ DEFAULT_ITEM_POOL = {
class ItemPool:
def __init__(self, logic, settings, rnd):
def __init__(self, logic, settings, rnd, stabilize_item_pool: bool):
self.__pool = {}
self.__setup(logic, settings)
self.__randomizeRupees(settings, rnd)
if not stabilize_item_pool:
self.__randomizeRupees(settings, rnd)
def add(self, item, count=1):
self.__pool[item] = self.__pool.get(item, 0) + count

View File

@ -527,6 +527,13 @@ class InGameHints(DefaultOnToggle):
display_name = "In-game Hints"
class StabilizeItemPool(DefaultOffToggle):
"""
By default, rupees in the item pool may be randomly swapped with bombs, arrows, powders, or capacity upgrades. This option disables that swapping, which is useful for plando.
"""
display_name = "Stabilize Item Pool"
class ForeignItemIcons(Choice):
"""
Choose how to display foreign items.
@ -562,6 +569,7 @@ ladx_option_groups = [
TrendyGame,
InGameHints,
NagMessages,
StabilizeItemPool,
Quickswap,
HardMode,
BootsControls
@ -631,6 +639,7 @@ class LinksAwakeningOptions(PerGameCommonOptions):
no_flash: NoFlash
in_game_hints: InGameHints
overworld: Overworld
stabilize_item_pool: StabilizeItemPool
warp_improvements: Removed
additional_warp_points: Removed

View File

@ -138,7 +138,8 @@ class LinksAwakeningWorld(World):
world_setup = LADXRWorldSetup()
world_setup.randomize(self.ladxr_settings, self.random)
self.ladxr_logic = LADXRLogic(configuration_options=self.ladxr_settings, world_setup=world_setup)
self.ladxr_itempool = LADXRItemPool(self.ladxr_logic, self.ladxr_settings, self.random).toDict()
self.ladxr_itempool = LADXRItemPool(self.ladxr_logic, self.ladxr_settings, self.random, bool(self.options.stabilize_item_pool)).toDict()
def generate_early(self) -> None:
self.dungeon_item_types = {
@ -225,7 +226,7 @@ class LinksAwakeningWorld(World):
for _ in range(count):
if item_name in exclude:
exclude.remove(item_name) # this is destructive. create unique list above
self.multiworld.itempool.append(self.create_item("Nothing"))
self.multiworld.itempool.append(self.create_item(self.get_filler_item_name()))
else:
item = self.create_item(item_name)
@ -499,8 +500,14 @@ class LinksAwakeningWorld(World):
state.prog_items[self.player]["RUPEES"] -= self.rupees[item.name]
return change
# Same fill choices and weights used in LADXR.itempool.__randomizeRupees
filler_choices = ("Bomb", "Single Arrow", "10 Arrows", "Magic Powder", "Medicine")
filler_weights = ( 10, 5, 10, 10, 1)
def get_filler_item_name(self) -> str:
return "Nothing"
if self.options.stabilize_item_pool:
return "Nothing"
return self.random.choices(self.filler_choices, self.filler_weights)[0]
def fill_slot_data(self):
slot_data = {}