SC2: Allowing unexcluded_items to affect items excluded by vanilla_items_only (#5520)

This commit is contained in:
Phaneros
2025-11-14 17:09:57 -08:00
committed by GitHub
parent a2f8877810
commit d7eb95a2ee
2 changed files with 58 additions and 21 deletions

View File

@@ -325,6 +325,53 @@ class TestItemFiltering(Sc2SetupTestBase):
if item_data.quantity == 0:
continue
self.assertIn(item_name, item_groups.vanilla_items + item_groups.nova_equipment)
def test_vanilla_items_only_can_unexclude_items(self) -> None:
world_options = {
# Ensuring an excess of locations so expected items don't get culled
**self.ALL_CAMPAIGNS,
'mission_order': options.MissionOrder.option_grid,
'maximum_campaign_size': options.MaximumCampaignSize.range_end,
'enable_race_swap': options.EnableRaceSwapVariants.option_shuffle_all,
'selected_races': {SC2Race.TERRAN.get_title()},
# Options under test
'vanilla_items_only': True,
'unexcluded_items': {
item_names.PROGRESSIVE_FIRE_SUPPRESSION_SYSTEM: 0,
item_names.WARHOUND: 1,
item_groups.ItemGroupNames.TERRAN_STIMPACKS: 0,
},
# Avoid options that lock non-vanilla items for logic
'required_tactics': options.RequiredTactics.option_any_units,
'mastery_locations': options.MasteryLocations.option_disabled,
# Move the unit nerf items from the start inventory to the pool,
# else this option could push non-vanilla items past this test
'war_council_nerfs': True,
}
self.generate_world(world_options)
world_items = [item.name for item in self.multiworld.itempool]
self.assertTrue(world_items)
self.assertNotIn(item_names.MARAUDER_MAGRAIL_MUNITIONS, world_items)
self.assertEqual(world_items.count(item_names.PROGRESSIVE_FIRE_SUPPRESSION_SYSTEM), 2)
self.assertIn(item_names.WARHOUND, world_items)
self.assertIn(item_names.MARAUDER_PROGRESSIVE_STIMPACK, world_items)
self.assertIn(item_names.REAPER_PROGRESSIVE_STIMPACK, world_items)
def test_vanilla_items_only_and_exclude_op_items_together_allow_one_level_of_regen_biosteel(self) -> None:
world_options = {
# Ensuring an excess of locations so expected items don't get culled
**self.ALL_CAMPAIGNS,
'mission_order': options.MissionOrder.option_grid,
'maximum_campaign_size': options.MaximumCampaignSize.range_end,
'enable_race_swap': options.EnableRaceSwapVariants.option_shuffle_all,
'selected_races': {SC2Race.TERRAN.get_title()},
# Options under test
'vanilla_items_only': True,
'exclude_overpowered_items': True,
}
self.generate_world(world_options)
world_items = [item.name for item in self.multiworld.itempool]
self.assertEqual(world_items.count(item_names.PROGRESSIVE_REGENERATIVE_BIO_STEEL), 1)
def test_evil_awoken_with_vanilla_items_only_generates(self) -> None:
world_options = {