Skip to content

Commit

Permalink
Add The Spear of Adun race swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Nov 24, 2024
1 parent f8208d3 commit 29aed40
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
49 changes: 49 additions & 0 deletions worlds/sc2/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4491,6 +4491,55 @@ def get_locations(world: Optional['SC2World']) -> Tuple[LocationData, ...]:
logic.zerg_common_unit(state)
and logic.zerg_basic_kerriganless_anti_air(state)
)),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "Victory", SC2_RACESWAP_LOC_ID_OFFSET + 10900, LocationType.VICTORY,
logic.terran_spear_of_adun_requirement
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "Elite Barracks", SC2_RACESWAP_LOC_ID_OFFSET + 10901, LocationType.VANILLA),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "Elite Factory", SC2_RACESWAP_LOC_ID_OFFSET + 10902, LocationType.VANILLA,
logic.terran_spear_of_adun_requirement
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "Elite Starport", SC2_RACESWAP_LOC_ID_OFFSET + 10903, LocationType.VANILLA,
logic.terran_spear_of_adun_requirement
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "North Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 10904, LocationType.EXTRA,
logic.terran_spear_of_adun_requirement
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "East Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 10905, LocationType.EXTRA,
logic.terran_spear_of_adun_requirement
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "South Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 10906, LocationType.EXTRA,
logic.terran_spear_of_adun_requirement
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_T.mission_name, "Southeast Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 10907, LocationType.EXTRA,
logic.terran_spear_of_adun_requirement
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "Victory", SC2_RACESWAP_LOC_ID_OFFSET + 11000, LocationType.VICTORY,
logic.zerg_competent_comp_competent_aa
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "Baneling Nest", SC2_RACESWAP_LOC_ID_OFFSET + 11001, LocationType.VANILLA),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "Roach Warren", SC2_RACESWAP_LOC_ID_OFFSET + 11002, LocationType.VANILLA,
lambda state: (
logic.zerg_competent_comp_competent_aa(state)
and logic.spread_creep(state)
)),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "Infestation Pit", SC2_RACESWAP_LOC_ID_OFFSET + 11003, LocationType.VANILLA,
lambda state: (
logic.zerg_competent_comp_competent_aa(state)
and logic.spread_creep(state)
)
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "North Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 11004, LocationType.EXTRA,
logic.zerg_competent_comp_competent_aa
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "East Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 11005, LocationType.EXTRA,
logic.zerg_competent_comp_competent_aa
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "South Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 11006, LocationType.EXTRA,
logic.zerg_competent_comp_competent_aa
),
make_location_data(SC2Mission.THE_SPEAR_OF_ADUN_Z.mission_name, "Southeast Power Cell", SC2_RACESWAP_LOC_ID_OFFSET + 11007, LocationType.EXTRA,
logic.zerg_competent_comp_competent_aa
),
]

beat_events = []
Expand Down
5 changes: 3 additions & 2 deletions worlds/sc2/mission_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __init__(self, mission_id: int, name: str, campaign: SC2Campaign, area: str,
# LotV
FOR_AIUR = 53, "For Aiur!", SC2Campaign.LOTV, "Aiur", SC2Race.ANY, MissionPools.STARTER, "ap_for_aiur", MissionFlag.Protoss|MissionFlag.NoBuild|MissionFlag.VsZerg
THE_GROWING_SHADOW = 54, "The Growing Shadow (Protoss)", SC2Campaign.LOTV, "Aiur", SC2Race.PROTOSS, MissionPools.EASY, "ap_the_growing_shadow", MissionFlag.Protoss|MissionFlag.VsPZ|MissionFlag.HasRaceSwap
THE_SPEAR_OF_ADUN = 55, "The Spear of Adun", SC2Campaign.LOTV, "Aiur", SC2Race.PROTOSS, MissionPools.EASY, "ap_the_spear_of_adun", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.VsPZ
THE_SPEAR_OF_ADUN = 55, "The Spear of Adun (Protoss)", SC2Campaign.LOTV, "Aiur", SC2Race.PROTOSS, MissionPools.EASY, "ap_the_spear_of_adun", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.VsPZ|MissionFlag.HasRaceSwap
SKY_SHIELD = 56, "Sky Shield", SC2Campaign.LOTV, "Korhal", SC2Race.PROTOSS, MissionPools.EASY, "ap_sky_shield", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.Countdown|MissionFlag.VsTerran|MissionFlag.AiTerranAlly
BROTHERS_IN_ARMS = 57, "Brothers in Arms", SC2Campaign.LOTV, "Korhal", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_brothers_in_arms", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.VsTerran|MissionFlag.AiTerranAlly
AMON_S_REACH = 58, "Amon's Reach", SC2Campaign.LOTV, "Shakuras", SC2Race.PROTOSS, MissionPools.EASY, "ap_amon_s_reach", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.VsZerg
Expand Down Expand Up @@ -285,7 +285,8 @@ def __init__(self, mission_id: int, name: str, campaign: SC2Campaign, area: str,
# 188/189 - For Aiur!
THE_GROWING_SHADOW_T = 190, "The Growing Shadow (Terran)", SC2Campaign.LOTV, "Aiur", SC2Race.TERRAN, MissionPools.EASY, "ap_the_growing_shadow", MissionFlag.Terran|MissionFlag.VsPZ|MissionFlag.RaceSwap
THE_GROWING_SHADOW_Z = 191, "The Growing Shadow (Zerg)", SC2Campaign.LOTV, "Aiur", SC2Race.ZERG, MissionPools.EASY, "ap_the_growing_shadow", MissionFlag.Zerg|MissionFlag.VsPZ|MissionFlag.RaceSwap
# 192/193 - The Spear of Adun
THE_SPEAR_OF_ADUN_T = 192, "The Spear of Adun (Terran)", SC2Campaign.LOTV, "Aiur", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_the_spear_of_adun", MissionFlag.Terran|MissionFlag.VsPZ|MissionFlag.RaceSwap
THE_SPEAR_OF_ADUN_Z = 193, "The Spear of Adun (Zerg)", SC2Campaign.LOTV, "Aiur", SC2Race.ZERG, MissionPools.MEDIUM, "ap_the_spear_of_adun", MissionFlag.Zerg|MissionFlag.VsPZ|MissionFlag.RaceSwap
# 194/195 - Sky Shield
# 196/197 - Brothers in Arms
# 198/199 - Amon's Reach
Expand Down
8 changes: 8 additions & 0 deletions worlds/sc2/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,14 @@ def templars_return_phase_3_reach_dts_requirement(self, state: CollectionState)
)
)

def terran_spear_of_adun_requirement(self, state: CollectionState) -> bool:
return (
self.terran_common_unit(state)
and self.terran_competent_anti_air(state)
and self.terran_defense_rating(state, False, False) >= 5
and self.terran_defense_rating(state, True, False) >= 5
)

def brothers_in_arms_requirement(self, state: CollectionState) -> bool:
return (
self.protoss_common_unit(state)
Expand Down

0 comments on commit 29aed40

Please sign in to comment.