diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index 5d1e0507ea..7aaf2b108d 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee Tooltip.SetDefault("Using RMB will extend the Ark out in front of you. Hitting an enemy with it will parry them, granting you a small window of invulnerability\n" + "You can also parry projectiles and temporarily make them deal 160 less damage\n" + "Parrying will empower the next 10 swings of the sword, boosting their damage and letting them throw stronger projectiles\n" + - "Using RMB after parrying will let you consume all the charge at once into a strong burst of energy\n" + + "Using RMB and pressing up while the Ark is charged will release all the charges in a powerful burst of energy\n" + "A heavenly blade forged to vanquish all evil"); } @@ -58,13 +58,10 @@ namespace CalamityMod.Items.Weapons.Melee { if (player.altFunctionUse == 2) { - if (!Main.projectile.Any(n => n.active && n.owner == player.whoAmI && (n.type == ProjectileType() || n.type == ProjectileType()))) - Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, 0, player.whoAmI, 0, 0); - - else if (Charge > 0) + if (Charge > 0 && player.controlUp) { float angle = new Vector2(speedX, speedY).ToRotation(); - Projectile.NewProjectile(player.Center, Vector2.Zero, ProjectileType(), (int)(damage * Charge * 1.8f), 0, player.whoAmI, angle, 600); + Projectile.NewProjectile(player.Center + angle.ToRotationVector2() * 90f, Vector2.Zero, ProjectileType(), (int)(damage * Charge * 1.8f), 0, player.whoAmI, angle, 600); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 3) Main.LocalPlayer.Calamity().GeneralScreenShakePower = 3; @@ -72,6 +69,9 @@ namespace CalamityMod.Items.Weapons.Melee Charge = 0; } + else if (!Main.projectile.Any(n => n.active && n.owner == player.whoAmI && (n.type == ProjectileType() || n.type == ProjectileType()))) + Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, 0, player.whoAmI, 0, 0); + return false; } @@ -82,8 +82,22 @@ namespace CalamityMod.Items.Weapons.Melee if (Charge > 0) damage *= 2; Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, Combo, Charge); - Combo *= -1f; + + //Shoot an extra star projectile every upwards swing + if (Combo == -1f) + { + //Only shoot the center star if theres no charge + if (Charge == 0) + Projectile.NewProjectile(player.Center + Vector2.Normalize(new Vector2(speedX, speedY)) * 20, new Vector2(speedX, speedY), ProjectileType(), (int)(damage * 0.1f), knockBack, player.whoAmI); + + Vector2 Shift = Vector2.Normalize(new Vector2(speedX, speedY).RotatedBy(MathHelper.PiOver2)) * 30; + + Projectile.NewProjectile(player.Center + Shift, new Vector2(speedX, speedY).RotatedBy(MathHelper.PiOver4 * 0.3f) , ProjectileType(), (int)(damage * 0.1f), knockBack, player.whoAmI, Charge > 0 ? 1 : 0); + Projectile.NewProjectile(player.Center - Shift, new Vector2(speedX, speedY).RotatedBy(-MathHelper.PiOver4 * 0.3f), ProjectileType(), (int)(damage * 0.1f), knockBack, player.whoAmI, Charge > 0 ? 1 : 0); + } + + Charge--; if (Charge < 0) Charge = 0; diff --git a/Particles/CircularSmearSmokey.png b/Particles/CircularSmearSmokey.png index bbd15baf21..6a9625be64 100644 Binary files a/Particles/CircularSmearSmokey.png and b/Particles/CircularSmearSmokey.png differ diff --git a/Particles/SemiCircularSmear.png b/Particles/SemiCircularSmear.png index 1798a1e3f3..c83f01bb48 100644 Binary files a/Particles/SemiCircularSmear.png and b/Particles/SemiCircularSmear.png differ diff --git a/Particles/ThunderBolt.png b/Particles/ThunderBolt.png index cabdcfc2bc..4114b2f625 100644 Binary files a/Particles/ThunderBolt.png and b/Particles/ThunderBolt.png differ diff --git a/Particles/TrientCircularSmear.png b/Particles/TrientCircularSmear.png new file mode 100644 index 0000000000..3d0afbdb06 Binary files /dev/null and b/Particles/TrientCircularSmear.png differ diff --git a/Projectiles/Melee/AncientBeam.cs b/Projectiles/Melee/AncientBeam.cs index 4bf36b747f..a2d7c098a7 100644 --- a/Projectiles/Melee/AncientBeam.cs +++ b/Projectiles/Melee/AncientBeam.cs @@ -48,10 +48,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 46f * projectile.scale; - Vector2 start = -projectile.rotation.ToRotationVector2() * 8.5f; + float bladeLenght = 34f * projectile.scale; + Vector2 start = -Utils.SafeNormalize(projectile.velocity, Vector2.Zero) * 8.5f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center + start, projectile.Center + start + projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center + start, projectile.Center + start + Utils.SafeNormalize(projectile.velocity, Vector2.Zero) * bladeLenght, 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/AncientStar.cs b/Projectiles/Melee/AncientStar.cs new file mode 100644 index 0000000000..90ce4d8530 --- /dev/null +++ b/Projectiles/Melee/AncientStar.cs @@ -0,0 +1,135 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class AncientStar : ModProjectile + { + const float MaxTime = 120; + public float Timer => MaxTime - projectile.timeLeft; + + public ref float Shine => ref projectile.ai[0]; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Star"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.timeLeft = (int)MaxTime; + } + + public override void AI() + { + if (Timer == 0) + { + Particle spark = new CritSpark(projectile.Center, Vector2.Zero, Color.White, Color.Cyan, Main.rand.NextFloat(2.3f, 2.6f), 20, 0.1f, 1.5f, hueShift: 0.02f); + GeneralParticleHandler.SpawnParticle(spark); + + for (int i = 0; i < 4; i++) + { + Vector2 particleSpeed = projectile.velocity.RotatedByRandom(MathHelper.PiOver4 * 0.8f) * 0.1f; + Particle energyLeak = new SquishyLightParticle(projectile.Center, particleSpeed, Main.rand.NextFloat(0.8f, 1.4f), Color.Cyan, 60, 0.3f, 1.5f, hueShift: 0.02f); + GeneralParticleHandler.SpawnParticle(energyLeak); + } + } + + + if (Timer / MaxTime > 0.25f) + { + projectile.velocity *= 0.95f; + } + + int dustType = Main.rand.Next(3); + dustType = dustType == 0 ? 15 : dustType == 1 ? 57 : 58; + Dust.NewDust(projectile.Center, 14, 14, dustType, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 150, default, 1.3f); + + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 20 + Main.rand.Next(40); + if (Main.rand.NextBool(5)) + { + Main.PlaySound(SoundID.Item9, projectile.position); + } + } + + if (Main.rand.NextBool(48)) + { + int starGore = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); + Main.gore[starGore].velocity *= 0.66f; + Main.gore[starGore].velocity += projectile.velocity * 0.3f; + } + + if (projectile.velocity.Length() < 2f) + { + projectile.Kill(); + return; + } + + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; + + CalamityGlobalProjectile.HomeInOnNPC(projectile, !projectile.tileCollide, 200f, 12f, 20f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + + if (Shine == 1f) + { + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + Texture2D starTexture = ModContent.GetTexture("CalamityMod/Particles/Sparkle"); + Texture2D bloomTexture = ModContent.GetTexture("CalamityMod/Particles/BloomCircle"); + //Ajust the bloom's texture to be the same size as the star's + float properBloomSize = (float)starTexture.Height / (float)bloomTexture.Height; + + Color color = Main.hslToRgb((Main.GlobalTime * 0.6f) % 1, 1, 0.85f); + float rotation = Main.GlobalTime * 8f; + Vector2 sparkCenter = projectile.Center - Main.screenPosition; + + spriteBatch.Draw(bloomTexture, sparkCenter, null, color * 0.5f, 0, bloomTexture.Size() / 2f, 2 * properBloomSize, SpriteEffects.None, 0); + spriteBatch.Draw(starTexture, sparkCenter, null, color * 0.5f, rotation + MathHelper.PiOver4, starTexture.Size() / 2f, 1 * 0.75f, SpriteEffects.None, 0); + spriteBatch.Draw(starTexture, sparkCenter, null, Color.White, rotation, starTexture.Size() / 2f, 1, SpriteEffects.None, 0); + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } + + return false; + } + + public override void Kill(int timeLeft) + { + var breakSound = Main.PlaySound(SoundID.DD2_WitherBeastDeath, projectile.Center); + if (breakSound != null) + breakSound.Volume *= 0.5f; + + for (int i = 0; i < 5; i++) + { + Vector2 particleSpeed = Main.rand.NextVector2CircularEdge(1, 1) * Main.rand.NextFloat(5.2f, 4.3f); + Particle spark = new CritSpark(projectile.Center, particleSpeed, Color.White, Color.Cyan, Main.rand.NextFloat(1.3f, 1.6f), 40, 0.1f, 3.5f, hueShift: 0.02f); + GeneralParticleHandler.SpawnParticle(spark); + } + + for (int i = 0; i < 3; i++) + { + Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); + } + } + } +} diff --git a/Projectiles/Melee/AncientStar.png b/Projectiles/Melee/AncientStar.png new file mode 100644 index 0000000000..4b8befbc52 Binary files /dev/null and b/Projectiles/Melee/AncientStar.png differ diff --git a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs index 285d764d51..0906384abf 100644 --- a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 82f * projectile.scale; + float bladeLenght = 78f * projectile.scale; Vector2 holdPoint = DistanceFromPlayer.Length() * projectile.rotation.ToRotationVector2(); return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee var sound = Main.PlaySound(Charge > 0 ? SoundID.DD2_PhantomPhoenixShot : SoundID.DD2_MonkStaffSwing, projectile.Center); if (Charge > 0) sound.Volume *= 2.5f; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = projectile.velocity; direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/TerraBall.cs b/Projectiles/Melee/TerraBall.cs deleted file mode 100644 index 3d33d4ebf5..0000000000 --- a/Projectiles/Melee/TerraBall.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class TerraBall : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Terra Star"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 20; - projectile.height = 20; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = 1; - projectile.timeLeft = 180; - } - - public override void AI() - { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 0.8f); - Main.dust[num469].noGravity = true; - - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.NextBool(5)) - { - Main.PlaySound(SoundID.Item9, projectile.position); - } - } - - if (Main.rand.NextBool(48)) - { - int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); - Main.gore[num60].velocity *= 0.66f; - Main.gore[num60].velocity += projectile.velocity * 0.3f; - } - - projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; - - CalamityGlobalProjectile.HomeInOnNPC(projectile, !projectile.tileCollide, 200f, 12f, 20f); - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(200, 200, 200, projectile.alpha); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); - return false; - } - - public override void Kill(int timeLeft) - { - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 50; - projectile.height = 50; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1.2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 5; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1.7f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f); - Main.dust[num624].velocity *= 2f; - } - for (int num480 = 0; num480 < 3; num480++) - { - Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); - } - } - } -} diff --git a/Projectiles/Melee/TerraBall.png b/Projectiles/Melee/TerraBall.png deleted file mode 100644 index 12344049a9..0000000000 Binary files a/Projectiles/Melee/TerraBall.png and /dev/null differ diff --git a/Projectiles/Melee/TrueAncientBeam.cs b/Projectiles/Melee/TrueAncientBeam.cs index 1ef2553a57..13a0b9cb31 100644 --- a/Projectiles/Melee/TrueAncientBeam.cs +++ b/Projectiles/Melee/TrueAncientBeam.cs @@ -48,10 +48,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 54f * projectile.scale; - Vector2 start = -projectile.rotation.ToRotationVector2() * 16f; + float bladeLenght = 44f * projectile.scale; + Vector2 start = -Utils.SafeNormalize(projectile.velocity, Vector2.Zero) * 16f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center + start, projectile.Center + start + projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center + start, projectile.Center + start + Utils.SafeNormalize(projectile.velocity, Vector2.Zero) * bladeLenght, 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/TrueAncientBlast.cs b/Projectiles/Melee/TrueAncientBlast.cs index 7e5cd0d174..475c8c32c6 100644 --- a/Projectiles/Melee/TrueAncientBlast.cs +++ b/Projectiles/Melee/TrueAncientBlast.cs @@ -62,58 +62,68 @@ namespace CalamityMod.Projectiles.Melee { if (Timer == 0) { - Particle Star = new GenericSparkle(projectile.Center, Vector2.Zero, Color.White, Color.HotPink, Main.rand.NextFloat(1f, 1.5f), 20, 0.1f, 3f); + Particle Star = new GenericSparkle(projectile.Center, Vector2.Zero, Color.White, Color.HotPink, Main.rand.NextFloat(2f, 2.5f), 20, 0.1f, 3f); GeneralParticleHandler.SpawnParticle(Star); - Star = new GenericSparkle(projectile.Center + lineVector, Vector2.Zero, Color.White, Color.PaleGoldenrod, Main.rand.NextFloat(1f, 1.5f), 20, 0.1f, 3f); + Star = new GenericSparkle(projectile.Center + lineVector, Vector2.Zero, Color.White, Color.PaleGoldenrod, Main.rand.NextFloat(2f, 2.5f), 20, 0.1f, 3f); GeneralParticleHandler.SpawnParticle(Star); Main.PlaySound(SoundID.Item84, projectile.Center); } } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Color pulseColor = Main.rand.NextBool() ? (Main.rand.NextBool() ? Color.CornflowerBlue : Color.Coral) : (Main.rand.NextBool() ? Color.GreenYellow : Color.Gold); + Particle pulse = new PulseRing(target.Center, Vector2.Zero, pulseColor, 0.05f, 0.2f + Main.rand.NextFloat(0f, 1f), 30); + GeneralParticleHandler.SpawnParticle(pulse); + + for (int i = 0; i < 10; i++) + { + Vector2 particleSpeed = angle.ToRotationVector2().RotatedByRandom(MathHelper.PiOver4 * 0.8f) * Main.rand.NextFloat(2.6f, 4f); + Particle energyLeak = new SquishyLightParticle(target.Center, particleSpeed, Main.rand.NextFloat(0.3f, 0.6f), Color.Cyan, 60, 1, 1.5f, hueShift: 0.02f); + GeneralParticleHandler.SpawnParticle(energyLeak); + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D sword = GetTexture("CalamityMod/Items/Weapons/Melee/TrueArkoftheAncients"); Texture2D glowmask = GetTexture("CalamityMod/Items/Weapons/Melee/TrueArkoftheAncientsGlow"); + float displace = 10 * (1f + ((float)Math.Sin(Timer / MaxTime * MathHelper.Pi) * 0.8f)); + float drawRotation = angle + MathHelper.PiOver4; Vector2 drawOrigin = new Vector2(0f, sword.Height); - Vector2 drawOffset = Owner.Center + angle.ToRotationVector2() * 30 - Main.screenPosition; - - - spriteBatch.Draw(sword, drawOffset, null, lightColor, drawRotation, drawOrigin, projectile.scale, 0f, 0f); - spriteBatch.Draw(glowmask, drawOffset, null, Color.Lerp(lightColor, Color.White, 0.75f), drawRotation, drawOrigin, projectile.scale, 0f, 0f); - + Vector2 drawOffset = Owner.Center + angle.ToRotationVector2() * displace - Main.screenPosition; + float swordSize = 1.4f + ((float)Math.Sin(Timer / MaxTime * MathHelper.Pi) * 0.6f); + spriteBatch.Draw(sword, drawOffset, null, lightColor, drawRotation, drawOrigin, swordSize, 0f, 0f); + spriteBatch.Draw(glowmask, drawOffset, null, Color.Lerp(lightColor, Color.White, 0.75f), drawRotation, drawOrigin, swordSize, 0f, 0f); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + //Draw the laser Texture2D tex = GetTexture("CalamityMod/Particles/BloomLine"); float rot = angle + MathHelper.PiOver2; Vector2 origin = new Vector2(tex.Width / 2f, tex.Height); - float size = Timer / MaxTime > 0.5f ? (float)Math.Sin(Timer / MaxTime * MathHelper.Pi) * 0.2f + 0.8f : (float)Math.Sin(Timer / MaxTime * MathHelper.Pi); - size *= 3; - Vector2 scale = new Vector2(size, lenght / tex.Height); spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, Color.LightPink, rot, origin, scale, SpriteEffects.None, 0); - + //Cap the lines Texture2D cap = GetTexture("CalamityMod/Particles/BloomLineCap"); scale = new Vector2(size, size); origin = new Vector2(cap.Width / 2f, cap.Height); - spriteBatch.Draw(cap, projectile.Center - Main.screenPosition, null, Color.LightPink, rot + MathHelper.Pi, origin, scale, SpriteEffects.None, 0); spriteBatch.Draw(cap, projectile.Center + lineVector - Main.screenPosition, null, Color.LightPink, rot, origin, scale, SpriteEffects.None, 0); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - return false; } } diff --git a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs index b6f76112ca..33dce5e434 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 96f * projectile.scale; + float bladeLenght = 88f * projectile.scale; Vector2 holdPoint = DistanceFromPlayer.Length() * projectile.rotation.ToRotationVector2(); return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee var sound = Main.PlaySound(Charge > 0 ? SoundID.DD2_PhantomPhoenixShot : SoundID.DD2_MonkStaffSwing, projectile.Center); if (Charge > 0) sound.Volume *= 2.5f; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = projectile.velocity; direction.Normalize(); projectile.rotation = direction.ToRotation(); @@ -140,7 +140,6 @@ namespace CalamityMod.Projectiles.Melee { for (int i = 0; i < projectile.oldRot.Length; ++i) { - //Color color = projectile.GetAlpha(lightColor) * (1f - (i / (float)projectile.oldRot.Length)); Color color = Main.hslToRgb((i / (float)projectile.oldRot.Length) * 0.7f, 1, 0.6f + (Charge > 0 ? 0.3f : 0f)); float afterimageRotation = projectile.oldRot[i] + MathHelper.PiOver4; @@ -151,9 +150,22 @@ namespace CalamityMod.Projectiles.Melee spriteBatch.Draw(sword, drawOffset, null, lightColor, drawRotation, drawOrigin, projectile.scale, flip, 0f); spriteBatch.Draw(glowmask, drawOffset, null, Color.Lerp(lightColor, Color.White, 0.75f), drawRotation, drawOrigin, projectile.scale, flip, 0f); + if (Charge > 0 && Timer / MaxTime > 0.5f) + { + Texture2D smear = GetTexture("CalamityMod/Particles/TrientCircularSmear"); + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + float opacity = (float)Math.Sin(Timer / MaxTime * MathHelper.Pi); + float rotation = (-MathHelper.PiOver4 * 0.5f + MathHelper.PiOver4 * 0.5f * Timer / MaxTime) * SwingDirection; + Color smearColor = Main.hslToRgb(((Timer - MaxTime * 0.5f ) / (MaxTime * 0.5f)) * 0.7f, 1, 0.6f); + spriteBatch.Draw(smear, Owner.Center - Main.screenPosition, null, smearColor * 0.5f * opacity, projectile.velocity.ToRotation() + MathHelper.Pi + rotation, smear.Size() / 2f, projectile.scale * 1.4f, SpriteEffects.None, 0); + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } return false; }