Skip to content

Commit

Permalink
Merge branch 'sc2-next' of github.com:Ziktofel/Archipelago into sc2-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Jul 28, 2024
2 parents 6c15f71 + 8fb7982 commit d74a5f4
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 32 deletions.
1 change: 1 addition & 0 deletions worlds/sc2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,7 @@ def calculate_items(ctx: SC2Context) -> typing.Dict[SC2Race, typing.List[int]]:
# War council option
if not ctx.nerf_unit_baselines:
accumulators[SC2Race.PROTOSS][ProtossItemType.War_Council.flag_word] = (1 << 30) - 1
accumulators[SC2Race.PROTOSS][ProtossItemType.War_Council_2.flag_word] = (1 << 30) - 1

# Deprecated Orbital Command handling (Backwards compatibility):
if orbital_command_count > 0:
Expand Down
25 changes: 23 additions & 2 deletions worlds/sc2/item_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ def _ability_desc(unit_name_plural: str, ability_name: str, ability_description:
item_names.TEMPEST_TECTONIC_DESTABILIZERS: "Tempests deal increased damage to buildings.",
item_names.TEMPEST_QUANTIC_REACTOR: "Tempests deal increased damage to massive units.",
item_names.TEMPEST_GRAVITY_SLING: "Tempests gain +8 range against air targets.",
item_names.PHOENIX_MIRAGE_IONIC_WAVELENGTH_FLUX: "Increases Phoenix and Mirage weapon damage by +2.",
item_names.PHOENIX_MIRAGE_ANION_PULSE_CRYSTALS: "Increases Phoenix and Mirage range by +2.",
item_names.PHOENIX_CLASS_IONIC_WAVELENGTH_FLUX: "Increases Phoenix, Mirage, and Skirmisher weapon damage by +2.",
item_names.PHOENIX_CLASS_ANION_PULSE_CRYSTALS: "Increases Phoenix, Mirage, and Skirmiser range by +2.",
item_names.CORSAIR_STEALTH_DRIVE: "Corsairs become permanently cloaked.",
item_names.CORSAIR_ARGUS_JEWEL: "Corsairs can store 2 charges of disruption web.",
item_names.CORSAIR_SUSTAINING_DISRUPTION: "Corsair disruption webs last longer.",
Expand Down Expand Up @@ -870,7 +870,28 @@ def _ability_desc(unit_name_plural: str, ability_name: str, ability_description:
item_names.ENERGIZER_MOBILE_CHRONO_BEAM: "Energizer War Council upgrade. Allows Energizers to use Chrono Beam in Mobile Mode.",
item_names.HAVOC_ENDURING_SIGHT: "Havoc War Council upgrade. Havoc Squad Sight stays up indefinitely and no longer takes energy.",
item_names.HIGH_TEMPLAR_PLASMA_SURGE: "High Templar War Council upgrade. High Templar Psionic Storm will heal fiendly protoss shields under it.",
# Signifier
# Ascendant
item_names.DARK_ARCHON_INDOMITABLE_WILL: "Dark Archon War Council upgrade. Casting Mind Control will no longer deplete the Dark Archon's shields.",
# Immortal
# Annihilator
item_names.VANGUARD_RAPIDFIRE_CANNON: "Vanguard War Council upgrade. Vanguards attack 38% faster.",
item_names.VANGUARD_FUSION_MORTARS: "Vanguard War Council upgrade. Vanguards deal +7 damage to armored targets per attack.",
# Stalwart
# Colossus
# Wrathwalker
# Reaver
# Disruptor
# Warp Prism
# Observer
# Phoenix
# Corsair
# Mirage
item_names.SKIRMISHER_PEER_CONTEMPT: "Skirmisher War Council upgrade. Allows Skirmishers to target air units.",
# Void Ray
# Destroyer
# Warp Ray
# Dawnbringer
item_names.SOA_CHRONO_SURGE: "The Spear of Adun increases a target structure's unit warp in and research speeds by +1000% for 20 seconds.",
item_names.SOA_PROGRESSIVE_PROXY_PYLON: inspect.cleandoc("""
Level 1: The Spear of Adun quickly warps in a Pylon to a target location.
Expand Down
15 changes: 12 additions & 3 deletions worlds/sc2/item_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@
TEMPEST_TECTONIC_DESTABILIZERS = "Tectonic Destabilizers (Tempest)"
TEMPEST_QUANTIC_REACTOR = "Quantic Reactor (Tempest)"
TEMPEST_GRAVITY_SLING = "Gravity Sling (Tempest)"
PHOENIX_MIRAGE_IONIC_WAVELENGTH_FLUX = "Ionic Wavelength Flux (Phoenix/Mirage)"
PHOENIX_MIRAGE_ANION_PULSE_CRYSTALS = "Anion Pulse-Crystals (Phoenix/Mirage)"
PHOENIX_CLASS_IONIC_WAVELENGTH_FLUX = "Ionic Wavelength Flux (Phoenix/Mirage/Skirmisher)"
PHOENIX_CLASS_ANION_PULSE_CRYSTALS = "Anion Pulse-Crystals (Phoenix/Mirage/Skirmisher)"
CORSAIR_STEALTH_DRIVE = "Stealth Drive (Corsair)"
CORSAIR_ARGUS_JEWEL = "Argus Jewel (Corsair)"
CORSAIR_SUSTAINING_DISRUPTION = "Sustaining Disruption (Corsair)"
Expand Down Expand Up @@ -709,14 +709,23 @@
DARK_ARCHON_INDOMITABLE_WILL = "Indomitable Will (Dark Archon)"
# IMMORTAL_IMPROVED_BARRIER = "Improved Barrier (Immortal)"
# Annihilator
# Vanguard
VANGUARD_RAPIDFIRE_CANNON = "Rapid-Fire Cannon (Vanguard)"
VANGUARD_FUSION_MORTARS = "Fusion Mortars (Vanguard)"
# Stalwart
# Colossus
# Wrathwalker
# Reaver
# Disruptor
# Warp Prism
# Observer
# Phoenix
# Corsair
# Mirage
SKIRMISHER_PEER_CONTEMPT = "Peer Contempt (Skirmisher)"
# Void Ray
# Destroyer
# Warp Ray
# Dawnbringer

# Spear Of Adun
SOA_CHRONO_SURGE = "Chrono Surge (Spear of Adun Calldown)"
Expand Down
30 changes: 20 additions & 10 deletions worlds/sc2/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class ProtossItemType(ItemTypeEnum):
Forge_3 = "Forge", 9
"""General Protoss unit upgrades"""
War_Council = "War Council", 10
War_Council_2 = "War Council", 11


class FactionlessItemType(ItemTypeEnum):
Expand Down Expand Up @@ -1657,8 +1658,8 @@ def get_full_item_list():
item_names.TEMPEST_TECTONIC_DESTABILIZERS: ItemData(316 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 16, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=item_names.TEMPEST),
item_names.TEMPEST_QUANTIC_REACTOR: ItemData(317 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 17, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=item_names.TEMPEST),
item_names.TEMPEST_GRAVITY_SLING: ItemData(318 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 18, SC2Race.PROTOSS, origin={"ext"}, parent_item=item_names.TEMPEST),
item_names.PHOENIX_MIRAGE_IONIC_WAVELENGTH_FLUX: ItemData(319 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 19, SC2Race.PROTOSS, origin={"ext"}),
item_names.PHOENIX_MIRAGE_ANION_PULSE_CRYSTALS: ItemData(320 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 20, SC2Race.PROTOSS, origin={"ext"}),
item_names.PHOENIX_CLASS_IONIC_WAVELENGTH_FLUX: ItemData(319 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 19, SC2Race.PROTOSS, origin={"ext"}),
item_names.PHOENIX_CLASS_ANION_PULSE_CRYSTALS: ItemData(320 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 20, SC2Race.PROTOSS, origin={"ext"}),
item_names.CORSAIR_STEALTH_DRIVE: ItemData(321 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 21, SC2Race.PROTOSS, origin={"ext"}, parent_item=item_names.CORSAIR),
item_names.CORSAIR_ARGUS_JEWEL: ItemData(322 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 22, SC2Race.PROTOSS, origin={"bw"}, parent_item=item_names.CORSAIR),
item_names.CORSAIR_SUSTAINING_DISRUPTION: ItemData(323 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_1, 23, SC2Race.PROTOSS, origin={"bw"}, parent_item=item_names.CORSAIR),
Expand Down Expand Up @@ -1752,14 +1753,23 @@ def get_full_item_list():
item_names.DARK_ARCHON_INDOMITABLE_WILL: ItemData(518 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council, 18, SC2Race.PROTOSS),
# 518 reserved for Immortal
# 519 reserved for Annihilator
# 520 reserved for Vanguard
# 521 reserved for Stalwart
# 522 reserved for Colossus
# 523 reserved for Wrathwalker
# 524 reserved for Reaver
# 525 reserved for Disruptor
# 526 reserved for Warp Prism
# 527 reserved for Observer
item_names.VANGUARD_RAPIDFIRE_CANNON: ItemData(520 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council, 20, SC2Race.PROTOSS, parent_item=item_names.VANGUARD),
item_names.VANGUARD_FUSION_MORTARS: ItemData(521 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council, 21, SC2Race.PROTOSS, parent_item=item_names.VANGUARD),
# 522 reserved for Stalwart
# 523 reserved for Colossus
# 524 reserved for Wrathwalker
# 525 reserved for Reaver
# 526 reserved for Disruptor
# 527 reserved for Warp Prism
# 528 reserved for Observer
# 530 reserved for Phoenix
# 531 reserved for Corsair
# 532 reserved for Mirage
item_names.SKIRMISHER_PEER_CONTEMPT: ItemData(533 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council_2, 3, SC2Race.PROTOSS, classification=ItemClassification.progression, parent_item=item_names.SKIRMISHER),
# 534 reserved for Void Ray
# 535 reserved for Destroyer
# 536 reserved for Warp Ray
# 537 reserved for Dawnbringer

# SoA Calldown powers
item_names.SOA_CHRONO_SURGE: ItemData(700 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Spear_Of_Adun, 0, SC2Race.PROTOSS, origin={"lotv"}),
Expand Down
1 change: 0 additions & 1 deletion worlds/sc2/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,6 @@ class StartingSupplyPerItem(Range):

@dataclass
class Starcraft2Options(PerGameCommonOptions):
selected_races: SelectRaces
game_difficulty: GameDifficulty
game_speed: GameSpeed
disable_forced_camera: DisableForcedCamera
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 @@ -509,9 +509,9 @@ def attempt_removal(item: Item) -> bool:
if not {item_names.STALKER, item_names.INSTIGATOR, item_names.SLAYER} & logical_inventory_set:
inventory = [item for item in inventory if not item.name.endswith("(Stalker/Instigator/Slayer)")]
unused_items = [item_name for item_name in unused_items if not item_name.endswith("(Stalker/Instigator/Slayer)")]
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.PHOENIX, item_names.MIRAGE, item_names.SKIRMISHER} & logical_inventory_set:
inventory = [item for item in inventory if not item.name.endswith("(Phoenix/Mirage/Skirmisher)")]
unused_items = [item_name for item_name in unused_items if not item_name.endswith("(Phoenix/Mirage/Skirmisher)")]
if not {item_names.VOID_RAY, item_names.DESTROYER, item_names.WARP_RAY, item_names.DAWNBRINGER} & logical_inventory_set:
inventory = [item for item in inventory if not item.name.endswith("(Void Ray/Destroyer/Warp Ray/Dawnbringer)")]
unused_items = [item_name for item_name in unused_items if not item_name.endswith("(Void Ray/Destroyer/Warp Ray/Dawnbringer)")]
Expand Down
32 changes: 19 additions & 13 deletions worlds/sc2/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,28 +584,34 @@ def protoss_anti_armor_anti_air(self, state: CollectionState) -> bool:
and state.has(item_names.IMMORTAL_ANNIHILATOR_STALWART_ADVANCED_TARGETING_MECHANICS, self.player))

def protoss_anti_light_anti_air(self, state: CollectionState) -> bool:
return self.protoss_competent_anti_air(state) \
return (
self.protoss_competent_anti_air(state)
or state.has_any({
item_names.PHOENIX, item_names.MIRAGE, item_names.SKIRMISHER, item_names.CORSAIR, item_names.CARRIER,
item_names.PHOENIX, item_names.MIRAGE, item_names.CORSAIR, item_names.CARRIER,
}, self.player)
or state.has_all((item_names.SKIRMISHER, item_names.SKIRMISHER_PEER_CONTEMPT), self.player)
)

def protoss_competent_anti_air(self, state: CollectionState) -> bool:
return state.has_any({
item_names.STALKER, item_names.SLAYER, item_names.INSTIGATOR, item_names.DRAGOON, item_names.ADEPT,
item_names.VOID_RAY, item_names.DESTROYER, item_names.TEMPEST, item_names.SKYLORD, item_names.PURGER
}, self.player) \
or (
return (
state.has_any({
item_names.STALKER, item_names.SLAYER, item_names.INSTIGATOR, item_names.DRAGOON, item_names.ADEPT,
item_names.VOID_RAY, item_names.DESTROYER, item_names.TEMPEST, item_names.SKYLORD, item_names.PURGER
}, self.player)
or ((
state.has_any({
item_names.PHOENIX, item_names.MIRAGE, item_names.SKIRMISHER,
item_names.CORSAIR, item_names.CARRIER,
}, self.player)
and state.has_any({
item_names.SCOUT, item_names.WRATHWALKER, item_names.WARP_RAY
item_names.PHOENIX, item_names.MIRAGE, item_names.CORSAIR, item_names.CARRIER,
}, self.player)
) \
or state.has_all((item_names.SKIRMISHER, item_names.SKIRMISHER_PEER_CONTEMPT), self.player)
)
and state.has_any({
item_names.SCOUT, item_names.WRATHWALKER, item_names.WARP_RAY
}, self.player)
)
or (self.advanced_tactics
and 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))
)

def protoss_has_blink(self, state: CollectionState) -> bool:
return state.has_any({item_names.STALKER, item_names.INSTIGATOR, item_names.SLAYER}, self.player) \
Expand Down

0 comments on commit d74a5f4

Please sign in to comment.