using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; namespace CalamityMod.Projectiles.Rogue { public class Valaricicle : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetDefaults() { Projectile.width = 10; Projectile.height = 10; Projectile.friendly = true; Projectile.DamageType = RogueDamageClass.Instance; Projectile.penetrate = 1; Projectile.timeLeft = 180; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.coldDamage = true; } public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 150 && target.CanBeChasedBy(Projectile); public override void AI() { Projectile.velocity.X *= 0.9995f; Projectile.velocity.Y += 0.01f; if (Projectile.timeLeft < 150) CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); } public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item27, Projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 67, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } } } }