Skip to content

Commit

Permalink
Remove weaponless terran units from Weapon/Armor groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Oct 25, 2024
1 parent 49149e9 commit 03441f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
6 changes: 3 additions & 3 deletions worlds/sc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ def create_items(self):
# Tell the logic which unit classes are used for required W/A upgrades
used_item_names: Set[str] = {item.name for item in item_list}
used_item_names = used_item_names.union(item.name for item in self.multiworld.itempool if item.player == self.player)
if used_item_names.isdisjoint(item_groups.barracks_units):
if used_item_names.isdisjoint(item_groups.barracks_wa_group):
self.has_barracks_unit = False
if used_item_names.isdisjoint(item_groups.factory_units):
if used_item_names.isdisjoint(item_groups.factory_wa_group):
self.has_factory_unit = False
if used_item_names.isdisjoint(item_groups.starport_units):
if used_item_names.isdisjoint(item_groups.starport_wa_group):
self.has_starport_unit = False
if used_item_names.isdisjoint(item_groups.zerg_melee_wa):
self.has_zerg_melee_unit = False
Expand Down
22 changes: 17 additions & 5 deletions worlds/sc2/item_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,30 @@ def get_all_group_names(cls) -> typing.Set[str]:
item_name for item_name, item_data in items.item_table.items()
if item_data.type == items.TerranItemType.Upgrade
]
item_name_groups[ItemGroupNames.BARRACKS_UNITS] = barracks_units = [
item_names.MARINE, item_names.MEDIC, item_names.FIREBAT, item_names.MARAUDER,
barracks_wa_group = [
item_names.MARINE, item_names.FIREBAT, item_names.MARAUDER,
item_names.REAPER, item_names.GHOST, item_names.SPECTRE, item_names.HERC, item_names.AEGIS_GUARD,
item_names.EMPERORS_SHADOW, item_names.DOMINION_TROOPER, item_names.SON_OF_KORHAL,
item_names.FIELD_RESPONSE_THETA,
]
item_name_groups[ItemGroupNames.FACTORY_UNITS] = factory_units = [
item_name_groups[ItemGroupNames.BARRACKS_UNITS] = barracks_units = (barracks_wa_group + [
item_names.MEDIC,
item_names.FIELD_RESPONSE_THETA,
])
factory_wa_group = [
item_names.HELLION, item_names.VULTURE, item_names.GOLIATH, item_names.DIAMONDBACK,
item_names.SIEGE_TANK, item_names.THOR, item_names.PREDATOR, item_names.WIDOW_MINE,
item_names.SIEGE_TANK, item_names.THOR, item_names.PREDATOR,
item_names.CYCLONE, item_names.WARHOUND, item_names.SHOCK_DIVISION, item_names.BLACKHAMMER,
item_names.BULWARK_COMPANY,
]
item_name_groups[ItemGroupNames.FACTORY_UNITS] = factory_units = (factory_wa_group + [
item_names.WIDOW_MINE,
])
starport_wa_group = [
item_names.WRAITH, item_names.VIKING, item_names.BANSHEE,
item_names.BATTLECRUISER, item_names.RAVEN_HUNTER_SEEKER_WEAPON,
item_names.LIBERATOR, item_names.VALKYRIE, item_names.PRIDE_OF_AUGUSTRGRAD, item_names.SKY_FURY,
item_names.EMPERORS_GUARDIAN, item_names.NIGHT_HAWK, item_names.NIGHT_WOLF,
]
item_name_groups[ItemGroupNames.STARPORT_UNITS] = starport_units = [
item_names.MEDIVAC, item_names.WRAITH, item_names.VIKING, item_names.BANSHEE,
item_names.BATTLECRUISER, item_names.HERCULES, item_names.SCIENCE_VESSEL, item_names.RAVEN,
Expand Down

0 comments on commit 03441f0

Please sign in to comment.