|
8 | 8 | FriendsanityHeartSize, BundleRandomization, SkillProgression
|
9 | 9 | from ..strings.entrance_names import Entrance
|
10 | 10 | from ..strings.region_names import Region
|
| 11 | +from ..strings.tool_names import Tool, ToolMaterial |
11 | 12 |
|
12 | 13 |
|
13 | 14 | class TestProgressiveToolsLogic(SVTestBase):
|
@@ -596,6 +597,54 @@ def swap_museum_and_bathhouse(multiworld, player):
|
596 | 597 | bathhouse_entrance.connect(museum_region)
|
597 | 598 |
|
598 | 599 |
|
| 600 | +class TestToolVanillaRequiresBlacksmith(SVTestBase): |
| 601 | + options = { |
| 602 | + options.EntranceRandomization: options.EntranceRandomization.option_buildings, |
| 603 | + options.ToolProgression: options.ToolProgression.option_vanilla, |
| 604 | + } |
| 605 | + seed = 4111845104987680262 |
| 606 | + |
| 607 | + # Seed is hardcoded to make sure the ER is a valid roll that actually lock the blacksmith behind the Railroad Boulder Removed. |
| 608 | + |
| 609 | + def test_cannot_get_any_tool_without_blacksmith_access(self): |
| 610 | + railroad_item = "Railroad Boulder Removed" |
| 611 | + place_region_at_entrance(self.multiworld, self.player, Region.blacksmith, Entrance.enter_bathhouse_entrance) |
| 612 | + collect_all_except(self.multiworld, railroad_item) |
| 613 | + |
| 614 | + for tool in [Tool.pickaxe, Tool.axe, Tool.hoe, Tool.trash_can, Tool.watering_can]: |
| 615 | + for material in [ToolMaterial.copper, ToolMaterial.iron, ToolMaterial.gold, ToolMaterial.iridium]: |
| 616 | + self.assert_rule_false(self.world.logic.tool.has_tool(tool, material), self.multiworld.state) |
| 617 | + |
| 618 | + self.multiworld.state.collect(self.world.create_item(railroad_item), event=False) |
| 619 | + |
| 620 | + for tool in [Tool.pickaxe, Tool.axe, Tool.hoe, Tool.trash_can, Tool.watering_can]: |
| 621 | + for material in [ToolMaterial.copper, ToolMaterial.iron, ToolMaterial.gold, ToolMaterial.iridium]: |
| 622 | + self.assert_rule_true(self.world.logic.tool.has_tool(tool, material), self.multiworld.state) |
| 623 | + |
| 624 | + def test_cannot_get_fishing_rod_without_willy_access(self): |
| 625 | + railroad_item = "Railroad Boulder Removed" |
| 626 | + place_region_at_entrance(self.multiworld, self.player, Region.fish_shop, Entrance.enter_bathhouse_entrance) |
| 627 | + collect_all_except(self.multiworld, railroad_item) |
| 628 | + |
| 629 | + for fishing_rod_level in [3, 4]: |
| 630 | + self.assert_rule_false(self.world.logic.tool.has_fishing_rod(fishing_rod_level), self.multiworld.state) |
| 631 | + |
| 632 | + self.multiworld.state.collect(self.world.create_item(railroad_item), event=False) |
| 633 | + |
| 634 | + for fishing_rod_level in [3, 4]: |
| 635 | + self.assert_rule_true(self.world.logic.tool.has_fishing_rod(fishing_rod_level), self.multiworld.state) |
| 636 | + |
| 637 | + |
| 638 | +def place_region_at_entrance(multiworld, player, region, entrance): |
| 639 | + region_to_place = multiworld.get_region(region, player) |
| 640 | + entrance_to_place_region = multiworld.get_entrance(entrance, player) |
| 641 | + |
| 642 | + entrance_to_switch = region_to_place.entrances[0] |
| 643 | + region_to_switch = entrance_to_place_region.connected_region |
| 644 | + entrance_to_switch.connect(region_to_switch) |
| 645 | + entrance_to_place_region.connect(region_to_place) |
| 646 | + |
| 647 | + |
599 | 648 | def collect_all_except(multiworld, item_to_not_collect: str):
|
600 | 649 | for item in multiworld.get_items():
|
601 | 650 | if item.name != item_to_not_collect:
|
|
0 commit comments