Пример #1
0
        public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            if (Timer < 120)
            {
                float     alpha = Math.Min(Timer / 20f, 1);
                Texture2D tex   = GetTexture(AssetDirectory.VitricBoss + "SpikeSource");
                spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, Color.White * alpha, 0, tex.Size() / 2, 1, 0, 0);
            }

            if (Timer > 90)
            {
                Texture2D spike = GetTexture(AssetDirectory.VitricBoss + "BossSpike");
                Texture2D glow  = GetTexture(AssetDirectory.VitricBoss + "BossSpikeGlow");

                Random rand = new Random(projectile.GetHashCode());

                Color color = VitricSummonOrb.MoltenGlow(Timer * 4 - 360);

                for (float k = 0; k < 6.28f; k += 6.28f / 12)
                {
                    float     progress = (float)Math.Sin((Timer - 90 - rand.Next(20)) / 40f * 3.14f);
                    Rectangle target   = new Rectangle((int)(projectile.Center.X - Main.screenPosition.X), (int)(projectile.Center.Y - Main.screenPosition.Y), (int)(spike.Width * (0.4f + rand.NextDouble() * 0.6f)), (int)(progress * spike.Height * (0.8f + rand.NextDouble() * 0.4f)));

                    spriteBatch.Draw(spike, target, null, lightColor, k, new Vector2(spike.Width / 2, spike.Height), 0, 0);
                    spriteBatch.Draw(glow, target, null, color, k, new Vector2(spike.Width / 2, spike.Height), 0, 0);
                }
            }
        }
        public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            int       timer   = 120 - projectile.timeLeft;
            Texture2D backTex = GetTexture(Texture);

            if (timer < 30)
            {
                Color     color = VitricSummonOrb.MoltenGlow(MathHelper.Min(timer * 4, 120));
                Texture2D tex   = GetTexture(AssetDirectory.VitricItem + "VitricSummonKnife");
                Rectangle frame = new Rectangle(tex.Width / 2, 0, tex.Width / 2, tex.Height);

                spriteBatch.Draw(backTex, projectile.oldPos[0] + projectile.Size / 2 - Main.screenPosition, null, lightColor, projectile.rotation, backTex.Size() / 2, 1, 0, 0);
                spriteBatch.Draw(tex, projectile.oldPos[0] + projectile.Size / 2 - Main.screenPosition, frame, color, projectile.rotation, frame.Size() / 2, 1, 0, 0);
                Lighting.AddLight(projectile.Center, color.ToVector3() * 0.5f);
            }
            else
            {
                for (int k = 0; k < ProjectileID.Sets.TrailCacheLength[projectile.type]; k++)
                {
                    float alpha = 1 - k / (float)ProjectileID.Sets.TrailCacheLength[projectile.type];
                    spriteBatch.Draw(backTex, projectile.oldPos[k] + projectile.Size / 2 - Main.screenPosition, null, lightColor * alpha, projectile.oldRot[k], backTex.Size() / 2, 1, 0, 0);
                }
            }

            return(false);
        }
Пример #3
0
        public void DrawAdditive(SpriteBatch spriteBatch)
        {
            Texture2D tex   = GetTexture(Texture + "Glow");
            Color     color = VitricSummonOrb.MoltenGlow(MathHelper.Min((200 - projectile.timeLeft), 120));

            spriteBatch.Draw(tex, projectile.Center + Vector2.Normalize(projectile.velocity) * -40 - Main.screenPosition, tex.Frame(),
                             color * (projectile.timeLeft / 140f), projectile.rotation + 3.14f, tex.Size() / 2, 1.8f, 0, 0);
        }
        public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            Color color = VitricSummonOrb.MoltenGlow(MathHelper.Min((600 - projectile.timeLeft), 120));

            spriteBatch.Draw(GetTexture(Texture), projectile.Center - Main.screenPosition, new Rectangle(0, 0, 32, 128), lightColor, projectile.rotation, new Vector2(16, 64), projectile.scale, 0, 0);
            spriteBatch.Draw(GetTexture(Texture), projectile.Center - Main.screenPosition, new Rectangle(0, 128, 32, 128), color, projectile.rotation, new Vector2(16, 64), projectile.scale, 0, 0);

            return(false);
        }
Пример #5
0
        public override void Kill(int timeLeft)
        {
            Color color = VitricSummonOrb.MoltenGlow(MathHelper.Min((200 - projectile.timeLeft), 120));

            for (int k = 0; k <= 10; k++)
            {
                Dust.NewDust(projectile.position, 22, 22, DustType <Dusts.GlassGravity>(), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
                Dust.NewDust(projectile.position, 22, 22, DustType <Dusts.Glow>(), 0, 0, 0, color, 0.3f);
            }
            Main.PlaySound(SoundID.Shatter, projectile.Center);
        }
Пример #6
0
        public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            if (projectile.timeLeft > 180)
            {
                return(false);
            }

            Color color = VitricSummonOrb.MoltenGlow(MathHelper.Min((200 - projectile.timeLeft), 120));

            spriteBatch.Draw(GetTexture(Texture), projectile.Center - Main.screenPosition, new Rectangle(0, 0, 22, 22), lightColor, projectile.rotation, Vector2.One * 11, projectile.scale, 0, 0);
            spriteBatch.Draw(GetTexture(Texture), projectile.Center - Main.screenPosition, new Rectangle(0, 22, 22, 22), color, projectile.rotation, Vector2.One * 11, projectile.scale, 0, 0);

            return(false);
        }
Пример #7
0
        public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            int       timer   = 130 - projectile.timeLeft;
            Texture2D backTex = GetTexture(Texture);

            spriteBatch.Draw(backTex, projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, backTex.Size() / 2, 1, 0, 0);

            if (timer < 60)
            {
                Color     color = VitricSummonOrb.MoltenGlow(MathHelper.Min(timer * 2, 120)); //TODO, clean up the file this is from later
                Texture2D tex   = GetTexture(AssetDirectory.VitricItem + "VitricSummonJavelin");
                Rectangle frame = new Rectangle(tex.Width / 2, 0, tex.Width / 2, tex.Height);

                spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, frame, color, projectile.rotation, frame.Size() / 2, 1, 0, 0);
            }

            return(false);
        }
Пример #8
0
        public void DrawAdditive(SpriteBatch spriteBatch)
        {
            Texture2D tex   = GetTexture(Texture + "Glow");
            float     alpha = projectile.timeLeft > 160 ? 1 - (projectile.timeLeft - 160) / 20f : 1;
            Color     color = VitricSummonOrb.MoltenGlow(MathHelper.Min((200 - projectile.timeLeft), 120)) * alpha;

            spriteBatch.Draw(tex, projectile.Center + Vector2.Normalize(projectile.velocity) * -40 - Main.screenPosition, tex.Frame(),
                             color * (projectile.timeLeft / 140f), projectile.rotation + 3.14f, tex.Size() / 2, 1.8f, 0, 0);

            if (projectile.timeLeft > 180)
            {
                Texture2D tex2   = GetTexture(AssetDirectory.VitricBoss + "RoarLine");
                float     alpha2 = (float)Math.Sin((projectile.timeLeft - 180) / 60f * 3.14f);
                Color     color2 = new Color(255, 180, 80) * alpha2;
                var       source = new Rectangle(0, tex2.Height / 2, tex2.Width, tex2.Height / 2);
                spriteBatch.Draw(tex2, projectile.Center - Main.screenPosition, source, color2, 0, new Vector2(tex2.Width / 2, 0), 6, 0, 0);
            }
        }
        public override void AI()
        {
            if (projectile.timeLeft > 550)
            {
                projectile.velocity *= 0.97f;
            }

            if (projectile.timeLeft < 460)
            {
                projectile.velocity *= 1.02f;
            }

            projectile.rotation = projectile.velocity.ToRotation() + 1.58f;

            Color color = VitricSummonOrb.MoltenGlow(MathHelper.Min((640 - projectile.timeLeft), 120));

            Dust d = Dust.NewDustPerfect(projectile.Center, 264, projectile.velocity * 0.5f, 0, color, 1.5f);

            d.noGravity = true;
        }
        public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            var tex   = GetTexture(Texture);
            var color = VitricSummonOrb.MoltenGlow(Timer / 3f);

            if (Timer >= 60)
            {
                spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, Color.Teal, 0, Vector2.One * 16, projectile.scale, 0, 0);
            }

            spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, color, 0, Vector2.One * 16, projectile.scale, 0, 0);

            if (Timer >= 180)
            {
                var tex2   = GetTexture(Texture + "Out");
                var color2 = VitricSummonOrb.MoltenGlow(Timer / 3f);

                spriteBatch.Draw(tex2, projectile.Center - Main.screenPosition, null, Color.Teal, projectile.rotation, new Vector2(-10, 32), 1, 0, 0);
                spriteBatch.Draw(tex2, projectile.Center - Main.screenPosition, null, color2, projectile.rotation, new Vector2(-10, 32), 1, 0, 0);
            }
        }
Пример #11
0
        public override void AI()
        {
            if (projectile.timeLeft == 180)
            {
                savedVelocity        = projectile.velocity;
                projectile.velocity *= 0;
            }

            if (projectile.timeLeft > 150)
            {
                projectile.velocity = Vector2.SmoothStep(Vector2.Zero, savedVelocity, (30 - (projectile.timeLeft - 150)) / 30f);
            }

            Color color = VitricSummonOrb.MoltenGlow(MathHelper.Min((200 - projectile.timeLeft), 120));

            for (int k = 0; k <= 1; k++)
            {
                Dust d = Dust.NewDustPerfect(projectile.Center + projectile.velocity, 264, (projectile.velocity * Main.rand.NextFloat(-0.25f, -0.1f)).RotatedBy(k == 0 ? 0.4f : -0.4f), 0, color, 1f);
                d.noGravity = true;
            }
            projectile.rotation = projectile.velocity.ToRotation() + 3.14f / 4;
        }
Пример #12
0
 public override Color?GetAlpha(Dust dust, Color lightColor)
 {
     return(VitricSummonOrb.MoltenGlow(dust.fadeIn * 3));
 }