@@ -9,8 +9,8 @@ def __init__(self, action, repeatable=False, priority=False):
99 self .is_repeatable = repeatable
1010 self .is_priority = priority
1111
12- async def execute (self , bot , state ):
13- e = await self .action (bot , state )
12+ async def execute (self , bot ):
13+ e = await self .action (bot )
1414 if not e and not self .is_repeatable :
1515 self .is_done = True
1616
@@ -23,7 +23,7 @@ def allow_repeat(self):
2323
2424
2525def expand (prioritize = False , repeatable = True ):
26- async def do_expand (bot , state ):
26+ async def do_expand (bot ):
2727 building = bot .basic_townhall_type
2828 can_afford = bot .can_afford (building )
2929 if can_afford :
@@ -35,7 +35,7 @@ async def do_expand(bot, state):
3535
3636
3737def train_unit (unit , on_building , prioritize = False , repeatable = False ):
38- async def do_train (bot , state ):
38+ async def do_train (bot ):
3939 buildings = bot .units (on_building ).ready .noqueue
4040 if buildings .exists :
4141 selected = buildings .first
@@ -52,7 +52,7 @@ async def do_train(bot, state):
5252
5353
5454def morph (unit , prioritize = False , repeatable = False ):
55- async def do_morph (bot , state ):
55+ async def do_morph (bot ):
5656 larvae = bot .units (UnitTypeId .LARVA )
5757 if larvae .exists :
5858 selected = larvae .first
@@ -69,7 +69,7 @@ async def do_morph(bot, state):
6969
7070
7171def construct (building , placement = None , prioritize = True , repeatable = False ):
72- async def do_build (bot , state ):
72+ async def do_build (bot ):
7373
7474 if not placement :
7575 location = bot .townhalls .first .position .towards (bot .game_info .map_center , 5 )
@@ -87,28 +87,28 @@ async def do_build(bot, state):
8787
8888
8989def add_supply (prioritize = True , repeatable = False ):
90- async def supply_spec (bot , state ):
90+ async def supply_spec (bot ):
9191 can_afford = bot .can_afford (bot .supply_type )
9292 if can_afford :
9393 if bot .race == Race .Zerg :
94- return await morph (bot .supply_type ).execute (bot , state )
94+ return await morph (bot .supply_type ).execute (bot )
9595 else :
96- return await construct (bot .supply_type ).execute (bot , state )
96+ return await construct (bot .supply_type ).execute (bot )
9797 else :
9898 return can_afford .action_result
9999
100100 return Command (supply_spec , priority = prioritize , repeatable = repeatable )
101101
102102
103103def add_gas (prioritize = True , repeatable = False ):
104- async def do_add_gas (bot , state ):
104+ async def do_add_gas (bot ):
105105 can_afford = bot .can_afford (bot .geyser_type )
106106 if not can_afford :
107107 return can_afford .action_result
108108
109109 owned_expansions = bot .owned_expansions
110110 for location , th in owned_expansions .items ():
111- vgs = state .vespene_geyser .closer_than (20.0 , th )
111+ vgs = bot . state .vespene_geyser .closer_than (20.0 , th )
112112 for vg in vgs :
113113 worker = bot .select_build_worker (vg .position )
114114 if worker is None :
0 commit comments