Stardew Valley: Add money logic to traveling merchant (#5327)

* add rule to traveling merchant region

* add a test so kaito is happy
This commit is contained in:
Jérémie Bolduc
2025-09-05 10:23:25 -04:00
committed by GitHub
parent 89be26a33a
commit 64d3c55d62
2 changed files with 24 additions and 1 deletions

View File

@@ -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))

View File

@@ -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)