using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; namespace CalamityMod.Projectiles.Magic { public class Icicle : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; public override void SetDefaults() { Projectile.width = 10; Projectile.height = 10; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.Bullet; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; Projectile.coldDamage = true; Projectile.penetrate = 1; Projectile.coldDamage = true; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); } public override Color? GetAlpha(Color lightColor) { return new Color(200, 200, 200, Projectile.alpha); } public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item27, Projectile.position); for (int index1 = 0; index1 < 5; ++index1) { int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 68, 0f, 0f, 0, new Color(), 1f); Main.dust[index2].noGravity = true; Main.dust[index2].velocity *= 1.5f; Main.dust[index2].scale *= 0.9f; } } } }