The Messenger: strip generated filler items for a sufficiently small pool (#1907)
* The Messenger: strip generated filler items for a sufficiently small remaining item pool * rewrite the test for the small chance there's no large currency shards
This commit is contained in:
parent
85582b9458
commit
3fba94f000
|
@ -49,17 +49,14 @@ class MessengerWorld(World):
|
||||||
base_offset = 0xADD_000
|
base_offset = 0xADD_000
|
||||||
item_name_to_id = {item: item_id
|
item_name_to_id = {item: item_id
|
||||||
for item_id, item in enumerate(ALL_ITEMS, base_offset)}
|
for item_id, item in enumerate(ALL_ITEMS, base_offset)}
|
||||||
seal_locs = [seal for seals in SEALS.values() for seal in seals]
|
|
||||||
mega_shard_locs = [shard for shards in MEGA_SHARDS.values() for shard in shards]
|
|
||||||
shop_locs = [f"The Shop - {shop_loc}" for shop_loc in SHOP_ITEMS]
|
|
||||||
location_name_to_id = {location: location_id
|
location_name_to_id = {location: location_id
|
||||||
for location_id, location in
|
for location_id, location in
|
||||||
enumerate([
|
enumerate([
|
||||||
*ALWAYS_LOCATIONS,
|
*ALWAYS_LOCATIONS,
|
||||||
*seal_locs,
|
*[seal for seals in SEALS.values() for seal in seals],
|
||||||
*mega_shard_locs,
|
*[shard for shards in MEGA_SHARDS.values() for shard in shards],
|
||||||
*BOSS_LOCATIONS,
|
*BOSS_LOCATIONS,
|
||||||
*shop_locs,
|
*[f"The Shop - {shop_loc}" for shop_loc in SHOP_ITEMS],
|
||||||
*FIGURINES,
|
*FIGURINES,
|
||||||
"Money Wrench",
|
"Money Wrench",
|
||||||
], base_offset)}
|
], base_offset)}
|
||||||
|
@ -127,13 +124,15 @@ class MessengerWorld(World):
|
||||||
for i in range(self.required_seals):
|
for i in range(self.required_seals):
|
||||||
seals[i].classification = ItemClassification.progression_skip_balancing
|
seals[i].classification = ItemClassification.progression_skip_balancing
|
||||||
itempool += seals
|
itempool += seals
|
||||||
|
|
||||||
|
remaining_fill = len(self.multiworld.get_unfilled_locations(self.player)) - len(itempool)
|
||||||
|
filler_pool = dict(list(FILLER.items())[2:]) if remaining_fill < 10 else FILLER
|
||||||
itempool += [self.create_item(filler_item)
|
itempool += [self.create_item(filler_item)
|
||||||
for filler_item in
|
for filler_item in
|
||||||
self.multiworld.random.choices(
|
self.multiworld.random.choices(
|
||||||
list(FILLER),
|
list(filler_pool),
|
||||||
weights=list(FILLER.values()),
|
weights=list(filler_pool.values()),
|
||||||
k=len(self.multiworld.get_unfilled_locations(self.player)) - len(itempool)
|
k=remaining_fill
|
||||||
)]
|
)]
|
||||||
|
|
||||||
self.multiworld.itempool += itempool
|
self.multiworld.itempool += itempool
|
||||||
|
|
|
@ -16,6 +16,7 @@ class ShopCostTest(MessengerTestBase):
|
||||||
with self.subTest("has cost", loc=loc):
|
with self.subTest("has cost", loc=loc):
|
||||||
self.assertFalse(self.can_reach_location(loc))
|
self.assertFalse(self.can_reach_location(loc))
|
||||||
|
|
||||||
|
def testShopPrices(self) -> None:
|
||||||
prices: Dict[str, int] = self.multiworld.worlds[self.player].shop_prices
|
prices: Dict[str, int] = self.multiworld.worlds[self.player].shop_prices
|
||||||
for loc, price in prices.items():
|
for loc, price in prices.items():
|
||||||
with self.subTest("prices", loc=loc):
|
with self.subTest("prices", loc=loc):
|
||||||
|
@ -48,6 +49,15 @@ class ShopCostMinTest(ShopCostTest):
|
||||||
"shop_price": "random",
|
"shop_price": "random",
|
||||||
"shuffle_seals": "false",
|
"shuffle_seals": "false",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def testShopRules(self) -> None:
|
||||||
|
if self.multiworld.worlds[self.player].total_shards:
|
||||||
|
super().testShopRules()
|
||||||
|
else:
|
||||||
|
for loc in SHOP_ITEMS:
|
||||||
|
loc = f"The Shop - {loc}"
|
||||||
|
with self.subTest("has cost", loc=loc):
|
||||||
|
self.assertTrue(self.can_reach_location(loc))
|
||||||
|
|
||||||
def testDBoost(self) -> None:
|
def testDBoost(self) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue