Skip to content

Commit

Permalink
Add Scorcher unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Jul 4, 2024
1 parent 3bdb100 commit a0b942c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions worlds/sc2/item_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def get_all_group_names(cls) -> typing.Set[str]:
]
item_name_groups[ItemGroupNames.STARGATE_UNITS] = stargate_units = [
item_names.PHOENIX, item_names.MIRAGE, item_names.CORSAIR,
item_names.VOID_RAY, item_names.DESTROYER, item_names.WARP_RAY,
item_names.VOID_RAY, item_names.DESTROYER, item_names.WARP_RAY, item_names.SCORCHER,
item_names.CARRIER,
item_names.TEMPEST, item_names.SCOUT, item_names.MOTHERSHIP,
item_names.ARBITER, item_names.ORACLE,
Expand All @@ -559,7 +559,7 @@ def get_all_group_names(cls) -> typing.Set[str]:
item_name_groups[ItemGroupNames.PURIFIER_UNITS] = [
item_names.SENTINEL, item_names.ADEPT, item_names.INSTIGATOR, item_names.ENERGIZER,
item_names.STALWART, item_names.COLOSSUS, item_names.DISRUPTOR,
item_names.MIRAGE, item_names.TEMPEST,
item_names.MIRAGE, item_names.SCORCHER, item_names.TEMPEST,
]
item_name_groups[ItemGroupNames.SOA_ITEMS] = soa_items = [
*[item_name for item_name, item_data in items.item_table.items() if item_data.type == items.ProtossItemType.Spear_Of_Adun],
Expand Down
3 changes: 2 additions & 1 deletion worlds/sc2/item_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@
CORSAIR = "Corsair"
DESTROYER = "Destroyer"
WARP_RAY = "Warp Ray"
SCORCHER = "Scorcher"
SCOUT = "Scout"
TEMPEST = "Tempest"
MOTHERSHIP = "Mothership"
Expand Down Expand Up @@ -627,7 +628,7 @@
ARBITER_ENHANCED_CLOAK_FIELD = "Enhanced Cloak Field (Arbiter)"
CARRIER_GRAVITON_CATAPULT = "Graviton Catapult (Carrier)"
CARRIER_HULL_OF_PAST_GLORIES = "Hull of Past Glories (Carrier)"
VOID_RAY_DESTROYER_WARP_RAY_FLUX_VANES = "Flux Vanes (Void Ray/Destroyer/Warp Ray)"
VOID_RAY_DESTROYER_WARP_RAY_SCORCHER_FLUX_VANES = "Flux Vanes (Void Ray/Destroyer/Warp Ray/Scorcher)"
DESTROYER_REFORGED_BLOODSHARD_CORE = "Reforged Bloodshard Core (Destroyer)"
WARP_PRISM_GRAVITIC_DRIVE = "Gravitic Drive (Warp Prism)"
WARP_PRISM_PHASE_BLASTER = "Phase Blaster (Warp Prism)"
Expand Down
3 changes: 3 additions & 0 deletions worlds/sc2/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,9 @@ def get_full_item_list():
item_names.WARP_RAY:
ItemData(31 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Unit_2, 10, SC2Race.PROTOSS,
classification=ItemClassification.progression, origin={"wol"}),
item_names.SCORCHER:
ItemData(32 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Unit_2, 11, SC2Race.PROTOSS,
classification=ItemClassification.progression, origin={"ext"}),

# Protoss Upgrades
item_names.PROGRESSIVE_PROTOSS_GROUND_WEAPON: ItemData(100 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Upgrade, 0, SC2Race.PROTOSS, quantity=WEAPON_ARMOR_UPGRADE_MAX_LEVEL, origin={"wol", "lotv"}),
Expand Down
6 changes: 3 additions & 3 deletions worlds/sc2/pool_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ def attempt_removal(item: Item) -> bool:
if not {item_names.PHOENIX, item_names.MIRAGE} & logical_inventory_set:
inventory = [item for item in inventory if not item.name.endswith("(Phoenix/Mirage)")]
unused_items = [item_name for item_name in unused_items if not item_name.endswith("(Phoenix/Mirage)")]
if not {item_names.VOID_RAY, item_names.DESTROYER, item_names.WARP_RAY} & logical_inventory_set:
inventory = [item for item in inventory if not item.name.endswith("(Void Ray/Destroyer/Warp Ray)")]
unused_items = [item_name for item_name in unused_items if not item_name.endswith("(Void Ray/Destroyer/Warp Ray)")]
if not {item_names.VOID_RAY, item_names.DESTROYER, item_names.WARP_RAY, item_names.SCORCHER} & logical_inventory_set:
inventory = [item for item in inventory if not item.name.endswith("(Void Ray/Destroyer/Warp Ray/Scorcher)")]
unused_items = [item_name for item_name in unused_items if not item_name.endswith("(Void Ray/Destroyer/Warp Ray/Scorcher)")]
if not {item_names.IMMORTAL, item_names.ANNIHILATOR, item_names.STALWART} & logical_inventory_set:
inventory = [item for item in inventory if not item.name.endswith("(Immortal/Annihilator/Stalwart)")]
unused_items = [item_name for item_name in unused_items if not item_name.endswith("(Immortal/Annihilator/Stalwart)")]
Expand Down
14 changes: 9 additions & 5 deletions worlds/sc2/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def protoss_basic_anti_air(self, state: CollectionState) -> bool:

def protoss_anti_armor_anti_air(self, state: CollectionState) -> bool:
return self.protoss_competent_anti_air(state) \
or state.has_any({item_names.SCOUT, item_names.WRATHWALKER, item_names.WARP_RAY}, self.player) \
or state.has_any({item_names.SCOUT, item_names.WRATHWALKER, item_names.WARP_RAY, item_names.SCORCHER}, self.player) \
or (state.has_any({item_names.IMMORTAL, item_names.ANNIHILATOR, item_names.STALWART}, self.player)
and state.has(item_names.IMMORTAL_ANNIHILATOR_STALWART_ADVANCED_TARGETING_MECHANICS, self.player))

Expand All @@ -512,17 +512,21 @@ def protoss_has_blink(self, state: CollectionState) -> bool:
)

def protoss_can_attack_behind_chasm(self, state: CollectionState) -> bool:
return state.has_any(
{item_names.SCOUT, item_names.TEMPEST,
item_names.CARRIER, item_names.VOID_RAY, item_names.DESTROYER, item_names.MOTHERSHIP}, self.player) \
return state.has_any({
item_names.SCOUT, item_names.TEMPEST, item_names.CARRIER, item_names.VOID_RAY, item_names.DESTROYER,
item_names.WARP_RAY, item_names.SCORCHER, item_names.MOTHERSHIP
}, self.player) \
or self.protoss_has_blink(state) \
or (state.has(item_names.WARP_PRISM, self.player)
and (self.protoss_common_unit(state) or state.has(item_names.WARP_PRISM_PHASE_BLASTER, self.player))) \
or (self.advanced_tactics
and state.has_any({item_names.ORACLE, item_names.ARBITER}, self.player))

def protoss_fleet(self, state: CollectionState) -> bool:
return state.has_any({item_names.CARRIER, item_names.TEMPEST, item_names.VOID_RAY, item_names.DESTROYER}, self.player)
return state.has_any({
item_names.CARRIER, item_names.TEMPEST, item_names.VOID_RAY, item_names.DESTROYER, item_names.WARP_RAY,
item_names.SCORCHER
}, self.player)

def templars_return_requirement(self, state: CollectionState) -> bool:
return self.story_tech_granted \
Expand Down

0 comments on commit a0b942c

Please sign in to comment.