Merge pull request #1404 from CalamityTeam/PlayerRelativeDrawFixes

Player Relative Draw Fixes
This commit is contained in:
CongratsIsTrash authored and GitHub committed 2026-04-30 12:46:54 -04:00
commit e51754c027
16 files changed
+50 -39

No files matched your search

+1 -1
View File
@@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Texture2D blade = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowBlade").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
Vector2 vel = Projectile.rotation.ToRotationVector2();
float randSize = Main.rand.NextFloat(0.8f, 1f);
Color drawColor = Projectile.GetAlpha(lightColor);
@@ -336,15 +336,17 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
float fade = 1;
float reformMult = Utils.GetLerpValue(1, 0, Projectile.Opacity) * 3.5f;
Texture2D tex = pullPin ? ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/DraedonsArsenal/PulseGrenade").Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/DraedonsArsenal/PulseGrenadeNoPin").Value;
Vector2 baseDrawPos = Projectile.Center - Main.screenPosition +
((!flung || catching) ? new Vector2(0, Owner.gfxOffY) : Vector2.Zero);
for (int i = 0; i < 15; i++)
{
Color auraColor = col with { A = 0 } * 0.25f * fade * fxScale;
Vector2 drawOffset = (MathHelper.TwoPi * i / 15f).ToRotationVector2() * 2 * Math.Max(fxScale, reformMult);
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + drawOffset, null, auraColor, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
Main.EntitySpriteDraw(tex, baseDrawPos + drawOffset, null, auraColor, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
}
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, lightColor * fade * Projectile.Opacity, Projectile.rotation, tex.Size() / 2f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
Main.EntitySpriteDraw(tex, baseDrawPos, null, lightColor * fade * Projectile.Opacity, Projectile.rotation, tex.Size() / 2f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/DraedonsArsenal/PulseGrenadeGlow").Value, Projectile.Center - Main.screenPosition, null, Color.White * fade * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, 1f, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/DraedonsArsenal/PulseGrenadeGlow").Value, baseDrawPos, null, Color.White * fade * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, 1f, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0);
return false;
}
public override void DrawBehind(int index, List<int> behindNPCsAndTiles, List<int> behindNPCs, List<int> behindProjectiles, List<int> overPlayers, List<int> overWiresUI)
+1 -1
View File
@@ -250,7 +250,7 @@ namespace CalamityMod.Projectiles.Magic
texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Magic/OmicronWingmanAlt").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
Color drawColor = Projectile.GetAlpha(lightColor);
float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
Vector2 rotationPoint = texture.Size() * 0.5f;
+1 -1
View File
@@ -265,7 +265,7 @@ namespace CalamityMod.Projectiles.Magic
else
texture = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/WingmanAlt").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
Color drawColor = Projectile.GetAlpha(lightColor);
float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
Vector2 rotationPoint = texture.Size() * 0.5f;
+1 -1
View File
@@ -264,7 +264,7 @@ namespace CalamityMod.Projectiles.Melee
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
Texture2D swoosh = ModContent.Request<Texture2D>("CalamityMod/Particles/VerticalSmearThin").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
Vector2 vel = Projectile.rotation.ToRotationVector2();
Color drawColor = Projectile.GetAlpha(lightColor);
float drawRotation = Projectile.rotation + ((Owner.direction == -1) ? MathHelper.Pi - MathHelper.PiOver4 : MathHelper.PiOver4);
+1 -1
View File
@@ -366,7 +366,7 @@ namespace CalamityMod.Projectiles.Melee
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
Texture2D swoosh = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmearLarge").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
Vector2 vel = Projectile.rotation.ToRotationVector2();
Color drawColor = Projectile.GetAlpha(lightColor);
float drawRotation = Projectile.rotation + ((Owner.direction == -1) ? MathHelper.Pi - MathHelper.PiOver4 : MathHelper.PiOver4);
@@ -428,15 +428,16 @@ namespace CalamityMod.Projectiles.Rogue
Color glowColor = Color.Lerp(mainColor, Color.Red, Utils.GetLerpValue(60, 18, (stealthPenaltyTimer >= 18 ? stealthPenaltyTimer : 60)));
float fade = Utils.GetLerpValue(0, 300, Projectile.timeLeft, true);
Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
Vector2 baseDrawPos = Projectile.Center - Main.screenPosition + (!flung ? new Vector2(0, Owner.gfxOffY) : Vector2.Zero);
for (int i = 0; i < 25; i++)
{
Color auraColor = glowColor with { A = 0 } * 0.35f * fade;
Vector2 drawOffset = (MathHelper.TwoPi * i / 25f).ToRotationVector2() * (hasReachedFullCharge ? 7 : 3f) * Projectile.Opacity;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + drawOffset + Main.rand.NextVector2Circular(4, 4), null, auraColor * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipVertically : SpriteEffects.None);
Main.EntitySpriteDraw(tex, baseDrawPos + drawOffset + Main.rand.NextVector2Circular(4, 4), null, auraColor * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipVertically : SpriteEffects.None);
}
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, lightColor * fade, Projectile.rotation, tex.Size() / 2f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipVertically : SpriteEffects.None, 0);
Main.EntitySpriteDraw(tex, baseDrawPos, null, lightColor * fade, Projectile.rotation, tex.Size() / 2f, Projectile.scale, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipVertically : SpriteEffects.None, 0);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/DoomsdayDeviceGlow2").Value, Projectile.Center - Main.screenPosition, null, glowColor * Projectile.Opacity * fade, Projectile.rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/DoomsdayDeviceGlow2").Value.Size() * 0.5f, 1f, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipVertically : SpriteEffects.None, 0);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/DoomsdayDeviceGlow2").Value, baseDrawPos, null, glowColor * Projectile.Opacity * fade, Projectile.rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/DoomsdayDeviceGlow2").Value.Size() * 0.5f, 1f, (!flung ? Owner.direction : Projectile.direction) != 1 ? SpriteEffects.FlipVertically : SpriteEffects.None, 0);
return false;
}
public override void DrawBehind(int index, List<int> behindNPCsAndTiles, List<int> behindNPCs, List<int> behindProjectiles, List<int> overPlayers, List<int> overWiresUI)
+2 -1
View File
@@ -696,7 +696,8 @@ namespace CalamityMod.Projectiles.Rogue
Asset<Texture2D> flashTip = BloomLine;
Asset<Texture2D> shineTip = Shine;
Vector2 generalDrawPos = Projectile.Center - Main.screenPosition + Main.rand.NextVector2Circular(rumble, rumble);
Vector2 generalDrawPos = Projectile.Center - Main.screenPosition + Main.rand.NextVector2Circular(rumble, rumble) +
((mode == gunState.NotThrown || mode == gunState.Stealth) ? new Vector2(0, Owner.gfxOffY) : Vector2.Zero);
PixelationManager.AddPixelatedDrawer((_) => // The spinnging smear when thrown
{
if (spinFx > 0.001f)
+8 -6
View File
@@ -439,6 +439,8 @@ namespace CalamityMod.Projectiles.Rogue
Asset<Texture2D> glowBottom = ModContent.Request<Texture2D>("CalamityMod/Particles/SquareRotated");
Asset<Texture2D> woosh = ModContent.Request<Texture2D>("CalamityMod/Particles/VerticalSmearLarge");
Vector2 drawAdjust = -Main.screenPosition + (!flung ? new Vector2(0, Owner.gfxOffY) : Vector2.Zero);
if (hitTiles || falling || stealth)
{
for (int i = 0; i < 25; i++)
@@ -446,7 +448,7 @@ namespace CalamityMod.Projectiles.Rogue
Vector2 drawPos = Projectile.Center;
Color auraColor = glowColor with { A = 0 } * 0.05f * glowUp;
Vector2 drawOffset = (MathHelper.TwoPi * i / 25f).ToRotationVector2() * glowUp * 2;
Main.EntitySpriteDraw(tex, drawPos - Main.screenPosition + drawOffset + Main.rand.NextVector2Circular(6, 6) * (1 - glowUp), null, auraColor with { A = 0 } * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
Main.EntitySpriteDraw(tex, drawPos + drawAdjust + drawOffset + Main.rand.NextVector2Circular(6, 6) * (1 - glowUp), null, auraColor with { A = 0 } * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
}
}
if (stealth)
@@ -458,19 +460,19 @@ namespace CalamityMod.Projectiles.Rogue
if (i == 0 && Projectile.timeLeft > 240)
{
Main.EntitySpriteDraw(woosh.Value, Projectile.Center - Main.screenPosition, null, Color.Khaki with { A = 0 } * 0.1f, fxVel.ToRotation() + Projectile.rotation + Main.GlobalTimeWrappedHourly * Projectile.direction * 27, woosh.Size() / 2f, Projectile.scale * 0.45f * throwCompletion, SpriteEffects.None, 0);
Main.EntitySpriteDraw(woosh.Value, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * 0.15f, fxVel.ToRotation() - 1.3f * Projectile.direction + Projectile.rotation + Main.GlobalTimeWrappedHourly * Projectile.direction * 27, woosh.Size() / 2f, Projectile.scale * 0.41f * throwCompletion, SpriteEffects.None, 0);
Main.EntitySpriteDraw(woosh.Value, Projectile.Center + drawAdjust, null, Color.Khaki with { A = 0 } * 0.1f, fxVel.ToRotation() + Projectile.rotation + Main.GlobalTimeWrappedHourly * Projectile.direction * 27, woosh.Size() / 2f, Projectile.scale * 0.45f * throwCompletion, SpriteEffects.None, 0);
Main.EntitySpriteDraw(woosh.Value, Projectile.Center + drawAdjust, null, mainColor with { A = 0 } * 0.15f, fxVel.ToRotation() - 1.3f * Projectile.direction + Projectile.rotation + Main.GlobalTimeWrappedHourly * Projectile.direction * 27, woosh.Size() / 2f, Projectile.scale * 0.41f * throwCompletion, SpriteEffects.None, 0);
}
for (int y = 0; y < 2; y++)
Main.EntitySpriteDraw(glowBlade.Value, fxPos - Main.screenPosition, null, (y != 0 ? Color.White : mainColor) with { A = 0 } * (0.3f * glowUp), fxVel.ToRotation() + MathHelper.PiOver2, glowBlade.Size() / 2f, new Vector2(0.4f * (y != 0 ? 0.65f : 1f), 1f * throwCompletion * glowUp * (i == 0 ? 1.5f : 1)) * Projectile.scale * 0.04f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(glowBlade.Value, fxPos + drawAdjust, null, (y != 0 ? Color.White : mainColor) with { A = 0 } * (0.3f * glowUp), fxVel.ToRotation() + MathHelper.PiOver2, glowBlade.Size() / 2f, new Vector2(0.4f * (y != 0 ? 0.65f : 1f), 1f * throwCompletion * glowUp * (i == 0 ? 1.5f : 1)) * Projectile.scale * 0.04f, SpriteEffects.None, 0);
float softGlowUp = (float)Math.Pow(glowUp, 0.15f);
for (int y = 0; y < 3; y++)
Main.EntitySpriteDraw(glowBottom.Value, fxPos - Main.screenPosition - fxVel * 0.55f, null, (y != 0 ? Color.White : mainColor) with { A = 0 } * (0.1f * glowUp), fxVel.ToRotation() + MathHelper.PiOver2, glowBottom.Size() / 2f, new Vector2(1f * (y != 0 ? 0.65f : 1f) * softGlowUp, 1.7f * throwCompletion * softGlowUp * (i == 0 ? 1.5f : 1)) * Projectile.scale * (y == 2 ? 0.3f : 0.25f), SpriteEffects.None, 0);
Main.EntitySpriteDraw(glowBottom.Value, fxPos + drawAdjust - fxVel * 0.55f, null, (y != 0 ? Color.White : mainColor) with { A = 0 } * (0.1f * glowUp), fxVel.ToRotation() + MathHelper.PiOver2, glowBottom.Size() / 2f, new Vector2(1f * (y != 0 ? 0.65f : 1f) * softGlowUp, 1.7f * throwCompletion * softGlowUp * (i == 0 ? 1.5f : 1)) * Projectile.scale * (y == 2 ? 0.3f : 0.25f), SpriteEffects.None, 0);
}
}
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.Lerp(Color.White with { A = 0 }, lightColor, (2 - glowUp)) * (inSky ? 0 : 1), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(tex, Projectile.Center + drawAdjust, null, Color.Lerp(Color.White with { A = 0 }, lightColor, (2 - glowUp)) * (inSky ? 0 : 1), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
+1 -1
View File
@@ -384,7 +384,7 @@ namespace CalamityMod.Projectiles.Rogue
Vector2 grenadePos = Owner.GetFrontHandPosition(Player.CompositeArmStretchAmount.Full, grenadeRot) + new Vector2(Owner.direction == 1 ? 5 : 5, Owner.direction == 1 ? -38 : 22).RotatedBy(grenadeRot);
drawPosition = grenadePos - Main.screenPosition;
drawPosition = grenadePos - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
drawRotation = grenadeRot + (Owner.direction == 1 ? MathHelper.ToRadians(180) : 0);
}
+1 -1
View File
@@ -352,7 +352,7 @@ namespace CalamityMod.Projectiles.Rogue
Vector2 grenadePos = Owner.GetFrontHandPosition(Player.CompositeArmStretchAmount.Full, grenadeRot) + new Vector2(Owner.direction == 1 ? 5 : 5, Owner.direction == 1 ? -38 : 22).RotatedBy(grenadeRot);
drawPosition = grenadePos - Main.screenPosition;
drawPosition = grenadePos - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
drawRotation = grenadeRot + (Owner.direction == 1 ? MathHelper.ToRadians(180) : 0);
}
+1 -1
View File
@@ -269,7 +269,7 @@ namespace CalamityMod.Projectiles.Rogue
}
public override bool PreDraw(ref Color lightColor)
{
Vector2 drawPos = Projectile.Center - Main.screenPosition;
Vector2 drawPos = Projectile.Center - Main.screenPosition + (!spinning ? new Vector2(0, Owner.gfxOffY) : Vector2.Zero);
Asset<Texture2D> tex = ModContent.Request<Texture2D>(Texture);
Main.EntitySpriteDraw(tex.Value, drawPos, null, spinning ? Color.White : Color.Lerp(lightColor, Color.White, Utils.GetLerpValue(0, ChargeupTime, time, true)), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, Projectile.spriteDirection > 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
+6 -5
View File
@@ -90,19 +90,20 @@ namespace CalamityMod.Projectiles.Typeless
Texture2D b2Texture = ModContent.Request<Texture2D>("CalamityMod/Particles/Light").Value;
Color drawColor = bColor;
float deathLerp = (float)Math.Pow(Utils.GetLerpValue(10, 300, Projectile.timeLeft), 2);
Vector2 baseDrawPos = Owner.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
float bScale2 = 0.95f;
Main.EntitySpriteDraw(bTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * deathLerp, 0, bTexture.Size() * 0.5f, (bScale2 * rot2 * Projectile.scale * deathLerp) + 2.5f * (fullChargeMult - 1), SpriteEffects.None, 0);
Main.EntitySpriteDraw(bTexture, baseDrawPos, null, drawColor with { A = 0 } * deathLerp, 0, bTexture.Size() * 0.5f, (bScale2 * rot2 * Projectile.scale * deathLerp) + 2.5f * (fullChargeMult - 1), SpriteEffects.None, 0);
Main.EntitySpriteDraw(b2Texture, Owner.Center - Main.screenPosition, null, new Color(30, 30, 30) * deathLerp, Main.rand.NextFloat(-2, 2), b2Texture.Size() * 0.5f, bScale2 * Projectile.scale * deathLerp * 1.2f * rot2, SpriteEffects.None, 0);
Main.EntitySpriteDraw(b2Texture, Owner.Center - Main.screenPosition, null, Color.Black * deathLerp, Main.rand.NextFloat(-2, 2), b2Texture.Size() * 0.5f, bScale2 * Projectile.scale * deathLerp * 0.8f * rot2, SpriteEffects.None, 0);
Main.EntitySpriteDraw(b2Texture, baseDrawPos, null, new Color(30, 30, 30) * deathLerp, Main.rand.NextFloat(-2, 2), b2Texture.Size() * 0.5f, bScale2 * Projectile.scale * deathLerp * 1.2f * rot2, SpriteEffects.None, 0);
Main.EntitySpriteDraw(b2Texture, baseDrawPos, null, Color.Black * deathLerp, Main.rand.NextFloat(-2, 2), b2Texture.Size() * 0.5f, bScale2 * Projectile.scale * deathLerp * 0.8f * rot2, SpriteEffects.None, 0);
for (int i = 0; i < 2; i++)
{
float subsine = rot2;
float rot = (MathHelper.TwoPi * i / 3f) + Main.GlobalTimeWrappedHourly;
Main.EntitySpriteDraw(vTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * 0.08f * deathLerp, rot + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.96f) * 0.16f * deathLerp * fullChargeMult, SpriteEffects.None, 0);
Main.EntitySpriteDraw(vTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 } * 0.08f * deathLerp, rot * 2 + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.96f) * 0.157f * deathLerp * fullChargeMult, SpriteEffects.None, 0);
Main.EntitySpriteDraw(vTexture, baseDrawPos, null, drawColor with { A = 0 } * 0.08f * deathLerp, rot + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.96f) * 0.16f * deathLerp * fullChargeMult, SpriteEffects.None, 0);
Main.EntitySpriteDraw(vTexture, baseDrawPos, null, drawColor with { A = 0 } * 0.08f * deathLerp, rot * 2 + MathHelper.ToRadians(-105), vTexture.Size() * 0.5f, new Vector2(1f, 0.96f) * 0.157f * deathLerp * fullChargeMult, SpriteEffects.None, 0);
}
return false;
}
+6 -3
View File
@@ -269,22 +269,25 @@ namespace CalamityMod.Projectiles.Typeless
Rectangle frame = orbTexture.Frame(1, 16, 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
Vector2 baseDrawPos = Projectile.Center - Main.screenPosition +
(poweredTimer != 0 ? new Vector2(0, Owner.gfxOffY) : Vector2.Zero);
if (powered)
{
Color auraColor = cl1 with { A = 0 } * poweredLerp * visualMult;
for (int i = 0; i < 2; i++)
{
float bScale2 = 0.25f;
Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition, null, cl2 with { A = 0 } * Utils.GetLerpValue(poweredTimerMax, 180, poweredTimer, true) * visualMult, Projectile.rotation, bTexture.Size() * 0.5f, Vector2.Lerp(new Vector2(0.6f, 1.4f), Vector2.One, MathHelper.Min(Utils.GetLerpValue(8, 15, Projectile.frame, true), Utils.GetLerpValue(8, 0, Projectile.frame, true))) * bScale2 * Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(bTexture, baseDrawPos, null, cl2 with { A = 0 } * Utils.GetLerpValue(poweredTimerMax, 180, poweredTimer, true) * visualMult, Projectile.rotation, bTexture.Size() * 0.5f, Vector2.Lerp(new Vector2(0.6f, 1.4f), Vector2.One, MathHelper.Min(Utils.GetLerpValue(8, 15, Projectile.frame, true), Utils.GetLerpValue(8, 0, Projectile.frame, true))) * bScale2 * Projectile.scale, SpriteEffects.None, 0);
}
}
Main.EntitySpriteDraw(orbTexture, Projectile.Center - Main.screenPosition, frame, Color.White * visualMult, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(orbTexture, baseDrawPos, frame, Color.White * visualMult, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
for (int i = 0; i < 10; i++)
{
Color auraColor = cl1 with { A = 0 } * (powered ? (float)Math.Pow(Utils.GetLerpValue(poweredTimerMax, 20, poweredTimer, true), 3) : sine) * 0.6f * visualMult;
Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * 4;
Main.EntitySpriteDraw(orbTexture, Projectile.Center - Main.screenPosition + drawOffset, frame, auraColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None);
Main.EntitySpriteDraw(orbTexture, baseDrawPos + drawOffset, frame, auraColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None);
}
return false;
}
+4 -3
View File
@@ -74,15 +74,16 @@ namespace CalamityMod.Projectiles.Typeless
Texture2D rTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/ShatteredExplosion").Value;
Texture2D bTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Color drawColor = bColor;
Vector2 baseDrawPos = Owner.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY);
for (int i = 0; i < 5; i++)
{
float bScale2 = 0.75f;
Main.EntitySpriteDraw(bTexture, Owner.Center - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, i * 0.15f) with { A = 0 }, 0, bTexture.Size() * 0.5f, (bScale2 - i * 0.15f) * rot2 * Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(bTexture, baseDrawPos, null, Color.Lerp(drawColor, Color.White, i * 0.15f) with { A = 0 }, 0, bTexture.Size() * 0.5f, (bScale2 - i * 0.15f) * rot2 * Projectile.scale, SpriteEffects.None, 0);
}
Main.EntitySpriteDraw(rTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 }, Main.rand.NextFloat(-2, 2), rTexture.Size() * 0.5f, 0.03f * rot2 * Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(rTexture, Owner.Center - Main.screenPosition, null, drawColor with { A = 0 }, Main.rand.NextFloat(-2, 2), rTexture.Size() * 0.5f, 0.04f * rot2 * Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(rTexture, baseDrawPos, null, drawColor with { A = 0 }, Main.rand.NextFloat(-2, 2), rTexture.Size() * 0.5f, 0.03f * rot2 * Projectile.scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(rTexture, baseDrawPos, null, drawColor with { A = 0 }, Main.rand.NextFloat(-2, 2), rTexture.Size() * 0.5f, 0.04f * rot2 * Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override bool? CanDamage() => false;
+7 -7
View File
@@ -292,27 +292,27 @@ namespace CalamityMod.Projectiles.Typeless
Vector2 scale = new Vector2(width, height * spawnFadePow) * 0.12f * Projectile.scale;
Vector2 scaleBack = new Vector2(width * 1.5f, height * 0.7f * spawnFadePow) * 0.07f * Projectile.scale;
Vector2 baseDrawPos = -Main.screenPosition + new Vector2(0, Owner.gfxOffY);
if (dashfx > 0)
{
for (int i = 0; i < 4; i++)
{
Main.EntitySpriteDraw(glow, expectedWingPosition1 - Main.screenPosition, null, (i < 2 ? Color.White : drawColor) with { A = 0 } * 0.65f, Projectile.rotation + (i % 2 == 0 ? MathHelper.PiOver2 : 0) + MathHelper.PiOver4, glow.Size() * 0.5f, new Vector2(0.2f, 1.2f) * (i < 2 ? 0.7f : 1) * Projectile.scale * (Main.rand.NextFloat(0.25f, 0.35f) + 0.02f * wingNum) * (float)Math.Pow(dashfx, 7), SpriteEffects.None, 0);
Main.EntitySpriteDraw(glow, expectedWingPosition2 - Main.screenPosition, null, (i < 2 ? Color.White : drawColor) with { A = 0 } * 0.65f, backWingRot + (i % 2 == 0 ? MathHelper.PiOver2 : 0) + MathHelper.PiOver4, glow.Size() * 0.5f, new Vector2(0.2f, 1.2f) * (i < 2 ? 0.3f : 0.6f) * Projectile.scale * (Main.rand.NextFloat(0.25f, 0.35f) + 0.02f * wingNum) * (float)Math.Pow(dashfx, 7), SpriteEffects.None, 0);
Main.EntitySpriteDraw(glow, expectedWingPosition1 + baseDrawPos, null, (i < 2 ? Color.White : drawColor) with { A = 0 } * 0.65f, Projectile.rotation + (i % 2 == 0 ? MathHelper.PiOver2 : 0) + MathHelper.PiOver4, glow.Size() * 0.5f, new Vector2(0.2f, 1.2f) * (i < 2 ? 0.7f : 1) * Projectile.scale * (Main.rand.NextFloat(0.25f, 0.35f) + 0.02f * wingNum) * (float)Math.Pow(dashfx, 7), SpriteEffects.None, 0);
Main.EntitySpriteDraw(glow, expectedWingPosition2 + baseDrawPos, null, (i < 2 ? Color.White : drawColor) with { A = 0 } * 0.65f, backWingRot + (i % 2 == 0 ? MathHelper.PiOver2 : 0) + MathHelper.PiOver4, glow.Size() * 0.5f, new Vector2(0.2f, 1.2f) * (i < 2 ? 0.3f : 0.6f) * Projectile.scale * (Main.rand.NextFloat(0.25f, 0.35f) + 0.02f * wingNum) * (float)Math.Pow(dashfx, 7), SpriteEffects.None, 0);
}
int draws = 12;
for (int i = 0; i < draws; i++)
{
Vector2 addedPos = ((MathHelper.TwoPi * i / draws).ToRotationVector2() * 2.5f + Main.rand.NextVector2Circular(2, 2)) * dashfx;
Main.EntitySpriteDraw(tex, expectedWingPosition1 - Main.screenPosition + addedPos, null, drawColor with { A = 0 } * spawnFadePow * 0.3f * dashfx, Projectile.rotation, new Vector2(tex.Width * 0.5f, 0), scale, lastDir == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
Main.EntitySpriteDraw(tex, expectedWingPosition1 + baseDrawPos + addedPos, null, drawColor with { A = 0 } * spawnFadePow * 0.3f * dashfx, Projectile.rotation, new Vector2(tex.Width * 0.5f, 0), scale, lastDir == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
Main.EntitySpriteDraw(tex, expectedWingPosition2 - Main.screenPosition + addedPos, null, drawColor with { A = 0 } * spawnFadePow * 0.3f * dashfx, backWingRot, new Vector2(tex.Width * 0.5f, 0), scaleBack, lastDir == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
Main.EntitySpriteDraw(tex, expectedWingPosition2 + baseDrawPos + addedPos, null, drawColor with { A = 0 } * spawnFadePow * 0.3f * dashfx, backWingRot, new Vector2(tex.Width * 0.5f, 0), scaleBack, lastDir == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
}
}
Main.EntitySpriteDraw(tex, expectedWingPosition1 - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, dashfx) with { A = 0 } * spawnFadePow * MathHelper.Lerp(1, 0.6f, dashfx), Projectile.rotation, new Vector2(tex.Width * 0.5f, 0), scale, lastDir == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
Main.EntitySpriteDraw(tex, expectedWingPosition1 + baseDrawPos, null, Color.Lerp(drawColor, Color.White, dashfx) with { A = 0 } * spawnFadePow * MathHelper.Lerp(1, 0.6f, dashfx), Projectile.rotation, new Vector2(tex.Width * 0.5f, 0), scale, lastDir == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
Main.EntitySpriteDraw(tex, expectedWingPosition2 - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, dashfx) with { A = 0 } * spawnFadePow * MathHelper.Lerp(1, 0.6f, dashfx), backWingRot, new Vector2(tex.Width * 0.5f, 0), scaleBack, lastDir == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
Main.EntitySpriteDraw(tex, expectedWingPosition2 + baseDrawPos, null, Color.Lerp(drawColor, Color.White, dashfx) with { A = 0 } * spawnFadePow * MathHelper.Lerp(1, 0.6f, dashfx), backWingRot, new Vector2(tex.Width * 0.5f, 0), scaleBack, lastDir == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
return false;
}
public int checkActiveWings()