70 lines
2.1 KiB
C#
70 lines
2.1 KiB
C#
using Microsoft.Xna.Framework;
|
|
using System;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class BeamingBolt2 : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Beaming Bolt");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 10;
|
|
projectile.height = 10;
|
|
projectile.friendly = true;
|
|
projectile.alpha = 255;
|
|
projectile.timeLeft = 120;
|
|
projectile.penetrate = 1;
|
|
projectile.magic = true;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
for (int dust = 0; dust < 2; dust++)
|
|
{
|
|
int randomDust = Main.rand.Next(3);
|
|
if (randomDust == 0)
|
|
{
|
|
randomDust = 164;
|
|
}
|
|
else if (randomDust == 1)
|
|
{
|
|
randomDust = 58;
|
|
}
|
|
else
|
|
{
|
|
randomDust = 204;
|
|
}
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
|
}
|
|
|
|
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 20f, 20f);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
for (int k = 0; k < 3; k++)
|
|
{
|
|
int randomDust = Main.rand.Next(3);
|
|
if (randomDust == 0)
|
|
{
|
|
randomDust = 164;
|
|
}
|
|
else if (randomDust == 1)
|
|
{
|
|
randomDust = 58;
|
|
}
|
|
else
|
|
{
|
|
randomDust = 204;
|
|
}
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
|
|
}
|
|
}
|
|
}
|
|
}
|