KDL3: Fix world access on non-strict open world (#4543)

* Update rules.py

* lambda capture
This commit is contained in:
Silvris 2025-01-26 18:52:02 -06:00 committed by GitHub
parent 8622cb6204
commit 57a571cc11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 13 deletions

View File

@ -329,6 +329,14 @@ def set_rules(world: "KDL3World") -> None:
world.options.ow_boss_requirement.value,
world.player_levels)))
if world.options.open_world:
for boss_flag, level in zip(["Level 1 Boss - Defeated", "Level 2 Boss - Defeated", "Level 3 Boss - Defeated",
"Level 4 Boss - Defeated", "Level 5 Boss - Defeated"],
location_name.level_names.keys()):
set_rule(world.get_location(boss_flag),
lambda state, lvl=level: state.has(f"{lvl} - Stage Completion", world.player,
world.options.ow_boss_requirement.value))
set_rule(world.multiworld.get_entrance("To Level 6", world.player),
lambda state: state.has("Heart Star", world.player, world.required_heart_stars))