public override void OnStart(Tyr tyr) { OverrideDefenseTarget = tyr.MapAnalyzer.Walk(NaturalDefensePos, tyr.MapAnalyzer.EnemyDistances, 15); MicroControllers.Add(StutterForwardController); MicroControllers.Add(FallBackController); MicroControllers.Add(new FearMinesController()); MicroControllers.Add(new StalkerController()); MicroControllers.Add(new DisruptorController()); MicroControllers.Add(new StutterController()); MicroControllers.Add(new HTController()); MicroControllers.Add(new ColloxenController()); MicroControllers.Add(new TempestController()); MicroControllers.Add(new AdvanceController()); if (WallIn == null) { WallIn = new WallInCreator(); WallIn.CreateNatural(new List <uint>() { UnitTypes.GATEWAY, UnitTypes.GATEWAY, UnitTypes.ZEALOT, UnitTypes.GATEWAY }); ShieldBatteryPos = DetermineShieldBatteryPos(); WallIn.ReserveSpace(); } Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0 && (Count(UnitTypes.CYBERNETICS_CORE) > 0 || tyr.EnemyStrategyAnalyzer.EarlyPool) && (Count(UnitTypes.GATEWAY) >= 2 || !tyr.EnemyStrategyAnalyzer.EarlyPool)); Set += ExpandBuildings(); Set += Units(); Set += MainBuild(); }
public override void OnStart(Bot bot) { OverrideDefenseTarget = bot.MapAnalyzer.Walk(NaturalDefensePos, bot.MapAnalyzer.EnemyDistances, 15); MicroControllers.Add(FearSpinesController); MicroControllers.Add(new HTController()); MicroControllers.Add(new AdeptKillWorkersController() { TargetTypes = new HashSet <uint> { UnitTypes.ZERGLING } }); MicroControllers.Add(new AdeptKillWorkersController()); MicroControllers.Add(new DodgeBallController()); MicroControllers.Add(new SoftLeashController(UnitTypes.ZEALOT, new HashSet <uint>() { UnitTypes.IMMORTAL, UnitTypes.ARCHON }, 6)); MicroControllers.Add(new SoftLeashController(UnitTypes.ARCHON, UnitTypes.IMMORTAL, 6)); MicroControllers.Add(StutterForwardController); MicroControllers.Add(FallBackController); MicroControllers.Add(new FearMinesController()); MicroControllers.Add(new StalkerController()); MicroControllers.Add(new DisruptorController()); MicroControllers.Add(new StutterController()); MicroControllers.Add(new ColloxenController()); MicroControllers.Add(new TempestController()); MicroControllers.Add(new AdvanceController()); if (WallIn == null) { WallIn = new WallInCreator(); WallIn.CreateNatural(new List <uint>() { UnitTypes.GATEWAY, UnitTypes.GATEWAY, UnitTypes.ZEALOT, UnitTypes.GATEWAY }); ShieldBatteryPos = DetermineShieldBatteryPos(); WallIn.ReserveSpace(); foreach (WallBuilding building in WallIn.Wall) { if (building.Type == UnitTypes.PYLON) { Bot.Main.buildingPlacer.ReservedLocation.Add(new ReservedBuilding() { Type = UnitTypes.NEXUS, Pos = building.Pos }); } } } Base third = null; float dist = 1000000; foreach (Base b in bot.BaseManager.Bases) { if (b == Main || b == Natural) { continue; } float newDist = SC2Util.DistanceSq(b.BaseLocation.Pos, Main.BaseLocation.Pos); if (newDist > dist) { continue; } dist = newDist; third = b; } NydusPos = new PotentialHelper(bot.MapAnalyzer.StartLocation, 18).To(third.BaseLocation.Pos).Get(); Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0 && (Count(UnitTypes.CYBERNETICS_CORE) > 0 || EarlyPool.Get().Detected) && (Count(UnitTypes.GATEWAY) >= 2 || !EarlyPool.Get().Detected)); Set += ExpandBuildings(); Set += Units(); Set += MainBuild(); }