Skip to content

Commit

Permalink
Merge pull request #348 from MatthewMarinets/mm/zerg_maw_logic_adjust…
Browse files Browse the repository at this point in the history
…ment

sc2: Slightly loosened zerg maw requirement to cross the gap
  • Loading branch information
Ziktofel authored Nov 23, 2024
2 parents 8dada22 + 2d34ba8 commit a370ca3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
4 changes: 2 additions & 2 deletions worlds/sc2/item/item_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ def get_full_item_list():
classification=ItemClassification.progression),
item_names.ECHIDNA_WORM:
ItemData(19 + SC2HOTS_ITEM_ID_OFFSET, ZergItemType.Unit, 18, SC2Race.ZERG,
classification=ItemClassification.useful),
classification=ItemClassification.progression),
item_names.INFESTED_SIEGE_TANK:
ItemData(20 + SC2HOTS_ITEM_ID_OFFSET, ZergItemType.Unit, 19, SC2Race.ZERG,
classification=ItemClassification.progression),
Expand Down Expand Up @@ -1595,7 +1595,7 @@ def get_full_item_list():
item_names.HUNTER_KILLERS: ItemData(604 + SC2HOTS_ITEM_ID_OFFSET, ZergItemType.Mercenary, 4, SC2Race.ZERG),
item_names.TORRASQUE_MERC: ItemData(605 + SC2HOTS_ITEM_ID_OFFSET, ZergItemType.Mercenary, 5, SC2Race.ZERG),
item_names.HUNTERLING: ItemData(606 + SC2HOTS_ITEM_ID_OFFSET, ZergItemType.Mercenary, 6, SC2Race.ZERG, classification=ItemClassification.progression),
item_names.YGGDRASIL: ItemData(607 + SC2HOTS_ITEM_ID_OFFSET, ZergItemType.Mercenary, 7, SC2Race.ZERG),
item_names.YGGDRASIL: ItemData(607 + SC2HOTS_ITEM_ID_OFFSET, ZergItemType.Mercenary, 7, SC2Race.ZERG, classification=ItemClassification.progression),


# Misc Upgrades
Expand Down
55 changes: 28 additions & 27 deletions worlds/sc2/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,58 +528,59 @@ def terran_survives_rip_field(self, state: CollectionState) -> bool:
def zerg_maw_requirement(self, state: CollectionState) -> bool:
"""
Ability to cross defended gaps, deal with skytoss, and avoid costly losses.
:param state:
:return:
"""
return (
state.has(item_names.SWARM_QUEEN, self.player)
and (state.has(item_names.NYDUS_WORM, self.player)
or (self.advanced_tactics and state.has(item_names.OVERLORD_VENTRAL_SACS, self.player)))
# Cross the gap
and (state.has_any((item_names.NYDUS_WORM, item_names.OVERLORD_VENTRAL_SACS), self.player)
or (self.advanced_tactics and state.has(item_names.YGGDRASIL, self.player)))
# Air to ground
and (self.morph_brood_lord(state) or self.morph_guardian(state))
# Ground to air
and (
state.has(item_names.INFESTOR, self.player)
or self.morph_tyrannozor(state)
or state.has_all({item_names.SWARM_HOST, item_names.SWARM_HOST_RESOURCE_EFFICIENCY, item_names.SWARM_HOST_PRESSURIZED_GLANDS}, self.player)
or state.has_all({item_names.HYDRALISK, item_names.HYDRALISK_RESOURCE_EFFICIENCY}, self.player)
or state.has_all({item_names.INFESTED_DIAMONDBACK, item_names.INFESTED_DIAMONDBACK_PROGRESSIVE_FUNGAL_SNARE}, self.player)
)
state.has(item_names.INFESTOR, self.player)
or self.morph_tyrannozor(state)
or state.has_all({item_names.SWARM_HOST, item_names.SWARM_HOST_RESOURCE_EFFICIENCY, item_names.SWARM_HOST_PRESSURIZED_GLANDS}, self.player)
or state.has_all({item_names.HYDRALISK, item_names.HYDRALISK_RESOURCE_EFFICIENCY}, self.player)
or state.has_all({item_names.INFESTED_DIAMONDBACK, item_names.INFESTED_DIAMONDBACK_PROGRESSIVE_FUNGAL_SNARE}, self.player)
)
# Survives rip-field
and (state.has_any({item_names.ABERRATION, item_names.ROACH, item_names.ULTRALISK}, self.player)
or self.morph_tyrannozor(state))
# Air-to-air
and (state.has_any({item_names.MUTALISK, item_names.CORRUPTOR, item_names.INFESTED_LIBERATOR, item_names.BROOD_QUEEN}, self.player))
# Upgrades / general
and self.zerg_competent_comp(state)
)

def protoss_maw_requirement(self, state: CollectionState) -> bool:
"""
Ability to cross defended gaps and deal with skytoss.
:param state:
:return:
"""
return (
(state.has(item_names.WARP_PRISM, self.player)
or (self.advanced_tactics and state.has(item_names.ARBITER, self.player))
)
and self.protoss_common_unit_anti_armor_air(state)
and self.protoss_fleet(state)
(
state.has(item_names.WARP_PRISM, self.player)
or (self.advanced_tactics and state.has(item_names.ARBITER, self.player))
)
and self.protoss_common_unit_anti_armor_air(state)
and self.protoss_fleet(state)
)

def terran_sustainable_mech_heal(self, state: CollectionState) -> bool:
"""
Can heal mech units without spending resources
:param state:
:return:
"""
return (
state.has(item_names.SCIENCE_VESSEL, self.player)
or (
state.has_any({item_names.MEDIC, item_names.FIELD_RESPONSE_THETA}, self.player)
and state.has(item_names.MEDIC_ADAPTIVE_MEDPACKS, self.player)
state.has(item_names.SCIENCE_VESSEL, self.player)
or (
state.has_any({item_names.MEDIC, item_names.FIELD_RESPONSE_THETA}, self.player)
and state.has(item_names.MEDIC_ADAPTIVE_MEDPACKS, self.player)
)
or state.count(item_names.PROGRESSIVE_REGENERATIVE_BIO_STEEL, self.player) >= 3
or (self.advanced_tactics
or state.count(item_names.PROGRESSIVE_REGENERATIVE_BIO_STEEL, self.player) >= 3
or (self.advanced_tactics
and (
state.has_all({item_names.RAVEN, item_names.RAVEN_BIO_MECHANICAL_REPAIR_DRONE}, self.player)
or state.count(item_names.PROGRESSIVE_REGENERATIVE_BIO_STEEL, self.player) >= 2
state.has_all({item_names.RAVEN, item_names.RAVEN_BIO_MECHANICAL_REPAIR_DRONE}, self.player)
or state.count(item_names.PROGRESSIVE_REGENERATIVE_BIO_STEEL, self.player) >= 2
)
)
)
Expand Down

0 comments on commit a370ca3

Please sign in to comment.