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:
parent
2751ccdaab
commit
f495bf7261
|
@ -220,6 +220,8 @@ class MessengerRules:
|
||||||
}
|
}
|
||||||
|
|
||||||
self.location_rules = {
|
self.location_rules = {
|
||||||
|
# hq
|
||||||
|
"Money Wrench": self.can_shop,
|
||||||
# ninja village
|
# ninja village
|
||||||
"Ninja Village Seal - Tree House":
|
"Ninja Village Seal - Tree House":
|
||||||
self.has_dart,
|
self.has_dart,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
from BaseClasses import CollectionState
|
||||||
from . import MessengerTestBase
|
from . import MessengerTestBase
|
||||||
from ..shop import SHOP_ITEMS, FIGURINES
|
from ..shop import SHOP_ITEMS, FIGURINES
|
||||||
|
|
||||||
|
@ -89,3 +90,15 @@ class PlandoTest(MessengerTestBase):
|
||||||
|
|
||||||
self.assertTrue(loc in FIGURINES)
|
self.assertTrue(loc in FIGURINES)
|
||||||
self.assertEqual(len(figures), len(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))
|
||||||
|
|
Loading…
Reference in New Issue