Files
CalamityModPublic/Projectiles/Ranged/FossilShard.cs
T

44 lines
1.4 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class FossilShard : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.penetrate = 1;
Projectile.aiStyle = ProjAIStyleID.Arrow;
Projectile.timeLeft = 120;
AIType = ProjectileID.WoodenArrowFriendly;
}
public override void AI()
{
if (Projectile.velocity.Y <= 0f)
Projectile.velocity.Y = 0.1f;
Projectile.rotation += Projectile.velocity.Y;
Projectile.velocity.Y *= 1.05f;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<ArmorCrunch>(), 60);
}
public override void Kill(int timeLeft)
{
for (int i = 0; i <= 2; i++)
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 32, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
}
}
}