From e4bb4b4a0aa0bb1bc79bb2ad6fad4f62dc1cf33e Mon Sep 17 00:00:00 2001 From: digiholic Date: Thu, 14 Nov 2024 13:09:21 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> --- worlds/osrs/Rules.py | 8 ++++---- worlds/osrs/__init__.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/worlds/osrs/Rules.py b/worlds/osrs/Rules.py index bcc1a2c77ccb..88a54d84665a 100644 --- a/worlds/osrs/Rules.py +++ b/worlds/osrs/Rules.py @@ -211,14 +211,14 @@ def get_skill_rule(skill, level, player, options) -> CollectionRule: def generate_special_rules_for(entrance, region_row, outbound_region_name, player, options): if outbound_region_name == RegionNames.Cooks_Guild: add_rule(entrance, get_cooking_skill_rule(32, player, options)) - if outbound_region_name == RegionNames.Crafting_Guild: + elif outbound_region_name == RegionNames.Crafting_Guild: add_rule(entrance, get_crafting_skill_rule(40, player, options)) - if outbound_region_name == RegionNames.Corsair_Cove: + elif outbound_region_name == RegionNames.Corsair_Cove: # Need to be able to start Corsair Curse in addition to having the item add_rule(entrance, lambda state: state.can_reach(RegionNames.Falador_Farm, "Region", player)) - if outbound_region_name == "Camdozaal*": + elif outbound_region_name == "Camdozaal*": add_rule(entrance, lambda state: state.has(ItemNames.QP_Below_Ice_Mountain, player)) - if region_row.name == "Dwarven Mountain Pass" and outbound_region_name == "Anvil*": + elif region_row.name == "Dwarven Mountain Pass" and outbound_region_name == "Anvil*": add_rule(entrance, lambda state: state.has(ItemNames.QP_Dorics_Quest, player)) # Special logic for canoes diff --git a/worlds/osrs/__init__.py b/worlds/osrs/__init__.py index 73cd63ac73d1..3e95ae1c6fce 100644 --- a/worlds/osrs/__init__.py +++ b/worlds/osrs/__init__.py @@ -164,7 +164,7 @@ def create_regions(self) -> None: entrance.connect(self.region_name_to_data[parsed_outbound]) item_name = self.region_rows_by_name[parsed_outbound].itemReq - entrance.access_rule = lambda state, item_name=item_name.replace("*",""): state.has(item_name.replace("*",""), self.player) + entrance.access_rule = lambda state, item_name=item_name.replace("*",""): state.has(item_name, self.player) generate_special_rules_for(entrance, region_row, outbound_region_name, self.player, self.options) for resource_region in region_row.resources: