Beispiel #1
0
    def aggressive(self) -> BuildOrder:
        worker_scout = Step(None,
                            WorkerScout(),
                            skip_until=RequireCustom(
                                lambda k: len(self.enemy_start_locations) > 1))
        stop_gas = RequiredAny([
            RequiredGas(100),
            RequiredTechReady(UpgradeId.ZERGLINGMOVEMENTSPEED, 0.001)
        ])
        end_game = RequiredAny(
            [RequiredSupply(90),
             RequiredUnitExists(UnitTypeId.LAIR, 1)])

        return BuildOrder([
            LingFloodBuild(),
            SequentialList([
                worker_scout,
                SpreadCreep(),
                InjectLarva(),
                Step(None,
                     PlanDistributeWorkers(3, 3),
                     skip=RequiredAny([stop_gas, end_game])),
                Step(None,
                     PlanDistributeWorkers(0, 0),
                     skip_until=stop_gas,
                     skip=end_game),
                Step(None,
                     PlanDistributeWorkers(None, None),
                     skip_until=end_game),
                DummyZergAttack()
            ]),
        ])
Beispiel #2
0
    async def create_plan(self) -> BuildOrder:
        tactics = SequentialList([
            # TauntEnemy(),
            # worker_scout,
            InjectLarva(),
            PlanHeatOverseer(),
            PlanWorkerOnlyDefense(),
            PlanZoneDefense(),
            PlanZoneGather(),
            PlanZoneAttack(),
            PlanFinishEnemy(),
        ])

        return BuildOrder([[
            ZergUnit(UnitTypeId.DRONE, 14),
            ZergUnit(UnitTypeId.OVERLORD, 2),
            ActBuilding(UnitTypeId.SPAWNINGPOOL),
            ZergUnit(UnitTypeId.DRONE, 20),
            ZergUnit(UnitTypeId.ZERGLING, 20)
        ],
                           [
                               Step(
                                   RequiredUnitReady(UnitTypeId.SPAWNINGPOOL),
                                   DefensiveBuilding(UnitTypeId.SPINECRAWLER,
                                                     DefensePosition.Entrance,
                                                     0)),
                               ZergUnit(UnitTypeId.QUEEN, 2)
                           ],
                           [
                               Step(RequiredUnitReady(UnitTypeId.SPAWNINGPOOL),
                                    AutoOverLord()),
                           ], tactics])
    async def create_plan(self) -> BuildOrder:
        stop_gas = RequiredAny([
            RequiredGas(100),
            RequiredTechReady(UpgradeId.ZERGLINGMOVEMENTSPEED, 0.001)
        ])
        end_game = RequiredAny(
            [RequiredSupply(70),
             RequiredUnitExists(UnitTypeId.LAIR, 1)])

        return BuildOrder([
            ActUnitOnce(UnitTypeId.DRONE, UnitTypeId.LARVA, 24),
            LingFloodBuild(),
            SequentialList([
                InjectLarva(),
                Step(None,
                     PlanDistributeWorkers(3, 3),
                     skip=RequiredAny([stop_gas, end_game])),
                Step(None,
                     PlanDistributeWorkers(0, 0),
                     skip_until=stop_gas,
                     skip=end_game),
                Step(None,
                     PlanDistributeWorkers(None, None),
                     skip_until=end_game),
                WorkerAttack(),
                DummyZergAttack()
            ]),
        ])
Beispiel #4
0
    async def create_plan(self) -> BuildOrder:
        build_step_buildings = [
            # 12 Pool
            Step(None, ActBuilding(UnitTypeId.SPAWNINGPOOL, 1), RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1)),
        ]

        finish = [
            Step(RequireCustom(lambda k: self.enemy_structures.flying.exists and self.supply_used > 30),
                 StepBuildGas(2)),
            ActExpand(2),
            RequiredUnitExists(UnitTypeId.DRONE, 20),
            MorphLair(),
            RequiredUnitExists(UnitTypeId.DRONE, 30),
            StepBuildGas(4),
            ActBuilding(UnitTypeId.SPIRE),
            ZergUnit(UnitTypeId.MUTALISK, 10, priority=True)
        ]

        build_step_units = [

            # 12 Pool followed by overlord
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), ActUnit(UnitTypeId.OVERLORD, UnitTypeId.LARVA, 2),
                 RequiredUnitExists(UnitTypeId.OVERLORD, 2)),

            # TheMusZero
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 14),
                 RequiredUnitExists(UnitTypeId.DRONE, 14)),
            # Queen for more larvae
            # BuildStep(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 1), RequiredUnitExists(UnitTypeId.QUEEN, 1)),

            # Endless zerglings
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA),
                 None),

        ]

        return BuildOrder([
            build_step_buildings,
            finish,
            build_step_units,
            AutoOverLord(),
            InjectLarva(),
            PlanWorkerOnlyDefense(),
            PlanZoneDefense(),
            PlanZoneGather(),
            PlanZoneAttack2(2),
            PlanFinishEnemy(),
        ])
    def cannon_expand(self) -> ActBase:
        self.knowledge.print(f"Cannon expand", "Build")
        enemy_main = self.knowledge.expansion_zones[-1]
        natural = self.knowledge.expansion_zones[-2]
        enemy_ramp = self.knowledge.enemy_base_ramp
        pylon_pos: Point2 = natural.behind_mineral_position_center

        return BuildOrder(
            [[
                ActUnitOnce(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
                GridBuilding(UnitTypeId.FORGE, 1),
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 18),
            ],
             [
                 BuildPosition(UnitTypeId.PYLON,
                               pylon_pos,
                               exact=False,
                               only_once=True),
                 Step(None,
                      BuildPosition(UnitTypeId.PHOTONCANNON,
                                    pylon_pos.towards(natural.center_location,
                                                      4),
                                    exact=False,
                                    only_once=True),
                      skip=RequireCustom(lambda k: k.lost_units_manager.
                                         own_lost_type(UnitTypeId.PYLON) > 0)),
                 ActExpand(2),
                 GridBuilding(UnitTypeId.GATEWAY, 1),
                 ActDefensiveCannons(2, 0, 1),
             ]])
 async def create_plan(self) -> BuildOrder:
     attack = TheAttack(4)
     return BuildOrder([
         Step(None, ChronoUnitProduction(UnitTypeId.PROBE, UnitTypeId.NEXUS),
              skip=RequiredUnitExists(UnitTypeId.PROBE, 40, include_pending=True), skip_until=RequiredUnitExists(UnitTypeId.ASSIMILATOR, 1)),
         SequentialList([
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
             GridBuilding(UnitTypeId.PYLON, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 16),
             StepBuildGas(1),
             GridBuilding(UnitTypeId.GATEWAY, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 20),
             ActExpand(2),
             GridBuilding(UnitTypeId.CYBERNETICSCORE, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 21),
             StepBuildGas(2),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
             GridBuilding(UnitTypeId.PYLON, 1),
             BuildOrder(
                 [
                     AutoPylon(),
                     ActTech(UpgradeId.WARPGATERESEARCH, UnitTypeId.CYBERNETICSCORE),
                     [
                         ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
                         Step(RequiredUnitExists(UnitTypeId.NEXUS, 2), ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 44)),
                         StepBuildGas(3,skip=RequiredGas(300))
                     ],
                 [
                     GateUnit(UnitTypeId.STALKER, 100)
                 ],
                 [
                     GridBuilding(UnitTypeId.GATEWAY, 7),
                     StepBuildGas(4, skip=RequiredGas(200)),
                 ]
             ])
         ]),
         SequentialList(
             [
                 PlanZoneDefense(),
                 RestorePower(),
                 PlanDistributeWorkers(),
                 PlanZoneGather(),
                 Step(RequiredUnitReady(UnitTypeId.GATEWAY, 4), attack),
                 PlanFinishEnemy(),
             ])
     ])
    async def create_plan(self) -> BuildOrder:
        rnd = random.randint(0, 2)
        if rnd == 2:
            cannon_rush = self.cannon_expand()
        elif rnd == 1:
            cannon_rush = self.cannon_rush()
        else:
            cannon_rush = self.cannon_contain()

        return BuildOrder([
            Step(None,
                 ChronoUnitProduction(UnitTypeId.PROBE, UnitTypeId.NEXUS),
                 skip=RequiredUnitExists(UnitTypeId.PROBE, 16),
                 skip_until=RequiredUnitReady(UnitTypeId.PYLON, 1)),
            ChronoAnyTech(0),
            SequentialList([
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 13),
                GridBuilding(UnitTypeId.PYLON, 1), cannon_rush,
                BuildOrder(
                    [[
                        ActExpand(2),
                        ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 30),
                        Step(RequiredUnitExists(UnitTypeId.NEXUS, 2),
                             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 44)),
                    ],
                     GridBuilding(UnitTypeId.GATEWAY, 2),
                     GridBuilding(UnitTypeId.CYBERNETICSCORE, 1),
                     StepBuildGas(2),
                     AutoPylon(),
                     StepBuildGas(3, skip=RequiredGas(300)),
                     ActTech(UpgradeId.WARPGATERESEARCH,
                             UnitTypeId.CYBERNETICSCORE),
                     BuildOrder([]).forge_upgrades_all,
                     Step(
                         RequiredUnitReady(UnitTypeId.TWILIGHTCOUNCIL, 1),
                         ActTech(UpgradeId.BLINKTECH,
                                 UnitTypeId.TWILIGHTCOUNCIL)),
                     [
                         ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
                         Step(RequiredUnitExists(UnitTypeId.NEXUS, 2),
                              ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 44)),
                         StepBuildGas(3, skip=RequiredGas(300))
                     ], [GateUnit(UnitTypeId.STALKER, 100)],
                     [
                         Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1),
                              GridBuilding(UnitTypeId.TWILIGHTCOUNCIL, 1)),
                         Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1),
                              GridBuilding(UnitTypeId.GATEWAY, 7)),
                         StepBuildGas(4, skip=RequiredGas(200)),
                     ]])
            ]),
            SequentialList([
                PlanCancelBuilding(),
                PlanZoneDefense(),
                PlanDistributeWorkers(),
                PlanZoneGather(),
                PlanZoneAttack(6),
                PlanFinishEnemy(),
            ])
        ])
Beispiel #8
0
 async def create_plan(self) -> BuildOrder:
     attack = PlanZoneAttack(6)
     return BuildOrder([
         Step(None,
              ChronoUnitProduction(UnitTypeId.PROBE, UnitTypeId.NEXUS),
              skip=RequiredUnitExists(UnitTypeId.PROBE,
                                      20,
                                      include_pending=True),
              skip_until=RequiredUnitExists(UnitTypeId.ASSIMILATOR, 1)),
         ChronoTech(AbilityId.RESEARCH_BLINK, UnitTypeId.TWILIGHTCOUNCIL),
         SequentialList([
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
             GridBuilding(UnitTypeId.PYLON, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 16),
             GridBuilding(UnitTypeId.GATEWAY, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 17),
             StepBuildGas(2),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 19),
             GridBuilding(UnitTypeId.GATEWAY, 2),
             BuildOrder([
                 AutoPylon(),
                 ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
                 SequentialList([
                     Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1),
                          GridBuilding(UnitTypeId.TWILIGHTCOUNCIL, 1)),
                     Step(
                         RequiredUnitReady(UnitTypeId.TWILIGHTCOUNCIL, 1),
                         ActTech(UpgradeId.BLINKTECH,
                                 UnitTypeId.TWILIGHTCOUNCIL)),
                 ]),
                 SequentialList([
                     Step(None,
                          GridBuilding(UnitTypeId.CYBERNETICSCORE, 1),
                          skip_until=RequiredUnitReady(
                              UnitTypeId.GATEWAY, 1)),
                     Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1),
                          GateUnit(UnitTypeId.ADEPT, 2, only_once=True)),
                     ActTech(UpgradeId.WARPGATERESEARCH,
                             UnitTypeId.CYBERNETICSCORE),
                     GateUnit(UnitTypeId.STALKER, 100)
                 ]),
                 Step(RequiredUnitExists(UnitTypeId.CYBERNETICSCORE, 1),
                      GridBuilding(UnitTypeId.GATEWAY, 4))
             ]),
         ]),
         SequentialList([
             PlanZoneDefense(),
             RestorePower(),
             PlanDistributeWorkers(),
             PlanZoneGather(),
             Step(RequiredTechReady(UpgradeId.BLINKTECH, 0.9), attack),
             PlanFinishEnemy(),
         ])
     ])
Beispiel #9
0
    async def create_plan(self) -> BuildOrder:
        self.knowledge.data_manager.set_build("bio")
        worker_scout = Step(None, WorkerScout(), skip_until=RequiredUnitExists(UnitTypeId.SUPPLYDEPOT, 1))
        tactics = [
            PlanCancelBuilding(),
            LowerDepots(),
            PlanZoneDefense(),
            worker_scout,
            Step(None, CallMule(50), skip=RequiredTime(5 * 60)),
            Step(None, CallMule(100), skip_until=RequiredTime(5 * 60)),
            Step(None, ScanEnemy(), skip_until=RequiredTime(5 * 60)),
            PlanDistributeWorkers(),
            ManTheBunkers(),
            Repair(),
            ContinueBuilding(),
            PlanZoneGatherTerran(),
            self.attack,
            PlanFinishEnemy(),
        ]

        return BuildOrder([
            BuildBio(),
            tactics
        ])
Beispiel #10
0
    async def create_plan(self) -> BuildOrder:
        self.attack = Step(None, PlanZoneAttack(random.randint(50, 80)))
        worker_scout = Step(None,
                            WorkerScout(),
                            skip_until=RequiredUnitExists(
                                UnitTypeId.SUPPLYDEPOT, 1))

        tactics = [
            PlanCancelBuilding(),
            LowerDepots(),
            PlanZoneDefense(),
            worker_scout,
            CallMule(100),
            ScanEnemy(),
            PlanDistributeWorkers(),
            ManTheBunkers(),
            Repair(),
            ContinueBuilding(),
            PlanZoneGatherTerran(),
            self.attack,
            PlanFinishEnemy(),
        ]

        return BuildOrder([BuildTanks(), SequentialList(tactics)])
Beispiel #11
0
    def macro(self) -> BuildOrder:
        worker_scout = Step(None,
                            WorkerScout(),
                            skip_until=RequireCustom(
                                lambda k: len(self.enemy_start_locations) > 1))
        distribute = PlanDistributeWorkers()

        return BuildOrder([
            LingSpeedBuild(),
            SequentialList([
                worker_scout,
                SpreadCreep(),
                InjectLarva(), distribute,
                DummyZergAttack()
            ]),
        ])
Beispiel #12
0
    async def create_plan(self) -> BuildOrder:

        worker_scout = Step(None, WorkerScout(), skip=RequireCustom(
            lambda k: len(self.enemy_start_locations) == 1), skip_until=RequiredSupply(20))
        self.distribute = PlanDistributeWorkers()

        return BuildOrder([
            RoachHydraBuild(),
            SequentialList([
                PlanCancelBuilding(),
                PlanZoneGather(),
                PlanZoneDefense(),
                worker_scout,
                SpreadCreep(),
                InjectLarva(),
                self.distribute,
                PlanZoneAttack(),
                PlanFinishEnemy()
            ]),
        ])
Beispiel #13
0
    def __init__(self):

        gas_related = [
            StepBuildGas(1, RequiredUnitExists(UnitTypeId.HATCHERY, 2)),
            Step(None,
                 ActTech(UpgradeId.ZERGLINGMOVEMENTSPEED,
                         UnitTypeId.SPAWNINGPOOL),
                 skip_until=RequiredGas(100)),
            Step(None,
                 ActBuilding(UnitTypeId.ROACHWARREN, 1),
                 skip_until=RequiredGas(100)),
            StepBuildGas(2, RequiredTime(4 * 60)),
            StepBuildGas(3, RequiredUnitExists(UnitTypeId.LAIR, 1)),
            StepBuildGas(5, None, RequiredGas(100)),
            StepBuildGas(8, RequiredSupply(50,
                                           supply_type=SupplyType.Workers)),
        ]
        buildings = [
            Step(RequiredUnitExists(UnitTypeId.DRONE, 14),
                 ActUnit(UnitTypeId.OVERLORD, UnitTypeId.LARVA, 2)),
            Step(RequiredSupply(16), ActExpand(2)),
            Step(RequiredUnitExists(UnitTypeId.EXTRACTOR, 1),
                 ActBuilding(UnitTypeId.SPAWNINGPOOL, 1)),
            Step(None,
                 ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 2),
                 skip_until=RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1)),
            Step(
                RequiredUnitReady(UnitTypeId.SPAWNINGPOOL),
                DefensiveBuilding(UnitTypeId.SPINECRAWLER,
                                  DefensePosition.Entrance, 1)),

            # Step(RequiredUnitExists(UnitTypeId.DRONE, 24, include_killed=True, include_pending=True), ActExpand(3)),
            Step(None,
                 MorphLair(),
                 skip=RequiredUnitExists(UnitTypeId.HIVE, 1)),
            Step(RequiredUnitExists(UnitTypeId.DRONE, 30, include_killed=True),
                 ActExpand(3)),
            Step(None, ZergUnit(UnitTypeId.QUEEN, 3)),
            Step(RequiredUnitExists(UnitTypeId.LAIR, 1),
                 ActBuilding(UnitTypeId.SPIRE, 1)),
            MorphOverseer(1),
            Step(None, ZergUnit(UnitTypeId.QUEEN, 5)),
            Step(RequiredUnitExists(UnitTypeId.SPIRE), ActExpand(4)),
            ActTech(UpgradeId.ZERGFLYERWEAPONSLEVEL1, UnitTypeId.SPIRE),
            Step(
                RequiredUnitExists(UnitTypeId.MUTALISK,
                                   10,
                                   include_killed=True),
                ActBuilding(UnitTypeId.INFESTATIONPIT)),
            Step(RequiredUnitReady(UnitTypeId.INFESTATIONPIT), MorphHive()),
            MorphGreaterSpire(),
            ActTech(UpgradeId.ZERGFLYERWEAPONSLEVEL2, UnitTypeId.GREATERSPIRE),
            ActTech(UpgradeId.ZERGFLYERWEAPONSLEVEL3, UnitTypeId.GREATERSPIRE),
        ]

        high_tier = [
            # Step(RequiredUnitReady(UnitTypeId.GREATERSPIRE), ZergUnit(UnitTypeId.DRONE, 70)),
            Step(None,
                 ZergUnit(UnitTypeId.CORRUPTOR, 3, priority=True),
                 skip_until=RequiredUnitReady(UnitTypeId.GREATERSPIRE)),
            Step(None, MorphBroodLord(5)),
            # Step(RequiredGas(200), ZergUnit(UnitTypeId.MUTALISK, 20, priority=True))
        ]

        units = [
            Step(RequiredUnitExists(UnitTypeId.HATCHERY, 1), None),
            Step(None, ZergUnit(UnitTypeId.DRONE, 20)),

            # Early zerglings
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ZergUnit(UnitTypeId.ZERGLING, 4), None),
            Step(None, ZergUnit(UnitTypeId.DRONE, 25)),
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ZergUnit(UnitTypeId.ZERGLING, 12), None),
            # Queen for more larvae
            Step(None, ZergUnit(UnitTypeId.QUEEN, 1)),
            Step(None, ZergUnit(UnitTypeId.DRONE, 30), None),
            Step(None, ZergUnit(UnitTypeId.ZERGLING, 16, only_once=True),
                 None),
            Step(None,
                 ZergUnit(UnitTypeId.ROACH, 4, only_once=True),
                 skip_until=RequiredGas(25)),
            Step(None,
                 ZergUnit(UnitTypeId.MUTALISK, 4),
                 skip_until=RequiredUnitReady(UnitTypeId.SPIRE, 1)),
            Step(None, ZergUnit(UnitTypeId.DRONE, 45), None),
            Step(None, ActUnitOnce(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 16),
                 None),
            Step(None,
                 ZergUnit(UnitTypeId.ROACH, 10),
                 skip=RequiredUnitReady(UnitTypeId.SPIRE, 1),
                 skip_until=RequiredGas(25)),
            Step(None, ZergUnit(UnitTypeId.DRONE, 65), None),
            Step(None,
                 ZergUnit(UnitTypeId.ZERGLING, 40),
                 skip_until=RequiredAll([
                     RequiredUnitReady(UnitTypeId.SPIRE, 1),
                     RequiredMinerals(300)
                 ])),
            Step(None,
                 ActUnit(UnitTypeId.ROACH, UnitTypeId.LARVA),
                 skip=RequiredUnitReady(UnitTypeId.SPIRE, 1)),
            Step(None,
                 ZergUnit(UnitTypeId.ZERGLING, 100),
                 skip_until=RequiredAll([
                     RequiredUnitReady(UnitTypeId.SPIRE, 1),
                     RequiredMinerals(500)
                 ])),

            # Endless mutalisks
            Step(None, ActUnit(UnitTypeId.MUTALISK, UnitTypeId.LARVA), None)
        ]
        super().__init__(
            [self.overlords, buildings, gas_related, high_tier, units])
Beispiel #14
0
    def cannon_rush(self) -> ActBase:
        self.knowledge.print(f"Cannon rush", "Build")
        enemy_main = self.knowledge.expansion_zones[-1]
        natural = self.knowledge.expansion_zones[-2]
        enemy_ramp = self.knowledge.enemy_base_ramp
        pylons: List[Point2] = [
            enemy_ramp.bottom_center.towards(natural.center_location, 3),
            enemy_ramp.top_center.towards(enemy_main.center_location, 3),
            enemy_ramp.top_center.towards(enemy_main.center_location, 6),
            enemy_ramp.top_center.towards(natural.center_location, -3),
            enemy_ramp.top_center.towards(enemy_main.center_location, 8),
            enemy_ramp.top_center.towards(natural.center_location, -6),
        ]

        return Step(
            None,
            BuildOrder([
                [
                    ActUnitOnce(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
                    GridBuilding(UnitTypeId.FORGE, 1),
                    ActUnitOnce(UnitTypeId.PROBE, UnitTypeId.NEXUS, 18),
                ],
                [
                    BuildPosition(UnitTypeId.PYLON, pylons[0], exact=False),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[1],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PYLON,
                                  pylons[2],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[3],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PYLON,
                                  pylons[4],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[5],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[4],
                                  exact=False,
                                  only_once=True),
                ],
                [
                    BuildPosition(UnitTypeId.PYLON,
                                  pylons[1],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[0],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PYLON,
                                  pylons[3],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[2],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PYLON,
                                  pylons[5],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[4],
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  pylons[5],
                                  exact=False,
                                  only_once=True),
                ],
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 16),
            ]),
            # Skip cannon rushing if we started nexus, or have over 750 minerals, the build is probably stuck
            skip=RequiredAny([
                RequiredUnitExists(UnitTypeId.NEXUS, 2),
                RequiredMinerals(750)
            ]))
    async def create_plan(self) -> BuildOrder:
        build_steps_scv = [
            Step(None,
                 ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 16 + 6),
                 skip=RequiredUnitExists(UnitTypeId.COMMANDCENTER, 2)),
            Step(None,
                 ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 32 + 12))
        ]

        build_steps_buildings = [
            Step(RequiredSupply(13), GridBuilding(UnitTypeId.SUPPLYDEPOT, 1)),
            Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 0.95),
                 GridBuilding(UnitTypeId.BARRACKS, 1)),
            StepBuildGas(1, RequiredSupply(16)),
            ActExpand(2),
            Step(RequiredSupply(16), GridBuilding(UnitTypeId.SUPPLYDEPOT, 2)),
            StepBuildGas(
                2,
                RequiredUnitExists(UnitTypeId.MARINE, 1,
                                   include_pending=True)),
            Step(None,
                 GridBuilding(UnitTypeId.FACTORY, 1),
                 skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            Step(None,
                 ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY,
                               1),
                 skip_until=RequiredUnitReady(UnitTypeId.FACTORY, 1)),
            Step(RequiredSupply(28), GridBuilding(UnitTypeId.SUPPLYDEPOT, 4)),
            Step(None, GridBuilding(UnitTypeId.FACTORY, 2)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY,
                              2)),
            Step(RequiredSupply(38), GridBuilding(UnitTypeId.SUPPLYDEPOT, 5)),
            Step(None,
                 ActExpand(3),
                 skip_until=RequireCustom(self.should_expand)),
            Step(None,
                 ActExpand(4),
                 skip_until=RequiredAll([
                     RequireCustom(self.should_expand),
                     RequiredUnitReady(UnitTypeId.COMMANDCENTER, 3)
                 ])),
            # BuildStep(None, GridBuilding(UnitTypeId.FACTORY, 3)),
            StepBuildGas(3),
            Step(RequiredSupply(45), GridBuilding(UnitTypeId.SUPPLYDEPOT, 8)),
            Step(None, GridBuilding(UnitTypeId.BARRACKS, 2)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.BARRACKSTECHLAB, UnitTypeId.BARRACKS,
                              1)),
            Step(None, ActTech(UpgradeId.SHIELDWALL,
                               UnitTypeId.BARRACKSTECHLAB)),
            StepBuildGas(4),
            # BuildStep(None, GridBuilding(UnitTypeId.ARMORY, 1)),
            Step(RequiredSupply(75), GridBuilding(UnitTypeId.SUPPLYDEPOT, 10)),
            Step(None, GridBuilding(UnitTypeId.BARRACKS, 5)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.BARRACKSREACTOR, UnitTypeId.BARRACKS,
                              3)),
            Step(None, GridBuilding(UnitTypeId.FACTORY, 3)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY,
                              3)),
            Step(RequiredSupply(85), GridBuilding(UnitTypeId.SUPPLYDEPOT, 14)),
        ]

        build_steps_mech = [
            # Step(RequiredUnitExists(UnitTypeId.FACTORY, 1), ActUnit(UnitTypeId.HELLION, UnitTypeId.FACTORY, 2)),
            Step(RequiredUnitReady(UnitTypeId.FACTORYTECHLAB, 1),
                 ActUnit(UnitTypeId.SIEGETANK, UnitTypeId.FACTORY, 20))
        ]

        build_steps_marines = [
            Step(RequiredUnitReady(UnitTypeId.BARRACKS, 1),
                 ActUnit(UnitTypeId.MARINE, UnitTypeId.BARRACKS, 2)),
            Step(RequiredMinerals(250),
                 ActUnit(UnitTypeId.MARINE, UnitTypeId.BARRACKS, 100))
        ]

        build_order = BuildOrder([
            build_steps_scv, build_steps_buildings, build_steps_mech,
            Step(None,
                 MorphOrbitals(),
                 skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            build_steps_marines,
            ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY, 99)
        ])

        scout = Step(None,
                     WorkerScout(),
                     skip_until=RequiredUnitExists(UnitTypeId.BARRACKS, 1))

        self.attack = PlanZoneAttack(60)
        tactics = [
            PlanCancelBuilding(),
            LowerDepots(),
            PlanZoneDefense(),
            scout,
            ScanEnemy(120),
            CallMule(),
            PlanDistributeWorkers(),
            Repair(),
            ContinueBuilding(),
            PlanZoneGatherTerran(),
            self.attack,
            PlanFinishEnemy(),
        ]
        return BuildOrder([build_order, tactics])
Beispiel #16
0
 async def create_plan(self) -> BuildOrder:
     attack = TheAttack(4)
     return BuildOrder([
         Step(None,
              ChronoUnitProduction(UnitTypeId.PROBE, UnitTypeId.NEXUS),
              skip=RequiredUnitExists(UnitTypeId.PROBE,
                                      30,
                                      include_pending=True),
              skip_until=RequiredUnitExists(UnitTypeId.ASSIMILATOR, 1)),
         ChronoUnitProduction(UnitTypeId.IMMORTAL,
                              UnitTypeId.ROBOTICSFACILITY),
         SequentialList([
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
             GridBuilding(UnitTypeId.PYLON, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 16),
             StepBuildGas(1),
             GridBuilding(UnitTypeId.GATEWAY, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 20),
             ActExpand(2),
             GridBuilding(UnitTypeId.CYBERNETICSCORE, 1),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 21),
             StepBuildGas(2),
             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
             GridBuilding(UnitTypeId.PYLON, 1),
             BuildOrder([
                 AutoPylon(),
                 GateUnit(UnitTypeId.STALKER, 2, priority=True),
                 ActTech(UpgradeId.WARPGATERESEARCH,
                         UnitTypeId.CYBERNETICSCORE),
                 [
                     ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
                     Step(RequiredUnitExists(UnitTypeId.NEXUS, 2),
                          ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 44)),
                     StepBuildGas(3, skip=RequiredGas(300)),
                     Step(RequiredUnitExists(UnitTypeId.NEXUS, 3),
                          ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 56)),
                     StepBuildGas(5, skip=RequiredGas(200)),
                 ],
                 SequentialList([
                     Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1),
                          GridBuilding(UnitTypeId.TWILIGHTCOUNCIL, 1)),
                     GridBuilding(UnitTypeId.ROBOTICSFACILITY, 1),
                     Step(
                         RequiredUnitReady(UnitTypeId.TWILIGHTCOUNCIL, 1),
                         ActTech(UpgradeId.CHARGE,
                                 UnitTypeId.TWILIGHTCOUNCIL)),
                 ]),
                 [
                     ActUnit(UnitTypeId.IMMORTAL,
                             UnitTypeId.ROBOTICSFACILITY,
                             1,
                             priority=True),
                     ActUnit(UnitTypeId.OBSERVER,
                             UnitTypeId.ROBOTICSFACILITY,
                             1,
                             priority=True),
                     ActUnit(UnitTypeId.IMMORTAL,
                             UnitTypeId.ROBOTICSFACILITY,
                             20,
                             priority=True)
                 ],
                 Step(RequiredTime(60 * 5), ActExpand(3)),
                 [GateUnit(UnitTypeId.ZEALOT, 100)],
                 [
                     GridBuilding(UnitTypeId.GATEWAY, 4),
                     StepBuildGas(4, skip=RequiredGas(200)),
                     GridBuilding(UnitTypeId.ROBOTICSFACILITY, 2),
                 ]
             ])
         ]),
         SequentialList([
             PlanCancelBuilding(),
             PlanHeatObserver(),
             PlanZoneDefense(),
             RestorePower(),
             PlanDistributeWorkers(),
             PlanZoneGather(),
             Step(RequiredUnitReady(UnitTypeId.IMMORTAL, 3), attack),
             PlanFinishEnemy(),
         ])
     ])
    async def create_plan(self) -> BuildOrder:
        attack_value = random.randint(50, 80)
        self.attack = Step(None, PlanZoneAttack(attack_value))
        empty = BuildOrder([])
        self.jump = random.randint(0,2)

        if self.jump == 0:
            self.knowledge.print(f"Att at {attack_value}", "Build")
        else:
            self.knowledge.print(f"Jump, att at {attack_value }", "Build")
        worker_scout = Step(None, WorkerScout(), skip_until=RequiredUnitExists(UnitTypeId.SUPPLYDEPOT, 1))
        self.distribute_workers = PlanDistributeWorkers(4)
        tactics = [
            PlanCancelBuilding(),
            LowerDepots(),
            PlanZoneDefense(),
            worker_scout,
            Step(None, CallMule(50), skip=RequiredTime(5* 60)),
            Step(None, CallMule(100), skip_until=RequiredTime(5 * 60)),
            Step(None, ScanEnemy(), skip_until=RequiredTime(5 * 60)),

            self.distribute_workers,
            ManTheBunkers(),
            Repair(),
            ContinueBuilding(),
            PlanZoneGatherTerran(),
            Step(None, JumpIn(), RequireCustom(lambda k: self.jump == 0)),
            self.attack,
            PlanFinishEnemy(),
        ]

        return BuildOrder([
            empty.depots,
            Step(None, MorphOrbitals(), skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            [
                Step(None, ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 34 + 12))
            ],
            [
                Step(RequiredSupply(13), GridBuilding(UnitTypeId.SUPPLYDEPOT, 1)),

                Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 0.95), GridBuilding(UnitTypeId.BARRACKS, 1)),
                StepBuildGas(1),
                ActExpand(2),
                Step(RequiredSupply(20), GridBuilding(UnitTypeId.SUPPLYDEPOT, 2)),
                StepBuildGas(2),
                Step(None, GridBuilding(UnitTypeId.FACTORY, 1),
                     skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
                Step(RequiredUnitReady(UnitTypeId.FACTORY, 1), GridBuilding(UnitTypeId.STARPORT, 1)),
                DefensiveBuilding(UnitTypeId.BUNKER, DefensePosition.Entrance, 1),
                Step(None, GridBuilding(UnitTypeId.BARRACKS, 2)),
                StepBuildGas(3),

                Step(None, ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY, 1)),
                Step(RequiredUnitReady(UnitTypeId.STARPORT, 1), GridBuilding(UnitTypeId.FUSIONCORE, 1)),
                Step(None, ActBuildAddon(UnitTypeId.STARPORTTECHLAB, UnitTypeId.STARPORT, 1)),
                StepBuildGas(4, None, RequiredUnitExists(UnitTypeId.BATTLECRUISER,1,include_killed=True, include_pending=True)),
                Step(RequiredUnitExists(UnitTypeId.BATTLECRUISER,1,include_killed=True), GridBuilding(UnitTypeId.BARRACKS, 3)),
                Step(None, ActBuildAddon(UnitTypeId.BARRACKSTECHLAB, UnitTypeId.BARRACKS, 1)),
                Step(None, ActBuildAddon(UnitTypeId.BARRACKSREACTOR, UnitTypeId.BARRACKS, 1)),

                Step(None, GridBuilding(UnitTypeId.STARPORT, 2)),

                Step(RequiredUnitReady(UnitTypeId.STARPORT, 2), ActBuildAddon(UnitTypeId.STARPORTTECHLAB, UnitTypeId.STARPORT, 2)),
                Step(None, ActTech(UpgradeId.SHIELDWALL, UnitTypeId.BARRACKSTECHLAB)),

                Step(RequiredMinerals(600), GridBuilding(UnitTypeId.BARRACKS, 5)),
                ActExpand(3),
            ],
            [
                Step(RequiredAny([RequiredEnemyBuildingExists(UnitTypeId.DARKSHRINE),
                                  RequiredEnemyUnitExistsAfter(UnitTypeId.DARKTEMPLAR),
                                  RequiredEnemyUnitExistsAfter(UnitTypeId.BANSHEE)]), None),
                Step(RequiredUnitReady(UnitTypeId.STARPORT, 1), ActUnit(UnitTypeId.RAVEN, UnitTypeId.STARPORT, 2, priority=True)),
            ],
            Step(None, SequentialList([
                ActUnit(UnitTypeId.BATTLECRUISER, UnitTypeId.STARPORT, 20, priority=True)
            ]), skip_until=RequiredUnitReady(UnitTypeId.FUSIONCORE, 1)),
            ActUnit(UnitTypeId.SIEGETANK, UnitTypeId.FACTORY, 10),
            ActUnit(UnitTypeId.MARINE, UnitTypeId.BARRACKS, 50),
            SequentialList(tactics)
        ])
Beispiel #18
0
    def __init__(self):

        gas_related = [
            Step(RequiredUnitExists(UnitTypeId.HATCHERY, 2), ActTech(UpgradeId.ZERGLINGMOVEMENTSPEED, UnitTypeId.SPAWNINGPOOL), skip_until=RequiredGas(100)),
            Step(None, ActBuilding(UnitTypeId.ROACHWARREN, 1), skip_until=RequiredGas(100)),
            StepBuildGas(2, RequiredTime(4 * 60), RequiredGas(100)),
            StepBuildGas(3, RequiredUnitExists(UnitTypeId.HYDRALISKDEN, 1), RequiredGas(50)),
            StepBuildGas(4, RequiredSupply(60, SupplyType.Workers), RequiredGas(25)),
            StepBuildGas(6, RequiredMinerals(749), RequiredGas(25)),
            StepBuildGas(8, RequiredMinerals(1000), RequiredGas(25)),
        ]
        buildings = [
            Step(RequiredUnitExists(UnitTypeId.DRONE, 14), ActUnit(UnitTypeId.OVERLORD, UnitTypeId.LARVA, 2)),
            Step(RequiredSupply(16), ActExpand(2)),
            Step(RequiredSupply(18), ActBuilding(UnitTypeId.SPAWNINGPOOL, 1)),
            StepBuildGas(1, RequiredSupply(20)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 2), skip_until=RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1)),

            Step(RequiredUnitExists(UnitTypeId.DRONE, 24, include_killed=True, include_pending=True), ActExpand(3)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 3)),
            Step(None, MorphLair(), skip=RequiredUnitExists(UnitTypeId.HIVE, 1)),
            Step(RequiredUnitExists(UnitTypeId.DRONE, 30, include_killed=True), ActExpand(4)),
            Step(RequiredUnitReady(UnitTypeId.LAIR, 1), ActBuilding(UnitTypeId.HYDRALISKDEN, 1)),
            MorphOverseer(1),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 4)),
            Step(RequiredSupply(100), ActExpand(5)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 10), skip_until=RequiredMinerals(500)), # anti air defense!
        ]

        units = [
            Step(RequiredUnitExists(UnitTypeId.HATCHERY, 1), None),

            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 23)),

            # Early zerglings
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 4),
                 None),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 28)),
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 12),
                 None),

            # Queen for more larvae
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 1)),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 35), None),
            Step(None, ActUnitOnce(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 16), None),
            Step(None, ActUnitOnce(UnitTypeId.ROACH, UnitTypeId.LARVA, 4), skip_until=RequiredGas(25)),

            Step(None, ActUnitOnce(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 100), skip_until=RequiredMinerals(750)),

            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 45), None),
            Step(None, ActUnit(UnitTypeId.HYDRALISK, UnitTypeId.LARVA, 7), skip=RequiredUnitReady(UnitTypeId.HYDRALISKDEN, 1)),
            Step(None, ActUnitOnce(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 24), None),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 50), None),
            Step(None, ActUnit(UnitTypeId.ROACH, UnitTypeId.LARVA, 10), skip_until=RequiredGas(25)),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 70), None),

            Step(None, ActUnit(UnitTypeId.ROACH, UnitTypeId.LARVA), skip=RequiredUnitReady(UnitTypeId.HYDRALISKDEN, 1)),

            # Endless hydralisk
            Step(None, ActUnit(UnitTypeId.HYDRALISK, UnitTypeId.LARVA), None)
        ]
        super().__init__([self.overlords, buildings, gas_related, units])
Beispiel #19
0
    def __init__(self):

        gas_related = [
            StepBuildGas(1, RequiredUnitExists(UnitTypeId.HATCHERY, 2)),
            Step(None,
                 ActTech(UpgradeId.ZERGLINGMOVEMENTSPEED,
                         UnitTypeId.SPAWNINGPOOL),
                 skip_until=RequiredGas(100)),
        ]
        buildings = [
            # 12 Pool
            Step(None, ActBuilding(UnitTypeId.SPAWNINGPOOL, 1)),
            Step(
                RequiredUnitExists(UnitTypeId.ZERGLING, 4,
                                   include_killed=True), ActExpand(2)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 2)),
            Step(RequiredUnitExists(UnitTypeId.DRONE, 24, include_killed=True),
                 ActExpand(3)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 3)),
            Step(RequiredUnitExists(UnitTypeId.DRONE, 30, include_killed=True),
                 ActExpand(4)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 4)),
        ]

        spire_end_game = [
            Step(
                RequiredAny([
                    RequiredSupply(90),
                    RequiredUnitExists(UnitTypeId.LAIR, 1)
                ]), None),
            ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 35),
            MorphLair(),
            ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 40),
            StepBuildGas(3, None),
            ActBuilding(UnitTypeId.SPIRE, 1),
            ActUnit(UnitTypeId.MUTALISK, UnitTypeId.LARVA, 10, priority=True)
        ]

        units = [
            Step(None, None, RequiredUnitExists(UnitTypeId.HATCHERY, 1)),

            # 12 Pool followed by overlord
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.OVERLORD, UnitTypeId.LARVA, 2),
                 RequiredUnitExists(UnitTypeId.OVERLORD, 2)),

            # TheMusZero
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 14),
                 RequiredUnitExists(UnitTypeId.DRONE, 14)),

            # Early zerglings
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 4), None),
            # Queen for more larvae
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 1),
                 RequiredUnitExists(UnitTypeId.QUEEN, 1)),
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 20), None),
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnitOnce(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 12), None),
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 30), None),
            # Endless zerglings
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA), None)
        ]

        super().__init__(
            [self.overlords, buildings, spire_end_game, gas_related, units])
Beispiel #20
0
    def __init__(self):

        gas_related = [
            StepBuildGas(1, RequiredUnitExists(UnitTypeId.HATCHERY, 2)),
            Step(None,
                 ActTech(UpgradeId.ZERGLINGMOVEMENTSPEED,
                         UnitTypeId.SPAWNINGPOOL),
                 skip_until=RequiredGas(100)),
            Step(None,
                 ActBuilding(UnitTypeId.ROACHWARREN, 1),
                 skip_until=RequiredGas(100)),
        ]
        buildings = [
            Step(RequiredUnitExists(UnitTypeId.DRONE, 14),
                 ActUnit(UnitTypeId.OVERLORD, UnitTypeId.LARVA, 2)),
            Step(None, ActExpand(2)),
            Step(RequiredUnitExists(UnitTypeId.EXTRACTOR, 1),
                 ActBuilding(UnitTypeId.SPAWNINGPOOL, 1)),
            Step(None,
                 ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 2),
                 skip_until=RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1)),
            Step(RequiredUnitExists(UnitTypeId.DRONE, 24, include_killed=True),
                 ActExpand(3)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 3)),
            Step(RequiredUnitExists(UnitTypeId.DRONE, 30, include_killed=True),
                 ActExpand(4)),
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 4)),
            Step(RequiredMinerals(500),
                 ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY,
                         10)),  # anti air defense!
        ]

        units = [
            Step(RequiredUnitExists(UnitTypeId.HATCHERY, 1), None),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 20)),

            # Early zerglings
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1),
                 ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 12), None),
            # Queen for more larvae
            Step(None, ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 1)),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 30), None),
            Step(None, ActUnitOnce(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 16),
                 None),
            Step(None,
                 ActUnitOnce(UnitTypeId.ROACH, UnitTypeId.LARVA, 4),
                 skip_until=RequiredGas(25)),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 40), None),
            Step(None, ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA, 16),
                 None),
            Step(None,
                 ActUnit(UnitTypeId.ROACH, UnitTypeId.LARVA, 10),
                 skip_until=RequiredGas(25)),

            # Endless zerglings
            Step(None, ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA), None)
        ]
        super().__init__([self.overlords, buildings, gas_related, units])
    async def create_plan(self) -> BuildOrder:
        self.knowledge.building_solver.wall_type = 3  # WallType.ProtossMainZerg

        build_steps_buildings2 = [
            Step(RequiredUnitReady(UnitTypeId.GATEWAY, 1), GridBuilding(UnitTypeId.CYBERNETICSCORE, 1)),
            Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1), GridBuilding(UnitTypeId.TWILIGHTCOUNCIL, 1)),
            Step(RequiredUnitReady(UnitTypeId.TWILIGHTCOUNCIL, 1), GridBuilding(UnitTypeId.DARKSHRINE, 1)),
            ActTech(UpgradeId.BLINKTECH, UnitTypeId.TWILIGHTCOUNCIL),
            ActTech(UpgradeId.CHARGE, UnitTypeId.TWILIGHTCOUNCIL)
        ]

        build_steps_workers = [
            Step(None, ActBuilding(UnitTypeId.NEXUS, 1), RequiredUnitExists(UnitTypeId.NEXUS, 1)),

            # Build to 14 probes and stop until pylon is building
            Step(None, ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS), RequiredUnitExists(UnitTypeId.PROBE, 14)),
            Step(None, None, RequiredUnitExists(UnitTypeId.PYLON, 1)),

            Step(None, ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS), RequiredUnitExists(UnitTypeId.PROBE, 16 + 3 + 3)),
            Step(RequireCustom(lambda k: self.knowledge.own_main_zone.minerals_running_low), ActExpand(2)),
            Step(None, ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS), RequiredUnitExists(UnitTypeId.PROBE, 30)),
            GridBuilding(UnitTypeId.GATEWAY, 5),
            StepBuildGas(3),
            GridBuilding(UnitTypeId.GATEWAY, 6),
        ]

        build_steps_buildings = [
            Step(RequiredSupply(14), GridBuilding(UnitTypeId.PYLON, 1), RequiredUnitExists(UnitTypeId.PYLON, 1)),
            StepBuildGas(1, RequiredSupply(16)),
            Step(RequiredSupply(16), GridBuilding(UnitTypeId.GATEWAY, 1), RequiredTotalUnitExists([UnitTypeId.GATEWAY, UnitTypeId.WARPGATE], 1)),
            StepBuildGas(2),
            Step(RequiredSupply(21), GridBuilding(UnitTypeId.PYLON, 2), RequiredUnitExists(UnitTypeId.PYLON, 2)),
            GridBuilding(UnitTypeId.GATEWAY, 2),
            Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1), ActTech(UpgradeId.WARPGATERESEARCH, UnitTypeId.CYBERNETICSCORE)),

            GridBuilding(UnitTypeId.GATEWAY, 3),
            AutoPylon()
        ]

        build_steps_units = [
            Step(None, ProtossUnit(UnitTypeId.DARKTEMPLAR, 4, priority=True), skip_until=RequiredUnitReady(UnitTypeId.DARKSHRINE, 1)),
            Step(RequiredUnitReady(UnitTypeId.GATEWAY, 1), ProtossUnit(UnitTypeId.ZEALOT, 1), RequiredTechReady(UpgradeId.WARPGATERESEARCH, 1)),
            Step(None, ProtossUnit(UnitTypeId.STALKER), None),
        ]
        build_steps_units2 = [
            Step(RequiredUnitExists(UnitTypeId.TWILIGHTCOUNCIL, 1), ProtossUnit(UnitTypeId.STALKER, 3), RequiredTechReady(UpgradeId.WARPGATERESEARCH, 1)),
            Step(RequiredMinerals(400), ProtossUnit(UnitTypeId.ZEALOT))
            ]

        build_steps_chrono = [
            Step(None, ChronoUnitProduction(UnitTypeId.PROBE, UnitTypeId.NEXUS),
                 skip=RequiredUnitExists(UnitTypeId.PROBE, 20, include_killed=True),
                 skip_until=RequiredUnitReady(UnitTypeId.PYLON)),
            ChronoAnyTech(0)
        ]

        build_order = BuildOrder([
            build_steps_buildings,
            build_steps_buildings2,
            build_steps_workers,
            build_steps_units,
            build_steps_units2,
            build_steps_chrono
        ])

        attack = PlanZoneAttack(20)
        attack.retreat_multiplier = 0.5  # All in

        tactics = [
            PlanCancelBuilding(),
            PlanZoneDefense(),
            RestorePower(),
            PlanDistributeWorkers(),
            DtPush(),
            PlanZoneGather(),
            attack,
            PlanFinishEnemy(),
        ]

        return BuildOrder([
            build_order,
            tactics
        ])
Beispiel #22
0
    def __init__(self):
        viking_counters = [
            UnitTypeId.COLOSSUS, UnitTypeId.MEDIVAC, UnitTypeId.RAVEN,
            UnitTypeId.VOIDRAY, UnitTypeId.CARRIER, UnitTypeId.TEMPEST,
            UnitTypeId.BROODLORD
        ]
        scv = [
            Step(None,
                 MorphOrbitals(),
                 skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            Step(None,
                 ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 16 + 6),
                 skip=RequiredUnitExists(UnitTypeId.COMMANDCENTER, 2)),
            Step(None,
                 ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 32 + 12))
        ]

        dt_counter = [
            Step(
                RequiredAny([
                    RequiredEnemyBuildingExists(UnitTypeId.DARKSHRINE),
                    RequiredEnemyUnitExistsAfter(UnitTypeId.DARKTEMPLAR),
                    RequiredEnemyUnitExistsAfter(UnitTypeId.BANSHEE)
                ]), None),
            Step(None, GridBuilding(UnitTypeId.ENGINEERINGBAY, 1)),
            Step(
                None,
                DefensiveBuilding(UnitTypeId.MISSILETURRET,
                                  DefensePosition.Entrance, 2)),
            Step(
                None,
                DefensiveBuilding(UnitTypeId.MISSILETURRET,
                                  DefensePosition.CenterMineralLine, None))
        ]
        dt_counter2 = [
            Step(
                RequiredAny([
                    RequiredEnemyBuildingExists(UnitTypeId.DARKSHRINE),
                    RequiredEnemyUnitExistsAfter(UnitTypeId.DARKTEMPLAR),
                    RequiredEnemyUnitExistsAfter(UnitTypeId.BANSHEE)
                ]), None),
            GridBuilding(UnitTypeId.STARPORT, 2),
            Step(
                None,
                ActBuildAddon(UnitTypeId.STARPORTTECHLAB, UnitTypeId.STARPORT,
                              1)),
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1),
                 ActUnit(UnitTypeId.RAVEN, UnitTypeId.STARPORT, 2)),
        ]

        buildings = [
            Step(
                RequiredSupply(13), GridBuilding(UnitTypeId.SUPPLYDEPOT, 1),
                RequiredTotalUnitExists([
                    UnitTypeId.SUPPLYDEPOT, UnitTypeId.SUPPLYDEPOTDROP,
                    UnitTypeId.SUPPLYDEPOTLOWERED
                ], 1)),
            StepBuildGas(1, RequiredSupply(16)),
            Step(
                RequiredTotalUnitExists([
                    UnitTypeId.SUPPLYDEPOT, UnitTypeId.SUPPLYDEPOTDROP,
                    UnitTypeId.SUPPLYDEPOTLOWERED
                ], 1), GridBuilding(UnitTypeId.BARRACKS, 1)),
            Step(
                RequiredUnitReady(UnitTypeId.BARRACKS, 0.25),
                GridBuilding(UnitTypeId.SUPPLYDEPOT, 2),
                RequiredTotalUnitExists([
                    UnitTypeId.SUPPLYDEPOT, UnitTypeId.SUPPLYDEPOTDROP,
                    UnitTypeId.SUPPLYDEPOTLOWERED
                ], 2)),
            StepBuildGas(1, RequiredSupply(18)),
            Step(RequiredUnitExists(UnitTypeId.MARINE, 1), ActExpand(2)),
            StepBuildGas(2, RequiredSupply(20)),
            Step(None,
                 GridBuilding(UnitTypeId.FACTORY, 1),
                 skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            Step(None, GridBuilding(UnitTypeId.FACTORY, 1)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY,
                              1)),
            # BuildStep(None, GridBuilding(UnitTypeId.FACTORY, 3)),
            Step(
                RequiredUnitExists(UnitTypeId.SIEGETANK,
                                   1,
                                   include_killed=True),
                GridBuilding(UnitTypeId.FACTORY, 2)),
            StepBuildGas(4),
            Step(
                None,
                ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY,
                              2)),
            Step(None, GridBuilding(UnitTypeId.BARRACKS, 2)),
            # BuildStep(None, GridBuilding(UnitTypeId.ARMORY, 1)),
            Step(None, GridBuilding(UnitTypeId.STARPORT, 1)),
            Step(None, GridBuilding(UnitTypeId.BARRACKS, 5)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.BARRACKSTECHLAB, UnitTypeId.BARRACKS,
                              1)),
            Step(None, ActTech(UpgradeId.SHIELDWALL,
                               UnitTypeId.BARRACKSTECHLAB)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.STARPORTREACTOR, UnitTypeId.STARPORT,
                              1)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.BARRACKSREACTOR, UnitTypeId.BARRACKS,
                              3)),
            Step(None, ActExpand(3)),
        ]

        mech = [
            Step(RequiredUnitExists(UnitTypeId.FACTORY, 1),
                 ActUnit(UnitTypeId.HELLION, UnitTypeId.FACTORY, 2),
                 skip=RequiredUnitReady(UnitTypeId.FACTORYTECHLAB, 1)),
            Step(RequiredUnitReady(UnitTypeId.FACTORYTECHLAB, 1),
                 ActUnit(UnitTypeId.SIEGETANK, UnitTypeId.FACTORY, 20))
        ]
        air = [
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1),
                 ActUnit(UnitTypeId.MEDIVAC, UnitTypeId.STARPORT, 2)),
            Step(None, ActUnit(UnitTypeId.VIKINGFIGHTER, UnitTypeId.STARPORT,
                               1)),
            Step(None,
                 ActUnit(UnitTypeId.VIKINGFIGHTER, UnitTypeId.STARPORT, 3),
                 skip_until=self.RequireAnyEnemyUnits(viking_counters, 1)),
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1),
                 ActUnit(UnitTypeId.MEDIVAC, UnitTypeId.STARPORT, 4)),
            Step(None,
                 ActUnit(UnitTypeId.VIKINGFIGHTER, UnitTypeId.STARPORT, 10),
                 skip_until=self.RequireAnyEnemyUnits(viking_counters, 4)),
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1),
                 ActUnit(UnitTypeId.MEDIVAC, UnitTypeId.STARPORT, 6)),
        ]
        marines = [
            Step(RequiredUnitReady(UnitTypeId.BARRACKS, 1),
                 ActUnit(UnitTypeId.MARINE, UnitTypeId.BARRACKS, 2)),
            Step(RequiredMinerals(250),
                 ActUnit(UnitTypeId.MARINE, UnitTypeId.BARRACKS, 100))
        ]

        super().__init__([
            scv, dt_counter, dt_counter2, self.depots, buildings, mech, air,
            marines
        ])
Beispiel #23
0
    async def create_plan(self) -> BuildOrder:
        self.knowledge.building_solver.wall_type = WallType.ProtossMainProtoss
        attack = PlanZoneAttack(7)
        attack.retreat_multiplier = 0.3
        # attack.attack_started = True
        backup = BuildOrder([
            Step(None,
                 ChronoUnitProduction(UnitTypeId.PROBE, UnitTypeId.NEXUS),
                 skip=RequiredUnitExists(UnitTypeId.PROBE,
                                         30,
                                         include_pending=True),
                 skip_until=RequiredUnitExists(UnitTypeId.ASSIMILATOR, 1)),
            ChronoUnitProduction(UnitTypeId.VOIDRAY, UnitTypeId.STARGATE),
            ActDefensiveCannons(0, 1),
            SequentialList([
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
                GridBuilding(UnitTypeId.PYLON, 1),
                StepBuildGas(1),
                GridBuilding(UnitTypeId.GATEWAY, 1),
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 20),
                GridBuilding(UnitTypeId.CYBERNETICSCORE, 1),
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 21),
                ActExpand(2),
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
                StepBuildGas(2),
                GridBuilding(UnitTypeId.PYLON, 1),
                BuildOrder([
                    AutoPylon(),
                    GateUnit(UnitTypeId.STALKER, 2, priority=True),
                    ActTech(UpgradeId.WARPGATERESEARCH,
                            UnitTypeId.CYBERNETICSCORE),
                    [
                        ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
                        Step(RequiredUnitExists(UnitTypeId.NEXUS, 2),
                             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 44)),
                        StepBuildGas(3, skip=RequiredGas(300)),
                        Step(RequiredUnitExists(UnitTypeId.NEXUS, 3),
                             ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 56)),
                        StepBuildGas(5, skip=RequiredGas(200)),
                    ],
                    SequentialList([
                        Step(RequiredUnitReady(UnitTypeId.CYBERNETICSCORE, 1),
                             GridBuilding(UnitTypeId.TWILIGHTCOUNCIL, 1)),
                        GridBuilding(UnitTypeId.STARGATE, 1),
                        Step(
                            RequiredUnitReady(UnitTypeId.TWILIGHTCOUNCIL, 1),
                            ActTech(UpgradeId.CHARGE,
                                    UnitTypeId.TWILIGHTCOUNCIL)),
                        Step(
                            RequiredUnitReady(UnitTypeId.TWILIGHTCOUNCIL, 1),
                            ActTech(UpgradeId.ADEPTPIERCINGATTACK,
                                    UnitTypeId.TWILIGHTCOUNCIL)),
                    ]),
                    [
                        ActUnit(UnitTypeId.VOIDRAY,
                                UnitTypeId.STARGATE,
                                20,
                                priority=True)
                    ],
                    Step(RequiredTime(60 * 5), ActExpand(3)),
                    [GateUnit(UnitTypeId.STALKER, 30)],
                    [
                        GridBuilding(UnitTypeId.GATEWAY, 4),
                        StepBuildGas(4, skip=RequiredGas(200)),
                        GridBuilding(UnitTypeId.STARGATE, 2),
                    ]
                ])
            ]),
        ])
        proxy_zealots = ProxyZealots()

        return BuildOrder([
            SequentialList([
                Step(None,
                     proxy_zealots,
                     skip=RequireCustom(
                         lambda k: self.knowledge.lost_units_manager.
                         own_lost_type(UnitTypeId.GATEWAY))), backup
            ]),
            [
                PlanDistributeWorkers(),
                PlanZoneDefense(),
                PlanZoneGather(),
                attack,
                PlanFinishEnemy(),
            ],
            ChronoUnitProduction(UnitTypeId.ZEALOT, UnitTypeId.GATEWAY)
        ])
Beispiel #24
0
    def cannon_contain(self) -> ActBase:
        self.knowledge.print(f"Cannon contain", "Build")
        enemy_main = self.knowledge.expansion_zones[-1]
        natural = self.knowledge.expansion_zones[-2]
        enemy_ramp = self.knowledge.enemy_base_ramp

        return Step(
            None,
            BuildOrder([
                [
                    ActUnitOnce(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
                    GridBuilding(UnitTypeId.FORGE, 1),
                    ActUnitOnce(UnitTypeId.PROBE, UnitTypeId.NEXUS, 18),
                ],
                [
                    BuildPosition(UnitTypeId.PYLON, natural.center_location),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  natural.center_location.towards(
                                      enemy_ramp.bottom_center, 5),
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PYLON,
                                  natural.center_location.towards(
                                      enemy_ramp.bottom_center, 8),
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  natural.center_location.towards(
                                      enemy_ramp.top_center, 13),
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PYLON,
                                  natural.center_location.towards(
                                      enemy_ramp.bottom_center, 16),
                                  exact=False,
                                  only_once=True),
                    BuildPosition(UnitTypeId.PHOTONCANNON,
                                  natural.center_location.towards(
                                      enemy_ramp.top_center, 20),
                                  exact=False,
                                  only_once=True),
                ],
                [
                    BuildPosition(UnitTypeId.PYLON,
                                  natural.behind_mineral_position_center,
                                  exact=False,
                                  only_once=True),
                    BuildPosition(
                        UnitTypeId.PHOTONCANNON,
                        natural.center_location.towards(
                            enemy_main.behind_mineral_position_center, 5),
                        exact=False,
                        only_once=True),
                    BuildPosition(
                        UnitTypeId.PYLON,
                        natural.center_location.towards(
                            enemy_main.behind_mineral_position_center, 8),
                        exact=False,
                        only_once=True),
                    BuildPosition(
                        UnitTypeId.PHOTONCANNON,
                        natural.center_location.towards(
                            enemy_main.behind_mineral_position_center, 12),
                        exact=False,
                        only_once=True),
                    BuildPosition(
                        UnitTypeId.PYLON,
                        natural.center_location.towards(
                            enemy_main.behind_mineral_position_center, 16),
                        exact=False,
                        only_once=True),
                    BuildPosition(
                        UnitTypeId.PHOTONCANNON,
                        natural.center_location.towards(
                            enemy_main.behind_mineral_position_center, 20),
                        exact=False,
                        only_once=True),
                ],
                ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 16),
            ]),
            # Skip cannon rushing if we started nexus, or have over 750 minerals, the build is probably stuck
            skip=RequiredAny([
                RequiredUnitExists(UnitTypeId.NEXUS, 2),
                RequiredMinerals(750)
            ]))
Beispiel #25
0
    async def create_plan(self) -> BuildOrder:
        self.tactic_index = random.randint(0, 2)

        if self.tactic_index == 0:
            self.knowledge.print("Proxy 2 rax bunker rush", "Build")
            self.attack = DodgeRampAttack(3)
            zone = self.knowledge.expansion_zones[-random.randint(3, 5)]
            natural = self.knowledge.expansion_zones[-2]
            chunk = [
                Step(RequiredSupply(12), GridBuilding(UnitTypeId.SUPPLYDEPOT,
                                                      1)),
                BuildPosition(UnitTypeId.BARRACKS,
                              zone.center_location,
                              exact=False,
                              only_once=True),
                BuildPosition(UnitTypeId.BARRACKS,
                              zone.center_location.towards(
                                  self.knowledge.enemy_base_ramp.bottom_center,
                                  5),
                              exact=False,
                              only_once=True),
                BuildPosition(UnitTypeId.BARRACKS,
                              zone.center_location.towards(
                                  self.game_info.map_center, 5),
                              exact=False,
                              only_once=True),
                Step(None, GridBuilding(UnitTypeId.SUPPLYDEPOT, 2)),
                Step(
                    RequiredUnitReady(UnitTypeId.MARINE, 1),
                    BuildPosition(UnitTypeId.BUNKER,
                                  natural.center_location.towards(
                                      self.game_info.map_center, 6),
                                  exact=False,
                                  only_once=True)),
                Step(RequiredMinerals(225),
                     GridBuilding(UnitTypeId.BARRACKS, 6)),
            ]
        elif self.tactic_index == 1:
            self.knowledge.print("20 marine all in", "Build")
            self.attack = DodgeRampAttack(20)
            chunk = [
                Step(RequiredSupply(14), GridBuilding(UnitTypeId.SUPPLYDEPOT,
                                                      1)),
                Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 1),
                     GridBuilding(UnitTypeId.BARRACKS, 1)),
                Step(None, GridBuilding(UnitTypeId.SUPPLYDEPOT, 2)),
                GridBuilding(UnitTypeId.BARRACKS, 6),
            ]
        else:
            self.knowledge.print("10 marine proxy rax", "Build")
            self.attack = DodgeRampAttack(10)
            zone = self.knowledge.expansion_zones[-random.randint(3, 5)]
            chunk = [
                Step(RequiredSupply(14), GridBuilding(UnitTypeId.SUPPLYDEPOT,
                                                      1)),
                Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 1),
                     GridBuilding(UnitTypeId.BARRACKS, 1)),
                Step(None, GridBuilding(UnitTypeId.SUPPLYDEPOT, 2)),
                BuildPosition(UnitTypeId.BARRACKS,
                              zone.center_location,
                              exact=False,
                              only_once=True),
                BuildPosition(UnitTypeId.BARRACKS,
                              zone.center_location.towards(
                                  self.knowledge.enemy_base_ramp.bottom_center,
                                  5),
                              exact=False,
                              only_once=True),
                Step(RequiredMinerals(225),
                     GridBuilding(UnitTypeId.BARRACKS, 6)),
            ]

        empty = BuildOrder([])

        worker_scout = Step(None,
                            WorkerScout(),
                            skip_until=RequiredUnitExists(
                                UnitTypeId.SUPPLYDEPOT, 1))
        self.distribute_workers = PlanDistributeWorkers()

        tactics = [
            PlanCancelBuilding(),
            LowerDepots(),
            PlanZoneDefense(),
            worker_scout,
            Step(None, CallMule(50), skip=RequiredTime(5 * 60)),
            Step(None, CallMule(100), skip_until=RequiredTime(5 * 60)),
            Step(None, ScanEnemy(), skip_until=RequiredTime(5 * 60)),
            self.distribute_workers,
            ManTheBunkers(),
            Repair(),
            ContinueBuilding(),
            PlanZoneGatherTerran(),
            Step(None, self.attack),
            PlanFinishEnemy(),
        ]

        return BuildOrder([
            empty.depots,
            Step(None,
                 MorphOrbitals(),
                 skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            [
                Step(None, ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER,
                                   20))
            ], chunk,
            ActUnit(UnitTypeId.MARINE, UnitTypeId.BARRACKS, 200),
            SequentialList(tactics)
        ])
Beispiel #26
0
    def __init__(self):
        self.worker_rushed = False
        self.rush_bunker = BuildPosition(UnitTypeId.BUNKER, Point2((0,0)), exact=True)
        viking_counters = [UnitTypeId.COLOSSUS, UnitTypeId.MEDIVAC, UnitTypeId.RAVEN, UnitTypeId.VOIDRAY,
                           UnitTypeId.CARRIER, UnitTypeId.TEMPEST, UnitTypeId.BROODLORD]

        warn = WarnBuildMacro([
            (UnitTypeId.SUPPLYDEPOT, 1, 18),
            (UnitTypeId.BARRACKS, 1, 42),
            (UnitTypeId.REFINERY, 1, 44),
            (UnitTypeId.COMMANDCENTER, 2, 60 + 44),
            (UnitTypeId.BARRACKSREACTOR, 1, 120),
            (UnitTypeId.FACTORY, 1, 120 + 21),
        ], [])

        scv = [
            Step(None, TerranUnit(UnitTypeId.MARINE, 2, priority=True), skip_until=lambda k: self.worker_rushed),
            Step(None, MorphOrbitals(), skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            Step(None, ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 16 + 6),
                 skip=RequiredUnitExists(UnitTypeId.COMMANDCENTER, 2)),
            Step(None, ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 32 + 12))
        ]

        dt_counter = [
            Step(RequiredAny([RequiredEnemyBuildingExists(UnitTypeId.DARKSHRINE),
                              RequiredEnemyUnitExistsAfter(UnitTypeId.DARKTEMPLAR),
                              RequiredEnemyUnitExistsAfter(UnitTypeId.BANSHEE)]), None),
            Step(None, GridBuilding(UnitTypeId.ENGINEERINGBAY, 1)),
            Step(None, DefensiveBuilding(UnitTypeId.MISSILETURRET, DefensePosition.Entrance, 2)),
            Step(None, DefensiveBuilding(UnitTypeId.MISSILETURRET, DefensePosition.CenterMineralLine, None))
        ]
        dt_counter2 = [
            Step(RequiredAny([RequiredEnemyBuildingExists(UnitTypeId.DARKSHRINE),
                              RequiredEnemyUnitExistsAfter(UnitTypeId.DARKTEMPLAR),
                              RequiredEnemyUnitExistsAfter(UnitTypeId.BANSHEE)]), None),
            Step(None, GridBuilding(UnitTypeId.STARPORT, 2)),
            Step(None, ActBuildAddon(UnitTypeId.STARPORTTECHLAB, UnitTypeId.STARPORT, 1)),
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1), ActUnit(UnitTypeId.RAVEN, UnitTypeId.STARPORT, 2)),
        ]

        opener = [
            Step(RequiredSupply(13), GridBuilding(UnitTypeId.SUPPLYDEPOT, 1, priority=True)),
            GridBuilding(UnitTypeId.BARRACKS, 1, priority=True),
            StepBuildGas(1, RequiredSupply(15)),
            TerranUnit(UnitTypeId.REAPER, 1, only_once=True, priority=True),
            Step(None, ActExpand(2), skip_until=RequiredAny([
                RequireCustom(lambda k: not k.possible_rush_detected),
                RequiredUnitExists(UnitTypeId.SIEGETANK, 2, include_killed=True)
            ])),
            Step(None, CancelBuilding(UnitTypeId.COMMANDCENTER, 1), skip=RequiredAny([
                RequireCustom(lambda k: not k.possible_rush_detected),
                RequiredUnitExists(UnitTypeId.SIEGETANK, 2, include_killed=True)
            ])),

            Step(None, self.rush_bunker, skip_until=lambda k: k.possible_rush_detected),
            Step(None, GridBuilding(UnitTypeId.BARRACKS, 2), skip_until=lambda k: k.possible_rush_detected),
            GridBuilding(UnitTypeId.SUPPLYDEPOT, 2, priority=True),
            ActBuildAddon(UnitTypeId.BARRACKSREACTOR, UnitTypeId.BARRACKS, 1),
            GridBuilding(UnitTypeId.FACTORY, 1),
            ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY, 1),

            AutoDepot()
        ]

        buildings = [
            Step(None, GridBuilding(UnitTypeId.BARRACKS, 2)),
            Step(RequiredUnitReady(UnitTypeId.FACTORYTECHLAB), TerranUnit(UnitTypeId.SIEGETANK, 1)),
            StepBuildGas(2),
            # BuildStep(None, GridBuilding(UnitTypeId.ARMORY, 1)),
            Step(None, ActBuildAddon(UnitTypeId.BARRACKSTECHLAB, UnitTypeId.BARRACKS, 1)),
            Step(None, GridBuilding(UnitTypeId.STARPORT, 1)),
            Step(None, GridBuilding(UnitTypeId.BARRACKS, 3)),
            Step(None, ActBuildAddon(UnitTypeId.BARRACKSTECHLAB, UnitTypeId.BARRACKS, 2)),

            Step(RequiredSupply(40, SupplyType.Workers), ActExpand(3)),

            Step(None, GridBuilding(UnitTypeId.BARRACKS, 5)),
            Step(None, ActBuildAddon(UnitTypeId.BARRACKSREACTOR, UnitTypeId.BARRACKS, 3)),

            Step(None, ActBuildAddon(UnitTypeId.STARPORTREACTOR, UnitTypeId.STARPORT, 1)),
            StepBuildGas(4),
        ]

        tech = [
            Step(None, ActTech(UpgradeId.PUNISHERGRENADES, UnitTypeId.BARRACKSTECHLAB)),
            Step(None, ActTech(UpgradeId.STIMPACK, UnitTypeId.BARRACKSTECHLAB)),
            Step(None, ActTech(UpgradeId.SHIELDWALL, UnitTypeId.BARRACKSTECHLAB)),
        ]

        mech = [
            TerranUnit(UnitTypeId.SIEGETANK, 2, priority=True)
        ]

        air = [
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1), TerranUnit(UnitTypeId.MEDIVAC, 2, priority=True)),
            Step(None, TerranUnit(UnitTypeId.VIKINGFIGHTER, 1, priority=True)),
            Step(None, TerranUnit(UnitTypeId.VIKINGFIGHTER, 3, priority=True), skip_until=self.RequireAnyEnemyUnits(viking_counters, 1)),
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1), TerranUnit(UnitTypeId.MEDIVAC, 4, priority=True)),
            Step(None, TerranUnit(UnitTypeId.VIKINGFIGHTER, 10, priority=True), skip_until=self.RequireAnyEnemyUnits(viking_counters, 4)),
            Step(RequiredUnitReady(UnitTypeId.STARPORT, 1), TerranUnit(UnitTypeId.MEDIVAC, 6, priority=True)),
        ]

        marines = [
            Step(RequiredUnitExists(UnitTypeId.REAPER, 1, include_killed=True), TerranUnit(UnitTypeId.MARINE, 2)),
            BuildOrder([
                TerranUnit(UnitTypeId.MARAUDER, 20, priority=True),
                TerranUnit(UnitTypeId.MARINE, 20),
                Step(RequiredMinerals(250), TerranUnit(UnitTypeId.MARINE, 100))
            ]),
        ]

        use_money = BuildOrder([
            Step(RequiredMinerals(400), GridBuilding(UnitTypeId.BARRACKS, 8)),
            Step(RequiredMinerals(500), ActBuildAddon(UnitTypeId.BARRACKSREACTOR, UnitTypeId.BARRACKS, 6)),
        ])

        super().__init__([warn, scv, opener, buildings,
                          dt_counter, dt_counter2,
                          tech,
                          mech, air, marines,
                          use_money])
Beispiel #27
0
 def depots(self) -> List[Step]:
     return [
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 1), None),
         Step(RequiredSupplyLeft(6), GridBuilding(UnitTypeId.SUPPLYDEPOT,
                                                  2)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 2), None),
         Step(RequiredSupplyLeft(14), GridBuilding(UnitTypeId.SUPPLYDEPOT,
                                                   4)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 4), None),
         Step(RequiredSupplyLeft(20), GridBuilding(UnitTypeId.SUPPLYDEPOT,
                                                   6)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 5), None),
         Step(RequiredSupplyLeft(20), GridBuilding(UnitTypeId.SUPPLYDEPOT,
                                                   7)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 6), None),
         Step(RequiredSupplyLeft(20),
              GridBuilding(UnitTypeId.SUPPLYDEPOT, 10)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 8), None),
         Step(RequiredSupplyLeft(20),
              GridBuilding(UnitTypeId.SUPPLYDEPOT, 12)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 10), None),
         Step(RequiredSupplyLeft(20),
              GridBuilding(UnitTypeId.SUPPLYDEPOT, 14)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 13), None),
         Step(RequiredSupplyLeft(20),
              GridBuilding(UnitTypeId.SUPPLYDEPOT, 16)),
         Step(RequiredUnitReady(UnitTypeId.SUPPLYDEPOT, 16),
              GridBuilding(UnitTypeId.SUPPLYDEPOT, 20)),
     ]
    def __init__(self):
        ultras = [
            Step(RequiredUnitExists(UnitTypeId.ULTRALISKCAVERN, 1), None),
            Step(RequiredGas(500), ActUnit(UnitTypeId.ULTRALISK, UnitTypeId.LARVA, priority=True)),
        ]

        units = [
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 100), skip=RequiredUnitExists(UnitTypeId.HIVE, 1)),
            Step(None, ActUnit(UnitTypeId.DRONE, UnitTypeId.LARVA, 50)),
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), ActUnit(UnitTypeId.ZERGLING, UnitTypeId.LARVA),
                 None)
        ]

        build_step_expansions = [
            Step(None, ActExpand(999)),
        ]

        queens = [
            Step(RequiredUnitExists(UnitTypeId.SPAWNINGPOOL, 1), None),
            Step(RequiredMinerals(500), ActUnit(UnitTypeId.QUEEN, UnitTypeId.HATCHERY, 5)),
        ]

        pool_and_tech = [
            Step(None, ActBuilding(UnitTypeId.SPAWNINGPOOL, 1)),
            StepBuildGas(2, None),
            Step(None, ActTech(UpgradeId.ZERGLINGMOVEMENTSPEED, UnitTypeId.SPAWNINGPOOL)),
            Step(RequiredGas(120), ActBuilding(UnitTypeId.EVOLUTIONCHAMBER, 2)),

            Step(RequiredUnitExists(UnitTypeId.EVOLUTIONCHAMBER, 1),
                 ActTech(UpgradeId.ZERGMELEEWEAPONSLEVEL1, UnitTypeId.EVOLUTIONCHAMBER)),
            Step(None, ActTech(UpgradeId.ZERGGROUNDARMORSLEVEL1, UnitTypeId.EVOLUTIONCHAMBER)),
            Step(None, MorphLair(), skip=RequiredUnitExists(UnitTypeId.HIVE, 1)),
            StepBuildGas(4, None),
            Step(None, ActTech(UpgradeId.ZERGMELEEWEAPONSLEVEL2, UnitTypeId.EVOLUTIONCHAMBER)),
            Step(None, ActTech(UpgradeId.ZERGGROUNDARMORSLEVEL2, UnitTypeId.EVOLUTIONCHAMBER)),
            # Infestation pit required
            Step(None, ActBuilding(UnitTypeId.INFESTATIONPIT, 1)),
            Step(RequiredUnitReady(UnitTypeId.INFESTATIONPIT, 1), MorphHive()),

            Step(RequiredUnitReady(UnitTypeId.HIVE, 1), ActTech(UpgradeId.ZERGLINGATTACKSPEED, UnitTypeId.SPAWNINGPOOL)),
            StepBuildGas(6, None),
            Step(None, ActBuilding(UnitTypeId.ULTRALISKCAVERN, 1)),
            Step(None, ActTech(UpgradeId.ZERGMELEEWEAPONSLEVEL3, UnitTypeId.EVOLUTIONCHAMBER)),
            Step(None, ActTech(UpgradeId.ZERGGROUNDARMORSLEVEL3, UnitTypeId.EVOLUTIONCHAMBER)),
            Step(None, ActTech(UpgradeId.CHITINOUSPLATING, UnitTypeId.ULTRALISKCAVERN)),
            # TODO: Ultra lisk speed?
            Step(None, ActTech(UpgradeId.ANABOLICSYNTHESIS, UnitTypeId.ULTRALISKCAVERN)),
            # ULTRALISKCAVERNRESEARCH_EVOLVEANABOLICSYNTHESIS2
        ]

        super().__init__([
            self.overlords,
            ultras,
            units,
            build_step_expansions,
            queens,
            pool_and_tech
        ])
Beispiel #29
0
    async def create_plan(self) -> BuildOrder:
        buildings = [
            Step(RequiredSupply(13), GridBuilding(UnitTypeId.SUPPLYDEPOT, 1)),
            Step(RequiredSupply(16), ActExpand(2)),
            Step(RequiredSupply(18), GridBuilding(UnitTypeId.BARRACKS, 1)),
            StepBuildGas(1),
            Step(RequiredSupply(20), GridBuilding(UnitTypeId.SUPPLYDEPOT, 2)),
            Step(None,
                 StepBuildGas(2),
                 skip_until=RequiredUnitExists(UnitTypeId.MARINE, 2)),
            Step(None,
                 GridBuilding(UnitTypeId.FACTORY, 1),
                 skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
            GridBuilding(UnitTypeId.FACTORY, 1),
            ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY, 1),
            StepBuildGas(4),
            Step(None, ActExpand(3)),
            GridBuilding(UnitTypeId.FACTORY, 2),
            ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY, 2),
            Step(None,
                 ActTech(UpgradeId.CYCLONELOCKONDAMAGEUPGRADE,
                         UnitTypeId.FACTORYTECHLAB),
                 skip_until=RequiredUnitReady(UnitTypeId.FACTORYTECHLAB, 1)),
            StepBuildGas(5),
            Step(None,
                 ActTech(UpgradeId.HIGHCAPACITYBARRELS,
                         UnitTypeId.FACTORYTECHLAB),
                 skip_until=RequiredUnitReady(UnitTypeId.FACTORYTECHLAB, 2)),
            StepBuildGas(6, None, RequiredGas(100)),
            Step(RequiredMinerals(400), GridBuilding(UnitTypeId.FACTORY, 4)),
            Step(
                None,
                ActBuildAddon(UnitTypeId.FACTORYREACTOR, UnitTypeId.FACTORY,
                              1)),
            ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY, 3),
            Step(RequiredMinerals(400), ActExpand(4)),
            GridBuilding(UnitTypeId.ENGINEERINGBAY, 1),
            StepBuildGas(8),
            GridBuilding(UnitTypeId.FACTORY, 6),
            Step(RequiredMinerals(400), GridBuilding(UnitTypeId.FACTORY, 8)),
            ActBuildAddon(UnitTypeId.FACTORYTECHLAB, UnitTypeId.FACTORY, 7),
            Step(RequiredSupply(120), GridBuilding(UnitTypeId.ARMORY, 2)),
        ]

        upgrades = [
            Step(
                RequiredUnitReady(UnitTypeId.ARMORY, 1),
                ActTech(UpgradeId.TERRANVEHICLEWEAPONSLEVEL1,
                        UnitTypeId.ARMORY)),
            ActTech(UpgradeId.TERRANVEHICLEANDSHIPARMORSLEVEL1,
                    UnitTypeId.ARMORY),
            ActTech(UpgradeId.TERRANVEHICLEWEAPONSLEVEL2, UnitTypeId.ARMORY),
            ActTech(UpgradeId.TERRANVEHICLEANDSHIPARMORSLEVEL2,
                    UnitTypeId.ARMORY),
            ActTech(UpgradeId.TERRANVEHICLEWEAPONSLEVEL3, UnitTypeId.ARMORY),
            ActTech(UpgradeId.TERRANVEHICLEANDSHIPARMORSLEVEL3,
                    UnitTypeId.ARMORY),
        ]

        self.attack = PlanZoneAttack(40)

        worker_scout = Step(None,
                            WorkerScout(),
                            skip_until=RequiredUnitExists(
                                UnitTypeId.SUPPLYDEPOT, 1))
        self.distribute_workers = PlanDistributeWorkers()

        tactics = [
            PlanCancelBuilding(),
            LowerDepots(),
            PlanZoneDefense(),
            worker_scout,
            Step(None, CallMule(50), skip=RequiredTime(5 * 60)),
            Step(None, CallMule(100), skip_until=RequiredTime(5 * 60)),
            Step(None, ScanEnemy(), skip_until=RequiredTime(5 * 60)),
            self.distribute_workers,
            ManTheBunkers(),
            Repair(),
            ContinueBuilding(),
            PlanZoneGatherTerran(),
            Step(RequiredTechReady(UpgradeId.CYCLONELOCKONDAMAGEUPGRADE, 0.95),
                 self.attack),
            PlanFinishEnemy(),
        ]

        return BuildOrder([
            Step(RequiredUnitExists(UnitTypeId.BARRACKS, 1),
                 SequentialList(self.depots)),
            [
                Step(RequiredUnitExists(UnitTypeId.COMMANDCENTER, 2),
                     MorphOrbitals(3),
                     skip_until=RequiredUnitReady(UnitTypeId.BARRACKS, 1)),
                Step(None,
                     MorphPlanetary(2),
                     skip_until=RequiredUnitReady(UnitTypeId.ENGINEERINGBAY,
                                                  1)),
            ],
            [
                Step(None, ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER,
                                   40)),
                Step(RequiredUnitExists(UnitTypeId.COMMANDCENTER, 3),
                     ActUnit(UnitTypeId.SCV, UnitTypeId.COMMANDCENTER, 70))
            ], upgrades,
            ActUnit(UnitTypeId.MARINE, UnitTypeId.BARRACKS, 4),
            [
                ActUnit(UnitTypeId.CYCLONE, UnitTypeId.FACTORY, 4),
                ActUnitOnce(UnitTypeId.HELLION, UnitTypeId.FACTORY, 1),
                ActUnit(UnitTypeId.CYCLONE, UnitTypeId.FACTORY, 4),
                ActUnit(UnitTypeId.CYCLONE,
                        UnitTypeId.FACTORY,
                        120,
                        priority=True),
            ],
            Step(
                RequiredUnitReady(UnitTypeId.FACTORYREACTOR, 1),
                ActUnit(UnitTypeId.HELLION, UnitTypeId.FACTORY, 60),
                skip_until=RequiredMinerals(300),
            ), buildings,
            SequentialList(tactics)
        ])