Exemplo n.º 1
0
        /// <summary>
        /// Returns whether the EntityAIBase should begin execution.
        /// </summary>
        public override bool ShouldExecute()
        {
            TargetEntity = TheEntity.GetAttackTarget();

            if (TargetEntity == null)
            {
                return(false);
            }

            if (TargetEntity.GetDistanceSqToEntity(TheEntity) > (double)(Field_48331_g * Field_48331_g))
            {
                return(false);
            }

            Vec3D vec3d = RandomPositionGenerator.Func_48620_a(TheEntity, 16, 7, Vec3D.CreateVector(TargetEntity.PosX, TargetEntity.PosY, TargetEntity.PosZ));

            if (vec3d == null)
            {
                return(false);
            }
            else
            {
                MovePosX = vec3d.XCoord;
                MovePosY = vec3d.YCoord;
                MovePosZ = vec3d.ZCoord;
                return(true);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns whether the EntityAIBase should begin execution.
        /// </summary>
        public override bool ShouldExecute()
        {
            LeapTarget = Leaper.GetAttackTarget();

            if (LeapTarget == null)
            {
                return(false);
            }

            double d = Leaper.GetDistanceSqToEntity(LeapTarget);

            if (d < 4D || d > 16D)
            {
                return(false);
            }

            if (!Leaper.OnGround)
            {
                return(false);
            }

            return(Leaper.GetRNG().Next(5) == 0);
        }
        /// <summary>
        /// Returns whether an in-progress EntityAIBase should continue executing
        /// </summary>
        public override bool ContinueExecuting()
        {
            EntityLiving entityliving = TaskOwner.GetAttackTarget();

            if (entityliving == null)
            {
                return(false);
            }

            if (!entityliving.IsEntityAlive())
            {
                return(false);
            }

            if (TaskOwner.GetDistanceSqToEntity(entityliving) > (double)(Field_48379_d * Field_48379_d))
            {
                return(false);
            }

            if (Field_48380_e)
            {
                if (!TaskOwner.Func_48090_aM().CanSee(entityliving))
                {
                    if (++Field_48378_g > 60)
                    {
                        return(false);
                    }
                }
                else
                {
                    Field_48378_g = 0;
                }
            }

            return(true);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Returns whether an in-progress EntityAIBase should continue executing
 /// </summary>
 public override bool ContinueExecuting()
 {
     return(!TheEntity.GetNavigator().NoPath() && TargetEntity.IsEntityAlive() && TargetEntity.GetDistanceSqToEntity(TheEntity) < (double)(Field_48331_g * Field_48331_g));
 }