Example #1
0
 public void AttackCommandCenter(Zergling zergling)
 {
     if (zergling.Location.X >= 330 && zergling.Location.Y >= 45 &&
         zergling.Location.X <= 470 && zergling.Location.Y <= 185)
     {
         TheCommandCenter.Health -= 4;
     }
 }
Example #2
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);
        }
Example #3
0
        public void Zergling_Can_Attack()
        {
            var zergling = new Zergling();
            var target   = new Target {
                Health = 33
            };

            zergling.Attack(target);

            Assert.AreEqual(28, target.Health);
        }
Example #4
0
        public static IEnumerable <ReportChange> Battle01_ZerglingVsMarine_BothDie()
        {
            Zergling zergling = new Zergling();
            Marine   marine   = new Marine();

            yield return(zergling.Attacks(marine));

            yield return(marine.Attacks(zergling));

            yield return(zergling.Attacks(marine));

            yield return(marine.Attacks(zergling));

            yield return(zergling.Attacks(marine));

            yield return(marine.Attacks(zergling));

            yield return(zergling.Attacks(marine));

            yield return(marine.Attacks(zergling));

            yield return(zergling.Attacks(marine));

            yield return(marine.Attacks(zergling));

            yield return(zergling.Attacks(marine)); //twice!

            yield return(zergling.Attacks(marine));

            yield return(marine.Attacks(zergling)); //marine kills zergling

            //hypothetical calculations past zergling death
            yield return(zergling.Attacks(marine));

            yield return(marine.Attacks(zergling));

            yield return(zergling.Attacks(marine)); //hypothetical zergling kills marine finally

            //yield return null;
        }
Example #5
0
 void Start()
 {
     _zergling1         = Zerging1.GetComponent <ZerglingHolder>()._zergling;
     _soundEffcetSource = Camera.main.GetComponent <AudioSource>();
 }