Skip to content

Commit

Permalink
Add Harbinger of Oblivion race swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Nov 29, 2024
1 parent f6ea276 commit 698597e
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 10 deletions.
60 changes: 53 additions & 7 deletions worlds/sc2/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1808,27 +1808,27 @@ def get_locations(world: Optional['SC2World']) -> Tuple[LocationData, ...]:
logic.the_infinite_cycle_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "Victory", SC2LOTV_LOC_ID_OFFSET + 1400, LocationType.VICTORY,
logic.harbinger_of_oblivion_requirement
logic.protoss_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "Artanis", SC2LOTV_LOC_ID_OFFSET + 1401, LocationType.EXTRA),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "Northwest Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1402, LocationType.EXTRA,
logic.harbinger_of_oblivion_requirement
logic.protoss_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "Northeast Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1403, LocationType.EXTRA,
logic.harbinger_of_oblivion_requirement
logic.protoss_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "Southwest Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1404, LocationType.EXTRA,
logic.harbinger_of_oblivion_requirement
logic.protoss_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "Southeast Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1405, LocationType.EXTRA,
logic.harbinger_of_oblivion_requirement
logic.protoss_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "South Xel'Naga Vessel", SC2LOTV_LOC_ID_OFFSET + 1406, LocationType.VANILLA),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "Mid Xel'Naga Vessel", SC2LOTV_LOC_ID_OFFSET + 1407, LocationType.VANILLA,
logic.harbinger_of_oblivion_requirement
logic.protoss_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION.mission_name, "North Xel'Naga Vessel", SC2LOTV_LOC_ID_OFFSET + 1408, LocationType.VANILLA,
logic.harbinger_of_oblivion_requirement
logic.protoss_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.UNSEALING_THE_PAST.mission_name, "Victory", SC2LOTV_LOC_ID_OFFSET + 1500, LocationType.VICTORY,
lambda state: (
Expand Down Expand Up @@ -5136,6 +5136,52 @@ def get_locations(world: Optional['SC2World']) -> Tuple[LocationData, ...]:
make_location_data(SC2Mission.TEMPLE_OF_UNIFICATION_Z.mission_name, "Titanic Warp Prism", SC2_RACESWAP_LOC_ID_OFFSET + 12206, LocationType.VANILLA,
logic.zerg_temple_of_unification_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "Victory", SC2_RACESWAP_LOC_ID_OFFSET + 12500, LocationType.VICTORY,
logic.terran_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "Artanis", SC2_RACESWAP_LOC_ID_OFFSET + 12501, LocationType.EXTRA),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "Northwest Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12502, LocationType.EXTRA,
logic.terran_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "Northeast Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12503, LocationType.EXTRA,
logic.terran_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "Southwest Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12504, LocationType.EXTRA,
logic.terran_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "Southeast Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12505, LocationType.EXTRA,
logic.terran_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "South Xel'Naga Vessel", SC2_RACESWAP_LOC_ID_OFFSET + 12506, LocationType.VANILLA),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "Mid Xel'Naga Vessel", SC2_RACESWAP_LOC_ID_OFFSET + 12507, LocationType.VANILLA,
logic.terran_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_T.mission_name, "North Xel'Naga Vessel", SC2_RACESWAP_LOC_ID_OFFSET + 12508, LocationType.VANILLA,
logic.terran_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "Victory", SC2_RACESWAP_LOC_ID_OFFSET + 12600, LocationType.VICTORY,
logic.zerg_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "Artanis", SC2_RACESWAP_LOC_ID_OFFSET + 12601, LocationType.EXTRA),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "Northwest Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12602, LocationType.EXTRA,
logic.zerg_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "Northeast Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12603, LocationType.EXTRA,
logic.zerg_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "Southwest Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12604, LocationType.EXTRA,
logic.zerg_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "Southeast Void Crystal", SC2_RACESWAP_LOC_ID_OFFSET + 12605, LocationType.EXTRA,
logic.zerg_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "South Xel'Naga Vessel", SC2_RACESWAP_LOC_ID_OFFSET + 12606, LocationType.VANILLA),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "Mid Xel'Naga Vessel", SC2_RACESWAP_LOC_ID_OFFSET + 12607, LocationType.VANILLA,
logic.zerg_harbinger_of_oblivion_requirement
),
make_location_data(SC2Mission.HARBINGER_OF_OBLIVION_Z.mission_name, "North Xel'Naga Vessel", SC2_RACESWAP_LOC_ID_OFFSET + 12608, LocationType.VANILLA,
logic.zerg_harbinger_of_oblivion_requirement
),
]

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 @@ -170,7 +170,7 @@ def __init__(self, mission_id: int, name: str, campaign: SC2Campaign, area: str,
FORBIDDEN_WEAPON = 60, "Forbidden Weapon (Protoss)", SC2Campaign.LOTV, "Purifier", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_forbidden_weapon", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.Countdown|MissionFlag.VsProtoss|MissionFlag.HasRaceSwap
TEMPLE_OF_UNIFICATION = 61, "Temple of Unification (Protoss)", SC2Campaign.LOTV, "Ulnar", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_temple_of_unification", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.VsTP|MissionFlag.HasRaceSwap
THE_INFINITE_CYCLE = 62, "The Infinite Cycle", SC2Campaign.LOTV, "Ulnar", SC2Race.ANY, MissionPools.HARD, "ap_the_infinite_cycle", MissionFlag.Protoss|MissionFlag.Kerrigan|MissionFlag.NoBuild|MissionFlag.VsTP
HARBINGER_OF_OBLIVION = 63, "Harbinger of Oblivion", SC2Campaign.LOTV, "Ulnar", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_harbinger_of_oblivion", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.Countdown|MissionFlag.VsTP|MissionFlag.AiZergAlly
HARBINGER_OF_OBLIVION = 63, "Harbinger of Oblivion (Protoss)", SC2Campaign.LOTV, "Ulnar", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_harbinger_of_oblivion", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.Countdown|MissionFlag.VsTP|MissionFlag.AiZergAlly|MissionFlag.HasRaceSwap
UNSEALING_THE_PAST = 64, "Unsealing the Past", SC2Campaign.LOTV, "Purifier", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_unsealing_the_past", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.AutoScroller|MissionFlag.VsZerg
PURIFICATION = 65, "Purification", SC2Campaign.LOTV, "Purifier", SC2Race.PROTOSS, MissionPools.HARD, "ap_purification", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.VsZerg
STEPS_OF_THE_RITE = 66, "Steps of the Rite", SC2Campaign.LOTV, "Tal'darim", SC2Race.PROTOSS, MissionPools.HARD, "ap_steps_of_the_rite", MissionFlag.Protoss|MissionFlag.VanillaSoa|MissionFlag.VsProtoss
Expand Down Expand Up @@ -303,7 +303,8 @@ def __init__(self, mission_id: int, name: str, campaign: SC2Campaign, area: str,
TEMPLE_OF_UNIFICATION_T = 204, "Temple of Unification (Terran)", SC2Campaign.LOTV, "Ulnar", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_temple_of_unification", MissionFlag.Terran|MissionFlag.VsTP|MissionFlag.RaceSwap
TEMPLE_OF_UNIFICATION_Z = 205, "Temple of Unification (Zerg)", SC2Campaign.LOTV, "Ulnar", SC2Race.ZERG, MissionPools.HARD, "ap_temple_of_unification", MissionFlag.Zerg|MissionFlag.VsTP|MissionFlag.RaceSwap
# 206/207 - The Infinite Cycle
# 208/209 - Harbinger of Oblivion
HARBINGER_OF_OBLIVION_T = 208, "Harbinger of Oblivion (Terran)", SC2Campaign.LOTV, "Ulnar", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_harbinger_of_oblivion", MissionFlag.Terran|MissionFlag.Countdown|MissionFlag.VsTP|MissionFlag.AiZergAlly|MissionFlag.RaceSwap
HARBINGER_OF_OBLIVION_Z = 209, "Harbinger of Oblivion (Zerg)", SC2Campaign.LOTV, "Ulnar", SC2Race.ZERG, MissionPools.HARD, "ap_harbinger_of_oblivion", MissionFlag.Zerg|MissionFlag.Countdown|MissionFlag.VsTP|MissionFlag.AiZergAlly|MissionFlag.RaceSwap
# 210/211 - Unsealing the Past
# 212/213 - Purification
# 214/215 - Steps of the Rite
Expand Down
27 changes: 26 additions & 1 deletion worlds/sc2/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ def zerg_last_stand_requirement(self, state: CollectionState) -> bool:
and self.zerg_army_weapon_armor_upgrade_min_level(state) >= 2
)

def harbinger_of_oblivion_requirement(self, state: CollectionState) -> bool:
def protoss_harbinger_of_oblivion_requirement(self, state: CollectionState) -> bool:
return (
self.protoss_anti_armor_anti_air(state)
and (self.take_over_ai_allies
Expand All @@ -1701,6 +1701,31 @@ def harbinger_of_oblivion_requirement(self, state: CollectionState) -> bool:
)
)

def terran_harbinger_of_oblivion_requirement(self, state: CollectionState) -> bool:
return (
self.terran_competent_anti_air(state)
and (
self.take_over_ai_allies
or (
self.terran_beats_protoss_deathball(state)
and state.has_any({item_names.BATTLECRUISER, item_names.LIBERATOR, item_names.SIEGE_TANK, item_names.THOR}, self.player)
)
)
)

def zerg_harbinger_of_oblivion_requirement(self, state: CollectionState) -> bool:
return (
self.zerg_competent_anti_air(state)
and self.zerg_common_unit(state)
and (
self.take_over_ai_allies
or (
self.zerg_competent_comp(state)
and self.zerg_big_monsters(state)
)
)
)

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

0 comments on commit 698597e

Please sign in to comment.