public override void AI()
        {
            base.AI();
            if (projectile.ai[0] == 0)
            {
                return;                 // failsafe in case we got a bad NPC index
            }
            if (target == null)
            {
                target       = Main.npc[(int)projectile.ai[0]];
                baseVelocity = projectile.velocity.Length();
            }
            if (!target.active)
            {
                projectile.Kill();
                return;
            }
            Vector2 vectorToTarget   = target.Center - projectile.Center;
            float   distanceToTarget = vectorToTarget.Length();

            if (distanceToTarget > baseVelocity)
            {
                vectorToTarget.SafeNormalize();
                vectorToTarget *= baseVelocity;
            }
            int inertia = projectile.timeLeft > 285 ? 12 : 4;

            projectile.velocity = (projectile.velocity * (inertia - 1) + vectorToTarget) / inertia;
            blurDrawer.Update(projectile.Center);
        }
 public override void AfterMoving()
 {
     blurDrawer.Update(projectile.Center, isDashing);
     // also interpolate extra blurs while using special
     if (isDashing && usingSpecial)
     {
         AddShockwaveDust();
     }
 }
        public override void AfterMoving()
        {
            // left shift old position
            int attackFrame = animationFrame - targetStartFrame;

            blurHelper.Update(projectile.Center, targetStartFrame != default && attackFrame > windupFrames);
            if (targetStartFrame != default && (animationFrame - targetStartFrame > framesToLiveAfterAttack ||
                                                Vector2.DistanceSquared(player.Center, projectile.Center) > 1300f * 1300f))
            {
                projectile.Kill();
            }
            scHelper.UpdateDrawers(false, drawFuncs);
        }
Beispiel #4
0
 public override void AfterMoving()
 {
     if (projectile.velocity.X > 1)
     {
         projectile.spriteDirection = 1;
         projectile.rotation        = projectile.velocity.ToRotation();
     }
     else if (projectile.velocity.X < -1)
     {
         projectile.spriteDirection = -1;
         projectile.rotation        = projectile.velocity.ToRotation() + MathHelper.Pi;
     }
     // left shift old position
     blurHelper.Update(projectile.Center, isDashing);
 }
 public override void AfterMoving()
 {
     // left shift old position
     blurHelper.Update(projectile.Center, isDashing);
 }
 public override void AfterMoving()
 {
     base.AfterMoving();
     blurHelper.Update(Projectile.Center, isDashing);
 }
 public override void PostAI()
 {
     blurDrawer.Update(Projectile.Center, true);
 }
 public override void AfterMoving()
 {
     base.AfterMoving();
     blurHelper.Update(projectile.Center, usingSpecial);
 }