43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class ParticleBeamofDoom : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Doom");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 6;
|
|
Projectile.height = 6;
|
|
Projectile.friendly = true;
|
|
Projectile.DamageType = DamageClass.Magic;
|
|
Projectile.tileCollide = false;
|
|
Projectile.penetrate = -1;
|
|
Projectile.extraUpdates = 100;
|
|
Projectile.timeLeft = 100;
|
|
Projectile.usesLocalNPCImmunity = true;
|
|
Projectile.localNPCHitCooldown = 30;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.localAI[0] += 1f;
|
|
if (Projectile.localAI[0] > 9f)
|
|
{
|
|
Vector2 vector33 = Projectile.position;
|
|
vector33 -= Projectile.velocity * 0.25f;
|
|
int num448 = Dust.NewDust(vector33, 1, 1, 206, 0f, 0f, 0, default, 2.5f);
|
|
Main.dust[num448].position = vector33;
|
|
Main.dust[num448].velocity *= 0.1f;
|
|
}
|
|
}
|
|
}
|
|
}
|