Exemple #1
0
        public BuildList Units()
        {
            BuildList result = new BuildList();

            result.Train(UnitTypes.SCV, 16);
            result.Train(UnitTypes.SCV, 30, () => Count(UnitTypes.COMMAND_CENTER) >= 2);
            result.Train(UnitTypes.SCV, 50, () => Count(UnitTypes.COMMAND_CENTER) >= 3);
            result.Train(UnitTypes.ORBITAL_COMMAND);
            result.Train(UnitTypes.REAPER, 6);
            result.Train(UnitTypes.FACTORY_TECH_LAB, 1);
            if (SiegeTanks)
            {
                result.Train(UnitTypes.SIEGE_TANK, 10);
            }
            else
            {
                result.Train(UnitTypes.CYCLONE, 10);
            }
            result.Train(UnitTypes.STARPORT_TECH_LAB, () => Completed(UnitTypes.FUSION_CORE) > 0);
            result.Train(UnitTypes.RAVEN, 1, () => Completed(UnitTypes.BATTLECRUISER) >= 2);
            result.Train(UnitTypes.BATTLECRUISER, () => Completed(UnitTypes.FUSION_CORE) > 0);
            result.Upgrade(UpgradeType.YamatoCannon, () => Completed(UnitTypes.BATTLECRUISER) >= 2);
            result.Train(UnitTypes.VIKING_FIGHTER, 10, () => Lifting.Get().Detected);
            result.Train(UnitTypes.VIKING_FIGHTER, 10, () => Lifting.Get().Detected);
            result.Train(UnitTypes.LIBERATOR, 10);
            result.Train(UnitTypes.MARINE, () =>
                         Bot.Main.EnemyStrategyAnalyzer.TotalCount(UnitTypes.BANSHEE) > 0 ||
                         Gas() < 42 ||
                         Lifting.Get().Detected);
            result.Train(UnitTypes.REAPER, 16);
            result.Train(UnitTypes.MARINE);

            return(result);
        }
Exemple #2
0
        private BuildList MainBuild()
        {
            BuildList result = new BuildList();

            result.Building(UnitTypes.COMMAND_CENTER);
            result.Building(UnitTypes.SUPPLY_DEPOT);
            result.Building(UnitTypes.BARRACKS);
            result.Building(UnitTypes.REFINERY);
            result.Building(UnitTypes.BARRACKS);
            result.If(() => Count(UnitTypes.REAPER) > 0 && Minerals() >= 200);
            result.Building(UnitTypes.REFINERY);
            result.Building(UnitTypes.COMMAND_CENTER, () => Minerals() >= 550);
            result.Building(UnitTypes.REFINERY, 2);
            result.If(() => Lifting.Get().Detected || Count(UnitTypes.REAPER) >= 5 || Gas() >= 150);
            result.Building(UnitTypes.FACTORY);
            result.Building(UnitTypes.COMMAND_CENTER, () => Minerals() >= 550);
            result.Building(UnitTypes.COMMAND_CENTER, () => Minerals() >= 550);
            result.Building(UnitTypes.REFINERY, 4);
            result.If(() => Lifting.Get().Detected || (Gas() >= 150 && Count(UnitTypes.COMMAND_CENTER) >= 2));
            result.Building(UnitTypes.STARPORT);
            result.Building(UnitTypes.FUSION_CORE, () => Completed(UnitTypes.STARPORT) > 0 && Gas() >= 300 && Minerals() >= 300);
            result.Building(UnitTypes.STARPORT, () => Count(UnitTypes.COMMAND_CENTER) >= 4 && Count(UnitTypes.FUSION_CORE) > 0 && Count(UnitTypes.BATTLECRUISER) > 0);

            return(result);
        }
Exemple #3
0
        private BuildList AntiLifting()
        {
            BuildList result = new BuildList();

            result.If(() => { return(Lifting.Get().Detected); });
            result.Building(UnitTypes.EXTRACTOR, 2);
            result.Building(UnitTypes.SPIRE);
            return(result);
        }
Exemple #4
0
        private BuildList BuildPylonForPower()
        {
            BuildList result = new BuildList();

            result.If(() => { return(Lifting.Get().Detected); });
            result.If(() => { return(Minerals() >= 300 &&
                                     Count(UnitTypes.STARGATE) < 2 &&
                                     Completed(UnitTypes.CYBERNETICS_CORE) > 0 &&
                                     Count(UnitTypes.PYLON) == Completed(UnitTypes.PYLON)); });
            result += new BuildingStep(UnitTypes.PYLON, 5);

            return(result);
        }
Exemple #5
0
        private BuildList BuildStargatesAgainstLifters()
        {
            BuildList result = new BuildList();

            result.If(() => { return(Lifting.Get().Detected); });
            result += new BuildingStep(UnitTypes.GATEWAY);
            result += new BuildingStep(UnitTypes.ASSIMILATOR);
            result += new BuildingStep(UnitTypes.CYBERNETICS_CORE);
            result += new BuildingStep(UnitTypes.ASSIMILATOR);
            result += new BuildingStep(UnitTypes.STARGATE, 2);

            return(result);
        }
Exemple #6
0
        private BuildList BuildStargatesAgainstLifters()
        {
            BuildList result = new BuildList();

            result.If(() => Lifting.Get().Detected || Bot.Main.Frame >= 22.4 * 60 * 10 || CounterWorkerRush.Get().Detected);
            result.Building(UnitTypes.GATEWAY);
            result.Building(UnitTypes.ASSIMILATOR);
            result.Building(UnitTypes.CYBERNETICS_CORE);
            result.Train(UnitTypes.STALKER, 10, () => BuildStalkers);
            result.Building(UnitTypes.ASSIMILATOR, () => Count(UnitTypes.STALKER) > 0 || !BuildStalkers);
            result.Building(UnitTypes.STARGATE, 2, () => Count(UnitTypes.STALKER) > 0 || !BuildStalkers);

            return(result);
        }
Exemple #7
0
 public override void Produce(Bot bot, Agent agent)
 {
     /*
      * if (agent.Unit.UnitType == UnitTypes.NEXUS
      *  && Minerals() >= 50
      *  && Count(UnitTypes.PROBE) < 16)
      *  agent.Order(1006);
      */
     if (agent.Unit.UnitType == UnitTypes.GATEWAY && Minerals() >= 100 &&
         (Minerals() >= 150 || PylonPlaced || !ProxyPylon) &&
         Count(UnitTypes.STALKER) >= 5 || !Lifting.Get().Detected)
     {
         agent.Order(916);
     }
 }
    void Start()
    {
        vp1 = tutorialVideo1.GetComponent <UnityEngine.Video.VideoPlayer>();
        if (tutorialVideo2 != null)
        {
            vp2 = tutorialVideo2.GetComponent <UnityEngine.Video.VideoPlayer>();
        }

        if (player != null)
        {
            lf = player.GetComponent <Lifting>();
        }

        video = tutorialVideo1;
        vp    = vp1;
    }
Exemple #9
0
 public override void Produce(Bot bot, Agent agent)
 {
     if (UnitTypes.ResourceCenters.Contains(agent.Unit.UnitType))
     {
         if (Minerals() >= 100 && Completed(UnitTypes.QUEEN) == 0 &&
             Completed(UnitTypes.SPAWNING_POOL) > 0)
         {
             agent.Order(1632);
         }
         else if (Lifting.Get().Detected &&
                  Minerals() >= 150 && Gas() >= 100)
         {
             agent.Order(1216);
         }
     }
 }
Exemple #10
0
        public BuildList Units()
        {
            BuildList result = new BuildList();

            result.Train(UnitTypes.SCV, 16);
            result.Train(UnitTypes.ORBITAL_COMMAND);
            result.Train(UnitTypes.REAPER, 6);
            result.Train(UnitTypes.VIKING_FIGHTER, 10);
            result.If(() => Count(UnitTypes.REAPER) >= 2);
            result.Train(UnitTypes.MARINE, () =>
                         Bot.Main.EnemyStrategyAnalyzer.TotalCount(UnitTypes.BANSHEE) > 0 ||
                         Gas() < 42 ||
                         Lifting.Get().Detected);
            result.Train(UnitTypes.REAPER, 16);
            result.Train(UnitTypes.MARINE);

            return(result);
        }
Exemple #11
0
        public override void OnFrame(Bot bot)
        {
            if (!MessageSent)
            {
                if (bot.Enemies().Count > 0)
                {
                    MessageSent = true;
                    bot.Chat("Prepare to be TICKLED! :D");
                }
            }

            if (bot.Frame - LastReinforcementsFrame >= 100 &&
                WorkerTask.Task.Units.Count >= (Lifting.Get().Detected ? 22 : 12) &&
                !Lifting.Get().Detected)
            {
                LastReinforcementsFrame     = bot.Frame;
                WorkerRushTask.TakeWorkers += 6;
            }
        }
Exemple #12
0
        private BuildList MainBuild()
        {
            BuildList result = new BuildList();

            result.Building(UnitTypes.COMMAND_CENTER);
            result.Building(UnitTypes.SUPPLY_DEPOT);
            result.Building(UnitTypes.BARRACKS);
            result.Building(UnitTypes.REFINERY);
            result.Building(UnitTypes.BARRACKS);
            result.If(() => Count(UnitTypes.REAPER) > 0 && Minerals() >= 200);
            result.Building(UnitTypes.REFINERY);
            result.Building(UnitTypes.BARRACKS);
            result.Building(UnitTypes.BARRACKS);
            result.If(() => Lifting.Get().Detected || (Gas() >= 200 && Minerals() >= 250));
            result.Building(UnitTypes.FACTORY, () => Completed(UnitTypes.FACTORY_FLYING) == 0);
            result.Building(UnitTypes.STARPORT);

            return(result);
        }
Exemple #13
0
 public override void Produce(Bot bot, Agent agent)
 {
     if (SmellCheese)
     {
         if (UnitTypes.ResourceCenters.Contains(agent.Unit.UnitType))
         {
             if (Minerals() >= 100 && Completed(UnitTypes.QUEEN) == 0 &&
                 Completed(UnitTypes.SPAWNING_POOL) > 0)
             {
                 agent.Order(1632);
             }
             else if (Lifting.Get().Detected &&
                      Minerals() >= 150 && Gas() >= 100)
             {
                 agent.Order(1216);
             }
         }
         return;
     }
     if (UnitTypes.ResourceCenters.Contains(agent.Unit.UnitType))
     {
         if (Minerals() >= 100 && Completed(UnitTypes.QUEEN) < 3 &&
             Completed(UnitTypes.SPAWNING_POOL) > 0)
         {
             agent.Order(1632);
             CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.QUEEN);
         }
         else if (Minerals() >= 100 && Completed(UnitTypes.QUEEN) < 5 &&
                  Count(UnitTypes.LAIR) > 0)
         {
             agent.Order(1632);
             CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.QUEEN);
         }
         else if (Count(UnitTypes.SPINE_CRAWLER) > 0 &&
                  Minerals() >= 150 && Gas() >= 100 &&
                  Count(UnitTypes.LAIR) + Count(UnitTypes.HIVE) == 0 &&
                  Count(UnitTypes.ZERGLING) >= RequiredZerglings)
         {
             agent.Order(1216);
         }
     }
 }
Exemple #14
0
        private bool UseRecall()
        {
            if (Recalled)
            {
                return(false);
            }
            int enemyDefendingWorkers = 0;
            int enemyAttackingWorkers = 0;

            foreach (Unit enemy in Bot.Main.Enemies())
            {
                if (!UnitTypes.WorkerTypes.Contains(enemy.UnitType))
                {
                    continue;
                }
                if (SC2Util.DistanceSq(enemy.Pos, Bot.Main.MapAnalyzer.StartLocation) <= 30 * 30)
                {
                    enemyAttackingWorkers++;
                }
                if (SC2Util.DistanceSq(enemy.Pos, Bot.Main.TargetManager.PotentialEnemyStartLocations[0]) <= 30 * 30)
                {
                    enemyDefendingWorkers++;
                }
            }
            if (Lifting.Get().Detected&& enemyDefendingWorkers == 0)
            {
                return(true);
            }
            if (CounterWorkerRush.Get().Detected &&
                enemyDefendingWorkers == 0 &&
                Bot.Main.Frame >= 22.4 * 60)
            {
                return(true);
            }

            if (enemyAttackingWorkers >= 5)
            {
                return(true);
            }
            return(false);
        }
Exemple #15
0
        private BuildList BuildGateways()
        {
            BuildList result = new BuildList();

            if (RushWorkers > 3)
            {
                result.Building(UnitTypes.GATEWAY, 2);
                result.Building(UnitTypes.GATEWAY, 2, () => Count(UnitTypes.ZEALOT) >= 2);
            }
            else
            {
                result.Building(UnitTypes.GATEWAY, 3);
                result.Building(UnitTypes.GATEWAY, 1, () => Count(UnitTypes.ZEALOT) >= 4);
            }
            result.Building(UnitTypes.ASSIMILATOR, () => Lifting.Get().Detected);
            result.Building(UnitTypes.CYBERNETICS_CORE, () => Lifting.Get().Detected);
            result.Train(UnitTypes.STALKER, 5, () => Lifting.Get().Detected);
            //result.If(() => { return Count(UnitTypes.ZEALOT) >= 8; });
            //result.Building(UnitTypes.GATEWAY, 2);
            return(result);
        }
Exemple #16
0
        private BuildList AntiLifting()
        {
            BuildList result = new BuildList();

            result.If(() => {
                if (!Lifting.Get().Detected)
                {
                    return(false);
                }
                // First destroy non-lifted buildings.
                foreach (Unit enemy in Bot.Main.Enemies())
                {
                    if (UnitTypes.BuildingTypes.Contains(enemy.UnitType) && !enemy.IsFlying)
                    {
                        return(false);
                    }
                }
                return(true);
            });
            result.Building(UnitTypes.EXTRACTOR, 2);
            result.Building(UnitTypes.SPIRE);
            result.Morph(UnitTypes.MUTALISK, 10);
            return(result);
        }
Exemple #17
0
        public override void OnFrame(Bot bot)
        {
            FlyerAttackTask.Task.RequiredSize         = 4;
            ConstructionTask.Task.OnlyWorkersFromMain = true;

            bot.buildingPlacer.BuildInsideMainOnly = true;
            foreach (WorkerDefenseTask task in WorkerDefenseTask.Tasks)
            {
                task.OnlyDefendInsideMain = true;
            }

            bot.buildingPlacer.BuildCompact = true;

            if (StrategyAnalysis.CannonRush.Get().Detected)
            {
                VoidrayOnly = true;
            }

            if (VoidrayOnly)
            {
                DefenseTask.Stopped = true;
            }

            if ((bot.EnemyRace == Race.Terran || bot.EnemyRace == Race.Random) &&
                ReaperDefenseCannonStep.DesiredPos == null)
            {
                foreach (Unit unit in bot.Enemies())
                {
                    if (unit.UnitType == UnitTypes.REAPER &&
                        Bot.Main.MapAnalyzer.StartArea[(int)System.Math.Round(unit.Pos.X), (int)System.Math.Round(unit.Pos.Y)])
                    {
                        Point2D dir    = SC2Util.Point(unit.Pos.X - bot.MapAnalyzer.StartLocation.X, unit.Pos.Y - bot.MapAnalyzer.StartLocation.Y);
                        float   length = (float)System.Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y);
                        dir = SC2Util.Point(dir.X / length, dir.Y / length);

                        ReaperDefenseCannonStep.DesiredPos = SC2Util.Point(bot.MapAnalyzer.StartLocation.X + dir.X * 4f, bot.MapAnalyzer.StartLocation.Y + dir.Y * 4f);
                        break;
                    }
                }
            }

            if (Lifting.Get().Detected&& bot.EnemyManager.EnemyBuildings.Count == 0 && !ChasingLiftedBuildings)
            {
                ChasingLiftedBuildings = true;
                bot.TaskManager.Add(new ElevatorChaserTask());
            }

            if (gatewayBuilt && Count(UnitTypes.GATEWAY) == 0)
            {
                gatewayBuilt = false;
            }
            else if (!gatewayBuilt)
            {
                foreach (Agent agent in bot.UnitManager.Agents.Values)
                {
                    if (agent.Unit.UnitType == UnitTypes.GATEWAY)
                    {
                        gatewayBuilt = true;
                        agent.Order(Abilities.MOVE, bot.TargetManager.PotentialEnemyStartLocations[0]);
                        break;
                    }
                }
            }
        }
Exemple #18
0
        public override void OnFrame(Bot bot)
        {
            if (Count(UnitTypes.STALKER) > 0)
            {
                BalanceGas();
            }
            else if (Gas() < 50)
            {
                GasWorkerTask.WorkersPerGas = 3;
            }
            else
            {
                GasWorkerTask.WorkersPerGas = 1;
            }

            TimingAttackTask.Task.RequiredSize = 1;
            TimingAttackTask.Task.RetreatSize  = 0;
            TimingAttackTask.Task.ExcludeUnitTypes.Add(UnitTypes.VOID_RAY);

            if (Lifting.Get().Detected)
            {
                int surfaceEnemies = 0;
                foreach (Unit unit in bot.Enemies())
                {
                    if (!unit.IsFlying)
                    {
                        surfaceEnemies++;
                    }
                }

                if (surfaceEnemies < 3 && WorkerTask.Task.Units.Count < 16)
                {
                    WorkerRushTask.Clear();
                    WorkerRushTask.Stopped = true;
                }
            }

            if (!MessageSent)
            {
                if (bot.Enemies().Count > 0)
                {
                    MessageSent = true;
                    bot.Chat("Prepare to be TICKLED! :D");
                }
            }

            if (bot.Frame - LastReinforcementsFrame >= 100 &&
                WorkerTask.Task.Units.Count >= (Lifting.Get().Detected ? 22 : 12) &&
                !Lifting.Get().Detected &&
                (!CounterWorkerRush.Get().Detected || bot.Frame >= 22.4 * 120) &&
                (!CounterWorkerRush.Get().Detected || !BuildStalkers))
            {
                LastReinforcementsFrame     = bot.Frame;
                WorkerRushTask.TakeWorkers += 6;
            }
            if (UseRecall())
            {
                RecallTask.Task.Location = new PotentialHelper(bot.TargetManager.PotentialEnemyStartLocations[0], 8).To(Main.BaseLocation.Pos).Get();
                Recalled = true;
            }
        }
Exemple #19
0
        public override void OnFrame(Bot bot)
        {
            if (Expand && Main.BaseLocation.MineralFields.Count < 8)
            {
                StartExpanding = true;
            }

            if (StartExpanding)
            {
                foreach (Agent agent in bot.Units())
                {
                    if (agent.Unit.UnitType == UnitTypes.FORGE &&
                        agent.DistanceSq(Bot.Main.MapAnalyzer.building1) <= 2 * 2)
                    {
                        KillOwnUnitTask.Task.TargetTag = agent.Unit.Tag;
                        break;
                    }
                }
            }


            bot.buildingPlacer.BuildCompact = true;

            if (StrategyAnalysis.CannonRush.Get().Detected)
            {
                VoidrayOnly = true;
            }

            if (VoidrayOnly)
            {
                DefenseTask.AirDefenseTask.Stopped    = true;
                DefenseTask.GroundDefenseTask.Stopped = true;
            }

            if ((bot.EnemyRace == Race.Terran || bot.EnemyRace == Race.Random) &&
                ReaperDefenseCannonStep.DesiredPos == null)
            {
                foreach (Unit unit in bot.Enemies())
                {
                    if (unit.UnitType == UnitTypes.REAPER &&
                        Bot.Main.MapAnalyzer.StartArea[(int)System.Math.Round(unit.Pos.X), (int)System.Math.Round(unit.Pos.Y)])
                    {
                        Point2D dir    = SC2Util.Point(unit.Pos.X - bot.MapAnalyzer.StartLocation.X, unit.Pos.Y - bot.MapAnalyzer.StartLocation.Y);
                        float   length = (float)System.Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y);
                        dir = SC2Util.Point(dir.X / length, dir.Y / length);

                        ReaperDefenseCannonStep.DesiredPos = SC2Util.Point(bot.MapAnalyzer.StartLocation.X + dir.X * 4f, bot.MapAnalyzer.StartLocation.Y + dir.Y * 4f);
                        break;
                    }
                }
            }

            if (Lifting.Get().Detected&& bot.EnemyManager.EnemyBuildings.Count == 0 && !ChasingLiftedBuildings)
            {
                ChasingLiftedBuildings = true;
                bot.TaskManager.Add(new ElevatorChaserTask());
            }

            if (gatewayBuilt && Count(UnitTypes.GATEWAY) == 0)
            {
                gatewayBuilt = false;
            }
            else if (!gatewayBuilt)
            {
                foreach (Agent agent in bot.UnitManager.Agents.Values)
                {
                    if (agent.Unit.UnitType == UnitTypes.GATEWAY)
                    {
                        gatewayBuilt = true;
                        agent.Order(Abilities.MOVE, bot.TargetManager.PotentialEnemyStartLocations[0]);
                        break;
                    }
                }
            }
        }
Exemple #20
0
        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;
                    }
                }
            }
        }
Exemple #21
0
        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;
             ||}
             ||
             ||if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.ZERGLING) >= 8
             || FourRax.Get().Detected
             || SmellCheese)
             ||{
             || TimingAttackTask.RequiredSize = 20;
             || TimingAttackTask.Clear();
             ||}
             */

            if (Count(UnitTypes.DRONE) >= 17)
            {
                GasWorkerTask.WorkersPerGas = 3;
            }
            else
            {
                GasWorkerTask.WorkersPerGas = 2;
            }


            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) < 17 - Completed(UnitTypes.EXTRACTOR) &&
                        (Count(UnitTypes.DRONE) < 14 || Completed(UnitTypes.ROACH) >= 11))
                    {
                        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 (Lifting.Get().Detected &&
                             Count(UnitTypes.ROACH) >= 35)
                    {
                        break;
                    }
                    else if (Minerals() >= 75 && Gas() >= 25 && ExpectedAvailableFood() > FoodUsed() + 6)
                    {
                        agent.Order(1351);
                        CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ROACH);
                    }
                    else if (Minerals() >= 100)
                    {
                        agent.Order(1344);
                        CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.OVERLORD);
                        bot.UnitManager.FoodExpected += 8;
                    }
                }
            }
        }