Skip to content

Commit 7db70b6

Browse files
committed
Merge remote-tracking branch 'origin/main' into more_client
2 parents 64b3535 + 002debd commit 7db70b6

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/DataValidation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def checkStartingItemsForBadSyntax():
366366
if type(starting_block) is not dict or len(starting_block.keys()) == 0:
367367
raise ValidationError("One of your starting item definitions is not a valid dictionary.\n Each definition must be inside {}, as demonstrated in the Manual documentation.")
368368

369-
valid_keys = ["items", "item_categories", "random", "if_previous_item", "_comment"] # _comment is provided by schema
369+
valid_keys = ["items", "item_categories", "random", "if_previous_item", "_comment", "yaml_option"] # _comment is provided by schema
370370
invalid_keys = [f'"{key}"' for key in starting_block.keys() if key not in valid_keys]
371371

372372
if len(invalid_keys) > 0:

src/Options.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from Options import FreeText, NumericOption, Toggle, DefaultOnToggle, Choice, TextChoice, Range, NamedRange, PerGameCommonOptions, DeathLink
1+
from Options import FreeText, NumericOption, Toggle, DefaultOnToggle, Choice, TextChoice, Range, PerGameCommonOptions, DeathLink, StartInventoryPool
22
from dataclasses import make_dataclass
33
from .hooks.Options import before_options_defined, after_options_defined
44
from .Data import category_table, game_table
@@ -13,6 +13,8 @@ class FillerTrapPercent(Range):
1313

1414
manual_options = before_options_defined({})
1515

16+
manual_options["start_inventory_from_pool"] = StartInventoryPool
17+
1618
if len(victory_names) > 1:
1719
goal = {'option_' + v: i for i, v in enumerate(victory_names)}
1820
manual_options['goal'] = type('goal', (Choice,), goal)

src/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class ManualWorld(World):
5454
item_name_to_item = item_name_to_item
5555
item_name_groups = item_name_groups
5656

57+
filler_item_name = filler_item_name
58+
5759
item_counts = {}
5860
start_inventory = {}
5961

@@ -64,7 +66,7 @@ class ManualWorld(World):
6466
victory_names = victory_names
6567

6668
def get_filler_item_name(self) -> str:
67-
return hook_get_filler_item_name(self, self.multiworld, self.player) or filler_item_name
69+
return hook_get_filler_item_name(self, self.multiworld, self.player) or self.filler_item_name
6870

6971
def interpret_slot_data(self, slot_data: dict[str, any]):
7072
#this is called by tools like UT
@@ -106,8 +108,10 @@ def create_items(self):
106108
configured_item_names = self.item_id_to_name.copy()
107109

108110
for name in configured_item_names.values():
111+
# victory gets placed via place_locked_item at the victory location in create_regions
109112
if name == "__Victory__": continue
110-
if name == filler_item_name: continue
113+
# the game.json filler item name is added to the item lookup, so skip it until it's potentially needed later
114+
if name == filler_item_name: continue # intentionally using the Game.py filler_item_name here because it's a non-Items item
111115

112116
item = self.item_name_to_item[name]
113117
item_count = int(item.get("count", 1))
@@ -370,7 +374,7 @@ def adjust_filler_items(self, item_pool, traps):
370374
item_pool.append(extra_item)
371375

372376
for _ in range(0, filler_count):
373-
extra_item = self.create_item(filler_item_name)
377+
extra_item = self.create_item(self.get_filler_item_name())
374378
item_pool.append(extra_item)
375379
elif extras < 0:
376380
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)