Esempio n. 1
0
        public override void OnFrame(Tyr tyr)
        {
            if (tyr.EnemyStrategyAnalyzer.FourRaxDetected ||
                (tyr.Frame >= 22.4 * 85 && !tyr.EnemyStrategyAnalyzer.NoProxyTerranConfirmed && tyr.TargetManager.PotentialEnemyStartLocations.Count == 1) ||
                tyr.EnemyStrategyAnalyzer.ReaperRushDetected)
            {
                SmellCheese = true;
            }

            if (tyr.EnemyStrategyAnalyzer.Count(UnitTypes.ZERGLING) >= 8 ||
                tyr.EnemyStrategyAnalyzer.FourRaxDetected ||
                SmellCheese)
            {
                TimingAttackTask.RequiredSize = 20;
                TimingAttackTask.Clear();
            }


            foreach (Agent agent in tyr.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))
                    {
                        agent.Order(1342);
                        CollectionUtil.Increment(tyr.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(tyr.UnitManager.Counts, UnitTypes.MUTALISK);
                    }
                    else if (tyr.EnemyStrategyAnalyzer.LiftingDetected &&
                             Count(UnitTypes.ROACH) >= 35)
                    {
                        break;
                    }
                    else if (Minerals() >= 75 && Gas() >= 25 && ExpectedAvailableFood() > FoodUsed() + 6)
                    {
                        agent.Order(1351);
                        CollectionUtil.Increment(tyr.UnitManager.Counts, UnitTypes.ROACH);
                    }
                    else if (Minerals() >= 100)
                    {
                        agent.Order(1344);
                        CollectionUtil.Increment(tyr.UnitManager.Counts, UnitTypes.OVERLORD);
                        tyr.UnitManager.FoodExpected += 8;
                    }
                }
            }
        }
Esempio n. 2
0
        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 (StrategyAnalysis.CannonRush.Get().Detected)
            {
                attackTask.RequiredSize = 5;
            }

            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 (EarlyPool.Get().Detected&& !Expanded.Get().Detected&& Completed(UnitTypes.ZEALOT) < 2)
            {
                foreach (Agent agent in bot.UnitManager.Agents.Values)
                {
                    if (agent.Unit.UnitType == UnitTypes.NEXUS &&
                        agent.Unit.BuildProgress < 0.99)
                    {
                        agent.Order(Abilities.CANCEL);
                    }
                }
            }

            if (MassHydra.Get().Detected)
            {
                UseStalkers  = false;
                UseImmortals = false;
            }
            else if (MassRoach.Get().Detected)
            {
                UseStalkers  = true;
                UseImmortals = true;
            }
            else if (bot.EnemyStrategyAnalyzer.EncounteredEnemies.Contains(UnitTypes.HYDRALISK) || bot.EnemyStrategyAnalyzer.EncounteredEnemies.Contains(UnitTypes.HYDRALISK_DEN))
            {
                UseStalkers  = false;
                UseImmortals = false;
            }
            else if (bot.EnemyStrategyAnalyzer.EncounteredEnemies.Contains(UnitTypes.ROACH) || bot.EnemyStrategyAnalyzer.EncounteredEnemies.Contains(UnitTypes.ROACH_WARREN))
            {
                UseStalkers  = true;
                UseImmortals = true;
            }
            else
            {
                UseStalkers  = bot.EnemyRace == Race.Protoss || (MassRoach.Get().DetectedPreviously&& !MassHydra.Get().DetectedPreviously);
                UseImmortals = (MassRoach.Get().DetectedPreviously&& !MassHydra.Get().DetectedPreviously);
            }
        }
Esempio n. 3
0
        public override void OnFrame(Tyr tyr)
        {
            if (Count(UnitTypes.ZEALOT) + Count(UnitTypes.ADEPT) + Count(UnitTypes.STALKER) + Count(UnitTypes.COLLOSUS) + Count(UnitTypes.IMMORTAL) >= attackTask.RequiredSize)
            {
                Attacking = true;
            }

            if (tyr.EnemyStrategyAnalyzer.FourRaxDetected ||
                (tyr.Frame >= 22.4 * 85 && !tyr.EnemyStrategyAnalyzer.NoProxyTerranConfirmed && tyr.TargetManager.PotentialEnemyStartLocations.Count == 1) ||
                tyr.EnemyStrategyAnalyzer.ReaperRushDetected)
            {
                SmellCheese = true;
                defenseTask.MainDefenseRadius = 21;
            }

            if (!tyr.PreviousEnemyStrategies.TerranTech &&
                (tyr.PreviousEnemyStrategies.ReaperRush || tyr.PreviousEnemyStrategies.FourRax))
            {
                SmellCheese = true;
            }

            if (tyr.EnemyRace == Race.Zerg && !PokeTask.Stopped)
            {
                if (tyr.EnemyStrategyAnalyzer.Count(UnitTypes.ZERGLING) >= 10 ||
                    tyr.EnemyStrategyAnalyzer.Count(UnitTypes.SPINE_CRAWLER) >= 2 ||
                    tyr.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 tyr.UnitManager.Agents.Values)
                {
                    if (agent.Unit.UnitType == UnitTypes.NEXUS &&
                        agent.Unit.BuildProgress < 0.99)
                    {
                        agent.Order(Abilities.CANCEL);
                    }
                }
            }

            if (tyr.EnemyStrategyAnalyzer.BioDetected)
            {
                DefendMech = false;
            }
            else if (tyr.EnemyStrategyAnalyzer.MechDetected)
            {
                DefendMech = true;
            }
            else if (tyr.PreviousEnemyStrategies.Bio)
            {
                DefendMech = false;
            }
            else if (tyr.PreviousEnemyStrategies.Mech)
            {
                DefendMech = true;
            }
            else
            {
                DefendMech = false;
            }
        }