Skip to content

Commit

Permalink
support setting a single filler item name during gen or having it be …
Browse files Browse the repository at this point in the history
…chosen dynamically each loop during Manual padding of filler items
  • Loading branch information
FuzzyGamesOn committed Sep 27, 2024
1 parent 0dc9d06 commit 7bc55d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class ManualWorld(World):
item_name_to_item = item_name_to_item
item_name_groups = item_name_groups

filler_item_name = filler_item_name

item_counts = {}
start_inventory = {}

Expand All @@ -63,7 +65,7 @@ class ManualWorld(World):
victory_names = victory_names

def get_filler_item_name(self) -> str:
return hook_get_filler_item_name(self, self.multiworld, self.player) or filler_item_name
return hook_get_filler_item_name(self, self.multiworld, self.player) or self.filler_item_name

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

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

filler_name_to_add = self.get_filler_item_name()

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

0 comments on commit 7bc55d1

Please sign in to comment.