From 63aa210555668a1b039e7a094458e03a2dfefb8d Mon Sep 17 00:00:00 2001 From: IbanPlay <56191483+IbanPlay@users.noreply.github.com> Date: Sun, 23 Jan 2022 23:14:07 +0100 Subject: [PATCH] Bloom line particle improvement --- Particles/BloomLine.png | Bin 144 -> 165 bytes Particles/BloomLineVFX.cs | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Particles/BloomLine.png b/Particles/BloomLine.png index 08bf1d28821f74f954ad288af4f04ad7583254c4..9a464ad26e2893b1d33bad9c009b7b6349dd5d6b 100644 GIT binary patch delta 123 zcmV->0EGXL0i^+uF?3%^L_t&-m3_=h4#Xe~1ku7axh5P9t_e0|MKm8Ni>Fd=IsqF% zL`W$iBIKMgGp_5x%n*@>s=n^ye0}z)wNgq!RRM?ydhfK>*n2?-r!OyNYpqDa z%&>YR>AIKmljPQWhr2@(03b6l#y~`%sD%k?mzF(2ZQfkA3&pPz5oCK07*qo IM6N<$f@Lx*Y5)KL diff --git a/Particles/BloomLineVFX.cs b/Particles/BloomLineVFX.cs index f45fb78177..f563d2d257 100644 --- a/Particles/BloomLineVFX.cs +++ b/Particles/BloomLineVFX.cs @@ -14,17 +14,19 @@ namespace CalamityMod.Particles public override bool SetLifetime => true; public override bool Important => Telegraph; + public bool Capped; public float opacity; public Vector2 LineVector; public bool Telegraph; //Denotes if the line is used as an enemy telegraph. In that case, it'll be marked as important - public BloomLineVFX(Vector2 startPoint, Vector2 lineVector, float thickness, Color color, int lifetime, bool telegraph = false) + public BloomLineVFX(Vector2 startPoint, Vector2 lineVector, float thickness, Color color, int lifetime, bool capped = false, bool telegraph = false) { Position = startPoint; LineVector = lineVector; Scale = thickness; Color = color; Lifetime = lifetime; + Capped = capped; Telegraph = telegraph; Velocity = Vector2.Zero; Rotation = 0; @@ -36,8 +38,19 @@ namespace CalamityMod.Particles float rot = LineVector.ToRotation() + MathHelper.PiOver2; Vector2 origin = new Vector2(tex.Width/2f, tex.Height); Vector2 scale = new Vector2(Scale, LineVector.Length() / tex.Height); - spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, rot, origin, scale, SpriteEffects.None, 0); + + if (Capped) + { + Texture2D cap = ModContent.GetTexture("CalamityMod/Particles/BloomLineCap"); ; + scale = new Vector2(Scale, Scale); + origin = new Vector2(cap.Width / 2f, cap.Height); + + spriteBatch.Draw(cap, Position - Main.screenPosition, null, Color, rot + MathHelper.Pi, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(cap, Position + LineVector - Main.screenPosition, null, Color, rot, origin, scale, SpriteEffects.None, 0); + } + + } } }