SC2: Proper All-In logic

This commit is contained in:
Magnemania
2022-10-05 21:47:50 -04:00
parent 58f392a0af
commit cb906cc3cb
3 changed files with 19 additions and 8 deletions

View File

@@ -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),

View File

@@ -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 = []

View File

@@ -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)