Ejemplo n.º 1
0
        public List <Build> GetBuilds(Bot bot, string[] lines)
        {
            List <Build> options = new List <Build>();


            if (Bot.Main.EnemyRace == Race.Protoss)
            {
                if (Stalker.Get().DetectedPreviously &&
                    Zealot.Get().DetectedPreviously &&
                    !Immortal.Get().DetectedPreviously)
                {
                    options.Add(new DefensiveSentries()
                    {
                        DelayAttacking = true
                    });
                    //options.Add(new MassSentries() { SkipNatural = true });
                    //options.Add(new GreedySentries());
                    return(options);
                }
                if (!Stalker.Get().DetectedPreviously &&
                    Zealot.Get().DetectedPreviously &&
                    !Immortal.Get().DetectedPreviously)
                {
                    //options.Add(new DefensiveSentries() { DelayAttacking = true });
                    options.Add(new MassSentries()
                    {
                        SkipNatural = true
                    });
                    return(options);
                }
            }
            if (Bot.Main.EnemyRace == Race.Zerg)
            {
                if ((Zergling.Get().DetectedPreviously || Roach.Get().DetectedPreviously) &&
                    !Hydralisk.Get().DetectedPreviously)
                {
                    options.Add(new DefensiveSentries());
                    return(options);
                }
            }
            if (Bot.Main.EnemyRace == Race.Terran && Battlecruiser.Get().DetectedPreviously&& !SiegeTank.Get().DetectedPreviously)
            {
                options.Add(new MassSentries()
                {
                    AntiBC = true
                });
                return(options);
            }
            options.Add(new MassSentries());
            options.Add(new GreedySentries());
            options.Add(new DefensiveSentries()
            {
                DelayAttacking = true
            });

            return(options);
        }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     if (transform.root.name.Contains("Roach"))
     {
         r = transform.root.GetComponent <Roach>();
     }
     else if (transform.root.name.Contains("SkeletonArcher"))
     {
         sA = transform.root.GetComponent <SkeletonArcher>();
     }
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            #region Fill collection
            Dog firstDog = new Dog(){CreatureId = 1};
            Horse firstHorse = new Horse() { CreatureId = 2 };
            Dog secondDog = new Dog() { CreatureId = 3 };
            Crucian firstCrucian = new Crucian() { CreatureId = 4 };
            Roach firstRoach = new Roach() { CreatureId = 5 };
            Crucian secondCrucian = new Crucian() {CreatureId = 6};
            Horse secondHorse = new Horse() {CreatureId = 7};
            #endregion

            List<LivingCreatures> listOfCreatures = new List<LivingCreatures>() {firstDog,firstHorse,secondDog,firstCrucian,firstRoach,secondCrucian,secondHorse};

            Console.WriteLine("Amount of creatures in collection is:{0}\nAmount of legs is:{1}\n",listOfCreatures.Count,AmountOfLegs(listOfCreatures));
            UnderwaterBreathingCreaturesId(listOfCreatures);
            Console.ReadLine();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            #region Fill collection
            Dog firstDog = new Dog()
            {
                CreatureId = 1
            };
            Horse firstHorse = new Horse()
            {
                CreatureId = 2
            };
            Dog secondDog = new Dog()
            {
                CreatureId = 3
            };
            Crucian firstCrucian = new Crucian()
            {
                CreatureId = 4
            };
            Roach firstRoach = new Roach()
            {
                CreatureId = 5
            };
            Crucian secondCrucian = new Crucian()
            {
                CreatureId = 6
            };
            Horse secondHorse = new Horse()
            {
                CreatureId = 7
            };
            #endregion

            List <LivingCreatures> listOfCreatures = new List <LivingCreatures>()
            {
                firstDog, firstHorse, secondDog, firstCrucian, firstRoach, secondCrucian, secondHorse
            };

            Console.WriteLine("Amount of creatures in collection is:{0}\nAmount of legs is:{1}\n", listOfCreatures.Count, AmountOfLegs(listOfCreatures));
            UnderwaterBreathingCreaturesId(listOfCreatures);
            Console.ReadLine();
        }
Ejemplo n.º 5
0
    void Run()
    {
        Scanner input = new Scanner(Console.In);

        int N = input.NextInt();

        Roach[] v = new Roach[N];
        for (int i = 0; i < N; i++)
        {
            v[i].x     = input.NextInt();
            v[i].y     = input.NextInt();
            v[i].index = i;
        }

        Array.Sort(v);

        for (int i = 0; i < N; i++)
        {
            Console.WriteLine("{0} {1}", v[i].x, v[i].y);
        }
    }
Ejemplo n.º 6
0
 public override void Produce(Bot bot, Agent agent)
 {
     if (agent.Unit.UnitType == UnitTypes.NEXUS &&
         Minerals() >= 50 &&
         Count(UnitTypes.PROBE) < 23 - Completed(UnitTypes.ASSIMILATOR))
     {
         if (Count(UnitTypes.PROBE) < 13 || Count(UnitTypes.PYLON) > 0)
         {
             agent.Order(1006);
         }
     }
     else if (agent.Unit.UnitType == UnitTypes.GATEWAY)
     {
         if (Completed(UnitTypes.CYBERNETICS_CORE) > 0 &&
             Minerals() >= 125 &&
             Gas() >= 50 &&
             UpgradeType.LookUp[UpgradeType.WarpGate].Progress() < 0.7 &&
             Count(UnitTypes.STALKER) < 10 || UpgradeType.LookUp[UpgradeType.Blink].Done())
         {
             agent.Order(917);
         }
     }
     else if (agent.Unit.UnitType == UnitTypes.WARP_GATE)
     {
         if (ProxyFourGateTask.Task.BuildRobo && Count(UnitTypes.ROBOTICS_FACILITY) == 0 && (Minerals() < 300 || Gas() < 150))
         {
             return;
         }
         if (Completed(UnitTypes.ROBOTICS_FACILITY) > 0 && !RobosActive() && (Minerals() < 350 || Gas() < 150) && (Count(UnitTypes.IMMORTAL) < 2 || Count(UnitTypes.STALKER) >= 7))
         {
             return;
         }
         if (Completed(UnitTypes.CYBERNETICS_CORE) > 0 &&
             Minerals() >= 125 &&
             Gas() >= 50 &&
             DefendReapers &&
             ReaperDefenseTask.Units.Count == 0)
         {
             Point2D aroundTile = SC2Util.To2D(bot.MapAnalyzer.StartLocation);
             Point2D placement  = WarpInPlacer.FindPlacement(aroundTile, UnitTypes.STALKER);
             if (placement != null)
             {
                 agent.Order(1414, placement);
             }
         }
         else if (Completed(UnitTypes.STALKER) >= 4 &&
                  Minerals() >= 100 &&
                  Bot.Main.EnemyRace == Race.Zerg &&
                  !Roach.Get().DetectedPreviously &&
                  Count(UnitTypes.ZEALOT) < Count(UnitTypes.STALKER))
         {
             Point2D aroundTile = ProxyFourGateTask.Task.GetHideLocation();
             if (aroundTile == null)
             {
                 aroundTile = SC2Util.To2D(bot.MapAnalyzer.StartLocation);
             }
             Point2D placement = WarpInPlacer.FindPlacement(aroundTile, UnitTypes.ZEALOT);
             if (placement != null)
             {
                 agent.Order(1413, placement);
             }
         }
         else if (Completed(UnitTypes.CYBERNETICS_CORE) > 0 &&
                  Minerals() >= 125 &&
                  Gas() >= 50)
         {
             Point2D aroundTile = ProxyFourGateTask.Task.GetHideLocation();
             if (aroundTile == null)
             {
                 aroundTile = SC2Util.To2D(bot.MapAnalyzer.StartLocation);
             }
             Point2D placement = WarpInPlacer.FindPlacement(aroundTile, UnitTypes.STALKER);
             if (placement != null)
             {
                 agent.Order(1414, placement);
             }
         }
     }
     else if (agent.Unit.UnitType == UnitTypes.ROBOTICS_FACILITY)
     {
         if (Count(UnitTypes.OBSERVER) == 0 &&
             Minerals() >= 25 &&
             Gas() >= 75 &&
             FoodLeft() >= 1)
         {
             agent.Order(977);
         }
         else if (Minerals() >= 275 &&
                  Gas() >= 100 &&
                  FoodLeft() >= 4)
         {
             agent.Order(979);
         }
     }
 }
Ejemplo n.º 7
0
        public Fish GetFishByStr()
        {
            Fish fish  = null;
            var  regex = new Regex(@".*(?=:)");

            var fishName = regex.Match(LoadStr);
            var name     = fishName.Value;

            regex = new Regex(@"\d+");

            var matches = regex.Matches(LoadStr);
            var sizeCf  = Convert.ToSingle(matches[0].Value) / 100;
            var minDeep = Convert.ToInt32(matches[1].Value);
            var maxDeep = Convert.ToInt32(matches[2].Value);

            regex = new Regex(@"(?<=\[).*(?=\])");

            var match     = regex.Match(LoadStr);
            var luresList = match.Value;

            var lures = luresList.Split(',');

            HashSet <FishBait> baits = new HashSet <FishBait>();

            foreach (var s in lures)
            {
                baits.Add(FishBait.GetFishBaitByName(s));
            }
            switch (name)
            {
            case "Щука":
                fish = new Pike(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Арктич. Голец":
                fish = new ArcticChar(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Жерех":
                fish = new Asp(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Лещ":
                fish = new Bream(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Налим":
                fish = new Burbot(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Голавль":
                fish = new Chub(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Карась Зол":
                fish = new GoldCarp(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Карась Сер":
                fish = new SilverCarp(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Хариус":
                fish = new Grayling(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Окунь":
                fish = new Perch(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Горбуша":
                fish = new PinkSalmon(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Плотва":
                fish = new Roach(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Рыбец":
                fish = new Rybets(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Сёмга":
                fish = new Salmon(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Подлещик":
                fish = new Scavenger(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Змееголов":
                fish = new SnakeHead(minDeep, maxDeep, sizeCf, baits);
                break;

            case "Линь":
                fish = new Tench(minDeep, maxDeep, sizeCf, baits);
                break;
            }
            return(fish);
        }