Example #1
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();
        }
Example #2
0
        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();
        }
Example #3
0
        public override void OnStart(Bot bot)
        {
            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(new AdvanceController());
            MicroControllers.Add(StutterController);
            MicroControllers.Add(StutterForwardController);

            WallIn.CreateReaperWall(new List <uint> {
                UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.CYBERNETICS_CORE
            });
            WallIn.ReserveSpace();

            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();
        }
Example #4
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();
        }
Example #5
0
        public override void OnStart(Bot bot)
        {
            MicroControllers.Add(new FleeCyclonesController());
            MicroControllers.Add(new SentryController());
            MicroControllers.Add(new DodgeBallController());
            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(new FallBackController()
            {
                ReturnFire = true, MainDist = 40
            });
            MicroControllers.Add(new FearMinesController());
            MicroControllers.Add(new AdvanceController());
            MicroControllers.Add(new StutterForwardController());

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


            WallIn.CreateReaperWall(new List <uint> {
                UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.CYBERNETICS_CORE
            });
            WallIn.ReserveSpace();

            Set += ProtossBuildUtil.Pylons(() => Count(UnitTypes.PYLON) > 0 && Count(UnitTypes.CYBERNETICS_CORE) > 0);
            Set += Units();
            Set += MainBuildList();
        }
Example #6
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();
        }
Example #7
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();
        }
Example #8
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();
        }
Example #9
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();
        }
Example #10
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();
        }
Example #11
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();
        }
Example #12
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();
        }
Example #13
0
        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();
        }
Example #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();
        }
Example #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();
        }
Example #16
0
        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();
        }
Example #17
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();
        }
Example #18
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();
        }
Example #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();
        }
Example #20
0
        public override void OnStart(Bot bot)
        {
            MicroControllers.Add(new FleeCyclonesController());
            MicroControllers.Add(new BlinkForwardController());
            MicroControllers.Add(new SentryController());
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(new TargetUnguardedBuildingsController());
            MicroControllers.Add(new AdvanceController());
            MicroControllers.Add(new StutterController());
            MicroControllers.Add(new KillTargetController(UnitTypes.SCV)
            {
                MaxDist = 4
            });
            MicroControllers.Add(KillCycloneController);
            MicroControllers.Add(KillBansheeController);
            MicroControllers.Add(new KillTargetController(UnitTypes.SCV, true));

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

            bot.TargetManager.PrefferDistant = false;


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

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

            try
            {
                string[]         scoutingLocations = Util.FileUtil.ReadScoutLocationFile();
                HashSet <string> existingLocations = new HashSet <string>();

                string[]       debugLines       = Util.FileUtil.ReadDebugFile();
                List <Point2D> fromCurrentStart = new List <Point2D>();
                List <Point2D> fromOtherStart   = new List <Point2D>();
                string         mapName          = bot.GameInfo.MapName;
                string         mapStartString   = mapName + "(" + bot.MapAnalyzer.StartLocation.X + ", " + bot.MapAnalyzer.StartLocation.Y + "):";

                foreach (string line in scoutingLocations)
                {
                    if (!line.StartsWith(mapName))
                    {
                        continue;
                    }
                    existingLocations.Add(line);
                }

                foreach (string line in debugLines)
                {
                    if (!line.StartsWith(mapName))
                    {
                        continue;
                    }
                    string position = line.Substring(line.LastIndexOf("("));
                    position = position.Replace(")", "").Replace("(", "");
                    string[] pos   = position.Split(',');
                    Point2D  point = new Point2D()
                    {
                        X = float.Parse(pos[0]), Y = float.Parse(pos[1])
                    };
                    if (line.StartsWith(mapStartString))
                    {
                        fromCurrentStart.Add(point);
                    }
                    else
                    {
                        fromOtherStart.Add(point);
                    }

                    Point2D basePos = null;
                    float   dist    = 1000000;
                    foreach (Base b in Bot.Main.BaseManager.Bases)
                    {
                        float newDist = SC2Util.DistanceSq(b.BaseLocation.Pos, point);
                        if (newDist > dist)
                        {
                            continue;
                        }
                        dist    = newDist;
                        basePos = b.BaseLocation.Pos;
                    }
                    string locationString = line.Substring(0, line.LastIndexOf("(")) + "(" + basePos.X + "," + basePos.Y + ")";
                    if (!existingLocations.Contains(locationString))
                    {
                        existingLocations.Add(locationString);
                        FileUtil.WriteScoutLocation(locationString);
                    }
                }

                foreach (string line in scoutingLocations)
                {
                    if (!line.StartsWith(mapStartString))
                    {
                        continue;
                    }

                    string position = line.Substring(line.LastIndexOf("("));
                    position = position.Replace(")", "").Replace("(", "");
                    string[] pos   = position.Split(',');
                    Point2D  point = new Point2D()
                    {
                        X = float.Parse(pos[0]), Y = float.Parse(pos[1])
                    };
                    ScoutLocations.Add(point);
                    DebugUtil.WriteLine("Found scout location: " + point);
                }
                HuntProxyTask.Task.ScoutBases = ScoutLocations;
            }
            catch (System.Exception e)
            {
                Util.DebugUtil.WriteLine("Exception when generating map image: " + e.Message);
            }
        }
Example #21
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();
        }
Example #22
0
        public override void OnStart(Bot bot)
        {
            DefenseTask.GroundDefenseTask.BeforeControllers.Add(new GravitonBeamController()
            {
                LiftReapers = true
            });
            DefenseTask.GroundDefenseTask.BeforeControllers.Add(KillMarauderController);
            MicroControllers.Add(new FleeCyclonesController());
            MicroControllers.Add(new BlinkForwardController());
            MicroControllers.Add(new SentryController());
            MicroControllers.Add(new DodgeBallController());
            MicroControllers.Add(new GravitonBeamController()
            {
                LiftMarauders = true
            });
            MicroControllers.Add(new FearEnemyController(UnitTypes.PHOENIX, UnitTypes.MISSILE_TURRET, 11));
            MicroControllers.Add(new AttackEnemyController(UnitTypes.PHOENIX, new HashSet <uint> {
                UnitTypes.BANSHEE, UnitTypes.RAVEN
            }, 20, true));
            MicroControllers.Add(new FearMinesController());
            MicroControllers.Add(new StutterController()
            {
                Range = 3
            });
            MicroControllers.Add(new KillTargetController(UnitTypes.SCV)
            {
                MaxDist = 4
            }.ExcludeAttackerType(UnitTypes.PHOENIX));
            MicroControllers.Add(new KillTargetController((unit) => unit.BuffIds.Contains(5))); // Kill lifted units
            MicroControllers.Add(new AttackEnemyController(UnitTypes.PHOENIX, UnitTypes.CYCLONE, 15, true));
            //MicroControllers.Add(KillMarauderController);
            MicroControllers.Add(KillCycloneController);
            MicroControllers.Add(KillBansheeController);
            MicroControllers.Add(KillVikingController);
            MicroControllers.Add(new KillTargetController(UnitTypes.SCV, true).ExcludeAttackerType(UnitTypes.PHOENIX));
            MicroControllers.Add(new AdvanceController());
            MicroControllers.Add(new StutterForwardController());
            MicroControllers.Add(PhoenixHuntAirController);
            MicroControllers.Add(PhoenixHuntCycloneController);
            MicroControllers.Add(PhoenixHuntMarauderController);
            MicroControllers.Add(new SoftLeashController(UnitTypes.PHOENIX, UnitTypes.STALKER, 5));
            TimingAttackTask.Task.BeforeControllers.Add(new SoftLeashController(UnitTypes.STALKER, UnitTypes.IMMORTAL, 7));

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

            WallIn.CreateReaperWall(new List <uint> {
                UnitTypes.GATEWAY, UnitTypes.PYLON, UnitTypes.CYBERNETICS_CORE
            });
            WallIn.ReserveSpace();

            Set += ProtossBuildUtil.Pylons(() => Count(UnitTypes.PYLON) >= 2 &&
                                           Count(UnitTypes.CYBERNETICS_CORE) > 0 &&
                                           (!ProxyMarauderSuspected || Count(UnitTypes.SHIELD_BATTERY) >= 2) &&
                                           (!ProxyMarauderSuspected || bot.Observation.Observation.PlayerCommon.FoodUsed >= 27));
            Set += Units();
            Set += MainBuildList();

            if (HuntProxies)
            {
                try
                {
                    DetermineProxyLocations();
                }
                catch (System.Exception e)
                {
                    Util.DebugUtil.WriteLine("Exception when generating map image: " + e.Message);
                }
            }
        }