56 lines
1.6 KiB
C#
56 lines
1.6 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Melee
|
|
{
|
|
public class CrystalDust : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Dust");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 46;
|
|
Projectile.height = 46;
|
|
Projectile.friendly = true;
|
|
Projectile.DamageType = DamageClass.Melee;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.tileCollide = false;
|
|
Projectile.penetrate = 3;
|
|
Projectile.timeLeft = 100;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.localAI[0] += 1f;
|
|
if (Projectile.localAI[0] > 4f)
|
|
{
|
|
int num307 = Main.rand.Next(3);
|
|
if (num307 == 0)
|
|
{
|
|
num307 = 173;
|
|
}
|
|
else if (num307 == 1)
|
|
{
|
|
num307 = 57;
|
|
}
|
|
else
|
|
{
|
|
num307 = 58;
|
|
}
|
|
for (int num468 = 0; num468 < 5; num468++)
|
|
{
|
|
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num307, 0f, 0f, 100, default, 2f);
|
|
Main.dust[num469].noGravity = true;
|
|
Main.dust[num469].velocity *= 0f;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|