48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using CalamityMod.Buffs.StatDebuffs;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.Audio;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class ChronoIcicleSmall : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Magic";
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 12;
|
|
Projectile.height = 12;
|
|
Projectile.aiStyle = ProjAIStyleID.Arrow;
|
|
Projectile.coldDamage = true;
|
|
Projectile.friendly = true;
|
|
Projectile.penetrate = 1;
|
|
Projectile.DamageType = DamageClass.Magic;
|
|
Projectile.coldDamage = true;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.velocity.Y += 0.05f;
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
|
{
|
|
SoundEngine.PlaySound(SoundID.Item27 with { Volume = SoundID.Item12.Volume * 0.7f }, Projectile.position);
|
|
target.AddBuff(ModContent.BuffType<TimeDistortion>(), 30);
|
|
}
|
|
|
|
public override void OnKill(int timeLeft)
|
|
{
|
|
for (int index1 = 0; index1 < 3; ++index1)
|
|
{
|
|
int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Snow);
|
|
Main.dust[index2].noGravity = true;
|
|
Main.dust[index2].noLight = true;
|
|
Main.dust[index2].scale = 0.7f;
|
|
}
|
|
}
|
|
}
|
|
}
|