Example #1
0
        public override bool Detect()
        {
            if (Bot.Main.TargetManager.PotentialEnemyStartLocations.Count != 1)
            {
                return(false);
            }
            if (Bot.Main.Frame >= 22.4 * 60 * 3)
            {
                return(false);
            }
            if (Expanded.Get().Detected)
            {
                return(false);
            }
            foreach (Unit enemy in Bot.Main.Enemies())
            {
                if (!UnitTypes.BuildingTypes.Contains(enemy.UnitType))
                {
                    continue;
                }

                if (SC2Util.DistanceSq(enemy.Pos, Bot.Main.TargetManager.PotentialEnemyStartLocations[0]) >= 40 * 40)
                {
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
 public override bool Detect()
 {
     if (Bot.Main.EnemyStrategyAnalyzer.Count(UnitTypes.ZERGLING) > 0 && Bot.Main.Frame <= 22.4 * 90)
     {
         return(true);
     }
     if (!Expanded.Get().Detected &&
         Bot.Main.EnemyStrategyAnalyzer.Count(UnitTypes.SPAWNING_POOL) > 0 && Bot.Main.Frame <= 22.4 * 120)
     {
         float hp = -1;
         foreach (Unit enemy in Bot.Main.Enemies())
         {
             if (enemy.UnitType == UnitTypes.SPAWNING_POOL)
             {
                 hp = enemy.Health;
             }
         }
         if ((22.4 * 120 - Bot.Main.Frame) * 0.85 + hp >= 900)
         {
             return(true);
         }
     }
     else if (Bot.Main.EnemyStrategyAnalyzer.Count(UnitTypes.SPAWNING_POOL) > 0 && Bot.Main.Frame <= 22.4 * 105)
     {
         float hp = -1;
         foreach (Unit enemy in Bot.Main.Enemies())
         {
             if (enemy.UnitType == UnitTypes.SPAWNING_POOL)
             {
                 hp = enemy.Health;
             }
         }
         if ((22.4 * 105 - Bot.Main.Frame) * 0.85 + hp >= 900)
         {
             return(true);
         }
     }
     return(false);
 }