38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Melee
|
|
{
|
|
public class ElementBall : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Ball");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 8;
|
|
Projectile.height = 8;
|
|
Projectile.friendly = true;
|
|
Projectile.DamageType = DamageClass.Melee;
|
|
Projectile.penetrate = 1;
|
|
Projectile.extraUpdates = 2;
|
|
Projectile.tileCollide = false;
|
|
Projectile.timeLeft = 150;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
int num250 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 66, (float)(Projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
|
|
Main.dust[num250].noGravity = true;
|
|
Main.dust[num250].velocity *= 0f;
|
|
|
|
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f);
|
|
}
|
|
}
|
|
}
|