using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal { public class TrackingDiskLaser : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Misc"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public float Time { get => Projectile.localAI[0]; set => Projectile.localAI[0] = value; } public override void SetDefaults() { Projectile.width = 2; Projectile.height = 2; Projectile.friendly = true; Projectile.DamageType = RogueDamageClass.Instance; Projectile.tileCollide = false; Projectile.penetrate = 1; Projectile.extraUpdates = 100; Projectile.timeLeft = 600; } public override void AI() { Lighting.AddLight(Projectile.Center, 0.2f, 0.1f, 0f); Time++; if (Time >= 10f) { for (int i = 0; i < 2; i++) { Dust dust = Dust.NewDustDirect(Projectile.Center, 0, 0, 182, 0f, 0f, 160, default, 2f); dust.position = Projectile.Center; dust.velocity = Projectile.velocity; dust.scale = Projectile.scale; dust.noGravity = true; } } } public override void Kill(int timeLeft) { Projectile.ExpandHitboxBy(60); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.Damage(); } } }