예제 #1
0
        public override void OnStart(Bot bot)
        {
            BuildingPlacement.ReservedBuilding reservedNatural = new BuildingPlacement.ReservedBuilding();
            reservedNatural.Pos  = Natural.BaseLocation.Pos;
            reservedNatural.Type = UnitTypes.NEXUS;
            bot.buildingPlacer.ReservedLocation.Add(reservedNatural);
            StutterController.Range = 15;

            MicroControllers.Add(new SoftLeashController(UnitTypes.COLOSUS, UnitTypes.IMMORTAL, 12));
            MicroControllers.Add(new FleeCyclonesController());
            MicroControllers.Add(new SentryController());
            MicroControllers.Add(new TempestController());
            MicroControllers.Add(new DisruptorController());
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(new FallBackController()
            {
                ReturnFire = true, MainDist = 40
            });
            MicroControllers.Add(new GravitonBeamController());
            MicroControllers.Add(new FearEnemyController(UnitTypes.PHOENIX, UnitTypes.MISSILE_TURRET, 11));
            MicroControllers.Add(new AttackEnemyController(UnitTypes.PHOENIX, UnitTypes.BANSHEE, 15, true));
            MicroControllers.Add(StutterController);
            MicroControllers.Add(StutterForwardController);

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

            Set += ProtossBuildUtil.Pylons(() => (Count(UnitTypes.PYLON) > 0 && Count(UnitTypes.CYBERNETICS_CORE) > 0 && Count(UnitTypes.STALKER) > 0) || bot.Frame >= 22.4 * 60 * 3.5);
            Set += Units();
            Set += ExpandBuildings();
            Set += MainBuildList();
        }
예제 #2
0
        public override void OnStart(Bot bot)
        {
            MicroControllers.Add(new StayByCannonsController());
            MicroControllers.Add(new FleeCyclonesController());
            MicroControllers.Add(new SentryController()
            {
                FleeEnemies = false, UseHallucaination = true
            });
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(new TargetUnguardedBuildingsController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new KillTargetController(UnitTypes.SCV)
            {
                MaxDist = 4
            });
            MicroControllers.Add(new KillTargetController(UnitTypes.SCV, true));

            if (SkipNatural)
            {
                foreach (Base b in bot.BaseManager.Bases)
                {
                    if (b == Main)
                    {
                        continue;
                    }
                    if (SC2Util.DistanceSq(b.BaseLocation.Pos, Main.BaseLocation.Pos) >= 50 * 50)
                    {
                        continue;
                    }
                    BuildingPlacement.ReservedBuilding reservedExpand = new BuildingPlacement.ReservedBuilding();
                    reservedExpand.Pos  = b.BaseLocation.Pos;
                    reservedExpand.Type = UnitTypes.NEXUS;
                    bot.buildingPlacer.ReservedLocation.Add(reservedExpand);
                }
            }

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

            bot.TargetManager.PrefferDistant = false;

            RampDefensePos = new PotentialHelper(MainDefensePos, 4).To(bot.MapAnalyzer.GetMainRamp()).Get();

            if (Bot.Main.EnemyRace == Race.Terran)
            {
                WallIn.CreateReaperWall(new List <uint> {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.CYBERNETICS_CORE
                });
                WallIn.ReserveSpace();
            }

            NaturalCannonDefensePos = NaturalDefensePos;

            if (Bot.Main.EnemyRace == Race.Zerg && !SkipNatural)
            {
                NaturalWall.CreateFullNatural(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                NaturalWall.ReserveSpace();

                if (NaturalWall.Wall.Count >= 4)
                {
                    if (bot.Map == MapEnum.Acropolis ||
                        bot.Map == MapEnum.Thunderbird)
                    {
                        WallBuilding temp = NaturalWall.Wall[3];
                        NaturalWall.Wall[3]     = NaturalWall.Wall[0];
                        NaturalWall.Wall[0]     = temp;
                        NaturalCannonDefensePos = new PotentialHelper(NaturalDefensePos, 4).To(Natural.BaseLocation.Pos).Get();
                    }
                    MainAndNatural = Bot.Main.MapAnalyzer.FindMainAndNaturalArea(NaturalWall);
                }
            }

            Set += ProtossBuildUtil.Pylons(() => Count(UnitTypes.PYLON) > 0 && Count(UnitTypes.CYBERNETICS_CORE) > 0);
            Set += ExpandBuildings();
            Set += Units();
            Set += MainBuildList();
        }