Пример #1
0
        public List <Build> GetBuilds(Bot bot, string[] lines)
        {
            List <Build> options = new List <Build>();


            if (Bot.Main.EnemyRace == Race.Protoss)
            {
                if (Stalker.Get().DetectedPreviously &&
                    Zealot.Get().DetectedPreviously &&
                    !Immortal.Get().DetectedPreviously)
                {
                    options.Add(new DefensiveSentries()
                    {
                        DelayAttacking = true
                    });
                    //options.Add(new MassSentries() { SkipNatural = true });
                    //options.Add(new GreedySentries());
                    return(options);
                }
                if (!Stalker.Get().DetectedPreviously &&
                    Zealot.Get().DetectedPreviously &&
                    !Immortal.Get().DetectedPreviously)
                {
                    //options.Add(new DefensiveSentries() { DelayAttacking = true });
                    options.Add(new MassSentries()
                    {
                        SkipNatural = true
                    });
                    return(options);
                }
            }
            if (Bot.Main.EnemyRace == Race.Zerg)
            {
                if ((Zergling.Get().DetectedPreviously || Roach.Get().DetectedPreviously) &&
                    !Hydralisk.Get().DetectedPreviously)
                {
                    options.Add(new DefensiveSentries());
                    return(options);
                }
            }
            if (Bot.Main.EnemyRace == Race.Terran && Battlecruiser.Get().DetectedPreviously&& !SiegeTank.Get().DetectedPreviously)
            {
                options.Add(new MassSentries()
                {
                    AntiBC = true
                });
                return(options);
            }
            options.Add(new MassSentries());
            options.Add(new GreedySentries());
            options.Add(new DefensiveSentries()
            {
                DelayAttacking = true
            });

            return(options);
        }
Пример #2
0
 public override void Produce(Bot bot, Agent agent)
 {
     if (agent.Unit.UnitType == UnitTypes.NEXUS &&
         Minerals() >= 50 &&
         Count(UnitTypes.PROBE) < 23 - Completed(UnitTypes.ASSIMILATOR))
     {
         if (Count(UnitTypes.PROBE) < 13 || Count(UnitTypes.PYLON) > 0)
         {
             agent.Order(1006);
         }
     }
     else if (agent.Unit.UnitType == UnitTypes.GATEWAY)
     {
         if (Completed(UnitTypes.CYBERNETICS_CORE) > 0 &&
             Minerals() >= 125 &&
             Gas() >= 50 &&
             UpgradeType.LookUp[UpgradeType.WarpGate].Progress() < 0.7 &&
             Count(UnitTypes.STALKER) < 10 || UpgradeType.LookUp[UpgradeType.Blink].Done())
         {
             agent.Order(917);
         }
     }
     else if (agent.Unit.UnitType == UnitTypes.WARP_GATE)
     {
         if (ProxyFourGateTask.Task.BuildRobo && Count(UnitTypes.ROBOTICS_FACILITY) == 0 && (Minerals() < 300 || Gas() < 150))
         {
             return;
         }
         if (Completed(UnitTypes.ROBOTICS_FACILITY) > 0 && !RobosActive() && (Minerals() < 350 || Gas() < 150) && (Count(UnitTypes.IMMORTAL) < 2 || Count(UnitTypes.STALKER) >= 7))
         {
             return;
         }
         if (Completed(UnitTypes.CYBERNETICS_CORE) > 0 &&
             Minerals() >= 125 &&
             Gas() >= 50 &&
             DefendReapers &&
             ReaperDefenseTask.Units.Count == 0)
         {
             Point2D aroundTile = SC2Util.To2D(bot.MapAnalyzer.StartLocation);
             Point2D placement  = WarpInPlacer.FindPlacement(aroundTile, UnitTypes.STALKER);
             if (placement != null)
             {
                 agent.Order(1414, placement);
             }
         }
         else if (Completed(UnitTypes.STALKER) >= 4 &&
                  Minerals() >= 100 &&
                  Bot.Main.EnemyRace == Race.Zerg &&
                  !Roach.Get().DetectedPreviously &&
                  Count(UnitTypes.ZEALOT) < Count(UnitTypes.STALKER))
         {
             Point2D aroundTile = ProxyFourGateTask.Task.GetHideLocation();
             if (aroundTile == null)
             {
                 aroundTile = SC2Util.To2D(bot.MapAnalyzer.StartLocation);
             }
             Point2D placement = WarpInPlacer.FindPlacement(aroundTile, UnitTypes.ZEALOT);
             if (placement != null)
             {
                 agent.Order(1413, placement);
             }
         }
         else if (Completed(UnitTypes.CYBERNETICS_CORE) > 0 &&
                  Minerals() >= 125 &&
                  Gas() >= 50)
         {
             Point2D aroundTile = ProxyFourGateTask.Task.GetHideLocation();
             if (aroundTile == null)
             {
                 aroundTile = SC2Util.To2D(bot.MapAnalyzer.StartLocation);
             }
             Point2D placement = WarpInPlacer.FindPlacement(aroundTile, UnitTypes.STALKER);
             if (placement != null)
             {
                 agent.Order(1414, placement);
             }
         }
     }
     else if (agent.Unit.UnitType == UnitTypes.ROBOTICS_FACILITY)
     {
         if (Count(UnitTypes.OBSERVER) == 0 &&
             Minerals() >= 25 &&
             Gas() >= 75 &&
             FoodLeft() >= 1)
         {
             agent.Order(977);
         }
         else if (Minerals() >= 275 &&
                  Gas() >= 100 &&
                  FoodLeft() >= 4)
         {
             agent.Order(979);
         }
     }
 }