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
 public bool EnemyInRange(Point location, NanoBotInfo enemyInfo, int defenseDistance)
 {
     if (null == enemyInfo)
         return false;
     if (GetDistance(location, enemyInfo.Location) <= defenseDistance)
         return true;
     return false;
 }
Exemple #3
0
 public NanoAttackerEventArgs(NanoBotInfo enemy, bool alive)
 {
     enemyInfo = enemy;
     enemyAlive = alive;
 }