From 87b0e9fe070ac271526777706b949b41300c35e4 Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Tue, 8 Oct 2024 21:28:18 -0500 Subject: [PATCH 1/2] The Messenger: fix missing money wrench rule --- worlds/messenger/rules.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worlds/messenger/rules.py b/worlds/messenger/rules.py index 85b73dec4147..c354ad70aba6 100644 --- a/worlds/messenger/rules.py +++ b/worlds/messenger/rules.py @@ -220,6 +220,8 @@ def __init__(self, world: "MessengerWorld") -> None: } self.location_rules = { + # hq + "Money Wrench": self.can_shop, # ninja village "Ninja Village Seal - Tree House": self.has_dart, From f2e031db654fbc764c9bd9a248e0b0870dc0c68e Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Tue, 8 Oct 2024 21:32:57 -0500 Subject: [PATCH 2/2] add a unit test for money wrench --- worlds/messenger/test/test_shop.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/worlds/messenger/test/test_shop.py b/worlds/messenger/test/test_shop.py index 971ff1763b47..ce6fd19e33c8 100644 --- a/worlds/messenger/test/test_shop.py +++ b/worlds/messenger/test/test_shop.py @@ -1,5 +1,6 @@ from typing import Dict +from BaseClasses import CollectionState from . import MessengerTestBase from ..shop import SHOP_ITEMS, FIGURINES @@ -89,3 +90,15 @@ def test_costs(self) -> None: self.assertTrue(loc in FIGURINES) self.assertEqual(len(figures), len(FIGURINES)) + + max_cost_state = CollectionState(self.multiworld) + self.assertFalse(self.world.get_location("Money Wrench").can_reach(max_cost_state)) + prog_shards = [] + for item in self.multiworld.itempool: + if "Time Shard " in item.name: + value = int(item.name.strip("Time Shard ()")) + if value >= 100: + prog_shards.append(item) + for shard in prog_shards: + max_cost_state.collect(shard, True) + self.assertTrue(self.world.get_location("Money Wrench").can_reach(max_cost_state))