57 lines
1.8 KiB
C#
57 lines
1.8 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Melee
|
|
{
|
|
public class SandFire : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Fire");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 6;
|
|
projectile.height = 6;
|
|
projectile.friendly = true;
|
|
projectile.penetrate = 1;
|
|
projectile.tileCollide = false;
|
|
projectile.melee = true;
|
|
projectile.timeLeft = 60;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Lighting.AddLight(projectile.Center, 0.25f, 0.25f, 0f);
|
|
|
|
projectile.localAI[0] += 1f;
|
|
if (projectile.localAI[0] > 4f)
|
|
{
|
|
for (int num468 = 0; num468 < 5; num468++)
|
|
{
|
|
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 159, 0f, 0f, 100, default, 0.5f);
|
|
Main.dust[num469].noGravity = true;
|
|
Main.dust[num469].velocity *= 0f;
|
|
}
|
|
}
|
|
|
|
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 400f, 20f, 20f);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
for (int k = 0; k < 5; k++)
|
|
{
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 159, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
|
|
}
|
|
}
|
|
}
|