-
Notifications
You must be signed in to change notification settings - Fork 27
/
macro_stalkers.py
66 lines (60 loc) · 2.51 KB
/
macro_stalkers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from sc2.data import Race
from sc2.ids.unit_typeid import UnitTypeId
from sc2.ids.upgrade_id import UpgradeId
from sharpy.knowledges import KnowledgeBot
from sharpy.plans import BuildOrder, Step, SequentialList, StepBuildGas
from sharpy.plans.acts import *
from sharpy.plans.acts.protoss import *
from sharpy.plans.require import *
from sharpy.plans.tactics import *
class MacroStalkers(KnowledgeBot):
def __init__(self):
super().__init__("Sharp Spiders")
async def create_plan(self) -> BuildOrder:
return BuildOrder(
Step(
None,
ChronoUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS),
skip=UnitExists(UnitTypeId.PROBE, 40, include_pending=True),
skip_until=UnitExists(UnitTypeId.ASSIMILATOR, 1),
),
SequentialList(
ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 14),
GridBuilding(UnitTypeId.PYLON, 1),
ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 16),
BuildGas(1),
GridBuilding(UnitTypeId.GATEWAY, 1),
ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 20),
Expand(2),
GridBuilding(UnitTypeId.CYBERNETICSCORE, 1),
ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 21),
BuildGas(2),
ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
GridBuilding(UnitTypeId.PYLON, 1),
BuildOrder(
AutoPylon(),
Tech(UpgradeId.WARPGATERESEARCH),
[
ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 22),
Step(UnitExists(UnitTypeId.NEXUS, 2), ActUnit(UnitTypeId.PROBE, UnitTypeId.NEXUS, 44)),
StepBuildGas(3, skip=Gas(300)),
],
[ProtossUnit(UnitTypeId.STALKER, 100)],
[GridBuilding(UnitTypeId.GATEWAY, 7), StepBuildGas(4, skip=Gas(200))],
),
),
SequentialList(
MineOpenBlockedBase(),
PlanZoneDefense(),
RestorePower(),
DistributeWorkers(),
Step(None, SpeedMining(), lambda ai: ai.client.game_step > 5),
PlanZoneGather(),
Step(UnitReady(UnitTypeId.GATEWAY, 4), PlanZoneAttack(4)),
PlanFinishEnemy(),
),
)
class LadderBot(MacroStalkers):
@property
def my_race(self):
return Race.Protoss