示例#1
0
文件: Sanity.cs 项目: evilz/TyrSc2
        public override void OnStart(Bot bot)
        {
            MicroControllers.Add(new FleeCyclonesController());
            MicroControllers.Add(new SentryController());
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(new FearMinesController());
            MicroControllers.Add(new AdvanceController());
            MicroControllers.Add(new StutterController());
            TimingAttackTask.Task.BeforeControllers.Add(new SoftLeashController(UnitTypes.STALKER, UnitTypes.IMMORTAL, 5)
            {
                MinEnemyRange = 25
            });

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

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

            Set += ProtossBuildUtil.Pylons(() => Count(UnitTypes.PYLON) > 0 && Count(UnitTypes.CYBERNETICS_CORE) > 0);
            Set += Units();
            Set += MainBuildList();
        }
示例#2
0
        public override void OnStart(Bot bot)
        {
            MicroControllers.Add(TempestController);
            MicroControllers.Add(new StutterController());

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

            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
                ShieldBatteryPos = SC2Util.TowardCardinal(WallIn.Wall[1].Pos, Main.BaseLocation.Pos, 2);
                Bot.Main.buildingPlacer.ReservedLocation.Add(new ReservedBuilding()
                {
                    Type = UnitTypes.SHIELD_BATTERY, Pos = ShieldBatteryPos
                });
            }

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) >= 2);
            Set += Units();
            Set += MainBuildList();
        }
示例#3
0
        public void BuildInsideWall(WallInCreator wallIn)
        {
            BoolGrid      pathable       = Bot.Main.MapAnalyzer.Pathable;
            ArrayBoolGrid walledPathable = new ArrayBoolGrid(pathable.Width(), pathable.Height());

            for (int x = 0; x < pathable.Width(); x++)
            {
                for (int y = 0; y < pathable.Height(); y++)
                {
                    if (!pathable[x, y])
                    {
                        walledPathable[x, y] = false;
                        continue;
                    }
                    bool blocked = false;
                    foreach (WallBuilding building in wallIn.Wall)
                    {
                        if (Math.Abs(building.Pos.X - x) <= building.Size.X / 2f &&
                            Math.Abs(building.Pos.Y - y) <= building.Size.Y / 2f)
                        {
                            blocked = true;
                            break;
                        }
                    }
                    walledPathable[x, y] = !blocked;
                }
            }
            LimitBuildArea = walledPathable.GetConnected(SC2Util.To2D(Bot.Main.MapAnalyzer.StartLocation));

            /*
             * DrawGrid(pathable, "Pathable");
             * DrawGrid(walledPathable, "WalledPathable");
             * DrawGrid(LimitBuildArea, "BuildArea");
             */
        }
示例#4
0
        public override void OnStart(Tyr tyr)
        {
            OverrideDefenseTarget = tyr.MapAnalyzer.Walk(NaturalDefensePos, tyr.MapAnalyzer.EnemyDistances, 15);

            MicroControllers.Add(StutterForwardController);
            MicroControllers.Add(FallBackController);
            MicroControllers.Add(new FearMinesController());
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new DisruptorController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new TempestController());
            MicroControllers.Add(new AdvanceController());

            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.CreateNatural(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.GATEWAY, UnitTypes.ZEALOT, UnitTypes.GATEWAY
                });
                ShieldBatteryPos = DetermineShieldBatteryPos();
                WallIn.ReserveSpace();
            }

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0 &&
                                           (Count(UnitTypes.CYBERNETICS_CORE) > 0 || tyr.EnemyStrategyAnalyzer.EarlyPool) &&
                                           (Count(UnitTypes.GATEWAY) >= 2 || !tyr.EnemyStrategyAnalyzer.EarlyPool));
            Set += ExpandBuildings();
            Set += Units();
            Set += MainBuild();
        }
示例#5
0
        public override void OnStart(Tyr tyr)
        {
            OverrideDefenseTarget     = tyr.MapAnalyzer.Walk(NaturalDefensePos, tyr.MapAnalyzer.EnemyDistances, 15);
            OverrideMainDefenseTarget = new PotentialHelper(tyr.MapAnalyzer.GetMainRamp(), 6).
                                        To(tyr.MapAnalyzer.StartLocation)
                                        .Get();

            MicroControllers.Add(FallBackController);
            MicroControllers.Add(new FearMinesController());
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new SentryController());
            MicroControllers.Add(new DisruptorController());
            MicroControllers.Add(StutterController);
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new TempestController());
            MicroControllers.Add(new AdvanceController());
            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
            }

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0 && (Count(UnitTypes.CYBERNETICS_CORE) > 0 || tyr.EnemyStrategyAnalyzer.WorkerRushDetected));
            Set += ExpandBuildings();
            Set += Units();
            Set += MainBuild();
        }
示例#6
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();
        }
示例#7
0
        public override void OnStart(Bot bot)
        {
            AttackMicroControllers.Add(new SoftLeashController(new HashSet <uint>()
            {
                UnitTypes.LIBERATOR, UnitTypes.MEDIVAC, UnitTypes.HELLBAT
            },
                                                               new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED, UnitTypes.THOR
            },
                                                               12));
            AttackMicroControllers.Add(new HellionHarassController());

            AttackMicroControllers.Add(new SoftLeashController(new HashSet <uint>()
            {
                UnitTypes.CYCLONE
            },
                                                               new HashSet <uint>()
            {
                UnitTypes.HELLBAT
            },
                                                               12));
            AttackMicroControllers.Add(new LeashController(new HashSet <uint>()
            {
                UnitTypes.CYCLONE
            },
                                                           new HashSet <uint>()
            {
                UnitTypes.HELLBAT
            },
                                                           4));

            MicroControllers.Add(new TankController()
            {
                SiegeAgainstMelee = true
            });
            MicroControllers.Add(new LiberatorController());
            MicroControllers.Add(VikingController);
            MicroControllers.Add(new MedivacController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(new MineController());

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

            Set += SupplyDepots();
            Set += Turrets();
            Set += MainBuild();
        }
示例#8
0
        public override void OnStart(Tyr tyr)
        {
            DefenseTask.Enable();
            tyr.TaskManager.Add(attackTask);
            tyr.TaskManager.Add(WorkerScoutTask);
            tyr.TaskManager.Add(new ObserverScoutTask());
            tyr.TaskManager.Add(new ArmyObserverTask());
            tyr.TaskManager.Add(new AdeptScoutTask());
            tyr.TaskManager.Add(TimedObserverTask);
            PhasedDisruptorTask.Enable();
            if (tyr.BaseManager.Pocket != null)
            {
                tyr.TaskManager.Add(new ScoutProxyTask(tyr.BaseManager.Pocket.BaseLocation.Pos));
            }
            ArchonMergeTask.Enable();

            OverrideDefenseTarget = tyr.MapAnalyzer.Walk(NaturalDefensePos, tyr.MapAnalyzer.EnemyDistances, 15);

            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(FearSpinesController);
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new DisruptorController());

            if (WallIn == null)
            {
                System.Console.WriteLine("Creating wall.");
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
                System.Console.WriteLine("Wall size: " + WallIn.Wall.Count);
                foreach (WallBuilding building in WallIn.Wall)
                {
                    System.Console.WriteLine("Building pos: " + building.Pos);
                }
            }

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0);
            Set += EmergencyGateways();
            Set += MutaCannons();
            Set += ExpandBuildings();
            Set += Nexii();
            Set += MainBuild();
        }
示例#9
0
        public override void OnStart(Bot bot)
        {
            WorkerScoutTask.StartFrame = 1200;

            DefenseTask.Enable();
            bot.TaskManager.Add(AttackTask);
            bot.TaskManager.Add(WorkerScoutTask);
            ArmyObserverTask.Enable();
            bot.TaskManager.Add(new ObserverScoutTask()
            {
                Priority = 6
            });
            if (bot.BaseManager.Pocket != null)
            {
                bot.TaskManager.Add(new ScoutProxyTask(bot.BaseManager.Pocket.BaseLocation.Pos));
            }
            ArchonMergeTask.Enable();

            OverrideDefenseTarget = bot.MapAnalyzer.Walk(NaturalDefensePos, bot.MapAnalyzer.EnemyDistances, 15);

            MicroControllers.Add(FallBackController);
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new SoftLeashController(UnitTypes.STALKER, UnitTypes.IMMORTAL, 6));
            MicroControllers.Add(new DisruptorController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new TempestController());
            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
            }

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0);
            Set += CannonDefense();
            Set += EmergencyGateways();
            Set += ExpandBuildings();
            Set += Units();
            Set += MainBuild();
        }
示例#10
0
        public override void OnStart(Bot bot)
        {
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new DodgeBallController());

            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.SUPPLY_DEPOT, UnitTypes.SUPPLY_DEPOT, UnitTypes.BARRACKS
                });
                WallIn.ReserveSpace();
            }

            Set += SupplyDepots();
            Set += MainBuild();
        }
示例#11
0
        public override void OnStart(Tyr tyr)
        {
            WorkerScoutTask.StartFrame = 1200;

            DefenseTask.Enable();
            tyr.TaskManager.Add(AttackTask);
            tyr.TaskManager.Add(WorkerScoutTask);
            ArmyObserverTask.Enable();
            tyr.TaskManager.Add(new ObserverScoutTask()
            {
                Priority = 6
            });
            tyr.TaskManager.Add(new AdeptScoutTask());
            if (tyr.BaseManager.Pocket != null)
            {
                tyr.TaskManager.Add(new ScoutProxyTask(tyr.BaseManager.Pocket.BaseLocation.Pos));
            }
            ArchonMergeTask.Enable();
            MechDestroyExpandsTask.Enable();

            OverrideDefenseTarget = tyr.MapAnalyzer.Walk(NaturalDefensePos, tyr.MapAnalyzer.EnemyDistances, 15);

            MicroControllers.Add(new VoidrayController());
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new DisruptorController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new TempestController());
            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
            }

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0);
            Set += CannonDefense();
            Set += ExpandBuildings();
            Set += MainBuild();
        }
示例#12
0
文件: MacroToss.cs 项目: evilz/TyrSc2
        public override void OnStart(Bot bot)
        {
            DefenseTask.Enable();
            bot.TaskManager.Add(attackTask);
            bot.TaskManager.Add(WorkerScoutTask);
            bot.TaskManager.Add(new ObserverScoutTask());
            bot.TaskManager.Add(new ArmyObserverTask());
            bot.TaskManager.Add(new AdeptScoutTask());
            bot.TaskManager.Add(TimedObserverTask);
            PhasedDisruptorTask.Enable();
            if (bot.BaseManager.Pocket != null)
            {
                bot.TaskManager.Add(new ScoutProxyTask(bot.BaseManager.Pocket.BaseLocation.Pos));
            }
            ArchonMergeTask.Enable();

            OverrideDefenseTarget = bot.MapAnalyzer.Walk(NaturalDefensePos, bot.MapAnalyzer.EnemyDistances, 15);

            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(FearSpinesController);
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new DisruptorController());

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

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0);
            Set += EmergencyGateways();
            Set += MutaCannons();
            Set += ExpandBuildings();
            Set += Nexii();
            Set += MainBuild();
        }
示例#13
0
        public BoolGrid FindMainAndNaturalArea(WallInCreator wall)
        {
            ArrayBoolGrid pathable = new ArrayBoolGrid(Pathable);

            foreach (WallBuilding building in wall.Wall)
            {
                for (float dx = building.Pos.X - building.Size.X / 2f; dx <= building.Pos.X + building.Size.X / 2f; dx++)
                {
                    for (float dy = building.Pos.Y - building.Size.Y / 2f; dy <= building.Pos.Y + building.Size.Y / 2f; dy++)
                    {
                        pathable[(int)dx, (int)dy] = false;
                    }
                }
            }

            BoolGrid result = pathable.GetConnected(SC2Util.To2D(StartLocation));

            //DrawGrid(result, "MainAndNatural.png");
            return(result);
        }
示例#14
0
        public override void OnStart(Bot bot)
        {
            foreach (WorkerDefenseTask task in WorkerDefenseTask.Tasks)
            {
                task.OnlyDefendInsideMain = true;
            }

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

            Base  third = null;
            float dist  = 1000000;

            foreach (Base b in bot.BaseManager.Bases)
            {
                if (b == Main ||
                    b == Natural)
                {
                    continue;
                }
                float newDist = SC2Util.DistanceSq(b.BaseLocation.Pos, Main.BaseLocation.Pos);
                if (newDist > dist)
                {
                    continue;
                }
                dist  = newDist;
                third = b;
            }
            CannonPos = new PotentialHelper(bot.MapAnalyzer.StartLocation, 18).To(third.BaseLocation.Pos).Get();

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) >= 2);
            Set += Units();
            Set += MainBuildList();
        }
示例#15
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();
        }
示例#16
0
        public override void OnStart(Tyr tyr)
        {
            DefenseTask.Enable();
            tyr.TaskManager.Add(attackTask);
            tyr.TaskManager.Add(WorkerScoutTask);
            ArmyObserverTask.Enable();
            tyr.TaskManager.Add(new ObserverScoutTask()
            {
                Priority = 6
            });
            tyr.TaskManager.Add(new AdeptScoutTask());
            if (tyr.BaseManager.Pocket != null)
            {
                tyr.TaskManager.Add(new ScoutProxyTask(tyr.BaseManager.Pocket.BaseLocation.Pos));
            }
            ArchonMergeTask.Enable();

            if (StalkerDefenseSquads == null)
            {
                StalkerDefenseSquads = DefenseSquadTask.GetDefenseTasks(UnitTypes.STALKER);
            }
            else
            {
                foreach (DefenseSquadTask task in StalkerDefenseSquads)
                {
                    Tyr.Bot.TaskManager.Add(task);
                }
            }
            DefenseSquadTask.Enable(StalkerDefenseSquads, true, true);

            OverrideDefenseTarget = tyr.MapAnalyzer.Walk(NaturalDefensePos, tyr.MapAnalyzer.EnemyDistances, 15);

            MicroControllers.Add(new SpreadOutController()
            {
                SpreadTypes = new HashSet <uint>()
                {
                    UnitTypes.IMMORTAL, UnitTypes.ARCHON, UnitTypes.STALKER
                }
            });
            MicroControllers.Add(FearSpinesController);
            MicroControllers.Add(new FearMinesController());
            MicroControllers.Add(new FallBackController());
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new DisruptorController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new TempestController());
            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.GATEWAY
                });
                WallIn.ReserveSpace();
            }

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0 && (Completed(Natural, UnitTypes.PYLON) > 0 || Count(UnitTypes.PYLON) < 2 || Minerals() >= 500));
            Set += CannonDefense();
            Set += EmergencyGateways();
            Set += ExpandBuildings();
            Set += Nexii();
            Set += Units();
            Set += MainBuild();
        }
示例#17
0
文件: PvZHjax.cs 项目: evilz/TyrSc2
        public override void OnStart(Bot bot)
        {
            OverrideDefenseTarget = bot.MapAnalyzer.Walk(NaturalDefensePos, bot.MapAnalyzer.EnemyDistances, 15);

            MicroControllers.Add(FearSpinesController);
            MicroControllers.Add(new HTController());
            MicroControllers.Add(new AdeptKillWorkersController()
            {
                TargetTypes = new HashSet <uint> {
                    UnitTypes.ZERGLING
                }
            });
            MicroControllers.Add(new AdeptKillWorkersController());
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(new SoftLeashController(UnitTypes.ZEALOT, new HashSet <uint>()
            {
                UnitTypes.IMMORTAL, UnitTypes.ARCHON
            }, 6));
            MicroControllers.Add(new SoftLeashController(UnitTypes.ARCHON, UnitTypes.IMMORTAL, 6));
            MicroControllers.Add(StutterForwardController);
            MicroControllers.Add(FallBackController);
            MicroControllers.Add(new FearMinesController());
            MicroControllers.Add(new StalkerController());
            MicroControllers.Add(new DisruptorController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new ColloxenController());
            MicroControllers.Add(new TempestController());
            MicroControllers.Add(new AdvanceController());

            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.CreateNatural(new List <uint>()
                {
                    UnitTypes.GATEWAY, UnitTypes.GATEWAY, UnitTypes.ZEALOT, UnitTypes.GATEWAY
                });
                ShieldBatteryPos = DetermineShieldBatteryPos();
                WallIn.ReserveSpace();
                foreach (WallBuilding building in WallIn.Wall)
                {
                    if (building.Type == UnitTypes.PYLON)
                    {
                        Bot.Main.buildingPlacer.ReservedLocation.Add(new ReservedBuilding()
                        {
                            Type = UnitTypes.NEXUS, Pos = building.Pos
                        });
                    }
                }
            }

            Base  third = null;
            float dist  = 1000000;

            foreach (Base b in bot.BaseManager.Bases)
            {
                if (b == Main ||
                    b == Natural)
                {
                    continue;
                }
                float newDist = SC2Util.DistanceSq(b.BaseLocation.Pos, Main.BaseLocation.Pos);
                if (newDist > dist)
                {
                    continue;
                }
                dist  = newDist;
                third = b;
            }
            NydusPos = new PotentialHelper(bot.MapAnalyzer.StartLocation, 18).To(third.BaseLocation.Pos).Get();

            Set += ProtossBuildUtil.Pylons(() => Completed(UnitTypes.PYLON) > 0 &&
                                           (Count(UnitTypes.CYBERNETICS_CORE) > 0 || EarlyPool.Get().Detected) &&
                                           (Count(UnitTypes.GATEWAY) >= 2 || !EarlyPool.Get().Detected));
            Set += ExpandBuildings();
            Set += Units();
            Set += MainBuild();
        }
示例#18
0
        public override void OnStart(Tyr tyr)
        {
            TimingAttackTask.Task.CustomControllers.Add(new LeashController(new HashSet <uint>()
            {
                UnitTypes.LIBERATOR, UnitTypes.MEDIVAC, UnitTypes.CYCLONE, UnitTypes.VIKING_FIGHTER
            },
                                                                            new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED
            },
                                                                            4));
            TimingAttackTask.Task.CustomControllers.Add(new LeashController(new HashSet <uint>()
            {
                UnitTypes.MARAUDER, UnitTypes.MARINE
            },
                                                                            new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED
            },
                                                                            8));
            TimingAttackTask.Task.CustomControllers.Add(new SoftLeashController(new HashSet <uint>()
            {
                UnitTypes.LIBERATOR, UnitTypes.MEDIVAC, UnitTypes.CYCLONE, UnitTypes.MARAUDER, UnitTypes.MARINE, UnitTypes.VIKING_FIGHTER
            },
                                                                                new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED
            },
                                                                                12));

            MicroControllers.Add(new FearEnemyController(new HashSet <uint>()
            {
                UnitTypes.MARINE, UnitTypes.CYCLONE
            }, UnitTypes.PHOTON_CANNON, 10));
            MicroControllers.Add(new TankController());
            MicroControllers.Add(new LiberatorController());
            MicroControllers.Add(new VikingController()
            {
                StickToTanks = false
            });
            MicroControllers.Add(new MedivacController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(MarineHarassController);

            if (WallIn == null)
            {
                WallIn = new WallInCreator();
                WallIn.Create(new List <uint>()
                {
                    UnitTypes.SUPPLY_DEPOT, UnitTypes.SUPPLY_DEPOT, UnitTypes.BUNKER
                });
                WallIn.ReserveSpace();
            }

            Set += SupplyDepots();
            Set += Turrets();
            Set += AntiWorkerRush();
            Set += AntiTempestBuild();
            Set += AntiCannonBuild();
            Set += MainBuild();
        }
示例#19
0
        public override void OnStart(Bot bot)
        {
            AttackMicroControllers.Add(new LeashController(
                                           new HashSet <uint>()
            {
                UnitTypes.LIBERATOR, UnitTypes.MEDIVAC, UnitTypes.HELLBAT, UnitTypes.WIDOW_MINE, UnitTypes.MARINE
            },
                                           new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED, UnitTypes.THOR, UnitTypes.THOR_SINGLE_TARGET
            },
                                           4));
            AttackMicroControllers.Add(new SoftLeashController(
                                           new HashSet <uint>()
            {
                UnitTypes.LIBERATOR, UnitTypes.MEDIVAC, UnitTypes.HELLBAT, UnitTypes.WIDOW_MINE, UnitTypes.MARINE
            },
                                           new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED, UnitTypes.THOR, UnitTypes.THOR_SINGLE_TARGET
            },
                                           12));
            AttackMicroControllers.Add(new LeashController(
                                           new HashSet <uint>()
            {
                UnitTypes.THOR, UnitTypes.THOR_SINGLE_TARGET
            },
                                           new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED
            },
                                           8));
            AttackMicroControllers.Add(new SoftLeashController(
                                           new HashSet <uint>()
            {
                UnitTypes.THOR, UnitTypes.THOR_SINGLE_TARGET
            },
                                           new HashSet <uint>()
            {
                UnitTypes.SIEGE_TANK, UnitTypes.SIEGE_TANK_SIEGED
            },
                                           12));

            MicroControllers.Add(new MineController());
            MicroControllers.Add(new TankController());
            MicroControllers.Add(new LiberatorController());
            MicroControllers.Add(new VikingController());
            MicroControllers.Add(new MedivacController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new DodgeBallController());

            OverrideDefenseTarget = bot.MapAnalyzer.Walk(NaturalDefensePos, bot.MapAnalyzer.EnemyDistances, 15);

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

            Set += SupplyDepots();
            Set += Turrets();
            Set += MainBuild();
        }