From d0ac2b744eac438570e6a2333e76fa212be66534 Mon Sep 17 00:00:00 2001 From: panicbit Date: Thu, 28 Mar 2024 10:11:26 +0100 Subject: [PATCH] LADX: fix local and non-local instrument placement (#2987) * LADX: fix local and non-local instrument placement * change confusing variable name --- worlds/ladx/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/worlds/ladx/__init__.py b/worlds/ladx/__init__.py index 9de3462ad05..d662b526bb6 100644 --- a/worlds/ladx/__init__.py +++ b/worlds/ladx/__init__.py @@ -184,19 +184,22 @@ def create_items(self) -> None: self.pre_fill_items = [] # For any and different world, set item rule instead - for option in ["maps", "compasses", "small_keys", "nightmare_keys", "stone_beaks", "instruments"]: - option = "shuffle_" + option + for dungeon_item_type in ["maps", "compasses", "small_keys", "nightmare_keys", "stone_beaks", "instruments"]: + option = "shuffle_" + dungeon_item_type option = self.player_options[option] dungeon_item_types[option.ladxr_item] = option.value + # The color dungeon does not contain an instrument + num_items = 8 if dungeon_item_type == "instruments" else 9 + if option.value == DungeonItemShuffle.option_own_world: self.multiworld.local_items[self.player].value |= { - ladxr_item_to_la_item_name[f"{option.ladxr_item}{i}"] for i in range(1, 10) + ladxr_item_to_la_item_name[f"{option.ladxr_item}{i}"] for i in range(1, num_items + 1) } elif option.value == DungeonItemShuffle.option_different_world: self.multiworld.non_local_items[self.player].value |= { - ladxr_item_to_la_item_name[f"{option.ladxr_item}{i}"] for i in range(1, 10) + ladxr_item_to_la_item_name[f"{option.ladxr_item}{i}"] for i in range(1, num_items + 1) } # option_original_dungeon = 0 # option_own_dungeons = 1