public void AdditiveCall(SpriteBatch spriteBatch) { Texture2D Bloom = mod.GetTexture("Effects/Masks/CircleGradient"); Color color = BloomColor; float bloomopacity = 0.75f; float bloomscale = 0.4f; float starScale = 15f; if (Timer > 15 && Timer < 45) { color = Color.Lerp(color, Color.White, 0.75f * ScaleProgress()); bloomopacity = MathHelper.Lerp(bloomopacity, 2f, ScaleProgress()); bloomscale = MathHelper.Lerp(bloomscale, 0.25f, ScaleProgress()); starScale = MathHelper.Lerp(starScale, 7f, ScaleProgress()); } if (LastStar >= 0) { Projectile laststar = Main.projectile[(int)LastStar]; if (laststar.active && laststar.type == projectile.type && laststar.ai[0] == projectile.ai[0] + 1 && laststar.owner == projectile.owner) { Texture2D Beam = mod.GetTexture("Textures/Trails/Trail_4"); Vector2 scale = new Vector2(projectile.Distance(laststar.Center) / Beam.Width, projectile.scale * 30 / Beam.Height); float opacity = 0.8f * projectile.Opacity * laststar.Opacity; Vector2 origin = new Vector2(0, Beam.Height / 2); spriteBatch.Draw(Beam, projectile.Center - Main.screenPosition, null, Color.Lerp(Color.White, color, 0.75f) * opacity, projectile.AngleTo(laststar.Center), origin, scale, SpriteEffects.None, 0); } } int bloomstodraw = 3; for (int i = 0; i < bloomstodraw; i++) { float progress = i / (float)bloomstodraw; spriteBatch.Draw(Bloom, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(color * bloomopacity) * MathHelper.Lerp(1f, 0.5f, 1 - progress), 0, Bloom.Size() / 2, projectile.scale * bloomscale * MathHelper.Lerp(0.75f, 1.2f, progress), SpriteEffects.None, 0); } StarPrimitive star = new StarPrimitive { Color = Color.White * projectile.Opacity, TriangleHeight = starScale * projectile.scale, TriangleWidth = starScale * projectile.scale * 0.3f, Position = projectile.Center - Main.screenPosition, Rotation = projectile.rotation }; PrimitiveRenderer.DrawPrimitiveShape(star); }
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { StarPrimitive star = new StarPrimitive { Color = Color.White, TriangleHeight = 12 * projectile.scale, TriangleWidth = 4 * projectile.scale, Position = projectile.Center - Main.screenPosition, Rotation = projectile.rotation }; PrimitiveRenderer.DrawPrimitiveShape(star); return(false); }
public void AdditiveCall(SpriteBatch sB) { StarPrimitive star = new StarPrimitive { Color = Color.White * projectile.Opacity, TriangleHeight = 12 * projectile.scale, TriangleWidth = 4 * projectile.scale, Position = projectile.Center - Main.screenPosition, Rotation = projectile.rotation }; PrimitiveRenderer.DrawPrimitiveShape(star); Texture2D bloom = mod.GetTexture("Effects/Masks/CircleGradient"); sB.Draw(bloom, projectile.Center - Main.screenPosition, null, Color.Goldenrod * 0.8f * projectile.Opacity, 0, bloom.Size() / 2, 0.25f * projectile.scale, SpriteEffects.None, 0); sB.Draw(bloom, projectile.Center - Main.screenPosition, null, Color.Goldenrod * projectile.Opacity, 0, bloom.Size() / 2, 0.2f * projectile.scale, SpriteEffects.None, 0); Texture2D beam = mod.GetTexture("Textures/Ray"); float beamProgress = (float)Math.Pow(Timer / (float)CHANNELTIME, 2); float opacity = MathHelper.Lerp(0.5f, 1f, beamProgress) * projectile.Opacity; for (int i = 0; i < 5; i++) { float angle = TargetAngle + (MathHelper.TwoPi * (i / 5f)) - MathHelper.PiOver2; float length = MathHelper.Lerp(30, 150, beamProgress); Vector2 scale = new Vector2(projectile.scale, length / beam.Height); sB.Draw(beam, projectile.Center - Main.screenPosition, null, Color.Goldenrod * opacity, angle, new Vector2(beam.Width / 2, 0), scale, SpriteEffects.None, 0); } for (int i = 0; i < 5; i++) { float angle = TargetAngle + (MathHelper.TwoPi * ((i + 0.5f) / 5f)) - MathHelper.PiOver2; float length = MathHelper.Lerp(15, 100, beamProgress); Vector2 scale = new Vector2(projectile.scale, length / beam.Height); sB.Draw(beam, projectile.Center - Main.screenPosition, null, Color.Goldenrod * opacity, angle, new Vector2(beam.Width / 2, 0), scale, SpriteEffects.None, 0); } }