Exemple #1
0
        private void HandleFinishingTouch()
        {
            int         min    = int.MaxValue;
            NanoBotInfo target = null;

            foreach (NanoBotInfo bot in player.OtherNanoBotsInfo)
            {
                int jarak = HunterBot.squareDist(this.Location, bot.Location);
                if (jarak < min)
                {
                    jarak  = min;
                    target = bot;
                }
            }
            if (target != null)
            {
                this.MoveTo(Global.PF.FindWay(this.Location, target.Location).Points);
            }
            else
            {
                Point dest = new Point(this.Location.X + r.Next(-15, 15), this.Location.Y + r.Next(-15, 15));
                if (player.Tissue.IsInMap(dest.X, dest.Y) &&
                    (player.Tissue[dest.X, dest.Y].AreaType != AreaEnum.Bone) &&
                    (player.Tissue[dest.X, dest.Y].AreaType != AreaEnum.Vessel) &&
                    (player.Tissue[dest.X, dest.Y].AreaType != AreaEnum.Special))
                {
                    this.MoveTo(Global.SPF.FindWay(this.Location, dest).Points);
                    return;
                }
            }
        }
Exemple #2
0
 private void HandleEnemies()
 {
     foreach (NanoBotInfo bot in player.OtherNanoBotsInfo)
     {
         if (bot.PlayerID == 0)
         {
             if (HunterBot.squareDist(bot.Location, this.Location) <= (this.DefenseDistance * this.DefenseDistance))
             {
                 this.StopMoving();
                 this.DefendTo(bot.Location, 8);
             }
             else if (HunterBot.squareDist(bot.Location, this.Location) <= jarakKejar)
             {
                 this.StopMoving();
                 this.MoveTo(Global.PF.FindWay(this.Location, bot.Location).Points);
             }
         }
     }
 }