示例#1
0
        public override void OnStart(Tyr tyr)
        {
            MicroControllers.Add(new FleeCyclonesController());
            MicroControllers.Add(new TempestController());
            MicroControllers.Add(new StutterController());

            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.CreateFullNatural(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
            }
            if (MainWallIn == null)
            {
                MainWallIn = new WallInCreator();
                MainWallIn.Create(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                MainWallIn.ReserveSpace();
            }

            Set += ProtossBuildUtil.Pylons();
            Set += Units();
            Set += MainBuildList();
        }
示例#2
0
        public override void OnStart(Bot bot)
        {
            if (BuildDefenses == null)
            {
                BuildDefenses = () => !SkipDefenses;
            }
            bot.Monday = true;

            MicroControllers.Add(FearVikingsController);
            MicroControllers.Add(new VoidrayController());
            MicroControllers.Add(new CarrierController());
            MicroControllers.Add(new StutterController());

            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.CreateFullNatural(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
                if (NaturalWall)
                {
                    bot.buildingPlacer.BuildInsideWall(WallIn);
                }
            }

            Set += NaturalDefenses();
            Set += RushDefenses();
            Set += ProtossBuildUtil.Pylons();
            Set += BuildReaperDefenseCannon();
            Set += BuildReaperRushDefense();
            Set += ProtossBuildUtil.Nexus(2, () => Count(UnitTypes.GATEWAY) > 0 && (!DelayNatural || Count(UnitTypes.STARGATE) > 0));
            Set += PowerPylons();
            Set += MainBuild();
        }
示例#3
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();
        }