Пример #1
0
 public void ConditionCheck()
 {
     if (AIB != null && AIB.hostile)
     {
         bool target = AIB.NoTarget();
         if (!target)
         {
             float d = Mathf.Abs(AIB.CalculateTarget());
             if (d < extendDist)
             {
                 if (jumpex && d < 4)
                 {
                     EX.ExtendPercent(100);
                 }
                 else
                 {
                     EX.ExtendPercent(attackex);
                 }
             }
             else
             {
                 EX.ExtendPercent(0);
             }
         }
     }
     //else if (AIB != null) { ExtendRandom(); }
 }
Пример #2
0
        private void MoveTarget()
        {
            if (!movebreak)
            {
                movebreak = true;
            }
            if (AIB == null)
            {
                return;
            }
            float d = AIB.CalculateTarget();

            if (d > 0)
            {
                mm = (1 / (float)dlegs) * LG.Count - half;
            }
            else
            {
                mm = -((1 / (float)dlegs) * LG.Count - half);
            }
            if (Mathf.Abs(d) < stoprange)
            {
                mm = 0;
            }
            AIB.Move(mm);
            goforward = false;
        }
Пример #3
0
        public void ConditionCheck()
        {
            if (AIB == null)
            {
                return;
            }                            //Maybe fire with no control?
            if (!AIB.hostile)
            {
                return;
            }

            float d = AIB.CalculateTarget();

            if (d == 0)
            {
                return;
            }                       //Is hostile but no target in sight.

            if (Mathf.Abs(d) < Mathf.Abs(attackdistance))
            {
                Execute();
            }
        }