示例#1
0
        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);
            }
        }
示例#2
0
        public List <Build> ProtossBuilds(Bot bot)
        {
            List <Build> options = new List <Build>();

            if (Bot.Debug)
            {
                foreach (Strategy strategy in bot.EnemyStrategyAnalyzer.Strategies)
                {
                    if (strategy.DetectedPreviously)
                    {
                        System.Console.WriteLine("Detected previous strategy: " + strategy.Name());
                    }
                }
            }

            if (bot.EnemyRace == Race.Terran)
            {
                if (Marine.Get().DetectedPreviously &&
                    !Reaper.Get().DetectedPreviously &&
                    !Marauder.Get().DetectedPreviously &&
                    !Cyclone.Get().DetectedPreviously &&
                    !Banshee.Get().DetectedPreviously &&
                    !SiegeTank.Get().DetectedPreviously &&
                    !Medivac.Get().DetectedPreviously &&
                    !Viking.Get().DetectedPreviously &&
                    !Raven.Get().DetectedPreviously &&
                    !Battlecruiser.Get().DetectedPreviously &&
                    !WidowMine.Get().DetectedPreviously &&
                    !Hellion.Get().DetectedPreviously &&
                    !Thor.Get().DetectedPreviously &&
                    !Liberator.Get().DetectedPreviously)
                {
                    // ValinMarineBot
                    options.Add(new NinjaTurtles());
                    return(options);
                }
                if (BattlecruiserRush.Get().DetectedPreviously &&
                    Thor.Get().DetectedPreviously &&
                    WidowMine.Get().DetectedPreviously)
                {
                    // BenBotBC
                    options.Add(new OneBaseStalkerImmortal());
                    return(options);
                }
                if (Battlecruiser.Get().DetectedPreviously &&
                    !BattlecruiserRush.Get().DetectedPreviously &&
                    !Marauder.Get().DetectedPreviously &&
                    !Banshee.Get().DetectedPreviously &&
                    !Reaper.Get().DetectedPreviously &&
                    !Cyclone.Get().DetectedPreviously &&
                    !Medivac.Get().DetectedPreviously &&
                    !Raven.Get().DetectedPreviously)
                {
                    options.Add(new MassVoidray()
                    {
                        SkipDefenses = true
                    });
                    return(options);
                }

                /*
                 * if (ProxyDetected.Get().DetectedPreviously
                 *  && !Marauder.Get().DetectedPreviously
                 *  && Banshee.Get().DetectedPreviously)
                 * {
                 *  options.Add(new AntiMicro());
                 *  return options;
                 * }
                 */
                if (ProxyDetected.Get().DetectedPreviously &&
                    Marauder.Get().DetectedPreviously &&
                    Banshee.Get().DetectedPreviously)
                {
                    // MicroMachine
                    options.Add(new AntiMicro()
                    {
                        HuntProxies = true, CounterProxyMarauder = false
                    });
                    //options.Add(new NinjaTurtles() { Expand = true });
                    //options.Add(new OneBaseTempest() { DefendingStalker = true });
                    return(options);
                }
                if (ProxyDetected.Get().DetectedPreviously &&
                    !Banshee.Get().DetectedPreviously)
                {
                    // Strelok
                    //options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, SendScout = true, MassTanksDetected = MassTank.Get().DetectedPreviously });
                    options.Add(new OneBaseStalkerImmortal()
                    {
                        UseSentry = true
                    });
                    options.Add(new OneBaseTempest());
                    return(options);
                }
                if (Marine.Get().DetectedPreviously &&
                    Medivac.Get().DetectedPreviously &&
                    Viking.Get().DetectedPreviously &&
                    Reaper.Get().DetectedPreviously &&
                    Raven.Get().DetectedPreviously &&
                    !Cyclone.Get().DetectedPreviously &&
                    !Marauder.Get().DetectedPreviously &&
                    !Banshee.Get().DetectedPreviously)
                {
                    options.Add(new OneBaseStalkerImmortal());
                    //options.Add(new PvTStalkerImmortal() { BuildReaperWall = false, ProxyPylon = false, DelayObserver = true, SendScout = false, MassTanksDetected = true });
                    return(options);
                }
                if (Marine.Get().DetectedPreviously &&
                    Medivac.Get().DetectedPreviously &&
                    Viking.Get().DetectedPreviously &&
                    Reaper.Get().DetectedPreviously &&
                    !Raven.Get().DetectedPreviously &&
                    Marauder.Get().DetectedPreviously &&
                    Liberator.Get().DetectedPreviously &&
                    !Banshee.Get().DetectedPreviously)
                {
                    // Jensiiibot
                    //options.Add(new PvTStalkerTempest());
                    //options.Add(new Builds.Protoss.WorkerRush() { CounterJensiii = true, BuildStalkers = true });
                    //options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, MassTanksDetected = MassTank.Get().DetectedPreviously, UseColosus = false });
                    options.Add(new PvTZealotImmortal());
                    return(options);
                }
                if (Marine.Get().DetectedPreviously &&
                    Medivac.Get().DetectedPreviously &&
                    Viking.Get().DetectedPreviously &&
                    Reaper.Get().DetectedPreviously &&
                    Cyclone.Get().DetectedPreviously &&
                    !Marauder.Get().DetectedPreviously &&
                    !Liberator.Get().DetectedPreviously &&
                    !Banshee.Get().DetectedPreviously)
                {
                    // Rusty
                    options.Add(new OneBaseStalkerImmortal());
                    return(options);
                }
                if (Marine.Get().DetectedPreviously &&
                    Medivac.Get().DetectedPreviously &&
                    Viking.Get().DetectedPreviously &&
                    Reaper.Get().DetectedPreviously &&
                    !Raven.Get().DetectedPreviously &&
                    Cyclone.Get().DetectedPreviously &&
                    Marauder.Get().DetectedPreviously &&
                    !Liberator.Get().DetectedPreviously &&
                    !Banshee.Get().DetectedPreviously &&
                    Thor.Get().DetectedPreviously &&
                    SiegeTank.Get().DetectedPreviously &&
                    MassTank.Get().DetectedPreviously &&
                    Hellbat.Get().DetectedPreviously)
                {
                    // MechSweep
                    options.Add(new OneBaseTempest()
                    {
                        RequiredSize = 3
                    });
                    return(options);
                }

                options.Add(new PvTStalkerImmortal()
                {
                    BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, MassTanksDetected = MassTank.Get().DetectedPreviously, UseColosus = false
                });
            }
            else if (bot.EnemyRace == Race.Zerg)
            {
                if (Bot.Main.OpponentID == "eed44128-f488-4e31-b457-8e55f8a95628")
                {
                    options.Add(new PvZHjax()
                    {
                        CounterRoaches = false, DefendNydus = false
                    });
                    return(options);
                }
                options.Add(new PvZHjax());
                return(options);

                /*
                 * if (Lurker.Get().DetectedPreviously)
                 * {
                 *  //Kagamine
                 *  //options.Add(new PvZAdeptIntoVoidray());
                 *  //options.Add(new WorkerRush());
                 *  options.Add(new PvZHjax());
                 *  return options;
                 * }
                 * if (Mutalisk.Get().DetectedPreviously
                 *  && !Lurker.Get().DetectedPreviously)
                 * {
                 *  options.Add(new OneBaseStalkerImmortal() { StartZealots = true });
                 *  return options;
                 * }
                 * if (Hydralisk.Get().DetectedPreviously && StrategyAnalysis.ZerglingRush.Get().DetectedPreviously)
                 * {
                 *  options.Add(new ZealotRush());
                 *  return options;
                 * }
                 * if (RoachRush.Get().DetectedPreviously || StrategyAnalysis.ZerglingRush.Get().DetectedPreviously)
                 * {
                 *  options.Add(new PvZRushDefense());
                 *  options.Add(new NinjaTurtles());
                 *  return options;
                 * }
                 * if (Roach.Get().DetectedPreviously
                 *  && Zergling.Get().DetectedPreviously
                 *  && !Hydralisk.Get().DetectedPreviously)
                 * {
                 *  options.Add(new PvZRushDefense());
                 *  options.Add(new NinjaTurtles());
                 *  return options;
                 * }
                 * if (Queen.Get().DetectedPreviously
                 *  && Zergling.Get().DetectedPreviously
                 *  && !Hydralisk.Get().DetectedPreviously
                 *  && !Roach.Get().DetectedPreviously)
                 * {
                 *  options.Add(new NinjaTurtles());
                 *  return options;
                 * }
                 * if (bot.PreviousEnemyStrategies.MassHydra
                 *  && MassRoach.Get().DetectedPreviously
                 *  && !Lurker.Get().DetectedPreviously)
                 * {
                 *  options.Add(new OneBaseTempest());
                 *  return options;
                 * }
                 * if (!Zergling.Get().DetectedPreviously
                 *  && !Roach.Get().DetectedPreviously
                 *  && !Hydralisk.Get().DetectedPreviously
                 *  && !Queen.Get().DetectedPreviously
                 *  && !Mutalisk.Get().DetectedPreviously)
                 * {
                 *  options.Add(new OneBaseTempest());
                 *  return options;
                 * }
                 * if (!Zergling.Get().DetectedPreviously
                 *  && Roach.Get().DetectedPreviously
                 *  && !Hydralisk.Get().DetectedPreviously
                 *  && Queen.Get().DetectedPreviously
                 *  && !Mutalisk.Get().DetectedPreviously)
                 * {
                 *  options.Add(new OneBaseTempest());
                 *  return options;
                 * }
                 * options.Add(new OneBaseStalkerImmortal() { StartZealots = true });
                 */
            }
            else if (bot.EnemyRace == Race.Protoss)
            {
                if (Zealot.Get().DetectedPreviously &&
                    VoidRay.Get().DetectedPreviously &&
                    !Carrier.Get().DetectedPreviously &&
                    !Tempest.Get().DetectedPreviously &&
                    !Stalker.Get().DetectedPreviously &&
                    !Adept.Get().DetectedPreviously &&
                    !Immortal.Get().DetectedPreviously &&
                    !StrategyAnalysis.CannonRush.Get().DetectedPreviously)
                {
                    // MavBot3
                    options.Add(new ZealotRush());
                    return(options);
                }
                if (SkippedNatural.Get().DetectedPreviously &&
                    !AdeptHarass.Get().DetectedPreviously &&
                    VoidRay.Get().DetectedPreviously &&
                    Immortal.Get().DetectedPreviously)
                {
                    // AdditionalPylons
                    options.Add(new DoubleRoboProxy());
                    return(options);
                }
                if (Oracle.Get().DetectedPreviously &&
                    ThreeGate.Get().DetectedPreviously &&
                    Zealot.Get().DetectedPreviously &&
                    !Stalker.Get().DetectedPreviously &&
                    !VoidRay.Get().DetectedPreviously &&
                    !Immortal.Get().DetectedPreviously)
                {
                    // LuckyBot
                    options.Add(new OneBaseTempest());
                    return(options);
                }
                if (Carrier.Get().DetectedPreviously &&
                    Collosus.Get().DetectedPreviously &&
                    SkyToss.Get().DetectedPreviously &&
                    Tempest.Get().DetectedPreviously &&
                    !Archon.Get().DetectedPreviously &&
                    !HighTemplar.Get().DetectedPreviously)
                {
                    // TheGoldenArmada
                    options.Add(new OneBaseTempest());
                    return(options);
                }
                options.Add(new OneBaseStalkerImmortal()
                {
                    DoubleRobo = true, EarlySentry = true, AggressiveMicro = true
                });
                return(options);

                /*
                 * if (AdeptHarass.Get().DetectedPreviously
                 *  && SkyToss.Get().DetectedPreviously
                 *  && Carrier.Get().DetectedPreviously
                 *  && HighTemplar.Get().DetectedPreviously
                 *  && VoidRay.Get().DetectedPreviously
                 *  && !StrategyAnalysis.CannonRush.Get().DetectedPreviously)
                 * {
                 *  options.Add(new ZealotRush());
                 *  options.Add(new OneBaseStalkerImmortal());
                 *  return options;
                 * }
                 * if (AdeptHarass.Get().DetectedPreviously)
                 * {
                 *  // SharpenedEdge
                 *  options.Add(new OneBaseTempest());
                 *  options.Add(new Dishwasher());
                 *  return options;
                 * }
                 * if (StrategyAnalysis.CannonRush.Get().DetectedPreviously
                 *  && Tempest.Get().DetectedPreviously)
                 * {
                 *  // ThreeWayLover
                 *  //options.Add(new MassVoidray() { SkipDefenses = true });
                 *  options.Add(new OneBaseTempest());
                 *  return options;
                 * }
                 * if (Sentry.Get().DetectedPreviously
                 *  && Archon.Get().DetectedPreviously
                 *  && !Stalker.Get().DetectedPreviously
                 *  && !Zealot.Get().DetectedPreviously)
                 * {
                 *  options.Add(new TempestProxy());
                 *  return options;
                 * }
                 * if (Zealot.Get().DetectedPreviously
                 *  && StrategyAnalysis.CannonRush.Get().DetectedPreviously
                 *  && Oracle.Get().DetectedPreviously
                 *  && Phoenix.Get().DetectedPreviously
                 *  && Stalker.Get().DetectedPreviously
                 *  && !Immortal.Get().DetectedPreviously)
                 * {
                 *  //Gumby
                 *  options.Add(new NinjaTurtles());
                 *  return options;
                 * }
                 * if (Oracle.Get().DetectedPreviously)
                 * {
                 *  options.Add(new OneBaseTempest());
                 *  return options;
                 * }
                 * if (!Stalker.Get().DetectedPreviously
                 *  && !Zealot.Get().DetectedPreviously
                 *  && !Sentry.Get().DetectedPreviously)
                 * {
                 *  options.Add(new ZealotRush());
                 *  return options;
                 * }
                 * if (Zealot.Get().DetectedPreviously
                 *  && !Stalker.Get().DetectedPreviously)
                 * {
                 *  options.Add(new NinjaTurtles());
                 *  return options;
                 * }
                 *
                 * options.Add(new NinjaTurtles());
                 * options.Add(new PvPMothershipSiege());
                 */
            }

            return(options);
        }
示例#3
0
        public override void OnFrame(Bot bot)
        {
            ArmyObserverTask.Task.IgnoreAllyUnitTypes.Add(UnitTypes.ADEPT);

            ObserverScoutTask.Task.Priority         = 6;
            WorkerTask.Task.EvacuateThreatenedBases = true;

            TimingAttackTask.Task.ExcludeUnitTypes.Add(UnitTypes.ADEPT);

            if (Count(UnitTypes.ADEPT) >= 6)
            {
                StopAdeptHarass = true;
            }

            bot.DrawText("ZealotRushSuspected: " + ZealotRushSuspected);

            foreach (Agent agent in bot.UnitManager.Agents.Values)
            {
                if (bot.Frame % 224 != 0)
                {
                    break;
                }
                if (agent.Unit.UnitType != UnitTypes.GATEWAY)
                {
                    continue;
                }

                if (Count(UnitTypes.NEXUS) < 2 && TimingAttackTask.Task.Units.Count == 0)
                {
                    agent.Order(Abilities.MOVE, Main.BaseLocation.Pos);
                }
                else
                {
                    agent.Order(Abilities.MOVE, bot.TargetManager.PotentialEnemyStartLocations[0]);
                }
            }

            KillImmortals.Stopped = TotalEnemyCount(UnitTypes.ZEALOT) >= 3 || EnemyCount(UnitTypes.PHOTON_CANNON) > 0;


            if (EnemyCount(UnitTypes.PHOENIX) <= 3)
            {
                DefenseTask.AirDefenseTask.IgnoreEnemyTypes.Add(UnitTypes.PHOENIX);
            }
            else
            {
                DefenseTask.AirDefenseTask.IgnoreEnemyTypes.Remove(UnitTypes.PHOENIX);
            }

            if (StrategyAnalysis.WorkerRush.Get().Detected &&
                Count(UnitTypes.ZEALOT) < 2)
            {
                GasWorkerTask.WorkersPerGas = 0;
            }
            else
            {
                BalanceGas();
            }

            if (TotalEnemyCount(UnitTypes.FORGE) > 0 && bot.Frame <= 22.4 * 60 * 2)
            {
                EarlyForgeDetected = true;
            }

            ScoutTask.Task.ScoutType = UnitTypes.PHOENIX;
            ScoutTask.Task.Target    = bot.TargetManager.PotentialEnemyStartLocations[0];

            if (!EarlyExpand &&
                !ZealotRushSuspected &&
                TotalEnemyCount(UnitTypes.STARGATE) + TotalEnemyCount(UnitTypes.DARK_SHRINE) + TotalEnemyCount(UnitTypes.VOID_RAY) == 0)
            {
                foreach (Agent agent in bot.Units())
                {
                    if (agent.Unit.UnitType != UnitTypes.SENTRY)
                    {
                        continue;
                    }
                    if (agent.Unit.Energy < 75)
                    {
                        continue;
                    }
                    // Hallucinate scouting phoenix.
                    agent.Order(154);
                }
            }

            if (!VoidraysDetected && TotalEnemyCount(UnitTypes.VOID_RAY) > 0)
            {
                VoidraysDetected = true;
                if (TimingAttackTask.Task.Units.Count < 12)
                {
                    TimingAttackTask.Task.Clear();
                }
            }

            if (!ZealotRushSuspected && !StrategyAnalysis.WorkerRush.Get().Detected)
            {
                if ((Bot.Main.Frame >= 22.4 * 60 * 1.5 &&
                     !Bot.Main.EnemyStrategyAnalyzer.NoProxyGatewayConfirmed &&
                     TotalEnemyCount(UnitTypes.ASSIMILATOR) + TotalEnemyCount(UnitTypes.CYBERNETICS_CORE) == 0) ||
                    (Bot.Main.Frame < 22.4 * 60 * 1.5 && ThreeGate.Get().Detected))
                {
                    ZealotRushSuspected = true;
                }
            }

            if (!LowGroundCannons)
            {
                foreach (Unit enemy in bot.Enemies())
                {
                    if (enemy.UnitType != UnitTypes.PHOTON_CANNON)
                    {
                        continue;
                    }
                    if (bot.MapAnalyzer.MapHeight((int)enemy.Pos.X, (int)enemy.Pos.Y) < bot.MapAnalyzer.MapHeight((int)bot.TargetManager.PotentialEnemyStartLocations[0].X, (int)bot.TargetManager.PotentialEnemyStartLocations[0].Y))
                    {
                        LowGroundCannons = true;
                        break;
                    }
                }
            }

            if (!CannonDefenseDetected &&
                TotalEnemyCount(UnitTypes.PHOTON_CANNON) + TotalEnemyCount(UnitTypes.FORGE) > 0 &&
                bot.Frame < 22.4 * 60 * 4 &&
                (EarlyForgeDetected || Expanded.Get().Detected || LowGroundCannons))
            {
                CannonDefenseDetected = true;
                if (TimingAttackTask.Task.Units.Count < 12)
                {
                    TimingAttackTask.Task.Clear();
                }
            }

            if (StrategyAnalysis.WorkerRush.Get().Detected &&
                Count(UnitTypes.ZEALOT) < 2)
            {
                foreach (Agent agent in bot.UnitManager.Agents.Values)
                {
                    if (agent.Unit.UnitType == UnitTypes.ASSIMILATOR &&
                        agent.Unit.BuildProgress < 0.99)
                    {
                        agent.Order(Abilities.CANCEL);
                    }
                }
            }

            bot.TargetManager.TargetCannons = true;
            if (ZealotRushSuspected)
            {
                bot.TargetManager.TargetGateways = true;
                WorkerScoutTask.Task.Stopped     = true;
                WorkerScoutTask.Task.Clear();
            }

            if (WorkerScoutTask.Task.BaseCircled())
            {
                WorkerScoutTask.Task.Stopped = true;
                WorkerScoutTask.Task.Clear();
            }

            if (ZealotRushSuspected ||
                Completed(UnitTypes.IMMORTAL) > 0)
            {
                foreach (WorkerDefenseTask task in WorkerDefenseTask.Tasks)
                {
                    task.Stopped = true;
                    task.Clear();
                }
            }

            if (ZealotRushSuspected && Completed(UnitTypes.STALKER) >= 12)
            {
                foreach (Agent agent in bot.Units())
                {
                    if (agent.Unit.UnitType != UnitTypes.GATEWAY)
                    {
                        continue;
                    }
                    if (agent.DistanceSq(WallIn.Wall[2].Pos) >= 2)
                    {
                        continue;
                    }
                    KillOwnUnitTask.Task.TargetTag = agent.Unit.Tag;
                    break;
                }
            }

            WorkerScoutTask.Task.StartFrame = 600;
            ObserverScoutTask.Task.Priority = 6;

            bot.NexusAbilityManager.Stopped = Count(UnitTypes.STALKER) == 0 && bot.Frame >= 120 * 22.4;
            bot.NexusAbilityManager.PriotitizedAbilities.Add(917);

            if (EnemyExpandFrame >= 1000000 &&
                Expanded.Get().Detected)
            {
                EnemyExpandFrame = bot.Frame;
            }

            if (EnemyExpandFrame < 90 * 22.4)
            {
                EarlyExpand = true;
            }

            if (EarlyExpand)
            {
                TimingAttackTask.Task.RequiredSize = 12;
            }
            else if (VoidraysDetected ||
                     (TotalEnemyCount(UnitTypes.PHOTON_CANNON) + TotalEnemyCount(UnitTypes.FORGE) > 0 && !LowGroundCannons && !EarlyExpand))
            {
                TimingAttackTask.Task.RequiredSize = 36;
            }
            else if (ZealotRushSuspected ||
                     (CannonDefenseDetected && EarlyExpand))
            {
                TimingAttackTask.Task.RequiredSize = 12;
            }
            else
            {
                TimingAttackTask.Task.RequiredSize = 36;
            }
            TimingAttackTask.Task.RetreatSize = 0;


            if (TotalEnemyCount(UnitTypes.PHOTON_CANNON) + TotalEnemyCount(UnitTypes.FORGE) > 0 &&
                !LowGroundCannons &&
                !EarlyExpand &&
                TimingAttackTask.Task.Units.Count < 18 &&
                TimingAttackTask.Task.RequiredSize > 18)
            {
                TimingAttackTask.Task.Clear();
            }

            FallBackController.Stopped = ZealotRushSuspected;

            ForwardProbeTask.Task.Stopped =
                Completed(UnitTypes.STALKER) + Count(UnitTypes.ADEPT) + Completed(UnitTypes.IMMORTAL) < Math.Max(8, TimingAttackTask.Task.RequiredSize) &&
                (!CannonDefenseDetected || !StargateDetected || EarlyExpand);

            if (ForwardProbeTask.Task.Stopped)
            {
                ForwardProbeTask.Task.Clear();
            }


            if (Count(UnitTypes.NEXUS) <= 1)
            {
                IdleTask.Task.OverrideTarget = OverrideMainDefenseTarget;
            }
            else if (Count(UnitTypes.NEXUS) >= 3)
            {
                IdleTask.Task.OverrideTarget = OverrideDefenseTarget;
            }
            else
            {
                IdleTask.Task.OverrideTarget = null;
            }

            if (ZealotRushSuspected)
            {
                DefenseTask.GroundDefenseTask.BufferZone          = 0;
                DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 20;
                DefenseTask.GroundDefenseTask.MainDefenseRadius   = 20;
                DefenseTask.GroundDefenseTask.MaxDefenseRadius    = 120;
                DefenseTask.GroundDefenseTask.DrawDefenderRadius  = 80;
            }
            else
            {
                DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 30;
                DefenseTask.GroundDefenseTask.MainDefenseRadius   = 30;
                DefenseTask.GroundDefenseTask.MaxDefenseRadius    = 120;
                DefenseTask.GroundDefenseTask.DrawDefenderRadius  = 80;
            }

            if (TotalEnemyCount(UnitTypes.TEMPEST) > 0)
            {
                DefenseTask.AirDefenseTask.ExpandDefenseRadius = 50;
                DefenseTask.AirDefenseTask.MainDefenseRadius   = 50;
                DefenseTask.AirDefenseTask.MaxDefenseRadius    = 120;
                DefenseTask.AirDefenseTask.DrawDefenderRadius  = 80;
            }
            else
            {
                DefenseTask.AirDefenseTask.ExpandDefenseRadius = 30;
                DefenseTask.AirDefenseTask.MainDefenseRadius   = 30;
                DefenseTask.AirDefenseTask.MaxDefenseRadius    = 120;
                DefenseTask.AirDefenseTask.DrawDefenderRadius  = 80;
            }

            StargateDetected = TotalEnemyCount(UnitTypes.STARGATE)
                               + TotalEnemyCount(UnitTypes.VOID_RAY)
                               + TotalEnemyCount(UnitTypes.TEMPEST)
                               + TotalEnemyCount(UnitTypes.CARRIER)
                               + TotalEnemyCount(UnitTypes.FLEET_BEACON) > 0 ||
                               TotalEnemyCount(UnitTypes.PHOENIX) >= 3;

            EarlyNexus = !EarlyExpand;
        }
示例#4
0
        public override void OnFrame(Bot bot)
        {
            if (bot.Observation.ActionErrors != null)
            {
                foreach (ActionError error in bot.Observation.ActionErrors)
                {
                    DebugUtil.WriteLine("Error with ability " + error.AbilityId + ": " + error.Result);
                }
            }

            if (!EcoCheeseSuspected && Expanded.Get().Detected&& bot.Frame <= 22.4 * 60 * 2 && bot.EnemyStrategyAnalyzer.Count(UnitTypes.GATEWAY) == 0)
            {
                EcoCheeseSuspected = true;
            }
            if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.STALKER) + bot.EnemyStrategyAnalyzer.Count(UnitTypes.ADEPT) > 0 ||
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.ZEALOT) >= 3)
            {
                EcoCheeseSuspected = false;
            }

            if (!CannonDefenseDetected && bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.PHOTON_CANNON) + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.FORGE) >= 0 && bot.Frame < 22.4 * 60 * 4)
            {
                CannonDefenseDetected = true;
            }

            if (!TempestDetected && bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.TEMPEST) > 0)
            {
                TempestDetected = true;
            }

            MechDestroyExpandsTask.Task.RequiredSize = 4;
            MechDestroyExpandsTask.Task.MaxSize      = 4;
            MechDestroyExpandsTask.Task.RetreatSize  = 0;
            MechDestroyExpandsTask.Task.UnitType     = UnitTypes.HELLION;
            if (bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.STALKER)
                + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.IMMORTAL)
                + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.VOID_RAY) > 0 &&
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.NEXUS) >= 2)
            {
                MechDestroyExpandsTask.Task.Stopped = true;
            }

            BunkerDefendersTask.Task.LeaveBunkers = EcoCheeseSuspected;
            MarineHarassController.Disabled       = !EcoCheeseSuspected;

            /*
             * if ((bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.STALKER) >= 7 || (bot.EnemyStrategyAnalyzer.Count(UnitTypes.GATEWAY) >= 3 && bot.EnemyStrategyAnalyzer.Count(UnitTypes.CYBERNETICS_CORE) > 0))
             *  && bot.Frame < 22.4 * 60f * 3.5)
             *  FourGateStalkerSuspected = true;
             */

            StalkerEmergency = FourGateStalkerSuspected &&
                               (Completed(UnitTypes.SIEGE_TANK) < 2 || Completed(UnitTypes.MARAUDER) < 4) &&
                               Completed(UnitTypes.MARAUDER) + Completed(UnitTypes.MARINE) + Completed(UnitTypes.SIEGE_TANK) + Completed(UnitTypes.CYCLONE) < 15;

            if (FourGateStalkerSuspected &&
                ((Completed(UnitTypes.SIEGE_TANK) >= 2 && Completed(UnitTypes.MARAUDER) >= 3) || Count(UnitTypes.COMMAND_CENTER) >= 2))
            {
                IdleTask.Task.OverrideTarget = SC2Util.Point((bot.MapAnalyzer.GetMainRamp().X + Natural.BaseLocation.Pos.X) / 2f, (bot.MapAnalyzer.GetMainRamp().Y + Natural.BaseLocation.Pos.Y) / 2f);
            }
            else
            {
                IdleTask.Task.OverrideTarget = null;
            }

            SiegeAtRampTask.Task.Stopped    = !FourGateStalkerSuspected || Count(UnitTypes.THOR) > 0;
            SiegeBelowRampTask.Task.Stopped = !FourGateStalkerSuspected || Count(UnitTypes.THOR) > 0;
            if (FourGateStalkerSuspected &&
                Completed(UnitTypes.SIEGE_TANK) < 2 &&
                Completed(UnitTypes.THOR) < 2 &&
                Count(UnitTypes.COMMAND_CENTER) > Completed(UnitTypes.COMMAND_CENTER) &&
                Bot.Main.EnemyStrategyAnalyzer.TotalCount(UnitTypes.STARGATE) == 0)
            {
                foreach (Agent agent in bot.UnitManager.Agents.Values)
                {
                    if (agent.Unit.UnitType == UnitTypes.COMMAND_CENTER &&
                        agent.Unit.BuildProgress < 0.99)
                    {
                        agent.Order(Abilities.CANCEL);
                    }
                }
            }

            bot.TargetManager.TargetCannons = true;
            if (!OraclesDetected &&
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.ORACLE) > 0)
            {
                OraclesDetectedFrame = bot.Frame;
            }
            OraclesDetected = bot.Frame - OraclesDetectedFrame < 30 * 22.4;

            if (Bot.Main.EnemyStrategyAnalyzer.TotalCount(UnitTypes.COLOSUS)
                + Bot.Main.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ROBOTICS_BAY)
                + Bot.Main.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ROBOTICS_FACILITY) > 0)
            {
                CollosusSuspected = true;
            }
            if (CollosusSuspected ||
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.TEMPEST) > 0 ||
                CannonsDetected)
            {
                DesiredVikings = 10;
            }
            else if (SkyTossDetected)
            {
                DesiredVikings = 5;
            }

            foreach (Task task in DefenseSquadTask.Tasks)
            {
                task.Stopped = !OraclesDetected;
                if (!OraclesDetected)
                {
                    task.Clear();
                }
                task.Priority = 8;
            }

            if (ZealotRushConfirmed)
            {
                TimingAttackTask.Task.RequiredSize = 20;
                TimingAttackTask.Task.RetreatSize  = 6;
            }
            else if (EcoCheeseSuspected)
            {
                TimingAttackTask.Task.RequiredSize = 3;
                TimingAttackTask.Task.RetreatSize  = 0;
            }
            else if (Completed(UnitTypes.COMMAND_CENTER) < 2 ||
                     FourGateStalkerSuspected ||
                     bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.TEMPEST) > 0)
            {
                TimingAttackTask.Task.RequiredSize = 40;
                TimingAttackTask.Task.RetreatSize  = 10;
            }
            else if (CollosusSuspected)
            {
                if (Completed(UnitTypes.VIKING_FIGHTER) == 0)
                {
                    TimingAttackTask.Task.Clear();
                    TimingAttackTask.Task.Stopped = true;
                }
                else
                {
                    TimingAttackTask.Task.Stopped = false;
                }
                TimingAttackTask.Task.RequiredSize = 40;
            }
            else if (WorkerRushDetected)
            {
                TimingAttackTask.Task.RequiredSize = 8;
                TimingAttackTask.Task.RetreatSize  = 0;
            }
            else if (DTsSuspected)
            {
                TimingAttackTask.Task.RequiredSize = 25;
                TimingAttackTask.Task.RetreatSize  = 8;
            }
            else
            {
                TimingAttackTask.Task.RequiredSize = 30;
                TimingAttackTask.Task.RetreatSize  = 10;
            }

            bot.DrawText("Attack sent: " + TimingAttackTask.Task.AttackSent);
            bot.DrawText("RequiredSize: " + TimingAttackTask.Task.RequiredSize);

            if (!GatewayPushDetected)
            {
                if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.CYBERNETICS_CORE) > 0 &&
                    bot.EnemyStrategyAnalyzer.Count(UnitTypes.GATEWAY) >= 3)
                {
                    GatewayPushDetected = true;
                }

                if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.ADEPT) > 0)
                {
                    GatewayPushDetected = true;
                }
                if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.STALKER) >= 3)
                {
                    GatewayPushDetected = true;
                }
            }

            if (GatewayPushDetected)
            {
                WorkerScoutTask.Task.Stopped = true;
                WorkerScoutTask.Task.Clear();
            }

            if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.GATEWAY) > 0 &&
                bot.Frame >= 22.4 * 90 &&
                bot.Frame < 22.4 * 110)
            {
                WorkerScoutTask.Task.Stopped = true;
                WorkerScoutTask.Task.Clear();
            }

            if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.ASSIMILATOR) + bot.EnemyStrategyAnalyzer.Count(UnitTypes.CYBERNETICS_CORE) > 0 &&
                bot.Frame >= 22.4 * 75 &&
                bot.Frame < 22.4 * 110)
            {
                WorkerScoutTask.Task.Stopped = true;
                WorkerScoutTask.Task.Clear();
            }

            if ((ZealotRushSuspected ||
                 bot.EnemyStrategyAnalyzer.Count(UnitTypes.PHOTON_CANNON) > 0 ||
                 WorkerRushDetected) &&
                bot.Frame >= 22.4 * 110)
            {
                WorkerScoutTask.Task.Stopped = true;
                WorkerScoutTask.Task.Clear();
            }

            if (TempestDetected && Count(UnitTypes.VIKING_FIGHTER) + Count(UnitTypes.THOR) * 2 >= 10)
            {
                DefenseTask.AirDefenseTask.ExpandDefenseRadius = 40;
                DefenseTask.AirDefenseTask.MainDefenseRadius   = 40;
                DefenseTask.AirDefenseTask.MaxDefenseRadius    = 120;
                DefenseTask.AirDefenseTask.DrawDefenderRadius  = 120;
            }
            else if (FourGateStalkerSuspected)
            {
                DefenseTask.AirDefenseTask.ExpandDefenseRadius    = 15;
                DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 15;
                DefenseTask.GroundDefenseTask.MainDefenseRadius   = 20;
            }
            else
            {
                DefenseTask.AirDefenseTask.ExpandDefenseRadius    = 20;
                DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 20;
            }
            DefenseTask.AirDefenseTask.MaxDefenseRadius    = 80;
            DefenseTask.GroundDefenseTask.MaxDefenseRadius = 80;

            RepairTask.Task.WallIn = WallIn;

            if (CannonDefenseDetected)
            {
                TransformTask.Task.HellbatsToHellions();
            }
            else
            {
                TransformTask.Task.HellionsToHellbats();
            }
            TransformTask.Task.ThorsToSingleTarget();

            if (!ZealotRushConfirmed && Bot.Main.EnemyRace == Race.Protoss && bot.Frame < 22.4 * 60 * 4 && Bot.Main.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ZEALOT) >= 5)
            {
                ZealotRushConfirmed = true;
            }

            if (ZealotRushConfirmed && Completed(UnitTypes.HELLION) + Completed(UnitTypes.HELLBAT) + Completed(UnitTypes.MARAUDER) < 6)
            {
                foreach (Agent agent in bot.UnitManager.Agents.Values)
                {
                    if (agent.Unit.UnitType == UnitTypes.COMMAND_CENTER && agent.Unit.BuildProgress < 0.99 && agent.DistanceSq(Main.BaseLocation.Pos) >= 4 * 4)
                    {
                        agent.Order(Abilities.CANCEL);
                    }
                }
            }

            if (!ZealotRushSuspected && 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))
                {
                    ZealotRushSuspected = true;
                }
            }

            if (!CannonsDetected)
            {
                if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.PHOTON_CANNON) > 0 ||
                    bot.EnemyStrategyAnalyzer.Count(UnitTypes.FORGE) > 0)
                {
                    CannonsDetected = true;
                }
            }

            if (WorkerRushDefenseTask.Task.WorkerRushHappening)
            {
                WorkerRushDetected = true;
            }

            if (ScanTimingsSet && bot.OrbitalAbilityManager.ScanCommands.Count == 0)
            {
                bot.OrbitalAbilityManager.SaveEnergy = 0;
            }
            else
            {
                bot.OrbitalAbilityManager.SaveEnergy = 50;
            }
            if (bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.FORGE) + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.PHOTON_CANNON) > 0 &&
                bot.Frame >= 22.4 * 60f * 2.5 &&
                !ScanTimingsSet)
            {
                ScanTimingsSet = true;
                if (!EarlyScanSet)
                {
                    EarlyScanSet = true;
                    bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                    {
                        Pos       = bot.TargetManager.PotentialEnemyStartLocations[0],
                        FromFrame = (int)(22.4 * 60 * 3.5)
                    });
                }
            }

            if (bot.Frame >= (int)(22.4 * 60f * 2.5) &&
                !EarlyScanSet &&
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.GATEWAY) == 1 &&
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.FORGE) == 0 &&
                bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.STALKER) == 0 &&
                bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ADEPT) == 0 &&
                bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ADEPT_PHASE_SHIFT) == 0)
            {
                EarlyScanSet = true;
                bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                {
                    Pos       = bot.TargetManager.PotentialEnemyStartLocations[0],
                    FromFrame = (int)(22.4 * 60 * 3)
                });
            }

            if (bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.GATEWAY) >= 2 &&
                (bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.CYBERNETICS_CORE) + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ASSIMILATOR) + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.STALKER) + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ADEPT) + bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.ADEPT_PHASE_SHIFT) > 0) &&
                bot.Frame >= 22.4 * 60f * 2.5 &&
                !ScanTimingsSet)
            {
                ScanTimingsSet = true;
                if (!EarlyScanSet)
                {
                    EarlyScanSet = true;
                    bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                    {
                        Pos       = bot.TargetManager.PotentialEnemyStartLocations[0],
                        FromFrame = (int)(22.4 * 60 * 3)
                    });
                }
                bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                {
                    Pos       = bot.TargetManager.PotentialEnemyStartLocations[0],
                    FromFrame = (int)(22.4 * 60 * 11.5)
                });
                bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                {
                    Pos       = bot.MapAnalyzer.GetEnemyNatural().Pos,
                    FromFrame = (int)(22.4 * 60 * 11.5 + 22.4)
                });
            }

            if (!GatewayPushDetected && !ScanTimingsSet && bot.Frame >= 22.4 * 60f * 2.75)
            {
                ScanTimingsSet = true;
                bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                {
                    Pos       = bot.TargetManager.PotentialEnemyStartLocations[0],
                    FromFrame = (int)(22.4 * 60 * 4)
                });
                bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                {
                    Pos       = bot.TargetManager.PotentialEnemyStartLocations[0],
                    FromFrame = (int)(22.4 * 60 * 5.5)
                });
                bot.OrbitalAbilityManager.ScanCommands.Add(new ScanCommand()
                {
                    Pos       = bot.MapAnalyzer.GetEnemyNatural().Pos,
                    FromFrame = (int)(22.4 * 60 * 5.5 + 22.4)
                });
            }

            if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.DARK_SHRINE)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.DARK_TEMPLAR)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.TWILIGHT_COUNSEL) > 0)
            {
                DTsSuspected = true;
            }

            if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.STARGATE)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.VOID_RAY)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.CARRIER)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.INTERCEPTOR)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.TEMPEST)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.PHOENIX)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.ORACLE) > 0)
            {
                SkyTossDetected = true;
            }
            if (bot.EnemyStrategyAnalyzer.Count(UnitTypes.PHOTON_CANNON)
                + bot.EnemyStrategyAnalyzer.Count(UnitTypes.SHIELD_BATTERY) >= 6 &&
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.ROBOTICS_FACILITY) == 0 &&
                bot.EnemyStrategyAnalyzer.Count(UnitTypes.GATEWAY) < 4)
            {
                SkyTossDetected = true;
            }

            if (bot.EnemyStrategyAnalyzer.TotalCount(UnitTypes.TEMPEST) > 0)
            {
                TimingAttackTask.Task.BeforeControllers = new List <CustomController>();
                TransformTask.Task.Priority             = 10;
            }
        }
示例#5
0
        public override void OnFrame(Bot bot)
        {
            TimingAttackTask.Task.RequiredSize = 32;
            TimingAttackTask.Task.RetreatSize  = 10;

            DefenseTask.GroundDefenseTask.MainDefenseRadius   = 20;
            DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 20;
            DefenseTask.GroundDefenseTask.MaxDefenseRadius    = 55;
            DefenseTask.AirDefenseTask.MainDefenseRadius      = 20;
            DefenseTask.AirDefenseTask.ExpandDefenseRadius    = 20;
            DefenseTask.AirDefenseTask.MaxDefenseRadius       = 55;

            /*
             * if ((!SmellCheese && bot.Frame >= 22.4 * 60 * 1.5
             *  && !bot.EnemyStrategyAnalyzer.NoProxyGatewayConfirmed)
             || (!SmellCheese && bot.Frame < 22.4 * 60 * 1.5 && ThreeGate.Get().Detected))
             ||{
             || SmellCheese = true;
             || TimingAttackTask.RequiredSize = 18;
             || TimingAttackTask.Stopped = false;
             ||}
             */


            if (bot.Frame < 22.4 * 60 * 1.5 && bot.EnemyStrategyAnalyzer.Count(UnitTypes.FORGE) > 0)
            {
                CannonRush = true;
            }

            if (bot.Frame < 22.4 * 60 * 2 && bot.EnemyStrategyAnalyzer.Count(UnitTypes.CYBERNETICS_CORE) > 0 &&
                ThreeGate.Get().Detected)
            {
                StalkerDefense = true;
                DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 13;
                DefenseTask.AirDefenseTask.ExpandDefenseRadius    = 13;
            }

            //if (SmellCheese && CannonRush)
            //    TimingAttackTask.RequiredSize = 12;

            if (Completed(UnitTypes.LAIR) > 0 &&
                Count(UnitTypes.OVERSEER) == 0)
            {
                MorphingTask.Task.Morph(UnitTypes.OVERSEER);
            }

            /*
             * 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) >= 14 && Count(UnitTypes.SPAWNING_POOL) == 0)
             *              break;
             *          if (Minerals() >= 75 && Gas() >= 25
             *              && ExpectedAvailableFood() > FoodUsed() + 2
             *              && Completed(UnitTypes.ROACH_WARREN) > 0)
             *          {
             *              agent.Order(1351);
             *              CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ROACH);
             *          }
             *          else if (Minerals() >= 50
             *              && ExpectedAvailableFood() > FoodUsed() + 2
             *              && (Count(UnitTypes.DRONE) < 16 - Completed(UnitTypes.EXTRACTOR) || Count(UnitTypes.ROACH) >= 5)
             *              && Count(UnitTypes.DRONE) < 22 - Completed(UnitTypes.EXTRACTOR))
             *          {
             *              agent.Order(1342);
             *              CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.DRONE);
             *          }
             *          else if (Minerals() >= 100 && FoodUsed()
             + Tyr.Bot.UnitManager.Count(UnitTypes.HATCHERY) * 2
             + Tyr.Bot.UnitManager.Count(UnitTypes.LAIR) * 2
             + Tyr.Bot.UnitManager.Count(UnitTypes.HIVE) * 2
             +              >= ExpectedAvailableFood() - 2)
             +          {
             +              agent.Order(1344);
             +              CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.OVERLORD);
             +              bot.UnitManager.FoodExpected += 8;
             +          }
             +      }
             +  }
             +
             +  return;
             + }
             +
             */

            TimingAttackTask.Task.Stopped = Completed(UnitTypes.BROOD_LORD) < 6;

            if (Count(UnitTypes.CORRUPTOR) > 10 && Completed(UnitTypes.GREATER_SPIRE) > 0)
            {
                MorphingTask.Task.Morph(UnitTypes.BROOD_LORD);
            }

            if (Completed(UnitTypes.LAIR) > 0 &&
                Count(UnitTypes.OVERSEER) < 2)
            {
                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 && StalkerDefense &&
                        ExpectedAvailableFood() > FoodUsed() + 2 &&
                        Count(UnitTypes.ZERGLING) < 0 &&
                        Completed(UnitTypes.SPAWNING_POOL) > 0 &&
                        (Count(UnitTypes.SPINE_CRAWLER) >= 2 || Minerals() >= 200))
                    {
                        agent.Order(1343);
                        CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ZERGLING);
                        CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ZERGLING);
                    }
                    if (Minerals() >= 75 && Gas() >= 25 && ExpectedAvailableFood() > FoodUsed() + 6 &&
                        Count(UnitTypes.ROACH) < 8 &&
                        Completed(UnitTypes.ROACH_WARREN) > 0)
                    {
                        agent.Order(1351);
                        CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.ROACH);
                    }
                    else if (Minerals() >= 50 &&
                             ExpectedAvailableFood() > FoodUsed() + 2 &&
                             Count(UnitTypes.DRONE) < 40 - Completed(UnitTypes.EXTRACTOR) &&
                             (Count(UnitTypes.ROACH) >= 8 || Count(UnitTypes.DRONE) <= 24))
                    {
                        agent.Order(1342);
                        CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.DRONE);
                    }
                    else if (Minerals() >= 150 &&
                             Gas() >= 100 &&
                             Completed(UnitTypes.SPIRE) + Completed(UnitTypes.GREATER_SPIRE) > 0 &&
                             (Completed(UnitTypes.GREATER_SPIRE) > 0 || Count(UnitTypes.CORRUPTOR) < 8) &&
                             Count(UnitTypes.CORRUPTOR) < 16 &&
                             ExpectedAvailableFood() > FoodUsed() + 4)
                    {
                        agent.Order(1353);
                        CollectionUtil.Increment(bot.UnitManager.Counts, UnitTypes.CORRUPTOR);
                    }
                    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;
                    }
                }
            }
        }