diff --git a/worlds/stardew_valley/rules.py b/worlds/stardew_valley/rules.py index 2b7eec99..2fb95a98 100644 --- a/worlds/stardew_valley/rules.py +++ b/worlds/stardew_valley/rules.py @@ -206,7 +206,7 @@ def set_entrance_rules(logic: StardewLogic, multiworld, player, world_options: S set_entrance_rule(multiworld, player, Entrance.enter_skull_cavern, logic.received(Wallet.skull_key)) set_entrance_rule(multiworld, player, LogicEntrance.talk_to_mines_dwarf, logic.wallet.can_speak_dwarf() & logic.tool.has_tool(Tool.pickaxe, ToolMaterial.iron)) - set_entrance_rule(multiworld, player, LogicEntrance.buy_from_traveling_merchant, logic.traveling_merchant.has_days()) + set_entrance_rule(multiworld, player, LogicEntrance.buy_from_traveling_merchant, logic.traveling_merchant.has_days() & logic.money.can_spend(1000)) set_entrance_rule(multiworld, player, LogicEntrance.buy_from_raccoon, logic.quest.has_raccoon_shop()) set_entrance_rule(multiworld, player, LogicEntrance.fish_in_waterfall, logic.skill.has_level(Skill.fishing, 5) & logic.tool.has_fishing_rod(2)) diff --git a/worlds/stardew_valley/test/rules/TestTravelingMerchant.py b/worlds/stardew_valley/test/rules/TestTravelingMerchant.py new file mode 100644 index 00000000..57b88747 --- /dev/null +++ b/worlds/stardew_valley/test/rules/TestTravelingMerchant.py @@ -0,0 +1,23 @@ +from ..bases import SVTestBase +from ...locations import location_table, LocationTags + + +class TestTravelingMerchant(SVTestBase): + + def test_purchase_from_traveling_merchant_requires_money(self): + traveling_merchant_location_names = [l for l in self.get_real_location_names() if LocationTags.TRAVELING_MERCHANT in location_table[l].tags] + + for traveling_merchant_day in ["Traveling Merchant: Sunday", "Traveling Merchant: Monday", "Traveling Merchant: Tuesday", + "Traveling Merchant: Wednesday", "Traveling Merchant: Thursday", "Traveling Merchant: Friday", + "Traveling Merchant: Saturday"]: + self.collect(traveling_merchant_day) + + for location_name in traveling_merchant_location_names: + location = self.multiworld.get_location(location_name, 1) + self.assert_cannot_reach_location(location, self.multiworld.state) + + self.collect("Shipping Bin") + + for location_name in traveling_merchant_location_names: + location = self.multiworld.get_location(location_name, 1) + self.assert_can_reach_location(location, self.multiworld.state)