private BuildList MainBuild() { BuildList result = new BuildList(); result.If(() => { return(!StrategyAnalysis.WorkerRush.Get().Detected || Count(UnitTypes.ZERGLING) >= 10); }); result.Morph(UnitTypes.DRONE, 14); result.Building(UnitTypes.SPAWNING_POOL); result.Building(UnitTypes.SPINE_CRAWLER, Main, MainDefensePos, 2); result.Building(UnitTypes.EXTRACTOR); result.Morph(UnitTypes.DRONE, 4); result.If(() => { return(Count(UnitTypes.QUEEN) > 0); }); result.Building(UnitTypes.ROACH_WARREN); result.Morph(UnitTypes.ROACH, 6); result.If(() => { return(Count(UnitTypes.LAIR) > 0); }); result.Building(UnitTypes.EXTRACTOR); result.Morph(UnitTypes.ROACH, 5, () => { return(!ReaperRush.Get().Detected); }); result.Morph(UnitTypes.OVERSEER); result.Building(UnitTypes.HYDRALISK_DEN); result.Morph(UnitTypes.ROACH, 4, () => { return(!ReaperRush.Get().Detected); }); result.Morph(UnitTypes.HYDRALISK, 5); result.Morph(UnitTypes.OVERSEER); result.Morph(UnitTypes.HYDRALISK, 80); return(result); }
public override void OnFrame(Bot bot) { if (FourRax.Get().Detected || (bot.Frame >= 22.4 * 85 && !bot.EnemyStrategyAnalyzer.NoProxyTerranConfirmed && bot.TargetManager.PotentialEnemyStartLocations.Count == 1) || ReaperRush.Get().Detected) { SmellCheese = true; } foreach (Agent agent in bot.UnitManager.Agents.Values) { if (agent.Unit.UnitType == UnitTypes.LARVA) { if (Count(UnitTypes.DRONE) >= 11 && Count(UnitTypes.SPAWNING_POOL) == 0) { break; } if (Minerals() >= 50 && ExpectedAvailableFood() > FoodUsed() + 2 && Count(UnitTypes.DRONE) < 45 - Completed(UnitTypes.EXTRACTOR) && (Count(UnitTypes.DRONE) < 40 - Completed(UnitTypes.EXTRACTOR) || Count(UnitTypes.HATCHERY) + Count(UnitTypes.LAIR) + Count(UnitTypes.HIVE) >= 3) && (Count(UnitTypes.ZERGLING) >= 10 || Count(UnitTypes.DRONE) <= 14) && (Count(UnitTypes.ZERGLING) >= 20 || Count(UnitTypes.DRONE) <= 18)) { agent.Order(1342); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.DRONE); } else if (Completed(UnitTypes.SPAWNING_POOL) > 0 && Count(UnitTypes.ZERGLING) < 20 && Minerals() >= 50 && ExpectedAvailableFood() > FoodUsed() + 4 && (Count(UnitTypes.SPINE_CRAWLER) >= 2 || Minerals() >= 200)) { agent.Order(1343); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ZERGLING); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ZERGLING); } else if (Completed(UnitTypes.SPIRE) + Completed(UnitTypes.GREATER_SPIRE) > 0 && Minerals() >= 100 && Gas() >= 100 && ExpectedAvailableFood() > FoodUsed() + 4) { agent.Order(1346); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.MUTALISK); } else if (Minerals() >= 100 && FoodUsed() + Bot.Main.UnitManager.Count(UnitTypes.HATCHERY) * 2 + Bot.Main.UnitManager.Count(UnitTypes.LAIR) * 2 + Bot.Main.UnitManager.Count(UnitTypes.HIVE) * 2 >= ExpectedAvailableFood() - 2) { agent.Order(1344); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.OVERLORD); bot.UnitManager.FoodExpected += 8; } } } }
public override void OnFrame(Bot bot) { WorkerScoutTask.Task.Stopped = bot.Frame >= 40 * 22.4 || StrategyAnalysis.WorkerRush.Get().Detected; if (WorkerScoutTask.Task.Stopped) { WorkerScoutTask.Task.Clear(); } if (StrategyAnalysis.WorkerRush.Get().Detected) { foreach (WorkerDefenseTask task in WorkerDefenseTask.Tasks) { task.DefenseRadius = 6; } } DefenseTask.GroundDefenseTask.Stopped = ReaperRush.Get().Detected&& Completed(UnitTypes.HYDRALISK) + Completed(UnitTypes.ROACH) >= 25; if (DefenseTask.GroundDefenseTask.Stopped) { DefenseTask.GroundDefenseTask.Clear(); } DefenseTask.AirDefenseTask.Stopped = ReaperRush.Get().Detected&& Completed(UnitTypes.HYDRALISK) + Completed(UnitTypes.ROACH) >= 25; if (DefenseTask.AirDefenseTask.Stopped) { DefenseTask.AirDefenseTask.Clear(); } TimingAttackTask.Task.RetreatSize = 5; TimingAttackTask.Task.RequiredSize = ReaperRush.Get().Detected&& !TimingAttackTask.Task.AttackSent ? 15 : 25; TimingAttackTask.Task.DefendOtherAgents = false; DefenseTask.GroundDefenseTask.MainDefenseRadius = 20; DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 20; DefenseTask.GroundDefenseTask.MaxDefenseRadius = 55; DefenseTask.AirDefenseTask.MainDefenseRadius = 20; DefenseTask.AirDefenseTask.ExpandDefenseRadius = 20; DefenseTask.AirDefenseTask.MaxDefenseRadius = 55; GasWorkerTask.WorkersPerGas = 3; if (!TakeExpand) { TakeExpand = Completed(UnitTypes.ROACH) + Completed(UnitTypes.HYDRALISK) + Completed(UnitTypes.QUEEN) >= TimingAttackTask.Task.RequiredSize; } if (!TakeExpand) { foreach (Agent agent in bot.UnitManager.Agents.Values) { if (agent.Unit.UnitType == UnitTypes.HATCHERY && agent.Unit.BuildProgress < 0.99) { agent.Order(Abilities.CANCEL); } } } }
public static Build GetDefenseBuild() { if (!SmellCheese) { if (Bot.Main.EnemyRace == Race.Terran) { if (FourRax.Get().Detected || (Bot.Main.Frame >= 22.4 * 85 && !Bot.Main.EnemyStrategyAnalyzer.NoProxyTerranConfirmed && Bot.Main.TargetManager.PotentialEnemyStartLocations.Count == 1) || ReaperRush.Get().Detected) { RushDefense.OnStart(Bot.Main); SmellCheese = true; } } else if (Bot.Main.EnemyRace == Race.Protoss) { if ((Bot.Main.Frame >= 22.4 * 60 * 1.5 && !Bot.Main.EnemyStrategyAnalyzer.NoProxyGatewayConfirmed) || (Bot.Main.Frame < 22.4 * 60 * 1.5 && ThreeGate.Get().Detected)) { RushDefense.OnStart(Bot.Main); SmellCheese = true; } } } if (StrategyAnalysis.WorkerRush.Get().Detected) { SmellCheese = true; } if (SmellCheese) { return(RushDefense); } else { return(null); } }
public override void OnFrame(Bot bot) { if (Count(UnitTypes.ZEALOT) + Count(UnitTypes.ADEPT) + Count(UnitTypes.STALKER) + Count(UnitTypes.COLOSUS) + Count(UnitTypes.IMMORTAL) >= attackTask.RequiredSize) { Attacking = true; } if (FourRax.Get().Detected || (bot.Frame >= 22.4 * 85 && !bot.EnemyStrategyAnalyzer.NoProxyTerranConfirmed && bot.TargetManager.PotentialEnemyStartLocations.Count == 1) || ReaperRush.Get().Detected) { SmellCheese = true; defenseTask.MainDefenseRadius = 21; } if (!TerranTech.Get().DetectedPreviously && (ReaperRush.Get().DetectedPreviously || FourRax.Get().DetectedPreviously)) { SmellCheese = true; } if (bot.EnemyRace == Race.Zerg && !PokeTask.Stopped) { if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.ZERGLING) >= 10 || bot.EnemyStrategyAnalyzer.Count(UnitTypes.SPINE_CRAWLER) >= 2 || bot.EnemyStrategyAnalyzer.Count(UnitTypes.ROACH) >= 5) { PokeTask.Stopped = true; PokeTask.Clear(); } } if (SmellCheese) { attackTask.RequiredSize = 15; attackTask.RetreatSize = 8; } if (SmellCheese && Completed(UnitTypes.ADEPT) < 8) { foreach (Agent agent in bot.UnitManager.Agents.Values) { if (agent.Unit.UnitType == UnitTypes.NEXUS && agent.Unit.BuildProgress < 0.99) { agent.Order(Abilities.CANCEL); } } } if (Bio.Get().Detected) { DefendMech = false; } else if (Mech.Get().Detected) { DefendMech = true; } else if (Bio.Get().DetectedPreviously) { DefendMech = false; } else if (Mech.Get().DetectedPreviously) { DefendMech = true; } else { DefendMech = false; } }
public override void OnFrame(Bot bot) { if (FourRax.Get().Detected || (bot.EnemyRace == Race.Terran && bot.Frame >= 22.4 * 85 && !bot.EnemyStrategyAnalyzer.NoProxyTerranConfirmed && bot.TargetManager.PotentialEnemyStartLocations.Count == 1) || ReaperRush.Get().Detected) { SmellCheese = true; TimingAttackTask.RequiredSize = 20; TimingAttackTask.RetreatSize = 6; foreach (QueenInjectTask queenInjectTask in QueenInjectTasks) { queenInjectTask.Priority = 6; } DefenseTask.ExpandDefenseRadius = 16; } if (SmellCheese) { foreach (Agent agent in bot.UnitManager.Agents.Values) { if (Count(UnitTypes.HATCHERY) >= 2 && agent.Unit.UnitType == UnitTypes.HATCHERY && agent.Unit.BuildProgress < 0.99) { agent.Order(Abilities.CANCEL); } if (agent.Unit.UnitType == UnitTypes.LARVA) { if (Count(UnitTypes.DRONE) >= 11 && Count(UnitTypes.SPAWNING_POOL) == 0) { break; } if (Minerals() >= 50 && ExpectedAvailableFood() > FoodUsed() + 2 && Count(UnitTypes.DRONE) < 17 - Completed(UnitTypes.EXTRACTOR)) { agent.Order(1342); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.DRONE); } else if (Completed(UnitTypes.SPIRE) + Completed(UnitTypes.GREATER_SPIRE) > 0 && Minerals() >= 100 && Gas() >= 100 && ExpectedAvailableFood() > FoodUsed() + 4) { agent.Order(1346); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.MUTALISK); } else if (Minerals() >= 75 && Gas() >= 25 && ExpectedAvailableFood() > FoodUsed() + 6 && (!Lifting.Get().Detected || Count(UnitTypes.ROACH) < 25)) { agent.Order(1351); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ROACH); } else if (Minerals() >= 100 && FoodUsed() > ExpectedAvailableFood() - 16) { agent.Order(1344); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.OVERLORD); bot.UnitManager.FoodExpected += 8; } } } return; } if (Completed(UnitTypes.LAIR) > 0 && Count(UnitTypes.OVERSEER) == 0) { MorphingTask.Task.Morph(UnitTypes.OVERSEER); } foreach (Agent agent in bot.UnitManager.Agents.Values) { if (agent.Unit.UnitType == UnitTypes.LARVA) { if (Count(UnitTypes.DRONE) >= 14 && Count(UnitTypes.SPAWNING_POOL) == 0) { break; } if (Minerals() >= 50 && ExpectedAvailableFood() > FoodUsed() + 2 && Count(UnitTypes.DRONE) < 45 - Completed(UnitTypes.EXTRACTOR) && (Count(UnitTypes.DRONE) < 40 - Completed(UnitTypes.EXTRACTOR) || Count(UnitTypes.HATCHERY) + Count(UnitTypes.LAIR) + Count(UnitTypes.HIVE) >= 3) && (Count(UnitTypes.ZERGLING) >= RequiredZerglings || Count(UnitTypes.DRONE) <= 18)) { agent.Order(1342); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.DRONE); } else if (Completed(UnitTypes.SPAWNING_POOL) > 0 && Count(UnitTypes.ZERGLING) < RequiredZerglings && Minerals() >= 50 && ExpectedAvailableFood() > FoodUsed() + 4 && (Count(UnitTypes.SPINE_CRAWLER) >= 2 || Minerals() >= 200)) { agent.Order(1343); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ZERGLING); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ZERGLING); } else if (Completed(UnitTypes.HYDRALISK_DEN) > 0 && Minerals() >= 100 && Gas() >= 50 && ExpectedAvailableFood() > FoodUsed() + 4) { agent.Order(1345); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.HYDRALISK); } else if (Minerals() >= 100 && FoodUsed() + Bot.Main.UnitManager.Count(UnitTypes.HATCHERY) * 2 + Bot.Main.UnitManager.Count(UnitTypes.LAIR) * 2 + Bot.Main.UnitManager.Count(UnitTypes.HIVE) * 2 >= ExpectedAvailableFood() - 2) { agent.Order(1344); CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.OVERLORD); bot.UnitManager.FoodExpected += 8; } } } }