Skip to content

Commit

Permalink
Some bugfixes to the item filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Jun 9, 2024
1 parent 018d530 commit 0883a21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions worlds/sc2/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,9 @@ def get_basic_units(world: 'SC2World', race: SC2Race) -> typing.Set[str]:
item_names.MICRO_FILTERING,
item_names.AUTOMATED_REFINERY,
item_names.COMMAND_CENTER_COMMAND_CENTER_REACTOR,
item_names.COMMAND_CENTER_SCANNER_SWEEP,
item_names.COMMAND_CENTER_MULE,
item_names.COMMAND_CENTER_EXTRA_SUPPLIES,
item_names.TECH_REACTOR,
item_names.CELLULAR_REACTOR,
item_names.PROGRESSIVE_REGENERATIVE_BIO_STEEL, # Place only L1
Expand Down
11 changes: 9 additions & 2 deletions worlds/sc2/pool_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,17 @@ def attempt_removal(item: Item) -> bool:
if not {item_names.MEDIVAC, item_names.HERCULES} & logical_inventory_set:
inventory = [item for item in inventory if item.name != item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK]
unused_items = [item_name for item_name in unused_items if item_name != item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK]
locked_items = [item for item in locked_items if item.name != item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK]
if item_names.MEDIVAC not in logical_inventory_set:
# Don't allow L2 Siege Tank Transport Hook without Medivac
inventory_transport_hooks = [item for item in inventory if item.name == item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK]
inventory_transport_hooks = [item for item in (inventory + locked_items) if item.name == item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK]
if len(inventory_transport_hooks) > 1:
inventory.remove(inventory_transport_hooks[0])
if inventory_transport_hooks[0] in inventory:
inventory.remove(inventory_transport_hooks[0])
elif inventory_transport_hooks[1] in inventory:
inventory.remove(inventory_transport_hooks[0])
else:
locked_items.remove(inventory_transport_hooks[0])
if len(inventory_transport_hooks) > 0:
# Transport Hook is in inventory, remove from unused_items
unused_items = [item_name for item_name in unused_items if item_name != item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK]
Expand All @@ -439,6 +445,7 @@ def attempt_removal(item: Item) -> bool:
# No orbital Command Spells
inventory = [item for item in inventory if item.name != item_names.PLANETARY_FORTRESS_ORBITAL_MODULE]
unused_items = [item_name for item_name in unused_items if item_name !=item_names.PLANETARY_FORTRESS_ORBITAL_MODULE]
locked_items = [item for item in inventory if item.name != item_names.PLANETARY_FORTRESS_ORBITAL_MODULE]

# HotS
# Baneling without sources => remove Baneling and upgrades
Expand Down

0 comments on commit 0883a21

Please sign in to comment.