Commit 073ad5ab authored by m1ndgames's avatar m1ndgames

update

parent 39513170
......@@ -86,6 +86,7 @@ class StalkerRush:
self.bot.do(stalker.attack(self.bot.commandertarget))
else:
if self.bot.enemy_units:
#enemies2 = self.units.filter(lambda unit: unit.type_id == UnitTypeId.STALKER and unit.distance_to(my_target) < 15)
enemies = self.bot.enemy_units
if enemies:
closeenemies = enemies.closer_than(15, stalker)
......
This diff is collapsed.
......@@ -14,9 +14,9 @@ class MutaliskRush:
"""Runs on every GameStep"""
if self.bot.iteration == 1:
self.bot.current_strategy = 'MutaliskRush'
self.bot.squadsize = 10
self.bot.attack_count = 10
self.bot.retreat_count = 3
self.bot.squadsize = 6
self.bot.attack_count = 12
self.bot.retreat_count = 2
self.bot.not_squadunit.append(UnitTypeId.QUEEN)
self.bot.not_commanderunit.append(UnitTypeId.QUEEN)
......@@ -36,6 +36,9 @@ class MutaliskRush:
if self.bot.townhalls.ready.amount >= 3:
await self.bot.unitmanager.createUnit("Queen", self.bot.townhalls.ready.amount)
if self.bot.minerals >= 200:
await self.bot.unitmanager.createUnit("Zergling", 100)
if self.bot.townhalls.amount == 1:
await self.bot.warmanager.expand()
......
......@@ -14,9 +14,9 @@ class ZerglingRush:
"""Runs on every GameStep"""
if self.bot.iteration == 1:
self.bot.current_strategy = 'ZerglingRush'
self.bot.squadsize = 10
self.bot.attack_count = 10
self.bot.retreat_count = 0
self.bot.squadsize = 6
self.bot.attack_count = 12
self.bot.retreat_count = 2
self.bot.not_squadunit.append(UnitTypeId.QUEEN)
self.bot.not_commanderunit.append(UnitTypeId.QUEEN)
......@@ -29,22 +29,19 @@ class ZerglingRush:
async def Macro(self):
"""Macro Routine"""
await self.bot.unitmanager.createUnit("Zergling", 100)
zerglings = self.bot.units(UnitTypeId.ZERGLING).ready
if not self.bot.structures(race_gas[self.bot.race]) and zerglings.amount >= 10:
if not self.bot.structures(race_gas[self.bot.race]):
await self.bot.ressources.createGas()
await self.bot.unitmanager.trainSkill("RESEARCH_ZERGLINGMETABOLICBOOST")
await self.bot.unitmanager.trainSkill("RESEARCH_ZERGLINGADRENALGLANDS")
await self.bot.unitmanager.createUnit("Zergling", 100)
if self.bot.townhalls.ready.amount >= 3:
await self.bot.unitmanager.createUnit("Queen", self.bot.townhalls.ready.amount)
await self.bot.warmanager.expand()
if self.bot.time >= 120:
await self.bot.warmanager.scout()
await self.bot.warmanager.scout()
async def Micro(self):
# zergling
......
......@@ -2,6 +2,7 @@ import random
import os
import configparser
from strategies.terran.MarineRush import *
from strategies.terran.ReaperRush import *
class TerranManager():
"""Protoss Race Manager"""
......@@ -22,11 +23,13 @@ class TerranManager():
def pickStrategy(self):
strategies = {
'MarineRush': MarineRush(self.bot)
'MarineRush': MarineRush(self.bot),
'ReaperRush': ReaperRush(self.bot)
}
# DEBUG Overrides
# self.bot.strategy = MarineRush(self.bot)
# self.bot.strategy = ReaperRush(self.bot)
# return
if self.bot.data_race_strategy in strategies:
......
......@@ -291,11 +291,13 @@ class UnitManager():
(morphbuildingid, morphability) = morphinfo
morphbuildingtype = UnitTypeId(morphbuildingid)
morphabilitytype = AbilityId(morphability)
morphbuilding = self.bot.structures(morphbuildingtype).ready.first
if morphbuilding:
print("Morphing: " + str(buildingname))
self.bot.do(morphbuilding(morphabilitytype))
return
morphbuildings = self.bot.structures(morphbuildingtype).ready
if morphbuildings:
morphbuilding = morphbuildings[0]
if morphbuilding:
print("Morphing: " + str(buildingname))
self.bot.do(morphbuilding(morphabilitytype))
return
else:
# Buildings that are build
# Return if there is no worker available
......
......@@ -459,7 +459,8 @@ class WarManager():
if not unit:
unit = self.bot.units.find_by_tag(self.bot.commander)
if not unit:
unit = self.bot.units(race_worker[self.bot.race]).ready.first
workers = self.bot.units(race_worker[self.bot.race]).ready
unit = workers[0]
if not unit:
return
......
......@@ -24,6 +24,16 @@ class ZergManager():
else:
await self.bot.strategy.Run()
def setStrategy(self, strategy):
if strategy:
strategies = {
'ZerglingRush': ZerglingRush(self.bot),
'MutaliskRush': MutaliskRush(self.bot),
'BanelingSpam': BanelingSpam(self.bot),
'RoachSpam': RoachSpam(self.bot)
}
self.bot.strategy = strategies[strategy]
def pickStrategy(self):
strategies = {
'ZerglingRush': ZerglingRush(self.bot),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment