From 383c93f321bf33a3cdbc257b03474e4af20ad080 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Thu, 14 Dec 2023 23:20:45 -0800 Subject: [PATCH] smoke trail --- Projectiles/Melee/DarkMasterBeam.cs | 5 ++--- Projectiles/Melee/DarkMasterClone.cs | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Projectiles/Melee/DarkMasterBeam.cs b/Projectiles/Melee/DarkMasterBeam.cs index 2ab3ae700f..957699be24 100644 --- a/Projectiles/Melee/DarkMasterBeam.cs +++ b/Projectiles/Melee/DarkMasterBeam.cs @@ -1,10 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; + namespace CalamityMod.Projectiles.Melee { public class DarkMasterBeam : ModProjectile, ILocalizedModType diff --git a/Projectiles/Melee/DarkMasterClone.cs b/Projectiles/Melee/DarkMasterClone.cs index bc1d893a49..410db8fd7a 100644 --- a/Projectiles/Melee/DarkMasterClone.cs +++ b/Projectiles/Melee/DarkMasterClone.cs @@ -1,16 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; -using static Humanizer.In; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using System; using Microsoft.Xna.Framework.Graphics; -using Terraria.Graphics.Shaders; namespace CalamityMod.Projectiles.Melee { @@ -51,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee break; } // if the player isn't holding the sword, DIE. - if (owner.HeldItem.type != ModContent.ItemType() || !owner.active || owner.CCed || owner == null || Projectile.type != ModContent.ProjectileType()) + if (owner.HeldItem.type != ModContent.ItemType() || !owner.active || owner.CCed || owner == null) { Projectile.Kill(); } @@ -59,8 +55,20 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 30; // move the clone to the desired position Projectile.Center = Vector2.Lerp(Projectile.Center, owner.Center + moveTo, 0.4f); + // produce smoke during initial move + if (Projectile.Distance(owner.Center + moveTo) < 16) + { + Projectile.ai[2] = 1; + } + if (Projectile.ai[2] == 0) + { + float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f); + Vector2 angleVec = angle.ToRotationVector2(); + Particle smoke = new HeavySmokeParticle(Projectile.Center, angleVec * Main.rand.NextFloat(1f, 2f), Color.Black, 30, Main.rand.NextFloat(0.25f, 1f), 0.5f, 0.1f); + GeneralParticleHandler.SpawnParticle(smoke); + } // shoot beams while the player is left clicking - if (owner.itemTime == owner.itemTimeMax && owner.altFunctionUse != 2) + if (owner.itemTime == owner.itemTimeMax && owner.altFunctionUse != 2 && owner.HeldItem.type == ModContent.ItemType()) { Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld); Projectile.direction = Math.Sign(direction.X);