Files
CalamityModPublic/Projectiles/Melee/ElementBall.cs
T
tomat 67bceff6e7 Initial dotnet format pass.
This commit formats the entire codebase according to `dotnet format` and its limited understanding of our provided `.editorconfig`.
2024-02-28 21:49:50 -08:00

34 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, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
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 rainbowDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.RainbowTorch, (float)(Projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
Main.dust[rainbowDust].noGravity = true;
Main.dust[rainbowDust].velocity *= 0f;
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f);
}
}
}