The Messenger: fix missing money wrench rule (#4041)

* The Messenger: fix missing money wrench rule

* add a unit test for money wrench
This commit is contained in:
Aaron Wagener 2024-10-10 20:05:21 -05:00 committed by GitHub
parent 2751ccdaab
commit f495bf7261
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -220,6 +220,8 @@ class MessengerRules:
}
self.location_rules = {
# hq
"Money Wrench": self.can_shop,
# ninja village
"Ninja Village Seal - Tree House":
self.has_dart,

View File

@ -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 @@ class PlandoTest(MessengerTestBase):
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))