using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { public class ShatteredExplosion : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; bool dust = true; public override void SetDefaults() { Projectile.width = 150; Projectile.height = 150; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; Projectile.timeLeft = 15; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; Projectile.DamageType = RogueDamageClass.Instance; } public override void AI() { if (Projectile.ai[0] == 1f) { Projectile.ai[0] = 0f; dust = false; } Projectile.localAI[0] += 1f; if (dust && Projectile.localAI[0] > 4f) { for (int i = 0; i < 5; i++) { int num469 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } }