Skip to content

Commit

Permalink
Fix missing i replacement, rework set rules to use "self" instead of …
Browse files Browse the repository at this point in the history
…a million arguments
  • Loading branch information
gaithern committed Jul 7, 2024
1 parent bdd0012 commit 35993e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion worlds/kh1/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ def has_oogie_manor(state: CollectionState, player: int, advanced_logic: bool) -
or (advanced_logic and has_item(state, player, "High Jump") and can_glide(state, player))
)

def set_rules(multiworld: MultiWorld, player: int, options, eotw_required_reports: int, final_rest_door_required_reports: int, final_rest_door_requirement: str):
def set_rules(kh1world):
multiworld = kh1world.multiworld
player = kh1world.player
options = kh1world.options
eotw_required_reports = kh1world.determine_reports_required_to_open_end_of_the_world()
final_rest_door_required_reports = kh1world.determine_reports_required_to_open_final_rest_door()
final_rest_door_requirement = kh1world.options.final_rest_door.current_key

#Location rules.
#Keys
#multiworld.get_location("Destiny Islands Chest" , player).access_rule = lambda state: has_item(state, player, "")
Expand Down
4 changes: 2 additions & 2 deletions worlds/kh1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def create_items(self):
level_up_locations = list(get_locations_by_category("Levels").keys())
self.random.shuffle(level_up_item_pool)
starting_level_for_stats_only = self.options.force_stats_on_levels - 1
while len(level_up_item_pool) > 0 and i < self.options.level_checks:
while len(level_up_item_pool) > 0 and starting_level_for_stats_only < self.options.level_checks:
self.multiworld.get_location(level_up_locations[starting_level_for_stats_only], self.player).place_locked_item(self.create_item(level_up_item_pool.pop()))
starting_level_for_stats_only += 1

Expand Down Expand Up @@ -273,7 +273,7 @@ def create_event(self, name: str) -> KH1Item:
return KH1Item(name, data.classification, data.code, self.player)

def set_rules(self):
set_rules(self.multiworld, self.player, self.options, self.determine_reports_required_to_open_end_of_the_world(), self.determine_reports_required_to_open_final_rest_door(), self.options.final_rest_door.current_key)
set_rules(self)

def create_regions(self):
create_regions(self.multiworld, self.player, self.options)
Expand Down

0 comments on commit 35993e6

Please sign in to comment.