Skip to content

Commit 7bc55d1

Browse files
committed
support setting a single filler item name during gen or having it be chosen dynamically each loop during Manual padding of filler items
1 parent 0dc9d06 commit 7bc55d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class ManualWorld(World):
5353
item_name_to_item = item_name_to_item
5454
item_name_groups = item_name_groups
5555

56+
filler_item_name = filler_item_name
57+
5658
item_counts = {}
5759
start_inventory = {}
5860

@@ -63,7 +65,7 @@ class ManualWorld(World):
6365
victory_names = victory_names
6466

6567
def get_filler_item_name(self) -> str:
66-
return hook_get_filler_item_name(self, self.multiworld, self.player) or filler_item_name
68+
return hook_get_filler_item_name(self, self.multiworld, self.player) or self.filler_item_name
6769

6870
def interpret_slot_data(self, slot_data: dict[str, any]):
6971
#this is called by tools like UT
@@ -108,7 +110,7 @@ def create_items(self):
108110
# victory gets placed via place_locked_item at the victory location in create_regions
109111
if name == "__Victory__": continue
110112
# the game.json filler item name is added to the item lookup, so skip it until it's potentially needed later
111-
if name == filler_item_name: continue
113+
if name == filler_item_name: continue # intentionally using the Game.py filler_item_name here because it's a non-Items item
112114

113115
item = self.item_name_to_item[name]
114116
item_count = int(item.get("count", 1))
@@ -357,10 +359,8 @@ def adjust_filler_items(self, item_pool, traps):
357359
extra_item = self.create_item(self.random.choice(traps))
358360
item_pool.append(extra_item)
359361

360-
filler_name_to_add = self.get_filler_item_name()
361-
362362
for _ in range(0, filler_count):
363-
extra_item = self.create_item(filler_name_to_add)
363+
extra_item = self.create_item(self.get_filler_item_name())
364364
item_pool.append(extra_item)
365365
elif extras < 0:
366366
logging.warning(f"{self.game} has more items than locations. {abs(extras)} non-progression items will be removed at random.")

0 commit comments

Comments
 (0)