50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class Icicle : ModProjectile
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 10;
|
|
projectile.height = 10;
|
|
projectile.aiStyle = 1;
|
|
aiType = ProjectileID.Bullet;
|
|
projectile.friendly = true;
|
|
projectile.magic = true;
|
|
projectile.coldDamage = true;
|
|
projectile.penetrate = 1;
|
|
}
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Icicle");
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Frostburn, 300);
|
|
}
|
|
|
|
public override Color? GetAlpha(Color lightColor)
|
|
{
|
|
return new Color(200, 200, 200, projectile.alpha);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
Main.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;
|
|
}
|
|
}
|
|
}
|
|
}
|