From cb906cc3cbe23750c4c51b11bc5d1090dfe509ab Mon Sep 17 00:00:00 2001 From: Magnemania Date: Wed, 5 Oct 2022 21:47:50 -0400 Subject: [PATCH] SC2: Proper All-In logic --- worlds/sc2wol/Items.py | 4 ++-- worlds/sc2wol/Locations.py | 3 +-- worlds/sc2wol/LogicMixin.py | 20 ++++++++++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/worlds/sc2wol/Items.py b/worlds/sc2wol/Items.py index 6bb74076fb..18921a769d 100644 --- a/worlds/sc2wol/Items.py +++ b/worlds/sc2wol/Items.py @@ -125,8 +125,8 @@ item_table = { "Hercules": ItemData(615 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 15, classification=ItemClassification.progression), "Cellular Reactor": ItemData(616 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 16, classification=ItemClassification.filler), "Regenerative Bio-Steel": ItemData(617 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 17, classification=ItemClassification.filler), - "Hive Mind Emulator": ItemData(618 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 18), - "Psi Disrupter": ItemData(619 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 19, classification=ItemClassification.filler), + "Hive Mind Emulator": ItemData(618 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 18, ItemClassification.progression), + "Psi Disrupter": ItemData(619 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 19, classification=ItemClassification.progression), "Zealot": ItemData(700 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 0, classification=ItemClassification.progression), "Stalker": ItemData(701 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 1, classification=ItemClassification.progression), diff --git a/worlds/sc2wol/Locations.py b/worlds/sc2wol/Locations.py index 0bff141670..2dcd1017a9 100644 --- a/worlds/sc2wol/Locations.py +++ b/worlds/sc2wol/Locations.py @@ -247,8 +247,7 @@ def get_locations(world: Optional[MultiWorld], player: Optional[int]) -> Tuple[L LocationData("Shatter the Sky", "Shatter the Sky: Leviathan", SC2WOL_LOC_ID_OFFSET + 2805, lambda state: state._sc2wol_has_competent_comp(world, player)), LocationData("All-In", "All-In: Victory", None, - lambda state: state._sc2wol_has_competent_comp(world, player) and - state._sc2wol_has_heavy_defense(world, player)) + lambda state: state._sc2wol_final_mission_requirements(world, player)) ] beat_events = [] diff --git a/worlds/sc2wol/LogicMixin.py b/worlds/sc2wol/LogicMixin.py index 8d184c3e7d..8a0a718dcb 100644 --- a/worlds/sc2wol/LogicMixin.py +++ b/worlds/sc2wol/LogicMixin.py @@ -1,13 +1,14 @@ from BaseClasses import MultiWorld from worlds.AutoWorld import LogicMixin +from .Options import get_option_value class SC2WoLLogic(LogicMixin): def _sc2wol_has_common_unit(self, world: MultiWorld, player: int) -> bool: return self.has_any({'Marine', 'Marauder', 'Firebat', 'Hellion', 'Vulture'}, player) - def _sc2wol_has_bunker_unit(self, world: MultiWorld, player: int) -> bool: - return self.has_any({'Marine', 'Marauder'}, player) + def _sc2wol_has_manned_bunkers(self, world: MultiWorld, player: int) -> bool: + return self.has_any({'Marine', 'Marauder'}, player) and self.has('Bunker', player) def _sc2wol_has_air(self, world: MultiWorld, player: int) -> bool: return self.has_any({'Viking', 'Wraith', 'Banshee'}, player) or \ @@ -24,8 +25,7 @@ class SC2WoLLogic(LogicMixin): def _sc2wol_has_heavy_defense(self, world: MultiWorld, player: int) -> bool: return (self.has_any({'Siege Tank', 'Vulture'}, player) or - self.has('Bunker', player) and self._sc2wol_has_bunker_unit(world, player)) and \ - self._sc2wol_has_anti_air(world, player) + self._sc2wol_has_manned_bunkers(world, player)) and self._sc2wol_has_anti_air(world, player) def _sc2wol_has_competent_comp(self, world: MultiWorld, player: int) -> bool: return (self.has('Marine', player) or self.has('Marauder', player) and @@ -62,6 +62,18 @@ class SC2WoLLogic(LogicMixin): self._sc2wol_has_competent_anti_air(world, player) and \ self.has("Science Vessel", player) + def _sc2wol_final_mission_requirements(self, world: MultiWorld, player: int): + if get_option_value(world, player, 'all_in_map') == 0: + # Ground + version_logic = sum( + self.has(item, player) for item in ['Planetary Fortress', 'Siege Tank', 'Psi Disruptor', 'Banshee', 'Battlecruiser'] + ) + self._sc2wol_has_manned_bunkers(world, player) >= 3 + else: + # Air + version_logic = self.has_any({'Viking', 'Battlecruiser'}, player) \ + and self.has_any({'Hive Mind Emulator', 'Psi Disruptor', 'Missile Turret'}, player) + return self._sc2wol_has_heavy_defense(world, player) and version_logic + def _sc2wol_cleared_missions(self, world: MultiWorld, player: int, mission_count: int) -> bool: return self.has_group("Missions", player, mission_count)