36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class SandBolt : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Bolt");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 10;
|
|
projectile.height = 10;
|
|
projectile.friendly = true;
|
|
projectile.penetrate = 1;
|
|
projectile.light = 1f;
|
|
projectile.timeLeft = 300;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
if (projectile.owner == Main.myPlayer)
|
|
{
|
|
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<SandMark>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
|
}
|
|
}
|
|
}
|
|
}
|