Exemple #1
0
 public override void Update()
 {
     Time--;
     if (Time == 0)
     {
         for (int k = 0; k < 16; k++)
         {
             float  rot    = MathHelper.TwoPi * k / 16f;
             Bullet bullet = new BulletFire(Position, 8f * rot.ToRotationVector2());
             BlushieBoss.AddBullet(bullet, BombDamageMult);
         }
     }
     if (Time < 0)
     {
         Time2--;
     }
     if (Time2 == 0)
     {
         for (int k = 0; k < 16; k++)
         {
             float  rot    = MathHelper.TwoPi * (k + 0.5f) / 16f;
             Bullet bullet = new BulletFire(Position, 8f * rot.ToRotationVector2());
             BlushieBoss.AddBullet(bullet, BombDamageMult);
         }
     }
     for (int k = 0; k < 1; k++)
     {
         int dust = Dust.NewDust(Position - new Vector2(Size), 64, 64, 6, 0f, 0f, 0, default(Color), 4f);
         Main.dust[dust].noGravity = true;
         Main.dust[dust].velocity *= 2f;
     }
 }
        public override void Update()
        {
            Vector2 oldVel = Velocity;

            base.Update();
            if (NumBounces >= 0 && oldVel != Velocity)
            {
                float rot   = Velocity.ToRotation();
                float speed = Velocity.Length();
                float newRot1;
                float newRot2;
                if (rot < -MathHelper.PiOver2)
                {
                    newRot1 = (rot - MathHelper.Pi) / 2f;
                    newRot2 = (rot - MathHelper.PiOver2) / 2f;
                }
                else if (rot < 0f)
                {
                    newRot1 = (rot - MathHelper.PiOver2) / 2f;
                    newRot2 = rot / 2f;
                }
                else if (rot < MathHelper.PiOver2)
                {
                    newRot1 = rot / 2f;
                    newRot2 = (rot + MathHelper.PiOver2) / 2f;
                }
                else
                {
                    newRot1 = (rot + MathHelper.PiOver2) / 2f;
                    newRot2 = (rot + MathHelper.Pi) / 2f;
                }
                var bullet = new BulletLightning(Position, speed * newRot1.ToRotationVector2());
                bullet.NumBounces = NumBounces;
                bullet.Damage     = Damage;
                BlushieBoss.AddBullet(bullet);
                bullet            = new BulletLightning(Position, speed * newRot2.ToRotationVector2());
                bullet.NumBounces = NumBounces;
                bullet.Damage     = Damage;
                BlushieBoss.AddBullet(bullet);
            }
            if (Main.rand.Next(20) == 0)
            {
                int dust = Dust.NewDust(Position - new Vector2(Size), 32, 32, Bluemagic.Instance.DustType("PurpleLightning"), 0f, 0f, 100, default(Color), 1f);
                Main.dust[dust].velocity *= 0.5f;
                Main.dust[dust].velocity += Velocity;
                Main.dust[dust].position += Velocity;
                Main.dust[dust].noGravity = true;
                Main.dust[dust].noLight   = true;
            }
        }
Exemple #3
0
 public override void Update()
 {
     if (this.Position.Y >= this.Threshold)
     {
         this.Timer--;
         if (this.ShouldRemove())
         {
             for (int k = 0; k < 4; k++)
             {
                 float  rot    = MathHelper.TwoPi * (k + 0.5f) / 4f;
                 Bullet bullet = BulletSimple.NewDragon(this.Position, this.Speed * rot.ToRotationVector2());
                 BlushieBoss.AddBullet(bullet, this.Damage);
             }
         }
     }
     else
     {
         this.Position.Y += this.Speed;
     }
 }