Skip to content

Commit

Permalink
The Messenger: fix missing money wrench rule (#4041)
Browse files Browse the repository at this point in the history
* The Messenger: fix missing money wrench rule

* add a unit test for money wrench
  • Loading branch information
alwaysintreble authored Oct 11, 2024
1 parent 2751ccd commit f495bf7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions worlds/messenger/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 13 additions & 0 deletions worlds/messenger/test/test_shop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Dict

from BaseClasses import CollectionState
from . import MessengerTestBase
from ..shop import SHOP_ITEMS, FIGURINES

Expand Down Expand Up @@ -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))

0 comments on commit f495bf7

Please sign in to comment.